<_blizzy_>
please ignore the messy code. it's not on github yet for a reason. :P anyway, https://gist.github.com/NotBlizzard/1bd57d2f533cf574b0d3, I'm trying to run multiple instances of Battle (line 116 has 1) without them blocking each other. like in go, go has 'go function()'
<Radar>
jasonw22: Ok, can you please try the blog post that I linked to?
<_blizzy_>
ho would I achieve this in ruby.
bkxd has joined #ruby
<jasonw22>
Radar: sure, sorry, I didn't see the link?
<jasonw22>
Radar: sure, sorry, I didn't see the link?
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
<havenwood>
jasonw22: It's acting like you're exceeding maximum number of open file descriptors or something.
bronson has joined #ruby
<havenwood>
jasonw22: remove that symlink
<jasonw22>
havenwood: ya. which is odd because resources usage is low. but i should probably reboot, perhaps
<havenwood>
jasonw22: It seems turning it off and back on again is a deep magic.
oo_ has quit [Remote host closed the connection]
<havenwood>
Usually works. ;)
oo_ has joined #ruby
<jasonw22>
definitely can be magical for releasing borked resources
jpfuentes2 has joined #ruby
<jasonw22>
but i'm gonna try ruby-install again now that i've removed the symlink, and if that fails, reboot (and fix my IRC client while I'm at it)
<havenwood>
?pry olso
<ruboto>
olso, 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
sdwrage has quit [Quit: This computer has gone to sleep]
freerobby has quit [Quit: Leaving.]
<havenwood>
mizaki: You can just use WEBrick in development, yeah?
<mizaki>
WEBrick?
sdwrage has joined #ruby
passbe1 has joined #ruby
sdwrage has quit [Remote host closed the connection]
commondream has joined #ruby
<havenwood>
mizaki: It's an alternative to Puma that ships with Ruby.
<mizaki>
I'm just setting my stuff up for my class next semester and this is what it's telling me to do and I can't
<passbe1>
im in irb, ruby 2.2.1. have a method which is calling exec() and after this method runs irb drops me to my shell prompt, not back to the irb shell. the method should return true, ideas ?
<mizaki>
Will WEBrick work with heroku?
<mizaki>
or should I just go ahead and get unbuntu
jasonw22 has joined #ruby
<havenwood>
mizaki: Yeah, WEBrick works fine with Heroku though it's performance isn't great. You can also use a different webserver in development than you do in production. Unfortunately Ubuntu doesn't ship with latest stable Ruby but Brightbox does maintain packages for Ubuntu.
<havenwood>
mizaki: Are you familiar with any particular GNU/LInux distro?
<havenwood>
mizaki: If you're comfortable with Ubuntu I'd vote Brightbox package ruby2.2.
baroquebobcat has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
zenguy_pc has quit [Read error: No route to host]
<mizaki>
not at all
lordkryss has quit [Quit: Connection closed for inactivity]
<mizaki>
I'm new to the world of programming...
jasonw22 has quit [Client Quit]
commondream has quit [Ping timeout: 264 seconds]
<havenwood>
mizaki: Fedora, ArchLinux and other distros ship with a nice latest stable Ruby available via the package manager.
<havenwood>
mizaki: If you want to just explore, I think you'll be fine using WEBrick on Windows. For the long run switching to a BSD or GNU/LInux box will probably be an easier and more fruitful path.
<jasonw22>
havenwood: same Errno 35 after reboot :-(
<havenwood>
passbe1: exec replaces the process, so there's no old process to go back to
<havenwood>
jasonw22: eek
bayed has quit [Quit: Connection closed for inactivity]
<passbe1>
havenwood: ahh ok, so inside my method should i use the backticks method or something else ?
tlarevo has joined #ruby
marr has quit []
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kahunaio has quit [Quit: Lost terminal]
<havenwood>
passbe1: Yeah, if you just need stdout Kernel#` sounds good.
dgutierrez1287 has quit [Remote host closed the connection]
podman has quit [Quit: Connection closed for inactivity]
<passbe1>
havenwood: ok cheers, will give that a whilr
<passbe1>
whirl*
mois3x has quit [Quit: mois3x]
<havenwood>
passbe1: If you want stdin and stdout there's IO::popen or for more options see Open3.
<quazimodo>
if I have class Foo < Hash
<quazimodo>
how do I prepopulate it with data in def initialize
<quazimodo>
def initialize; self[:zed] = "zed", self[:bar] = "bar"; end
<quazimodo>
?
<havenwood>
passbe1: Open3 lets you do stdout and stderr separately or merged. Lots of options.
<quazimodo>
or do we have some sort of @object
effeeee has joined #ruby
<effeeee>
Hey,
bruno- has quit [Ping timeout: 246 seconds]
gkra_ has joined #ruby
<effeeee>
how bad of an idea would it be to pass along state in an exception? for example have an exception, that holds a list with all errors, that occured during a computation
scripore has quit [Quit: This computer has gone to sleep]
addisonh has joined #ruby
Rickmasta has joined #ruby
<passbe1>
havenwood: i really just want to know if it fails or not which is why i was chasing the boolean return type of exec
<havenwood>
_blizzy_: Yeah, a Hash is threadsafe in CRuby because of the GVL but for non-GVL implementations you'll want to synchronize Hash read and write access with a Mutex lock.
<havenwood>
Or use a Queue.
<_blizzy_>
havenwood, oh ok. thxs. :)
djellemah has quit [Ping timeout: 250 seconds]
choke has joined #ruby
gccostabr has quit [Quit: ZZZzzz…]
<havenwood>
_blizzy_: You're welcome. I keep forgetting you're using websockets... Interesting idea! Just use Faraday and drop RestClient.
<_blizzy_>
havenwood, ok.
baroquebobcat has joined #ruby
workmad3 has joined #ruby
choke has quit [Client Quit]
Yiota has joined #ruby
<havenwood>
_blizzy_: If you want an adventure, implement the same with DRb and Rinda::TupleSpace from Ruby's stdlib.
choke has joined #ruby
<_blizzy_>
havenwood, hmm.
choke has quit [Read error: Connection reset by peer]
<jasonw22>
eam: that script turns out to be dyci-clang.py which comes with XCode Dynamic Code Injection plugin, which i ended up installing as a result of playing with http://audiokit.io/playgrounds/
<havenwood>
quazimodo: You might also want to allow an #initialize default argument we well. Without parens the arg and any block will be passed to super.
<havenwood>
as well*
baweaver has joined #ruby
<havenwood>
Was up one row and to the right one column on my keyboard. >.>
<havenwood>
Back in line fingers!
transiency has quit [Ping timeout: 252 seconds]
FernandoBasso has quit [Quit: WeeChat 1.2]
<Derasi>
I'm looking for help with Devise. Should the Devise user model handle profile pages for each user, or should a separate model be created for handling profile pages?
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pontiki has joined #ruby
fabrice31 has joined #ruby
EllisTAA has joined #ruby
zacts has joined #ruby
<pontiki>
hi
<zacts>
ruby my dear
tlarevo has quit [Remote host closed the connection]
revath has quit [Read error: Connection reset by peer]
TheHodge has joined #ruby
revath has joined #ruby
commondream has quit [Ping timeout: 244 seconds]
tesuji has joined #ruby
tesuji has joined #ruby
<arturaz>
nevermind, solved, it was that I was using ruby bundler, not jruby bundler
Hounddog has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
tubuliferous_ has quit [Ping timeout: 246 seconds]
c0m0 has joined #ruby
Hounddog has joined #ruby
fsvehla has quit [Quit: fsvehla]
khebbie has quit [Ping timeout: 276 seconds]
senayar has quit [Remote host closed the connection]
<ljarvis>
moin
ta_ has joined #ruby
spider-mario has quit [Ping timeout: 252 seconds]
spider-mario has joined #ruby
Cust0sLim3n has quit [Ping timeout: 244 seconds]
yh has quit [Ping timeout: 250 seconds]
<flughafen>
moin ljarvis
Pathfinder has quit [Ping timeout: 256 seconds]
Xeago has quit [Remote host closed the connection]
ponga has joined #ruby
Xeago has joined #ruby
khebbie has joined #ruby
Pathfinder has joined #ruby
ttilley has joined #ruby
Xeago has quit [Remote host closed the connection]
<adaedra>
moin ljarvis und flughafen
<ljarvis>
i need new speakers
tvw has joined #ruby
Xeago has joined #ruby
wildroman2 has joined #ruby
ttilley has quit [Ping timeout: 276 seconds]
anisha has joined #ruby
hubcaps has quit [Quit: Lost terminal]
tesuji_ has joined #ruby
micmus has joined #ruby
timonv_ has joined #ruby
Aswebb_ has joined #ruby
jinie_ is now known as jinie
fabrice31_ has joined #ruby
tesuji has quit [Ping timeout: 276 seconds]
timonv_ has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
zeroDivisible has joined #ruby
pwnz0r has quit [Remote host closed the connection]
pwnz0r has joined #ruby
timonv^ has joined #ruby
yfeldblum has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
<yorickpeterse>
morning
<flughafen>
yo adaedra
<flughafen>
ljarvis: what kind of speakers
DLSteve has joined #ruby
Jackneill has joined #ruby
<zenspider>
arturaz: that's a _confusing_ error message. Ugh.
fabrice31_ has quit [Remote host closed the connection]
<zenspider>
bundler has been my enemy all day
<arturaz>
yeah, ruby isn't my favorite these days
fabrice31 has joined #ruby
CustosLimen has joined #ruby
senayar has joined #ruby
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
<flughafen>
arturaz: you take that back!
<arturaz>
why?
Scroff has quit []
pwnz0r has quit [Ping timeout: 276 seconds]
Jackneill has joined #ruby
<zenspider>
bundler != ruby
psy_ has quit [Ping timeout: 248 seconds]
<zenspider>
ruby isn't the problem, bundler is
Scroff has joined #ruby
Xeago has quit [Remote host closed the connection]
timonv^ has quit [Ping timeout: 272 seconds]
RegulationD has quit [Ping timeout: 248 seconds]
Zai00 has joined #ruby
dg-ratio1 has quit [Remote host closed the connection]
dg-ratio1 has joined #ruby
langlands has joined #ruby
baweaver_ has quit [Remote host closed the connection]
marr has joined #ruby
Xeago has joined #ruby
jmhmccr has quit [Quit: Connection closed for inactivity]
jacor has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
ahmetkapikiran has joined #ruby
jacor has joined #ruby
Igorshp has joined #ruby
unshadow has joined #ruby
unshadow has quit [Client Quit]
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jokke has quit [Ping timeout: 276 seconds]
MyMind has joined #ruby
jokke has joined #ruby
<Ikares>
Hey, I was wondering, does @ mean a local variable and does $ mean a global variable? I'm used to TorqueScript
<heftig>
Ikares: $ are globals, @ are instance variables (associated with the current self)
<heftig>
Ikares: locals have no sigil
<Ikares>
Ah, thanks
Sembei has quit [Ping timeout: 264 seconds]
Rollabunna has joined #ruby
x44x45x41x4E has joined #ruby
<heftig>
Ikares: identifiers starting with [a-z_] are locals or method calls; they're locals as soon as the parser encounters them on the left side of an assignment
<jhass>
there are also @@class_vars though their usecases are rare
Igorshp has quit [Remote host closed the connection]
<heftig>
they're terrible
<jhass>
finally Constants are starting with [A-Z]
quazimodo has quit [Ping timeout: 246 seconds]
platzhirsch has joined #ruby
contradictioned has quit [Ping timeout: 246 seconds]
rubie has quit [Remote host closed the connection]
markalanevans has quit [Quit: markalanevans]
Rollabunna has quit [Ping timeout: 248 seconds]
codecop has joined #ruby
micmus has quit [Ping timeout: 264 seconds]
platzhirsch has quit [Ping timeout: 250 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
gagrio|MRG has quit [Ping timeout: 244 seconds]
spider-mario has quit [Remote host closed the connection]
ahmetkapikiran has quit [Ping timeout: 276 seconds]
chthon has joined #ruby
workmad3 has joined #ruby
ahmetkapikiran has joined #ruby
techsethi has quit [Read error: Connection reset by peer]
spacemud has quit [Ping timeout: 264 seconds]
unsymbol has quit [Ping timeout: 276 seconds]
techsethi has joined #ruby
CustosLimen has quit [Ping timeout: 264 seconds]
DLSteve has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
contradictioned has joined #ruby
platzhirsch has joined #ruby
soulcake has quit [Ping timeout: 276 seconds]
<jesterfraud>
jhass, don't class level hooks etc. use @@vars?
<jhass>
what do you mean?
stardiviner has quit [Quit: Weird in coding now, or make love, only two things push me away from IRC.]
soulcake has joined #ruby
DLSteve has quit [Client Quit]
quimrstorres has joined #ruby
joonty has joined #ruby
quimrstorres has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
quimrstorres has joined #ruby
gagrio|MRG has joined #ruby
<jesterfraud>
like before_action :blah
<jesterfraud>
has to store those somewhere, right?
<jesterfraud>
(Rails example)
yh has joined #ruby
<apeiros>
doesn't need to be @@cvars
<jhass>
yes, typically you'd use class level @ivars
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jesterfraud>
and they'd carry over to each instance of that class?
weaksauce has quit [Ping timeout: 264 seconds]
<jesterfraud>
if so, what IS the legitimate use of @@cvars?
unsymbol has joined #ruby
<ljarvis>
they're accessed outside of any instance of the class. You refer to them directly on the class itself (which, is an instance of Class)
<jesterfraud>
right
<jesterfraud>
I obviously need to read up a bit more
CustosLimen has joined #ruby
spacemud has joined #ruby
workmad3 has joined #ruby
bkxd has joined #ruby
arup_r has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 255 seconds]
langlands has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
panga has joined #ruby
djellemah has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
blue_deref has quit [Quit: bbn]
<yorickpeterse>
welp, TIL I still have 3 weeks of holiday time left unclaimed
<yorickpeterse>
<bosswoman> so Yorick I've checked your contract stuff for the renewal next month, you still have 3 weeks of unclaimed holidays
timonv_ has quit [Quit: Leaving...]
<yorickpeterse>
guess that will be 3 weeks of FOSS at home :D
<jesterfraud>
:D
<yorickpeterse>
or taking off Friday for the next 15 weeks
<yorickpeterse>
the possibilities are endless
revath has quit [Quit: Leaving.]
<yorickpeterse>
well, I still have like 7 days for this year
revath has joined #ruby
timonv has joined #ruby
ponga has quit [Ping timeout: 248 seconds]
panga is now known as ponga
<tbuehlmann>
yorickpeterse, I'm gone for 3 weeks in august, you could have my flat :p
<yorickpeterse>
why would I have yours? I have my own
<yorickpeterse>
mine even comes with a cat
luzidco has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
Scrofff has joined #ruby
wildroman2 has joined #ruby
<tbuehlmann>
well, I could ask, why would you go to south korea? going places
<yorickpeterse>
yeah but you don't live in South Korea do you?
sevenseacat has quit [Quit: Me dun like you no more.]
<tbuehlmann>
right, it's just germany
<yorickpeterse>
meh, Netherlands > Germany
<tbuehlmann>
and SK > Netherlands? :D
Scroff has quit [Ping timeout: 252 seconds]
ghostpl has joined #ruby
AlexRussia has joined #ruby
multi_io has quit [Ping timeout: 256 seconds]
<yorickpeterse>
Cuisine wise, yes
revath has quit [Ping timeout: 255 seconds]
User458764 has joined #ruby
multi_io has joined #ruby
<yorickpeterse>
Also the women are better, but that might just be my hormones talking
<tbuehlmann>
:)
<adaedra>
.
techsethi_ has joined #ruby
techsethi has quit [Ping timeout: 246 seconds]
techsethi_ is now known as techsethi
avat has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ruurd has joined #ruby
polysics has joined #ruby
oo_ has quit [Remote host closed the connection]
lele has quit [Ping timeout: 272 seconds]
RandyT_ has joined #ruby
RandyT has quit [Ping timeout: 276 seconds]
oo_ has joined #ruby
<avat>
What is the best tool to schedule a job 10 days later? I'm looking for simplest tool which won't loose scheduled jobs on restart
<bnagy>
cron
Pumukel has joined #ruby
AlexAltea has joined #ruby
<chris2>
at
railsraider has joined #ruby
<avat>
But I have to store this particular job details somewhere for 10 days. Should I use Redis?
Rollabunna has joined #ruby
lokulin_ has quit [Changing host]
lokulin_ has joined #ruby
<chris2>
in the command line you pass to at :P
DLSteve has joined #ruby
A205B064 has quit [Ping timeout: 246 seconds]
lokulin_ is now known as lokulin
alex88_ has joined #ruby
datanoise has joined #ruby
arup_r has joined #ruby
<jhass>
if you like redis and already have something like resque or sidekiq running, there are plugins for them that do that
<avat>
Any tutorial how to use at with Sinatra?
<chris2>
if you have a certain frequency of jobs, probably use some "real" queue
<chris2>
but you asked for the simplest tool :P
oo_ has quit [Remote host closed the connection]
<avat>
OK I guess I will need something more then :)
nini1294 has joined #ruby
fabrice31_ has joined #ruby
<jhass>
maybe describe your actual usecase
<avat>
Currently I'm using rufus-scheduler, but I will loose all jobs on update (beacuse I need to restart sinatra server)
techsethi has quit [Read error: Connection reset by peer]
Rollabunna has quit [Ping timeout: 248 seconds]
alex88 has quit [Ping timeout: 246 seconds]
tubuliferous_ has joined #ruby
<avat>
Or when admins do some maintenance and they will restart a machine. So I guess I need something which stores queue and after restart picks it again and runs a job when time comes
alex88_ has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
alex88 has joined #ruby
bronson has quit [Remote host closed the connection]
<avat>
Resque then?
fabrice31 has quit [Ping timeout: 272 seconds]
<jhass>
you didn't give your usecase, we can't make clear recommendations
datanoise has quit [Ping timeout: 276 seconds]
terlar has joined #ruby
techsethi has joined #ruby
krz has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 276 seconds]
<jhass>
I'd setup an hourly job that goes over the Trials, filters them by created_at <= now-10d and does the check
x0f has quit [Ping timeout: 252 seconds]
<jhass>
that way you'll never loose jobs and never overrun any queue
unsymbol has quit [Ping timeout: 276 seconds]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
unsymbol_ has joined #ruby
michael_mbp has quit [Excess Flood]
unsymbol_ has quit [Client Quit]
keen___________0 has quit [Read error: Connection reset by peer]
unsymbol has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
commondream has joined #ruby
<avat>
It doesnt need to be very precise. Thanks jhass, maybe I'll try this way
<workmad3>
jhass: I'd be tempted to do it daily personally... so Trials are activated at, say, 7a.m EST 10 days from then
keen___________0 has joined #ruby
revath has joined #ruby
<workmad3>
but yeah, cron jobs or clockwork is a good way to handle timing-insensitive jobs like that, without the mechanics of a queue providing more points of failure
michael_mbp has joined #ruby
<effeeee>
how bad of an idea would it be to pass along state in an exception? for example have an exception, that holds a list with all errors, that occured during a computation
ttilley has joined #ruby
<jhass>
always has the sound of doing flow control with them to me
n008f4g_ has quit [Ping timeout: 255 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
<adaedra>
variable names should not begin by a capitalized letter
CustosLimen has quit [Ping timeout: 272 seconds]
<Fluent_>
That's a constant
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ndrei has joined #ruby
<Fluent_>
It doesn't change
olistik has quit [Remote host closed the connection]
<workmad3>
Fluent_: what exactly are you asking?
ttilley has quit [Ping timeout: 252 seconds]
<adaedra>
Cards change at l3 and l57
lordkryss has joined #ruby
revath has left #ruby [#ruby]
<adaedra>
and 53 too
tercenya has quit [Read error: Connection reset by peer]
ghostpl has quit [Remote host closed the connection]
<Fluent_>
What
ttilley has joined #ruby
<Fluent_>
That doesn't change it
ttilley has quit [Changing host]
ttilley has joined #ruby
<Fluent_>
workmad3, I was just looking for constructive criticism is all
<adaedra>
That changes the content
<adaedra>
also, l57, you use map without getting the content back, I think each would be more appropriate
<Fluent_>
line 57 is a method call, it doesn't change any value
<workmad3>
Fluent_: not sure I can provide constructive criticim on it :P
<workmad3>
*criticism
icarus has quit [Quit: Lost terminal]
<Fluent_>
Well it does, but it doesn't change any of the constants
<Fluent_>
It changes a global variable
<adaedra>
meh, lines are not numbered the same way in your second link
tercenya has joined #ruby
<Fluent_>
Yeah, I'm on the github
<Fluent_>
line 57 changeCard
<Fluent_>
Doesn't change a constant's value
<adaedra>
so 4, 58 and 54
lkba has joined #ruby
ghostpl has joined #ruby
<Fluent_>
That's a hash
<Fluent_>
and it changes the key value pair
<adaedra>
yes
<Fluent_>
I think I could define it different
<Fluent_>
Just make the hash global
<Fluent_>
not a constant :D
<workmad3>
Fluent_: it's all pretty poorly structured, your code is shouting out for a class to handle things, it's very 'scripty', makes odd use of top-level ivars...
<Fluent_>
Good point
fabrice31_ has quit [Remote host closed the connection]
<Fluent_>
Hmmm, what are ivars?
<adaedra>
IMO a constant could be frozen at its declaration – constant
<workmad3>
@ivar
fabrice31 has joined #ruby
<Fluent_>
I should wrap it up in a class
charliesome has joined #ruby
<Fluent_>
Oh, globals?
<workmad3>
Fluent_: no, an ivar is not a global
<adaedra>
and a x? method should return true or false, not do something on its own and return something – even if I see what you do
<Fluent_>
I just call those things global variables
<workmad3>
Fluent_: a global is $global
two-gun_ has joined #ruby
<Fluent_>
@var = 'foo'
<Fluent_>
Ahh
<workmad3>
Fluent_: you're wrong in your terminology then :P
<Fluent_>
Yes, I am
<adaedra>
(Yeah, that's nitpicking, I know)
<[k->
changeCard is camel case
<Fluent_>
I think I recall that $global now
fabrice31 has quit [Remote host closed the connection]
<Fluent_>
That it is
khebbie has joined #ruby
<Fluent_>
I ride le camel
<Fluent_>
You suggest _'s, right?
<adaedra>
Same way, you use #select at l41 but don't use its return, you want #each
<workmad3>
Fluent_: if I was writing a quick, write-only script to handle a specific class, it might look like your code... but I'm guessing you're not looking to have quick & dirty code to handle simple automation tasks, you're wanting to write good, well structured ruby code, yeah?
two-gun has quit [Ping timeout: 244 seconds]
Synthead has quit [Ping timeout: 244 seconds]
BrianBoyko1 has joined #ruby
<workmad3>
Fluent_: snake_case is idiomatic ruby for methods and variables, CamelCase is reserved for class names and sometimes constants, and sometimes constants are written as SCREAMING_SNAKE_CASE
<Fluent_>
Well, I just threw this together. I have no need to write well structured code, but I was more curious of what the transition process would be like from a scripted piece of code to something professional in nature
<workmad3>
Fluent_: well, to answer your original question then - what I'd change to write it as a cleanly structured piece of ruby code is "everything" ;)
RegulationD has joined #ruby
<Fluent_>
lol
<Fluent_>
Thanks
<workmad3>
adaedra: yeah, good point... no need to do \r\n in ruby
<workmad3>
ever
<adaedra>
If i read changeCard correctly, you treat o as no and s as yes, right?
<Fluent_>
Yep, that would do it
<Fluent_>
Not a perfect solution, but I did that quickly to accept any input from that is inside 'yes'
<Fluent_>
so if the user types: 'y' or 'yes' it works
<adaedra>
That disturbs me for two reasons: you ask explicitely for y/n, and in my mind, o is yes
<adaedra>
but I see your point
<Fluent_>
o is not yes o would be no
<adaedra>
maybe use start_with?, which would accept y, ye and yes, and n and no
<workmad3>
Fluent_: o as in 'ok'
<Fluent_>
Oh, in your mind
<adaedra>
o as in oui :p
chinmay_dd has quit [Remote host closed the connection]
<Fluent_>
o is yes, I read that wrong
OrbitalKitten has joined #ruby
<workmad3>
adaedra: ah yeah, weird foreign languages too :P
<Fluent_>
There is a start_with method, I didn't know that
<Fluent_>
Nice
<Fluent_>
I'm definitely going to be using that
<adaedra>
workmad3: that's what I'm used too ([o/n]), but ok works too, didn't think of that.
<workmad3>
adaedra: [o/c] would be more typical when using ok (as in ok, cancel)
RegulationD has quit [Ping timeout: 248 seconds]
<adaedra>
you have an extra set of parenthesis on line 5
<Fluent_>
Thanks for the tips guize
<yorickpeterse>
usually CLIs use [y/n]
quimrstorres has quit [Remote host closed the connection]
<yorickpeterse>
or [yes/no]
<Fluent_>
You are my new best acquaintances
<workmad3>
yorickpeterse: I want to write one that using '[cancel/continue]' now, just to break a `starts_with?` call :D
<workmad3>
*uses
<adaedra>
:D
<adaedra>
Abort, Retry, Ignore?
rafaelsales has quit [Remote host closed the connection]
<Fluent_>
I don't know if it's just me, adaedra but I like to wrap my mathematical operations in parenthesis like that
CustosLimen has joined #ruby
<workmad3>
"This will make your computer explode. [C]ancel or [C]ontinue?"
<adaedra>
Also Fluent_
Paradox has joined #ruby
<adaedra>
If I enter nothing at your prompt, it asks me again, right?
<adaedra>
(still changeCard)
<[k->
the difference between good code and bad code was demonstrated yesterday... 160min reduced to 5 seconds
<Fluent_>
I could do: rand(0..hash.size) -1 I just think: (rand(0..hash.size) -1) looks neater
Rickmasta has joined #ruby
<adaedra>
I'd remove the external parenthesis and put a space before the 1
<Fluent_>
If you input nothing, it will not
<Fluent_>
It will go with 'no' basically
<workmad3>
Fluent_: hash.keys.sample would be nicer still
<adaedra>
Yet the y is capitalized in your prompt, which leads me to thing yes is the default option
<[k->
you can show the default option using "(N) >"
<workmad3>
Fluent_: e.g. WinningCard = Cards.keys.sample <-- no need for WinningCardIndex anymore
<Fluent_>
workmad3, nice :D
<Fluent_>
Thanks for the tip
<Fluent_>
Which eliminates more code
rafaelsa_ has joined #ruby
<workmad3>
Cards = %w(K Q A).shuffle.zip(['n'] * 3).to_h <-- that also eliminates some code
Synthead has joined #ruby
<Fluent_>
That will make my brain hurt
<Fluent_>
Time to see what that does
rritoch has joined #ruby
gloscombe has joined #ruby
<Fluent_>
#=> {"Q"=>"n", "A"=>"n", "K"=>"n"}
<Fluent_>
Nice
d10n-work has quit [Quit: Connection closed for inactivity]
chinmay_dd has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
<Fluent_>
Should I use the .between? method too?
<Fluent_>
for if @userIndex < 1 || @userIndex > 3
<workmad3>
Fluent_: you could also probably make your code much simpler if you did `Cards = %w(K Q A); WinningCard = Cards.sample` and had users choose K, Q or A, rather than a 'face down' card with 1, 2 and 3
<adaedra>
you could
phutchins has joined #ruby
arup_r has quit [Remote host closed the connection]
ahmetkapikiran has joined #ruby
cir0x has joined #ruby
<Fluent_>
Then the user will know the card they are choosing, workmad3...
<Fluent_>
If I choose A, I know I get A, I don't want that
<workmad3>
Fluent_: yes, but they don't know which card is the winner
<workmad3>
Fluent_: seeing as you randomly choose a card to 'win', knowing the card isn't actually any detriment
serivich has joined #ruby
<workmad3>
Fluent_: at the moment, you're basically doing "Pick a number, 1 2 or 3, one of which is randomly the 'winner'" but pushing it through a mapping of 1,2,3 => 0,1,2 => random_order(Q, K, A)
chinmay_dd has joined #ruby
olistik has joined #ruby
<workmad3>
Fluent_: so you're basically doing 2 levels of indirection to map a random 'winning' number onto a random 'winning' card, which makes your code correspondingly more complicated for no actual gain
<Fluent_>
Hmmm
<Fluent_>
I see
lele has joined #ruby
Rollabunna has joined #ruby
jamesbrink has joined #ruby
two-gun has joined #ruby
arup_r_ has joined #ruby
joonty has quit [Quit: joonty]
<Fluent_>
You guys are awesome
<Fluent_>
Time for some coffee
two-gun_ has quit [Ping timeout: 255 seconds]
Rollabunna has quit [Ping timeout: 248 seconds]
joonty has joined #ruby
baxx has joined #ruby
dented42 has joined #ruby
two-gun has quit [Ping timeout: 265 seconds]
doublemalt_ has quit [Ping timeout: 246 seconds]
ponga has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
two-gun has joined #ruby
ponga has joined #ruby
anisha is now known as anarang
AlexAltea has quit [Ping timeout: 248 seconds]
quimrstorres has joined #ruby
chinmay_dd has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
lva has joined #ruby
techsethi has quit [Ping timeout: 244 seconds]
datanoise has joined #ruby
bronson has joined #ruby
wildroman2 has quit [Remote host closed the connection]
x0f has quit [Ping timeout: 246 seconds]
techsethi has joined #ruby
konsolebox has quit [Quit: Leaving]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 276 seconds]
cir0x has quit [Quit: Leaving.]
rodfersou has joined #ruby
dgutierrez1287 has joined #ruby
x0f has joined #ruby
datanoise has quit [Ping timeout: 244 seconds]
* flughafen
fetches tea
sdothum has joined #ruby
bruno- has joined #ruby
* adaedra
throws tea in the harbour
<ttilley>
heh
<[k->
ah, the sea is so refreshing today!
<workmad3>
adaedra: VIVA LA REVOLUTION!
<adaedra>
VIVE*
<workmad3>
heh, close enough... it's not like anyone cares if I spell french words correctly anyway ;)
<ttilley>
my irc client displays that animated gif inline in chat
<ttilley>
it's glorious
<[k->
é*
<workmad3>
adaedra: drats, I was also hoping I'd used the wrong gender pronoun for revolution :(
<[k->
É*
<adaedra>
yes, é
<[k->
wait a minute, what is bonjour
<adaedra>
Hello
<workmad3>
VIVA LE RÉVOLUTION!
ZOMGITSABEAR1 has left #ruby [#ruby]
<adaedra>
You can replace T by SS to be even more wrong
two-gun has quit [Ping timeout: 244 seconds]
<workmad3>
[k-: the french word, or the apple network discovery protocol?
<[k->
anyone actually uses try_convert as suggested in rdocs?
<[k->
the french word, hello
bruno- has quit [Ping timeout: 250 seconds]
arup_r_ has quit []
* flughafen
throws adaedra into harbour to fetch tea.
bruno- has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<effeeee>
how bad of an idea would it be to pass along state in an exception? for example have an exception, that holds a list with all errors, that occured during a computation
Emeric has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
<flughafen>
or maybe i should demand adaedra boil the ocean to make me a big tea.
Emeric has quit [Client Quit]
<workmad3>
flughafen: it'll be an interesting cuppa... are you normally fond of whale poop in your tea?
<[k->
you'd kill the corals!
commondream has joined #ruby
<flughafen>
workmad3: loaded with antioxidants
<jhass>
flughafen: workmad3 #ruby-offtopic misses you ;)
<[k->
think of the shark fins!
<shevy>
think of the children
<[k->
there are aquariums for those type of people
ndrei has joined #ruby
<shevy>
freedom for fish! humans into the aquariums
c355E3B has joined #ruby
<workmad3>
shevy: screw that, the fish already have 2/3s of the earths surface for their playpen
<shevy>
we are at war with them
<workmad3>
jhass: I can't think why... anyone would think that discussions of whale-poop tea aren't relevant to ruby...
<jhass>
right... my bad I guess
kp666 has quit [Remote host closed the connection]
<shevy>
fish would code in ruby, if they'd have an underwater computer
<shevy>
it also probably has to be a touchscreen rather than a keyboard interface
<[k->
no they won't, they need java first
<shevy>
no please
<[k->
EnterpriseShit first
<shevy>
no fish would want to code in java
<shevy>
perhaps EnterpriseFish like that puff fish
<[k->
then the fishes won't advance
<shevy>
that's why we declared war on them
<shevy>
they just don't wanna evolve
<[k->
oh.
<shevy>
we know of duck typing but have you ever heard of fish typing?
<workmad3>
shevy: I have... it's when duck typing is particularly smelly
<yorickpeterse>
I'm more a fan of cat typing
<[k->
ducks are fish!
<shevy>
haha
<adaedra>
>_>
<flughafen>
[k-: is that because they float like wood?
<shevy>
[k- ducks eat fish!
doertedev has joined #ruby
<[k->
hurhur
<yorickpeterse>
if the fish quacks like a duck and walks like a duck it probably is a duck
<workmad3>
witches weigh as much as a fish!
<shevy>
and bread
<[k->
fish eat fish!
<shevy>
I always wondered why ducks eat bread... it's not a natural food for them now is it?
<shevy>
but people through bread pieces to them in a pond
<shevy>
*throw
<workmad3>
shevy: it's not like it's a natural food for us either :P
<yorickpeterse>
shevy: Yeah it's not
commondream has quit [Ping timeout: 272 seconds]
<shevy>
workmad3 true
<yorickpeterse>
They can't digest it properly either
<workmad3>
shevy: and yet sandwiches are delicious!
<yorickpeterse>
so feeding them too much can actually cause health problems
<shevy>
our natural food would be fruit... and fish :)
<yorickpeterse>
and animals
<shevy>
yeah
<yorickpeterse>
take that vegans
<shevy>
we use their energy so that we can code more ruby
<yorickpeterse>
cows go in, code comes out
<workmad3>
and root veg... and insects... and whatever else we could get our grubby little hunter-gatherer hands on!
<shevy>
lol
<shevy>
cows go in... code comes out... life of a programmer
ponga has quit [Quit: Leaving...]
wildroman2 has joined #ruby
<flughafen>
shevy brings fish to the ducks
wildroman2 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<[k->
code go in... more code comes out
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<workmad3>
shevy: I'm personally very happy we're not stuck with 'natural' food... duck in hoi-sin sauce is too delicious to give up!
micmus has joined #ruby
wildroman2 has joined #ruby
<adaedra>
I'm sure ducks prefer zsh
malinki has joined #ruby
<workmad3>
[k-: Programmer - A machine for turning caffeine into bugs
<[k->
lel
<yorickpeterse>
adaedra: not Fish shell?
<yorickpeterse>
:>
<adaedra>
that's the joke
Ropeney has joined #ruby
AlexAltea has joined #ruby
x44x45x41x4E has quit [Remote host closed the connection]
<workmad3>
adaedra: how is it funny to state the simple truth that Zsh > *?
Rollabunna has joined #ruby
malinki has left #ruby [#ruby]
<adaedra>
Come discuss that in offtopic :>
tkuchiki_ has quit [Ping timeout: 246 seconds]
<yorickpeterse>
workmad3: that's what separates humans from the beasts: we have fine cuisine, they don't
<shevy>
hmm
<shevy>
some animals eat one thing, then something else
<yorickpeterse>
I also have yet to find an actual use case for zsh
<shevy>
like meat first, then vegetables
<yorickpeterse>
or any shell that's not Bash
<shevy>
or if they are sick due to foot, eat some plants that may help there
<shevy>
the fish shell is quite interesting, at least it tries to do things differently. like those fancy colours
techsethi has quit [Ping timeout: 246 seconds]
<shevy>
as you type :)
<shevy>
zsh has RPROMPT so that makes it superior to bash alone
<shevy>
but bash is simpler!
<flughafen>
shevy: are you using zsh?
<shevy>
nope, bash still
<workmad3>
kill ruby<tab> | menu of all ruby pids to tab through and select
<workmad3>
^^ there we go, why I use zsh
<shevy>
due to laziness; I acknowledge that zsh is the better shell, but I am the lazier person
<flughafen>
i tried zsh for a little while, but i don't remember why i went back to bash
<shevy>
yeah somewhat similar to my case flughafen :)
<shevy>
I think it had to do with the fact that I use ruby to generate my aliases
<shevy>
it became unwieldy, and for some reason, the syntax for bash is not 100% identical to zsh; I get some strange errors, and I was too lazy to fix them
<flughafen>
shevy: what are you using/
<shevy>
aliases_rc:2246: bad option: -l
<shevy>
aliases_rc:4133: no matches found: 256_colours=find /lib/terminfo /usr/share/terminfo -name *256*
<shevy>
things like that
<jhass>
?ot shevy flughafen
<ruboto>
shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
ndrei has joined #ruby
<yorickpeterse>
shit the police is here
<shevy>
how do I invoke ruby
<shevy>
I use bash
<flughafen>
quick hide the weed
krz has quit [Read error: Connection reset by peer]
vasilakisfil has joined #ruby
vasilakisfil__ has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
doublemalt_ has joined #ruby
timonv has quit [Ping timeout: 277 seconds]
timonv has joined #ruby
<chris2>
lol shevy. still have your 5kloc aliases file?
<izzol>
ok, nevermind, I found the problem.
<flughafen>
see jhass izzol figuure it out on his own. it's good that we burried his question
x0f has quit [Ping timeout: 252 seconds]
txdv has joined #ruby
ahmetkapikiran has joined #ruby
<izzol>
flughafen: ;-)
<txdv>
shevy: can you upload your alias file? :D
<jhass>
izzol: share the solution though!
<izzol>
jhass: I just deleted '.' on the end ;-)
dg-ratio1 has quit [Remote host closed the connection]
<jhass>
ah
<jhass>
bug IMO :P
<flughafen>
izzol: make a pr for your gist, and then we'll review it
<jhass>
the . is valid part of the name, most software just supports omitting it
dg-ratio1 has joined #ruby
<izzol>
jhass: that's correct, but somehow rspec-dns is not supporting it
<jhass>
izzol: I'd open an issue ;)
<jhass>
or even look into fixing it
charliesome has quit [Quit: zzz]
Xeago_ has quit [Remote host closed the connection]
<izzol>
jhass: yes, good idea
krz has joined #ruby
scripore has joined #ruby
x0f has joined #ruby
Xeago has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
<shevy>
chris2 I am approaching 40.000 aliases!
<chris2>
i'll buy you a sixpack of beer if you show me that file :P
Xeago has quit [Remote host closed the connection]
techsethi has joined #ruby
DaniG2k has joined #ruby
tubuliferous_ has joined #ruby
oo_ has quit [Remote host closed the connection]
two-gun has joined #ruby
Papierkorb has joined #ruby
Xeago has joined #ruby
<flughafen>
shevy: huh?
<flughafen>
is it in your github?
<shevy>
look
<shevy>
if it were made available
<shevy>
you'd just laugh
Xeago has quit [Read error: Connection reset by peer]
<shevy>
I can already see your curious grin
tubuliferous_ has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
<jhass>
isn't it beautiful if people laugh?
ta has joined #ruby
<flughafen>
shevy: has your alias taken off yet? nope?
<shevy>
flughafen hmm
<shevy>
flughafen that's a good question actually... if it's an alias I use a lot, there is a "return of investment"; but if I barely use an alias, then the time it takes to define it, like let's say 8 seconds or so, wouldn't be worth the investment
<flughafen>
i make aliases or scripts for a lot of things.
<txdv>
shevy: how can you have so many aliases
<txdv>
how do they look like?
<flughafen>
even ssh'ing to a machine
Synthead has joined #ruby
<shevy>
txdv they are just aliases
<txdv>
do you have aliases for "iwantapizzawithsalamiat5oclock"
<shevy>
txdv hmm nah, that would usually happen through a ruby script then
Vardan has joined #ruby
<Vardan>
hi all
<shevy>
like I have a clock/alarm bell in ruby
<Vardan>
people is it possible to run code on class load?
<yorickpeterse>
I once wrote a script that would start VLC at 08:00 to play music because I was having problems with my phone's alarm
<jhass>
Vardan: well, you can always reopen a class at any point, when would you consider a class "loaded"?
michael_mbp has quit [Excess Flood]
<shevy>
Vardan well you tend to load a .rb file; but you can put code into the file; and methods into your class which you can call
<shevy>
yorickpeterse I tend to use mplayer
<jhass>
mmh, I once had a cronjob doing the same via mpd
<shevy>
to start my alarm, I do like: "at 07:33:24" and it'll start then to play loud music
<adaedra>
yorickpeterse: I had a script which put the computer to sleep, then, on time, woke it up and ran mpc play
Xeago has quit [Remote host closed the connection]
<shevy>
I once had my computer crash due to an unrelated problem, and did not wake up and missed an early schedule, which sucked :(
<Vardan>
ok, I want this, I have class A and class B, class B extends class A now I want that on class B load it do some code which in real written in class A :)
fabrice31 has joined #ruby
<jhass>
Vardan: "load", you need to elaborate on what you mean by that
<shevy>
Vardan yes put the code in that second file
<jhass>
Vardan: do you want to run code when A is subclassed perhaps?
<shevy>
you can check for direct-call, like through the commandline, via something like: if __FILE__ == $PROGRAM_NAME; or you could make it integrated into the behaviour of the second class, like a class method, and invoke that
<Vardan>
in real I don't know what I mean by load :) be cause it is class in Rails app/models folder and I don't know how Rails load them
michael_mbp has joined #ruby
<shevy>
aha
<jhass>
Vardan: then remove the abstractions
<jhass>
Vardan: explain what you want to do, with your real classes and why
diegoviola has joined #ruby
<Vardan>
I think you know how rails generate class and instance method from DB table, now I want to have the same but own :)
<jhass>
ideally illustrate with some code on gist.github.com
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
Vardan: I think you want the inherited hook (in case of a parent class) or the included hook (in case of a included module). Also take a look at ActiveSupport::Concern
two-gun has quit [Quit: Lost terminal]
<jhass>
shevy: btw all your friends are in #ruby-offtopic now ;)
[k-_ has joined #ruby
esplainisix has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
minmax has quit [Quit: WeeChat 0.4.3]
lavros has quit [Ping timeout: 248 seconds]
joonty has quit [Quit: joonty]
zack6849_ has quit [Ping timeout: 272 seconds]
lavros has joined #ruby
unshadow has joined #ruby
zack6849 has joined #ruby
zack6849 has quit [Changing host]
zack6849 has joined #ruby
adr3ana has joined #ruby
droidburgundy has joined #ruby
droidburgundy has quit [Remote host closed the connection]
dg-ratio1 has quit [Remote host closed the connection]
<shevy>
ack
<shevy>
they play unicode hangman :(
husanu has quit [Remote host closed the connection]
djbkd has joined #ruby
<shevy>
though it's interesting to see that the hangman games have not stopped
<shevy>
they just moved to another place :D
husanu has joined #ruby
dg-ratio1 has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
<flughafen>
;)
quazimodo has joined #ruby
adr3ana has quit [Ping timeout: 272 seconds]
fabrice31 has quit [Read error: No route to host]
fabrice31_ has joined #ruby
<[k-_>
we will do this until there is something to do
ponga has joined #ruby
djbkd has quit [Ping timeout: 255 seconds]
RegulationD has joined #ruby
dg-ratio1 has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
ndrei has quit [Ping timeout: 255 seconds]
CustosLimen has quit [Ping timeout: 246 seconds]
dg-ratio1 has joined #ruby
hudsama has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
ndrei has joined #ruby
RegulationD has quit [Ping timeout: 248 seconds]
yh has quit [Ping timeout: 246 seconds]
DroidBur_ has joined #ruby
_blizzy_ has joined #ruby
CustosLimen has joined #ruby
ddarkpassenger has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
polyrob has quit [Ping timeout: 256 seconds]
joonty has joined #ruby
<livcd>
anybody has good Ruby/Rails rss feeds to share with me ?
<ponga>
livcd: there is a seperate channel for rails
esplainisix has quit [Remote host closed the connection]
<ponga>
i guess you'd get better answers from there
yfeldblum has quit [Ping timeout: 248 seconds]
<c355E3B>
livcd: rubyflow is ok
<IceDragon>
I LIVE
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
polyrob has joined #ruby
dg-ratio1 has quit [Remote host closed the connection]
<livcd>
ponga: well i have asked about Ruby as well
<ponga>
ah hah
<ponga>
sorry
dg-ratio1 has joined #ruby
Muhannad has joined #ruby
sdwrage has joined #ruby
Iskarlar has joined #ruby
<abyss>
I have a file, there is a pattern like: patternline1\n patternline2. I'd like to check each line and if line == patternline2 then check previous line and if previous line == patternline1 then delete patternline1. How I can achieve that? Any help?
Muhannad has quit [Read error: Connection reset by peer]
x44x45x41x4E has joined #ruby
<abyss>
lol
<[k-_>
now someone should start a session and guide him along :D
<IceDragon>
[k-_: Ah, I took it as an http joke off my cookie statement
* IceDragon
read too far into the conversation
<IceDragon>
orz
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<[k-_>
you read very far
<abyss>
[k-_: nevermind I did it in awk;p But I was just curious :)
<[k-_>
dont you have some ruby to learn
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev24_ has joined #ruby
jacor has quit [Read error: Connection reset by peer]
<abyss>
btw [k-_ I've learnt ruby an half an year ago but because I didn't have any chalanges or whatsover I forgot a lot. Do you have an advice how to practise? Where or something - I'm not a programmer, I'm just an admin
yayfoxes_ has joined #ruby
jacor has joined #ruby
<abyss>
ok "a lot" I forgot almost all;)
thelastinuit has joined #ruby
aryaching has joined #ruby
rritoch has quit [Quit: Leaving]
<IceDragon>
abyss: I write ruby everyday, for everything, downloading cat pictures, randomly regenerating text documents, moving my audio samples around, deploying code, everything and anything, also games, which was my main motivation to use ruby
<workmad3>
abyss: you could use ruby and chef to automate your sysadmin stuff ;)
rritoch has joined #ruby
Rickmasta has joined #ruby
x44x45x41x4E has quit [Ping timeout: 246 seconds]
<IceDragon>
3:
nfk has joined #ruby
<IceDragon>
I should shoot myself for using ansible...
lolmaus has joined #ruby
<abyss>
workmad3: I'm using puppet:)
<ljarvis>
IceDragon: building games was your main motivation for using Ruby?
<IceDragon>
Yah, I started out with RPG Maker VX
<IceDragon>
And got hooked on ruby immediately, but my thirst for pretty gems didn't stop ;-; I WANTED MORE
Muhannad_ has quit [Ping timeout: 272 seconds]
<workmad3>
abyss: also uses ruby under the hood ;) write more modules (or whatever they're called) for puppet without using their DSL :P
<IceDragon>
So I switched to linux to get more out of ruby
e1nh4nd3r has joined #ruby
<IceDragon>
and here I am today ;3
BrianBoyko1 has quit [Remote host closed the connection]
<[k-_>
you ruby too much
<abyss>
IceDragon: :)
<[k-_>
time to learn something new!
<workmad3>
IceDragon: start learning elixir!
<[k-_>
yay functional!
<IceDragon>
[k-_: I do C and C++, also Go, I have clojure on my list of things to learn also uggh JS..
<ljarvis>
workmad3: everything should be done without their DSL. Puppet makes me want to tear my face off
<abyss>
start learning assembler;p
skade has joined #ruby
<[k-_>
?how2describeproblem
<ruboto>
I don't know anything about how2describeproblem
<workmad3>
ljarvis: my experience with puppet is limited to an attempt to set it up with VMs about 6 years ago that failed
<IceDragon>
I do! describe it in code!
<[k-_>
but abyss fails at that :@
<abyss>
:D
<flughafen>
workmad3: salt!
<IceDragon>
workmad3: Try again?
<[k-_>
so is anyone guiding him through his problem?
<abyss>
[k-_: fails with what?
<workmad3>
IceDragon: I switched to chef and never worried about it again :P
<[k-_>
:@
<ljarvis>
workmad3: +1
<abyss>
[k-_: yeah, IceDragon described both my problems;)
atomical has joined #ruby
<workmad3>
and I don't need to touch any sysadmin stuff in my new job
<IceDragon>
yay!
<IceDragon>
sysamdin is evil :x
lkba has quit [Remote host closed the connection]
<IceDragon>
And no one ask why, I have nothing to backup my statement
<[k-_>
so no one uses codebunny.io? ;-;
<abyss>
;)
<workmad3>
IceDragon: when in doubt, point to Sendmail and rest your case ;)
DaniG2k has quit [Quit: leaving]
havenwood has joined #ruby
<IceDragon>
[k-_: Um, nope, I learn code by looking at other people's code, reading api docs and banging my head against the desk all alone in a corner
<IceDragon>
especially banging my head against the desk
<IceDragon>
workmad3: I'll keep that in mind 3;
pyo_ has quit []
maasha has joined #ruby
<abyss>
IceDragon: any books?
<abyss>
I've read one but I forgot almost everything;)
<maasha>
So hash keys are default in the input order. Can you insert a new key/value pair after a particular key?
soulcake has quit [Ping timeout: 276 seconds]
senayar has quit [Remote host closed the connection]
sgambino has joined #ruby
<IceDragon>
abyss: The pickaxe that used to ship with ruby back in 1.8
devdazed has quit [Quit: Computer has gone to sleep.]
<IceDragon>
maasha: Splice the hash together, split it after a certain key, merge the key/value pair you want and then merge the other half back unto it
ahmetkapikiran has joined #ruby
jespada has joined #ruby
<ljarvis>
maasha: hashes are not supposed to be ordered
msnyon has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
<IceDragon>
ljarvis: in 1.9+ they are 3:
<[k-_>
that was a mistake
<ljarvis>
that doesn't change my statement
senayar has joined #ruby
<[k-_>
many people raged because they didnt like the behaviour
<[k-_>
look at the forums!
<workmad3>
IceDragon: implementation wise, they have a deterministic order to keys now, but that doesn't make it right to then rely on a specific order as hashes are semantically unordered
yh has joined #ruby
nini1294 has quit [Ping timeout: 246 seconds]
<IceDragon>
[k-_: ;-; I'm terrified of forums, people say mean things!
<ruboto>
ljarvis # => undefined method `to_f' for #<Date: 2015-01-15 ((2457038j,0s,0n),+0s,2299161j)> (NoMethodError) ...check link for more (https://eval.in/386243)
<workmad3>
adaedra: and do you need a random date or a random datetime?
<adaedra>
def real_random; 4; end # Chosen by fair dice roll. Guaranteed to be random
<[k-_>
def negativerand(*args); a=rand(*args); a % 2 == 0 ? a : -a ;end
<ljarvis>
I've seen that in the wild adaedra :(
<[k-_>
really?
<adaedra>
That's an xkcd, iirc
nini1294 has joined #ruby
<ljarvis>
yep it is
<IceDragon>
adaedra: shiiiiet, I can't argue with the dice roll...
nettoweb has joined #ruby
<[k-_>
but it's used in the wild?
<ljarvis>
I worked on some code which had a method like "next_number" and it returned a static number
yayfoxes_ has quit [Ping timeout: 256 seconds]
<ljarvis>
the tests failed when they changed it so they left it
<ljarvis>
go figure
<IceDragon>
ljarvis: makes sense in the case of tests I guess
<IceDragon>
ljarvis: That or they shoudl have used; random = Random.new(seed)
ziprar has joined #ruby
jespada has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Scrofff has joined #ruby
tkuchiki has joined #ruby
<_mh_>
I wonder, can a regular expression be modified after it's been created?
rbennacer has joined #ruby
<[k-_>
yes
nini1294 has quit [Ping timeout: 265 seconds]
decoponio has joined #ruby
zipace has quit [Ping timeout: 244 seconds]
<_mh_>
[k-_: how would one go about this? Particular use case is having to prepend \A to a precompiled regex
Xeago has quit [Remote host closed the connection]
<IceDragon>
_mh_: /\A#{regex.source}/
Scroff_ has joined #ruby
phat4life has quit [Read error: Connection reset by peer]
devdazed has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
<_mh_>
aaah! Well, should've guessed that.
krz has joined #ruby
phat4life has joined #ruby
<_mh_>
Thank you :)
Scroff has quit [Ping timeout: 246 seconds]
cubicool has joined #ruby
<IceDragon>
_mh_: np
Scrofff has quit [Ping timeout: 244 seconds]
serivich has quit [Ping timeout: 246 seconds]
jespada has quit [Quit: WeeChat 1.1.1]
ndrei has joined #ruby
strixd has joined #ruby
strixd has quit [Excess Flood]
<cubicool>
I feel dirty.
strixd has joined #ruby
<cubicool>
I've been using Python for years professionally. I paid off all my debt in life with Python gigs. I have tons of Python side work in queue...
<cubicool>
...and lately all I do play around with ruby.
<[k-_>
ruby is not dirty
serivich has joined #ruby
<cubicool>
I certainly USED to think so.
quimrstorres has quit [Remote host closed the connection]
<_mh_>
There's language choices based on preference and language choices based on need. Also language choices based on 'better suited for the job'. I don't see many languages I'd call dirty or bad, but many that are not well suited for the job.
<IceDragon>
cubicool: YES, YES, WE NEED MORE LIKE YOU
<IceDragon>
python converts!
<IceDragon>
MUHAHAHAHAHAHA
* canton7
thinks java is dirty and bad :P
lucianosousa has joined #ruby
<_mh_>
canton7: The army of java programmers out there likely agree with you, yet they still make a lot of money with it ;)
<canton7>
your argument is sound, but there are still languages that are fundamentally flawed imo :P
bronson has joined #ruby
<canton7>
heh, I never said you couldn't make money from them
* canton7
is one of those java programmers
<_mh_>
heck... PHP... yes, I didn't say there aren't ones that are really bad.
<IceDragon>
money trumps happiness?
Pathfinder has quit [Ping timeout: 248 seconds]
CloCkWeRX has joined #ruby
<canton7>
I'm a consultant, so what the client wants trumps everything
Rapier- has joined #ruby
<_mh_>
IceDragon: Well, for the general programming community, apparently... otherwise I can't explain those gazillions of people doing java.
<canton7>
luckily java only needs to be rolled out of storage occasionally
<IceDragon>
Or is it a case where Happiness === money but money != Happiness
ndrei has quit [Remote host closed the connection]
<canton7>
the langauge choice isn't typically made by the programmer :P
ndrei has joined #ruby
<_mh_>
of course not, but I've met more people that _willingly_ submit to the pain of java for the money, so...
<_mh_>
(or PHP for that matter)
momomomomo has joined #ruby
<canton7>
sometimes they do actually like it
<IceDragon>
_mh_: Because there is so many libraries that do the job already, you just need to piece em together
<canton7>
I've got one of those in my office
<IceDragon>
somehow..
JoshL_ has joined #ruby
<IceDragon>
in a huge unreabable mess...
<IceDragon>
orz
JoshL has quit [Read error: Connection reset by peer]
<IceDragon>
/experience with java
<_mh_>
IceDragon: yes, that's the common argument :). Just glue them together, it's _easy_.
umgrosscol has joined #ruby
<canton7>
not when your dependency management tools suck ass ;0
<_mh_>
Enter SomeObscureLibraryInflectorInterfaceFactoryInstance
<canton7>
even C# how has something bundler-esque (with recursive dependency resolution, a lockfile, etc)
<IceDragon>
_mh_ You forgot teh name spaces!
<canton7>
*now has
bronson has quit [Ping timeout: 265 seconds]
<IceDragon>
canton7: C# is Java done better
<IceDragon>
__common_argument__
<canton7>
now I think enterprise architecture is something different. people who go around bashing the *concept* of things like factories typically haven't had to maintain buge codebases
<canton7>
not that java culture doesn't tend to overdo those sorts of things....
<_mh_>
to be fair, the idea of having a language that can run on any platform is a good one and the JVM has some pretty powerful stuff to offer, the language just fails to use it
<IceDragon>
Cookie cookie = CookieFactory.Make();
* IceDragon
eats the cookie
<IceDragon>
x_x taste like java...
chinmay_dd has quit [Remote host closed the connection]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
charliesome has quit [Ping timeout: 272 seconds]
<IceDragon>
_mh_: Its a case of the language sucks but the vm rocks
<canton7>
nah, you need to use the factory to create a builder, and use that builder to build a cookie
<_mh_>
canton7: I don't have a problem with the concepts, the java community just often goes overboard with them.
<IceDragon>
canton7: Dahell, I just want a COOKIE!
<canton7>
agreed on that, _mh_ :P
<IceDragon>
Cookie cookie = new Cookie();
chinmay_dd has joined #ruby
podman has joined #ruby
<canton7>
yeah, but what if you want a fake cookie for testing?
<IceDragon>
better yet, C++ cookies
<IceDragon>
Cookie cookie();
jerius has joined #ruby
<IceDragon>
Cookie cookie(REAL_COOKIE);
<IceDragon>
3:
* IceDragon
eats the cookie
nateberkopec has quit [Quit: Leaving...]
<IceDragon>
x_x taste like templates...
coderhs has joined #ruby
coderhs has quit [Client Quit]
sevenseacat has joined #ruby
<IceDragon>
canton7: Use inheritance, or composition for the cookie I suppose? new ExperimentalCookie() or cookie = new Cookie(); cookie.properties.push(new ExperimentalTrait());
<_mh_>
In the end of the day, it more matters on the skill of the person writing the code what you get in the end... some communities just don't seem to care about the results of their overengineering of things.
JoshL has joined #ruby
JoshL_ has quit [Read error: No route to host]
<_mh_>
And you sadly can overengineer in just about any high level language.
<havenwood>
Less code the better.
scripore has joined #ruby
<[k-_>
^
araujo has quit [Quit: Leaving]
CustosLimen has quit [Ping timeout: 264 seconds]
chinmay_dd has quit [Ping timeout: 264 seconds]
<workmad3>
havenwood: there's a limit to that... see perl :P
sdwrage has quit [Quit: Leaving]
<_mh_>
exactly.
bohallor has joined #ruby
<havenwood>
Factory smactory!
aryaching has quit [Read error: Connection reset by peer]
<_mh_>
And sometimes the little longer, but more readable code helps more (esp. in a multi programmer environment)
<canton7>
IceDragon, well you'd typically use DI - so either inject the cookie, or inject a factory that can create cookies on demand
<workmad3>
canton7: can I get a cookie injection plz
denver has quit [Remote host closed the connection]
* canton7
injects cookies into workmad3's bloodstream
<workmad3>
canton7: double-choc-chip by preference
cubicool has quit [Quit: leaving]
Fluent_ is now known as Fluent
Fluent has quit [Changing host]
Fluent has joined #ruby
<_mh_>
canton7: wouldn't you need an AbstractCookie first, just in case someone wants to make their own cookies?
treehug88 has joined #ruby
yh has joined #ruby
<IceDragon>
_mh_: See, this is why we use composition!
<IceDragon>
Just create CookieProperties
<IceDragon>
1 cookie with hundreds of flavours
<IceDragon>
o.o
arturaz has quit [Ping timeout: 256 seconds]
sdothum has quit [Ping timeout: 252 seconds]
danman has joined #ruby
n008f4g_ has joined #ruby
lloyd_ has joined #ruby
<lloyd_>
join #jruby
<lloyd_>
er forgot /; sorry.
<havenwood>
lloyd_: Success! You're here.
<lloyd_>
thanks! :)
tagrudev has quit [Remote host closed the connection]
<dudedudeman>
this is a shot in the dark question, but does anyone know of any examples of a to-do app written in ruby using TDD as the backbone?
<maloik>
that should be an easy google
<maloik>
if you want something a little more specific, look up the "stringer" app on github
<dudedudeman>
swanson/stringer?
<maloik>
it's an RSS reader type app in Sinatra, and it's pretty well written last time I checked
<maloik>
yes I believe so
<dudedudeman>
ah yep, ok
drewvanstone has quit [Client Quit]
dented42 has joined #ruby
jrl has joined #ruby
elia has quit [Quit: (IRC Client: textualapp.com)]
GitGud has joined #ruby
<dudedudeman>
maloik: i'm just struggling to get a solid grasp on testing, so i'm looking to maybe peep some code that is testing within the same context as what i'm working on
drewvanstone has joined #ruby
maasha has quit [Ping timeout: 246 seconds]
baroquebobcat has joined #ruby
elia has joined #ruby
<jrl>
hi. if I use #{s.split[3]} to get the 4th word in a string, how to i get 4th to last word?
<havenwood>
jrl: -4
<maloik>
jrl: use [3..-1]
drewvanstone has quit [Client Quit]
<workmad3>
jrl: s.split(4).last
<maloik>
oh... well depends on how you understand the question :-)
<workmad3>
or s.split(4)[3]
<[k-_>
wat does the question even mean
<jrl>
"I went to ruby channel on freenode" I want to get -> "ruby channel on freenode"
dopie has joined #ruby
freerobby has quit [Quit: Leaving.]
<maloik>
split(" ")[3..-1]
<[k-_>
str.split will do
<[k-_>
^ maloik
<maloik>
yea
freerobby has joined #ruby
<[k-_>
i wished we could do [third..last]
thalassa has joined #ruby
<[k-_>
that'll be maximum expressiveness!
<havenwood>
>> "I went to ruby channel on freenode".partition(' ').last
ghostpl has quit [Remote host closed the connection]
<Pwnna>
i have a tar operation running via popen3 and I want to gracefully abort when encountering a SIGTERM (that is, it will finish the tar operation before exitting)
<Pwnna>
but it seems like when I send a sigterm and trap it, the tar operation pauses or something like that
<jhass>
brotspinne: some style guides suggest to disambiguate with if foo == bar and if (foo = bar), but I hate that style
<brotspinne>
centrx: there will be more than more statement if new_variable is not nil
tkuchiki has joined #ruby
<brotspinne>
more than one
tubuliferous_ has quit [Ping timeout: 252 seconds]
BTRE has quit [Quit: Leaving]
danman has quit [Quit: danman]
<centrx>
brotspinne, Using a single = in if-statements just requires developers with attention to detail
<jhass>
I tend to do your second variant
<[k-_>
if compute_some_value returns false, it wont run tho
techsethi has joined #ruby
charliesome has joined #ruby
<centrx>
brotspinne, It's less problematic than a == turning into a =
rbennacer has joined #ruby
creakybones has joined #ruby
nhhagen has quit [Remote host closed the connection]
platzhirsch has quit [Read error: Connection reset by peer]
<[k-_>
jhass: while line = socket.gets is what everyone does!
<jhass>
"tend"
kobain has joined #ruby
scripore has quit [Client Quit]
<brotspinne>
jhass: yes I agree that adding parenthesis is not solving it
<jhass>
I'm only dogmatic about where to put spaces
Xeago has joined #ruby
elia has joined #ruby
<[k-_>
sometimes i wish ruby was more expressive
<jhass>
heh
<shadoi>
haha
<jhass>
I see you didn't try many languages yet
<[k-_>
however, it is already reaching its limits
platzhirsch has joined #ruby
<brotspinne>
ok here is the question: is there another way than "foo = 42" to create a local variable?
lucianosousa has quit [Quit: lucianosousa]
<[k-_>
i only have a little java, ruby, and a little haskell
<unshadow>
[k-_: I see... good thing I have rvm :)
<[k-_>
;O
peter_paule has joined #ruby
bentanweihao has left #ruby [#ruby]
<[k-_>
>> binding.pry
<apeiros>
important re lvar_set:
<ruboto>
[k-_ # => undefined method `pry' for #<Binding:0x41bac32c> (NoMethodError) ...check link for more (https://eval.in/386296)
<apeiros>
>> this = binding; this.local_variable_set 'foo', 42; foo
<ruboto>
apeiros # => undefined local variable or method `foo' for main:Object (NameError) ...check link for more (https://eval.in/386297)
<havenwood>
apeiros: shh, i'm cheating! ;)
dgutierrez1287 has quit [Ping timeout: 252 seconds]
<baryha>
! Raa Lynx games, and you know its football game. Lowers ram against each other, the Super Bowl, everything but thing but this stupid football. After they go boyer!
<baryha>
Juni Jonn Joans Football game it's a soccer game, it's a fucker game, it's a football makes me, it's a soccer game it's a fuck a duck. Fuck fuckers, Cowboys, Ravens, Cornbuck a duck.
<baryha>
Juni Jonn Joans Football or long Saturday after the football makes me say oh my eye queue one notch, and than football game. It is the worse this garbage here. Lowers my eyes it more teams like they show its football. Afternoons. No!
<havenwood>
!mute baryha
<apeiros>
what a lame spammer
<[k-_>
many fucks were given
baryha has left #ruby [#ruby]
bayfet has joined #ruby
cir0x has quit [Quit: Leaving.]
<bayfet>
! Raa Lynx games, and you know its football game. Lowers ram against each other, the Super Bowl, everything but thing but this stupid football. After they go boyer!
<bayfet>
Juni Jonn Joans Football game it's a soccer game, it's a fucker game, it's a football makes me, it's a soccer game it's a fuck a duck. Fuck fuckers, Cowboys, Ravens, Cornbuck a duck.
<bayfet>
Juni Jonn Joans Football or long Saturday after the football makes me say oh my eye queue one notch, and than football game. It is the worse this garbage here. Lowers my eyes it more teams like they show its football. Afternoons. No!
<havenwood>
!mute bayfet
<yorickpeterse>
that worked really well
bayfet has left #ruby [#ruby]
bubafett has joined #ruby
dented42 has joined #ruby
<bubafett>
! Raa Lynx games, and you know its football game. Lowers ram against each other, the Super Bowl, everything but thing but this stupid football. After they go boyer!
<bubafett>
Juni Jonn Joans Football game it's a soccer game, it's a fucker game, it's a football makes me, it's a soccer game it's a fuck a duck. Fuck fuckers, Cowboys, Ravens, Cornbuck a duck.
livathinos has quit []
<bubafett>
Juni Jonn Joans Football or long Saturday after the football makes me say oh my eye queue one notch, and than football game. It is the worse this garbage here. Lowers my eyes it more teams like they show its football. Afternoons. No!
<bubafett>
The worst sport everything on during. Most people are runna ma naes.
<yorickpeterse>
you might just want to ban the hostname
<bubafett>
It's a fucker game. It's no lie it's about football.
<bubafett>
Nothing but football is the worst sport everything on television. Nothing on television is college football or long Saturday afternoons. Nothing worst sport ever my eyes it more teams like this stupid football! Brucest boyer coyer! Boyer! Brucesht, boyer! Brucesht! The worst sport ever. nothing paint dry. Lynx game, it's a soccer game, so they show it sucks ten rears. Rum-dum-dum-foot ball.
<bubafett>
The worst sport ever moyer! Brucest boyer my lord, what is college football. Nothing but this stupid foot ball is good. Except when I can't watching prime but the worst sport everything but the Jaguars, so bored, makes me say oh my eyes it sucks ten rears. Nothing prime time time but football game. Lowers ram against each other, the Jaguars, Cornhuskers, so bored, makes me say oh my lord, what
<bubafett>
Nothing prime time time but the Nebraska Cornhuskers, Cornbuckers, so boyer football is they show its football game, so the Nebraska Cornhuskers, so the Jaguars, College football game it's a soccer game. When he football makes me, it's a soccer game, so they go brucesht boyer royer royer! Brucesht, boyer coyer! Brucesht! They show it more. Nothing but football. Nothing on during but as watching
<bubafett>
but thing but football. Nothing worst sport everything on television is good. Except when he football game. I'm swearing on during. Most people are runna ma naes. It's a soccer game. It's a lynx game! Raa Lynx game. Lowers my eyes it more teams like than football. No!
<jhass>
!mute bubafett
<havenwood>
jhass: ha
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olistik has quit [Remote host closed the connection]
<centrx>
So...how bout that local sports team
<apeiros>
somebody with two arms make that mute a bit better please
<Senjai>
adaedra: Isn't bower just like curl asset_file_here > to this file
<phat4life>
do any of you use slanger or pusher?
BrianBoyko has joined #ruby
scripore has joined #ruby
<Senjai>
phat4life: I've used pusher
<phat4life>
slanger just straight up stopped working
<adaedra>
Senjai: more like git clone, iirc
* Aria
does her part to put out the fires of language bigotry.
nobitanobi has joined #ruby
<Senjai>
phat4life: we haven't had an issue with pusher
<phat4life>
er, slanger works in dev, not in prod
<Senjai>
phat4life: I found that it causes people to be lazy though.
<Senjai>
phat4life: go ask support
<phat4life>
Senjai: pusher?
Flcn has joined #ruby
William|i7 has left #ruby [#ruby]
<phat4life>
how does pusher/slanger make people lazy
<havenn>
hex and nimble
<Senjai>
phat4life: Instead of making actual endpoints, or doing certain things properly with websockets or polling, they will opt for pusher.
chinmay_dd has joined #ruby
<Senjai>
phat4life: Slanger is a standalone server ruby implementation of the Pusher protocol. It is not designed to run inside a Rails or sinatra app, but it can be easily installed as a gem. <<
charliesome has joined #ruby
<Senjai>
Honestly, go with elixir, or even node for something like that :P
<puppeh_>
any1 using requirejs-rails gem?
brotspinne has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r has quit [Ping timeout: 256 seconds]
wallerdev has joined #ruby
<Senjai>
puppeh_: #RubyOnRails
mordocai has joined #ruby
<phat4life>
sails4life
drewo has quit [Quit: WeeChat 1.2]
<phat4life>
have any of you used sails?
<Senjai>
?use
<ruboto>
Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
platzhirsch has joined #ruby
cpruitt has joined #ruby
<phat4life>
aka sails, the rails of node
<Senjai>
If I used node, I wouldn't use it to solve the same problems as rails. I'd use rails
endash has joined #ruby
olistik has joined #ruby
<phat4life>
the problem is websockets with rails, i am not sure how to do it properly
atom3 has quit [Remote host closed the connection]
vasilakisfil_ has quit [Ping timeout: 256 seconds]
<Senjai>
phat4life: You dont. You use a language meant for it
<Senjai>
phat4life: Elixir, Go, or even Node
atom3 has joined #ruby
<Senjai>
phat4life: #besttoolforthejob
deric_skibotn has joined #ruby
<Senjai>
Elixir/erlang is probably the best solution out there
<Senjai>
Due to the BEAM vm
freerobby has quit [Quit: Leaving.]
<phat4life>
sails is interesting though, as its a node mvc framework, farily similar to rails in concept
Xeago has joined #ruby
<shevy>
sails
<shevy>
who picks such a name
<phat4life>
its meant to be like rails
<Senjai>
shevy: Javascript developers :P
<[k-_>
sliar
<shevy>
I'm gonna create a gem called sailormoon and then I will make my new framework
<shevy>
sails on sailormoon!
polysics has quit [Remote host closed the connection]
<phat4life>
i think i am going to take a break from ruby for a while
<Senjai>
phat4life: :(
<phat4life>
i miss c++ :(
<Senjai>
wat
<Senjai>
:P
<phat4life>
i know right
chinmay_dd has quit [Ping timeout: 256 seconds]
droidburgundy has quit [Ping timeout: 256 seconds]
* Senjai
is going back to work now :P
avelldiroll has quit [Quit: WeeChat 0.3.8]
arooni-mobile has joined #ruby
platzhirsch has quit [Ping timeout: 276 seconds]
<|work>
shevy: D on D
freerobby has joined #ruby
olistik has quit [Ping timeout: 276 seconds]
griffindy has joined #ruby
theery_ has quit [Read error: Connection reset by peer]
<shevy>
hmm
RobertBirnie has joined #ruby
theery has joined #ruby
theery has quit [Read error: Connection reset by peer]
<shevy>
[k-_ java on jeroids
<[k-_>
esy
<[k-_>
wat*
<shevy>
python on ShshShshSzhshshsh
<[k-_>
ruby on track
theery has joined #ruby
<shevy>
hehe
olistik has joined #ruby
<[k-_>
pun intended
tkrajcar has left #ruby [#ruby]
scripore has quit [Quit: This computer has gone to sleep]
djbkd has joined #ruby
<phat4life>
i have to learn java, any the lack of duck types, how do i adapt blah
<phat4life>
*and
<[k-_>
interfaces
<shevy>
you just lower your head, accept your fate shamefully, and learn it phat4life
<shevy>
or perhaps you can get a good book that is fun to read
nunayerBeezwax has joined #ruby
<phat4life>
i have ruby design pattern books
<[k-_>
> you cast to a interface
arcanez has joined #ruby
SOLDIERz has joined #ruby
Scroff_ has quit [Ping timeout: 265 seconds]
Igorshp has quit [Remote host closed the connection]
<arcanez>
is there a difference in performance/gc for "foo = 'bar' << baz << 'quux'" vs "foo = 'bar' + baz + 'quux'" vs "foo = "bar#{baz}quux"" (where bar & quux are strings and baz is a variable that has a string)
nateberkopec has joined #ruby
<arcanez>
I know there is for += vs << vs #{}, but not sure about just +
<[k-_>
yes
bronson has joined #ruby
<shevy>
arcanez + will create a new object, << will not
failshell has quit []
<[k-_>
if you already have strings, u can use << or #{}
<[k-_>
but if you dont, use #{}
<shevy>
+ occurs in both situations btw, += just is a shortcut for: bla += 'hi' bla = bla + 'hi'
<[k-_>
is #{} a method call?
avelldiroll has joined #ruby
<shevy>
don't think so; but it will call .to_s
<Senjai>
It will call to_s on the result between the braces if it is not a string
<Senjai>
same goes for normal concatenation
<Senjai>
Actually, I'm pretty sure it uses coerce
<arcanez>
+ will create new objects based on the number of +s right?
<shevy>
number of what?
white_bear has quit [Quit: leaving]
<shevy>
what means +s
<arcanez>
foo+bar+baz+quux+this+that
<GarethAdams>
a + b + c will perform two #+ method calls, yes
<arcanez>
creates more objects vs foo+bar+baz
perrier__ has quit [Read error: Connection reset by peer]
<Senjai>
is performing set intersections notably faster than with arrays?
<Senjai>
E.g. is it worth converting an array to a set to run an intersection
fabrice31 has quit [Ping timeout: 252 seconds]
DroidBur_ has quit [Ping timeout: 252 seconds]
Zai00 has quit [Quit: Zai00]
soulcake has quit [Ping timeout: 276 seconds]
<[k-_>
if your array is not uniq, no
<[k-_>
wait
<[k-_>
it doesnt matter
husanu has quit [Remote host closed the connection]
soulcake has joined #ruby
<[k-_>
for the uniqueness, that is
peter_paule has joined #ruby
Scroff has quit [Remote host closed the connection]
<BrianBoyko>
Howdy again. I'm ... kinda up poop creek. How do I make a ruby app that I can call from the command line?
<[k-_>
i think so
husanu has joined #ruby
brotspinne has joined #ruby
platzhirsch1 has joined #ruby
<[k-_>
BrianBoyko: use the #!
anisha has joined #ruby
<[k-_>
#!/usr/local/bin/ruby
<[k-_>
then you can just type the file name without having to type ruby <file name>
platzhirsch has quit [Ping timeout: 256 seconds]
zeroDivisible has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
<[k-_>
Senjal, i think it would be worth it
<[k-_>
you could do a benchmark, it would benefit the community :D
A124 has quit [Client Quit]
<Senjai>
aye will do in a bit :)
shinnya has quit [Ping timeout: 244 seconds]
soxet has joined #ruby
arup_r has joined #ruby
yh has quit [Ping timeout: 264 seconds]
<shevy>
BrianBoyko you just have the .rb file in question ok? that file can either have all the code, or call to the code that you wish to invoke
<shevy>
if you have a proper #shebang line, you can omit the leading "ruby" invocation component
<[k-_>
you can also use a shell script
vasilakisfil_ has joined #ruby
<shevy>
you can alias make an alias, like "alarm" as alias to "/tmp/alarm.rb", then youc an invoke via alarm; or you structure it like a gem, then you can put a bin/ file that will invoke it
<BrianBoyko>
That's right. I am running bash
<shevy>
that is how e. g. "rackup" works
<shevy>
I can not type well today
<shevy>
my left pinkie is injured :(
platzhirsch1 has quit [Ping timeout: 248 seconds]
Lucky_ has joined #ruby
<[k-_>
:(
msnyon has joined #ruby
ttilley has quit [Quit: Leaving...]
platzhirsch has joined #ruby
A124 has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
atom3 has quit [Ping timeout: 276 seconds]
atom3 has joined #ruby
rbennacer has joined #ruby
User458764 has joined #ruby
volty has joined #ruby
hahuang65 has joined #ruby
charliesome has quit [Quit: zzz]
theery has quit []
freerobby has quit [Quit: Leaving.]
Muhannad_ has quit [Ping timeout: 248 seconds]
<dfockler>
09:45 shevy: ruby on rails
<dfockler>
09:45 shevy: php on poop
<dfockler>
lol I just read these
peter_paule has quit [Ping timeout: 256 seconds]
<shevy>
:)
platzhirsch has quit [Ping timeout: 264 seconds]
<shevy>
it's harder to come up with frameworks for other languages
<shevy>
erlang?
rbennacer has quit [Ping timeout: 246 seconds]
<shevy>
nim? lua?
dorei has joined #ruby
weaksauce has joined #ruby
hahuang65 has quit [Ping timeout: 252 seconds]
djbkd_ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
<dfockler>
Erlang on Monads
towski_ has joined #ruby
<dfockler>
Nim on Omin
nobitanobi has quit [Remote host closed the connection]
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 248 seconds]
techsethi has quit [Ping timeout: 256 seconds]
_blizzy_ has joined #ruby
<dfockler>
Lua on the Moon
<BrianBoyko>
Hmm... I think I might be screwing this up. I'm trying to write a program that, when executed, will write a CSV file from the database. But the error I'm getting is that my method isn't defined. https://gist.github.com/brianboyko/25736f9efde4de320b57
<[k-_>
Elixir on drugs
<Senjai>
BrianBoyko: Databases typically can dump CSV's by themselves
<Senjai>
have you considered that?
__main__ has quit [Read error: Connection reset by peer]
<dfockler>
BrianBoyko: usually through an export function
<Senjai>
[k-_: Honestly, heisenburg would be a great library name for an elixir library
<BrianBoyko>
Senjai - yes, but in order to do that I'd need to log into the database and export it from there.
_main_ has joined #ruby
<BrianBoyko>
What I want to do is create a publically accessible CSV file.
griffindy has quit [Read error: Connection reset by peer]
<BrianBoyko>
and run it every 10 minutes or so.
bronson has quit [Remote host closed the connection]
<shevy>
dfockler I like the latter two
msnyon has quit [Ping timeout: 252 seconds]
<[k-_>
Elixir's heisenburg
Flcn has quit [Quit: Be back later ...]
<shevy>
Erlang on Monads, isn't that haskell?
<[k-_>
errr exposed!
<[k-_>
run!
<dfockler>
BrianBoyko: you can just have your ruby db handler do postgres' COPY function
marciotex has joined #ruby
<BrianBoyko>
conn.exec("COPY donors to 'output.csv' header") - like that?
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marciotex has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfinninger has joined #ruby
netmask has joined #ruby
netmask is now known as net_mask
net_mask has quit [Client Quit]
lkba_ has quit [Ping timeout: 246 seconds]
speakingcode has joined #ruby
duderonomy has quit [Ping timeout: 244 seconds]
acovrig has joined #ruby
<shevy>
hmm I have some scripts that generate some files
<shevy>
ruby scripts
<shevy>
it takes a bit too long for my taste though
<shevy>
4 seconds in total perhaps
bb010g has quit [Quit: Connection closed for inactivity]
<acovrig>
Is there a way to append an item to an array in a hash on the fly (so I don’t have to have a var_name[:hash_item] = Array.new just before the loop)?
<shevy>
how should one go about trying to optimize it for speed?
nhhagen has joined #ruby
ItSANg___ has joined #ruby
B1n4r10 has quit [Ping timeout: 265 seconds]
fabrice31 has joined #ruby
<apeiros>
acovrig: hash = {key: []} before the loop is the best choice IMO
s2013 has joined #ruby
<apeiros>
but you can do `hash[:key] ||= []; hash[:key] << item`
ItSANgo has quit [Ping timeout: 252 seconds]
<apeiros>
or `hash = Hash.new { |h,k| h[k] = [] }; …your loop… hash[:key] << item`. note that this variant creates a new array on *lookup* already.
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tractatus has left #ruby [#ruby]
casadei has joined #ruby
ebernhardson has joined #ruby
fabrice31 has quit [Ping timeout: 248 seconds]
infinitone has joined #ruby
charliesome has joined #ruby
s2013 has quit [Ping timeout: 255 seconds]
wildroman2 has joined #ruby
marr has quit [Ping timeout: 264 seconds]
sarkyniin has quit [Remote host closed the connection]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ivorpad has joined #ruby
kaleido has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
e1nh4nd3r has quit [Quit: Leaving.]
quimrstorres has quit [Remote host closed the connection]
jenrzzz has joined #ruby
netmask has joined #ruby
AlphaAtom has joined #ruby
dented42 has joined #ruby
mary5030 has joined #ruby
cir0x has quit [Quit: Leaving.]
workmad3 has joined #ruby
kahuna_ has quit [Quit: Lost terminal]
chinmay__ has quit [Ping timeout: 265 seconds]
dfinninger has quit []
CustosLimen has quit [Ping timeout: 256 seconds]
DroidBur_ has joined #ruby
mary5030_ has quit [Ping timeout: 264 seconds]
yfeldblum has joined #ruby
droidburgundy has quit [Read error: Connection reset by peer]
shinnya has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hoov has quit [Quit: Leaving]
acke has joined #ruby
polysics has joined #ruby
ttilley has joined #ruby
Xeago has joined #ruby
Tai15 has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
Xeago has quit [Remote host closed the connection]
gambl0re has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby
Asher has quit [Quit: Leaving.]
<atmosx>
yes
ebernhardson has left #ruby [#ruby]
<atmosx>
5 USD/hr each
<atmosx>
for ruby/ror
<atmosx>
lol
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
marciotex has joined #ruby
yfeldblum has quit [Ping timeout: 248 seconds]
<centrx>
shevy'll do it for $4.99!
CustosLimen has joined #ruby
chinmay_dd has joined #ruby
phutchins has joined #ruby
<apeiros>
I doubt shevy would ever do rails
duderonomy has joined #ruby
<acovrig>
apeiros: not exactly, but it makes me think differently; with either method, wouldn’t I end up with devs = {:size1=>[dev], :size2=>[]} if there isn’t any of size2, and if so how would I remove the empty array if it is empty?
rdark has quit [Ping timeout: 272 seconds]
Kricir has quit [Remote host closed the connection]
<apeiros>
acovrig: I don't follow.
drewvanstone has quit [Ping timeout: 252 seconds]
<atmosx>
apeiros: why not?
rdark has joined #ruby
drewvanstone has joined #ruby
<atmosx>
shevy: why no rails?
<apeiros>
atmosx: regarding shevy?
<atmosx>
apeiros: yes
<apeiros>
just ask them about their opinion on rails ;-)
<acovrig>
apeiros: just understood the ||= message above, it seems to work well
<atmosx>
shevy: What do you think of the highly acclaimed ruby-based programming framework called rails? lol
<dfockler>
I don't understand why it's called rails
<dfockler>
or Ruby on Rails for that matter
<apeiros>
dfockler: because there isn't a lot for you to decide on
<|work>
dfockler: Because extending the metaphor.
<dfockler>
Ruby Train!
djbkd has joined #ruby
chinmay_dd has quit [Ping timeout: 264 seconds]
pengin has quit [Remote host closed the connection]
<apeiros>
I'm not kidding btw., afaik that's the reason. rails is (or was) opinionated. so it took many decisions away from you. i.e. you were "on rails".
<apeiros>
(and hence could focus on your "real" tasks)
<atmosx>
Guys, is there any website listing ip and domain names of all the sites that someone would wanna "block" (porn, torrents, etc.?). I've seen only phishing websites listed.
<dfockler>
Ruby in Handcuffs
<|work>
Ruby ala DHH.
_solomon has quit [Quit: _solomon]
<dfockler>
atmosx: might check out some antivirus sites???, or just ask the UK gov't
jenrzzz has quit [Ping timeout: 264 seconds]
rdark has quit [Ping timeout: 244 seconds]
drewvanstone has quit [Ping timeout: 246 seconds]
<atmosx>
dfockler: I've got the UK's "official" list from wikipedia. Well probably the 'public' one... I'm not sure how does one feel living in the UK, privacy-wise. Today I've read that 'Ghost' blogging platform is migrating it's infrastructure to the Netherlands, due to privacy concerns.
<atmosx>
There other UK online services moving abroad too. I'm afraid that in a decade you won't be able to purchase online services from foreign countries
Asher has joined #ruby
<dfockler>
atmosx: yeah I just read about that stuff
Asher is now known as Guest57162
pontiki has joined #ruby
zer0ne has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
Guest57162 has quit [Client Quit]
<atmosx>
dfockler: govs and marketers are killing the internet as we know it. My twitter timeline is full of 'promotion' messages and my 'friend requests' are mostly by bots.
zer0ne is now known as zero_one_
<centrx>
Twitter? What's that?
<dfockler>
I read twitter on the cli, so I don't see anything but words
<atmosx>
dfockler: what client?
sdwrage has quit [Quit: This computer has gone to sleep]
<dfockler>
rainbowstream
<atmosx>
and why do you do that btw?
lolmaus has joined #ruby
<dfockler>
so it doesn't look like I'm browsing twitter at work
<atmosx>
ah
<atmosx>
smart
yqt has joined #ruby
<shevy>
atmosx no I meant because apeiros was calling a get_devs method ... <apeiros> a) snake_case method names: get_devs
<atmosx>
it kills the experience but whatever...
<dfockler>
atmosx: It's like 70% of the experience, and without ads
<slash_nick>
shevy: that only returns your current devs... to get new devs i think it's get_devs!... or you can just disable dev caching
yayfoxes_ has quit [Quit: WeeChat 1.0.1]
<shevy>
hehe
<shevy>
dev caching... do I store them in the cellar or what
<slash_nick>
cellar is okay... not your wine cellar though, you know devs
<Aria>
Prune your twitter lists. Block followers who are spammy or who don't interact like human beings. Block the jerks. Follow people unlike you but who can see nuance. Block people who won't see nuance.
marciotex has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Aria>
You'll have a very different experience.
yh has joined #ruby
<atmosx>
dfockler: you writ eon terminal at work, emacs/vim?
<atmosx>
dfockler: well the without 'ads' is a good one. Don't spread the word around because twitter will find the way to inject adds on clients too in the long run.
baweaver has joined #ruby
<dfockler>
slowly adopting vim, although it's a little 'much' for doing CSS/HTML
<atmosx>
Aria: hm, a reason I don't miss my FB account is that I "had" to follow many peoplw I didn't care... It was depressing.
baweaver has quit [Remote host closed the connection]
<shevy>
dfockler don't let it play with your brain!
<atmosx>
dfockler: hm, well if you use a shortcut to load the browser on the fly, it's okay.
<Aria>
Indeed. Private lists that are your 'real' attention are even better.
sandstrom has joined #ruby
<Aria>
That way you can 'follow' for social lubrication but not actually pay attention
<Aria>
likewise muting
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
<atmosx>
dfockler: I use vim and espresso for my CSS. But I'm an amateur.
<atmosx>
Aria: I muted only 2 people.
<atmosx>
Aria: also,I'd like my timeline to be less about politics and more about programming but even that apparently, it's hard to achieve. Anyway, twitter is not a real 'problem'.
sdwrage has joined #ruby
baweaver has joined #ruby
<shevy>
social lubrication
kadoppe has quit [Ping timeout: 276 seconds]
<atmosx>
jhass: you were right, adding bs=1m and usind /dev/rdisk improved my r/w speeds considerably, I just copied 8 GB really fast.
<shevy>
interesting word combinations are created here!
<slash_nick>
dfockler: if you become proficient with vim, i doubt you'll keep that feeling that it's too much (even for html/css)
nhhagen has quit [Remote host closed the connection]
<dfockler>
slash_nick: probably, I like it, I just don't yet have all the skills that I do in sublime
<Aria>
Heh. If only we could separate the politics from programming, but it turns out our actions as programmers have social consequences. And hence we can't ignore politics.
<atmosx>
slash_nick: I hate the copy/paste I mean yank/paste even registers are kinda tricky, too long combinations.
<dfockler>
Aria: politics is a part of humanity, like it or not
<atmosx>
I need to optimize that... I mean registers are awesome but having a 'combo' instead of a quick shortcut is a pain
kadoppe has joined #ruby
slumos has left #ruby [#ruby]
<Aria>
Indeed. Politics is literally what happens when humans interact in groups.
<Aria>
(I don't actually want to separate them. I've got more specific goals.)
Soda has joined #ruby
<atmosx>
Aria: I would like to be more patient and state my opinion in less aggressive ways (especially when I strongly disagree).
<Aria>
Indeed. It takes practice to do so.
<Aria>
(And is worth every moment of that practice)
<atmosx>
I'm reading a sort of thesis about why people seem so unreasonable when talking about politics/social topics. It's kinda interesting although not very convincing (so far)
<atmosx>
Aria: well, I need to try harder apparently heh.
Casty has joined #ruby
RegulationD has joined #ruby
nofxxxx has joined #ruby
cir0x has joined #ruby
tuelz has quit [Ping timeout: 252 seconds]
sarkyniin has joined #ruby
baweaver has quit [Remote host closed the connection]
wallerdev_ has quit [Quit: wallerdev_]
DroidBur_ has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
droidburgundy has joined #ruby
frem has joined #ruby
nonparfumee has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tuelz has joined #ruby
sarkyniin has quit [Remote host closed the connection]
toretore has quit [Quit: This computer has gone to sleep]
Asher- has joined #ruby
khebbie has joined #ruby
User458764 has joined #ruby
Asher- is now known as asher
asher is now known as Asher
elia has joined #ruby
langlands has joined #ruby
baweaver has joined #ruby
Tai15 has quit [Read error: Connection reset by peer]
droidburgundy has quit []
NeverDie_ has joined #ruby
adamjleonard has joined #ruby
langlands has quit [Client Quit]
drewvanstone has joined #ruby
NeverDie has quit [Ping timeout: 252 seconds]
skade has quit [Quit: Computer has gone to sleep.]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gccostabr has joined #ruby
benolee has joined #ruby
skade has joined #ruby
skade has quit [Client Quit]
yayfoxes_ has quit [Quit: WeeChat 1.0.1]
benolee has quit [Client Quit]
markov_twain has joined #ruby
pengin has joined #ruby
zotherstupidguy has joined #ruby
markovtwain has quit [Ping timeout: 246 seconds]
wallerdev_ has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
CustosLimen has quit [Ping timeout: 255 seconds]
Or1on has joined #ruby
wildroman2 has quit [Remote host closed the connection]
JoshL has quit []
<atmosx>
cool, the new RPi seems to be way faster then the old one.
<adaedra>
The B2?
<adaedra>
or there another new one?
yfeldblum has joined #ruby
yayfoxes_ has joined #ruby
quimrstorres has quit [Remote host closed the connection]
skade has joined #ruby
Azure has quit [Read error: Connection reset by peer]
tvw has joined #ruby
skade has quit [Client Quit]
Azure has joined #ruby
skade has joined #ruby
eggoez has joined #ruby
aphprentice has quit [Ping timeout: 246 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dfockler>
what's the best way in ruby to standardize various date formats?
<apeiros>
dfockler: too vague
<apeiros>
string input?
<havenn>
dfockler: What do you have and what do you want to end up with?
havenn is now known as havenwood
<dfockler>
yeah I have a date strings in various formats, and need them in a single format
<apeiros>
strptime IMO
workmad3 has joined #ruby
<apeiros>
but depends on the (undisclosed) details
Flcn has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Or1on>
I'm thinking of working a sort of capslock manager on ruby as a learning project. I'd like to use caps+w to popup a list of opened windows that I can switch to by typing the name. I also want to use caps+hjkl as arrows keys, sort of like a vim mode. Which libraries could help me with this?
markov_twain has quit [Quit: markov_twain]
skade has quit [Quit: Computer has gone to sleep.]
aryaching has quit [Ping timeout: 252 seconds]
sdwrage has joined #ruby
xelkarin has joined #ruby
<Or1on>
I think there is a way to use autohotkey with ruby... maybe I could use gtk or qt for the window list... I'm not sure how I can get a list of opened windows from a linux windows manager or OSX/ windows from ruby
CustosLimen has joined #ruby
Azure has quit [Read error: Connection reset by peer]
centrx has quit [Quit: Shutting down, Please wait...]
blackmes1 has joined #ruby
centrx has joined #ruby
blackmes1 has quit [Client Quit]
<atmosx>
adaedra: CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d ... well no idea I think it's widely known as RPi v2
slackbotgz has quit [Remote host closed the connection]
<atmosx>
adaedra: 1G RAM, armv7
<adaedra>
yeah should be that
<adaedra>
I'm pondering about getting one
slackbotgz has joined #ruby
jschoolcraft has joined #ruby
<atmosx>
well it's fast.
<atmosx>
the only complain I've found around is the micro-sd ... everyone would like a faster throughput there
<atmosx>
but it's ok, generally speaking
peter_paule has joined #ruby
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nickfausnight has quit [Quit: Connection closed for inactivity]
k25611 has joined #ruby
k25611 has left #ruby [#ruby]
bosma has joined #ruby
Alayde has joined #ruby
NeverDie_ has quit [Ping timeout: 250 seconds]
NeverDie_ has joined #ruby
drewvanstone has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
iwaffles has joined #ruby
blandflakes has joined #ruby
Hobogrammer has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
cpruitt has quit [Quit: cpruitt]
NeverDie has quit [Ping timeout: 272 seconds]
nonparfumee has joined #ruby
crazydiamond has joined #ruby
drewvanstone has quit [Ping timeout: 264 seconds]
chris2 has joined #ruby
dgutierrez1287 has joined #ruby
x1337807x has joined #ruby
spider-mario has quit [Ping timeout: 264 seconds]
Narzew has joined #ruby
skade has joined #ruby
drewvanstone has joined #ruby
nonparfumee has quit [Client Quit]
spider-mario has joined #ruby
micmus has quit [Ping timeout: 265 seconds]
kahunaio has joined #ruby
_kfpratt has quit [Remote host closed the connection]
ttilley has joined #ruby
thelastinuit has quit [Read error: Connection reset by peer]
momomomomo has joined #ruby
dgutierrez1287 has quit [Ping timeout: 255 seconds]
otisZart has joined #ruby
symm- has joined #ruby
ttilley has quit [Ping timeout: 250 seconds]
acke has quit [Remote host closed the connection]
patrick_star has joined #ruby
nateberkopec has quit [Quit: Leaving...]
kahunaio has quit [Ping timeout: 256 seconds]
momomomomo has quit [Quit: momomomomo]
SansSerif has joined #ruby
SansSerif has quit [Read error: Connection reset by peer]
CustosLimen has quit [Ping timeout: 246 seconds]
blackmes1 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
SansSerif has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
micmus has joined #ruby
Alayde_ has joined #ruby
pdoherty has quit [Quit: Leaving]
pehlert has joined #ruby
polysics has quit []
diegoviola has quit [Quit: WeeChat 1.2]
Alayde has quit [Read error: Connection reset by peer]
dopie has joined #ruby
acovrig has quit [Quit: acovrig]
CustosLimen has joined #ruby
jerius has quit [Quit: /quit]
<pehlert>
Hey all! Maybe someone can explain this to me.. I have a rake task which spawns a couple of threads to fetch data via net/http. The remote ends are extremely slow, so most of the time should be IO wait. However, I don't have the impression that the threads really execute in parallel (e.g. netstat shows only one connection at a time).. I know there is the GIL, but shouldn't a thread still yield back when ther
<pehlert>
e is IO wait?
ruv has quit [Ping timeout: 256 seconds]
rodfersou has quit [Remote host closed the connection]
dstarh has quit [Max SendQ exceeded]
roolo has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
zero_one_ has quit [Remote host closed the connection]
<pehlert>
The code is too complex to post it all, but this should be the gist of it
zero_one_ has joined #ruby
<jhass>
well, nothing obviously wrong about it, maybe there's a hidden lock somewhere?
prinsen has joined #ruby
jmoles has joined #ruby
<pehlert>
jhass: Possibly, but I really have not idea where..
lucianosousa has quit [Quit: lucianosousa]
<pehlert>
jhass: Are there any othzer ways to lock than Mutex.new.synchronize?
sarkyniin has quit [Remote host closed the connection]
Palmer11 has joined #ruby
<jhass>
no, but it can be hidden in Monitor/MonitorMixin
<prinsen>
I have a .so dynamic module that I have generated with Swig. Is there any way to generate documentation for it, or download a IDE with autocompletion features?
sarkyniin has joined #ruby
<jmoles>
Hello Rubyists!!! I have, in some code of mine, a Symbol instance I recieved by enumerated the methods of a class instance with grep() and picking the one I want. I can easily call this method now with .call[:sym], but I'd like to do this same thing INSIDE a class.
<jmoles>
It is proving... harder.
<jmoles>
Whoops, I mean .send(:sym).
<Senjai>
?code jmoles
<ruboto>
jmoles, We can't help you without your code, please post it to https://gist.github.com
<jmoles>
I will, one sec.
<jhass>
pehlert: one thing you could try (and be it to find out), to spawn a new thread for each request and delaying that until after you have fetched all data, so Thread.new do http.request(request); end; essentially
ldnunes has quit [Quit: Leaving]
arooni-mobile has joined #ruby
lucianosousa has joined #ruby
eggoez has quit [Ping timeout: 252 seconds]
Narzew has quit [Ping timeout: 248 seconds]
<jhass>
pehlert: the other approach would be to leave the concurrency out of the ruby part and just push requests to typhoeus hydra
<pehlert>
jhass: Hum, that might be an idea. A quick grep through my gem dependencies has not shown any uses of Mutex :(
ndrei_ has quit [Ping timeout: 264 seconds]
Igorshp has quit [Remote host closed the connection]
dx7 has joined #ruby
sarkyniin has quit [Read error: Connection reset by peer]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pehlert>
jhass: That would be extremely difficult to refactor, though :-/
<pehlert>
sigh
atom3 has quit [Ping timeout: 276 seconds]
<jhass>
huh? shouldn't be harder than pushing the Thread.new down, probably even easier
netmask has quit [Remote host closed the connection]
<pehlert>
true, neither will be very easy
nemesit|znc has quit [Ping timeout: 272 seconds]
atom3 has joined #ruby
rbennacer has quit [Ping timeout: 256 seconds]
Igorshp has joined #ruby
<jhass>
well, that statement does make me wonder how much your example does relate to your real code tbh ;)
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
other hidden locks could be contentions on a queue or a connection pool btw
<pehlert>
jhass: There're really just a few wrapper classes and the actual worker does 3 not 1 http request. But for the requests, they are all similar to this, so nothing special is happening which is not visible in the pastie
scx_ has joined #ruby
addisonhuddy has joined #ruby
arescorpio has joined #ruby
<jmoles>
Senjai: ruboto: damnit, now it's not happening anymore. :)
gccostabr has quit [Quit: ZZZzzz…]
jtbnyc69 has joined #ruby
<jhass>
?ruboto
<ruboto>
I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
<pehlert>
jhass: I thought about ActiveRecord's connection pool being an issue here, but there are only 5 customers and 10 connections in the pool, so that shouldn't be an issue either
<jtbnyc69>
hello everyone, can anyone recommend the preferred debugger for ruby these days? ruby 2.x and not rails, just straight ruby?
<pehlert>
What a sentence.. Sorry, getting tired
ttilley has joined #ruby
<jhass>
?rails jtbnyc69
<ruboto>
jtbnyc69, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<jhass>
blerg, wrong one, sorry
<jhass>
?pry jtbnyc69
<ruboto>
jtbnyc69, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
<jhass>
bad muscle memory :/
<jtbnyc69>
ruboto: anything supported under emacs?
<jhass>
maybe there's a byebug plugin for emacs, who knows
scx has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
<jhass>
but I'd just go with a second shell, pry is nothing you want to miss out
sarkyniin has joined #ruby
<jhass>
pehlert: me too apparently ;)
<jtbnyc69>
thank you so jhass and ruboto
<shevy>
lol
<shevy>
ruboto is just a spam-bot jtbnyc69
scx has joined #ruby
bohallor has quit [Ping timeout: 264 seconds]
<jhass>
I see, once it tracks karma it also needs to track its own
<jtbnyc69>
oh, ruboto is quite good. 8)
<shevy>
jtbnyc69 it can actually be useful
<shevy>
you can use it to eval ruby code live here
<jtbnyc69>
neat
<shevy>
>> puts 'jhass is helpful ' * 2
<ruboto>
shevy # => jhass is helpful jhass is helpful ...check link for more (https://eval.in/386460)
Narzew has joined #ruby
scx_ has quit [Ping timeout: 246 seconds]
ghostpl has quit [Remote host closed the connection]
<shevy>
though the formatting is a bit confusing... I liked the old eval-in output more, to denote the "string" part, and then just provide a link; perhaps putting the "check link" into the () part
<ruboto>
Senjai # => 1220136825991110068701238785423046926253574342803192842192413588385845373153881997605496447502203281 ...check link for more (https://eval.in/386461)
chinmay_dd has joined #ruby
addisonhuddy has quit [Ping timeout: 250 seconds]
NeverDie_ has quit [Ping timeout: 252 seconds]
ttilley has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
husanu has quit [Remote host closed the connection]
sdwrage has quit [Quit: Leaving]
husanu has joined #ruby
<Senjai>
finisherr: With aruba?
Chrislivecodingt has joined #ruby
<finisherr>
with rspec natively
<finisherr>
and rake
<Senjai>
just by running the command from rspec?
<Senjai>
dont use rake, just use bin/whatever
<finisherr>
I was going to use Mixlib::ShellOut
<Senjai>
Uhm
<finisherr>
to run the commands
<Senjai>
`./bin/myfile`
mandarinkin has joined #ruby
<Senjai>
fixed forever
dopie has joined #ruby
<Senjai>
`./bin/myfile myargs`
Papierkorb has quit [Ping timeout: 244 seconds]
<finisherr>
yeah, i guess that simplifies things
<Senjai>
It does, but mixlib doesnt seem too terrible.
fabrice31 has joined #ruby
<Senjai>
I just think it might be more than required
<Senjai>
Eh, depends
<Senjai>
I wouldn't -1 mixlib
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chris2 has quit [Ping timeout: 272 seconds]
sanjivupadhyaya has quit []
<Chrislivecodingt>
Hey guys, am Chris from Livecoding.tv if you have questions on watching shows on Livecoding.tv let me know. There is an aesome show tonight on Livecoding.tv:
<eam>
shevy: if you're bored (or if anyone else is) you could give me feedback on how this module should look before I release it https://github.com/eam/ruby-mdbm
whippythellama has quit [Quit: WeeChat 1.2]
bb010g has joined #ruby
netmask has quit [Ping timeout: 256 seconds]
uninitialized has joined #ruby
scripore has joined #ruby
baweaver has joined #ruby
quazimodo has quit [Ping timeout: 252 seconds]
cir0x has quit [Quit: Leaving.]
msnyon has joined #ruby
bronson has quit [Remote host closed the connection]
<apeiros>
eam: misses a license! :-O
* apeiros
suggests BSD (because I like it and because mdbm is also under BSD)
DLSteve has quit [Quit: Leaving]
A205B064 has joined #ruby
eggoez has joined #ruby
bosma_ has joined #ruby
bosma has quit [Disconnected by services]
<eam>
good catch
bosma_ is now known as bosma
t0rrieri has joined #ruby
<apeiros>
I think an up-to-date rubygems warns you when you run `gem build`
last_staff has quit [Quit: ciaozzZZZ.....]
<eam>
in terms of structure / idioms, did I do anything dumb?
<apeiros>
still looking. I'm a bit slow right now (still single handed)
djbkd_ has joined #ruby
marciotex has quit [Quit: My Mac has gone to sleep. ZZZzzz…]