slainer6_ has quit [Remote host closed the connection]
wargasm has quit [Read error: Connection reset by peer]
<babykosh>
ping
aharris6 has quit [Remote host closed the connection]
twopoint718 has quit [Ping timeout: 248 seconds]
ryanlecompte has quit [Read error: Connection reset by peer]
aharris6 has joined #ruby
byennen has joined #ruby
Shamgar has quit [Read error: Operation timed out]
ctwiz has joined #ruby
tbrock has joined #ruby
SCommette has joined #ruby
ctwiz is now known as dpg
<jrajav>
jsilver: POSIX came after Windows
<jrajav>
Well, after MS-DOS
<jsilver>
jrajav: ah, didn't know that
doritostains has quit [Quit: Leaving...]
<jsilver>
never quite understood what POSIX really meant
<jrajav>
Yeah, there were several competing standards for OSes at the time. Those coherent Unixy standards we all know and love didn't emerge until the end of the 80's
jenrzzz has quit [Ping timeout: 252 seconds]
<jrajav>
And to this day Windows held out, obviously.
<seanstickle>
Windows is POSIX compliant
TechZombie has quit [Quit: Leaving.]
<sorbo_>
again demonstrating the lack of correlation between merit and popularity
<jrajav>
Hard links aren't really first class citizens, for instance
<seanstickle>
There you go.
<jrajav>
Though it's better now than it was
<seanstickle>
Anyways, their POSIX subsystem sucks
<seanstickle>
But it's there for FIPS compliance
marr has joined #ruby
<jrajav>
And just because Windows technically conforms to a POSIX standard (it definitely doesn't conform to ALL of them) doesn't mean that that fact is necessarily useful
<jsilver>
trippy
jrunning_ has quit [Ping timeout: 264 seconds]
<jsilver>
what's FIPS compliance?
<seanstickle>
Well… I never said the Windows POSIX stuff was good
<seanstickle>
In fact, I said it sucked.
jsilver has quit [Remote host closed the connection]
<seanstickle>
jsilver: Federal Information Processing Standard
jsilver has joined #ruby
<seanstickle>
jsilver: Federal Information Processing Standard
wargasm has joined #ruby
<jsilver>
right
<seanstickle>
Required for acquisitions and purchasing
_bart has joined #ruby
axl_ has joined #ruby
fyolnish has quit [Remote host closed the connection]
<jsilver>
lol.
<Spaceghostc2c>
Lol cygwin.
<jsilver>
evidence of an obvious M$ scam
<jsilver>
Spaceghostc2c: what's wrong with cygwin
<jsilver>
isn't it like, used for stuff?
<Spaceghostc2c>
jsilver: The 'win' part.
<jsilver>
yea
<jsilver>
:|
<jsilver>
i got windows 8 tho
bgh has quit [Ping timeout: 256 seconds]
<jsilver>
barely ever use it, the lighting terrible
h4mz1d has joined #ruby
jjang has quit [Remote host closed the connection]
jsilver has quit [Remote host closed the connection]
axl_ has quit [Read error: Connection timed out]
moshee has quit [Ping timeout: 264 seconds]
_bart has left #ruby [#ruby]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
<jrajav>
msys is way better than cygwin btw
robotmay has quit [Remote host closed the connection]
c0rn has quit []
cakehero has joined #ruby
<babykosh>
ping
<Spaceghostc2c>
jrajav: True.
techhelp has quit [Quit: This computer has gone to sleep]
kil0byte has quit [Remote host closed the connection]
daniel_- has quit [Ping timeout: 245 seconds]
kil0byte has joined #ruby
mascool has joined #ruby
yshh has quit [Remote host closed the connection]
jds_ has joined #ruby
philips_ has quit [Excess Flood]
leonardorb has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 255 seconds]
machty has quit [Quit: machty]
philips_ has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
ikaros has quit [Remote host closed the connection]
daniel_- has joined #ruby
jds_ has quit [Ping timeout: 260 seconds]
otters has joined #ruby
bradhe_ has joined #ruby
chaosis has joined #ruby
c0rn has joined #ruby
<babykosh>
ping
Guest80635 has joined #ruby
ephemerian has quit [Quit: Leaving.]
c0rn has quit []
u89 has quit [Remote host closed the connection]
yshh has joined #ruby
statarb3 has quit [Quit: Leaving]
c0rn has joined #ruby
jsilver has joined #ruby
guille has quit [Quit: guille]
twopoint718 has joined #ruby
twopoint718 has quit [Changing host]
twopoint718 has joined #ruby
Guest80635 is now known as gurushah
cooler has quit [Remote host closed the connection]
GoGoGarrett has quit [Remote host closed the connection]
dingus9 has joined #ruby
BoomCow has joined #ruby
GoGoGarrett has joined #ruby
slainer68 has joined #ruby
wei_ has quit [Quit: wei_]
<dingus9>
hey, I have a symbol/method of an activerecord class that returns true for respond_to?, but doesn't show up in object.methods… I can't find it defined in any of my source files… Also it doesn't inherit any of the methods from the Methods objetc what is it
eldariof has quit []
eldariof has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
jlwestsr has quit [Quit: Ex-Chat]
<ryanf>
dingus9: you forgot to say what it is
marr has quit [Ping timeout: 265 seconds]
doritostains has joined #ruby
ttt has joined #ruby
_nitti has joined #ruby
<dingus9>
sorry it being my mystery callable
aharris6 has quit [Remote host closed the connection]
<dingus9>
I'm trying to figure out where "it" is defined, all I know is that it is callable with User.find_or_create_by_login however, User.methods does not contain find_or_create_by_login
slainer68 has quit [Ping timeout: 260 seconds]
<dingus9>
it is also available to an instantiated user object
pu22l3r has quit [Remote host closed the connection]
tbrock has quit [Quit: Computer has gone to sleep.]
<dingus9>
im out for a while for a haircut
jrunning_ has joined #ruby
dingus9 has left #ruby [#ruby]
Slivka has quit [Read error: Operation timed out]
cableray has quit [Quit: cableray]
wei_ has joined #ruby
leonardorb has joined #ruby
Xeago has quit [Remote host closed the connection]
Shamgar has quit [Ping timeout: 252 seconds]
leonardorb has quit [Ping timeout: 256 seconds]
jrunning_ has quit [Ping timeout: 245 seconds]
reset has joined #ruby
arya_ has quit [Ping timeout: 244 seconds]
PhilK has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
gbchaosmaster has quit [Quit: leaving]
icole has joined #ruby
kisoku has quit [Ping timeout: 260 seconds]
ElderFain has quit [Ping timeout: 264 seconds]
kisoku has joined #ruby
rellin has quit [Ping timeout: 260 seconds]
L1 has joined #ruby
randym has joined #ruby
arya_ has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
elementz has quit [Ping timeout: 256 seconds]
aquagrunty has left #ruby [#ruby]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
PhilK has joined #ruby
skaczor has joined #ruby
Erfankam has joined #ruby
mahmoudimus has joined #ruby
Slivka has joined #ruby
Goles has quit [Read error: Connection reset by peer]
PhilK has quit [Ping timeout: 250 seconds]
hotovson has quit [Remote host closed the connection]
mahmoudimus has quit [Client Quit]
blazes816 has joined #ruby
icole has quit [Remote host closed the connection]
Erfankam has quit [Ping timeout: 255 seconds]
gbchaosmaster has joined #ruby
mahmoudimus has joined #ruby
yewton has quit [Quit: (*´ω`*)]
eka has quit [Remote host closed the connection]
yewton has joined #ruby
cub949 has quit [Quit: Leaving]
cableray has joined #ruby
jeffreybaird has joined #ruby
kisoku has quit [Ping timeout: 255 seconds]
ElderFain has joined #ruby
gurushah has quit [Quit: gurushah]
moshee has quit [Remote host closed the connection]
hibariya has joined #ruby
danneu has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
byennen has quit [Read error: Connection reset by peer]
moshee has quit [Changing host]
moshee has joined #ruby
GoGoGarrett has joined #ruby
byennen has joined #ruby
bradhe has quit [Remote host closed the connection]
kisoku has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
rakl has joined #ruby
bradhe has joined #ruby
PhilK has joined #ruby
SCommette has joined #ruby
bradhe has quit [Ping timeout: 252 seconds]
h4mz1d has quit [Ping timeout: 252 seconds]
wookiehangover has quit [Ping timeout: 264 seconds]
arya_ has quit [Ping timeout: 244 seconds]
PhilK has quit [Ping timeout: 260 seconds]
sorbo_ has quit [Quit: sorbo_]
wookiehangover has joined #ruby
kisoku has quit [Ping timeout: 256 seconds]
arya_ has joined #ruby
kisoku has joined #ruby
earthquake has quit [Quit: earthquake]
earthquake has joined #ruby
Shamgar has joined #ruby
gabrielrotbart has joined #ruby
s14 has joined #ruby
s14 has quit [Client Quit]
s14 has joined #ruby
danneu has joined #ruby
kisoku has quit [Remote host closed the connection]
krawchyk has joined #ruby
Tref has joined #ruby
al3xnull has joined #ruby
tomsthumb has joined #ruby
jmuniz has quit [Quit: Later Nerds!]
arya_ has quit [Ping timeout: 244 seconds]
mneorr has joined #ruby
bgh has quit [Ping timeout: 264 seconds]
xyzodiac has quit [Ping timeout: 256 seconds]
kisoku has joined #ruby
arya_ has joined #ruby
Hanmac1 has joined #ruby
xyzodiac has joined #ruby
techhelp has joined #ruby
Hanmac has quit [Ping timeout: 260 seconds]
Slivka has quit [Remote host closed the connection]
Bosox20051 has joined #ruby
bradhe has joined #ruby
krz has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
dzhulk has joined #ruby
Ruler_Of_Heaven_ has quit [Ping timeout: 264 seconds]
chendo_ has quit [Ping timeout: 264 seconds]
wei_ has quit [Quit: wei_]
dzhulk has quit [Client Quit]
x82_nicole has joined #ruby
CaptainJet has quit []
chendo_ has joined #ruby
vasile has quit [Ping timeout: 260 seconds]
ly- has joined #ruby
techhelp2 has joined #ruby
x82_nicole has quit [Client Quit]
niklasb has quit [Ping timeout: 252 seconds]
chendo_ has quit [Ping timeout: 255 seconds]
techhelp has quit [Ping timeout: 260 seconds]
chendo_ has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
jenrzzz has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
ryanlecompte has joined #ruby
SCommette has quit [Quit: SCommette]
dpg has left #ruby [#ruby]
al3xnull has quit [Ping timeout: 260 seconds]
ddd has joined #ruby
x82_nicole has joined #ruby
daniel_- has quit [Ping timeout: 265 seconds]
mneorr has quit [Remote host closed the connection]
Drekonus has joined #ruby
chendo_ has quit [Ping timeout: 265 seconds]
freakazoid0223 has joined #ruby
CreativeEmbassy has joined #ruby
swarley| has joined #ruby
mjolk has joined #ruby
chendo_ has joined #ruby
arya_ has quit [Ping timeout: 244 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
skaczor has quit [Remote host closed the connection]
cj3kim has joined #ruby
arya_ has joined #ruby
Drekonus has quit [Remote host closed the connection]
icole has joined #ruby
mneorr has joined #ruby
Zense has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
icole has quit [Ping timeout: 255 seconds]
xyzodiac has joined #ruby
Drekonus has joined #ruby
SCommette has joined #ruby
jlogsdon has joined #ruby
cableray has quit [Quit: cableray]
michaelmartinez has joined #ruby
ossareh has joined #ruby
mneorr has quit [Remote host closed the connection]
x82_nicole has quit [Quit: Computer has gone to sleep.]
SCommette has quit [Client Quit]
Drekonus has quit [Quit: Leaving.]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
sorbo_ has joined #ruby
SCommette has joined #ruby
ewag has joined #ruby
median has joined #ruby
byennen has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
<median>
hi, learning ruby (on rails), and a friend pointed me here. not sure of the etiquette yet. : )
<median>
basically curious how to have a shared form across 2 controllers
<median>
and i tried a partial => 'shared/folder' approach but not working
Axsuul has joined #ruby
xsbeats has joined #ruby
postmodern has joined #ruby
seanstickle has quit [Quit: seanstickle]
mneorr has joined #ruby
ananthakumaran has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
g-ram has joined #ruby
<krz>
how do i convert "false" into boolean?
<krz>
or "true" for that matter
c0rn has quit []
<jtcoon>
median, I am not a good repository of best practices, but using a partial sounds like the right route, perhaps passing in a local referencing the resource being operated on (avoid @instancevars)
soyapi has joined #ruby
soyapi has quit [Remote host closed the connection]
philips_ has quit [Excess Flood]
<jtcoon>
krz, I don't think there's a built-in way, see google for examples (some add functionality to string)
CaptainJet has joined #ruby
chrisramon has joined #ruby
philips_ has joined #ruby
<sorbo_>
krz: yeah, you can monkey patch String, as jtcoon mentions
<sorbo_>
if you're feeling adventurous you can also just eval the strings
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
joeycarmello has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
jlwestsr has quit [Quit: Ex-Chat]
ananthakumaran has quit [Quit: Leaving.]
joeycarmello has joined #ruby
segv- has joined #ruby
rohit_ has joined #ruby
segv- has quit [Client Quit]
yewton has quit [Excess Flood]
yewton has joined #ruby
joeycarmello has quit [Ping timeout: 252 seconds]
bakis has quit [Ping timeout: 250 seconds]
gcds has joined #ruby
IceDragon has quit [Quit: Space~~~]
JStoker has quit [Excess Flood]
burgestrand1 has joined #ruby
Retistic has quit [Quit: Retistic]
wei_ has joined #ruby
jrunning has quit [Read error: Operation timed out]
acrocity_ has joined #ruby
yewton has quit [Max SendQ exceeded]
burgestrand has quit [Ping timeout: 248 seconds]
rippa has joined #ruby
arya_ has joined #ruby
acrocity has quit [Ping timeout: 246 seconds]
acrocity_ is now known as acrocity
yewton has joined #ruby
burgestrand1 has quit [Ping timeout: 256 seconds]
bakis has joined #ruby
bakis is now known as Guest7543
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
ranjan has joined #ruby
ranjan is now known as Guest90303
Takehiro has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
A124 has quit [Quit: Leaving.]
mahmoudimus has joined #ruby
gcds has quit [Ping timeout: 260 seconds]
JStoker has joined #ruby
CreativeEmbassy has joined #ruby
aharris6 has joined #ruby
mjolk has quit [Remote host closed the connection]
rking has quit [Quit: BBIAB]
ninp0 has quit [Ping timeout: 252 seconds]
rippa has quit [Ping timeout: 264 seconds]
xpen has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
aces1up has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
<aces1up>
what is the term or name for using a queue to organize threads.. basically, I have a function that finished, so the I fire a queue job that only has a single worker thread.. basically I do this as an alternative to mutex to ensure the job uses a single thread therefore that thread should be the only one accesses my un-thread safe variables.
ananthakumaran has joined #ruby
<aces1up>
hope that makes sense.
moshee has quit [Remote host closed the connection]
pu22l3r has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
pu22l3r has quit [Remote host closed the connection]
kil0byte has joined #ruby
pu22l3r has joined #ruby
ninp0 has joined #ruby
Guest7543 is now known as bakis
bakis has quit [Changing host]
bakis has joined #ruby
centipedefarmer has quit [Remote host closed the connection]
aharris6 has quit [Remote host closed the connection]
drago757 has quit [Quit: drago757]
xpen has quit [Ping timeout: 245 seconds]
Guest90303 has quit [Ping timeout: 252 seconds]
techhelp2 has quit [Quit: This computer has gone to sleep]
yewton has quit [Max SendQ exceeded]
jonahR has quit [Quit: jonahR]
yewton has joined #ruby
arya_ has quit [Ping timeout: 260 seconds]
joeycarmello has joined #ruby
wei_ has quit [Quit: wei_]
ossareh has quit [Ping timeout: 256 seconds]
arya_ has joined #ruby
bpfh has quit [Quit: Saindo]
pcarrier has quit []
djdb has joined #ruby
rellin has joined #ruby
pu22l3r has quit [Ping timeout: 248 seconds]
CaptainJet has quit []
arya_ has quit [Ping timeout: 260 seconds]
hemanth has quit [Read error: Connection reset by peer]
haxrbyte_ has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 250 seconds]
<burgestrand>
aces1up: don’t understand what you want.
<reactormonk>
aces1up, I'd go with jruby and something from java.util.concurrent ;-)
kil0byte has joined #ruby
tagrudev has joined #ruby
elsifaka has joined #ruby
<aces1up>
burgestrand basically I need a way to callback the originating thread queue to pop off another job.
<aces1up>
but if i don't do the call back it will run all jobs immediately, as the jobs themselves run in another thread.
<aces1up>
and would return immediately thus poping off another job .
<aces1up>
make sense?
CreativeEmbassy has joined #ruby
<burgestrand>
aces1up: the spawn_thread goes to sleep after popping (and runnig) the first job, and is only woken up after 10 seconds, by looking at this code. Is it not?
areil_ has joined #ruby
piotr has joined #ruby
kil0byte_ has quit [Ping timeout: 255 seconds]
<aces1up>
no the Fibernode the one sleeping for 10secs is simulating an asyncrounous event. the queue itself does not sleep.
<burgestrand>
aces1up: by the way, sleep (no arguments) sleeps forever (like Thead#stop), and the loop method is often preferred over “while true”
<aces1up>
thought I could put the running thread to sleep then wake it up in the callback but doesn't seem to work.
areil_ has quit [Client Quit]
areil_ has joined #ruby
aharris6 has joined #ruby
charliesome has joined #ruby
areil_ has quit [Client Quit]
mneorr has quit [Remote host closed the connection]
areil has quit [Ping timeout: 256 seconds]
<aces1up>
burgestrand any ideas, or do i need to clarify more?
<burgestrand>
aces1up: I’m trying to run your code to try to understand what you are talking about it.
mneorr has joined #ruby
rtd has quit [Quit: rtd]
<burgestrand>
aces1up: your code crashes.
<burgestrand>
aces1up: what is “obj_info”?
bairui has quit [Ping timeout: 265 seconds]
<burgestrand>
aces1up: line #15 in your paste.
FredLe has joined #ruby
<aces1up>
sorry.. remove obj_info
<aces1up>
its a kernel method I defined.
<aces1up>
so when you run that code as is it won't run second job..
<aces1up>
comment out line 36 and run again and it will run both jobs.
iamjarvo has joined #ruby
<burgestrand>
aces1up: it runs both jobs, and then waits forever until a new job is added to the queue
areil has joined #ruby
<aces1up>
but it shouldn't do that. it should only run second job when first job has completed.
<burgestrand>
aces1up: actually.
<burgestrand>
aces1up: Thread#stop does not exist.
mercwithamouth has quit [Ping timeout: 260 seconds]
elsifaka has joined #ruby
elsifaka has quit [Max SendQ exceeded]
u89 has joined #ruby
yewton has joined #ruby
xsbeats has quit [Read error: Connection reset by peer]
xsbeats_ has joined #ruby
elsifaka has joined #ruby
pcarrier has quit []
elsifaka has quit [Max SendQ exceeded]
u89 has quit [Remote host closed the connection]
elsifaka has joined #ruby
jprovazn has joined #ruby
cableray has joined #ruby
SeySayux has quit [Read error: Operation timed out]
neurotech has joined #ruby
bgh has joined #ruby
hotovson has joined #ruby
slainer68 has joined #ruby
generalissimo has quit [Remote host closed the connection]
Tearan has quit [Quit: Sleepy Badger....]
Villadelfia has quit [Ping timeout: 265 seconds]
sspiff has joined #ruby
kil0byte has joined #ruby
odyssey4me has joined #ruby
dangerousdave has joined #ruby
nomenkun_ has quit [Remote host closed the connection]
SeySayux has joined #ruby
dangerousdave has quit [Client Quit]
slainer68 has quit [Ping timeout: 248 seconds]
Villadelfia has joined #ruby
Villadelfia has quit [Changing host]
Villadelfia has joined #ruby
kil0byte_ has quit [Ping timeout: 260 seconds]
braoru has joined #ruby
jimeh has joined #ruby
h4mz1d has quit [Ping timeout: 245 seconds]
margle has joined #ruby
blaxter has quit [Quit: foo]
nemesit has quit [Ping timeout: 265 seconds]
blaxter has joined #ruby
pcarrier has joined #ruby
c0rn has quit []
arya_ has joined #ruby
elsifaka has quit [Quit: Veloma e!]
doritostains has joined #ruby
bradhe has joined #ruby
sepp2k1 has quit [Remote host closed the connection]
browndawg has joined #ruby
cableray has quit [Quit: cableray]
cableray has joined #ruby
apeiros_ has joined #ruby
hoelzro|away is now known as hoelzro
Xeago has joined #ruby
vlad_starkov has joined #ruby
Virunga has joined #ruby
<Axsuul>
Can anyone recommend a library better than Net::HTTP
arya_ has quit []
arya_ has joined #ruby
codezombie has joined #ruby
k610 has joined #ruby
reset has joined #ruby
L1 has quit [Changing host]
L1 has joined #ruby
bradhe has quit [Ping timeout: 260 seconds]
marr has joined #ruby
reset has quit [Ping timeout: 265 seconds]
odyssey4me has quit [Ping timeout: 264 seconds]
jackbrownhf has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
<krz>
how would i use eval to convert 'true' to true
<apeiros_>
krz: you wouldn't.
<apeiros_>
you'd simply do string == 'true'
<krz>
that would require a method right?
<apeiros_>
eval is a method too
<krz>
is there a one liner for something similar
<apeiros_>
wtf?
<apeiros_>
how's "string == 'true'" not a one-liner?
<apeiros_>
do you write it on 2 lines or what? o0
<krz>
how the hell do i convert "true" or "false" with that, if i don't have it as a method
<apeiros_>
oh my
<apeiros_>
converted_value = your_input == 'true'
<krz>
'true'.to_bool would work. assuming to_bool is a method that has string == 'true'
<apeiros_>
I don't know how I can make it any clearer
bluOxigen has joined #ruby
<krz>
you suggesting itinerary conditions?
cableray has quit [Quit: cableray]
<apeiros_>
che?
<apeiros_>
krz: you're aware that == returns an Object, yes?
<apeiros_>
'true' == 'true' # => true
<apeiros_>
'false' == 'true' # => false
<apeiros_>
don't know where you're stuck with understanding that code…
Elhu has joined #ruby
ebouchut_ has joined #ruby
ebouchut has quit [Read error: Connection reset by peer]
<krz>
apeiros_: foo can either be 'true', 'false' or nil
<apeiros_>
and?
xpen has joined #ruby
<krz>
i want to do. baz = foo
<krz>
baz should be true, false, or nil
<wildcard0>
baz = foo.to_s ?
<apeiros_>
krz: I can't help you. I told you how. If by all the explanation I've already given, you still can't make sense of it, then I can't help you.
bluOxigen has quit [Ping timeout: 260 seconds]
<krz>
bad = eval(foo)
<krz>
bad=baz
<wildcard0>
i must have missed the beginning
<krz>
thats what i needed
<apeiros_>
it's a bad solution
machty has joined #ruby
<krz>
how so?
<apeiros_>
srsly?
<krz>
its eval. not evil :=P
* apeiros_
walks away
jds_ has quit [Remote host closed the connection]
bluOxigen has joined #ruby
<apeiros_>
hopeless case.
<krz>
i was being sarcastic
L1 has quit [Quit: Quitter]
<krz>
yes, i know its code smell
<apeiros_>
it's a code STINK
<apeiros_>
obviously foo is user-input
<krz>
i was just trying to show you what i needed as a one liner
<apeiros_>
yes, and you fail to read and understand replies you get.
<apeiros_>
but srsly, I'm off. I have not enough patience for this.
<JonnieCache>
how far is the gosu port? because gosu has its own sound support doesnt it?
yshh has quit [Ping timeout: 264 seconds]
margle has quit [Quit: Computer has gone to sleep.]
<apeiros_>
I'd expect the gosu port to be on par with the current terminal implementation at the end of december. it *may* be earlier. I wouldn't bet on it, though. effort is quite a bit higher.
staafl has joined #ruby
<apeiros_>
also lots of initial effort is going on now, which will hopefully be a bit lower after december
<Paradox>
( ͡ಠ ͜ʖ ͡ಠ)
SPYGAME has quit [Ping timeout: 264 seconds]
hotovson has quit [Remote host closed the connection]
reinaldob has joined #ruby
Virunga has joined #ruby
googya has joined #ruby
leonardorb has quit [Remote host closed the connection]
morf has joined #ruby
cascalheira has joined #ruby
rakl has quit [Quit: sleeping]
ttt has quit [Disconnected by services]
<apeiros_>
JonnieCache: ah, with regards to license - I assume you're fine with the game being completely under BSD?
adeponte has quit [Remote host closed the connection]
aetcore has joined #ruby
chussenot has quit [Quit: chussenot]
chussenot has joined #ruby
JohnBat26 has joined #ruby
dzhulk has joined #ruby
himsin has joined #ruby
fyolnish has joined #ruby
beiter has quit [Quit: beiter]
Averna1 has joined #ruby
kil0byte_ has joined #ruby
segora has joined #ruby
larissa has joined #ruby
fyolnish has quit [Ping timeout: 255 seconds]
kil0byte has quit [Ping timeout: 260 seconds]
bgh has joined #ruby
rakunHo has quit [Remote host closed the connection]
margle has joined #ruby
Hanmac1 has quit [Quit: Leaving.]
swex has quit [Remote host closed the connection]
elementz has joined #ruby
elementz has joined #ruby
elementz has quit [Changing host]
Hanmac has joined #ruby
tk__ has joined #ruby
arabi has joined #ruby
<hemanth>
class << self; is not applicable with 1.9.X ?
<arabi>
hey guys i am a ruby newbie , i was writing a code to find largest prime factor a number ... but it takes toooooo long to execute ... pls have a look at my code : http://pastie.org/5470941
swex has joined #ruby
roadt_ has quit [Ping timeout: 245 seconds]
<arabi>
is there anyone to help :(
kil0byte has joined #ruby
<arabi>
hey guys i am a ruby newbie , i was writing a code to find largest prime factor a number ... but it takes toooooo long to execute ... pls have a look at my code : http://pastie.org/5470941
<wildcard0>
quick glace, you only need to search to num/2 for primes
<wildcard0>
cause 3*9 = 9*3
<hoelzro>
you could limit it further to sqrt(num)
<nomenkun_>
you keep dividing yet as soon as you increase counter you can return false
<wildcard0>
also, you only need to look at odd numbers
<wildcard0>
so you can do (3..num).step(2) do
<arabi>
ok
<arabi>
lemme see what happens
<wildcard0>
basically a bunch of small optimization that should cut out a huge number of cases
arturaz has quit [Read error: Connection reset by peer]
<JonnieCache>
banisterfiend: rbenv (or rather ruby-build) doesnt do anything special to add it to rbenv. it just builds it in the .rbenv/versions directory. thats it
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
nemesit has joined #ruby
<postmodern>
also a good trick is to set RUBY_BUILD_BUILD_PATH and use ruby-build -k
<postmodern>
which keeps the source code, in case you have to patch/re-compile
fir_ed has quit [Ping timeout: 265 seconds]
chussenot has quit [Quit: chussenot]
mvangala has quit [Read error: Connection reset by peer]
rohit_ has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
hemanth has joined #ruby
bgh has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
leonardorb has joined #ruby
bgh has joined #ruby
topek has joined #ruby
cantonic has joined #ruby
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
postmodern has quit [Quit: Leaving]
hemanth has joined #ruby
replore has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
mvangala has joined #ruby
samphippen has joined #ruby
kil0byte_ has joined #ruby
paolooo has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
kil0byte has quit [Ping timeout: 245 seconds]
hemanth has joined #ruby
hotovson has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
smi_ has quit [Quit: Page closed]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
bier has joined #ruby
bier_ has joined #ruby
jaygen has joined #ruby
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
xkx has joined #ruby
xkx has quit [Client Quit]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
igro has quit [Quit: Computer has gone to sleep.]
piotr_ has joined #ruby
piotr has quit [Ping timeout: 245 seconds]
swarley- has joined #ruby
bgh has quit [Ping timeout: 252 seconds]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
pcarrier has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
mvangala has quit [Read error: Connection reset by peer]
SPYGAME has quit [Ping timeout: 260 seconds]
hamed_r has joined #ruby
hemanth has joined #ruby
swarley| has quit [Ping timeout: 255 seconds]
hemanth has quit [Read error: Connection reset by peer]
atmosx_ has joined #ruby
[Neurotic] has quit [Ping timeout: 264 seconds]
gbchaosmaster has quit [Read error: Operation timed out]
googya has quit [Quit: Leaving.]
xpen has joined #ruby
hemanth has joined #ruby
browndawg has quit [Quit: Leaving.]
hemanth has quit [Read error: Connection reset by peer]
swarley- has quit [Ping timeout: 246 seconds]
pcarrier has quit [Ping timeout: 245 seconds]
ExxKA has quit [Quit: This computer has gone to sleep]
mvangala has joined #ruby
atmosx has quit [Ping timeout: 276 seconds]
hemanth has joined #ruby
xpen has quit [Remote host closed the connection]
pcarrier has joined #ruby
topek has quit [Quit: Leaving.]
hemanth has quit [Read error: Connection reset by peer]
byennen has joined #ruby
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
rohit_ has joined #ruby
kevinykchan has quit [Quit: Computer has gone to sleep.]
tobinharris has joined #ruby
undersc0re97 has quit [Ping timeout: 245 seconds]
hemanth has joined #ruby
aetcore has quit [Quit: aetcore]
hemanth has quit [Read error: Connection reset by peer]
yacks has quit [Quit: Leaving]
hemanth has joined #ruby
jdripper has joined #ruby
kil0byte has joined #ruby
lenovodroid has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
yacks has joined #ruby
hemanth has joined #ruby
cousine has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
kil0byte_ has quit [Ping timeout: 256 seconds]
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
ToTo has joined #ruby
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
<dawkirst3>
Hello, I'm really new to Ruby and Linux. I'm trying to move a temporary file (uploaded through the browser) in /tmp/ to an app directory with FileUtils.move. I get a permission denied error. I've ran chmod -R 777 /tmp/ and confirmed with ls -l. Still getting the error though. Any ideas?
eka has joined #ruby
replore_ has joined #ruby
jeffreybaird has joined #ruby
<apeiros_>
aren't tempfiles unlinked right after creation?
<hoelzro>
dawkirst3: what are the permissions of the destination?
<dawkirst3>
hoelzro also ran chmod -R 777 there
<hoelzro>
dawkirst3: is the tempfile owned by the user that's running the Ruby process?
<hoelzro>
also, you should be careful about arbitrarily changing permissions, especially in /tmp
jprovazn has quit [Quit: Leaving]
browndawg has quit [Ping timeout: 265 seconds]
eka has quit [Ping timeout: 245 seconds]
<dawkirst3>
ok wait, I feel stupid: I've changed FileUtils.mv(path,/path) to FileUtils.mv(path,path/) and now it works. Did the formal look for a file in the root, and the latter for a directory?
<dawkirst3>
hoelzro they were owned by root
leonardorb has quit [Remote host closed the connection]
<dawkirst3>
I changed owner to my user, then changed owner back to root
<dawkirst3>
but any new temp files are now still owned by my user (probably because my user is running the browser that creates the file)
braoru has quit [Ping timeout: 265 seconds]
thunderstrike has joined #ruby
thunderstrike has quit [Remote host closed the connection]
<dawkirst3>
hoelzro why would the second path have worked though (I'm trying to understand Linux, as I said -- only installed Ubuntu today)
<hoelzro>
dawkirst3: possibly some magic of how FileUtils works
<JonnieCache>
path/ is realative to the current dir
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
<JonnieCache>
/path is an absolute path starting at the root
<hoelzro>
oh, I didn't see the leading slash in the former example
<hoelzro>
JonnieCache: good catch
awarner has quit [Remote host closed the connection]
<JonnieCache>
dawkirst3: /path is equivalent to c:\path
<dawkirst3>
thanks JonnieCache, so path/ would be a relative path?
<dawkirst3>
awesome, makes sense
advorak has joined #ruby
<dawkirst3>
that is why I can navigate to tmp by going cd /tmp even though I'm not relative to that path
banisterfiend has quit [Ping timeout: 260 seconds]
<dawkirst3>
hoelzro back to not arbitrarily changing owners and permissions in /tmp, is there a way to change it back?
<dawkirst3>
or reset it to some default state?
<hoelzro>
dawkirst3: well, rebooting it will likely fix that =)
a_a_g has quit [Quit: Leaving.]
<hoelzro>
I can never remember what the default is
<dawkirst3>
ok :)
<dawkirst3>
thanks
<hoelzro>
I want to say 755, but that's probably wrong
<hoelzro>
or maybe it's 4777?
<maetthew>
I'm trying to make an IRC bot with Cinch and DataMapper. I am having trouble saving to the database. Why am I getting this error when @player_create.save is called on line 21 (in tf2mixbot.rb) -- https://gist.github.com/4195052
<dawkirst3>
I'll reboot
nomenkun_ has quit [Read error: Connection reset by peer]
margle has quit [Quit: Computer has gone to sleep.]
<hoelzro>
it's 1777 on my box
nomenkun has joined #ruby
<maetthew>
err
mikecmpbll has joined #ruby
<maetthew>
nvm me i will refine my question
<dawkirst3>
hoelzro one last question - I've played around with Ruby on a Windows box, but in Ubuntu I need to run ruby -rubygems somesrcript.rb for my gems to be required. Why is that? How does gem include paths work?
philips_ has quit [Excess Flood]
synthetix has quit [Ping timeout: 245 seconds]
<hoelzro>
dawkirst3: is your Ubuntu ruby 1.8?
<dawkirst3>
uhm
<apeiros_>
maetthew: @player != @player_create
elementz has quit [Remote host closed the connection]
<dawkirst3>
yes
<hoelzro>
dawkirst3: that would be why =)_
<maetthew>
apeiros_, I know I failed when making the gist..
<maetthew>
I'm trying to make an IRC bot with Cinch and DataMapper. I am having trouble saving to the database. Why am I getting this error when @player_create.save is called on line 21 (in tf2mixbot.rb) -- https://gist.github.com/4195052
<maetthew>
apeiros_, ^
<maetthew>
oops and its @player.save not @player_create
<maetthew>
still haven't woken up :P
ner0x has joined #ruby
<maetthew>
And it's actually not an error. It's just that nothing is happening
samphippen has joined #ruby
philips_ has joined #ruby
<apeiros_>
maetthew: I'd read the datamapper docs
Adget has joined #ruby
<maetthew>
apeiros_, that's what i'm doing. well not the docs but the "getting started" doc
<apeiros_>
if datamapper works like AR wrt #save, then it might well be that your save returned false
<apeiros_>
returns a boolean. and in your case, it probably returns false.
<dawkirst3>
hoelzro ok, can I update Ruby through apt or apt-get? (don't undersand the difference yet)
pcarrier has joined #ruby
<maetthew>
apeiros_, hmm ok. Will check if it's actually false
chaosis has quit [Ping timeout: 260 seconds]
<maetthew>
apeiros_, I should be able to do if @player.save == true then?
<hoelzro>
dawkirst3: I wouldn't recommend it
<apeiros_>
you can drop the '== true'
<apeiros_>
but yes
<hoelzro>
dawkirst3: well, I think (but don't know) that there's a ruby19 package
<hoelzro>
which would be ok to use
<hoelzro>
however
<maetthew>
apeiros_, Indeed i did an ifelse and it returns "save failed" :/
<hoelzro>
the rule of thumb is to not mess with the system Ruby
freeayu has quit [Ping timeout: 255 seconds]
<maetthew>
apeiros_, Any idea why it will return false?
<hoelzro>
most people these days use rbenv or rvm
<apeiros_>
maetthew: no, #datamapper might be more helpful for that
<dawkirst3>
hoelzro ok
daniel_- has quit [Ping timeout: 245 seconds]
<hoelzro>
maetthew: apt is the suite of tools; apt-get downloads and installs things
<maetthew>
apeiros_, thank you didn't think of that
Tombar has joined #ruby
dawkirst3 is now known as dawkirst
fmsmkq has joined #ruby
rippa has joined #ruby
workmad3 has joined #ruby
<dawkirst>
hoelzro thanks for that (I assume it was meant for me)
<hoelzro>
dawkirst: indeed it was =)
<maetthew>
:P
<dawkirst>
hoelzro well thanks for the help and thanks for being so friendly (I was initially quite scared to ask the question)
<hoelzro>
no problem! don't be scared to ask =)
reinaldob has quit [Remote host closed the connection]
eka has joined #ruby
bwwrd has joined #ruby
reinaldob has joined #ruby
binarypl1 has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
nga4 has quit [Ping timeout: 250 seconds]
rippa has quit [Ping timeout: 248 seconds]
browndawg has joined #ruby
yewton has quit [Excess Flood]
yewton has joined #ruby
fmsmkq has quit [Remote host closed the connection]
<dawkirst>
ok thanks, no terminal command that fetches a description from rubygems.org?
ninp0 has quit [Ping timeout: 252 seconds]
yacks has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
yewton has quit [Max SendQ exceeded]
<hoelzro>
not that I know of, but my Ruby-fu is actually quite weak
yewton has joined #ruby
<dawkirst>
ok
slainer68 has quit [Remote host closed the connection]
bluenemo has joined #ruby
ninp0 has joined #ruby
jharris has joined #ruby
jrist-afk is now known as jrist
slainer68 has joined #ruby
brendan_ is now known as brendan`
niklasb has quit [Ping timeout: 252 seconds]
centipedefarmer has joined #ruby
<JonnieCache>
dawkirst: theres `gem -r spec <gemname>` but that dumps the whole specfile
<JonnieCache>
dawkirst: easiest probably to just go to rubygems.org
<dawkirst>
thank JonnieCache. specfile?
<JonnieCache>
the metadata file that defines the gem
<JonnieCache>
try it and see
<dawkirst>
ok, thanks
<dawkirst>
will do
chussenot_ has joined #ruby
Adget1 has joined #ruby
elkclone has quit [Quit: It's never too late to unplug and run.]
elkclone has joined #ruby
jrunning has joined #ruby
jrist has quit [Ping timeout: 255 seconds]
chussenot has quit [Ping timeout: 245 seconds]
chussenot_ is now known as chussenot
yewton has quit [Max SendQ exceeded]
_nitti has joined #ruby
Adget has quit [Ping timeout: 245 seconds]
jrist has joined #ruby
yewton has joined #ruby
asobrasil has joined #ruby
kil0byte has joined #ruby
xpen has joined #ruby
devdazed has joined #ruby
_nitti has quit [Remote host closed the connection]
_nitti has joined #ruby
ttt has joined #ruby
staafl has quit [Quit: Leaving]
kil0byte_ has quit [Ping timeout: 264 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
<ner0x>
Has anyone used geocoder with geonames service?
AndChat| has joined #ruby
<apeiros_>
anyone surely has, but I think he left just 5min ago
king313 has joined #ruby
<dawkirst>
JonnieCache, do people typically use ri?
Banistergalaxy has quit [Ping timeout: 245 seconds]
<iamjarvo>
apeiros_: funny
ttt has quit [Ping timeout: 245 seconds]
<apeiros_>
dawkirst: I do. And I'd advocate using it.
rtd has joined #ruby
<dawkirst>
apeiros_, can I run ri from anywhere, or must it be in a dir with a ruby script in?
awarner has joined #ruby
<apeiros_>
dawkirst: anywhere
sailias has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<apeiros_>
it's a normal shell utility
nga4 has joined #ruby
mpereira has joined #ruby
ananthakumaran has joined #ruby
<ner0x>
apeiros_: Your humor. It amuses me.
cakehero has joined #ruby
<ner0x>
apeiros_: Just curious as it doesn't seem to be one of the geocoding services built in, that's all. :)
<JonnieCache>
dawkirst: i never use it but i probably should
<dawkirst>
apeiros_, as an example, ri Hash responds with a "Nothing known about Hash". Should I update it somehow?
ixti has quit [Read error: Connection reset by peer]
<JonnieCache>
i think you have to install the docs somehow
Tombar has quit [Remote host closed the connection]
binarypl1 has quit [Quit: WeeChat 0.3.9.2]
<dawkirst>
JonnieCache, ok
<JonnieCache>
someone here must know
Tombar has joined #ruby
ixti has joined #ruby
koshii has quit [Ping timeout: 265 seconds]
Coolhand has quit [Ping timeout: 252 seconds]
<dawkirst>
JonnieCache, does ri get its documentation from ruby-doc.org?
ixti has quit [Read error: Connection reset by peer]
<JonnieCache>
no, its stored locally
heathd has joined #ruby
S2kx has joined #ruby
kevinykchan has joined #ruby
<JonnieCache>
and generated when things are installed. however that document generating step is optional and presumably in your case it was disabled
<dawkirst>
JonnieCache, ok, so I assume it's a local copy of the stuff at ruby-doc.org?
<dawkirst>
JonnieCache, ok
<JonnieCache>
it is common to disable it because it makes installing everything take significantly longer
braoru has joined #ruby
<workmad3>
especially as you can generate it on demand (although I can never remember the command for that)
<dawkirst>
yup, I can image
<dawkirst>
*imagine
<JonnieCache>
dawkirst: its generated from comments in the source code, and therefore yes it is ultimately the same content from rubydoc.org, rdoc.info and many other places
king313 has quit [Read error: Connection reset by peer]
Coolhand has joined #ruby
ixti has joined #ruby
<dawkirst>
workmad3, I imagine that's somehow done through the rdoc command?
ExxKA has joined #ruby
leonardorb has joined #ruby
bluenemo has quit [Remote host closed the connection]
<JonnieCache>
ri is different from rdoc somehow. then theres YARD as well. i never use any of it, i just look it all up in the browser
pcarrier has quit []
<JonnieCache>
partially because it seems so complicated and fractured like this
S1kx has quit [Ping timeout: 265 seconds]
<banisterfiend>
JonnieCache: youer' supposed to just use pry for, traitor
tk__ has quit [Quit: ばいばい]
<banisterfiend>
jk
ixti has quit [Read error: Connection reset by peer]
jeffreybaird has joined #ruby
samphippen has joined #ruby
<workmad3>
banisterfiend: does pry generate ri on demand if nothing is found? :)
<banisterfiend>
workmad3: it doesnt need to generate, i package a database with the pry-doc gem
CreativeEmbassy has joined #ruby
<workmad3>
heh
<banisterfiend>
workmad3: and that's only for core
<banisterfiend>
workmad3: for everything else, pry grabs the docs directly from teh source itself on demand
<JonnieCache>
pry(main)> ri String
<JonnieCache>
error: 'String' not found
<banisterfiend>
JonnieCache: dont use ri
<JonnieCache>
is that because I lack pry-doc?
<banisterfiend>
JonnieCache: use show-doc
leonardorb has quit [Ping timeout: 245 seconds]
<banisterfiend>
JonnieCache: ah, but yes for core docs you need pry-doc
freeayu has joined #ruby
<JonnieCache>
hmm i have that
ixti has joined #ruby
mpereira has quit [Ping timeout: 260 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
hm let me check
<JonnieCache>
it spits out the rdoc with <code>tags</code> in it and the like
awarner has quit [Remote host closed the connection]
<JonnieCache>
ill stick to the browser :P
ixti has quit [Read error: Connection reset by peer]
<workmad3>
banisterfiend: hmm, 'ri String' shows nicer output than 'show-doc String' for me :P
<banisterfiend>
JonnieCache: really? can u gist it?
Nick|laptop has quit [Remote host closed the connection]
GoGoGarrett has joined #ruby
slainer68 has quit [Remote host closed the connection]
reinaldob has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<JonnieCache>
i guess if youre shipping your own doc files you should be able to strip that however you want
<banisterfiend>
JonnieCache: ah, ok we forgot to render <code>, it's weird, cos ruby docs use a tonne of different tags and we support most of it: ``, <tt>, etc
carlyle has joined #ruby
slainer68 has joined #ruby
<JonnieCache>
what do you do, replace them with control codes?
<banisterfiend>
JonnieCache: Yeah, we do for most of the stuff, check out this:
<banisterfiend>
JonnieCache: yes, in the case of tags that indicate code, we render it using CodeRay so we properly syntax highlight the code
crankycoder has quit [Quit: leaving]
<banisterfiend>
for other tags we bold the text, and so on
odyssey4me has joined #ruby
crankycoder has joined #ruby
<JonnieCache>
the other reason i dont ever use ri is because to type # on a mac keyboard is alt+3
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<JonnieCache>
and alt+3 is bound to various things im my terminal
<banisterfiend>
JonnieCache: workmad3 in most cases it shoudl output correctly (in my experience), for some reason we just forgot to deal with <code>
stopbit has joined #ruby
cousine has quit [Remote host closed the connection]
malkomalko has quit [Remote host closed the connection]
<banisterfiend>
JonnieCache: oh ok..but another advantage in getting used to using show-doc in pry, is that it'll work on arbitrary gems that you install, even if you have --no-ri --no-rdoc set during gem installation (which most people do)
<JonnieCache>
first step is to rebind the fucking § key to send # instead, without just binding it to alt+3
dmerrick has joined #ruby
<JonnieCache>
which is something i have so far failed to do, because i havent really tried very hard
katherinem13_bed is now known as katherinem13
nyuszika7h has joined #ruby
techhelp has joined #ruby
<banisterfiend>
workmad3: IMO, that's way too much information, if i want to know the methods an object has, i just use: ls -M in pry, i dont want to be spammed with that info just when reading docs
Tombar has quit [Ping timeout: 260 seconds]
<workmad3>
banisterfiend: yeah, but pry pages it ;)
<dawkirst>
banisterfiend, what is pry?
<workmad3>
banisterfiend: and the includes and the superclass before the description are quite nice IMO
vasile has joined #ruby
xpen has quit [Remote host closed the connection]
<banisterfiend>
sure, but, for me anyway, i'm just not interested in the methods an object has when i want to read docs, but everyone is diffrent
nomenkun has quit [Remote host closed the connection]
_alejandro has joined #ruby
Sigma00 has quit [Client Quit]
Direktor has joined #ruby
kil0byte has joined #ruby
<dawkirst>
apeiros_, I think what confused me is that I tried to remove ruby with apt but it seems as if it wasn't removed
Direktor has quit [Read error: Connection reset by peer]
Spaceboy has joined #ruby
<apeiros_>
dawkirst: just leave apt's ruby
Sigma00 has joined #ruby
<dawkirst>
ok
yacks has quit [Ping timeout: 260 seconds]
tonini has quit [Remote host closed the connection]
Adget1 has quit [Ping timeout: 245 seconds]
<dawkirst>
apeiros_, so when you say you won't install rvm through apt, how would you install it then?
kil0byte_ has quit [Ping timeout: 250 seconds]
tagrudev has quit [Quit: :||:"!@]
rippa has joined #ruby
<dawkirst>
apeiros_, nm, read something on the site
Takehiro has joined #ruby
arya has joined #ruby
levabalkin has joined #ruby
levabalkin has quit [Client Quit]
k610 has quit [Ping timeout: 255 seconds]
levabalkin has joined #ruby
levabalkin has left #ruby [#ruby]
malkomalko has joined #ruby
freeayu has quit [Ping timeout: 265 seconds]
beardyjay has joined #ruby
ToTo has quit [Ping timeout: 244 seconds]
SPYGAME has quit [Ping timeout: 248 seconds]
mpereira has joined #ruby
Virunga has joined #ruby
leonardorb has joined #ruby
radic has quit [Excess Flood]
radic has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
skaczor has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
Jefus has joined #ruby
Takehiro has joined #ruby
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
BigO has joined #ruby
Slivka has joined #ruby
lenovodroid has quit [Client Quit]
philcrissman has quit [Remote host closed the connection]
Slivka has quit [Read error: Connection reset by peer]
jlogsdon has joined #ruby
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
Slivka has joined #ruby
levabalkin has joined #ruby
philcrissman has joined #ruby
levabalkin has left #ruby [#ruby]
_nitti has joined #ruby
ly- has quit [Remote host closed the connection]
jgarvey has joined #ruby
cj3kim has joined #ruby
jenrzzz has joined #ruby
vjt has joined #ruby
levabalkin has joined #ruby
generalissimo has joined #ruby
ToTo has joined #ruby
pcarrier has quit []
daniel_- has joined #ruby
levabalkin has left #ruby [#ruby]
jlast has joined #ruby
<dawkirst>
apeiros_, great success, thanks
levabalkin has joined #ruby
browndawg has left #ruby [#ruby]
lenovodroid has joined #ruby
Jefus has quit [Quit: leaving]
zigomir has quit [Quit: zigomir]
nascro has joined #ruby
SPYGAME has joined #ruby
icole has joined #ruby
mpereira has quit [Ping timeout: 255 seconds]
<apeiros_>
dawkirst: great :)
techhelp has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
<dawkirst>
apeiros_, I do have some sort of a consequent problem, and that is my ruby scripts don't pick up the required gems, something to do with the gem path (I'm *really* new to all this, so please bear with me)
beilabs has quit [Ping timeout: 244 seconds]
mmitchell has joined #ruby
beilabs has joined #ruby
icole has quit [Ping timeout: 265 seconds]
lejonet has joined #ruby
<lejonet>
Are there any good libraries for bignum math? I'm getting Infinity from Math.sqrt 2**(2**13) + 1, which I doubt...
samphippen has joined #ruby
beardyjay has quit [Quit: WeeChat 0.4.0-dev]
<apeiros_>
dawkirst: yeah, for rvm installed ruby, you should reinstall the gems
the_hack has joined #ruby
Bry8Star has quit [Remote host closed the connection]
<apeiros_>
rvm separates its rubies completely from system ruby
marr has quit [Ping timeout: 256 seconds]
<apeiros_>
#rvm is a very helpful and active channel btw. ;-)
jenrzzz has quit [Ping timeout: 265 seconds]
<the_hack>
Hello, is there a way to ca
<dawkirst>
apeiros_, I see, heading over there now :)
ToTo has quit [Quit: Leaving...]
<the_hack>
Is there a way to look up a class from a string, for example, the exact reverse of variable.class.inspect ?
maesbn has quit [Remote host closed the connection]
<davidcelis>
it should be obvious where after you read that
pcarrier has quit [Ping timeout: 244 seconds]
philcrissman has quit [Remote host closed the connection]
pcarrier has joined #ruby
<danneu>
ruby 2.0.0-preview2 is slower than preview1 in every benchmark in my benchmark folder. often slower than mri, too. preview1 always faster than mri
replore_ has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
jekotia has joined #ruby
mikecmpbll has joined #ruby
<davidcelis>
thats a feature
niklasb has quit [Ping timeout: 255 seconds]
bradhe has joined #ruby
lolmaus has quit []
a_a_g1 has joined #ruby
adac has quit [Quit: Leaving]
alanp has quit [Ping timeout: 264 seconds]
failshell has quit [Quit: Lost terminal]
flip_digits has joined #ruby
phantasm66 has quit [Quit: *poof*]
dzhulk has joined #ruby
the_hack has quit [Quit: Computer has gone to sleep.]
Cicloid has joined #ruby
<danneu>
im moving to duby
<danneu>
er mirah
alanp has joined #ruby
joeycarmello has quit [Remote host closed the connection]
haxrbyte has joined #ruby
joeycarmello has joined #ruby
<ner0x>
If I had a string. How can I replace the first and last " of the message?
<ner0x>
I could replace it with '' huh.
daniel_- has quit [Ping timeout: 265 seconds]
carloslopes has joined #ruby
nascro has quit []
ckrailo has joined #ruby
mneorr has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
jrajav has quit [Quit: I tend to be neutral about apples]
<ner0x>
gsub will work for the middle, .gsub( /$"/, '' ) didn't work though.
cheier has joined #ruby
ryanlecompte has joined #ruby
xpen_ has quit [Remote host closed the connection]
<danneu>
ner0x: what's the msg look like
haxrbyte has quit [Ping timeout: 260 seconds]
<danneu>
ner0x: %{"hello"}.gsub(/"/, '') ?
lenovodroid has quit [Ping timeout: 256 seconds]
the_hack has joined #ruby
the_hack has quit [Remote host closed the connection]
mneorr has joined #ruby
<ner0x>
danneu: It's CSV but I'm removing the first " the last " and any "," in between. The middle I have, the first I have as well, it's the last one I'm having trouble with.
mneorr has quit [Remote host closed the connection]
<shevy>
ner0x, you could reverse the string, find the position via .index, then deduct that number from string.size to find the top right element... or perhaps... .rindex
bradhe has quit [Remote host closed the connection]
banisterfiend has joined #ruby
* ner0x
looks up the docs.
<danneu>
or remove a '"' suffix if String#end_with?(suffix) exists?
geekbri has joined #ruby
freeayu has joined #ruby
<davidcelis>
/$(").*(")^/
yshh has joined #ruby
<davidcelis>
if you want to do it on each line of the CSV
kirun has joined #ruby
hoelzro is now known as hoelzro|away
<danneu>
isnt $ and ^ swapped
<davidcelis>
yes
<davidcelis>
my bad
geekbri has quit [Read error: Connection reset by peer]
geekbri has joined #ruby
flagg0204 has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
Slivka has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
yshh has quit [Ping timeout: 252 seconds]
ameech has joined #ruby
<ameech>
Hello
flagg0204 has quit [Client Quit]
flagg0204 has joined #ruby
Xeago_ has joined #ruby
weasels has joined #ruby
<davidcelis>
Hi
LBRapid has joined #ruby
<ameech>
Does anyone have any experience with daemonizing Guard?
workmad3 has joined #ruby
freeayu_ has joined #ruby
ananthakumaran1 has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
aganov has quit [Remote host closed the connection]
ehc_ has joined #ruby
cakehero_ has joined #ruby
weasels has quit [Ping timeout: 264 seconds]
danneu1 has joined #ruby
cheier has quit [Quit: cheier]
carlyle has quit [Ping timeout: 245 seconds]
arabi has joined #ruby
vertog has joined #ruby
vertog is now known as verto
BadLarry_ has joined #ruby
mneorr has joined #ruby
verto is now known as Guest97488
samphippen has quit [Quit: Computer has gone to sleep.]
<arabi>
helloo.... i am new to ruby... i was working on a program to find sum of prime numbers below 2million .. it takes too long to complete ...any help on the code http://pastie.org/5474669
Nykolla_ has joined #ruby
icole has joined #ruby
<danneu1>
cody--: we can't see Video class. is there indeed a class method 'import'?
ameech has left #ruby [#ruby]
lenovodroid has joined #ruby
<tommylommykins>
hmmm
centipedefarmer has quit [Remote host closed the connection]
twopoint718 has quit [Write error: Connection reset by peer]
Monie has quit [Write error: Connection reset by peer]
dnyy has quit [Write error: Connection reset by peer]
moshee has quit [Read error: Connection reset by peer]
phantasm66 has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
beiter has joined #ruby
larissa has quit [Quit: Leaving]
<arabi>
helloo.... i am new to ruby... i was working on a program to find sum of prime numbers below 2million .. it takes too long to complete ...any help on the code http://pastie.org/5474669
<danneu1>
arabi: trial division for primes is slow
awarner has joined #ruby
Vert has quit [Quit: No Ping reply in 180 seconds.]
Vert has joined #ruby
<cody-->
any thoughts danneu1?
<danneu1>
arabi: although using a sieve or Ruby's Prime class might defeat the challenge of waht sounds like a euler problem
mguy has quit [Read error: Connection reset by peer]
<arabi>
what else algorithm I can use
<arabi>
yes it is a euler problem
elkclone has quit [Quit: It's never too late to unplug and run.]
mguy has joined #ruby
Nykolla has quit [Ping timeout: 250 seconds]
carlyle has joined #ruby
<danneu1>
cody--: that link doesnt even load for me. did you 'require' it in the file
beilabs has joined #ruby
icole has quit [Ping timeout: 250 seconds]
<cody-->
It's a method active record has
alup has joined #ruby
<danneu1>
oh, the link didn't load and i assumed you were using the mass import gem
capaterra has joined #ruby
dr_bob has quit [Quit: Leaving.]
phantasm66 has quit [Client Quit]
<danneu1>
arabi: just look up prime number algorithm and implement it in ruby. check out sieve of erato
byennen has quit [Remote host closed the connection]
Hanmac has joined #ruby
<danneu1>
iirc ruby does implement the erato sieve (and others?) in stdlib, but i see there's pretty bad documentation
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
froy has joined #ruby
nat2610 has joined #ruby
<tommylommykins>
lol
<danneu1>
arabi: but staying with your algorithm, i didnt really inspect it but you should cache the primes you find.
* tommylommykins
was about to ask 'why is so hard to zip the natural numbers with the elements of an array?'
<tommylommykins>
but then I remembered each_with_index :s
phantasm66 has quit [Client Quit]
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
<arabi>
danneu1 i have tried it with smaller ranges say 10, 100, 1000 ... it works fine
<danneu1>
arabi: yeah but 2M is alrger than 1000
<JonnieCache>
tommylommykins: i think you can even just do array.each |element, index|
<JonnieCache>
tommylommykins: each_with_index is just for clarity. maybe im wrong though
<danneu1>
especially when you're doing 2M iterations, each iteration iterating (2..2_000_000-iteration_number)
tommyvyo has quit [Quit: Computer has gone to sleep.]
<dawkirst>
JonnieCache, since you're still here, I'll ask you: if I found a gem on github, how do I include it? Do I download it and build it?
<arabi>
%W{a b c d e f}.each {|a, b| puts b.inspect} when i type this i am getting all nill
<arabi>
%W{a b c d e f}.each {|a, b| puts a.inspect} but it works fine
morf has quit [Quit: eof]
<arabi>
that's what i meant
osvico has quit [Ping timeout: 256 seconds]
atmosx_ is now known as atmosx
cdt_ has quit [Ping timeout: 246 seconds]
<foucist>
that's becuase the %W{} is giving you ["a", "b", "c", "d", "e", "f"]
codecaster has joined #ruby
<Xeago>
there is no second argument to be passed to the block
sn0wb1rd has quit [Quit: sn0wb1rd]
atmosx has quit [Quit: WeeChat 0.4.0-dev]
flagg0204 has joined #ruby
slainer68 has quit [Remote host closed the connection]
<arabi>
yes that is JonnieCache what you meant actually?
Xeago has quit [Remote host closed the connection]
codecaster has quit [Client Quit]
byennen has joined #ruby
<JonnieCache>
yeah because theres no second argument
byennen has quit [Read error: Connection reset by peer]
<JonnieCache>
i thought there was but there isnt. sorry for confusing everyone
<JonnieCache>
dawkirst: no, its all automatic
<a_a_g1>
arabi: ruby does not check the number of arguments passed to procs/lambdas. If you pass less, extra local args are set to nil. If you pass more, they are ignored
byennen has joined #ruby
<JonnieCache>
dawkirst: you can install a gem with `gem install <gemname>` on the command line
a_a_g1 is now known as a_a_g
<JonnieCache>
dawkirst: but in practise gem management is typically done through bundler
<dawkirst>
a_a_g, so is it possible to add a git repo as a source?
bluenemo has quit [Remote host closed the connection]
segora has joined #ruby
<a_a_g>
no, you cant add a git repo, you can only add a gem server
<a_a_g>
are you using bundler?
banister_ has joined #ruby
<luckyruby>
is there a way to configure ActionMailer to use a different logfile to log emails sent?
alx- has joined #ruby
<luckyruby>
oops, sorry wrong channel
jharris has quit [Quit: WeeChat 0.3.8]
dmiller has joined #ruby
<dawkirst>
a_a_g, no, I need to wrap my head around bundler first (I've only just installed rvm). Can you recommend a good screencast or article for that?
<a_a_g>
hm, not really. basic bundler usage is very simple
<dawkirst>
Would bundler sort those dependencies for me?
adeponte has joined #ruby
<a_a_g>
in your project directory, you create a file called Gemfile
<dawkirst>
Or what I'm trying to understand: how would bundler help me where a normal gem install <gem> won't?
areil has quit [Remote host closed the connection]
barraponto has joined #ruby
<barraponto>
is there a channel for middleman?
<a_a_g>
i dont get what probem in particular it solves
<danneu1>
barraponto: i google 'irc channel middleman'
carlyle_ has joined #ruby
Guest97488 is now known as verto
chussenot has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
Vainoharhainen has joined #ruby
chussenot has joined #ruby
<barraponto>
danneu1: swiftirc?
alvaro_o has joined #ruby
Elico has quit [Remote host closed the connection]
<danneu1>
dunno mate, just a google query
byennen has quit [Remote host closed the connection]
carlyle has quit [Ping timeout: 245 seconds]
alx- has quit [Quit: alx-]
<barraponto>
oh if it was obvious from a google query i wouldn't have asked.
barraponto has left #ruby [#ruby]
<danneu1>
attitude
BigO has quit [Remote host closed the connection]
Elico has joined #ruby
eldariof has joined #ruby
dobbymoo` has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
dobbymoodge has quit [Ping timeout: 246 seconds]
Adget1 has joined #ruby
BigO has joined #ruby
slash_nick has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
Squarepy has joined #ruby
Adget has quit [Ping timeout: 256 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<lectrick>
FizzBuzz in Ruby, done via functional style, without any conditionals whatsoever (yes, that last part was hard) :) https://gist.github.com/4196452
<ner0x>
In order to fix broken csv, what would be the easier way to extract "Name "The Don" Lastname" out of it?
<ner0x>
Notice the broken CSV with his nickname.
Elico has quit [Remote host closed the connection]
Elico has joined #ruby
moted has joined #ruby
SPYGAME has quit [Read error: Connection reset by peer]
Vainoharhainen has quit [Quit: Leaving...]
arietis has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
nat2610 has left #ruby [#ruby]
<waxjar>
i don't understand your question ner0x
piotr_ has joined #ruby
vasile has joined #ruby
piotr has quit [Ping timeout: 245 seconds]
<ner0x>
The program I'm forced to use exports broken CSV. As in "Name "nickname" Last" as a single column, which CSV considered broken.
codecaster has joined #ruby
BigO_ has joined #ruby
rismoney has quit []
sepp2k has joined #ruby
tobinharris has quit [Quit: tobinharris]
tommyvyo_ has joined #ruby
skattyadz has quit [Quit: skattyadz]
BigO has quit [Ping timeout: 256 seconds]
arabi has quit [Quit: Leaving]
iamjarvo has quit [Quit: Leaving.]
<waxjar>
ah, i see. you could clean the cdv file perhaps by gsub'ing all "s, except the ones at the beginning and end of a column
makwanza has joined #ruby
makwanza has quit [Client Quit]
dv_ has quit [Read error: Connection reset by peer]
banister_ is now known as banisterfiend
evangelosavgerin has joined #ruby
<theRoUS>
ruby 1.8.7. is there any way to tell 'bundle install --path=vendor' to *only* bundle gems that aren't available from the system libraries?
<evangelosavgerin>
hello guyz, My team and I are builing a startup that aims to make developers life easier. At this moment we are doing our customer development and we would like some of your time for a brief interview (5 - 10 minutes). If you are interested in please contact us at hi@geembo.com
<evangelosavgerin>
hello guyz, My team and I are builing a startup that aims to make developers life easier. At this moment we are doing our customer development and we would like some of your time for a brief interview (5 - 10 minutes). If you are interested in please contact us at hi@geembo.com
<Hanmac>
ner0x are the cells splited with "," ?
<evangelosavgerin>
hello guyz, My team and I are builing a startup that aims to make developers life easier. At this moment we are doing our customer development and we would like some of your time for a brief interview (5 - 10 minutes). If you are interested in please contact us at hi@geembo.com
evangelosavgerin has quit [Killed (idoru (Spam is off topic on freenode.))]
jdripper has quit [Quit: Leaving.]
<banisterfiend>
what a piece of shit
<theRoUS>
i only want to bundle the gems that are 'non-standard' for our environment, not *all* of them
<davidcelis>
banisterfiend: ikr
tenmilestereo has joined #ruby
philcrissman has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
<davidcelis>
looks like he's trying to rebuild coderwall
<davidcelis>
glwt
vlad_starkov has joined #ruby
dv_ has joined #ruby
cheier has joined #ruby
mrsolo has joined #ruby
kil0byte has quit [Remote host closed the connection]
SPYGAME has joined #ruby
<waxjar>
ner0x, something like column[1..-1].gsub('"', '""') ? (i believe "s are escaped with "" in CSV files, not sure though)
xyzodiac has joined #ruby
tvw has joined #ruby
<banisterfiend>
davidcelis: coderwall is pretty much a waste of time as it is IMO
<davidcelis>
yep
<davidcelis>
unnecessary resume wrapper around github when github serves as a resume already
voodoofish430 has joined #ruby
odyssey4me has quit []
straind has quit []
cascalheira has quit [Quit: Leaving...]
<babykosh>
quick easy one……How to return the hash 'name' with the maximum 'value'…..all values have a number from 1-20….I want the hash 'name' with 'value' = 20?
<banisterfiend>
babykosh: your two questions are contradictory
jharris has joined #ruby
tvw has quit [Remote host closed the connection]
<banisterfiend>
babykosh: hash.max_by { |k,v| v }
dmiller has quit [Remote host closed the connection]
<danneu1>
what came to my mind was hash.invert[h.values.max]
<danneu1>
er, replace h with hash
<eka>
babykosh: hash.max
Takehiro has quit [Remote host closed the connection]
<banisterfiend>
babykosh: u need: hash.max_by { |k, v| v }
<eka>
mmmm nope
<danneu1>
{a: 2, c: 24, d: 3}.max #=> [:d, 3]
<eka>
babykosh: that takes the max key... sorry
freakazoid0223 has quit [Quit: Leaving]
tobinharris has joined #ruby
<babykosh>
hash.max_by {|k,v| v}
<banisterfiend>
babykosh: even better, this: hash.max_by(&:last)
samphippen has quit [Quit: Computer has gone to sleep.]
SPYGAME has quit [Ping timeout: 244 seconds]
bradhe has quit [Remote host closed the connection]
joeycarmello has quit [Remote host closed the connection]
ananthakumaran1 has quit [Quit: Leaving.]
<babykosh>
Thank you all
krawchyk has joined #ruby
roadt_ has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
c0rn has joined #ruby
<babykosh>
ah one more…..so if I say kosh_hash.max_by{|k,v|v}…..I get back a single array as so…[b, 20]…how do I rewrite kosh_hash.max_by{|k,v|v}….so I get back….b?
mascool has joined #ruby
<Hanmac>
kosh_hash.max_by{|k,v|v}[0]
tommyvyo has quit [Quit: Computer has gone to sleep.]
tommyvyo_ is now known as tommyvyo
alexim has joined #ruby
toto_ has joined #ruby
dv_ has quit [Ping timeout: 252 seconds]
ephemerian has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
xyzodiac has quit [Quit: Computer has gone to sleep.]
bradhe has joined #ruby
dv_ has joined #ruby
geekbri has joined #ruby
mengu has joined #ruby
bradhe has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
uris has quit [Ping timeout: 245 seconds]
kil0byte has joined #ruby
PhilK has joined #ruby
bradhe has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
dioms has quit [Ping timeout: 264 seconds]
bradhe has joined #ruby
codecaster has quit [Quit: Leaving.]
toto_ has quit [Ping timeout: 255 seconds]
pu22l3r has joined #ruby
ToTo has joined #ruby
Guest50800 is now known as ged
tbrock has joined #ruby
aquarant_ is now known as aquaranto
cascalheira has joined #ruby
joeycarmello has joined #ruby
vlad_starkov has quit [Ping timeout: 260 seconds]
pcarrier has quit []
arturas_ has quit [Remote host closed the connection]
tobinharris has quit [Quit: tobinharris]
workmad3 has quit [Ping timeout: 250 seconds]
fred909 has joined #ruby
philcrissman has quit [Remote host closed the connection]
arya_ has quit []
dobbymoo` has quit [Read error: Connection reset by peer]
rdark has quit [Quit: leaving]
ChampS666 has joined #ruby
dobbymoo` has joined #ruby
Rydefalk has quit [Remote host closed the connection]
tbrock has quit [Quit: Computer has gone to sleep.]
jrajav has joined #ruby
BrianJ has joined #ruby
Russell^^ has joined #ruby
jamesaxl has joined #ruby
rtd_ has joined #ruby
rtd has quit [Read error: Connection reset by peer]
reinaldob has quit [Remote host closed the connection]
uris has joined #ruby
g-ram has joined #ruby
icole has joined #ruby
philcrissman has joined #ruby
malkomalko has quit [Remote host closed the connection]
grzywacz has quit [Ping timeout: 256 seconds]
xybre has quit [Changing host]
xybre has joined #ruby
nkts has quit [Remote host closed the connection]
dpk is now known as [[]]
[[]] is now known as []
[] is now known as [[[[]]]
<xybre>
So, I'm looking at 2D array solutions in Ruby. There's nested Arrays [[]], Matricies (Matrix class in standard lib), and Narray (gem).
icole has quit [Ping timeout: 244 seconds]
[[[[]]] is now known as kpd
kpd is now known as applebloom
applebloom is now known as dpk
dzhulk has joined #ruby
dangerousdave has joined #ruby
pu22l3r has quit [Remote host closed the connection]
jrist is now known as jrist-afk
emmanuelux has joined #ruby
chaosis has quit [Ping timeout: 260 seconds]
Squarepy has quit [Quit: Leaving]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
ossareh has joined #ruby
Mon_Ouie has quit [Ping timeout: 245 seconds]
mahmoudimus has joined #ruby
Mon_Ouie has joined #ruby
cousine has joined #ruby
toto- has joined #ruby
twopoint818 is now known as twopoint718
Spaceboy has quit [Remote host closed the connection]
brianpWins has joined #ruby
Slivka has joined #ruby
atno has quit [Ping timeout: 255 seconds]
alee has quit [Remote host closed the connection]
craq has joined #ruby
ToTo has quit [Ping timeout: 244 seconds]
a_a_g has quit [Quit: Leaving.]
i_s has joined #ruby
<ner0x>
Is there a way to convert columns of nil to '' ?
<ner0x>
In a \t delimited CSV file.
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
dankest has joined #ruby
swarley| has joined #ruby
Spaceboy has joined #ruby
thomas_6475 has joined #ruby
<thomas_6475>
hi
<thomas_6475>
im using qr ruby and i have overwritten an event handler, mousePressEvent
icole has joined #ruby
<thomas_6475>
now i want to handle that event and then pass it to the superclass(QGraphicsScene) for further handling
<waxjar>
ner0x, you can iterate trough the rows or columns and replace nil with ''
<waxjar>
how to do that depends a bit on the library you're using
Takehiro has joined #ruby
craq has left #ruby [#ruby]
rippa has quit [Ping timeout: 256 seconds]
alee has joined #ruby
mmitchel_ has joined #ruby
JStoker has quit [Excess Flood]
cableray has joined #ruby
<ner0x>
waxjar: CSV core
xyzodiac has joined #ruby
<thomas_6475>
i tey this: "self.class.superclass.instance_method(mousePressEvent).bind(self).call event" but i get this error : `mousePressEvent': wrong number of arguments (0 for 1) (ArgumentError)
swarley- has joined #ruby
bricker has joined #ruby
<waxjar>
I suppose you could use CSV.read, and iterate over the arrays with #map or #map! (they're methods on Enumerable)
<thomas_6475>
how do i pass a parameter when i use .call =
<thomas_6475>
?
<waxjar>
ner0x: altered = CSV.read('file.csv).map { |row| row.map { |column| '' if column.nil? } } something like that?
slainer68 has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
swarley- has quit [Read error: Connection reset by peer]
froy has quit [Read error: Connection reset by peer]
froy has joined #ruby
shevy2 has joined #ruby
manizzle has quit [Ping timeout: 244 seconds]
headius has joined #ruby
JStoker has joined #ruby
arturaz has joined #ruby
shevy has quit [Read error: Operation timed out]
kirun_ has joined #ruby
_nitti has quit [Remote host closed the connection]
centipedefarmer has quit [Remote host closed the connection]
Jamone has joined #ruby
<thomas_6475>
Hanmac: the method i want to call is not listed when i print self.class.superclass.methods
ebouchut has joined #ruby
kirun has quit [Ping timeout: 256 seconds]
lampe2 has joined #ruby
<Hanmac>
you need .instance_methods
Monie has joined #ruby
|Monie| has quit [Ping timeout: 244 seconds]
<lectrick>
anyone here a ruby FP meister?
<apeiros_>
FP?
centipedefarmer has joined #ruby
<lectrick>
apeiros_: ?
<apeiros_>
functional programming?
<lectrick>
yeah
Neomex has joined #ruby
_nitti has joined #ruby
* apeiros_
is only a generic ruby sensei, not an FP meister
ebouchut has quit [Client Quit]
<lectrick>
apeiros_: I am trying to rewrite this higher order function as one that takes an arbitrary number of other functions as arguments instead of just 3, but I'm stumped due to having to pass along the last 'n' argument: append_func1_func2_func3 = lambda{|func1, func2, func3, n| func1.(n) << func2.(n) << func3.(n)}.curry
<Hanmac>
"functional programming" in ruby is a lie because it is still ObjectOrientated because everything is an object :P
Jamone has quit [Ping timeout: 244 seconds]
<apeiros_>
PFP
<lectrick>
ok ok just believe the lie for a second then
<apeiros_>
pretend-FP
<lectrick>
FFP? fake FP
ebouchut has joined #ruby
carloslopes has quit [Remote host closed the connection]
<Beoran_>
P is a lie too sine in reality ,there is only a cpu that does nothing but numeric calculations with registers and pushing data around fro one memory location to another
<Beoran_>
nothing but side effects
<apeiros_>
hi Beoran_ :)
<Beoran_>
hi apeiros_
JohnBat26 has joined #ruby
pyr0commie has joined #ruby
Spaceboy has quit [Quit: Reconnecting]
straind has joined #ruby
<ner0x>
What's the syntax for inline if?
doritostains has quit [Quit: Leaving...]
<ner0x>
I'm used to var = x > 2 ? true : false
soyapi has joined #ruby
<blazes816>
do_something() if foo_bar
<thomas_6475>
can anyone help with qt-ryby? whats the ruby equivalent to qgraphicsitem_cast ?
<apeiros_>
ner0x: that'll work in ruby too
<blazes816>
that also works
<apeiros_>
and that's called ternary
<ner0x>
Great. :)
<apeiros_>
you can also write: var = if cond then a else b end
<apeiros_>
inline-if has a different meaning
adambeynon has joined #ruby
<apeiros_>
it's without the else: puts "it is morning" if Time.now.between?(six, ten)
Spaceboy has joined #ruby
<ner0x>
Ah as in post.delete if params.delete == true etc
baphled has joined #ruby
thomas__3242 has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<lectrick>
apeiros_: so you don't know how to write the function I was looking for, eh
craq has joined #ruby
<apeiros_>
lectrick: no. I could probably figure it out, but I don't know it just like that. and sc2 livestream is more interesting than this problem ;-p
thomas_6475 has quit [Ping timeout: 260 seconds]
ryanf has joined #ruby
soyapi has quit [Quit: Ex-Chat]
workmad3 has quit [Ping timeout: 252 seconds]
nat2610 has left #ruby [#ruby]
bwwrd has joined #ruby
manizzle has joined #ruby
cakehero_ has quit [Quit: Computer has gone to sleep.]
<lectrick>
apeiros_: understood. i'm no stranger to gaming, although i'm too slow for sc2 :/
swarley| has joined #ruby
<lectrick>
I probably average 1 cps
davidcelis has joined #ruby
<apeiros_>
cps?
* apeiros_
only knows apm
<apeiros_>
I'm only silver-league too
dzhulk has quit [Quit: Leaving.]
cousine has quit [Remote host closed the connection]
<lectrick>
apeiros_: ah, 60 apm then lol
davidcelis has quit [Client Quit]
<lectrick>
apeiros_: sorry, my web dev knowledge bled into my gamer knowledge
wermel has quit [Remote host closed the connection]
ewag has quit [Ping timeout: 264 seconds]
aetcore has joined #ruby
<apeiros_>
I'm around 70. not much either :(
<reactormonk>
apeiros_, still hate blizzard
<apeiros_>
reactormonk: why's that?
verto is now known as verto|off
<wmoxam>
heh, I'm silver league too :(
<reactormonk>
apeiros_, because they said
<ner0x>
Can you assign variables in array context. var1 = nil, var2 = nil, [ var1, var2 ] = [ 'lat', 'long' ].map { |x| model.x } ?
<reactormonk>
"if you want to play on US servers, go buy a new game"
mneorr has quit [Remote host closed the connection]
h4mz1d has joined #ruby
toto- has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
mneorr has joined #ruby
Morkel has quit [Read error: Operation timed out]
swarley- has joined #ruby
Morkel has joined #ruby
<reactormonk>
ner0x, nope, but you can plash stuff, var1, var2 = *%w(lat long).map {|x| model.x}
toto_ has joined #ruby
pu22l3r has joined #ruby
savage- has joined #ruby
<reactormonk>
err, splash
Mon_Ouie has quit [Read error: Connection reset by peer]
ctwiz has joined #ruby
<apeiros_>
reactormonk: srsly?
<apeiros_>
reactormonk: I changed servers more than once…
<reactormonk>
apeiros_, yep.
mneorr has quit [Remote host closed the connection]
<apeiros_>
odd
mneorr has joined #ruby
swarley| has quit [Ping timeout: 246 seconds]
ryanlecompte has quit [Ping timeout: 256 seconds]
zodiak has quit [Read error: No route to host]
banisterfiend has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
h4mz1d has quit [Ping timeout: 255 seconds]
heftig has quit [Read error: Connection reset by peer]
craq has left #ruby [#ruby]
<Hanmac>
ner0x: are you sure that .map { |x| model.x } works? i dont think so
nonotza has joined #ruby
heftig_ has joined #ruby
zodiak has joined #ruby
bradhe has quit [Remote host closed the connection]
<reactormonk>
apeiros_, burned by DRM. suppose everyone gotta make that experience
<apeiros_>
:-S
hderms has joined #ruby
jenrzzz has joined #ruby
<hderms>
is there anything in ruby like Object#tap that returns the value of the block instead of self
<hderms>
so like
<hderms>
5.do_something{|x| x- 1}
<hderms>
would return 4
pcarrier has joined #ruby
reset has joined #ruby
savage- has quit [Remote host closed the connection]
danneu1 has quit [Remote host closed the connection]
ryanlecompte has joined #ruby
ctwiz is now known as dpg
<reactormonk>
hderms, yep, but the other way round: {|x| x-1}.call(5)
pcarrier has quit [Client Quit]
<Hanmac>
reactormonk you forgot the proc
<Hanmac>
proc{|x| x-1}[5] #> 4
<banisterfiend>
hderms: i really want this method in ruby: def let() yield end
<hderms>
yeah
<hderms>
that would be nice banisterfiend
<reactormonk>
Hanmac, point.
<banisterfiend>
Hanmac: do you watch 'one piece' ?
<reactormonk>
banisterfiend, go to the ruby mailing list with that just because
weasels has joined #ruby
h4mz1d has joined #ruby
<hderms>
hanmac what is with the array looking notation at the end of that
carloslopes has joined #ruby
<hderms>
is that some kind of unpacking or something
carloslopes has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
<Hanmac>
hderms it is short for .call
jamesaxl has quit [Ping timeout: 260 seconds]
<hderms>
weird
<Hanmac>
banisterfiend do you mean an spcific episode or in general?
<hderms>
never seen that before
<banisterfiend>
Hanmac: in genearl
<Hanmac>
yes i do sometimes
Guest30882 has quit [Quit: Guest30882]
jamesaxl has joined #ruby
<Hanmac>
hderms: look at this: proc{|x| x-1}.(5) ... :P
<hderms>
heh that's ugly
<hderms>
() is a call method
g0bl1n has joined #ruby
<banisterfiend>
Hanmac: this is cuter: ->(x) { x - 1 }.(5)
slash_nick is now known as slash_me
slash_me is now known as slash_nick
<Hanmac>
i not like the arrow ... it looks so agressive :/
<banisterfiend>
Hanmac: it's a phallic symbol
Neomex has quit [Quit: Neomex]
<jlast>
banisterfiend: is coffeescript phalic? -> =>
hadees has joined #ruby
<jlast>
((( -> => -> =>
dmiller has quit [Ping timeout: 265 seconds]
<hderms>
banisterfiend: that's messed up
<Hanmac>
ruby has a semen operator too "=~"
<banisterfiend>
jlast: yeah, and with a thicker shaft too
<banisterfiend>
jlast: sry :P
Synthead has joined #ruby
<jlast>
not as thick as the pound comment #### foo
tPl0ch has joined #ruby
<hderms>
banisterfiend: that doesn't work for me
<jlast>
Hanmac: that is a semen operator
<hderms>
is that particular to a certain version
chimkan has joined #ruby
thomas__3242 has quit [Quit: Leaving]
<banisterfiend>
Hanmac: i thought the rubygems '~>' was the semen operator
dzhulk has joined #ruby
kingdias has joined #ruby
jrist-afk is now known as jrist
weasels is now known as otters
rtd_ has quit [Quit: rtd_]
Xeago has joined #ruby
dmiller has joined #ruby
braoru has quit [Ping timeout: 252 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
kingdias has left #ruby [#ruby]
Beoran_ has quit [Read error: Operation timed out]
<xybre>
2-dimensional lists: nested arrays, Matrix objects, or Narrays?
techhelp has quit [Quit: Leaving]
i_s has quit [Quit: i_s]
verto|off is now known as verto
<slash_nick>
def method_name(&block); block.call; end # Is there a concept of an empty block I can use for &block's default value to prevent NoMethodError for block.call ???
<slash_nick>
nevermind
frem has quit [Ping timeout: 265 seconds]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
haxrbyte has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
tcdent has joined #ruby
darthdeus has joined #ruby
<apeiros_>
slash_nick: block.call if block
tcdent has left #ruby [#ruby]
<apeiros_>
slash_nick: but if you don't pass the block on, you should use `yield if block_given?` instead
haxrbyte has joined #ruby
<apeiros_>
since that doesn't force ruby to create an object from the block
<foucist>
xybre: gonna do math? i'd lean towrads the first if i wasn't doing a whole lot of math
bradhe has joined #ruby
<xybre>
Matrix seems to try to be immutable, so thats probably a no go. Might be good for lookup speed though.
<foucist>
crap, i saw a great snippet for adding arrays together, matrix style, without any matrix libs.. lost it
strangeworks has joined #ruby
arturaz has quit [Ping timeout: 260 seconds]
<epochwolf>
xybre: what's your usecase?
<apeiros_>
Matrix is implemented in pure ruby
<apeiros_>
so no gain
EyesIsMine has quit [Ping timeout: 245 seconds]
<xybre>
No math per se, the biggest trouble is loading and unloading the 2/3d array object, which has the potential to happen often. Loading a block of data and associated objects in the array, operating on it (mostly lookups, but some writes), dumping the changes, and loading up other blocks.
bricker has quit [Quit: leaving]
iamjarvo1 has joined #ruby
bricker has joined #ruby
nomenkun has joined #ruby
<epochwolf>
xybre: I'd go with nested arrays
iamjarvo has quit [Read error: Connection reset by peer]
<xybre>
Its basically terrain data, each gridsquare of terrain will be an object with attributes, but the terrain could be very large. If I go 3D with it, it grows exponentially.
<xybre>
It'll be important to operate upon multiple gridsquares quickly, in a sparse manner (ie, non-sequentially).
philcrissman has quit [Remote host closed the connection]
workmad3 has joined #ruby
bubu\a has joined #ruby
g0bl1n has quit [Ping timeout: 245 seconds]
Adget1 has quit [Quit: Adget1]
dzhulk has joined #ruby
<epochwolf>
xybre: if you're getting into that, I'd do some research into how to process that kind of data
<xybre>
Hmm
<xybre>
I could also use Hashes with an addressing system
toto_ has quit [Ping timeout: 260 seconds]
Beoran_ has joined #ruby
postmodern has joined #ruby
cakehero has joined #ruby
<epochwolf>
xybre: if you're trying to optimize, you need to do research on the type of structures that are optimial for the processing you need to do.
<xybre>
That would be more useful with a sparse field, since not every grid actually contains data.
bradhe has quit [Ping timeout: 264 seconds]
<epochwolf>
xybre: if you're not going to do the research, just do anything that will work. Don't optimize.
philcrissman has joined #ruby
<epochwolf>
xybre: trying to guess without data is unlikely to produce an optimal result
davidcelis has joined #ruby
<foucist>
i don't recall nested arrays being slow when done at a low level
<xybre>
epochwolf: I've looked around a bit, but not sure where to start. But I guess the best thing to do would be to create a sane API abstraction so the implementation could be swapped out easily if it becomes a bottleneck.
<foucist>
lookups are fast afaik
pipopopo has joined #ruby
<foucist>
hashes & addressing is probably even better.. hashmap
<epochwolf>
foucist: it depnds, at the millions of datapoints level, ruby does not handle much well.
<foucist>
epochwolf: yeah i wasj ust thinking at the C level
<foucist>
course if the bottleneck is the ram/disk/bus, then gotta change approach :P
<epochwolf>
foucist: xybre isn't using C, which is why I want to stab him for trying to optmize.
leonardorb has quit [Read error: Connection reset by peer]
<epochwolf>
ruby isn't optmial
<foucist>
what?!
<foucist>
you tell me this now?
<hderms>
lol
<epochwolf>
foucist: ruby is too slow for real time operations
<foucist>
after i've been coding ruby for years? ?:(
jackbrownhf has joined #ruby
jackbrownhf has quit [Changing host]
jackbrownhf has joined #ruby
<xybre>
If I keep the array a fixed size it shouldn't be too bad, but if its dynamically sized I think it would be a performance problem. ie unusuable.
<epochwolf>
foucist: you're a dumbass but I already knew that.
leonardorb has joined #ruby
<foucist>
heh :P
<epochwolf>
xybre: ruby arrays are linked lists...
braoru has joined #ruby
bradhe has joined #ruby
<xybre>
.. I know. I'm talking about iterating through all of them and adding elements to the subarrays being inefficient.
reset has quit [Quit: Leaving...]
<epochwolf>
xybre: using ruby is inefficient
<xybre>
Yes I know Ruby isn't C, but thats no reason to completely ignore performance.
<foucist>
xybre: anyways the hashes & addressing sounds interesting, or something that basically isn't an array
<xybre>
Ruby is written in C, Narray is a C extension, etc.
timonv has quit [Remote host closed the connection]
<epochwolf>
you're looking at two to three orders of magititude slower to do stuff in ruby
<foucist>
cheap looking ;)
<foucist>
er
<foucist>
keep looking*
<foucist>
or use narray
<epochwolf>
okay, I don't care anymore. Lunch time!
reset has joined #ruby
* epochwolf
hunts for squirrels out back
<xybre>
I like writing in Ruby. If I wanted to write in C, I'd write it in C.
EyesIsMine has joined #ruby
haxrbyte has quit [Ping timeout: 245 seconds]
mikepack has quit [Remote host closed the connection]
<cout>
epochwolf: sounds like a good idea; it will keep you from being nasty to otherwise pleasant people :(
dpk is now known as \\
<epochwolf>
cout: I'm usually a dick.
leonardorb has quit [Read error: Connection reset by peer]
\\ is now known as \\\
<epochwolf>
cout: I'm trying to get better
\\\ is now known as \\\\
\\\\ is now known as \\\\\
\\\\\ is now known as \\\\\\
<xybre>
I guess the bigger concern is all the objects loaded into memory, the array structure is just an addressing and lookup handler really. Hmm.
haxrbyte has joined #ruby
leonardorb has joined #ruby
schaerli has quit [Remote host closed the connection]
\\\\\\ is now known as Guest15193
Guest15193 is now known as \\\\\\\
\\\\\\\ is now known as \\\\\\\\
\\\\\\\\ is now known as \\\\\\\\\
<slash_nick>
when passing a block to a method... does yield actually call the block?
J-_-L has joined #ruby
eldariof has quit []
darthdeu has joined #ruby
leonardorb has quit [Read error: Connection reset by peer]
<Hanmac>
epochwolf with my bindings i could make 3D rendering and i still gets ~200FPS ... similar to the C++ SamplebBrowser
gbchaosmaster has joined #ruby
<epochwolf>
Hanmac: bindings, you mean c extensions?
strangeworks has quit [Quit: Leaving]
<xybre>
slash_nick: depends how you get the block to the method.
sepp2k1 has joined #ruby
<Hanmac>
yep
darthdeus has quit [Read error: Connection reset by peer]
<slash_nick>
gotcha
<epochwolf>
Hanmac: of course, I'm talking pure ruby
sepp2k has quit [Ping timeout: 256 seconds]
leonardorb has joined #ruby
<epochwolf>
slash_nick: if block_given? is true, yield calls the block
<epochwolf>
otherwise I think it's a non-op or an exception
verto is now known as verto|off
workmad3 has quit [Ping timeout: 252 seconds]
segora has quit [Quit: segora]
afgeneralist has joined #ruby
<canton7>
exception
stderr-_ is now known as stderr-
mikepack has joined #ruby
<Hanmac>
epochwolf of cause its an extension, or show me how it should be possible to make 3D with pure ruby
<epochwolf>
Hanmac: that was my point.
\\\\\\\\\ is now known as dpk
<epochwolf>
Hanmac: 3D processing with anykind of speed isn't really doable in plain ruby.
<epochwolf>
you either need a faster language or c extensions to do the heavy lifting quickly.
i_s has joined #ruby
<Hanmac>
i choice Ogre for that
leonardorb has quit [Read error: Connection reset by peer]
nignaztic has joined #ruby
<epochwolf>
Hanmac: my experience is helping a classmate of mine with 2d processing using ruby. It took hours to run on a few milllion entries even with optimizations and profiling.
leonardorb has joined #ruby
aquaranto has quit [Remote host closed the connection]
jackbrownhf has quit [Quit: Sto andando via]
<Hanmac>
i did an rotating cube with RTT and compositor features with my binding
<epochwolf>
I do remember needing to use a preview version of 1.9 just to avoid thrashing the GC
leonardorb has quit [Read error: Connection reset by peer]
<Hanmac>
i cache my objects to i dont need to recreate them
lordnaz has joined #ruby
leonardorb has joined #ruby
nignaztic has quit [Ping timeout: 265 seconds]
Nisstyre-laptop has quit [Ping timeout: 260 seconds]
<xybre>
Ruby is written in C, it doesn't inherently have to be slow.
<epochwolf>
Hanmac: It was a project for a neural networks class. Dead ends needed to be pruned, hence the GC,
<mrbrdo>
could anyone give me an advice on how to run ruby without make install-ing it? (I already compiled it) right now I'm getting "dyld: Library not loaded: /usr/local/lib/libruby.2.0.0.dylib" so I probably need to recompile with some extra flags or change my bash environment?
Tearan has joined #ruby
h4mz1d has quit [Ping timeout: 255 seconds]
havenn has joined #ruby
schaerli has joined #ruby
bubu\a has quit []
arturaz has joined #ruby
Neomex has joined #ruby
elaptics is now known as elaptics`away
kulp has joined #ruby
<kulp>
i would like to do something like `thisvar = load("foo.rb")` and get access to the last expression in foo.rb. More generally I would like functionality like perl's "do"
nignaztic has joined #ruby
dankest is now known as dankest|away
<kulp>
does it exist ? how would you write a code to have modules like this, without going to classes
adambeynon has quit [Quit: Computer has gone to sleep.]
bluOxigen has quit [Ping timeout: 256 seconds]
savage- has joined #ruby
alexim has quit [Ping timeout: 264 seconds]
lordnaz has quit [Ping timeout: 256 seconds]
haxrbyte has quit [Ping timeout: 255 seconds]
<wildcard0>
kulp: in ruby everything is a class. if you run something outside of a class container, the interpreter puts it into a class for you
<wildcard0>
well that's not totally true. s/class/object/
<kulp>
aha. how do i get access to that object ? the result of load is a success/failure boolean, it seems
<kulp>
well i'm not sure anything is clarified, sorry
<wildcard0>
so if you have something outside of the object in a separate file, you end up with the new stuff being mixed into the current set
mengu has quit [Quit: Konversation terminated!]
bricker_ has joined #ruby
<kulp>
well not if i do load(..., true), right ?
<kulp>
i would prefer not to have it mixed in
daniel_- has joined #ruby
ryanlecompte has quit [Ping timeout: 244 seconds]
<kulp>
since feasibly i would load multiple different modules which would use the same names internal to their files
<wildcard0>
ya if it's true then it's in a different namespace
<kulp>
i guess i will just have the loaded module call a register() function.
<wildcard0>
if you need access to that, you should either name it or you have to start playing with ruby's reflection stuff
bricker has quit [Read error: Operation timed out]
<kulp>
blegh
<kulp>
`perldoc -f do` and `do EXPR` is nicer ;) but now i am going to get lynched !
<wildcard0>
haha
<wildcard0>
it's been probably 10 years since i've used perl
<wildcard0>
i dont really remember the internals well
smw_ has joined #ruby
<kulp>
i could get used to ruby, for certain
<kulp>
unless there are many little niggles like i perceive this to be (perhaps wrongly)
<wildcard0>
ruby in general is pretty nice to work with
<wildcard0>
IMO at least
<wildcard0>
there's certainly a bunch of language specific stuff you need to learn, but i've found it isn't really that painful
<wildcard0>
there are definitely things ruby does better than others
<kulp>
it seems to borrow the best parts of perl
<kulp>
and for small jobs i am trying to learn it to replace perl
machty has joined #ruby
joshman_ has joined #ruby
<lupine>
also, do pay attention to TOPLEVEL_BINDING
<wildcard0>
so this do thing. it defines an anonymous function and returns the value of the last expression?
<wildcard0>
do you could do like a = lambda { |x| puts "hi" x }
<wildcard0>
and then a.call(5)
<wildcard0>
?
hotovson has quit [Remote host closed the connection]
dangerousdave has quit [Quit: Leaving...]
froy has quit [Ping timeout: 244 seconds]
mascool has quit [Ping timeout: 250 seconds]
<wildcard0>
er, typo, ; between the puts "hi" and the x
hp has joined #ruby
hp is now known as Guest62032
<kulp>
wildcard0: yeah like that, except the contents of the lambda would be in a different file
<Guest62032>
I'd like to modify a string in-place but doing self = self[n...-1] does not work: "Can't change the value of self"
<wildcard0>
ah ok
arya_ has joined #ruby
<kulp>
i mean i'm asking to do something that's idiomatic in perl, but maybe not in ruby
<kulp>
so feel free to suggest a different solution that could get the same effect if you can see the underlying question (i haven't explained it well)
<kulp>
i do have a solution now, just calling a function in the outer file from the inner file
<wildcard0>
that'd work
<kulp>
so i guess my question is largely moot, but it might be a learning experience anyway
ewag has joined #ruby
ChampS666 has quit [Ping timeout: 265 seconds]
bigmcq77 has joined #ruby
heftig_ is now known as heftig
<wildcard0>
Guest62032: in ruby, "self" is a keyword, it has special meaning. try changing the variable name :)
chimkan has quit [Quit: chimkan]
<rking>
Guest62032: Just do: chop!
L1 has joined #ruby
L1 has quit [Changing host]
L1 has joined #ruby
<rking>
No explicit 'self' on that one
mascool has joined #ruby
cmarques has quit [Ping timeout: 256 seconds]
iamjarvo has joined #ruby
samphippen has joined #ruby
ChampS666 has joined #ruby
rellin has quit [Read error: Connection reset by peer]
fred909 has quit [Ping timeout: 260 seconds]
rellin has joined #ruby
Lemtzas is now known as peopel
segv- has joined #ruby
jamiei has left #ruby [#ruby]
<havenn>
I thought it was interesting to compare the Perl 6 book solutions to equivalent in Ruby and Python. Perl 6 and Ruby really do sometimes mirror each other: https://gist.github.com/3928203
<Guest62032>
rking: chop is for the last characters.
<Guest62032>
wildcard0: I am an instance method of the String class
<rking>
Guest62032: Yeah. What else is self[0...-1] doing?
braoru has quit [Ping timeout: 255 seconds]
nemesit has quit [Ping timeout: 252 seconds]
<Guest62032>
(I solved my problem! Use self.replace(self[n..-1]))
nemesit has joined #ruby
<wildcard0>
ya that works. self is the currently referenced object
<Guest62032>
rking: self[n..-1] removes the first n characters (notice the n as leading index)
<wildcard0>
it'd need to call a method
babykosh has quit [Quit: babykosh]
geekbri has quit [Remote host closed the connection]
<brendan`>
in an if statement, can you add { } around the actions?
<rking>
Guest62032: Ahh crud. My bad. I read 0 where you had n
<brendan`>
ie: if a = b { puts "hi" }
<Guest62032>
I'm lucky String has a built-in replace(), though. What about other types of objects?
<brendan`>
mainly for my readability
<heftig>
brendan`: no.
mmitchel_ has quit [Remote host closed the connection]
<rking>
Guest62032: Other objects would all have an ivar representing stuff
<brendan`>
ok
<heftig>
puts "hi" if a == b
mmitchell has joined #ruby
<heftig>
if a == b; puts "hi; end
<wildcard0>
ya double = is important
<heftig>
i always preferred pascal's :=, = to C style =, ==
smw_ has quit [Ping timeout: 248 seconds]
<rking>
heftig: Have you seen the way Smalltalk does it?
segv- has quit [Client Quit]
<wildcard0>
== was algol 68 right?
kulp has left #ruby [#ruby]
jackbrownhf has joined #ruby
jackbrownhf has quit [Changing host]
jackbrownhf has joined #ruby
babykosh has joined #ruby
bricker has joined #ruby
bricker has quit [Client Quit]
<reactormonk>
heftig, agreed
bricker_ has quit [Ping timeout: 250 seconds]
tPl0ch has quit [Quit: Verlassend]
tfnorris has joined #ruby
nomenkun has quit [Remote host closed the connection]
darthdeu has quit [Quit: Leaving...]
nat2610 has joined #ruby
v0n has quit [Quit: Leaving]
advorak has quit [Quit: Leaving]
v0n has joined #ruby
schaerli has quit [Remote host closed the connection]
BigO_ has quit [Ping timeout: 244 seconds]
banisterfiend has quit [Ping timeout: 245 seconds]
v0n has quit [Client Quit]
v0n has joined #ruby
babykosh has left #ruby [#ruby]
ner0x has quit [Quit: Leaving]
mneorr has quit [Remote host closed the connection]
atmosx has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
arturaz has quit [Remote host closed the connection]
rellin2 has joined #ruby
pu22l3r has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 265 seconds]
rellin has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Quit: Leaving.]
schaerli has joined #ruby
bricker has joined #ruby
[Neurotic] has joined #ruby
fred909 has joined #ruby
pignata_ is now known as pignata
hadees has quit [Quit: hadees]
nat2610 has quit [Read error: Connection reset by peer]
nat2610 has joined #ruby
slash_nick has quit [Ping timeout: 260 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
tenmilestereo has quit [Quit: Leaving]
beiter has quit [Quit: beiter]
piccalingo has joined #ruby
<aces1up>
if i have a large hash table that many threads access, what are some of the side effect of un safe thread operations, trying to figure out a thread safe bug I might have, for instance could 1 thread delete a key, and then cause another thread key it holds to be different?
dankest|away is now known as dankest
gridaphobe has joined #ruby
stkowski has joined #ruby
mikeg has joined #ruby
<[Neurotic]>
all sorts of crazy stuff could happen
c0rn has quit [Quit: Computer has gone to sleep.]
<[Neurotic]>
nothing is atomic
gabrielrotbart has joined #ruby
<[Neurotic]>
the hash could say there is something in it, and then return null, as the value has yet to be set internally
<[Neurotic]>
or vice versa
Averna1 has joined #ruby
<[Neurotic]>
the whole internal state is up for grabs
Averna1 has quit [Client Quit]
<lupine>
Hash is threadsafe, more or less
<lupine>
a[x] = 1 if a[x] == 0 isn't, though
Nisstyre-laptop has joined #ruby
<[Neurotic]>
yah - was going to say, is it a Java HashMap or a JRuby Map?
schaerli has quit [Remote host closed the connection]
tommyvyo has joined #ruby
BrianJ has quit [Quit: Computer has gone to sleep.]
anna_ has joined #ruby
burntbit has joined #ruby
<lupine>
jruby go out of their way to keep it all threadsafe, bless 'em
<lupine>
(I guess 1.9 adopted that approach too)
<mikeg>
having the following error trying to install gems: NoMethodError: undefined method `full_name' for nil:NilClass Full stacktrace is here: https://gist.github.com/4198729
<lupine>
back with green threads, "thread-safe" was the default state, much of the time
<mikeg>
ruby is 1.9.2-p290 gems is 1.8.24
<lupine>
no special magic required
slash_nick has joined #ruby
krawchyk has quit [Remote host closed the connection]
<burntbit>
can I create a default variable for a class so all new instances have it... and not use class << self ?
gabrielrotbart has quit [Remote host closed the connection]
workmad3 has joined #ruby
moos3 has quit [Quit: Off to blow shit up!]
Elico has quit [Quit: elico]
ephemerian has joined #ruby
jenrzzz has joined #ruby
jrist is now known as jrist-afk
nari has joined #ruby
forced_request has quit [Read error: Connection reset by peer]
mneorr has quit [Remote host closed the connection]
tommyvyo has joined #ruby
mneorr has joined #ruby
Gm4n has quit [Ping timeout: 255 seconds]
mikepack has quit [Remote host closed the connection]
tommyvyo_ has joined #ruby
slash_nick has joined #ruby
willob has joined #ruby
forced_request has joined #ruby
moos3 has joined #ruby
65MABKLVI has quit [Read error: Connection reset by peer]
LBRapid has quit [Quit: Leaving]
mikepack has joined #ruby
jds_ has quit [Remote host closed the connection]
xnm has joined #ruby
nonotza has quit [Quit: nonotza]
babykosh has joined #ruby
mikepack has quit [Remote host closed the connection]
gabrielrotbart has joined #ruby
kuzushi has joined #ruby
Russell^^ has quit [Quit: Russell^^]
<slash_nick>
kuzushi: you seem a little unbalanced
u89 has joined #ruby
nemesit has quit [Quit: Leaving...]
macabre has quit [Remote host closed the connection]
J-_-L has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
<babykosh>
I have a method that returns a hash like so….{:b1=>993, :c1=>-993}….I need to return the the name of the symbol with the highest number value…in this case :b1…how to do this?
<apeiros_>
babykosh: max_by
jrajav has quit [Quit: I tend to be neutral about apples]
jeffreybaird has joined #ruby
matchaw_ has joined #ruby
alanp_ has joined #ruby
alanp has quit [Ping timeout: 252 seconds]
jgarvey has quit [Quit: Leaving]
alanp_ is now known as alanp
chimkan_ has joined #ruby
<kuzushi>
slash_nick: ha-- I think you are the first person who knows what this means w/o me telling them :)
<kuzushi>
you must be a judo guy :)
bradhe has quit [Remote host closed the connection]
machty has quit [Quit: machty]
froy has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
alexim has joined #ruby
danneu has joined #ruby
danneu has quit [Client Quit]
Choobie has joined #ruby
chimkan_ has quit [Client Quit]
withnale has quit [Read error: Operation timed out]
<babykosh>
got it ..thanks all
withnale has joined #ruby
_tca has quit [Read error: Connection reset by peer]