j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nux443 has quit [Ping timeout: 246 seconds]
Limix has quit [Ping timeout: 250 seconds]
Azure has quit [Ping timeout: 250 seconds]
helpa has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
Limix has joined #ruby
bsdbofh has joined #ruby
ecnalyr has quit [Remote host closed the connection]
juanpablo_ has joined #ruby
christiandsg has quit [Remote host closed the connection]
helpa has joined #ruby
Lucky__ has joined #ruby
Azure has joined #ruby
allcentury has quit [Ping timeout: 252 seconds]
roxtrong_ has joined #ruby
jxpx777 has joined #ruby
Limix has quit [Ping timeout: 250 seconds]
juanpablo_ has quit [Ping timeout: 240 seconds]
paulcsmith has joined #ruby
jtdoncas has joined #ruby
paulcsmith has quit [Client Quit]
Limix has joined #ruby
nux443 has joined #ruby
Vile` has quit [Ping timeout: 246 seconds]
Vile` has joined #ruby
petricore has quit [Ping timeout: 240 seconds]
donske has joined #ruby
donske has quit [Max SendQ exceeded]
UtkarshRay has joined #ruby
Limix has quit [Ping timeout: 265 seconds]
bkxd has quit [Ping timeout: 245 seconds]
Limix has joined #ruby
helpa has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bb010g has joined #ruby
workmad3 has joined #ruby
saddad has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
sdfgsdfg has joined #ruby
j_mcnally has joined #ruby
m3ow1504_x has quit [Read error: Connection reset by peer]
fast_scooter has quit [Quit: fast_scooter]
workmad3 has quit [Ping timeout: 245 seconds]
m3ow1504_x has joined #ruby
millerti has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
nettoweb has joined #ruby
chouhoul_ has quit [Ping timeout: 240 seconds]
roxtrong_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mistermocha has joined #ruby
nux443 has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
nettoweb has quit [Client Quit]
nettoweb has joined #ruby
nettoweb has quit [Client Quit]
Porfa has joined #ruby
amystephen has quit [Quit: amystephen]
tkuchiki has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Porfa has quit [Client Quit]
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermo_ has quit [Read error: Connection reset by peer]
sargas has joined #ruby
mistermocha has joined #ruby
Limix has quit [Quit: Limix]
bkxd has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
rdark has quit [Ping timeout: 272 seconds]
mistermo_ has quit [Read error: Connection reset by peer]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has joined #ruby
freerobby has quit [Quit: Leaving.]
jtdoncas has quit [Ping timeout: 246 seconds]
GarethAdams has quit [Ping timeout: 256 seconds]
bruno- has joined #ruby
bsdbofh has quit [Quit: bsdbofh]
j_mcnall_ has joined #ruby
j_mcnally has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
mistermo_ has joined #ruby
mistermocha has quit [Ping timeout: 252 seconds]
bkxd has quit [Ping timeout: 255 seconds]
mistermo_ has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
malconis has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
malconis has quit [Client Quit]
GarethAdams has joined #ruby
Pupeno has quit [Ping timeout: 260 seconds]
nux443 has joined #ruby
saddad has joined #ruby
mistermocha has quit [Remote host closed the connection]
nux443 has quit [Ping timeout: 250 seconds]
Synthead has quit [Disconnected by services]
Synthbean has joined #ruby
bronson has joined #ruby
juanpablo_ has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
nux443 has joined #ruby
juanpablo_ has quit [Ping timeout: 240 seconds]
bsdbofh has joined #ruby
devoldmx has joined #ruby
bsdbofh has quit [Client Quit]
devoldmx has quit [Ping timeout: 255 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
exadeci has quit [Quit: Connection closed for inactivity]
Torrieri has quit [Quit: Be back later ...]
yfeldblum has quit [Ping timeout: 246 seconds]
j_mcnall_ has quit [Read error: Connection reset by peer]
j_mcnally has joined #ruby
linuxboytoo has quit [Quit: Leaving...]
braincrash has quit [Quit: bye bye]
saddad has quit [Quit: WeeChat 1.3-dev]
ramfjord has quit [Ping timeout: 265 seconds]
psy_ has quit [Ping timeout: 240 seconds]
grenierm has quit [Quit: grenierm]
banjara has joined #ruby
Pumukel has joined #ruby
baweaver has joined #ruby
n_blownapart has joined #ruby
braincrash has joined #ruby
bkxd has joined #ruby
_djbkd has quit [Remote host closed the connection]
auzty has joined #ruby
lukebyrne has joined #ruby
nux443 has quit [Ping timeout: 255 seconds]
startupality has quit [Quit: startupality]
theery has joined #ruby
ecnalyr has joined #ruby
nux443 has joined #ruby
Yzguy has joined #ruby
Yzguy has quit [Client Quit]
rubie has quit [Remote host closed the connection]
banjara has quit [Quit: Leaving.]
rubie has joined #ruby
lipoqil has joined #ruby
ecnalyr has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby
faces has quit [Ping timeout: 256 seconds]
rubie has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
theery has quit [Remote host closed the connection]
lipoqil has quit [Ping timeout: 264 seconds]
yeticry has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
yeticry has joined #ruby
dgutierrez1287 has quit [Ping timeout: 265 seconds]
rubie has joined #ruby
nzst has joined #ruby
nux443 has quit [Ping timeout: 260 seconds]
nzst has quit [Ping timeout: 265 seconds]
rubie has quit [Remote host closed the connection]
wagnerrn has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sargas has quit [Quit: This computer has gone to sleep]
face has joined #ruby
bronson has quit [Remote host closed the connection]
wagnerrn has left #ruby [#ruby]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<pontiki>
Ox0dea: did you get an answer to: < Ox0dea> Which is smaller, a Muckenseckel or an RCH?
The_Phoenix has joined #ruby
<Ox0dea>
pontiki: I did not. Do you have some insight into the matter?
Vile` has quit [Ping timeout: 265 seconds]
craysiii has quit [Remote host closed the connection]
RobertGladdenKKK has joined #ruby
<pontiki>
none whatsoever. i'm not even googling those terms
<Ox0dea>
Not unwise, really.
darkf has joined #ruby
Vile` has joined #ruby
<RobertGladdenKKK>
are we allowed to recruit developers here?
last_staff has joined #ruby
sargas has joined #ruby
nux443 has joined #ruby
solocshaw has quit [Ping timeout: 246 seconds]
solocshaw has joined #ruby
nofxx has quit [Ping timeout: 244 seconds]
crdpink has quit [Ping timeout: 246 seconds]
crdpink2 has joined #ruby
UtkarshRay has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
jeadre has quit [Remote host closed the connection]
bazbing80 has joined #ruby
grenierm has joined #ruby
nux443 has quit [Ping timeout: 255 seconds]
jeadre has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
nux443 has joined #ruby
chipotle has joined #ruby
theery has joined #ruby
<baweaver>
!mute RobertGladdenKKK
symm- has joined #ruby
ylg has quit []
workmad3 has quit [Ping timeout: 246 seconds]
<pontiki>
what a strange question using that nick
* baweaver
shrugs
maletor has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<Radar>
Googling for that name turns up bad results.
<baweaver>
Saw KKK and kiwiirc, good enough for me.
nux443 has quit [Ping timeout: 264 seconds]
AlexAltea has joined #ruby
lukebyrne has quit [Quit: lukebyrne]
Torrieri has joined #ruby
Torrieri has joined #ruby
<bazbing80>
Does anyone know how RSpec gets the description of a matcher? Somewhere in rspec-core there must be a place where rpsec utilises a matcher and then "quieries" the matcher's description method. Does anyone know where this would be?
chipotle has quit [Ping timeout: 240 seconds]
<baweaver>
could ask on the rspec channel
AccordLTN has quit [Ping timeout: 246 seconds]
nofxx has joined #ruby
<bazbing80>
It must .call the proc that's sent to it in an it{} or specify{}
<Radar>
helpa now no longer runs inside a screen session
theery has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 244 seconds]
Pupeno has quit [Ping timeout: 244 seconds]
Salehi has joined #ruby
rushed has joined #ruby
juanpablo_ has quit [Ping timeout: 252 seconds]
devoldmx has joined #ruby
lemur has joined #ruby
christiandsg has joined #ruby
jerin has joined #ruby
jerin has left #ruby [#ruby]
hashrocket has quit [Quit: Connection closed for inactivity]
devoldmx has quit [Ping timeout: 252 seconds]
lemur has quit [Ping timeout: 246 seconds]
<pontiki>
:)
bkxd has joined #ruby
RobertBirnie has joined #ruby
maletor has joined #ruby
wldcordeiro__ has joined #ruby
Salehi has quit [Remote host closed the connection]
craysiii has joined #ruby
leafybasil has quit [Remote host closed the connection]
theery has joined #ruby
leafybasil has joined #ruby
<Ox0dea>
helpa: !home
m3ow1504_x has quit [Read error: Connection reset by peer]
m3ow1504_x has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lipoqil has joined #ruby
riotjones has joined #ruby
<shevy>
helpa versus ruboto - the ultimate showdown
opensource_ninja has joined #ruby
fantazo has quit [Ping timeout: 246 seconds]
Vile` has quit [Read error: Connection reset by peer]
lipoqil has quit [Ping timeout: 245 seconds]
christiandsg has quit [Remote host closed the connection]
PaulCape_ has joined #ruby
ohaibbq has joined #ruby
riotjones has quit [Ping timeout: 252 seconds]
Vile` has joined #ruby
<shevy>
ewwww... /usr/bin/makeinfo is a perl script
tmtwd has joined #ruby
PaulCapestany has quit [Ping timeout: 246 seconds]
<shevy>
quite a lot of legacy scripts out there necessary for compilation, if only they would have used ruby
PaulCapestany has joined #ruby
theery has quit [Remote host closed the connection]
<Ox0dea>
~ $ file -L /bin/* | grep -ci perl
<Ox0dea>
52
dagda1 has joined #ruby
<Ox0dea>
Only 10 for Ruby. :(
yashinbasement has joined #ruby
Vile` has quit [Ping timeout: 245 seconds]
PaulCape_ has quit [Ping timeout: 240 seconds]
Vile` has joined #ruby
lavros has quit [Quit: leaving]
lavros has joined #ruby
rubie has joined #ruby
Salehi has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<shevy>
old sysadmins are so lazy
<nahtnam>
Is there a way to say "or nil"?
<nahtnam>
Like `deaths = stats["total_deaths"]`
<nahtnam>
sometimes total_deaths doesnt exist
<nahtnam>
so I want to set deaths to nil
jxpx777 has joined #ruby
<Ox0dea>
nahtnam: That's exactly what that line does?
ohaibbq_ has joined #ruby
<nahtnam>
Ox0dea: It throws an error if it doesnt exist
<Ox0dea>
Nope.
<nahtnam>
NoMethodError: undefined method `/' for nil:NilClass
<nahtnam>
oops
<Ox0dea>
Then you don't actually want to set `deaths` to nil.
<nahtnam>
one sec
<nahtnam>
For something like this: `time_played = stats["total_time_played"] / 3600 || nil`
<nahtnam>
(remove the || nil, was just trying it out)
ohaibbq has quit [Ping timeout: 244 seconds]
<nahtnam>
it throws a no method error because im dividing
<nahtnam>
I dont want it to thrown an error
<nahtnam>
just set itself to nil
<nahtnam>
so the json can render after that without the app throwing a 500
jxpx777 has quit [Ping timeout: 255 seconds]
<Ox0dea>
nahtnam: Convention favors using #try from ActiveSupport.
jpfuentes2 has joined #ruby
<nahtnam>
So I need to make a try for every single variable? I have like 30
<Ox0dea>
Abstraction time!
Fezzler has joined #ruby
<Ox0dea>
Then again, #try really is the right abstraction already.
maletor has quit [Quit: Computer has gone to sleep.]
<nahtnam>
Hm, ok. Thanks for your help
nzst has joined #ruby
<Ox0dea>
nahtnam: Sure thing. `time_played = stats["total_time_played"].try(:/, 3600)` really isn't that bad, but if you're "massaging" ~30 variables, there are things you could do from space.
banjara has joined #ruby
<nahtnam>
> there are things you could do from space.
<nahtnam>
?
<shevy>
nahtnam in this case perhaps you don't need to set a variable
<shevy>
I assume that stats is the hash that already has the information
<nahtnam>
Hm, so let me give some background on my app
<nahtnam>
The Steam api is *horrible*
<nahtnam>
and ember is very sensitive
<shevy>
ewww
<nahtnam>
so I have to convert the horrible api to a nice one that ember can use
psy has quit [Disconnected by services]
banjara has quit [Client Quit]
<Ox0dea>
nahtnam: An "architecture astronaut" is said of somebody who over-abstracts things.
<nahtnam>
and the worst part is that steam returns an array, and each array is different for each user
hyy1 has joined #ruby
<Ox0dea>
I was suggesting you might do something like creating a massaging lambda for each of the keys.
<Ox0dea>
Then your transformation code could just be `var_hash.map { |v| massagers[v][v] }` or some such.
<nahtnam>
Not sure how to do that, and also for each weapon, I need to add a custom name manually
<shevy>
nahtnam just make it readable whatever they return
<nahtnam>
Thats the part where I manually define each weapon name
<shevy>
so you return the results as json?
<Ox0dea>
Yikes.
nzst has quit [Ping timeout: 256 seconds]
Fezzler has quit [Quit: Leaving]
<Ox0dea>
Why do you suppose you need all these local variables?
<nahtnam>
shevy: Yep
<nahtnam>
Ox0dea: Keep things clean
<nahtnam>
and readable. Does it slow things down?
nux443 has quit [Ping timeout: 250 seconds]
jpfuentes2 has quit [Ping timeout: 252 seconds]
<Ox0dea>
You're just shoving them into an Array and sorting, so I don't understand why they need identifiers, especially given that their names are right their in the Hash.
hyy1 has quit [Ping timeout: 252 seconds]
<Radar>
there*
<Radar>
:D
<Ox0dea>
...?
<Ox0dea>
Oh, wow.
<Radar>
"right their in the Hash."
<Ox0dea>
Jesus.
Salehi has quit [Remote host closed the connection]
<nahtnam>
Ox0dea: Because "elite" is not a gun, "taser" is not a weapon "hkp2000" is not a gun
<Ox0dea>
Radar: Savor this moment. :P
<Radar>
Oh I am.
sdothum has quit [Ping timeout: 265 seconds]
<Ox0dea>
nahtnam: I'm not sure I follow.
sevenseacat has joined #ruby
<baweaver>
Ox0dea: QFT + Linked in my quotes log
<nahtnam>
You said the names are given in the hash, but some of the gun names are wrong
<baweaver>
:D
jpfuentes2 has joined #ruby
bkxd has quit [Quit: Lost terminal]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
baweaver lol
keen___________6 has quit [Read error: Connection reset by peer]
<shevy>
so it will remain messy because irrelevant over whether you store it in local variable, or try to access it directly, you need to obtain the information; you can try to find some way that gives you the proper weapon types though, based on analyzing your calls to:
<shevy>
nova = {:name => "Nova", :kills => stats["total_kills_nova"]}
workmad3 has joined #ruby
<shevy>
so at least the last part always is 'total_kills_'+downcased_name
<nahtnam>
Yeah, cuz p2k and usps are both ctpistols
<Ox0dea>
nahtnam: But do you see how it's pointless to make that distinction and then throw it away immediately?
<nahtnam>
(their stats are combined)
<nahtnam>
Yeah, but how else do I store the info?
<shevy>
I notice a silence :)
workmad3 has quit [Ping timeout: 265 seconds]
<nahtnam>
So the best solution I can think of is just to have a large switch statement and create a rails model for the stats. Then let each element of the array go through the switch statement and insert itself appropriately. https://gist.github.com/nahtnam/55084d0a31e27ab03120
<Ox0dea>
I'm trying to see if there's some clever way to dynamically generate these names.
grenierm has quit [Quit: grenierm]
<nahtnam>
Ox0dea: Is there a way to make a "map" or something?
charliesome has quit [Client Quit]
<Ox0dea>
nahtnam: That's... what Hash does?
quazimodo has quit [Ping timeout: 246 seconds]
<shevy>
hmm
<baweaver>
what madness is this?
<baweaver>
shevy: wood you care to explain?
freezevee has joined #ruby
charliesome has joined #ruby
<shevy>
nahtnam you could generate the regular names, and then add exceptions for the non-regular ones; and perhaps just put it into a class too
<shevy>
baweaver I think it is some steam game or something and he is fetching some headshot stats or so
<ruboto>
nahtnam # => undefined method `[]' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/424533)
<nahtnam>
Ox0dea:
<baweaver>
hehehe
<baweaver>
I see it
arup_r has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
<sevenseacat>
so do i
<baweaver>
|k,v| won't work there
<baweaver>
I wonder why
<Ox0dea>
Oh, right. I forgot it was an Array. :/
yeticry has quit [Read error: Connection reset by peer]
<nahtnam>
.to_h?
<baweaver>
2 for 2 Ox0dea :D
<Ox0dea>
nahtnam: Nah, just nix the `_, `.
<shevy>
not his day
<Ox0dea>
Valuable commentary is valid.
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jeadre has quit [Remote host closed the connection]
nux443 has joined #ruby
<baweaver>
Sorry, just being snarky over here :D
<Ox0dea>
I still think Hash's yield semantics are wonky.
<nahtnam>
Awesome, finally works. Now what about the other stuff? Is there a smart way to thow away the nils? One problem I keep having is when running `wlr = (wins.to_f / losses.to_f).round(2)` and (wins.to_f/losses.to_f) returns nil, it throws an error
freezevee has quit [Read error: Connection reset by peer]
<Ox0dea>
You really do want #try, mate.
<nahtnam>
<Ox0dea>
It's that or conditional chains.
<sevenseacat>
you want to think about your problems before you ask how to solve them
jeadre has joined #ruby
<baweaver>
I wonder what || does
<Ox0dea>
It certainly doesn't save one from NoMethodErrors.
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<baweaver>
orly?
<Ox0dea>
Nor does it seem to be the case that nahtnam wants to shove zeroes in to keep his data uniform.
dagda1_ has joined #ruby
<nahtnam>
Its highly unlikely that any of these are nil, but I have seen it happen with total_kills, so I just wanna be safe...
<sevenseacat>
"highly unlikely" == "its still gonna happen sometimes so your code better account for it"
<wasamasa>
KINGSABRI: this is not about people themselves, this is about communication with whatever you call "hackers"
diegoaguilar has quit [Remote host closed the connection]
<KINGSABRI>
it's premative page,, communication between hackers is about ideas
<wasamasa>
good luck with that if you can't even get english right :P
<KINGSABRI>
I've met a lot of ppl this year in blackhat and defcon ,, many of them not English native and they have english worst than mine, but they are great
Gnomethrower has joined #ruby
bruno- has joined #ruby
<KINGSABRI>
wasamasa: tell russians and chines that ;)
<wasamasa>
KINGSABRI: I am from the ukraine, thank you
<Ox0dea>
What's with `.` being executed 10 times, though?
<Ox0dea>
Should be 8?
gibre has quit [Quit: Leaving]
neanderslob has quit [Read error: Connection reset by peer]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aidanharris1 has quit [Read error: Connection reset by peer]
face has joined #ruby
dgutierrez1287 has quit [Ping timeout: 252 seconds]
faces has quit [Ping timeout: 246 seconds]
jimms has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 244 seconds]
faces has joined #ruby
faces has quit [Client Quit]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
face has quit [Ping timeout: 260 seconds]
lipoqil has joined #ruby
stamina has joined #ruby
Pupeno has joined #ruby
yfeldblum has joined #ruby
leat1 has quit [Remote host closed the connection]
m3ow1504_x has quit [Read error: Connection reset by peer]
m3ow1504_x has joined #ruby
leat1 has joined #ruby
mrtg9970 has quit [Remote host closed the connection]
jimms has joined #ruby
Voker57 has joined #ruby
bluish has quit [Quit: WeeChat 1.2]
lkba_ has quit [Ping timeout: 250 seconds]
pandaant has joined #ruby
arooni-mobile has quit [Ping timeout: 246 seconds]
grenierm has joined #ruby
rushed has joined #ruby
johnflux has quit [Remote host closed the connection]
jimms_ has joined #ruby
KINGSABRI has joined #ruby
michael_mbp has quit [Excess Flood]
workmad3 has joined #ruby
michael_mbp has joined #ruby
jimms has quit [Ping timeout: 260 seconds]
yfeldblu_ has joined #ruby
workmad3 has quit [Ping timeout: 265 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
catoblepa has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nzst has joined #ruby
tsujp has joined #ruby
sevenseacat has quit [Quit: .]
bkxd has joined #ruby
stardiviner has quit [Ping timeout: 250 seconds]
bkxd has quit [Client Quit]
fantazo has quit [Ping timeout: 260 seconds]
drunkdad has joined #ruby
timonv has quit [Ping timeout: 272 seconds]
nzst has quit [Ping timeout: 246 seconds]
bladiebla has joined #ruby
bladiebla has left #ruby [#ruby]
jxpx777 has joined #ruby
r0x0rZ has quit []
jxpx777 has quit [Read error: Connection reset by peer]
stamina has quit [Ping timeout: 264 seconds]
DLSteve has joined #ruby
bronson has joined #ruby
devoldmx has joined #ruby
tno has quit [Ping timeout: 246 seconds]
ghr has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
krz has joined #ruby
devoldmx has quit [Ping timeout: 252 seconds]
startupality has joined #ruby
PaulCape_ has joined #ruby
ghr has quit [Ping timeout: 240 seconds]
PaulCapestany has quit [Ping timeout: 240 seconds]
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
ndrei has quit [Ping timeout: 272 seconds]
juanpablo_ has joined #ruby
Alina-malina has joined #ruby
KINGSABRI has quit [Remote host closed the connection]
juanpablo_ has quit [Ping timeout: 244 seconds]
yashinbasement has quit [Quit: Leaving]
Musashi007 has quit [Quit: Musashi007]
ecnalyr has joined #ruby
Musashi007 has joined #ruby
Musashi007 has quit [Client Quit]
ecnalyr has quit [Ping timeout: 250 seconds]
BackEndCoder has quit [Ping timeout: 245 seconds]
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
houhoulis has quit [Remote host closed the connection]
workmad3 has joined #ruby
BackEndCoder has joined #ruby
rushed has quit [Quit: rushed]
codenapper has joined #ruby
<apeiros>
:-O
<apeiros>
chanserv! that sneaky bastard!
<apeiros>
steals jhass' wizard hat!
<adaedra>
apeiros used substitute
workmad3 has quit [Ping timeout: 240 seconds]
<Ox0dea>
I like shorts.
PaulCape_ has quit [Ping timeout: 240 seconds]
m3ow1504_x has quit [Read error: Connection reset by peer]
PaulCapestany has joined #ruby
m3ow1504_x has joined #ruby
keen___________7 has joined #ruby
<siaw>
hello Rubyists, this piece works in ruby ‘Array.new(3) { rand(100) }’
keen___________6 has quit [Ping timeout: 260 seconds]
<siaw>
now, what can i do to make sure an object accepts a block in Ruby?
<jhass>
an object doesn't, a method does
<adaedra>
methods accept blocks
<siaw>
how can i ask Array, hey Array, do you accept blocks? is this possible?
codenapper has quit [Ping timeout: 256 seconds]
<jhass>
for .new you should look at the corresponding #initilize's docs
<siaw>
ok. so how do i ask a method if it accept blocks?
<jhass>
it's usually documented
<jhass>
for core and stdlib methods at least
<siaw>
jhass: how do i find that?
<jhass>
look at the docs
<jhass>
ruby-doc.org
<jhass>
ri, your local rdocs, devdocs.io, rubydoc.info, whatever you're fancy
<apeiros>
somebody up for some community work for #ruby?
<apeiros>
we need a section in ruby-community.com which is behind a login using github accounts
<jhass>
(you should mention what it'd be)
<apeiros>
jhass: fo reel?
<adaedra>
apeiros: devise!
<apeiros>
adaedra: I hear you volunteer? :D
<jhass>
yah, u slow typer
<siaw>
jhass: thank you
<apeiros>
jhass: I just got up!
<pawnbox>
:D
<adaedra>
apeiros: #ruby-community
<apeiros>
sure
Kallis has joined #ruby
<pawnbox>
apeiros: sure i got some time.
<jhass>
pawnbox: please join #ruby-community too ;)
roxtrongo has quit [Remote host closed the connection]
yfeldblu_ has quit [Read error: Connection reset by peer]
<apeiros>
oh dear…
<apeiros>
updating everything to ruby 2.2.3 :D
tsujp has quit [Quit: tsujp is snoozing]
m3ow1504_x has quit [Read error: No route to host]
m3ow1504_x has joined #ruby
codenapper has joined #ruby
charliesome has joined #ruby
m3ow1504_x has quit [Client Quit]
yfeldblum has joined #ruby
nux443 has joined #ruby
tkuchiki has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
bkxd has joined #ruby
<al2o3-cr>
Is #!/usr/bin/env ruby -rjson -rnokogiri legit?
<jhass>
kinda, though I'd prefer require "json"; require "nokogiri" below
<adaedra>
I think some system don't support shebangs with more than one argument
<jhass>
can we call that hashbang please btw?
siaw has quit [Quit: siaw]
<al2o3-cr>
So explicitly calling require better
<al2o3-cr>
Seems fair
<al2o3-cr>
adaedra: ok cheers
yfeldblu_ has joined #ruby
AccordLTN has quit []
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
allcentury has joined #ruby
bkxd has quit [Quit: leaving]
yfeldblum has quit [Ping timeout: 246 seconds]
riotjones has joined #ruby
Kallis has quit [Read error: Connection reset by peer]
<al2o3-cr>
Can someone explain to me how this works ~/$/
riotjones has quit [Ping timeout: 264 seconds]
<al2o3-cr>
Is it a shorcut for $_.size?
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AccordLTN has joined #ruby
<Ox0dea>
Indeed it is.
UtkarshRay has joined #ruby
<Ox0dea>
~ with no LHS matches against $_ and returns the index at which it matched, and /$/ just matches the end of the string.
<al2o3-cr>
Ox0dea: but the former doesn't count \n right?
<Ox0dea>
That's true.
sdothum has joined #ruby
<al2o3-cr>
Ok, thanks Ox0dea
<Ox0dea>
Sure thing.
<Ox0dea>
al2o3-cr: Did you encounter that in the wild?
<al2o3-cr>
Yeah, looking at some code golf :)
dgutierrez1287 has joined #ruby
<Ox0dea>
I should perhaps clarify that it wasn't quite correct to refer to an LHS at all; it's just an invocation of Regexp#~, which has a rather special default definition.
devsh has joined #ruby
<Ox0dea>
jhass: "Shebang" is off-limits now?
Cust0sLim3n has quit [Ping timeout: 252 seconds]
<jhass>
I'm just asking
<Ox0dea>
But why even bother?
<wasamasa>
I dunno, but hashbang made more sense to me
<jhass>
hashbang just makes so much more sense to me and the reasons for using/coming up for shebang I can come up with are not pretty...
<Papierkorb>
has nothing to do with 'she' and 'bang'
<Ox0dea>
jhass: There is a trove of historical precedent on this matter.
<wasamasa>
it's an abbreviation for shell?
<Papierkorb>
shebang is perfectly fine, if you're offended, you chose to be so yourself
dgutierrez1287 has quit [Ping timeout: 246 seconds]
gizmore has joined #ruby
Cust0sLim3n has joined #ruby
<wasamasa>
is pound-bang even more offensive?
<Ox0dea>
jhass: Why are you fine with preserving the "bang" bit? Doesn't that have the potential to offend the asexual?
<Papierkorb>
^
<jhass>
gosh, it was a question, no need to troll me
<Ox0dea>
I think you were trolling in asking it.
catoblepa has quit [Ping timeout: 264 seconds]
<al2o3-cr>
Ox0dea: ah, ok
<Papierkorb>
"SJWs" already made the world a worse place. They don't want to discuss, only disrupt. By bowing down these trolls get what they wanted. And what did the Internet teach us? "Don't feed the trolls."
<bnagy>
oh fuck off
CloCkWeRX has joined #ruby
<bnagy>
I am not an SJW but the only time I ever hear the term is white male assholes trolling on social media
<wasamasa>
so, SJW means "person I'm not agreeing with"?
<al2o3-cr>
?ot
<ruboto>
this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<bnagy>
the world doesn't owe you a right to be an offensive asshole when you know it offends people
<al2o3-cr>
I wanted to that :)
<Papierkorb>
bnagy: Now you're assuming everyone is white and male. That's unfair.
<bnagy>
wrt shebang, that's the term I learnt like 25 years ago, but whatever, things change
<jhass>
Papierkorb: bnagy didn't mean to spawn that level of discussion here, please move it to -offtopic or your query
codecop has quit [Remote host closed the connection]
arup_r has quit [Ping timeout: 272 seconds]
patrick_star has quit [Ping timeout: 250 seconds]
iceyec has quit [Remote host closed the connection]
skade has joined #ruby
skade has quit [Client Quit]
workmad3 has joined #ruby
CloCkWeRX has joined #ruby
fantazo has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
nanoz has joined #ruby
arup_r has joined #ruby
ReK2 has quit [Ping timeout: 264 seconds]
siaw has quit [Quit: siaw]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
mprelude has joined #ruby
solocshaw has quit [Ping timeout: 264 seconds]
jimms has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
unrar has joined #ruby
<unrar>
Hello there
<mprelude>
Hey
siaw has joined #ruby
solocshaw has joined #ruby
<al2o3-cr>
o/
<unrar>
So I am working on this project that I just came up with, it probably already exists but yolo I think it's a relatively good idea
allcentury has joined #ruby
devoldmx has joined #ruby
<unrar>
The main idea is that it's a ruby sorta middleware for databases, you can write a JSON file which would be like a scheme of an API and then this middleware turns it into a real API
<unrar>
RESTful I guess,
<unrar>
Am I reinventing the wheel?
tsujp has quit [Quit: tsujp is snoozing]
tkuchiki has joined #ruby
<jhass>
I think I've seen that before, yeah
<wasamasa>
funny
<wasamasa>
I thought REST was for resources, not data
<unrar>
Actually I hate REST
fast_scooter has joined #ruby
<unrar>
lmao
<wasamasa>
which would inevitably lead to impedance mismatches once you go beyond basic CRUD
<unrar>
Well then I'm going to reinvent the wheel but nevermind because my wheel is going to be better
<wasamasa>
but if you're using your database just for CRUD instead of making the most of relations...
<unrar>
I've never done much Javascript or JSON so my JSON sucks tremendously but I guess it works
<mprelude>
I don't like rails much either.
pawnbox has quit [Ping timeout: 255 seconds]
<unrar>
The thing with Rails is that I get frustrated because I want to know exactly everything that's going on
<unrar>
That's why the (very few) web apps I do, I do in PHP lmao
roxtrongo has joined #ruby
<unrar>
hate me
fast_scooter has joined #ruby
<Zarthus>
php might not be the best language if you want to know what's going on ;)
eightfold has joined #ruby
al2o3-cr has quit [Ping timeout: 250 seconds]
<unrar>
I agree
<unrar>
but i also know what's not going on
<unrar>
i barely do web dev anyway
freezevee has joined #ruby
dgutierrez1287 has joined #ruby
roxtrongo has quit [Ping timeout: 250 seconds]
ghr has joined #ruby
centrx has joined #ruby
centrx has quit [Remote host closed the connection]
yfeldblu_ has quit [Ping timeout: 246 seconds]
Guest81018 has joined #ruby
stamina has joined #ruby
Guest81018 has quit [Client Quit]
devoldmx_ has quit [Ping timeout: 265 seconds]
sameerynho has joined #ruby
sankaber has joined #ruby
ghr has quit [Ping timeout: 246 seconds]
krz has quit [Ping timeout: 260 seconds]
lxsameer has quit [Ping timeout: 246 seconds]
The_Phoenix has quit [Ping timeout: 265 seconds]
<arup_r>
what is RMVC ?
<unrar>
some lame framework i started developing like two years ago
<arup_r>
R stands for ?
The_Phoenix has joined #ruby
<unrar>
the idea is to use the MVC architecture and some of the benefits of Rails like generators and migrations and stuff, but without a preference for web apps
<unrar>
ruby lmao
<unrar>
And the thing is that I tried to keep it simple so it's much more simple than Rails but it's still helpeful, that JSON API thing I'm doing with RMVC
<unrar>
i really have to change the models and views and controllers defaults and make them real objects rather than static classes because it looks so lame but meh it works
<sevenseacat>
"hate" is a very strong word. I think it implies misunderstanding.
dgutierrez1287 has quit [Ping timeout: 244 seconds]
<[k->
that's horrible, in my opinion
<nahtnam>
Then what should I do?
meatherly has quit []
<[k->
if win.nil? # abort
<apeiros>
you should think whether nil is a sensible value at any time
_mak has joined #ruby
<apeiros>
or whether there's a more sensible initial value
<_mak>
hi there
gamename has joined #ruby
<[k->
will Ruby 3 have option types?
<havenwood>
[k-: Use falseyness rather than explicit `nil` check.
<havenwood>
nil?*
<soahccc>
I just did something stupid but it raised a question. When I obj.extend(SomeModule) can SomeModule overwrite existing methods on obj?
<havenwood>
_mak: hi'
<_mak>
what could I use with ruby to login to my bank account and grab my balance? I was looking into capybara but it seems that it was meant to work with Rails only
<apeiros>
soahccc: extend is an operation on the ancestry of obj
<havenwood>
_mak: Considered mechanize?
<apeiros>
soahccc: so while it does not *overwrite* an existing method, it can put methods which are higher up in the inheritance chain and "shadow" existing methods
ngscheurich has joined #ruby
<apeiros>
soahccc: same as with class A < B, class A can shadow methods defined in B
<_mak>
havenwood: cool, I'll check it, thanks
mistermocha has quit [Read error: Connection reset by peer]
<soahccc>
apeiros: hmm okay. I extended MonitorMixin onto a queue and new_cond is giving me a mutex one :D
weemsledeux has joined #ruby
mistermocha has joined #ruby
stamina has quit [Ping timeout: 240 seconds]
pranny has joined #ruby
<rehat>
anyone know of a ruby gem that will move files from on directory to another and maintains the folder structure? So folder A has the same files as folder B but those files are in a different folder than they are in folder A
leat1 has quit [Remote host closed the connection]
sever2client has joined #ruby
sever2client has quit [Remote host closed the connection]
<havenwood>
rehat: How is that different from just moving files?
leat1 has joined #ruby
sever2client has joined #ruby
pyon has quit [Quit: brb]
modern has quit [Read error: Connection reset by peer]
<havenwood>
rehat: Have a little example?
<[k->
you might be overthinking with a tired mind
ngscheurich has quit [Ping timeout: 256 seconds]
pyon has joined #ruby
clarkenciel has joined #ruby
<rehat>
folder A -> Folder -> file A and I want to move do a move on folder A to folder B where folder B - Folder (differnt from folder A) -> file A
<rehat>
lol
dzejrou has joined #ruby
tmtwd has joined #ruby
sevenseacat has quit [Quit: .]
centrx has joined #ruby
<rehat>
I guess I would need to make a script that would take a file from Folder A and then find that same file in Folder B and replace it
jaequery has joined #ruby
<[k->
oh, you just want a symlink then?
chry has joined #ruby
<rehat>
nah no symlink from cp and replace
<[k->
it would be expensive to find the file with the same name and then replace it
<[k->
keeping an index of the file is better
<[k->
and you can replace it using that indeed
<[k->
imdex*
<rehat>
what do you mean by index?
<[k->
a cache
<[k->
our
<[k->
or* maybe that isnt the right term
Sembei has quit [Excess Flood]
Sembei has joined #ruby
northfurr has joined #ruby
timonv has quit [Ping timeout: 256 seconds]
JBrickley has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
northfurr has quit [Client Quit]
jamesaxl has joined #ruby
leafybasil has joined #ruby
devdazed has joined #ruby
rdark has joined #ruby
rdark has quit [Remote host closed the connection]
iateadonut has joined #ruby
joneshf-laptop has joined #ruby
JBrickley has joined #ruby
christiandsg has joined #ruby
<shevy>
[k- learn english!
UtkarshRay has joined #ruby
<[k->
(hint: you should have asked your question along these lines to help people understand you: i want to keep a file (the copy) in sync with another "master" file using Ruby. they are in different folders with the same filename. how would i go about doing that?)
<[k->
shevy: my English > your english
<[k->
i respected pronouns, case closed
leat1 has quit [Remote host closed the connection]
leat1 has quit [Remote host closed the connection]
Zackio has joined #ruby
nanoz has quit [Quit: <3]
christiandsg has quit [Remote host closed the connection]
rbennacer has joined #ruby
pyon has quit [Quit: fix config]
maletor has joined #ruby
Yzguy has joined #ruby
pawnbox has quit [Remote host closed the connection]
Vile` has joined #ruby
leat1 has joined #ruby
pawnbox has joined #ruby
zeroDivisible has joined #ruby
freerobby has joined #ruby
pyon has joined #ruby
chipotle has quit [Quit: cheerio]
<blokc>
@apeiros I couldn't find a way to procedurally call nested hash key references. I see that to call a nested key I call myhash[k1][k2], so how can I build that reference if in my recursive method I don't know the keys.
<blokc>
@[k-_ same question
leat1 has quit [Remote host closed the connection]
sever2client has quit [Remote host closed the connection]
timonv has joined #ruby
mistermocha has joined #ruby
<havenn>
blokc: Just a style thing but I'd probably: File.join(dir_path, to, '.yml')
<blokc>
that adds a dash between the file name and extension
<havenn>
blokc: oh, goodness, right
<havenn>
blokc: nevermind me
Musashi007 has quit [Quit: Musashi007]
<havenn>
blokc: What were you actually asking about originally?
<shevy>
lol
<blokc>
havenn: right, it was my meta programming struggle of translating strings in a deeply nested hash using the termit gem and keeping the structure.
<havenn>
blokc: ahh
UtkarshRay has quit [Quit: Leaving]
* havenn
goes in search of coffee
<blokc>
the application is to take a rails translation yaml file and convert it into whatever language codes I pass in.
<arup_r>
Can I pass operators using a variable like below ?
<blokc>
so en.yml would be es.yml if i ran `translate_yaml en es en.yml`.
<arup_r>
havenn: a + b is a syntactic sugar of a.+(b)
<havenn>
arup_r: Yeah, no macros in Ruby to create your own sugar in that fashion particularly.
Xiti has quit [Quit: Xiti]
<Papierkorb>
arup_r: try to avoid eval()
<arup_r>
I know..
<arup_r>
but it sometimes ..... wins .. I used it to here to show you people what I had in my mind
pandaant has quit [Remote host closed the connection]
<havenn>
arup_r: Matz had a short and a long answer to whether Ruby 3 will get macros. The short answer was, "No" and the long answer was "Absolutely no."
yfeldblum has joined #ruby
hotpancakes has joined #ruby
<Papierkorb>
Thank god
<arup_r>
haha.. Why he is against of it?
fedexo has quit [Ping timeout: 244 seconds]
<Papierkorb>
because macros are a bad idea whenever the language offers better alternatives
christiandsg has joined #ruby
fedexo has joined #ruby
<arup_r>
o i see
<Papierkorb>
Which ruby already does
<Papierkorb>
I mean you can fake it with eval. Which you should not, I mean, there's Object#send_public and friends
Xiti has joined #ruby
fantazo has quit [Ping timeout: 246 seconds]
<arup_r>
yeah
<Papierkorb>
Choose the most non-ugly solution to a problem ;) #send is uglier than #public_send is uglied than just calling the method
bluish has quit [Quit: WeeChat 1.2]
<havenn>
arup_r: If you'd like to see what macros might look like in a language quite similar to Ruby see Crystal-lang.
PaulCapestany has quit [Ping timeout: 260 seconds]
<shevy>
cool
tonios57 has joined #ruby
marr has joined #ruby
ramfjord has joined #ruby
skade has joined #ruby
bluish has quit [Quit: WeeChat 1.2]
dionysus69 has quit [Ping timeout: 252 seconds]
mistermo_ has quit [Read error: Connection reset by peer]
Vile` has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
vF3hNGxc47h8 has quit [Remote host closed the connection]
Pupeno has quit [Remote host closed the connection]
Waldo123 has joined #ruby
Waldo123 has quit [Client Quit]
ghr has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
podman has joined #ruby
mistermocha has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
The_Phoenix has quit [Read error: Connection reset by peer]
pauly_oc has quit [Ping timeout: 244 seconds]
sarkyniin has joined #ruby
d2dchat has joined #ruby
ghr has quit [Ping timeout: 260 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<Ox0dea>
That big-ass image on rubygems.org's 404 page is data-encoded...
Pupeno has joined #ruby
Pupeno has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<Papierkorb>
224.5KiB well spent
dionysus69 has joined #ruby
dh64 has quit [Ping timeout: 252 seconds]
<shevy>
you two are nerds
ebbflowgo has quit [Quit: ebbflowgo]
<Ox0dea>
It gets cached with the rest of the page's content, so it's not "bad" or anything; it's just weird they're not using a CDN. In any case, it's the largest data-encoded image I've ever run into in the wild.
Pupeno has quit [Remote host closed the connection]
freerobby has joined #ruby
<Papierkorb>
Ox0dea: actually, the only good part about that is saving a TCP ACK at best! The Base64 increases the file size to no avail
devdazed has joined #ruby
bronson has joined #ruby
<Ox0dea>
Well, a SYN, a SYNACK, and an ACK, but yeah.
<Ox0dea>
It's certainly unorthodox, but caching still manages to save the day.
ramfjord has quit [Ping timeout: 256 seconds]
cantaberry has quit [Ping timeout: 272 seconds]
<migimunz>
Ox0dea, thanks much!
christiandsg has quit [Remote host closed the connection]
<Ox0dea>
migimunz: Sure thing. I linked that mostly to illustrate that whitequark really knows this parsing shit. :P
<Ox0dea>
He's probably *the* person who best understands parse.y, excepting perhaps ko1 and nobu.
mistermocha has quit [Read error: Connection reset by peer]
jeadre has quit [Remote host closed the connection]
<[k-_>
hmmm /(?:(\(\W+\))[, ]{0,})+(?: ::.*)?/
zenspider has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
<shevy>
what are you trying to break now
<migimunz>
good to have a source, parsing and transforming ruby is tricky business
bronson has quit [Ping timeout: 252 seconds]
<migimunz>
Ox0dea, great fun though
<Ox0dea>
migimunz: Indeed it is. What're you up to, if you don't mind saying?
rbennacer has quit [Remote host closed the connection]
juanpablo_ has joined #ruby
jeadre has joined #ruby
dionysus69 has quit [Quit: dionysus69]
<migimunz>
Ox0dea, not at all, I want to add pattern matching (ML style) to ruby. It'd still be valid ruby code, but I want it to "compile" to efficient ruby in the background.
mrtomme has quit [Ping timeout: 264 seconds]
mrtomme has joined #ruby
<Ox0dea>
The lack of quotes around "efficient" is conspicuous.
<Ox0dea>
I take your meaning, of course. :P
<migimunz>
haha
<Ox0dea>
You've reminded me to look into whether or not stateless gensyms are feasible.
<migimunz>
but yeah, pattern matching can easily be translated into a bunch of assignments and conditionals, and will make code that deals with things like parsing or AST matching much easier to write
<migimunz>
Ox0dea, stateless as in completely pure?
<Ox0dea>
As I'm sure you're aware, several attempts have been made to bolt something akin to pattern matching onto Ruby, but optimizing the thing seems novel.
juanpablo_ has quit [Ping timeout: 240 seconds]
arup_r has quit [Quit: Leaving]
rbennacer has joined #ruby
<Ox0dea>
migimunz: Well, anything that would avoid having to ensure the symbol you've just generated is unique, I guess.
<migimunz>
Ox0dea, well, two major hurdles with implementing pattern matching: good error reporting and performance.
<migimunz>
oh, that sounds interesting, but seems like you'd either have to pass a generator that keeps the state or rely on an external state of some sort, at least if it's based on some pseudo-random generator
<migimunz>
which is I'm assuming exactly what you want to avoid
<Ox0dea>
Precisely. Atomic incrementation is pretty standard, and it works, but it's boring. :P
<Ox0dea>
There's something I slapped together a while back.
<Ox0dea>
It "works" by looking into VM bytecode instructions, but it's probably fragile as hell.
<migimunz>
oh awesome, let me check it out
Pumukel has quit [Ping timeout: 256 seconds]
<Ox0dea>
It's method overloading much more than it is pattern matching, but there's a certain overlap between the two.
<migimunz>
oh wow, this is pretty cool
ramfjord has joined #ruby
tmtwd has joined #ruby
ebbflowgo has joined #ruby
mistermo_ has joined #ruby
<Ox0dea>
I do like the visual cleanliness of hijacking default arguments, but... y'know, it's hijacking default arguments.
mistermocha has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
<migimunz>
that's true, but if you're doing pattern matching, then you don't really need default arguments for those methods
mistermo_ has quit [Read error: Connection reset by peer]
bluish has joined #ruby
mistermocha has joined #ruby
clarkenciel has joined #ruby
peteyg has quit [Ping timeout: 244 seconds]
hotpancakes has joined #ruby
bluish has quit [Client Quit]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 256 seconds]
PaulCapestany has joined #ruby
skyjumper has joined #ruby
cantaberry has joined #ruby
PaulCapestany has quit [Client Quit]
fantazo has joined #ruby
PaulCape_ has quit [Ping timeout: 265 seconds]
PaulCapestany has joined #ruby
cantaberry has quit [Remote host closed the connection]
atomical has joined #ruby
cantaberry has joined #ruby
Speed has joined #ruby
pranny has quit [Remote host closed the connection]
joast has quit [Quit: Leaving.]
bronson has joined #ruby
skyjumper has left #ruby [#ruby]
codecop has quit [Remote host closed the connection]
<IceDragon>
Gentlemen, and ladies, I require your assistance in parsing an AJAX response in ruby: sample %Q([,,"en",,,,0.16169573,,[["en"],,[0.16169573]]])
<IceDragon>
So far I've tried gsub-ing the commas to add nulls, to no avail
<Papierkorb>
JSON.parse
<IceDragon>
Won't parse correctly because of the multiple commas
<IceDragon>
YAML won't parse it either
<IceDragon>
correction: won't parse at all.
<Speed>
we tried gsubbing those consecutive commas to add 'null's, but it's hard to get it right
<jhass>
what is it supposed to be?
DLSteve has joined #ruby
<Papierkorb>
Why is the response so broken?
<IceDragon>
jhass: a response from google's translation api
<Speed>
it's an AJAX response that's returned from a web service
<jhass>
so XML?
<Speed>
it's javascript, and the webpage simply eval()'s it
<jhass>
(AJAX response doesn't define the content type these days)
<jhass>
ouch
<Speed>
([1,,,,] is completely valid JS)
<Speed>
indeed
<IceDragon>
jhass: sadly its valid JS, but invalid <insert every sane format here>
pawnbox has quit [Remote host closed the connection]
<Speed>
we'd like to fix it up into valid JSON and parse it
yeticry has quit [Ping timeout: 260 seconds]
<jhass>
doesn't sound like it's supposed to consumed as API though
<IceDragon>
you mean poke your eyes out afterwards
<Papierkorb>
Speed: that thing is broken as hell, and you're claiming consistency issues?
<IceDragon>
*may
ghr has joined #ruby
<unholycrab>
can i change which ruby is my system ruby?
willharrison has quit [Ping timeout: 252 seconds]
<unholycrab>
for example, use an rvm installed ruby as the system ruby?
<Papierkorb>
unholycrab: see tools like rvm or rbenv
<unholycrab>
Papierkorb: rvm allows me to set the default ruby for use with an interactive shell as a certain user, as far as i understand
<Papierkorb>
unholycrab: I'm not sure if that is a good idea. What's wrong with a user-local installation?
<Speed>
Papierkorb: I'm just saying that if the response is [origin_text, translated_text, language], sometimes translated_text would be nil, thus parsing the array would return us an array with two items. Considering I probably have origin, translation, language = [ary...], this would set translation = 'en'
<IceDragon>
unholycrab: you could try chruby as well?
<unholycrab>
Papierkorb: there are a lot of unknowns, and overwriting the system ruby would solve all of them
ghr has quit [Ping timeout: 246 seconds]
sargas has joined #ruby
<unholycrab>
im not sure if its a good idea, why its a bad idea, etc
<Papierkorb>
unholycrab: I'd argue that it would add another layer of hack onto the layers uncertainties, and a user-local one is a somewhat guaranteed non-hacky way of being certain of the ruby version
maletor has joined #ruby
<unholycrab>
its a virtual instance that will serve a rails application
<unholycrab>
and nothing else
<unholycrab>
it needs only one ruby
<unholycrab>
and it needs a specific version
<Papierkorb>
unholycrab: excellent use-case for a user-local installation
<toretore>
unholycrab: if it's a vm then just instll ruby globally without a version manager
<Papierkorb>
unholycrab: else, a system update may override your installation
<unholycrab>
toretore: can i specify a version for that
<unholycrab>
i see, Papierkorb
<toretore>
you can install whichever version you want wherever you want
<unholycrab>
then i just need to figure out what user will run the web server, and user-install it there
ndrei has quit [Ping timeout: 260 seconds]
<Papierkorb>
unholycrab: in fact, I'd completely remove the systems ruby installation if you don't need it elsewhere. Else, your server may not fail fast but fail later, making for fun debugging sessions
robbyoconnor has joined #ruby
<unholycrab>
yes
ndrei has joined #ruby
kaps has joined #ruby
sameerynho has quit [Quit: Leaving]
<unholycrab>
thank you Papierkorb, toretore
<unholycrab>
+ IceDragon
mbff has joined #ruby
<mbff>
Hello! I am trying to get back info from the newly created row. How can I do this? test = @db.execute( "insert into rappers (name,studioAlbums) values ('Kanye West', '8')")
<IceDragon>
yay + IceDragon :D
<mbff>
test returns empty brackets.
<mbff>
I am using SQLite3
<IceDragon>
mbff: re-read the row
<IceDragon>
or in this case: read the row
<mbff>
ok, but I am don't know which row the data was created to.
rbennacer has quit [Remote host closed the connection]
blueOxigen has quit [Ping timeout: 250 seconds]
<Speed>
mbff: insert into ... values ... returning id
<Speed>
then you can read the row with the same id
roxtrongo has joined #ruby
<mbff>
Speed, I am new to SQL, care to expand on that?
hostess has quit [Quit: No Ping reply in 180 seconds.]
<Speed>
ah sorry, I think RETURNING is a postgres thing
rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
<nofxx>
mbff, why write sql? use sequel or ar
radgeRayden has joined #ruby
asi_ has quit [Quit: No Ping reply in 180 seconds.]
solocshaw has joined #ruby
sarkyniin has quit [Ping timeout: 240 seconds]
Mendenhall has joined #ruby
rodfersou has joined #ruby
<mbff>
nofxx, just practice. What is AR?
AustinMatherne has quit [Ping timeout: 240 seconds]
<blokc>
active record
asi_ has joined #ruby
juanpablo_ has quit [Ping timeout: 252 seconds]
<mbff>
Oh right. I am taking a SQL/database class
<mbff>
My college is out of date.
northfurr has joined #ruby
torpig has quit [Ping timeout: 256 seconds]
voltalio has joined #ruby
voltalio has quit [Client Quit]
AustinMatherne has joined #ruby
voltalio has joined #ruby
<mbff>
the following is still not returning anything... any ideas before I head over to #SQL ? test = @db.execute( "insert into rappers (name,studioAlbums) values ('Kanye West', '8'); SCOPE_IDENTITY()")
<Papierkorb>
mbff: nothing wrong with learning SQL
ndrei has quit [Ping timeout: 250 seconds]
cornerma1 has joined #ruby
torpig has joined #ruby
mahlon has quit [Read error: Connection reset by peer]
ndrei has joined #ruby
rideh has quit [Ping timeout: 252 seconds]
cornerman has quit [Read error: Connection reset by peer]
cornerma1 is now known as cornerman
<ruurd>
HAhahaha. The nicest thing about SQL standards is that there are so many of them :-) :-)
jatb has quit [Ping timeout: 244 seconds]
ged has joined #ruby
mahlon has joined #ruby
rideh has joined #ruby
<mbff>
that is what i am quickly discovering.... first week of class, but I want to get ahead.
jalljo has quit [Ping timeout: 240 seconds]
ged__ has quit [Read error: Connection reset by peer]
<nofxx>
mbff, that's how I've discovered that I want to be a programmer hehe. Teacher gave us book 1-4 for the whole semester on tuesday. By friday I printed in finished 9
<nofxx>
pascal haha
cashnguns has joined #ruby
jalljo has joined #ruby
jatb has joined #ruby
<mbff>
nofxx, haha
Billias has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 256 seconds]
eightfold has quit [Ping timeout: 246 seconds]
mrtg9970 has joined #ruby
<nofxx>
fun fact about pascal, only lang I know that '=' means '=' (comparator). Assignment is x := 1 . Is there any other(s)?
ndrei has quit [Ping timeout: 256 seconds]
Musashi007 has joined #ruby
<ruurd>
Prolog uses :- for assign
mrtg9970 has quit [Client Quit]
<ruurd>
Yes a lot of languages are using 'is' for 'assign'... :-)
dzejrou_ has quit [Quit: dzejrou_]
<chris2>
same for all wirth languages
<chris2>
also algol
Mia has quit [Read error: Connection reset by peer]
Musashi007 has quit [Client Quit]
<nofxx>
is? x is 2; if x = 2 ?
<nofxx>
'is' reads better as '==' imo
Billias has joined #ruby
<nofxx>
x = 2 ; if x is 2 {}
<chris2>
valid python no? :P
rbennacer has quit [Remote host closed the connection]
PaulCape_ has joined #ruby
ndrei has joined #ruby
roxtrong_ has joined #ruby
northfurr has quit [Quit: northfurr]
PaulCapestany has quit [Ping timeout: 250 seconds]
mistermocha has quit [Ping timeout: 240 seconds]
northfurr has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
roxtrongo has quit [Ping timeout: 260 seconds]
weemsledeux has joined #ruby
ebbflowgo has joined #ruby
mistermocha has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
<shevy>
IceDragon are you still working on your game?
<IceDragon>
shevy: on and off
ebbflowgo has quit [Client Quit]
<IceDragon>
utterly wrecked the map editor after changing the rendering process
sargas has quit [Quit: This computer has gone to sleep]
zenguy_pc has joined #ruby
Fezzler has joined #ruby
<shevy>
hehehe
theery has joined #ruby
<IceDragon>
shevy: the woes of first time game programming
dgutierrez1287 has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mistermocha has quit [Read error: Connection reset by peer]
ebbflowgo has joined #ruby
theery has quit [Remote host closed the connection]
mistermocha has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has joined #ruby
DLSteve has quit [Quit: Leaving]
[k- has quit [Ping timeout: 246 seconds]
northfurr has quit [Quit: northfurr]
agent_white has joined #ruby
sargas has joined #ruby
sargas has quit [Remote host closed the connection]
<mbff>
Can I call a static method inside a static method of the same class?
Azure has joined #ruby
theery has joined #ruby
<jhass>
there are no static methods, so yes
<mbff>
self.methodName ?
<jhass>
just defined in another class ;)
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
northfurr has joined #ruby
theery has quit [Remote host closed the connection]
<jhass>
also I hope you don't really use camelCase for method names
<mbff>
nope
northfurr has quit [Client Quit]
noethics has joined #ruby
<ruurd>
mbff why not?
jmdade has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruurd>
I think he means class methods
<jhass>
which still are just normal methods, defined in a classes singleton class
<ruurd>
same difference.
lapide_viridi has joined #ruby
<ruurd>
if you flatten it hard enough everything is a jump.
mistermocha has quit [Ping timeout: 244 seconds]
<shevy>
hehe
<pontiki>
back to assembler for you!
Yzguy has quit [Quit: Zzz...]
rbennacer has joined #ruby
Fezzler has quit [Quit: Leaving]
mistermocha has joined #ruby
northfurr has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
Musashi007 has quit [Quit: Musashi007]
theery has joined #ruby
Mia has joined #ruby
Rickmasta has quit [Ping timeout: 244 seconds]
Rickmasta has joined #ruby
workmad3 has joined #ruby
doublemalt_ has joined #ruby
kaps has left #ruby [#ruby]
theery has quit [Remote host closed the connection]
theery has joined #ruby
bb010g has joined #ruby
Jackneill has quit [Ping timeout: 250 seconds]
jgt1 has quit [Ping timeout: 265 seconds]
DoubleMalt has quit [Ping timeout: 244 seconds]
Mia has quit [Read error: Connection reset by peer]
NeverDie has joined #ruby
mbff has quit [Remote host closed the connection]
zenspider has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
northfurr has quit [Quit: northfurr]
mistermocha has quit [Read error: Connection reset by peer]
Musashi007 has joined #ruby
theery has quit [Remote host closed the connection]
<lightfoot>
specifically this part -> [options [, lang]]
siemprefresco has quit [Ping timeout: 240 seconds]
<shevy>
the [] in there mean that this is optional, you can omit it
<shevy>
example four shows that invocation: r4 = Regexp.new(r2)
<shevy>
where variable r2 itself is constructed via a Regexp.new call: r2 = Regexp.new('cat', true)
Kwhy_Not has left #ruby [#ruby]
<lightfoot>
does this mean [, lang], lang must be last?
<shevy>
yeah, if you supplied 2 arguments before
<shevy>
weird that the example on the page does not show 3 arguments
<ght>
I have a question. When using the mysql2 gem, you have to set cast_booleans to true when executing a MySQL query to utilize stored boolean values.
<ght>
Otherwise, the stored boolean values will appear as what they literally are, tinyint values of 1 or 0.
<shevy>
"If options is a Fixnum, it should be one or more of the constants Regexp::EXTENDED, Regexp::IGNORECASE, and Regexp::MULTILINE, or-ed together."
siemprefresco has joined #ruby
<ght>
My question is, why on God's green earth is it not a default to cast_booleans as true, and one would have to specify cast_booleans to false to override?
<ght>
When the hell would anyone ever really want to store and utilize tinyint values for anything other than boolean?