aphprentice has quit [Remote host closed the connection]
santana has quit [Quit: leaving]
baxx has quit [Ping timeout: 244 seconds]
stardiviner has joined #ruby
davedev24_ has quit []
uptownhr has joined #ruby
serivichi has joined #ruby
<havenwood>
freedrull: Homebrew?
Spami has joined #ruby
<havenwood>
freedrull: brew tap raggi/ale && brew install openssl-osx-ca
Manolo_ has joined #ruby
A124 has quit [Remote host closed the connection]
<havenwood>
freedrull: But the ruby-build tool that rbenv uses ships its own openssl instead of using your package managers. I don't know what implication that has on certs if any.
<krowv>
I'd like to get the current coordinates of a window and then use those coordinates to open another window relative to the location of the existing window
Matt_P has joined #ruby
<Matt_P>
hi, im trying to install a gem, but it depends on another gem that cant install on my machine (there is a bug fix in the next minor version)
<Matt_P>
is it possible to trick gem in to installing 1.0.4 as 1.0.3 ?
<Radar>
no
<Radar>
install 1.0.4
<Matt_P>
or better yet installing the other gem with an updated gem version for its dependency?
bnagy_ is now known as bnagy
<Matt_P>
the package i want to install depends on a specific version :(
<Radar>
it would be helpful to know which gems you are talking about so that we can reproduce the problem on our machines
<Matt_P>
sensu -> eventmachine 1.0.3
<Matt_P>
on archLinux ruby 2.2
<baweaver>
Submit a PR to sensu to not be a pain about it
<Radar>
what baweaver said
<Matt_P>
haha :)
growlove has quit [Quit: Leaving]
<Matt_P>
is there a download gem local and install from local?
<Matt_P>
so i can just patch the gem spec?
keen___________0 has joined #ruby
<baweaver>
Most of the time it's not really needed
beneggett has quit [Quit: ...zzz ¯\_(ツ)_/¯ zzz...]
fabrice31 has quit [Ping timeout: 246 seconds]
jesterfraud has joined #ruby
casadei has joined #ruby
Ox0dea has quit [Read error: No route to host]
dfockler has quit [Ping timeout: 246 seconds]
bakedb has quit [Ping timeout: 276 seconds]
bakedb_ has joined #ruby
gianlucadv has joined #ruby
ta has joined #ruby
hanmac has joined #ruby
revath has joined #ruby
charliesome has joined #ruby
sinkensabe has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby
chinmay_dd has joined #ruby
datanoise has quit [Ping timeout: 265 seconds]
bluOxigen has joined #ruby
olistik has joined #ruby
allomov has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
towski_ has quit [Remote host closed the connection]
shafox_ has joined #ruby
shafox_ is now known as shafox
GnuYawk has quit [Quit: WeeChat 1.0]
shafox has quit [Client Quit]
towski_ has joined #ruby
GnuYawk has joined #ruby
GnuYawk has quit [Changing host]
GnuYawk has joined #ruby
shafox has joined #ruby
towski_ has quit [Remote host closed the connection]
MVPhelp has joined #ruby
GnuYawk has quit [Client Quit]
M-Technic has quit [Quit: leaving]
GnuYawk has joined #ruby
ndrei has joined #ruby
stardiviner has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
MVPhelp has quit [Remote host closed the connection]
MVPhelp has joined #ruby
peter_paule has joined #ruby
aridere has quit [Quit: Leaving]
ta has quit [Remote host closed the connection]
sarkyniin has quit [Ping timeout: 276 seconds]
postmodern has quit [Quit: Leaving]
ndhamecom has joined #ruby
sarkyniin has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
uptownhr has quit [Quit: uptownhr]
zenguy_pc has quit [Read error: Connection reset by peer]
roolo has joined #ruby
aganov has joined #ruby
lxsameer has joined #ruby
pl1ght has quit [Ping timeout: 276 seconds]
uptownhr has joined #ruby
pontiki has quit [Quit: <poit>]
fsvehla has joined #ruby
CloCkWeRX1 has joined #ruby
darkf_ has joined #ruby
pl1ght has joined #ruby
CloCkWeRX has quit [Ping timeout: 252 seconds]
darkf has quit [Ping timeout: 248 seconds]
Jarboe has quit []
darkf_ is now known as darkf
lxsameer has quit [Ping timeout: 275 seconds]
EllisTAA has joined #ruby
<EllisTAA>
this is my first time coming to the challenge just to hang out
lxsameer has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
<Radar>
coming to the where
theery has quit []
<[k->
o_O
MatthewsFace has joined #ruby
p1k has quit [Ping timeout: 255 seconds]
arescorpio has quit [Quit: Leaving.]
ndhamecom has quit [Ping timeout: 276 seconds]
A205B064 has quit [Ping timeout: 272 seconds]
avahey has quit [Quit: Connection closed for inactivity]
zenguy_pc has joined #ruby
EllisTAA has quit [Client Quit]
uptownhr has quit [Quit: uptownhr]
peter_paule has quit [Ping timeout: 264 seconds]
darkf_ has joined #ruby
uptownhr has joined #ruby
EllisTAA has joined #ruby
charliesome has quit [Ping timeout: 252 seconds]
Tempesta has joined #ruby
sinkensabe has joined #ruby
darkf has quit [Ping timeout: 248 seconds]
darkf_ is now known as darkf
p1k has joined #ruby
p1k has quit [Client Quit]
tagrudev has joined #ruby
p1k has joined #ruby
micmus has joined #ruby
charliesome has joined #ruby
uptownhr has quit [Quit: uptownhr]
uptownhr has joined #ruby
Matt_P has left #ruby [#ruby]
NightMonkey has quit [Ping timeout: 264 seconds]
CalvinnHobbes has joined #ruby
dopie has quit [Quit: Leaving]
dumdedum has joined #ruby
dopie has joined #ruby
spider-mario has quit [Ping timeout: 264 seconds]
NightMonkey has joined #ruby
darkf_ has joined #ruby
dhjondoh has joined #ruby
uptownhr has quit [Quit: uptownhr]
last_staff has joined #ruby
TvL2386 has joined #ruby
symm- has quit [Ping timeout: 264 seconds]
darkf has quit [Ping timeout: 248 seconds]
GnuYawk has quit [Quit: WeeChat 1.0]
GnuYawk has joined #ruby
GnuYawk has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
darkf_ is now known as darkf
GnuYawk has quit [Client Quit]
GnuYawk has joined #ruby
GnuYawk has quit [Changing host]
GnuYawk has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
ta has joined #ruby
C1V0 has joined #ruby
dg-ratio1 has joined #ruby
spider-mario has joined #ruby
Igorshp has joined #ruby
datanoise has joined #ruby
Igorshp has quit [Read error: Connection reset by peer]
Igorshp has joined #ruby
GnuYawk has quit [Quit: WeeChat 1.0]
EllisTAA has quit [Quit: EllisTAA]
olistik has quit [Remote host closed the connection]
codecop has joined #ruby
<TvL2386>
hi guys, I'm having an application that creates a file and writes to it for an hour and this loops indefinitely (tcpdump -G 3600). I need to upload the finished files to an ftp server. I'm wondering how I can do this. I was thinking of keeping a yaml file to register what's been uploaded. And upload based on ctime age or check if it's not in use anymore
GnuYawk has joined #ruby
techsethi has joined #ruby
uptownhr has joined #ruby
jokester has quit [Changing host]
jokester has joined #ruby
dhjondoh has joined #ruby
sandstrom has joined #ruby
oo_ has joined #ruby
atom3 has quit [Ping timeout: 276 seconds]
<al2o3-cr>
o/ oo_
atomi_ has quit [Quit: leaving]
atom3 has joined #ruby
atomi has joined #ruby
sarkyniin has quit [Remote host closed the connection]
GnuYawk has quit [Quit: WeeChat 1.0]
GnuYawk has joined #ruby
casadei has quit [Remote host closed the connection]
<shevy>
more code people
dg-ratio1 has quit [Ping timeout: 256 seconds]
<dopie>
anyone here good with sql?
<TvL2386>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
<TvL2386>
haha! Last time I've been slapped with that!
<certainty>
moin
<al2o3-cr>
o/
Igorshp has quit [Remote host closed the connection]
stan has joined #ruby
datanoise has quit [Ping timeout: 248 seconds]
lapide_viridi has joined #ruby
chinmay_dd has joined #ruby
chinmay_dd has quit [Client Quit]
last_staff has quit [Ping timeout: 248 seconds]
revath has quit [Ping timeout: 265 seconds]
rubie has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
allomov has quit [Remote host closed the connection]
ndrei has joined #ruby
<[k->
1h blocking IO ;-;
revath has joined #ruby
User458764 has joined #ruby
<shevy>
dopie I hate SQL
<shevy>
you can do lots of optimizations
_blizzy_ has joined #ruby
<shevy>
I hated these even more
ndrei has quit [Ping timeout: 276 seconds]
fsvehla has quit [Quit: fsvehla]
uptownhr has quit [Quit: uptownhr]
<certainty>
shevy is grouchy smurf
<shevy>
depends
<shevy>
other things are much cooler
<shevy>
ruby is usually very cool
lapide_viridi has quit [Read error: Connection reset by peer]
soulcake has quit [Ping timeout: 275 seconds]
froots_0xff has quit [Remote host closed the connection]
<[k->
do you like mongodb
<shevy>
have no experience with it. How is its syntax?
<shevy>
I actually used postgresql and postgresql is cool; but I still hate SQL
soulcake has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
ruby-lang381 has joined #ruby
bigkevmcd has joined #ruby
<[k->
I only ever used it with a binding
<[k->
but I forgot
<starfox_sf>
often times I am running a ruby program which has some sort of long loop and I try to do Ctrl-c to break out of it and it does not work. I have to go and kill the process. Is there any way to make Ctrl-C interrupt the program?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<shevy>
huh
<shevy>
I hate those $ variables
kwd has joined #ruby
<shevy>
I mean the short ones
<ruby-lang381>
i am trying to consume Amazon API but i am having a hard time coding it, can anyone help
<starfox_sf>
ddv: good point.
<shevy>
well actually, I don't like global variables very much to begin with but I understand that it is sometimes necessary to be able to globally control or assign stuff
GitGud has quit [Ping timeout: 256 seconds]
dhjondoh has quit [Quit: dhjondoh]
<al2o3-cr>
i like these one $' and $`
d10n-work has quit [Quit: Connection closed for inactivity]
Xeago has joined #ruby
krz has quit [Read error: Connection reset by peer]
toretore has quit [Quit: This computer has gone to sleep]
timonv has joined #ruby
ruby-lang381 has quit [Ping timeout: 246 seconds]
uptownhr has joined #ruby
revath has left #ruby [#ruby]
rbennacer has joined #ruby
<al2o3-cr>
>> 1/0 rescue $@
<ruboto>
al2o3-cr # => ["/tmp/execpad-0a7e3e2011cd/source-0a7e3e2011cd:2:in `/'", "/tmp/execpad-0a7e3e2011cd/source-0a7e3e2 ...check link for more (https://eval.in/385323)
andikr has joined #ruby
baweaver has quit [Remote host closed the connection]
fedexo has quit [Quit: No Ping reply in 180 seconds.]
blue_deref has quit [Quit: bbn]
dhjondoh has joined #ruby
workmad3 has joined #ruby
techsethi has quit [Quit: techsethi]
rbennacer has quit [Ping timeout: 264 seconds]
Zimsky__ has quit [Ping timeout: 276 seconds]
Ox0dea has joined #ruby
<Ox0dea>
>> /#{'()' * 32768}/
<ruboto>
Ox0dea, I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
j4cknewt has quit [Remote host closed the connection]
withnale_ has joined #ruby
soulcake has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
_mh_ has joined #ruby
_mh_ has joined #ruby
duper` has joined #ruby
super has quit [Ping timeout: 276 seconds]
_djbkd has quit [Remote host closed the connection]
revath has joined #ruby
soulcake has quit [Changing host]
soulcake has joined #ruby
tvw has joined #ruby
Xeago has quit [Remote host closed the connection]
jimms has joined #ruby
workmad3 has joined #ruby
n008f4g_ has joined #ruby
konsolebox has joined #ruby
mister_solo has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
ahmetkapikiran has joined #ruby
Xeago has joined #ruby
chthon has joined #ruby
Scroff has joined #ruby
Xeago has quit [Remote host closed the connection]
lkba_ has joined #ruby
tomaz_b has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
negev has joined #ruby
oo_ has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 264 seconds]
Tempesta has quit [Read error: Connection reset by peer]
<negev>
hi, i'm going crazy trying to figure out how to include subtemplates using Erubis. can anyone help? i'm doing this in a cgi wrapper: puts Erubis::FastEruby.new(File.read(ENV["PATH_TRANSLATED"])).result(binding()) but then within the .erb script that it's loading, there's no way i can see to include a subtemplate
<negev>
for example, in index.erb if i do: puts ERB.new(File.read('menu.erb')).result(binding)
<negev>
it will render it immediately, at the top of the output
Tempesta has joined #ruby
<negev>
is there a buffer i can append to or something?
lkba has quit [Ping timeout: 248 seconds]
<adaedra>
I think there's one, _erbout or something
<adaedra>
Ah, Erubis
Mon_Ouie has joined #ruby
bogdanteleaga has joined #ruby
oo_ has joined #ruby
Xeago has joined #ruby
Igorshp has joined #ruby
<negev>
there must be a way to use subtemplates with erubis
<adaedra>
Erubis or ERB?
<negev>
either i just need it to work
<adaedra>
I see both in your question
<negev>
i'm using Erubis to render the initial template
rubie has joined #ruby
<negev>
yeah i think that's just because i was trying solutions i found online
<negev>
they seem to do similar things
<adaedra>
it doesn't work if you do your template rendering in a <%= %> block?
<adaedra>
no puts
Xeago has quit [Remote host closed the connection]
dg-ratio1 has quit [Remote host closed the connection]
rubie has quit [Ping timeout: 265 seconds]
dg-ratio1 has joined #ruby
quimrstorres has joined #ruby
GnuYawk has quit [Ping timeout: 244 seconds]
quimrstorres has quit [Remote host closed the connection]
mister_solo has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
quimrstorres has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
quazimodo has quit [Ping timeout: 244 seconds]
c0m0 has joined #ruby
quimrstorres has quit [Remote host closed the connection]
ndrei has joined #ruby
quimrstorres has joined #ruby
<white_bear_>
is doing: path = 'foo/bar/baz'; File.join(path.split(File::SEPARATOR)) fine regarding path portability?
fabrice31 has joined #ruby
skade has joined #ruby
<adaedra>
what do you want to do?
valkyrka has joined #ruby
<adaedra>
ensuring use of \ on Windows and / else?
<white_bear_>
yep
workmad3 has joined #ruby
htmldrum has quit [Ping timeout: 272 seconds]
<adaedra>
You're sample won't work then
<adaedra>
If you're Windows, it would split on '\' and thus not split anything
<adaedra>
Your*
<white_bear_>
i have this path: 'foo/bar/baz', i want it to be portable
<white_bear_>
what about: File.join('foo/bar/baz'.split('/')) ?
<adaedra>
Just do File.join('foo', 'bar', 'baz')
<adaedra>
If your string is hardcoded
<canton7>
also, windows handles '/' just fine :P
<yorickpeterse>
morning
dhjondoh has joined #ruby
<adaedra>
yeah, I would let the compatibility layer do its job
<white_bear_>
it's not hardcoded
<jhass>
there's File.split btw
Xeago has joined #ruby
<jhass>
oh, that's basename/dirname, nvm
<white_bear_>
File.join(%w(foo bar baz)) makes foo/bar/baz path portable right? so, path = 'foo/bar/baz; File.join(path.split('/')) should make it right?
yoongkang has quit [Remote host closed the connection]
yoongkang has joined #ruby
<jhass>
white_bear_: what's not portable in your scenario about always using "foo/bar/baz" directly?
workmad3 has quit [Ping timeout: 276 seconds]
ahmetkapikiran has quit [Quit: ahmetkapikiran]
auzty has quit [Ping timeout: 276 seconds]
<white_bear_>
jhass: foo/bar/baz is variable supplied by user at the top of the script
Cust0sLim3n has quit [Ping timeout: 252 seconds]
<negev>
adaedra: oh yeah that does work, thanks :)
_fumk is now known as fumk
<adaedra>
yw
DaniG2k has joined #ruby
<jhass>
white_bear_: I don't follow how that makes it non-portable
<white_bear_>
jhass: look at this sample: Dir[File.join(%W[ #{PUPPET_DIR} hieradata nodes *])]
<white_bear_>
jhass: i'd like "#{PUPPET_DIR}/hieradata/nodes" to be dynamic
<adaedra>
oh, puppet
rafaelsales has joined #ruby
<adaedra>
What's wrong with File.join ?
OrbitalKitten has joined #ruby
vikaton has quit [Quit: Connection closed for inactivity]
quazimodo has joined #ruby
<jhass>
white_bear_: as previously noted always using / should work on Windows
hectortrope has joined #ruby
<negev>
quit
negev has quit [Quit: leaving]
<adaedra>
quat
<white_bear_>
adaedra: File.join requires the path to be exploded, right? i.e., File.join("#{PUPPET_DIR}", 'hieradata', 'nodes'), while i'd like the path to be declared as "#{PUPPET_DIR}/hieradata/nodes"
yh has joined #ruby
lee-jon has joined #ruby
Cust0sLim3n has joined #ruby
<adaedra>
Then just use your string, as jhass stated / should be able to work on Windows. But the fact you should "explode" the path with File.join is not an issue, except if you've coding in tweets
konsolebox has joined #ruby
<white_bear_>
jhass: yeah, that's right, i just wanted to know how to handle portability correctly
timonv has joined #ruby
rafaelsales has quit [Ping timeout: 246 seconds]
bayed has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
<white_bear_>
thanks
arup_r has joined #ruby
<white_bear_>
also, is there a way to retrieve all files in PATH without using a glob? i.e., avoid doing: Dir[DIR_PATH + '/*']
<white_bear_>
s/PATH/DIR_PATH/
<jhass>
Dir.entries
bruno- has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<white_bear_>
jhass: cool, thanks!
ahmetkapikiran has joined #ruby
<[k->
Dir.entries contain . and .. iirc
<white_bear_>
indeed, is there an idiom to skip them?
<ljarvis>
yes, next if f == "." or f == ".."
* [k-
checks the docs
<ljarvis>
or all hidden files, just check for f.start_with?(".")
OrbitalKitten has joined #ruby
<ljarvis>
it's just a simple loop
quazimodo has quit [Ping timeout: 272 seconds]
auzty has joined #ruby
* adaedra
checks [k-
DexterLB has quit [Read error: Connection reset by peer]
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
auzty has quit [Read error: Connection reset by peer]
<[k->
there's no opts to skip those that I hoped :/
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
yoongkang has quit [Remote host closed the connection]
okdas_ is now known as okdas
okdas has quit [Changing host]
okdas has joined #ruby
bruno- has quit [Ping timeout: 264 seconds]
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
kp666 has joined #ruby
white_bear_ has quit [Ping timeout: 272 seconds]
chinmay_dd has quit [Ping timeout: 256 seconds]
uptownhr has quit [Quit: uptownhr]
DexterLB has joined #ruby
mister_solo has quit [Ping timeout: 256 seconds]
dionysus69 has joined #ruby
multi_io has quit [Ping timeout: 264 seconds]
chinmay_dd has joined #ruby
multi_io has joined #ruby
white_bear has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
dhjondoh has joined #ruby
workmad3 has joined #ruby
<adaedra>
I never remember the outcome when this is discussed here: ruby-install or ruby-build?
konsolebox has joined #ruby
white_bear_ has joined #ruby
<white_bear_>
back i guess
<adaedra>
un ours
<white_bear_>
:D
<jhass>
adaedra: the one not associated with rbenv :P
fabrice31 has quit [Remote host closed the connection]
<white_bear_>
so, how do you exclude "." and ".." in this: Dir[DIR_PATH].entries.map! ... # ?
fabrice31 has joined #ruby
<jhass>
uh, Dir[] is glob already, might just use it then
chinmay_dd has quit [Read error: Connection reset by peer]
chinmay__ has joined #ruby
<ljarvis>
^
<adaedra>
jhass: wow, such wisdom :p
white_bear has quit [Ping timeout: 265 seconds]
<ljarvis>
adaedra: ruby-install
<al2o3-cr>
does anyone use test ?<operator>, <file> in code?
<jhass>
white_bear_: Dir["#{DIR_PATH}/*"] but yeah
<white_bear_>
is / portable here? :p
<adaedra>
.
<jhass>
if DIR_PATH contains no \, yes
pandb has quit [Quit: leaving]
workmad3 has joined #ruby
<white_bear_>
sounds good
stardiviner has quit [Ping timeout: 264 seconds]
yh has quit [Ping timeout: 250 seconds]
Scroff has quit [Ping timeout: 252 seconds]
ghostpl has joined #ruby
<white_bear_>
thanks :)
ahmetkapikiran has quit [Quit: ahmetkapikiran]
lee-jon has left #ruby [#ruby]
anne-marie35 has joined #ruby
tkuchiki has joined #ruby
yh has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
lacrosse__ is now known as lacrosse
konsolebox has quit [Read error: Connection reset by peer]
<[k->
there is also Dir.entries(path)
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ndrei has joined #ruby
<white_bear_>
it keeps . and .. too
iamninja has quit [Read error: Connection reset by peer]
OrbitalKitten has joined #ruby
n008f4g_ has quit [Ping timeout: 252 seconds]
iamninja has joined #ruby
<[k->
just opening your options
<ljarvis>
that's exactly what was just discussed
al2o3-cr has quit [Ping timeout: 272 seconds]
<shevy>
the bear!
<shevy>
catch him!
yoongkang has joined #ruby
ndrei has quit [Ping timeout: 272 seconds]
CloCkWeRX1 has quit [Quit: Leaving.]
tkuchiki has quit [Remote host closed the connection]
olistik has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
<anne-marie35>
Hello
<[k->
*reminding him his options
exadeci has joined #ruby
<anne-marie35>
i'm a newbie in ruby (first time i use irc). i was wondering what kind of question i can ask to the ruby community. Many thanks
<[k->
I need to make my trip to the docs worthwhile, you'd know
Scroff has joined #ruby
<[k->
you can ask any question but you may not get a response
chinmay__ is now known as chinmay_dd
tkuchiki has joined #ruby
<ljarvis>
anne-marie35: a ruby question
<adaedra>
anne-marie35: anything!
<anne-marie35>
ok thank you ljarvis ^^
chinmay_dd has quit [Remote host closed the connection]
Scrofff has quit [Ping timeout: 250 seconds]
<apeiros>
anne-marie35: any ruby related question is fine. sometimes it needs patience to get an answer. sometimes getting no answer means that nobody understood your question.
<anne-marie35>
so i would like to make rake tasks for a sinatra application with postgresql (no active record gem used), the purpose is to create databases with those tasks.
<anne-marie35>
i've search and read some stackoverflow questions, the official doc for rake, etc. and i so this, put the sql in a sql file and execute it with the task. Is it a good way to do things ?the url --> https://gist.github.com/KevM/1705486
<adaedra>
apeiros: yeah, znc got connection problems yesterday, pushed back by old nick
<shevy>
adaedra bring back the undead in you
<shevy>
and send him with some baguette to us too :)
<[k->
oops, the message before that was 174808
chinmay_dd has joined #ruby
* wasamasa
is imagining undead rails zombies
<wasamasa>
the horror
<[k->
you broke the chain of 8s
<[k->
huehuehue
<shevy>
they spawn threads until the computer crashes
<adaedra>
[k-: sorry
<zenspider>
I can't read anything past the first tab
<anne-marie35>
@<apeiros>ok, i will take care about the way i wrote in enlish
<adaedra>
anne-marie35: not a lot of us speak english natively, I guess it'll be ok :)
<apeiros>
anne-marie35: heh, from experience, most often the language is not the problem :) more that people leave out tons of context.
terlar has joined #ruby
<[k->
please don't wing mandarin at us
<[k->
swing*
startupality has joined #ruby
<[k->
the horror when you fail mandarin badly
ghostpl has quit [Remote host closed the connection]
<apeiros>
anne-marie35: for some reason I really dislike e.g. manually invoking tasks in rake (Rake::Task["apply_sqlserver_sql"].execute()). convention in ruby is to use snake_case for variable names (se_config instead of seConfig f.ex.)
<apeiros>
and of course 2 spaces, not tabs :)
<[k->
I don't write much code anymore :(
tkuchiki has quit [Remote host closed the connection]
mister_solo has quit [Ping timeout: 265 seconds]
<ljarvis>
apeiros: apeiron probably
mattrse has quit [Ping timeout: 264 seconds]
<apeiros>
ljarvis: that'd fit with my memory, yes
* ljarvis
does lots of perl
<apeiros>
it's not the first time this came up :)
<ljarvis>
heh
<adaedra>
[k-: Do you have videos with even less quality? I can still see what happens.
<jhass>
s = r, n = p, can you break the code?
<[k->
adaedra: no I don't ;p
bluOxigen has quit [Ping timeout: 256 seconds]
unshadow has quit [Quit: leaving]
<shevy>
[k- try to write a little bit every now and then
terlar has quit [Read error: No buffer space available]
<shevy>
adaedra it was recorded with a potato
<anne-marie35>
apeiros: thanks for the answer and the tip
yh has quit [Ping timeout: 265 seconds]
<adaedra>
DIe, potato
<adaedra>
s/I/i/
<shevy>
and as you may now from the french cuisine, a potato has really bad eyesight
Mon_Ouie has quit [Remote host closed the connection]
p1k has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
Cust0sLim3n has joined #ruby
<[k->
have you seen a potato budding from a potato?
<[k->
looks very gross
bluOxigen has joined #ruby
<shevy>
well that's how plants tend to expand man
<adaedra>
Potatisar
<shevy>
you are killing baby plants when you eat them; you should eat stone instead
<adaedra>
To be stoned?
<[k->
I'm sure stones are very nutritious!
<[k->
fossils power our electricity!
yh has joined #ruby
<[k->
think of the energy we would get!
<_mh_>
am sure, given enough time to be digested and depending on the type of stone, the enclosed minerals could be very healthy.
dg-ratio1 has quit [Remote host closed the connection]
dg-ratio1 has joined #ruby
<apeiros>
anne-marie35: another thing you might consider: I tend to not have any code in my rake tasks themselves. I have the code in classes and call out to those.
<adaedra>
Fascinating
ndrei has quit [Remote host closed the connection]
ndrei has joined #ruby
<shevy>
classes are very useful
dfockler has joined #ruby
yoongkang has joined #ruby
<[k->
does the community like refinements now?
<ddv>
refinements are awesome
endash has joined #ruby
<shevy>
I don't like its syntax
<ddv>
and I represent the community in full
<shevy>
the idea is ok
<ljarvis>
dont let yorickpeterse see that
<yorickpeterse>
I saw it
<yorickpeterse>
I see everything
antgel has joined #ruby
<yorickpeterse>
well mostly everything
dede has quit [Quit: Connection closed for inactivity]
konsolebox has joined #ruby
fabrice31_ has joined #ruby
<apeiros>
yorickpeterse's family name is Heimdall
mattrse has joined #ruby
<yorickpeterse>
heh
dfockler has quit [Ping timeout: 246 seconds]
konsolebox has quit [Read error: Connection reset by peer]
ndrei has quit [Ping timeout: 248 seconds]
fabrice31_ has quit [Remote host closed the connection]
<shevy>
sounds mighty
<shevy>
like a Viking
<shevy>
Heimdall Wauki, brother of Thor Wauki!
ndrei has joined #ruby
datanoise has joined #ruby
<apeiros>
there's those wimps who fear winter coming. they should fear ragnarök.
<anne-marie35>
apeiros: i saw some examples with a lot of code in a task indeed and i was wondering why they do that
yh has quit [Ping timeout: 265 seconds]
stardiviner has joined #ruby
olistik has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 256 seconds]
<[k->
is this an example of encapsulation not being followed?
bluOxigen has quit [Read error: Connection reset by peer]
mcpierce` is now known as mcpierce
bluOxigen has joined #ruby
<apeiros>
it's an example of early convenience staying around for too long
yh has joined #ruby
<apeiros>
small rake tasks with code you don't need anywhere else is usually where it starts
<apeiros>
so you put all code in the task itself. and then never reconsider the pattern, even as your tasks grow.
bkxd has quit [Ping timeout: 255 seconds]
quimrstorres has quit [Remote host closed the connection]
<jhass>
invoking other tasks is probably the last red flag that you should extract stuff
ndrei has quit [Ping timeout: 248 seconds]
<apeiros>
jhass: I'm actually thinking about *why* I dislike that so much. it's a gut feel and I can't rationalize it. so I wonder whether it's mistaken :-|
<apeiros>
might also just still be those f'ing meds I'm on, preventing me from thinking clearly :<
ta has quit [Remote host closed the connection]
ndrei has joined #ruby
quimrstorres has joined #ruby
<jhass>
I'd rationalize it about above point actually, it's a big red flag that you actually want to extract stuff to a class or at least some regular methods, it indicates people forgetting that rake tasks are regular Ruby after all
<jhass>
and I think it's also that it feels like it's not intended by Rake by not having a DSL method to do it, it looks like breaking up Rake internals
farhad_hf has joined #ruby
Blaguvest has joined #ruby
<jhass>
(I do agree about it if you didn't figure ;D)
farhad_hf has left #ruby ["Konversation terminated!"]
mister_solo has joined #ruby
al2o3-cr has joined #ruby
al2o3-cr is now known as Guest16239
surs has joined #ruby
<apeiros>
:)
nopolitica has quit [Ping timeout: 265 seconds]
mcpierce has quit [Quit: Coyote finally caught me]
<shevy>
coding while being drugged rocks
<shevy>
guess how _why was able to code so much!
<jhass>
baconed
jimms has quit [Remote host closed the connection]
fujimura has quit [Remote host closed the connection]
p1k has joined #ruby
bkxd has joined #ruby
<adaedra>
bacon?
konsolebox has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
sandstrom has joined #ruby
denver has joined #ruby
<ljarvis>
baconed what his state
duoi has quit [Quit: duoi]
Guest16239 has quit [Quit: the quieter you become, the more you are able to hear]
<tobiasvl>
chunky bacon
gr33n7007h has joined #ruby
<apeiros>
he never told the fox that the chunky bacon was fox bacon…
gr33n7007h is now known as al2o3-r
kp666 has quit [Remote host closed the connection]
duoi has joined #ruby
z3uS has quit [Ping timeout: 264 seconds]
bar0n has joined #ruby
<[k->
guess what did the fox say?
iamninja has quit [Ping timeout: 252 seconds]
al2o3-r is now known as al2o3-cr
<jhass>
apeiros: I see what you mean about the meds
_blizzy_ has joined #ruby
<apeiros>
z3uS has joined #ruby
lucianob has joined #ruby
lkba has joined #ruby
<[k->
I wish I could be remotely as funny but... guess not ;-;
olistik has joined #ruby
baxx has joined #ruby
Pupeno has quit [Remote host closed the connection]
<[k->
I hope nobody gave a blank look on that one hehe
* adaedra
pats [k-
<jhass>
nah, we're busy playing hangman
uptownhr has joined #ruby
endash has quit [Quit: endash]
bkxd has quit [*.net *.split]
surs has quit [*.net *.split]
stan has quit [*.net *.split]
MVPhelp has quit [*.net *.split]
shafox has quit [*.net *.split]
jesterfraud has quit [*.net *.split]
kenichi has quit [*.net *.split]
unclouded has quit [*.net *.split]
jokester has quit [*.net *.split]
BackEndCoder has quit [*.net *.split]
bougyman has quit [*.net *.split]
nertzy has quit [*.net *.split]
CHVNX has quit [*.net *.split]
quarcu has quit [*.net *.split]
RazorX_ has quit [*.net *.split]
Fluent has quit [*.net *.split]
Janusz1_ has quit [*.net *.split]
spectra has quit [*.net *.split]
ElderFain has quit [*.net *.split]
mistym has quit [*.net *.split]
johnhamelink has quit [*.net *.split]
george2 has quit [*.net *.split]
PlasmaStar has quit [*.net *.split]
RoryHughes has quit [*.net *.split]
drewdavis has quit [*.net *.split]
jimeh has quit [*.net *.split]
blackjid has quit [*.net *.split]
jalcine has quit [*.net *.split]
LBRapid has quit [*.net *.split]
lupine has quit [*.net *.split]
teotwaki has quit [*.net *.split]
sfr^ has quit [*.net *.split]
prasselpikachu has quit [*.net *.split]
df has quit [*.net *.split]
epochwolf has quit [*.net *.split]
Shidash has quit [*.net *.split]
Seich_ has quit [*.net *.split]
nullwarp has quit [*.net *.split]
DarkBushido has quit [*.net *.split]
ytti has quit [*.net *.split]
jamo___ has quit [*.net *.split]
MiracleBlue has quit [*.net *.split]
BLuEGoD has quit [*.net *.split]
Dwarf has quit [*.net *.split]
akahn has quit [*.net *.split]
jokke has quit [*.net *.split]
canton7 has quit [*.net *.split]
programmerq has quit [*.net *.split]
melter has quit [*.net *.split]
tylersmith has quit [*.net *.split]
chinmay_dd has quit [Remote host closed the connection]
tylersmith has joined #ruby
Janusz1 has joined #ruby
drewdavis has joined #ruby
nullwarp has joined #ruby
bkxd has joined #ruby
quazimodo has joined #ruby
sfr^ has joined #ruby
<apeiros>
[k-: I was refusing to say "Ring-ding-ding-ding-dingeringeding!"
Seich has joined #ruby
stan has joined #ruby
jesterfraud has joined #ruby
DarkBushido has joined #ruby
Jamo__ has joined #ruby
df has joined #ruby
PlasmaStar has joined #ruby
bougyman has joined #ruby
bougyman has quit [Changing host]
bougyman has joined #ruby
nertzy has joined #ruby
surs has joined #ruby
CHVNX has joined #ruby
kenichi has joined #ruby
unclouded has joined #ruby
Shidash has joined #ruby
RoryHughes has joined #ruby
teotwaki has joined #ruby
epochwolf has joined #ruby
prasselpikachu has joined #ruby
LBRapid has joined #ruby
Fluent_ has joined #ruby
george2 has joined #ruby
jalcine has joined #ruby
blackjid has joined #ruby
RazorX has joined #ruby
johnhamelink has joined #ruby
fabrice31 has joined #ruby
BackEndCoder has joined #ruby
ElderFain- has joined #ruby
ElderFain- is now known as ElderFain
MVPhelp_ has joined #ruby
mistym has joined #ruby
programmerq has joined #ruby
jimeh has joined #ruby
ghostpl has joined #ruby
lkba_ has quit [Ping timeout: 276 seconds]
jokester has joined #ruby
ElderFain has quit [Changing host]
ElderFain has joined #ruby
quarcu has joined #ruby
Dwarf has joined #ruby
melter has joined #ruby
BLuEGoD has joined #ruby
Pupeno has joined #ruby
khebbie has joined #ruby
chinmay_dd has joined #ruby
shafox has joined #ruby
akahn has joined #ruby
lupine has joined #ruby
bkxd has quit [Ping timeout: 256 seconds]
<adaedra>
Can we stop with this? It's dead and buried since long.
<[k->
MiracleBlue has joined #ruby
patteh has joined #ruby
spectra has joined #ruby
patteh has quit [Client Quit]
DexterLB has quit [Quit: So long and thanks for all the fish]
ndrei has quit [Ping timeout: 250 seconds]
DexterLB has joined #ruby
mattrse has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
Kero_ is now known as Kero
mattrse has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<shevy>
the buried baguette
k3asd` has quit [Ping timeout: 276 seconds]
<shevy>
most of _why's projects seem to have been able to find new maintainers
chinmay_dd has quit [Remote host closed the connection]
<stan>
is there a cleaner way of getting a value from a list of hashes than this? [{1 => 1, 2 => 2}, {3 => 3}].find { |h| h[1] }[1]
<shevy>
ack
<adaedra>
Hello VB
<shevy>
lol
Jackneill has joined #ruby
<shevy>
so an Array with Hashes inside
bkxd has joined #ruby
<ljarvis>
shevy: .map(&:values)
<jhass>
stan: you can spare the .find in that case
<ljarvis>
stan: ^
<shevy>
I am stan!
<shevy>
he is shevy
<jhass>
oh, mh, actually nvm
<jhass>
that's one I'd like find_value for :/
<stan>
but the value of a particular key
<ljarvis>
ah i read it wrong heh
<[k->
.find &:[1]
<jhass>
that doesn't work
<ljarvis>
it's been proposed
<[k->
why not :(
<ljarvis>
bit clunky though
<[k->
.find &:second
<ljarvis>
^ active support only
MatthewsFace has quit [Remote host closed the connection]
<[k->
clearly more readable!
<workmad3>
[k-: because a) that's not a valid symbol and b) you can't pass arguments to Symbol#to_proc like that
ndrei has quit [Ping timeout: 276 seconds]
ndrei_ has joined #ruby
<jhass>
you'll still need .find(&:second).second :/
<ljarvis>
:D
<ljarvis>
beautiful...
<jhass>
or .lazy.map(&:second).find(&:itself)
<[k->
I missed the second [1] part
<jhass>
I really should write a patch for find_value
noname has joined #ruby
<ljarvis>
yarly
<workmad3>
[k-: it's possible to patch Symbol so that .find :[].(1) would work
Pupeno has joined #ruby
<[k->
but that would be ugly
<workmad3>
:[][1] ? :)
tvw has joined #ruby
<[k->
using &:values looks much better
ta has joined #ruby
<[k->
wait, that method call doesn't make sense
skyrocker has left #ruby [#ruby]
<[k->
oh, I just got it
<jhass>
stan: maybe you can restructure your stuff so that becomes unnecessary :/
chthon has quit [Ping timeout: 244 seconds]
<[k->
merging the hashes may be nice
lkba has quit [Remote host closed the connection]
skade has joined #ruby
<abyss>
helo again;) I have this code: https://gist.github.com/anonymous/15b22caab60edfe9caf5. It reads ids from id_to_change_all_uniq put to array. Then loop in each, check if line contain one of the id from ids array if yes, then add 1000 to id and change old id to new id.
Renich has quit [Ping timeout: 264 seconds]
iamninja has joined #ruby
skade has quit [Client Quit]
<[k->
I got a 404 :(
BaconOverflow has joined #ruby
<abyss>
the problem is that I have to find all ids in line not only first id from array (id = ids.find), someone could help me in that?
<adaedra>
remove the dot, [k-
al2o3-cr has quit [Ping timeout: 244 seconds]
<[k->
oh
<[k->
haha
<adaedra>
?gist_usage
<ruboto>
To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
<adaedra>
?gistusage
<ruboto>
I don't know anything about gistusage
<adaedra>
jhass, help me
<adaedra>
nvm
<workmad3>
?gist-usage
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<workmad3>
adaedra: :P
<adaedra>
ruboto is slow today :(
<workmad3>
oh wait, that looks like gist... and you already found gist_usage :D
<abyss>
btw: it's to my code?;)
rodferso1 has joined #ruby
<shevy>
lol
<adaedra>
yes, enable syntax coloring
<shevy>
so many lines of ? bot fail, and nobdy answers this poor man's question
sandstrom has joined #ruby
<shevy>
we have... .find .select .scan .grep we have everything man
<abyss>
shevy: I have but not so good I suppose because I wanted to add ids.each between 9 and 10 lines;)
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
it would be better to separate the various concerns
<[k->
there is no proper indentation! *screams*
k3asd` has quit [Ping timeout: 264 seconds]
tvw has quit [Ping timeout: 248 seconds]
quazimodo has quit [Ping timeout: 248 seconds]
<shevy>
oh but there is
<shevy>
he indents with one space :)
<adaedra>
yep, just replace your .find by .select and you'll get an array of all matches
OrbitalKitten has joined #ruby
rodfersou has quit [Ping timeout: 276 seconds]
livcd has joined #ruby
<abyss>
adaedra: ok, but it wouldn't be better to add another line with select? If select is slower than find? Thank you.
al2o3-cr has joined #ruby
k3asd` has joined #ruby
Pupeno has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
<[k->
select is slower than find in the worst case scenario
<adaedra>
abyss: they do different things. #find returns the first match (or nil), #select returns all the values which match your predicate in a new array.
<[k->
find and select are the same in the best case scenario :D
<adaedra>
so instead of a if, maybe use a each
blackmesa has quit [Ping timeout: 276 seconds]
<adaedra>
ah wait
<abyss>
yes, that why I wonder if it will be slower I mean maybe I should add another line beneath ids.find. if find something then put everything to array, or not?
<adaedra>
I don't see well what you're trying to achieve
<abyss>
adaedra: if I use each then always for each line the script will be try to add 1000 to id and try to change for each id (there's about 65000 ids;)), yes?
<adaedra>
or you could just
<abyss>
adaedra: I'd like to check each line in my file and if line contain one of the id (ids array) then add 1000 and change old value to new one.
<abyss>
*add 10000
<adaedra>
.gsub!(/\b\d+\b/) { |n| n.to_i + 1000 }
<adaedra>
or something like that
chthon has joined #ruby
<[k->
regex is quite slow...
<bnagy>
abyss: we gave you a bunch of ideas about optimising your regexp lookups, but doesn't look like you did any of it
User458764 has quit [Ping timeout: 276 seconds]
<abyss>
adaedra: I'm afraid I don't get this code;)
Rapier- has quit [Quit: (null)]
<adaedra>
[k-: I don't know if it would be slower than what he's doing already
User458764 has joined #ruby
<bnagy>
another way might just be to convert ALL of the sub ids to a Hash, then get all the numbers out of each line instead
User458764 has quit [Max SendQ exceeded]
<[k->
yes bnagy!
<[k->
wait, sub ids?
<bnagy>
so instead of checking for each possible subst if, you get the ids that are actually there, see if they're in to_substitute and then replace if so
datanoise has quit [Ping timeout: 264 seconds]
User458764 has joined #ruby
oo_ has quit [Remote host closed the connection]
endash has joined #ruby
<bnagy>
should change it from O n**2 to O n :/
<abyss>
bnagy: yes, but I have different problem:) Sorry for that I didn't understand well how I should change it, so I left this one. It's works for me but only for the first occurrence
<bnagy>
well O n*m
<[k->
arrays aren't really fast for that huge a number
bnumfw has joined #ruby
mattrse has quit [Remote host closed the connection]
<bnagy>
abyss: basically, instead of iterating ids for each input line, just turn that into a Hash
<[k->
you could use a set, that takes away the ugly solution of hash for you
<bnagy>
then for each line, just get everything that might be an id
denver has quit [Ping timeout: 252 seconds]
<bnagy>
and see if a) there are any and b) if they are in the hash
<bnagy>
that will be much lower order
<bnagy>
[k-: set is just a hash in ruby, right?
<[k->
yes, its in the stdlib
<bnagy>
ok well I don't think bikeshedding Set vs Hash is the main problem :)
Zai00 has joined #ruby
<bnagy>
compared to reducing it by a factor of ~ ids.size / 2 ;)
<abyss>
adaedra: btw: this code: .gsub!(/\b\d+\b/) { |n| n.to_i + 1000 } As I said I can't change each number I have to change id from ids array:)
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<abyss>
bnagy: sorry for that but I don't get it how hashes will help me:(
<adaedra>
you can add your condition in the block
<[k->
you can also do this: as you read the line, check if the id is in the hash, if not, insert it to the hash.
<bnagy>
[k-: I don't think that's the problem
<[k->
but it would be faster :3
<bnagy>
[k-: afaik the problem is "if any line has an id in $this_list, increase all those ids by 1000"
<[k->
he also wants it to be fast
<abyss>
bnagy: exactly
<bnagy>
so you don't need to modify your starting hit list
<adaedra>
functional > fast
<adaedra>
;)
<[k->
of course, of course
rubie has joined #ruby
<bnagy>
basically my suggestion is: turn hit list into a hash, then for each line, get all things that might be ids, look up in hitlist, if they are there do gsub
<bnagy>
so it's one scan per line, one lookup per scan result
<abyss>
bnagy: now my script works something like this: if any line has an id in $this_list, increase first accurance of id by 1000 intead of all ids in line. Adding each after that find will add for each id 10000 even if that id doesn't accur in line :(
<[k->
I'm not sure how adding 10000 wouldn't result in another collision though
yfeldblum has quit [Ping timeout: 248 seconds]
ta has joined #ruby
<bnagy>
[k-: well presumably the initial list is defined like that, it's a DB dump where the ids were monotonically increasing I think
<abyss>
yeah, you're not sure about that but I'm not sure what are you talking about ;)
<bnagy>
but yes, you're right in theory :)
rodferso1 has quit [Quit: leaving]
<bnagy>
abyss: might one line contain more than one id from the replace_list ?
<abyss>
bnagy: I have list of ids that I need to increase in my binlog file.
rodfersou has joined #ruby
<abyss>
bnagy: yes , that's the problem
<[k->
by list you mean arrays?
<workmad3>
[k-: it's fine as long as: 1) there's only a chance of 2 items having the same ID and 2) the largest id is < 10000 :)
<bnagy>
ok then my thing still works, you just need to go through the found ids and use sub
<abyss>
otherwise the script would be work fine
rubie has quit [Ping timeout: 265 seconds]
Pupeno has joined #ruby
<[k->
workmad3: I hope it is a one time only script then
<bnagy>
basically say your scan for numbers in the line finds [20, 50, 20] you do found_ids.each {|id| if (replace=sub_list[id]; line.sub! id, replace; end } or something
ldnunes has joined #ruby
<bnagy>
modulo syntax errors
Iskarlar has quit [Read error: No route to host]
phat4life has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Iskarlar has joined #ruby
<bnagy>
you'll run twice for 20 there, but it's fine
Zai00 has quit [Ping timeout: 252 seconds]
toretore has joined #ruby
<bnagy>
because it's still like 30000 times faster than what you have :)
Zai00 has joined #ruby
phat4life has joined #ruby
<[k->
you shouldn't use arrays or regexp for 65000 things, that'll be super duper ultra mega slow
MasterPiece has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<bnagy>
[k-: we had this a few days ago, and were suggesting using a Regexp.union
<DefV_>
don't underestimate your computer
<bnagy>
but the code has changed slightly
<bnagy>
also, regexp is surprisingly fast :<
<shevy>
ruby is fast!
<bnagy>
I hate regexp and never use them, but when you're performance golfing regexp solutions do better than you'd expect
<shevy>
once it'll become mruby
<bnagy>
apart from the object creation
startupality has quit [Quit: startupality]
OrbitalKitten has joined #ruby
don_ has joined #ruby
<adaedra>
%r{fast}
<abyss>
bnagy: sorry:(
<DefV_>
bnagy: why do you hate regexp?
Iskarlar has quit [Client Quit]
<[k->
so... we don't need to optimise Ruby by hand? :D
<abyss>
bnagy: I still don't know how to achieve that? First I need to find this 20,50, 20 , yes?;)
<abyss>
I know I could add between line 9 and 10 ids.each do |id| do and do everything between line 10 and 12 but i would be extremely slow:(
<bnagy>
let's start with that. I didn't test anything so it will be buggy
soulcake has quit [Ping timeout: 276 seconds]
<[k->
bnagy, you didn't indent properly!
luciano__ has joined #ruby
luciano__ has joined #ruby
<bnagy>
DefV_: they rapidly become impossible to read, and people use them instead of parsing
<bnagy>
[k-: I know, I just blatted it in the gist fork, sorry :/
<[k->
parsing is the only way to do things in Haskell and I don't know how to parse ;-;
<DefV_>
bnagy: Good tests fix the impossible-to-read problem (for me)
<bnagy>
how do tests make shit regexps less eyeburning?
blackmesa has joined #ruby
<bnagy>
regexp is just a horrible language
<ljarvis>
:o
<flughafen_>
i love me some regex
soulcake has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lucianob has quit [Ping timeout: 246 seconds]
<bnagy>
abyss: do you get what I'm trying to do with that code?
<bougyman>
bnagy: /x with comments :)
<abyss>
bnagy: It wouldn't change each number I mean if in line is 78889 and I want to change 888 to 1888 it change 78889 to 718889 as well?
<DefV_>
bnagy: most of the time regexes become complex when you try to catch different kinds of input and ignoring others
yeticry has quit [Ping timeout: 256 seconds]
<bnagy>
abyss: no, it will only change complete matches
<[k->
I think abyss is under a lot of stress
nopolitica has joined #ruby
<DefV_>
bnagy: tests capture all the exceptions for which you've made your regexp complex
yeticry has joined #ruby
<abyss>
[k-: yes;) Because we have really bad issue;) But how you uncover this?;)
<[k->
you said some nonsensical stuff which shows that you are facing a lot of stress
<abyss>
and client is pissed off so I'm a bit stress because everybody in company looks at me;)
<abyss>
[k-: uhhh, it maybe bacause of my english;)
railsraider has joined #ruby
<[k->
no, it's this: 195026 <abyss> bnagy: It wouldn't change each number I mean if in line is 78889 and I want to change 888 to 1888 it change 78889 to 718889 as well?
quimrstorres has joined #ruby
<[k->
no offense :D
Zai00 has quit [Quit: Zai00]
<[k->
bnagy: time to swing some production code?
<abyss>
[k-: uhh, because I did that;) in my script in line 9 and 11 I omitted \b \b and then it changed everything;) even that I mentioned 78889 to 718889 ;)
<bnagy>
abyss: I updated it to fix a small bug
<bnagy>
I am drinking beer so I won't swear 100% that it does what you want, but it lgtm
<bnagy>
it's slightly inefficient if you have a lot of ids to replace per input line. If it's like one or two this approach is better imho
<abyss>
bnagy: How I can list the whole code I can see only the first version:(
<bnagy>
either way it's much more efficient than your code I think
hoov has joined #ruby
<bnagy>
abyss: just refresh, it's gist
<abyss>
hmmm I still see ids.each {|id| replace[id] = id.to_i + 1000} intead of +ids.each {|id| replace[id] = (Integer(id)+ 1000).to_s}
<[k->
:o there are multiple ids per line?
<abyss>
[k-: yes, it's all fuss about;)
<bnagy>
abyss: uh.. the second thing you said is the change
codecop has quit [Remote host closed the connection]
jacor has quit [Read error: Connection reset by peer]
nopolitica has quit [Ping timeout: 255 seconds]
<bnagy>
so if you can't see it, how did you know it was there? ;)
jacor has joined #ruby
<adaedra>
that's why I proposed the gsub! above, got all changes in one line
<abyss>
bnagy: yeah, but I cant see this in one file only when I click reviosions then I can see your changes - never mind;) I will stick it together:)
<bnagy>
adaedra: the ideas can differ I think
serivich has joined #ruby
flughafen_ has quit [Ping timeout: 264 seconds]
<bnagy>
abyss: make sure you use my whole gist, I construct the hash completely differently
<bnagy>
adaedra: s/ideas/ids/
<shevy>
circle.rb:87:in `initialize': bignum too big to convert into `long' (RangeError)
<shevy>
ruby does not let me count to Infinity :(
<bnagy>
like I think a line can be like "DO SQL SHIT WITH 13, AND ALSO 15"
<bnagy>
and we need to convert to "DO SQL SHIT TO 1013, AND ALSO 1015"
<adaedra>
?
droidburgundy has joined #ruby
<adaedra>
.gsub!(/\b\d+\b/) { |n| n.to_i + 1000 }
djbkd has joined #ruby
<adaedra>
>> "DO SQL SHIT WITH 13 AND ALSO 15".gsub(/\b\d+\b/) { |n| n.to_i + 1000 }
<bnagy>
because you need to check each id to see if it's in the list to sub
<adaedra>
I can't ?
<abyss>
bnagy: lines could looks like: NSERT INTO codes (package_id,code,add_date,exp_date,licence_duration,students_licences,comment) VALUES ('1693', 'vvvv', 1443109600, 15381293600, '12', '1', NULL) and should looks like: NSERT INTO codes (package_id,code,add_date,exp_date,licence_duration,students_licences,comment) VALUES ('11693', 'vvvv', 1443109600, 15381293600, '1012', '1', NULL) or something, but lines could looks like: SET INSERT_ID=481699/*!*/; and it should l
tvw has joined #ruby
<abyss>
bnagy: yes, exactly:)
<abyss>
adaedra: I have list of ids (in array) that I want to change
olistik has quit [Remote host closed the connection]
<abyss>
s/but lines could looks like/but lines could looks like
<abyss>
s/but lines could looks like/but lines could also looks like/g
<adaedra>
bnagy: add a if in the block
don_ has quit [Read error: Connection reset by peer]
<shevy>
your lines could look like
<adaedra>
but that was only an idea, can be reworked
olistik has joined #ruby
hoov has quit [Quit: Leaving]
<bnagy>
abyss: in my code at the point where I'm doing sub! I'm using strings, not regexp, so it can't "overmatch" but it can undermatch :/
gagrio has quit [Ping timeout: 264 seconds]
<bnagy>
abyss: so it should probably be converted to a regex with boundary anchors
<bnagy>
adaedra: gsub (without !) with a block would work
unshadow has joined #ruby
<bnagy>
I just don't think it's any more efficient and it's harder to read (imho)
otisZart has joined #ruby
<bnagy>
but my sub with a string is definitely buggy
djbkd has quit [Ping timeout: 256 seconds]
<adaedra>
Also, for the above hash, instead of storing all possible ids, just have a magic hash like h = Hash.new { |_, n| n + 1000 }
Blaguvest has quit [Ping timeout: 244 seconds]
<bnagy>
updated... how's that?
<abyss>
adaedra: it's too complicated for me;p
<bnagy>
adaedra: that's in my gist already ;)
allenn has joined #ruby
<adaedra>
it sets base for unknown ids, and you can manually set replacements
<[k-_>
then there isnt a logical error then actually
<abyss>
[k-_: I'd like to check each line if contain one of the id from array if yes then increase id to change about 1000 and replace old value with new one
strixd has joined #ruby
strixd has quit [Excess Flood]
<abyss>
for example I have line: SET INSERT_ID=283418/*!*/; I want: SET INSERT_ID=284418/*!*/;
<abyss>
I have line: UPDATE codes SET code='MKGB47B7', status=1, students_licences='1', licences_used='0', unlock_date=1433421747, licence_till=1465044147, user_id='21465', school_id='14363', comment='Nsomethisdfvklas fjs kasldf jasf asid.' WHERE id='46923'
<abyss>
/*!*/;
<abyss>
SET INSERT_ID=283418/*!*/;
<abyss>
<abyss>
SET INSERT_ID=21477/*!*/;
<abyss>
INSERT INTO `user` (^M
strixd has joined #ruby
<abyss>
login,^M
<abyss>
password,^M
<abyss>
password_salt,^M
<abyss>
role_id,^M
<abyss>
firstname,^M
strixd has quit [Excess Flood]
<abyss>
lastname,^M
<abyss>
email,^M
OrbitalKitten has joined #ruby
<abyss>
processallow,^M
<flughafen>
holy crap
<abyss>
allow_remind_email,^M
<abyss>
created,^M
<abyss>
sso_id,^M
<abyss>
quota,^M
<redlegion>
Holy paste to channel
<abyss>
trial_period_date,^M
<sevenseacat>
!mute abyss
<flughafen>
sevenseacat to the rescut
<redlegion>
Loool
<[k-_>
this will only take a moment
strixd has joined #ruby
<flughafen>
rescue* .. you were so fast you wouldn't even think you wear an eye-patch
Xeago has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
phutchins has joined #ruby
rafaelsales has joined #ruby
<[k-_>
he is done now
<[k-_>
he can be unmuted
Xeago has quit [Remote host closed the connection]
k3asd` has quit [Ping timeout: 276 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sevenseacat>
!unmute abyss
<abyss>
thank you. Sorry again for that.
hanmac1 has joined #ruby
<sevenseacat>
s'ok.
sgambino has joined #ruby
<jesterfraud>
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<[k-_>
so what is the purpose of ids_to_change_all_uniq?
<abyss>
[k-_: so, there's all ids I need to change
<abyss>
*there're
<[k-_>
ah, so it contains all the ids you need to change
<abyss>
yes
<abyss>
wow, my english have to be really bad :D Sorry.
<[k-_>
do you have an example of a line of yshop_14-megaslice?
hanmac1 has quit [Quit: Leaving.]
Al3ks has joined #ruby
Papierkorb has joined #ruby
luciano__ has quit [Read error: Connection reset by peer]
malconis has quit [Remote host closed the connection]
<[k-_>
does this work?
fabrice31_ has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
dANO_ has joined #ruby
malconis has joined #ruby
zeroDivisible has quit [Ping timeout: 244 seconds]
vasilakisfil has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
atom3 has quit [Ping timeout: 276 seconds]
atom3 has joined #ruby
griffindy has joined #ruby
<abyss>
[k-_: I get: :18:in `+': can't convert Fixnum into String (TypeError)
<shevy>
I just came back to see that sevenseacat has once again saved this channel
<abyss>
it's def where is: id + 1000
vasilakisfil__ has quit [Ping timeout: 256 seconds]
transiency has quit [Ping timeout: 256 seconds]
<[k-_>
oopw
fabrice31 has quit [Ping timeout: 246 seconds]
<sevenseacat>
so here i come to save the day, a regular joe now on parade
afrianska has quit [Ping timeout: 272 seconds]
lxsameer has quit [Quit: Leaving]
<[k-_>
i updated the gist
<[k-_>
try that
thiagovsk has joined #ruby
<havenwood>
No more rhymes now I mean it... Anybody wanna peanut?
yqt has joined #ruby
dblessing has joined #ruby
<shevy>
a peanut in my hut
dorei has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_>
look shevy! i coded!
scripore has joined #ruby
<abyss>
[k-_: I'm checking... It has done its job too fast;p Something is suspicious;)
arup_r has quit [Remote host closed the connection]
<adaedra>
I can code too
<adaedra>
puts "Hello"
<adaedra>
Hop, done
<[k-_>
yay adaedra can code too
<[k-_>
\o/
<shevy>
[k-_ yeah
<shevy>
[k-_ but you did not write code for yourself
<shevy>
you just help other people write code :(
whippythellama has joined #ruby
<[k-_>
:(
<[k-_>
i help other people write code to make myself happy
<[k-_>
does that count?
<shevy>
I don't know
<shevy>
it seems fishy
<[k-_>
i managed to get into insert mode in vim!
<[k-_>
i dont know how i did it, but i did it!
sdothum has joined #ruby
Thenews has joined #ruby
zeroDivisible has joined #ruby
seansith has quit [Changing host]
seansith has joined #ruby
<abyss>
[k-_: it's extremely fast in comparison to my script - your - 5sec, my: 160min ;p
e1nh4nd3r has joined #ruby
scx has quit [Ping timeout: 244 seconds]
zz_Outlastsheep is now known as Outlastsheep
<[k-_>
it works?
quimrstorres has joined #ruby
<abyss>
but it's doesn't work in some cases, instead of figures I get NULL
e1nh4nd3r has quit [Client Quit]
e1nh4nd3r has joined #ruby
<[k-_>
do you have the line?
scx has joined #ruby
tomaz_b has quit [Ping timeout: 244 seconds]
<Thenews>
www.VALBOT.com provides domain valuations. Reporting globally on Site Traffic, Pagerank, Malware, WHOIS data, SEO & even Social Media presence.
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rubie has joined #ruby
<[k-_>
is my code horrid ;-;
revath has quit [Ping timeout: 252 seconds]
<bnagy>
abyss: just make the names of the lookup hash match - either change both to lookup or both to ids
ahmetkapikiran has joined #ruby
adaedra has joined #ruby
<bnagy>
[k-_: well I don't inherently mind using Set
<bnagy>
but when you have to make a method call in each replace then it seems simpler and faster just to use a Hash in the first place
<adaedra>
what the hell
zipace has quit [Ping timeout: 246 seconds]
<bnagy>
like.. I think you fell in love with the idea of Set and then didn't reconsider
<[k-_>
but hash []= is also a method call
subtwo has quit [Quit: (null)]
rbennacer has joined #ruby
imanzarrabian has joined #ruby
Xeago has joined #ruby
<[k-_>
and my code only calls change_id when it is needed
<bnagy>
but you have to call change_id
tedstriker has joined #ruby
rbennacer has quit [Remote host closed the connection]
<[k-_>
it doesnt add +1000 to everything
tedstriker has quit [Max SendQ exceeded]
<bnagy>
any time there is more than one change per line I win
<bnagy>
no?
arup_r has joined #ruby
<[k-_>
method calls are indeed expensive
<[k-_>
I can use a lambda, yes?
tedstriker has joined #ruby
<[k-_>
worst case is to inline it
<bnagy>
why not just not use a set?
<bnagy>
do you get paid per line of code, or what?
<abyss>
[k-_: why it's so fast!;)
<adaedra>
ok, sorry about earlier Aria havenwood – I was responding to Thenews message, but something in my connection delayed the message
<abyss>
[k-_: hmm I still get NULL in that updates
<[k-_>
if i get paid per minute i would write abyss's code immediately
devdazed has joined #ruby
<apeiros>
adaedra: the problem is that those are still post-fact
rubie has quit [Ping timeout: 265 seconds]
<adaedra>
apeiros: which ones?
<abyss>
[k-_: ;)
<abyss>
[k-_: you've said that is just fun;p
arup_r has quit [Remote host closed the connection]
<apeiros>
adaedra: kline on pattern
<adaedra>
Grmbl, maybe if FreeNode was not routing me through Chicago I wouldn't lag so much >_>
<Aria>
Aaah!
arup_r has joined #ruby
<apeiros>
[k-_, flughafen, jhass: I mean I'd want a mode where a service has to approve of messages and/or users. i.e. message gets first sent to service, service returns accept/reject, on accept, message is sent from the original sender to the channel/user
<[k-_>
it shouldn't replace the numbers with null ;-;
rbennacer has joined #ruby
<adaedra>
apeiros: I think I saw it work on message send – so nothing was send. But that may depend on the server.
<[k-_>
i saw something like that before adaedra
<[k-_>
services provided a filter list
<abyss>
[k-_: it's works for you?
<[k-_>
no i didnt run it
<bnagy>
[k-_: your sub is wrong in the last gist I think
tlarevo_ has quit [Remote host closed the connection]
hagabaka has joined #ruby
<bnagy>
abyss: honestly, you should be able to fix those kind of trivial bugs yourself :|
<[k-_>
1.8 doesnt have lambda literals ;-;
<adaedra>
1.8 has one thing: expiration.
<havenwood>
adaedra: ah, thanks!
<[k-_>
badumtss!
<adaedra>
thanks to what?
<abyss>
;)
<[k-_>
abyss: change it to change_id = lambda { |id| id + 1000 }
arup_r has quit [Remote host closed the connection]
cpruitt has joined #ruby
<havenwood>
adaedra: the ping, now i'm late ;)
TinkerTyper has quit [Ping timeout: 264 seconds]
<adaedra>
oh
quimrstorres has joined #ruby
<adaedra>
yeah, would have been better without network issues >_>
symm- has quit [Ping timeout: 248 seconds]
<havenwood>
hehe
<[k-_>
do you have special late privileges by any chance ;)
musgravejw has joined #ruby
renderful has quit [Remote host closed the connection]
dross has joined #ruby
<abyss>
bnagy: you want leave me alone, I fight with this for 3 days, not only with script but whole this bunch of duplications in binlogs etc - my wise and intelligence decrease to 60;)
TinkerTyper has joined #ruby
<abyss>
[k-_: change_id = lambda { |id| id + 1000 } , get: undefined method `change_id' for main:Object (NoMethodError)
michael_mbp has joined #ruby
<[k-_>
haish
jesterfraud is now known as noyoudont
commondream has joined #ruby
imanzarrabian has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noyoudont is now known as jesterfraud
<[k-_>
i updated the gist again
davedev24_ has joined #ruby
yoongkang has joined #ruby
coderhs has quit [Quit: Leaving]
skysploit has joined #ruby
skysploit has quit [Remote host closed the connection]
skysploit has joined #ruby
revath has joined #ruby
jerius has joined #ruby
<abyss>
[k-_: I still get NULLs :(
<[k-_>
do you get nulls on bnagy's?
<abyss>
bnagy code doesn't work for me
<[k-_>
i stole the sub code from him!
<[k-_>
pls wait while i try to go interactive
skysploit has quit [Client Quit]
<bnagy>
abyss: in what way? What's the error from the latest gist?
<abyss>
undefined local variable or method `replace' for main:Object (NameError) - but I was afraid to show this because he would beat me that it's easy to repair
soulcake has quit [Ping timeout: 276 seconds]
dblessing has quit [Ping timeout: 244 seconds]
dross has quit [Ping timeout: 250 seconds]
<bnagy>
oh, well change it in line 3 :|
enebo has joined #ruby
<bnagy>
updated
lordkryss has joined #ruby
<bnagy>
but seriously 0_o
<abyss>
bnagy: yeah, but I'm not sure what your code do, so I'm not sure if I thought righ to change it, Why hash for example ;)
<bnagy>
abyss: ok well I'm out
bogdanteleaga has quit [Ping timeout: 250 seconds]
<bnagy>
it doesn't seem like you can actually code at all
<[k-_>
abyss: the reason why we give you code is for you to learn from it ;-;
<bnagy>
so this isn't really a programming question any more
ta has joined #ruby
<abyss>
bnagy: Your patience has been exhausted by me?:(
<bnagy>
abyss: yes
imanzarrabian has joined #ruby
hutch78 has joined #ruby
<shevy>
lol
<bnagy>
the last bug was between lines 2 and 3. If you can't figure that out for yourself then you're not programming
mister_solo has joined #ruby
<abyss>
yeah, ok sorry for that, it's my bad, I spent 3 days on it (not only that script) everybody looks at me I have knife on my neck and I stopped thinking - my bad.
<bnagy>
I mean I apologise for my code that I'm typing untested into gist not working perfectly
<bnagy>
that bit is clearly my fault
soulcake has joined #ruby
MasterPiece has quit [Remote host closed the connection]
<abyss>
[k-_: yes, I know, people from this channel help me many times and I learn a lot (not only ruby, but programming :)) it's my bad that I turn off thinking its because all that circumstances :/
podman has joined #ruby
<shevy>
now you two make out and kiss and we can move on
<abyss>
three of us
datanoise has joined #ruby
<shevy>
wat
<shevy>
that's illegal
<shevy>
in some US states
<abyss>
err bnagy [k-_ and me?;)
<shevy>
oh dear
Al3ks has quit [Quit: Leaving]
<_mh_>
abyss: Out of experience, don't let yourself being overrun by requests. Sure people want their fixes and quick, but the more stress you put on yourself, the more likely you'll be making a lot of mistakes.
mallu has joined #ruby
<abyss>
_mh_: yes, sometimes live isn't so easy;)
mallu has quit [Client Quit]
<adaedra>
<shevy> in some US states
soulcake has quit [Changing host]
soulcake has joined #ruby
<adaedra>
since when the US law is a reference?
<shevy>
since TTIP
<bnagy>
since BIS! \o/
terlar has joined #ruby
msnyon has joined #ruby
<_mh_>
abyss: I sure as well know. But sometimes it takes a ping to take a step back, take a deep breath and realize work's going to take the time and rushing it does more harm then good.
adamjleonard has joined #ruby
<abyss>
[k-_: yes I get NULLs with bnagy code as well.
Al3ks has quit [Remote host closed the connection]
<[k-_>
^ there
_ixti_ has joined #ruby
soulcake has joined #ruby
<bnagy>
uh
<bnagy>
well there has to be at least one thread
jespada has joined #ruby
<[k-_>
his question was *ever* :3
soulcake has quit [Changing host]
soulcake has joined #ruby
<bnagy>
I didn't know IO would create more though, I thought all that stuff just blocked the main thread
<[k-_>
no, no, no
<[k-_>
ruby is smart enough to have async io :D
<bnagy>
no it's not
Scrofff has quit [Ping timeout: 264 seconds]
<[k-_>
or non-blocking io
<[k-_>
whatever the correct term is
<bnagy>
also false premise
<adaedra>
when was the syntax for named arguments introduced?
<[k-_>
2.0 i think
<[k-_>
or 2.1
<_mh_>
2.1, I believe
<jhass>
2.0 for optional, 2.1 for required ones iirc
Xeago has quit [Remote host closed the connection]
<adaedra>
oh
<adaedra>
ok
kobain has joined #ruby
Pupeno has joined #ruby
<dudedudeman>
'marnin to you all
mikecmpb_ has joined #ruby
l0oky has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
<bohallor>
thanks guys. so only multi-threaded during IO. and the main thread waits or tries to continue? eg loading a Ruby script with ./ruby helloworld.rb or require etc.
kahuna_ has joined #ruby
<l0oky>
unless keyword in ruby is so confusing
<[k-_>
yes l0oky, we all agree :)
<havenwood>
l0oky: It's like unless in real life.
<l0oky>
can someone enlighten me hehe
<havenwood>
l0oky: this unless that
<adaedra>
[k-_: no I don't
hanmac1 has quit [Quit: Leaving.]
<l0oky>
unless i don't have 'this'
scripore has quit [Quit: This computer has gone to sleep]
<l0oky>
haha
revath has quit [Ping timeout: 246 seconds]
<_mh_>
bohallor: Your question is about 'default' parallel execution of code?
mary5030 has quit [Remote host closed the connection]
<[k-_>
adaedra has acheived nirvana!
<l0oky>
-.-'
PapaSierra has joined #ruby
<bnagy>
bohallor: not even multi-threaded during io
<bohallor>
yes. default unmodified ruby 2.2, but just running (what appears to be) sequential ruby code.
<_mh_>
bohallor: Top down, no hidden paralell executions
<bnagy>
l0oky: "if not"
<[k-_>
just use if not
<bnagy>
nono use unless
<l0oky>
yeah but rubymine is being such a jerk
<bohallor>
_mh_: that's what i was hoping for
<bnagy>
but the semantic meaning is "if not"
<[k-_>
nono if not is less confusing
<bnagy>
false
<l0oky>
highlighting that statement in yellow :S
<[k-_>
true
<PapaSierra>
hi. i'm learning about mixins. if i use an analogy from js, if i already have a class i could add a method to it. i understand how to do this: obj.extend(SomeMixin), but that adds the mixin to an instance. how would i add it to the *class* so all instances have the mixin?
<bnagy>
[k-_: not and ! have different precedence :(
<bnagy>
like and and &&
micmus has joined #ruby
ndrei has joined #ruby
Xeago has joined #ruby
<adaedra>
l0oky: put your mouse over the keyword, it should tells you what's wrong
<bnagy>
in general, best to just use unless
IrishGringo has joined #ruby
scripore has quit [Client Quit]
<jhass>
PapaSierra: by calling include on the class
<jhass>
PapaSierra: class Foo; include SomeMixin; end; typically
dg-ratio1 has joined #ruby
<jhass>
and that's actually the common case over extend
<adaedra>
l0oky: iirc, it doesn't like unless if it has a else with it, it would want you to revert the cases and use if
<l0oky>
Control flow statement with negative condition less...
<[k-_>
I know they do
<[k-_>
.-----.
aphprentice has joined #ruby
<l0oky>
whatever that means hahaha
Outlastsheep is now known as zz_Outlastsheep
<[k-_>
i would kill someone if they use multiple unless
<[k-_>
and unless not
<adaedra>
"unless not"
<adaedra>
ahah
<l0oky>
hahhahahahaha
sevenseacat has quit [Quit: Me dun like you no more.]
* l0oky
*derp*
<PapaSierra>
jhass: that presumes my code declared class Foo. what if Foo is declared in a gem that i'm using and i simply want to add extra behaviour after the fact?
kirun has joined #ruby
jenrzzz has joined #ruby
<jhass>
[k-_: l0oky worth pointing out that unless and if not are not equivalent, if not/ if ! call the ! method, unless doesn't
<shevy>
PapaSierra ruby is open at run-time to modifications
scripore has joined #ruby
<l0oky>
right..
<[k-_>
then how does it work?!
<[k-_>
i thought it was just syntactic sugar
railsraider_ has joined #ruby
<bohallor>
_mh_: that's what i was hoping for
<jhass>
PapaSierra: you could just reopen the class, though you're properly better off writing a decorator, OO design wise speaking
roa has quit [Ping timeout: 272 seconds]
<jhass>
*probably
dross has joined #ruby
<PapaSierra>
jhass: right
sandstrom has joined #ruby
<[k-_>
>> module A;def hi;end;end; class B;end; a = B.new; B.include(A); a.hi
<adaedra>
#openbsd which recommend something in gnu.org?
<[k-_>
now, now, they arent biased beasts
Xeago has quit [Remote host closed the connection]
p1k has quit [Ping timeout: 276 seconds]
<jhass>
adaedra: if you ever setup a mailman you'll know why :P
kwd has quit [Quit: kwd]
dfockler has joined #ruby
snockerton has joined #ruby
Jackneill has joined #ruby
<adaedra>
[k-_: I thought BSD guys disliked the GPL.
CloCkWeRX has quit [Quit: Leaving.]
<[k-_>
they do
scripore has quit [Quit: This computer has gone to sleep]
<adaedra>
jhass: Doesn't seems to be the case before long.
bluish has joined #ruby
<jhass>
be glad
wookiehangover has quit [Ping timeout: 252 seconds]
<adaedra>
you say that because it's difficult to do?
<jhass>
well, it's fairly easy actually. If you start with a blank postfix and don't intend to use it for anything besides
pik_ has quit [Client Quit]
phat4life has quit [Ping timeout: 248 seconds]
unshadow has quit [Ping timeout: 250 seconds]
afrianska has quit [Ping timeout: 264 seconds]
phat4life has joined #ruby
jenrzzz has joined #ruby
gambl0re has joined #ruby
<adaedra>
I see
Soda has joined #ruby
<lalalaaa>
ddv: dunno, email delivery via localhost works fine for normal rails apps but discourse has been abstracted to the point where it no longer resembles a rails app
Xeago has joined #ruby
zeroDi has joined #ruby
fabrice31 has quit [Ping timeout: 250 seconds]
<adaedra>
it ressembles a road app
atom3_ has quit [Ping timeout: 276 seconds]
<lalalaaa>
but thats just my opinion. it works great for people who're not familiar with rails and who want a 1-click install via docker
* adaedra
--> []
baweaver has joined #ruby
axilla has joined #ruby
<[k-_>
wut
atom3 has joined #ruby
<[k-_>
i hope your meds wear off soon
uber_ has joined #ruby
<adaedra>
?
wookiehangover has joined #ruby
ccooke has quit [Ping timeout: 256 seconds]
yoongkang has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
zeroDivisible has quit [Ping timeout: 256 seconds]
tvw has joined #ruby
<[k-_>
you arent taking meds?
ccooke has joined #ruby
imanzarrabian has joined #ruby
tjbiddle has joined #ruby
<adaedra>
no
<jhass>
just bacon
<jhass>
chunky bacon
<adaedra>
:D
chinmay_dd has joined #ruby
ta has quit [Read error: Connection reset by peer]
<Aria>
[k-_: not appropriate.
diegoviola has quit [Ping timeout: 244 seconds]
<[k-_>
it must be apeiros who is/was taking meds then
<Takumo>
kadoppe: so I'd need to just replace k.to_s with k+'2' :)
icebourg has joined #ruby
<[k-_>
you should abstract it to have a HashKeyUpdaterFactory
timonv_ has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
<bnagy>
>:(
imanzarrabian has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_>
:)
<Takumo>
[k-_: ThisIsNotJ2EError
* jhass
hands [k-_ some chunky bacon
<bnagy>
JUST CREATE A NEW HASH IT IS NOT THAT HARD
renderful has joined #ruby
theRoUS` is now known as theROUS
* jhass
hands bnagy some chunky bacon, too
shakes has joined #ruby
<bnagy>
effing hipsters
<[k-_>
this is not fox bacon right
<adaedra>
there, there.
ahmadsoe has joined #ruby
<DefV_>
This solution needs more threads!
DefV_ is now known as DefV
lalalaaa has quit [Quit: leaving]
<[k-_>
no, threads are too heavy
<adaedra>
-_-
<[k-_>
we should use fibers!
n008f4g_ has joined #ruby
<havenwood>
[k-_: At the same time that factory work exhausts the nervous system to the uttermost, it does away with the many-sided play of the muscles, and confiscates every atom of freedom, both in bodily and intellectual activity.
<bnagy>
somewhere along the line there was this new movement where it became illegal to hit the enter key
<Takumo>
bnagy: yeah, this DB just has some crap like "userinfofield1" "userinfofield2" "userinfofield3" etc :(
<DefV>
We need a forking model so we can use all our cores
devdazed_ has joined #ruby
<shevy>
how do you guys keep track of news in ruby?
imanzarrabian has joined #ruby
<bnagy>
new = {}; old.each {|k,v| #do stuff
<DefV>
shevy: twitter
<[k-_>
r/ruby?
<[k-_>
r/programming?
<apeiros>
shevy: twitter/ruby-flow
<shevy>
aha ok
<apeiros>
shevy: also see ruby-community.com for links ;-)
<ruboto>
adaedra # => /tmp/execpad-9a6cd3110dcd/source-9a6cd3110dcd:2: syntax error, unexpected '(' ...check link for more (https://eval.in/385640)
<[k-_>
i didnt use 18
<adaedra>
well
edwinvd__ has quit []
<adaedra>
hi ivanskie
<ivanskie>
I'm trying to find the right tool. not sure if i should do a single page (single file too) html/javascript or.. make a ruby script...
revath has joined #ruby
<ponga>
damn it i can't understand duck typing concept
<[k-_>
i must have created my own class then
Alayde_ has joined #ruby
<ivanskie>
I have csv file being generated everyday. one csv per day.
timonv has quit [Ping timeout: 276 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
<ivanskie>
I need to read csv file, and show a count of different items... per day..
dANO_ has quit []
bronson has joined #ruby
<[k-_>
ivanskie: is this frontend or backend
NeverDie has joined #ruby
<episage>
jhass: spot on :D, i am pushing before i call run
<jhass>
"show", elaborate on that
<ivanskie>
front.. its not to be a hosted app.. customer wants to have something she can run/open... and view it.
<jhass>
episage: but if it's run empty, who's pushing new items then?
<michael_mbp>
thanks jhass and [k-_
<michael_mbp>
I'd completely forgotten about parse.y
<[k-_>
yw
msgodf has quit [Ping timeout: 272 seconds]
<[k-_>
well you should use javascript then or opal2js
fantazo has quit [Ping timeout: 265 seconds]
<ivanskie>
basically.. got a printer applicator machine.. every time it prints a label.. it prints a diff label for diff product.. and software writes back into csv file of the productID.. so i want to go back into that CSV file, and count number of these different productIDs to show her a count per day.. but the csv file is different each day..
<michael_mbp>
I do a fair bit of ecma, but not dived that much under the covers. I want to.
<ivanskie>
with a date written in filename
caseypatrickdris has joined #ruby
<michael_mbp>
done backbone, some ES6, node.
Rollabunna has joined #ruby
<ivanskie>
and i'm not sure if i want to do this in Ruby.. and then instal ruby on her laptop.. or do it in JS
<jhass>
ivanskie: do you know how to do it in either?
husanu1 has joined #ruby
<michael_mbp>
ivanskie: name the file with a certain pattern
<michael_mbp>
like products_<date>
yh has quit [Ping timeout: 246 seconds]
<ivanskie>
ruby.. i have idea.. i know more ruby than i know JS.. and in JS i was thinking of maybe doing emberjs or angular single page thing.. in one file.. so she'd just open it and it'd show her
k3asd`_ has joined #ruby
<michael_mbp>
where date is in an isoformat
lotherk has joined #ruby
<ivanskie>
hm.. its in 62215 right now
<michael_mbp>
you can then regexp the date
JEG2 has joined #ruby
<michael_mbp>
FileUtils will help you some
<episage>
jhass: i should spawn separate thread to manage it
davedev2_ has joined #ruby
<ivanskie>
hm
<jhass>
episage: sounds about right, google producer/consumer pattern
sandstrom has joined #ruby
<[k-_>
ivanskie, check out opal
<episage>
ok
<ivanskie>
ooh
husanu1 has quit [Remote host closed the connection]
ivanskie is now known as ivanskie_away
<ponga>
shevy: what is a well known language that does not support duck typing?
Senjai has quit [Changing host]
Senjai has joined #ruby
husanu has joined #ruby
<ponga>
i always thought it as a natural stuff, i can't imagine something without it
<shevy>
proc sumTillNegative(x: varargs[int]): int =
k3asd` has quit [Ping timeout: 252 seconds]
<bnagy>
"cast typing" - "We'll MAKE you a duck!"
<shevy>
and the last one... proc myWriteln(f: File, a: varargs[string]) =
acke has joined #ruby
<shevy>
bnagy they make meat out of a duck in a factory!
<[k-_>
abyss is having a really long meeting
davedev24_ has quit [Ping timeout: 248 seconds]
enebo has quit [Quit: enebo]
<ponga>
i can't understand it... isn't it just different objects having different methods and a programmer's job to handle them?
k3asd`_ has quit [Ping timeout: 276 seconds]
k3asd` has joined #ruby
<bnagy>
ponga: "objects" and "methods" are already making assumptions
shinnya has joined #ruby
<Senjai>
I'm putting rails on notice
<ponga>
bnagy: i know i am but i don't have good prerequisite knowledges to explain it well
endash has joined #ruby
IrishGringo has quit [Ping timeout: 248 seconds]
<bnagy>
ponga: there are plenty of languages that don't have wither
<bnagy>
*either
<jhass>
foo.to_s.upcase # duck typing; if foo.is_a?(String); foo.upcase; elsif foo.is_a?(Symbol); foo.to_s.upcase; else raise ArgumentError, "pass something I can handle!"; end # no duck typing
skade has quit [Quit: Computer has gone to sleep.]
rbennacer has quit [Remote host closed the connection]
<ponga>
bnagy: " For example, in a non-duck-typed language, one would create a function that requires that the object passed into it be of type Duck, " this line helped me to grasp it
* [k-_
checks if f.oo website exists
momomomomo has joined #ruby
Iarfen has joined #ruby
<Iarfen>
Hi!!
<[k-_>
hi!
spider-mario has joined #ruby
<shevy>
ponga what I don't understand is
<bnagy>
ponga: that's kind of wrong imho :/
<shevy>
duck typing relies on .respond_to? right?
<ponga>
shevy: when do you think matz will speak english comfortably?
<Iarfen>
I wanted to ask: is Ruby a good programming language to make videogames? Comparing against c++ and objective-c?
<shevy>
in LPC, non-existing methods return 0
enebo has joined #ruby
<shevy>
ponga he is 50 now, perhaps when he is 99
<bnagy>
ponga: for example you can write ruby duckishly or non-duckishly
<jhass>
Iarfen: depends on the type of the game, but tbh. probably not
<_blizzy_>
is there a way to run multiple class instances at the same time without them colliding?
<ivanskie_away>
back
<jhass>
Iarfen: the ecosystem isn't too strong there
<_blizzy_>
they can be started whenever I use a command, let's say, !foo
<bnagy>
so it's not a langauge thing, it's a programming approach
<_blizzy_>
so !foo, would start 1, !foo would start a second one, but 1 and 2 wouldn't interfere with each other.
j416 has joined #ruby
<ponga>
shevy: maybe he's not willing or trying hard
blackmes1 has quit [Ping timeout: 255 seconds]
<jhass>
_blizzy_: if you have proper encapsulation (= no shared state) that should just work
<_blizzy_>
jhass, the instances are anonymous
<ponga>
ability to code overlaps a lot with ability of language accquisition
<ivanskie>
if I make a visual page.. im thinking of listing all csv files, then when she clicks on each one it shows the counts on the right kinda thing hmm. you'd think it makes mose sence to write it as an excel macro. but i haven't touched VB in yeeears
<jhass>
_blizzy_: not relevant
<[k-_>
is that not duck typing?
<[k-_>
how does that work then?
<jhass>
[k-_: can't tell if you're serious...
<ponga>
oh thank you bnagy "so it's not a langauge thing, it's a programming approach" your line really solved the last puzzle piece inside my head
<ponga>
thanks
* [k-_
goes research on the subject
deric_skibotn has joined #ruby
<jhass>
[k-_: Kernel.Array(my_a=[])
<jhass>
that's what you're doing there
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_blizzy_>
jhass, so this https://gist.github.com/NotBlizzard/45990af8297c3868827e, if called twice, would start two separate Foo instances, and they wouldn't interfere with each other, and both would both be running until they finish.
dross has quit [Ping timeout: 272 seconds]
<[k-_>
oh!
sarkyniin has joined #ruby
<[k-_>
@.@
<jhass>
_blizzy_: in your example there's no concurrency so they wouldn't start in parallel or even run concurrently
<Iarfen>
jhass, why not? because of performance issues respecto to c++ or because of other reasons? I prefer ruby as a programming language, it has more flexibility than c++
<_blizzy_>
jhass, I mean like, I call !foo once, and it starts to run
<_blizzy_>
you call !foo 5 minutes later, and a second instances runs
IrishGringo has joined #ruby
<_blizzy_>
my instance is still running
<_blizzy_>
while yours is now running
<jhass>
Iarfen: you can bypass the performance issues with bindings to native libraries, I rather mean lack thereof & frameworks on top
<bnagy>
Iarfen: you can do anything in anything
<_blizzy_>
I'm using EventMachine if that helps. c:
<Iarfen>
jhass, I wanted to do my own framework, frameworks are not an issue :D
<bnagy>
notch made 2 billion bucks out of java
<[k-_>
you shouldn't really write games in ruby...
<jhass>
Iarfen: if all you want is some SDL/2D side scroller type of thing you should be fine with the SDL bindings or something like Gosu though
<_blizzy_>
if you're making a game make it in C# or Java, or C++.
momomomomo has quit [Quit: momomomomo]
<[k-_>
it becomes hell to maintain ruby when the code base gets huge
<Iarfen>
jhass, I want to do an MMORPG, ruby is not the option then? I really prefer it
<bnagy>
smelling trolling
<_blizzy_>
Iarfen, i'm not jhass, but making a MMORPG in ruby is possible
<jhass>
_blizzy_: not me, never used eventmachine yet, thus not familiar with its implementation
<_blizzy_>
but not recommended
<Iarfen>
blizzy_, thank you, why is not recommender
<[k-_>
larfen, twitter shifted off ruby because it wasnt keeping up
<yh>
keeping up in what way?
<_blizzy_>
because there are better languages for MMORPGS.
<[k-_>
slow
mikecmpb_ has quit [Quit: i've nodded off.]
<_blizzy_>
Twitter now uses Scala, which is a great language btw.
<yh>
JRuby is pretty fast
alex88 has quit [Ping timeout: 248 seconds]
<havenwood>
[k-_: Twitter still uses Rails as well.
<[k-_>
minor minor
<_blizzy_>
Twitter uses Scala now I though.
blackmes2 has joined #ruby
<_blizzy_>
*thought
<_blizzy_>
jhass, minus Event Machine, how would I achieve my goal if possible.
<_blizzy_>
threads?
<Iarfen>
blizzy_, but why the other languages are best, only because of frameworks?
<havenwood>
_blizzy_: For the backend, aye.
<jhass>
_blizzy_: stuff that gets as big as twitter would be stupid to base on a single technology
xxneolithicxx has joined #ruby
darkf has quit [Quit: Leaving]
<_blizzy_>
jhass, yeah.
<bnagy>
EM is dead, no?
<_blizzy_>
havenwood, ok, thanks.
<_blizzy_>
Iarfen, because each tool has it's use.
towski_ has joined #ruby
<_blizzy_>
I wouldn't build an airplane with just a hammer.
<_blizzy_>
it's possible, but it would be hard as hell.
icebourg has quit []
dross has joined #ruby
<[k-_>
it's possible?
<_blizzy_>
ok, probably not possible, but you get the point. c:
<jhass>
Iarfen: just toying or building something specific?
icebourg has joined #ruby
revath has quit [Ping timeout: 244 seconds]
<Iarfen>
jhass, building an MMORPG, it will be specific
<shevy>
once they grow
<Iarfen>
trying to decide the best programming language, I don't like C++ because the syntax is really anoying
<shevy>
they abandon ruby
<shevy>
:(
<Iarfen>
so prefer to use another if possible
<nofxxx>
Is jruby-head >= 2.0.0 ?
<[k-_>
ruby really isnt the right choice for this things
<havenwood>
nofxxx: JRuby 9.0 is up to 2.2 now. :)
<[k-_>
larfen: you should get a strongly typed language with static typing
husanu has quit [Remote host closed the connection]
droidburgundy has joined #ruby
<nofxxx>
havenwood, ty. For travis CI. Gonna try jruby-head.
husanu has joined #ruby
cndiv has quit []
<[k-_>
and don't jump onto the haskell bandwagon
<[k-_>
IO wont be easy to handle...
<[k-_>
you could try D
droidburgundy has quit [Client Quit]
<[k-_>
it has type inference
<havenwood>
nofxxx: For earlier JRuby you can: export JRUBY_OPTS=--2.0
<havenwood>
nofxxx: 9.0.0.0.rc1 ship in 2.2 mode.
<nofxxx>
Iarfen, I disagree, ruby would be perfect for a lot of stuff. And when it comes to the realtime/socket part you can just choose what to use. deepstream/node, or maybe elixir/erlang
<jhass>
Iarfen: I guess Elixir for the backend could be interesting, but for the client you'll C++ is probably still your best bet :/
snath has joined #ruby
<jhass>
eh, s/you'll//
<havenwood>
Iarfen: Crystal and Elixir are the answers. What is the question?
<Iarfen>
okay, thank you all for the advices, I'll decide
<nofxxx>
Iarfen, as said, you need a lot of tools to build an airplane. Ruby being the dewalt 20V
<[k-_>
havenwood: hue hue hue
<jhass>
well yeah, Crystal if you don't fear fixing language bugs :P
<havenwood>
nofxxx: I thought Ruby was legos. ;)
<[k-_>
please, we need more D users
* havenwood
flies off in a lego plane...
<nofxxx>
havenwood, dude, with some money and a dewalt 20V you can launch to space. I've built half my furniture with it hehe
allenn has quit [Ping timeout: 252 seconds]
<[k-_>
you'll be mistreating yourself and others
<nofxxx>
Iarfen, checkout rethinkdb too
<jhass>
use mongo because mongo is webscale. MySQL isn't wescale. use mongo
cndiv has joined #ruby
antgel has quit [Ping timeout: 256 seconds]
<nofxxx>
havenwood, and thanks again
<[k-_>
are you sure mongo is the right choice
<nofxxx>
yeah, mongo or rethink. Love'em both.
<[k-_>
most people have criticised mongo
<[k-_>
they said it should be used if your data is not important @.@
<[k-_>
only*
<nofxxx>
[k-_, while they talk I use, and dont waste a second migrating or shell working
<dudedudeman>
our company uses mongo for everything. web, pipeline, production, whatever
<[k-_>
but mongo journalling is a bit awkwardish
nofxxxx has joined #ruby
<eam>
[k-_: those people are correct
rafaelsales has quit [Remote host closed the connection]
<[k-_>
they are? not sure who to trust @.@
lrocksmashtime has left #ruby [#ruby]
<adaedra>
[k-_: problem is that mongo does not guarantees data correctness iirc
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
<_blizzy_>
I get the joke now.
episage has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<[k-|>
the first one is parallelism isnt it
<eam>
interestingly we have parallelism in one cpu as well due to superscalar architecture
super has joined #ruby
jenksy has joined #ruby
<eam>
though it's hidden from view at the ruby level
<jhass>
[k-|: both are
<toretore>
meaning? hyperthreading?
nwhirschfeld has joined #ruby
<jhass>
[k-|: the second one is how it works out in reality ;)
<eam>
toretore: pipelining
<jhass>
the first one is how you planned it
<[k-|>
but..but...
<toretore>
eam: oh
<eam>
hyperthreading isn't hidden from view, it appears as a real cpu core to userspace
<[k-|>
that is so much less elegant than ruby!
<toretore>
right
zeroDi has quit [Ping timeout: 255 seconds]
<[k-|>
A superscalar CPU architecture implements a form of parallelism called instruction-level parallelism within a single processor. It therefore allows faster CPU throughput than would otherwise be possible at a given clock rate.
<[k-|>
[Wikipedia]
subtwo has joined #ruby
afrianska has quit [Ping timeout: 252 seconds]
<eam>
[k-|: read that as: the CPU determines that the next X instructions don't interact with each other, so it executes them all at the same time (in a pipeline)
bronson has quit [Remote host closed the connection]
<[k-|>
:o
droidburgundy has joined #ruby
<atmosx_>
hello
atmosx_ is now known as atmosx
droidburgundy has quit [Client Quit]
<[k-|>
hello
<toretore>
why is it a pipeline if they don't interact?
baweaver has joined #ruby
vikaton has joined #ruby
<eam>
view program code as stuff you're pushing through the cpu - an instruction pipeline
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
<eam>
the amount you can execute in parallel (empty the pipe fast) is the depth of your pipeline
<eam>
all kinds of tricks are used on modern processors to set up long pipelines with maximum parallelism (branch prediction, out of order execution)
<toretore>
yeah i was being facetious :P
<eam>
ah :)
<eam>
oh well, should be interesting material for newbies
<toretore>
usually pipeline means the result of one job goes into the next
<toretore>
yeah for sure
<vkgfx>
it does
<vkgfx>
the parallel execution is just different phases of execution
<vkgfx>
like reading instruction from memory, loading data, executing instruction, etc.
<vkgfx>
they flow along a pipeline
baweaver has quit [Remote host closed the connection]
<vkgfx>
pipelining means that you can be loading the next instruction's data while you executing the previous one
dblessing has joined #ruby
<vkgfx>
and you can be loading the instruction for the instruction after that
<toretore>
sure, but they don't depend on each other
<vkgfx>
sometimes they do
<vkgfx>
that causes a stall
tlarevo has joined #ruby
<vkgfx>
but it can also be resolved by making a data path
yqt has quit [Ping timeout: 246 seconds]
<vkgfx>
so that data from one instruction can be redirected back to the next one that uses it
<toretore>
at least in the case of "superscalar" architecture
subtwo has quit [Quit: (null)]
<toretore>
the whole point being that they can be executed in parallel because they're not waiting on each other
Rollabunna has quit [Remote host closed the connection]
<vkgfx>
pipelining and superscalar execution are not that same thing toretore
charliesome has joined #ruby
<[k-|>
add -> mov can be in parallel but mov -> add cannot?
<toretore>
vkgfx: ok
caseypatrickdris has quit [Quit: Leaving...]
<eam>
[k-|: depends on what's going on where
<eam>
if nothing interacts with the memory being touched then there's probably no issue
casadei has quit [Remote host closed the connection]
<[k-|>
time to beg?
msnyon has quit [Ping timeout: 246 seconds]
<toretore>
havenwood: that can be done without explicit language support
blue_deref has joined #ruby
<toretore>
just need someone to build it
nwhirschfeld has joined #ruby
<toretore>
and i don't like the cutesy syntax :/
alphaatom|pc has quit [Ping timeout: 256 seconds]
msnyon has joined #ruby
two-gun has joined #ruby
quimrstorres has quit [Remote host closed the connection]
lkba has joined #ruby
alphaatom|pc has joined #ruby
DLSteve has joined #ruby
Ilyas has joined #ruby
<[k-|>
we have <|> in haskell... whatever that is
<[k-|>
but the elixir code looks ~beautiful~
<[k-|>
i shall add it to my list of things to learn
Jackneill has quit [Remote host closed the connection]
acke has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tjbiddle has quit [Quit: tjbiddle]
psy_ has quit [Read error: Connection reset by peer]
zz_Outlastsheep is now known as Outlastsheep
<two-gun>
evening all. I'm having trouble with a gem called wordmove (am i in the right channel?) the stack is vagrant/vvv/wordmove for wordpress but my problem is wordmove seems to have been install at root. if i do sudo gem list, it shows up, if i do gem list, it doesn't. this is a problem because wordmove uses rsync to push the wp site to the production server. it's no good if i can only do that as root. is it a st
<two-gun>
raightforward thing to change the path or something? I'm not so fluent with this stuff yet. thanks
Channel6 has quit [Quit: Leaving]
msnyon has quit [Ping timeout: 252 seconds]
crdpink has joined #ruby
lkba_ has quit [Ping timeout: 250 seconds]
crdpink2 has quit [Ping timeout: 248 seconds]
Scroff has joined #ruby
<havenwood>
two-gun: Yup, this is the right channel. See: gem help install | grep user\-install -A1
s2013 has joined #ruby
yoongkang has quit [Remote host closed the connection]
diegoviola has joined #ruby
<[k-|>
i hardly use any gems
<havenwood>
two-gun: You can put a `gem: --user-install` in your ~.gemrc or install the gem with: gem install foo --user-install
tubuliferous_ has joined #ruby
<havenwood>
two-gun: To install in your home directory instead of system. ^
casadei has joined #ruby
<two-gun>
havenwood: is there anyway to modify it as it stands. it was installed as part of a shell script and i'm a little unsure if i remove it and re-install it what might fall apart. to build the vagrant virtual machine takes forever an di've already done it 3 times. thanks for your help
kohgpat has joined #ruby
ahmadsoe has quit [Quit: Connection closed for inactivity]
<havenwood>
two-gun: Do you have just one Ruby installed? Ubuntu system Ruby?
<two-gun>
havenwood: how might i check that?
<havenwood>
two-gun: uname -a
<havenwood>
two-gun: which ruby
lucianosousa has joined #ruby
<havenwood>
two-gun: which -a ruby
<two-gun>
i might have 2. i just did ruby -v and sudo ruby -v
<two-gun>
different version numbers :-O
<havenwood>
two-gun: Do you get anything for?: command -v rvm
<two-gun>
uname -a: Linux vvv 3.13.0-55-generic #92-Ubuntu SMP Sun Jun 14 18:33:09 UTC 2015 i686 i686 i686 GNU/Linux
<two-gun>
which ruby: /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby
<havenwood>
So I'm guessing Ubuntu system Ruby as well as RVM.
<havenwood>
Aye
<two-gun>
which -a ruby/usr/local/rvm/rubies/ruby-2.2.1/bin/ruby
<two-gun>
/usr/bin/ruby
<havenwood>
two-gun: So when you use `sudo` it is dropping your RVM env which gives you system Ruby.
trieepiee has joined #ruby
<trieepiee>
if I want to learn ruby today what's the best way to do so
<havenwood>
two-gun: There's an `rvmsudo` that keeps the RVM env while elevating privileges.
<nofxxxx>
trieepiee, codeschool, code achademy, chris pine learn to program
<two-gun>
trieepiee: not sure what this community thinks of code academy but you could start that right now. might be nice to just dive in (i haven't done it myself)
<havenwood>
trieepiee: The Learn to Program book ^ is a gentle introduction if this is your first foray into programming.
<nofxxxx>
two-gun, which version ubuntu is shipping from apt? if it's > 2.2 you might just well drop rvm, it'll just cause headaches
<Outlastsheep>
http://mislav.uniqpath.com/poignant-guide/book/ It's outdated since it explains an older version of Ruby (most of the info's still relevant though). But it's still the most *entertaining* way to go.
sdwrage has joined #ruby
kohgpat has quit [Quit: leaving]
<trieepiee>
thanks all of you
<havenwood>
Outlastsheep: And it has a soundtrack, which is lacking from most other programming books.
<Outlastsheep>
trieepiee: you're welcome!
<Outlastsheep>
havenwood: and cartoon foxes! _Cartoon Foxes_, man!
<BrianBoyko1>
I have a program - written by someone else - that processes Stripe payments. I'd like to create a log of those payments (just e-mail and amount) to a PG database. Difficulty: I'm a newbie programmer. Ultra Hardcore Difficulty: studying Javascript.
freerobby has quit [Quit: Leaving.]
<BrianBoyko1>
so basically, I just have to pass @amount and @email to a database.
tlarevo has quit [Remote host closed the connection]
<BrianBoyko1>
This program doesn't need to retrieve anything.
<adaedra>
Most direct way is pg. If you want a nice layer in top of that, you have Sequel.
baweaver has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
chinmay_dd has quit []
<BrianBoyko1>
I'm going through the pg docs now and I'm more or less lost. Especially since I can't get this program to run locally.
Zai00 has joined #ruby
shinnya has quit [Ping timeout: 246 seconds]
freerobby has joined #ruby
<adaedra>
Which program? The code you were given?
psy_ has joined #ruby
Iarfen has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253]]
cir0x has joined #ruby
<BrianBoyko1>
Yes - I'm getting the old "you have the wrong version of ruby" error. Problem is, I've done everything to get it to the right version of Ruby and it's still thinking I have the wrong version of Ruby
symm- has joined #ruby
denver has quit [Read error: Connection reset by peer]
senayar has joined #ruby
<adaedra>
what do you mean by "to get it to the right version", what did you do?
<jhass>
something's literally printing you "you have the wrong version of ruby"? if so what's that?
dstarh has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
GitGud has quit [Read error: Connection reset by peer]
<BrianBoyko1>
Your Ruby version is 2.1.2, but your Gemfile specified 2.1.5
<adaedra>
ok, what do you mean now by: I've done everything to get it to the right version
<air__>
ha ha version error
flughafen_ has quit [Ping timeout: 252 seconds]
<[k-|>
its not nice to laugh at people :(
rubie has joined #ruby
<[k-|>
i bet he was pulling his hairs out over this
Scroff has joined #ruby
<BrianBoyko1>
You're right.
baweaver has quit [Remote host closed the connection]
<BrianBoyko1>
I mean, you're mean, but you're right.
Beoran_ has quit [Ping timeout: 264 seconds]
RegulationD has joined #ruby
<jhass>
heh, I'm sure we can get through this, how did you install Ruby?
<BrianBoyko1>
Well, I've googled how to change ruby versions, I've installed the latest version of ruby, I've installed rvm (and that was an ordeal) and at the end - I still get this error
<BrianBoyko1>
sudo apt-get install ruby ruby-dev
scripore has joined #ruby
<jhass>
but you have rvm now?
<BrianBoyko1>
yes
<jhass>
what's the output of?: rvm current
<adaedra>
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
BanzaiJoe has joined #ruby
<jhass>
adaedra: it's a single line...
<adaedra>
oh
<BrianBoyko1>
ruby-2.1.5
<jhass>
what's the exact command you run that claims it's Ruby 2.1.2 ?
GitGud has joined #ruby
<BrianBoyko1>
bundle install
atom3 has joined #ruby
atom3 has quit [Remote host closed the connection]
Scroff has quit [Remote host closed the connection]
otherj has joined #ruby
<jhass>
yeah, that part seems right
<ivanskie>
perhaps a dumb question...
<ivanskie>
warning: redefining Object#initialize may cause infinite loop
<ivanskie>
whats wrong with me writing my own initialize block?
mary5030_ has joined #ruby
air__ has quit [Ping timeout: 246 seconds]
<ivanskie>
its not in a module.. just a single lonesome .rb file
<BrianBoyko1>
Hmm... I don't understand why the code breaks when I add my logging code, but worked before...
<jhass>
BrianBoyko1: my guess is it fails in the Stripe call before that already, we can verify if you just add a puts e.backtrace or LOG.error(e.backtrace) in lines 178, 185 and 196 and share the output
<jhass>
oh, you had it working locally before?
mary5030 has quit [Ping timeout: 252 seconds]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BrianBoyko1>
okay. That'll show up in the console, correct?
<jhass>
?code ivanskie
<ruboto>
ivanskie, We can't help you without your code, please post it to https://gist.github.com
<ivanskie>
im not worried about refactoring at this point.. just need basic functionality laid out then will refactor and all that.
<jhass>
ivanskie: ah well. Okay the issue here is that toplevel methods are actually added as private methods to the class Object which is the default base class for all other classes
<jhass>
ivanskie: so you redefine the default initialize method of all classes that don't define their own
mikecmpbll has joined #ruby
<ivanskie>
hmm.
snockerton has quit [Client Quit]
<jhass>
best just pick a different name
<ivanskie>
what would be the best practice here? make my own class?
<jhass>
yes
<abyss>
[k went home? bnagy thank you for your help. Tommorow I will check it on 2.x ruby.
<ivanskie>
im usually working with rails. so this is a first doing Ruby alone stuff..
<jhass>
BrianBoyko1: nothing in the logs? hard to believe...
<jhass>
running on heroku? check heroku logs iirc
<BrianBoyko1>
Heroku has logs?
<jhass>
sure!
Zai00 has quit [Quit: Zai00]
<jhass>
heroku logs as command literally
<jhass>
iirc
moloch is now known as zly
workmad3 has joined #ruby
<ivanskie>
ah nice
zly has quit [Changing host]
zly has joined #ruby
<ivanskie>
okay moving on. thanks!
khebbie has joined #ruby
<jhass>
ivanskie: btw ruby's community is strong on using snake_case instead of headlessCamlCase ;)
<ivanskie>
alright
<BrianBoyko1>
2015-06-22T19:33:02.203694+00:00 app[web.1]: PG::ConnectionBad - could not connect to server: No such file or directory
<Aria>
unix domain socket connection
<Aria>
And it's not where it expects it to be.
<ivanskie>
yeah this stuff is mixing with me trying to learn JS and Ember lol.. earlier I was scratching my scrambled brain head trying to remember how to declare a function in ruby.. i was like. do not ask in irc!
<jhass>
:P
<Aria>
I do wish language channels were more polyglot friendly.
bronson has quit [Remote host closed the connection]
<jhass>
let's make a new channel for each combination!
ziprar is now known as zipace
<ivanskie>
lol
<jhass>
#cppandabitperlandjs
slackbotgz has quit [Remote host closed the connection]
slackbotgz has joined #ruby
<BrianBoyko1>
Jember. Rubescript, Javerlang
<ivanskie>
might as well name it #brainscrambler-cppanddabitperlandjs
<ivanskie>
no one will ever know what ur talking about
<jhass>
BrianBoyko1: so yeah, your connect call doesn't fit what you can reach on Heroku
<jhass>
where's the DB supposed to be?
fsvehla has quit [Quit: fsvehla]
<BrianBoyko1>
Well, it's telling me the URL is postgres://qucsbxejiqhfnl:CQkNveZA21tUrTs046lhgHcBGg@ec2-54-227-247-161.compute-1.amazonaws.com:5432/d1e3fv1kfb1muf
<ivanskie>
do I add PrintJobs.new on the bottom somewhere? or.. lolz i feel dumb now. wow way out of practice
asmodlol has joined #ruby
<jhass>
ivanskie: yep, exactly that
<EllisTAA>
jhass: what would those other cases be doing?
<jhass>
EllisTAA: trigger an action for example
<jhass>
like "turn on the light"
<EllisTAA>
so that would be using a post method?
jerius has joined #ruby
<atmosx>
ivanskie: readData(file) <-- line 18 is not defined
<jhass>
in a RESTful web based API, likely, or a PUT to update the state of the light resource, but you don't have to model it that way
<EllisTAA>
ah i see
<ivanskie>
oooh
<ivanskie>
thank you
malconis_ has quit [Ping timeout: 256 seconds]
malconis has joined #ruby
<atmosx>
ivanskie: you probably mean read_data(file)
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ivanskie>
yes indeed
<EllisTAA>
so if apis only accepted get requests it would be just a way to access resources, but since it can accept puts or delete or post it is called a programming interface
atom3 has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
<ivanskie>
ok now if I knew how to properly work with csv.. (reading docs, and examples)... I think the best way here.. would be to build an array of files inside the get_files block..
<ivanskie>
method*
<EllisTAA>
so an api is an api because you can create read update and delete?
<atmosx>
ivanskie: you don't need the initialize method either
<jhass>
EllisTAA: I'm sure there are API's out there that let you trigger stuff via GET's, not saying they're pretty but it doesn't disqualify them for the term API
<atmosx>
ivanskie: you're not setting any instance variables, why do you need it?
peter_paule has quit [Ping timeout: 265 seconds]
<ivanskie>
good point
<atmosx>
you dont. Your class looks more like a module to me :-)
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
BrianBoyko1: ah no, I meant to replace the parameters in the PG.connect call with that
sinkensabe has joined #ruby
<ivanskie>
i think it is too.
AlphaAtom has joined #ruby
<jhass>
BrianBoyko1: ENV accesses the environment variables, like you can see with heroku config
<BrianBoyko1>
okay.
<jhass>
BrianBoyko1: so literally uri = URI.parse(ENV["DATABASE_URL"])
<ivanskie>
basically what I have to work with.. is.. something else out there.. creates a new csv file every day... then once something gets printed, the csv file gets populated with some information like what got printed, productID etc...
<jhass>
BrianBoyko1: and then use uri to pull out the values in the PG.connect call
<jhass>
BrianBoyko1: don't forget to pull out the host and port too
Zai00 has joined #ruby
<ivanskie>
what I need to do is read each CSV file.. and count how many times each unique productID got printed.. or is mentioned per day..
<BrianBoyko1>
And I use the real URL, not DATABASE_URL, right?
User458764 has joined #ruby
<atmosx>
ivanskie: Well, once you read the CSV data you can do anything you want, it's not hard. Just try to analyze the problem and take one step at a time.
<atmosx>
ivanskie: once you have a owrking version, (no matter how long/wrong/bad) you can start to optimize your code.
<ivanskie>
yep. gonna try to play around in irb for a bit
<jhass>
BrianBoyko1: no, ENV["DATABASE_URL"] obtains the real one
charliesome has joined #ruby
<ivanskie>
cause one tutorial showed the headers thing.. and he was doing .to_a.map { |row| row.to_hash }.. but that doesn't work if i do my_data = CSV.read.. works only with CSV.new but then he doesn't actually show how to work with arrays of hashes later.. which sounds basic.. but i can're remember
<ivanskie>
can't
<jhass>
?pry ivanskie
<ruboto>
ivanskie, 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
<ivanskie>
i've got pry installed
<jhass>
just because you said irb ;P
<atmosx>
jhass: what makes pry superior?
<jhass>
atmosx: see above ;)
<ivanskie>
colors
<ivanskie>
:)
<bougyman>
everything
<ivanskie>
lol
jerius has joined #ruby
<ivanskie>
its got the most important improvement.. its got pretty colors :)
<ivanskie>
its what counts right?
<ivanskie>
:P
baxx has quit [Ping timeout: 244 seconds]
freerobby has quit [Quit: Leaving.]
<bougyman>
edit BlahObject
<bougyman>
is the #1 best feature
<bougyman>
repl-based iterative programming
atom3 has joined #ruby
momomomomo has joined #ruby
Rollabunna has joined #ruby
freerobby has joined #ruby
otherj has quit [Quit: .]
<dudedudeman>
the pry link in that above bit jhass is broken
djbkd has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<jhass>
works fine here
<bougyman>
same
bluish has left #ruby ["Good Bye"]
<dudedudeman>
i get this guy: ERR_SSL_VERSION_OR_CIPHER_MISMATCH
<dudedudeman>
ah, taking the https:// off the front worked
<jhass>
oO ssleuth rates it 9.0, get a recent openssl
romero has joined #ruby
<BrianBoyko1>
Now I've got Failed to load resource: the server responded with a status of 503 (Service Unavailable)
<BrianBoyko1>
and the checkout doesn't work.
<BrianBoyko1>
I think I may have accidentially did something to the pub key
<jhass>
git to the rescue?
Jackneill has quit [Ping timeout: 265 seconds]
<atmosx>
This OSX Activiy Monitor thing is really awesome.
k3asd` has joined #ruby
* atmosx
is playing with threads
<BrianBoyko1>
Hold on. I forgot the commas
wallerdev has joined #ruby
<BrianBoyko1>
90% of the time the problem is unsolvable, it is do to a stray punctuation mark that is either where it shouldn't be, or isn't where it should.
momomomomo has quit [Client Quit]
<ivanskie>
how can I work with an array of hashes like this: #<CSV::Row dropdate:"19/06/15" droptime:"10:07:41" drop:"03" productid:"124" serialno:"30">
<ivanskie>
?
freerobby has quit [Ping timeout: 248 seconds]
Rollabunna has quit [Ping timeout: 248 seconds]
<jhass>
mmh, you could've just copy pasted my stuff :P
<BrianBoyko1>
Still have payment failed: reason unknown error
<jhass>
what do the logs say now?
<atmosx>
ivanskie: show the code that result
<jhass>
ivanskie: you can treat CSV::Row's like that like a hash
<ivanskie>
i might not even need to do the header stuff..
decoponio has quit [Quit: Leaving...]
Cust0sLim3n has quit [Ping timeout: 248 seconds]
<ivanskie>
really i just need the count of each unique productid per file..
blackmes2 has quit [Ping timeout: 276 seconds]
framling has quit [Quit: errands]
jacor has quit [Read error: Connection reset by peer]
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jacor has joined #ruby
<jhass>
ivanskie: my answer still holds...
<ivanskie>
i was thinking of get list of files > on each file, print birthdate in human date like i did in work.rb earlier > do my count and print each product id followed by its count.
<ivanskie>
yeah
<jhass>
.map {|row| row[:productid] }
<ivanskie>
oh
<ivanskie>
ooooh o.O awesome
<ivanskie>
thank you
<BrianBoyko1>
2015-06-22T20:15:56.094497+00:00 app[web.1]: TypeError - no implicit conversion of String into Integer:
<Senjai>
I want to get all ids for priority: 0 to perform an operation, then all ids for priority 1, until there are no more ids for the incrementing priority
<jhass>
BrianBoyko1: actually looking at pg's docs: conn.exec_params("INSERT INTO donors VALUES ($1, $2)", [email, amount.to_i])
<Guest54>
hey guys i'm looking at a code emersion class that focuses on Ruby Development.
momomomomo has quit [Client Quit]
Igorshp has joined #ruby
<Senjai>
I'm probably going to try and change the data structure to make it easier
<Guest54>
any front-end dev people here who use ruby regularly?
Igorshp has quit [Remote host closed the connection]
<Senjai>
so I can do an each over the key value pairs
<Senjai>
unless someone has a better solution
<Senjai>
Guest54: Almost every webdev
<Senjai>
That uses rails
<Senjai>
that is
<BrianBoyko1>
:(
<BrianBoyko1>
Well, let's try it.
patteh_ has quit [Quit: Lost terminal]
nveselinov has quit [Quit: Connection closed for inactivity]
baweaver has joined #ruby
<Guest54>
Senjai how hard to learn compared with something like php or node?
patteh has joined #ruby
<Senjai>
PHP is a terrible language, and node requires you to write javascript
<BrianBoyko1>
Good News/Bad News
<Senjai>
so I would suggest Ruby, for sure
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BrianBoyko1>
Good news - the transaction went through
<BrianBoyko1>
Bad news, it's not in the database.
<jhass>
wat
<Guest54>
so easier then those two?
failshell has joined #ruby
fabrice31 has quit [Ping timeout: 248 seconds]
<Guest54>
mysql supported?
<BrianBoyko1>
I probably messed up when re-creating the table to use INT instead of real#
<Guest54>
i'm sure it is
<jhass>
BrianBoyko1: it should error if it failed to insert though
<failshell>
so im printing the output of a script, which has colored output. id like to remove the control codes for the color, before saving the output to a file. any idea how to do that?
yh has joined #ruby
workmad3 has joined #ruby
<failshell>
not printing, but writing
nahtnam has quit [Quit: Connection closed for inactivity]
<tamarin>
I'm trying to do a YAML.load, but it looks like some of my hashes are coming in as strings (ie: ":myhash"). Any idea what would cause that?
<Guest54>
ivanskie now i'm a beginner, and i'm still unclear on the rails and ruby side of things
<phat4life>
learn ruby first, then rails
<Guest54>
is this still a good recommendation? for a beginner?
<ivanskie>
im a more advanced beginner lol... but i'd recommend start with ruby.. then move into rails. rails is basically a bunch of ruby gems slapped together into a beautiful framework.. (beautiful is subjective)
<bougyman>
don't bother learning ruby if you plan on using rails.
<ivanskie>
it depends on how you learn better. reading, video, or class
<Guest54>
whoa whoa here's where i'm getting confused
<ivanskie>
and you don't need to be a pro at ruby to write rails, like bougyman said
<Guest54>
where did you guys start?
<Guest54>
start with ruby?
<ivanskie>
i started with rails...
Boohbah has quit [Ping timeout: 246 seconds]
<Guest54>
shoot....
<ivanskie>
but i always do everything backwards
<ivanskie>
and everyone i've asked before said learn Ruby
<ivanskie>
a really good book for rails is Rails 4 in Action
bogdanteleaga has quit [Ping timeout: 265 seconds]
<phat4life>
i feel like most of the ruby programmers i know didn't come from oop backgrounds
<phat4life>
and you start with Rails, its a very narrow view of oop
<ivanskie>
it covers a lot of what basic tutorials cover, plus introduces you to more stuff that you'd usually come across when develping rails apps
uber has joined #ruby
<BrianBoyko1>
When I get this site built, I'll learn some ruby. I thought I could get by by programming in one language and branching out to others later. But... as this project has just shown, you've got to be a polyglot to make it in the world today.
asmodlol has joined #ruby
User458764 has joined #ruby
<phat4life>
i mean, most languages are easy to pick up, just learn fp, oop, thos apply to many languages
<phat4life>
the problem is knowing all the crazy gems or libraries, that is what differentiates you
skade has joined #ruby
<Guest54>
word thanks phat4life, i think these design patterns might be a good starting point
Rollabunna has joined #ruby
<phat4life>
that one is excellent
bar0n has quit [Quit: Page closed]
acke has quit [Remote host closed the connection]
void has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
Rapier- has quit [Quit: (null)]
droidburgundy has quit []
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
wallerdev has joined #ruby
void has quit [Client Quit]
Rollabunna has quit [Ping timeout: 276 seconds]
yfeldblum has joined #ruby
failshell has quit []
snockerton has joined #ruby
umgrosscol has quit [Remote host closed the connection]
<Guest54>
phat4life, just ordered it. thanks so much for the recommendation.
diegoviola has quit [Remote host closed the connection]
tamarin has left #ruby ["Good Bye"]
bohallor has quit [Ping timeout: 252 seconds]
baxx has joined #ruby
BrianBoyko1 has quit [Read error: Connection reset by peer]
Ilyas has joined #ruby
Ilyas has quit [Remote host closed the connection]
phutchins has joined #ruby
blue_deref has quit [Quit: bbn]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
langlands has quit [Ping timeout: 272 seconds]
spider-mario has quit [Ping timeout: 252 seconds]
skyjumpe1 is now known as skyjumper
skyjumper has quit [Changing host]
skyjumper has joined #ruby
ldnunes has quit [Quit: Leaving]
platzhirsch has left #ruby [#ruby]
sarkyniin has quit [Ping timeout: 265 seconds]
benegget_ has quit [Quit: ...zzz ¯\_(ツ)_/¯ zzz...]
roolo has quit [Remote host closed the connection]
casadei has quit [Remote host closed the connection]
spider-mario has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
Agoldfish has joined #ruby
subtwo has joined #ruby
rafaelsales has quit [Remote host closed the connection]
rafaelsales has joined #ruby
bhorn1 has quit [Quit: Leaving]
freerobby has quit [Quit: Leaving.]
rbennacer has quit [Ping timeout: 252 seconds]
hal_9000 has joined #ruby
pengin has joined #ruby
rafaelsales has quit [Remote host closed the connection]
rafaelsales has joined #ruby
beneggett has joined #ruby
d10n-work has joined #ruby
atom3 has quit [Ping timeout: 277 seconds]
Yiota has joined #ruby
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 248 seconds]
iPdev is now known as suited_pdev
atom3 has joined #ruby
danzilio has joined #ruby
n008f4g_ has quit [Ping timeout: 272 seconds]
endash has quit [Quit: endash]
sarkyniin has joined #ruby
scpike_ has quit [Quit: leaving]
scpike has joined #ruby
sinkensabe has joined #ruby
<ivanskie>
what do you guys use to compile a ruby into a windows executable
<ivanskie>
to run on a machine without ruby and etc etc..
<ivanskie>
?
<ivanskie>
im having not so great time with visualruby.. it just doesnt run.
<ivanskie>
i found ocra so far..
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sinkensabe has quit [Remote host closed the connection]
<Senjai>
self contained classes are a different story
godemperor has joined #ruby
A205B064 has joined #ruby
<Senjai>
The most important thing about the stdlib is that it is reliable, and easy to maintain, not that its small
asmodlol has joined #ruby
yqt has joined #ruby
<Senjai>
and doesnt change often
<Senjai>
many things in AS fit that description
<Senjai>
many dont
LJT has joined #ruby
<Ray`>
aye
<Senjai>
Ray of something terrible in the stdlib?
<Ray`>
(I didn't have a ruby example to hand)
<Ray`>
yeah
geiltalasdair has joined #ruby
<Ray`>
right, I used that as a function due to the fact that it's a) useless and b) extra code to maintain
Agoldfish has quit [Quit: G'Bye]
<ivanskie>
im trying the Opal thing... and it doesn't want to do anything says Opal::Builder::MissingRequire: A file required by "application" wasn't found.... and tries to look for it in opal's gem's directory..
senayar has quit [Remote host closed the connection]
djbkd_ has joined #ruby
renderful has quit []
claw has quit [Ping timeout: 246 seconds]
senayar_ has joined #ruby
minibar has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
zeroDi has quit [Quit: WeeChat 1.2]
wildroman2 has joined #ruby
zeroDivisible has joined #ruby
whippythellama has quit [Quit: WeeChat 1.2]
blazes816 has joined #ruby
devdazed has quit [Ping timeout: 256 seconds]
djbkd_ has quit [Ping timeout: 246 seconds]
zeroDivisible has quit [Remote host closed the connection]
zeroDivisible has joined #ruby
uptownhr has quit [Quit: uptownhr]
avahey has joined #ruby
scripore has joined #ruby
tcrypt has quit [Ping timeout: 246 seconds]
Iskarlar has joined #ruby
zenguy_pc has quit [Read error: No route to host]
baweaver has quit [Remote host closed the connection]
blazes816 has quit [Ping timeout: 276 seconds]
Rollabunna has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jglover has joined #ruby
<jglover>
having some issues with a Thin server. Seems like it sporadically starts and stops reactor
<jglover>
and sometimes doesn't start it for over an hour after deployment
<jglover>
any ideas?
baweaver has joined #ruby
havenwood has joined #ruby
kobain has joined #ruby
last_staff has quit [Quit: last_staff]
Casty has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<ivanskie>
well #opal's dead..
bluOxigen has quit [Ping timeout: 256 seconds]
<ivanskie>
how do you include other ruby classes? like csv for example?
<ivanskie>
oh nevermind
<ivanskie>
lol nevermind already solved the problem i had. forgot (got a lot of crap going on at same time)
Rollabunna has quit [Ping timeout: 248 seconds]
<nofxxxx>
ivanskie, does it work? csv on opal
<ivanskie>
nofxxxx well.. i'll find out.. for now when I load my html console says failed to load resource.. opal is not defined... but i just realized i think i need to include opal.js separately?
slumos has left #ruby [#ruby]
<nofxxxx>
ivanskie, sorry never played but it's in my todo list. But iirc, doesn't it precompile??
<ivanskie>
*shrug*
<nofxxxx>
ahh, even precompiled you need the main lib... I figure
RegulationD has quit [Remote host closed the connection]
<Senjai>
I would assume subpat calls sub at some point
<olso>
also, should i start with rails4 or wait for rails5? are "gems" (this sounds so hipsterish :D) compatible rails4 with rails5 or gems are just ruby packages, not rails packages?
<Senjai>
Some of that is no longer applicable, but much of it is
michael_mbp has joined #ruby
<_blizzy_>
but php is still good at what it does.
quimrstorres has joined #ruby
<Senjai>
It's literally the worst tool for every problem :P. I'm going to stop now
bhorn1 has joined #ruby
<Senjai>
_blizzy_: Read the article :P
pengin has joined #ruby
<olso>
Senjai, that book looks nice, but im looking for something kind of "here is everything you should know about syntax, here is stuff you look it up in" and then i learn by doing
<_blizzy_>
Senjai, I've read it.
<_blizzy_>
learnxinyminutes.com
<bhorn1>
Hey guys quick question. Creating a ruby gtk3 application as a sort of menu that I would like to stay on top of all windows at all times.
<bhorn1>
I've figured out how to keep it on top, but I was wondering it there was a way to make the application take up a set amount of space on either side of the screen that other windows wouldn't go behind.
snockerton has quit [Quit: Leaving.]
<bhorn1>
So it reacted similar to the way the unity bar does, just taking up a portion of the screen and when something gets maximized it will stay to the left of my application.
kaleido has joined #ruby
bronson has joined #ruby
<olso>
thanks _blizzy_ , thats something i like :)
<Senjai>
olso: I would avoid sites promising to learn things in minutes
jsaak has quit [Ping timeout: 264 seconds]
commondream has quit [Remote host closed the connection]
<Senjai>
eventually you'll have to get a complete understanding of things, the best thing I can recommend is create your own project while cusing a proper resource
<Senjai>
each chapter
davedev2_ has quit [Ping timeout: 256 seconds]
davedev24_ has joined #ruby
<Senjai>
add a feature using what you learned to your application
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
yh has quit [Ping timeout: 248 seconds]
<olso>
each data type is object? so i can just chain methods?
<olso>
noice
<Senjai>
olso: They dont all return self, but the ones that do, yeah
Rollabunna has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
crdpink2 has quit [Ping timeout: 248 seconds]
crdpink2 has joined #ruby
rodfersou has quit [Quit: leaving]
ledestin has quit [Read error: Connection reset by peer]
<baweaver>
Most of the chaining is from Enumerable.
arescorpio has joined #ruby
asmodlol has quit [Ping timeout: 246 seconds]
<baweaver>
Anything that says learn x from y perspective I'm extremely skeptical of
<Senjai>
^^^^^^
wallerdev has joined #ruby
<baweaver>
Because writing Ruby like Java or PHP is likely to get you in a bad way pretty fast.
<Senjai>
Feel free to write it like Smalltalk though.
<baweaver>
Write Ruby like Ruby, there are enough styleguides out there to set things straight.
<baweaver>
granted a lot came from Smalltalk and Lisp
<baweaver>
and Perl, but that'd get you in real hot water
<Senjai>
From Lisp too eh?
<Senjai>
Haven't heard that story
dfockler has joined #ruby
<Senjai>
I thought it was mostly Smalltalk and Perl
<Senjai>
What comes from lisp?
<baweaver>
Where do you think blocks came from?
<Senjai>
ah
<Senjai>
that makes sense
<baweaver>
and first class functions and some of the other parts like that.
<Senjai>
Dodm
mizaki has joined #ruby
<Senjai>
I thought blocks came from smalltalk too.
<baweaver>
keyword args, garbage collection, conditional branches, symbols, first class functions, metaprogramming
<baweaver>
those are are lisp descendant.
yoongkang has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
bhorn1 has quit [Quit: Leaving]
yoongkang has joined #ruby
<Senjai>
Cool, good to know
<_blizzy_>
so, in Event Machine, I would do
<_blizzy_>
EventMachine.run do Stuff Goes Here end
JEG2 has quit [Quit: Connection closed for inactivity]