apeiros changed the topic of #ruby to: Ruby 2.1.5; 2.0.0-p598; 1.9.3-p551: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
emmanuelux has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
mathias2 has quit [Ping timeout: 265 seconds]
aspires has joined #ruby
dkb20k has quit [Ping timeout: 244 seconds]
lampd1 has quit [Remote host closed the connection]
soulcake has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
funburn has joined #ruby
gregoriokusowski has joined #ruby
<rpag_> wald0, C is bare bones
Avahey has joined #ruby
<momomomomo> jesus still on that conversation? :|
<banister> wald0 C has strcmp
poweratom_ has joined #ruby
aep has joined #ruby
<banister> and 'string' isn't even a type in C
<wald0> momomomomo: nope, jesus doesn't exist
jdj_dk has quit [Ping timeout: 244 seconds]
<banister> you just have a null-terminated array of chars
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kirun has quit [Quit: Client exiting]
c0def00d has quit [Quit: c0def00d]
dermothaughey has joined #ruby
aep has quit [Ping timeout: 256 seconds]
fuhgeddaboudit has joined #ruby
fuhgeddaboudit has quit [Remote host closed the connection]
aep has joined #ruby
thumpba has joined #ruby
<volty> @sin, @sout, @wait_thr = Open3.popen2("cmd ...") // so I write some text to @sin and right after read_nonblock from @sout, should I interlace the two calls with a small delay (say 0.05) ?
pandaant has quit [Remote host closed the connection]
pdtpatrick_ has joined #ruby
<volty> e.c. intersperse
uber has quit [Quit: bye]
sargas has joined #ruby
usrj has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
usrj has joined #ruby
NoNMaDDeN has joined #ruby
uber has joined #ruby
oo_ has joined #ruby
Lingos_ has joined #ruby
<volty> never mind, I received a forced answer
<omosoj> hey all, i have a question about ar associations. a store has_many products, and a store has_one storesale. how do i relate storesale to products?
mugiwara has quit []
thumpba has quit [Remote host closed the connection]
<rpag_> omosoj, by joining #rubyonrails
Juanchito has quit [Quit: Connection closed for inactivity]
Kricir has joined #ruby
<jhass> worse, he already asked there
<omosoj> rpag_, is AR not a part of ruby as well?
<jhass> AR is written in ruby, it's part of rails
NoNMaDDeN has quit [Ping timeout: 244 seconds]
Lingos_ has quit [Ping timeout: 250 seconds]
<rpag_> omosoj, what jhass said
<omosoj> i asked in the other room about 10 minutes ago. no bites. i've been trying to learn this for a while and getting frustrated. ugh
<jhass> omosoj: 10 minutes is nothing in IRC terms
<omosoj> i've talked to some people who use AR without rails, so i thought it might be appropriate to ask in here as well
sevenseacat has joined #ruby
lampd1 has joined #ruby
<jhass> response times of 4 hours and more are not unusual in less popular channels
<banister> omosoj probably storesale has_many products through: store (if you need to)
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bMalum has quit [Quit: bMalum]
<banister> idk
<jhass> banister: you should found #new2rails :P
Insti has quit [Ping timeout: 264 seconds]
<banister> nah :)
<omosoj> banister, that's what i thought might work, but you seem unsure
volty has quit [Ping timeout: 264 seconds]
<banister> omosoj try it?
volty has joined #ruby
<wald0> bankair: null array of chars what thing? jesus?
<banister> it'll work
<wald0> oops, banister i meant
<banister> wald0 idk what you're asking me
<wald0> well, in any case, for sure ruby "string" is totally different than a string of chars in c, is a totally different design
<wald0> which is good and bad, in both ones :)
usrj has left #ruby ["AndroIRC"]
<banister> C barely has arrays
<omosoj> banister, and products belong_to storesale too?
fabrice31 has joined #ruby
jdj_dk has joined #ruby
<banister> omosoj no, belongs_to implies it has a foreign key
danijoo has joined #ruby
crazydiamond has joined #ruby
kireevco has joined #ruby
<omosoj> banister, yes, i see. it is unnecessary b/c storesale has a foreign key for store, goes there, then goes to all the products connected to that store. is that basically what happens?
rshetty has joined #ruby
<banister> omosoj yep
rudisimo has quit [Remote host closed the connection]
<omosoj> k, thanks :)
ramfjord has quit [Ping timeout: 272 seconds]
Miron has quit [Ping timeout: 240 seconds]
thumpba has joined #ruby
fabrice31 has quit [Ping timeout: 250 seconds]
<omosoj> banister, sorry, one last question. when you go through a table, do you need to consider its foreign keys at all?
uber has quit [Changing host]
uber has joined #ruby
Channel6 has quit [Quit: Leaving]
<banister> omosoj what do u mean?
Channel6 has joined #ruby
<omosoj> basically, is the through table functioning as a joins table that needs both tables' foreign keys?
rshetty has quit [Ping timeout: 264 seconds]
delianides has joined #ruby
delianides has quit [Remote host closed the connection]
delianides has joined #ruby
<omosoj> banister ^
Insti has joined #ruby
Lingo has quit [Quit: Be back later ...]
diegoviola has quit [Quit: WeeChat 1.0.1]
nateberkopec has quit [Quit: Leaving...]
Kricir has quit [Remote host closed the connection]
fgo has joined #ruby
wald0 has quit [Quit: Lost terminal]
luckyruby has joined #ruby
dkphenom has joined #ruby
dkphenom has quit [Max SendQ exceeded]
dkphenom has joined #ruby
dkphenom has quit [Max SendQ exceeded]
<banister> omosoj: you're doing this: select products.* from products join store where products.store_id = store.id where store.id = (that particular) storesale.store_id
dkphenom has joined #ruby
diegoviola has joined #ruby
thumpba has quit [Remote host closed the connection]
<banister> omosoj so it's just the regular: store.products except it's starting with the storesale (which has a reference back to the store)
<banister> nothing fancy
delianides has quit [Ping timeout: 272 seconds]
oo_ has quit [Remote host closed the connection]
<dkphenom> hi, i have an array of strings, how do I print a print an array element which contains a substring?
<omosoj> banister, got it, thanks
SCHAAP137 has quit [Quit: Leaving]
<banister> sorry that should be an 'on' rather than a 'where' (the first one)
<volty> >> %w/one two three/.grep /t/
<eval-in__> volty => ["two", "three"] (https://eval.in/222270)
oo_ has joined #ruby
delianides has joined #ruby
nkumari has quit [Remote host closed the connection]
funburn has quit [Ping timeout: 264 seconds]
<omosoj> k
<dkphenom> nm, answered my own quesiton :)
ramfjord has joined #ruby
mikepack has joined #ruby
nkumari has joined #ruby
nkumari has quit [Read error: Connection reset by peer]
nkumari has joined #ruby
nkumari has quit [Remote host closed the connection]
thumpba has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sargas has quit [Quit: Leaving]
nkumari has joined #ruby
haon99 has joined #ruby
mathias2 has joined #ruby
Jake232 has joined #ruby
sdwrage has joined #ruby
dkb20k has joined #ruby
<haon99> Hi! I'm currently trying to save the binary output of a RMagick/MiniMagick object (via .to_blob) into mongo's gridFS, but seeing the error: "string contains null byte"
it0a has joined #ruby
<haon99> Unsure what the root of the problem could be? Perhaps an encoding issue?
Fire-Dragon-DoL has quit [Quit: Leaving.]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Frank_Jameso has quit [Remote host closed the connection]
kobain has joined #ruby
mathias2 has quit [Ping timeout: 250 seconds]
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
dkb20k has quit [Ping timeout: 240 seconds]
<banister> haon99 i dont know much about mongo, but maybe you can store the blog in a different field type other than string?
<banister> strings (at least in C) treat null bytes specially, it indicates the end of a string
<banister> if there's a pure binary type you can use, try that instead
<banister> blob*
dermothaughey has quit [Remote host closed the connection]
<haon99> banister: I can save the output of open(self.image_url) into gridFS without a problem
<haon99> somehow the output of .to_blob is what's causing issues.
dermothaughey has joined #ruby
<banister> haon99 you can always base64 encode it or something
<haon99> I noticed the output of .to_blob is a long binary encoded string, whereas open(self.image_url) returns: #<Tempfile:/var/folders/4s/88_0g83d12nfj8m8z_93f54r0000gn/T/open-uri20141116-2987-181m4ho>
nkumari has quit [Remote host closed the connection]
<haon99> Maybe I can create a tempfile object to feed it into?
<haon99> Tempfile.new('temp').write(image.to_blob) outputs: #<Encoding::UndefinedConversionError: "\xFF" from ASCII-8BIT to UTF-8>
thsig has quit [Remote host closed the connection]
arescorpio has joined #ruby
dermothaughey has quit [Ping timeout: 258 seconds]
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
<banister> lol
nkumari has joined #ruby
corehook has joined #ruby
chris222223 has joined #ruby
jgrevich has joined #ruby
marr has quit [Ping timeout: 245 seconds]
byprdct has joined #ruby
josephndenton has joined #ruby
robustus has quit [Ping timeout: 250 seconds]
Soda has quit [Remote host closed the connection]
byprdct_ has quit [Ping timeout: 240 seconds]
nkumari has quit [Remote host closed the connection]
corehook has quit [Ping timeout: 258 seconds]
robustus has joined #ruby
jimbach has joined #ruby
corehook has joined #ruby
Techguy305 has joined #ruby
josephndenton has quit [Write error: Connection reset by peer]
Techguy305 has quit [Max SendQ exceeded]
corehook has quit [Remote host closed the connection]
dc_ has quit [Remote host closed the connection]
Techguy305 has joined #ruby
haon99 has quit [Quit: Page closed]
jimbach_ has joined #ruby
nkumari has joined #ruby
tlarevo has quit [Remote host closed the connection]
tokik has joined #ruby
_ixti_ has quit [Ping timeout: 240 seconds]
jimbach has quit [Ping timeout: 258 seconds]
jdj_dk has quit [Ping timeout: 240 seconds]
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gregoriokusowski has quit [Quit: gregoriokusowski]
Techguy305 has quit [Ping timeout: 240 seconds]
chris222223 has quit [Ping timeout: 240 seconds]
Techguy305|2 has joined #ruby
KC9YDN has joined #ruby
tkuchiki has joined #ruby
spastorino has quit [Quit: Connection closed for inactivity]
procat has quit [Ping timeout: 264 seconds]
j_mcnally has joined #ruby
silkfox has quit [Ping timeout: 272 seconds]
sinequanon has joined #ruby
Nogbit has joined #ruby
s00pcan has joined #ruby
josephndenton has joined #ruby
davedev24_ has quit []
gsd has joined #ruby
oo_ has quit [Remote host closed the connection]
sinequanon has quit [Ping timeout: 258 seconds]
oo_ has joined #ruby
gregoriokusowski has joined #ruby
airdeluxe has quit [Quit: Leaving]
josephndenton has quit [Ping timeout: 256 seconds]
nobitanobi has quit [Remote host closed the connection]
rudisimo has joined #ruby
cajone has quit [Remote host closed the connection]
gregoriokusowski has quit [Client Quit]
oo_ has quit [Ping timeout: 250 seconds]
Takle_ has joined #ruby
Xeago has quit [Remote host closed the connection]
oo_ has joined #ruby
Takle has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
cajone has joined #ruby
Channel6 has quit [Quit: Leaving]
iml has joined #ruby
fandi has quit [Quit: Leaving]
iml has quit [Max SendQ exceeded]
nonks has joined #ruby
iml has joined #ruby
iml has quit [Max SendQ exceeded]
wolflee_________ has joined #ruby
dkb20k has joined #ruby
hamakn has quit [Remote host closed the connection]
wolflee________ has quit [Read error: Connection reset by peer]
nkumari has quit [Remote host closed the connection]
hamakn has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Spami has quit [Quit: This computer has gone to sleep]
Takle_ has quit [Ping timeout: 255 seconds]
Takle has joined #ruby
t_mmyv has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
hamakn has quit [Ping timeout: 258 seconds]
wolflee_________ has quit [Ping timeout: 244 seconds]
byprdct has quit [Quit: sleeping]
nonks has quit [Ping timeout: 250 seconds]
Takle has quit [Ping timeout: 256 seconds]
dc_ has joined #ruby
glaksmono has joined #ruby
jdj_dk has joined #ruby
oleo__ has joined #ruby
Takle has joined #ruby
mathias2 has joined #ruby
oleo is now known as Guest52034
hamakn has joined #ruby
Guest52034 has quit [Ping timeout: 255 seconds]
tus has joined #ruby
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
Takle has quit [Ping timeout: 244 seconds]
mathias2 has quit [Ping timeout: 240 seconds]
mattstra_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Channel6 has joined #ruby
Takle has joined #ruby
rudisimo has quit [Remote host closed the connection]
thumpba has quit []
nkumari has joined #ruby
BlackGear has joined #ruby
phutchins has quit [Ping timeout: 258 seconds]
echooo has joined #ruby
Lingos_ has joined #ruby
parzzix has quit [Ping timeout: 272 seconds]
<etech0> how can i check if the first letter of a string is a consonant? I know i should be using regex, but then I get stuck
byprdct has joined #ruby
<BraddPitt> you could create a collection of vowels
<BraddPitt> and then check if that letter is NOT in the collection
adriancb has quit [Remote host closed the connection]
<BraddPitt> which /may/ be faster than regex, would have to profile it
<BraddPitt> underlying point being that iterating over 5 strings won't take long at all
lele has quit [Ping timeout: 265 seconds]
<etech0> right
<etech0> I'll try that. Thanks!
<BraddPitt> and there is the possibility that compiling and executing the regex would be slower (someone smarter than I can maybe give input)
<BraddPitt> np etech0
Lingos_ has quit [Ping timeout: 255 seconds]
Spami has joined #ruby
delianides has quit []
Nogbit has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
fabrice31 has joined #ruby
parzzix has joined #ruby
chipotle has joined #ruby
procat has joined #ruby
adriancb has joined #ruby
lele has joined #ruby
NoNMaDDeN has joined #ruby
sailias has joined #ruby
jenrzzz has joined #ruby
farkdiber has joined #ruby
fabrice31 has quit [Ping timeout: 264 seconds]
aspiers has joined #ruby
nobitanobi has joined #ruby
procat has quit [Ping timeout: 250 seconds]
momomomomo has quit [Quit: momomomomo]
<BraddPitt> Anyone here know much about using delayed_job?
<BraddPitt> or perhaps can help me understand a bit of code from that gem?
NoNMaDDeN has quit [Ping timeout: 255 seconds]
nkumari has quit [Remote host closed the connection]
nkumari has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
krz has joined #ruby
ProfElm has quit [Quit: Leaving]
jimbach_ has quit [Remote host closed the connection]
adriancb has quit [Remote host closed the connection]
jimbach has joined #ruby
<volty> >> ["vowel" =~ /^(?![aeiou])/, "etech0" =~ /^(?![aeiou])/]
<eval-in__> volty => [0, nil] (https://eval.in/222293)
<volty> btw regexp should be negligably faster
kireevco has quit [Ping timeout: 265 seconds]
jimbach has quit [Remote host closed the connection]
jimbach has joined #ruby
cleopatra has quit [Quit: Saliendo]
sirene is now known as cleopatra
byprdct has quit [Read error: Connection reset by peer]
hiyosi has quit [Ping timeout: 240 seconds]
wex13r has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
rshetty has joined #ruby
dermothaughey has joined #ruby
byprdct has joined #ruby
jimbach has quit [Ping timeout: 258 seconds]
x1337807x has quit [Read error: Connection reset by peer]
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rshetty has quit [Ping timeout: 264 seconds]
aspires has quit []
josephndenton has joined #ruby
DarkCthulhu has left #ruby ["Leaving"]
nobitanobi has quit [Remote host closed the connection]
arup_r has joined #ruby
nonks has joined #ruby
byprdct has quit [Quit: sleeping]
St1gma has quit [Read error: Connection reset by peer]
arup_r has quit [Client Quit]
St1gma has joined #ruby
arup_r has joined #ruby
poweratom_ has quit [Quit: Be back later ...]
nkumari_ has joined #ruby
atomical has joined #ruby
rustshaman has joined #ruby
zacts- has joined #ruby
mary5030 has quit [Remote host closed the connection]
nkumari has quit [Ping timeout: 265 seconds]
corehook has joined #ruby
mathias2 has joined #ruby
arrubin has quit []
volty has quit [Quit: Konversation terminated!]
tyll has quit [Ping timeout: 240 seconds]
crazydiamond has quit [Ping timeout: 245 seconds]
nonks has quit [Ping timeout: 250 seconds]
Mars` has joined #ruby
bahar has quit [Ping timeout: 255 seconds]
lemur has quit [Ping timeout: 258 seconds]
nkumari_ has quit [Remote host closed the connection]
mary5030 has joined #ruby
mathias2 has quit [Ping timeout: 272 seconds]
nkumari has joined #ruby
byprdct has joined #ruby
lemur has joined #ruby
bahar has joined #ruby
tyll has joined #ruby
rkazak has left #ruby [#ruby]
airdeluxe has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
dermothaughey has quit [Remote host closed the connection]
St1gma has joined #ruby
dermothaughey has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mars` has quit [Ping timeout: 272 seconds]
NoNMaDDeN has joined #ruby
bahar has quit [Ping timeout: 272 seconds]
MrDoctor2 has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
mary5030 has quit [Remote host closed the connection]
MrDoctor2 has joined #ruby
bahar has joined #ruby
mary5030 has joined #ruby
renderful has joined #ruby
magic_ has joined #ruby
dermothaughey has quit [Ping timeout: 255 seconds]
zacts- has quit []
ZaRDaK has quit [Read error: Connection reset by peer]
ZaRDaK has joined #ruby
Cache_Money has joined #ruby
mugiwara_ has joined #ruby
Channel6 has quit [Quit: Leaving]
mary5030 has quit [Ping timeout: 272 seconds]
luriv has quit [Ping timeout: 258 seconds]
<mugiwara_> I'm about to read some tutorials on Ruby Gems. I am still not totally sure about the concept, and don;t know how to use them. I learned modules, which seem to be a way to have code span multiple files, like most projects would. But gems.. they are like plugins written by other people? And you would 'require' them just like modules?
renderful has quit [Ping timeout: 255 seconds]
sinequanon has joined #ruby
<BraddPitt> a gem is a packaged library or collection of code that provides some function
<BraddPitt> you can include them in your own program so that you have access to that code
slawrence00 has joined #ruby
divi has joined #ruby
<BraddPitt> and yes, you 'require' them similar to modules
<BraddPitt> except that you include modules, not require
<mugiwara_> ah yes, you're right
omosoj has quit [Quit: leaving]
<mugiwara_> I found a tutorial on tutsplus to explain to to me, very similar to how you did
<mugiwara_> BraddPitt: Also, gems are pretty much the equivalent of pypi packages that I would install using pip. Makes sense! :]
sinequanon has quit [Ping timeout: 258 seconds]
<mugiwara_> I learned rvm a little while ago, so I just created a new gemset, I will practice installing and uninstalling gems
nkumari has quit [Remote host closed the connection]
amystephen has quit [Quit: amystephen]
davedev24_ has joined #ruby
procat has joined #ruby
KramerC has joined #ruby
chipotle has quit [Quit: cya]
Jake232 has quit [Ping timeout: 256 seconds]
freerobby has joined #ruby
Photism has quit [Quit: Leaving]
<mugiwara_> I want to continue learning Ruby by working with Twitter and YouTube API. Since most big sites now use oauth, should I get ONE gem for oauth and learn to manually code for Twitter and YouTube, or use "gem install twitter" and use pre-made gems?
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MrDoctor2 has quit [Remote host closed the connection]
razieliyo_ has joined #ruby
razieliyo has quit [Read error: No route to host]
MrDoctor2 has joined #ruby
Techguy305|2 has quit [Remote host closed the connection]
aspires has joined #ruby
sailias has joined #ruby
freerobby has quit [Quit: Leaving.]
Channel6 has joined #ruby
tus has quit []
hiyosi has joined #ruby
<BraddPitt> the gems are generally just wrappers for the HTTP calls with some helper methods thrown in
deject3d_ has joined #ruby
mattstra_ has joined #ruby
mugiwara_ has quit []
sailias has quit [Quit: Leaving.]
hiyosi has quit [Ping timeout: 265 seconds]
<BraddPitt> with ActiveRecord, suppose I have a an Order table with user_id column and order belongs_to user. Is it faster to call user.id or user_id from the Order model class?
oo_ has quit [Remote host closed the connection]
<BraddPitt> i would think user_id since the order is read into memory and we dont have to hit the DB to read the user_id attribute of the model
<rpag_> user_id is faster
<rpag_> it returns an integer
<rpag_> no AR object to read, no association to load
<rpag_> s/read/create/
<BraddPitt> still seems to be firing a SQL query
<BraddPitt> i dont get why
<BraddPitt> this is for a Orders#show method
oo_ has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
<BraddPitt> just `puts "#{user_id}" to server console window
<BraddPitt> ah
<BraddPitt> i think this is from the Devise gem
<BraddPitt> perhaps?
<BraddPitt> yeah, it is
<BraddPitt> derf, i had a before_action to auth a user
kyb3r_ has quit [Read error: Connection reset by peer]
kyb3r_ has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Techguy305 has joined #ruby
takitakitaki has joined #ruby
nkumari has joined #ruby
nkumari has quit [Remote host closed the connection]
n008f4g_ has quit [Ping timeout: 250 seconds]
kevr has quit [Ping timeout: 256 seconds]
klmlfl has joined #ruby
oo_ has quit [Remote host closed the connection]
Photism has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
oo_ has joined #ruby
mathias2 has joined #ruby
farkdiber has quit [Remote host closed the connection]
kevr has joined #ruby
Lingos_ has joined #ruby
kevr has quit [Changing host]
kevr has joined #ruby
iamjarvo has joined #ruby
arup_r has quit [Quit: Leaving.]
drawingthesun has joined #ruby
nonks has joined #ruby
nonks has quit [Remote host closed the connection]
BlackGear has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Techguy305|2 has joined #ruby
mathias2 has quit [Ping timeout: 256 seconds]
Lingos_ has quit [Ping timeout: 244 seconds]
St1gma has quit [Read error: Connection reset by peer]
braincrash has quit [Quit: bye bye]
St1gma has joined #ruby
jgrevich_ has joined #ruby
j_mcnally has joined #ruby
anaeem1_ has joined #ruby
XX1 has quit []
Techguy305 has quit [Ping timeout: 265 seconds]
jgrevich has quit [Ping timeout: 255 seconds]
jgrevich_ is now known as jgrevich
braincrash has joined #ruby
fabrice31 has joined #ruby
mary5030 has joined #ruby
_5kg has quit [Ping timeout: 240 seconds]
tlarevo has joined #ruby
rudisimo has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
testcore has joined #ruby
fabrice31 has quit [Ping timeout: 255 seconds]
anaeem1 has joined #ruby
rshetty has joined #ruby
kumarat9pm has joined #ruby
flori has quit [Ping timeout: 245 seconds]
flori has joined #ruby
techsethi has joined #ruby
gsd has joined #ruby
arescorpio has quit [Excess Flood]
takitakitaki has quit [Quit: Leaving]
Techguy305|2 has quit [Remote host closed the connection]
rudisimo has quit [Remote host closed the connection]
jgrevich has quit [Read error: No route to host]
klmlfl has quit [Remote host closed the connection]
poweratom_ has joined #ruby
aspires has quit []
cirn0 has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cirn0 has quit [Client Quit]
corehook has quit [Ping timeout: 258 seconds]
luckyruby has quit [Remote host closed the connection]
corehook has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
aspires has joined #ruby
kp666 has joined #ruby
jenrzzz has joined #ruby
MattB2 has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 255 seconds]
mary5030 has quit [Remote host closed the connection]
chipotle has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
krz has quit [Quit: WeeChat 1.0.1]
St1gma has joined #ruby
mattstra_ has quit [Quit: Textual IRC Client: www.textualapp.com]
vinleod has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
jlast_ has quit [Remote host closed the connection]
louism2wash has joined #ruby
iml has joined #ruby
jlast has joined #ruby
krz has joined #ruby
iml has quit [Max SendQ exceeded]
krz has quit [Client Quit]
iml has joined #ruby
dseitz has joined #ruby
tkuchiki has joined #ruby
iml has quit [Max SendQ exceeded]
krz has joined #ruby
aspiers has quit [Ping timeout: 272 seconds]
iml has joined #ruby
iml has quit [Max SendQ exceeded]
iml has joined #ruby
karmatr0n has joined #ruby
oo_ has quit [Remote host closed the connection]
iml has quit [Max SendQ exceeded]
Mateon1 has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
iml has joined #ruby
iml has quit [Max SendQ exceeded]
danijoo has quit [Read error: Connection reset by peer]
jlast has joined #ruby
iml has joined #ruby
danijoo has joined #ruby
iml has quit [Max SendQ exceeded]
poweratom_ has quit [Quit: Be back later ...]
louism2wash has quit [Quit: This computer has gone to sleep]
iml has joined #ruby
parabolize has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
iml has quit [Max SendQ exceeded]
Nexus_x1 has quit [Quit: (null)]
iml has joined #ruby
tlarevo has quit [Remote host closed the connection]
dseitz has quit [Ping timeout: 240 seconds]
techsethi has quit [Quit: techsethi]
iml has quit [Max SendQ exceeded]
deject3d_ has quit [Quit: Computer has gone to sleep.]
jlast_ has joined #ruby
iml has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
iml has quit [Max SendQ exceeded]
jackmanarakat has joined #ruby
<jackmanarakat> hi guys, i am stuck on a problem
tlarevo has joined #ruby
<jackmanarakat> how would you add an array?
<jackmanarakat> a sum of all the numbers in an array
_5kg has joined #ruby
iml has joined #ruby
<jackmanarakat> def sum([])? what do we pass in as the parameters for the method?
<BraddPitt> an array of items
iml has quit [Max SendQ exceeded]
dseitz has joined #ruby
iml has joined #ruby
<jackmanarakat> BraddPitt: yes,
<jackmanarakat> i saw an answer on stack overflow, but i am not finding documentation on this piece of code
<jackmanarakat> :+)
iml has quit [Max SendQ exceeded]
<jackmanarakat> it's not a joke lol
<jackmanarakat> it looks like a smiley face
<jackmanarakat> and a clown nose
<BraddPitt> I'm sorry, which part are you stuck on?
crus has quit [Read error: Connection reset by peer]
<jackmanarakat> well basically i'm trying to create a new method that adds an array with an arbitrary amount of numbers
iml has joined #ruby
karmatr0n has quit [Remote host closed the connection]
<jackmanarakat> the second answer is awesome
<jackmanarakat> but i am not understanding what the code does
<jackmanarakat> :+
<jackmanarakat> ???
jlast_ has quit [Ping timeout: 258 seconds]
<BraddPitt> ah
<BraddPitt> :+ is a special symbol in Ruby
mathias2 has joined #ruby
koderok has joined #ruby
<BraddPitt> that second answer is literally saying "for each item in the array, add it to this initial value"
<BraddPitt> where the "initial value" is that 0 specified in the inject() parameters
<BraddPitt> does that make sense?
benzrf is now known as benzrf|offline
<jackmanarakat> ok yes, thank you
<jackmanarakat> so how would i add an empty array?
<BraddPitt> do you mean how would you sum all items in an empty array?
crus has joined #ruby
mathias2 has quit [Ping timeout: 272 seconds]
<zenspider> there's nothing special about :+, it's just a symbol
kevinxu has joined #ruby
x77686d has joined #ruby
ferr has quit [Ping timeout: 255 seconds]
kevinxu is now known as Guest6439
<zenspider> jackmanarakat: did you try the suggested code against an empty array?
<jackmanarakat> no, but i found the answers to the puzzles
<jackmanarakat> i don't know if working backwards is a good idea, but i want to learn
ferr has joined #ruby
<BraddPitt> it is always a good idea to understand the internals of your code
<jackmanarakat> i'm very new to ruby and it's my first progrmaming language
<jackmanarakat> i can't believe that i did the first two by myself!
_5kg has quit [Ping timeout: 264 seconds]
Morkel has joined #ruby
<BraddPitt> even a better reason to learn more :)
Techguy305 has joined #ruby
artm has joined #ruby
<jackmanarakat> well i did the first two parts of the second problem, but i don't know how to make an empty array
s2013 has joined #ruby
<jackmanarakat> i know it's Array.new
<zenspider> []
<jackmanarakat> or []
<jackmanarakat> but it's a bit different here
<zenspider> don't use Array.new. [] is fine
<jackmanarakat> def sum(numbers) numbers.inject(0){|total, number| total+number} end
amystephen has joined #ruby
<jackmanarakat> that's the solution on what i'm stuck on
<jackmanarakat> but i don't understand that code
<zenspider> it's the same as the :+ one above
<jackmanarakat> oh
<zenspider> go read the doco on Enumerable.inject first
<zenspider> then it should be fairly straightforward
<jackmanarakat> i don't get where the parameters come into use
renderful has joined #ruby
<zenspider> that's what doco is for
<jackmanarakat> my question is, because this is backed by a testing framework, i'm learning test driven development,
<zenspider> `ri Enumerable.inject` or find the doco online
<jackmanarakat> is that is it passing an array, or am i creating an array
<jackmanarakat> def sum(numbers) numbers.inject(0){|total, number| total+number} end
<jackmanarakat> :~/Desktop/test-first-ruby-master$ ri enumerable.inject Nothing known about enumerable
<jackmanarakat> there we go
<zenspider> Enumerable
<BraddPitt> the (numbers) is thje name for a parameter
NoNMaDDeN has joined #ruby
<jackmanarakat> this is the code for the test case
<jackmanarakat> describe "sum" do it "computes the sum of an empty array" do sum([]).should == 0 end
<BraddPitt> right
<BraddPitt> so in that test case, they are calling the sum() method and passing the parameter [], which is an empty array
<BraddPitt> its the same as
<BraddPitt> empty_array = []
<BraddPitt> sum(empty_array)
<jackmanarakat> thank you! :)
<jackmanarakat> okay so now i have to try and do the harder thing
mathias2 has joined #ruby
renderful has quit [Ping timeout: 245 seconds]
mobiGeek2 has quit [Quit: Nettalk6 - www.ntalk.de]
<gr33n7007h> How can I get an array of all socket constants and their corresponding integer values?
<BraddPitt> where are these socket constants defined?
<zenspider> Socket.constants.sort.map { |n| [n, Socket.const_get(n) ] }
<zenspider> not sure why you want an array tho
<gr33n7007h> zenspider, perfect!!! :)
<gr33n7007h> Then I could just call Hash[]
sumark has quit [Remote host closed the connection]
sumark has joined #ruby
nfk has quit [Quit: yawn]
techsethi has joined #ruby
koderok has quit [Quit: koderok]
i0n has joined #ruby
hiyosi has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
x77686d has quit [Quit: x77686d]
fgo has quit [Quit: WeeChat 1.0]
sinequanon has joined #ruby
jlast has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
hiyosi has quit [Ping timeout: 265 seconds]
BTRE has quit [Quit: Leaving]
BTRE has joined #ruby
<dkphenom> i have hash of arrays like this: entries = {"First, Last"=>["(954) 555-1234, (cell)", "(954) 727-1895, (work)"]}, how can I update the (work) contact within the array of the hash?
razieliyo_ has quit [Quit: Saliendo]
pengin has joined #ruby
tlarevo has quit [Ping timeout: 264 seconds]
jlast has quit [Ping timeout: 258 seconds]
tlarevo has joined #ruby
adriancb has joined #ruby
siwica has joined #ruby
siwica has quit [Remote host closed the connection]
oo_ has joined #ruby
ferr has quit [Remote host closed the connection]
aspires has quit []
Abhijit has joined #ruby
adriancb has quit [Ping timeout: 240 seconds]
aspiers has joined #ruby
techsethi has quit [Quit: techsethi]
Photism has quit [Quit: Leaving]
<zenspider> dkphenom: how would you update it if it were just a string?
Cache_Money has quit [Quit: Cache_Money]
<dkphenom> zenspider can I pm you?
<zenspider> no
<BraddPitt> dkphenom you can use regex (which you have to, since its one long string)
<BraddPitt> but it would be better to do some data massaging before you put it into the hash
<BraddPitt> will cause much fewer headaches later on
pengin has quit [Remote host closed the connection]
tlarevo has quit [Ping timeout: 240 seconds]
<dkphenom> why do I need to regex it? i could fetch the entries based on the contact (work or cell), then map it? im just confused by the hash of arrays notation....
<BraddPitt> "(954) 727-1895, (work)"
<zenspider> again, how would you update it if it were just a string?
<BraddPitt> do you want to maintain the (work) bit of the string?
<dkphenom> string = "blah blah"
<dkphenom> but i dont see hwo that applies, im having problem knowing how to chain select the name withinin the hash and the appropriate element of the array so that I can then assign to it
<BraddPitt> entries["First, Last"][0]
<BraddPitt> will return "(954) 555-1234, (cell)
<BraddPitt> missed a closing quote but you get the idea
<BraddPitt> entries["First, Last"][1] will return "(954) 727-1895, (work)"
_5kg has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
duncannz has quit [Ping timeout: 265 seconds]
mleung has joined #ruby
Channel6 has quit [Quit: Leaving]
Lingos_ has joined #ruby
mleung has quit [Client Quit]
havenwood has joined #ruby
<zenspider> dkphenom: that's not updating a string. that's setting a variable
duncannz has joined #ruby
<dkphenom> if string is some string, thats how I would update it
<gr33n7007h> something like this maybe: entries.map {|k,v| v[-1] = "updated" }
deject3d_ has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
Lingos_ has quit [Ping timeout: 255 seconds]
xymbol has quit [Quit: Be back later ...]
avrc has quit [Quit: this channel is bakas]
<dkphenom> hmmm
<dkphenom> so i need the index of the element in the array
<dkphenom> can't just select based on value
ZaRDaK has quit [Read error: Connection reset by peer]
omosoj has joined #ruby
<BraddPitt> you have no values, they are array elements
<BraddPitt> all you have are indices
<BraddPitt> hence why i suggested to massage the data into a more "proper" hash format
xymbol has joined #ruby
fedexo has quit [Ping timeout: 244 seconds]
Techguy305 has quit [Ping timeout: 255 seconds]
jdj_dk has quit [Ping timeout: 256 seconds]
fabrice31 has joined #ruby
ARCADIVS has joined #ruby
jlast has joined #ruby
corehook has quit [Remote host closed the connection]
parzzix has quit [Read error: Connection reset by peer]
poweratom_ has joined #ruby
fabrice31 has quit [Ping timeout: 245 seconds]
i0n has quit [Quit: snooze]
it0a has quit [Quit: WeeChat 1.0.1]
techsethi has joined #ruby
Techguy305 has joined #ruby
<dkphenom> why can't i just do entries[name].index(value) = new_value
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
<gr33n7007h> dkphenom, does this work "string" = "new string"
<dkphenom> no
<dkphenom> im confused sigh
SweetSweetCandy has joined #ruby
siso has quit [Ping timeout: 272 seconds]
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
SweetSweetCandy has quit [Remote host closed the connection]
byprdct has quit [Quit: by]
parzzix has joined #ruby
corehook has joined #ruby
vimer has joined #ruby
kireevco has joined #ruby
<gr33n7007h> dkphenom, entries[name].index(value) that just return an integer
<gr33n7007h> so doing 2 = new_value is not going to work
t_mmyv has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<gr33n7007h> >> entries = {"First, Last"=>["(954) 555-1234, (cell)", "(954) 727-1895, (work)"]}; entries.fetch('First, Last').index('(954) 727-1895, (work)')
<eval-in__> gr33n7007h => 1 (https://eval.in/222320)
corehook has quit [Remote host closed the connection]
pdtpatrick_ has quit [Ping timeout: 258 seconds]
sigurding has joined #ruby
kumarat9pm has quit [Ping timeout: 240 seconds]
j_mcnally has quit [Ping timeout: 255 seconds]
<gr33n7007h> dkphenom, but this will work: entries.fetch('First, Last')[1] = :new_value
sinequanon has quit [Remote host closed the connection]
<dkphenom> right so im trying to determine the index
<dkphenom> so i dont have to hardcode it
<gr33n7007h> use a hash or something other then an array
timonv_ has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Auv is now known as AlexFromTarget
NoNMaDDeN has joined #ruby
Sp4rKy_ has quit [Ping timeout: 250 seconds]
teddyp1cker has joined #ruby
timonv_ has quit [Remote host closed the connection]
<gr33n7007h> Am not sure quite what your asking but: entries = {"First, Last"=>{cell: "(222) 555-0000", work: "(222) 727-0000" } }; entries.map {|k,v| v[:work] = "new value" }; entries
timonv_ has joined #ruby
tagrudev has joined #ruby
jlast has joined #ruby
<zenspider> learn how to ask better questions and be open to feedback when you get it. otherwise, there's little reason to try to help
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dkphenom> who me?
<zenspider> who else?
rshetty has quit [Ping timeout: 255 seconds]
pdtpatrick_ has joined #ruby
jack_rabbit has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
sandelius has joined #ruby
elaptics`away is now known as elaptics
Abhijit has quit [Read error: No route to host]
<BraddPitt> [22:25] <dkphenom> right so im trying to determine the index
<BraddPitt> you can search through all indices and the apply a regex to see if it matches what you expect
<dkphenom> i got it figured out bradd, thanks
<BraddPitt> but honestly the best way is to have this in a proper nested hash
<BraddPitt> ok
<BraddPitt> np
Abhijit has joined #ruby
<dkphenom> thanks g33n7007h
<gr33n7007h> ok, np
timonv_ has quit [Remote host closed the connection]
noop has joined #ruby
pdtpatrick_ has quit [Ping timeout: 264 seconds]
AlexFromTarget is now known as Auv
anarang has joined #ruby
j_mcnally has joined #ruby
zenspider has quit [Quit: bye]
cescalante has quit [Ping timeout: 245 seconds]
last_staff has joined #ruby
s51itxsyc has left #ruby [#ruby]
Sp4rKy_ has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sandelius has joined #ruby
zenspider has joined #ruby
kumarat9pm has joined #ruby
havenwood has quit []
havenwood has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
jack_rabbit has quit [Ping timeout: 265 seconds]
oleo__ has quit [Quit: Verlassend]
Just\ has joined #ruby
ht__th has joined #ruby
_5kg has quit [Ping timeout: 264 seconds]
ta has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
tobago has joined #ruby
BlackGear has joined #ruby
Just\ has left #ruby [#ruby]
matcouto has joined #ruby
mengu has joined #ruby
nrsk has joined #ruby
poweratom_ has quit [Ping timeout: 264 seconds]
MSY has joined #ruby
MSY is now known as Guest2671
bal has joined #ruby
Macaveli has joined #ruby
kireevco has quit [Quit: Leaving.]
corehook has joined #ruby
hiyosi has joined #ruby
kamilc__ has joined #ruby
oo_ has joined #ruby
RealMarc is now known as Marc
Marc is now known as Guest70457
iml has quit [Quit: sleep]
ramfjord has joined #ruby
s2013 has quit [Ping timeout: 258 seconds]
sinequanon has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hiyosi has quit [Ping timeout: 244 seconds]
codecop has joined #ruby
lolmaus_ has quit [Quit: Konversation terminated!]
rudisimo has joined #ruby
keen___________3 has joined #ruby
claptor has joined #ruby
corehook has quit [Remote host closed the connection]
corehook has joined #ruby
bMalum has joined #ruby
corehook has quit [Remote host closed the connection]
keen___________2 has quit [Ping timeout: 250 seconds]
red_horned_rihno has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
rudisimo has quit [Ping timeout: 258 seconds]
clauswitt has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
lxsameer has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
jlast has joined #ruby
clauswi__ has joined #ruby
cescalante has joined #ruby
techsethi has quit [Quit: techsethi]
St1gma has quit [Read error: Connection reset by peer]
clauswitt has quit [Ping timeout: 256 seconds]
St1gma has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
d4nku has quit [Ping timeout: 258 seconds]
Lingos_ has joined #ruby
codecop has quit [Remote host closed the connection]
sinequanon has quit [Remote host closed the connection]
fabrice31 has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
Mateon2 has joined #ruby
Lingos_ has quit [Ping timeout: 245 seconds]
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mateon1 has quit [Ping timeout: 240 seconds]
_5kg has joined #ruby
sandelius has joined #ruby
Techguy305 has quit [Ping timeout: 244 seconds]
echooo1 has joined #ruby
echooo has quit [Ping timeout: 244 seconds]
rdark has joined #ruby
artm has quit [Read error: Connection reset by peer]
artm has joined #ruby
moritzs has joined #ruby
sinequanon has joined #ruby
c0def00d has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
Macaveli has joined #ruby
jlast has joined #ruby
oo_ has quit [Remote host closed the connection]
terlar has joined #ruby
corehook has joined #ruby
oo_ has joined #ruby
andrewlio has joined #ruby
einarj has joined #ruby
jheg has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
bigkevmcd has joined #ruby
despai has joined #ruby
timonv_ has joined #ruby
artm has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
timonv_ has quit [Remote host closed the connection]
timonv_ has joined #ruby
ta has joined #ruby
red_horned_rihno has quit [Ping timeout: 258 seconds]
despai has quit [Quit: This computer has gone to sleep]
vimer_ has joined #ruby
mikepack has quit [Ping timeout: 265 seconds]
deject3d_ has quit [Remote host closed the connection]
RitterJack has joined #ruby
vimer has quit [Ping timeout: 264 seconds]
lampd1 has quit [Remote host closed the connection]
artm has joined #ruby
sinequanon has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
TomyWork has joined #ruby
t_p has joined #ruby
mathias2 has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
d4nku has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
josephndenton has joined #ruby
duncannz has quit [Ping timeout: 272 seconds]
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JohnBat26 has joined #ruby
livathinos has joined #ruby
lidaaa has quit [Ping timeout: 255 seconds]
coderhs has joined #ruby
BlackGear has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
coderhs has quit [Read error: Connection reset by peer]
jheg has quit [Quit: jheg]
wolflee has joined #ruby
Takle has quit [Remote host closed the connection]
Asher1 has joined #ruby
josephndenton has quit [Ping timeout: 264 seconds]
duncannz has joined #ruby
jlast has joined #ruby
rikai has quit [Ping timeout: 256 seconds]
xymbol has quit [Read error: Connection reset by peer]
mityaz has joined #ruby
xymbol has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
d4nku has quit [Ping timeout: 255 seconds]
mityaz has quit [Client Quit]
sandelius has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
mikepack has joined #ruby
c0def00d has quit [Quit: c0def00d]
jlast has quit [Ping timeout: 258 seconds]
ghr has joined #ruby
lolmaus has joined #ruby
tesuji has joined #ruby
mikepack has quit [Ping timeout: 255 seconds]
pvb has joined #ruby
Xeago has joined #ruby
kyb3r_ has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
mityaz has joined #ruby
<shevy> code code code
<Abhijit> bug bug bug
ghostlines has joined #ruby
Xeago has quit [Ping timeout: 255 seconds]
<shevy> hehe
pvb has quit [Quit: Leaving]
AlSquirrel has quit [Quit: This computer has gone to sleep]
DarkCthulhu has joined #ruby
atmosx has quit [Remote host closed the connection]
DarkCthulhu has left #ruby [#ruby]
atmosx has joined #ruby
<godd2> hehehe*
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
mathias2 has joined #ruby
Avahey has quit [Quit: Connection closed for inactivity]
unshadow has joined #ruby
bMalum has quit [Quit: bMalum]
<shevy> hey godd2
<shevy> what will be your next game?
lxsameer has quit [Ping timeout: 255 seconds]
<unshadow> What is the right way to perform multilpe test on a veriable, lets say I have this string = "Today is a nice day", now I want to do something like this: if string.match(/Today/) do this; end; if string.match(/nice/) do this also; end
<unshadow> Does that makes sense ?
livathin_ has joined #ruby
sevenseacat has quit [Quit: Leaving.]
<canton7> case statement?
<canton7> or plain if/elsif?
<tobiasvl> case is probably cleanest
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
d4nku has joined #ruby
<godd2> case statement won't do both though
<tobiasvl> yeah true
<godd2> unshadow do you want both outcomes to happen, or only the first one that matches?
<tobiasvl> neither will elsif
<unshadow> both
<godd2> yea then just do separate if statements
<unshadow> no better way ?
Mia has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
<godd2> the if statement already *is* the better way
<godd2> unless youd rather dabble in lower level syntax
<unshadow> lower level syntex ?
ctp has joined #ruby
<godd2> unshadow i mean coding in a different language like C
<unshadow> oh... I see, no thanks XD
<godd2> without know much more about your problem though, we cant offer a good solution.
hiyosi has joined #ruby
<godd2> It might turn out you should create a new class or it might turn out you just need a couple if statements
<unshadow> I think you got my problem, it was just that in ruby I usually except everything to be very nicely coded, and a few if-end one after another just looks silly
AlexRussia has quit [Ping timeout: 255 seconds]
livathinos has quit [Ping timeout: 258 seconds]
<unshadow> but thats what i'll do
<godd2> well if you want, put some sample code in a gist for one of us to look at
Takle has joined #ruby
d4nku has quit [Ping timeout: 244 seconds]
sk87 has joined #ruby
jlast has joined #ruby
dc_ has quit [Remote host closed the connection]
<godd2> shevy haha I didn't have any plans for a new one. Though I am working on my sound gem: https://github.com/RSMP/sound
jmdade has joined #ruby
<shevy> cool!
<zenspider> godd2: oooh. please make my rubygems-sing gem work again
<shevy> just the other day I looked at a gem that displays chords and notes (or rather, calculates frequencies and distances towards them)
<shevy> godd2 build me a hans zimmer gem please
<shevy> ack
hiyosi has quit [Ping timeout: 240 seconds]
<shevy> you are a sound guru
sigurding has quit [Quit: sigurding]
chthon has joined #ruby
<unshadow> So, godd2 what say you ? can I make it better with the if-end checks ?
moritzs has quit [Ping timeout: 255 seconds]
<godd2> zenspider Ill take a look at it. is this the github repo for it? https://github.com/seattlerb/rubygems-sing
BTRE has quit [Read error: Connection reset by peer]
<godd2> unshadow yea separate if statements is fine since youre doing two logically different things. i.e. in one you're colorizing renegotiation, and in the other you're colorizing crime
AlexRussia has joined #ruby
<unshadow> godd2, ok , cool :)
<godd2> I mean, yes there's probably room for some abstraction here, but as long as this works it looks okay
lxsameer has quit [Quit: Leaving]
elaptics`away is now known as elaptics
matcouto has joined #ruby
<godd2> shevy L)
<godd2> :)*
techsethi has joined #ruby
Guest6439 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_5kg has quit [Ping timeout: 256 seconds]
sigurding has joined #ruby
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
<shevy> I have to read up on audio theory before I can even understand anything
<shevy> all I know... the higher the frequency, the faster it swings right?
spastorino has joined #ruby
kevinxu has joined #ruby
<godd2> and it dont mean a thing if it aint got that swing
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alex88 has joined #ruby
kevinxu is now known as Guest90344
joonty has joined #ruby
ctp has joined #ruby
olivier_bK has joined #ruby
ixti has joined #ruby
kumarat9pm has quit [Ping timeout: 240 seconds]
ChoiKyuSang has joined #ruby
duncannz has quit [Remote host closed the connection]
mkrank has joined #ruby
AliRezaTaleghani has joined #ruby
Olivertynes has joined #ruby
RitterJack has quit [Ping timeout: 245 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
Joufflu has quit [Ping timeout: 258 seconds]
kumarat9pm has joined #ruby
d4nku has joined #ruby
sdwrage has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
cajone has quit [Ping timeout: 245 seconds]
jlast has quit [Ping timeout: 258 seconds]
vieq has quit [Ping timeout: 272 seconds]
sdwrage has quit [Client Quit]
vieq has joined #ruby
bMalum has joined #ruby
gregoriokusowski has joined #ruby
techsethi has quit [Quit: techsethi]
msgodf has joined #ruby
teddyp1cker has joined #ruby
d4nku has quit [Ping timeout: 264 seconds]
unshadow has quit [Quit: leaving]
<zenspider> godd2: aye
<zenspider> all the midi libs have either fallen into disrepair or suck
bergelmir has joined #ruby
dangerousdave has joined #ruby
dangerousdave has quit [Client Quit]
giuseppesolinas has joined #ruby
<zenspider> I was hacking with dean hudson and he got me hooked up doing CoreAudio on osx, so then I just generated notes via sine waves and a lookup table
<zenspider> but it was tedious and felt wrong
<bergelmir> can someone tell me how to do a "curl -4 <host>" (resolve only ipv4 addresses) with net::http?
<zenspider> tho he did use my code to hook it up to an ipad keyboard for remote playing
<godd2> zenspider lookup tables is the way to go for pcm.
hmsimha_ has quit [Ping timeout: 255 seconds]
<zenspider> my code was shite. and/or coreaudio had some jitter
<zenspider> I tend to believe it was my code until proven otherwise :)
teddyp1cker has quit [Ping timeout: 256 seconds]
wolflee has quit [Quit: (null)]
elcheckito has joined #ruby
RitterJack has joined #ruby
narcan has joined #ruby
Juanchito has joined #ruby
<godd2> I do need to learn CoreAudio. I have integration of windows multimedia and ALSA on linux, but hopefully I'll get the core of my gem to a point where someone can code their own interface :P
wolflee has joined #ruby
jheg has joined #ruby
mikepack has joined #ruby
<zenspider> ok. I should sleep
<zenspider> far too early, but the conf demands
bMalum has quit [Ping timeout: 244 seconds]
neoxquick has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
omosoj has quit [Ping timeout: 264 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
BTRE has joined #ruby
corehook has quit [Remote host closed the connection]
corehook has joined #ruby
corehook has quit [Remote host closed the connection]
cek has joined #ruby
elcheckito has quit [Ping timeout: 264 seconds]
<cek> how do i set a future breakpoint in byebug?
mikepack has quit [Ping timeout: 272 seconds]
d4nku has joined #ruby
rylev has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<cek> oh, seems supplying full path is enough
thsig has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
thsig_ has joined #ruby
narcan has joined #ruby
<olivier_bK> hy all
d4nku has quit [Ping timeout: 256 seconds]
hmsimha_ has joined #ruby
iinzg has quit [Read error: Connection reset by peer]
elcheckito has joined #ruby
thsig has quit [Read error: Connection reset by peer]
BTRE has quit [Quit: Leaving]
AlSquire has joined #ruby
BTRE has joined #ruby
cassianoleal has joined #ruby
iinzg has joined #ruby
BTRE has quit [Client Quit]
AlSquire has quit [Client Quit]
iinzg has quit [Read error: Connection reset by peer]
<cek> hmm, it still outputs 2 empty lines
cek has left #ruby [#ruby]
iinzg has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
nagaraj has joined #ruby
iinzg has quit [Max SendQ exceeded]
t_p has quit [Quit: Computer has gone to sleep.]
_5kg has joined #ruby
rdark_ has joined #ruby
iinzg has joined #ruby
Spami has joined #ruby
rdark has quit [Ping timeout: 245 seconds]
govg has quit [Quit: leaving]
iinzg has quit [Read error: Connection reset by peer]
cek has joined #ruby
ctp has joined #ruby
<cek> $ byebug mco -- mcb --clear-expired -I /xxx/ --np
<cek> (byebug) info args => empty
AlSquire has joined #ruby
BTRE has joined #ruby
<cek> and when program is run, it's like to ARGV is supplied :/
jlast has joined #ruby
lkba has quit [Ping timeout: 244 seconds]
mengu has quit [Remote host closed the connection]
gaussblurinc1 has joined #ruby
thsig_ has quit [Remote host closed the connection]
rshetty has joined #ruby
d4nku has joined #ruby
<cek> had to ARGV.shift in order for that program to work flawlessly... hmmm
marr has joined #ruby
thsig has joined #ruby
charliesome has joined #ruby
AFKGeek has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Guest2671 has quit [Quit: This computer has gone to sleep]
corehook has joined #ruby
vimer_ has quit [Ping timeout: 250 seconds]
mkaesz has joined #ruby
jdj_dk has joined #ruby
rodfersou has joined #ruby
thsig has quit [Ping timeout: 265 seconds]
vimer has joined #ruby
cassianoleal has quit [Read error: Connection reset by peer]
jdj_dk has quit [Remote host closed the connection]
Guest2671 has joined #ruby
drawingthesun has quit [Read error: Connection reset by peer]
sprihodko has joined #ruby
bergelmir has quit [Quit: leaving]
n008f4g_ has joined #ruby
d4nku has quit [Ping timeout: 240 seconds]
jlast_ has joined #ruby
rshetty has quit [Ping timeout: 244 seconds]
AmBienCeD has joined #ruby
drawingthesun has joined #ruby
Guest90344 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jackmanarakat> can you convert an array to string?
<apeiros> jackmanarakat: sure
<apeiros> see Array#join and #inspect
jlast has quit [Ping timeout: 258 seconds]
<jackmanarakat> def titleize(word) word = word.split capitalize = word.to_s.capitalize capitalize end
<jackmanarakat> why isn't that working?
<apeiros> because you're doing it wrong
<jackmanarakat> what am i doing wrong?
<apeiros> what doesn't work?
<jackmanarakat> it's still an array
<Olivertynes> eval("@codeblock = lambda { |event| #{@code} }", binding, "(ruby filter code)") <--- even is a hash
<Olivertynes> should I be able to do something with event object inside the @code ?
jlast_ has quit [Ping timeout: 258 seconds]
<apeiros> jackmanarakat: no
<apeiros> >> [1,2,3].to_s
<eval-in__> apeiros => "[1, 2, 3]" (https://eval.in/222352)
<apeiros> that's a string
<Olivertynes> I am doing event['foo'] = "bar"
<apeiros> to_s is the same as inspect. use join.
cassianoleal has joined #ruby
<jackmanarakat> how can i make it capitalize two words?
<Olivertynes> code => "event['logmsg'].try{ |logmsg| logmsg.scan(/([\w-]+)=\"([^\\\"]+)\"/).map { |res| event['kv_' + res[0]] = res[1]}}"
<Olivertynes> that gives nothing on the event hash
<jackmanarakat> holy sshit
reinaldob has joined #ruby
<Olivertynes> but if I try in the repl with event = {} and a sample logmsg
MattB2 has joined #ruby
<Olivertynes> it works just fine
<Olivertynes> trying to figure out if I have to grab the event some other way maybe
* Olivertynes not a ruby expert
<jackmanarakat> Olivertynes: what is this sequence of characters mean (/([\w-]+)=\"([^\\\"]+)\"/)
MattB2 has quit [Client Quit]
<Olivertynes> its a regexp, with some extra escaping
<Olivertynes> the regexp is just fine, it simply matches a group of arrays
<jackmanarakat> what would you use it for?
<Olivertynes> its a key="random value" splitter
<Olivertynes> basically, I have a list of lists
<jackmanarakat> what does it do?
<Olivertynes> it takes Event="Message Sent" Service="H.225" Message-type="NST" Src-ip="85.1...<snip>
doev has joined #ruby
<jackmanarakat> how did you know to use those particular characters?
<apeiros> Olivertynes: did you properly escape? because remember, "\\" is a single backslash
<workmad3> jackmanarakat: because he learned regexp? :P
<jackmanarakat> oh
<Olivertynes> and makes it a list of lists per key/value
<jackmanarakat> i have no idea waht regexp is
<Olivertynes> apeiros: I tested it in a repl, and it matches just fine
<apeiros> Olivertynes: then your problem is elsewhere
<Olivertynes> indeed
<jackmanarakat> i'm so fucked... i am starting a bootcamp in a couple weeks and i don't feel ready
<jackmanarakat> >=(
<jackmanarakat> i mean <=*(
<Olivertynes> the code in logstash that runs this
<Olivertynes> is eval("@codeblock = lambda { |event| #{@code} }", binding, "(ruby filter code)")
<Olivertynes> should I be able to affect event inside the lambda?
<Olivertynes> @code == event['logmsg'].try{ |logmsg| logmsg.scan(/([\w-]+)=\"([^\\\"]+)\"/).map { |res| event['kv_' + res[0]] = res[1]}}
drawingthesun has quit [Quit: Leaving]
Duckily has joined #ruby
techsethi has joined #ruby
<Duckily> anyone know why rails might be rendering json inside of html template? its a failrly new app but let me know if you would like something pastied
razieliyo has joined #ruby
razieliyo has joined #ruby
<apeiros> Duckily: #rubyonrails
<Duckily> whoops sorry wrong channel
<Duckily> stupid irc client
Takle has quit [Remote host closed the connection]
<jackmanarakat> has anyone been to a programming bootcamp?
d4nku has joined #ruby
dangerousdave has joined #ruby
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
<mnemon> jackmanarakat: what's that?
<jackmanarakat> what do you mean mnemon
<mnemon> what is a programming bootcamp?
<mnemon> what do you do there etc.
Takle has joined #ruby
<Abhijit> where boots are thrown at programmers who dont program good.
<mnemon> :)
<jackmanarakat> mnemon: it's a super intensive 12 week rails course
<jackmanarakat> by some divine miracle i managed to get accepted
<jackmanarakat> but i don't feel like i'm ready because i cheated on the homework
<jackmanarakat> by looking at the answers
<jackmanarakat> :(
reinaldob has quit [Remote host closed the connection]
stef204 has joined #ruby
ldnunes has joined #ruby
davidhq has joined #ruby
vimer has quit [Quit: leaving]
havenwood has quit [Remote host closed the connection]
ctp has joined #ruby
tkuchiki has quit [Remote host closed the connection]
ctp has quit [Client Quit]
tkuchiki has joined #ruby
reinaldob has joined #ruby
codecop has joined #ruby
hanmac1 has joined #ruby
thsig has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
tvw has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
St1gma has joined #ruby
<jmdade> jackmanarakat: I did one many years ago. Just make sure you get the pre-reading done and expect 12 very long hard weeks. You'll be fine then.
tkuchiki has quit [Ping timeout: 250 seconds]
<jackmanarakat> jmdade: i cheated on the prereading
<jackmanarakat> actually i have an assignment due today and i am cheating on it :(
<jmdade> I hope your tutors aren't in here then ;)
<jackmanarakat> i did manage to get some things right by myself, do you think i'm not cut out to be a programmer?
<jmdade> I think you should put the effort into catching up. Maybe 'fess up to the tutors and see if they can help you catch up? I don't see why you'd be any less a programmer for this, but a good grounding will help you be successful.
hiyosi has joined #ruby
tokik has quit [Ping timeout: 240 seconds]
<jackmanarakat> jmdade: the bootcamp hasn't started yet, it's just the required readings and prepwork that i'm cheating on now
<jmdade> In my opinion you are only cheating yourself there. It'll make the actual camp much harder than you need it to be.
st1gma1 has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
<jackmanarakat> oh boy... it's not that i want to cheat, it's that i don't understand how it's done
<jackmanarakat> so i take a peek and memorize the solution
<jackmanarakat> maybe that's a terrible approach
rshetty has joined #ruby
<jmdade> This is probably too off topic for this channel, PM me.
<jackmanarakat> thank you
<workmad3> jackmanarakat: that's how most people start learning... but it's important to not just memorize solutions but to actually figure them out once you've looked at it
Macaveli has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
<jackmanarakat> workmad3: a few things i do not understand when i looked up the answers, but i did for others
tlarevo has joined #ruby
st1gma1 has quit [Read error: Connection reset by peer]
hiyosi has quit [Ping timeout: 272 seconds]
st1gma1 has joined #ruby
<ccooke> jackmanarakat: Chances are, you won't be the only person who looked at the answers to get in. Try going through them and trying to work out *why* the solutions work
<ccooke> then see if you can find similar problems to solve online
<jheg> o/
<jackmanarakat> wow thank you
<ccooke> jackmanarakat: that doesn't mean it's a good thing to do, because you *will* have made it harder for yourself
jackmanarakat_ has joined #ruby
<jackmanarakat_> ccooke: i hope you're right about me not being the only one that's cheating
<jackmanarakat_> hello???
<ccooke> jackmanarakat_: I'm at work :-)
eka has joined #ruby
<jackmanarakat_> oh sorry guys
<ccooke> currently about to join a conference call
<jackmanarakat_> something is wrong with my connection
<jheg> trying to better understand getts and setters and something im not sure of is how these two bits of code really differ as they both seem to do the same .. https://gist.github.com/jheg/61e2961150e564d92ca3
<jheg> *getters
jackmanarakat has quit [Ping timeout: 246 seconds]
n008f4g_ has quit [Ping timeout: 245 seconds]
<jackmanarakat_> jheg: that's what i don't like about ruby, the semantics are not beginner friendly
<ccooke> jackmanarakat_: Good luck. I'm unlikely to be aroundd now. Moving a datacentre.
<jackmanarakat_> there are far too many ways to do the same thing which to me is very confusing
mathias2 has quit [Ping timeout: 240 seconds]
<jheg> I’m not so sure - I think it’s very beignner friendly
<jackmanarakat_> ccooke: i wish you the best of luck!
<jheg> v easy to read compared to other languages I’ve seen :)
<cek> there's no language better than javascript
<jheg> sorry the calls were back to front … https://gist.github.com/jheg/65cb55ecd3c4b45c3eb7
<jackmanarakat_> every time i program something and i show my code to someone they always tell me ways of improving it
<jackmanarakat_> so that's what i don't get
<jheg> there are many ways to achieve the same thing
<jackmanarakat_> we have many ways of doing something in ruby, but only one right way
<hanmac1> jheg interesting might be the possible return value
<jheg> its a case of learnign to write efficient code I guess
<jackmanarakat_> why not learn the right way to begin with
<jheg> there is no /right/ way as suc h
<hanmac1> jheg the second one in your sample should return self
<apeiros> jheg: bah, my way is the right way :-p
Hobogrammer has quit [Ping timeout: 244 seconds]
<cek> my way on the highway
<cek> jheg: why would you be bothered with specifics, use what's more comfortable for you
<jheg> doesnt the first one also return self hanmac1 ?
mengu has joined #ruby
<hanmac1> jheg: no, none of them does return self in your sample
mengu has quit [Changing host]
mengu has joined #ruby
<jheg> cek: I only want to ensure that I’m not forcing something through when there might be a better way
<jackmanarakat_> http://pastie.org/9724878
<cek> you'll never find the best way, just do the work
<jackmanarakat_> this is a very simple example
<jackmanarakat_> it's not the best example but i think you'll get the point
fgo has joined #ruby
samflores has left #ruby [#ruby]
<hanmac1> jheg: obj.name= value always return value, only obj.send(:name=, value) MIGHT return something different
<jheg> jackmanarakat_: sorry what does that example illustrate?
st1gma1 has quit [Read error: Connection reset by peer]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
st1gma1 has joined #ruby
<jackmanarakat_> jheg: the complexity of the ruby language
<jackmanarakat_> you can do things more than one way
<jackmanarakat_> which is very confusing to me
Bira has joined #ruby
<jheg> hanmac1: thanks
dangerousdave has quit [Ping timeout: 244 seconds]
<jheg> jackmanarakat_: those two examples just look like you’ve given your vars different names though?
<apeiros> jackmanarakat_: doesn't mean you have to learn all the ways at once
<jackmanarakat_> well it's a terrible example
<jheg> :)
<jackmanarakat_> but i hate how there is more than one way of doing it
<jackmanarakat_> if vs when while vs until and so on
<jheg> imagine if there wasn’t that would be worse
<jackmanarakat_> :(
arup_r has joined #ruby
jlast has joined #ruby
airdeluxe has quit [Ping timeout: 250 seconds]
spyderman4g63 has joined #ruby
<apeiros> jackmanarakat_: maybe look into python then. they pride themselves with having "the one way"
nfk has joined #ruby
<jackmanarakat_> apeiros: well i have to learn ruby for rails and i like the syntax of ruby much better
<jheg> where you learning jackmanarakat_ ?
shemerey has joined #ruby
<jackmanarakat_> i'm going to be going to a bootcamp which i feel totally unprepared for
<arup_r> I have series of items wc:product:meta:b06a053f31c8b737e5c93c1d8c, wc:product:b06a053f31c8b737e5c93c1d8c , wc:product:b06a053f31c8b737e5c93c1d8c .... Where I want to filter only values where **meta** is not present..using Regex. How to do so ?
<jheg> class based or online?
<jheg> i’m currently doing an online one hence my interest
<arup_r> I tried \Awc:product: ... But it is not correcr'
spyderman4g63 has quit [Client Quit]
<jheg> in fact having spent the past couple of months doing one day a week and the occasional evening i’ve taken 3 months off work starting today to get stuck into the online one im doing
jdj_dk has joined #ruby
<hanmac1> arup_r: huch what kind of fomat is that?
<arup_r> It is a id number
<jackmanarakat_> jheg: it's live :)
<jackmanarakat_> i'm flying there in a few weeks
<jheg> hanmac1: Would I be correct in saying that the first example in my code is a setter method but the second is not?
<jheg> nice one
shemerey has quit [Client Quit]
<jheg> live would have been my first choice but the cost was 5 to 10 times that of an online solution and plus it would have been too much time away from gf and kids :(
t_mmyv has joined #ruby
<arup_r> hanmac1: I want to filter only where meta is not present in the number
<hanmac1> arup_r:
<hanmac1> >> "wc:product:meta:b06a053f31c8b737e5c93c1d8c, wc:product:b06a053f31c8b737e5c93c1d8c , wc:product:b06a053f31c8b737e5c93c1d8c".split(",").map(&:strip).select {|s| s !~ /meta/ }
<eval-in__> hanmac1 => ["wc:product:b06a053f31c8b737e5c93c1d8c", "wc:product:b06a053f31c8b737e5c93c1d8c"] (https://eval.in/222390)
<arup_r> Yes...
<arup_r> Thanks hanmac1
jlast has quit [Ping timeout: 258 seconds]
shemerey_ has joined #ruby
iwishiwerearobot has joined #ruby
crazydiamond has joined #ruby
jdj_dk has quit [Ping timeout: 272 seconds]
ChoiKyuSang has quit [Ping timeout: 240 seconds]
shemerey_ has quit [Client Quit]
jeanlinux has joined #ruby
startupality has joined #ruby
teddyp1cker has joined #ruby
Guest2671 has quit [Quit: This computer has gone to sleep]
mathias2 has joined #ruby
jeanlinux has quit [Remote host closed the connection]
<hanmac1> jheg: hm yes and no ... ruby does not have extra "setter methods" ... only the parser does return always val when the function is called as obj.name = val .... like as i said if you call the function with send it does not always return val
fabrice31 has quit [Remote host closed the connection]
Morkel_ has joined #ruby
<Olivertynes> https://github.com/elasticsearch/logstash/blob/master/lib/logstash/event.rb#L138 this means I can do event['foo'] = "bar" right? def []= means implementation of bracket syntax?
unclouded has quit [Ping timeout: 244 seconds]
Morkel has quit [Ping timeout: 272 seconds]
Morkel_ is now known as Morkel
zarubin has joined #ruby
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<jheg> nice one thanks hanmac1
teddyp1cker has quit [Ping timeout: 272 seconds]
<hanmac1> jheg see what i mean with return value:
<hanmac1> >> def name=(val); return "woot";end; p self.name = "hey", self.send(:name=,"boo")
<eval-in__> hanmac1 => "hey" ... (https://eval.in/222397)
mikepack has joined #ruby
tgandrews has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
gaussblurinc1 has joined #ruby
sigurding has quit [Quit: sigurding]
mikepack has quit [Ping timeout: 240 seconds]
stef204 has joined #ruby
mozzarella has quit [Ping timeout: 240 seconds]
vinleod has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sk87 has joined #ruby
corehook has quit [Remote host closed the connection]
corehook has joined #ruby
corehook has quit [Remote host closed the connection]
Macaveli has joined #ruby
dangerousdave has joined #ruby
ikaros has joined #ruby
oculus has joined #ruby
fabrice31 has joined #ruby
borkdude has joined #ruby
glaksmono has quit [Quit: This computer has gone to sleep]
<borkdude> What ruby mode do people here use? My default ruby mode indents deeper than the code written in vim by my colleague
<borkdude> for emacs I mean
elaptics is now known as elaptics`away
scottymeuk has joined #ruby
corehook has joined #ruby
elaptics`away is now known as elaptics
<txdv> what is a ruby mode?
blackmesa has joined #ruby
atmosx has quit [Remote host closed the connection]
atmosx has joined #ruby
BlackGear has joined #ruby
agjacome has joined #ruby
iinzg has joined #ruby
vimer has joined #ruby
mozzarella has joined #ruby
Takle has quit [Read error: Connection reset by peer]
jeanlinux has joined #ruby
zarubin has quit [Quit: Leaving.]
Fusl has quit [Ping timeout: 245 seconds]
Takle has joined #ruby
zarubin has joined #ruby
<zmyrgel> borkdude: why don't you just configure the ruby-mode indentation?
zarubin has quit [Client Quit]
<zmyrgel> any suggestions on tools to use to make small web application on windows server?
kirun has joined #ruby
<zmyrgel> I have very limited windows experience but I thought to use ruby as language
<zmyrgel> the application itself would be single web page where you could upload xml file
<zmyrgel> it would then take the xml, make soap request to another service and return the result to caller
gaussblurinc1 has quit [Quit: Leaving.]
gaussblurinc1 has joined #ruby
parzzix has quit [Ping timeout: 244 seconds]
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
Macaveli has joined #ruby
shazaum has joined #ruby
Fusl has joined #ruby
sigurding has joined #ruby
<zmyrgel> mainly interested on what application server to use
<zmyrgel> preferable something that I can deploy on Centos7 and Windows so I can devel on my laptop and deploy to our Windows box
unclouded has joined #ruby
Takle has quit [Remote host closed the connection]
cleopatra has quit [Ping timeout: 272 seconds]
Axy has quit [Read error: Connection reset by peer]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
narcan has joined #ruby
techsethi has quit [Quit: techsethi]
<jheg> should attr_* only be used when you ONLY need to either return the instance variable or set the instance variable but anything else the method should be written into the class seperately?
nagaraj has quit [Ping timeout: 255 seconds]
<jheg> for example if as part of an objects instantiation a code is assigned to @special_code but at no point would I want that info to be read I should create a method that hides part of the @special_code rather than using attr_*
toertore has joined #ruby
<jhass> jheg: attr_reader :foo is a shortcut to writing def foo; @foo; end;. attr_writer :foo is a shortcut to writing def foo=(v); @foo = v; end; attr_accessor is a shortcut to writing attr_reader :foo; attr_writer :foo; That's all there is to it
phutchins has joined #ruby
nagaraj has joined #ruby
jlast has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
mkaesz has quit [Ping timeout: 240 seconds]
agit0 has joined #ruby
tlarevo has quit [Ping timeout: 265 seconds]
Takle has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
sprihodko has quit [Quit: (null)]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tgandrews has quit [Quit: tgandrews]
ndrei has joined #ruby
jackmanarakat_ has quit [Quit: Page closed]
Mateon2 is now known as Mateon1
agjacome has quit [Quit: leaving]
agjacome has joined #ruby
agjacome has quit [Client Quit]
Takle_ has joined #ruby
tkuchiki has joined #ruby
Takle has quit [Read error: Connection reset by peer]
<jheg> thanks jhass I was kind of hoping that would be the reply :)
jlast has quit [Ping timeout: 258 seconds]
tvw has quit []
tvw has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
hiyosi has joined #ruby
nagaraj has quit [Quit: nagaraj]
mathias2 has quit [Read error: Connection reset by peer]
mathias3 has joined #ruby
arup_r has quit [Remote host closed the connection]
maasha has joined #ruby
<maasha> Converting numbers into string string representation of equal length with leading zeros:
<maasha> "%05b" % 690
<maasha> -> "1010110010", however,
hiyosi has quit [Ping timeout: 240 seconds]
<maasha> oh, sod it.
AliRezaTaleghani has quit [Ping timeout: 245 seconds]
corehook has quit [Remote host closed the connection]
<apeiros> was that a question?
<maasha> "%10b" % 156 -> " 10011100" where is my leading zeros?
wpp has joined #ruby
<apeiros> you didn't specify you wanted leading zeros
<apeiros> just padding
<apeiros> %010b
max96at|off is now known as max96at
<apeiros> >> "%010b" % 156
<eval-in__> apeiros => "0010011100" (https://eval.in/222434)
wpp has quit [Max SendQ exceeded]
<maasha> ah, stupid me. thanks
Bira has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
mkaesz has joined #ruby
wpp has joined #ruby
st1gma1 has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
tlarevo has joined #ruby
mengu has joined #ruby
Takle_ has quit [Remote host closed the connection]
anaeem1 has quit [Remote host closed the connection]
<jheg> anyone good with regex - i need to get the last 3 characters of a string
claptor has quit [Quit: this channel is bakas]
<godd2> try /.{3}$/
<godd2> though I am obligated to ask why you want the last 3 chars of a string
FooMunki has joined #ruby
<jheg> I don’t :)
<gregf_> >> "hello" =~ /(.{3})$/
<eval-in__> gregf_ => 2 (https://eval.in/222435)
<jheg> Just learning how to do something
<gregf_> >> "hello" =~ /(.{3})$/; puts $1
<eval-in__> gregf_ => llo ... (https://eval.in/222437)
<jhass> foo[-3, 3]
<jhass> no need for regex
<gregf_> yeah :/
<apeiros> was just gonna ask the same :)
corehook has joined #ruby
<jmdade> and that matches more characters too.
jds has joined #ruby
jlast has joined #ruby
Bira has joined #ruby
jeanlinux has quit [Remote host closed the connection]
oo_ has joined #ruby
AliRezaTaleghani has joined #ruby
<jheg> thanks all the course I’m following was giving an example of when you would want to conceal part of a string
<jheg> in the case of a social number this example was given ...
<jheg> 'xxx-xx-' + @ssn.split('-').last
<jhass> use #{}
<jheg> that’s what lead me to looking at doing it with regex
fgo has quit [Quit: WeeChat 1.0]
<godd2> ('-')
<godd2> d('-'d)
<jheg> “xxx-xx-#{@ssn.split(‘-‘).last}”
<jheg> ^ like that jhass ?
zarubin has joined #ruby
Takle has joined #ruby
<jhass> yes
elcheckito has quit [Ping timeout: 264 seconds]
<jheg> ok cool
jlast has quit [Ping timeout: 258 seconds]
dkphenom has joined #ruby
shemerey has joined #ruby
<godd2> seems like an odd place to be splitting an ssn string. consider altering you code to where @ssn.last already returns the last 4
arup_r has joined #ruby
<jheg> what you mean godd2 ?
<godd2> like in the initializer, make @ssn = ssn.split('-'). plus that way you can think about validating in the same logical area
<godd2> but that's a design choice I leave to you :)
<jheg> but then where would the actuall number be stored?
<godd2> in the resulting array
gerep has joined #ruby
<godd2> >> "123-456-7890".split('-')
<eval-in__> godd2 => ["123", "456", "7890"] (https://eval.in/222440)
<jheg> oh yes I see nice tip
jeanlinux has joined #ruby
<jheg> easier to reference it then as well I suppose right?
c0def00d has joined #ruby
c0def00d has quit [Client Quit]
<jheg> ssn[-1]
<gerep> Hi all. I'm using system('serf agent') to run my serf instance. $? should return this "serf aget" pid?
blackmesa has quit [Ping timeout: 272 seconds]
<godd2> that's my thinking. but of course, there are many ways to do it
mmozuras has joined #ruby
vimer has quit [Quit: leaving]
<godd2> jheg or better yet, @ssn.last
<jhass> gerep: yes
<jhass> unless it double forks or something like that
vt102 has joined #ruby
<jheg> cool ta
<gerep> Because when I try to get the PID is returns a different number, always one lower like $?.id = 20210, ps aux | grep serf = 20211
<mostlybadfly> Good morning all
doodlehaus has joined #ruby
<jhass> gerep: does it daemonize?
<ta> jheg: thanks
<jheg> lol
<gerep> jhass: I'm running it like this: `serf agent -rpc-addr=127.0.0.1:8087 >/dev/null 2>&1`
<jhass> gerep: consider using Kernel#spawn for that behavior
<gerep> jhass: otherwise it would stop in the serf process
paulfm has joined #ruby
<workmad3> jheg: I'd expect it does... otherwise the system call would block until it had finished :)
<gerep> jhass: ok, thanks a lot :)
echooo1 has quit [Quit: echooo1]
govg has joined #ruby
<workmad3> *jhass ^^ (sorry jheg)
<jhass> gerep: this way you spawn a shell and I guess you get the pid of that one
paulfm has quit [Client Quit]
<godd2> jheg If I saw the code "xxx-xx-#{@ssn.last}" it would be much easier to read
<gerep> jhass: ok, I'm reading about it now =)
tlarevo has quit []
dj_zubehoer has joined #ruby
doodlehaus has quit [Remote host closed the connection]
<jheg> very true
NoNMaDDeN has joined #ruby
<gerep> jhass: still different pid :(
Rx_o has joined #ruby
<jhass> are you sure it doesn't fork?
ThaDick has joined #ruby
<jhass> or do you still do the >/dev/null ?
<godd2> jheg of course, the tradeoff here is that if you want to display the entire social, you have to reconstruct it, but the solution there is to make a class for SSN that does that sort of stuff for you. as I said, its a design decision.
n008f4g_ has joined #ruby
<gerep> jhass: pid = spawn('serf agent -rpc-addr=127.0.0.1:8087 &')
mmozuras has quit [Remote host closed the connection]
<jhass> gerep: read up what spawn does again
<jhass> remove that &
corehook has quit [Remote host closed the connection]
mmozuras has joined #ruby
<jhass> and use an absolute path
renderful has joined #ruby
<gerep> jhass: damn, yes, forgot that little guy there
<gerep> jhass: thanks a lot for your time :)
krz has joined #ruby
<jheg> godd2: now your jus trying to mess with my mind
<jheg> but yeah I get it I need to think about the data im capturing and where it may need to be used before deciding how to store it
techsethi has joined #ruby
<godd2> jheg no haha, I'm just opening your eyes to the expressive powers of ruby :)
Rx_o has quit [Client Quit]
<jheg> ha really appreciate it thanks :)
mmozuras has quit [Client Quit]
<gerep> jhass: is there a way to check when all my tests are done? So I can run a system('kill') on that process?
mmozuras has joined #ruby
aclearman037 has joined #ruby
<jhass> I don't know, is there?
<jhass> that's specific to whatever you're doing
<jhass> use Process.kill to kill a process
<jhass> use Process.wait to wait for its termination
krz has quit [Client Quit]
<gerep> jhass: ok, thanks again :)
krz has joined #ruby
<apeiros> Process.kill is actually to send signals
St1gma has quit [Read error: Connection reset by peer]
rudisimo has joined #ruby
<apeiros> one of the signals is sigterm
renderful has quit [Ping timeout: 244 seconds]
<txdv> terminal signal
St1gma has joined #ruby
rshetty has quit [Ping timeout: 250 seconds]
mmozuras has quit [Client Quit]
mmozuras has joined #ruby
Duckily has quit [Quit: Duckily]
workmad3 is now known as wm3|away
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
rudisimo has quit [Remote host closed the connection]
aspiers has quit [Ping timeout: 250 seconds]
livathin_ has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
vimer has joined #ruby
Takle has quit [Remote host closed the connection]
parzzix has joined #ruby
teddyp1cker has joined #ruby
dj_zubehoer has quit [Remote host closed the connection]
artm has quit [Ping timeout: 258 seconds]
sjohnsen has quit [Ping timeout: 260 seconds]
gregoriokusowski has quit [Quit: gregoriokusowski]
Toad` has quit []
livathinos has joined #ruby
tesuji has quit [Ping timeout: 265 seconds]
teddyp1cker has quit [Ping timeout: 264 seconds]
rudisimo has joined #ruby
sjohnsen has joined #ruby
rudisimo has quit [Remote host closed the connection]
ChanderG has joined #ruby
ChoiKyuSang has joined #ruby
hiyosi has joined #ruby
jespada has joined #ruby
mikepack has joined #ruby
Bira has quit [Remote host closed the connection]
stef_204 has joined #ruby
aspiers has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
[stef_204] has joined #ruby
stef204 has quit [Ping timeout: 245 seconds]
psy_ has quit [Ping timeout: 265 seconds]
mikepack has quit [Ping timeout: 272 seconds]
luksaur has joined #ruby
luksaur has joined #ruby
stef_204 has quit [Ping timeout: 256 seconds]
artm has joined #ruby
xymbol has quit [Quit: Be back later ...]
St1gma has quit [Read error: Connection reset by peer]
stef204 has joined #ruby
St1gma has joined #ruby
at284km has joined #ruby
[stef_204] has quit [Ping timeout: 244 seconds]
anaeem1_ has joined #ruby
Guest7 has joined #ruby
Guest7 has quit [Max SendQ exceeded]
stef_204 has joined #ruby
AlexRussia has joined #ruby
Bira has joined #ruby
at284km has quit [Client Quit]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
sdwrage has joined #ruby
at284km has joined #ruby
xymbol has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
gaussblurinc1 has joined #ruby
stef204 has quit [Ping timeout: 255 seconds]
at284km has quit [Client Quit]
sdwrage has quit [Client Quit]
anaeem1_ has quit [Ping timeout: 240 seconds]
ta has quit [Remote host closed the connection]
ChanderG has quit [Quit: Page closed]
anaeem1 has joined #ruby
lolmaus has quit [Ping timeout: 240 seconds]
lolmaus has joined #ruby
gogiel has quit [Ping timeout: 264 seconds]
procat has quit [Ping timeout: 256 seconds]
xymbol has quit [Ping timeout: 264 seconds]
tvw has quit []
ARCADIVS has quit [Quit: ARCADIVS]
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
arup_r has quit [Remote host closed the connection]
jlast has joined #ruby
tier has joined #ruby
cajone has joined #ruby
HayesHimself has joined #ruby
dh64 has quit [Quit: Konversation terminated!]
gaussblurinc1 has quit [Quit: Leaving.]
rshetty has joined #ruby
gaussblurinc1 has joined #ruby
jeanlinux has quit []
anaeem1 has quit [Remote host closed the connection]
kp666 has quit [Remote host closed the connection]
sddssd has joined #ruby
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
Takle has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
hamakn has quit [Ping timeout: 240 seconds]
<alex88> I might be tired, but looking at https://gist.github.com/alex88/c3b72741bec0ee5ef25f following example http://activeadmin.info/docs/12-arbre-components.html#table_for I don't see the error
thsig has quit [Remote host closed the connection]
sddssd has quit [Quit: Page closed]
henesy has joined #ruby
<alex88> what's wrong?
mesamoo has joined #ruby
jmdade has quit [Quit: Textual IRC Client: www.textualapp.com]
techsethi has quit [Quit: techsethi]
vimer has quit [Ping timeout: 255 seconds]
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<teotwaki> alex88: missing comma between 'Dashboards' and the dictionary
<teotwaki> err, block.
DaniG2k has joined #ruby
psy_ has joined #ruby
<DaniG2k> I'm trying to set up friendly_id. I have a model with section:string title:string and I want to get my urls to look like host/section/title
<DaniG2k> I've run the migrations, blah blah
<alex88> teotwaki: mmhh it gives another error
<alex88> using the do block syntax it works
doodlehaus has joined #ruby
<alex88> anyway, thanks!
<DaniG2k> and for now, in my model.rb I am just trying with friendly_id :title, use: :slugged
<DaniG2k> to see if it works
<DaniG2k> but I can't see the slugged urls
sigurding has quit [Quit: sigurding]
<apeiros> DaniG2k: wrong channel?
Takle has quit [Remote host closed the connection]
jimbach_ has joined #ruby
<DaniG2k> oh damn
<DaniG2k> oops
<DaniG2k> i thought i typed /join #rubyonrails
<DaniG2k> nm sorry guys
adriancb has joined #ruby
rodfersou has quit [Read error: Connection reset by peer]
rodfersou has joined #ruby
dmyers has joined #ruby
postmodern has quit [Remote host closed the connection]
unclouded has quit [Ping timeout: 265 seconds]
jmdade has joined #ruby
Takle has joined #ruby
tus has joined #ruby
AlexRussia has quit [Quit: WeeChat 1.1-dev]
josephndenton has joined #ruby
AlexRussia has joined #ruby
doodlehaus has quit [Remote host closed the connection]
Gadgetoid has quit [Ping timeout: 272 seconds]
livingstn has joined #ruby
<shevy> red alert!
<shevy> rails is leaking!!!
<shevy> onto #ruby!
stef204 has joined #ruby
<shevy> txdv, raise the shields
lektrik has joined #ruby
<apeiros> >> raise Shields
<eval-in__> apeiros => uninitialized constant Shields (NameError) ... (https://eval.in/222447)
ChoiKyuSang has quit [Ping timeout: 256 seconds]
<apeiros> d'oh
crazed_ is now known as crazed
allcentury has joined #ruby
<banister> >> raise Shields = Exception
<eval-in__> banister => Exception (Exception) ... (https://eval.in/222448)
zarubin has quit [Quit: Leaving.]
<banister> apeiros lord knows when the cold wind blows it'll turn your head around
henesy has quit [Ping timeout: 256 seconds]
<banister> apeiros is it cold there in switz
doodlehaus has joined #ruby
<godd2> Strictly Ruby off da railzz here
<apeiros> define cold. need to wear my jacket & cap now.
henesy has joined #ruby
Gadgetoid has joined #ruby
jerius has joined #ruby
iamjarvo has joined #ruby
tier_ has joined #ruby
<banister> apeiros do you enjoy your swiss winters
<apeiros> not much, no. I'm not a winter guy.
rudisimo has joined #ruby
sigurding has joined #ruby
<shevy> but you are surrounded by mountains!
ndrei has quit [Ping timeout: 272 seconds]
atomical has joined #ruby
silkfox has joined #ruby
<txdv> and chocolate
iamjarvo has quit [Client Quit]
tier has quit [Ping timeout: 272 seconds]
kevinxu has joined #ruby
kevinxu is now known as Guest64301
<godd2> and other notably swiss things!
Guest64301 has quit [Max SendQ exceeded]
<max96at> people tend to like the things they don't have best
rudisimo has quit [Remote host closed the connection]
<max96at> so I'd assume swiss people love hot summer days on the beach :D
<apeiros> max96at: nah, there's tons of swiss who love winter and wintersports
<max96at> of course
<apeiros> and I only love hot weather when I don't have to do anything
<apeiros> and I'm reeeeally picky about beaches :D
sorpaas_ has joined #ruby
Xeago has joined #ruby
sorpaas_ has quit [Remote host closed the connection]
sorpaas_ has joined #ruby
dANO has joined #ruby
<godd2> interesting thing to be picky about
rkalfane has joined #ruby
Xeago_ has quit [Ping timeout: 258 seconds]
Xeago_ has joined #ruby
sailias has joined #ruby
<shevy> godd2 there are so many crap beaches, like those with rocks
<shevy> even small rocks!
<shevy> also beaches with lots of people can be very annoying
droidburgundy has joined #ruby
<godd2> yea but I wouldn't call someone picky if they don't like crappy things.
Techguy305 has joined #ruby
<shevy> what if apeiros really dislikes a LOT :)
Xeago has quit [Ping timeout: 244 seconds]
Techguy305 has quit [Max SendQ exceeded]
Abhijit has quit [Quit: Leaving]
Techguy305 has joined #ruby
wpp has quit []
robertt_dex has joined #ruby
gregoriokusowski has joined #ruby
<shevy> godd2 I am home again; it's time to read up on audio stuff for me
<shevy> \o/
<godd2> shevy I can always answer any questions you have.
thsig has joined #ruby
whoisjake has joined #ruby
glaksmono has joined #ruby
oleo has joined #ruby
jimbach_ has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
<shevy> ah
jimbach has joined #ruby
tkuchiki has joined #ruby
tier_ has quit [Ping timeout: 255 seconds]
tier has joined #ruby
<shevy> years ago I started to compile information into a local knowledgebase
<shevy> I start from there slowly; will take me a while before I can even come up
corehook has joined #ruby
dangerousdave has quit [Ping timeout: 255 seconds]
<shevy> godd2, for the record though - apeiros wrote a song into a .wav file once ... "Alle meine Entlein"
procat has joined #ruby
<apeiros> there's a couple of things shevy doesn't get tired of mentioning :)
gaussblurinc1 has quit [Quit: Leaving.]
gaussblurinc1 has joined #ruby
Takle has quit [Remote host closed the connection]
<godd2> shevy you mean with Ruby?
arup_r has joined #ruby
oleo has quit [Excess Flood]
Channel6 has joined #ruby
tkuchiki has quit [Ping timeout: 264 seconds]
oleo has joined #ruby
sk87 has joined #ruby
sigurding has quit [Quit: sigurding]
<maasha> just mean "p)
<maasha> argh, picasso! :o)
BlackGea_ has joined #ruby
ringarin has joined #ruby
ndrei has joined #ruby
maasha has quit [Quit: Page closed]
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
techsethi has joined #ruby
Takle has joined #ruby
mary5030 has joined #ruby
BlackGear has quit [Ping timeout: 255 seconds]
larissa has joined #ruby
bmichelsen has joined #ruby
clauswi__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
slawrence00 has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
rudisimo has joined #ruby
St1gma has joined #ruby
mesamoo has quit [Remote host closed the connection]
Areessell has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
doev has quit [Quit: Verlassend]
oo_ has quit [Remote host closed the connection]
mathias3 has quit [Ping timeout: 240 seconds]
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
s2013 has joined #ruby
dANO has quit [Remote host closed the connection]
kumarat9pm has quit [Read error: Connection reset by peer]
kumarat9pm has joined #ruby
rudisimo has quit [Remote host closed the connection]
decoponio has joined #ruby
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rkalfane has joined #ruby
rippa has joined #ruby
sorpaas_ has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
BlackGea_ has quit [Quit: ZZZzzz…]
dANO has joined #ruby
klmlfl has joined #ruby
einarj has quit [Remote host closed the connection]
Kricir has joined #ruby
sambao21 has joined #ruby
iamjarvo has joined #ruby
unclouded has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
tagrudev has quit [Remote host closed the connection]
ghr has quit [Read error: No route to host]
moritzs has joined #ruby
ghr has joined #ruby
wm3|away has quit [Ping timeout: 258 seconds]
<shevy> godd2 yeah
corehook has quit [Remote host closed the connection]
glaksmono has quit [Quit: This computer has gone to sleep]
glaksmono has joined #ruby
<godd2> shevy then it looks like there is demand for this. I'll do more work on this gem so there can be reading and writing to wav files: https://github.com/RSMP/riffy
AFKGeek has quit [Quit: Fades into the shadows]
stef204 has joined #ruby
aaronrl has joined #ruby
<shevy> \o/
<shevy> apeiros wrote it all in a single (!) .rb file back then
<shevy> even had something strange like http://pastie.org/9725340
<shevy> I didn't understand anything :)
aspiers has quit [Ping timeout: 255 seconds]
rudisimo has joined #ruby
<shevy> and writing into a file
<shevy> File.open(path, 'wb:binary') { |fh| fh.write(to_binary) }
<godd2> haha is the code up somewhere? I wouldn't mind taking a look at it
DaniG2k has quit [Quit: leaving]
cek has left #ruby [#ruby]
sk87 has joined #ruby
dmyers has quit [Remote host closed the connection]
jerius has quit []
s2013 has quit [Ping timeout: 244 seconds]
<shevy> not sure
AlSquire has quit [Ping timeout: 240 seconds]
<shevy> I tried to make sense of it and in the process broke it :(
teddyp1cker has joined #ruby
lampd1 has joined #ruby
<shevy> there even was a __END__ section
AlSquire has joined #ruby
<shevy> but in what I have, there is nothing afterwards that
<shevy> but I am sure apeiros had something in it
glaksmono has quit [Client Quit]
divi has joined #ruby
glaksmono has joined #ruby
CustosL1men has joined #ruby
jerius has joined #ruby
iceden has joined #ruby
Dude007 has joined #ruby
freerobby has joined #ruby
rudisimo has quit [Remote host closed the connection]
gtrak has joined #ruby
rudisimo has joined #ruby
mmozuras has quit [Quit: leaving]
teddyp1cker has quit [Ping timeout: 256 seconds]
samuel02 has joined #ruby
Dude007 has quit [Client Quit]
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
crazydiamond has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
hanmac1 has quit [Quit: Leaving.]
louism2wash has joined #ruby
glaksmono has quit [Quit: This computer has gone to sleep]
adriancb has quit [Remote host closed the connection]
Techguy305|2 has joined #ruby
i0n has joined #ruby
gerep has quit [Ping timeout: 258 seconds]
Techguy305|2 has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
Techguy305|2 has joined #ruby
sigurding has joined #ruby
Techguy305 has quit [Ping timeout: 264 seconds]
s2013 has joined #ruby
rudisimo has quit [Remote host closed the connection]
jlast has joined #ruby
s2013 has left #ruby [#ruby]
s2013 has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
AliRezaTaleghani has quit [Quit: Leaving.]
rylev has quit [Remote host closed the connection]
psy_ has quit [Remote host closed the connection]
hamakn has joined #ruby
rudisimo has joined #ruby
zacstewart has joined #ruby
treehug88 has joined #ruby
treehug88 has quit [Client Quit]
noop has quit [Ping timeout: 258 seconds]
Soda has joined #ruby
Techguy305|2 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Channel6 has quit [Quit: Leaving]
wm3|away has joined #ruby
bal has quit [Quit: bal]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gsd has joined #ruby
<shevy> bag of tricks
<shevy> or trick of bags
gaussblurinc1 has quit [Read error: Connection reset by peer]
gaussblurinc1 has joined #ruby
clauswitt has joined #ruby
treehug88 has joined #ruby
unclouded has quit [Ping timeout: 265 seconds]
mleung has joined #ruby
iceden has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
tier has quit [Remote host closed the connection]
rudisimo has quit [Remote host closed the connection]
rudisimo has joined #ruby
anarang has quit [Quit: Leaving]
vifino has quit [Ping timeout: 265 seconds]
ta has joined #ruby
jobewan has joined #ruby
kireevco has joined #ruby
tier has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
clauswit_ has joined #ruby
St1gma has joined #ruby
rkalfane has joined #ruby
clauswitt has quit [Ping timeout: 250 seconds]
shemerey has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bubu_aa has joined #ruby
speaking1ode is now known as speakingcode
<bubu_aa> Hey guys, random question, does a class need to start with a letter? i.e. I can't create a class called 247....?
vifino has joined #ruby
<banister> bubu_aa needs to start with a capital letter, ya
<bubu_aa> oki, thought so
<bubu_aa> thanks
pandaant has joined #ruby
philwantsfish has quit []
mleung has quit [Quit: mleung]
rjl has joined #ruby
oo_ has joined #ruby
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
ringarin has quit [Read error: Connection reset by peer]
gtrak has quit [Ping timeout: 255 seconds]
<shevy> bubu_aa did you really want to create a class called 404 :)
shock_one has joined #ruby
kobain has joined #ruby
renderful has joined #ruby
xymbol has joined #ruby
rylev has joined #ruby
kobain has quit [Max SendQ exceeded]
* apeiros ponders explaining the difference between class & constant
gtrak has joined #ruby
<banister> apeiros it would probably just confuse a noob ;)
dangerousdave has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
kobain has joined #ruby
joast has quit [Quit: Leaving.]
jxf has joined #ruby
St1gma has joined #ruby
kobain has quit [Max SendQ exceeded]
St1gma has quit [Read error: Connection reset by peer]
mkrank has quit [Read error: Connection reset by peer]
oo_ has quit [Ping timeout: 264 seconds]
dangerousdave has joined #ruby
dangerousdave has quit [Client Quit]
<olivier_bK> how to match element in array and display the array element ?
St1gma has joined #ruby
hydra1 has quit [Ping timeout: 244 seconds]
<shevy> olivier_bK best give an example (1) your array (2) match criterium
lmickh has joined #ruby
sigurding has quit [Quit: sigurding]
oleo has quit [Quit: Verlassend]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Techguy305 has joined #ruby
rkalfane has quit [Quit: Textual IRC Client: www.textualapp.com]
corehook has joined #ruby
sigurding has joined #ruby
paulfm has joined #ruby
mityaz has quit [Quit: Leaving]
sigurding has quit [Client Quit]
<shevy> %w( abc def ghi ab ).select {|entry| entry.include? 'ab' }
louism2wash has quit [Quit: Leaving]
mistermocha has joined #ruby
mikepack has joined #ruby
terrellt_ is now known as terrellt
clauswit_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oleo has joined #ruby
rudisimo has quit [Remote host closed the connection]
rudisimo has joined #ruby
Takle has quit [Remote host closed the connection]
oculus has joined #ruby
Macaveli has quit [Ping timeout: 264 seconds]
fabrice31 has quit [Remote host closed the connection]
<canton7> huh, a criterium is a bike race. I had no idea
<shevy> hahaha
<canton7> yup
<shevy> "Flanders (Belgium) hosts a number of criteriums, as does the Netherlands"
<shevy> sometimes I can't believe Wikipedia is serious
tjsousa has joined #ruby
<shevy> In german the singular word is "Kriterium", the plural is "die Kriterien"; apparently english deviates from this ... singular: criterion, plural: criteria
<shevy> so a critter-ion!
<shevy> a charged critter is the english term
<canton7> english is weird :P
Way-n-e has joined #ruby
hmsimha_ has quit [Ping timeout: 255 seconds]
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<Way-n-e> How create 2 initialize()
bmichelsen has quit [Quit: ZZZzzz…]
<shevy> Way-n-e simply write them
<shevy> last one wins
adriancb has quit [Remote host closed the connection]
<shevy> though of course if you write two initialize methods in the same class, you'd be a strange person
Joufflu has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Way-n-e> with different parameters
livathinos has quit [Remote host closed the connection]
fandi has joined #ruby
Joufflu has quit [Read error: Connection reset by peer]
<Way-n-e> one with (a integer) second a=string
<shevy> ah
Joufflu has joined #ruby
visof has joined #ruby
<shevy> I guess you want to simply pass different objects to it?
havenwood has joined #ruby
<shevy> write a single initialize() method but simply be flexible in how you accept arguments
<canton7> ruby don't have no method overloading. there's no overload resolution. nothing like that
<Way-n-e> ;(
<canton7> you write your one method, see what arguments you've been given, and do stuff based on that
unclouded has joined #ruby
<shevy> Way-n-e no sad face; you can simply check whether you have been given an integer or a string
<shevy> ruby is all about smiley faces
Takle has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
rudisimo has quit [Remote host closed the connection]
tobago has quit [Remote host closed the connection]
nrsk has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
beneggett has joined #ruby
joonty has quit [Quit: Leaving]
olivier_bK has quit [Ping timeout: 255 seconds]
HayesHimself has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hijiri has quit [Ping timeout: 272 seconds]
gtrak has quit [Ping timeout: 240 seconds]
nkumari has joined #ruby
s00pcan has quit [Remote host closed the connection]
dc_ has joined #ruby
lkba has joined #ruby
louism2wash has joined #ruby
<shevy> ain't it so guys!
s00pcan has joined #ruby
aspiers has joined #ruby
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
mistermocha has quit [Remote host closed the connection]
anaeem1 has joined #ruby
kobain has joined #ruby
clauswitt has joined #ruby
stef204 has joined #ruby
vifino has quit [Ping timeout: 258 seconds]
<canton7> >> class String; def happyize; self == ':(' ? replace(':)') : self; end; end; x = ':('; x.happyize; p x
<eval-in__> canton7 => ":)" ... (https://eval.in/222483)
ghostlines has quit [Ping timeout: 265 seconds]
<shevy> yeah that's the spirit!
Takle has quit [Remote host closed the connection]
iceden has joined #ruby
<shevy> I can not even make out the code with all those smiley faces in there
<canton7> hehe
terlar has quit [Ping timeout: 245 seconds]
byprdct has joined #ruby
anaeem1 has quit [Remote host closed the connection]
anaeem1 has joined #ruby
vifino has joined #ruby
nkumari has quit [Remote host closed the connection]
alex88 has quit []
ndrei has quit [Ping timeout: 240 seconds]
Takle has joined #ruby
joast has joined #ruby
psy_ has joined #ruby
gsd has joined #ruby
arrubin has joined #ruby
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
tier has quit [Remote host closed the connection]
andrewcarter has joined #ruby
shock_one has quit [Quit: Be back later ...]
anaeem1 has quit [Ping timeout: 264 seconds]
CustosL1men has quit [Ping timeout: 255 seconds]
maestrojed has joined #ruby
henesy has quit [Quit: Ex-Chat]
nii236|irssi has joined #ruby
timonv_ has quit [Remote host closed the connection]
rikai has joined #ruby
rismoney1 has joined #ruby
ramfjord has joined #ruby
geggam has joined #ruby
narph has joined #ruby
tier has joined #ruby
timonv_ has joined #ruby
timonv_ has quit [Remote host closed the connection]
mg^ has quit [Quit: Leaving]
timonv_ has joined #ruby
timonv_ has quit [Remote host closed the connection]
michaeldeol has joined #ruby
anaeem1 has joined #ruby
mistermocha has joined #ruby
<s2013> im trying to divide elements of an array into 5 buckets as evenly as possible.
tesaf has joined #ruby
<s2013> what would be the most efficient way? i cant seem to skip sorting it
waxjar has joined #ruby
agit0 has quit [Quit: Leaving]
rjl has quit [Ping timeout: 258 seconds]
havenwood has quit [Ping timeout: 250 seconds]
St1gma has quit [Read error: Connection reset by peer]
DaniG2k has joined #ruby
<ericwood> depends on what the criteria is for the buckets
St1gma has joined #ruby
unclouded has quit [Ping timeout: 272 seconds]
<s2013> basically if you had 15 numbers lets say.. youd put them in 5 buckets.. so 3 numbers in each bucket.. but the buckets are the bottom 20, next 40, etc..
<s2013> basically group hte numbers
ringarin has joined #ruby
<bubu_aa> Hey guys, how can I merge 2 hashes on same keys? i.e. https://gist.github.com/joshmyers/4ead9e0753a3358409e0
<s2013> i kinda have something working.. but its not the most efficient
<bubu_aa> I want to append valued, not overwrite them...
Cyberheb has joined #ruby
j_mcnally has joined #ruby
sigurding has joined #ruby
baroquebobcat has joined #ruby
<Hanmac> s2013 & ericwood
<Hanmac> >> a=(0..15).to_a; a.each_slice(a.size / 5).to_a
<eval-in__> Hanmac => [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14], [15]] (https://eval.in/222508)
<s2013> ericwood, thanks but i think that might not fully work cause i still need to be able to group them
dkb20k has quit [Remote host closed the connection]
stef204 has joined #ruby
<s2013> Hanmac, nah that wont work either.. cause the last elmeent is only 1 size
<jhass> bubu_aa: Hash#merge takes a block
<jhass> check the docs
rudisimo has joined #ruby
<Hanmac> s2013: hm as you see its 16 not 15 elements i did it wrong
jason_rad has joined #ruby
JimmyNeutron has quit [Ping timeout: 255 seconds]
<s2013> the problem isnt if they divide evenly
<s2013> thats easy
<s2013> im having issue about when there are remainders
jason_rad has quit [Client Quit]
<bubu_aa> jhass: ahh thanks
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ringarin has quit [Ping timeout: 256 seconds]
Soda has quit [Remote host closed the connection]
jason_rad has joined #ruby
<s2013> maybe this might make more sense
<s2013> trying to find the most efficient solution to it
moritzs has quit [Ping timeout: 255 seconds]
<klap> I'm delegating to another class with method_missing; supposedly I'm meant to define respond_to? as well
<klap> How should I define it?
<klap> Should I have it call respond_to? on the composed class?
<jhass> klap: define respond_to_missing?
adriancb has joined #ruby
<jhass> and calling respond_to? on the delegated class in that one makes sense
<jhass> also have a lookg at the delegate stdlib
<klap> Is it necessary to define respond_to_missing as well?
<klap> Seems redundant with respond_to? !
<jhass> not as well
<jhass> don't override respond_to?, define respond_to_missing?
i0n has quit [Quit: snooze]
gregoriokusowski has quit [Read error: Connection reset by peer]
<jhass> or just save yourself reinventing the wheel and use the delegate stdlib
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<ericwood> hey if any of you people live in Austin: http://www.meetup.com/austinrb/events/218735924/
<s2013> haha i was in cap factory pas tweekend
gregoriokusowski has joined #ruby
airdeluxe has joined #ruby
<s2013> ericwood, this is roomba the vacuum right
<ericwood> damn right!
<s2013> nice. ill come by
<ericwood> woohoo, please do
<s2013> are you involved in the rails community in austin
<ericwood> mostly the ruby community but there's a lot of overlapp
<Way-n-e> in ruby is any stream? object similar to put string, read string, in mem, file etc.
<ericwood> Austin on Rails has gotten pretty big so I usually don't go :\
<s2013> gotcha.. do you know damon?
<ericwood> Way-n-e: depends on what you're doing with it but IO is what you want most likely
<ericwood> s2013: yeah!
jespada has quit [Ping timeout: 258 seconds]
nii236|irssi has quit [Quit: Lost terminal]
<s2013> haha nice
hydra2 has joined #ruby
<s2013> small world
<ericwood> do you know Rob Mack?
<Way-n-e> ericwood: simple stream.new(memory) stream.read similar file stream.close
<s2013> nah. i just moved back to austin recently
<ericwood> Way-n-e: check out IO, then
<ericwood> oh cool
<ericwood> where you workin'?
<s2013> but i might be giving a talk at the rails meetup in february
<ericwood> nice!
<bubu_aa> jhass: sorry to be a pain but I'm struggling to get the merge hash block working ( I know I'm doing something stupid )
<s2013> i just quit my job. i was working in nyc
<bubu_aa> any ideas given my example?
jason_rad has quit [Quit: leaving]
<jhass> bubu_aa: you could provide a full problem description
<ericwood> s2013: that's funny, I'm actually considering a move to NYC soon :|
Takle has quit [Remote host closed the connection]
<s2013> now im just trying to sort of go back to my cs roots and spend some time doing algos and what not
<ericwood> niceeeeeeeeeeeeeee
whatasunnyday has joined #ruby
<s2013> oh yeah im from nyc originally. its great city but depends on what you like
mr_foobar_baz has joined #ruby
Takle has joined #ruby
TomyWork has quit [Ping timeout: 250 seconds]
mr_foobar_baz has quit [Client Quit]
stef204 has quit [Read error: Connection reset by peer]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JakePee has joined #ruby
<JakePee> got a question
mleung has joined #ruby
<s2013> just ask
neoxquick has joined #ruby
<JakePee> trying to get from this `a = ['hi' => 'there', 'dude'=>nil]`
jespada has joined #ruby
nrsk has joined #ruby
beneggett has quit [Ping timeout: 256 seconds]
<JakePee> to string `hi there dude`
<bubu_aa> jhass: hopefully this is clearer
ringarin has joined #ruby
<JakePee> but getting this
<JakePee> irb(main):010:0> a.join(' ')
<JakePee> => "hitheredude"
<ericwood> JakePee: arrays don't work that way
<ericwood> what you posted is a hash of sorts
<s2013> yeah
beneggett has joined #ruby
<s2013> thats not really an array , nor a ahsh
<s2013> hash*
<s2013> should be a = ['hi', 'there', 'dude']
zzzbra has joined #ruby
<ericwood> >> a = ['hi', 'there', 'dude']; a.join(' ')
<eval-in__> ericwood => "hi there dude" (https://eval.in/222542)
<ericwood> seems to work ¯\_(ツ)_/¯
Takle has quit [Ping timeout: 258 seconds]
<JakePee> Can I make that work if I make it a hash map?
<jhass> bubu_aa: and currentstatus.merge(dowtimeslist) {|_,status, downtime| status[:last_downtime] = downtime } doesn't work?
<s2013> you can do anything, but doesnt mean you should
<JakePee> The key value associations are somewhat important
<s2013> whats the actual data
<s2013> and what are you trying to get out of it
bmichelsen has joined #ruby
<JakePee> a command line call with options
lkba has quit [Ping timeout: 245 seconds]
moritzs has joined #ruby
<JakePee> i'll throw it in eval
tjsousa has quit [Remote host closed the connection]
lkba has joined #ruby
msgodf has quit [Remote host closed the connection]
whoisjake has quit []
synfin has joined #ruby
anaeem1 has quit [Read error: Connection reset by peer]
i0n has joined #ruby
rshetty has quit [Remote host closed the connection]
aspiers has quit [Ping timeout: 240 seconds]
<j2p2> i feel gross after writing this
<j2p2> but i think this works
<j2p2> for what you want
Techguy305 has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
<s2013> thats sexy
anaeem1 has joined #ruby
gregoriokusowski has quit [Quit: gregoriokusowski]
<j2p2> JakePee ^
<jhass> bubu_aa: oh, I didn't see that you changed downtimeslist format
<jhass> currentstatus.merge(dowtimeslist) {|_,status, downtime| status[:last_downtime] = downtime[:last_downtime] } then of course
andikr has quit [Remote host closed the connection]
<jhass> or if your in rails with the new format a deep_merge should work too
<jhass> *you're
ptrrr has joined #ruby
<bubu_aa> ah, nice, my bad :)
<bubu_aa> not rails, sinatra
zzzbra has quit [Remote host closed the connection]
<Way-n-e> how open IO stream?
<Way-n-e> a=IO.new(a,'w') ?
<JakePee> j2p2: Thanks, this seems to cover it pretty well `a.map{|k,v| "#{k} #{v}"}.join(' ')`
dj_zubehoer has joined #ruby
ringarin has quit [Ping timeout: 265 seconds]
<j2p2> ah or that :p
jhwhite has joined #ruby
clauswit_ has joined #ruby
<jhass> Way-n-e: what's a?
zzzbra has joined #ruby
<s2013> gahhh
dj_zubehoer has quit [Remote host closed the connection]
<Way-n-e> I 'm ask, I dont know. I need put data into file or memory, streams
gregoriokusowski has joined #ruby
nobitanobi has joined #ruby
<Way-n-e> a.write('test')
<Way-n-e> how new() open etc a?
<jhass> Did you read File and IO blocks?
<jhass> *docs
stunder has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
<Way-n-e> jhass: Yes ;) but not undestood
mikecmpbll has quit [Quit: ciao.]
<jhass> File.write('foo.txt', 'content'); or File.open('file.txt', 'w') do |file| file.write whatever; end;
clauswitt has quit [Ping timeout: 256 seconds]
allcentury has quit [Ping timeout: 255 seconds]
DaniG2k has quit [Quit: leaving]
<Way-n-e> jhass: to file ok, but I need use IO. How I can write similar to memory stream?
chthon has quit [Ping timeout: 250 seconds]
<jhass> what's a memory stream?
<Way-n-e> Memory.write('foo.txt','w')
Takle has joined #ruby
jdj_dk has joined #ruby
<Way-n-e> similar file but in memory
pizzahead has joined #ruby
<Way-n-e> stream in memory
<jhass> do you want StringIO?
mleung has quit [Quit: mleung]
<Way-n-e> is one way to open /create IO in file or memory?
<jhass> does StringIO do what you want?
deric_skibotn has joined #ruby
<Way-n-e> jhass: for memory yes, but sometimes i need write my stream to file
Hanmac has quit [Ping timeout: 265 seconds]
mleung has joined #ruby
i0n has quit [Quit: snooze]
<Way-n-e> is IO.sysopen is IO.memopen?
troyready has joined #ruby
teddyp1cker has joined #ruby
<Way-n-e> or other way?
jdj_dk has quit [Remote host closed the connection]
Fire-Dragon-DoL has joined #ruby
bubu_aa has quit [Ping timeout: 246 seconds]
<pizzahead> I'm using net:http to make web requests and I'm trying to add a rescue for 500 errors but I must be doing it wrong. i've tried rescue, rescue exceptions and then I tried this but it didn't help http://tammersaleh.com/posts/rescuing-net-http-exceptions/
<jhass> StringIO and File both include IO, can't you just conditonalize the creation?
<jhass> Way-n-e: ^
Cyberheb has quit [Quit: Computer has gone to sleep.]
<jhass> pizzahead: "didn't help"
oculus has joined #ruby
<jhass> I'm sure you can describe your problem better than that
<Way-n-e> jhass: ok, where is example IO ?
<pizzahead> jhass: it never hit the rescue
<Way-n-e> tutorial?
<jhass> Way-n-e: I thought you already know how to open a File?
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<Way-n-e> how write in binmode 10 bytes ti IO
<jhass> pizzahead: code & error message / actual behavior vs. expected behavior
mistermocha has quit [Remote host closed the connection]
<jhass> pizzahead: we don't see your screen
mengu has quit [Read error: No route to host]
<Way-n-e> or read 10 bytes from IO
<jhass> Way-n-e: IO#write thing_that_contains_10_bytes
moritzs has quit [Ping timeout: 240 seconds]
<jhass> IO#read 10
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
zzzbra_ has joined #ruby
teddyp1cker has quit [Ping timeout: 250 seconds]
mengu has quit [Remote host closed the connection]
<Way-n-e> no octet, bits
<jhass> you clearly wrote bytes
<Way-n-e> from any files, utf8,ascii etc
JimmyNeutron has joined #ruby
moritzs has joined #ruby
<jhass> and you can only read bytes, not bits
<jhass> see man 2 read
<jhass> Way-n-e: did you actually try anything prior asking?
zzzbra has quit [Ping timeout: 240 seconds]
<wm3|away> jhass: you and your high expectations :P
<jhass> you and your cynism
<wm3|away> *cynicism
<wm3|away> ;)
<Way-n-e> yes, i nned stream to encoding data, create stream, put some string and get encoded data
<jhass> yeah sorry, spell checker disabled itself :P
tgandrews has joined #ruby
<jhass> Way-n-e: show what you've tried so far
unclouded has joined #ruby
<pizzahead> jhass: I have an API that randomly throws 500 internal server errors. I'm assuming that it's not really being treated by net::http as a real exception so it would never hit the rescue block?
<jhass> pizzahead: show code
<jhass> & error message it produces
<Way-n-e> jhass: some data are in file sored, some is simple a string
<jhass> let's try godd2's method
<jhass> Way-n-e: why?
<Way-n-e> for example 'file:test.txt' -encodingbase64-> stream.mem print -> 'file:out.txt'
sigurding has quit [Quit: sigurding]
<Way-n-e> do You know what is BIO in OpenSSl?
Avahey has joined #ruby
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> pizzahead: but yes, I don't think it throws an exception
vectra has quit [Ping timeout: 265 seconds]
byprdct_ has joined #ruby
RitterJack has quit [Remote host closed the connection]
<jhass> Way-n-e: no. What is it?
<jhass> my openssl manpage doesn't contain that string
moritzs has quit [Ping timeout: 264 seconds]
<Way-n-e> streams ;-) cascaded streams with filter
Soda has joined #ruby
Timgauthier has joined #ruby
bricker`work has joined #ruby
<jhass> I still don't get what your actual problem is
RandyT has joined #ruby
mleung has quit [Quit: mleung]
nkumari has joined #ruby
<jhass> you only describe some vague solution you ultimately want without showing that you did any kind of serious research or experimentation
byprdct has quit [Ping timeout: 264 seconds]
jheg has quit [Quit: jheg]
<jhass> sounds like you want to retrofit something you saw somewhere onto your actual problem
Hanmac has joined #ruby
last_staff has quit [Quit: last_staff]
ozialien_ has quit [Read error: Connection reset by peer]
whatasunnyday has quit [Quit: whatasunnyday]
timonv_ has joined #ruby
nateberkopec has joined #ruby
<pizzahead> jhass: http://pastebin.com/uB7AUWrX
<jhass> and now?
allcentury has joined #ruby
<pizzahead> jhass: I have it connecting to hamms which is throwing whatever error I specify in status. This is stripped down from my script that was getting 500's every so often against an API I'm trying to get data from.
tier_ has joined #ruby
atomical has joined #ruby
despai has joined #ruby
<jhass> and what's your problem?
<pizzahead> jhass: it skips the rescue block and ends
whatasunnyday has joined #ruby
<jhass> it skips line 8 too?
whatasunnyday has quit [Client Quit]
gregoriokusows-1 has joined #ruby
momomomomo has joined #ruby
<pizzahead> jhass: #<Net::HTTPInternalServerError 500 INTERNAL SERVER ERROR readbody=true>
Ulrike_Rayne has quit [Ping timeout: 244 seconds]
gregoriokusowski has quit [Ping timeout: 250 seconds]
<pizzahead> jhass: must not be a real exception to net::http?
<jhass> no
<jhass> HTTPInternalServerError is a subclass of HTTPResponse
adriancb has quit [Remote host closed the connection]
<pizzahead> jhass: ty I will read through
clauswit_ has quit [Ping timeout: 256 seconds]
<jhass> HTTPInternalServerError < HTTPServerError < HTTPResponse
nkumari has quit [Remote host closed the connection]
tier has quit [Ping timeout: 272 seconds]
x1337807x has joined #ruby
ZaRDaK has joined #ruby
jshultz has joined #ruby
clauswitt has joined #ruby
ndrei has joined #ruby
sailias has quit [Quit: Leaving.]
visof has quit [Ping timeout: 272 seconds]
sailias has joined #ruby
visof has joined #ruby
econerd4ever has joined #ruby
Eiam has joined #ruby
ringarin has joined #ruby
olivier_bK has joined #ruby
az7ar has joined #ruby
hiyosi has quit [Ping timeout: 265 seconds]
entrenador has joined #ruby
oo_ has joined #ruby
baweaver has joined #ruby
wallerdev has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
benzrf|offline is now known as benzrf
larissa has quit [Quit: Leaving]
tgandrews has quit [Quit: tgandrews]
fabrice31 has joined #ruby
sdwrage has joined #ruby
oo_ has quit [Ping timeout: 250 seconds]
wm3|away has quit [Ping timeout: 258 seconds]
sigurding has joined #ruby
nkumari has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
fabrice31 has quit [Ping timeout: 245 seconds]
renderful has quit [Remote host closed the connection]
visof has quit [Ping timeout: 256 seconds]
despai has joined #ruby
Ulrike_Rayne has joined #ruby
<Timgauthier> so shevy my favourite PHP based CMS updated
kyb3r_ has joined #ruby
<Timgauthier> they're removing logic from the templates and putting them in controlloers now! :D
<Timgauthier> next step, convert to ruby! :P
sdwrage has quit [Quit: This computer has gone to sleep]
m8 has joined #ruby
mkaesz has quit [Ping timeout: 255 seconds]
bahar has quit [Ping timeout: 255 seconds]
Hobogrammer has joined #ruby
moritzs has joined #ruby
SCHAAP137 has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bahar has joined #ruby
treehug88 has quit [Read error: Connection reset by peer]
mkaesz has joined #ruby
sarmiena_ has joined #ruby
treehug88 has joined #ruby
sdwrage has joined #ruby
bluOxigen has quit [Ping timeout: 250 seconds]
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jhwhite has quit [Ping timeout: 245 seconds]
kireevco has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
zacstewart has quit [Remote host closed the connection]
adriancb has joined #ruby
Ulrike_Rayne has quit [Ping timeout: 244 seconds]
mkaesz has quit [Remote host closed the connection]
WillAmes has quit [Remote host closed the connection]
JakePee has quit [Read error: Connection reset by peer]
WillAmes has joined #ruby
Ulrike_Rayne has joined #ruby
corehook has quit [Remote host closed the connection]
whoisjake has joined #ruby
az7ar is now known as az7ar_away
<apeiros_> Timgauthier: wow… that logic does not belong into templates was common knowledge even back when I still did php
oculus has joined #ruby
<apeiros_> and it took them *this* long to figure?
kireevco has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
ThaDick_ has joined #ruby
kireevco has joined #ruby
<havenwood> pipework: Ruby 3.0 \o/
ThaDick has quit [Ping timeout: 265 seconds]
ThaDick_ is now known as ThaDick
oculus has quit [Client Quit]
<havenwood> llvm jit and static typing, brave new world
oculus has joined #ruby
vimer has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
dkphenom has joined #ruby
aclearman037 has quit [Quit: I'm out!]
magic_ has quit [Read error: Connection reset by peer]
<havenwood> we should have a #ruby birds of a feather :)
tier_ has quit [Ping timeout: 272 seconds]
arup_r has quit [Ping timeout: 244 seconds]
tier has joined #ruby
<Timgauthier> apeiros_ they originally didn't expect people to put logic in the templates, but to use templates, but that ended up not making much sense, so they rewrote the software for version 2 and so now kirbycms has controllers for logic
entrenador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aclearman037 has joined #ruby
<apeiros_> havenwood: lünk?
<havenwood> keynote isn't over yet, hmm
<shevy> Timgauthier they are crazy
jimbach has quit [Remote host closed the connection]
<havenwood> apeiros_: matz said there'd be concurrency, but didn't talk about details
<Timgauthier> indeed
spyderman4g63 has joined #ruby
<shevy> Timgauthier you poor man - married now but still having to write PHP for a living
<shevy> :>
<havenwood> apeiros_: for jit just suggested llvm was possible
<apeiros_> havenwood: o0
spider-mario has joined #ruby
<havenwood> apeiros_: and optional static typing, said it's better than comments
<apeiros_> concurrency? we already have that. did he mean removal of GIL?
<Timgauthier> shevy i wish i was making a living at it :(
mikecmpbll has joined #ruby
oculus has quit [Ping timeout: 264 seconds]
<havenwood> apeiros_: yeah, buh bye GVL
renderful has joined #ruby
rudisimo has quit [Remote host closed the connection]
<havenwood> apeiros_: but not sure how yet
<apeiros_> what conf?
<havenwood> apeiros_: RubyConf
<apeiros_> damn. haven't been at a single conf for 2 years now
<apeiros_> this sucks :(
entrenador has joined #ruby
tier has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
<havenwood> apeiros_: go next year!
Way-n-e has left #ruby [#ruby]
sigurding has quit [Read error: Connection reset by peer]
<apeiros_> :-S
<havenwood> he's talking about how static typing and duck typing now
tier has joined #ruby
<havenwood> mentioning Typescript
mikepack has quit [Remote host closed the connection]
nkumari has quit [Remote host closed the connection]
<Xeago_> apeiros_: if you know a conf you're going to, mention it to me please :>
<havenwood> apeiros_: release for 3.0 to be released within the next one to ten years, hehe
<Xeago_> I was hoping to attend this years velocity in barcelona
clauswit_ has joined #ruby
<banister> Xeago_ hoi, hoe gaat het Meneer?
St_Marx has quit [Quit: Ex-Chat]
<apeiros_> Xeago_: sure. same thing back :D
entrenador has quit [Client Quit]
lolmaus has joined #ruby
kyb3r_ has quit [Read error: Connection reset by peer]
RandyT has quit [Quit: ZNC - http://znc.in]
<Xeago_> banister: net zo als altijd :>
benzrf is now known as benzrf|offline
noop has joined #ruby
<banister> Xeago_ ok dan, hou je van olie ballen, houdt u de olie in hen? als je zoveel van hen eet je eruit één !!!!!!
blackmesa has joined #ruby
<Xeago_> wat?
mleung has joined #ruby
<Xeago_> it's not even just not a sentence, it also has spelling errors, you learning dutch I see? :D
artm has quit [Ping timeout: 258 seconds]
<Xeago_> maar nee, ik ben geen oliebollen-fan, geef mij maar spekkoek
wald0 has joined #ruby
clauswitt has quit [Ping timeout: 255 seconds]
<rpag_> havenwood, doing a lightning talk?
carlosoliveira has joined #ruby
<havenwood> rpag_: yup, hopefully tomorrow
<carlosoliveira> hey
<rpag_> transducers topic?
<carlosoliveira> im gay
carlosoliveira has left #ruby [#ruby]
<havenwood> rpag_: yeah, hopefully it'll be coherent
RandyT has joined #ruby
<rpag_> try get a video of it :)
lidaaa has joined #ruby
clauswit_ has quit [Ping timeout: 272 seconds]
<havenwood> soft typing compile-time check, best effort
<havenwood> require, define_method, and method_missing will be restricted to enable
jimbach has joined #ruby
<apeiros_> sounds similar to a concept in my toy-language
<apeiros_> where you can switch into a limited mode which lends itself to optimization by disabling various dynamic aspects
benzrf|offline is now known as benzrf
<s2013> can you write tests on the same file as the method?
<havenwood> apeiros_: that sounds just like it
olivier_bK has quit [Ping timeout: 265 seconds]
rkalfane has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
Jake232 has joined #ruby
Soda has quit [Remote host closed the connection]
<apeiros_> s2013: you can do whatever you want
<rpag_> embedding tests in below __END__ would be interesting
<rpag_> -in
<shevy> hehehe
<shevy> I want more than one __END__
carlosoliveira has joined #ruby
<s2013> https://gist.github.com/ss2k/6dbcca2bd4c3ee4152a5 is there a better way to do this?
rudisimo has joined #ruby
<shevy> in fact, not only do I want more than one __END__ - I also want to denote this with a different token
jimbach has quit [Remote host closed the connection]
ramfjord has joined #ruby
tgandrews has joined #ruby
<shevy> ___ should suffice :)
<apeiros_> shevy: use __END__, put whatever tokens you want to further segregate
livathin_ has joined #ruby
tier has quit [Remote host closed the connection]
nkumari has joined #ruby
MattB2 has joined #ruby
havenwood has quit [Remote host closed the connection]
thsig has quit [Remote host closed the connection]
<pizzahead> jhass: thanks for your help again. I ended up using .code to sleep and retry if not 200.
<robertt_dex> shevy: here is an interesting usage of __END__
postmodern has joined #ruby
<robertt_dex> shevy: you can see how he create several "files" under it
TeresaP has joined #ruby
momomomomo has quit [Quit: momomomomo]
<robertt_dex> s2013: __END__ will requiere a parser if you plan to have several file using it. Ruby will just parse the __END__ content of the first file.
AlSquire has quit [Quit: This computer has gone to sleep]
mary5030 has quit [Remote host closed the connection]
<shevy> huh wait
<shevy> ruby will not read the second __END__ right?
<robertt_dex> no it wont
<robertt_dex> just the file that gets called by the ruby bin
<shevy> ah but the example there uses only one __END__
<rpag_> isn't DATA just scoped to whatever file you're in?
<robertt_dex> the rest of them will be ignored
<robertt_dex> no it's not
hiyosi has joined #ruby
<robertt_dex> required files wont get parsed
baweaver has quit [Remote host closed the connection]
nobitanobi has quit [Remote host closed the connection]
<eam> hm, ruby doesn't support -P
<apeiros_> DATA relates only to the main file being executed
<apeiros_> but __END__ works in all files
<shevy> ack we have an apeiros clone
tier has joined #ruby
<s2013> jij
<s2013> huh
<robertt_dex> apeiros: works as comment, but it's not easy to access
<shevy> you speak to the wrong apeiros_ !
revoohc has joined #ruby
<robertt_dex> haha, yea
omosoj has joined #ruby
omosoj has quit [Client Quit]
<apeiros_> and you can use e.g. https://github.com/apeiros/scriptfile to read __END__ data of all files
omosoj has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
<shevy> so he also played with __END__ ;)
<apeiros_> reminds me that I still haven't published this as a gem :-|
<apeiros_> it's now probably 10y old
<shevy> butler was your last great gem ...
<robertt_dex> ;) that's handy
<apeiros_> shevy: I get highlighted on all variations
kasperti_ has joined #ruby
<shevy> hehe
mary5030 has joined #ruby
rudisimo has quit [Remote host closed the connection]
<robertt_dex> I'm currently working on specs under the __END__ metadata, probably what s2013 wants :P
<robertt_dex> Also on YARD based specs
<s2013> im so confused
<robertt_dex> the idea is to mix both, simple examples on the YARD and complex tests under the __END__
nrsk has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
oo_ has joined #ruby
<robertt_dex> s2013: as far as I know there's no really a way to do what you want right now (in a clean way)
rudisimo has joined #ruby
<s2013> oh im past the test questions
dangerousdave has joined #ruby
<s2013> https://gist.github.com/ss2k/6dbcca2bd4c3ee4152a5 i was asking for feedback on this
rudisimo has quit [Remote host closed the connection]
hiyosi has quit [Ping timeout: 240 seconds]
rudisimo has joined #ruby
fantazo has joined #ruby
<robertt_dex> s2013: there should be :P lets see...
omosoj has quit [Ping timeout: 240 seconds]
aclearman037 has quit [Quit: I'm out!]
pdtpatrick_ has joined #ruby
<robertt_dex> s2013: .sort.each_slice(5).to_a
<robertt_dex> looks easier... haha
oo_ has quit [Ping timeout: 255 seconds]
pglombardo has joined #ruby
<s2013> no that wont work
<s2013> i need to split them upinto 5 equal or semi equal parts
<s2013> each_slice would work if the # of elements could be evenly distributed amongst five buckets
<robertt_dex> [[0, 5, 9, 10, 11], [14, 19, 21, 22, 23], [23, 24, 33, 50, 55], [99, 349, 591, 4991]]
<robertt_dex> just add a comment on your code
<s2013> yeah but thats 4 buckets
<robertt_dex> I see, sorry
rshetty has joined #ruby
<robertt_dex> Ok, you just need to get the numebr of elements per bucket and use the slice line with it
sk87 has joined #ruby
<s2013> yeah but that wont work if you have remainders
<shevy> ok
<shevy> I know what you need
<shevy> Hanmac, your type is called again
<j2p2> you could just mod it and add one to the slice while remainder != 0 while decrementing the remainder each loop
<j2p2> right?
whoisjake has quit []
<s2013> j2p2, thats what im doing
<j2p2> it's not a one-liner but works
iamjarvo has joined #ruby
<j2p2> ah ok
<s2013> i already have the code, just wondering if i can make it more efficient
<Hanmac> shevy i already did try before but he didnt liked it
econerd4ever has quit [Remote host closed the connection]
<shevy> OK
<shevy> s2013 you made Hanmac sad :(
<s2013> yeah i think Hanmac misunderstood what th eproblem was. its confusing
Mars` has joined #ruby
<s2013> no, im sad :(
sk87 has quit [Client Quit]
<robertt_dex> s2013: slice WORKS. You ust have a math problem now
econerd4ever has joined #ruby
<shevy> ah that is ok
wsmoak has joined #ruby
nobitanobi has joined #ruby
<shevy> 99% time people don't understand Hanmac either ;-)
<j2p2> ugh okay, now I have to figure out a better way because there's the full code right there :p
aclearman037 has joined #ruby
chipotle has quit [Quit: cya]
<s2013> can you limit the # of items in the array?
<s2013> i want it to be as space and time efficient as possible
<s2013> we basically have tons of data and we need to put them into bottom 20, next 20, etc..
rylev has quit [Remote host closed the connection]
<robertt_dex> a.sort.each_slice((a.length/5.0).ceil).to_a
rshetty has quit [Ping timeout: 256 seconds]
<s2013> hmm
<s2013> let me try
<s2013> >> a = [1,2,3,4,5,6]; a.each_slice((a.length/5.0).ceil).to_a
<eval-in__> s2013 => [[1, 2], [3, 4], [5, 6]] (https://eval.in/222605)
Xeago has joined #ruby
<s2013> :(
econerd4ever has quit [Ping timeout: 250 seconds]
zacstewart has joined #ruby
<robertt_dex> s2013: getting there, so how should that scenario be solved ?
St1gma has quit [Read error: Connection reset by peer]
<s2013> [1,2], [3], [4], [5], [6]
<robertt_dex> cool
St1gma has joined #ruby
<s2013> >> a = [1,2,3,4,5]; a.each_slice((a.length/5.0).ceil).to_a
<eval-in__> s2013 => [[1], [2], [3], [4], [5]] (https://eval.in/222607)
<s2013> see like i said each_slice works if the elements can be evenly distributed
<robertt_dex> try to add those in your next sample scenarios :P
<s2013> what do you mean
Xeago_ has quit [Ping timeout: 240 seconds]
<wsmoak> anyone using mongo? I’m struggling to return the results of coll.find() (all items in the collection) as a proper json array.
vimer has quit [Quit: leaving]
<s2013> what do you mean wsmoak
oculus has joined #ruby
<s2013> it returns as json
<wsmoak> hard-coding this works: [{id: 45},{id: 46}].to_json
<s2013> are you using mongoid?
<s2013> i use mongo with nodejs usually and it returns as json
<Hanmac> s2013: i got:
<Hanmac> >> data=[5,19,33,14,591,349,11,24,22,4991,23,21,99,50,55,23,10,0,9]; data.group_by.with_index {|o,i| i % 5 }
<eval-in__> Hanmac => {0=>[5, 349, 23, 23], 1=>[19, 11, 21, 10], 2=>[33, 24, 99, 0], 3=>[14, 22, 50, 9], 4=>[591, 4991, 55]} (https://eval.in/222616)
<wsmoak> s2013: not mongoid. just mongo.
louism2wash has quit [Quit: This computer has gone to sleep]
wald0 has quit [Quit: Lost terminal]
<s2013> Hanmac, interesting. one sec
<s2013> >> data=[5,19,33,14,591,349,11,24,22,4991,23,21,99,50,55,23,10,0,9]; data.sort.group_by.with_index {|o,i| i % 5 }
<eval-in__> s2013 => {0=>[0, 14, 23, 99], 1=>[5, 19, 24, 349], 2=>[9, 21, 33, 591], 3=>[10, 22, 50, 4991], 4=>[11, 23, 55]} (https://eval.in/222624)
chipotle has joined #ruby
<wsmoak> so coll.find() returns a cursor. I can .each over it and .to_json on each item… but it needs to have [ ] around the whole thing and commas in between.
<s2013> its a lot closer, atleast as far as # of elements go
renderful has quit [Remote host closed the connection]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JDiPierro has joined #ruby
<wsmoak> (just looked. definitely not mongoid. I don’t need a mapper, just good json for angular to work on)
omosoj has joined #ruby
Juanchito has quit [Quit: Connection closed for inactivity]
Takle has quit [Remote host closed the connection]
blackmes1 has joined #ruby
zB0hs has joined #ruby
Xeago has quit [Remote host closed the connection]
<Hanmac> s2013: it has a different result than your function, but i still thinks there is something broken with yours ... that group by does port them as evenly as possible
blackmesa has quit [Ping timeout: 250 seconds]
timonv_ has joined #ruby
jdj_dk has joined #ruby
jlast has quit [Remote host closed the connection]
<s2013> Hanmac, what would be broken? i need to make sure i tworks all the time
jlast has joined #ruby
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<s2013> i tried with random arrays and they all seemed to have given the right results but i don tknow
<Hanmac> s2013: i dont know i only say i got a different result with group_by than with your function ... that means something is fishy there ... and it does smell after a school homework
<s2013> lol.. i wish.. my last cs class was about 10 years ago
cleopatra has joined #ruby
<s2013> i would love to be studying cs than being out in the real world
<wsmoak> ftr it’s on http://recipes.sinatrarb.com/p/databases/mongo -> coll.find().to_a.to_json
<Hanmac> ahh ok i found the problem ... you do sort before and i do not
claymore has joined #ruby
<s2013> Hanmac, i did the sort though when i repasted it
Takle has joined #ruby
baweaver has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Hanmac> s2013: your wanted output: data.sort.each_slice(data.size / 5 + 1).to_a
<s2013> >> data=[0, 5, 9, 10, 11, 14, 19, 21, 22, 23, 23, 24, 33, 50, 55, 99, 349, 591, 4991]; data.group_by.with_index {|o,i| i % 5 }
<eval-in__> s2013 => {0=>[0, 14, 23, 99], 1=>[5, 19, 24, 349], 2=>[9, 21, 33, 591], 3=>[10, 22, 50, 4991], 4=>[11, 23, 55]} (https://eval.in/222639)
<Hanmac> hm ok ceil would be better than +1
FooMunki has quit [Quit: FooMunki]
<s2013> thats sorted
<s2013> >> data=[0, 5, 9, 10, 11, 14, 19, 21, 22, 23, 23, 24, 33, 50, 55, 99, 349, 591, 4991]; data.each_slice(data.size/5+1).to_a
<eval-in__> s2013 => [[0, 5, 9, 10], [11, 14, 19, 21], [22, 23, 23, 24], [33, 50, 55, 99], [349, 591, 4991]] (https://eval.in/222641)
<s2013> yeah that seems to work
jlast has quit [Ping timeout: 264 seconds]
<s2013> >> data=[0,1,2,3,4]; data.each_slice(data.size/5+1).to_a
<eval-in__> s2013 => [[0, 1], [2, 3], [4]] (https://eval.in/222645)
teddyp1cker has joined #ruby
<s2013> doesnt work for that case... my code i know works cause i tested it with tons of different combinations.. but i feel it can be more efficient but what you said is pretty close
<Hanmac> it seems i get ignored ... i did say ceil is better than +1 ... and that you need .sort. ... and thats why i dont like to help with homework
karmatr0n has joined #ruby
pizzahead has quit [Ping timeout: 255 seconds]
tier has quit [Remote host closed the connection]
renderful has joined #ruby
<jhass> don't forget to .fdiv
thsig has joined #ruby
<Hanmac> s2013: thats final form: data.sort.each_slice(data.size.fdiv(5).ceil).to_a
<s2013> k let me try
Hijiri has joined #ruby
<s2013> i have never seen fdiv, interesting
tus has quit [Ping timeout: 240 seconds]
it0a has joined #ruby
<s2013> oh that just divides by the float. cool
teddyp1cker has quit [Ping timeout: 256 seconds]
dANO has quit []
cleopatra has quit [Quit: Saliendo]
<s2013> >> data = [1,2,3,4,5,6]; data.sort.each_slice(data.size.fdiv(5).ceil).to_a
<eval-in__> s2013 => [[1, 2], [3, 4], [5, 6]] (https://eval.in/222654)
cleopatra has joined #ruby
yfeldblum has joined #ruby
nkumari has quit [Remote host closed the connection]
yfeldblum has quit [Client Quit]
shazaum has quit [Quit: Leaving]
whoisjake has joined #ruby
iamjarvo has joined #ruby
x1337807x has joined #ruby
arup_r has quit [Ping timeout: 264 seconds]
chipotle has quit [Max SendQ exceeded]
davidhq has joined #ruby
x1337807_ has joined #ruby
AndyBotwin has joined #ruby
teddyp1cker has joined #ruby
artm has joined #ruby
adriancb has quit [Remote host closed the connection]
teddyp1cker has quit [Read error: Connection reset by peer]
teddyp1cker has joined #ruby
* apeiros wants ceildiv
olivier_bK has joined #ruby
davidhq has quit [Client Quit]
yfeldblum has joined #ruby
yfeldblum has quit [Client Quit]
Jarboe has joined #ruby
<Timgauthier> shevy you are good at the hamls right?
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Timgauthier> or the yamls
<s2013> what do you need help with haml
<Timgauthier> and the camels
thsig has quit [Remote host closed the connection]
<Timgauthier> i just need someone to check to see if they can tell something obviously wrong.
Bira has quit [Remote host closed the connection]
<s2013> past eit
<deric_skibotn> Interesting finding: I have 5 classes I want to find in a huge codebase.
dualbus has joined #ruby
<s2013> thats yaml
<Timgauthier> it breaks the page and doesn't work if i have the info: and on, but fine without it.
<Timgauthier> sorry :S
x1337807x has quit [Ping timeout: 256 seconds]
momomomomo has joined #ruby
mary5030 has quit [Remote host closed the connection]
<deric_skibotn> ObjectSpace.each_object(TargetClass) do |obj| doSometing if obj.class.superclass == TargetClass ; end
<deric_skibotn> is 10 x slower than
<Timgauthier> its also being used in a php app s2013 ;)
<s2013> seems fine
<deric_skibotn> Object.constants.each do |klass| doSomething if Kernel.const_get(klass).superclass == TargetClass ; end
<s2013> check yamllint.com
kumarat9pm has quit [Ping timeout: 265 seconds]
f0ster has joined #ruby
pglombar_ has joined #ruby
nkumari has joined #ruby
yfeldblum has joined #ruby
<shevy> Timgauthier only yamls, hamls confuse me
<Timgauthier> haha
<Timgauthier> okay
<Timgauthier> well look at the pastie then bra
baweaver has quit [Remote host closed the connection]
adriancb has joined #ruby
jimbach has joined #ruby
<Timgauthier> lol yamllint is broken
jheg has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
mathias3 has joined #ruby
jlast has joined #ruby
dangerousdave has joined #ruby
pglombardo has quit [Ping timeout: 256 seconds]
timonv_ has quit [Ping timeout: 240 seconds]
lolmaus has quit [Quit: Konversation terminated!]
x1337807_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
papile has joined #ruby
narph has quit [Quit: Connection closed for inactivity]
tier has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
anaeem1 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
sdwrage has joined #ruby
anaeem1 has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
St1gma has joined #ruby
Fire-Dragon-DoL has joined #ruby
anaeem1 has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
mary5030_ has joined #ruby
tier has quit [Read error: Connection reset by peer]
giuseppesolinas has joined #ruby
tier has joined #ruby
n_blownapart has joined #ruby
rodfersou has quit [Quit: leaving]
mary5030_ has quit [Remote host closed the connection]
mary5030_ has joined #ruby
mary5030 has quit [Ping timeout: 245 seconds]
fabrice31 has quit [Ping timeout: 265 seconds]
tus has joined #ruby
mleung has quit [Quit: mleung]
econerd4ever has joined #ruby
jimbach has quit [Remote host closed the connection]
anaeem1 has quit [Ping timeout: 256 seconds]
noop has quit [Ping timeout: 255 seconds]
yeticry has quit [Ping timeout: 244 seconds]
jimbach has joined #ruby
jenrzzz has joined #ruby
baweaver has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
momomomomo has quit [Quit: momomomomo]
garethrees has joined #ruby
pengin has joined #ruby
j_mcnally has joined #ruby
mikepack has joined #ruby
matcouto has joined #ruby
bmichelsen has quit [Ping timeout: 272 seconds]
dangerousdave has joined #ruby
yeticry has joined #ruby
ClarusCogitatio has joined #ruby
aspiers has joined #ruby
bmichelsen has joined #ruby
econerd4ever has quit [Ping timeout: 264 seconds]
ghr has quit [Ping timeout: 264 seconds]
Squarepy has joined #ruby
artm has quit [Ping timeout: 255 seconds]
elaptics is now known as elaptics`away
jheg has quit [Quit: jheg]
<shevy> Timgauthier I love how you can drag and drop widgets through jquery
<Timgauthier> hm?
<Timgauthier> context?
<shevy> Timgauthier just saying!
<shevy> I stare at my .cgi files in awe
<Timgauthier> okay ;)
<shevy> as I drag around the images
<Timgauthier> lol
davidhq has joined #ruby
jheg has joined #ruby
davidhq has quit [Client Quit]
bmichelsen has quit [Client Quit]
adriancb has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
Takle has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
aspiers has quit [Ping timeout: 265 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
Mars` has quit [Ping timeout: 272 seconds]
nobitanobi has quit [Remote host closed the connection]
St1gma has quit [Read error: Connection reset by peer]
St1gma has joined #ruby
Mars` has joined #ruby
pengin has quit [Remote host closed the connection]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ldnunes has quit [Quit: Leaving]
pengin has joined #ruby
sailias has quit [Quit: Leaving.]
sailias1 has joined #ruby
livathin_ has quit []
Takle has quit [Ping timeout: 240 seconds]
zzzbra_ has quit [Ping timeout: 245 seconds]
karmatr0n has quit [Remote host closed the connection]
paulfm has quit []
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmichelsen has joined #ruby
wallerdev has joined #ruby
karmatr0n has joined #ruby
AndyBotwin has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
pengin has quit [Ping timeout: 258 seconds]
wallerdev has quit [Client Quit]
davidhq has joined #ruby
benzrf is now known as benzrf|offline
BenjiWiebe has joined #ruby
<BenjiWiebe> How do I get the real GID in Ruby?
<BenjiWiebe> On Linux. ruby-mri.
kamilc__ has quit [Quit: Linkinus - http://linkinus.com]
max96at is now known as max96at|off
mleung has joined #ruby
<shevy> either Process::GID
<shevy> or gid = Etc.getgrnam("users").gid
<BenjiWiebe> OK, thanks.
<shevy> or through Etc.passwd { |u|; u.gid
sdwrage_ has joined #ruby
davidhq has quit [Client Quit]
<BenjiWiebe> Cause I have a Ruby script that is getting called by a setgid wrapper program.
<BenjiWiebe> And I want to drop the setgid privilege temporarily.
<BenjiWiebe> Is that possible?
davidhq has joined #ruby
<BenjiWiebe> Say it is running as webmaster:specialgroup, I want to launch a subprocess as webmaster:webmaster, then resume webmaster:specialgroup.
dj_zubehoer has joined #ruby
<shevy> hmm
davidhq has quit [Client Quit]
maoko has joined #ruby
<shevy> I believe it is not allowed to change the gid if it were to outgrow its starting ID
<shevy> not sure however
<BenjiWiebe> huh?
Takle has joined #ruby
sdwrage has quit [Ping timeout: 240 seconds]
<BenjiWiebe> "outgrow its starting ID"?
cleopatra has left #ruby ["Saliendo"]
delianides has joined #ruby
<shevy> yeah
<shevy> can processes freely change their affiliated IDs?
zzzbra has joined #ruby
<BenjiWiebe> idk...
<BenjiWiebe> seems they should be able to give up privileges.
dangerousdave has joined #ruby
teddyp1cker has joined #ruby
<shevy> you mean downwards? I am not sure
<shevy> I really don't know haha
<shevy> if I were in change of an operating system, like the CPU in Tron 1 movie ...
<shevy> I'd shake my head and say "No dice. Never ever. You stay how you were born, you filthy programs!"
<shevy> those who refuse will have to duke it out in the arena
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<BenjiWiebe> This script is a simple message-posting script, usable by all users on my Linux computer.
maoko has quit [Quit: Textual IRC Client: www.textualapp.com]
<BenjiWiebe> Looking...
davidhq has joined #ruby
<BenjiWiebe> jhass: That isn't reversible, is it?
<jhass> therefore fork
maoko has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrisja has joined #ruby
<shevy> hehehe
<BenjiWiebe> Oh OK...hadn't thought of that.
<BenjiWiebe> lol
msgodf has joined #ruby
<BenjiWiebe> So simple.
fantazo has quit [Quit: Verlassend]
<jhass> in the fork just Kernel#exec to effectively get Kernel#spawn behavior
moritzs has quit [Ping timeout: 258 seconds]
dj_zubehoer has quit [Remote host closed the connection]
<BenjiWiebe> I don't want to exec.
baweaver has quit [Remote host closed the connection]
teddyp1cker has quit [Ping timeout: 240 seconds]
Blizzy has joined #ruby
<BenjiWiebe> Cause I actually am opening a pipe.
aspiers has joined #ruby
<BenjiWiebe> To a pager (and 'less' allows executing commands, which is why I want to drop privileges)
clauswit_ has joined #ruby
<BenjiWiebe> ^^^ In fact, a user of mine (in fun, I knew he was doing something) exploited it and ran some code under my account.
davidhq has quit [Client Quit]
tier has quit [Remote host closed the connection]
jespada has quit [Quit: Leaving]
<jhass> oh, then don't forget to Process.wait in the parent
<BenjiWiebe> jhass: Actually thought of that myself, this time. :)
kumarat9pm has joined #ruby
VBlizzard has quit [Ping timeout: 258 seconds]
adriancb has joined #ruby
momomomomo has joined #ruby
kireevco has quit [Read error: Connection reset by peer]
kireevco1 has joined #ruby
<BenjiWiebe> jhass: It isn't working, though. https://gist.github.com/BenjiWiebe/9dc09b96e9d0826e9cc4
<jhass> kinda odd that none of the many Kernel#spawn options provides this
jheg has quit [Quit: jheg]
<BenjiWiebe> jhass: Ah...figured it out, kinda.
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BenjiWiebe> jhass: Because of the wrapper program having the egid set to (in this case) 1012, the *real* gid (rgid) of the script itself is set to 1012.
mary5030_ has quit [Remote host closed the connection]
delianides has quit [Ping timeout: 240 seconds]
<BenjiWiebe> I need to look up the primary group of the user running it...
Mars` has quit [Ping timeout: 245 seconds]
sambao21 has joined #ruby
giuseppesolinas has joined #ruby
<jhass> mmh, I'm actually not sure yet if change_privilege actually drops
jheg has joined #ruby
<BenjiWiebe> now I get EPERM!!
<BenjiWiebe> Seems I have no way of accessing the user's real GID.
jdj_dk has quit [Remote host closed the connection]
junmapro has joined #ruby
moted has joined #ruby
moted has quit [Client Quit]
<junmapro> how do we check what type of thing the object is?
dj_zubehoer has joined #ruby
synergyz has quit [Ping timeout: 245 seconds]
<junmapro> i mean ifit's astring or an array or whatnot
<junmapro> integer
<jhass> meh, there was a time where I understood all the gid, egid and so on stuff, all gone already
jenrzzz has joined #ruby
<jhass> junmapro: .class for example
mary5030 has joined #ruby
<jhass> .inspect gives a programmer friendly representation
<junmapro> i'm getting nil class
<junmapro> NilClass
<jhass> then it's nil
<jhass> >> nil.class
<eval-in__> jhass => NilClass (https://eval.in/222660)
<junmapro> but what if i want to know if it's an array
<jhass> .is_a? Array
dj_zubehoer has quit [Remote host closed the connection]
<jhass> it might be better to try calling #to_a
<shevy> junmapro always via .is_a?
<godd2> >> [true.class, false.class, nil.class]
<eval-in__> godd2 => [TrueClass, FalseClass, NilClass] (https://eval.in/222661)
<jhass> that way the caller can decide what to pass you
<ericwood> I wish there was an alias for is_an
<junmapro> oh there's no other way?
<ericwood> >> [].is_an?(Array)
<eval-in__> ericwood => undefined method `is_an?' for []:Array (NoMethodError) ... (https://eval.in/222662)
<ericwood> :(
Duckily has joined #ruby
<jhass> junmapro: what's your real problem?
<shevy> ericwood that is the wrong question
francisfish has joined #ruby
BenjiWiebe has quit [Quit: Konversation terminated!]
<shevy> the question must be "Object, do you have this?"
_br_ has quit [Ping timeout: 250 seconds]
<shevy> apeiros explained that once
<junmapro> jhass: my real problem is that i'm trying to create a program that capitalizes multiple words and excludes the little words that aren't meant to be capitalized
<apeiros> 2nd vs. 3rd person in method names?
<shevy> it would be proper english, but the wrong question for the object
<apeiros> sadly ruby isn't consistent there.
<shevy> like File.exist? vs. File.exists?
bricker`work has quit [Quit: leaving]
Timgauthier has quit [Quit: Textual IRC Client: www.textualapp.com]
<jhass> junmapro: and why do you need to know whether something is an array?
dj_zubehoer has joined #ruby
<junmapro> i'm thinking of turning the title into an array and then scanning for each word, if it's on the list, it won't capitalize it, but if it isn't it will continue capitalizing each item in the array
delianides has joined #ruby
<ericwood> if it's reading like english it might as well have a few aliases for grammar
baweaver has joined #ruby
<godd2> >> [].kind_of? Array # I know it's not the same as is_a?
<eval-in__> godd2 => true (https://eval.in/222663)
<junmapro> input ===> "this is a title" output ====> "This is a Title"
St1gma has quit [Read error: Connection reset by peer]
<shevy> it's more like japanglish
dj_zubehoer has quit [Remote host closed the connection]
<jhass> junmapro: I don't see why you would need to check whether something is an array there :)
St1gma has joined #ruby
bricker`work has joined #ruby
thsig has joined #ruby
kireevco1 has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
xymbol has quit [Quit: Be back later ...]
almostworking has joined #ruby
Duckily has quit [Quit: Duckily]
kish is now known as fdemocracy
almostworking has left #ruby [#ruby]
Guest2671 has joined #ruby
<rpag_> jhass, I prefer "===" over is_a?/kind_of?, since BasicObject implements === but not the other two
Bira has joined #ruby
<jhass> I prefer === nowhere
bmichelsen has quit [Ping timeout: 255 seconds]
<jhass> it's for case statements, that's all
<rpag_> you don't like, Array === obj ?
<jhass> no
_br_ has joined #ruby
<jhass> the .is_a?'s should be rare too
<rpag_> Array === obj works the same as obj.is_a?(Array), and if 'Array' is dynamic(could be BasicObject), it'll work in that case too, so thats why i prefer it
<jhass> You can't trick Module#=== though
hiyosi has joined #ruby
<rpag_> trick it?
kasperti_ has quit []
momomomomo has quit [Quit: momomomomo]
<jhass> class PretendedArray; def is_a?(klass); klass == Array; end; end;
synergyz has joined #ruby
<jhass> harms duck typing even more than is_a? does
dangerousdave has joined #ruby
Guest2671 has quit [Client Quit]
<rpag_> i dont follow
davidhq has joined #ruby
garethrees has quit [Ping timeout: 250 seconds]
<jhass> >> class PretendedArray; def is_a?(klass); klass == Array; end; end; obj = PretendedArray.new; [obj.is_a?(Array), Array === obj]
<eval-in__> jhass => [true, false] (https://eval.in/222664)
St1gma has quit [Read error: Connection reset by peer]
Bira has quit [Ping timeout: 240 seconds]
<shevy> if it talks like a duck
<shevy> and smells like a duck
St1gma has joined #ruby
<shevy> I'm gonna cook it
St1gma has quit [Read error: Connection reset by peer]
* omosoj tucks bib into shirt.
St1gma has joined #ruby
miah has quit [Quit: DevOps? DerpOps maybe!]
_br_ has quit [Ping timeout: 255 seconds]
momomomomo has joined #ruby
hiyosi has quit [Ping timeout: 240 seconds]
DaniG2k has joined #ruby
davidhq has quit [Client Quit]
<rpag_> >> class PretendedArray; def is_a?(klass); klass == Array; end; PretendedArray.new.is_a?(PretendedArray)
<eval-in__> rpag_ => /tmp/execpad-9d85a72c1142/source-9d85a72c1142:7: syntax error, unexpected end-of-input, expecting keyword_end (https://eval.in/222665)
<rpag_> >> class PretendedArray; def is_a?(klass); klass == Array; end; end; PretendedArray.new.is_a?(PretendedArray)
<eval-in__> rpag_ => false (https://eval.in/222666)
<rpag_> hehe
<jhass> rpag_: solvable, not the point
Soda has joined #ruby
<rpag_> i will still prefer ===, because of the BasicObject case, which i've run into in real world code
dangerousdave has quit [Ping timeout: 264 seconds]
Soda has quit [Remote host closed the connection]
<jhass> and I run into problems because of people like you in real world code
bahar has quit [Ping timeout: 256 seconds]
momomomomo has quit [Client Quit]
<jhass> and no, I'm not making that up
<rpag_> thats a bit harsh
<rpag_> what problems do i introduce by using === ?
<jhass> you harm duck typing and delegation, both preferred practices in the ruby world
<rpag_> i dont use ===/is_a? much
<shevy> harm ducks
<rpag_> but when i do, I use ===
<shevy> I am all for radical violence against them
x1337807x has joined #ruby
<jhass> as I've shown you can workaround is_a?
tier has joined #ruby
x1337807x has quit [Max SendQ exceeded]
<jhass> you can't workaround Moudle#===
<shevy> also harm all Moudles
clauswit_ has quit [Quit: Textual IRC Client: www.textualapp.com]
x1337807x has joined #ruby
bahar has joined #ruby
St1gma has quit [Read error: Connection reset by peer]
claymore has quit [Quit: Leaving]
St1gma has joined #ruby
kasperti_ has joined #ruby
Mars` has joined #ruby
<rpag_> jhass, the delegation case is valid, but so is the BasicObject case. it doesn't have is_a?, it would never work.
<rpag_> and BasicObject is a possible, in my case anyway
danijoo has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
<jhass> rpag_: what do you use BasicObject for if not delegation?
rshetty has joined #ruby
sailias has quit [Quit: Leaving.]
sailias1 has joined #ruby
sailias1 is now known as sailias
<rpag_> jhass, this code was in somewhere deep in pry
danijoo has joined #ruby
tier has quit [Remote host closed the connection]
<rpag_> -in
mleung has quit [Quit: mleung]
<jhass> doesn't really answer my question
dj_zubehoer has joined #ruby
kireevco has left #ruby [#ruby]
shredding has joined #ruby
thsig has quit [Remote host closed the connection]
davidhq has joined #ruby
<rpag_> i don't have the code at hand, but the case was that I could receive ANY object(BasicObject included), so is_a? wouldn't have worked.
<jhass> question is why you needed to know it's BasicObject
<rpag_> i wasnt checking for BasicObject
dj_zubehoer has quit [Remote host closed the connection]
<rpag_> it was the object i could call is_a? on
<jhass> or why you needed an is_a? at all
anaeem1 has joined #ruby
x1337807x has quit [Ping timeout: 264 seconds]
oo_ has joined #ruby
mattmcclure has joined #ruby
<rpag_> sure, duck typing is preferable, but it doesn't fit every case
davidhq has quit [Client Quit]
treehug8_ has joined #ruby
dangerousdave has joined #ruby
mathias3 has quit [Ping timeout: 240 seconds]
<jhass> anyway, there sure a rare cases where you have to use Module#=== because you can't call #is_a? and rare cases where you need #is_a?
x1337807x has joined #ruby
<jhass> that doesn't mean it's generally better to use Module#=== over #is_a? or #is_a? at all
<rpag_> i have preferred === since then, because i haven't ever come across the delegation case
treehug88 has quit [Ping timeout: 255 seconds]
benzrf|offline is now known as benzrf
rshetty has quit [Ping timeout: 265 seconds]
_br_ has joined #ruby
drkyro has joined #ruby
momomomomo has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
tier has joined #ruby
<rpag_> i don't use is_a? or === that much, but when I have to, === has been reliable where as is_a? hasn't.
tier has quit [Remote host closed the connection]
<junmapro> what would you guys recommend that i do?
<junmapro> for the title program?
<rpag_> about what?
anaeem1 has quit [Ping timeout: 256 seconds]
oo_ has quit [Ping timeout: 244 seconds]
blackmes1 has quit [Ping timeout: 250 seconds]
<junmapro> basically it should do this "this is a nice title" and do this "This is a Nice Title"
d4nku has quit [Read error: Connection reset by peer]
<junmapro> what is the logic behind that program?
<rpag_> why don't you capitalize "is a" ?
<junmapro> why shouldn't i use an array for it?
<junmapro> rpag_: because of english rules
<atmosx> aloha
<rpag_> i don't see why "Nice Title" is capitalized then
<junmapro> because english rules
decoponio has quit [Quit: Leaving...]
<rpag_> Nice Title wouldn't be capitalized in english, unless it's suppose to be a name?
<atmosx> mcdonalds or corn flakes (chocolate ones)
<atmosx> with milk?
<jhass> junmapro: I didn't say you shouldn't use an array. I said I don't see why you need to check that you have an array for that
spider-mario has quit [Remote host closed the connection]
<atmosx> rpag_: or day or month
tus has quit [Ping timeout: 256 seconds]
<junmapro> does %w() turn stuff into an array?
DaniG2k has quit [Ping timeout: 256 seconds]
<rpag_> its a literal syntax for an array yup
<jhass> it's an array literal
thsig has joined #ruby
maoko has quit [Quit: Textual IRC Client: www.textualapp.com]
razieliyo has quit [Read error: Connection reset by peer]
ptrrr has quit [Quit: ptrrr]
<rpag_> %w(foo) is the same as ['foo']
<junmapro> thanks guys
St1gma has quit [Read error: Connection reset by peer]
<junmapro> what would you recommend that i do if i wanted to recreate something similar to that site?
st1gma1 has joined #ruby
StevePerkins has joined #ruby
aspiers has quit [Ping timeout: 258 seconds]
StevePerkins has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
jenrzzz has quit [Ping timeout: 255 seconds]
<jhass> to recreate it perfectly you would need grammatical analyses of the sentence
<jhass> not trivial at all
JBreit has joined #ruby
sk87 has joined #ruby
<jhass> if it actually manages to implement the rules written there
<atmosx> >> a = w%(dog bark's)
<eval-in__> atmosx => /tmp/execpad-22e12f6cf685/source-22e12f6cf685:2: unterminated string meets end of file ... (https://eval.in/222667)
<atmosx> >> a = w%(dog barks)
<eval-in__> atmosx => undefined local variable or method `w' for main:Object (NameError) ... (https://eval.in/222668)
<atmosx> oh shit
<atmosx> lol
<atmosx> bbl
<jhass> for a quick best effort, I guess a whitelist of lowercase words is actually not a bad approach
<jhass> in any case, the first step is to settle on a set of rules you want to implement
fantazo has joined #ruby
omosoj has quit [Ping timeout: 250 seconds]
JBreit has left #ruby [#ruby]
x1337807x has quit [Ping timeout: 250 seconds]
fdemocracy is now known as kish
elaptics`away is now known as elaptics
whoisjake has quit []
shemerey has joined #ruby
kireevco has joined #ruby
baweaver has joined #ruby
t_mmyv has quit [Ping timeout: 256 seconds]
gregoriokusows-1 has quit [Ping timeout: 264 seconds]
<junmapro> thanks jhass
wallerdev has joined #ruby
havenwood has joined #ruby
dorei has joined #ruby
oleo has quit [Read error: Connection reset by peer]
almostworking has joined #ruby
almostworking has left #ruby [#ruby]
shemerey has quit [Quit: Textual IRC Client: www.textualapp.com]
danijoo has quit [Read error: Connection reset by peer]
robertt_dex has quit [Remote host closed the connection]
danijoo has joined #ruby
adriancb has quit [Remote host closed the connection]
x77686d has joined #ruby
andrewlio has quit [Ping timeout: 264 seconds]
paulfm has joined #ruby
ClarusCogitatio has quit [Ping timeout: 245 seconds]
paulfm has quit [Remote host closed the connection]
agent_white has joined #ruby
blackmes1 has joined #ruby
DaniG2k has joined #ruby
st1gma1 has quit [Read error: Connection reset by peer]
* DaniG2k
shemerey has joined #ruby
st1gma1 has joined #ruby
ClarusCogitatio has joined #ruby
thsig has quit [Remote host closed the connection]
paulfm has joined #ruby
<shevy> DaniG2k that's a great emote!
adriancb has joined #ruby
<DaniG2k> lolz
ht__th has quit [Remote host closed the connection]
parabolize has joined #ruby
razieliyo has joined #ruby
razieliyo has quit [Changing host]
razieliyo has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
Morkel has quit [Quit: Morkel]
timonv_ has joined #ruby
karmatr0n has quit [Remote host closed the connection]
aspiers has joined #ruby
oleo has joined #ruby
unpeet has joined #ruby
drkyro has quit [Quit: Textual IRC Client: www.textualapp.com]
st1gma1 has quit [Read error: Connection reset by peer]
st1gma1 has joined #ruby
Channel6 has joined #ruby
lepht has joined #ruby
Naeblis has left #ruby ["Textual IRC Client: www.textualapp.com"]
timonv_ has quit [Ping timeout: 255 seconds]
iamjarvo has joined #ruby
michaeldeol has quit [Quit: Textual IRC Client: www.textualapp.com]
michaeldeol has joined #ruby
rdark_ has quit [Quit: leaving]
mary5030 has quit [Remote host closed the connection]
<junmapro> i don't get what expression i should use
rkalfane has quit [Quit: Textual IRC Client: www.textualapp.com]
fabrice31 has joined #ruby
andrewcarter has quit [Quit: Connection closed for inactivity]
michaeldeol has quit [Client Quit]
<junmapro> <unpeet> show gratis (solo hooy) --> http://s422803032.DONOTGOTOTHISBADSITE.es
RoryHughes_ is now known as RoryHughes
<junmapro> !ops
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
hiyosi has joined #ruby
perrier has quit [Remote host closed the connection]
perrier has joined #ruby
fabrice31 has quit [Ping timeout: 245 seconds]
Mars` has quit [Ping timeout: 264 seconds]
michaeldeol has joined #ruby
unpeet has quit [K-Lined]
<jhass> apeiros: ^
synergyz has quit [Read error: Connection reset by peer]
tus has joined #ruby
tus has quit [Changing host]
tus has joined #ruby
<jhass> junmapro: what rules have you set
wldcordeiro has quit [Quit: Leaving]
synergyz has joined #ruby
<junmapro> well the rules in plain english are this: i have an array of 3 words that shouldn't be capitalized and capitalize the rest
<junmapro> i am having a hard time putting it into "ruby"
<junmapro> phrasing that sentence for me in the ruby langauge
Xeago has joined #ruby
timonv_ has joined #ruby
Mars` has joined #ruby
<jhass> okay, try to write in plain english an algorithm that implements this rule
nkumari has quit [Remote host closed the connection]
<jhass> what steps can you imagine to do that
omosoj has joined #ruby
mleung has joined #ruby
despai has joined #ruby
msgodf has quit [Ping timeout: 264 seconds]
Channel6 has quit [Quit: Leaving]
jheg has quit [Quit: jheg]
havenwood has quit [Remote host closed the connection]
shemerey has quit [Quit: Textual IRC Client: www.textualapp.com]
ndrei has quit [Ping timeout: 264 seconds]
shemerey has joined #ruby
havenwood has joined #ruby
shemerey has quit [Client Quit]
thsig has joined #ruby
MattB2 has quit [Ping timeout: 250 seconds]
nkumari has joined #ruby
shemerey has joined #ruby
timonv_ has quit [Remote host closed the connection]
ClarusCogitatio has quit [Ping timeout: 264 seconds]
econerd4ever has joined #ruby
Duckily has joined #ruby
paulfm has quit []
JDiPierro has quit [Remote host closed the connection]
aclearman037 has quit [Quit: I'm out!]
ClarusCogitatio has joined #ruby
samuel02 has quit []
centrx has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has quit [Ping timeout: 250 seconds]
valeriansaliou has joined #ruby
mathias3 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thsig has quit [Ping timeout: 255 seconds]
Areessell has quit [Read error: Connection reset by peer]
revoohc has quit [Quit: revoohc]
MattB2 has joined #ruby
delianides has quit [Remote host closed the connection]
valeriansaliou has quit [Client Quit]
<junmapro> jhass: well the only algorithm i can think of is capitalize all the words in the list unless they're in the white list
<junmapro> unless one of the words is in the whitelist
_br_ has quit [Ping timeout: 264 seconds]
<jhass> "the list"? start by defining your input, where does it come from, what do you need to do with it in order 1) apply capitalization 2) exclude certain words from capitalization
benzrf is now known as benzrf|offline
mathias3 has quit [Ping timeout: 250 seconds]
kevinfagan_ has quit [Ping timeout: 250 seconds]
sindork_ has quit [Ping timeout: 250 seconds]
ThaDick has quit [Quit: ThaDick]
nobitanobi has quit [Remote host closed the connection]
sindork has joined #ruby
tier has joined #ruby
<junmapro> this is what i have
tesaf has quit [Quit: Lost terminal]
<junmapro> i hope it makes sense
QKO has quit [Ping timeout: 250 seconds]
sarlalia1 has quit [Ping timeout: 250 seconds]
tier has quit [Remote host closed the connection]
DaniG2k has quit [Quit: leaving]
<junmapro> jhass:
livingstn has quit []
QKO has joined #ruby
<godd2> junmapro word.split wont change what's in the word variable
tgandrews has quit [Quit: tgandrews]
kevinfagan has joined #ruby
<jhass> junmapro: start by using variable names that actually describe their value
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> how can a word contain multiple words
<jhass> word.each do |words|
freerobby has quit [Quit: Leaving.]
<jhass> that doesn't make any sense
<airdeluxe> -_-
<junmapro> i still don't get what .each do |stuff| really does
<junmapro> :(
<junmapro> jhass: what do you mean by using a variable name that describes their value
<jhass> word = 'foo'; words = 'foo bar'; words = ['foo', 'bar']
<jhass> see, these make sense
<jhass> it's a single word, or it's multiple words
<godd2> junmapro collection.each do |yielded_member| will take each member of the collection and yield it to the yielded_member variable for a single loop
warreng has joined #ruby
<jhass> word.each do |words|, word is a single word. You iterate over that single word. expecting to yield words ?
iamjarvo has joined #ruby
<jhass> how can a word contain multiple words?
<jhass> that's confusing and doesn't help you to understand your code
<junmapro> what is a foo bar?
<jhass> just placeholders
sarlalia1 has joined #ruby
nobitanobi has joined #ruby
<jhass> in this case two words
jmdade has quit [Quit: Textual IRC Client: www.textualapp.com]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> so, each takes a collection, something that holds multiple items, like an array or a hash
<jhass> for each item in the collection it invokes the block you pass it, passing it one of the items
<airdeluxe> "i am wordy".scan(/\w+/) do |werd| puts werd.capitalize end
allcentury has quit [Ping timeout: 265 seconds]
<junmapro> thank you godd2
<airdeluxe> nice godd2
<junmapro> brb i'm going to make some food
<airdeluxe> code blocks for the winn
carlosoliveira has quit [Quit: Connection closed for inactivity]
nobitanobi has quit [Ping timeout: 255 seconds]
dkphenom has joined #ruby
omosoj has quit [Quit: leaving]
tkuchiki has joined #ruby
havenwood has joined #ruby
thsig has joined #ruby
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has quit [Ping timeout: 264 seconds]
thsig has quit [Client Quit]
shredding has quit [Quit: shredding]
Alina-malina has quit [Ping timeout: 272 seconds]
St_Marx has joined #ruby
aspiers has quit [Ping timeout: 245 seconds]
nobitanobi has joined #ruby
teddyp1cker has joined #ruby
procat has quit [Ping timeout: 250 seconds]
jxf has quit [Ping timeout: 240 seconds]
benzrf|offline is now known as benzrf
sambao21 has quit [Quit: Computer has gone to sleep.]
sambao21 has joined #ruby
teddyp1cker has quit [Ping timeout: 258 seconds]
it0a has quit [Quit: WeeChat 1.0.1]
byprdct_ has quit [Quit: by]
jlast has quit [Remote host closed the connection]
jxf has joined #ruby
jerius has quit [Ping timeout: 240 seconds]
jlast has joined #ruby
aspiers has joined #ruby
dj_zubehoer has joined #ruby
Bira has joined #ruby
doodlehaus has quit [Remote host closed the connection]
Alina-malina has joined #ruby
moritzs has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tus has quit [Ping timeout: 245 seconds]
codecop has quit [Remote host closed the connection]
m8 has quit [Quit: Sto andando via]
oculus has joined #ruby
dj_zubehoer has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 250 seconds]
Bira has quit [Ping timeout: 255 seconds]
josephndenton has quit [Ping timeout: 255 seconds]
zzzbra has quit [Remote host closed the connection]
ghr has joined #ruby
x1337807x has joined #ruby
zzzbra has joined #ruby
banister has joined #ruby
nateberkopec has quit [Quit: Leaving...]
jenrzzz has joined #ruby
ghr has quit [Ping timeout: 250 seconds]
cj has left #ruby [#ruby]
rshetty has joined #ruby
ClarusCogitatio has quit [Ping timeout: 240 seconds]
x1337807x has quit [Ping timeout: 255 seconds]
kireevco1 has joined #ruby
dcope has left #ruby [#ruby]
kireevco has quit [Ping timeout: 245 seconds]
Alina-malina has quit [Ping timeout: 272 seconds]
josephndenton has joined #ruby
sinequanon has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
ghr has joined #ruby
ClarusCogitatio has joined #ruby
rshetty has quit [Ping timeout: 256 seconds]
chrisja has quit [Quit: leaving]
Vivekananda has joined #ruby
Alina-malina has joined #ruby
sailias has quit [Quit: Leaving.]
shemerey has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dj_zubehoer has joined #ruby
aspiers has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
nkumari has quit [Remote host closed the connection]
s2013 has quit [Quit: Leaving]
silkfox has quit [Ping timeout: 272 seconds]
Nogbit has joined #ruby
nkumari has joined #ruby
Kricir has quit [Remote host closed the connection]
deric_skibotn has quit [Ping timeout: 258 seconds]
freerobby has joined #ruby
visof has joined #ruby
zzzbra has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
jobewan has quit [Quit: Leaving]
tkuchiki has quit [Ping timeout: 256 seconds]
nkumari has quit [Ping timeout: 258 seconds]
ClarusCogitatio has quit [Ping timeout: 256 seconds]
deric_skibotn has joined #ruby
lektrik has quit [Ping timeout: 255 seconds]
hmsimha_ has joined #ruby
zzzbra has joined #ruby
phutchins has quit [Quit: Lost terminal]
phutchins has joined #ruby
ClarusCogitatio has joined #ruby
Mateon1 has quit [Ping timeout: 272 seconds]
emmesswhy has joined #ruby
nkumari has joined #ruby
Riking is now known as Rikimg
<dukedave> Has anyone here used Hashie's coercion and and 'Trash' functionality at the same time?
ramfjord has quit [Ping timeout: 245 seconds]
visof has quit [Ping timeout: 258 seconds]
woven has joined #ruby
oculus has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
spyderman4g63 has quit [Remote host closed the connection]
kirun has quit [Quit: Client exiting]
oculus has joined #ruby
mathias3 has joined #ruby
ramfjord has joined #ruby
n_blownapart has quit [Remote host closed the connection]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
kireevco has joined #ruby
treehug8_ has quit []
kireevco1 has quit [Read error: Connection reset by peer]
mathias3 has quit [Ping timeout: 255 seconds]
beowuff has joined #ruby
beowuff has left #ruby [#ruby]
n_blownapart has joined #ruby
rshetty has joined #ruby
Alina-malina has quit [Ping timeout: 265 seconds]
Darryl_ has quit [Quit: Connection closed for inactivity]
woven has quit [Ping timeout: 255 seconds]
kaawee has joined #ruby
xymbol has joined #ruby
<kaawee> Hello! How do I build a gem which depends on one list of gems if the platform is JRuby and on a different list of gems if the platform is MRI?
<rpag_> kaawee, build two gems, one for MRI, one for JRuby
giuseppesolinas has joined #ruby
<pipework> havenwood: Hey, are you at the rubyconfs?
sambao21 has joined #ruby
Alina-malina has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
<havenwood> pipework: yup yup
<havenwood> pipework: we should hang out
<pipework> havenwood: Where at? I'm listening to the ruby idioms at like 25.
jhwhite has joined #ruby
rshetty has quit [Ping timeout: 240 seconds]
Channel6 has joined #ruby
<havenwood> pipework: my battery is about to die, i need to plug in. but i'm planning on Deoptimizing Ruby after the break
<pipework> havenwood: You find me, I'm the ginger with the dogen.
<pipework> I'll head there.
* havenwood googles dogen
droidburgundy has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<pontiki> wish i were there
<havenwood> pontiki: come next year!
<pontiki> where is it next year?
<havenwood> dunno
<pontiki> i <3 san diego
<havenwood> pontiki: i think they'll announce on wed
kasperti_ has quit []
* pontiki nods
havenwood has quit []
fabrice31 has joined #ruby
st1gma1 has quit [Read error: Connection reset by peer]
zzzbra has quit [Remote host closed the connection]
mr_foobar_baz has joined #ruby
st1gma1 has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
vectra has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
toertore has quit [Ping timeout: 264 seconds]
lmickh has quit [Remote host closed the connection]
renderful has quit [Remote host closed the connection]
bricker`work has quit [Quit: Lost terminal]
karmatr0n has joined #ruby
nkumari has quit [Remote host closed the connection]
Bira has joined #ruby
nkumari has joined #ruby
nobitanobi has quit [Remote host closed the connection]
dj_zubehoer has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 258 seconds]
nobitanobi has joined #ruby
baweaver has joined #ruby
etech0_ has joined #ruby
nkumari has quit [Remote host closed the connection]
<etech0_> Hi! How do I rasie an argumenterror?
Bira has quit [Ping timeout: 264 seconds]
<eam> >> raise ArgumentError
<eval-in__> eam => ArgumentError (ArgumentError) ... (https://eval.in/222721)
<etech0_> what if I want the error to show certain text?
<etech0_> depending on why I'm raising the error?
<eam> >> raise ArgumentError.new("I don't like your argument")
<eval-in__> eam => I don't like your argument (ArgumentError) ... (https://eval.in/222722)
Squarepy has quit [Read error: Connection reset by peer]
<etech0_> got it. So what's the stuff in Rescue?
st1gma1 has quit [Read error: Connection reset by peer]
nobitanobi has quit []
st1gma1 has joined #ruby
pocketprotector_ has joined #ruby
parzzix has quit [Ping timeout: 264 seconds]
TeresaP has quit [Ping timeout: 246 seconds]
fumduq has joined #ruby
<jhass> subclasses of Exception
Channel6 has quit [Remote host closed the connection]
woven has joined #ruby
<etech0_> what's the point?
<jhass> rescuing exceptions
pietr0 has joined #ruby
etech0 has quit [Quit: Page closed]
banana-socks has joined #ruby
vectra has quit [Ping timeout: 258 seconds]
delianides has joined #ruby
emmesswhy has quit [Quit: Leaving]
<banana-socks> I'm writing a ruby script, and want to display a number as curerncy. For some reason the number_as_currency method is giving me an error. Why could that be?
<jhass> banana-socks: maybe it doesn't exist
delianides has quit [Remote host closed the connection]
<banana-socks> it says "undefined method"
delianides has joined #ruby
<jhass> okay, it doesn't exist
phutchins has quit [Ping timeout: 272 seconds]
delianides has quit [Client Quit]
<banana-socks> typo. I meant to write that I'm using number_to_currency
<banana-socks> does that one exist?
<jhass> not in core or stdlib ruby
<rpag_> it's from rails
<banana-socks> aha!
<rpag_> actionview helper
<banana-socks> is there any similar method that would work in plain ruby?
<jhass> String#% should get you close enough
<rpag_> check the source of the method
<banana-socks> where do i find the source?
<MattB2> banana-socks: or just use actionview helper
valeriansaliou has joined #ruby
<jhass> I wouldn't add actionview as a dependency for just one of its helpers
<rpag_> it seems to just delegate to activesupport, but here you go (click 'show source'): http://apidock.com/rails/ActionView/Helpers/NumberHelper/number_to_currency
jhass has quit [Read error: Connection reset by peer]
<banana-socks> the soource looks like it's just calling itself!
jhass has joined #ruby
ramfjord has joined #ruby
<rpag_> it's being called from actionview, and calls activesupport
<banana-socks> sounds complicated!!
geggam has quit [Ping timeout: 245 seconds]
valeriansaliou has quit [Ping timeout: 265 seconds]
kireevco1 has joined #ruby
Azure has quit [Quit: Blue Sky Fish]
kireevco has quit [Read error: Connection reset by peer]
<ericwood> most stuff like that delegates to ActiveSupport
<ericwood> ActiveSupport::NumberHelper.number_to_currency(number, options)
<ericwood> that's all you want
Vivekananda has quit [Read error: No route to host]
Hijiri has quit [Ping timeout: 272 seconds]
jhass has quit [Quit: Bye]