baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.10: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || Rails questions? Ask on #RubyOnRails || logs @ https://irclog.whitequark.org/ruby/
andol_ is now known as andll
neanderslob has quit [Ping timeout: 244 seconds]
nertzy has quit [Ping timeout: 250 seconds]
electrostat has joined #ruby
wldcordeiro has quit [Ping timeout: 240 seconds]
wjimenez5271 has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
tenderlove has quit [Remote host closed the connection]
benlieb has quit [Client Quit]
<andll> When I download an image with open-uri -- file = open(url) -- the result is different than reading a file with say File.read(file_path, 'rb'). I suspect the encoding is different, but I'm not sure how to check. What else might be different? How do I force the result to be the same?
skweek has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
solocshaw has quit [Remote host closed the connection]
johnmilton has joined #ruby
<jazzonmym11nd> andll: you can check encoding with String#encoding
minimalism has joined #ruby
<andll> jazzonmym11nd: thanks, I'll try that
nertzy has joined #ruby
<jazzonmym11nd> i think you want both to return ASCII-8BIT
benlieb has quit [Client Quit]
<al2o3-cr> andll: binary, that is all
quazimodo has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
<jazzonmym11nd> the file you're downloading could be compressed or encoded some other way as well, you'd need to drop down to Net::HTTP to check.
wjimenez5271 has joined #ruby
moby has quit [Ping timeout: 264 seconds]
<andll> jazzonmym11nd: thanks
<andll> al2o3-cr: thanks
<jazzonmym11nd> or just use curl -I from your shell.
RedNifre_ has joined #ruby
jphase has quit []
solocshaw has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
karmatr0n has quit [Ping timeout: 255 seconds]
calmchaos has joined #ruby
benlieb has joined #ruby
RedNifre has quit [Ping timeout: 276 seconds]
jphase has joined #ruby
Sashimi has joined #ruby
quazimodo has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
calmchaos has quit [Ping timeout: 265 seconds]
zacstewart has quit [Ping timeout: 244 seconds]
nitric has quit [Ping timeout: 255 seconds]
dogweather has quit []
Dispatch has quit [Remote host closed the connection]
astrobun_ has quit [Remote host closed the connection]
symm- has joined #ruby
polysics has joined #ruby
greister_ has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
bkxd has joined #ruby
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
agent_white has quit [Quit: headingHome]
flashpoint9 has joined #ruby
coolboy has joined #ruby
<andll> there must be some other difference. When I download the Google image via open-uri the type is apparently binary. When I try to then POST the image to an API via rest-client the result fails. Whereas if I read the image with File.new(file_path, 'rb') then perform the same operation with rest-client, the result succeeds.
<andll> is it because one is a a 'stream' or something
polysics has quit [Ping timeout: 264 seconds]
jtzero1 has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
replay has quit [Quit: Textual IRC Client: www.textualapp.com]
postmodern has quit [Ping timeout: 250 seconds]
cdg has quit [Remote host closed the connection]
solocshaw has quit [Remote host closed the connection]
<al2o3-cr> >> (1670708/13).chr('utf-8').*(80) << ' be happy, don\'t worry'
<ruby[bot]> al2o3-cr: # => "😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄 be happy, don't wo ...check link for more (https://eval.in/638270)
saneax is now known as saneax-_-|AFK
pochoa has quit [Ping timeout: 250 seconds]
CloCkWeRX has joined #ruby
mwlang has quit [Remote host closed the connection]
benlieb has quit [Remote host closed the connection]
mwlang has joined #ruby
<al2o3-cr> andll: show us your knickers on gist
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 250 seconds]
<al2o3-cr> erm... i mean code :)
solocshaw has joined #ruby
<jazzonmym11nd> lol
<jazzonmym11nd> weird typo
finisherr has quit [Remote host closed the connection]
<al2o3-cr> :p
wldcordeiro has joined #ruby
Bellthoven has joined #ruby
habitullence has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
tdy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<andll> al2o3-cr: I'd have to censor the code, as it's for work. But in short, I'm convinced the result of open(url) with open-uri is different than File.new(file_path, 'rb')
postmodern has joined #ruby
<jazzonmym11nd> andll: did u try curl -I the url cos it could be gzip'ed.
statelesscode has quit [Ping timeout: 265 seconds]
calmchaos has joined #ruby
<jazzonmym11nd> yea looks fine
Guest2765 has quit [Ping timeout: 252 seconds]
<jazzonmym11nd> it fails when you try to upload it?
<jazzonmym11nd> how are you uploading it?
shmuli has quit [Remote host closed the connection]
<jazzonmym11nd> this works fine for me: File.write "foo.png", open("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png").read
Sashimi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jazzonmym11nd> bbiab
robfrawley has joined #ruby
_djbkd has quit [Remote host closed the connection]
robfrawley is now known as Guest34289
_djbkd has joined #ruby
calmchaos has quit [Ping timeout: 255 seconds]
shmuli has joined #ruby
BlkDynmt has quit [Ping timeout: 250 seconds]
Littlemyu_ has joined #ruby
JeanCarloMachado has joined #ruby
JeanCarl1Machado has joined #ruby
_djbkd has quit [Ping timeout: 264 seconds]
Mattx has joined #ruby
andll has quit [Quit: Page closed]
amclain has quit [Quit: Leaving]
ramfjord has joined #ruby
<Mattx> Does ruby really support threads?
nankyokusei has joined #ruby
BTRE has quit [Ping timeout: 276 seconds]
<Mattx> I'm processing two task A and B multiple times, around 15 seconds each. After the first A task I'm starting a thread to process B while at the same time I process the second A, and so on
shmuli has quit [Remote host closed the connection]
<al2o3-cr> Mattx: knots on cotton, if thats what you mean
<Mattx> But now those tasks finish together, but in 30 seconds
<Mattx> it's having the same performance with or without threads
<al2o3-cr> Mattx: are these tasks IO?
<Mattx> al2o3-cr, I've no idea what you meant
<Mattx> al2o3-cr, B is IO
<al2o3-cr> Mattx: fork it
<Mattx> kind of, it's actually saving to a pgsql database
moby has joined #ruby
CloCkWeRX has quit [Remote host closed the connection]
JeanCarl1Machado has quit [Remote host closed the connection]
JeanCarloMachado has quit [Remote host closed the connection]
charliesome has joined #ruby
BTRE has joined #ruby
shmuli has joined #ruby
<jazzonmym11nd> Mattx: it does but there's a lock so that only one thread is running unless threads are IO bound.
nankyokusei has quit [Ping timeout: 260 seconds]
<Mattx> how would you improve the performance in my scenario?
<jazzonmym11nd> you could try using fork() and see if that's any better.
nando294021 has quit [Ping timeout: 244 seconds]
zekriad has quit [Quit: Textual IRC Client: www.textualapp.com]
arescorpio has joined #ruby
Davedev28 has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
Dispatch has joined #ruby
insanedreamer has joined #ruby
Davedev28 has joined #ruby
<Mattx> it somehow works. thanks
<Mattx> just slightly slower than the faster of both tasks, but I guess it's normal
ur5us has quit [Ping timeout: 250 seconds]
shmuli has quit [Remote host closed the connection]
Lightsword has quit [Quit: ZNC]
ur5us has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
Lightsword has joined #ruby
moneylotion has quit [Ping timeout: 252 seconds]
agent_white has joined #ruby
shmuli has joined #ruby
JoshS has joined #ruby
hutch34_ has quit [Ping timeout: 252 seconds]
LoneHermit has joined #ruby
A0X1887 has quit [Ping timeout: 265 seconds]
astrobun_ has joined #ruby
astrobun_ has quit [Remote host closed the connection]
moneylotion has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
polysics has joined #ruby
bkxd has joined #ruby
gilfoyle has quit [Quit: .]
umdstu has quit [Ping timeout: 265 seconds]
jazzonmym11nd has quit [Ping timeout: 244 seconds]
polysics has quit [Ping timeout: 250 seconds]
alaibe has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
giz|work has joined #ruby
nettoweb has joined #ruby
blackwind_123 has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 250 seconds]
A0X1887 has joined #ruby
tax has quit [Quit: Leaving]
blackwind_123 has joined #ruby
alaibe has quit [Ping timeout: 265 seconds]
duderonomy has joined #ruby
Littlemyu_ has quit [Ping timeout: 244 seconds]
nettoweb has quit [Ping timeout: 255 seconds]
grill is now known as floatingpoint
shinnya has quit [Ping timeout: 276 seconds]
shmuli has quit [Remote host closed the connection]
shazaum_ has quit [Quit: Leaving]
charliesome has joined #ruby
coolboy has quit [Ping timeout: 265 seconds]
shmuli has joined #ruby
decav has quit [Ping timeout: 244 seconds]
capitainIsh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zacstewart has joined #ruby
Vingador has joined #ruby
Ropeney has joined #ruby
Davedev28 has quit [Remote host closed the connection]
Es0teric has joined #ruby
zacstewart has quit [Ping timeout: 260 seconds]
astrobun_ has joined #ruby
giz|work has quit [Ping timeout: 276 seconds]
mtkd has quit [Ping timeout: 252 seconds]
giz|work has joined #ruby
mtkd has joined #ruby
Ropeney has quit [Quit: Textual IRC Client: www.textualapp.com]
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #ruby
mdgmt has joined #ruby
astrobun_ has quit [Ping timeout: 244 seconds]
rodfersou|afk has quit [Quit: leaving]
Ropeney has joined #ruby
ruby_ has quit [Ping timeout: 265 seconds]
capitainIsh has joined #ruby
tax has joined #ruby
hutch34_ has joined #ruby
govg has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 252 seconds]
Guest34289 has quit [Ping timeout: 244 seconds]
hahuang61 has joined #ruby
shmuli has quit [Remote host closed the connection]
Dispatch has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 240 seconds]
zeroDi has quit [Quit: WeeChat 1.5]
greister__ has joined #ruby
elvis4526 has quit [Ping timeout: 250 seconds]
greister_ has quit [Ping timeout: 265 seconds]
robfrawley has joined #ruby
robfrawley is now known as Guest90323
astrobun_ has joined #ruby
ruby_ has joined #ruby
Dispatch has joined #ruby
gnufied has quit [Quit: Leaving]
binaryplease1 has joined #ruby
Sembei has quit [Read error: Connection reset by peer]
ur5us has quit [Remote host closed the connection]
Bellthoven has quit []
ur5us has joined #ruby
ruby_ has quit [Ping timeout: 265 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
dviola has quit [Quit: WeeChat 1.5]
Sembei has joined #ruby
binaryplease has quit [Ping timeout: 244 seconds]
cyphactor has quit [Ping timeout: 265 seconds]
giz|work has quit [Ping timeout: 265 seconds]
A5101 has joined #ruby
cyphase has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
chichou has joined #ruby
gizmore has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
gizmore has quit [Changing host]
gizmore has joined #ruby
agent_white has quit [Quit: brb]
cyphactor has joined #ruby
flashpoint9 has joined #ruby
lessless has joined #ruby
lessless has left #ruby [#ruby]
Dispatch has quit [Remote host closed the connection]
binaryplease1 is now known as binaryplease
chichou has quit [Client Quit]
shmuli has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
insanedreamer_ has joined #ruby
insanedreamer has quit [Ping timeout: 255 seconds]
insanedreamer_ is now known as insanedreamer
Dispatch has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
shmuli has quit [Ping timeout: 264 seconds]
LoneHermit has quit [Remote host closed the connection]
insanedreamer has quit [Quit: insanedreamer]
sneakerhax has joined #ruby
cyphase has joined #ruby
solocshaw has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 250 seconds]
solocshaw has joined #ruby
jphase has joined #ruby
Coldblackice has quit []
Wsewolod has joined #ruby
coolboy has joined #ruby
dstarh has joined #ruby
zacstewart has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby
Coldblackice has joined #ruby
coolboy has quit [Ping timeout: 244 seconds]
cyphase has joined #ruby
thejamespinto has joined #ruby
NetSage has quit [Remote host closed the connection]
Coldblackice has quit [Client Quit]
giz|work has joined #ruby
nankyokusei has joined #ruby
Coldblackice has joined #ruby
braincra- has quit [Quit: bye bye]
gix has quit [Ping timeout: 260 seconds]
dasher00 has quit [Read error: Connection timed out]
nankyokusei has quit [Ping timeout: 265 seconds]
dasher00 has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
dasher00 has quit [Max SendQ exceeded]
eizua has joined #ruby
linduxed has quit [Ping timeout: 244 seconds]
gix has joined #ruby
cyphase has joined #ruby
ruby_ has joined #ruby
moparisthebest has quit [Quit: ZNC - 1.6.0 - http://znc.in]
gorp2016 has joined #ruby
giz|work has quit [Ping timeout: 244 seconds]
braincrash has joined #ruby
greister__ has quit [Ping timeout: 240 seconds]
hutch34_ has quit [Ping timeout: 255 seconds]
cyphase has quit [Ping timeout: 255 seconds]
cdg has joined #ruby
code_ has quit [Ping timeout: 244 seconds]
cyphase has joined #ruby
govg has joined #ruby
bkxd has joined #ruby
polysics has joined #ruby
shakes has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
r4z has quit [Quit: Leaving]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
Cohedrin has quit [Client Quit]
govg has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 265 seconds]
alaibe has joined #ruby
polysics has quit [Ping timeout: 276 seconds]
cyphase has quit [Ping timeout: 265 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
code_ has joined #ruby
flashpoint9 has joined #ruby
alaibe has quit [Ping timeout: 276 seconds]
zacstewart has quit [Ping timeout: 264 seconds]
yardenbar has joined #ruby
vuoto has joined #ruby
cyphase has joined #ruby
astrobu__ has joined #ruby
hutch34_ has joined #ruby
astrobun_ has quit [Ping timeout: 265 seconds]
hutch34_ has quit [Ping timeout: 265 seconds]
greister_ has joined #ruby
yardenbar has quit [Ping timeout: 255 seconds]
cyphase has quit [Ping timeout: 276 seconds]
<gizmore> good.morning
<apeiros> moin
flashpoint9 has quit [Remote host closed the connection]
<gizmore> puts smileys.where("emotion LIKE %", 'fun').first
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
cyphase has joined #ruby
moparisthebest has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
vuoto has quit [Remote host closed the connection]
giz|work has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
giz|work has quit [Client Quit]
shakes has quit [Quit: Leaving]
shakes has joined #ruby
zipace has joined #ruby
cyphase has quit [Ping timeout: 276 seconds]
Dispatch has quit []
yeticry has quit [Quit: leaving]
yeticry has joined #ruby
cyphase has joined #ruby
Bellthoven has joined #ruby
phoo1234567 has quit [Quit: Gotta go]
calmchaos has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
calmchaos has quit [Ping timeout: 240 seconds]
someoneelse2 has joined #ruby
Vingador has quit [Ping timeout: 265 seconds]
cdg has quit [Ping timeout: 276 seconds]
<someoneelse2> hi all, has anyone any idea about sinatra?
_djbkd has joined #ruby
<someoneelse2> I am trying to do something very simple: I have a folder with 8000 images in my computer and I want to show them randomly, one at a time in a <div> inside a sinatra view, then press a button and cycle them.
cyphase has joined #ruby
astrobu__ has quit [Remote host closed the connection]
<someoneelse2> has anyone any idea ?
greister_ has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
tmtwd has quit [Ping timeout: 265 seconds]
enterprisey has quit [Quit: Leaving]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
polysics has joined #ruby
alfiemax has joined #ruby
DoubleMalt has joined #ruby
hahuang61 has joined #ruby
jgnagy has quit [Remote host closed the connection]
Bellthoven has quit []
shakes has quit [Quit: Leaving]
shakes has joined #ruby
zacstewart has joined #ruby
polysics has quit [Ping timeout: 250 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
lightheaded has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
tmtwd has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
lightheaded has quit [Ping timeout: 250 seconds]
nanoz has joined #ruby
Exuma has joined #ruby
Silthias has joined #ruby
craigp has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
Exuma has quit [Client Quit]
cibs has quit [Ping timeout: 240 seconds]
AlexRussia has quit [Ping timeout: 276 seconds]
Vile` has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
astrobun_ has joined #ruby
mikhael_k33hl has joined #ruby
<mikhael_k33hl> How do you guys test signal handling? specifically in rspec?
Es0teric has quit [Quit: Computer has gone to sleep.]
Mattx has quit [Quit: Leaving]
astrobun_ has quit [Ping timeout: 250 seconds]
codezomb has quit [Quit: Textual IRC Client: www.textualapp.com]
cyphase has quit [Ping timeout: 250 seconds]
bkxd has joined #ruby
astrobun_ has joined #ruby
Bl4ckpajamas has joined #ruby
lightheaded has joined #ruby
cyphase has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
Guest90323 has quit [Ping timeout: 265 seconds]
zacstewart has quit [Ping timeout: 244 seconds]
robfrawley has joined #ruby
_djbkd has quit [Quit: My people need me...]
robfrawley is now known as Guest27846
pawnbox has quit [Remote host closed the connection]
LoneHermit has joined #ruby
pawnbox has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
LoneHermit has quit [Ping timeout: 250 seconds]
eljimbo has quit [Quit: This computer has gone to sleep]
Robtop__ has joined #ruby
ta_ has quit [Ping timeout: 255 seconds]
deadprez has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 250 seconds]
Cohedrin has joined #ruby
k3rn31 has joined #ruby
ctp has joined #ruby
astrobu__ has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
astrobun_ has quit [Ping timeout: 255 seconds]
dreamyspell has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd_ has joined #ruby
someoneelse2 has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
astrobu__ has quit [Remote host closed the connection]
astrobun_ has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
polysics has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
bocaneri has joined #ruby
alaibe has joined #ruby
zacstewart has joined #ruby
pawnbox has joined #ruby
calmchaos has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
bar___ has joined #ruby
polysics has quit [Ping timeout: 264 seconds]
hahuang61 has joined #ruby
moby has left #ruby ["Leaving"]
Littlemyu_ has joined #ruby
alaibe has quit [Ping timeout: 265 seconds]
solocshaw has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
cyphase has quit [Ping timeout: 244 seconds]
Es0teric has joined #ruby
hahuang61 has quit [Ping timeout: 264 seconds]
bar___ has quit [Remote host closed the connection]
cyphase has joined #ruby
pawnbox has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
djbkd_ has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
solocshaw has quit [Ping timeout: 250 seconds]
flashpoint9 has joined #ruby
arescorpio has quit [Quit: Leaving.]
zacstewart has quit [Ping timeout: 244 seconds]
astrobu__ has joined #ruby
A5101 has quit [Ping timeout: 244 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
astrobun_ has quit [Ping timeout: 265 seconds]
ruby_ has quit [Remote host closed the connection]
dminuoso has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
aufi has joined #ruby
saneax-_-|AFK is now known as saneax
Littlemyu_ is now known as littlemyu
lightheaded has quit [Remote host closed the connection]
maokomioko has joined #ruby
Vile` has joined #ruby
cyphase has joined #ruby
aufi has quit [Quit: Leaving]
aufi has joined #ruby
elifoster has joined #ruby
olistik has joined #ruby
charliesome has joined #ruby
last_staff has joined #ruby
sapphire_ has joined #ruby
someoneelse2 has joined #ruby
someoneelse2 has quit [Client Quit]
bkxd has joined #ruby
polysics has joined #ruby
olistik has quit [Remote host closed the connection]
pandaant has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lightheaded has joined #ruby
zacstewart has joined #ruby
firstdayonthejob has joined #ruby
ftshtw has joined #ruby
bkxd has quit [Ping timeout: 265 seconds]
JoshS has quit [Quit: Leaving]
cyphase has joined #ruby
gingray has joined #ruby
wugy has joined #ruby
dminuoso_ has joined #ruby
d0nn1e has quit [Ping timeout: 265 seconds]
dminuoso has quit [Ping timeout: 240 seconds]
capitainIsh has quit [Quit: Textual IRC Client: www.textualapp.com]
pandaant has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 244 seconds]
Silthias has joined #ruby
d0nn1e has joined #ruby
pandaant has joined #ruby
nowhereFast has joined #ruby
nanoz] has joined #ruby
Bl4ckpajamas has quit [Quit: ZZZzzz…]
dminuoso_ has quit [Remote host closed the connection]
anisha has joined #ruby
nanoz has quit [Ping timeout: 252 seconds]
hinbody has quit [Ping timeout: 264 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
tmtwd has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
biberu has joined #ruby
charliesome has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
conta has joined #ruby
gizmore has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
aganov has joined #ruby
cyphase has joined #ruby
nowhereFast has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
firstdayonthejob has quit [Ping timeout: 244 seconds]
zacstewart has quit [Ping timeout: 265 seconds]
astrobu__ has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 276 seconds]
blackgoat has quit [Ping timeout: 244 seconds]
magicien has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
jtzero1 has quit [Ping timeout: 264 seconds]
aidalgol has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
cyphase has quit [Ping timeout: 255 seconds]
LoneHermit has joined #ruby
submitnine has joined #ruby
cyphase has joined #ruby
ruby_ has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
polysics has quit []
ruby_ has quit [Ping timeout: 255 seconds]
Sashimi has joined #ruby
nankyokusei has joined #ruby
calmchaos has quit [Remote host closed the connection]
dminuoso has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
gorp2016 has quit [Read error: Connection reset by peer]
<dminuoso> ftshtw: Just a quick glance, but the second sounds like a caching problem.
zacstewart has joined #ruby
<dminuoso> ftshtw: You either need to use cache controls (which from experience have a tendency to not work as expected), or you finger print the image asset, so that each request is forced to fetch it from your remote server.
<dminuoso> ftshtw: Ideally do some analysis with your developer tools in your browser, so you can see how it behaves.
spectrum has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #ruby
mark_66 has joined #ruby
<ftshtw> dminuoso: what do you mean finger print ?
<dminuoso> ftshtw: This is an example asset URI from my Rails application: href="/assets/application-c64d50707afedf9503d650aaaced26b72701b854b0f4b984bcfab81c8c06ae0f.css"
<dminuoso> ftshtw: Each time the asset changes, the fingerprint is changed - so that it looks like a new file.
<ftshtw> dminuoso: I've been developing in Rails for the past 3-4 years and I decided to play around with Sinatra so I find the philosophy totally different
<ftshtw> different from assets precompilation to the public folder which is predefined
<dminuoso> ftshtw: The underlying principle of "fingerprinting resources" is an extremely common thing. Sprockets in rails handles it completely transparently for you.
olistik has joined #ruby
<ftshtw> I mean it's been a long time since I was trying to find a solution to such a simple problem :P
<ftshtw> dminuoso: true
<dminuoso> ftshtw: At any rate, your question lacks details from your developer tools. If you look at the network tab, its much eaiser to see what happens.
Rodya_ has quit [Remote host closed the connection]
Madplatypus has quit [Quit: Connection closed for inactivity]
<ftshtw> dminuoso: but send_file actually downloads an image as an attachment and the dev tools show just src='/photo' which is pretty much obvious
devbug has quit [Quit: ZZZzzz…]
mrgrieves has joined #ruby
gagrio has joined #ruby
<dminuoso> ftshtw: Ah.
jazzonmym1nd has joined #ruby
littlemyu has quit [Ping timeout: 240 seconds]
<ftshtw> it doesn't => <img src="/photo" alt='image' style="width: 100%;" />
<ftshtw> I mean I find it an awful solution but I can't find anything else
<dminuoso> ftshtw: Mm, doesnt that Dir.glob just give you a filename? Id think you would need to specify a full or relative path.
<ftshtw> I tried to File.read and use file:/// links but everything fails
<dminuoso> ftshtw: Alright I was not aware of that.
<ftshtw> dminuoso: true, the full path of a filename
<ftshtw> I set up :public_folder but it doesn't seem to understand it later in the route
DoubleMalt has quit [Remote host closed the connection]
<dminuoso> ftshtw: Nvm, glob uses the same path ref that you pass to it.
sevenfourk has joined #ruby
olistik has quit [Ping timeout: 250 seconds]
<ftshtw> the logical way should be to send the path to the view with something like @photo = image_url and then display it in the .erb with src="<%= @photo %>"
<ftshtw> like Rails
<ftshtw> but it doesn't
<dminuoso> ftshtw: Wait a moment. What is @photo ?
<ftshtw> I guess these are the transparent things which make Rails easy to use
<ftshtw> so I guess I am a bad developer
<ftshtw> dminuoso: I've tried it with @photo = Dir.glob("/Users/hyp3rkyd/Pictures/Wallpapers/*").sample
<dminuoso> ftshtw: What happens if you do a GET /photo directly?
ctp has joined #ruby
<ftshtw> dminuoso: this is what I am doing right now
sai_ has joined #ruby
<ftshtw> dminuoso: well almost. GET /photo will show the image in full-size
PaulePanter has quit [Ping timeout: 276 seconds]
Madplatypus has joined #ruby
spectrum has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
inukshuk has joined #ruby
mrgrieves has quit [Ping timeout: 276 seconds]
thejamespinto_ has joined #ruby
<dminuoso> ftshtw: Here is what I would do. I would look at the exact HTTP response for the GET /photos
<dminuoso> ftshtw: and compare it to what the exact response looks like when your browser fetches an image for a page.
ledestin has joined #ruby
<dminuoso> Perhaps you need to be explicit about the content-type or some other detail.
<ftshtw> dminuoso: it's an image so what else should it be ?
cyphase has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thejamespinto has quit [Ping timeout: 276 seconds]
<ftshtw> dminuoso: but what does it have to do with my issues ?
BlkDynmt has joined #ruby
|ifei5g00d has quit [Ping timeout: 240 seconds]
alaibe has joined #ruby
vondruch has joined #ruby
<ftshtw> dminuoso: at least I see "Content-Disposition
<ftshtw> inline; filename=
Ishido has joined #ruby
<dminuoso> ftshtw: Well your second issue is that it displays the image as expected, but it does not reload it right?
cyphase has joined #ruby
<ftshtw> dminuoso: yes
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
zacstewart has quit [Ping timeout: 244 seconds]
alaibe has quit [Ping timeout: 276 seconds]
optikalmouse has joined #ruby
charliesome has joined #ruby
<optikalmouse> how do I reference a class/instance method within a lambda?
<optikalmouse> I made ruby segfault because the did_you_mean library could not find the method names within the lambda (though the lambda is declared within my class)
<dminuoso> optikalmouse: Can you gist the segfaulting code? I would be very interested.
hahuang61 has quit [Ping timeout: 265 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
<dminuoso> optikalmouse: As for your question, instance_eval lets you evaluate a lambda within a context of an object.
thejamespinto_ has quit [Ping timeout: 264 seconds]
<jazzonmym1nd> Proc not a lambda no?
thejamespinto has joined #ruby
Bish has quit [Remote host closed the connection]
<dminuoso> jazzonmym1nd: They are the same thing.
hinbody has joined #ruby
<dminuoso> (For the purpose of this discussion)
<jazzonmym1nd> they have different semantics.
<dminuoso> 09:45 < dminuoso> (For the purpose of this discussion)
<jazzonmym1nd> Proc is more accurate :)
bkxd has joined #ruby
<jazzonmym1nd> since it exhibits that behavior.
<dminuoso> jazzonmym1nd: If we wanted to be accurate, then instance_eval only works with a block.
<dminuoso> So it does not matter.
<dminuoso> Happy?
<jazzonmym1nd> block has same semantics as a Proc.
hhfemh has joined #ruby
olistik has joined #ruby
pawnbox has quit [Remote host closed the connection]
<dminuoso> jazzonmym1nd: A block has not the same semantics as a proc.
<dminuoso> A block is not an object.
<dminuoso> They are not the same thing.
<dminuoso> In fact the thing that both proc and lambda have in common, is that they both are a ruby object with a pointer to what Ruby understands as a block, and some meta data ontop of it that implements the difference between proc and lambda.
<jazzonmym1nd> a Proc encapsulates a block, and a lambda is just a specialized Proc, how arguments are handled and behavior of 'return' is different, a block passed to instance_eval behaves same as standard Proc object
alaibe has joined #ruby
<dminuoso> Are you trying to make a point here?
<dminuoso> Or are you just arguing for the sake of it?
<jazzonmym1nd> just that if anything the block passed to instance_eval is much more similar to a Proc object, arguments or lack of and 'return' are managed the same way.
<optikalmouse> I'm trying to trace through at which point the apply_criteria lambda is called and it looks like it's after the instance is defined
<dminuoso> optikalmouse: Works for me. Which Ruby version are you running?
<dminuoso> And which did_you_mean ?
bkxd has quit [Ping timeout: 244 seconds]
<optikalmouse> 2.3.0p
<optikalmouse> and I saw a bug reported about a segfault before: https://github.com/yuki24/did_you_mean/issues/74
<dminuoso> optikalmouse: Mm, Im running 2.3.0 too here.
<optikalmouse> my workaround has been to copy/paste the instance method's code directly into the lambda :/
<optikalmouse> which is obvs not ideal
<dminuoso> optikalmouse: It would be awesome if we could provide explicit captures like in C++.
pawnbox has joined #ruby
<dminuoso> optikalmouse: You could simply pass the object as a parameter to the lambda/proc
greister_ has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
Burgestrand has joined #ruby
<optikalmouse> I bet someone was trying to be clever here.could have just passed in a method symbol name and call that...
flashpoint9 has joined #ruby
alaibe has quit [Ping timeout: 255 seconds]
<optikalmouse> dminuoso: would instance_eval do the trick here?
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
<dminuoso> optikalmouse: I would rather just pass the object if you really have to use it.
nowhereFast has joined #ruby
flashpoint9 has joined #ruby
minimalism has quit [Quit: minimalism]
pawnbox has quit [Remote host closed the connection]
<[k-> also note that the position of where you define cool is important
mikecmpbll has joined #ruby
<[k-> it should have been defined before you used it
pawnbox has joined #ruby
greister_ has quit [Ping timeout: 240 seconds]
twizsted has joined #ruby
cyphase has joined #ruby
<dminuoso> [k-: huh?
<optikalmouse> [k-: that...shouldn't matter?
<dminuoso> [k-: The whole point is that its an undefined method.. :P
<[k-> oh haha im wrong, sorry.
<dminuoso> to trigger did_you_mean
flashpoint9 has quit [Ping timeout: 250 seconds]
bkxd has joined #ruby
maokomioko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 265 seconds]
AlexRussia has joined #ruby
TomyWork has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
zacstewart has joined #ruby
<[k-> if you want to call a method of an object
<[k-> you could pass the object and a symbol of the method
<[k-> then use object#public_send
astrobun_ has joined #ruby
<[k-> or you can use Object#instance_method to get the method
<[k-> and then you can use Method#call on it
bkxd has joined #ruby
jsrn_ has joined #ruby
Es0teric has quit [Remote host closed the connection]
<Burgestrand> You can also pass it as a block!
<Burgestrand> do_something(&object.method(:callback))
astrobun_ has quit [Ping timeout: 252 seconds]
<optikalmouse> ^ also true
<optikalmouse> k awesome, thanks for the help :D
<dminuoso> optikalmouse: As I indicated, I woult opt for passing the object. (Which [k- just pointed out how to use with public_send).
<dminuoso> It's simple and effective.
bkxd has quit [Ping timeout: 265 seconds]
<[k-> please use #public_send instead of #send as it is the right way™
<dminuoso> I too tell people to use #public_send all the time, but I never do it myself.
sai__ has quit [Read error: Connection reset by peer]
<dminuoso> :-)
sai_ has joined #ruby
elifoster has quit [Quit: sleep]
alaibe has joined #ruby
Rodya_ has joined #ruby
pawnbox has joined #ruby
jgt has joined #ruby
<[k-> how to use send :)
evie_hammond has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
Dimik has quit [Ping timeout: 260 seconds]
Alayde has quit [Ping timeout: 276 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bauruine has quit [Ping timeout: 250 seconds]
zacstewart has quit [Ping timeout: 260 seconds]
<sapphire_> guys, is RuRu possible with rly?
<sapphire_> like pypy, but ruru, gettit?
blaxter has joined #ruby
marr has joined #ruby
blaxter has quit [Client Quit]
Freijo has joined #ruby
flying has joined #ruby
dyjakan has quit [Remote host closed the connection]
Pumukel has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
optikalmouse has quit [Quit: optikalmouse]
ec0 has quit [Ping timeout: 250 seconds]
blackgoat has joined #ruby
bauruine has joined #ruby
hahuang61 has joined #ruby
Ipe_ has joined #ruby
Macaveli has joined #ruby
careta has joined #ruby
sai_ has quit [Ping timeout: 244 seconds]
Cohedrin has joined #ruby
blackgoat has quit [Ping timeout: 265 seconds]
Cohedrin has quit [Client Quit]
heelpmeplz has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 255 seconds]
JoshS has joined #ruby
heelpmeplz has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
optikalmouse has joined #ruby
raeoks has joined #ruby
LoneHerm_ has joined #ruby
Ipe_ has quit [Quit: Konversation terminated!]
zacstewart has joined #ruby
alexherbo2 has quit [Ping timeout: 276 seconds]
dyjakan has joined #ruby
LoneHerm_ has quit [Ping timeout: 244 seconds]
LoneHerm_ has joined #ruby
linduxed has joined #ruby
Silthias has quit [Read error: Connection reset by peer]
ferr has joined #ruby
kith has quit [Quit: kith]
olistik has quit [Remote host closed the connection]
webus has joined #ruby
nankyokusei has joined #ruby
mim1k_ has joined #ruby
bkxd has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ is now known as mim1k
mooru has joined #ruby
nankyokusei has quit [Ping timeout: 265 seconds]
Agent001 has joined #ruby
lightheaded has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 240 seconds]
lightheaded has joined #ruby
pawnbox_ has joined #ruby
mooru_ has joined #ruby
nanoz] has quit [Ping timeout: 240 seconds]
pawnbox has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
mooru has quit [Ping timeout: 276 seconds]
einarj has joined #ruby
workmad3 has joined #ruby
lightheaded has quit [Ping timeout: 255 seconds]
optikalmouse has quit [Quit: optikalmouse]
senayar has joined #ruby
Couch has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
sevenfourk has quit [Quit: Connection closed for inactivity]
maokomioko has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
jphase has joined #ruby
charliesome has quit [Client Quit]
blit has joined #ruby
pen has joined #ruby
blit has left #ruby [#ruby]
bsrd has joined #ruby
_joes_ has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby
lightheaded has joined #ruby
jazzonmym1nd has quit [Ping timeout: 265 seconds]
olistik has joined #ruby
hahuang61 has joined #ruby
DaniG2k has joined #ruby
jgt has quit [Ping timeout: 250 seconds]
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
cyphase has quit [Ping timeout: 264 seconds]
hahuang61 has quit [Ping timeout: 260 seconds]
giz|work has joined #ruby
mrgrieves has joined #ruby
cyphase has joined #ruby
flashpoint9 has joined #ruby
pawnbox has quit [Remote host closed the connection]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
pawnbox has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
astrobun_ has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
ta__ has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
Snowy has joined #ruby
bar___ has joined #ruby
getxsick has joined #ruby
alaibe has left #ruby ["WeeChat 1.5"]
<getxsick> is it possible to do something like: for i in list if condition else list2 ?
da3mon has joined #ruby
da3mon has quit [Client Quit]
LoneHerm_ has quit [Remote host closed the connection]
<dminuoso> getxsick: what is that supposed to do?
Snowy is now known as xoxoxoxoxoxo
ta_ has quit [Ping timeout: 250 seconds]
<getxsick> dminuoso: depend on the if statement i pass different container to the for
<dminuoso> getxsick: drop the "for i in" and use the Ruby style
<getxsick> dminuoso: in fact i want to set something like "default container" in case the one passed by user is empty (or nil)
<dminuoso> getxsick: The clean way is simply this: container = condition ? list1 : list2; container.each { |elem }
<getxsick> dminuoso: i'm totally new to the Ruby, so still not sure what is the Ruby style ;-) i'm open to lister :
<dminuoso> (You could do this in a single line but that adds no value and reduces readability)
mrgrieves has quit [Ping timeout: 250 seconds]
<getxsick> ah, forgot about ?: operator :D right
<dminuoso> getxsick: Fair enough. "for i in enumerable" is just syntax sugar for: enumerable do |i| end
yardenbar has joined #ruby
<dminuoso> getxsick: and its only for python folks. Dont use it. :)
<dminuoso> *enumerable.each do |i| end
<dminuoso> sorry
<getxsick> dminuoso: yeah, over 10 years of python...you know :)
<dminuoso> getxsick: Let me prepare a simplistic example to show
<getxsick> dminuoso: sure
<dminuoso> getxsick: https://eval.in/638781
<getxsick> dminuoso: thx
bar___ has quit [Ping timeout: 252 seconds]
astrobun_ has quit [Remote host closed the connection]
<dminuoso> getxsick: it shows that the notion of "looping through a container" is not really some language feature, but its provided through actual methods that you can call.
Silthias has joined #ruby
<dminuoso> getxsick: You can do lots of fun things with them https://eval.in/638782
jgt has joined #ruby
<getxsick> yeah, i know the Enumerable class, just still playing with the "Ruby style" :)
pawnbox has quit [Remote host closed the connection]
blackgoat has joined #ruby
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
stamina has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Moeh has joined #ruby
Moeh has quit [Client Quit]
Rodya_ has joined #ruby
giz|work has quit [Ping timeout: 250 seconds]
vdamewood has joined #ruby
<getxsick> dminuoso: https://eval.in/638812 - is it in Ruby style? or it can be nicely tuned?
Guest27846 has quit [Ping timeout: 250 seconds]
<adaedra> I think `[u,]` does not work
<dminuoso> getxsick: nil evaluates as falsey
<dminuoso> adaedra: it should.
<dminuoso> >> [1,]
<ruby[bot]> dminuoso: # => [1] (https://eval.in/638813)
<adaedra> oh, didn't know this one then
<adaedra> ah wait
<adaedra> I misread
<dminuoso> adaedra: It's syntax sugar for when you split arrays across multiple lines, so that even your last line can have a comma at the end.
<dminuoso> :P
<adaedra> yeah, I thought it was operator [], not array literal, I derped
<dminuoso> Ah.
<getxsick> dminuoso: https://eval.in/638816 so like this?
<Mon_Ouie> That should work too though
<dminuoso> getxsick: Second, leave () away from method invocations unless thye are required to resolve syntax ambiguity
<getxsick> dminuoso: you mean the last line? sure
elementaru has joined #ruby
<dminuoso> getxsick: Then I think you could actually specify the default value of the argument to be @default.each_key
* dminuoso ponders on this
Rodya_ has quit [Ping timeout: 255 seconds]
<getxsick> dminuoso: hm? not sure i understood
<dminuoso> >> def f(a = @default.each_key); a.each { |e| } end # getxsick
<ruby[bot]> dminuoso: # => :f (https://eval.in/638825)
lightheaded has quit [Remote host closed the connection]
mdgmt has quit [Ping timeout: 240 seconds]
<dminuoso> getxsick: your body indicates that "the default value for the argument is supposed to be @default.each_key
lightheaded has joined #ruby
<dminuoso> So lets make it so. :)
mooru_ has quit [Quit: Textual IRC Client: www.textualapp.com]
sai_ has joined #ruby
robfrawley has joined #ruby
<dminuoso> Oh well nevermind, that doesnt fit quite nicely in there.
robfrawley is now known as Guest42974
pawnbox has quit [Remote host closed the connection]
<getxsick> actually it's still more simpler than in the real source code
pawnbox has joined #ruby
yardenbar has quit [Ping timeout: 255 seconds]
lightheaded has quit [Read error: No route to host]
lightheaded has joined #ruby
dionysus69 has joined #ruby
<dminuoso> getxsick: https://eval.in/638836
Silthias has quit [Ping timeout: 244 seconds]
<getxsick> dminuoso: but then you have to wrap in a list the passing argument (which actually is good as it keeps API more concise
<dminuoso> getxsick: Well you pass something to f, and it treats it like a list. Otherwise it defaults to another list.
<dminuoso> It would feel right to pass in a list.
sevenfourk has joined #ruby
<dminuoso> getxsick: But dont let me confuse you, this is just me toying around.
Silthias has joined #ruby
lightheaded has quit [Ping timeout: 260 seconds]
lightheaded has joined #ruby
jazzonmym1nd has joined #ruby
c355e3b has joined #ruby
giz|work has joined #ruby
Agent001 has quit [Ping timeout: 240 seconds]
jazzonmym1nd has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
lightheaded has quit [Ping timeout: 276 seconds]
Pumukel has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Agent001 has joined #ruby
Pumukel has joined #ruby
charliesome has joined #ruby
rodfersou has joined #ruby
sdothum has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<sapphire_> my question is still unanswered
<j416> sapphire_: perhaps it was not clear enough
<j416> sapphire_: or, no one knows the answer
<sapphire_> it was clear as a glass sheet
<adaedra> For you maybe.
aidalgol has quit [Quit: zZzZzZzZzz]
lightheaded has joined #ruby
<getxsick> dminuoso: i ended up with this: https://eval.in/638852 and probably there is no way to set better default value for host as it rely on the user in the iteration
k3rn31 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<getxsick> ah, it's wrong
<getxsick> nvm
<sapphire_> [eye rolling intensifies]
bkxd has joined #ruby
ruby_ has joined #ruby
Hyuk has joined #ruby
<getxsick> dminuoso: https://eval.in/638854 now
<[k-> hello sapphire_, back again I see
<sapphire_> yes
<[k-> did you find a solution?
<sapphire_> yes, fixing up yacc for unicode :/
<sapphire_> that sucks
lightheaded has quit [Read error: No route to host]
<[k-> must be hard, i heard nasty comments about yacc
lightheaded has joined #ruby
mdgmt has joined #ruby
<sapphire_> afm it's impossible, 'cos i cannot into c
<sapphire_> :/
<sapphire_> so i'm asking about rly then
Hyuk has quit [Client Quit]
<[k-> what's rly?
ruby_ has quit [Ping timeout: 244 seconds]
<sapphire_> heh, yacc for ruby...it seems
<sapphire_> based on ply
Agent001 has quit [Ping timeout: 240 seconds]
<[k-> ah. so you are using yacc to use rly to maje a new yacc for ruby?
<sapphire_> nr
charliesome has joined #ruby
<sapphire_> i'm planning on using rly instead of yacc
<sapphire_> y know like pypy
<sapphire_> in this case - ruru
<sapphire_> if it's possible ofc
<[k-> and then you will swap out parse.y with the one from rly?
jgt has quit [Ping timeout: 244 seconds]
craigp has quit [Ping timeout: 252 seconds]
<[k-> what are the commonly used languages in your area?
mdgmt has quit [Ping timeout: 252 seconds]
<sapphire_> delphi and it's sad
<sapphire_> like, very sad
<[k-> delphi is localized?
giz|work has quit [Ping timeout: 244 seconds]
<sapphire_> it's outdated and buggy and nobody cares mostly because it's not complicated and understandable
bkxd has quit [Ping timeout: 276 seconds]
kristofferR has joined #ruby
nankyokusei has joined #ruby
<[k-> but if you localise ruby, won't your ruby be outdated and buggy?
<Mon_Ouie> Let's all switch to Piet
<[k-> ruby is very very complex
mikhael_k33hl has quit [Quit: Page closed]
<[k-> how do we metaprogram in piet though
edwinvdgraaf has joined #ruby
<sapphire_> outdated - well, debatable, it will be in case when most of the gems are no longer compatible
<sapphire_> buggy - nah
hanmac has quit [Ping timeout: 255 seconds]
<[k-> how would you ensure compatibility? have you thought about it?
nankyokusei has quit [Ping timeout: 276 seconds]
shakes has quit [Quit: Leaving]
<sapphire_> conversion
<sapphire_> or having both localized and original keywords
<sapphire_> btw, even crystal is written in crystal
alaibe_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<[k-> ruby written in Ruby is rubinius i think
raMpin has joined #ruby
<sapphire_> found no docs
<sapphire_> existing "docs" are incoplete and raw
<sapphire_> incomplete*
ctp has joined #ruby
jgt has joined #ruby
giz|work has joined #ruby
aganov has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 244 seconds]
maloik has quit [Ping timeout: 244 seconds]
flopsec has quit [Ping timeout: 244 seconds]
Vile` has quit [Remote host closed the connection]
mim1k_ has joined #ruby
Vingador has joined #ruby
mim1k_ is now known as mim1k
Vile` has joined #ruby
flopsec has joined #ruby
marr has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
k3rn31 has quit [Quit: Computer has gone to sleep.]
dionysus69 has quit [Remote host closed the connection]
sai_ has quit [Ping timeout: 244 seconds]
raMp has joined #ruby
raMpin has quit [Ping timeout: 265 seconds]
Rodya_ has joined #ruby
sai_ has joined #ruby
hanmac has joined #ruby
gvt has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
alaibe_ has left #ruby ["WeeChat 1.5"]
flashpoint9 has joined #ruby
DaniG2k has quit [Ping timeout: 265 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
foooobear has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
rodfersou has quit [Ping timeout: 244 seconds]
rodfersou has joined #ruby
bkxd has joined #ruby
cyphase has joined #ruby
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v2.5 Beta Build (2016/09/08) 32 Bit]
<sapphire_> :/...
DaniG2k has joined #ruby
Tempesta has joined #ruby
bar___ has joined #ruby
twistedpixels has quit [Remote host closed the connection]
twistedpixels has joined #ruby
twistedpixels has joined #ruby
twistedpixels has quit [Changing host]
pawnbox has quit [Remote host closed the connection]
maloik has joined #ruby
dionysus69 has quit [Quit: dionysus69]
bar___ has quit [Remote host closed the connection]
hahuang61 has joined #ruby
ponga has joined #ruby
pawnbox has joined #ruby
dionysus69 has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
LUMIA930 has joined #ruby
tyang has joined #ruby
sai__ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
<dminuoso> getxsick: There's something real fishy about your code.
<[k-> are you sure there is no documentation
<sapphire_> at least i told you above
<[k-> there is an entire book on it: https://book.rubinius.com/manuscript/preface.html
<sapphire_> "book" is unfinished and raw
<dminuoso> getxsick: It does not seem to yield the sum of all connections, but the duration instead. The method name is misleading.
<chrisseaton> Just read the 'blue book' http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf and replace Smalltalk with Ruby in your mind as you are reading
<[k-> well I saw the content page and was like wow. I am disappointed :(
badeball has quit [Remote host closed the connection]
badeball has joined #ruby
<[k-> sapphire_ are you planning to do this alone?
<sapphire_> well, do you see crowds of volunteers?
DaniG2k has quit [Ping timeout: 250 seconds]
<sapphire_> me neither
tlaxkit has joined #ruby
_joes_ has quit [Quit: Connection closed for inactivity]
<chrisseaton> sapphire_: the hard problems of implementing Ruby aren't anything to do with parsing and lexing though
<[k-> are you going to keep up with ruby releases? syntax changes? hashrocket to colons? keyword arguments?
<sapphire_> well, only updating versions once in a while
jgt has quit [Ping timeout: 264 seconds]
LoneHermit has joined #ruby
<sapphire_> you know, like chrome-based browsers
cyphase has quit [Ping timeout: 276 seconds]
synthroid has joined #ruby
banisterfiend has joined #ruby
craigp has joined #ruby
DaniG2k has joined #ruby
<[k-> hey, what if you tried to localise crystal instead?
<[k-> crystal is easier to read
<sapphire_> unfinished
<[k-> and has type safety
<sapphire_> it's in alpha
<[k-> but it works!
nanoz] has joined #ruby
tk__ has joined #ruby
<sapphire_> standart lib is not yet done
<sapphire_> standard*
blaxter has joined #ruby
<[k-> at least they dont have Timeout#timeout
<sapphire_> yea, they do have int32 overflow
<[k-> python has PEP8 which describes the language
<[k-> what about lua? or a lisp?
<[k-> racket?
LoneHermit has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
<sapphire_> hmm, can it be simplified further to the point that user isn't actually noticing he's programming?
blaxter has quit [Client Quit]
<[k-> they program in delphi already
<sapphire_> (almost) like englishscript
<[k-> they know the drill
<sapphire_> yes, and yet imagine a complete novice who just wants to create a program, fast
<sapphire_> (and visually)
nadir has joined #ruby
<[k-> lua can do that, lisp too
<[k-> or you can compile to ruby bytecode too
sai_ has quit [Read error: Connection reset by peer]
<[k-> run on the jvm!
bruce_lee has quit [Ping timeout: 265 seconds]
bruce_lee has joined #ruby
<sapphire_> ((lisp(is(so(obvious)))) (and(not(confusing(at(all))))))
sai_ has joined #ruby
<[k-> do most of the people in your area not speak english?
sai_ has quit [Read error: Connection reset by peer]
<[k-> you speak it well
<sapphire_> 60%
gnufied has joined #ruby
<dminuoso> sapphire_: Do you actually know the reason for the braces?
<sapphire_> nr, never really dug down to it
sai_ has joined #ruby
<[k-> are you trying to solve a non problem?
giz|work has quit [Ping timeout: 265 seconds]
<[k-> did you do a survey? to gauge responses?
<dminuoso> sapphire_: The idea is that the these expression (S-expressions) are exactly the same in the internal representation, giving you the ability to treat code as data.
<sapphire_> well, you see the rest (40%) are just refusing or "learned deutch"
<dminuoso> sapphire_: It's a neat thing actually. :)
tuelz1 has quit [Ping timeout: 250 seconds]
<sapphire_> w/o proper ide you are screwed tho
<sapphire_> +-1 brace and hello syntax error
<dminuoso> Proper identation goes a long way to make lisp readable
anisha has quit [Quit: This computer has gone to sleep]
<dminuoso> Well, editors have had matching parens features for decades.
<dminuoso> sapphire_: And if you miss a semicolon or ) or } in C you can end up with pretty strange errors too.
<dminuoso> It's not much of an argument.
<dminuoso> Even in Ruby a missing () {} can produce super strange errors.
xoxoxoxoxoxo has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
<sapphire_> well, if your editor weird enough (ey, rubymine) you'll notice that before running the app
<sapphire_> well..."running"
<sapphire_> 'cos ruby is not compilable
<[k-> what about ide support for your proposed localised ruby?
<dminuoso> sapphire_: Ruby quite is.
<[k-> it won't have any of the tools available
<sapphire_> rubymine ofc
<sapphire_> with a plugin/slight alterations
<[k-> and everyone will pay for rubymine?
<sapphire_> and/or notepad++
<sapphire_> srsly? Community edition all the way
<dminuoso> sapphire_: In fact you can have Ruby just parse input to detect grammar errors.
giz|work has joined #ruby
<[k-> oh there's one alrdy?
<sapphire_> long time actually
<sapphire_> and some shifty unlim lic servers as well ;)
<[k-> do you have funding? company support? how are you going to convince them to switch to your ruby?
<sapphire_> simplicity
polysics has joined #ruby
<sapphire_> and "intuitivity"
<[k-> so you don't have funding and all?
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
<sapphire_> why, we're not a large company
<[k-> is your company using ruby?
<sapphire_> we don't have thousands of workstations
<sapphire_> told you above
<[k-> sell ruby to your co-workers, see if it works
sai_ has quit [Read error: Connection reset by peer]
<[k-> then decide if you want to put in effort to localise
sai_ has joined #ruby
Rodya_ has joined #ruby
tuelz1 has joined #ruby
<[k-> show them your side projects
<[k-> show them rails
<sapphire_> it is decided and currently the problem is - confusion,slowness,docs
sai_ has quit [Read error: Connection reset by peer]
mark_66 has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 265 seconds]
Agent001 has joined #ruby
mark_66 has joined #ruby
sai_ has joined #ruby
last_staff has joined #ruby
claudiuinberlin has joined #ruby
<sapphire_> guess what, for some wird reason in ru_RU people only learn__rails__, not ruby itself
<sapphire_> like, wtf
<sapphire_> it's like learning laravel and not minding php
<[k-> implement pair programming
<[k-> get them to learn together!
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[k-> are you in a position of power?
<sapphire_> nah, too ignorant and we have svn
<sapphire_> i'm not, sadly
sai_ has quit [Read error: Connection reset by peer]
olistik has quit [Remote host closed the connection]
banisterfiend has joined #ruby
<[k-> (then I think the company would just shoot down your version of ruby)
pawnbox has quit [Remote host closed the connection]
sai_ has joined #ruby
olistik has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
claudiuinberlin has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
<sapphire_> eh, then i'll get it on github
<[k-> and then what?
cyphase has joined #ruby
<sapphire_> at least other people will be grateful enough
pandaant has quit [Remote host closed the connection]
hutch34_ has joined #ruby
olistik has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[k-> although I doubt the long term sustainability of your project, if you want to do it this way then
jgt has joined #ruby
giz|work has quit [Ping timeout: 250 seconds]
<[k-> all i have to say is good luck
<sapphire_> aherm, see? They are popping left and right https://github.com/ozra/onyx-lang
<sapphire_> wtf
<sapphire_> "they" in this case - ruby/crystal based langs
sai_ has quit [Read error: Connection reset by peer]
<[k-> now you have an example
postmodern has quit [Quit: Leaving]
giz|work has joined #ruby
blaxter has joined #ruby
pawnbox has joined #ruby
sai_ has joined #ruby
<[k-> you can follow what the author of onyx-lang is trying to do
<[k-> and translate it to your work
<sapphire_> |||:| my brows are sinking
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
rbr has quit [Ping timeout: 265 seconds]
sai_ has quit [Read error: Connection reset by peer]
<[k-> if you hook onto crystal like that, you can get libraries for free!
rbr has joined #ruby
DaniG2k has quit [Quit: leaving]
<[k-> and LLVM gives you what jvm gives other languages!
sai_ has joined #ruby
jazzonmym1nd has joined #ruby
pokalyis has joined #ruby
<[k-> it's like what the scala author said, the performance of scala will only improve even if he doesnt do anything
<sapphire_> i ain't against that
Madplatypus has joined #ruby
mrgrieves has joined #ruby
<[k-> so what are your plans now
<sapphire_> i'm against non-compilability,general slowness, meduim learning curve
fmcgeough has joined #ruby
malconis has joined #ruby
<sapphire_> learning curve should be so law it should be digging the floor you are standing on
<sapphire_> low*
<[k-> great, crystal is compiled, fast, and doesn't require specifying types!
<sapphire_> compiler? Not really
<sapphire_> compiled*
malconis has quit [Remote host closed the connection]
<sapphire_> at least not for native formats
<sapphire_> windows binaries are also missing
malconis has joined #ruby
<sapphire_> visual part as well
johnmilton has quit [Remote host closed the connection]
jazzonmym1nd has quit [Ping timeout: 244 seconds]
<[k-> what about jruby
<Mon_Ouie> That's not true, Crystal does compile to native code.
<sapphire_> jruby is massive
sai__ has joined #ruby
bsrd has quit [Quit: WeeChat 1.5]
<sapphire_> maybe even too massive
dstarh has quit [Quit: Textual IRC Client: www.textualapp.com]
cyphase has quit [Ping timeout: 255 seconds]
sai_ has quit [Ping timeout: 264 seconds]
sevenfourk has quit [Quit: Connection closed for inactivity]
<[k-> have you considered lua? lua is real fast
NetSage has joined #ruby
<sapphire_> lua is confusing and learning curve is a bit too high
NetSage has quit [Client Quit]
cyphase has joined #ruby
sai__ has quit [Ping timeout: 240 seconds]
chrisdav6 has joined #ruby
shakes has joined #ruby
<[k-> are you serious...
mrgrieves has quit [Ping timeout: 265 seconds]
<chrisdav6> good morning!
<sapphire_> i'm never kidding
last_staff has quit [Quit: last_staff]
<[k-> what's the language code for Deutsche?
<[k-> is it de-de?
<sapphire_> yup
<sapphire_> German - Germanydede-de
<[k-> there is #ruby-de too
wugy has quit []
anisha has joined #ruby
wugy has joined #ruby
wugy has quit [Excess Flood]
<sapphire_> bit wrong
bmurt_ has joined #ruby
wugy has joined #ruby
<sapphire_> and yes, i put "learnined german" in quotes
sai_ has joined #ruby
<sapphire_> that was "formal learning"
<sapphire_> learned*
<[k-> does these sites solve the problem?
olistik has joined #ruby
<sapphire_> rdoc will not solve it
<sapphire_> 'cos it's not typical
giz|work has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
ta_ has joined #ruby
<[k-> what are the general attitudes of the people there?
<[k-> are they willing to learn/switch?
Ropeney has joined #ruby
<[k-> are they passionate about their jobs/programming as a hobby?
<sapphire_> they are conservatives
<sapphire_> they need programs to run fast, to write less code and to be effective
<sapphire_> and to have gui
<sapphire_> (delphi-style)
lifted has joined #ruby
tlaxkit has quit [Quit: tlaxkit]
nankyokusei has joined #ruby
ernstwijsmuller has joined #ruby
ta__ has quit [Ping timeout: 252 seconds]
LoneHermit has joined #ruby
<[k-> actually, if your company is pushing ruby already, why do you still want to localise ruby?
jphase has joined #ruby
johnmilton has joined #ruby
jphase has quit [Remote host closed the connection]
<sapphire_> see above the part with the learning curve
polysics has quit []
jphase has joined #ruby
<sapphire_> huh, another one :/ https://github.com/mruby/mruby
glcx has joined #ruby
glcx has joined #ruby
glcx has quit [Changing host]
banisterfiend has joined #ruby
<dminuoso> Im using chruby on my server (configured properly through a script in /etc/profile.d ) and capistrano is giving me "/usr/bin/env bundle: No such file or director" errors. If I log in as the deploy user that command runs just fine.
<dminuoso> I can't figure this out.
nankyokusei has quit [Ping timeout: 244 seconds]
<[k-> mruby is by Matz for embeddable ruby
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
LoneHermit has quit [Ping timeout: 264 seconds]
<dminuoso> So folks, where would you look?
ramortegui has joined #ruby
<sapphire_> so, he abandoned original ruby?
Bob8989|2 has joined #ruby
<[k-> no, this is his sister project
<dminuoso> sapphire_: No. It's just a stripped down version for special targerts.
<[k-> he is doing both at the same time
Jamo has quit [Ping timeout: 240 seconds]
<ernstwijsmuller> anybody experience with rails? getting a nill error on my edit @post .. iam pretty new at it..
hutch34_ has quit [Ping timeout: 255 seconds]
Jamo has joined #ruby
ernstwijsmuller is now known as RubNob
<sapphire_> rails is in #rubyonrails
<RubNob> thanks!
shinnya has joined #ruby
RubNob has left #ruby [#ruby]
a1fa has joined #ruby
<a1fa> i have a silly to_datetime dilema. is there a better way of writing this
<a1fa> .strftime(%M/%D/%Y 00:00 MTN).to_datetime.to_i
<a1fa> those should be lowercase %m/%d/%y
<a1fa> and capital %Y. :( need more caffeine
<adaedra> why do you convert to string then back to datetime?
xoxoxoxoxoxo has joined #ruby
<adaedra> what are you trying to achieve here?
<a1fa> adaedra: if i do to_date.to_i, it does not work
<Batholith> And you probably meant to have quotes!
giz|work has joined #ruby
<a1fa> trying to get start of day, disregarding minutes
<a1fa> and hours..
<adaedra> ah
skweek has joined #ruby
<adaedra> if you have active_support (i.e. rails), you have beginning_of_day
FernandoBasso has joined #ruby
<a1fa> yes i do.. but it does not work with "business-day_ gem
<a1fa> well nevermind
<a1fa> < tard
<a1fa> that worked very well, thank you adaedra
<a1fa> 1.business_day.ago.beginning_of_day.to_i
conta has quit [Quit: conta]
coolboy has joined #ruby
<[k-> chrisdav6 ^ example of monkeypatching
<a1fa> what is monkeypatching?
xoxoxoxoxoxo has quit [Ping timeout: 252 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
Alayde has joined #ruby
giz|work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
cyphase has quit [Ping timeout: 255 seconds]
<[k-> In simple terms, monkey patching refers to the practice of extending or modifying existing code by changing classes at run-time.
Rodya_ has joined #ruby
submitnine has quit []
<a1fa> good or a bad thing?
<Burgestrand> Both.
<Burgestrand> Sometimes it's convenient, sometimes it's the cleanest option without rewriting the entire implementation, and sometimes it comes back to bite you!
<[k-> however, rails is an example of the good side
xoxoxoxoxoxo has joined #ruby
<Burgestrand> I'm a bit torn on that, but Rails has definitely added some good monkey patches without polluting too much!
<Burgestrand> And if I'm not wrong, some of them have even been added into Ruby itself over time, because it was so nice.
<[k-> like &:method
eljimador has joined #ruby
Ipe has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
lidenbrock has joined #ruby
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ngscheurich has joined #ruby
Ipe has quit [Client Quit]
maokomioko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ipe_ has joined #ruby
stamina has quit [Ping timeout: 255 seconds]
bigkevmcd has quit [Quit: Outta here...]
raeoks has joined #ruby
Ipe_ has quit [Client Quit]
raeoks has quit [Client Quit]
Ipe_ has joined #ruby
Jamo has quit [Ping timeout: 255 seconds]
eljimmy has quit [Ping timeout: 276 seconds]
PaulePanter has joined #ruby
aegis3121 has joined #ruby
Jamo has joined #ruby
AlexRussia has quit [Ping timeout: 244 seconds]
raeoks has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
craigp has quit [Quit: WeeChat 1.5]
raeoks has quit [Client Quit]
jhack has joined #ruby
ferr has quit [Quit: WeeChat 1.5]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AndrewIsHere has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
sevenfourk has joined #ruby
jhack has quit [Quit: jhack]
jhack has joined #ruby
pawnbox has quit [Remote host closed the connection]
kanyewezt has joined #ruby
flashpoi_ has joined #ruby
<[k-> ftshtw: you could try #sinatra if you don't get a response here
flashpoint9 has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
cyphase has joined #ruby
FernandoBasso has quit [Ping timeout: 244 seconds]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ruby_ has joined #ruby
AlexRussia has joined #ruby
tyang has quit [Ping timeout: 250 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
Rodya_ has joined #ruby
AndrewIsHere has quit []
sapphire_ has quit [Quit: Page closed]
heftig has quit [Read error: Connection reset by peer]
flashpoi_ has quit [Remote host closed the connection]
heftig has joined #ruby
flashpoint9 has joined #ruby
pawnbox has joined #ruby
sai_ has quit [Remote host closed the connection]
alaibe has joined #ruby
tyang has joined #ruby
dn` has joined #ruby
alaibe has left #ruby [#ruby]
jhack has quit [Quit: jhack]
xoxoxoxoxoxo is now known as Snowy
hutch34_ has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
last_staff has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
tyang has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 255 seconds]
bigkevmcd has joined #ruby
AlexRussia has joined #ruby
crdpink has quit [Excess Flood]
jhack has joined #ruby
crdpink has joined #ruby
griffindy has joined #ruby
cyphase has joined #ruby
ctp has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
dionysus69 has quit [Remote host closed the connection]
LastWhisper____ has joined #ruby
LoneHermit has joined #ruby
deadprez has joined #ruby
LUMIA930 has quit [Ping timeout: 252 seconds]
cyphase has quit [Ping timeout: 250 seconds]
pandaant has joined #ruby
LoneHermit has quit [Ping timeout: 244 seconds]
lightheaded has quit [Remote host closed the connection]
toretore has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
lightheaded has joined #ruby
deadprez has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
rippa has joined #ruby
pawnbox has joined #ruby
maokomioko has joined #ruby
roychri has joined #ruby
cyphase has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lightheaded has quit [Ping timeout: 255 seconds]
heftig has quit [Read error: Connection reset by peer]
pokalyis has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
lidenbrock has quit [Ping timeout: 264 seconds]
pandaant has quit [Ping timeout: 276 seconds]
jgt has quit [Ping timeout: 265 seconds]
webus has quit [Quit: goodbye]
pandaant has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
phoo1234567 has joined #ruby
heftig has joined #ruby
dionysus69 has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Mon_Ouie has quit [Ping timeout: 244 seconds]
eljimbo has joined #ruby
phoo1234567 has quit [Read error: Connection reset by peer]
pokalyis has joined #ruby
Burgestrand has joined #ruby
JeanCarloMachado has joined #ruby
bweston92 has quit [Read error: Connection reset by peer]
toretore has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moparisthebest has left #ruby ["Leaving"]
cyphase has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 250 seconds]
last_staff has quit [Read error: Connection reset by peer]
flashpoint9 has joined #ruby
LastWhisper____ has joined #ruby
hogetaro has quit [Quit: Leaving...]
last_staff has joined #ruby
dminuoso has quit [Ping timeout: 240 seconds]
cyphase has joined #ruby
tuelz1 has quit [Ping timeout: 250 seconds]
AzureStigma has joined #ruby
dionysus69 has quit [Remote host closed the connection]
deadprez has joined #ruby
deadprez has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
deadprez has joined #ruby
pawnbox has quit [Ping timeout: 265 seconds]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdgraaf has quit [Remote host closed the connection]
jrafanie has joined #ruby
pawnbox has joined #ruby
Rodya_ has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
tuelz1 has joined #ruby
cyphase has quit [Ping timeout: 276 seconds]
dionysus69 has quit [Remote host closed the connection]
Rodya_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
chouhoulis has joined #ruby
Ropeney has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
cyphase has joined #ruby
dminuoso has joined #ruby
morfin has joined #ruby
<morfin> hello, JRuby works with application server right?
<morfin> like Tomcat/JBoss/something else
<adaedra> I think you can exports apps to war files
<morfin> war? it's like jar but war?
r4z has joined #ruby
<nowhereFast> morfin: it does
<[k-> ?patience ftshtw
<[k-> wait we don't have that?
<nowhereFast> run a search on: openshift jruby
sai_ has joined #ruby
<morfin> i remember some guys said i can use it if got Java apps etc
<nowhereFast> and the book deploying with jruby
<morfin> deploying that is possibly harder hmm
hk238 has joined #ruby
<nowhereFast> maybe try the #jruby channel?
<morfin> nevermind i just asked, not going to use that very soon :)
maokomioko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nowhereFast> pretty sure you can do both war and jar
maokomioko has joined #ruby
<nowhereFast> then just drop into tomcat/jboss
karmatr0n has joined #ruby
maokomioko has quit [Client Quit]
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
synruby has joined #ruby
synruby has quit [Client Quit]
synruby has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
synruby has quit [Client Quit]
AlexRussia has joined #ruby
hakunin has quit [Remote host closed the connection]
aegis3121 has quit [Ping timeout: 255 seconds]
[k- has quit [Quit: -a- Connection Timed Out]
jesk has joined #ruby
<jesk> hi
Alayde has quit [Ping timeout: 240 seconds]
[k- has joined #ruby
jobewan has joined #ruby
synruby has joined #ruby
<synruby> hi
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
synruby has quit [Client Quit]
agent_white has joined #ruby
<agent_white> Mornin'
LastWhisper____ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
sysanthrope has quit [Remote host closed the connection]
sysanthrope has joined #ruby
synruby has joined #ruby
dminuoso has quit [Remote host closed the connection]
morfin has quit [Ping timeout: 276 seconds]
nankyokusei has joined #ruby
bmurt_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rodfersou is now known as rodfersou|lunch
<synruby> I'm not new to programming in general, but I'm new to Ruby. I installed Ruby 2.3.1-x64. What book should I follow for a fun learning experience?
7GHABZIEL has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
<synruby> should I be concerned about this: "You will have
<synruby> the option to download a 64-bit (x86) version. At this stage, I would recommend
<synruby> compatible with the 64-bit version yet"
<synruby> staying with the normal, plain (32-bit) version, as not all Ruby libraries are
<adaedra> what are you reading?
<nowhereFast> new to ruby or new to coding?
<synruby> new to ruby
<synruby> i found it in an excerpt online. its from a book i guess
<nowhereFast> google poodr
nankyokusei has quit [Ping timeout: 244 seconds]
conta has joined #ruby
cyphase has joined #ruby
7GHABZIEL has quit [Ping timeout: 252 seconds]
<nowhereFast> can't speak for anybody else, but this book helped me out on a few fronts re. ruby
<synruby> thanks
synruby has left #ruby ["Leaving"]
qba73 has joined #ruby
wugy has quit []
etetz has joined #ruby
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.2 Aria]
<a1fa> i need to combine two different Models, and sort.uniq them; (Model1.select(:name).distinct + Model2.select(:name).distinct).sort.uniq did not work
qba73 has quit [Remote host closed the connection]
hutch34_ has quit [Ping timeout: 264 seconds]
qba73 has joined #ruby
<a1fa> i tried with pluck too, no luck
tk__ has quit [Quit: ばいばい]
<[k-> what does Model1.select(:name).distinct give you?
<[k-> an array or a Model?
qba73_ has joined #ruby
<a1fa> Model
raMp has quit [Quit: Konversation terminated!]
weemsledeux has joined #ruby
<[k-> and what does + on Models do?
<a1fa> two models ":)"
dminuoso has joined #ruby
<[k-> it works like that? :o
<a1fa> it doesnt :)
<[k-> shouldn't you have one combined model or something then?
<a1fa> [k-: may have figured it out
<[k-> you can sort an array
<[k-> not sure if you can sort a model?
mikecmpbll has quit [Read error: Connection reset by peer]
jgnagy has joined #ruby
qba73 has quit [Ping timeout: 265 seconds]
hk238 has joined #ruby
<a1fa> well i am plucking stuff out
<a1fa> so its an array
mikecmpbll has joined #ruby
<[k-> how does it become an array?!
<a1fa> .pluck?
<[k-> that wasn't in the code you provided, and I don't know rails ;)
Vingador has quit [Remote host closed the connection]
qba73_ has quit [Ping timeout: 265 seconds]
<[k-> you have to explain it to me what you are doing and you will eventually figure out what's wrong as I force you to think
ftshtw has quit [Ping timeout: 264 seconds]
mark_66 has quit [Quit: Leaving.]
<[k-> I'm sorry if you felt appalled :(
jhack has joined #ruby
<a1fa> that didnt work
<a1fa> comparison of nilclass with string failed
qba73 has joined #ruby
jhack has quit [Client Quit]
cyphase has quit [Ping timeout: 250 seconds]
synruby has joined #ruby
qba73 has quit [Client Quit]
<a1fa> i see why, but why.
Alayde has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<[k-> is that an error?
sai_ has joined #ruby
<a1fa> no
sai_ has quit [Read error: Connection reset by peer]
minimalism has joined #ruby
<a1fa> i had to do sort_by! { |a| a.to_s || 0 }.uniq
<a1fa> gross
synruby has left #ruby ["Leaving"]
<[k-> why the || 0?
sai_ has joined #ruby
raeoks has joined #ruby
senayar has quit [Ping timeout: 265 seconds]
cyphase has joined #ruby
synruby has joined #ruby
dminuoso has quit [Ping timeout: 265 seconds]
pochoa has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
chouhoulis has quit [Remote host closed the connection]
Alayde has quit [Ping timeout: 276 seconds]
sai_ has joined #ruby
<baweaver> >> nil.to_s
<ruby[bot]> baweaver: # => "" (https://eval.in/638972)
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
sai_ has quit [Read error: Connection reset by peer]
<synruby> POODR
sai_ has joined #ruby
nowhereFast has quit [Ping timeout: 244 seconds]
bmurt has quit [Remote host closed the connection]
brendan- has joined #ruby
brendan- is now known as bmurt-
[Butch] has joined #ruby
hahuang61 has joined #ruby
b3atr has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
<b3atr> is there a common interface to test types for nil/empty values?
<b3atr> i mean, for all types. a gem would also would be helpful.
skarn_ has quit [Excess Flood]
d5sx43 has joined #ruby
tyang has joined #ruby
aufi has quit [Quit: Leaving]
<Papierkorb> b3atr: ActiveSupports Object#blank?
skarn_ has joined #ruby
<[k-> &ri Object#nil? @b3atr
<Papierkorb> [k-: > "nil/empty values"
hahuang61 has quit [Ping timeout: 250 seconds]
<b3atr> for example; ['', ''].nil? -> false
<Papierkorb> b3atr: That will never be blank
<Papierkorb> the array isn't empty
<b3atr> i need a common interface to test all types to no be empty or nil.
<b3atr> even their what they contains.
<b3atr> err, they
<[k-> oh, empty values, I see, sorry
<Papierkorb> b3atr: ... are you coming from PHP?
d5sx43 has quit [Client Quit]
cyphase has joined #ruby
<b3atr> Papierkorb: i didn't do PHP at all :) i reached to a situiaion where i should validate a type to be not empty
aegis3121 has joined #ruby
<roychri> We all have to come from somewhere! ;-)
deadprez has quit [Remote host closed the connection]
<roychri> b3atr: [", "] <= This is not empty.
<Papierkorb> b3atr: [""] is an array containing an empty string, but it's not empty, as it contains something.
deadprez has joined #ruby
<Papierkorb> b3atr: ActiveSupports blank? boils down to class Object; def blank?; nil? || (respond_to?(:empty?) ? empty? : false); end; end
<b3atr> b3atr: i'm searching to find a solution to not do if foo.class.name == bar.class.name; do this.
lightheaded has joined #ruby
spudowiar has joined #ruby
<Papierkorb> why would you ever do that by comparing class /names/ ?!
k3rn31 has joined #ruby
<[k-> you could just compare the class itself
<b3atr> if an array iterate through it and check whether its elements are empty/nil
<roychri> b3art : [", "].[", "].map{|v| v.split(/, */)}.delete_if{|v| v.empty?}.empty? => true
<Papierkorb> Using that you can quickly write a helper method, in Array directlry or not, to see if its contents are blank
<Papierkorb> [k-: Just compare the class object itself?
<roychri> oops,.... one sec
<roychri> b3atr: [", "].map{|v| v.split(/, */)}.delete_if{|v| v.empty?}.empty?
shinnya has quit [Ping timeout: 250 seconds]
Couch has quit [Ping timeout: 240 seconds]
<Papierkorb> b3atr: why should a string containing a comma be empty?
<roychri> Papierkorb: Its most likely an array of CSV strings.
aegis3121 has quit [Ping timeout: 260 seconds]
<Papierkorb> Thank god we have a CSV parser library in the standard distribution
amclain has joined #ruby
<[k-> Papierkorb: that's what I meant, sorry for the ambiguity
<b3atr> roychri: delete_if(&:empty) does the trick ;D
Vingador has joined #ruby
duderonomy has quit [Ping timeout: 244 seconds]
deadprez has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
deadprez has joined #ruby
<roychri> b3atr: Is it an array of CSV lines? If so, like Papierkorb suggest, use CSV parser.
<Papierkorb> b3atr: watch out though, #delete_if is destructive. #reject is not.
<roychri> oh yeah, reject would be betta!
sai_ has quit [Read error: Connection reset by peer]
Vingador has quit [Remote host closed the connection]
<roychri> Thanks Papierkorb
<b3atr> Papierkorb: ok
sai_ has joined #ruby
<b3atr> thanks for helping me :D
<Papierkorb> what do you need it for?
nikivi has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
blandflakes has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
Rodya_ has joined #ruby
<roychri> It must be top secret :-p
mikecmpb_ has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
nowhereFast has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nowhereFast has quit [Remote host closed the connection]
tyang has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
pochoa has quit [Ping timeout: 264 seconds]
jsrn_ has quit [Read error: Connection reset by peer]
Madplatypus has quit [Quit: Connection closed for inactivity]
pochoa has joined #ruby
LoneHermit has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
flying has quit []
jhack has joined #ruby
nitric has joined #ruby
Fernando-Basso has joined #ruby
Vingador has joined #ruby
mikecmpb_ has quit [Quit: inabit. zz.]
Lucky_ABA has joined #ruby
hhfemh has quit [Remote host closed the connection]
danostrowski has joined #ruby
glcx has quit [Quit: Quitte]
LoneHermit has quit [Ping timeout: 265 seconds]
bmurt has joined #ruby
hutch34_ has joined #ruby
pandaant has quit [Remote host closed the connection]
spudowiar has quit [Quit: gtg]
edwinvdgraaf has joined #ruby
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
cyphase has quit [Ping timeout: 250 seconds]
Snowy has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
Snowy has joined #ruby
pochoa has quit [Ping timeout: 276 seconds]
synruby has quit [Ping timeout: 276 seconds]
sai__ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
PersonaSound has joined #ruby
pawnbox has joined #ruby
sai_ has joined #ruby
Snowy has quit [Remote host closed the connection]
<PersonaSound> anyone know any good beginner resources such as pdfs and whatnot
cyphase has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
<roychri> PersonaSound: You mean like https://www.codecademy.com/learn/ruby and http://tryruby.org/ ?
AlexRussia has quit [Ping timeout: 265 seconds]
<PersonaSound> mainly looking for some ebooks if theyŕe available
sai_ has quit [Read error: Connection reset by peer]
<roychri> free or paid?
daivyk has joined #ruby
<PersonaSound> paid is free for me, either is fine
sai_ has joined #ruby
<[k-> ?books
BrianJ has quit [Quit: Textual IRC Client: www.textualapp.com]
<[k-> what's up with this!
<roychri> broken bot!
sai_ has quit [Read error: Connection reset by peer]
<PersonaSound> ty
sai_ has joined #ruby
kevin has joined #ruby
ruby_ has quit [Remote host closed the connection]
sai_ has quit [Read error: Connection reset by peer]
cyphase has quit [Ping timeout: 260 seconds]
sai_ has joined #ruby
Guest3871 has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
sai__ has joined #ruby
Guest3871 has quit [Remote host closed the connection]
dviola has joined #ruby
olistik has quit [Remote host closed the connection]
morfin has joined #ruby
cyphase has joined #ruby
claudiuinberlin has quit []
sai__ has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
marxarelli has joined #ruby
AlexRussia has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
conta has quit [Ping timeout: 252 seconds]
sai_ has joined #ruby
pochoa has joined #ruby
jgt has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
sai__ has joined #ruby
sai_ has joined #ruby
sai__ has quit [Read error: Connection reset by peer]
rodfersou|lunch is now known as rodfersou
JeanCarloMachado has quit [Quit: leaving]
Silthias has quit [Ping timeout: 264 seconds]
cheshyre has joined #ruby
vdamewood has quit [Quit: Life beckons.]
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
cyphase has quit [Ping timeout: 255 seconds]
ruby_ has joined #ruby
A124 has quit [Quit: '']
d0nn1e has quit [Ping timeout: 244 seconds]
aegis3121 has joined #ruby
A124 has joined #ruby
d0nn1e has joined #ruby
cyphase has joined #ruby
sai_ has joined #ruby
sai__ has quit [Read error: Connection reset by peer]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bjh13 has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
aegis3121 has quit [Ping timeout: 276 seconds]
chouhoulis has joined #ruby
d0nn1e has quit [Ping timeout: 252 seconds]
einarj has quit [Remote host closed the connection]
einarj has joined #ruby
cheshyre has left #ruby ["Textual IRC Client: www.textualapp.com"]
\13k_ has joined #ruby
Rodya_ has joined #ruby
tvon has quit [Quit: Peace out, y'all!]
gregf_ has quit [Quit: leaving]
zeroDi has joined #ruby
eizua has quit [Remote host closed the connection]
d0nn1e has joined #ruby
nikivi has quit [Quit: irc]
einarj has quit [Ping timeout: 250 seconds]
firstdayonthejob has joined #ruby
nankyokusei has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
cyphase has quit [Ping timeout: 265 seconds]
blaxter has quit [Quit: foo]
jgt has quit [Ping timeout: 240 seconds]
zipace has quit [Ping timeout: 250 seconds]
Ishido has quit [Ping timeout: 255 seconds]
nankyokusei has quit [Ping timeout: 276 seconds]
cyphase has joined #ruby
vuoto has joined #ruby
_djbkd has joined #ruby
duderonomy has joined #ruby
hk238 has quit [Read error: Connection reset by peer]
tvon has joined #ruby
rippa has joined #ruby
LastWhisper____ has joined #ruby
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
jhack has quit [Quit: jhack]
Agent001 has quit [Read error: Connection reset by peer]
bigkevmcd has quit [Quit: Outta here...]
hakunin has joined #ruby
BlkDynmt has quit [Quit: BlkDynmt]
symm- has joined #ruby
ramfjord has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Ishido has joined #ruby
SeepingN has joined #ruby
karmatr0n has quit [Ping timeout: 265 seconds]
Cohedrin has joined #ruby
spudowiar has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
hk238 has joined #ruby
Ishido has quit [Remote host closed the connection]
Ishido has joined #ruby
maokomioko has joined #ruby
devbug has joined #ruby
AustinMatherne has quit [Remote host closed the connection]
marxarelli has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AustinMatherne has joined #ruby
rcvalle has joined #ruby
TeresaP has joined #ruby
<TeresaP> Hey there. I want to do File.directory?("/Users/username/folder_that_doesnt_exist") and have it return true but then ile.directory?("/Users/username/somefile.ext") would return false. Is there a way to do something like that? File.directory? seems to need the path to exist already but I just want to know if the syntax of the string indicates it is a directory.
Jamo has quit [Ping timeout: 244 seconds]
Jamo has joined #ruby
<[k-> you can't really tell from a string whether it indicates a directory or not unless it ends with a /
deadprez has quit [Remote host closed the connection]
<TeresaP> Well what if it was just that after the last slash there was not a period?
<TeresaP> and we strip off the last / first
<[k-> there could be files that have no extensions
gingray has quit [Ping timeout: 250 seconds]
<[k-> hidden folders also start with a period
<TeresaP> OK, maybe I can check first to see if the File.file?
<[k-> You can even name directories something
<TeresaP> If false, then proceed to chomp the slash, then check for period
<[k-> something.exe* and have it work
claudiuinberlin has joined #ruby
aegis3121 has joined #ruby
deadprez has joined #ruby
<TeresaP> I'm writing a test tool where I want to make sure the user passes in a directory but that directory doesn't have to exist
<[k-> what are you trying to do exactly?
<TeresaP> ^ :)
PersonaSound has quit [Ping timeout: 276 seconds]
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.2 Aria]
<[k-> check if it's an existing file then
<[k-> if it isn't, then you can stop right there already, job finished
cyphase has quit [Ping timeout: 250 seconds]
TPug has joined #ruby
<[k-> directories can be named what files can be named so there's no point really
<toretore> (Maybe(directory?) || !file?) == !file
<TeresaP> The user might be trying to pass in "/Some/Path/ThatDoesntExist/filename.ext"
<TeresaP> And get confused when a directory is created
<toretore> the actual problem probably lies elsewhere if you have logic like this
<TeresaP> I'm just doing some simple checks before running the rest of the code
<toretore> why?
<toretore> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<TeresaP> Because it's confusing if they call this method and a folder is created
<TeresaP> Sigh.
kevin has quit [Quit: Leaving]
<TeresaP> Usually there is a simple solution
hahuang61 has joined #ruby
<TeresaP> Sounds like right now there isn't. And I did list my problem
<[k-> You can use File.extname to get the extension
<toretore> there is no actual solution to what you want, so you have to change the underlying assumptions
<TeresaP> Ooh, good point [k-
<TeresaP> I can just check to see if that's an empty string
<TeresaP> Thank you
cyphase has joined #ruby
heelpmeplz has quit [Quit: Leaving]
deadprez has quit [Remote host closed the connection]
deadprez has joined #ruby
sai__ has quit [Remote host closed the connection]
<TeresaP> toretore all I need to do is check if File.file?(...) is true or File.extname(...).eql?("") is false
maokomioko has quit [Quit: Textual IRC Client: www.textualapp.com]
<toretore> your assumptions are still wrong
<[k-> But... what about hidden directories?
marxarelli has joined #ruby
<TeresaP> I don't think my users will pass in hidden directories
flashpoint9 has quit [Remote host closed the connection]
<TeresaP> I can understand that being a use case though
flashpoint9 has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
<[k-> toretore is righ
tdy has quit [Ping timeout: 276 seconds]
<TeresaP> But I believe if it's a hidden directory, it will still save to it?
<TeresaP> It'll just be hard to find if they're not showing hidden directories
<toretore> you won't ever have a correct solution to this problem, which means you have to rethink the underlying assumptions
<TeresaP> In any case, my users would really just mess up and pass in a filename instead of a directory name so that's what I'm basically guarding against
<TeresaP> This satisfies my requirements
<[k-> sounds like apple
<TeresaP> Yes we use macs
jenrzzz has quit [Ping timeout: 240 seconds]
<[k-> Return us our freedom!
<TeresaP> haha
AlexRussia has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
al2o3-cr has quit [Ping timeout: 250 seconds]
deadprez has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
flashpoint9 has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
Guest42974 has quit [Ping timeout: 244 seconds]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BlkDynmt has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
jhack has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
firstdayonthejob has quit [Quit: WeeChat 1.5]
replay has joined #ruby
TeresaP has quit [Quit: Page closed]
flashpoint9 has joined #ruby
firstdayonthejob has joined #ruby
deadprez has joined #ruby
tdy has joined #ruby
dionysus69 has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
flashpoint9 has quit [Remote host closed the connection]
edwinvdgraaf has quit [Read error: Connection reset by peer]
flashpoint9 has joined #ruby
edwinvdgraaf has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
swills has quit [Quit: Leaving]
flashpoint9 has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
Rodya_ has joined #ruby
BTRE has quit [Ping timeout: 244 seconds]
omphe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cyphase has joined #ruby
AlexRussia has joined #ruby
sai_ has joined #ruby
BTRE has joined #ruby
Ipe_ has quit [Quit: Konversation terminated!]
ec0 has joined #ruby
LoneHerm_ has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
swills has joined #ruby
tyang has joined #ruby
LoneHerm_ has quit [Ping timeout: 250 seconds]
Ipe_ has joined #ruby
conta has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
BlkDynmt has quit [Quit: BlkDynmt]
sai_ has joined #ruby
tyang_ has joined #ruby
robfrawley has joined #ruby
robfrawley is now known as Guest15639
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ayv26 has joined #ruby
mwlang has quit [Quit: mwlang]
\13k_ has quit [Quit: Textual IRC Client: www.textualapp.com]
\13k_ has joined #ruby
pawnbox_ has joined #ruby
LastWhisper____ has joined #ruby
LastWhisper____ has quit [Read error: Connection reset by peer]
\13k_ has quit [Client Quit]
pawnbox has quit [Ping timeout: 240 seconds]
\13k_ has joined #ruby
ayv26 has quit [Client Quit]
tyang has quit [Ping timeout: 255 seconds]
\13k_ has quit [Client Quit]
dmr8 has joined #ruby
\13k_ has joined #ruby
\13k_ has quit [Client Quit]
charliesome has joined #ruby
pawnbox_ has quit [Ping timeout: 244 seconds]
lalalaaa has joined #ruby
<lalalaaa> Hi! Anybody know why I can ping google.com but not rubygems.org?
miqlas-H has joined #ruby
miqlas-H has quit [Client Quit]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
miqlas-H has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
pawnbox has joined #ruby
pwnd_nsfw has joined #ruby
flashpoint9 has joined #ruby
cdg has quit [Remote host closed the connection]
symm- has joined #ruby
naftilos76 has joined #ruby
Robtop__ has quit [Ping timeout: 250 seconds]
<toretore> lalalaaa: why are you pinging rubygems.org?
alfiemax has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
LUMIA930 has joined #ruby
finisherr has joined #ruby
ekinmur has joined #ruby
ec0 has quit [Ping timeout: 240 seconds]
cyphase has quit [Ping timeout: 264 seconds]
Ipe has joined #ruby
b3atr has quit [Ping timeout: 240 seconds]
spudowiar has quit [Quit: gtg]
pawnbox has quit [Ping timeout: 255 seconds]
Ipe_ has quit [Ping timeout: 252 seconds]
b3atr has joined #ruby
ur5us has joined #ruby
bsrd has joined #ruby
bmurt has joined #ruby
cyphase has joined #ruby
jenrzzz has quit [Quit: Lost terminal]
AzureStigma has quit [Quit: Textual IRC Client: www.textualapp.com]
catphish has joined #ruby
flashpoint9 has joined #ruby
BTRE has quit [Quit: Leaving]
<roychri> lalalaaa: Some servers (load balancer, firewalls, etc..) disables the ICMP port, preventing to have a pong response to our ping requests.
<catphish> burn them
symm- has quit [Ping timeout: 244 seconds]
JackMc is now known as magic
symm- has joined #ruby
naftilos76 has quit [Quit: Αποχώρησε]
Lucky_ABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n1cky has quit [Read error: Connection reset by peer]
n1cky has joined #ruby
<catphish> i have some questions about string operations and performance, first of all what would be the fastest way to split a string into string[0..-512] and string[-511..-1]
aegis3121 has quit [Ping timeout: 240 seconds]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb> catphish: if you need to split the string at all, that's probably as fast as it will get. How large is the string?
TPug has joined #ruby
futilegames has joined #ruby
aegis3121 has joined #ruby
<catphish> Papierkorb: its 1MB, i fear that string[0..-512] would be a huge copy operation
<Papierkorb> catphish: you're correct
<Papierkorb> what are you building that needs to shovel a 1meg string (binary data?)
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<catphish> maybe truncate will cut the end off efficiently
kirun has joined #ruby
ec0 has joined #ruby
tdy has quit [Ping timeout: 260 seconds]
<catphish> perhaps if i paste my code, it will better explain what i'm doing, basically gsubbing a stream
<Papierkorb> catphish: yes, paste on gist.github.com please
symm- has quit [Ping timeout: 244 seconds]
BlkDynmt has joined #ruby
omphe has joined #ruby
<catphish> i'll just comment it, one moment
<Papierkorb> catphish: String#chop! looks like it's basically just setting the new string length, but that might (?) entail an internal realloc(), not sure about ruby internas
al2o3-cr has joined #ruby
BTRE has joined #ruby
Rodya_ has joined #ruby
lightheaded has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 264 seconds]
<catphish> the aim is to efficiently gsub a stream of binary data
lightheaded has joined #ruby
<catphish> it works well as-is, but i'm keen to really maximize performance as this code makes up a pretty substantial portion of my server load :)
stamina has joined #ruby
nankyokusei has joined #ruby
hakunin has quit [Remote host closed the connection]
spider-mario has joined #ruby
<Papierkorb> catphish: So it's basically a stream editor aka sed?
hakunin has joined #ruby
<catphish> Papierkorb: yes, i suppose it is
<catphish> i hadn't thought of it that way
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb> catphish: I may not completely understand the ideas, but first thing coming to mind is that you could use an array of strings as buffer, instead of a huge single string
LoneHermit has joined #ruby
<Papierkorb> if you need to do operations on those strings, if at all, it should be faster already. Make sure though to benchmark these approaches using "benchmark"
<catphish> Papierkorb: the main problem is that it's possible something you want to replace spans between 2 input strings
Rodya_ has quit [Ping timeout: 250 seconds]
<catphish> (since the input is in random chunks)
futilegames has quit [Quit: futilegames]
teclator has joined #ruby
cyphase has joined #ruby
ldnunes has quit [Quit: Leaving]
johnmilton has quit [Remote host closed the connection]
<Papierkorb> Correct
last_staff has joined #ruby
lightheaded has quit [Ping timeout: 255 seconds]
zipace has joined #ruby
nankyokusei has quit [Ping timeout: 265 seconds]
<Papierkorb> catphish: If the number of replacements is static and they're strings, you could make sure the buffer doesn't end with one of those strings
Lucky_ABA has joined #ruby
<catphish> that sounds extensive in itself, because it could end at any point in the replacement :(:
<catphish> * :(
sai_ has quit [Read error: Connection reset by peer]
b3atr has quit [Ping timeout: 255 seconds]
AbstractArtist has joined #ruby
foooobear has quit [Quit: (null)]
sai_ has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
<Papierkorb> catphish: Mh... sorry, don't have time atm to help right now, gtg
<catphish> i guess i should just play with benchmark
<catphish> Papierkorb: thanks for your help anyway!
dionysus69 has quit [Remote host closed the connection]
<aegis3121> So doing some work, and I've found that 3.fdiv(0) returns Float::INFINITY. I would have expected a ZeroDivisionError
<aegis3121> Can anyone help me understand why?
teclator has quit [Ping timeout: 276 seconds]
hakunin has quit [Remote host closed the connection]
<catphish> the source code at http://apidock.com/ruby/Fixnum/fdiv offers some ideas, but but a quick answer
dionysus69 has joined #ruby
<catphish> *but not
ftshtw has joined #ruby
dionysus69 has quit [Client Quit]
<aegis3121> Hey thanks, didn't help Iw as looking at Numeric not Fixnum
<catphish> i've never understood the purpose of Float::INFINITY, i can't imagine how this result is ever useful in a mathematical situation
<aegis3121> I suppose it's good for a max value for maps, graphs, etc...
sai_ has quit [Read error: Connection reset by peer]
<catphish> unfortunately i dont' know what any of those C mathods and macros actually do
<catphish> so i can't be much more help
sai_ has joined #ruby
<catphish> >> 1.0 / 0.0
<ruby[bot]> catphish: # => Infinity (https://eval.in/639060)
Lucky_ABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlexRussia has quit [Ping timeout: 276 seconds]
kanobt61 has quit [Read error: Connection reset by peer]
<catphish> i assume it has something to do with the lack of precision in floating point, but given that 0.0 == 0, it seems silly
<catphish> its a good question
pawnbox has joined #ruby
<AbstractArtist> 0.0 != 0
<catphish> >> 0.0 == 0
<ruby[bot]> catphish: # => true (https://eval.in/639061)
mrgrieves has joined #ruby
<AbstractArtist> false
AbstractArtist has left #ruby [#ruby]
snockerton has joined #ruby
AbstractArtist has joined #ruby
<catphish> AbstractArtist: welcome back
<AbstractArtist> thank you
<catphish> AbstractArtist: i'm kinda inclined to agree with you, but i dont really know how 0.0 is represented
<aegis3121> >> 0.0.zero?
<ruby[bot]> aegis3121: # => true (https://eval.in/639062)
<catphish> i'd have thought 0 was quite easy to represent in any system
<catphish> except roman numerals
<AbstractArtist> its the point your supposed to represent
SteenJobs has joined #ruby
<AbstractArtist> call it pixel point magic
<catphish> where does the point go i wonder :)
kanobt61 has joined #ruby
siovene has joined #ruby
<catphish> i should probably learn about floating point one day, but i avoid it wherever possible
<AbstractArtist> no need to rush
cyphase has quit [Ping timeout: 276 seconds]
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
blandflakes has joined #ruby
zekriad has joined #ruby
ixti has quit [Ping timeout: 250 seconds]
sai_ has quit [Read error: Connection reset by peer]
<baweaver> Zero easy to represent in any system? Sounds like someone's getting close to mZero
BlkDynmt has quit [Quit: BlkDynmt]
alfiemax has quit [Ping timeout: 255 seconds]
sai_ has joined #ruby
AlexRussia has joined #ruby
replay has quit [Ping timeout: 276 seconds]
deadprez has quit [Remote host closed the connection]
shinnya has joined #ruby
deadprez has joined #ruby
cyphase has joined #ruby
jhack has quit [Quit: jhack]
hahuang61 has joined #ruby
n1cky has quit [Remote host closed the connection]
flashpoi_ has joined #ruby
JeanCarloMachado has joined #ruby
jazzonmym1nd has joined #ruby
<baweaver> catphish: If you want to blow your mind on polymorphism in a different context ^
futilegames has joined #ruby
chrisdav6 has quit [Quit: Ex-Chat]
flashpoint9 has quit [Ping timeout: 244 seconds]
deadprez has quit [Ping timeout: 240 seconds]
hahuang61 has quit [Ping timeout: 250 seconds]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
deadprez has joined #ruby
ctp has joined #ruby
mrgrieves has quit [Ping timeout: 240 seconds]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
omphe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kobain has joined #ruby
AlexRussia has quit [Ping timeout: 250 seconds]
bsrd has quit [Quit: WeeChat 1.5]
ixti has joined #ruby
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
cyphase has quit [Ping timeout: 265 seconds]
omphe has joined #ruby
cyphase has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
stamina has quit [Ping timeout: 250 seconds]
ctp has quit [Ping timeout: 250 seconds]
ag4ve_ has joined #ruby
ag4ve_ has quit [Max SendQ exceeded]
ag4ve_ has joined #ruby
AbstractArtist has quit []
JoshS has quit [Quit: Leaving]
etetz has quit [Remote host closed the connection]
saneax is now known as saneax-_-|AFK
ftshtw_ has joined #ruby
cdg has joined #ruby
deadprez has quit [Remote host closed the connection]
ftshtw_ has quit [Client Quit]
ftshtw has quit [Ping timeout: 240 seconds]
Vingador has quit [Ping timeout: 240 seconds]
Lucky_ABA has joined #ruby
ekinmur has quit [Quit: Textual IRC Client: www.textualapp.com]
Fernando-Basso has quit [Quit: Leaving]
deadprez has joined #ruby
Synthead has joined #ruby
futilegames has quit [Quit: futilegames]
BlkDynmt has joined #ruby
jhack has joined #ruby
lightheaded has joined #ruby
kith has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
elifoster has joined #ruby
minotep has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
omphe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<al2o3-cr> hey, TIL Ruby ships with levenshtein distance in rubygems & didyoumean :)
<catphish> its hard to miss didyoumean :)
Rodya_ has joined #ruby
Coldblackice has joined #ruby
jazzonmym11nd has joined #ruby
cyphase has joined #ruby
flashpoi_ has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ruby
bmurt has joined #ruby
jazzonmym1nd has quit [Ping timeout: 276 seconds]
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
replay has joined #ruby
marxarelli has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lightheaded has quit [Ping timeout: 255 seconds]
ur5us has quit [Remote host closed the connection]
michaeldeol has joined #ruby
michaeldeol has quit [Client Quit]
marxarelli has joined #ruby
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ruby-lang007 has joined #ruby
ruby-lang007 has quit [Client Quit]
ruby-lang175 has joined #ruby
<ruby-lang175> hi
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
conta has quit [Ping timeout: 244 seconds]
elementaru has quit [Read error: Connection reset by peer]
_djbkd has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<ruby-lang175> im still new with ruby... I've done applications in Rails before. but thats different.. I have a problem i need to solve in ruby.
<ruby-lang175> test
<ruby-lang175> err
ruby-lang175 has left #ruby [#ruby]
ruby-lang175 has joined #ruby
<ruby-lang175> test
<ruby-lang175> damit.. why is it not loggin me in
sai_ has quit []
_djbkd has joined #ruby
stamina has joined #ruby
dmr8 has quit [Quit: Leaving]
ixti has quit [Ping timeout: 240 seconds]
<roychri> ruby-lang175: What code do you have so far?
blandflakes has joined #ruby
blandflakes has quit [Client Quit]
pawnbox has joined #ruby
pochoa has quit [Ping timeout: 252 seconds]
cyphase has quit [Ping timeout: 250 seconds]
nanoz] has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
hahuang61 has joined #ruby
ivanskie has joined #ruby
ruby-lang175 has quit [Ping timeout: 264 seconds]
pochoa has joined #ruby
ivanskie has left #ruby [#ruby]
ivanskie has joined #ruby
<ivanskie> hi
synthroid has quit []
BlkDynmt has quit [Quit: BlkDynmt]
cyphase has joined #ruby
pawnbox has quit [Ping timeout: 264 seconds]
TPug has joined #ruby
<ivanskie> so i'm scratching my head here. I have a problem i need to solve. and im not sure which way to go about it. I have several csv files that i read. it is basically a log of a scan of every box of fruit going by a machine. so there's date, productid, and grower amongst the ones i really care about. so I read the csv files, and get them all into an array of hashes. https://gist.github.com/i5okie/04c9307774df84524cc2df8f87ca956b that has date
<ivanskie> I need to go over the data and print out: by unique date --> by unique Grower --> and then print a list of unique product ids with count
<ivanskie> right now i have a mini ruby app that goes over the csv files and prints counts of product ids..
blackgoat has joined #ruby
<ivanskie> now im just not sure how i should go about doing this new thing.. do I create an array of arrays with hashes with each date...
tyang_ has quit [Quit: Leaving]
<roychri> ivanskie: You could create a hash to keep track of every uniq type of values.
gnufied has quit [Ping timeout: 250 seconds]
<ivanskie> this would have been easier if i had orm to work with and a database but i dont atm..
JeanCarloMachado has quit [Quit: leaving]
<ivanskie> roychri: so right now im kind of confused about this "algorithm" thing. overall. so if you were to write this in english per steps... how would you do it?
<ivanskie> i think I can write the ruby code to do this.. but i'm not experienced enough to come up with an elegant logic.. lol
pochoa has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
Kyhz has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
daivyk has quit [Quit: Quit]
<ivanskie> updated my gist to include logic notes i have so far https://gist.github.com/i5okie/04c9307774df84524cc2df8f87ca956b
<toretore> ivanskie: you probably want to incrementally build a structure like this: {date1 => {grower1 => {product1 => count, product2 => count}, grower2 => {product1 => count}}, date2 => {grower1 => {product1 => count}}}
<toretore> then, for each line, step into the structure using the values until you get to the count
<ivanskie> that makes sense.
cyphase has quit [Ping timeout: 276 seconds]
<ivanskie> i don't know how to get to that
<ivanskie> my thinking at first was to go over the original data.. and have a separate array of arrays with key being date.. and say if date exists, append this row into the array under this date, if not, push the new date, and add the row under this key
<ivanskie> so then i'd have to go in and do the same with unique grower id..
<ivanskie> and products.. and eventually for produts..
<toretore> date, _, _, product, _, grower = '01/09/16,09:50:46,12,501,177,055'.split(','); dateh = structure[date] ||= {}; growerh = dateh[grower] ||= {}; growerh[product] = (growerh[product] || 0) + 1
kobain has joined #ruby
olistik has joined #ruby
jhooker has joined #ruby
<ivanskie> hm
_djbkd has quit [Remote host closed the connection]
ur5us has joined #ruby
cyphase has joined #ruby
BlkDynmt has joined #ruby
_djbkd has joined #ruby
olistik has quit [Remote host closed the connection]
edwinvdgraaf has quit [Remote host closed the connection]
spudowiar has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
_djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby
gnufied has joined #ruby
olistik has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pochoa has joined #ruby
ta_ has quit [Ping timeout: 264 seconds]
qubit77 has joined #ruby
nankyokusei has joined #ruby
ta_ has joined #ruby
<baweaver> Auto-vivification of hashes is a magical thing
<baweaver> >> h = Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }; h[1][2][3][4] = 5; h
<ruby[bot]> baweaver: # => {1=>{2=>{3=>{4=>5}}}} (https://eval.in/639099)
<baweaver> toretore / ivanskie ^
pochoa has quit [Ping timeout: 244 seconds]
LoneHerm_ has joined #ruby
minotep has quit [Quit: minotep]
<baweaver> date, _, _, product, _, grower = '01/09/16,09:50:46,12,501,177,055'.split(','); (structure[date][grower][product] ||= 0) += 1
nankyokusei has quit [Ping timeout: 240 seconds]
lightheaded has joined #ruby
kirun has quit [Quit: Konversation terminated!]
JoshS has joined #ruby
LoneHerm_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 250 seconds]
spiette has quit [Quit: :qa!]
cyphase has quit [Ping timeout: 264 seconds]
edwinvdgraaf has joined #ruby
tdy has joined #ruby
pochoa has joined #ruby
cyphase has joined #ruby
jenrzzz has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
Snowy has joined #ruby
Snowy has quit [Client Quit]
ngscheurich has quit [Ping timeout: 255 seconds]
marr has joined #ruby
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramortegui has quit [Remote host closed the connection]
neanderslob has joined #ruby
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
TPug has joined #ruby
heelpmeplz has joined #ruby
<heelpmeplz> I have a series of XML feeds named something like, "EUR_feed.xml", "USD_feed.xml", etc. Each feed contains prices for the same set of "item numbers", but corresponding to a different currency. I want to load all the data into a Hash that looks like products[itemno]["prices"][currency] . Is there a way I can loop over each feed, populating the Hash as I go? I can declare the "products" before the loop, but the keys for
<heelpmeplz> each itemnumber are not present in the Hash after the loop runs (products is still empty). Is there a way to do this without running the loop twice (once to collect the item numbers so I can create the keys, and another to populate those keys)?
Ipe has quit [Read error: Connection reset by peer]
JoshS has quit [Quit: Leaving]
cyphase has quit [Ping timeout: 250 seconds]
gagrio has quit [Quit: Leaving...]
<heelpmeplz> I don't know what the item numbers are (to create the itemnumber keys) until I process each feed. However, if I create those keys while I am looping through each feed, I still have an empty "products" Hash when the loop exits. This is a fairly simple question, hopefully someone can help.
nadir has quit [Quit: Connection closed for inactivity]
pochoa has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 260 seconds]
<baweaver> Step back and take a look at the problem. You know you have one hash
cyphase has joined #ruby
<heelpmeplz> Yes, I do know that.
<baweaver> Now, is there a way in which you can set a hash key to another hash?
stamina has quit [Ping timeout: 255 seconds]
<baweaver> What about if you want to check whether or not it exists as a key first?
<heelpmeplz> huh?
biberu has quit []
a1fa has left #ruby [#ruby]
<baweaver> How do you set a value on a hash?
<heelpmeplz> you assign a value to a key of that hash
<baweaver> and if you want to only assign it if it does not exist yet?
<heelpmeplz> then I use ||=
<baweaver> good good
gnufied has quit [Ping timeout: 250 seconds]
<baweaver> Now then, as you're looping through all the fields you have the pieces that are `item_no` and `currency`
<heelpmeplz> I don't have trouble looping through the fields
<heelpmeplz> I am looping through each FILE
<heelpmeplz> as I loop through each FILE, I loop through each ITEM in the FILE
<baweaver> I'm aware.
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<heelpmeplz> I have to declare the Hash outside of these loops, but any new keys that are created in a loop are not reflected when the loop closes
<baweaver> So you have your one hash at the top of your code. You can check whether or not it has a value for the item number
deadprez has quit [Remote host closed the connection]
<heelpmeplz> It does not
<heelpmeplz> It wouldn't
workmad3 has joined #ruby
<baweaver> It does.
<heelpmeplz> it's an empty hash before the loops run
<baweaver> otherwise you're doing something odd.
<baweaver> do you have your code in a gist?
<baweaver> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
nadir has joined #ruby
<heelpmeplz> I don't know how to use gist, I'll put it in pastebin
<baweaver> the bot will complain
<aegis3121> there's a link. Right there.
<baweaver> heelpmeplz: Also, please choose a better name. The current one seems really bad.
al2o3-cr has joined #ruby
<baweaver> what do you suppose that might do?
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
gnufied has joined #ruby
bmurt has joined #ruby
<heelpmeplz> I don't know man, I can't find any obvious difference between those two pages
<baweaver> see line 18
<heelpmeplz> ok
<baweaver> what happens when the loop hits again?
<baweaver> same problem on line 48
<heelpmeplz> It empties the Hash. Obviously a bug. Then it goes on to run products[itemno]["prices"][currency] = price . It does this a billion times, then the loop finishes, and I am left with the problem I originally described, of having an empty hash
cyphase has quit [Ping timeout: 250 seconds]
<heelpmeplz> My question is simple. I'm not trying to "debug" a compiler error, I'm just asking why my hash is empty at the end and how I can fix it. It appears that because the empty hash is created outside the loop, it is accessible outside the loop. However, the keys and their associated data/hashes are not saved when the loop exits.
deadprez has joined #ruby
<heelpmeplz> It's just a simple question about how to populate a hash
coolboy has quit [Ping timeout: 240 seconds]
<baweaver> See comment
<heelpmeplz> ok man, thanks for all the help
<baweaver> Oh they are.
ahuman has quit [Ping timeout: 240 seconds]
SteenJobs has joined #ruby
cyphase has joined #ruby
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[k- has quit [Ping timeout: 244 seconds]
ahuman has joined #ruby
<heelpmeplz> guess you come here and roll the dice, today's just not my day. I'll just ugly up the code and make it work because I have no other options after wasting so much of my time. I'm pretty sure anyone could have just answered my question, but it just wasn't meant to be apparently.
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver> It was answered.
d0nn1e has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ruby
<baweaver> and unless you excluded code it should be working as is.
<heelpmeplz> where
<heelpmeplz> where did you answer it
claudiuinberlin has quit []
jhooker has quit [Quit: Leaving]
jphase_ has joined #ruby
<baweaver> It also helps if you read the docs on YAML#dump
<baweaver> &ri YAML#dump
<`derpy> No results
<baweaver> &ri Yaml#dump
<`derpy> No results
<baweaver> hm.
<aegis3121> class method
[Butch] has quit [Quit: I'm out . . .]
<baweaver> The hash has data, you're just not doing anything to it.
vuoto has quit [Remote host closed the connection]
<baweaver> No need to be melodramatic in any case.
gnufied has quit [Ping timeout: 250 seconds]
jphase has quit [Ping timeout: 240 seconds]
<aegis3121> fwiw
<aegis3121> I think that's what you need to look at for .dump
rodfersou has quit [Quit: leaving]
* baweaver loses track of YAML libs
_djbkd has quit [Remote host closed the connection]
jphase_ has quit [Ping timeout: 264 seconds]
<heelpmeplz> Did I supposedly make some mistake with YAML.dump that this article would help me not to make in the future?
<baweaver> Take a look.
cyphase has quit [Ping timeout: 265 seconds]
lightheaded has quit [Remote host closed the connection]
nando293921 has joined #ruby
lightheaded has joined #ruby
ziprar has joined #ruby
zipace has quit [Disconnected by services]
<Batholith> I never remember what all these "fwiw" shortcuts and what not mean.
<aegis3121> Sorry, "for what it's worth"
raMp has joined #ruby
<aegis3121> that one is one of the few that I use a lot. Because that's a lot of words, and I'm a little lazy.
firstdayonthejob has quit [Ping timeout: 240 seconds]
SteenJobs has quit [Ping timeout: 252 seconds]
<Batholith> Maybe I'm just too old for all them hip shortcuts. But then again, I'm not even in my mid twenties.
pochoa has joined #ruby
LoneHerm_ has joined #ruby
TreyG has joined #ruby
_djbkd has joined #ruby
raMp has quit [Client Quit]
<heelpmeplz> ok, I looked. Not sure what the point was. I'm definitely done with all the 20 questions and trying to guess what error people think they see in my code. I asked for help, some advice was supposedly given, and the code was supposedly fine, but now I'm being asked to view the YAML help files, as though I didn't know how to use YAML.dump (pretty sure I do)? Thank you for trying to help me, I think we must be on very different
<heelpmeplz> pages here, to the point where it's not worth trying to sort out. Thanks for trying to help.
pawnbox has joined #ruby
lightheaded has quit [Ping timeout: 255 seconds]
cyphase has joined #ruby
<baweaver> read the docs Luke
<baweaver> reeeeead the docs
<heelpmeplz> bro I f***ing read it
<baweaver> (hint: no, you don't know how to use it)
<heelpmeplz> what is it you think I didn't read?
aidalgol has joined #ruby
<baweaver> Line 25
aegis3121 has quit [Ping timeout: 264 seconds]
<baweaver> What does YAML dump do?
<heelpmeplz> It encodes a string in YAML format
<baweaver> and returns a string
olistik has quit [Remote host closed the connection]
<heelpmeplz> I guess it would...
LoneHerm_ has quit [Ping timeout: 276 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
TreyG_ has joined #ruby
last_staff has quit [Quit: last_staff]
NightMonkey has quit [Ping timeout: 244 seconds]
heelpmeplz has quit [Quit: Leaving]
ziprar has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 265 seconds]
TreyG has quit [Ping timeout: 244 seconds]
AndrewIsHere has joined #ruby
pokalyis has joined #ruby
jphase has joined #ruby
TreyG has joined #ruby
nitric has quit [Ping timeout: 240 seconds]
TreyG_ has quit [Ping timeout: 265 seconds]
spudowiar has quit [Quit: zzZZZzzzZZzZzZzzzzzZz]
TreyG_ has joined #ruby
TreyG has quit [Ping timeout: 264 seconds]
ruby-lang215 has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
god is now known as nchambers
Kyhz has quit [Ping timeout: 260 seconds]
NightMonkey has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
banisterfiend has joined #ruby
TreyG has joined #ruby
ledestin has joined #ruby
sepp2k has quit [Quit: Leaving.]
cyphase has joined #ruby
zekriad has quit [Quit: Textual IRC Client: www.textualapp.com]
TreyG_ has quit [Ping timeout: 250 seconds]
MrBusiness has quit [Read error: Connection reset by peer]
statelesscode has joined #ruby
agent_white has quit [Quit: brb]
zekriad has joined #ruby
flashpoint9 has joined #ruby
TreyG_ has joined #ruby
siovene has quit [Quit: Connection closed for inactivity]
hutch34_ has quit [Ping timeout: 255 seconds]
TreyG has quit [Ping timeout: 244 seconds]
TreyG has joined #ruby
devbug has quit [Read error: Connection reset by peer]
ruby-lang215 has quit [Ping timeout: 264 seconds]
TreyG_ has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
solocshaw has quit [Remote host closed the connection]
TreyG_ has joined #ruby
TreyG has quit [Ping timeout: 244 seconds]
[k- has joined #ruby
tdy has quit [Quit: tdy]
symm- has joined #ruby
TreyG has joined #ruby
deadprez has quit [Remote host closed the connection]
BlkDynmt has quit [Quit: BlkDynmt]
devbug has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
TreyG_ has quit [Ping timeout: 255 seconds]
flashpoint9 has quit [Remote host closed the connection]
TreyG_ has joined #ruby
cdg has quit [Remote host closed the connection]
TreyG has quit [Ping timeout: 265 seconds]
cdg has joined #ruby
snockerton has quit [Quit: Leaving.]
BlkDynmt has joined #ruby
jobewan has quit [Ping timeout: 240 seconds]
elifoster has quit [Ping timeout: 265 seconds]
nankyokusei has joined #ruby
cdg has quit [Ping timeout: 244 seconds]
blackmesa has joined #ruby
pochoa has quit [Ping timeout: 260 seconds]
pochoa has joined #ruby
gingray has joined #ruby
LoneHermit has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
TreyG has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LoneHermit has quit [Ping timeout: 276 seconds]
TPug has joined #ruby
TreyG_ has quit [Ping timeout: 265 seconds]
astrobun_ has joined #ruby
ruby_ has quit []
TreyG_ has joined #ruby
flashpoint9 has joined #ruby
deadprez has joined #ruby
TreyG has quit [Ping timeout: 276 seconds]
Linell has joined #ruby
neanderslob has quit [Ping timeout: 244 seconds]
TreyG has joined #ruby
TreyG_ has quit [Ping timeout: 252 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
deadprez has quit [Ping timeout: 250 seconds]
astrobu__ has joined #ruby
spider-mario has quit [Remote host closed the connection]
TreyG_ has joined #ruby
MrBusiness has joined #ruby
TreyG has quit [Ping timeout: 276 seconds]
al2o3-cr has quit [Ping timeout: 250 seconds]
dreamyspell has quit [Quit: Leaving]
astrobun_ has quit [Ping timeout: 255 seconds]
TreyG has joined #ruby
SteenJobs has joined #ruby
TreyG_ has quit [Ping timeout: 276 seconds]
_djbkd has quit [Quit: My people need me...]
gheegh has joined #ruby
TreyG_ has joined #ruby
deadprez has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
TreyG has quit [Ping timeout: 276 seconds]
jhack has quit [Quit: jhack]
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
TreyG has joined #ruby
pochoa has quit [Ping timeout: 260 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
cyphase has joined #ruby
TreyG_ has quit [Ping timeout: 276 seconds]
TreyG_ has joined #ruby
TreyG has quit [Ping timeout: 250 seconds]
blackmesa has quit [Quit: WeeChat 1.5]
pawnbox has joined #ruby
Vingador has joined #ruby