bradhe_ has quit [Remote host closed the connection]
<crome>
they mean ("update item row =row+1 WHERE item id= " + $_GET['id'])
centrex has quit [Read error: Connection reset by peer]
centrex has joined #ruby
minecoins has joined #ruby
kitak has quit [Remote host closed the connection]
The_Doctor is now known as Adran
mercwithamouth has joined #ruby
mansi has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 250 seconds]
george2|chakra has joined #ruby
dima_ has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
george2 has quit [Ping timeout: 252 seconds]
george2|chakra is now known as george2
Hobogrammer has quit [Ping timeout: 265 seconds]
centrex has quit [Ping timeout: 240 seconds]
vpretzel|964 has quit [Quit: Adios!]
thomasxie has joined #ruby
otherj has joined #ruby
linojon has joined #ruby
pu22l3r has joined #ruby
snuffeluffegus has joined #ruby
arubin has joined #ruby
thomasxie has left #ruby [#ruby]
flowerhack has quit [Quit: Connection closed for inactivity]
xeno has joined #ruby
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<xeno>
A philosophical question: Why does return fail at the end of a Proc.new { return "hi" } block like that?
<DreamingRainne>
xeno: It returns out of the calling environment, not out of just the block, I think.
dapz has joined #ruby
<DreamingRainne>
It's the reason you can do stuff like @herp.each{ |derp| return if derp > 3 }
Bumptious has joined #ruby
ccham has joined #ruby
emaxi has joined #ruby
BSaboia has quit [Ping timeout: 245 seconds]
aniM has quit [Ping timeout: 265 seconds]
mansi has joined #ruby
emaxi has quit [Remote host closed the connection]
<DreamingRainne>
I think using "lambda" instead of "Proc.new" lets "return" only return out of the block itself? Or otherwise works a little differently.
<xeno>
Yes, Dreaming...: I am just trying to wrap my mind around it with some supporting mnemonic.
<xeno>
Why, why oh why?
<xeno>
I thought using lambda just affected arguments. Perhaps the return value is technically an argument?
* DreamingRainne
shrugs.
dapz has quit [Client Quit]
aspires has quit []
sailias has joined #ruby
marr has quit [Ping timeout: 258 seconds]
marcdel has joined #ruby
<shevy>
I thought so as well
<xybre>
No, a lambda is an anonymous function, a proc is just a ball of code.
<shevy>
I rarely use Proc.new or lambda though, somehow it does not fit into the rest of my ruby code
<xybre>
Lambdas have strict arity, procs have no concept of arity and you can pass in whatever.
<havenwood>
xeno: a return from a proc returns from the method the proc is inside, but a next would just return from the proc
<xybre>
Lambdas can return becasue they are functions, procs can only return if they are called from within a function (or method).
<xybre>
Right because a proc is jsut a ball of code and has about identical semantic usage to a block, which has no arity checks and also uses next/break instead of return.
TripTastic has left #ruby [#ruby]
<DreamingRainne>
>> p = Proc.new{ |n| next "hi" if n == 3; n }; (1..3).map{|x| p.call(x)}
danshultz has quit [Remote host closed the connection]
Olipro has quit [Read error: Connection reset by peer]
danshultz has joined #ruby
no6 has joined #ruby
Slavox|AFK is now known as Slavox
mrmargolis has quit [Remote host closed the connection]
skulker has quit []
charliesome has joined #ruby
noob101 has quit [Ping timeout: 240 seconds]
HashNuke has joined #ruby
msmith_ has quit [Remote host closed the connection]
whomp has joined #ruby
Riking has joined #ruby
sdouglas has quit [Remote host closed the connection]
sigurding has joined #ruby
bthesorc_ has quit [Remote host closed the connection]
danshultz has quit [Ping timeout: 258 seconds]
Royalb15 has joined #ruby
bthesorceror has joined #ruby
robbyoconnor has joined #ruby
locriani has quit [Ping timeout: 258 seconds]
fuhgeddaboudit has joined #ruby
northfurr has joined #ruby
iamjarvo has joined #ruby
bthesorceror has quit [Ping timeout: 258 seconds]
xeno has quit [Ping timeout: 240 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
kenndel_ has joined #ruby
Photism_ has joined #ruby
Martxel_ has quit [Ping timeout: 250 seconds]
saarinen has quit [Quit: saarinen]
skysploit has joined #ruby
skysploit has quit [Changing host]
skysploit has joined #ruby
lupine has joined #ruby
sdwrage has joined #ruby
skysploit has quit [Client Quit]
kenndel has quit [Ping timeout: 258 seconds]
Photism has quit [Ping timeout: 258 seconds]
skysploit has joined #ruby
skysploit has quit [Changing host]
skysploit has joined #ruby
skysploit has quit [Client Quit]
sigurding has quit [Quit: sigurding]
skysploit has joined #ruby
skysploit has quit [Changing host]
skysploit has joined #ruby
combusean has joined #ruby
pu22l3r has quit [Remote host closed the connection]
metasansana has quit [Read error: Connection reset by peer]
r_rios has quit [Ping timeout: 265 seconds]
Spami has quit [Quit: This computer has gone to sleep]
nortel has joined #ruby
saarinen has joined #ruby
i_s has joined #ruby
zachallett has joined #ruby
omosoj_ is now known as omosoj
<nortel>
hello, how print from many threads without spliting print's outputs in one line ?
zcreative has joined #ruby
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<benzrf>
nortel: use a mutex
<nortel>
oh my god
<benzrf>
nortel: ?
<nortel>
nono, thanks for response =)
nisstyre has joined #ruby
cjbottaro has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
hamakn_ has joined #ruby
nisstyre has quit [Client Quit]
crystal77 has quit [Quit: Computer has gone to sleep.]
i_s has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
fuhgeddaboudit has quit [Ping timeout: 276 seconds]
<shevy>
nortel use a condom
zachallett has quit [Remote host closed the connection]
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
<nortel>
what mode ?
sevin has quit [Read error: Connection reset by peer]
SonicX has joined #ruby
<shevy>
the "close your eyes and through with it" mode
gigetoo has quit [Remote host closed the connection]
emaxi has joined #ruby
radic_ has joined #ruby
radic has quit [Disconnected by services]
gigetoo has joined #ruby
jlast has joined #ruby
hamakn has quit [Ping timeout: 276 seconds]
sevin has joined #ruby
braincrash has quit [Quit: bye bye]
webgen has quit [Ping timeout: 240 seconds]
Hobogrammer has joined #ruby
zz_jrhorn424 has quit [Ping timeout: 258 seconds]
arietis has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
msmith_ has joined #ruby
freerobby has quit [Quit: Leaving.]
speakingcode has joined #ruby
danshultz has joined #ruby
zz_jrhorn424 has joined #ruby
ixti has joined #ruby
braincrash has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
no6 has quit [Ping timeout: 276 seconds]
meatherly has quit [Remote host closed the connection]
meatherly has joined #ruby
arietis has quit [Ping timeout: 258 seconds]
crystal77 has joined #ruby
whomp has quit [Ping timeout: 276 seconds]
spyderma_ has joined #ruby
Bastol has joined #ruby
danshultz has quit [Remote host closed the connection]
meatherly has quit [Ping timeout: 240 seconds]
danshultz has joined #ruby
spyderman4g63 has quit [Ping timeout: 258 seconds]
whomp has joined #ruby
wallerdev has quit [Quit: wallerdev]
eka has joined #ruby
browndawg has joined #ruby
hamakn_ has quit [Remote host closed the connection]
browndawg has quit [Max SendQ exceeded]
agjacome has quit [Quit: leaving]
mostlybadfly has joined #ruby
danshultz has quit [Ping timeout: 258 seconds]
browndawg has joined #ruby
sambao21 has joined #ruby
cashnguns has quit [Remote host closed the connection]
deens has quit [Remote host closed the connection]
rkofman_ has joined #ruby
rkofman_ has quit [Client Quit]
hgl has joined #ruby
whomp has quit [Ping timeout: 245 seconds]
s3ri0us is now known as s3ri0us|away
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
sambao21 has quit [Ping timeout: 250 seconds]
whomp has joined #ruby
davispuh has quit [Remote host closed the connection]
Slavox is now known as Slavox|AFK
meatherly has joined #ruby
bluehavana has quit [Quit: Connection closed for inactivity]
kenneth has joined #ruby
Slavox|AFK is now known as Slavox
sdwrage has joined #ruby
yacks has joined #ruby
wallerdev has joined #ruby
Deele has quit [Ping timeout: 255 seconds]
Ancient has left #ruby ["Leaving"]
Celm has joined #ruby
zcreative has quit [Quit: Computer has gone to sleep.]
northfurr has quit [Quit: northfurr]
hamakn has joined #ruby
ghr has joined #ruby
locriani has joined #ruby
bthesorceror has joined #ruby
michaeldeol has joined #ruby
hgl has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 265 seconds]
locriani has quit [Ping timeout: 258 seconds]
hgl has joined #ruby
msmith_ has quit [Remote host closed the connection]
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hgl has quit [Client Quit]
funktor has joined #ruby
mikeric has quit []
crystal77 has quit [Quit: Computer has gone to sleep.]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BSaboia has joined #ruby
kenneth has joined #ruby
bloodsub-mobile has joined #ruby
Jetchisel has joined #ruby
phinfonet has quit []
bloodsub-mobile has quit [Read error: Connection reset by peer]
Jeff_D has joined #ruby
Alina-malina has quit [Ping timeout: 240 seconds]
<Jeff_D>
rbenv question? how do people install 2.1 with a newer version of OpenSSL than the default 1.0.1e (which is vulnerable to Heartbleed)?
twidx has quit [Quit: Connection closed for inactivity]
locriani has joined #ruby
<centrx>
Jeff_D, You can always recompile OpenSSL with heartbeats off
<centrx>
Jeff_D, Is it not possible to use the newer library version with Ruby 2.1?
vc7 has joined #ruby
Celm has quit [Remote host closed the connection]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sguselnikov has joined #ruby
<Jeff_D>
centrx: If I'm compiling by hand, sure — but I'm leading a group of developers and we've standardised on rbenv to be able to test against different Rubies. The 2.1 install as installed by rbenv pushes 1.0.1e onto the system, which is just wrong
vc7 has quit [Remote host closed the connection]
tjr9898 has joined #ruby
vc7 has joined #ruby
<havenwood>
Jeff_D: You can update ruby-build to one that links to a patched openssl, or use a tool like ruby-install that isn't vulnerable since it links against the package manager's openssl.
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Jeff_D>
havenwood: ok… researching how to do that now. Thanks
<havenwood>
Jeff_D: or you need ruby-build 20140408 or later
<Jeff_D>
havenwood: I see; much better than the rbenv plugin we've been using. And I saw 0408 on the last update of rbenv; I'll try that. Thanks again; should be able to clean up things now. :)
Spami has joined #ruby
Hytosys has joined #ruby
sguselnikov has quit [Client Quit]
arietis has joined #ruby
ixti has quit [Ping timeout: 265 seconds]
Jeff_D has quit [Quit: JMP $]
Phoenixz has quit [Ping timeout: 240 seconds]
funktor has quit [Remote host closed the connection]
whomp has quit [Ping timeout: 240 seconds]
jlast has joined #ruby
SvenOostenbrink has joined #ruby
centrx has quit [Quit: All this computer hacking is making me thirsty]
ironsand has quit [Ping timeout: 240 seconds]
jlast has quit [Ping timeout: 250 seconds]
kevinykc_ has quit [Quit: Computer has gone to sleep.]
anaeem1_ has joined #ruby
helpD has joined #ruby
i_s has joined #ruby
ixti has joined #ruby
jason_ has quit [Remote host closed the connection]
jason_ has joined #ruby
iamjarvo has quit [Ping timeout: 250 seconds]
r_rios has joined #ruby
helpD has quit [Ping timeout: 240 seconds]
meatherly has quit [Remote host closed the connection]
sdouglas has quit [Remote host closed the connection]
codebro has joined #ruby
freerobby has joined #ruby
zcreative has joined #ruby
oo_ has quit [Remote host closed the connection]
mr_snowf1ake has quit [Ping timeout: 240 seconds]
sdouglas has joined #ruby
ksinkar has joined #ruby
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ksinkar>
I am compiling ruby from source. Do I have to pass any specific flags to the ./compile if I want to compile my ruby with readline support?
oo_ has joined #ruby
codebro has quit [Ping timeout: 252 seconds]
freerobby has quit [Ping timeout: 265 seconds]
<havenwood>
ksinkar: what OS?
agent_white has quit [Read error: Connection reset by peer]
agent_white has joined #ruby
<havenwood>
ksinkar: you often don't need to specify, but for example on OSX you can explicitly link to readline, etc, like: --with-opt-dir="$(brew --prefix readline)"
__class__ has quit [Ping timeout: 276 seconds]
<ksinkar>
havenwood: CentOS 6
<havenwood>
ksinkar: you shouldn't need to specify any flag
cj3kim_ has quit [Read error: Connection reset by peer]
<ksinkar>
havenwood: after having installed ruby and then deployed a rails application, I found that $rails console will not work because of readline errors
<agent_white>
Hanmac: Whoa! That's pretty cool... I actually stumbled on cycle since I was trying to see if I could have next loop to the start of the array.
<agent_white>
Goddamn theres so many cool things I have yet to find.
<DreamingRainne>
agent_white: "retry" should loop it back to the start as well, even within a plain "each" block.
jlast has quit [Ping timeout: 276 seconds]
doritostains has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<agent_white>
Hanmac: I need to play with Enumerators... haven't really even touched them.
<agent_white>
DreamingRainne: What do you mean by that?
Hanmac has quit [Ping timeout: 245 seconds]
wildtype has joined #ruby
<DreamingRainne>
agent_white: You said "I was trying to see if I could have next loop to the start of the array". That's what "retry" does: it starts the loop over from the beginning.
davedev24 has quit [Remote host closed the connection]
<DreamingRainne>
(Or the block in general, starting from the call it's attached to.)
ponga has joined #ruby
ponga has quit [Changing host]
ponga has joined #ruby
Es0teric has joined #ruby
davedev24 has joined #ruby
blackmesa has joined #ruby
freerobby has joined #ruby
jack_rabbit has quit [Ping timeout: 240 seconds]
<agent_white>
DreamingRainne: So like... I could turn the array to an enum, then just catch the "StopIteration" exception and call retry?
<DreamingRainne>
If you catch it within the block body, yes, I think so.
senayar_ has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
davedev24 has quit [Ping timeout: 265 seconds]
Es0teric has quit [Ping timeout: 265 seconds]
freerobby has quit [Ping timeout: 276 seconds]
<DreamingRainne>
>> runs = 0; (1..5).each{|n| if n == 5; runs += 1; retry unless runs == 3; else print "#{n},"; end }
<agent_white>
I'm so proud. This "cycle" thing means my IRC client can have multiple channel windows! WOOO!
<DreamingRainne>
So 1.9+ basically doesn't have "retry" anymore? That example is kinda exactly how it's supposed to work.
<DreamingRainne>
agent_white: Why would you need to cycle in order to have multiple channel windows?
treehug88 has quit []
<agent_white>
DreamingRainne: Ah I'm focusing on having a single "main" window, that can be cycled to different channels for now... I'll add in tiling later ;P
<agent_white>
Can't let my head explode quite yet!
<DreamingRainne>
benlieb: Perhaps force encoding to ISO-8859-1 or something like that. Not sure offhand how to do that... <looks>
<benlieb>
DreamingRainne: ruby 2.0
<benlieb>
I'm not sure that will help.
<Urnas>
? What learn me? RoR3 or RoR4?
rvraghav93 has quit [Read error: Connection reset by peer]
ghr has quit [Ping timeout: 265 seconds]
<jacky>
RoR7
<Urnas>
And what is the lasy.version supported RoR3?
<benlieb>
Urnas: ruby 2.0. You might as well start learning ror4
<yxhuvud>
No reason to learn something that isn't new, unless your work demands it.
<Urnas>
*last
lsmola has joined #ruby
Ancient has joined #ruby
ashleyis has quit [Ping timeout: 252 seconds]
<DreamingRainne>
benlieb: When you get the string, try doing: string.force_encoding("ISO-8859-1")
<Urnas>
Ok , ruby 1
<DreamingRainne>
Either because it *is* ISO-8859-1, or to at least get the thing to quit complaining about it.
<Urnas>
Ruby 1.9 the last version is supported ror3?
<benlieb>
DreamingRainne: but I don't know what it is. The log file is 2.5G. There could be all kinds of sh*t in there
nerium has joined #ruby
ashleyis has joined #ruby
cj3kim has quit [Remote host closed the connection]
dkannan has quit [Quit: dkannan]
cj3kim has joined #ruby
nerium has quit [Client Quit]
_justin has joined #ruby
banister has joined #ruby
helpD has joined #ruby
ponga has joined #ruby
ponga has quit [Changing host]
ponga has joined #ruby
<DreamingRainne>
If it's webpage logs, then set it to whatever encoding the webpages use. If in doubt, just try ISO-8859-1, and the worst you'll get is mojibake (misinterpreted gibberish) if someone sent text encoded in neither UTF-8 nor 8859-1. In any case, it should at least process.
<DreamingRainne>
Or set them to binary, maybe.
<benlieb>
DreamingRainne: charset=utf-8
atmosx has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
atmosx has joined #ruby
cj3kim has quit [Ping timeout: 245 seconds]
mengu has quit [Remote host closed the connection]
oponder has joined #ruby
shashank_rs has quit [Quit: shashank_rs]
timonv has quit [Remote host closed the connection]
agent_white has quit [Quit: gnight]
<DefV_>
16
rm_ has joined #ruby
donnoc has joined #ruby
AlSquire has joined #ruby
Celm has joined #ruby
sski has quit [Remote host closed the connection]
sski has joined #ruby
jacky has quit [Excess Flood]
<davzie>
For christ's sake. I need a REST client like POSTMAN that I can use without Google Chrome. I refuse to install that pile of shite now they are trying to push Google Now on me.
<davzie>
I can't find one.
senayar has joined #ruby
Celm has quit [Ping timeout: 258 seconds]
senayar has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 245 seconds]
thomasxie has joined #ruby
senayar has joined #ruby
jacky has joined #ruby
sski has quit [Ping timeout: 240 seconds]
<olivier_bK>
how i can pass a gsub on array inside the hash ?
arietis has quit [Quit: Computer has gone to sleep.]
<Hanmac>
olivier_bK: hm i would recomend that your parser will be improved so you get ["xerox"] instead of [" 'xerox';\n"]
senayar has quit [Ping timeout: 240 seconds]
<olivier_bK>
i try that to
<olivier_bK>
:)
kaspergrubbe has joined #ruby
oo_ has quit [Remote host closed the connection]
<olivier_bK>
do you know how i can remove the ;\n
senayar has joined #ruby
dangerousdave has joined #ruby
rm_ has quit [Ping timeout: 250 seconds]
jlast has joined #ruby
dkannan has joined #ruby
timonv has joined #ruby
decoponio has joined #ruby
nshbrown has joined #ruby
mityaz has quit [Ping timeout: 276 seconds]
emaxi has joined #ruby
<nshbrown>
trying to get rbenv on OSX to use the proper bin within the shim directory.. it keeps defaulting to the /usr/bin. Any ideas how to get it to always default to the .ruby-version bin/rails path instead of the system one?
<havenwood>
olivier_bK: hard to tell what you mean from your input example, but:
kitak has quit [Remote host closed the connection]
lsmola has joined #ruby
tkuchiki has quit [Ping timeout: 252 seconds]
mikecmpbll has joined #ruby
sdouglas has quit [Ping timeout: 276 seconds]
Deele has joined #ruby
tesuji has joined #ruby
yfeldblum has joined #ruby
browndawg has joined #ruby
sepp2k has joined #ruby
crzrcn has joined #ruby
shashank_rs has quit [Ping timeout: 276 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
mixonic has joined #ruby
roolo has quit [Quit: Leaving...]
dangerousdave has quit []
crzrcn has quit [Ping timeout: 240 seconds]
billiam_ has joined #ruby
Hytosys has quit [Quit: Hytosys]
atno has joined #ruby
vlad_starkov has joined #ruby
phoo1234567 has joined #ruby
binw has quit [Read error: Connection reset by peer]
shashank_rs has joined #ruby
mengu has quit [Read error: Connection reset by peer]
donnoc_ has quit [Ping timeout: 265 seconds]
Olipro has joined #ruby
mengu has joined #ruby
yacks has joined #ruby
binw has joined #ruby
crazymykl has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
roolo has joined #ruby
charlies_ has joined #ruby
mengu has quit [Ping timeout: 245 seconds]
Olipro has quit [Ping timeout: 246 seconds]
<atmosx>
in sequel can I destroy methods that has been associated with one_to_many tc?
p8952 has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 265 seconds]
msmith_ has joined #ruby
mixonic has quit [Quit: *zonk*]
j416 has joined #ruby
atno has quit [Remote host closed the connection]
Olipro has joined #ruby
<j416>
what's the best way to trap ^C to do cleanup before program exit?
emaxi has joined #ruby
<j416>
should I trap() it, rescue Interrupt?
<j416>
rescue then throw+catch?
<DreamingRainne>
j416: I would think rescuing Interrupt would be best.
shime has joined #ruby
Celm has joined #ruby
<j416>
DreamingRainne: thanks. I'll investigate further and use that if nothing turns up.
grieg has joined #ruby
<DreamingRainne>
Or, if I understand it correctly, use "ensure" sections to do cleanup. That should work with other exceptions too, not just Ctrl+C type.
Thanatermesis has joined #ruby
Thanatermesis has joined #ruby
<momomomomo>
j416: rescue SystemExit
<j416>
DreamingRainne: good idea.
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
grieg has quit [Changing host]
grieg has joined #ruby
<j416>
momomomomo: that didn't do it
<j416>
SystemExit isn't thrown on ^C
<shevy>
j416, call this method in your class at creation time: def register_sigint; Signal.trap('SIGINT') { exit }; end
<momomomomo>
rescue SystemExit, Interrupt
<j416>
at least not in my case
<momomomomo>
but ensure at the end of your file is the best for cleanup anyhow, as DreamingRainne
<j416>
momomomomo: yes, it feels like the best way
atno has joined #ruby
emaxi has quit [Ping timeout: 258 seconds]
grieg has quit [Client Quit]
kyle__ has quit [Ping timeout: 240 seconds]
grieg has joined #ruby
<j416>
but I stil, want to eat the exception (or else it'll be shown to the user)
Celm has quit [Ping timeout: 250 seconds]
rm_ has joined #ruby
klaut has quit [Remote host closed the connection]
<DreamingRainne>
Try, just for testing: "rescue Exception => ex" and then print out info about "ex", such as its class, to see what kind it is.
<DreamingRainne>
Then 'rescue' that.
Martxel has quit [Quit: Leaving]
Martxel has joined #ruby
<momomomomo>
rescue SystemExit, Interrupt should do it
aspiers has quit [Ping timeout: 240 seconds]
<momomomomo>
if not, then you might be on a different thread
<DreamingRainne>
Or 'rescue Exception' anyway so the user doesn't wind up with a stacktrace dumped in their lap.
<momomomomo>
or you could just trap(“sigint”)
<j416>
shevy: that still seems to throw the exception
<j416>
DreamingRainne: it's Interrupt alright, and that works just fine. The reason I was asking was to find out if perhaps there is a reason not to use it.
<j416>
I will follow momomomomo's suggestion and capture those two
<j416>
momomomomo: thanks for that link, I was just vaguely remembering something about never rescuing Exception
<momomomomo>
no problem, time to get back to reading :p
kayloos has joined #ruby
<DreamingRainne>
I feel kinda wary of the idea of trapping SIGINT (or other signals) because (A) the handler happens outside the running code's context, thus you can't run local 'ensure' blocks, do cleanup etc; (B) isn't it kinda tied to Unix-like systems? (There's certainly worse system types to be bound to, though.)
mixonic has quit [Client Quit]
kyle_ has joined #ruby
<shevy>
j416 what do you mean with "throw" an exception? my method does not "throw" anything
nvrch has joined #ruby
<momomomomo>
shevy: just a note - that won’t work as expected in terminal
<shevy>
it works perfectly fine
<momomomomo>
trapping sigint?
<shevy>
yes
<shevy>
ctr-c interrupts the program
tkuchiki has joined #ruby
<j416>
shevy: s/throw/raise/, sorry.
crzrcn has joined #ruby
<j416>
shevy: and what I meant was, it doesn't keep the exception from getting raised
jlast has joined #ruby
nism has joined #ruby
<momomomomo>
Hm, guess it does work on 1.9
dblessing has joined #ruby
<j416>
this is 1.9.3
<momomomomo>
either way, i would do an ensure block to clear up your shit
<apeiros>
trapping sigint worked in all rubies for the last 10+ years
<momomomomo>
and if you want to rescue, get specific with SystemExit, Interrupt
<shevy>
the pickaxe book encouraged blanket "rescue Exception" :(
<momomomomo>
apeiros: in irb on 1.8 ctrl-c sent IRB::Abort according to some people on SO
<apeiros>
and I'd assume it even worked in all versions
<j416>
it's not that much cleanup, it's more like I want to get rid of the stack trace and show something less scary to the user
mrnugget has joined #ruby
<momomomomo>
apeiros: thus, you wouldn’t get the same result as on 1.9
<apeiros>
momomomomo: you know, the *IRB* part in *IRB::Abort* should tell you something
sambao21 has quit [Ping timeout: 240 seconds]
<j416>
:D
yfeldblum has joined #ruby
<momomomomo>
apeiros: I’m talking about using it in irb.
Arnvald has joined #ruby
<shevy>
irb can be a weird beast
<momomomomo>
"momomomomo: shevy: just a note - that won’t work as expected in terminal"
AlexRussia has quit [Quit: Konversation terminated!Good bye!]
jlast has quit [Read error: No route to host]
oo_ has quit [Remote host closed the connection]
jlast_ has joined #ruby
<momomomomo>
:s/terminal/irb
AlexRussia has joined #ruby
oo_ has joined #ruby
<shevy>
you guys often replace words on IRC!!!
<shevy>
s/words/clothes/
dkannan has quit [Quit: dkannan]
<momomomomo>
people often miss the context due to the scrolling nature and jump in - i’m guilty of that too :p
<j416>
blergh ^D doesn't seem to send SIGQUIT when waiting for user input (gets) :/
banister has joined #ruby
jamto11 has quit [Ping timeout: 276 seconds]
<j416>
either that or gets rescues it and returns ''
<j416>
oh well
msmith_ has quit [Remote host closed the connection]
SilkFox has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
treehug88 has joined #ruby
davedev24 has quit [Remote host closed the connection]
SilkFox has joined #ruby
davedev24 has joined #ruby
kyle_ has joined #ruby
crome has quit [Ping timeout: 240 seconds]
<Mon_Ouie>
If you hit ^D in gets EOF is sent to stdin and therefore it returns nil (or whatever was typed in before if anything)
garndt has joined #ruby
enebo has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
anaeem1__ has joined #ruby
mikecmpbll has joined #ruby
<j416>
Mon_Quthanks for confirming my suspicion
crome has joined #ruby
<j416>
I'll have to handle empty input then instead of trying to trap ^D
thomasxie has joined #ruby
<DreamingRainne>
Yeah. For example, that's what you'd use if you do "cat > derp.txt", type in stuff, then Ctrl+D to finish. In Ruby, you'd detect that by '$stdin.gets' returning nil, which you can take to mean EOF.
<MacTrash>
Is there a nicer way to put values for a certain key in a hash into an array than this? => @answer_ids = Array.new; @answers.each {|item| @answer_ids.push(item[:answer_id])}
jason_ has quit [Ping timeout: 265 seconds]
<MacTrash>
I'm new to the whole functional construct thing, but it seems this is a candidate.
jmeeuwen has quit [Read error: Connection reset by peer]
SHyx0rmZ has joined #ruby
jmeeuwen_ is now known as jmeeuwen
carraroj has joined #ruby
<olivier_bK>
when i try to export my array in csv i get configuration_securicmm.mydomain.net.php,["securicmm", "https://securicmm.mydomaine.net", "securicmm"]
Milly_Bays has quit [Quit: Leaving]
lmickh has joined #ruby
<olivier_bK>
do you know how i can remove the hook
<olivier_bK>
?
creativeembassy has joined #ruby
jason_ has joined #ruby
kayloos_ has joined #ruby
hgl has joined #ruby
duggiefresh has joined #ruby
SilkFox has joined #ruby
_bart has joined #ruby
arietis has joined #ruby
kayloos has quit [Ping timeout: 245 seconds]
SHyx0rmZ has quit [Ping timeout: 240 seconds]
emaxi has quit [Remote host closed the connection]
frank_____ has joined #ruby
jamto11 has joined #ruby
msmith_ has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
anaeem1_ has joined #ruby
freerobby has joined #ruby
jwest has quit [Quit: WeeChat 0.4.1]
donnoc_ has quit [Ping timeout: 245 seconds]
rm_ has quit [Remote host closed the connection]
rm_ has joined #ruby
ace_striker has joined #ruby
ace_striker has quit [Changing host]
ace_striker has joined #ruby
ace_striker has joined #ruby
ace_striker has quit [Changing host]
cj3kim_ has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
<shevy>
how should others be able to reproduce this problem
dik_dak has quit [Quit: Leaving]
rm_ has quit [Ping timeout: 265 seconds]
snath has quit [Ping timeout: 265 seconds]
nvrch has quit [Quit: nvrch]
etqqkoiflwhb has joined #ruby
sambao21 has joined #ruby
dik_dak has joined #ruby
cj3kim has quit [Ping timeout: 276 seconds]
sdouglas has joined #ruby
Merks has joined #ruby
treehug88 has joined #ruby
anaeem1 has quit [Remote host closed the connection]
grayWolf is now known as Speed
tesuji has joined #ruby
zarul has quit [Remote host closed the connection]
<pbergsmann>
hi @all! i’m trying to install the mysql gem on a debian wheezy server with mariadb but it fails with “checking for mysql_ssl_set()... *** extconf.rb failed ***” does anyone have an idea? i tried everything in every google result :)
mehlah has joined #ruby
<ddv>
did you install mysql development headers?
cj3kim_ has quit [Read error: Connection reset by peer]
<pbergsmann>
i installed the mariadb ones, yes and installing the mysql2 gem works btw
<ddv>
pbergsmann, also you should look at the relevent part in your build log
cj3kim has joined #ruby
AlexRussia has quit [Quit: Konversation terminated!Good bye!]
<pbergsmann>
ok, i should have thought about looking into the mkmf.log by myself…it’s full of undefined references to openssl…i’ll look into that… THX!
ghr has joined #ruby
momomomomo has joined #ruby
shtirlic has quit [Client Quit]
crystal77 has joined #ruby
anaeem1 has quit [Remote host closed the connection]
anaeem1 has joined #ruby
Al__ has joined #ruby
shtirlic has joined #ruby
<bricker`LA>
/join #rubyonrails
ghr has quit [Ping timeout: 250 seconds]
<bricker`LA>
... well, go on then.
anaeem1 has quit [Ping timeout: 252 seconds]
rayners has joined #ruby
<ddv>
pbergsmann, no problem
hoelzro has quit [Remote host closed the connection]
mehlah has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby
<pbergsmann>
ddv: do you have any advice how to force some openssl lib directory when installing the mysql gem?
kerin has joined #ruby
kpshek has joined #ruby
sigurding has quit [Ping timeout: 276 seconds]
bricker`LA has quit [Ping timeout: 250 seconds]
sigurding has joined #ruby
bricker`LA has joined #ruby
jason_ has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
bogeyd6 has joined #ruby
<ddv>
pbergsmann, I think you need to figure out what dependency you are missing. It should pickup ssl dev headers automatically
<ddv>
pbergsmann, how are you compiling ruby?
<ddv>
pbergsmann, are you using rbenv/rvm?
<pbergsmann>
ddv: i forgot to mention, that i’m inside a omnibus package :)
kobain has joined #ruby
blackmesa has joined #ruby
<benzrf>
shit
<benzrf>
how do i make a Time from hour/minute
<benzrf>
or HMS i guess
dima_ has joined #ruby
<ddv>
strfparse?
lmickh has quit [Ping timeout: 240 seconds]
<ddv>
something like that
<benzrf>
>.>
<Hanmac>
shevy currently "rwx: 50.68% documented"
Letopanyu1 has joined #ruby
pygospa has joined #ruby
lmickh has joined #ruby
mehlah has joined #ruby
vpretzel_ has joined #ruby
<benzrf>
how can i set the h/m/s for a Time >.<
<benzrf>
or make a new one w/ those values
butblack has joined #ruby
Celm has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
Es0teric has quit [Quit: Computer has gone to sleep.]
<foit3>
Hi. anybody knows how i can delete a symlink within ruby? tried File.unlink(f), but got Operation not permitted @ unlink_internal . (google didn't help)
sski has quit [Remote host closed the connection]
olivier_bK has quit [Ping timeout: 245 seconds]
sdwrage has joined #ruby
pietr0 has quit [Quit: pietr0]
sski has joined #ruby
supersym has joined #ruby
<lupine>
foit3, sounds like you don't have permissions to delete the symlink at all
<lupine>
unlink is the right call
nomadic has quit [Ping timeout: 246 seconds]
lkba has quit [Ping timeout: 258 seconds]
<foit3>
lupine: well its lrwxr-xr-x and the ruby app did create the symlink
<lupine>
if Kernel.system("rm symlink") works, then it's not a permissions issue
rundll32 has joined #ruby
djbkd has joined #ruby
<foit3>
lupine: i ll try
lmickh has quit [Quit: No Ping reply in 180 seconds.]
bradsmith has joined #ruby
<lupine>
(for removing files, IIRC, the permissions of the directory also come into play - but if you can create, you should be able to delete)
hamakn has quit [Remote host closed the connection]
arubincloud has joined #ruby
lmickh has joined #ruby
sski has quit [Ping timeout: 240 seconds]
<lupine>
I've just tested unlink here and it does what I'd expect to a symlink
nomadic has joined #ruby
`nik` has quit [Remote host closed the connection]
arietis has joined #ruby
<lupine>
so, I just upgraded a large, complicated ruby1.8 process that supervises a few hundred other processes and does other stuff to ruby1.9
<lupine>
one job has gone from 60 seconds to 4
<rundll32>
lupin, what is the best software for ruby that works with c language?
Al__ has quit [Quit: Al__]
dima_ has joined #ruby
<lupine>
I don't know what that is, rundll32
<lupine>
ffi?
kevind has joined #ruby
<rundll32>
i mean the the best framework ?
<lupine>
i still don't know what that is
troyready has joined #ruby
<lagweezle>
lupine: wow. O.O
<lagweezle>
That's a NICE speed up.
<lupine>
yeah, I'm quite happy
bean has joined #ruby
<foit3>
lupine: thx for your help. unlink didnt work for me, but delete did. i had another issue. not all files i wanted to delete were symlinks but folders too
<lupine>
you're not on a broken platform, are you?
<lupine>
windows or osx or something like that
<lupine>
lagweezle, yeah, I had an idea that 1.9 would be faster, but in my head this transition was going to be the first in many optimisation steps
<lupine>
but now I can sit back and drink cider all easter
ksinkar has quit [Ping timeout: 250 seconds]
oo_ has joined #ruby
sski has joined #ruby
<rundll32>
lupin, can you answer one question?
<lupine>
if i can
sdwrage has quit [Quit: This computer has gone to sleep]
tesuji has joined #ruby
<rundll32>
is twitter still runs ruby in its frontend?
etqqkoiflwhb has joined #ruby
<lupine>
no, I believe they moved away
<rundll32>
they moved away to java right?
<baweaver>
Scala
<lupine>
don't remember, they blogged extensively about it
<baweaver>
They still use a lot of Ruby
Morkel_ has joined #ruby
<rundll32>
they told they still ruby in its frontend ui.
sdwrage has joined #ruby
nomadic has quit [Quit: -bye-]
<baweaver>
Anything requiring large scale concurrency, you'd be a fool to advocate pure Java.
<lupine>
I'd be surprised, it's almost entirely javascript
ghr has joined #ruby
butblack has joined #ruby
nomadic has joined #ruby
<lupine>
go is definitely growing on me for both high and low-concurrency applications
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
qba73 has quit []
vpretzel|bugsqua is now known as vpretzel|1301
<rundll32>
but i found that bootstrap is written in java script but wikipedia says they still using ruby on their frontend.
sdwrage has quit [Quit: This computer has gone to sleep]
marcdel has quit [Ping timeout: 265 seconds]
ashleyis has joined #ruby
Spami has joined #ruby
crzrcn has joined #ruby
wallerdev has quit [Quit: wallerdev]
michaeldeol has joined #ruby
r0nin_ has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
x77686d has quit [Quit: x77686d]
<j416>
shevy: lol what
<j416>
rmorello|swim...
bradhe has joined #ruby
rm_ has quit [Ping timeout: 258 seconds]
<j416>
shevy: this is never going to end is it
<j416>
:D
* shevy
shevy|naked
<shevy>
ack
<j416>
www
<j416>
lol
<shevy>
that was a nick change fail
shevy is now known as shevy|naked
<shevy|naked>
there we go
<j416>
sexy
larsam has quit [Quit: larsam]
<shevy|naked>
see how seldom I use that command
marcdel has joined #ruby
shevy|naked is now known as shevy
<shevy>
it's that dark corner of IRC
_justin has joined #ruby
Czupa has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
charliesome has quit [Client Quit]
coderhs has joined #ruby
kpshek has quit []
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Vovko has quit []
havenwood has joined #ruby
crzrcn has quit [Quit: Leaving.]
timonv has joined #ruby
senayar has joined #ruby
<Hanmac>
shevy: i did say that rwx has currently > 50% documented of existing code ... and there was no reaction from you, are you not interested anymore? *sad face*
ace_striker has quit [Ping timeout: 240 seconds]
frank_____ has quit [Quit: Connection closed for inactivity]
cj3kim_ has quit [Remote host closed the connection]
supersym has quit []
toastynerd has quit [Remote host closed the connection]
lsmola has quit [Ping timeout: 245 seconds]
Doppp has quit [Ping timeout: 276 seconds]
lkba has joined #ruby
<shevy>
Hanmac I woke up about like 20 minutes ago or such
klaut has quit [Remote host closed the connection]
centipedefarmer has quit [Ping timeout: 276 seconds]
x77686d has joined #ruby
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
sski has joined #ruby
CaptainJet has joined #ruby
mattsp1290 has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 265 seconds]
rylev has joined #ruby
freerobby has joined #ruby
roolo has quit [Quit: Leaving...]
freerobby1 has quit [Read error: Connection reset by peer]
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wallerdev has joined #ruby
_justin has quit [Quit: _justin]
freerobby1 has joined #ruby
acoyfellow has quit [Ping timeout: 276 seconds]
lolmaus has joined #ruby
<wallerdev>
food morning
freerobby has quit [Read error: Connection reset by peer]
twidx has joined #ruby
dumdedum has quit [Quit: foo]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lele has quit [Ping timeout: 246 seconds]
mansi_ has quit [Remote host closed the connection]
mrnugget has quit [Quit: mrnugget]
mansi_ has joined #ruby
lw has joined #ruby
SilkFox has joined #ruby
GaryOak_ has joined #ruby
duggiefresh has quit [Remote host closed the connection]
<Eiam>
whats blah = -> (stuff) ?
<Eiam>
i tried googling for ruby symbols -> and didn't turn up anything constructive
<Eiam>
from reading the code it looks like some kind of lambda shorthand
<wallerdev>
you need a {}
<wallerdev>
wont work like that
<wallerdev>
search stabby block
<wallerdev>
thats the official name lol
freerobby has joined #ruby
camilasan has joined #ruby
aspires has quit []
freerobby has quit [Read error: Connection reset by peer]
freerobby2 has joined #ruby
<Eiam>
okay so it is a lambda shorthand
freerobby1 has quit [Ping timeout: 265 seconds]
<Eiam>
at least i could decipher the code properly
<Hanmac>
wallerdev: stabby block/lambda always looks like some kind of Brutus act ... ;P
mansi_ has quit [Ping timeout: 258 seconds]
<Eiam>
so what is you guys opinion on writing a lambda then .call on an array with the lambda passed in, vs just putting the contents of the function inside an .each or .map on the array itself?
<Eiam>
cause i find the second to be more obvious, and the first to be... wankery?
<Eiam>
its less immediately obvious and unless you intend on calling the lambda repeatedly elsewhere, provides no value
<slash_nick>
Eiam: i dunno... gist an A vs B for me?
Kricir has quit [Remote host closed the connection]
mark_locklear has quit [Ping timeout: 250 seconds]
AlSquire has quit [Quit: This computer has gone to sleep]
aspires has joined #ruby
duggiefresh has joined #ruby
<wallerdev>
Eiam: dont add complexity you dont need haha
bradhe has quit [Remote host closed the connection]
Doppp has quit [Ping timeout: 240 seconds]
simono has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
<Eiam>
that was my sentiment but maybe I'm biased
<Eiam>
my boss said "I rewrote some of your code"
heftig has quit [Quit: Quitting]
<Eiam>
so i read the source diffs and was like.. ಠ_ಠ you made my code worse, not better.
<shevy>
lol
kenneth has joined #ruby
<wallerdev>
maybe he just discovered lambdas and was excited to use them everywhere
<shevy>
Eiam I find that procs and lambdas in general are at odds with the rest of my code
roland has joined #ruby
<wallerdev>
happens to the best of us
<Eiam>
wallerdev: he's totally into this wolfram alpha could computing thing
<Eiam>
which is very functional
<shevy>
adding a new syntax -> only exacerbates on that situation
<Eiam>
so yes, i think he was looking for an itch to scratch in some way
<Hanmac>
Eiam good that you dont need to read my C++ macros ;P
andy___ has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
renier has joined #ruby
andy___ has joined #ruby
lele has joined #ruby
ukd1 has joined #ruby
sailias has quit [Ping timeout: 265 seconds]
yfeldblum has joined #ruby
zigomir has quit [Remote host closed the connection]
phansch has joined #ruby
JohnBat26 has joined #ruby
etqqkoiflwhb has quit [Ping timeout: 240 seconds]
mjs2600 has quit [Remote host closed the connection]
kpshek has quit []
simono has joined #ruby
no6 has joined #ruby
nircUser has joined #ruby
etqqkoiflwhb has joined #ruby
<shevy>
dumdedum
endash_ has joined #ruby
nircUser has left #ruby [#ruby]
mjs2600 has joined #ruby
SvenOostenbrink has joined #ruby
pu22l3r has joined #ruby
senayar_ has joined #ruby
zcreative has joined #ruby
benzrf is now known as benzrf|offline
anaeem1 has quit [Remote host closed the connection]
mjs2600 has quit [Remote host closed the connection]
anaeem1 has joined #ruby
bklane has joined #ruby
<bklane>
so I am creating a user object that has 1 of 4 different roles. I am unsure if it would be best to make this attribute a string or a integer that correlates to a role. Any thoughts?
timgauthier has joined #ruby
senayar has quit [Ping timeout: 258 seconds]
<j416>
bklane: symbol?
etqqkoiflwhb has quit [Ping timeout: 252 seconds]
timonv has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
timonv has joined #ruby
<bklane>
j416: can you set an attribute column as a symbol with rails?
<j416>
never used rails, sorry
timonv has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
butblack has quit [Ping timeout: 258 seconds]
mjs2600 has joined #ruby
x1337807_ has joined #ruby
yfeldblu_ has joined #ruby
rayners has quit [Remote host closed the connection]
butblack has joined #ruby
simono has quit [Ping timeout: 276 seconds]
<bklane>
hmmm, alright thanks
<j416>
>.>
anaeem1 has quit [Ping timeout: 276 seconds]
etqqkoiflwhb has joined #ruby
helpD has joined #ruby
timgauthier has quit [Client Quit]
yfeldblum has quit [Ping timeout: 240 seconds]
evenix_ has joined #ruby
evenix has joined #ruby
jwest has joined #ruby
duggiefresh has quit [Read error: Connection reset by peer]
duggiefresh has joined #ruby
_justin has joined #ruby
x1337807x has quit [Ping timeout: 265 seconds]
<Hanmac>
bklane: #RubyOnRails
kpshek has joined #ruby
kpshek has quit [Client Quit]
mark_locklear has joined #ruby
<Hanmac>
bklane: but about ERM, I would make a role table there is it listed, and then use some kind of User has many Roles ... that should make an m-n relation automaticlly
dapz has joined #ruby
aspires has quit []
rylev has quit [Remote host closed the connection]
senayar_ has quit [Remote host closed the connection]
benzrf is now known as benzrf|offline
Milly_Bays has joined #ruby
quitobro has quit [Remote host closed the connection]
x1337807_ has quit [Ping timeout: 265 seconds]
bradsmith has quit [Remote host closed the connection]
combusean has joined #ruby
andy___ has quit [Remote host closed the connection]
rmorello|swim has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sski has quit [Remote host closed the connection]
andy___ has joined #ruby
sski has joined #ruby
benzrf|offline is now known as benzrf
stonevil has joined #ruby
mehlah has quit [Quit: Leaving...]
aspires has joined #ruby
creativeembassy has quit [Quit: FO SHO]
andy___ has quit [Read error: Connection reset by peer]
funktor has quit [Remote host closed the connection]
iamjarvo has joined #ruby
freerobby2 has quit [Quit: Leaving.]
andy___ has joined #ruby
pwh has quit []
benzrf is now known as benzrf|offline
benzrf|offline is now known as benzrf
funktor has joined #ruby
bradhe has joined #ruby
pu22l3r has quit [Remote host closed the connection]
sski has quit [Ping timeout: 240 seconds]
pu22l3r has joined #ruby
centrx has joined #ruby
Adrao has joined #ruby
aspires has quit [Ping timeout: 240 seconds]
msmith_ has quit [Remote host closed the connection]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aspires has joined #ruby
msmith_ has joined #ruby
funktor has quit [Ping timeout: 240 seconds]
qhartman has joined #ruby
shashank_rs has joined #ruby
kayloos_ has quit [Ping timeout: 252 seconds]
nomadic has quit [Ping timeout: 246 seconds]
keen_____ has joined #ruby
wallerdev has quit [Quit: wallerdev]
nomadic has joined #ruby
keen____ has quit [Ping timeout: 265 seconds]
marr has quit [Ping timeout: 245 seconds]
freerobby has joined #ruby
nomadic has quit [Changing host]
nomadic has joined #ruby
wallerdev has joined #ruby
kobain has quit []
mark_locklear has quit [Ping timeout: 240 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
j416 has quit [Quit: o/]
butblack has quit [Quit: butblack]
timonv has joined #ruby
cj3kim has joined #ruby
mjs2600 has quit [Remote host closed the connection]
butblack has joined #ruby
<seemant>
hi all, in ruby land, is there a good ORM type library?
butblack has quit [Client Quit]
<seemant>
I'm agnostic as to relational or not, I suppose
Kricir has joined #ruby
<shevy>
god python2 vs python3 sucks so much
<seemant>
note: not rails :)
<shevy>
there are build tools like libgweather that depend on only either version
aspires has quit []
<atmosx>
seemant: sequel
mjs2600 has joined #ruby
crzrcn has joined #ruby
<atmosx>
seemant: there's also datamapper but I'd go with sequel
cj3kim has quit [Ping timeout: 258 seconds]
x77686d has quit [Quit: x77686d]
<seemant>
atmosx: what do you like about it?
sambao21 has joined #ruby
<baweaver>
Sequel, Virtus
kpshek has joined #ruby
<baweaver>
Virtus if you're interacting with JSON structures
<baweaver>
Sequel if you don't, or aren't sure what that is.
blackavr has joined #ruby
pskosinski has quit [Remote host closed the connection]
<seemant>
baweaver: atmosx: my input data is, in fact, json
<seemant>
(if that makes a diff)
stonevil has quit [Quit: Computer has gone to sleep.]
butblack has joined #ruby
stonevil has joined #ruby
agjacome has quit [Quit: leaving]
Jetchisel has joined #ruby
x1337807x has joined #ruby
rmorello has joined #ruby
deens has joined #ruby
rmorello is now known as rmorello|exhaust
<atmosx>
seemant: what does it mean your input data is json?
stonevil has quit [Ping timeout: 265 seconds]
<atmosx>
seemant: why does it matter?
<atmosx>
seemant: I like the fact that is active developed and often updated and there's a really nice support right on this network by the lead developer
<atmosx>
seemant: does everything I need and much more
centrex has joined #ruby
<seemant>
atmosx: thank you, I will give it a shot then
Squarepy has joined #ruby
<shevy>
hey atmosx how's your rails project coming along?
cruisibesares has joined #ruby
<centrx>
seemant, You can use ActiveRecord without the rest of Rails too
<cruisibesares>
Hey guys im making a web service with unicorn everything works fine but I have something that I absolutly have to run when/if the unicorn worker crashes. Does anyone know how to bascially make an ensure block with a unicorn worker?
nomenkun has quit [Remote host closed the connection]
<ddd>
damn, sorry was trying to copy the URL
mehlah has joined #ruby
nomenkun has joined #ruby
nomenkun has quit [Remote host closed the connection]
ehc has joined #ruby
nomenkun has joined #ruby
<atmosx>
ddd: I use sequel for all except rails. Rails is integrated with AR, I wouldn't use rails if it weren't for it's conventions
luriv has quit [Ping timeout: 240 seconds]
<centrx>
seemant, Sequel and ActiveRecord are the two major Ruby ORMs now. Datamapper is kind of old, and Ruby Object Manager is not yet ready for primetime.
madb055 has joined #ruby
<cruisibesares>
im currenly trying to use after_fork to override the traps that unicorn sets up but i cant seem to get it to work
<seemant>
centrx: atmosx: any opnionn on the nosql options?
<atmosx>
cruisibesares: why does unicorn crash?
<atmosx>
seemant: nope, sorry
<ddd>
atmosx yeah i was doing this with ramaze at the time.
blackavr has quit [Quit: blackavr]
<ddd>
i'd like to learn sequel better regardless of rails or not.
alexherbo2 has joined #ruby
<cruisibesares>
atmosx: it can crash out when the upstream service breaks or when the memory gets to high i have monit reaping it
<atmosx>
cruisibesares: memory hight? how much high? Using ruby 2.1?
<ddd>
someone had told me that before i do i should understand SQL a lot better (joins etc) as it would make sequel more understandable without the helpers.
<ddd>
so i've been reading the postgresql manual set I bought.
quitobro has joined #ruby
<benzrf>
ddd: i know sql!
<benzrf>
kinda
<ddd>
you know, their book series.
<benzrf>
what's good about ramaze v. rails or sinatra
<ddd>
benzrf i'm not very good with it
<cruisibesares>
yeah basically in the background im running waitir and trying to turn a website without an api into an api
<benzrf>
also is that rah-mah-zey or ruh-maze
<ddd>
outside of an ORM like AR or Sequel
dapz has joined #ruby
<ddd>
rah mayze
<cruisibesares>
waitir crashes or ff crashes or it times out and then it leave behind the open brower
<cruisibesares>
i need to ensure that browser.close is called
<atmosx>
cruisibesares: I'm confused by your setup. Not sure how you can relaunchd unicorn once crashed...
nomenkun has quit [Ping timeout: 240 seconds]
<ddd>
could use a bash script and pidof
<cruisibesares>
the master relaunches the worker
<cruisibesares>
if the worker times out
pu22l3r_ has joined #ruby
<ddd>
yeah you would only be able to monitor the master since the master controls and monitors the slaves.
wallerdev has quit [Quit: wallerdev]
<ddd>
remember, the slaves die off normally too if not used and are above your minimum count
<ddd>
so outside of unicorn you'd really only want to look at the master, since the child (slave) you wouldn't retain it's exit code
MatthewsFace has joined #ruby
<ddd>
and with the master you really only care if its in the running/sleeping pool
mjs2600 has quit [Remote host closed the connection]
zorak8 has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
Briareos1 has quit [Remote host closed the connection]
centrex has joined #ruby
yfeldblu_ has quit [Remote host closed the connection]
mrnugget has joined #ruby
treehug88 has quit []
<ddd>
atmosx hey would it be too expensive to write a ruby script to launch unicorn and utilize a begin rescue end clause to monitor? (thinking memory requirements of bash vs ruby *just* for a monitoring script)
<ddd>
just an idea
mjs2600 has joined #ruby
mjs2600 has quit [Remote host closed the connection]
kirun has quit [Remote host closed the connection]
vpretzel|1301 has quit [Quit: Adios!]
yfeldblum has joined #ruby
arietis has joined #ruby
northfurr has joined #ruby
s3ri0us has joined #ruby
treehug88 has joined #ruby
treehug88 has quit [Max SendQ exceeded]
mark_locklear has joined #ruby
treehug88 has joined #ruby
StreakyJ has quit [Quit: leaving]
funktor has joined #ruby
kirun has joined #ruby
yfeldblu_ has joined #ruby
x77686d has joined #ruby
mib_mib has joined #ruby
pu22l3r_ has quit [Remote host closed the connection]
mib_mib has quit [Quit: Page closed]
yfeldblum has quit [Ping timeout: 258 seconds]
pu22l3r has joined #ruby
pu22l3r has quit [Read error: Connection reset by peer]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pu22l3r has joined #ruby
zcreative has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
_justin has quit [Quit: _justin]
sdwrage has joined #ruby
rm_ has quit [Remote host closed the connection]
rm_ has joined #ruby
phansch has joined #ruby
noob101 has quit [Ping timeout: 240 seconds]
quitobro has quit [Remote host closed the connection]
lmickh_ has joined #ruby
Shidash has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
MatthewsFace has quit [Quit: This computer has gone to sleep]
<zorak8>
I think im gonna unnistall ruby and rails and rvm and delete all traces of they of my computer
<zorak8>
and then install all again
<zorak8>
m having a lot of problems with my rails
decoponio has quit [Quit: Leaving...]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rm_ has quit [Ping timeout: 240 seconds]
ktosiek has joined #ruby
bklane has quit [Quit: Leaving...]
sepp2k1 has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Client Quit]
quitobro has joined #ruby
nerium has joined #ruby
<nerium>
Anyone knows a good way to run blocks of ruby code asyncronius in for example a rails view?
kinginky_ has joined #ruby
timonv has quit [Remote host closed the connection]
cpruitt has quit [Quit: cpruitt]
sepp2k has quit [Ping timeout: 252 seconds]
GaryOak_ has quit [Quit: Leaving...]
kenneth has joined #ruby
MatthewsFace has joined #ruby
MatthewsFace has quit [Client Quit]
momomomomo has quit [Quit: momomomomo]
duggiefresh has quit [Remote host closed the connection]
sdwrage has quit [Quit: This computer has gone to sleep]
aspires has joined #ruby
freerobby has quit [Quit: Leaving.]
sdwrage has joined #ruby
jason_ has quit [Remote host closed the connection]
jason_ has joined #ruby
cassioscabral has joined #ruby
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
zorak8 I keep on telling ya, only use ruby from source ;)
dapz has joined #ruby
skaflem has quit [Quit: Leaving]
duggiefresh has joined #ruby
<havenwood>
shevy: or ruby-install so you don't get burned by missing dependencies :P
<baweaver>
Windows?
<shevy>
I don't trust those automatic cures
<havenwood>
baweaver: Nope.
<baweaver>
If so, you're pretty well just asking for it
<shevy>
we could all use RVM if it would work!
<zorak8>
linux
<baweaver>
It does
<shevy>
havenwood did not recommend it!!!
<havenwood>
shevy: RVM2 looks really ambitious, and... it's in Ruby!
grieg has quit [Ping timeout: 265 seconds]
<shevy>
baweaver whenever I see your nick, I am thinking of talking to a beaver. it freaks me out somewhat :\
<havenwood>
shevy: the chronic-what-chles of narnia
<shevy>
cool
<baweaver>
With the 2.0 project, it looks like fun
<shevy>
never heard of rvm2
baweaver is now known as lemur
<lemur>
BetteR?
<havenwood>
shevy: 20,000+ lines of shell is just waaay too much
<lemur>
Sounds like fun
<shevy>
no wonder you don't recommend it
<havenwood>
lemur: more ambitious, takes on the role of the SM framework as well as RVM's installing duties
<shevy>
it's not written in ruby
<havenwood>
hehe
Milly_Bays has quit [Read error: Connection reset by peer]
Es0teric has joined #ruby
mikeric has joined #ruby
<havenwood>
lemur: RVM2 *may* even end up using chruby to switch Rubies, and relegate itself to the more difficult task of installing everything needed for Ruby and the rest of the development environment
<Eiam>
didn't he do a kickstarter to write it?
<havenwood>
still remains to be determined
thumpba_ has joined #ruby
benzrf is now known as benzrf|offline
<shevy>
kinkstarter?
<havenwood>
Eiam: yeah, but bountysource
<havenwood>
err
<Eiam>
20k of shell, gag =(
<havenwood>
another one, what was it
<Eiam>
shell script longer than one page? don't write it in bash.
<havenwood>
Eiam: RVM2 will bootstrap Ruby though, precompiled binaries or if they're unavailable JRuby. So you don't need Ruby to exist to install Ruby.
sarlalian has quit [Quit: WeeChat 0.4.0]
etqqkoiflwhb has joined #ruby
mjs2600 has quit [Remote host closed the connection]
<havenwood>
Eiam: also ability to have RVM2 on local dev machine but install your Ruby setup remotely on a server that doesn't have Ruby.
marr has joined #ruby
twiceaday has joined #ruby
aspires has joined #ruby
butblack has quit [Ping timeout: 245 seconds]
butblack has joined #ruby
notlaforge has joined #ruby
pbergsmann has quit [Quit: pbergsmann]
thumpba_ has quit [Remote host closed the connection]
twiceday has quit [Ping timeout: 245 seconds]
phansch has quit [Quit: WeeChat 0.4.2]
phansch has joined #ruby
djbkd has quit [Remote host closed the connection]
SCommette has joined #ruby
phansch has quit [Client Quit]
phansch has joined #ruby
phansch has quit [Client Quit]
tvw has quit []
sarlalian has joined #ruby
rmorello|exhaust has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
yubrew__ has quit [Remote host closed the connection]
cpruitt has joined #ruby
<havenwood>
to be clear :O, when i said doesn't sound like a good deal i mean for the developers. a really, really good deal for the community. :D
cpruitt has quit [Client Quit]
kjs has quit [Ping timeout: 240 seconds]
ellbot has quit [Remote host closed the connection]
ellbot has joined #ruby
cpruitt has joined #ruby
<havenwood>
friday ;)
afex has quit [Ping timeout: 240 seconds]
spyderman4g63 has joined #ruby
spyderma_ has quit [Read error: Connection reset by peer]
<shevy>
continue coding
banister has joined #ruby
banister has quit [Max SendQ exceeded]
banister has joined #ruby
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
afex has joined #ruby
klaut has joined #ruby
<RubyPanther>
I can't even tell if he's serious, but I'm laughing either way
ellbot has quit [Ping timeout: 252 seconds]
pushpak has joined #ruby
obscured has quit [Quit: leaving]
kpshek has quit []
noop has quit [Read error: No route to host]
bluOxigen has joined #ruby
glanzi has joined #ruby
Emmanuel_Chanel has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
olivier_bK has joined #ruby
toastynerd has joined #ruby
rh1n0 has joined #ruby
kpshek has joined #ruby
ellbot has joined #ruby
stonevil has joined #ruby
ashleyis has quit [Ping timeout: 252 seconds]
cassioscabral has quit [Ping timeout: 250 seconds]
rm_ has quit []
shashank_rs has quit [Ping timeout: 276 seconds]
MindfulMonk has quit [Ping timeout: 252 seconds]
BSaboia has quit [Ping timeout: 245 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
shashank_rs has joined #ruby
mattmcclure has joined #ruby
nfk has quit [Quit: yawn]
Es0teric has joined #ruby
benzrf|offline is now known as benzrf
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
etqqkoiflwhb has quit [Ping timeout: 250 seconds]
sarlalian has quit [Quit: WeeChat 0.4.0]
dunix has quit []
nfk has joined #ruby
timgauthier has joined #ruby
davedev2_ has joined #ruby
Adrao has quit [Remote host closed the connection]
MindfulMonk has joined #ruby
bradhe has quit [Remote host closed the connection]
<havenwood>
ddd: i just listed to mpapis' interview on the Changelog
<havenwood>
listened*
centrex has quit [Ping timeout: 258 seconds]
<ddd>
ah
roolo has quit [Client Quit]
Monito has joined #ruby
<havenwood>
from 09/13
shime has joined #ruby
<ddd>
remember wayne's sh modular app he wrote? iirc, that's supposed to be used as the underpinnings for the expansion
MatthewsFace has joined #ruby
HashNuke has quit [Quit: Connection closed for inactivity]
<havenwood>
ya, named BSDM initially, then SM, now SM Framework.
<ddd>
exactly the one
etqqkoiflwhb has quit [Ping timeout: 240 seconds]
<havenwood>
Tokaido uses it as well ;)
<ddd>
nice
emaxi has quit [Remote host closed the connection]
bradhe has joined #ruby
emaxi has joined #ruby
omosoj has joined #ruby
rebelshrug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kricir has quit [Remote host closed the connection]
etqqkoiflwhb has joined #ruby
rh1n0 has quit [Ping timeout: 240 seconds]
Squarepy has quit [Remote host closed the connection]
etqqkoiflwhb has quit [Client Quit]
<ddd>
can't wait until this semester ends. means I should be able to get back to coding for a bit. Hopefully I can help mpapis again. poor bloke's been carrying the vast majority of the weight, even with the tech support, since I started college again.
<ddd>
i feel bad for not being able to help out but school's just been killing my time (even family time has suffered)
crucify_me has joined #ruby
emaxi has quit [Ping timeout: 240 seconds]
<crucify_me>
hi keep having the same problem where I can't escape out of eval in pry to the top level. suggest?
shime has quit [Ping timeout: 265 seconds]
<shevy>
ddd you have learned much about engines in this semester?
<havenwood>
crucify_me: a `!` doesn't do it?
timonv has joined #ruby
<ddd>
yeah tons
<crucify_me>
havenwood: one sec thanks
<havenwood>
crucify_me: just an aside, but there's a well-populated #pry channel as well
<ddd>
excellent resource, and they will answer questions though sometimes you have to wait just like here
<ddd>
great project
jprovazn has quit [Quit: Odcházím]
pu22l3r_ has joined #ruby
skulker has quit [Remote host closed the connection]
Valesk has joined #ruby
<crucify_me>
ddd havenwood I'm trying to learn how to learn ruby using pry as was suggested to me.
<ddd>
shevy even though I finished my two core engines classes already, the teacher is going to give me 2 extra classes called Practicals. We just got 3 Cummins ISX engines donated to the school, and because I'm highly interested in Cummins engines (they're used tremendously around here along with Case and Cat) in which I'll get to tear all 3 engines down and rebuild so I can get the hands-on experience.
<crucify_me>
havenwood ! just clears the buffer as far as I can see.
sambao21 has quit [Quit: Computer has gone to sleep.]
momomomomo has joined #ruby
evenix_ has quit [Remote host closed the connection]
evenix has quit [Remote host closed the connection]
<crucify_me>
I'm in edit mode in a sublime file and can't get out of eval for an "order" instance.
<crucify_me>
havenwood: ^
<havenwood>
crucify_me: ah, i misunderstood
evenix has joined #ruby
evenix_ has joined #ruby
<crucify_me>
pry(#<Order>)> << sorry I didn't explain properly.
<ddd>
cd .. doesn't get you out?
<crucify_me>
no
pu22l3r has quit [Ping timeout: 240 seconds]
<ddd>
try step -1
dik_dak has quit [Ping timeout: 250 seconds]
<crucify_me>
no. that
<crucify_me>
s a command*
<crucify_me>
?
<ddd>
if you have pry-debugger installed it is
<ddd>
lets you step into, through, etc
mrnugget has quit [Quit: mrnugget]
<crucify_me>
cool ddd I'll check to see what I have , this is not my main machine. thanks
<ddd>
run 'help' and see if its listed on the left side (each pry-* gem registers a list of its commands and the gem it comes from is listed)
<ddd>
np
nari has quit [Ping timeout: 276 seconds]
<crucify_me>
K thanks
Es0teric has quit [Quit: Computer has gone to sleep.]
<ddd>
there's another way you can list the pry-loaded gems as well but i don't remember it. (sorry)
vlad_starkov has joined #ruby
evenix_ has quit [Ping timeout: 258 seconds]
evenix has quit [Ping timeout: 258 seconds]
ukd1 has quit [Remote host closed the connection]
<crucify_me>
cool
<ddd>
something like Gem::Specifications.all.include('pry-debugger') iirc
yubrew has joined #ruby
bradhe has quit [Remote host closed the connection]
danshultz has quit [Remote host closed the connection]
<Mon_Ouie>
reject! returns nil if there has been no modification, delete_if returns the receiver regardless. Same with keep_if vs select!
danshultz has joined #ruby
<shevy>
omosoj they will point at the same "position" always
Muhammad_ has quit [Quit: Ch0c0late]
jlast has joined #ruby
<shevy>
omosoj but you should be able to make copies via alias and alias_method yourself
sambao21 has quit [Quit: Computer has gone to sleep.]
kalleth has quit [Remote host closed the connection]
<omosoj>
Mon_Ouie, shevy, thanks
andy_____ has joined #ruby
evenix_ has joined #ruby
evenix has joined #ruby
andy___ has quit [Read error: Connection reset by peer]
arianit has joined #ruby
arianit has quit [Changing host]
arianit has joined #ruby
kalleth has joined #ruby
<omosoj>
Sorry... what is the receiver? The array it was called on?
<Mon_Ouie>
And for most pairs of actually identical methods (map and collect as mentioned for instance) redefining one will not affect the other at all. So if you want to change their behavior you will have to redefine both of them.
<Mon_Ouie>
Yes, the receiver of a method is the object it was called on
m_3 has quit [Remote host closed the connection]
<shevy>
omosoj your object in question
<shevy>
cat = Cat.new; cat.meow
aspires has quit []
yubrew has joined #ruby
kalleth_ has joined #ruby
danshultz has quit [Ping timeout: 240 seconds]
lele has joined #ruby
mary5030 has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 265 seconds]
sigurding has quit [Ping timeout: 258 seconds]
jamto11 has quit [Remote host closed the connection]
<omosoj>
benzrf, what's the difference between the while loop and the ellipsis thing?
aspires has joined #ruby
aspires has quit [Client Quit]
<omosoj>
Mon_Ouie, 2) should I remove all primes from that array? or should I create an array from some algorithm that multiplies all 3-digit numbers?
nomenkun has joined #ruby
sambao21 has quit [Client Quit]
arianit has joined #ruby
arianit_ has joined #ruby
arianit has joined #ruby
arianit has quit [Changing host]
shashank_rs has quit [Ping timeout: 276 seconds]
sigurding has quit [Quit: sigurding]
kalleth has quit [Remote host closed the connection]
kalleth_ is now known as kalleth
emaxi has quit [Ping timeout: 245 seconds]
arianit_ has quit [Client Quit]
ndrei has quit [Quit: Lost terminal]
sigurding has joined #ruby
sambao21 has joined #ruby
<Mon_Ouie>
omosoj: Primes aren't the only ones I think. Plus if you actually calculate the product you will iterate over less numbers
ndrei has joined #ruby
aspires has joined #ruby
nomenkun has quit [Ping timeout: 276 seconds]
Morkel has quit [Quit: Morkel]
<omosoj>
Ok... I get what you're saying. 997799 could be the product of a 2 digit and a 4 digit or whatever. But it seems that there will be many more numbers if I create an array of all possible products of 3 digit numbers.
<Mon_Ouie>
All numbers between 100^2 and 999^2 : 988002
<Mon_Ouie>
all pairs of 3 digit numbers : 810000
helpD has quit [Remote host closed the connection]
graft has joined #ruby
<Mon_Ouie>
(999-100+1)**2 vs 999**2-100**2+1
lookup has joined #ruby
dapz has joined #ruby
Nukepuppy has quit [Ping timeout: 240 seconds]
rvraghav93 has quit []
cruisibesares has quit [Quit: This computer has gone to sleep]
cruisibesares has joined #ruby
toastynerd has quit [Remote host closed the connection]
<Mon_Ouie>
You don't need an array of all of them by the way. You just need to iterate over all pairs (which you can do with two nested loops), evaluate their product, and see if it's palindromic
<Mon_Ouie>
Speaking of that, you don't need to store all palindromic numbers you found. You only need to remember the biggest one so far.
yacks has quit [Ping timeout: 258 seconds]
<omosoj>
All pairs? Meaning 2 of the same 3 digit number?
gl- has left #ruby [#ruby]
dapz has quit [Client Quit]
<Mon_Ouie>
Hm? It means two 3-digit numbers. e.g. (121, 301), (345, 345), etc.
shwouchk has joined #ruby
<shwouchk>
Hello
<omosoj>
Ok, got it. Sorry, trying to kickstart my math brain. It's rusty
claymore has quit [Quit: Leaving]
pu22l3r_ has quit [Remote host closed the connection]
<shwouchk>
I'm trying to modify a piece of code without actually learning ruby rigorously... Do case statements evaluate only the first clause that matches, or all matching clauses (I'm guessing the former, but better be sure)?
Kricir has joined #ruby
kreisys has joined #ruby
<Mon_Ouie>
shwouchk: Only the first one
<ph88>
@possibilities.map!(&:to_s) <-- what's the ! and &: here ?
BSaboia has joined #ruby
<shwouchk>
Mon_Ouie: thanks
pu22l3r has joined #ruby
<omosoj>
Is there a name for this calculation: (999-100+1)**2 ?
<Mon_Ouie>
ph88: The ! is part of the method name. It usually means that method is a variant of another method. Specifically here, map! modifies the array in-place (while map will create a new array)
<canton7>
ph88, #map! is the name of the method. if differs from #map in that it mutates the @possibilities array, whereas #map will return a modified copy
<canton7>
map!(&:to_s) is shorthand for map!{ |x| x.to_s }
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<canton7>
(it's turning the symbol :to_s into the proc { |x| x.to_s } using the operator &, which is magic for #to_proc)
<ph88>
what's |x| ?
<Mon_Ouie>
omosoj: I'm not sure. But the set of all pairs where one element comes from one set and the other from another set is called the cartesian product of those two sets
lmickh has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<Mon_Ouie>
In this case the two sets are the same ([100..999]). And that number is called the cardinality of that set.
Kricir has joined #ruby
<canton7>
ph88, if you don't know block syntax, I think it's time to read a basic introductory text
<Mon_Ouie>
(that set being the product, written [100..999]×[100..999] a.k.a [100..999]²)
chrisseaton has joined #ruby
<omosoj>
K... working on the nested loops
asteros has joined #ruby
sepp2k1 has quit [Read error: Connection reset by peer]
arianit has quit [Quit: Ex-Chat]
<omosoj>
Should I use while loops, or a (n..m) kinda thing?
<Mon_Ouie>
I'd prefer the later form
<Mon_Ouie>
That way you don't have to manipulate the iterator variable yourself
phoenixz is now known as Blubberbop
rylev has joined #ruby
Tomasso has quit [Read error: Connection reset by peer]
lw has quit [Quit: s]
<omosoj>
Manipulate = adding 1 to it at the end of the block?
Emmanuel_Chanel has quit [Quit: Leaving]
<Mon_Ouie>
That and checking the end condition yourself
mikeric has quit []
jhass|off has quit [Ping timeout: 252 seconds]
<ph88>
thx canton7 & Mon_Ouie
Tomasso has joined #ruby
jhass|off has joined #ruby
jhass|off is now known as jhass
Milly_Bays has quit [Ping timeout: 240 seconds]
Czupa has quit [Remote host closed the connection]
rylev has quit [Ping timeout: 240 seconds]
rylev has joined #ruby
Lemur has quit [Remote host closed the connection]
rylev has quit [Remote host closed the connection]
rylev has joined #ruby
ellbot has joined #ruby
ellbot has quit [Remote host closed the connection]
Jetchisel has quit [Ping timeout: 245 seconds]
GaryOak_ has quit [Remote host closed the connection]
nivram80 has joined #ruby
cover_ has quit [Remote host closed the connection]
pen has joined #ruby
mrmargolis has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
<canton7>
omosoj, getting there
<wallerdev>
its blowing my mind that you assigned an array to a variable named set
<canton7>
you can solve it in one line if you get far enough - you've still got a little way to go
meatherly has quit [Remote host closed the connection]
<Mon_Ouie>
You can still do it with only an integer variable instead of an array.
tacos1de has joined #ruby
<omosoj>
wallerdev, lol. I think of it as a set but I should probably stop that
<canton7>
a set doesn't have duplicate entires (and is created with Set.new)
<canton7>
an array can
meatherly has joined #ruby
<Mon_Ouie>
Your y earlier was the last one you found because you replaced its value whenever you found a new palindrome. Instead you want to keep track of the greatest palindrome you've seen.
terrellt has quit [Remote host closed the connection]
emaxi has quit [Ping timeout: 258 seconds]
<omosoj>
Mon_Ouie, I get that. Hmm, I'll try to figure out how to do that.
terrellt has joined #ruby
<canton7>
also something to be thinking about: it won't affect the timeout, but you're currently calculating e.g. both 100 * 101, and 101 * 100
terrellt has quit [Read error: Connection reset by peer]
chris_thomson has quit [Read error: Connection reset by peer]
Dwarf has joined #ruby
terrellt has joined #ruby
toastynerd has joined #ruby
chris_thomson has joined #ruby
<omosoj>
canton7, k, I see.
<canton7>
btw, in case you hadn't come across it, there's an array method called #max
<wallerdev>
it seems like this is a good scenario for parallelizing the task
<omosoj>
Right... use &&
<omosoj>
?
<canton7>
yup
<wallerdev>
take full advantage of each processor
<canton7>
and think about which condition you want to check first
<canton7>
as if the first condition is false, the second one is never ru
<canton7>
*run
hobodave has joined #ruby
dima_ has quit [Remote host closed the connection]
<omosoj>
canton7, whoa, interesting
<Mon_Ouie>
Half a second here too. You can also avoid checking both (101,100) and (100,101) and all such duplicates quite easily: just change the range you're iterating on such that x ≤ y or vice-versa.
<canton7>
with 'a && b', both a and b have to be true for the result to be true. if a is false, the result can never be true, so there's no point in checking b
<canton7>
similarly with 'a || b' either a or b has to be true for the result to be true. if a is true, then there's no point in checking b - the result is going to be true whatever b is
<canton7>
yeah, think carefully about where you start on line 9
brunops has joined #ruby
sigurding has quit [Quit: sigurding]
sigurding has joined #ruby
evenix_ has quit [Remote host closed the connection]
evenix has quit [Remote host closed the connection]
brunops has quit [Client Quit]
evenix has joined #ruby
evenix_ has joined #ruby
soulcake has quit [Read error: Connection reset by peer]
freerobby has quit [Quit: Leaving.]
soulcake has joined #ruby
Kryptonical has joined #ruby
b1nd has quit [Ping timeout: 252 seconds]
cruisibesares has quit [Quit: This computer has gone to sleep]
sigurding has quit [Ping timeout: 265 seconds]
funktor has joined #ruby
evenix_ has quit [Ping timeout: 240 seconds]
evenix has quit [Ping timeout: 240 seconds]
ktosiek has quit [Ping timeout: 252 seconds]
toastynerd has quit [Remote host closed the connection]
<omosoj>
Don't understand, Mon_Ouie. hmm
deens has quit [Remote host closed the connection]
deens has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
<benzrf>
i want Object#id thats just return self
<canton7>
omosoj, think about what you're doing. the first loop goes from 100 to 999, for each item in that range, you have a second loop which goes from 100 to 999
<omosoj>
Ok, I think I understand. Letting them multiple downwards is repetitive.
<canton7>
so you can 100 * 100, 100 * 101, 100 * 102 ....... 101 * 100, 101 * 101, 101 * 102 .....
rakm has joined #ruby
djbkd has quit [Remote host closed the connection]
<Mon_Ouie>
benzrf: Well except that Object#id used to be Object#object_id but it was deprecated and then removed from core because people wanted to use it for ids in databases
<omosoj>
Can I replace a with x in the second ellipsis? (line 9) (also, file recently updated)
<wallerdev>
people didn't want to use object_id for databases lol
<Mon_Ouie>
omosoj: Yup :)
arubincloud has quit []
<wallerdev>
people just wanted to use the method id to represent an id attribute on various classes
<wallerdev>
and although it worked, if you accidentally had a nil object or an object of another type it would return an object_id which made bugs harder to find
<Mon_Ouie>
wallerdev: No, I mean they used a method called #id to retrieve the id used for databases and such
<omosoj>
Awesome!
zeropx has joined #ruby
deens has quit [Ping timeout: 240 seconds]
Avahey_ has joined #ruby
vlad_starkov has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<canton7>
omosoj, there we go :)
Monito has quit [Read error: Connection reset by peer]
<omosoj>
Can't believe how helpful and generous you guys are! Thanks so much!
<canton7>
right, I think that's about as good as that approach can get
<wallerdev>
we love helping people with trivial problems, it makes us feel smart
hobodave has quit [Quit: Computer has gone to sleep.]
<canton7>
for interest, my one-liner: (100..999).to_a.repeated_combination(2).map{ |x,y| x * y }.select{ |x| x.to_s == x.to_s.reverse }.max
Monito has joined #ruby
<canton7>
though it's not as efficient as your implementation
dik_dak has quit [Quit: Leaving]
klaut has quit [Remote host closed the connection]
<omosoj>
lol
asteros has quit [Quit: asteros]
<Mon_Ouie>
Too bad Enumerable#lazy doesn't have methods like repeated_combination and product
<canton7>
yeah
senayar has joined #ruby
dumdedum has quit [Quit: foo]
<benzrf>
whats repcom
RaptorJesus_ has joined #ruby
RaptorJesus has quit [Ping timeout: 265 seconds]
asteros has joined #ruby
ghr has joined #ruby
<omosoj>
canton7, I'm gonna sit down and analyze that. Thanks.
<wallerdev>
gets combinations of the numbers benzrf
RaptorJesus_ is now known as RaptorJesus
<wallerdev>
so if you had [1, 2, 3] youd get all 2-pair combinations with repeated_combination(2)
<canton7>
omosoj, sure. the repeated_combination stuff is just a library method which does the same as your two loops
vlad_starkov has quit [Ping timeout: 252 seconds]
lookup has quit [Quit: lookup]
<benzrf>
cartesian product on self u mean?
<benzrf>
>> [1, 2, 3].repeated_combination
<eval-in_>
benzrf => wrong number of arguments (0 for 1) (ArgumentError) ... (https://eval.in/138414)
<canton7>
then the rest is a pipeline - take each pair of numbers and calculate the product, then filter those by the ones that are palendromic, then find the max
<canton7>
there are two combination and two permutation methods on Array. I can never remember the names - always have to go back to the rdoc pagfe
<canton7>
but they're incredibly useful for this sort of stuff
<xybre>
sample, permutation, shuffle, rotate?
ukd1 has quit [Quit: Leaving...]
ghr has quit [Ping timeout: 245 seconds]
<omosoj>
Bye for now, guys. Thanks again.
yubrew has joined #ruby
mansi_ has quit [Remote host closed the connection]
<Mon_Ouie>
xybre: (repeated_)permutation, (repeated_)combination I assume
<xybre>
Ah, sure.
mansi has joined #ruby
george2 has quit [Remote host closed the connection]
mu5k17u has quit [Remote host closed the connection]
funktor has quit [Remote host closed the connection]
b1nd has joined #ruby
<Mon_Ouie>
Andn actually since repeated_combination returns an Enumerator (I thought it would be an array like #product) you can easily make it lazy. It seems slower though.
MatthewsFace has quit [Quit: This computer has gone to sleep]