tkuchiki_ has quit [Remote host closed the connection]
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nitenq has quit [Quit: nitenq]
araujo_ has joined #ruby
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxpx777 has joined #ruby
aeze has joined #ruby
araujo has quit [Ping timeout: 264 seconds]
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
imperator: So `expected 'const wchar_t * __restrict__' but argument is of type 'unsigned int'` then it blows up on?: (wchar_t*)ruby_xmalloc(MAX_WPATH);
revath has joined #ruby
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arescorpio has joined #ruby
<zenspider>
eam: vvv
<havenwood>
imperator: Yeah, I dunno. O.o?
<zenspider>
>> def ARGF.woot; p :woot!; end; ARGF.woot
<shevy>
lambda, dunno... you have to ask someone who uses them. I still try to find a compelling use case where I need to use them, and where they fit into the rest of my code; you can grep through the source of rack though, rack makes use of lambdas/procs a lot
shock_one has joined #ruby
bigkevmcd has joined #ruby
jxpx777 has quit [Quit: Leaving...]
attlasbot has joined #ruby
<at0m>
shevy: i have gone through tut. of code acedmy but when sometimes i start thinking those thing i got confused??
<at0m>
it seems all are doing same thing..
<shevy>
no
tkuchiki_ has joined #ruby
<shevy>
you just have to use them in code
<shevy>
lambda/procs are almost the same yes; difference being in regards to mandatory versus non-mandatory arguments
<shevy>
and a block, now that's different right? it's attached to a method
<at0m>
i am talking about whole cocept of ruby. it is easy but i don't know how to get it in heart all concept
<at0m>
no no i have gone through both and i think i didn't understand anyone of them at that time.
serivichi has quit [Ping timeout: 244 seconds]
Usaur has joined #ruby
Pisuke has quit [Ping timeout: 265 seconds]
Scroff has quit [Ping timeout: 256 seconds]
Spami has quit [Quit: This computer has gone to sleep]
corehook has quit [Remote host closed the connection]
balazs has joined #ruby
snockerton has joined #ruby
Channel6 has joined #ruby
ozialien has joined #ruby
snockerton has quit [Client Quit]
at0m has quit [Ping timeout: 246 seconds]
uri_ has joined #ruby
Pisuke has joined #ruby
bronson has joined #ruby
pontiki has quit [Quit: <poit>]
vikaton has quit [Quit: Connection closed for inactivity]
krz has quit [Read error: Connection reset by peer]
nitenq has quit [Quit: nitenq]
tkuchiki_ has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
balazs has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 276 seconds]
aridere has joined #ruby
balazs has joined #ruby
northfurr has quit [Quit: northfurr]
bronson has joined #ruby
oo_ has quit [Remote host closed the connection]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxpx777 has quit [Quit: Leaving...]
yfeldblum has quit [Remote host closed the connection]
jwaldrip has quit [Quit: Be back later ...]
bronson has quit [Client Quit]
<zenspider>
blocks/procs are lovely, but they definitely take some getting used to
krisquigley has joined #ruby
pragmatism has joined #ruby
jwaldrip has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
datanoise has quit [Ping timeout: 246 seconds]
krisquigley has quit [Ping timeout: 265 seconds]
flughafe1 has quit [Ping timeout: 244 seconds]
dwithers2 has joined #ruby
dwithers1 has quit [Read error: No route to host]
CloCkWeRX has joined #ruby
dwithers3 has joined #ruby
CloCkWeRX1 has joined #ruby
kahuna_ has joined #ruby
dwithers4 has joined #ruby
skade has joined #ruby
dwithers2 has quit [Ping timeout: 252 seconds]
krz has joined #ruby
CloCkWeRX has quit [Ping timeout: 264 seconds]
chris1 has joined #ruby
dwithers has joined #ruby
daynaskully has quit [Ping timeout: 265 seconds]
tvw has quit []
chris1 has quit [Quit: WeeChat 1.2]
dwithers3 has quit [Read error: No route to host]
northfurr has joined #ruby
dwithers4 has quit [Ping timeout: 240 seconds]
digifiv5e has joined #ruby
digifiv5e is now known as Guest19245
davedev2_ has joined #ruby
jesterfraud_work has joined #ruby
<jesterfraud_work>
what's the pattern behind generating hooks?
davedev24_ has quit [Ping timeout: 265 seconds]
<jesterfraud_work>
I have a module I include that I want to change the behaviour in one model, but it's an additive change, so I figure a hook is probably the most DRY way to do it
yfeldblum has joined #ruby
coffee__cup has quit [Quit: Leaving]
failshell has joined #ruby
<jesterfraud_work>
specifically
<jesterfraud_work>
I want a pre-method hook
<jesterfraud_work>
or a post-method, haven't decided yet, but I figure it'd be really similar
atomi has quit [Remote host closed the connection]
keen__________ has joined #ruby
revath has quit [Quit: Leaving.]
oo_ has quit [Remote host closed the connection]
revath has joined #ruby
keen_________ has quit [Read error: Connection reset by peer]
<quazimodo>
do we have a 'object orientation design' channel in irc?
AndroidLoverInSF has quit [Ping timeout: 246 seconds]
coffeecup__ has joined #ruby
<quazimodo>
where I can ask about abstract patterns and idesa
<flughafen>
i don't think so?
AndroidLoverInSF has joined #ruby
<quazimodo>
whether or not the ideas scale well etc
<quazimodo>
I need to find a pro
<quazimodo>
someone to mentor me *without* violating my trust with sexual harassment later
attlas__bot has quit [Ping timeout: 264 seconds]
atomi has joined #ruby
<sevenseacat>
...
atomi has quit [Read error: Connection reset by peer]
mike___1234 has joined #ruby
unshadow has joined #ruby
<certainty>
i don't even
unshadow has quit [Client Quit]
Cust0sLim3n has quit [Ping timeout: 252 seconds]
<sevenseacat>
that was entirely irrelevant.
ramfjord has joined #ruby
atomi has joined #ruby
skysploi_ has joined #ruby
postmodern has quit [Quit: Leaving]
skysploit has quit [Ping timeout: 276 seconds]
<shevy>
lol
<flughafen>
my package is still at dhl....
<flughafen>
for mroe than a week now
<shevy>
flughafen it's time to move on to new adventures
<certainty>
that sucks
<shevy>
so the airport failed. let's build something grand else
<sevenseacat>
maybe theyre waiting for you to fly it to yourself.
sinkensabe has joined #ruby
<flughafen>
i'm tempted to just go get it myself, but from what I heard from a coworker, the place has no customer thing for me to pick it up
failshell has joined #ruby
Cust0sLim3n has joined #ruby
tkuchiki_ has quit [Remote host closed the connection]
<shevy>
hehe
<shevy>
simply go through the backdoor
corehook has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
RegulationD has joined #ruby
northfurr has quit [Quit: northfurr]
kiki_lamb has quit [Ping timeout: 255 seconds]
sinkensabe has quit [Remote host closed the connection]
sandelius has joined #ruby
failshell has quit [Ping timeout: 276 seconds]
kiki_lamb has joined #ruby
last_staff has quit [Ping timeout: 244 seconds]
corehook has joined #ruby
balazs has joined #ruby
allomov has joined #ruby
<imperator>
oh, hell, mingw has some sort of non-conforming version of swprintf
freezevee has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
gluten_hell_ has joined #ruby
<freezevee>
how do you keep settings in a separate file ? For example If you want to save 100 links, its titles and the language of the websites, is it sane to save them in a module as constant Hashes or yaml files ?
<sevenseacat>
seems like thats what a database would be for
Volsus has quit [Quit: Leaving]
neanderslob has joined #ruby
solars has joined #ruby
<shevy>
freezevee you can keep it in a Hash, and then save it in a yaml file
<freezevee>
shevy: what is more common ? I did it with a config.rb file and calling them as Config::Links::GOOGLE[:url] for example
psy_ has joined #ruby
<shevy>
how do you update config.rb
<freezevee>
sevenseacat: 100 was a brave number, I am only having 10 of them
<sevenseacat>
okay?
roolo has joined #ruby
<freezevee>
shevy: what do you mean? it's simple RSS feeds so I am not going to update them all the time
<shevy>
sevenseacat keeps a database of mice in the environment
kiki_lamb has quit [Ping timeout: 245 seconds]
Paradox has quit [Quit: off to herp the derps]
<shevy>
freezevee I have no idea what you mean. I don't think I ever updated a .rb file dynamically in such a way
corehook has quit [Remote host closed the connection]
GnuYawk has joined #ruby
GnuYawk has joined #ruby
<freezevee>
shevy: I don't need to update it
<shevy>
aha
Scroff has joined #ruby
<shevy>
if you hardcoded it anyway then you can just keep it in a .rb file
<shevy>
*hardcode
AnoHito_ has joined #ruby
AnoHito has quit [Ping timeout: 272 seconds]
Paradox has joined #ruby
datanoise has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
rubie has quit [Remote host closed the connection]
<freezevee>
shevy: the application is a simple RSS parser, meaning that ruby fetches the RSS data and then I display them on a simple html
<freezevee>
a fun project
<freezevee>
shevy: so I am looking for somewhere to save 10 links with a title and a language, like GOOGLE = { title: "Google", url: "http://...", lang: "en" }
jenrzzz has joined #ruby
<shevy>
yes, a hash you have there
<freezevee>
and I am reading that either yaml or an .rb module is the same
tkuchiki_ has joined #ruby
alex88 has joined #ruby
<shevy>
ruby needs to put the yaml data into ruby data anyway
kiki_lamb has joined #ruby
Scroff has quit [Ping timeout: 272 seconds]
<freezevee>
shevy: what is more common in these situations ? I've seen only Rails where there are database.yml and other .yml files for configurations
<freezevee>
shevy: it works as a module but should I leave it as is or change it to yaml ?
rubie has joined #ruby
<freezevee>
I am just looking for the best practice
fabrice31 has joined #ruby
<freezevee>
to use now and on future projects
rubie has quit [Remote host closed the connection]
ReK2 has joined #ruby
ReK2 has joined #ruby
chussenot has quit [Quit: chussenot]
apoplexy has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
<shevy>
you are putting so much thought into this
<shevy>
put the stuff into a .rb file
<shevy>
end of story
<shevy>
:)
<jesterfraud_work>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<jesterfraud_work>
thanks ruboto
edwinvdgraaf has joined #ruby
<shevy>
for my larger projects, I tend to have a directory called configuration/
drewo has joined #ruby
<shevy>
where every individual user-togglable option becomes a yaml file
<shevy>
base_dir.yml
<shevy>
/tmp
<shevy>
or something like that
strixd has joined #ruby
strixd has quit [Excess Flood]
shock_one has joined #ruby
auzty has joined #ruby
strixd has joined #ruby
strixd has quit [Excess Flood]
jwaldrip has quit [Quit: Be back later ...]
strixd has joined #ruby
yaw has joined #ruby
pyo_ has joined #ruby
svoop has joined #ruby
allomov has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 265 seconds]
<freezevee>
shevy: all right
rdark has joined #ruby
<freezevee>
thanks
<shevy>
\o/
tkuchiki_ has quit [Remote host closed the connection]
chussenot has joined #ruby
araujo has joined #ruby
shock_one has quit [Remote host closed the connection]
oo_ has joined #ruby
datanoise has quit [Ping timeout: 250 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
if only all distros would use a universal package manager and repository
<yorickpeterse>
life would be a heck of a lot easier for us puny users
nikhgupta has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
<jhass>
philosophies are just too different
bMalum has quit [Quit: bMalum]
<yorickpeterse>
You mean everybody thinks they're a special snowflake
<jhass>
I guess
<yorickpeterse>
"ooooh nooo we're Canonical we can use our own fork of apt"
<negev>
hi, i want to run ruby via apache. doesn't seem like there's a clean way to do this. don't want to run rails as my app is very very simple and rails is needless bloat. i'm currently using Erubis to execute the ruby scripts as cgi's, but struggling with basic issues like being able to pull in other scripts as subtemplates. can anyone point me at a more elegant solution?
<yorickpeterse>
negev: typically ruby apps use Rack and have a proxy (apache/nginx) in front of it
<apeiros>
negev: the common way to run ruby is via rack
<ljarvis>
negev: the solution would be to use an app
<yorickpeterse>
CGI is pretty rarely used nowadays
<apeiros>
and via apache the common solution to run rack apps is passenger
dreinull75 has quit [Remote host closed the connection]
Cust0sLim3n has joined #ruby
<bnagy>
much simpler than ncurses, but less frills ( no drop-down menus etc etc )
dreinull75 has joined #ruby
<bnagy>
looks like there's also an ffi binding
fujimura_ has quit [Ping timeout: 255 seconds]
oo_ has quit [Ping timeout: 245 seconds]
shock_one has joined #ruby
<agent_white>
bnagy: Ooo... I'll look into it! Thank you :D
failshell has joined #ruby
yoongkang has joined #ruby
alex88_ has joined #ruby
Akagi201 has quit [Remote host closed the connection]
PaulCapestany has quit [Read error: Connection reset by peer]
bigkevmcd has quit [Read error: Connection reset by peer]
jmferreira has joined #ruby
bigkevmcd has joined #ruby
RegulationD has joined #ruby
failshell has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
Casty has joined #ruby
fabrice31 has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 264 seconds]
alex88_ has quit [Ping timeout: 244 seconds]
Zai00 has joined #ruby
aapole has quit [Ping timeout: 252 seconds]
Casty has quit [Client Quit]
serivich has quit [Ping timeout: 272 seconds]
Hounddog has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 264 seconds]
<shevy>
undeadaedra almost perfect... "schelcht" -> should be "schlecht"; in France, mal, right?
<shevy>
malaise... malaire... malbaguette
<undeadaedra>
typo
corehook has joined #ruby
<shevy>
maltypo
_ixti_ has joined #ruby
<undeadaedra>
in this context, « mauvais » will be better, but yes, in general case « mal » is right
mandarinkin has quit [Ping timeout: 272 seconds]
ixti has quit [Ping timeout: 245 seconds]
jds has joined #ruby
<shevy>
\o/
<undeadaedra>
Biggest problem I have with german now is trying not to mix with swedish
Rollabunna has joined #ruby
Palmer11 has joined #ruby
hakunin has quit [Remote host closed the connection]
j4cknewt has joined #ruby
ndrei has joined #ruby
mister_solo has joined #ruby
futilegames has joined #ruby
lkba_ has joined #ruby
futilegames has quit [Client Quit]
Zai00 has quit [Quit: Zai00]
j4cknewt has quit [Ping timeout: 265 seconds]
TvL2386 has joined #ruby
lkba has quit [Ping timeout: 250 seconds]
ottlikg has joined #ruby
<TvL2386>
hi guys, just reading about the SystemTimer gem (https://rubygems.org/gems/SystemTimer/versions/1.2.3).... It seems to be working with blocked system calls as well... It seems like a good way to create timeout facilities if it's not built-in the code you're calling... Anybody got experience on this?
marr has quit [Ping timeout: 264 seconds]
DoubleMalt has quit [Ping timeout: 264 seconds]
arup_r has joined #ruby
revath has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
senayar has quit [Remote host closed the connection]
_jesterfraud has joined #ruby
jesterfraud has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
sdothum has joined #ruby
auzty has quit [Quit: Leaving]
<zotherstupidguy>
"Versions are to Software what Subversion is to Git." this is a qoute in almost-sinatra project, i dont understand it! what does it mean?
sandstrom has joined #ruby
rodfersou has joined #ruby
DoubleMalt has joined #ruby
<jhass>
zotherstupidguy: you'll understand it soon enough, just keep it in mind
fusillicode has joined #ruby
fusillicode has left #ruby [#ruby]
Cust0sLim3n has quit [Ping timeout: 245 seconds]
kalusn has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
gluten_hell_ has joined #ruby
fgo has joined #ruby
<wasamasa>
lol
<wasamasa>
what do they suggest using instead, git revisions all the time?
<wasamasa>
no git tags ever?
ndrei has joined #ruby
krowv has quit [Ping timeout: 250 seconds]
<zotherstupidguy>
wasamasa you use git tags?
<wasamasa>
zotherstupidguy: yup
<wasamasa>
zotherstupidguy: and I tag them with the version left in the file header
_blizzy_ has quit [Ping timeout: 265 seconds]
qwertme has joined #ruby
<wasamasa>
zotherstupidguy: it's for emacs packages as there's two package archives with versioning they wander to
msgodf has quit [Ping timeout: 250 seconds]
dzejrou has joined #ruby
<zotherstupidguy>
wasamasa i can't follow such strict workflow, i will almost always forget to do all a long series of steps
mwlang has joined #ruby
<wasamasa>
fix a bug, commit the change, change the last digit of the version, commit the version bump, tag, push code and tag
<mwlang>
does Nokogiri turn "2015-06-03T16:47:14" into Time values?
<workmad3>
wasamasa: there's rake tasks that can handle the entire bump/commit/tag/push process too :D
<wasamasa>
workmad3: I don't use rake for non-ruby things
tedstriker has quit [Read error: Connection reset by peer]
<zotherstupidguy>
yea i know semver
GitGud has joined #ruby
GitGud was kicked from #ruby by ChanServ [Banned: 3d good bye]
<workmad3>
wasamasa: there's probably make tasks too :P
allomov has quit [Remote host closed the connection]
denver has joined #ruby
<zotherstupidguy>
its kinda bad that there are no repository for common rake tasts :)
tedstriker has joined #ruby
<zotherstupidguy>
sad*
platzhirsch1 has quit [Quit: Leaving.]
<workmad3>
but yeah, it's not a complicated process in all honesty... I used to have to deal with something like a 25 step release process for a mobile app :(
tkuchiki_ has joined #ruby
<mwlang>
nvm, I figured it out — it’s the “nori” gem converting strings to Time (it uses Nokogiri to parse the XML files)
<workmad3>
which included getting a physical USB dongle plugged into the machine in order to activate the licence for a proprietary compiler
<wasamasa>
oh dear
<wasamasa>
that doesn't sound very zen-like :P
<workmad3>
wasamasa: it really wasn't :P
Questions has joined #ruby
fujimura has joined #ruby
ahmetkapikiran has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<workmad3>
wasamasa: I managed to automate and script about half of it at one point... in perl :D
<Questions>
hi. if its not too much trouble I have a really noob question to ask. i'm learning ruby and I just wanted to know in the >require field at the top of every ruby code i see. does the require thing have to be in teh same directory or does it have to be an installed gem ?
<wasamasa>
the latter
<Questions>
ok thank you so much
<workmad3>
Questions: it needs to be visible in any of the directories you see if you print out $LOAD_PATH
<wasamasa>
you usually go for require_relative inside gems
<workmad3>
Questions: which doesn't include the current directory by default
<Questions>
so to see that i go ruby $LOAD_Path
ndrei has joined #ruby
<Questions>
on terminal ?
<workmad3>
Questions: ruby -e "puts $LOAD_PATH" would show it to you
<workmad3>
Questions: but it can be modified at run-time too
<Questions>
ah i see. thank you
nikhgupta has joined #ruby
<Questions>
workmad3:ah so you mean. before i run my program there could be a clause that changes it to the directory of the program right?
<jhass>
Questions: workmad3 single quotes, no?
<workmad3>
Questions: it's an array, so you could add to it... but it's generally not recommended to play with it much
<workmad3>
jhass: yeah, I just realised that
<Questions>
workmad3: ah i see
<Questions>
thank you
<workmad3>
jhass: otherwise bash decides that $LOAD_PATH is an env var :D
<jhass>
;)
<Questions>
haha
tkuchiki_ has quit [Ping timeout: 276 seconds]
Cust0sLim3n has joined #ruby
<Questions>
ok
<Questions>
one day i will be able to participate in these conversation
<Questions>
and make jokes
<workmad3>
Questions: ruby -e 'puts $LOAD_PATH' <-- that's what jhass was meaning
<Questions>
oh i know that
<Questions>
:)
<agent_white>
Like... what did the pirate say on his birthday?
<Questions>
require gems ?
<Questions>
idk
<agent_white>
AYYYYYYEEEMAYEY!
<Questions>
oh...
<Questions>
i meant ruby jokes
fujimura has quit [Ping timeout: 265 seconds]
<Questions>
i can make java jokes though!
<agent_white>
He was a rubyist, too, of course!
<workmad3>
agent_white: what do you call a pirate with 2 hands and 2 legs?
s2013 has joined #ruby
<agent_white>
workmad3: I dunno what?!
tkuchiki has quit [Ping timeout: 256 seconds]
<workmad3>
agent_white: n00b
<agent_white>
workmad3: :(
<Questions>
why can't java programmers get women?
<agent_white>
workmad3: What did the baby computer call it's father?
<Questions>
because they treat them like objects !
<agent_white>
Questions: ohsnahp
<jhass>
uhm
<workmad3>
agent_white: go on
* jhass
senses #ruby-offtopic territory
<agent_white>
DADA!
allomov has joined #ruby
dEPy has joined #ruby
<Questions>
looks like i'll fit in with the community
<agent_white>
Or... DATA.
<Questions>
:D
* agent_white
shrugs
<workmad3>
agent_white: maybe 0xDADA? :D
<agent_white>
Questions: Keep the jokes coming. Then make a ruby bot to tell us jokes!
<agent_white>
workmad3: YES!
<Questions>
aw you guys
<Questions>
such gems <3
jmhmccr has quit [Quit: Connection closed for inactivity]
<agent_white>
I spose 0XDEADBEEF wouldn't come first :P
<Questions>
did you see what i did there?
skade has joined #ruby
<Questions>
funny right?
<Questions>
:D
* workmad3
watches the channel tumbleweeds
<Questions>
:(
<Questions>
i thought it was funny
<workmad3>
:P
<undeadaedra>
0xNOSORRY
<workmad3>
undeadaedra: awesome... none of those are valid hex digits :D
<Questions>
they all are tho
revath has quit [Ping timeout: 252 seconds]
<Questions>
i thought hex was 0-9 A-F
<Questions>
i forgot my digital systems i guess :P
<workmad3>
Questions: correct... so NOSORRY doesn't fit hex :P
<Questions>
oh nvm!
<Questions>
i was looking at DEADBEEF
<Questions>
heh
mwlang has quit [Quit: mwlang]
diegoviola has joined #ruby
<workmad3>
Questions: heh :) DEADBEEF is a classic hex pattern ;)
platzhirsch has joined #ruby
<Questions>
hm
<Questions>
didnt know
<diegoviola>
I want to parse strings in ruby, like if a string contains the word foo and bar I want to do something else, what method can I use for this?
<undeadaedra>
let me find something
shock_one has quit [Remote host closed the connection]
TheHodge has quit [Quit: Connection closed for inactivity]
<apeiros>
no. string comparison is not parsing.
* undeadaedra
steals some of jhass's popcorn
* apeiros
snatches the rest of jhass' popcorn
<jhass>
:(
revath1 has left #ruby [#ruby]
<jhass>
I need that for all the definitions of parsing to come!
mclee has joined #ruby
* undeadaedra
gets an ULTRA-JUMBO box of popcorn for #ruby
nikhgupta has quit [Ping timeout: 276 seconds]
<bnagy>
it's always popcorn tiem here :/
<bnagy>
which idiot merged the other channel?
* apeiros
points at jhass
<apeiros>
0:-)
* ljarvis
points at jh
<ljarvis>
:|
<diegoviola>
#ruby-lang requires invite? wat/
<diegoviola>
?
* undeadaedra
points at popcorn
<ljarvis>
such lag
droidburgundy has quit [Ping timeout: 264 seconds]
skade has quit [Quit: Computer has gone to sleep.]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
diegoviola: there is no ruby-lang
tkuchiki has joined #ruby
Cust0sLim3n has quit [Ping timeout: 264 seconds]
Soda has joined #ruby
<bnagy>
:D
<jhass>
we actually just renamed it to #ruby-offtopic
<diegoviola>
ljarvis: my employer wants me to write a program that parses user input and give responses based on that input, but they're being vague at best, they mention they need a bot for their clients and they say words like NLP, machine learning and so on
tkuchiki has quit [Remote host closed the connection]
<diegoviola>
ljarvis: and I don't think that means anything
<bnagy>
NLP and ML definitely mean things
<ljarvis>
diegoviola: where will this be used?
<ljarvis>
i.e what kind of bot? irc?
<diegoviola>
ljarvis: no IRC at all
<wasamasa>
diegoviola: have they ever played with chatterbots?
<diegoviola>
ljarvis: they want it for their web site, I have to write the HTML / CSS for that
<diegoviola>
wasamasa: they want something like that
Abhijit has left #ruby [#ruby]
<wasamasa>
diegoviola: it doesn't even know about something like established context
<wasamasa>
diegoviola: so, you can respond with something more or less fitting, but that's it
j4cknewt has joined #ruby
strixd has joined #ruby
<wasamasa>
diegoviola: fooling someone with randomly bad responses into believing it's a human is hard
<diegoviola>
wasamasa: right
strixd has quit [Excess Flood]
<apeiros>
my cleverbot instance graduated from the academy of gallifrey
<diegoviola>
I asked a person here yesterday why they're doing this at all, wouldn't it be easier if they just have some tracking code that they can look for information based on the tracking code?
<ljarvis>
diegoviola: isn't it your place to suggest that?
strixd has joined #ruby
aapole has joined #ruby
<workmad3>
wasamasa: cutting edge in conversation bots is now able to convince people that it's a human with learning disabilities btw :D
<wasamasa>
workmad3: yeah, I've seen the turing test news
msgodf has joined #ruby
<wasamasa>
workmad3: it's disappointing that pretending to be a teenage boy is sufficient
nikhgupt has quit [Ping timeout: 245 seconds]
<diegoviola>
ljarvis: I don't understand your question?
<diegoviola>
my place?
<ljarvis>
you're wondering why your employer is doing it?
Ox0dea has joined #ruby
<diegoviola>
ljarvis: yes, and I already asked them why, they didn't know how to respond
dg-ratiodata has joined #ruby
<workmad3>
wasamasa: it's also a bit disappointing that it took about 60 years to get to that point
<wasamasa>
un
<wasamasa>
*run
<ljarvis>
that's quite the bsiness
<bnagy>
diegoviola: maybe they're a bot?
<diegoviola>
ljarvis: they said something along the lines of "Uhm... well, this is what we want, and our customers also want it, so uhm... yes, we can't do full-text-search, we need something that appears as human but isn't"
Marsupermammal has joined #ruby
<workmad3>
diegoviola: tell them that what they want isn't possible
x44x45x41x4E has quit [Ping timeout: 245 seconds]
<wasamasa>
diegoviola: point them to eugene
<workmad3>
diegoviola: because what they're asking for is currently beyond the cutting edge of AI research
<ljarvis>
:|
shredding has quit [Ping timeout: 276 seconds]
<diegoviola>
workmad3: I think they will eventually realize it's not possible
<wasamasa>
workmad3: well, if it's on a very specific topic, it can work better
<jhass>
tell them full text search is a lot easier
<ljarvis>
it's your job to tell them
<ljarvis>
don't wait
<workmad3>
^^
<wasamasa>
workmad3: like the support agents on certain company websites
droidburgundy has joined #ruby
<workmad3>
wasamasa: sure, the more restrictive the domain, the better these things get :)
<wasamasa>
workmad3: which come with cute animations and redirect you to the respective support site, but eh, it's easier to make a better search function for your website
aapole has quit [Ping timeout: 245 seconds]
RegulationD has joined #ruby
<workmad3>
wasamasa: you can also get quite far if you're willing to create an RDF ontology and set up inference rules with it nowadays, so that there's more semantic relevance between queries... but that's a fair bit of effort to go through too :D
<workmad3>
*between queries and suggestions
<wasamasa>
hmm
<workmad3>
again, the more limited the domain, the better (and the easier to model your ontology)
HotCoder has joined #ruby
<workmad3>
that's not exactly a conversation bot though :D
allcentury has quit [Ping timeout: 265 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has quit [Ping timeout: 252 seconds]
shock_one has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
RegulationD has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
Rollabunna has quit [Remote host closed the connection]
Palmer11 has quit [Quit: Palmer11]
evanjs has joined #ruby
dopie has joined #ruby
ndrei has joined #ruby
Xeago has quit [Remote host closed the connection]
treehug88 has joined #ruby
yqt has quit [Ping timeout: 272 seconds]
evanjs has quit [Remote host closed the connection]
shum has joined #ruby
revath has joined #ruby
Xeago has joined #ruby
<diegoviola>
okay
<diegoviola>
thanks guys
fgo has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
sdothum has quit [Ping timeout: 240 seconds]
corehook has joined #ruby
ta has quit [Read error: Connection reset by peer]
<Ox0dea>
>> [1, 2i, 3.14].all?(Numeric)
<ruboto>
Ox0dea # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/383186)
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
I fixed that. :)
skade has joined #ruby
ldnunes has quit [Ping timeout: 255 seconds]
<ljarvis>
wat
<Ox0dea>
You don't think it makes sense?
<apeiros>
hm? you added a literal for imaginaries?
<ljarvis>
:D
<Ox0dea>
No, Ruby's had that for a while now.
<ljarvis>
grep is fine with me
<Ox0dea>
I added case equality to Enumerable#any?, #all?, #none?, and #one?.
<apeiros>
ah
<Ox0dea>
Right, it's the predicate form of #grep.
<apeiros>
like grep
<apeiros>
I see
<Ox0dea>
I was surprised it hadn't been implemented yet.
<yorickpeterse>
"The most active countries in Europe are Germany, the United Kingdom, and France, but if we look at users per capita we see a different story -- Sweden, Finland, and the Netherlands lead the way. London, Paris and Stockholm top the list of European cities most active on GitHub."
<yorickpeterse>
hup holland hup
<yorickpeterse>
also the UK is a country now?
allomov has quit [Remote host closed the connection]
Rollabunna has joined #ruby
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
bmn has quit [Quit: obai]
ta has joined #ruby
dorei has joined #ruby
allomov has joined #ruby
centrx has joined #ruby
dopieee has joined #ruby
<shevy>
yes!
<shevy>
ruled by a benevolent dictator
dopie has quit [Ping timeout: 245 seconds]
<shevy>
this here is even cooler:
<shevy>
"Around 32 million people visit GitHub each month, and most of this traffic comes from outside of the United States (74% in fact)."
krz has quit [Quit: WeeChat 1.0.1]
<Ox0dea>
heftig: Your approach doesn't work for Enumerable.
mister_solo has quit [Ping timeout: 265 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<heftig>
Ox0dea: it was just enough to pass your testcase
<yorickpeterse>
JSON API, HAL and Siren: the SOAP of JSON
<centrx>
That title is webscale
<yorickpeterse>
and none of them work if you don't have a concept of a resource (e.g. aggregated data that consists out of multiple tables/resources/etc)
<yorickpeterse>
BUT OMG HYPERLINKS IN JSON
failshell has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
iwishiwerearobot has quit [Quit: >:(]
aryaching has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
<apeiros>
yorickpeterse: can't you consider the aggregate to be a resource itself?
jwaldrip has quit [Ping timeout: 265 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
iwishiwerearobot has joined #ruby
lfox has joined #ruby
<yorickpeterse>
Adding IDs/links to that is a bit pointless since you can't view it on its own
fujimura has quit [Ping timeout: 240 seconds]
<yorickpeterse>
it's aggregated as in "average rating of X over the past 12 months"
<yorickpeterse>
that's not really a resource, at least not in the REST sense
<apeiros>
I guess it'd be parametrized, so the params would serve as ID, no?
corehook has quit [Remote host closed the connection]
<apeiros>
and afaik REST has a concept of generated resources too, like searches (I'm not to deep in there, so not sure)
skade has joined #ruby
krz has joined #ruby
Papierkorb has joined #ruby
arup_r has quit [Remote host closed the connection]
CloCkWeRX has quit [Remote host closed the connection]
<heftig>
Ox0dea: that would behave differently from the C version in case of all?(nil) or all?(false)
<yorickpeterse>
apeiros: this is an API that just spits out statistics, not sure how IDs/links/etc would even be useful there
jds has quit [Quit: Connection closed for inactivity]
dgutierrez1287 has quit [Remote host closed the connection]
zotherstupidguy has quit [Ping timeout: 240 seconds]
<abyss>
I have file: http://pastebin.com/whhQ2U04 and second file id_to_change_uniq is the list of numbers to change. I write small script in ruby and I'd like to for each line which contains one of the number from id_to_change_uniq to increase about 1000. But my script doesn't work. Why?;)
<apeiros>
abyss: readability tip - you can shorten this: (line =~ /INSERT INTO/) || (line =~ /DELETE/) || (line =~ /UPDATE/) || (line =~ /INSERT_ID/)
<apeiros>
to this: line =~ /INSERT INTO|DELETE|UPDATE|INSERT_ID/
zenguy_pc has quit [Read error: Connection reset by peer]
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ruby
<abyss>
apeiros: ok, thank you. But something doesn't work even there;)
oo_ has quit [Ping timeout: 256 seconds]
zenguy_pc has joined #ruby
InternetFriend has joined #ruby
mdz_ has joined #ruby
nikhgupta has joined #ruby
mikecmpb_ has quit [Ping timeout: 246 seconds]
<shevy>
is there a simple (does not have to be 100% fool-proof) way in ruby to determine whether something is a binary file, like a .mp3 file, or a text file, like plain code in a .rb file?
fabrice31_ has quit [Ping timeout: 276 seconds]
shock_one has quit [Remote host closed the connection]
shock_one has joined #ruby
veinofstars has quit [Quit: veinofstars]
revath has quit [Read error: Connection reset by peer]
revath has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
tkuchiki has quit [Remote host closed the connection]
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
St1gma has quit [Remote host closed the connection]
<yorickpeterse>
shevy: don't think so, you'd need proper MIME type detection
penzur has quit [Ping timeout: 265 seconds]
<yorickpeterse>
because technically everything is binary
rindolf has joined #ruby
<rindolf>
Hi all.
qwertme has joined #ruby
mujou has joined #ruby
arup_r has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
sevenseacat has joined #ruby
<shevy>
hmm
zenguy_pc has joined #ruby
griffindy has joined #ruby
<abyss>
ok I suppose I didn't chomp the \n from lines in array
<apeiros>
abyss: sorry. RL disrupted
<apeiros>
abyss: define "doesn't work"
<abyss>
apeiros: yeah, my english isn't good :(
penzur has joined #ruby
failshell has quit []
<apeiros>
I'm sure even with bad english you can do better than "doesn't work". but it seems you found your problem.
<al2o3-cr>
shevy: the gem filemagic does it
zenguy_pc has quit [Max SendQ exceeded]
<jmferreira>
shevy: i guess you could look for some control characters that exist on most binary files but are rare or non-existent on text files. 0x00 comes to mind.
<abyss>
apeiros: sorry. I described what script should to do. And script just freeze I suppose because it doesn't nothing because I didn't chomp lines so even the first if didn't work
enebo has joined #ruby
aapole has quit [Ping timeout: 276 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has joined #ruby
Xeago has joined #ruby
<abyss>
apeiros: File.readlines("id_to_change_uniq").chomp doesn't work, should I do file.each and then chomp?
centrx has quit [Quit: Shutting down, Please wait...]
dblessing has joined #ruby
<abyss>
al2o3-cr: can't: private method `chomp' called for #<Array:0x7f8924a30110>
<Ox0dea>
shevy: Do you just not realize that my suggestion would actually work?
<shevy>
aha
livathinos has quit [Read error: Connection reset by peer]
<shevy>
"Audio file with ID3 version 2.4.0, unsynchronized frames, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Stereo"
revath has quit [Read error: Connection reset by peer]
<shevy>
Ox0dea please man
Hounddog has quit [Remote host closed the connection]
nikhgupta has quit [Remote host closed the connection]
darkf_ has joined #ruby
livathinos has joined #ruby
revath has joined #ruby
<shevy>
do they classify files somehow?
nikhgupta has joined #ruby
<shevy>
like I mean, this is an "audio file" I suppose
<shevy>
but what makes a file an audio file exactly, is that specified anywhere?
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
<al2o3-cr>
abyss: something like your_arr.map(&:chomp)
phutchins has joined #ruby
<shevy>
NoMethodError: undefined method `binary?' for File:Class
<shevy>
:(
axl_ has joined #ruby
<abyss>
al2o3-cr: oh, I get it
nikhgupta has quit [Remote host closed the connection]
nikhgupta has joined #ruby
<al2o3-cr>
shevy: ptool as binary?
pikos has joined #ruby
erts has joined #ruby
mister_solo has joined #ruby
JakFrist has joined #ruby
senayar has quit [Remote host closed the connection]
nikhgupta has quit [Remote host closed the connection]
Abhijit has joined #ruby
nikhgupta has joined #ruby
fgo_ has quit [Ping timeout: 265 seconds]
zz_Outlastsheep is now known as Outlastsheep
ta__ has joined #ruby
yoongkang has quit [Remote host closed the connection]
mister_s_ has joined #ruby
denver has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 276 seconds]
phutchins has quit [Ping timeout: 256 seconds]
ta has quit [Read error: Connection reset by peer]
Forgetful_Lion has quit [Remote host closed the connection]
ta__ has quit [Remote host closed the connection]
mister_solo has quit [Ping timeout: 244 seconds]
jlast has joined #ruby
zotherstupidguy has joined #ruby
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality_ has joined #ruby
Janusz1 has joined #ruby
mikecmp__ is now known as mikecmpbll
<apeiros>
abyss: "doesn't work" again. drop that. it's useless.
<abyss>
ok, I revised script and now it looks like this: https://gist.github.com/anonymous/918cd60ee21471bd8477 Now lines are matched but in lines 14 and 15 I increase id about 1000 and I change this line and I set puts line in 12 line to compare, but the line remains the same... So gsub doesn't change anything
<abyss>
apeiros: I threw it out:)
startupality has quit [Ping timeout: 246 seconds]
startupality_ is now known as startupality
Guest11186 has joined #ruby
platzhirsch has left #ruby [#ruby]
senayar has joined #ruby
<apeiros>
,'#{newID}'
vdamewood has joined #ruby
<apeiros>
single quotes don't interpolate. you must use double quotes
<apeiros>
but "#{expr}" is an (IMO) bad way to write expr.to_s
<yorickpeterse>
Yeah, use %Q{expr}
mrmargolis has joined #ruby
<yorickpeterse>
errr
<yorickpeterse>
derp
<yorickpeterse>
%Q{#{expr}} :3
<apeiros>
%Q{#{%{#{"#{expr}}}}}
<apeiros>
oh, missing "
mwlang has joined #ruby
<Janusz1>
Hi. I have problem with encoding, I am using Base64.decode64 in my puppet, and then I am getting variable with encoding ASCII-8BIT, but I need it in utf, so I do .encode("UTF-8") and getting error: Detail: "\xC3" from ASCII-8BIT to UTF-8, could someone help me with it?
<apeiros>
%Q{#{%{#{"#{expr}"}}}}
<abyss>
and why this isn't increase that id about 1000?;)
musgravejw has joined #ruby
JoshL has joined #ruby
Guest11186 is now known as marr
<apeiros>
Janusz1: so you have binary data in your base64 encoded blob
<apeiros>
Janusz1: and utf-8 is not suitable for binary data
<apeiros>
oh, wait…
<Janusz1>
apeiros: I have string in germany language
tkuchiki has joined #ruby
<apeiros>
you use encode? wrong tool. force_encoding.
<apeiros>
encode will *translate*
<mwlang>
So I have a gem that’s converting time strings into DateTime, but unfortunately it’s doing so as a UTC time: #<DateTime: 2015-06-03T16:47:14+00:00 ((2457177j,60434s,0n),+0s,2299161j)> How do I easily shove that DateTime instance to the correct timezone?
<apeiros>
you can't translate binary to utf-8.
<undeadaedra>
"in germany language"
nonparfumee has joined #ruby
InternetFriend has joined #ruby
<mwlang>
(for example, I want to place it in the +05:00 timezone.
<apeiros>
undeadaedra: pssht, you francian
nikhgupt has joined #ruby
devdazed has joined #ruby
davedev24_ has joined #ruby
<yorickpeterse>
mwlang: DateTime#new_offset can be used to set the time offset
<mwlang>
I know I could just re-instantiate with the values of the current DateTime instance, but I was hoping to just say zone = “EST” or something similar.
<yorickpeterse>
time offset != timezone
<undeadaedra>
apeiros: ssh, you'll wake my head-cutting urges.
gambl0re has quit [Ping timeout: 276 seconds]
malconis has joined #ruby
<mwlang>
yorickpeterse: hmmm….just setting the offset should be good enough
revath has quit [Read error: Connection reset by peer]
<yorickpeterse>
mwlang: though DateTime#new_offset works with zone names
<yorickpeterse>
* also works
nikhgupt has quit [Remote host closed the connection]
<yorickpeterse>
e.g.
dionysus69 has joined #ruby
<abyss>
ok. Because here I get nil: ID = line.split(' ').find {|item| IDS.include? item }
<mwlang>
That’s actually changing the time. I need it to stay 16:47, but with new offset.
Siyfion has joined #ruby
<undeadaedra>
Time is changing all the time :o
jmferreira has quit [Ping timeout: 276 seconds]
<Janusz1>
apeiros: thank you
<maloik>
mwlang: then the gem parsing the strings is probably doing it wrong?
<maloik>
which gem are you using?
<mwlang>
maloik: nori
dopieee has quit [Ping timeout: 250 seconds]
<maloik>
and what does the string look like?
jwaldrip has joined #ruby
<yorickpeterse>
mwlang: then you'll need to append it to the input before parsing
hinbody has joined #ruby
mrgrieves has joined #ruby
<yorickpeterse>
because it's impossible to find out what the zone is for "2015-06-01 14:51:38"
<yorickpeterse>
unless somewhere it's stated that everything is always in zone X
intinig has quit []
<yorickpeterse>
(something something always just include the zone/offset in the output)
arup_r has quit []
Zackio has quit [Read error: Connection reset by peer]
<mwlang>
yorickpeterse: looking at the source, they’re calling DateTime.parse(x) where x, in my case was "2015-06-03T16:47:14"
nikhgupt has joined #ruby
<mwlang>
I guess I’ll just re-instantiate it from the values.
Outlastsheep is now known as zz_Outlastsheep
<abyss>
apeiros: I found a mistake in my script the line I trying to change looks like: SET INSERT_ID=2151098/*!*/; I wanted to increase that number about 1000. But ofcourse when I do split(' ') I divide it by space so it mistakes because I'm looking for the figures... Do you have any idea how to achieve that? Catch that number and change it? In id_to_change_uniq I have numbers that I wanted to increase.
<abyss>
So the task should be easy, find each line in ID array increase about 1000
kriskropd has quit [Remote host closed the connection]
<abyss>
and change in each line
rubie has joined #ruby
<apeiros>
abyss: so you want "SET INSERT_ID=2151098/*!*/;" to change to "SET INSERT_ID=2161098/*!*/;" ?
RegulationD has joined #ruby
<mrgrieves>
hi, in a string of a number of words what can I used to remove the left side of the string from a "key" word?
sdothum has joined #ruby
nikhgupta has quit [Ping timeout: 264 seconds]
<apeiros>
abyss: I'd change the structure of your script. first check whether line =~ /INSERT INTO|DELETE|UPDATE|INSERT_ID/
<apeiros>
abyss: then find the id in the string. and don't just test whether it is in there - get which id is in there too.
<mrgrieves>
ie "Hello world, my name is daniel" what can I use to delete everything before name so I end up with "name is daniel"
<apeiros>
abyss: and then you can directly gsub. no need to extract it
<abyss>
apeiros: yes. Thank you for your understanding;) But somewhere in the file ther could be lines like: UPDATE assignmentuser SET state='YToxOntpOjIzNTM7Y' WHERE userid='2151098/' and I wanted to change this to userid='2161098' as well
<apeiros>
mrgrieves: see String#[], String#sub and String#gsub
<apeiros>
mrgrieves: whoops, String#[]=, not #[]
revath has quit [Read error: Connection reset by peer]
mclee has quit [Ping timeout: 256 seconds]
<apeiros>
abyss: yes. that'd still work with the way I suggested.
revath has joined #ruby
<mrgrieves>
apeiros: cheers
freerobby has joined #ruby
<abyss>
apeiros: I will try;)
<abyss>
thank you very much
<apeiros>
if your list of id's is large, and your script is too slow - there's ways to go about it a bit differently to improve performance
<abyss>
apeiros: to find the id I should use match, yes?
msnyon has joined #ruby
Zackio has joined #ruby
<apeiros>
abyss: just use .find instead of .any?
<abyss>
apeiros: yes, there's 30000 ids
<apeiros>
it'll return which number was found, and not just whether a number was found
<apeiros>
yeah, I'd expect your approach to be quite slow then
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
unshadow has quit [Ping timeout: 276 seconds]
olistik has joined #ruby
<abyss>
apeiros: I did: ID = IDS.find { |w| line =~ /\b#{w}\b/ } and it looks like probably works ;) Do you think that script is ok?
symm- has quit [Ping timeout: 264 seconds]
RegulationD has joined #ruby
<abyss>
and how to write this changes in file, lol - please answer when you back
dhjondoh has quit [Quit: dhjondoh]
imperator has joined #ruby
Cust0sLim3n has joined #ruby
fabrice31_ has joined #ruby
Igorshp has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
dhjondoh has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
<abyss>
And I still can't increase about 1000 in whole text. The whole text is intact:/ (I compare first puts line with the last)
AlphaAtom has joined #ruby
shinnya has joined #ruby
revath has quit [Quit: Leaving.]
olistik has left #ruby [#ruby]
AlphaAtom has quit [Max SendQ exceeded]
viuo has joined #ruby
revath has joined #ruby
catphish has joined #ruby
AlphaAtom has joined #ruby
pontiki has joined #ruby
<pontiki>
hello, all o/
<havenwood>
\o
fabrice31 has quit [Ping timeout: 256 seconds]
__butch__ has joined #ruby
lfox has joined #ruby
LMity has joined #ruby
Scroff has joined #ruby
<imperator>
"cast to pointer from integer of different size" - i guess NUM2OFFT was the wrong choice
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has quit [Remote host closed the connection]
<imperator>
what's the proper NUM2xxx where the lhv is uintptr_t ?
hoov has quit [Read error: Connection reset by peer]
<pontiki>
a general question: Kernel#Array() will usually do the job of turning something into an array. But when you give it a hash, it dutifully turns the hash into an array. But what if you just want to make a hash into an array with a single hash member?
ascarter has joined #ruby
<pontiki>
but do so while not necessarily knowing you're getting a hash passed to you?
<pontiki>
are back to having to do type checking on this?
[H]unt3r has joined #ruby
<imperator>
h = {}; a = [h]?
aryaching_ has joined #ruby
sepp2k has joined #ruby
aryaching has quit [Ping timeout: 250 seconds]
<pontiki>
imperator: more like: def xxx(z); Array(z).each {...}; end
<catphish>
can anyone point me in the right direction of how I might use this ioctl in ruby? #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
olistik_ has joined #ruby
Scrofff has quit [Ping timeout: 246 seconds]
olistik_ has left #ruby [#ruby]
ht__ has quit [Quit: Konversation terminated!]
mikecmpb_ is now known as mikecmpbll
volty has joined #ruby
<pontiki>
so i guess the answer is yes
<catphish>
in C it's called as "ioctl(fd, DMX_SET_FILTER, filter)" - i have no problem with the the string param, but the integer part is kind confusing
InternetFriend has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<jhass>
catphish: printf it and just copy it over :P
railsraider has joined #ruby
<catphish>
jhass: actually yes :)
<catphish>
printf("%x") for the win here i think
<jhass>
yah
dopie has joined #ruby
<catphish>
well it's 0x403c6f2b
Igorshp has joined #ruby
<catphish>
i guess i could have calculated that with reference to _IOC but it's a rabbit hole
kfpratt has joined #ruby
dg-ratiodata has quit [Read error: Connection reset by peer]
<catphish>
thanks!
<jhass>
tbh I do it all the time
<jhass>
just not worth the rabbit hole most of the time
Iskarlar has quit [Read error: Connection reset by peer]
<abyss>
apeiros: Ok. I had to add gsub! then I can see the changes;) This is ok? How I can now write this to file? How to expedite the whole script? Thank you.
startupality has quit [Quit: startupality]
momomomomo has joined #ruby
Iskarlar has joined #ruby
northfurr has quit [Quit: northfurr]
Iskarlar has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
dopie has joined #ruby
mary5030 has joined #ruby
kies has joined #ruby
bruno- has joined #ruby
yoongkang has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
Zai00 has joined #ruby
fgo_ has quit [Ping timeout: 276 seconds]
vdamewood has quit [Read error: Connection reset by peer]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fabrice31 has joined #ruby
InternetFriend has joined #ruby
yaw has joined #ruby
yaw has quit [Client Quit]
viuo has quit [Quit: leaving]
tagrudev has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
Iskarlar_ has joined #ruby
zudochkin has joined #ruby
Iskarlar_ has quit [Client Quit]
ndrei has quit [Ping timeout: 265 seconds]
bruno- has quit [Ping timeout: 255 seconds]
quimrstorres has joined #ruby
j4cknewt has joined #ruby
<apeiros>
abyss: File.write(path, content)
startupality has joined #ruby
simplyianm has joined #ruby
olistik has joined #ruby
sohrab has joined #ruby
simplyianm has quit [Remote host closed the connection]
simplyianm has joined #ruby
<apeiros>
abyss: yes, ID = IDS.find { |w| line =~ /\b#{w}\b/ } is better. but you should not use constants (variables which start with an uppercase letter are constants).
segfalt has joined #ruby
gambl0re has joined #ruby
Iskarlar has joined #ruby
hinbody has quit [Ping timeout: 264 seconds]
<volty>
perl 6 went functional (the examples, of shevy's link above)
quimrstorres has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
mujou has quit [Quit: Leaving...]
<yorickpeterse>
Perl 6 is anything but a functional language
_blizzy_ has joined #ruby
<shevy>
perl went crazy
sanguisdex has quit [Ping timeout: 276 seconds]
quimrstorres has joined #ruby
<volty>
of, course, yorickpeterse, the mine was about those constructs
<ponga>
{ |w| line =~ /\b#{w}\b/ } looked like all gibberish for a second , it took me a moment to understand what it is ..
<yorickpeterse>
constructs?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fujimura has joined #ruby
ottlikg has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<volty>
look at quicksort, it seems almost haskell :)
antgel has quit [Ping timeout: 252 seconds]
hinbody has joined #ruby
AlphaAtom has joined #ruby
<volty>
construct -- (create by linking linguistic units; "construct a sentence"; "construct a paragraph")
jenrzzz has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
<yorickpeterse>
I know what "construct" means...
<shevy>
ponga well regexes are never really pretty
<apeiros>
I find regexen very pretty :)
AlphaAtom has joined #ruby
<shevy>
I try to avoid them when possible, if it is for simple things like "if string.include? substring" or string.start_with? or string.end_with?
sanguisdex has joined #ruby
<volty>
nothing more elegant then regexens — and the elegance stays in their power & solution
<shevy>
yeah
<shevy>
I get horny when I see things like /([A-Za-z\d-]*_{0,1}[_a-z]*)[_-]{1,20}([A-Za-z_\d.]*[-a-z]*[\d]*)/
<yorickpeterse>
ljarvis: there's actually a really good reason to do it this way
* undeadaedra
slaps shevy
<ljarvis>
sure I don't doubt that
<yorickpeterse>
makes it easier to associate (technically) and it actually stays with the method
<ljarvis>
the reason won't make me like it, that I know
<undeadaedra>
You could also have XML documentation like Microsoft does :D
<yorickpeterse>
at the cost of moving the method name further away from the body
<yorickpeterse>
but you can always just fold the comments
francois_ has quit [Remote host closed the connection]
<ericmeds>
so YARD can tell me what percentage of the code is documented?
<yorickpeterse>
ericmeds: yes
<ericmeds>
nice!
olistik has left #ruby [#ruby]
<ericmeds>
yorickpeterse: and should we document every single function like you would in Python?
umgrosscol has joined #ruby
<ljarvis>
why would it be different?
<yorickpeterse>
ericmeds: no
<yorickpeterse>
document where it makes sense
segfalt has quit [Ping timeout: 265 seconds]
sharpmachine has joined #ruby
<ljarvis>
^ for every language
veinofstars has quit [Quit: veinofstars]
cirn0 has joined #ruby
anisha has quit [Quit: Leaving]
<undeadaedra>
ericmeds: it tells you stats when you compile doc, and you can ask it exactly what is left to document.
mister_s_ has quit [Ping timeout: 276 seconds]
kfpratt has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mister_solo has joined #ruby
fgo has joined #ruby
tsvenson|afk has joined #ruby
freerobby has quit [Quit: Leaving.]
stan has quit [Ping timeout: 265 seconds]
tsvenson has quit [Ping timeout: 265 seconds]
fgo_ has quit [Ping timeout: 245 seconds]
Xeago has quit [Remote host closed the connection]
chouhoul_ has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
segfalt has joined #ruby
diegoviola has quit [Ping timeout: 244 seconds]
apoplexy has joined #ruby
kfpratt has joined #ruby
Cache_Money has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
hefest has quit [Quit: leaving]
momomomomo has joined #ruby
sharpmachine has quit [Ping timeout: 240 seconds]
dhjondoh has quit [Remote host closed the connection]
Kricir has joined #ruby
sharpmachine has joined #ruby
<Senjai>
ericmeds: If you're developing a library, every public method should be documented
<Senjai>
On an internal project, there's usually some room for flexibility
<ericmeds>
right - potentially the more complex methods should deserve proper comments/docs
<Senjai>
ericmeds: Well, see, thats the thing
<ericmeds>
but not sure where the line should be
solars has quit [Ping timeout: 245 seconds]
rcvalle has joined #ruby
<ericmeds>
for an internal project
<Senjai>
ericmeds: We document libraries because it has to be used by people that may be stupid, or cannot read source code. Or that the source code itself is unusually complex
<Senjai>
ericmeds: In a perfect world, your code should be self documeting
<ericmeds>
right - straight forward enough to be read and understood
<Senjai>
And that you typically want people to use your library, so making it easier to do so is a form of promotion
<Senjai>
Usually the documentation for most open source libraries are so terrible, I end up just keeping their source open in a tmux window
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
:D
<shevy>
I focus on working examples first
<shevy>
when examples work, it's 30% of the deal
<shevy>
that's how I learned ruby-gnome
zotherstupidguy has joined #ruby
livathinos has quit [Ping timeout: 276 seconds]
<shevy>
if I would have started from the wiki, I would have given up on it soon enough again
<Senjai>
I disagree, there should have to be very few examples. You dont need to have examples for how to use every class, just a basic one of how the library functions in the readme, and the rest can be documented.
<Senjai>
Thor is a great example of where documentation is really the only way you understand things, or reading the source
<Senjai>
Arel is largely a unicorn, despite it being used everywhere
nikhgupta has joined #ruby
<ericmeds>
Senjai: what are your recommendations for a super small development team with the potential to grow
francois_ has joined #ruby
<Senjai>
Arel is extreeeeemmely useful for development. Yest 99% of active record users dont use it because its unclear how.
<ericmeds>
id imagine doc’ing as much as possible but the problem is where is that line
<ericmeds>
how do you even make the recommendation
sharpmachine has quit [Read error: Connection reset by peer]
<Senjai>
ericmeds: lol, with the potential to grow?
<ericmeds>
so it wouldnt be only a few guys for long for example
<Senjai>
ericmeds: We dont document internal stuff
<Senjai>
It's documented by specs and properly named and encapsulated objects
<phat4life>
ericmeds: use rubocop, simple-cov
<Senjai>
^
<phat4life>
metric_fu is helpful as well
<Senjai>
SimpleCov is great, we dont use robocop though, specifically because we have a number of clients with code bases that began outside of our firm
<Senjai>
With simplecov you can have a build fail if coverage is less than a certain %
<phat4life>
Senjai: you can always configure rubocop to ignore certain directories
<Senjai>
on jenkins at least
<Senjai>
phat4life: Its totally not worth it :P
<Senjai>
phat4life: We get a lot of rescue projects
<phat4life>
with have rubcop running in a pre commit hook, but its really fucking annoying
<ericmeds>
phat4life: thanks was looking into simplecov also for test coverage
<Senjai>
phat4life: rm -rf .git/hooks
<Senjai>
phat4life: ftw
<ericmeds>
nice
hubcaps has quit [Ping timeout: 256 seconds]
<Senjai>
ericmeds: Writing good tests is necessary for the team. Code thats hard to test is hard to use
<phat4life>
ericmeds: are you using docker or vagrant
<Senjai>
as a rule of thumb
oo_ has joined #ruby
<ericmeds>
phat4life: vagrant for now
<phat4life>
we use ansible to provision our vagrant dev envronment, which has redis, mysql, a few other things
<Senjai>
phat4life: I only have a pre-commit hook for binding.pry's :P, and one for gerrit
<phat4life>
ansible is god mode
mclee has joined #ruby
<Senjai>
I heard good things about ansible, but I still prefer the vanilla setup
<Senjai>
Ubuntu with things set up properly + git lcone
<ericmeds>
yeah part of what ive done is implement a framework for integration testing etc and now im onto unit testing coverage
<Senjai>
clone*
InternetFriend has joined #ruby
<phat4life>
our rails app depneds on jenkins servers, redis, mysql, slanger, pusher, so it a complicated dev environment
keen__________ has quit [Read error: Connection timed out]
<phat4life>
to its eaiser to have that running on vagrant
nikhgupta has quit [Remote host closed the connection]
<yorickpeterse>
heh, ansible for deployments
nikhgupta has joined #ruby
<Senjai>
phat4life: redis, mysql are apt-get installs, jenkins shouldn't be on every dev box, pusher is an ENV setting that can be used by sharing a development .env with DotEnv
* yorickpeterse
shakes cane while mumbling "you kids never learn!"
ericwood has quit [Quit: Changing server]
<phat4life>
Senjai: for us it makes sense
* yorickpeterse
is actually working on a new deploy tool for $WORK
<phat4life>
because the rails app creates, destroys jenkisn projects
<mikecmpbll>
i've never used any provisioning tools yet. we hardly ever provision new servers or dev machines and it takes me about 15 mins to do it myself.
<Senjai>
phat4life: LOL WHAT
<Senjai>
phat4life: That's your problem.
edwinvdgraaf has quit [Ping timeout: 245 seconds]
<Senjai>
phat4life: Why is rails coupled to jenkins?
<Senjai>
Unless its job is to.. manage jenkins
francois_ has quit [Remote host closed the connection]
keen__________ has joined #ruby
veinofstars has joined #ruby
<phat4life>
Senjai: its used to managed jenkins which is used for company wide projects
<Senjai>
Ah
<Senjai>
That's fair then.
<Senjai>
I prefer.. scripts and things
<phat4life>
we trigger jobs, manage them
<Senjai>
phat4life: Why not just use jenkins to manage jenkins though
<Senjai>
Application specific things can be done with cron, or queues
<phat4life>
Senjai: the rails app is for internal non techical users
<phat4life>
Senjai: most of the jenkins jobs just but static content in s3
<Senjai>
So jenkins is like a task runner?
<dorei>
isn't jenkins just a modern version of crond?
<phat4life>
all jenkins does is compile js, static contect from sourc control
oo_ has quit [Ping timeout: 264 seconds]
<phat4life>
Senjai: the rails app is just a front end for jenkins
ddarkpassenger has joined #ruby
blackmesa has joined #ruby
<yorickpeterse>
heh, our jenkins does a shit ton
<phat4life>
we have 11k jenkins jobs
antgel has quit [Ping timeout: 264 seconds]
<phat4life>
with with probably 300+ builds
<phat4life>
each
<Senjai>
yorickpeterse: Same, but we have like, a build with parameters thing, that makes it pretty simple.
<yorickpeterse>
precompile assets, package Gems, package apps, trigger deploys, build Linux binaries for PhantomJS and other things, build Rubinius binaries/nightlies, etc
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<undeadaedra>
"a shit ton" – and in imperial measurements?
<yorickpeterse>
undeadaedra: metrics only
<Senjai>
yorickpeterse: lol at the phantomjs, I hate how they're so slow to release binaries on linux
<phat4life>
Senjai: creating jenkins projects sometimes only works with xml
<undeadaedra>
yorickpeterse: good.
<phat4life>
with all the plugins and shit
Synthead has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
<veinofstars>
j #emberjs
<yorickpeterse>
Senjai: meh, I just started up a beefy EC2 instance and 30 minutes later I had my CentOS binary
<Senjai>
phat4life: I'll ask if I can show our tool for setting up jenkins projecst, at the minute its closed source, but not for any particular reason I dont think
<shevy>
is the tech world becoming smarter and smarter every year?
railsraider has quit [Quit: railsraider]
<phat4life>
shevy: yes
ruby-lang515 has joined #ruby
<Senjai>
shevy: yes and no
sevenseacat has quit [Quit: Me dun like you no more.]
<yorickpeterse>
shevy: No, it thinks it becomes smarter every year but it stays roughly the same
<Senjai>
shevy: The % of smart people in the industry is relatively constant
<yorickpeterse>
once in a while it makes a small jump
<Senjai>
there is just more people in th eindustry
<Senjai>
yorickpeterse: I win :P
yqt has joined #ruby
<shevy>
yorickpeterse now that is a very confusing statement :D
<phat4life>
there are a lot of shit rails devs being churned out by places like dev boot camp
<shevy>
I am just trying to notice the differences to like 1995
<Senjai>
shevy: See, there is this thing called javascript, that can allow people to call themselves software engineers, without actually knowing anything about building anything outside of a browser frontend
<phat4life>
shevy: the barrier of entry for rails devs is pretty low
<phat4life>
sometimes
pontiki has quit [Quit: ZZZZZZZZ<clunk>NNNNNNNNN]
<Senjai>
phat4life: Yeah, but if it wasn't for that, I wouldnt be here so..
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Senjai>
As I got picked up by this company being self taught
francois_ has joined #ruby
<phat4life>
Senjai: dev bootcamp?
<Senjai>
No
<phat4life>
ah self taught
<dorei>
i think that programming and software engineering are like two different skills
<shevy>
can you code in ruby Senjai?
<shevy>
at work
<phat4life>
i feel like the self taught ones, can be really good at what they do
<phat4life>
not always
<Senjai>
shevy: I've been writing ruby, rails, javascript, etc for the past two years
francois_ has quit [Remote host closed the connection]
sharpmachine has joined #ruby
<Senjai>
99% of the people here are self taught. Sure they have degrees, but they all say they were useless
<yorickpeterse>
I'm the only dirty dropout at the office
<Senjai>
about 50% of our office has degrees
<Senjai>
I think
<Darkwater>
I don't even have a degree (yet) lol
<Senjai>
yorickpeterse: Right, and you're kind of awesome at the things so.
<yorickpeterse>
I'm also the coolest one that the office, may or may not be related
Xeago has quit [Remote host closed the connection]
<yorickpeterse>
my crotch isn't that clearly visible
<phat4life>
Senjai: the problem i have, is that i would like to see devs be able to read code; like, most of the devs i know, if i show them a recursive function, ask them what it does, they cant
<shevy>
lol
<yorickpeterse>
or bulge or w/e that is
Sembei has joined #ruby
<shevy>
they just stuffed it up
<shevy>
have you seen Ronal the Barbarian? that animated movie?
mister_solo has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
<Senjai>
phat4life: Recursion is a pretty verbose thing for people new to the industry.
<phat4life>
Senjai: a lot of self taught devs have gaps in more computer science stuf
<shevy>
they overdid it with the jokes... but I still found some non-overdone things funny, like the invisible potion
<phat4life>
maybe dynamic programming
<Senjai>
I cant say I fully understand it beyond a function that just calls itself. There's many different ways to recurse over things
<Senjai>
phat4life: You have a ton of gaps for sure. The thing is, you should.
momomomomo has quit [Ping timeout: 276 seconds]
<phat4life>
yeah true
<yorickpeterse>
shevy: nop
jlast has quit [Read error: Connection reset by peer]
<Senjai>
phat4life: Having a web developer that has spent 2 years learning math instead of engineering is a waste of time
<Senjai>
phat4life: Except in the most exceptional of cases
<phat4life>
i love math :(
<phat4life>
i don't get to use enough math
Agoldfish has joined #ruby
<Senjai>
phat4life: That's fine, but its not the most important thing in a devs toolkit (for this part of the industry)
<shevy>
you are not a real person phat4life
djdarkbeat has joined #ruby
<yorickpeterse>
if all you do is poop CRUD apps then yeah, it's pretty pointless
<Senjai>
now if it was game dev, that's a different story
Pisuke has quit [Ping timeout: 265 seconds]
sdothum has joined #ruby
ndrei has joined #ruby
<Senjai>
yorickpeterse: Even complex apps. The hardest thing for a developer to learn is how to manage complexity, everything else is details
mleung has quit [Quit: mleung]
<phat4life>
shevy: shadertoy.com
towski_ has joined #ruby
<phat4life>
Senjai: yes! managing complexity is hard for inexperienced devs
<shevy>
dunno what that is
<yorickpeterse>
Not sure, I think writing good Git commit messages is still the #1 hardest thing
<shevy>
but I wanted to create 3D objects via ruby programmatically!
<phat4life>
shevy: webgl shader sandbox
<yorickpeterse>
(for most)
<phat4life>
shevy: its all just math
<phat4life>
but cool as hell
<ZOMGITSABEAR>
puts "Is it true that 3 + 2 < 5 - 7?"
<Spaceghostc2c>
ZOMGITSABEAR: For as long as the pay is high, the benefits are substantial, and the perks are hard to count, yes.
<ZOMGITSABEAR>
my motivation is fulfilling work that challenges me, and allows me to have a comfortable lifestyle
<undeadaedra>
can'tcan't
<Senjai>
They pretty much wrote the code that causes the error, try putting that into a dummy rails app and uploading it. Then if you want, you can follow what gets called from where and try to fix it if you like :)
Scroff has joined #ruby
<jhass>
if you have at least some fun doing, it's fine
<yorickpeterse>
ZOMGITSABEAR: if you can stand sitting behind a computer ~9 hours a day yelling at it, sure
<Senjai>
undeadaedra: At the moment, yeah. I got plans to make it a lot better
<ZOMGITSABEAR>
i know with sysadmin, it's a high stress job
malconis has joined #ruby
<ZOMGITSABEAR>
is programming high stress?
<yorickpeterse>
varies from company to company
<Spaceghostc2c>
ZOMGITSABEAR: Some people just work like 4-8 hours a day and step away after work.
pepperbreath has quit [Ping timeout: 265 seconds]
duoi has quit [Ping timeout: 265 seconds]
<undeadaedra>
Senjai: what will you call it? cancancancan?
<Spaceghostc2c>
undeadaedra: cannotcannot
dfockler has joined #ruby
<Senjai>
undeadaedra: Nope, cancancan version 2 :)
<ZOMGITSABEAR>
thanks for all the help, guys
<ZOMGITSABEAR>
i really appreciate it
<Spaceghostc2c>
ZOMGITSABEAR: Anyone mid-level or better shouldn't be making less than six figures working in a tech hub in the US.
<undeadaedra>
Is there a bear in here?
<ZOMGITSABEAR>
i am a bear, yes
rindolf has quit [Quit: Leaving]
ogpastaling has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
<undeadaedra>
Brown or white?
Scroff has quit [Remote host closed the connection]
<ZOMGITSABEAR>
oohh
<ZOMGITSABEAR>
good question
<undeadaedra>
Wait
* yorickpeterse
only makes 5 figures :<
<undeadaedra>
I just remember that I'm not allowed to ask this in my country
<dfockler>
I don't live in a tech hub
<ZOMGITSABEAR>
lawl
<yorickpeterse>
Then again I don't live in a third world country such as the US
<undeadaedra>
:D
<Senjai>
yorickpeterse: LOL! Canada here
<ZOMGITSABEAR>
>us
<ZOMGITSABEAR>
>third world country
<ZOMGITSABEAR>
lol?
<jhass>
it's true
<undeadaedra>
sorry, fourth
<yorickpeterse>
Isn't Canada just the US but with the guns replaced with maple syrup?
<ZOMGITSABEAR>
i mean, i know shit is bad here, but third world? c'mon
<shevy>
and colder weather
<shevy>
actually they also have lots of guns
<Senjai>
Yes, + public health care and services that actually work
<shevy>
stolen from europe!!!
<ZOMGITSABEAR>
canadians love their hunting and sport shooting
<yorickpeterse>
except the giant potholes in Toronto
<ZOMGITSABEAR>
just don't have full auto
<ZOMGITSABEAR>
alright, i'm getting distracted. i need to go back to studying
<shevy>
do they have polar bears in Canada?
nateberkopec has joined #ruby
<ZOMGITSABEAR>
i'll be back in here with more questions, most likely. hahaha
<undeadaedra>
shevy: only positive ones.
<ZOMGITSABEAR>
^lol
bruno- has quit [Read error: Connection reset by peer]
pikos has joined #ruby
bruno- has joined #ruby
aapole has quit [Ping timeout: 276 seconds]
duoi has joined #ruby
duoi has quit [Changing host]
duoi has joined #ruby
drocsid has quit [Ping timeout: 252 seconds]
sharpmachine has quit [Read error: Connection reset by peer]
olistik has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
erts has quit [Ping timeout: 265 seconds]
francois_ has joined #ruby
startupality has quit [Read error: Connection reset by peer]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit []
<mwlang>
Shouldn’t the US be like the 9000th world country? I mean, it’s only ~400 years old…surely more than three countries have come before...
sharpmachine has joined #ruby
casadei has quit [Remote host closed the connection]
<jhass>
not sure where the "instead of" is coming from, but yes
nikhgupt has joined #ruby
<mwlang>
eam: true, dat.
<imperator>
gimmick shoehorned into core by the FP proponents, looks like poo, never see it used in production code
nobitanobi has joined #ruby
<Senjai>
imperator: We use it all the time
<elaptics>
imperator: you haven't seen my production code then :)
<dfockler>
jhass: I was thinking of passing a block and yielding is that incorrect?
mrmargolis has quit [Ping timeout: 250 seconds]
rbowlby has joined #ruby
<Senjai>
imperator: IMO its better than saying lambda explicitly
<phat4life>
dfockler: yield all the things!
<jhass>
dfockler: perhaps? that question is a bit vague
<imperator>
should probably switch languages if you want FP then
<phat4life>
ocaml ftw
pikos has left #ruby ["..."]
<Senjai>
imperator: Lambdas aren't just for FP
<dfockler>
jhass: I'm understand it vaguely :P
<dfockler>
understanding
<jhass>
I guess ;)
<Senjai>
We have Procs, lambdas are just stricter procs (kind of)
<imperator>
phat4life, got smp?
nikhgupta has quit [Ping timeout: 265 seconds]
<ZOMGITSABEAR>
so let's say you've got a ine that says something like puts num_one.to_s
<ZOMGITSABEAR>
what is that and what does it do
<imperator>
i tried to learn ocaml at one point....jeesh
<mwlang>
You know….I’d like to read a good in-depth article on Procs vs. Lambdas…I don’t quite grok their differences.
<ZOMGITSABEAR>
i know it's to a string, but what does that mean
<imperator>
it's fast, but gawd, that syntax, could not deal
<Senjai>
ZOMGITSABEAR: Convert num_one to a string, pass that string to the puts function
<Senjai>
puts will print it to stdout, usually the terminal
<ZOMGITSABEAR>
um
<ZOMGITSABEAR>
...........
<ZOMGITSABEAR>
but what is a string
<wasamasa>
not a bear
<undeadaedra>
:D
<Senjai>
ZOMGITSABEAR: Sorry dude, you should pick up a book, thats the basic of basics :P
<ZOMGITSABEAR>
gotcha. now i know ruby
_djbkd has quit [Remote host closed the connection]
<ZOMGITSABEAR>
:p
* wasamasa
feels uneasy about allcaps nicks
diegoviola has quit [Changing host]
diegoviola has joined #ruby
<Senjai>
ZOMGITSABEAR: I recommend programming ruby, by the pragprog guys
<elaptics>
imperator: do you just pass lambda as-is in methods then? i.e. method_name lambda { puts "hi" } instead of method_name -> { puts "hi" }
<undeadaedra>
ZOMGITSABEAR: Strings are a basic programming structure, almost any language has it.
<ZOMGITSABEAR>
ah ok
<wasamasa>
except C!
<Senjai>
any modern language
_djbkd has joined #ruby
<Senjai>
wasamasa: I wouldnt mention that, if he doesnt know what a string is I wouldnt want to bother him with the intricacies around strings vs character arrays, or the subtle differences between languages
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AndroidLoverInSF has joined #ruby
<Outlastsheep>
Makes you wonder how those people even get by on IRC.
<Outlastsheep>
With such a nick you're bound to get banned in most places.
* jhass
shrugs
<Outlastsheep>
Oh well.
erts has quit [Quit: erts]
segfalt has joined #ruby
aaeron has quit [Client Quit]
<bougyman>
maybe it's sarcastic
<jhass>
nah, kid trying to offend people, that's all, don't worry about it
Volsus has joined #ruby
<Outlastsheep>
Whatever it is, it's gone now.
* Outlastsheep
goes back to work.
<hal_9000>
what does Outlastsheep mean anyway? :)
failshell has joined #ruby
cirn0 has joined #ruby
corehook has quit [Remote host closed the connection]
episage has quit [Ping timeout: 265 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
<TvL2386>
hi guys, anybody familiar with rabbitmq and bunny?
<jhass>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
<TvL2386>
-_-
<Outlastsheep>
hal_9000: Oh, one sec...
RegulationD has joined #ruby
corehook has joined #ruby
<Outlastsheep>
My original name was 'Fiestaguy', which turned into 'Fiestasheep' after I discovered my new favourite animal (They're so fluffy and adorable! ^w^) Then someone gifted me the horror game 'Outlast' on Steam.
lkba_ has joined #ruby
<hal_9000>
ah, it all makes sense
<Outlastsheep>
I changed my AFK-Nick to 'Outlastsheep' (As-in 'playing outlast'.) I was playing the game so often (and thus used this nick so often) the people in an IRC Channel I staff started knowing me as 'Outlastsheep' rather than 'Fiestasheep' And thus I kept this name.
charliesome has quit [Quit: zzz]
AlphaAtom has joined #ruby
mister_solo has quit [Ping timeout: 256 seconds]
nofxx has quit [Ping timeout: 272 seconds]
<Outlastsheep>
Besides, I've stuck with 'Fiesta' for 4 years now. Nice to get a change now and then.
<TvL2386>
alrighty: I'm thinking of replacing our proprietary MQ stuff (implementing RPC) with a standard using RabbitMQ and the bunny gem. I'm implementing the RPC server pattern but think it's a bit too complex and would like to make it simpler by hiding the nasty stuff... Not sure how to do that though... I was wondering if anybody ever tried to do the same thing
luksaur has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
kahuna_ has quit [Remote host closed the connection]
aaeron has joined #ruby
jackjackdripper has joined #ruby
lkba has quit [Ping timeout: 276 seconds]
rgs_ has quit [Quit: leaving]
rgs has joined #ruby
RegulationD has quit [Ping timeout: 264 seconds]
ndrei_ has joined #ruby
claw has quit [Remote host closed the connection]
msgodf has joined #ruby
msgodf has quit [Max SendQ exceeded]
Igorshp has quit [Remote host closed the connection]
simplyianm has quit [Remote host closed the connection]
bayed has quit [Quit: Connection closed for inactivity]
<bnagy>
yes
simplyianm has joined #ruby
msgodf has joined #ruby
<bnagy>
probably wouldn't do it again, tbh, there are much more mature options off the shelf now
tvw has quit [Remote host closed the connection]
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
msgodf has quit [Max SendQ exceeded]
<Senjai>
TvL2386: You dont gain much from using Rabbit
<TvL2386>
bnagy, like what?
ndrei has quit [Ping timeout: 256 seconds]
bricker has quit [Ping timeout: 245 seconds]
<Senjai>
Not in ruby at least
failshell has quit [Remote host closed the connection]
whippythellama_ has quit [Quit: WeeChat 1.2]
whippythellama has joined #ruby
renderful has joined #ruby
failshell has joined #ruby
<TvL2386>
Senjai, the purpose is to replace a legacy MQ "network" of clients/workers... The current infrastructure is heading into a wall due to being old and soon I will run into backporting legacy libs (libzmq v2)
<TvL2386>
Senjai, I need to start looking for a replacement and rabbitmq caught my eye
msgodf has joined #ruby
bMalum has joined #ruby
<TvL2386>
it's also in use for mcollective which is doing stuff with puppet (not my project), anyway: we already have rabbitmq and I just thought it would be good to use it
<toretore>
TvL2386: what's the reason you want to replace it specifically?
msgodf has quit [Max SendQ exceeded]
withnale____ has quit [Ping timeout: 264 seconds]
francois_ has quit [Remote host closed the connection]
<TvL2386>
toretore, because the current MQ infrastructure is made by a single person in the company and is not based on any standards. The workers, clients and broker are all self invented making use of libzmq package, ffi, ffi-rzmq...
dionysus69 has joined #ruby
hahuang65 has quit [Ping timeout: 276 seconds]
msgodf has joined #ruby
mister_solo has joined #ruby
endash has quit [Quit: endash]
<Senjai>
TvL2386: Sidekiq, Resque
<TvL2386>
it's outdated and needs an upgrade... Instead of investing in this proprietary solution, I'd like to adopt standards and not reinvent the wheel
<Senjai>
TvL2386: If its super basic you can go with delayed job
<toretore>
TvL2386: and what's wrong with it?
msgodf has quit [Max SendQ exceeded]
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<toretore>
TvL2386: amqp/rabbitmq is easy, at least if you know how it works already
bricker has joined #ruby
momomomomo has quit [Ping timeout: 244 seconds]
episage has joined #ruby
<toretore>
it's like rails, it does most of the things you want out of the box
symbol has joined #ruby
cosmicfires has quit [Quit: bye...]
nikhgupta has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
msgodf has joined #ruby
momomomomo has joined #ruby
ntln has quit [Ping timeout: 265 seconds]
<TvL2386>
Senjai, it's not super basic... The workers need to run on certain machines and do things like firewall reload, vpn creation, vm deployment etcetera
sharpmachine has quit [Read error: Connection reset by peer]
simplyianm has joined #ruby
edwinvdgraaf has joined #ruby
<Senjai>
TvL2386: That sounds basic
<TvL2386>
toretore, you're not mentioning bunny
aaeron has quit [Quit: Leaving.]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<TvL2386>
toretore, gonna checkout amqp
<Senjai>
What the job does isn't what makes it complex
<Senjai>
Do the workers have to be organized into queues?
shock_one has quit []
msgodf has quit [Remote host closed the connection]
<Senjai>
Do they automatically prioritize things? Do things have to wait for workers to finish their jobs?
<Senjai>
etc
chinmay_dd has quit []
GPrime has joined #ruby
rcvalle has quit [Ping timeout: 250 seconds]
aapole has joined #ruby
sharpmachine has joined #ruby
<toretore>
TvL2386: amqp is the protocol
<TvL2386>
well... these workers run on certain machines and only do a single job. The worker on the firewall is able to install the ruleset and reload. The worker running on a management machine interacts with Cisco to create a vpn account. They are connected to a MQ broker awaiting instructions
<toretore>
bunne is a ruby library that implements it
<toretore>
bunny
sohrab has joined #ruby
episage has quit [Ping timeout: 244 seconds]
Scroff has joined #ruby
aaeron has joined #ruby
<TvL2386>
toretore, yeah I checked... ruby-amqp is an existing lib built around event-machine, but they refer to bunny unless event-machine is a requirement
krisquigley has joined #ruby
theery has joined #ruby
<toretore>
it's the same thing, one uses em one doesn't
mister_solo has quit [Ping timeout: 245 seconds]
j4cknewt_ has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<TvL2386>
toretore, clear :-)
rubie has joined #ruby
<TvL2386>
ah well... time to play with bunny :-)
toretore has quit [Quit: This computer has gone to sleep]
casadei has joined #ruby
sohrab is now known as omosoj
jwaldrip has quit [Quit: Be back later ...]
omosoj is now known as sohrab
keernel has joined #ruby
krisquigley has quit [Ping timeout: 256 seconds]
jwaldrip has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
<diegoviola>
I need to make some HTTP calls from sinatra, i.e. hit some API and return/parse json from it, any ideas how?
<diegoviola>
I asked on #sinatra but it's quiet over there
blackmesa has joined #ruby
<jhass>
how would you do it outside sinatra?
dgutierrez1287 has joined #ruby
tedstriker has quit [Quit: Anti-Fraping status set.]
<diegoviola>
via curl
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
<Senjai>
Just because arrays of constant symbols are annoying
learath has joined #ruby
cornytoad_ has joined #ruby
ogpastal_ has joined #ruby
hahuang65 has joined #ruby
<learath>
is there a clean/correct way to iterate through an array, and return true if [any|all] array elements return [true|false]
<undeadaedra>
any? and all?, iirc
<LiquidInsect>
[1,2,3].any?{|number| number == 1}
<LiquidInsect>
[1,2,3].all?{|number| number == 1}
jwaldrip_ has quit [Ping timeout: 245 seconds]
rdark has quit [Quit: leaving]
jwaldrip_ has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ponyo>
When we use a symbol, we don't define it's value, it's existence is all we care about?
DashNine has quit [Quit: Process terminated]
<learath>
LiquidInsect/undeadaedra: thanks
davedev24_ has joined #ruby
ogpastaling has quit [Ping timeout: 256 seconds]
nikhgupta has quit [Remote host closed the connection]
<LiquidInsect>
Ponyo: basically, yes. A symbol is just an identifier
davedev2_ has quit [Ping timeout: 265 seconds]
mdw has joined #ruby
otherj has joined #ruby
<Ponyo>
Ok I think that helps finally put them in place. I'm still not sure why reduce needs a symbol and not a string, but at least symbols are making more sense :)
rbowlby has joined #ruby
Outlastsheep is now known as zz_Outlastsheep
<undeadaedra>
because reduce requires a symbol
<undeadaedra>
symbols are used as fixed identifiers, such as method names
drew0 has quit [Remote host closed the connection]
<baweaver>
here's the thing though on that
<baweaver>
+ is a method on numbers
<baweaver>
so symbol to proc makes perfect sense there
<baweaver>
except
drewo has joined #ruby
<baweaver>
it requires an argument
<diegoviola>
I have some code that does res = Net::HTTP.get_response(uri) and I get this back with res.body:
<diegoviola>
=> "{\n \"type\": \"search_results\",\n \"total\": 1,\n \"results\": [\n {\n \"type\": \"article\",\n \"article_id\": 792488,\n \"url\": \"https://demo360.neoassist.com:80/API/kb/articles/792488.json\",\n \"title\": \"Como fa\xC3\xA7o para comprar um presente?\",\n \"body\": \"Lojas<br>Loja Virtual<br>Produtos com possibilidade de
<diegoviola>
undeadaedra: so I have to do hash["results"].first to get teh first and so on?
<baweaver>
Why don't you try and find out?
djdarkbeat has quit [Quit: djdarkbeat]
<baweaver>
you already have it in a REPL
<diegoviola>
right
jwaldrip_ has quit [Ping timeout: 255 seconds]
baweaver has quit [Remote host closed the connection]
<mdw>
hey guys, what is Rails going to do to improve scalability? It seems everyone is ditching Rails once they hit scale (was just reading Parse blog on how the moved to Go from Ruby/Rails). I love Rails when I'm working on side projects (easy to use, convention over configuration, etc) but I'm worried it's going to fade away from relevance if it doesn't address some things.
jwaldrip_ has joined #ruby
oo_ has quit [Ping timeout: 252 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spider-mario has joined #ruby
<jackjackdripper>
I'm trying to parse long ass json returned by collins and within the json are some arrays I would like to sort the data in that array. so it will come to doing something like parsed["data"]["Data"][0]["ASSET"]["TAG"] I plan to just go through 0 to what ever until end if it returns nil. in which I get NoMethodError: undefined method `[]' for nil:NilClass. any way I can escape this?
<otherj>
mdw, this is a pretty tired question
<otherj>
mdw, if you can't scale rails you're doing it wrong
corehook has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
<undeadaedra>
?rails mdw
<ruboto>
mdw, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
jenrzzz has quit [Ping timeout: 245 seconds]
<otherj>
he's not asking there because he knows he can't troll this there
mary5030 has joined #ruby
<mdw>
otherj i'm not trolling
<mdw>
and I don't think your response is very helpful to be honest
<centrx>
mdw, "Everyone" is not ditching Rails for scalability
<centrx>
mdw, The most common examples of this are giant Top 10 websites that typically use their own custom implementations of things anyway
<otherj>
I'm not sure you should expect a "helpful" answer when you ask a trollish question and obviously without doing any research
kadoppe has quit [Ping timeout: 244 seconds]
<mdw>
the truth many people are now moving away from Rails and personally I think it's a bit concerning. I've been following Elixir lang (I link Ruby syntax) and Phoenix promises to do what Rails can't.
<mdw>
(I like*)
* otherj
yawns
<centrx>
There are a lot of unstated assumptions in what you're saying
swgillespie has joined #ruby
frem has joined #ruby
<undeadaedra>
meh
sandstrom has joined #ruby
<mdw>
well it seems the problem is the one-process per request nature of Rails
<mdw>
and things like Eventmachine and JRuby have their own problems
<undeadaedra>
wow
kadoppe has joined #ruby
<diegoviola>
I don't want to have to do response["results"].first though
<undeadaedra>
you don't have to
<Senjai>
mdw: Really, I'm pretty sure a lot of people are moving to Rails
wallerdev has quit [Quit: wallerdev]
AlphaAtom has joined #ruby
<Senjai>
Rails can be scaled just fine
<diegoviola>
undeadaedra: how else do I get the "body" there
<diegoviola>
then
ylla has quit [Ping timeout: 252 seconds]
<undeadaedra>
depends on what you want to do
<Senjai>
If you want websockets, don
<Senjai>
don't use rails
<Senjai>
Thats a given.
<diegoviola>
undeadaedra: access the body from results
konieczkow has joined #ruby
<Senjai>
You can have that built in a language meant to solve that problem
<Senjai>
and use it with rails
Yiota has joined #ruby
<undeadaedra>
Hashes and Arrays have plenty of methods to iterate and transform data, diegoviola
<mdw>
Senjai I live in London, I don't see many Rails contracts (though I guess in the US it's different). I would like to see that change but businesses here want scalability.
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jphenow has quit [Quit: Be back later ...]
francois_ has joined #ruby
duderonomy has joined #ruby
aryaching_ is now known as aryaching
<mdw>
Senjai yes, Phoenix does websockets much better than Rails
<diegoviola>
undeadaedra: that makes sense
<Senjai>
mdw: I dont know man, we have clients that are extremely large and operate just fine.
micmus has quit [Ping timeout: 265 seconds]
<Senjai>
mdw: Yeah, but you dont need websockets. Very rarely.
dagda1 has joined #ruby
<Senjai>
Unless you're developing like a game or something
cornytoad_ has quit []
Scroff has quit [Remote host closed the connection]
<undeadaedra>
there's much more to scalability than just rails
ponga has quit [Quit: Connection closed for inactivity]
jphenow has joined #ruby
<mdw>
(i'm a mobile app developer usually, and whenever I build side projects for API's I don't care much for the V in the MVC, I just want a headless API).
<havenwood>
mdw: They could have moved from Rails to Roda. I don't know why they're averse to deploying and tuning the JVM.
edwinvdgraaf has quit [Remote host closed the connection]
simplyianm has joined #ruby
dzejrou has quit [Read error: Connection reset by peer]
Scrofff has joined #ruby
jphenow has quit [Quit: Be back later ...]
<dukedave>
I feel like there is a better way to express this, but my brain can't form it: `Array(options[:except]).any? { |o| o === self }`
mrmargol_ has quit [Read error: Connection reset by peer]
mrmargolis has joined #ruby
Scroff has quit [Ping timeout: 250 seconds]
jphenow has joined #ruby
nikhgupta has joined #ruby
wallerdev has joined #ruby
jobewan has quit [Remote host closed the connection]
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Senjai>
dukedave: === doesnt exist in ruby :P
<Senjai>
At least I dont think it does
corehook has quit [Remote host closed the connection]
<Senjai>
unless you define it
axl_ has quit [Ping timeout: 250 seconds]
<jhass>
it does but we pretend it doesn't
dg-ratiodata has quit [Ping timeout: 256 seconds]
edwinvdgraaf has joined #ruby
<Senjai>
jhass: DEAR GOD
<jhass>
it's for case/when and nothing else
<Senjai>
dukedave: Array.wrap(option[:except]).detect {|x| x == self }
<Senjai>
But that still weird code to write
<jhass>
.wrap is activesupport
<Senjai>
Oh
<Senjai>
lol
axl_ has joined #ruby
<jhass>
dukedave: I feel this lacks context, can you describe it in words?
<Senjai>
^
<Senjai>
Or gist the code around it
mcclurmc has joined #ruby
<diegoviola>
how I'm supposed to parse this json data? https://gist.github.com/diegoviola/477a246892b567ae9f3b I tried JSON.parse(res.body) and that gives me a hash with an array and a hash... I tried #each like h["results"].each { |x| x["body"] } but then the body comes as an array too
<diegoviola>
and I need a string
<diegoviola>
what I'm doing wrong here?
corehook has joined #ruby
sharpmachine has quit [Remote host closed the connection]
<jhass>
?pry diegoviola
<ruboto>
diegoviola, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
platzhirsch has joined #ruby
sharpmachine has joined #ruby
NightsKing has quit [Quit: WeeChat 1.0.1]
erts has joined #ruby
<jhass>
what do you mean by "the body comes as an array too", how did you verify that claim?
DEA7TH has quit [Read error: Connection reset by peer]
corehook has quit [Remote host closed the connection]
<diegoviola>
Oops, it's actually a string, I was wrong
Xiti has joined #ruby
<dukedave>
jhass: sure! I want to say, is self 'included' options[:except], where 'included' has the same semantics as ===
<diegoviola>
sorry about that
<jhass>
dukedave: why === ?
renderfu_ has joined #ruby
k3asd` has joined #ruby
renderful has quit [Read error: Connection reset by peer]
renderful has joined #ruby
sharpmachine has quit [Remote host closed the connection]
<dukedave>
jhass: well I'm not sure what other method I'd use, other than passing in a Proc.
<dukedave>
I think of === as 'does this belong in this bucket'
rubie has joined #ruby
<jhass>
now I feel like I lack even more context
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
anyway, alternative, not necessarily superior, just equivalent: Array(options[:except]).grep(self).any?
<jhass>
for any more recommendations provide any actual context
Xeago has quit [Remote host closed the connection]
DEA7TH has joined #ruby
arooni-mobile has joined #ruby
<jhass>
hrm or did grep do arg === item, I don't even remember
shinnya has quit [Ping timeout: 265 seconds]
ogpastal_ has quit [Remote host closed the connection]
s2013 has joined #ruby
ogpastaling has joined #ruby
renderfu_ has quit [Ping timeout: 272 seconds]
InternetFriend has joined #ruby
<apeiros>
jhass: yes, ary.grep(arg) is arg === item
rubie has quit [Ping timeout: 265 seconds]
<jhass>
so nvm that
otherj has joined #ruby
gix has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
tvw has joined #ruby
ogpastaling has quit [Read error: Connection reset by peer]
nikhgupta has quit [Remote host closed the connection]
CorySimmons has quit [Quit: Bye!]
<jackjackdripper>
#number is supposed to be an array
gix has joined #ruby
<jackjackdripper>
i want to iterate and get all the tags in that array
troulouliou_dev has joined #ruby
<dukedave>
jhass: I'm using it as a filter, where options[:except] lets you define the things to exclude
<Senjai>
jackjackdripper: #{number}, not {#number}
allomov has joined #ruby
droidburgundy has quit [Remote host closed the connection]
AndroidLoverInSF has quit [Ping timeout: 256 seconds]
lfox has joined #ruby
<diegoviola>
I can see the body as string when doing: h["results"].each { |x| p x["body"] } but how do I save this in a variable so I can gsub the body? sorry for the lame question
baweaver has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
nikhgupta has joined #ruby
<jhass>
dukedave: yeah, as long as I have no clue what things is and what self is we're not getting anywhere
Xeago has quit [Remote host closed the connection]
AndroidLoverInSF has joined #ruby
baweaver has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
baweaver has joined #ruby
<dukedave>
jhass: well I'm intentionally trying to be general, but my specific case is testing if something is a class
<diegoviola>
any ideas?
simplyianm has joined #ruby
ixti has joined #ruby
<jhass>
dukedave: then I'd strongly prefer .is_a? over using Module#===
<jhass>
latter is for usage by case/when, .grep and similar
levifig has joined #ruby
<_blizzy_>
this is stumping me really hard
mrmargol_ has joined #ruby
baweaver has quit [Remote host closed the connection]
<yorickpeterse>
maloik: are pirate costumes still allowed at arrrrcamp?
psy_ has quit [Quit: Leaving]
<jhass>
diegoviola: .map? .find? depends
<Senjai>
dukedave: We also prefer duck typing against type checking
dopie has joined #ruby
krisquigley has joined #ruby
psy_ has joined #ruby
AlphaAtom has joined #ruby
<jackjackdripper>
srry i'm getting syntax error I'm trying to essentially arrive to this parsed["data"]["Data"][0]["ASSET"]["TAG"] with this parsed["data"]["Data"][#{number}]["ASSET"]["TAG"]
phizzbuzz has quit [Read error: Connection reset by peer]
nikhgupta has quit [Remote host closed the connection]
rubie has joined #ruby
<dfockler>
diegoviola: with map you can do the gsub in the map block
<yorickpeterse>
jhass: noooo, that's not the right one
<dukedave>
jhass: yeah, so I originally had `Array(options[:except]).include? self.class`, but that means you can only pass in classes to options[:except], and using is_a? has the same restriction.
<dukedave>
By comparison if I use ===, then you can pass in a class and get the same behavior, or e.g. a string and get === as defined for strings (i.e. equality)
<diegoviola>
dfockler: with #map I get a ["string string string string"]
nikhgupta has joined #ruby
<diegoviola>
an array
<al2o3-cr>
_blizzy_: a.max_by {|h| h[:foo] }
<dfockler>
diegoviola: you've got a collection of items
<_blizzy_>
al2o3-cr, jhass, thank you so much
<jhass>
diegoviola: well, the json probably is an array because there can be more than one result, perhaps you should handle that?
<jackjackdripper>
jhass thanks
simplyianm has quit [Read error: Connection reset by peer]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
simplyianm has joined #ruby
droidburgundy has joined #ruby
droidburgundy has quit [Remote host closed the connection]
<dukedave>
diegoviola: was that for someone else?
krisquigley has quit [Ping timeout: 244 seconds]
simplyianm has quit [Read error: Connection reset by peer]
<diegoviola>
sorry, no, just not sure how to handle this
gambl0re has quit [Excess Flood]
<jhass>
dukedave: *shrug* if it works for you it works for you, but maybe document that you use === for functionality there instead of style, for fellow developers sanity
simplyianm has joined #ruby
gambl0re has joined #ruby
<dukedave>
jhass: yer, I'll just make it an explicit is_a?, rather than sacrifice sanity for generality. Thanks for your input !
vudew has quit [Ping timeout: 276 seconds]
<dfockler>
diegoviola: not sure what you are wanting
bgmarx has quit [Remote host closed the connection]
<dfockler>
you can do h["results"].map { |x| x["body"].gsub(...) }
bgmarx has joined #ruby
<al2o3-cr>
diegoviola: body = h[:results].map {|x| x[:body] }.first.gsub(...) ?
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
diegoviola: body = ["ponies", "unicorns", "cats", "dogs"].sample ?
<centrx>
One of these things is not like the other things
<jhass>
I know, ponies aren't real
claw has joined #ruby
<dfockler>
Unicorns are the only ones with a horn, that's the difference
fujimura has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
<jhass>
I should've included ponycorns
michaeldeol has quit [Ping timeout: 276 seconds]
serivich has quit [Ping timeout: 272 seconds]
nobitanobi has quit []
<yorickpeterse>
> Submit CFP
<yorickpeterse>
> Your bio
<yorickpeterse>
fuck
<yorickpeterse>
I suck at writing bios :<
ixti has quit [Ping timeout: 252 seconds]
<centrx>
You're accepting proposals for your bio?
bgmarx has quit [Ping timeout: 265 seconds]
<yorickpeterse>
hahah
<diegoviola>
thanks
<yorickpeterse>
Sure, go ahead
<apeiros>
BIO: yorickpeterse, main ranter of #ruby. nuff said.
michaeldeol has joined #ruby
<yorickpeterse>
haha
<yorickpeterse>
well I did actually include that sorta in the bio
<yorickpeterse>
"Yorick is a Ruby programmer from the sunny country of The Netherlands. During the day he works on APIs, web scraping, natural language processing and a lot more. During the night he mainly works on Rubinius and Oga (an XML/HTML parser for Ruby) and occasionally rants in the Ruby IRC channel."
dopie has joined #ruby
evanjs has joined #ruby
Guest25_ has quit [Ping timeout: 255 seconds]
<yorickpeterse>
oooh, papercall.io has Vim mode
<jhass>
you forgot to highlight your love to the web scaleability of MongoDB
<yorickpeterse>
I like
hakunin_ has joined #ruby
<yorickpeterse>
jhass: neg, that's behind us now
fujimura has quit [Ping timeout: 256 seconds]
<yorickpeterse>
although I do still have one MongoDB cluster running :<
<yorickpeterse>
which thankfully only has a tiny bit of fairly boring data
nifoc has joined #ruby
otherj has quit [Quit: .]
<yorickpeterse>
bah, this Vim mode isn't actually Vim mode
<yorickpeterse>
e.g. it doesn't recognize CTRL + {
<yorickpeterse>
and it doesn't clearly show Visual mode
<yorickpeterse>
2/10 would not use again
hakunin has quit [Read error: Connection reset by peer]
<yorickpeterse>
I'd actually throw a pile of money at somebody if they could make a Chromium extension that lets me edit text fields using $EDITOR
aaeron has quit [Quit: Leaving.]
galeido has joined #ruby
<yorickpeterse>
I think the only one I ever found required some Node.js server running or something like that
quimrstorres has joined #ruby
rushed has joined #ruby
langlands has joined #ruby
nifoc has quit [Remote host closed the connection]
Channel6 has quit [Quit: Leaving]
nifoc has joined #ruby
renderfu_ has joined #ruby
treehug88 has joined #ruby
renderful has quit [Ping timeout: 265 seconds]
x1337807x has joined #ruby
quimrstorres has quit [Ping timeout: 276 seconds]
nifoc has quit [Remote host closed the connection]
rcvalle has joined #ruby
francois_ has joined #ruby
nifoc has joined #ruby
fantazo has quit [Quit: Verlassend]
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
aaeron has joined #ruby
aaeron has quit [Client Quit]
Scroff has joined #ruby
EllisTAA has joined #ruby
baweaver has joined #ruby
mdw has joined #ruby
rushed has quit [Quit: rushed]
EllisTAA has quit [Client Quit]
blazes816 has joined #ruby
francois_ has quit [Ping timeout: 276 seconds]
Xeago has joined #ruby
Scrofff has quit [Ping timeout: 252 seconds]
aaeron has joined #ruby
blackmes1 has joined #ruby
ZergCoder has joined #ruby
Scrofff has joined #ruby
<ZergCoder>
This may be a stupid question, but can Ruby do everything Python can do and vice-versa?
baweaver has quit [Remote host closed the connection]
<bougyman>
they're both general purpose programming languages.
<bougyman>
so: sure.
<yorickpeterse>
conceptually, probably
EllisTAA has joined #ruby
dblessing has joined #ruby
tcrypt has quit [Ping timeout: 276 seconds]
<joevandyk>
if i have data = [{f: 2, g: 3}]; headers = {f: 1, g: 2}; x = []; headers.each { |k, v| x << data[k] }; does make a copy in memory of everything in data?
InternetFriend has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Scroff has quit [Ping timeout: 272 seconds]
cabreraM516 has joined #ruby
<jhass>
no
<jhass>
btw better written with a .map
rushed has joined #ruby
NeverDie has joined #ruby
<ZergCoder>
OK thanks bougyman and yorickpeterse
alexherbo2 has quit [Quit: WeeChat 1.2]
dopie has quit [Quit: This computer has gone to sleep]
<ZergCoder>
I've gotten familiar with Ruby syntax for the most part and I wanted to start on a personal project
sharpmachine has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
sumark has quit [Remote host closed the connection]
ixti has joined #ruby
Scrofff has quit [Ping timeout: 276 seconds]
cabreraM516 has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
Scrofff has joined #ruby
sumark has joined #ruby
sharpmachine has joined #ruby
JoshL has quit []
jenrzzz has joined #ruby
Scroff has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
<ZergCoder>
jhass: quick question
triangles has joined #ruby
rbennacer has joined #ruby
<ZergCoder>
is making an image scraper like that difficult with vanilla ruby?
<BanzaiJoe>
also searching for regex and parsing xml will get you into Dante's 3rd layer of hell
flughafen_ has quit [Ping timeout: 256 seconds]
rjno has quit [Remote host closed the connection]
wallerdev has joined #ruby
Scroff has joined #ruby
<centrx>
ZergCoder, if by vanilla Ruby you include Nokogiri or Mechanize, no it's easy
<bougyman>
nokogiri is anything but vanilla ruby
<jhass>
ZergCoder: "difficult" is relative, it wouldn't be difficult for me I just wouldn't see why I'd need to make it harder than it could be by using a library
<ZergCoder>
oh i meant without any libraries or frameworks
<jhass>
there's nothing "impure" about using a library
arturhoo has quit [Quit: arturhoo]
cirn0 has quit [Remote host closed the connection]
<bougyman>
ZergCoder: a scraper in python without using any libraries would not be any easier or harder, to go back to your initial query.
troulouliou_dev has quit [Quit: Leaving]
<centrx>
Yeah not sure what the point of re-implementing everything is
Dreamer3 has quit [Read error: Connection reset by peer]
jxpx777 has quit [Read error: Connection reset by peer]
rjno has joined #ruby
<bougyman>
you'd basically write mechanize, and write a parser, instead of using nokogiri and mechanize.
starfox_sf has joined #ruby
jwaldrip_ has quit [Read error: Connection reset by peer]
Dreamer3 has joined #ruby
RegulationD has quit [Read error: Connection reset by peer]
<BanzaiJoe>
crawl, then stand, then walk, then run, then fly, then invent spaceships
blackmes1 has quit [Read error: Connection reset by peer]
EllisTAA has quit [Quit: EllisTAA]
jwaldrip_ has joined #ruby
cirn0 has joined #ruby
deric_skibotn has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
<ZergCoder>
I guess I'm just used to completely writing my projects from my own code so I feel like I get a good grasp of the language
<centrx>
Does that include the standard library, do you have to reimplement HTTP and TCP too?
centrx has quit [Remote host closed the connection]
<ZergCoder>
although my own projects have been pretty simple
Scrofff has quit [Ping timeout: 256 seconds]
premera has quit [Read error: Connection reset by peer]
<BanzaiJoe>
ZergCoder there are many people writing or rewriting libraries so that the rest of us don't have to reinvent the wheel
centrx has joined #ruby
<ZergCoder>
I see your guy's point
deric_skibotn has joined #ruby
x0f has quit [Ping timeout: 250 seconds]
bihi has quit [Ping timeout: 250 seconds]
<ZergCoder>
guys'*
<jhass>
*people ;)
premera has joined #ruby
blackmes1 has joined #ruby
<ZergCoder>
or that
<ZergCoder>
thanks all
<centrx>
Robots be with you
<jhass>
can rexml parse not well formed html? I never checked
ReK2 has quit [Remote host closed the connection]
oo___ has joined #ruby
dionysus69 has quit [Quit: dionysus69]
<yorickpeterse>
No
<yorickpeterse>
It can't parse HTML to begin with
Vile` has joined #ruby
sharpmachine has quit [Ping timeout: 267 seconds]
x0f has joined #ruby
<jhass>
then there's really no point in doing it library less
preller_ has quit [Ping timeout: 250 seconds]
dudedudeman has quit [Ping timeout: 250 seconds]
<BanzaiJoe>
is not well formed html still html... let me mount the meditating stone
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DEA7TH has quit [Read error: Connection reset by peer]
lfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
yorickpeterse: does it integrate with mechanize yet? :P
<undeadaedra>
mmh, did diegoviola told you he cross-posted his issues to #sinatra?
ReK2 has joined #ruby
<jhass>
yes
bihi has joined #ruby
<yorickpeterse>
jhass: No idea
<jhass>
well, the API requests one
yfeldblum has joined #ruby
<BanzaiJoe>
yorickpeterse you ever see David Baez video on metaprogramming in python 3?
<yorickpeterse>
BanzaiJoe: No, I don't really follow the Python world
rbennacer has quit [Remote host closed the connection]
sharpmachine has joined #ruby
<yorickpeterse>
I last wrote Python years ago
Rapier- has quit [Quit: (null)]
dudedudeman has joined #ruby
nonparfumee has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
oo___ has quit [Ping timeout: 252 seconds]
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
aapole has quit [Remote host closed the connection]
victortyau has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BanzaiJoe>
he's been PyCon keynote several times, great speaker, he goes off the deep end, seriously, with metaprogramming, it's the kind of video that's great to put up during washing dishes ( https://www.youtube.com/watch?v=sPiWg5jSoZI&ab_channel=NextDayVideo ), it's 3 hours long, so little chucks at a time
<dfockler>
what's a pull parser vs a regular parser?
<diegoviola>
undeadaedra: sorry about that
<wasamasa>
dfockler: guess it's about inversion of control
<jhass>
yeah, a pull parser consumes as the user requests data
<undeadaedra>
diegoviola: no worries
yardenbar has joined #ruby
<undeadaedra>
found strange that the discussion moved, that's all :)
preller_ has joined #ruby
<wasamasa>
the pull parser walks down and emits events you can make use of
<yorickpeterse>
dfockler: in the case of a pull parser you usually have to advance the parsing process yourself, allowing you to process input as it comes in
<yorickpeterse>
a regular parser parses the whole input and then gives you some sort of result based on it
moshee has joined #ruby
sharpmachine has quit [Read error: Connection reset by peer]
<yorickpeterse>
pull parsers typically use less memory because they (usually) don't keep anything around after they've processed a chunk
<wasamasa>
or, hmm
<wasamasa>
all this xml parsing is confusing the hell out of me
<yorickpeterse>
:P
<wasamasa>
it should only matter anyways if you're processing huge amounts
Igorshp has quit [Remote host closed the connection]
<wasamasa>
for a one-off parsing task just let your plain old parser return something tree-like you can then dissect as you wish
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dfockler>
like processing a stream vs processing a discrete data set
rbennacer has joined #ruby
DEA7TH has joined #ruby
jlast has quit [Remote host closed the connection]
<yorickpeterse>
the tl;dr is:
jlast has joined #ruby
<yorickpeterse>
DOM: one big massive tree, typically easy to use at the cost of more memory usage
<yorickpeterse>
SAX: do everything yourself, typically events are emitted for every node type and you have to construct everything manually. Costs more work, much lower memory usage, more control
<phat4life>
what about react
<phat4life>
virtual dom
<yorickpeterse>
Pull parsing: sorta in the middle of the two. Not as heavy as DOM/tree parsing, not as lightweight as SAX parsing
<wasamasa>
phat4life: that's got little to do with that
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<undeadaedra>
virtual dom = dom, no?
<yorickpeterse>
phat4life: unrelated to parsing
<phat4life>
gotcha
<Senjai>
yorickpeterse: You know too much about parsing
<yorickpeterse>
dfockler: typically SAX parsing is used when you want to process GBs of data
Alayde_ has joined #ruby
<undeadaedra>
you can not know too much about parsing
<wasamasa>
phat4life: it's a nice abstraction for frontend programming in a more declarative way
vudew has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
Senjai: I banged my head against a wall for this for the past year or so :P
sandstrom has joined #ruby
mdz_ has quit [Remote host closed the connection]
<phat4life>
i wrote a tokenizer once
<dfockler>
yorickpeterse: that makes sense, I'm reading through some of the Oga code
<phat4life>
also trees are awesome
<Senjai>
yorickpeterse: I will have to pick your brain on things sometime
<yorickpeterse>
I still need to write stuff about LL(1) parsing, existing docs are _really_ bad on the subject
mdz_ has joined #ruby
<phat4life>
there are all kinds of trees
<phat4life>
red/black trees, quad trees
<yorickpeterse>
oak trees
<phat4life>
balanced trees
<yorickpeterse>
:P
gianlucadv has quit [Ping timeout: 264 seconds]
<phat4life>
i dont' have enough trees in my life :|
allomov has quit [Remote host closed the connection]
<yorickpeterse>
Senjai: feel free to, I'm in here basically 24/7 anyway
sharpmachine has joined #ruby
<phat4life>
have you ever recruited someone from irc (ive seen it happen in a different chanel)
Alayde has quit [Ping timeout: 272 seconds]
jlast has quit [Ping timeout: 252 seconds]
Igorshp has joined #ruby
baweaver has quit [Remote host closed the connection]
<yorickpeterse>
I've asked people, but never managed to hire someone
slumos has joined #ruby
<yorickpeterse>
they either flock to Soundcloud or INRA
<Senjai>
phat4life: I was hired from IRC
* yorickpeterse
looks sternly at ddfreyne
wildroman2 has quit [Ping timeout: 246 seconds]
<dfockler>
yorickpeterse: :P So you have to write an Xpath parser before you can utilize xpath selectors?
<yorickpeterse>
dfockler: If they're written in XPath, yes
<yorickpeterse>
Because Ruby doesn't know what "/foo/bar[@x="y"]" means
allomov has joined #ruby
_djbkd has quit [Remote host closed the connection]
<dfockler>
what does nokogiri do for that?
<ericmeds>
simplecov is confusing - it’s showing like 90% coverage - i know that isn’t accurate
<jhass>
dfockler: ask libxml2, which it is a binding to
yardenbar has quit [Quit: Leaving]
bruno- has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
_djbkd has joined #ruby
mdz_ has quit [Ping timeout: 276 seconds]
<yorickpeterse>
dfockler: delegates all of it to libxml2
<phat4life>
sweet who wants to hire me
<undeadaedra>
ericmeds: look detailed results, it generates a html report
<yorickpeterse>
They have a parser for CSS expressions
<dfockler>
ah bummer
<yorickpeterse>
they translate that to XPath and then delegate that again
<ericmeds>
undeadaedra: yeah it includes the tests in the spec/ dir but shows a high percentage of coverage - is it evaulating the entire app code?
DEA7TH has quit [Changing host]
DEA7TH has joined #ruby
<Senjai>
phat4life: I would go contribute to an open source project in the industry you want to be in
fabrice31 has joined #ruby
<undeadaedra>
ericmeds: code loaded after starting SimpleCov
<Senjai>
phat4life: Also, feel free to poke CanCanCan >.> <.<
<phat4life>
I have an amazing project i am working on already, however finishing it is difficult because it uses technologies i don't fully understand
<undeadaedra>
ericmeds: so you should do the SimpleCov.start in your spec_helper
idafyaid has joined #ruby
<dfockler>
yorickpeterse: do you think you'll split the xpath parser into another gem?
<ericmeds>
yeah I added that
<undeadaedra>
and load your code to test *after*
<phat4life>
Senjai: i am working on a JS port of milkdrop to webgl
<ericmeds>
something just doesnt seem right i dont think we have such great coverage
skade has joined #ruby
<undeadaedra>
open the report and see
<phat4life>
Senjai: webgl is amazing
<undeadaedra>
simplecov report is well done
<ericmeds>
do I need to set config.eager_load = true in /config/environments/test.rb
<Senjai>
phat4life: Sure, except for the javascript part xD
<ericmeds>
-/
<Senjai>
phat4life: Wanting to work in browser games or?
<undeadaedra>
ah, rails?
pdoherty has quit [Ping timeout: 244 seconds]
<ericmeds>
yeah
<ericmeds>
rails
<yorickpeterse>
dfockler: no
<phat4life>
Senjai: maybe
<phat4life>
my ultimate goal is to freelance webgl
<yorickpeterse>
people can yank the parser out of Oga if they want, but gemifying it will probably do me more harm than good
<phat4life>
i might do some backend stuff with sinatra
nikhgupt has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
<phat4life>
for one of the projects, or slanger specifically
<undeadaedra>
ericmeds: ask #RubyOnRails, they may know better.
allomov has quit [Ping timeout: 265 seconds]
senayar has joined #ruby
senayar has joined #ruby
<phat4life>
do any of you use slanger?
<Senjai>
phat4life: Just use rails
<phat4life>
i need websocket
diegoviola has quit [Quit: WeeChat 1.2]
nikhgupta has joined #ruby
<Senjai>
phat4life: use elixer or go
<Senjai>
:P
<phat4life>
rails is over kill
<Senjai>
Would not recommend ruby for websockets
rushed has quit [Quit: rushed]
LMity has joined #ruby
<bougyman>
i used EM::Websockets and it's been rock solid.
fabrice31 has quit [Ping timeout: 272 seconds]
<bougyman>
up and running in a busy prod environment for 6 years.
<Senjai>
bougyman: Not saying you cant :P
<Senjai>
Just that there are better solutions for it
<bougyman>
depending on one's definition of better.
<undeadaedra>
ericmeds: when I did it, I put `SimpleCov.start 'rails'` in top of my spec_helper. See SimpleCov documentation, it may have a section for rails.
idafyaid has quit [Remote host closed the connection]
<shevy>
now all that it takes is to have ruby instead of javascript
<c-c>
Senjai: tell me more?
idafyaid has joined #ruby
<undeadaedra>
shevy: opal is one step towards it
mrgrieves has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ericmeds>
undeadaedra: i will check it out
idafyaid has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segfalt has quit [Quit: segfalt]
<phat4life>
we use it slanger for websockets
quimrstorres has joined #ruby
<mrgrieves>
hi, what can I do to print the digits on a string like this "application_name_anysize_1223"
<phat4life>
and its currently broken, and i have no idea how to fix it :(
idafyaid has joined #ruby
<phat4life>
well,, its rails -> slanger -> pusher
<Senjai>
c-c: bougyman: The erlang VM is well suited to websockets, due to how it organizes erlang processes. Each process can have tons of processes, which is ideal for websockets.
Nieralyte has joined #ruby
tomphp has joined #ruby
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
<jhass>
mrgrieves: print? you mean you have a string like that and want to extract a substring for the digits?
<ruboto>
c-c, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<bougyman>
jhass: my side ended a long time ago.
datanoise has joined #ruby
<yorickpeterse>
c-c: in Erlang processes are more like coroutines with their own memory
<Senjai>
jhass: aye, thats fine
<yorickpeterse>
they're not Unix processes
<jhass>
bougyman: sorry, have seen you highlighted in the conversation
<bougyman>
no worries.
<bougyman>
when it gets off-ruby I bail.
<Senjai>
To be fair, it didnt go too far off
<Senjai>
Use something else, like what?, why?
<Senjai>
that's about how far that went
ldnunes has quit [Quit: Leaving]
<jhass>
(I'm a bit aggressive about it atm, it's too empty ;P)
<Senjai>
empty?
x1337807x has joined #ruby
quimrstorres has quit [Ping timeout: 264 seconds]
<jhass>
#ruby-offtopic
<Senjai>
Oh
<c-c>
well, writing it in ruby get you donee faster, writing it in erlang makes it run faster
<mrgrieves>
jhass: yes, extract the digits
<Senjai>
c-c: Writing in elixer gets you done faster and makes it run faster
<yorickpeterse>
Just use Ruby and use something else when you actually need it
Casty has joined #ruby
<jhass>
mrgrieves: for your sample input, .split("_").last would suffice
<Senjai>
c-c: Elixer sits on top of erlang
bootstrappm has quit [Quit: bootstrappm]
<yorickpeterse>
instead of endless bikeshedding about "OMG USE THIS LANGUAGE BECAUSE WEBSCALE"
bootstrappm has joined #ruby
aryaching has quit [Ping timeout: 272 seconds]
<Senjai>
yorickpeterse: That's way to occamz razor of you
<c-c>
Senjai: is that a ruby interpreter?
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<c-c>
ok, nevermind, its scala for the erlang vm
_djbkd has quit [Remote host closed the connection]
<mrgrieves>
what I want to do eventually is to have a hash which elements will be application_name_anysize => 1223
davedev24_ has quit [Ping timeout: 256 seconds]
<jhass>
though I'd actually love to see all the "language X is so much better than Ruby [for Y]"-stuff in #ruby-offtopic instead of here, it's a bit much of it recently ;)
_djbkd has joined #ruby
<Senjai>
jhass: We get it, your lonely :P
sepp2k has quit [Quit: Leaving.]
<Senjai>
I still use ruby, for like, everything
<jhass>
mrgrieves: always good to ask about your actual problem then, .map {|instance| instance.split(/_(?=\d)/) }.to_h
volty has joined #ruby
cabreraM516 has quit [Read error: Connection reset by peer]
davedev24_ has joined #ruby
towski_ has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
starfox_sf has quit [Ping timeout: 256 seconds]
LMity has quit [Ping timeout: 252 seconds]
cirn0 has quit [Remote host closed the connection]
jenrzzz_ has joined #ruby
j_mcnally has joined #ruby
starfox_sf has joined #ruby
Guest25_ has joined #ruby
jenrzzz_ has quit [Client Quit]
Leef_ has joined #ruby
mrmargolis has joined #ruby
momomomomo has joined #ruby
nikhgupta has quit [Remote host closed the connection]
momomomomo has quit [Client Quit]
sharpmachine has quit [Ping timeout: 252 seconds]
nikhgupta has joined #ruby
michaeldeol has quit [Ping timeout: 265 seconds]
cabreraM516 has joined #ruby
momomomomo has joined #ruby
<episage>
whats the best way to create storage class in ruby?
<jhass>
what's a storage class?
<Senjai>
episage: lol, storage class?
jenrzzz has quit [Quit: leaving]
aaeron has quit [Quit: Leaving.]
<episage>
like i want to store some variables in 1 thing
<Senjai>
sorry, the lol was rude, could you explain?
jphenow has quit [Quit: Be back later ...]
jenrzzz has joined #ruby
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<episage>
a number, string, string , string together
<apeiros>
episage: what make Array, Hash or Struct unsuitable?
vickleton has quit [Quit: Ex-Chat]
sharpmachine has joined #ruby
<episage>
apeiros: yeah yeah i see
<episage>
Senjai: thanks
bootstrappm has quit [Quit: bootstrappm]
<apeiros>
episage: ah, or you're also asking for what exists - not just how to build your own?
jlast has joined #ruby
bootstrappm has joined #ruby
<episage>
thats right
<episage>
im very new
<episage>
started today
<episage>
:P
quimrstorres has joined #ruby
gregf has quit [Quit: WeeChat 1.1.1]
<Senjai>
episage: Structs are handy for creating generic containers of data. But for objects that have behavior you could either inherit from a struct, or define a class normally
<apeiros>
episage: ok. those 3 classes are standard container classes.
sohrab has quit [Quit: leaving]
<Senjai>
Array and Hash is probably not recommended IMO, for what you described
<Senjai>
Best give each "group" of that data a name
<Senjai>
if they're related
<apeiros>
episage: and Senjai said the rest :)
GPrime has joined #ruby
_ht has quit [Quit: Konversation terminated!]
<jhass>
episage: to add, don't actually name things number, string1, string2 etc, try to describe what they represent
rodferso2 has quit [Quit: leaving]
<jhass>
like first_name, last_name, age
<episage>
ok
<Senjai>
Aye in that case, it'd be proper to have Person
<Senjai>
and a Person has a first_name, last_name, and a age
<episage>
so should I use structs or classes if the 'thing' does not contain logic?
ndrei_ has quit [Ping timeout: 245 seconds]
<Senjai>
You could, or not.
<Senjai>
It's a good use case for structs
<Senjai>
Adding logic though, I would suggest moving away from that.
<episage>
Ok, I will go for structs then
renanoronfle has joined #ruby
<episage>
thanks for advice :)
dopie has quit [Quit: This computer has gone to sleep]
Igorshp has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 245 seconds]
bronson has joined #ruby
MatthewsFace has quit [Remote host closed the connection]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Senjai>
dostoyevsky: Doesnt sound appropriate for there either
mrgrieves has quit [Quit: Lost terminal]
atomi has quit [Read error: Connection reset by peer]
tvw has quit [Remote host closed the connection]
<dostoyevsky>
someone send me a patch and I do not know what it's about
<dorei>
can I use ConditionVariable outside a mutex.synchronize block?
<baweaver>
re Contracts: just another layer of protection allowing for cleaner reasoning for QuickCheck type libraries.
<Senjai>
baweaver: It's better than raising ArgumentError I suppose
<baweaver>
Yeah, I've used enough Haskell to be fond of the idea
<baweaver>
just curious on other thoughts.
atomi has joined #ruby
<Senjai>
baweaver: But I wouldn't use it in an application I don't think. Given solid tests and yardoc, I wouldnt want to add another library for something like that
<baweaver>
QuickCheck is amazing by the way, check it out if you haven't yet.
bootstrappm has left #ruby [#ruby]
rbennacer has joined #ruby
<ZOMGITSABEAR>
guys
<baweaver>
The big thing on that is that it kills off nil unless you explicitly allow it.
<ruboto>
ZOMGITSABEAR, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<ZOMGITSABEAR>
well then
<havenwood>
ZOMGITSABEAR: No politics here please.
<ZOMGITSABEAR>
i only brought it up because it was discussed here earlier
<ZOMGITSABEAR>
my bad
<ZOMGITSABEAR>
won't happen again
umgrosscol has quit [Quit: Quit]
AlphaAtom has joined #ruby
<baweaver>
Trolls lurk on occasion, I don't tend to check history when something partially inflammatory is posted.
ts310 has quit [Quit: leaving]
moted has joined #ruby
<Senjai>
ZOMGITSABEAR: It's a little different when theres an actual conversation going on or not.
AlphaAtom has quit [Max SendQ exceeded]
<volty>
it seems that it depends on the time of the day (when you can discuss politics or not) :)
<ZOMGITSABEAR>
ah, ok
<apeiros>
volty: it does not. but ops don't always see
AlphaAtom has joined #ruby
<phat4life>
just clevery inject politics in your ruby gists
<baweaver>
I prefer to foldLeft
<dostoyevsky>
do you know of any ruby gems that come with a Vagrantfile, is that common these days=
<dostoyevsky>
?
<havenwood>
baweaver: ha
<phat4life>
isn't inject just an alias for reduce though
vikaton has joined #ruby
<baweaver>
which is the same as foldLeft in other languages, yeah
coffee__cup has joined #ruby
benanne has quit [Quit: kbai]
tkuchiki has joined #ruby
<Senjai>
dostoyevsky: Idk, look. You're asking a lot of weird context lacking questions.
quimrstorres has quit [Remote host closed the connection]
<volty>
apeiros: yes, distracted ops don't see :)
<volty>
sometimes you inject, and sometimes you reduce, nice to have both names
<phat4life>
it really should just be foldleft
<Senjai>
Reduce is the correct term I think
gambl0re has quit [Ping timeout: 245 seconds]
<phat4life>
foldleft is more precise
<havenwood>
dostoyevsky: Hmm, I've seen vagrant boxes for projects, especially when there's complicated setup - but it's not at all a normal thing for a gem to include.
<phat4life>
i think ocaml has fold right as well
<baweaver>
you need lazy to really get mileage out of foldright
<Senjai>
baweaver: why?
GPrime has joined #ruby
j_mcnally has joined #ruby
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<volty>
Senjai: it depends on what you do, on the result, there are occasions when you get as result (e.g) an array that could be much greater, or other structures
j_mcnally has quit [Client Quit]
<volty>
when the result is a hash I prefer inject
<volty>
(to call it)
<baweaver>
it'll SO Scala real fast though
<dostoyevsky>
I also see that some links to rubyforge.org are not working anymore...
mdw has quit [Read error: Connection reset by peer]
sharpmachine has quit [Read error: Connection reset by peer]
<vikaton>
Opal needs to chnage its compilation target
<vikaton>
to WebAssembly!
d10n-work has joined #ruby
<baweaver>
Is that actually defined already or just a spec still?
<havenwood>
dostoyevsky: rubyforge has been shut down for a little over a year
edwinvdg_ has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<dostoyevsky>
yeah, strange... I wonder if I can retire my project somehow, remove it from the public gem repositories, because I think there are some problems with how I organized data back then
<baweaver>
just make a major version change then
workmad3 has joined #ruby
<jhass>
you can yank all versions but not delete it
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
_djbkd has quit [Read error: Connection reset by peer]
jlast has quit [Remote host closed the connection]
lfox has joined #ruby
_djbkd has joined #ruby
simplyianm has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
renderful has joined #ruby
TvL2386 has quit [Remote host closed the connection]
rjno has quit []
workmad3 has quit [Ping timeout: 272 seconds]
rbennacer has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jlast has quit [Ping timeout: 244 seconds]
* havenwood
dons a tophat
<triangles>
Is there anything special I need to do when rendering an ERB template that'll use Unicode characters? I get non-descriptive errors when trying to do it, and can't find any useful results on Google about it
<Senjai>
I've used class MyThing < Struct.new in certain scenarios, I don't think there is an issue with it
<jhass>
probably not, it's just kinda useless
<jhass>
Struct.new creates you a perfectly fine class
<Senjai>
Depends, if you dont need to define #initialize, and you only need one or two... formatting methods or something
<Senjai>
its totally fine
<jhass>
and even takes a block that's instance_eval'd in it
<Senjai>
oh sorry
<Senjai>
right, the block approach
<episage>
hmm but if I have "SerpSnippet = Struct.new(:blue_text)" and i want to exten this to have one extra field named "web_element"
<Senjai>
kind of forgot about that
<episage>
the WebSerpSnippet < Struct.new will dont do anything
<episage>
i guess
sharpmachine has joined #ruby
<jhass>
episage: probably not worth the inheritance, just WebSerpSnippet = Struct.new(:blue_text, :web_element)
<Senjai>
Heading out
<Senjai>
Night guys
<jhass>
night
<episage>
Senjai: cu, thanks for help
<volty>
'night
michael_mbp has quit [Excess Flood]
<episage>
jhass: I actually shortened it. In real this is that long: SerpSnippet = Struct.new(:blue_text, :green_url, :description, :desc_normal, :desc_ad, :is_ad, :index_total, :index_normal, :index_ad)
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
^ trying out did_you_mean gem
gambl0re has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
edwinvdg_ has joined #ruby
<havenwood>
'Matz hope to integrate "did_you_mean" gem to Ruby 2.3'
RickHull has joined #ruby
Akagi201 has quit [Remote host closed the connection]
quimrstorres has quit [Ping timeout: 245 seconds]
_djbkd has quit [Remote host closed the connection]
simplyianm has joined #ruby
drujensen has quit [Quit: drujensen]
krisquigley has joined #ruby
<RickHull>
i'm having an issue with incomplete stack traces. when an exception is thrown in a gem i am using, i don't get any of that gem's stack trace. the topmost stack entry is the calling code, calling into the gem
<RickHull>
incidentally, i authored that (private) gem
_djbkd has joined #ruby
<jhass>
any backtrace shortening rails shenigans possible?
edwinvdgraaf has quit [Ping timeout: 245 seconds]
<RickHull>
no
j_mcnally has joined #ruby
AndroidLoverInSF has quit [Ping timeout: 272 seconds]
<RickHull>
the gem itself is tiny, a wrapper around fog
<jhass>
does the issue appear in using fog directly?
j0n3 has quit [Quit: Leaving]
<RickHull>
not that i've seen
vkgfx has joined #ruby
AndroidLoverInSF has joined #ruby
<RickHull>
let me see if i can generate an exception in irb, requiring the gem
<vkgfx>
hey i've got a question about monkey patching a class in a framework i'm working with (vagrant) if anyone has cycles to spare
veinofstars has quit [Quit: veinofstars]
<jhass>
does it appear if you copy your gem to a application local directory (and possibly patch up $LOAD_PATH so it's found) ?
<vkgfx>
vagrant detects an error that doesn't actually exists and shuts down
<vkgfx>
there's currently no way to make it stop doing that and so after a few days of this i'm ready to just monkey patch it out
<vkgfx>
except i did that and it didn't change the communicator class
_blizzy_ has joined #ruby
<jhass>
RickHull: in the app with the problem, I'd rescue the exception and but a binding.pry into the rescue clause, then explore the exception, whether it's somehow a proxy (obj.class === obj == false), has things monkey patched (.method(:backtrace).source_location) etc.
<vkgfx>
i should point out that sudo is not a real method, it's an alias to the execute method
<jhass>
*put
<RickHull>
jhass: oh, in the calling code, it does require 'activesupport/inflector'
<RickHull>
i can repro this in the calling code, but not irb
<RickHull>
so i am narrowing down the calling code
erts has quit [Quit: erts]
triangles has quit [Quit: Leaving]
idafyaid has quit [Ping timeout: 264 seconds]
<jhass>
vkgfx: alias or alias_method?
<vkgfx>
let me check
<RickHull>
jhass: the calling code is ultimately `rake`
<jhass>
RickHull: might be, what I said above should help in finding the offender regardless
<RickHull>
the Rakefile requires a lot of lib files, and the one lib file that I can repro the error with
<RickHull>
it repros when called via `rake`
fujimura has joined #ruby
<RickHull>
but not ruby lib/foo.rb
wallerdev has joined #ruby
<jhass>
vkgfx: alias_method copies the target, it doesn't delegate and it doesn't truly alias
<vkgfx>
hmm ok
<jhass>
vkgfx: so override execute and recall alias_method to catch all
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
?pry RickHull
<ruboto>
RickHull, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<jhass>
seriously, give it a try
<vkgfx>
jhass: thanks i'll try it out
blackmes1 has quit [Quit: WeeChat 1.2]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Quit: leaving]
jenrzzz has joined #ruby
<RickHull>
jhass: looks like a rake "feature" from here. I have a two line Rakefile, require 'my-gem'; MyGem.some_method(:bad_arg)
<RickHull>
rake -T, and the exception is thrown with bad stack trace
<jhass>
RickHull: --trace ?
<RickHull>
aha
<episage>
jhass: works!
<jhass>
episage: great
<episage>
I've got another question
<jhass>
episage: composition is to prefer over inheritance anyway ;)
<episage>
class GCrawler < Struct.new(:serp)
<RickHull>
jhass: nailed it, thanks
<jhass>
GCrawler = Struct.new(:serp) you mean
<episage>
how can I use the :serp inside GCrawler class?
Al3ks has quit [Read error: Connection reset by peer]
<jhass>
episage: if you got logic and a single attribute, just forget about Struct for that instance
<episage>
I mean new class with extra field
podman has joined #ruby
<jhass>
class GCrawler
fujimura has quit [Ping timeout: 265 seconds]
<jhass>
def initialize(serp)
_blizzy_ has quit [Ping timeout: 256 seconds]
<jhass>
@serp = serp
<episage>
hold on
<jhass>
end
<jhass>
end
<episage>
serp gets updated as I call methods in GCrawler
<episage>
so I should keep it updated and accessible to world
<vkgfx>
jhass: that's not doing it. i get the feeling that it's not overwriting anything in the "real" communicator class that's running
<vkgfx>
maybe there's some fundamental misunderstanding i have about how vagrant fits together, because i've done some patching before and this just doesn't work
<jhass>
vkgfx: perhaps load order issues? your patch being loaded first?
<jhass>
or vagrant actually invoking itself so the process doesn't even see your patch?