s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
CalydOn has quit [Quit: Leaving]
elperdut_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nietzschette>
hey i have a quick question question
rakm has joined #ruby
mordocai has joined #ruby
<al2o3-cr>
harly: best time reading
<al2o3-cr>
?ask nietzschette
<ruboto>
nietzschette, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
hectorsq has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JanPeter is now known as Balllkenende
jottr has joined #ruby
<jericon>
In my script I'm using mysql2 to retrieve a value from MySQL. It will always be a single row returned (I'm doing SELECT TO_DAYS(now());). What I want is to get the result of that query into its own variable. What is the best way to do that?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
firstdayonthejob has quit [Ping timeout: 252 seconds]
babblebre has quit [Quit: Connection closed for inactivity]
<harly>
eam: missed your suggestion. I like that. to get it printed out as a decimal, is it best like (10.1r/100r).to_f or should I use something that doesn't involve a float?
<nietzschette>
I have a tk app and when I bind a command to a button, it appears I am limited to commands in the global scope. Is there a way to reslove the local scope in a string?
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
<al2o3-cr>
?code nietzschette
<ruboto>
nietzschette, We can't help you without your code, please post it to https://gist.github.com
DEA7TH has joined #ruby
infamos has joined #ruby
<ericwood>
huh there's Tk ruby bindings?
<al2o3-cr>
ericwood: yep
<ericwood>
I used to do so much Tkinter stuff when I started out with python, it was kinda fun!
<ericwood>
oh boy oh boy
<eam>
harly: it depends on your use case -- the thing to keep in mind is that the number base dictates which operations can and can't be performed accurately
<eam>
harly: just like 1/3 is a repeating decimal in base 10, other values are repeating (and un-expressable without loss) in base 2
RegulationD has joined #ruby
<ericwood>
oh my god ActiveState TCL
<ericwood>
now there's a phrase I haven't heard in a while :o
chibs has quit [Ping timeout: 240 seconds]
<al2o3-cr>
nietzschette: that semicolon should be a comma
ixti has quit [Quit: WeeChat 1.3]
<al2o3-cr>
*them
<ericwood>
oh my god...it works
<nietzschette>
you see the ugly portion in the string i have to name my module, my class, and a member of my class before I even get to the funtion. is there a way to reference that function directly, or provide the scope programaticly?
riotjones has joined #ruby
cdg has quit [Remote host closed the connection]
<harly>
eam: ok i get that. so if I have Rational(1.3) and I want that printed out as decimal with a precision of 3. what's the best approach? (reading through precision docs in Rational but i think that's not applicable)
<harly>
Rational(1,3) i mean.
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rickmasta has joined #ruby
RegulationD has quit [Ping timeout: 252 seconds]
Porfa has quit [Quit: Porfa]
antgel has quit [Ping timeout: 260 seconds]
Rickmasta has quit [Client Quit]
<nietzschette>
you mean, like Rational(1,3).to_f.round(3)
acke has quit [Ping timeout: 246 seconds]
<eam>
harly: probably use bigdecimal for that
<al2o3-cr>
nietzschette: interpolate the string
<harly>
nietzchette: yes i mean that. but i wonder if I should still avoid float and use something else.
Rickmasta has joined #ruby
<eam>
to_f will have the same rounding issues as the original expression
treaki has quit [Ping timeout: 250 seconds]
Rickmasta has joined #ruby
<eam>
Rational is nice if you want to represent the exact rational value
jgt1 has quit [Ping timeout: 260 seconds]
<eam>
BigDecimal will give you more precision for actually doing the division
antgel has joined #ruby
charliesome has joined #ruby
<harly>
eam. in this case i'm happy to stay in rational until i just want to represent the final answer.
riotjones has quit [Ping timeout: 252 seconds]
<eam>
you can always BigDecimal.new(some_rational)
<harly>
eam. so just trying to fish for the best way to take the final rational, say Rationa(1,3) after all the calculations, and represeent it as a string "1.333". what .to_f.round(3) does.
htmldrum has joined #ruby
<harly>
0.333 of course.
mattwildig has quit []
sankaber has joined #ruby
charliesome has quit [Client Quit]
pdoherty has joined #ruby
<eam>
>> BigDecimal.new(Rational(1,3), 3)
<ruboto>
eam # => uninitialized constant BigDecimal (NameError) ...check link for more (https://eval.in/463261)
<nietzschette>
ah yes, I remember those problems now.
<eam>
if you push your math into Rationals you know you won't encounter errors due to the rounding limits of the type -- and BigDecimal is the way to do the final high precision conversion
<harly>
although. in this case small final precision probably makes it all a bit moot
<ruboto>
havenwood # => /tmp/execpad-0034ce16b55f/source-0034ce16b55f:1:in `p': undefined method `inspect' for #<Object:0x41 ...check link for more (https://eval.in/463279)
<shevy>
now you did it
<shevy>
you broke the ruby
rgtk has joined #ruby
<havenwood>
shevy: No worries:
peterhu_ has quit [Quit: leaving]
<havenwood>
>> class << self; remove_method :inspect end; self
<bnagy>
not sure if that counts as 'good' until I hear the question :)
nateberkopec has quit [Quit: Leaving...]
hxegon has joined #ruby
<eam>
I'll cross post from their sleepy channe:
<eam>
buf = Thing.read; struct = MyFFIStruct.new FFI::MemoryPointer.from_string buf # is this the best / most efficient way to perform what in C might be read(f, &my_struct, sizeof(my_struct)) ?
rgtk has joined #ruby
elton has quit []
<eam>
al2o3-cr: yeah I'm using that
devoldmx has joined #ruby
cmoney has joined #ruby
<eam>
Thing in this case is a usb handle
Bloomer has joined #ruby
<eam>
wondering specifically about a clean string/buf -> struct path
RegulationD has quit [Ping timeout: 244 seconds]
Musashi007 has quit [Quit: Musashi007]
<bnagy>
eam: pretty much, afaik
<eam>
ok rad
<eam>
it seems to be working well
<bnagy>
you can use FFI::Pointer or MemoryPointer
<eam>
what's the difference?
<bnagy>
but if you're starting with a string that's certainly what I'd do
leafybas_ has quit [Remote host closed the connection]
<bnagy>
FFI::Pointer comes from Other Stuff eg things return em
<eam>
aha
leafybas_ has joined #ruby
freerobby has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
axsuul has joined #ruby
willardg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
babblebre has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
axsuul has quit [Max SendQ exceeded]
devoldmx has quit [Ping timeout: 260 seconds]
<al2o3-cr>
whats a pointer
axsuul has joined #ruby
moeabdol has joined #ruby
<bnagy>
I guess you could avoid the intermediate buf variable, but I probably wouldn't :)
baweaver has joined #ruby
<eam>
al2o3-cr: an integer that points to a location of memory
purplexed- has quit [Ping timeout: 250 seconds]
axsuul has quit [Max SendQ exceeded]
<al2o3-cr>
eam: ah ok
<eam>
bnagy: makes sense :)
to_json has quit [Quit: Leaving.]
axsuul has joined #ruby
<eam>
now I have a method that given a descriptor and a FFI::Struct class will read 'em off the wire
<eam>
seems to be working ok
<al2o3-cr>
int foo = 1; int_ptr = &foo; <-- ?
<eam>
yeah
rgrmatt has joined #ruby
<eam>
and then *int_ptr = 5 # changes the memory location of foo, so foo == 5
leafybas_ has quit [Ping timeout: 244 seconds]
<al2o3-cr>
so whats the difference between `*` and `&`
rgtk has joined #ruby
rbennacer has joined #ruby
<eam>
& is address-of, * is points-to
<bnagy>
direction
willardg has joined #ruby
<al2o3-cr>
ah ok :)
<al2o3-cr>
whats the difference between struct and typedef?
rgrmatt has quit [Remote host closed the connection]
roxtrong_ has joined #ruby
juanpablo__ has joined #ruby
Kero has joined #ruby
<eam>
al2o3-cr: a struct is an ordered layout of variables in memory with names, like a ruby class with no methods or a hash (but with a different layout)
<eam>
a typedef is essentially an alias
ESpiney has joined #ruby
<eam>
typedef int magic_number; magic_number foo; # foo is an int
<al2o3-cr>
eam: ok awesome
Pupeno has joined #ruby
willardg has quit [Ping timeout: 255 seconds]
rgtk has quit [Ping timeout: 260 seconds]
bryanray_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
simplyianm has quit [Remote host closed the connection]
<al2o3-cr>
c boats
Rollabunna has joined #ruby
juanpablo__ has quit [Ping timeout: 260 seconds]
simplyia_ has joined #ruby
<al2o3-cr>
so eam this is valid char *foo[] = "ksjdkj";
<eam>
just char *foo = "ksjdkj";
<eam>
in C, a double quoted string is a pointer
d34th4ck3r has quit [Quit: zzz]
Pupeno has quit [Ping timeout: 246 seconds]
axsuul has quit [Ping timeout: 244 seconds]
<eam>
in fact,this is valid C: "asdf"[2] or this: 2["asdf"] -- they're the same thing
<al2o3-cr>
eam: why though?
rgrmatt has joined #ruby
<eam>
x[y] is just shorthand for *(x + y)
maikowblue has quit [Quit: .]
swgillespie has joined #ruby
<eam>
if you have char *foo = "abcd"; and "abcd" is at memory location 1000, then it means *(1001) is the byte 'b'
<eam>
which is foo[1], or 1000 + 1
<al2o3-cr>
eam: so a char is one byte?
Rollabunna has quit [Ping timeout: 240 seconds]
<eam>
generally (not sure if always on all platforms?)
<al2o3-cr>
should be upto 64bits
<eam>
a C char isn't a unicode character
bruno- has joined #ruby
<eam>
C doesn't have a concept of character datatypes
krz has joined #ruby
bruno- is now known as Guest84504
rgrmatt has quit [Remote host closed the connection]
rgtk has joined #ruby
<eam>
wikipedia says POSIX guarantees char = 8 bits
<eam>
other platforms might differ
<al2o3-cr>
eam: kk
<eam>
most of the datatypes have a minimum size, but no max
<eam>
which is why stuff like int can grow to larger values on new architectures
<al2o3-cr>
but a double on 32bit is 4 64bit 8?
<al2o3-cr>
eam: have you tried overflowing the stack on 64bit arch?
rgtk has quit [Read error: Connection reset by peer]
<eam>
floating point is unrelated to the integer size, or pointer size
<al2o3-cr>
eam: correct
eminencehc has joined #ruby
mistermocha has joined #ruby
rgrmatt has joined #ruby
rgtk_ has quit [Ping timeout: 260 seconds]
eminencehc has quit [Ping timeout: 252 seconds]
dopamean_ has joined #ruby
bryanray has joined #ruby
newmanships has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tjbiddle has joined #ruby
rgtk has joined #ruby
<al2o3-cr>
eam: you know assembly ia32/
<al2o3-cr>
eam: you know assembly ia32/64
tjbiddle has quit [Client Quit]
nopolitica has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
favadi has joined #ruby
rgrmatt has quit [Remote host closed the connection]
dopamean_ has quit [Ping timeout: 244 seconds]
mistermocha has quit [Remote host closed the connection]
DiCablo has joined #ruby
OS-18454-1 is now known as OS-18454
rgtk has joined #ruby
kp666_ has joined #ruby
sdothum has quit [Read error: Connection reset by peer]
riotjones has joined #ruby
mistermocha has joined #ruby
<al2o3-cr>
>> "bonfire lollies all around " * 9
<ruboto>
al2o3-cr # => "bonfire lollies all around bonfire lollies all around bonfire lollies all around bonfire lollies al ...check link for more (https://eval.in/463354)
nopolitica has quit [Ping timeout: 240 seconds]
axsuul_ has joined #ruby
rabbithole has quit [Ping timeout: 240 seconds]
mistermocha has quit [Remote host closed the connection]
<al2o3-cr>
mallu: and what should be the return value?
<mallu>
[1,4,5]
<mallu>
my code is returning an empty array
krz has quit [Quit: WeeChat 1.2]
<al2o3-cr>
mallu: give me sec
Tarellel has joined #ruby
<Ropeney>
mallu, dont you want > 1?
riotjones has joined #ruby
asianMike has quit []
<Ropeney>
nvm didnt read above
<mallu>
Ropeney: Actually I wanted <= 1
<mallu>
thank you
<mallu>
that worked
<Ropeney>
:D
<mallu>
BTW if you care this would also work... just in case if you are curious def non_duplicated_values(values) values.find_all { |x| values.count(x) == 1 } end
Helheim has joined #ruby
blackmesa has joined #ruby
axsuul has joined #ruby
axsuul has quit [Max SendQ exceeded]
ebbflowgo has quit [Quit: ebbflowgo]
axsuul has joined #ruby
haraoka has joined #ruby
riotjones has quit [Ping timeout: 240 seconds]
sanjayu has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has quit [Ping timeout: 240 seconds]
nopolitica has joined #ruby
<al2o3-cr>
mallu: there's a totally better way than this but, you know
opensource_ninja has quit [Ping timeout: 252 seconds]
mistermocha has quit [Remote host closed the connection]
dionysus69 has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
hxegon has joined #ruby
al2o3-cr has joined #ruby
infamos has quit [Ping timeout: 246 seconds]
tigarcia has joined #ruby
bruno- has joined #ruby
bruno- is now known as Guest10832
NeverTired has joined #ruby
krz has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
wprice has quit [Quit: wprice]
tkuchiki has joined #ruby
c0dedead has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
drizzle has joined #ruby
neanderslob has quit [Quit: No Ping reply in 180 seconds.]
Guest10832 has quit [Ping timeout: 264 seconds]
<c0dedead>
I tried asking this in #rubyonrails but did not get a response. How do I combine an ActiveRecord_Relation and an ActiveRecord_AssociationRelation so that I end up with a single relation which holds all of data from both relations?
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
neanderslob has joined #ruby
newmanships has joined #ruby
BSab has joined #ruby
chibs has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GeissT has quit [Ping timeout: 244 seconds]
haxrbyte_ has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 240 seconds]
haxrbyte has joined #ruby
last_staff has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
c0dedead has quit [Ping timeout: 244 seconds]
moeabdol has joined #ruby
mndoci has joined #ruby
tenderlo_ has joined #ruby
mordocai has quit [Quit: sleep]
tenderlove has quit [Ping timeout: 264 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
moeabdol has quit [Quit: WeeChat 1.3]
dopamean_ has joined #ruby
ruurd has joined #ruby
newmanships has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
riotjones has joined #ruby
BSab has quit [Ping timeout: 255 seconds]
juanpablo__ has joined #ruby
yardenbar has joined #ruby
blackmesa has joined #ruby
tagrudev has joined #ruby
dhjondoh has joined #ruby
haxrbyte has quit [Ping timeout: 264 seconds]
mndoci has quit [Remote host closed the connection]
hxegon_ has joined #ruby
hxegon has quit [Ping timeout: 265 seconds]
CloCkWeRX has quit [Ping timeout: 250 seconds]
riotjones has quit [Ping timeout: 264 seconds]
juanpablo__ has quit [Ping timeout: 246 seconds]
Feyn has quit [Quit: Leaving]
Porfa has joined #ruby
an0ma1y has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 272 seconds]
moeabdol has joined #ruby
agit0 has joined #ruby
Musashi007 has joined #ruby
trosborn has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ruby
nateberkopec has joined #ruby
nopolitica has joined #ruby
nateberkopec has quit [Ping timeout: 240 seconds]
kiddorails has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dhjondoh has quit [Quit: dhjondoh]
mallu has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
genpaku has quit [Ping timeout: 265 seconds]
dhjondoh has joined #ruby
Pupp3tm4st3r has joined #ruby
ESpiney has quit [Quit: Leaving]
genpaku has joined #ruby
d34th4ck3r has quit [Quit: zzz]
Pupp3tm4_ has joined #ruby
_djbkd has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
ruurd has quit [Quit: ZZZzzz…]
infamos has joined #ruby
abucha has joined #ruby
skade has joined #ruby
jso has quit [Ping timeout: 272 seconds]
baweaver has quit [Remote host closed the connection]
nopolitica has quit [Ping timeout: 240 seconds]
bryanray has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
CloCkWeRX has joined #ruby
Pupp3tm4st3r has quit [Ping timeout: 246 seconds]
abucha_ has quit [Ping timeout: 252 seconds]
fedexo has quit [Ping timeout: 240 seconds]
Rollabunna has joined #ruby
Tarellel has quit [Quit: Tarellel]
baweaver has joined #ruby
baweaver has quit [Remote host closed the connection]
vigintas has joined #ruby
rabbitho1e has quit [Ping timeout: 265 seconds]
acke has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
Rollabunna has quit [Ping timeout: 250 seconds]
swgillespie has joined #ruby
vigintas has quit [Ping timeout: 250 seconds]
User458764 has joined #ruby
beast has joined #ruby
devoldmx has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<certainty>
moin
simplyia_ has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tigarcia has quit []
yfeldblum has quit [Ping timeout: 268 seconds]
al2o3-cr has quit [Ping timeout: 264 seconds]
predator117 has joined #ruby
rabbithole has joined #ruby
AlexRussia has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
GeissT_ has joined #ruby
mleung has quit [Quit: mleung]
GeissT has quit [Ping timeout: 260 seconds]
joonty has joined #ruby
c0dedead has joined #ruby
c0dedead has quit [Client Quit]
djbkd_ has quit [Remote host closed the connection]
tvw has joined #ruby
karapetyan has joined #ruby
charliesome has joined #ruby
treaki_ has quit [Ping timeout: 252 seconds]
firstdayonthejob has joined #ruby
al2o3-cr has quit [Ping timeout: 264 seconds]
riotjones has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
localredhead has quit [Ping timeout: 244 seconds]
yeticry has joined #ruby
DoubleMalt has joined #ruby
colegatron has quit [Ping timeout: 268 seconds]
zenguy_pc has quit [Ping timeout: 264 seconds]
riotjones has quit [Ping timeout: 260 seconds]
Porfa has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
codecop has joined #ruby
GeissT has joined #ruby
kiddorails has quit [Remote host closed the connection]
Porfa has quit [Client Quit]
bricker has joined #ruby
ruurd has joined #ruby
GeissT_ has quit [Ping timeout: 255 seconds]
davedev2_ has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
nateberkopec has joined #ruby
colegatron has joined #ruby
segmond has quit [Ping timeout: 246 seconds]
bricker has quit [Ping timeout: 240 seconds]
Spami has joined #ruby
zenguy_pc has joined #ruby
nateberkopec has quit [Ping timeout: 244 seconds]
segmond has joined #ruby
futilegames has joined #ruby
TomyWork has joined #ruby
roxtrong_ has joined #ruby
neanderslob has quit [Read error: Connection reset by peer]
neanderslob has joined #ruby
haraoka has quit [Remote host closed the connection]
pietr0 has quit [Ping timeout: 244 seconds]
baweaver has joined #ruby
ibouvousaime has joined #ruby
dh64 has quit [Quit: Konversation terminated!]
baweaver has quit [Ping timeout: 240 seconds]
terlar has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
devoldmx has joined #ruby
krzkrz has joined #ruby
riffraff has joined #ruby
krz has quit [Read error: Connection reset by peer]
axsuul has quit [Ping timeout: 268 seconds]
rattatmatt has joined #ruby
davedev2_ has quit [Ping timeout: 246 seconds]
davedev24 has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
lubarch has quit [Quit: leaving]
d34th4ck3r has joined #ruby
ibouvousaime has quit [Ping timeout: 260 seconds]
polysics has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ibouvousaime has joined #ruby
firstdayonthejob has quit [Ping timeout: 240 seconds]
mgorbach has quit [Ping timeout: 255 seconds]
davedev24 has quit [Client Quit]
blaxter has joined #ruby
juanpablo__ has joined #ruby
timonv has joined #ruby
nopolitica has joined #ruby
chibs has quit [Ping timeout: 244 seconds]
solars has joined #ruby
SCHAAP137 has joined #ruby
Pupeno has joined #ruby
GeissT has quit [Quit: Bye!]
juanpablo__ has quit [Ping timeout: 272 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgorbach has joined #ruby
kalusn has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
rgtk has joined #ruby
troulouliou_div2 has joined #ruby
charliesome has joined #ruby
bMalum has joined #ruby
ruurd has joined #ruby
nettoweb has joined #ruby
lipoqil has joined #ruby
charliesome has quit [Client Quit]
htmldrum has quit [Ping timeout: 260 seconds]
camilasan has quit [Remote host closed the connection]
riotjones has joined #ruby
blackmesa has joined #ruby
nopolitica has quit [Ping timeout: 250 seconds]
vigintas has joined #ruby
Guest11942 is now known as dellavg
riotjones has quit [Ping timeout: 246 seconds]
sebstrax has joined #ruby
shredding has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
dellavg is now known as Guest60692
Guest10035 has joined #ruby
neanderslob has quit [Ping timeout: 252 seconds]
tomaz_b has joined #ruby
neanderslob has joined #ruby
darkf_ has joined #ruby
bruno- has joined #ruby
riffraff_ has joined #ruby
bruno- is now known as Guest1858
<tomaz_b>
hi... i have one newbie question and would really appreciate some help. i need so solve something with ruby. can someone suggest/direct/show me link/tutorial/something that would show me how to sign XML programmably with certficate.
<tomaz_b>
i found some (quite old) gems.
<tomaz_b>
what would you use today?
riffraff has quit [Ping timeout: 240 seconds]
kimegede has joined #ruby
roshanavand has joined #ruby
purplexed- has quit [Ping timeout: 255 seconds]
an0ma1y has joined #ruby
nateberkopec has joined #ruby
Guest10035 is now known as dellavg
darkf has quit [Ping timeout: 240 seconds]
roshanav_ has joined #ruby
aufi has joined #ruby
qiukun has joined #ruby
tvw has quit []
Guest1858 has quit [Ping timeout: 260 seconds]
<adaedra>
Hello
yfeldblum has joined #ruby
<shevy>
hey undeadra
camilasan has joined #ruby
senayar has joined #ruby
roshanavand has quit [Ping timeout: 268 seconds]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
roshanav_ has quit [Ping timeout: 246 seconds]
relix has joined #ruby
krzkrz has quit [Ping timeout: 240 seconds]
nateberkopec has quit [Ping timeout: 250 seconds]
TheHodge has joined #ruby
blaxter has quit [Ping timeout: 268 seconds]
krzkrz has joined #ruby
platzhirsch has joined #ruby
mikecmpbll has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
rgtk has quit [Remote host closed the connection]
blueOxigen has left #ruby [#ruby]
startupality has joined #ruby
trajing has joined #ruby
Caius has joined #ruby
atom3 has joined #ruby
pusewicz has joined #ruby
Caius has joined #ruby
Caius has quit [Changing host]
marr has joined #ruby
qiukun has quit [Ping timeout: 268 seconds]
platzhirsch has quit [Ping timeout: 250 seconds]
qiukun has joined #ruby
karapetyan has quit [Remote host closed the connection]
hmsimha_ has quit [Quit: Leaving]
karapetyan has joined #ruby
purplexed- has joined #ruby
purplexed- has joined #ruby
Rollabunna has joined #ruby
rattatmatt has quit [Quit: Leaving]
polysics has quit []
musashi has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
<musashi>
I'm not sure this is the best place for this but can I ask you guys how I would write a regex that would match with "o/" and not "\o/"
baweaver has joined #ruby
adac has joined #ruby
rabbithole has quit [Ping timeout: 240 seconds]
<tobiasvl>
musashi: negative lookbehind
<musashi>
sorry?
Rollabunna has quit [Ping timeout: 272 seconds]
<tobiasvl>
musashi: you can use something called a "negative lookbehind" to achieve that
<canton7>
ruby-lang410, you're being caught out by too little escaping and too much interpolation
<izzol>
I have an API in sinatra, and I need to have a fast nice fronted to it. What is the best for this? :-)
Pupeno has quit [Remote host closed the connection]
riotjones has joined #ruby
<canton7>
ruby-lang410, example... Test_String.scan(/...\....\....\..../) works fine
<canton7>
ruby-lang410, similarly, Regex_Pattern = '...\....\....\....' and Regex_Pattern = "...\\....\\....\\...." are fine
lipoqil has quit [Quit: Connection closed for inactivity]
dhjondoh has quit [Quit: dhjondoh]
musashi has quit [Ping timeout: 265 seconds]
krzkrz has quit [Ping timeout: 264 seconds]
blackmesa has quit [Ping timeout: 255 seconds]
<ruby-lang410>
canton7: Thank you verymuch ... I just changed " " to ' ' and it worked?? ... However I am still confused why :/
d34th4ck3r has quit [Quit: zzz]
<ruby-lang410>
canton7: Any suggestions on what to google to know more about this
<canton7>
ruby-lang410, within " ", \ acts as an escape character. so ruby sees "\.", and goes "ok, he's escaping a period - but that's not an escape sequence, so I'll just insert a period"
<canton7>
... so you lose the backslash before you get near the #scan method call
DoubleMalt has joined #ruby
riotjones has quit [Ping timeout: 250 seconds]
<canton7>
within ' ' there is no escaping, so this doesn't happen. likewise "\\." means ruby goes "ok, he's escaping.. a backslash. which results in a backslash. next, there's a period..."
roshanavand has quit [Remote host closed the connection]
<ruby-lang410>
canton7: OMG ... this so valuable knowledge!! ... Thank you so much !! ... May god bless you :)
lukaszes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Gooddaytoyousir has joined #ruby
elperdut_ has quit [Client Quit]
blueOxigen has joined #ruby
solars has quit [Ping timeout: 252 seconds]
s00pcan has quit [Ping timeout: 260 seconds]
bluOxigen has quit [Ping timeout: 272 seconds]
colorisco has joined #ruby
s00pcan has joined #ruby
karapetyan has joined #ruby
riotjones has joined #ruby
riotjones has quit [Read error: Connection reset by peer]
riotjone_ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
u3DyxaH_4aTap has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
Coldblackice has quit [Ping timeout: 240 seconds]
juanpablo__ has joined #ruby
riotjone_ has quit [Ping timeout: 250 seconds]
roshanavand has quit [Remote host closed the connection]
qiukun has quit [Remote host closed the connection]
qiukun has joined #ruby
idefine has joined #ruby
juanpablo__ has quit [Ping timeout: 240 seconds]
krzkrz has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dhjondoh has quit [Quit: dhjondoh]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sluukkonen has quit [Ping timeout: 272 seconds]
lubarch has joined #ruby
idefine has quit [Ping timeout: 246 seconds]
jmonreal has quit [Ping timeout: 264 seconds]
u3DyxaH_4aTap has quit [Quit: ShakeIT Script - Be the Best!]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
juanpablo__ has joined #ruby
Xeago has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
juanpablo__ has quit [Ping timeout: 272 seconds]
Xeago has joined #ruby
bruno- is now known as Guest61643
jmonreal has joined #ruby
Porfa has quit [Quit: Porfa]
Xeago has quit [Remote host closed the connection]
darkf_ is now known as darkf
tulak has joined #ruby
sanjayu has quit [Ping timeout: 240 seconds]
dhjondoh has joined #ruby
Guest61643 has quit [Ping timeout: 272 seconds]
s00pcan has quit [Ping timeout: 240 seconds]
Porfa has joined #ruby
s00pcan has joined #ruby
WillAmes has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 1.3]
WillAmes has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
baweaver has joined #ruby
shredding has quit [Ping timeout: 250 seconds]
nateberkopec has joined #ruby
sdothum has joined #ruby
bMalum has joined #ruby
arup_r has joined #ruby
arup_r is now known as Guest12797
newbsduser has joined #ruby
<newbsduser>
hello, i want to generate raw http packets with ethernet header.. i want to inject these packets specific interface. for instance: eth3. how can i do that with ruby? if u advise me a tutorial or library name i ll be glad
Guest12797 is now known as arup_r
karapetyan has quit [Remote host closed the connection]
devoldmx has joined #ruby
mooru has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
nateberkopec has quit [Ping timeout: 268 seconds]
sluukkonen has joined #ruby
weckl has joined #ruby
skweek has quit [Ping timeout: 252 seconds]
roshanavand has quit [Remote host closed the connection]
jgt1 has quit [Ping timeout: 240 seconds]
devoldmx has quit [Ping timeout: 240 seconds]
solars has joined #ruby
karapetyan has joined #ruby
CVirus has joined #ruby
ta has joined #ruby
CVirus has left #ruby ["Leaving"]
ta has joined #ruby
tulak has quit [Remote host closed the connection]
mikecmpb_ has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
karapetyan has quit [Read error: No route to host]
favadi has joined #ruby
Mon_Ouie has joined #ruby
codecop has quit [Remote host closed the connection]
qiukun has quit [Quit: qiukun]
avril14th has joined #ruby
solocshaw has joined #ruby
roshanavand has joined #ruby
cacam9621 has quit [Quit: Leaving]
Balllkenende has quit [Remote host closed the connection]
joufflu has quit [Read error: Connection reset by peer]
jgt1 has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
stamina has joined #ruby
BSab has joined #ruby
gigetoo has joined #ruby
diegobiavati has quit [Read error: Connection reset by peer]
htmldrum has quit [Ping timeout: 240 seconds]
elperdut_ has joined #ruby
donske has joined #ruby
nateberkopec has joined #ruby
blackmesa has joined #ruby
solocshaw has quit [Ping timeout: 246 seconds]
moeabdol has quit [Read error: Connection reset by peer]
infamos has quit [Ping timeout: 268 seconds]
riotjones has joined #ruby
build22_ has joined #ruby
moeabdol has joined #ruby
duckpuppy has joined #ruby
solocshaw has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
inteq has quit [Remote host closed the connection]
gigetoo has quit [Ping timeout: 264 seconds]
Xeago has joined #ruby
riotjones has quit [Ping timeout: 260 seconds]
roshanavand has quit [Remote host closed the connection]
Aswebb_ has joined #ruby
karapetyan has joined #ruby
rabbithole has quit [Ping timeout: 252 seconds]
Icey has joined #ruby
roshanavand has joined #ruby
Wsewolod has joined #ruby
Icey has quit [Client Quit]
karapetyan has quit [Remote host closed the connection]
Icey has joined #ruby
solars has quit [Ping timeout: 264 seconds]
Xeago has quit [Remote host closed the connection]
karapetyan has joined #ruby
Balllkenende has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
bruno- has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
bruno- is now known as Guest45427
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lukaszes has joined #ruby
tkuchiki has joined #ruby
tulak has joined #ruby
prestorium has quit [Quit: Leaving]
Balllkenende has quit [Ping timeout: 240 seconds]
subscope has joined #ruby
tkuchiki has quit [Remote host closed the connection]
codecop has joined #ruby
tkuchiki has joined #ruby
<rob_>
newbsduser: look at socket library
roshanavand has quit [Remote host closed the connection]
BSab has quit [Quit: Leaving]
prestorium has joined #ruby
joonty has quit [Quit: joonty]
roshanavand has joined #ruby
synthroid has joined #ruby
rabbithole has joined #ruby
abucha_ has quit [Remote host closed the connection]
astrobun_ has joined #ruby
astrobun_ has quit [Remote host closed the connection]
<yorickpeterse>
Socket doesn't let you inject packets into any interfaces
shredding has joined #ruby
<shevy>
it sounds non-trivial what newbsduser wants to do
gigetoo has joined #ruby
favadi has joined #ruby
jmonreal has quit [Quit: Lost terminal]
dANO- has joined #ruby
Balllkenende has joined #ruby
tulak has quit [Remote host closed the connection]
<adaedra>
that's low level (and requires root under Linux, afaik)
lipoqil has quit [Quit: Connection closed for inactivity]
ghoti has quit [Ping timeout: 246 seconds]
atomical has joined #ruby
lukaszes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Icey has quit [Quit: icey]
ghoti has joined #ruby
Icey has joined #ruby
sgambino has joined #ruby
Icey has quit [Client Quit]
<Moblin>
Is there a ruby method that inherently puts a number to a string with commas?
Moblin is now known as Ebok
Icey has joined #ruby
chibs has joined #ruby
lxsameer has quit [Quit: Leaving]
momomomomo has joined #ruby
treehug88 has joined #ruby
<apeiros>
Ebok: asking a question and then changing nick ain't smart.
<Ebok>
Fair
joonty has joined #ruby
<Ebok>
I only noticed it was the backup nick after asking
Porfa has quit [Quit: Porfa]
<apeiros>
I don't really know what you're asking for either, though :)
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
363665.localize # => "363,665"
freerobby has joined #ruby
pl1ght has joined #ruby
mary5030 has joined #ruby
<Ebok>
Hm
<Ebok>
Cool!
Balllkenende has quit [Remote host closed the connection]
<apeiros>
updated to include `places` arg: -1234.56.localize(thousands: "'", decimal: ",", places: 4) # => "-1'234,5600"
karapetyan has joined #ruby
<apeiros>
better naming of arguments welcome :)
Balllkenende has joined #ruby
juanpablo__ has joined #ruby
colegatron has quit [Ping timeout: 250 seconds]
_stu_ has joined #ruby
riotjones has joined #ruby
<Ebok>
that regex ... take the first number, looking forward at three numbers, and put a "," there. I like it ^^
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
<apeiros>
that one's actually stolen. iirc from zenspider
jas02 has quit [Quit: jas02]
gusTester has left #ruby [#ruby]
karapetyan has quit [Ping timeout: 260 seconds]
roshanavand has quit [Remote host closed the connection]
solocshaw1 has joined #ruby
<Ebok>
Im mostly happy to be able to read that regex tbh. I'm just starting to come to terms with lookforward lookback
_blizzy_ has joined #ruby
dhjondoh has quit [Remote host closed the connection]
<apeiros>
lookaround is the umbrella term ;-)
roshanavand has joined #ruby
juanpablo__ has quit [Ping timeout: 252 seconds]
<Ebok>
noted
riotjones has quit [Ping timeout: 260 seconds]
bryanray has joined #ruby
<mikecmpb_>
if i have a module with some behaviour, is there a good pattern for being able to overwrite some default values that the module uses from the class which includes it?
Xeago has joined #ruby
<mikecmpb_>
i've extracted some password reset code out into a module and i want to have a default password expiry but allow that to be changed by the class which includes the module, not sure what approach to take.
solocshaw has quit [Ping timeout: 240 seconds]
solocshaw1 is now known as solocshaw
mary5030 has quit [Ping timeout: 260 seconds]
<apeiros>
mikecmpb_: define them as methods
mikecmpb_ is now known as mikecmpbll
<apeiros>
including class can then just define those methods itself
<jhass>
constant resolution should win as well
<mikecmpbll>
ah yes.
timonv has quit [Ping timeout: 255 seconds]
karapetyan has joined #ruby
<apeiros>
I usually prefer methods as they allow logic too. but granted, not always actually.
<mikecmpbll>
jhass: how could that work?
abucha has joined #ruby
<jhass>
>> module Foo; X = 1; def x; X; end; end; class A; X = 2; include Foo; end; class B; include Foo; end; [A.new.x, B.new.x]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
erbesharat has joined #ruby
<jhass>
weird, I thought the first case works
<apeiros>
>> module Adder; def value; base + summand; end; def base; 0; end; def summand: 10; end; end; class FutureYear; include Adder; def base; Time.now.year; end; end; FutureYear.new.value
<ruboto>
apeiros # => /tmp/execpad-dbeb92f3a286/source-dbeb92f3a286:2: syntax error, unexpected ':', expecting ';' or '\n' ...check link for more (https://eval.in/463713)
dstarh has joined #ruby
segfalt has quit [Ping timeout: 272 seconds]
<apeiros>
plerp
markfletcher has joined #ruby
<apeiros>
with constant you need self::
<apeiros>
or self.class::
<apeiros>
>> module Adder; def value; base + summand; end; def base; 0; end; def summand; 10; end; end; class FutureYear; include Adder; def base; Time.now.year; end; end; FutureYear.new.value
<apeiros>
meh, /me late. jhass already corrected himself :)
Fire-Dragon-DoL has joined #ruby
hxegon_ has quit [Ping timeout: 240 seconds]
bryanray has quit [Client Quit]
Guest45427 has quit [Ping timeout: 240 seconds]
diegoaguilar has quit [Read error: Connection reset by peer]
diegoaguilar has joined #ruby
Pupp3tm4_ has quit [Ping timeout: 265 seconds]
<mikecmpbll>
apeiros, jhass: excellent, thank you both!
<mikecmpbll>
i thought i'd get some redefining constant error if i did that, for some reason.
jdawgaz has joined #ruby
<jhass>
nah, those are really two separate constants in their own namespaces
MuffinPimp has joined #ruby
<jhass>
it's just resolution that makes it work, A::X winning over Foo::X
<mikecmpbll>
gotcha
diegoaguilar has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 252 seconds]
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
colegatron has joined #ruby
rdark has quit [Ping timeout: 268 seconds]
rodfersou is now known as rodfersou|lunch
dreinull75 has left #ruby ["undefined"]
dionysus69 has joined #ruby
al2o3-cr has joined #ruby
juanpablo__ has joined #ruby
JDiPierro has joined #ruby
roshanavand has quit [Remote host closed the connection]
suchness has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
<Ebok>
aperios: actually, while I can read it, I'm not entirely certain of the implications of this part of that gsub regex: +$, does that actually make the regex start from right to left? "+ end of line"
Guest53 has joined #ruby
solars has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
Ebok: + is a quantifier, it affects the expression before it, not after
<jhass>
.+ is any character (.), one or more times (+)
zacstewart has joined #ruby
<jhass>
ah okay, shold've looked at the context
skweek has quit [Ping timeout: 246 seconds]
<jhass>
Ebok: in this case we already have the quantifier, {3}
<jhass>
that's three times
<jhass>
\d is any number, so three digits
<apeiros>
\d{3}+ is shorthand for (?:\d{3})+, so a multiple of 3
<Ebok>
I see. so its {3}+ together
<apeiros>
+digits
<Ebok>
Right
<jhass>
wait, it's not the no backtrace thing, what was it called again?
<Ebok>
I guess I just need to look up and read more about how 'end of line" functions
<apeiros>
jhass: greediness?
<jhass>
yeah, no
aredridel is now known as Aria
<jhass>
possessive
constantinexvi has quit [Ping timeout: 268 seconds]
<apeiros>
yeah, * is possessive, ? is lazy (iirc)
<Ebok>
possessive sounds familiar
<jhass>
non-greedy still backtraces
<apeiros>
ah, *+ is possessive
<jhass>
apeiros: it's a lookahead, so I have my doubts about your interpretation
<jhass>
can't have dynamic width things there
<apeiros>
yes, I think {m} is a special case
constantinexvi has joined #ruby
tinyhippo is now known as sadhippo
<apeiros>
in other cases you'd have to write the (?:) out iirc
<apeiros>
as said, that part is stolen :D
<jhass>
{m} is a fixed width, yeah
Rickmasta has joined #ruby
sankaber has joined #ruby
<jhass>
but "\d{3}+ is shorthand for (?:\d{3})+" would make it dynamic width
<jhass>
I think it's possessive rather, no?
sankaber has quit [Remote host closed the connection]
<apeiros>
was there a diff between atomic group and possessive quant?
sankaber has joined #ruby
<jhass>
atomic group is the superset, possessive quantifiers are shorthands to certain variants
agit0 has joined #ruby
cdg has joined #ruby
<apeiros>
if it was just possessive, it wouldn't work as far as I understand. because it'd match the quantified pattern only once. i.e. {3} is the quantifier then. + is only modifying that to be possessive.
<jhass>
"You can make a quantifier possessive by placing an extra + after it. * is greedy, *? is lazy, and *+ is possessive. ++, ?+ and {n,m}+ are all possessive as well."
<Ebok>
Basically the reason I asked was I was just looking at /(\d)(?=\d{3}+$)/ on Rubular, and noticed that it grabbed 45 0 00 0 000, in 450million. the last instance of 0 puts the comma after it, but then its only two 0 before the next injection, unless the comma counted. So I wasnt clear what was actually happening
maikowblue has joined #ruby
karapetyan has joined #ruby
sandals has joined #ruby
<Ebok>
Going from right to left in this instance would be a cool trick >_>; if that was actaully happening
<Ebok>
I mean I know the method is returning the values correctly
<Ebok>
I suspect reading that tutorial will provide me some of the answers
<apeiros>
jhass: yeah, that'd be really nice
momomomomo has joined #ruby
umgrosscol has joined #ruby
sandals is now known as powerful_pdev
<adaedra>
I had a site like that
s00pcan has quit [Remote host closed the connection]
s00pcan has joined #ruby
devoldmx has joined #ruby
<_blizzy_>
some guy was arguing that ruby is unreadable. Im like how?
ekinmur has joined #ruby
davedev24 has joined #ruby
<_blizzy_>
it's one of the most readable languages I know of.
<apeiros>
they've got some pretty unreadable ruby code to share :D
<_blizzy_>
oh.
<apeiros>
you can write unreadable code in almost any language
<apeiros>
but yeah, IMO wrt common code readability, ruby is one of the most readable languages out there.
blackmesa has joined #ruby
malconis has joined #ruby
malconis has quit [Remote host closed the connection]
<jhass>
it does take a bit to get used to, but then it's very readable
malconis has joined #ruby
lukaszes has joined #ruby
devoldmx has quit [Ping timeout: 250 seconds]
<jhass>
I do remember my first impression of it being confusing too
Xeago has quit [Remote host closed the connection]
antgel has quit [Ping timeout: 250 seconds]
kp666_ has quit [Remote host closed the connection]
ESpiney has joined #ruby
lukaszes has quit [Client Quit]
<jhass>
adaedra: doesn't like our case unfortunately
mooru has quit [Ping timeout: 268 seconds]
antgel has joined #ruby
chibs has joined #ruby
freerobby has quit [Quit: Leaving.]
Arnvald has joined #ruby
bigmac has joined #ruby
bigmac has quit [Client Quit]
Arnvald has quit [Remote host closed the connection]
abucha has quit [Remote host closed the connection]
abucha has joined #ruby
chibs has quit [Ping timeout: 260 seconds]
huddy has quit [Quit: Connection closed for inactivity]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
exadeci has quit [Quit: Connection closed for inactivity]
abucha_ has joined #ruby
rbennacer has joined #ruby
Xeago has joined #ruby
mag42c has joined #ruby
diegoaguilar has joined #ruby
roshanavand has quit [Remote host closed the connection]
juanpablo__ has quit [Read error: Connection reset by peer]
skade has quit [Quit: Computer has gone to sleep.]
<jhass>
apeiros: I think it's a special case in oniguruma, similar to what Java does, expanding (?=\d{3}+$) to (?=\d{9}$|\d{6}$|\d{3}$) automatically, starting with 3**n <= remaining string length
roshanavand has joined #ruby
<jhass>
and then iterating n down to 1
<apeiros>
that's actually a pretty nice performance optimization
favadi has joined #ruby
<jhass>
at least that's the only way I'm able to explain that expressions behavior to me
abucha has quit [Ping timeout: 252 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qwertme has joined #ruby
tmtwd has joined #ruby
favadi has quit [Max SendQ exceeded]
roshanavand has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
<apeiros>
I think {3} is not a quantifier in the classical sense
JDiPierro has quit [Remote host closed the connection]
<apeiros>
in that it is fixed
<apeiros>
i.e. \d{3} is really just (?:\d\d\d)
<jhass>
mh, no, it's \d{,m} actually
<apeiros>
no
<jhass>
well, m,m
<apeiros>
\d{,m} is \d{0,m}
<jhass>
yeah derped there for a sec, I meant {m,m}
<apeiros>
and \d{3} is \d{3,3}, which is (?:\d\d\d)
zacstewart has quit [Remote host closed the connection]
Eiam has quit [Read error: Connection reset by peer]
<jhass>
but your expansion would be an optimization over the general case
rdark has joined #ruby
<apeiros>
hence I think \d{3}[+*?] is unrelated to greedy/possessive/lazy. \d{3}? would be "3 or none"
<apeiros>
and not "lazily 3"
JDiPierro has joined #ruby
<apeiros>
same with \d{3}*, it'd be "a multiple of 3, with factor starting at 0"
Guest53 has joined #ruby
tulak has joined #ruby
<jhass>
the Java behavior for \d{n,m}+ is take the max (m) and generate alternations of \d{m**i} with max(m**i) <= remaining string length
<apeiros>
I'd bet that's also only true for n != m
<jhass>
according to regular-expressions.info
bronson has quit [Read error: Connection reset by peer]
cliffstah has quit [Ping timeout: 255 seconds]
wlanboy has quit [Ping timeout: 250 seconds]
karapetyan has quit [Remote host closed the connection]
whippythellama has joined #ruby
<jhass>
and it's only doing that inside lookarounds, outside it's possessive
aeris22 has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
<jhass>
but lookarounds are already atomic
xnr has quit [Ping timeout: 240 seconds]
brendan- has quit [Max SendQ exceeded]
SHyx0rmZ has quit [Ping timeout: 246 seconds]
<adaedra>
jhass: yeah, it would be even cooloer with a Ruby mode.
scottymeuk has quit [Ping timeout: 250 seconds]
shawnacscott has quit [Ping timeout: 250 seconds]
j2k has quit [Ping timeout: 250 seconds]
norc has quit [Ping timeout: 246 seconds]
justinweiss has quit [Ping timeout: 250 seconds]
julie_harshaw has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
Flipez has quit [Ping timeout: 240 seconds]
ctp_ is now known as ctp
parus has quit [Ping timeout: 265 seconds]
Dreamer3 has quit [Max SendQ exceeded]
shadeslayer has quit [Ping timeout: 255 seconds]
riotjones has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tulak has quit [Remote host closed the connection]
Rollabunna has quit [Read error: Connection reset by peer]
donske has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
acy has left #ruby ["Leaving"]
Guest48008 has quit [Ping timeout: 265 seconds]
griffindy has joined #ruby
<apeiros>
minver: you can create custom error classes and you can write custom rescue blocks
rabbithole has quit [Ping timeout: 240 seconds]
<apeiros>
and ruby doesn't care what you put in the message string even with the core exception classes
peitera has joined #ruby
<apeiros>
as for custom error classes: just inherit from StandardError (NOT from Exception!)
Xeago has joined #ruby
spew has joined #ruby
shinnya has joined #ruby
CloCkWeRX has joined #ruby
Xeago has quit [Remote host closed the connection]
p0wn3d__ has joined #ruby
newbsduser has quit [Remote host closed the connection]
Spleeze has joined #ruby
Fire-Dragon-DoL has quit []
jgt1 has joined #ruby
musou has joined #ruby
cwong_on_irc has joined #ruby
mary5030 has joined #ruby
tkuchiki has joined #ruby
tagrudev has quit [Remote host closed the connection]
bruno-_ has joined #ruby
<minver>
apeiros: Even if I have a custom error and override the message method raise() still seems to skip formatting. I want newlines and tabs in the error message
dopamean_ has quit [Ping timeout: 240 seconds]
Mon_Ouie has quit [Ping timeout: 240 seconds]
RegulationD has joined #ruby
nfk|laptop has quit [Quit: yawn]
Xeago has joined #ruby
The_Phoenix has joined #ruby
<minver>
apeiros: nvm, thanks!
minver has quit [Quit: Page closed]
polishdub has joined #ruby
shmilan has joined #ruby
abucha_ has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
kp666_ has joined #ruby
abucha has joined #ruby
abucha_ has joined #ruby
Xeago has joined #ruby
elperdut_ has quit [Ping timeout: 240 seconds]
dhollinger has joined #ruby
jmonreal has joined #ruby
pdoherty has joined #ruby
elperdut has joined #ruby
rabbithole has joined #ruby
<jmonreal>
hey there folks. I am using optparse to parse the arguments of command line, but when I do not enter anything, the script does not show the help
<jmonreal>
I was wondering what am I missing
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
abucha_ has quit [Remote host closed the connection]
elperdut has quit [Max SendQ exceeded]
but3k4_ has joined #ruby
solars has quit [Ping timeout: 260 seconds]
<Ebok>
how do you ask a regex to look ahead for two conditions?
to_json has joined #ruby
to_json has joined #ruby
jgt1 has quit [Ping timeout: 252 seconds]
abucha has quit [Ping timeout: 272 seconds]
rdark has quit [Quit: leaving]
elperdut has joined #ruby
<Ebok>
example find any letter followed by 'a' and 'b'
rdark has joined #ruby
rdark has quit [Changing host]
rdark has joined #ruby
but3k4 has quit [Read error: Connection reset by peer]
<Ebok>
assume a and b could be anything
Xeago has quit [Remote host closed the connection]
<Ebok>
the search considition in this case is /[A-Z](?=[0-9])/ >_>
<havenwood>
Ebok: Any two digits followed by a capital letter, or a known list of options or?
dopamean_ has joined #ruby
<gregf_>
Ebok: if whats following A and B are dynamic, then God help you :|
<Ebok>
gregf gave me what I needed
<Ebok>
And yeah I know
<Ebok>
xD
<gregf_>
Ebok: that was just a guess, havenwood has asked quite a valid question ;)
nertzy has quit [Quit: This computer has gone to sleep]
step1step2_ has joined #ruby
<jmonreal>
great!
<jmonreal>
do you folks know how to tell optparse to validate the required fields?
<Ebok>
havenwood, I dont have a specific need outside needing to be able to look ahead for multiple conditions, say, take X when its followed by anyY and Z
<Ebok>
The answer was literally +
<Ebok>
>_>;
<Ebok>
\d(?=[a-zA-Z]+\d) <== an example. match a number thats followed by letters and one more number
freerobby has joined #ruby
solars has joined #ruby
daivyk has quit [Quit: ZZZzzz…]
<Ebok>
I'll be more clear when I ask questions in the future, sorry for the headache, thanks for the assist
<Ebok>
I know there are other ways to do this, I'm just wondering if gsub can do it
treehug88 has joined #ruby
bruno- is now known as Guest15285
cwong_on_irc has quit [Read error: Connection reset by peer]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Ebok>
the other curiousity I have with gsub is when the pattern is matched, can we modify the pattern? example "hello world".gub(/[aeiou]/,pat.next) turning e into f, o into p, etc
<slash_nick>
woods: that's on googles list of things to read before an interview
<woods>
Why do suppose I am reading it? :)
build22 has quit []
<slash_nick>
woods: good luck! :)
<woods>
slash_nick, thanks!
NeverDie has joined #ruby
<woods>
I feel like I didn't grasp many of those concepts as well as I should have in school, so now that I have more time, I'm going back and reviewing.
TheNet has joined #ruby
jackjackdripper has joined #ruby
Expl0s3 has quit [Ping timeout: 246 seconds]
<slash_nick>
woods: are you also reading programming pearls & the one on programming interviews as well?
jwaldrip has quit [Quit: Be back later ...]
TheNet has quit [Remote host closed the connection]
TheNet has joined #ruby
Yzguy has joined #ruby
dtordable has joined #ruby
dtordable has joined #ruby
beauby has quit [Ping timeout: 252 seconds]
TheNet has quit [Remote host closed the connection]
jwaldrip has joined #ruby
jwaldrip_ has joined #ruby
jwaldrip_ has quit [Remote host closed the connection]
diegoaguilar has quit [Ping timeout: 240 seconds]
RegulationD has joined #ruby
momomomomo has joined #ruby
shmilan has joined #ruby
dtordable has quit [Client Quit]
yqt has quit [Ping timeout: 272 seconds]
netule has joined #ruby
peteykun has quit [Ping timeout: 260 seconds]
beauby has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwaldrip has quit [Ping timeout: 240 seconds]
tylerm has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
Spleeze has joined #ruby
<woods>
slash_nick, I don't have programming pearls, but a co-worker let me borrow "Cracking the Coding Interview"
<tylerm>
howdy - i'm looking at allinoneruby and tar2rubyscript but not having much luck and these seem like old projects.. is there a newer approach you can recommend
sdfgsdfg has quit [Read error: Connection reset by peer]
CalydOn has quit [Ping timeout: 240 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tylerm>
i want to deploy my app and complete ruby env to another linux machine with them needing to install anything.
idefine has quit [Read error: Connection reset by peer]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has joined #ruby
Guest53 has joined #ruby
symbol has joined #ruby
cndiv has quit [Quit: Be back later ...]
symbol has quit [Client Quit]
z4ph0d has quit [Ping timeout: 240 seconds]
z4ph0d has joined #ruby
roxtrong_ has joined #ruby
<tomaz_b>
hi... i am newbie in ruby ... i have to create XML, based on .xsd files. I came across soap4r and cmd tool xsd2ruby.rb. Now I got huge file full of classes and everything. But somehow ... I am not sure that I know how to build XML (actualy create one)... after instantiating some of those classes
stamina has joined #ruby
<tomaz_b>
can someone please help/suggest me how to proceed
NeverDie has joined #ruby
cdg_ has quit [Remote host closed the connection]
idefine has quit [Read error: Connection reset by peer]
eminencehc has quit [Remote host closed the connection]
<Sou|cutter>
TheNet: I might take a look at ActiveSupport's class_attribute
mercerist has quit [Ping timeout: 240 seconds]
Musashi007 has joined #ruby
<apeiros>
TheNet: class ivar. you can initialize it in self.inherited.
<apeiros>
my pattern is usually to have a private self.initialize_class and call that via send from self.inherited.
karapetyan has quit [Remote host closed the connection]
<apeiros>
I dislike ||= in accessors
idefine_ has quit [Read error: Connection reset by peer]
mistermocha has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
jorb has quit [Ping timeout: 264 seconds]
hectorsq has joined #ruby
elaptics is now known as elaptics`away
jorb has joined #ruby
idefine has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
jdawgaz has joined #ruby
ldnunes has quit [Quit: Leaving]
<woods>
slash_nick, sorry for the delayed response, i was out of the office, ill have to check that one out as well
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pocketprotector is now known as notworking
griffindy has joined #ruby
griffindy has quit [Client Quit]
griffindy has joined #ruby
griffindy has quit [Read error: Connection reset by peer]
griffindy has joined #ruby
kstuart has quit [Read error: Connection reset by peer]
Coldblackice has joined #ruby
Musashi007 has quit [Quit: Musashi007]
blackmesa has joined #ruby
maletor has quit [Ping timeout: 260 seconds]
idefine has quit [Read error: Connection reset by peer]
skweek has quit [Ping timeout: 246 seconds]
kstuart has joined #ruby
nopolitica has quit [Ping timeout: 240 seconds]
[Butch] has joined #ruby
idefine has joined #ruby
tw1sted has quit [Changing host]
tw1sted has joined #ruby
neanderslob has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
skweek has joined #ruby
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has quit [Ping timeout: 272 seconds]
QORRiE has quit [Quit: Leaving]
Guest57263 has quit [Read error: Connection reset by peer]
bruno-_ has joined #ruby
RegulationD has quit [Remote host closed the connection]
Oatmeal has quit [Ping timeout: 240 seconds]
notworking is now known as pocketprotector
jessemcgilallen has quit [Quit: jessemcgilallen]
diegoaguilar has quit [Remote host closed the connection]
arthurix_ has joined #ruby
idefine has quit [Read error: Connection reset by peer]
idefine has joined #ruby
mistermocha has joined #ruby
arthurix has quit [Ping timeout: 260 seconds]
prestorium has quit [Quit: Leaving]
fantazo has quit [Ping timeout: 244 seconds]
Aswebb_ has quit [Remote host closed the connection]
Guest53 has joined #ruby
eminencehc has joined #ruby
step1step22 has joined #ruby
xfbs has quit []
mistermocha has quit [Ping timeout: 255 seconds]
zotherstupidguy has joined #ruby
woods has quit [Ping timeout: 272 seconds]
ahegyi has quit [Ping timeout: 260 seconds]
vdamewood has joined #ruby
zenguy_pc has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
trosborn has joined #ruby
skade has joined #ruby
Oatmeal has joined #ruby
Ox0dea has joined #ruby
baweaver has joined #ruby
zotherstupidguy has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
ibouvousaime has joined #ruby
startupality has quit [Quit: startupality]
stannard has quit [Remote host closed the connection]
stamina has joined #ruby
<Ox0dea>
So, you can include "Rakefile" in a gem's extension list to have your default Rake task executed post-install; this is pretty awesome, but RubyGems is mucking about with the output streams, so printing is annoying. :<
<Ox0dea>
https://eval.in/463874 only prints "--0--", indicating that I apparently have to repurpose stdin for output, and I don't wanna do that.
stannard_ has joined #ruby
treehug88 has quit [Ping timeout: 246 seconds]
<Ox0dea>
Please adivse.
<Ox0dea>
*advise
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Ping timeout: 240 seconds]
lemur has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
zylogz80 has quit [Ping timeout: 260 seconds]
zacstewart has quit [Remote host closed the connection]
DEA7TH has joined #ruby
idefine has quit [Read error: Connection reset by peer]
platzhirsch has left #ruby [#ruby]
shellie_ has quit [Quit: .]
rabbithole has joined #ruby
jxs_ has joined #ruby
idefine has joined #ruby
decoponio has quit [Quit: Leaving...]
woods has joined #ruby
mistermocha has joined #ruby
ruurd has joined #ruby
TheNet has quit [Remote host closed the connection]
tomphp has joined #ruby
TheNet has joined #ruby
TheNet has quit [Remote host closed the connection]
diegoaguilar has joined #ruby
bruno-_ has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
bruno- is now known as Guest65882
moeabdol has joined #ruby
duckpupp1 has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
zotherstupidguy has joined #ruby
lemur has quit [Remote host closed the connection]
woods has quit [Ping timeout: 244 seconds]
marcosantoniocar has joined #ruby
al2o3-cr has joined #ruby
to_json has quit [Quit: Leaving.]
treehug88 has joined #ruby
dopamean_ has quit [Read error: Connection reset by peer]
infamos has joined #ruby
hxegon has quit [Ping timeout: 252 seconds]
p0wn3d__ has quit [Ping timeout: 250 seconds]
cdg has joined #ruby
moeabdol has quit [Ping timeout: 252 seconds]
mozzarella has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
idefine has quit [Read error: Connection reset by peer]
arup_r has quit [Quit: Leaving]
arthurix has joined #ruby
Coldblackice has quit [Ping timeout: 240 seconds]
idefine has joined #ruby
segfalt has joined #ruby
segfalt__ has quit [Read error: Connection reset by peer]
infamos has quit [Ping timeout: 260 seconds]
bricker has joined #ruby
infamos has joined #ruby
zotherstupidguy has quit [Ping timeout: 255 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<edj_>
it says i need to make this "books.sort { |firstBook, secondBook| firstBook <=> secondBook }" sort them in decending order
<Ox0dea>
edj_: Do you understand the <=> operator?
<edj_>
is there a way to do that without making it an if else?
<edj_>
no i do not
<Ox0dea>
edj_: Yes, it's extremely easy.
_stu_ has quit [Quit: _stu_]
<Ox0dea>
&ri Comparable#<=> @ edj_
<`derpy>
No results
<Ox0dea>
Derp.
goodcodeguy has joined #ruby
<Ox0dea>
edj_: Anyway, it's searchable name is the "spaceship" operator; look into it.
jmo has joined #ruby
<edj_>
Ox0dea:thanks
jmo has quit [Remote host closed the connection]
<CalydOn>
Hello, I'm writing a Ruby code and I have some trouble with user input . When I use gets.chomp command I can't move the cursor backward terminal (with the left arrow key) , the terminal print [ [C ^ . I wonder if someone Could help me . Thanks
<Ox0dea>
>> [1, 2, 3].sort { |a, b| b <=> a } # edj_
<Ox0dea>
havenwood: None that come to mind, and I've thought about it hard-ish.
segfalt has joined #ruby
<shevy>
slash_nick lol
<shevy>
"rename tailing to trailing"
<slash_nick>
:)
<shevy>
is this a pun or something
<slash_nick>
substantive, i know
<shevy>
"put the cat on the mat"
<shevy>
"take the dog out of the fog"
<shevy>
aaaah ok
<shevy>
typo fix
<slash_nick>
i thought i posted this in offtopic
zacstewart has joined #ruby
<slash_nick>
i'm lost.
diegoaguilar has joined #ruby
<shevy>
CalydOn what did you do just now, your nick appears wrong
skweek has quit [Ping timeout: 240 seconds]
<CalydOn>
nothing i just use notice command
<shevy>
ok
ta has quit [Remote host closed the connection]
<shevy>
that scared the squirrel out of me
<Ox0dea>
CalydOn: You shouldn't.
<shevy>
CalydOn readline support is available from the official ruby tarball such as ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.2.3.tar.xz - it is in that directory in ext/readline/
<shevy>
if you compiled from source, the makefile will try to see if you have readline + ncurses available, then the bindings will be compiled; distributions may have a readline package so you could try to use that
beauby has quit [Ping timeout: 260 seconds]
<CalydOn>
why i shouldn't (i m new on irc, I made an mistake ?)
<Ox0dea>
CalydOn: Sorry, I've inadvertently led you on a goose chase. Your Ruby was almost certainly compiled with readline, you just have to explicitly request it as shevy is explaining.
nfk has joined #ruby
<shevy>
it depends how you obtained your ruby... perhaps you are on windows... not sure if they have readline support available by default, I assume no
<shevy>
*depends on
skade has quit [Quit: Computer has gone to sleep.]
<tsunamie>
however I am trying to understand the difference between Mechanize and Nokogiri
htmldrum has joined #ruby
<tsunamie>
how do I find out? IS there like a javadocs eqiviliant?
zenguy_pc has joined #ruby
shmilan has joined #ruby
yfeldblum has joined #ruby
maxz has quit [Ping timeout: 246 seconds]
ruurd has quit [Read error: Connection reset by peer]
hectorsq has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
EllisTAA has joined #ruby
sshbio has quit [Ping timeout: 250 seconds]
maxz has joined #ruby
DarkBushido has quit [Ping timeout: 246 seconds]
htmldrum has quit [Ping timeout: 240 seconds]
Oatmeal has joined #ruby
User4587_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
htmldrum has joined #ruby
lukaszes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
griffindy has quit [Read error: Connection reset by peer]
momomomomo has quit [Client Quit]
lemur has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
<Ox0dea>
tsunamie: Parsing XML and driving a browser are very different things.
moeabdol has joined #ruby
<tsunamie>
sp Mechanize is for parsing XML? As I can see from nokriki I am taking in HTML as a massive string and this gem seems to have the ability to parse over it
djbkd has quit [Remote host closed the connection]
<tsunamie>
I get it's looping throught rows. and that it looping throught rows. How ever I am currently assuming that rows is a string
luriv has quit [Ping timeout: 260 seconds]
jinie has joined #ruby
dnomyar has quit [Ping timeout: 272 seconds]
synthroid has quit []
ruurd has quit [Read error: Connection reset by peer]
<tsunamie>
and that each value is having css selector run throught them all. However I am getting stuck on the row.css("td a").map{ |a|
<tsunamie>
a['href'] if a['href'].match("/wiki/")
<tsunamie>
}.compact.uniq
<tsunamie>
section
<tsunamie>
manveru, I am trying to understand lines 2-4
johnhamelink has joined #ruby
<manveru>
well, what don't you understand about it?
<manveru>
what map is? what 'td a' selects? what an href is?
<tsunamie>
manveru, I think a better question is. IS there an eqiviliant to javadoc's for ruby. Where I can lookup methodes roles, actions and so on for specific objects?
<tsunamie>
manveru, I think teaching me how to fish is the best way to go
Azure has joined #ruby
<manveru>
ruby-doc usually
<Ox0dea>
tsunamie: In your defense, that code isn't great.
<ruby-lang498>
im trying to open a txt file, pass all data into a new array and then match the array value with hash keys and im having some trouble...
<tsunamie>
manveru, Ox0dea do you know how the logic for this works? row.css("td a").map?
simplyianm has quit [Remote host closed the connection]
phutchins has joined #ruby
<tsunamie>
so I get that row is an Nokogiri::HTML object
<tsunamie>
and that css is simply a method of that object that allows your the parse for items with that identification in the xml
kerunaru has quit [Client Quit]
riotjones has joined #ruby
<Ox0dea>
tsunamie: Just so; #map is just a method on Enumerable that transforms the collection however you specify in the body of the block.
_stu_ has joined #ruby
<tsunamie>
however I don't understand where they got the map method from as I can't see it in the nologiri documents. So I assuming it's the method thats apart of an array
<Ox0dea>
tsunamie: #map is a core method provided by the Enumerable module.
<ruby-lang498>
manveru, why is it attaching a "/n" too the strings it add?
riotjone_ has quit [Ping timeout: 260 seconds]
radgeRayden_ has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
radgeRayden has quit [Ping timeout: 244 seconds]
<tsunamie>
Ox0dea, so how do I know what objects I can run each on? As I understand it Nokogiri is it's own object right? Which is a gem that structures the HTML into a searchable object
donske has joined #ruby
CloCkWeRX1 has joined #ruby
<tsunamie>
so how did it know each method could be used on it?
CloCkWeRX has quit [Quit: Leaving.]
<tsunamie>
or how do I know what methodes can be run on a Nokogiri object? Since each is not in the docs for it
<ericwood>
tsunamie: don't node lists include enumerable? if so you can use any method in the enumerable module (in the ruby docs)
<tsunamie>
Ox0dea, I feel like I am missing something. A fundermental understanding. Like how actaully nokogiri is just a set of arrays/hashs
<apeiros>
tsunamie: don't forget the ancestry
simplyianm has joined #ruby
Ox0dea has quit [Disconnected by services]
<apeiros>
classes inherit from other classes and include modules.
<dave1984>
I'm trying to create a collection so I can group my "projects". I made a folder called _projects/, added the collection and output: true in my _config.yml, and tried looping through it with {% for project in site.projects %} <h1>{{ project.title }}</h1> {% endfor %}. But it's not finding anything. Did I miss a step?
<Ox0dea>
Simply by defining your own #each (which should yield all your thing's elements in turn) and including Enumerable, you get >50 methods "for free".
kalusn has joined #ruby
<tsunamie>
apeiros, so you saying if I run {}.method(:find).owner where inside the {} is the method it will show me the original owner
<apeiros>
dave1984: you missed the step of telling us what the heck you're talking about
<dave1984>
apeiros: lol my bad, did I ever
<dave1984>
jekyll, though I found a irc chan for it
<zenspider_>
Ox0dea: welcome to math?
to_json has quit [Quit: Leaving.]
<Ox0dea>
zenspider_: Cicadas.
<tsunamie>
okay trying to absorb all of this, please be gental
baweaver has joined #ruby
<zenspider_>
dave1984: I think that exact code would work fine in zenweb :)
jobewan has quit [Ping timeout: 250 seconds]
<apeiros>
beware, the spider lures in the zenweb
<zenspider_>
Ox0dea: that's nice
<dave1984>
zenspider_: are you plugging something? I have no idea what that is
teclator has quit [Ping timeout: 244 seconds]
eminencehc has joined #ruby
<apeiros>
oh, lurk, not lure
<tsunamie>
okay does anyone know how I can run this on a command line?
<tsunamie>
Array.instance_method(:map).owner
opensource_ninja has joined #ruby
lacrymol1gy has joined #ruby
<zenspider_>
tsunamie: either `ruby -e 'code'` or fire up irb and do it in there
<Ox0dea>
zenspider_: "Mind of a Hacker" was a nice listen, but 1 is composite, so you're a bad cicada.
axsuul has joined #ruby
<Ox0dea>
s/composite/not prime/
nibbo has quit [Ping timeout: 244 seconds]
kies^ has quit [Remote host closed the connection]
Rickmasta has joined #ruby
nateberkopec has joined #ruby
simplyianm has joined #ruby
<lacrymol1gy>
I've got a list with hashes, and I want to map it into a list of a certain field: [{foo: 1, bar: 2}, {foo: 3, bar: 4}].pluck(:foo) => [1, 3]
Oatmeal has quit [Max SendQ exceeded]
<lacrymol1gy>
is there an idiom for this?
<zenspider_>
again: that's nice.
<tsunamie>
zenspider_, irb? I have cygwin and I just ran ruby -e "Array.instance_method(:map).owner"
<tsunamie>
and it gave me nothing back
<zenspider_>
tsunamie: you didn't ask it to print anytihng
<zenspider_>
puts or p in front
<zenspider_>
irb should work for you
<zenspider_>
if it doesn't, something is wrong
tmtwd has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
axsuul_ has joined #ruby
MiracleBlue has quit [Ping timeout: 264 seconds]
Iacobus has quit [Ping timeout: 264 seconds]
<tsunamie>
okay I think I am going to far for tonight
<tsunamie>
my brain is about to explode
<zenspider_>
lacrymol1gy: we wouldn't have a method on array specific to accessing sub-hashes. Instead, use #map: hashes.map { |h| h[:key] }
prasselpikachu has quit [Ping timeout: 264 seconds]
<netule>
tsunamie, .css is a method that allows you to use CSS selectors to search for elements
prasselpikachu has joined #ruby
<tsunamie>
netule, Hi, I get that sorry. What I am trying to give myself is the tools to find that info
<tsunamie>
in some meaning full way
<Ox0dea>
tsunamie: Codecademy never shows you #map?
trosborn has quit [Quit: trosborn]
idefine has quit [Read error: Connection reset by peer]
idefine_ has joined #ruby
<tsunamie>
Ox0dea, it gave me examples of map and how to use it. However that was never my problem. My problem was or the limited stuff that course covered are the absolut basics
krzkrz has joined #ruby
<tsunamie>
it instantiated that each object has it's own set of methodes unique to processing the object itself
mistermocha has quit [Read error: Connection reset by peer]
<tsunamie>
It never talked about how to read docs or search for which methods were avaiable to an object or how to check hieachy
mistermocha has joined #ruby
<tsunamie>
it just assumed you knew all the methodes avaiable to manipulating something. IT never gavce me the fishing rod and said. by the way. Here's how you work out which methodes can be used on the object you just created
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tsunamie>
every single example just walked throught like this. Here is a string, ow you can use CAPUP bla bla bla all these methdos
snockerton has quit [Quit: Leaving.]
<tsunamie>
sorry ranted a bit
_aeris_ has quit [Ping timeout: 265 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<netule>
that's what references are for, though. You can hardly expect them to teach you all of the interfaces for all of the classes in Ruby
<Ox0dea>
netule: Codecademy is not a "reference"; it advertises that it teaches the student how to use Ruby.