<zenspider>
you just threw ordering out the window
<zenspider>
these requirements sure look like BS to me
failshell has quit [Remote host closed the connection]
<b3itz>
hey guys, so i need to loop through a txt file "inFile" line by line and parse the data into an array. the data in the inFile is structured like, 33, 55, 22 etc. how in the world do i take that inFile and parse it into an array/?
<jenrzzz>
MattB: you're gonna need to access a.values no matter what you do, so there's not much to be gained by avoiding the intermediate arrays
balazs has quit [Ping timeout: 258 seconds]
<b3itz>
obiously i need to loop throigh the file line by line... inFile.each_line do |line|?
balazs has joined #ruby
troyready has quit [Ping timeout: 250 seconds]
geggam has quit [Ping timeout: 265 seconds]
<zenspider>
b3itz: obviously?
<jenrzzz>
MattB: but you could do some shenanigans like hash.each.with_index.with_object({}) do |(k, v), i, h|... if you want to keep it all in a block and avoid calling Hash[]
<pontiki>
b3itz: it's a comma-separated line?
<gr33n7007h>
b3itz, ARGF.each do |line| ....
it0a has joined #ruby
<b3itz>
pontiki: no, just using the return button
klaut_ has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<jenrzzz>
b3itz: that sounds like a CSV file. have you checked out the CSV module?
cpruitt has quit [Quit: cpruitt]
<pontiki>
ok, never mind
<b3itz>
jenrzzz: this is an assignment using a txt file my prof provided
<pontiki>
homework?
<pontiki>
hah
<jenrzzz>
ah. what part are you stuck on?
<MattB>
jenrzzz: Okay thanks.
<b3itz>
yes homework. Well, i have the file opened File.open('input.txt', 'r')
<b3itz>
then im not sure how to loop through and create an array out of each line
michael3 has joined #ruby
<b3itz>
11 55 29 68 22 => i need to then read that line in, and create an array, data, [11, 55, 29, 68, 22]\
<eam>
b3itz: what methods are available on your file object?
<eam>
the_file = File.open('input.txt', 'r') # now, what methods are available to call on the_file?
<lampd1>
jenrzzz: but he doesn't need to parse an html file
<lampd1>
lol ;)
<eam>
b3itz: read through jenrzzz's link, try using some of those methods documented there
<jenrzzz>
this is srs business for srs programmers
<jenrzzz>
no jokes allowed
<jenrzzz>
you could put an eye out
<lampd1>
all jokes aside, i need to dig into some file parsing right now too :(
TeresaP has quit [Quit: Page closed]
<b3itz>
ok lemme take a look real quick, am i on the right track thinking i need to use a for loop to iterate through and seperate items in the array by the space?
<lampd1>
hooray for APIless software \o/
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<MattB>
jenrzzz: That's an abomination: hash.each.with_index.with_object({}) do |(k, v), i, h| ! :-) Think I'll stick with Hash[]
<jenrzzz>
MattB: yep :)
<jenrzzz>
b3itz: you should almost never use a for loop in ruby
<b3itz>
jenrzzz: you can see i've mostly studied java lol
<b3itz>
what should i use??
<Authenticator>
b3itz: Implement it via the CSV lib for testing and code your impementation to have the same interface (if possible) and return the same values. Reverse engineer it to the level desired for class.
fmcgeough has joined #ruby
freerobby has quit [Quit: Leaving.]
reinaldob has joined #ruby
fmcgeough has quit [Client Quit]
<MattB>
b3itz #each is your friend when it comes to iteration, but Ruby has other methods to split a string into an array by separator.
<atmosx>
MattB: did you pull that off now? impressive too :-)
<atmosx>
zil2: can show the entire script?
<MattB>
it should be {0=>100.0, 1=>83.3333, 2=>50.0}
dkb20k has joined #ruby
siaw has left #ruby [#ruby]
ozialien has joined #ruby
linojon has joined #ruby
enebo has quit [Quit: enebo]
<MattB>
ie. Sum of all three values as percentage of total, sum of second and third (as percentage), third only (as %).
<MattB>
That's why I was using the index in the first place, to track where I was up to in the array...
freerobby has joined #ruby
<zil2>
atmosx - it is really really long and awkward/has many related files, can show you via teamviewer on the machine
ghostmoth has quit [Quit: ghostmoth]
dkb20k has quit [Ping timeout: 255 seconds]
tkuchiki has quit [Remote host closed the connection]
<atmosx>
zil2: can you upload the method or the *lines* where the code which you can't get to work is? I mean like 3 lines up/down or the entire method (if it's part of a method).
tkuchiki has joined #ruby
<atmosx>
zil2: if you can upload it to github, I'm not opening a TM session now with a stranger :-P
<zil2>
heh, even as you as the controller!? No worries, I'll try to upload...
adriancb has quit [Remote host closed the connection]
<jenrzzz>
MattB: can you specify the problem clearly in a gist with expected input and output?
<MattB>
Yes, good idea - we were getting there by iteration, but with a step missed it's gonna be hard to back track.
<atmosx>
zil2: actually you need to show (in the SO post too) the convet_err() method mus tbe defined somewhere
tkuchiki has quit [Ping timeout: 265 seconds]
<jenrzzz>
zil2: does convert_err return a string?
<atmosx>
zil2: first things first: That code is wrong. You can't use #{} outside of a double-quote string "#{var}" or var
<atmosx>
zil2: so in your case should be: convert_err(results["status"]) =~ /Uknown/ in line 4
<zil2>
I have never used ruby before now, I am a c# dev, I have never seen #{} and after googling for ages, I can't even find a refrence that shows what it is... I'll try to dig out convert_err now
<atmosx>
now if you can show the convert_err method would be fine
<atmosx>
remove the #{} you don't need it. Adding the double quotes will work too, but will add up confusion.
<jenrzzz>
zil2: #{} is used for string interpolation. e.g. "foo-#{1 + 2}" => 'foo-3'
Pupeno has joined #ruby
cashnguns has joined #ruby
crocket has joined #ruby
<crocket>
How do I get the number of processors without installing any ruby module?
<crocket>
I just need to get the number of hardware threads.
<jenrzzz>
i don't think you can do this with pure ruby
<jenrzzz>
the sys-cpu gem will though
<atmosx>
crocket: in BSd either, but I suggest you go with the 'system' gem then or you write your own method.
sevenseacat has joined #ruby
<crocket>
Woo
Musashi007 has quit [Quit: Musashi007]
oo_ has joined #ruby
<zil2>
atmosx trying to run now iwth modifications you said
rshetty has joined #ruby
<atmosx>
zil2: do you know what the results["status"] variable should return? What kind of class? String or Symbol? Because I'm getting the idea you're expecting a symbol there.
Kricir has joined #ruby
<jenrzzz>
atmosx: i think it might be anything. #convert_error(err) returns "Unknown Error" unless [:required, :no_response].include?(err)
razieliyo has quit [Quit: Saliendo]
<zil2>
atmosx: sorry, I don't have a clue :( http://pastebin.com/CwBHiTnj is the script, I can't say more than that other than poste other bits
Joufflu has joined #ruby
<atmosx>
zil2: did you run the modification I gave to see if the error is reproduced?
<atmosx>
in line 4?
<zil2>
atmosx - I am trying to run it now, just takes ages to actually get to a response of unknown!
rshetty has quit [Ping timeout: 244 seconds]
pauly_oc has quit [Ping timeout: 250 seconds]
<zil2>
it is like 1 in 50000 runs (can do about 2-3 a second) but it just output then failed... so, idea is to rerun when it comes up
skolman_ has quit [Remote host closed the connection]
<atmosx>
oh I see
tokik has quit [Ping timeout: 255 seconds]
Joufflu has quit [Read error: Connection reset by peer]
skolman has joined #ruby
louism2wash has joined #ruby
<zil2>
yep, that is what I have - so far so good... I mean, when I tried, it kept doing the retry no matter what/on anything... it is processing now!
<louism2wash>
Hey guys, is there any standard for what goes into your a lib directory in a Ruby project? That's where I am putting my class files. Thanks.
<zil2>
woot! atmosx: It worked! :) Retried the failed one! Thank you so much!
<atmosx>
zil2: so you're okay? Also that code segment you showed, uses if/else ... I think might be better style to use exceptions http://ruby.bastardsbook.com/chapters/exception-handling/ but if it works and it's complicated better not touch it :-)
<atmosx>
zil2: no worries, that was easy :-)
djbkd_ has quit [Ping timeout: 245 seconds]
<atmosx>
zil2: glad to help
<graft>
okay, so i can do Circle.new.is_a? Shape, but what about the equivalent for the class? Circle.is_a? Shape doesn't do what I want
djbkd_ has joined #ruby
<zil2>
honestly, I am not sure how much I will be using ruby/this in future... just needed something quick and paid someone who sent it, then dropped off the radar when we needed this slight modification on errors...
<atmosx>
louism2wash: is your program going to be a gem or something?
<Radar>
the who?
goodenough has joined #ruby
<zil2>
atmosx: if on stack overflow, please reply with that tiny mod and I'll upvote/mark as answer when I can
abstrakt has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
<MattB>
Okay, I"m back! :-)
<louism2wash>
atmosx: no, I just thought that lib was a ruby standard??? Is there a standard place to put my class files I guess would be a better way to ask that question :)
<atmosx>
zil2: A guy already replied, I'm on SO too but never mind ;-) Upload that guy's answer, it was correct.
<porfa>
hey guys, instead of telling a string to delete specific characters str.[2..-1] cant i specify a patern instead?
<jenrzzz>
zil2: it's #include?, with a question mark
<MattB>
WOuld you mind taking a look?
<MattB>
Thanks!
<jenrzzz>
porfa: yes, you can pass a regex to String#[] and it will return whatever matches
sdegutis has joined #ruby
<sdegutis>
The main benefit of Clojure over Ruby so far appears to be the complete lack of worrying about method name collisions.
<MattB>
The main bit is what to do instead of: a.map!.with_index{|v, i| (a[i..a.count].inject(&:+).to_f/total*100.0)}
Jake232 has joined #ruby
ephemerian has quit [Quit: Leaving.]
<jenrzzz>
sdegutis: also it's like orders of magnitude faster
jimbach has joined #ruby
<sdegutis>
Not JRuby.
<sdegutis>
jenrzzz: Meh.
<jenrzzz>
yeah, i meant MRI
<jenrzzz>
dat JVM
<sdegutis>
jenrzzz: I don't really see that as a primary advantage.
<sdegutis>
jenrzzz: The majority of my app's job is translating one string to another string. Pretty easy stuff.
<jenrzzz>
nah, but it's a pretty nice secondary advantage
<jenrzzz>
i've been wanting to do a clojure project for a while
mikepack has quit []
IrishGringo has joined #ruby
Joufflu has joined #ruby
timonv_ has quit [Ping timeout: 258 seconds]
robustus has quit [Ping timeout: 255 seconds]
<jenrzzz>
MattB: so, what question is this data answering exactly? how many users have registered in the past N weeks?
<MattB>
Oh, I think Authenticator may have hinted at a solution, but I missed it because he did it an array of vowels, not numbers (so sum but not percentage. Does this look better:
<jenrzzz>
sdegutis: oh, i wouldn't expect or want it to be
marr has quit [Ping timeout: 245 seconds]
<sdegutis>
jenrzzz: Especially Rails's security stuff.
Fusl has joined #ruby
<zenspider>
MattB: you're suffering from a severe lack of clarity. This whole thing is a mess from top to bottom.
<sevenseacat>
yeah i hate when things are conventient too
<sdegutis>
There's nothing. Literally nothing. That helps you out.
michael_mbp has joined #ruby
goodenough has quit [Remote host closed the connection]
<sdegutis>
sevenseacat: lol
apeiros has quit [Remote host closed the connection]
<sevenseacat>
convenient
<MattB>
Sorry jenrzzz, missed your question, an apologies to all for the code spam
<jenrzzz>
sdegutis: i'm looking to escape from dhh's magical universe to one of my own creation
apeiros has joined #ruby
<sdegutis>
jenrzzz: Okay then Clojure is totally for you.
<MattB>
jenrzzz: IT's basically looking at number sign-ins per week against number of sign-ups for a cohort
<sevenseacat>
i prefer to have a solid foundation made by people smarter than me
<sdegutis>
jenrzzz: I totally wanted that too. But after doing Clojure web app full time for a few years, I'm kind of wanting something a little bit more automagical.
<MattB>
zenspider: could you be more specific, you're sffering from a severe lack of clarity ;-)
mary5030 has quit [Ping timeout: 272 seconds]
<jenrzzz>
MattB: what's wrong with what we had before? you can just sum the percentages of weeks before if you want to get the running totals
<sevenseacat>
this isnt going to end well
<jenrzzz>
sevenseacat, sdegutis: yeah, that's why I haven't done a clojure project yet
skolman_ has quit [Remote host closed the connection]
<sdegutis>
:)
<jenrzzz>
but someday someone will come up with a stupid idea and i will agree to build it for them just to play with some new tech
<MattB>
jenrzz, I must be missing something obvious then - otherwise, given the simple array of percentages, I'm back to .map.with_index to iterate over it and sum the percentages.
<MattB>
This gives the desired result: a = [1,2,3,4,5] ; b = a.length.times.collect {|i| a[i..-1].inject(&:+) / a.inject(&:+).to_f * 100}; b
<MattB>
As does this: a.map!.with_index{|v, i| (a[i..a.count].inject(&:+).to_f/total*100.0)}
<jenrzzz>
MattB: then just use that?
<jenrzzz>
idk, if you are asking for design feedback or best practices, you can't just limit it to the tiny aspect that you're stuck on
<jenrzzz>
we need the big picture to come up with the optimal solution
<jenrzzz>
what do you do with that hash after it gets returned? try to focus this method on just the transformations that need to be applied to make the data useful
<jenrzzz>
the summed/running percentages sound more specific to the analysis part than the transformation part, which is why it makes more sense imo to return the hash with each week's percentage
triple_b has joined #ruby
<MattB>
I see what you're saying then
<MattB>
It gets dumped to a Rails view, and graphed
<MattB>
The graph library expects the numbered hash format, with the percentages summed....
<MattB>
I tried it with the plain percentages, but you can't compare cohorts, as the discrete percentages get thinned out, the longer ago the cort signed up
<jenrzzz>
is it a JS graphing library or ruby?
VanillaGoat__ has joined #ruby
<jenrzzz>
also, where does this functionality live in your app?
IrishGringo has quit [Ping timeout: 244 seconds]
<MattB>
It's google charts (JS) via Chartkick (Ruby)
<MattB>
At the moment the code is in the User model
<jenrzzz>
what's the method called?
<MattB>
User.cohorts
dkb20k has joined #ruby
hiyosi has quit [Ping timeout: 265 seconds]
jonr22 has joined #ruby
tkuchiki has joined #ruby
sdegutis has quit [Quit: Leaving...]
VanillaGoat_ has quit [Ping timeout: 260 seconds]
djbkd__ has joined #ruby
dkphenom has joined #ruby
<jenrzzz>
so you're just doing <%= sexy_chart(Users.cohorts) %> ?
jottr has quit [Ping timeout: 245 seconds]
<MattB>
Exactly
<jenrzzz>
is there more to this method than the code you showed us? how long is it?
djbkd_ has quit [Ping timeout: 240 seconds]
rshetty has quit [Read error: Connection reset by peer]
Kricir has quit []
dkb20k has quit [Ping timeout: 260 seconds]
<MattB>
That's it, bar the line that pulls the values from the db, which is using the groupdate Gem to group the data by week
godd2 has quit [Ping timeout: 250 seconds]
<MattB>
Let me post the whole thing as a pastie...
<jenrzzz>
yeah, it'll help to see it in situ
rshetty has joined #ruby
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jenrzzz>
MattB: so, i think this is *ok* if you just want to draw the graph and be done with it. but if you expect to be doing a lot more with cohort analysis, it'd be worth it to do some better design here
<jenrzzz>
you definitely want to extract a couple methods from #cohorts
<Blizzy>
thank you, MattB.
goodenough has joined #ruby
djbkd__ has quit [Ping timeout: 258 seconds]
<MattB>
jenrzzz: I'm new to cohort analysis, so this was a first experiment, as is probably painfully obvious! What methods would you extract as a starting point?
<MattB>
(And thanks BTW!)
pietr0 has quit [Ping timeout: 260 seconds]
arescorpio has joined #ruby
beneggett has joined #ruby
razrunelord has quit [Remote host closed the connection]
<lampd1>
<3 that feeling when you transition from knowing about something to grokking it
i_s has quit [Remote host closed the connection]
<jenrzzz>
lampd1: what are you newly grokking?
tlarevo has joined #ruby
<lampd1>
jenrzzz: actually just started down the path of trying to grok a few new things ;)
<benzrf>
lampd1: learn haskell
<benzrf>
there will be so much stuff to grok
<benzrf>
it is just nuts
viet_power has quit [Ping timeout: 240 seconds]
<lampd1>
nty
hamakn has quit [Remote host closed the connection]
snath has joined #ruby
<benzrf>
oh?
hamakn has joined #ruby
renderful has joined #ruby
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jimbach has quit [Remote host closed the connection]
<lampd1>
maybe after i've moved on from working on learning ruby/rails and python a bit better :P
botwin has joined #ruby
<lampd1>
and xtlang, lol
goodenough has quit [Remote host closed the connection]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jenrzzz>
MattB: lines 6-8 should be in another method, but i'm not sure what to call it
livingstn has joined #ruby
<MattB>
Wow, thank you very much! I was half-way through having a go myself, but this is much better!
mikepack has quit [Remote host closed the connection]
hackeron_ has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gsd has joined #ruby
gsd has quit [Client Quit]
hackeron has quit [Ping timeout: 258 seconds]
nobitanobi has quit []
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jbw has quit [Ping timeout: 245 seconds]
bluOxigen has joined #ruby
rshetty has quit [Remote host closed the connection]
hamakn has joined #ruby
tier has quit [Remote host closed the connection]
triple_b has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jenrzzz>
zenspider: can you tell me everything is going to be okay?
leslie1 has joined #ruby
<porfa>
guys im in need of help, i just dont know what to do :( im fetching a url adn some products have [0][?href?], [1][?href?],[2][?href?]... some products just have one link, so when it tries to get [1][?href"] it quits and stops getting the rest of the data :(
<jenrzzz>
porfa: code plz
<porfa>
ok, posting
dkb20k has joined #ruby
Akuma has quit [Ping timeout: 250 seconds]
<jenrzzz>
zenspider: why do good things happen to bad people?
<porfa>
dont blow the coffee out of your mouth, this is my first ever going at programing, *ever*
<jenrzzz>
what are you trying to do?
<porfa>
i am trying to get all the image file links from that url
msmith_ has joined #ruby
<porfa>
and other data, and exporting to csv
<porfa>
the output is alredy formated for my csv needs
jdj_dk has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
<porfa>
if there was a way for ruby to count the numver of links before i actually request them, then it would know how many links to go after
stunder has joined #ruby
stunder has quit [Client Quit]
<porfa>
or i cold just put some command to ignore and carry on with the script if thats possible, i would be ok with that, though its the easy way out
zil2 has quit []
stunder has joined #ruby
bigkevmcd has quit [Ping timeout: 256 seconds]
jbw has joined #ruby
<pontiki>
porfa, probably a stupid question, but why do you have semi-colons separating things instead of commas for part of your output in the puts statement?
parabolize has joined #ruby
<pontiki>
another question, why do you get the images if you only want their urls?
<porfa>
my other software acepts csv product info formated like that
<pontiki>
semi-colon separated files?
<porfa>
because the urls are .asph?docwtv
yfeldblum has quit [Remote host closed the connection]
<porfa>
pontiki: yes
<pontiki>
weird as
wjimenez5271 has joined #ruby
<porfa>
for ie.. ?name;description;image1, image2, image3;weight"
<pontiki>
that's not a csv
<porfa>
i know what csv stands for, im sorry about
Cat_1 has quit []
<porfa>
it?s just the software calls it ?csv import? and i?ve been using it for quite a while
<pontiki>
and, like, at line 68, uriimg1 is not the same as mechaimg1 after you run the get?
jottr has joined #ruby
<porfa>
let me check
mikepack has joined #ruby
Takle has quit [Remote host closed the connection]
kaspergrubbe has quit [Remote host closed the connection]
troyreadyy has quit [Ping timeout: 272 seconds]
<jenrzzz>
zenspider: where do rubyists go when they die?
bmurt has quit [Client Quit]
abstrakt has quit [Quit: Leaving]
mgorbach has joined #ruby
cmxu has joined #ruby
<MattB>
jenrzzz: Makes me sad that I will /never/ be able to churn out code the way you can. I think from now on I should leave programming to the professionals! :-)
bmurt has joined #ruby
Spami has quit [Ping timeout: 244 seconds]
<pontiki>
porfa, as a first effort? this is pretty good
<jenrzzz>
heh, all i've done all day is answer questions in IRC because i'm unable to churn out the code people pay me for
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jenrzzz>
other people's problems always seem easier, if not more fun :P
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki>
hehe, jenrzzz
<porfa>
lucky me! ahah
User458764 has joined #ruby
<porfa>
that mechanize thing you did looks awesome, again thank you!
jjasonclark has quit [Quit: jjasonclark]
gsd has joined #ruby
timonv_ has joined #ruby
<pontiki>
you can save a bit by doing something like: image_urls = doc.search('li.image').map{|i| i.children.first['href']}
<MattB>
pontiki: isn't a scope just a method by another name though on this case?
oniMaker has quit [Ping timeout: 250 seconds]
Spami has joined #ruby
<MattB>
(in this case)
<pontiki>
it is, but they're more descriptive
<pontiki>
and more usable
wang has quit [Ping timeout: 265 seconds]
wang has joined #ruby
<pontiki>
retain the method you have for .count.value, but using the scope
tyll has quit [Ping timeout: 250 seconds]
oo_ has quit [Remote host closed the connection]
Areessell__ has quit [Quit: (null)]
<MattB>
I guess that would be more correct, although not sure what it might ever be reused for! :-)
<crocket>
Is ruby on rails good with websockets?
yetanotherdave has quit [Ping timeout: 240 seconds]
oniMaker has joined #ruby
rshetty has quit [Ping timeout: 265 seconds]
<pontiki>
also, you know there is #rubyonrails channel?
botwin has quit [Remote host closed the connection]
<crocket>
pontiki, I couldn't remember it.
<pontiki>
not that you haven't been getting great help here; i just know there are some denizens of #ruby that really hate talking about rails :P
Imofftopic has joined #ruby
<pontiki>
oh, crocket, yeah, i was addressing that to MattB , but yeah
<crocket>
pontiki, Why?
<pontiki>
you'll have to ask them when they start to whinge. :)
<crocket>
Why do ruby people hate rails?
<MattB>
pontiki, yes, but I originally came to ask a ruby question about using map, and the scope (hoho) gradually expanded!
<pontiki>
see previous answer, crocket
<porfa>
i?ve noticed the text output is quite diferent from before
<porfa>
is there another method to transform text ? :o
<pontiki>
um, porfa, there are a huge number of methods that transform text
<porfa>
but i just want to [2..-5]
<MattB>
jenrzzz went from helping answer my original question to refactoring my godawful Rails method, so we ended up talking Rails in #ruby.
<porfa>
im sorry
<MattB>
I did wonder how long it would take someone to complain ;-)
<pontiki>
i need more context, porfa
<MattB>
Everyone's being very patient with me. :-)
<pontiki>
*what* text, what do you want from it, etc
<pontiki>
MattB: *i'm* not complaining!!
<pontiki>
i <3 <3 <3 rails
<pontiki>
(not that it doesn't sometimes frustrate me greatly, too. :) )
<porfa>
its outputing this "[\"Bluetooth, cobertura ate : 10 m\" from ?specs2? and before it was outputing ?Bluetooth, cobertura ate : 10 m?
<porfa>
my quotations marks are switched to questions marks, what the hell
<pontiki>
i think something is being mistranslated in our character encodings, porfa
<pontiki>
i don't see the difference
jenrzzz has quit [Ping timeout: 244 seconds]
<pontiki>
ah, ok
<MattB>
<3 Ruby, <3 Rails, do not have the brains to be good at either. Oh well!
<pontiki>
put it in a pastie, then, porfa, that usually works
<rpag>
rails doesn't require a brain :P
<pontiki>
and here we have it!!
<pontiki>
crocket: ask rpag why they hate rails
<MattB>
rpag: then I'm officially brain-dead! LOL
<crocket>
rpag, Just because rails doesn't require a brain, it doesn't mean rails is bad.
<pontiki>
i think most of them hate rails because rails made ruby popular
<crocket>
It could mean the opposite
<rpag>
hate is a pretty strong word
wallerdev has quit [Quit: wallerdev]
mib_mib has joined #ruby
<rpag>
i just dislike the path rails has taken so far
<pontiki>
and they can't have their tiny little exclusive niche
<crocket>
Rails is so good that anyone can use it.
<sevenseacat>
or when people say ruby they automatically presume you mean rails
<rpag>
pontiki, you're being hella presumptuous
<pontiki>
rpag: i am, yes
<pontiki>
"rails doesn't require a brain" is rather presumptuous as well
<rpag>
it was a joke
<pontiki>
if not downright insulting
<rpag>
hence the ':P'
Musashi007 has joined #ruby
<pontiki>
so is mine
Wolland has joined #ruby
<rpag>
oh okay then
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rpag>
on a serious note, i don't think rails is the best way to build a web application anymore, at least not since javascript frameworks started popping up everywhere
<benzrf>
tbh rails DOESNT require a brain
Imofftopic has quit [Remote host closed the connection]
<MattB>
See, that's why Rails isn't for zombies like me :-D
luriv has quit [Ping timeout: 240 seconds]
Musashi007 has quit [Quit: Musashi007]
<rpag>
nah, it's just something you should be aware of
<pontiki>
does that need to be a class method?
stretchlimo has joined #ruby
<MattB>
Which one?
<pontiki>
percent_retention_by_period
jonr22 has quit [Ping timeout: 256 seconds]
porfa has quit [Quit: porfa]
<rpag>
i think it does, it's called from another class method
* JDHankle
tries to hack together gtk3 and vagrant
porfa has joined #ruby
<MattB>
Dumb question - where should I put it otherwise? It's pretty specific, and only used by this class...
stretchlimo has quit [Client Quit]
adriancb has joined #ruby
lucyinthesky has left #ruby ["Leaving"]
<pontiki>
idk, i'm not sure what the overall thing is for
<pontiki>
not really sure why those are in a persistence model
adriancb has quit [Read error: Connection reset by peer]
ixti has quit [Ping timeout: 245 seconds]
adriancb has joined #ruby
jimbach has joined #ruby
<pontiki>
maybe they should be in a presenter model
<MattB>
As a whole it formats data for graphing cohorts, so yes, it's probably in the wrong place, but it was the easiest place to start from :-)
byprdct has joined #ruby
bigmac has joined #ruby
duncannz has joined #ruby
byprdct_ has quit [Ping timeout: 256 seconds]
<MattB>
And I still struggle to know where best to put things. Fat model, skinny controllers, no, no , skinny everything, no presenters, no decorators. Agh!
<pontiki>
there are no shortage of opinions
<JDHankle>
I'm trying to get vagrant and gtk3 to talk to each other. The only way I can think to do this is to create a vagrant plugin and somehow deamonize the gtk3 code using `vagrant whatever start|stop`. The alternative appears to be to write a cli wrapper, which sounds awful.
<pontiki>
and p.much anything i might say over irc is going to be woefully incomplete
<jenrzzz>
there are a lot of right ways to do it
<jenrzzz>
only you have the knowledge to decide which is best
<pontiki>
sometimes what's right in one place is wrong in another, that's where it gets fun
<pontiki>
but it never requires a brain, or thinking!!
<pontiki>
just using a robot!!
<MattB>
:-) I"ll be okay then.
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oleo__ has joined #ruby
oleo is now known as Guest78399
wjimenez5271 has quit [Ping timeout: 272 seconds]
xenomorph is now known as {xenomorph}
goshdarnyou has joined #ruby
Guest78399 has quit [Ping timeout: 244 seconds]
tokik has joined #ruby
tlarevo has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
<MattB>
Right, it's 3:45am, so I will thank you all for your generous help (esp. jenrzzz, pontiki) and and call it a night.
<pontiki>
sleep well
viet_power has quit [Ping timeout: 250 seconds]
<jenrzzz>
cheers!
SpikeMaster has joined #ruby
<MattB>
Thanks, g'night.
{xenomorph} is now known as xenomorph
MattB has quit []
dh64 has quit [Quit: Konversation terminated!]
mattstratton has joined #ruby
Xiti has quit [Quit: Leaving]
chrisja has quit [Quit: leaving]
triple_b has quit [Read error: Connection reset by peer]
mattstratton has quit [Read error: Connection reset by peer]
triple_b has joined #ruby
mattstratton has joined #ruby
Xiti has joined #ruby
oo_ has joined #ruby
DTSCode has quit [Ping timeout: 245 seconds]
JBreit has joined #ruby
kobain has quit [Ping timeout: 260 seconds]
jwang__ has joined #ruby
agrinb has joined #ruby
luckyruby has joined #ruby
emmesswhy has joined #ruby
phutchins has quit [Ping timeout: 244 seconds]
radic has joined #ruby
viet_power has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
yetanotherdave has joined #ruby
arup_r has joined #ruby
JBreit has left #ruby ["Leaving"]
kobain has joined #ruby
mattmcclure has quit [Quit: Connection closed for inactivity]
bigmac has quit [Read error: Connection reset by peer]
radic_ has quit [Ping timeout: 245 seconds]
<jimmyhoughjr>
im having trouble with either rvm or rbenv on debian
<jimmyhoughjr>
I can't seem to get bash to find the commands, even when i add the appropraite lines to the .bashrc
<tmoore>
jimmyhoughjr: did you load a new shell?
<jenrzzz>
jimmyhoughjr: did you `source ~/.bashrc` or reload your shell?
<jimmyhoughjr>
i was ssh'd in, i closed the connection and relogged in
braincrash has quit [Quit: bye bye]
SpikeMaster has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
Imofftopic has joined #ruby
<jenrzzz>
jimmyhoughjr: where did you install them? also, which would you rather use?
<jimmyhoughjr>
i suppose rbenv
<jimmyhoughjr>
in my home folder, im going back through the rbenv steps now
rshetty has joined #ruby
Imofftopic has quit [Client Quit]
wjimenez5271 has joined #ruby
shortCircuit__ has joined #ruby
braincrash has joined #ruby
snath has quit [Ping timeout: 260 seconds]
<jenrzzz>
jimmyhoughjr: i think you might need to source your .bashrc from your .bash_profile
<jenrzzz>
jimmyhoughjr: SSH'ing in is a login shell
<jimmyhoughjr>
it seems to be working now, I think i had forgot to append the shims to .bashrc
snovity has quit [Ping timeout: 245 seconds]
<jimmyhoughjr>
im setting up rails4 on a beaglebone black
freerobby has joined #ruby
<jimmyhoughjr>
they recommended ruby 2.1.0 if i recall
<jenrzzz>
why rails?
jjconti has joined #ruby
<jjconti>
hi
StephenA1 has joined #ruby
<jjconti>
is there someonewith experience developing simple 2d games in ruby?
<jjconti>
Im wondering which is the state of the art
<rpag>
jjconti, #gosu ?
<jjconti>
gosu or rubygame?
<jjconti>
other?
<jjconti>
I've experience using pygame
StephenA1 has quit [Client Quit]
<jimmyhoughjr>
cuz its better than jnode.js imo
DTSCode has joined #ruby
mib_mib has quit [Ping timeout: 255 seconds]
<jimmyhoughjr>
"node.js"
<jjconti>
is any of this two similar to pygame rpag?
jottr has joined #ruby
<rpag>
jjconti, not familiar with pygame
<jjconti>
gosu seems more live that rubygame
<jimmyhoughjr>
jenrzzz why not?
<jenrzzz>
jimmyhoughjr: yeah, but on limited hardware like beaglebone, rails brings a lot more bloat than you probably need
<jimmyhoughjr>
web development is so much more complicated than say iOS or windows
KC9YDN has joined #ruby
agrinb has quit [Remote host closed the connection]
cashnguns has quit [Remote host closed the connection]
DLSteve has quit [Ping timeout: 272 seconds]
shortCircuit__ is now known as hellNo
arup_r has quit [Quit: Leaving.]
hellNo is now known as shortCircuit
jenrzzz has quit [Ping timeout: 265 seconds]
wjimenez_ has joined #ruby
shortCircuit is now known as shortCircuit__
shortCircuit__ is now known as supermanBlack
wjimenez5271 has quit [Ping timeout: 265 seconds]
rubie has joined #ruby
<rubie>
hi all: i was wondering if anyone out there knew of any other beginners that were hungry to learn as much Ruby as humanly possible. I would love to have someone to skype with and talk through problems with, maybe even build something. Thanks!
Xuerian has joined #ruby
Wolland has joined #ruby
wjimenez_ has quit [Ping timeout: 244 seconds]
mib_mib has joined #ruby
Wolland_ has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
krz has joined #ruby
pyon has joined #ruby
wjimenez5271 has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
timonv_ has joined #ruby
hornairs has quit [Ping timeout: 260 seconds]
siwica has quit [Ping timeout: 256 seconds]
kp666 has joined #ruby
krz has quit [Client Quit]
krz has joined #ruby
Madran is now known as Adran
timonv_ has quit [Ping timeout: 265 seconds]
krz has quit [Client Quit]
krz has joined #ruby
rshetty has quit [Remote host closed the connection]
snath has joined #ruby
rshetty has joined #ruby
jjconti has quit [Remote host closed the connection]
<Authenticator>
Or, def show_alive s ; print "processing #{s}: " ; t = Thread.new { loop do ; print '*' ; sleep 1 ; end } ; yield ; ensure ; t.kill ; end ; show_alive('pings') { o = `ping -c5 google.com >/dev/null` }
agrinb has quit [Ping timeout: 265 seconds]
iwishiwerearobot has joined #ruby
<sevenseacat>
dafuq
<henesy>
Authenticator, thanks, i'll paste that for future reference, I got a temporary enough fix...i think...doesn't do what I want it to do exactly, i'll come back to this tomorrow
blueOxigen has joined #ruby
IrishGringo has joined #ruby
bluOxigen has quit [Ping timeout: 265 seconds]
<Authenticator>
sevenseacat: ?
<shevy>
Authenticator it's a potty-mouthed cat obviously
iwishiwerearobot has quit [Ping timeout: 260 seconds]
oleo__ has quit [Quit: Verlassend]
<rpag>
st1gma1, $? would be nil or a Process::Status object.
Abhijit has joined #ruby
terlar has joined #ruby
<rpag>
for example: $?.exitstatus == 0
jaequery has joined #ruby
<st1gma1>
yeah you are correct rpag
<st1gma1>
I didn't think it throughly
BlackGear has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
magic_ has quit [Read error: Connection reset by peer]
Neozonz|Disc has quit [Ping timeout: 244 seconds]
mengu has joined #ruby
tagrudev has joined #ruby
josephndenton has quit [Ping timeout: 258 seconds]
luriv has joined #ruby
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby
psy_ has quit [Read error: Connection reset by peer]
sigurding has joined #ruby
chipotle has quit [Quit: cya]
IrishGringo has quit [Ping timeout: 260 seconds]
<badhatter>
Is there a way to convert a Gemfile.lock into a Gemfile
danijoo_ has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
<gizmore>
ricer-core will get renamed to ricer-bot
<gizmore>
ricer-fullbot is a demo project which uses ricer-bot, ricer-rss, ricer-websockets, ricer-purple
<shevy>
I don't see it on rubygems.org
rippa has joined #ruby
<gizmore>
its only github
<gizmore>
i am new to all this
mistermocha has joined #ruby
<shevy>
seems as if there are a lot of github-only based projects :(
<shevy>
not only with you, in general really
davidhq has joined #ruby
valeriansaliou has quit [Ping timeout: 250 seconds]
<gizmore>
yeah... it´s nice
<gizmore>
you can clone with a single click
<gizmore>
do a patch online
<gizmore>
voial
<gizmore>
i like it
<gizmore>
github has done great to oss
<sevenseacat>
github is pretty awesome.
<gizmore>
yeah!
<sevenseacat>
not perfect, but awesome.
<gizmore>
btw, all my gem hashes fail
<gizmore>
i always have to calc sha512 collisions
terlar has joined #ruby
<hanmac1>
shevy & gizmore hm maybe for "patch online" something like that? ;P https://orionhub.org
<gizmore>
digicert tls... seriously?
<gizmore>
blank page without js
<gizmore>
seriously?
<gizmore>
Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.
<gizmore>
Continue anyway?
<gizmore>
i think i might still fake my UA to playstation4
<gizmore>
indeed
<gizmore>
hanmac1: on github you just click "clone", then patch it, and in your gemfile you use gem 'purple-ruby', git: 'gizmore/purple--ruby'
fandi has quit [Remote host closed the connection]
<gizmore>
can do with activerecord too
jottr has joined #ruby
agrinb has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
<hanmac1>
gizmore: hm yeah, but that is if you want to edit your cloned repo more online than only doing one-file-commits
<gizmore>
it´s great for experimenting, and works
<gizmore>
you can also checkout your clone, and work seriously
sinkensabe has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lxsameer has joined #ruby
<gizmore>
with all that history and linking on github, it´s easy to merge different people ideas
<gizmore>
and a clone is just a single click away... i like github :)
rbrs has joined #ruby
<gizmore>
i am not getting paid by github... and i felt bad as i added a second key
siaw has joined #ruby
<gizmore>
crypto always does make me feel bad though
zorak8 has joined #ruby
DjDeaf_ has joined #ruby
<hanmac1>
gizmore: i didnt say anthing against github ... with that orionhub you can sign in with your github account and can edit your repositories there too
DjDeaf has quit [Read error: Connection reset by peer]
<gizmore>
ah okay ... it looked like a disfunctional notepad to me
codecop has quit [Remote host closed the connection]
iwishiwerearobot has joined #ruby
<gizmore>
shevy: i miss you in shadowlamb
hephaestus_rg has quit [Ping timeout: 255 seconds]
<shevy>
I need to get work done!
<gizmore>
i wanna test weather command :P
<shevy>
I need to finish my rewrite of konsole colours
<siaw>
aaaaa i think i explained myself badly
<siaw>
i want to pass a folder as an argument :D :D
<siaw>
in the constructor
<gizmore>
sheepman: you should first settle if you use bright or dark background
<gizmore>
shevy: you should first settle if you use bright or dark background
<sevenseacat>
dark background ftw
<deepy>
shevy: base it on solarized dark
<gizmore>
siaw: your problem is now to create a dir object?
<sevenseacat>
ugh why does everyone love solarized
<shevy>
gizmore dark background for konsole
<gizmore>
white xterm ftleets
dumdedum has joined #ruby
<deepy>
sevenseacat: why don't you?
<shevy>
white background in xchat
psyprus has joined #ruby
<siaw>
no, not to created a directory object
<sevenseacat>
the contrast levels are horrible
<shevy>
deepy it is a pessimistic cat
<siaw>
to accept a folder as an argument in the class’s constructor
<sevenseacat>
half of it doesnt contrast enough and half of it constrasts too much
<deepy>
I'm accepting replacements
<gizmore>
siaw: you have been given examples of how to copy a parameter into an @instancevar
jasooon has quit [Ping timeout: 244 seconds]
<shevy>
siaw there are no "folders" man, it is a directory. inside your setter, simply check on the provided input. if File.directory? your_input_variable_here
<gizmore>
def initialize(param); @dir = param; end
shredding has joined #ruby
marcdel has quit []
<gizmore>
this copies the argument into @dir
louism2wash has quit [Quit: This computer has gone to sleep]
Neozonz|Disc2 has quit [Ping timeout: 244 seconds]
<unshadow>
I'm trying to parse out an http response, I got the response in a file (i dont need to "GET" it from a website), I want to parse it for path, body, headers etc.. all the examples I see with NET:HTTP is only available after "GET"ing the response from a URL
<unshadow>
is there a way to parse it from a file ?
momomomomo has joined #ruby
linduxed has quit [Ping timeout: 258 seconds]
ruby-help has quit [Ping timeout: 244 seconds]
<gizmore>
unshadow: maybe it´s more smart to not save it to a file, unless you really want to
<unshadow>
It's not really from a file, it will be from a socket read, I need to parse it directly while its comming in
<unshadow>
if it will work from a file it will work on the socket read, all it gets is a string in the end
elaptics`away is now known as elaptics
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
linduxed has joined #ruby
Lingos has joined #ruby
CustosLimen has quit [Ping timeout: 256 seconds]
Lingos has quit [Client Quit]
<unshadow>
now NET::HTTP can only parse the response from an "http.request(request)" object which is actually just a "request = Net::HTTP::Get.new(uri.request_uri)"
<unshadow>
I dont want to "GET" it, just parse it
<shevy>
hmm
<shevy>
why do we have the name of the method .to_sym and not .to_symbol ?
eka has joined #ruby
patric100e99 has joined #ruby
ta has quit [Quit: Leaving...]
suy is now known as disperso
Spami has quit [Quit: This computer has gone to sleep]
kaspergrubbe has quit [Read error: Connection reset by peer]
kaspergrubbe has joined #ruby
sadgrapeissad has joined #ruby
kaspergrubbe has quit [Client Quit]
<sadgrapeissad>
hello guys! I've been banging my head for a while now. I'm creating APIs and I'm using GrapeAPI ... I want to catch a particular exception... how do I do that?
<sadgrapeissad>
I wanna catch this --> Grape::Exceptions::ValidationErrors
sigurding has quit [Quit: sigurding]
kaspergrubbe has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
marcdel has quit []
<sadgrapeissad>
I tried using rescue_from but a rescue_from :all ...catches it
sigurding has joined #ruby
Timgauthier has joined #ruby
jasooon has quit [Ping timeout: 265 seconds]
josephndenton has joined #ruby
Lingos has joined #ruby
jheg has joined #ruby
coderhs has quit [Ping timeout: 256 seconds]
lsmola has joined #ruby
olivier_bK has joined #ruby
echooo has joined #ruby
mrgrieves has joined #ruby
<mrgrieves>
how can I define variables inside a method and then use them outside once the method executed?
tesuji has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
troulouliou_dev has quit [Ping timeout: 244 seconds]
<tobiasvl>
you can't, you need to define the variables outside the method's scope somewhere and manipulate them inside the method
<tobiasvl>
mrgrieves: defined inside a method, variables only live for the method's scope
sinequanon has quit [Remote host closed the connection]
jack_rabbit has quit [Quit: Leaving]
<mrgrieves>
tobiasvl: thanks, so define them outside but assigning values inside is ok
govg has quit [Remote host closed the connection]
Takle has joined #ruby
jack_rabbit has joined #ruby
<hanmac1>
mrgrieves: make a gist or a pastie of what you want
cassianoleal has joined #ruby
Wolland_ has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 265 seconds]
<tobiasvl>
mrgrieves: I agree with hanmac1. defining them outside but assigning values inside works, but if it's ok depends. if they're instance variables, then it's very ok. if they're global variables, I dunno.
<shevy>
mrgrieves store them e. g. in @ivars
cassianoleal has quit [Client Quit]
MrDoctor has joined #ruby
<shevy>
mrgrieves or global variables but they are leaky, they are valid everywhere, so if you have a $debug var, and some other code also has a $debug var, obviously whoever last writes to it wins, so that is kinda bad. you could also abuse constants to store stuff :)
<hanmac1>
tobiasvl & shevy i store all my variables in @bagOfHolding ;P
<Lingos>
I'm working on a ruby project but I got stuck with some simple html/css. The positioning I made works with chrome and firefox but not with safari. Is there any super kind person that can spend 15-20 min paring with me?
<shevy>
mrgrieves it is usually best to turn code such as this into a class
pyon has quit [Ping timeout: 245 seconds]
<shevy>
what variable is the one that has to be persistent?
<shevy>
and btw store this with file ending .rb in a gist, then it will be automatically colourized
<tobiasvl>
mrgrieves: shevy is correct, but this looks like a ruby replacement for a shell script really? if you don't want to go the object oriented route, I guess just declare the variable above the method.
<mrgrieves>
the problem I'm lokking at (I'm sure there are many but there's one I want to fix in particular) is that I want run_summary to be defined at the last iteration of the mco_retry block
<canton7>
at the very least set it up so tab inserts 2 spaces :P
<canton7>
half the amount of key-banging
<shevy>
I never use tabs
<shevy>
I used a hammer to wipe out the tab and caps lock key!
unshadow has joined #ruby
<canton7>
in almost every editor ever you can configure it so that the tab button inserts spaces
<shevy>
and the MS logo on my keyboard
vsipuli has joined #ruby
<shevy>
yeah but you have to hit the tab key
<canton7>
I normally map caps lock onto something else too :P
<canton7>
tried backspace for a while, but couldn't get into the habit
<shevy>
my left hand sits mostly near ... ctrl ... alt ... and the left side of the alphabet roughly
dangerousdave has joined #ruby
<shevy>
hmm let me check which hand uses space
<Baluse>
thanks shevyl
moritzs has quit [Ping timeout: 240 seconds]
<shevy>
oh... right hand, my thumb there
<shevy>
weird
<unshadow>
why when I read a file in "rb" mode I get a string like this: "��`I�%&/m�J�J��t�`$ؐ@���" but when I use unpack("B*") I get 0101010 ?
unshadow has quit [Client Quit]
unshadow has joined #ruby
anarang has joined #ruby
<unshadow>
Why when I read a file in "rb" mode I get a string with wierd shapes, but, when I do .unpack("B*") on a string I get 010101010 ? isnt the "rb" flag stands for read binery ?
<tobiasvl>
unshadow: yes. if you use "rb", you read the bytes
<tobiasvl>
that's how the byte values are printed
<canton7>
unshadow, the 'b' just means "don't do end-of-line character conversion"
Macaveli has joined #ruby
<canton7>
it doesn't mean "convert to some other format"
Macaveli has quit [Read error: Connection reset by peer]
iamdoo2 has quit []
Macaveli has joined #ruby
Takle has quit [Read error: Connection reset by peer]
Takle_ has joined #ruby
<unshadow>
I see, how can I use the "rb" logic on a string ?
<canton7>
not sure what you're asking
<canton7>
ruby won't do automatic end-of-line conversion on a string
<canton7>
just when reading/writing files
<apeiros>
canton7, unshadow: 'rb' also sets encoding to binary
momomomomo has quit [Quit: momomomomo]
Wolland has joined #ruby
<apeiros>
unshadow: how are you printing that string?
<apeiros>
unshadow: also what does `p yourstring.encoding` print?
nrsk has joined #ruby
klaut has quit [Remote host closed the connection]
<apeiros>
unshadow: also code please. that unpack("B*") result looks highly suspicious. you pasted *7* bits. that makes no sense whatsoever.
davidhq has joined #ruby
<unshadow>
Well, My issue is that, I'm trying to use gzip on an HTTP gziped response, I split the response to headers and body, on the body I'm trying to decompress the string using gzip, I'm keep getting "not in gzip format", doing a little bit of googling I saw that when this happens for files, you need to read them in "rb" mode
<unshadow>
my string returns UTF-8
<unshadow>
and the 7 bits is just an example :) not the real deadl
oo_ has quit [Read error: Connection reset by peer]
duncannz has quit [Ping timeout: 264 seconds]
<unshadow>
you can see that in the code I split the headers and body, then try to "unzip" (gunzip?) the body
<apeiros>
I don't see any read with "rb" in this?
<gizmore>
unshadow: use a http client
BlackGear has quit [Client Quit]
<apeiros>
body = data.split("\n\n").to_a[1..-1].join("\n") # broken right there already.
<unshadow>
yeha... I dont read this from a file, I get it as a string, then, I get the "not in GZIP format", when googling the error the solution is using a read "rb"
<gizmore>
or activeshootme.domagic
<apeiros>
header/body separation is \r\n\r\n
<Timgauthier>
uh oh, i'm doing php again :(
<apeiros>
and if you have something *before* this code which removes the \r's, then you have your culprit already.
<gizmore>
what if it is chunked?
<gizmore>
or it is 7bit encoded?
<gizmore>
what if spdy comes?
<apeiros>
also, if data.encoding returns utf-8, something is off before that code anyway. it should be binary.
mengu has quit [Remote host closed the connection]
__main__ has quit [Read error: Connection reset by peer]
<unshadow>
why ? the http states : Content-Type: text/html; charset=utf-8
Spleeze has quit [Ping timeout: 265 seconds]
<apeiros>
unshadow: it also states content-encoding gzip
jasooon has joined #ruby
<apeiros>
so either your thingy unzips the data for you, or it should give you the binary gzip
<gizmore>
unshadow: btw zlib != gzlib
<apeiros>
because gzipped data is not utf-8.
<unshadow>
I sohuld use "gzlib" ??
<gizmore>
it could be a reason
<apeiros>
(which is also exhibited by all those "�" invalid character signs in your output)
jack_rabbit has quit [Ping timeout: 265 seconds]
<apeiros>
gizmore: Gzip reader is for gzip
<unshadow>
how would I re-encode the data to binery format ?
<unshadow>
from the UTF-8 ?
<apeiros>
so while zlib maybe != zlib, it's perfectly suitable to read gzipped data.
<apeiros>
*!= gzlib
<unshadow>
maybe the to_s messes with the encoding ?
<gizmore>
hmm really?
<apeiros>
unshadow: fix the code before the code you pasted
<gizmore>
unshadow: utf8 encoding issues should only mangle the output a tiny bit... your gzip decoding is not fine yet
<apeiros>
unshadow: if the data is otherwise undamaged, force_encoding('binary') will do. but since you split on \n\n instead of \r\n\r\n I'd say your data is damaged.
<gizmore>
i am just saying that there is not an utf8 problem yet
<unshadow>
Thanks ! I'll look into it now
RealMarc has joined #ruby
reinaldob has joined #ruby
<apeiros>
unshadow: also your output looks as if whatever you used to get the data did not properly read chunked data. the chunk lenght seems to be still in it.
<apeiros>
^ is a guess, though. I may be wrong on that.
jasooon has quit [Ping timeout: 265 seconds]
Lingos has quit [Quit: Be back later ...]
<apeiros>
well, an educated guess. "26de\n" does not look like the start of gzip. it does very much look like length part of chunked encoding.
<gizmore>
apeiros: sounds like we have a winner
<unshadow>
hm.....
Avahey has quit [Quit: Connection closed for inactivity]
Timgauthier has quit [Ping timeout: 258 seconds]
<unshadow>
this means I need to wait from more data to come to build the full gziped page ?
<apeiros>
unshadow: we're back at: show code. the relevant. the one which gets (and seems to mangle) your data.
<apeiros>
this means whatever you use to read your data does not speak http 1.1.
joonty has joined #ruby
<unshadow>
it's not
<unshadow>
it reads form socket
<unshadow>
raw data
Spleeze has joined #ruby
<apeiros>
use a proper http lib then
<gizmore>
i said that 20 min ago
<apeiros>
the other option is to read the >100 pages of http spec.
yfeldblum has quit [Ping timeout: 245 seconds]
<apeiros>
and implement a proper http reader. I somehow think that's not what you want to do.
RitterJack has quit [Remote host closed the connection]
<unshadow>
hahah yeha... but, I do have a problem, I cant use an HTTP lib as I do alot of manipulation in the socket/tcp/ssl level
vifino has joined #ruby
Deele has joined #ruby
<unshadow>
the whole code is a proxy
<gizmore>
unshadow: use a http lib that somewhat is ... not bad?
vifino has quit [Remote host closed the connection]
<apeiros>
I feel sorry for whoever has to use that proxy.
<unshadow>
hahah
<gizmore>
apeiros: it is also a firewall :)
<apeiros>
no, seriously. you obviously don't know the protocol and didn't bother to read up on it.
<gizmore>
sigfaults all outgoing
__main__ has joined #ruby
<unshadow>
the proxy works great, the only issue I get is the Gzip, all the other little things are taken care of
<apeiros>
yeah, sure…
<unshadow>
:/
ericli has joined #ruby
Timgauthier has joined #ruby
<apeiros>
you have proper keep-alive, proper cache header settings, etc.?
<gizmore>
apeiros: it is "works great on one php testpage"
<apeiros>
you process all headers explicitly for proxies and more. right?
<gizmore>
ericli: you can load the file with Yaml.load() ... then use the weird join above
<gizmore>
to port it to the weird string you want
<ericli>
gizmore, sure, thanks a lot
<gizmore>
yw :)
kaspergr_ is now known as kaspergrubbe
mkaesz has joined #ruby
Timgauthier has joined #ruby
rshetty has quit [Ping timeout: 250 seconds]
decoponyo has joined #ruby
Hightower666 has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
Takle has quit [Read error: Connection reset by peer]
DrCode has quit [Remote host closed the connection]
Takle has joined #ruby
Nahra has joined #ruby
workmad3 has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
decoponio has quit [Ping timeout: 250 seconds]
zwer has quit [Remote host closed the connection]
zwer has joined #ruby
Lingos has joined #ruby
jack_rabbit has joined #ruby
wasamasa has quit [Ping timeout: 250 seconds]
decoponio has joined #ruby
agrinb has joined #ruby
vsipuli has quit []
DrCode has joined #ruby
Xeago has joined #ruby
vsipuli has joined #ruby
vsipuli has quit [Changing host]
vsipuli has joined #ruby
workmad3 has joined #ruby
decoponyo has quit [Ping timeout: 258 seconds]
dr0p has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
b1nd has quit [Ping timeout: 240 seconds]
rdark has joined #ruby
agrinb has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
rshetty has joined #ruby
<dr0p>
hello, does anyone use rubocop with ubuntu ? I cannot find way to disable checking linelenght. Github: Metrics/LineLength: Enabled: false doesn't work
b1nd has joined #ruby
Takle has quit [Remote host closed the connection]
Lingos has quit [Quit: Be back later ...]
jenrzzz has joined #ruby
Lingos has joined #ruby
TPBallbag is now known as weewillywinkiwi
garethrees has joined #ruby
Insanity133 has quit [Read error: Connection reset by peer]
rshetty_ has quit [Ping timeout: 250 seconds]
czaks has joined #ruby
anarang has quit [Quit: Leaving]
anarang has joined #ruby
ghr has quit [Read error: Connection reset by peer]
weewillywinkiwi is now known as TPBallbag
Mohan has quit [Read error: Connection reset by peer]
marr has joined #ruby
patrick99e99 has joined #ruby
ldnunes has joined #ruby
Mohan__ has joined #ruby
workmad3 has joined #ruby
zachrab has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
clarkk has joined #ruby
patrick99e99 has quit [Ping timeout: 250 seconds]
sigurding has quit [Quit: sigurding]
unshadow has quit [Quit: leaving]
kyoshero has quit [Quit: Leaving]
Areessell__ has quit [Quit: (null)]
workmad3 has joined #ruby
arup_r_ has joined #ruby
<clarkk>
I have an ubuntu system and I'm trying to work out how I installed ruby some time ago. I have a ~/.rvm directory and the environment is set up fine. Can anyone explain how it got there?
zachrab has quit [Ping timeout: 245 seconds]
Takle has joined #ruby
<clarkk>
or how I can work out what procedure I used?
Macaveli_ has joined #ruby
Macaveli has quit [Read error: No route to host]
workmad3 has quit [Read error: Connection reset by peer]
pwestlund has joined #ruby
wasamasa has joined #ruby
wasamasa has quit [Changing host]
wasamasa has joined #ruby
arup_r has quit [Ping timeout: 264 seconds]
oo_ has joined #ruby
danjordan has joined #ruby
Naeblis has joined #ruby
<disperso>
clarkk: but what do you want exactly? reproduce it in other place?
Wolland has joined #ruby
zwer has quit [Remote host closed the connection]
djstorm has joined #ruby
zwer has joined #ruby
workmad3 has joined #ruby
jack_rabbit has quit [Ping timeout: 264 seconds]
Macaveli_ has quit [Ping timeout: 255 seconds]
<clarkk>
disperso: I'm just trying to document my procedure so that it's not so much of a struggle next time i have to set it up. I also have an OS X system, and yes, I will need to document that too, and also get it up to date, but I'm just dealing with the ubuntu box for now
workmad3 has quit [Read error: Connection reset by peer]
Wolland has quit [Ping timeout: 255 seconds]
fsapo has joined #ruby
Insanity133 has joined #ruby
workmad3 has joined #ruby
<disperso>
clarkk: well, the difference between them, I guess that it will be that both linux distributions and os x have a ruby version shipped built in. The rest is pretty much the same, no? Add configuration to your .bashrc, .zshrc, etc.
workmad3 has quit [Read error: Connection reset by peer]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
robustus is now known as robustus|Off
Fire-Dragon-DoL has joined #ruby
Lingos has quit [Quit: Be back later ...]
<shevy>
clarkk you probably installed rvm
Takle has quit [Remote host closed the connection]
<clarkk>
disperso: when you run the rvm installer, as per the instructions, ie \curl -sSL https://get.rvm.io | bash -s stable --ruby does it put everything in ~/.rvm and leave no other trace anywhere else on the file system, regardless of where you ran that command?
<shevy>
clarkk you also probably have an additional ruby
<shevy>
the ubuntu ruby
<gr33n7007h>
I need help, what I'm trying to do is iterate from 0.0.0.0 to 255.255.255.255 going like 0.0.0.1, 0.0.0.2, 0.0.0.3 ... 255.255.255.255 ?
<shevy>
clarkk yes
mib_mib has joined #ruby
<clarkk>
shevy: no, I haven't installed it from the ubuntu repos
<shevy>
ok so you have only one ruby
<shevy>
that makes it all even simpler!
<gr33n7007h>
would i need 4 loops?
<shevy>
if you remove .rvm in your home dir, you have eliminated ruby completely :)
<shevy>
gr33n7007h well
<shevy>
gr33n7007h the max value is 255 for each position right?
<gr33n7007h>
shevy yes
<shevy>
ruby won't know this unless you tell it specifically
Insanity144 has joined #ruby
workmad3 has joined #ruby
josephndenton has joined #ruby
<shevy>
so you have these values
<shevy>
(0..255).(0..255).(0..255).(0..255)
<clarkk>
shevy: so the "bash -s stable" is what installs the files, and then deletes any downloaded install files?
St_Marx has quit [Ping timeout: 250 seconds]
<gr33n7007h>
yes
<shevy>
dunno what bash -s does
jonathan_alban has joined #ruby
<apeiros>
gr33n7007h: (2**32).times do |i|
pyon has joined #ruby
<apeiros>
gr33n7007h: what you have is 4 bytes, each byte represented individually as its numeric value 0-255.
<gr33n7007h>
apeiros, ok yep
Takle has joined #ruby
<gr33n7007h>
listening
mib_mib has quit [Ping timeout: 244 seconds]
St_Marx has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
<gr33n7007h>
this is what I thought but: 0.upto(255) { |a| 0.upto(255) {|b| 0.upto(255) {|c| 0.upto(255) {|d| puts "#{a}.#{b}.#{c}.#{d}; end; end; end; end but it seems so wrong
DrCode has joined #ruby
<gr33n7007h>
ah, shevy yours is similar to mine
<shevy>
hehe
<clarkk>
ok thanks disperso and shevy - I think I've got it
cmxu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jasooon has joined #ruby
<gr33n7007h>
apeiros, looking at IPAddr.ntop now thanks
<shevy>
gr33n7007h yeah I am sure there are better solutions
<gr33n7007h>
apeiros, solution looks the right one
moritzs has quit [Remote host closed the connection]
lampd1_ has joined #ruby
coderhs has quit [Ping timeout: 255 seconds]
<shevy>
what is your new code now?
<apeiros>
gr33n7007h: well, it's eather what you did or a single iteration over all 4 billion values in a single iteration and converting the value
AkashicLegend has quit [Ping timeout: 245 seconds]
AkashicLegend has joined #ruby
claymore has joined #ruby
claymore has quit [Changing host]
claymore has joined #ruby
Vile` has quit [Remote host closed the connection]
bigkevmcd has quit [Ping timeout: 250 seconds]
Lingos has quit [Quit: Be back later ...]
<dualz>
i have a question, what net framework and your opinion why, should I be using for ruby when doing an angular based site? I'm trying to decide between sinatra and rails
spacemud has joined #ruby
klaut has joined #ruby
anarang has quit [Ping timeout: 256 seconds]
bigkevmcd has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Vile` has joined #ruby
iwishiwerearobot has joined #ruby
tkuchiki has joined #ruby
mkaesz has joined #ruby
ssarah has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
DrCode has joined #ruby
rylev has joined #ruby
tkuchiki has quit [Ping timeout: 258 seconds]
<disperso>
dualz: both are fine IMHO for an API.
<disperso>
depends on many other things, why I'd chose one or the other
claw_ has joined #ruby
DrCode has quit [Client Quit]
DrCode has joined #ruby
AkashicLegend has quit [Remote host closed the connection]
claw has quit [Ping timeout: 264 seconds]
DrCode has quit [Remote host closed the connection]
Wolland has joined #ruby
kaspergrubbe has quit [Read error: No route to host]
kaspergr_ has joined #ruby
anarang has joined #ruby
Areessell__ has joined #ruby
rbrs has quit [Quit: Leaving]
rshetty has joined #ruby
DrCode has joined #ruby
DrCode has quit [Remote host closed the connection]
Wolland_ has joined #ruby
Macaveli has joined #ruby
Wolland has quit [Read error: Connection reset by peer]
Lingos has joined #ruby
sk87 has joined #ruby
Takle has quit [Remote host closed the connection]
Wolland has joined #ruby
kith has quit [Quit: kith]
jottr has joined #ruby
DrCode has joined #ruby
coderhs has joined #ruby
psyprus has quit [Ping timeout: 258 seconds]
Wolland_ has quit [Ping timeout: 272 seconds]
Lingos has quit [Remote host closed the connection]
renderful has joined #ruby
bMalum has joined #ruby
kith has joined #ruby
jnollette has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
bMalum has quit [Client Quit]
renderful has quit [Ping timeout: 250 seconds]
TPBallbag has quit [Remote host closed the connection]
mib_mib has joined #ruby
psyprus has joined #ruby
DjDeaf has joined #ruby
amundj has quit [Ping timeout: 245 seconds]
arup_r has joined #ruby
mib_mib has quit [Ping timeout: 240 seconds]
IrishGringo has joined #ruby
jgrevich has quit [Quit: jgrevich]
oo_ has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
amundj has joined #ruby
arup_r_ has quit [Ping timeout: 256 seconds]
jasooon has joined #ruby
TPBallbag has joined #ruby
spastorino has joined #ruby
TPBallbag has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
<ruber>
Is it possible to use rbenv with $GEM_HOME to avoid having to reinstall gems for every minor version Ruby update, ie. a single collection of gems for all versions?
<txdv>
looks like the shortest way to do it siaw
yfeldblum has quit [Ping timeout: 265 seconds]
<siaw>
shouldn’t be the shortest way. i need ANOTHER way to do it :D
<shevy>
Wraps the meth method with Debugger.post_mortem {?} block.
Musashi007 has quit [Quit: Musashi007]
<shevy>
meth synthamine drug
psy_ has quit [Ping timeout: 264 seconds]
<shevy>
Walter White is in da house
Neozonz|Disc has joined #ruby
Neozonz|Disc has joined #ruby
<gr33n7007h>
:D
<Timgauthier>
shevy lol
<pontiki>
ohwhoa: you can just use the apropriate gem for the type of database you're using...
<Timgauthier>
shevy you ever work with aws?
<shevy>
Timgauthier nope
<Timgauthier>
don't
<Timgauthier>
lol
<shevy>
lol
<shevy>
tell you, I am kinda stuck in the 1998 era of the www
lw_ has quit [Quit: s]
<Timgauthier>
you get shit like this https://d34oapiz2jbm97.cloudfront.net/nln-video/blank_video.mp4?Expires=1415194265&Signature=G6-aHtGl9~1Fr-9BFaJr16Rh3JFvjkq7fwFcRA-xNlZsf5zzbAdvaiSfMmf77~ZvHIvLqeBt5dbOfikubRtT7RJCGEKpMwHZ2ywqVW4MLOG7ZDEYCjtGG49ANnkYMqWVoWDIHRZcWU7R4DuvNhaKiH4ZkD8Z~BaVmbn9mpDPmcPPHui4evWO40w6~TAbq1VTAEDdbXpghdwkqR2oxie0xUbWN3iRwVKZTESxplJZ9DfOqT7m4-3qKhS~w-essCSTfAxSFEY6gW~CxYF6fEhy55gzQX7-c3NO91HuHtec7Ox7v2ZXHkyQ8FBYMIxDS0LNEl23~
<eval-in__>
gr33n7007h => "the quieter you become, the more you are able to hear" (https://eval.in/217828)
pushpak has joined #ruby
max96at|off is now known as max96at
lemur has quit [Read error: Connection reset by peer]
lemur has joined #ruby
robbyoconnor has quit [Ping timeout: 265 seconds]
Luser has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
jasooon has quit [Ping timeout: 244 seconds]
iamjarvo has joined #ruby
robustus|Off is now known as robustus
Xeago has joined #ruby
benzrf is now known as benzrf|offline
allcentury has joined #ruby
Neozonz has quit [Ping timeout: 258 seconds]
it0a has joined #ruby
Pupeno has joined #ruby
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Neozonz has joined #ruby
Pupeno_ has quit [Ping timeout: 265 seconds]
zlude has joined #ruby
enebo has joined #ruby
Timgauthier is now known as timgauthier_away
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: zzz]
sailias has joined #ruby
oleo has joined #ruby
<zlude>
Hello! I'm doing a iteration from database to get all data listed, but i what to send it by e-mail, how can i do for this iteration output be sent by Mail.deliver body?
kamil has quit [Quit: Leaving...]
tier has quit [Remote host closed the connection]
Xeago_ has joined #ruby
mattstratton has joined #ruby
znst has quit [Remote host closed the connection]
<jhass>
zlude: what did you try so far?
jaequery has joined #ruby
orionstein has joined #ruby
davedev24_ has joined #ruby
engineered_acade has joined #ruby
engineered_acade is now known as Cat_1
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tier has joined #ruby
shredding has quit [Quit: shredding]
cpruitt has joined #ruby
ghr has quit [Read error: Connection reset by peer]
garethrees has joined #ruby
ndrei has quit [Ping timeout: 260 seconds]
Xeago has quit [Ping timeout: 272 seconds]
dumdedum has joined #ruby
<zlude>
jhass, look: http://pastie.org/private/bzvyl3dwqnp5fahyy9hrg puts "Id: #{circuito.id}" returns me all rows associated to user "me", when in run in console i get result, but now can i sent by my Mail.delivery? how can i put this output in body?
moritzs has joined #ruby
<jhass>
non-English code always makes me sad :(
<zlude>
jhass, let me english it for you.
<jhass>
anyway, don't use puts but build a string instread
krz has quit [Quit: WeeChat 1.0.1]
andrewcarter has quit [Quit: Connection closed for inactivity]
<jhass>
no need
davedev24_ has quit [Ping timeout: 272 seconds]
tlarevo has quit [Remote host closed the connection]
<jhass>
zlude: Have a look at String#<<, Array#join, Array#map and so on
Channel6 has joined #ruby
<alex88>
hi guys, is there an option to force overwrite executables during gem install?
Takle has quit [Remote host closed the connection]
paulfm has joined #ruby
<jhass>
alex88: does gem install --help list any?
adriancb has joined #ruby
<alex88>
jhass: nope, just --force but that's to force dependencies
<jhass>
alex88: then you can guess the answer
<alex88>
kk great.. :S
<alex88>
thanks jhass
<jhass>
alex88: but you might be interested in gem pristine
<alex88>
not sure how that can help
<alex88>
unless you mean removing other versions
<alex88>
before installing
sepp2k has joined #ruby
anarang has quit [Quit: Leaving]
sepp2k has quit [Client Quit]
<jhass>
gem pristine should rewrite bin's too iirc
<jhass>
in fact has an option to only rewrite those
moritzs has quit [Remote host closed the connection]
larissa has joined #ruby
<alex88>
to restore, I'm dealing with damn aws opsworks that installs bundled ruby in the same folder where system ruby installs gem's executables
supermanBlack has quit [Remote host closed the connection]
<zlude>
jhass, i'm a little bit confused, i'm a beginner in ruby, in php it appears more easy to do i guess.
<jhass>
zlude: did you read some basic ruby tutorials?
agrinb_ has quit [Remote host closed the connection]
<jhass>
zlude: you can do basically the same as in php to do string building, but there are nicer alternatives
ndrei has joined #ruby
doev has joined #ruby
DaniG2k has joined #ruby
<jhass>
>> [1, 2, 3, 4].map {|n| n.to_s(2) }.join(".") # zlude, to just scratch the surface
<jhass>
bahar_: never looked at backburner but from the readme examples, Sidekiqs API looks a lot less redundant for me with more sane defaults chosen for you
klaut has joined #ruby
Takle has joined #ruby
joonty has quit [Quit: Leaving]
<jhass>
hanmac1: that's not even fewer characters!
balazs has joined #ruby
ClarusCogitatio has joined #ruby
patrick99e99 has quit [Ping timeout: 265 seconds]
Takle_ has joined #ruby
Takle has quit [Read error: Connection reset by peer]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
byprdct has quit []
davedev24_ has joined #ruby
failshell has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
<bahar_>
jhass: thats good, because it looks like sidekiq is more actively maintained, too
<rdark>
basically I want to ensure that an array (correct XML terminology?) is emptied and only contains my wanted entry
SethDusek5 has joined #ruby
SethDusek5 has left #ruby [#ruby]
banister has joined #ruby
Wolland has joined #ruby
<jhass>
rdark: nope, no arrays in xml
* rdark
goes into the wrong room
silkfox has joined #ruby
<rdark>
jhass: just out of interest, whats the equivilant in XML?
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
O
failshell has quit [Client Quit]
<jhass>
sorry
<jhass>
I'm not sure I'd say there's one
vifino has joined #ruby
<jhass>
XML is a tree structrue
banister is now known as banisterfiend
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
peta_ has joined #ruby
beef-wellington has quit [Ping timeout: 240 seconds]
<jhass>
so "a node with only leave childs" maybe?
ndrei has quit [Ping timeout: 250 seconds]
beef-wellington has joined #ruby
<jhass>
*leaf
agjacome has quit [Quit: leaving]
Wolland has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
oo_ has quit [Remote host closed the connection]
viet_power has quit [Ping timeout: 245 seconds]
silkfox has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
mdarby has joined #ruby
coderhs has joined #ruby
coderhs has quit [Remote host closed the connection]
hamakn has quit [Remote host closed the connection]
timonv_ has joined #ruby
sk87 has joined #ruby
sk87 has quit [Client Quit]
jaequery has quit [Client Quit]
at3560k has joined #ruby
hamakn has joined #ruby
<at3560k>
Hi there, I've googled a bit, but haven't found quite what I'm looking for... could someone recommend an examplary cookbook or gist with an ini file/singleton pattern for an application config?
ndrei has joined #ruby
klaut has quit [Remote host closed the connection]
<banisterfiend>
apeiros ping
SethDusek5 has joined #ruby
<apeiros>
pong
<apeiros>
*sob*, headache doesn't help solving equations. not having done it for years doesn't help either :-(
gigetoo has quit [Read error: Connection reset by peer]
peta_ has quit [Remote host closed the connection]
<Cat_1>
What equation?
peta_ has joined #ruby
peta_ has left #ruby [#ruby]
hamakn has quit [Ping timeout: 255 seconds]
<apeiros>
Cat_1: calculating interception course in 2d space
jgrevich has joined #ruby
ericli has quit [Quit: This computer has gone to sleep]
gigetoo has joined #ruby
ducklobster has quit [Ping timeout: 246 seconds]
<Cat_1>
Good luck sir :)
SethDusek5 has left #ruby [#ruby]
rkalfane has joined #ruby
kobain has joined #ruby
<apeiros>
I think I have solved it. but I keep getting wrong results :-/
kobain has quit [Changing host]
kobain has joined #ruby
<Cat_1>
Equations of motion are fun
<jhass>
at3560k: there's a ton of context missing in your question
<Cat_1>
gist it?
mib_mib has joined #ruby
<apeiros>
it doesn't seem to be difficult. but I lost practice and headache doesn't help either :-/
klaut has joined #ruby
agrinb has joined #ruby
klaut has quit [Remote host closed the connection]
troulouliou_dev has joined #ruby
<apeiros>
Cat_1: it's JS. but I'm happy if somebody takes a look :)
beef-wellington has quit [Ping timeout: 265 seconds]
<Fractional>
What's more right? class Foo; @updater = Updater.new; def initialize(a); @a = a; end; end or: class Foo; def initialize(a); @updater = updater.new; @a = a; end; end?
<twohlix>
k, and maxspeed is the magnitude of the xy vector you can do. 0 acceleration time?
<jhass>
zlude: doesn't change my answer
<at3560k>
jhass: I'm a bit new to ruby, have found the ini file and am writting a command line driven application. There'll be typical options such as "debug" that could override a user's .rc file. I was simply looking for an...idiomatic way to write this. Looking at ini file documentation, I'd expect it to use...symbols instead of strings
Photism has joined #ruby
nucatus has joined #ruby
<apeiros>
assuming constant velocity of the target ship and assuming we can immediately turn in that direction and travel at full speed
<twohlix>
k, cool
Ankhers has joined #ruby
agrinb_ has joined #ruby
<apeiros>
twohlix: correct
<apeiros>
would be too complex if I'd factor that stuff in too :D
Macaveli has joined #ruby
Fractional has quit [Client Quit]
<twohlix>
yea, you'd be doing some calculus :)
Fractional has joined #ruby
<Fractional>
.
<Fractional>
What's more right? class Foo; @updater = Updater.new; def initialize(a); @a = a; end; end or: class Foo; def initialize(a); @updater = updater.new; @a = a; end; end?
<apeiros>
I'll leave that as an exercise for people implementing adjutants :D
msmith_ has joined #ruby
<Fractional>
Sorry if double post, I believe I was disconnected.
<apeiros>
(adjutants will be pieces of code which take over tasks for you - such as managing your ships)
<apeiros>
so there's none "being more right". you'll have to say what you intend to do
<at3560k>
jhass: yes, I'm reading the documentation on ersion 3.0 right now
<Fractional>
apeiros, how are they not equivalent? Both are declaring and initializing @a in the constructor. The difference is where @updater gets declared and initialized.
<apeiros>
twohlix, Cat_1: I'd gist the equations. but they're scribbled by hand on paper :D
<twohlix>
yea
<twohlix>
I've figured the EQs out i think
<Fractional>
Is there a reason to why my teacher decides to declare and initialize variables outside of the constructor, if it does not have anything to do with the constructors parameters?
<apeiros>
Fractional: yes, first one does not have @updater in your Foo instances
<apeiros>
>> class Foo; @x = 1; end; Foo.new.instance_variables
<jhass>
at3560k: I'd suggest you get pry (pryrepl.org), load the gem and play around a bit ;)
yfeldblum has joined #ruby
<at3560k>
All I'm getting at is looking at those documents, from what I've seen is that it feels...different from other ruby I've been using. I would expect the sections to be :symbols. I can write it, but it feels... like I'm not understanding a use pattern
<apeiros>
>> class Foo; @x = 1; end; Foo.instance_variables
<apeiros>
Fractional: ^ compare those two pieces of code and their output
lampd1 has quit [Remote host closed the connection]
agrinb_ has quit [Ping timeout: 272 seconds]
<Fractional>
Oh right.
<Fractional>
Thank you :P
<Cat_1>
I'm assuming you want a = sqrt(targetVelocityX*targetVelocityX + targetVelocityY*targetVelocityY - ownMaxVelocity*ownMaxVelocity)
SpaceKookie has quit [Ping timeout: 256 seconds]
<at3560k>
I'll look into it...thanks
jaequery has joined #ruby
Neozonz has quit [Ping timeout: 265 seconds]
jasooon has joined #ruby
<Cat_1>
Looks like you're trying to do a pythagorean identity there
nemesit|znc has quit [Ping timeout: 256 seconds]
viet_power has joined #ruby
ohcibi_ has joined #ruby
t_mmyv has joined #ruby
dcopeland_ has joined #ruby
tagrudev has quit [Remote host closed the connection]
<jhass>
at3560k: well you generally don't want to convert user input (like configuration files) to symbols, so the gem rightfully keeps the internal structures as strings. But at least things like Inifile#[] seems to call #to_s on the argument, so you can very well pass a symbol and it should work
<apeiros>
I'll try to transcribe my equations. but give me a second first. want to check something first.
<apeiros>
well, second == ~5min :)
agrinb__ has quit [Ping timeout: 272 seconds]
kalleth has quit [Ping timeout: 256 seconds]
ohcibi has quit [Ping timeout: 256 seconds]
lele has quit [Ping timeout: 256 seconds]
dcopeland has quit [Ping timeout: 256 seconds]
bauruine has quit [Ping timeout: 256 seconds]
<at3560k>
So maybe I've been learning an anti-idiom... good to know.
<at3560k>
thanks
last_staff has quit [Remote host closed the connection]
dcopeland_ is now known as dcopeland
kalleth has joined #ruby
<apeiros>
Cat_1: pythagoras only comes in as a part of the equation - ownVelocityX^2 + ownVelocityY^2 == maxOwnVelocity^2
<Spami>
by any chances does anyone knows how to remove ruby-install and all rubies ?
<Fractional>
.
heftig_ has joined #ruby
<balazs>
does anyone know if Fog::AWS::SQS has a state in it ? I cannot seem to receive the same messages twice, even though it is not deleted from the queue.
rshetty has quit [Remote host closed the connection]
nucatus_ has joined #ruby
SpaceKookie has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
jaequery has quit [Client Quit]
eka_ has joined #ruby
andikr has quit [Remote host closed the connection]
Constant_ has joined #ruby
<twohlix>
apeiros, you shouldn't have to do quadratic at all
Hightower666 has quit [Ping timeout: 244 seconds]
ClarusCogitatio has quit [Ping timeout: 258 seconds]
<balazs>
duh, nm, must be the Default Visibility Timeout
jottr has quit [Read error: Connection reset by peer]
snath has quit [Ping timeout: 256 seconds]
papal has quit [Ping timeout: 256 seconds]
gilmour has quit [Ping timeout: 256 seconds]
jasooon has quit [Ping timeout: 260 seconds]
ubra has left #ruby [#ruby]
mdarby has quit [Ping timeout: 256 seconds]
ConstantineXVI has quit [Ping timeout: 256 seconds]
eka has quit [Ping timeout: 256 seconds]
Cat_1 has quit [Ping timeout: 256 seconds]
reek has quit [Ping timeout: 256 seconds]
BlackGear has quit [Max SendQ exceeded]
gizmore has joined #ruby
gizmore has quit [Changing host]
gizmore has joined #ruby
iceden has quit [Ping timeout: 264 seconds]
edwardly_ is now known as edwardly
bauruine has joined #ruby
tessi_zz has joined #ruby
papal has joined #ruby
iceden has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
jrdnull has joined #ruby
BlackGear has joined #ruby
gilmour has joined #ruby
ubra has joined #ruby
mary5030 has joined #ruby
gr33n7007h has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
klaut has joined #ruby
Constant_ has quit [Client Quit]
ConstantineXVI has joined #ruby
arup_r has joined #ruby
Cat_1_ has joined #ruby
<Cat_1_>
man my internet connections' been whacky lately
Neozonz|Disc2 has joined #ruby
manzo has joined #ruby
aclearma_ has joined #ruby
ClarusCogitatio has quit [Ping timeout: 250 seconds]
gsd has joined #ruby
geggam has joined #ruby
mikeg has joined #ruby
Neozonz|Disc has quit [Ping timeout: 265 seconds]
<apeiros>
hm, it seems to be a problem with numeric stability when "a" goes towards zero in the quadratic equation
<apeiros>
otherwise it seems to produce proper results
aclearman037 has quit [Ping timeout: 258 seconds]
BlackGear has quit [Read error: Connection reset by peer]
<apeiros>
Cat_1_: what's the rationale for using sqrt there?
BlackGear has joined #ruby
<apeiros>
I'll gist the equations. transcribing now. will take a couple of minutes I guess.
byprdct has joined #ruby
Neozonz has joined #ruby
ClarusCogitatio has joined #ruby
gsd has quit [Client Quit]
<electrical>
Hi all. i have a string version of a hash due to limitation of the gemspec file ( metadata field ) is there a nice way to convert it into a real hash? would like to avoid using 'eval' :-)
renderful has joined #ruby
Neozonz|Disc2 has quit [Ping timeout: 255 seconds]
<workmad3>
electrical: I'd suggest storing it as a string of json or yaml
robustus is now known as robustus|Off
rostam has quit [Remote host closed the connection]
benzrf|offline is now known as benzrf
klaut has quit [Remote host closed the connection]
mikeg has quit [Ping timeout: 258 seconds]
<jhass>
^ but I wonder if there's actually anything enforcing that restriction?
<electrical>
workmad3: storing as json could be possible yeah
Neozonz|Disc has joined #ruby
Neozonz|Disc has joined #ruby
gsd has joined #ruby
sigurding has quit [Quit: sigurding]
Channel6 has quit [Quit: Leaving]
hanmac1 has quit [Quit: Leaving.]
robustus|Off is now known as robustus
momomomomo has joined #ruby
BlackGear has joined #ruby
marcdel has joined #ruby
larissa has quit [Quit: Leaving]
BlackGear has quit [Max SendQ exceeded]
Takle_ has quit [Remote host closed the connection]
BlackGear has joined #ruby
robbyoconnor has joined #ruby
heftig_ is now known as heftig
Neozonz has quit [Ping timeout: 265 seconds]
Neozonz has joined #ruby
govg has joined #ruby
oleo is now known as Guest97114
oleo__ has joined #ruby
Takle has joined #ruby
oleo__ has quit [Read error: Connection reset by peer]
<zlude>
jhass, i give up.
finferl has quit [Remote host closed the connection]
<jhass>
zlude: what did you try?
<jhass>
(don't paste the same thing again)
mostlybadfly has joined #ruby
Neozonz|Disc has quit [Ping timeout: 258 seconds]
rkalfane has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
marcdel has quit [Ping timeout: 265 seconds]
robbyoconnor has quit [Client Quit]
rkalfane has joined #ruby
ClarusCogitatio has quit [Ping timeout: 245 seconds]
<shevy>
haha
<jhass>
did you read some basic ruby tutorial like I suggested?
<shevy>
paste it!
<shevy>
show it man!
oleo__ has joined #ruby
<zlude>
jhass, in fact, i really don't understand what you means with your example. I search in web how do that, but don't work! i create a var @test = "test" and call body "#{@test}", nothing on email body is going. just if i put static text. body "test" so, works.
kaspergrubbe has quit [Read error: Connection reset by peer]
<zlude>
shevy, i do @test = "test" and then.. body "#{@test}", nothing on email body
<tobiasvl>
zlude: you have some weird quotation marks in that code
<shevy>
nope
<jhass>
zlude: show the "doesn't work" example
<shevy>
but btw, in that example you can omit the #{} -> body @test
kaspergrubbe has joined #ruby
<tobiasvl>
or is it just my font
jaequery has quit [Client Quit]
VanillaGoat_ has quit [Ping timeout: 255 seconds]
Neozonz has quit [Ping timeout: 244 seconds]
<shevy>
body "" # How can i get the output from 'books' in my e-mail body?
<shevy>
what do you mean with books precisely
jaequery has joined #ruby
<jhass>
tobiasvl: probably a combination of pastebin.com and your font
<shevy>
this here?
<shevy>
books = @author.books
<tobiasvl>
zlude: I'm guessing you want to use the output that you puts on line 39? you never use that output for anything besides printing it to screen
<tobiasvl>
put the result from the each block into a string and use that?
<shevy>
zlude always keep your code as simple as possible
Xiti has joined #ruby
<jhass>
shevy: it's fairly simple already
<shevy>
I dunno
bal has quit [Quit: bal]
<jhass>
zlude: still waiting for your actual attempt, not your "I don't know further, solve it for me"
bigkevmcd has quit [Ping timeout: 245 seconds]
ki0 has joined #ruby
<shevy>
he writes stuff like "How can i get the output from 'books' in my e-mail body?" but I don't see 'books', I see 'book' like book.id
sk87 has joined #ruby
<zlude>
<shevy> "books = @author.books" ?
<shevy>
is that books?
Wolland has joined #ruby
<shevy>
I mean I don't know what it returns
lampd1 has quit [Client Quit]
<shevy>
you probably want a string representation
<shevy>
that's kinda hard to debug remotely!
<tobiasvl>
I'm 100% sure zlude means he wants books to be the concatenation of the strings from all iterations on line 39
<tobiasvl>
so zlude, do that
<shevy>
aha
<shevy>
now that is a lot clearer to me
<jhass>
tobiasvl: already pointed him to map and join
<shevy>
yes zlude have you used .map?
<shevy>
I guess he gave up
tlarevo has joined #ruby
<zlude>
shevy, I really don't understand how map can help me.
Neozonz|Disc2 has joined #ruby
agrinb has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fandi has quit [Remote host closed the connection]
jaequery has joined #ruby
<shevy>
well
jaequery has quit [Max SendQ exceeded]
<shevy>
what is books
<jhass>
zlude: let's work on that when we figured out why passing a static variable to body didn't work for you
Neozonz|Disc2 has quit [Ping timeout: 255 seconds]
Dude007 has quit []
<zlude>
shevy, so, what is collect it?
wang has quit [Ping timeout: 244 seconds]
<apeiros>
I think I have to special case a ~= 0
<shevy>
zlude well, we need to agree that you want to send some text towards body() right?
oleo__ is now known as oleo
braincra- has joined #ruby
<twohlix>
apeiros, there is always the case where the thing you're trying to intercept is faster than the ship you're using to intercept. Sometimes they'll have an intersection point, sometimes they wont.
rkalfane has joined #ruby
oleo has quit [Quit: Verlassend]
wang has joined #ruby
<apeiros>
twohlix: yes, that's when the quadratic equation yields no result
<zlude>
shevy, I want to send in body the @author.books from "Linda Liukas"
Neozonz|Disc has joined #ruby
hamakn has joined #ruby
josephndenton has quit [Ping timeout: 250 seconds]
<shevy>
he never says yes or no :(
Bounga has joined #ruby
<apeiros>
twohlix: there's also the case where it has the same speed and same heading -> uninterceptable too. also yields no result for quadratic.
<shevy>
ah ok non-native english speaker
oleo has joined #ruby
msmith__ has joined #ruby
<shevy>
zlude you can run debug statements in your code; require 'pp'; pp @author.books - it probably won't work alone as it is not a string, and body() probably wants a string or?
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shevy>
but I would not write it like that, I would break it into small chunks so that my poor brain and my poor eyes don't have to stare at long lines
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
dkb20k has quit [Remote host closed the connection]
mib_mib has joined #ruby
ClarusCogitatio has quit [Ping timeout: 265 seconds]
<jhass>
zlude: that's because some weird ruby trick Mail.deliver does
mistermocha has joined #ruby
<jhass>
zlude: it changes the scope for where @instance_variables are looked up
mib_mib has quit [Ping timeout: 240 seconds]
<jhass>
which then also allows you to call methods like to in that scope
freerobby has joined #ruby
<shevy>
aaaah
<shevy>
how evil
momomomomo has quit [Ping timeout: 264 seconds]
momomomomo_ is now known as momomomomo
jottr_ has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
<apeiros>
I think not all of the result cases I handle for the quadratic equation should be possible, though :)
ql6wlld has joined #ruby
aganov has quit [Remote host closed the connection]
msmith_ has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr_ has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
moritzs has joined #ruby
Neozonz|Disc has quit [Ping timeout: 265 seconds]
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Neozonz has joined #ruby
msmith__ has quit [Ping timeout: 255 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
noop has quit [Read error: Connection reset by peer]
<zlude>
shevy and jhass, thank you a lot guys, and I'm sorry for my fucking newbie skills :/ i'll continuing on study.
zachrab has quit [Remote host closed the connection]
<shevy>
hey that is non trivial zlude
jasooon has joined #ruby
<shevy>
I did not keep in mind that it could change the meaning of @ivars
<shevy>
I find that really evil
coderhs has joined #ruby
<shevy>
it hopefully is not matz approved!
<jhass>
zlude: I could have pointed that out a lot earlier if you just shared your actual attempt ;)
zachrab has joined #ruby
<jhass>
so don't be sorry for being new to ruby
sambao21 has joined #ruby
oo_ has joined #ruby
_maes_ has joined #ruby
<zlude>
jhass, shevy... means my code is a shit? I really like webapps, and i will learn Rails soon, but i really need to try to understand ruby first. So i'm trying to do with just ruby somethings possible with php.
<shevy>
zlude dunno, there is not a lot of your code is it? you just use a lot of code written by other people
ixti has joined #ruby
<jhass>
zlude: no, that's totally not what I'm saying
<shevy>
jhass there is the language barrier!
<jhass>
zlude: you always shared the "last working" state, why I asked for the state that actually fails
<zlude>
shevy, wtf! i write by hand code by code in this example.
<MattB2>
in your _order partial render order.line_items
Neozonz has quit [Ping timeout: 244 seconds]
<shevy>
zlude well you just use code written by others really ;)
<jhass>
MattB2: channel
<MattB2>
jhass sorry
maestrojed has joined #ruby
CustosLimen has quit [Ping timeout: 255 seconds]
dangerousdave has joined #ruby
<zlude>
shevy, I'm not a php prog, i'm newbie in php too, i'm beginning with dev, so a friend said, php sucks, learn ruby. so i come to ruby instead php
Pete_____ has joined #ruby
jasooon has quit [Ping timeout: 240 seconds]
<shevy>
learn php first - you will want to switch at a later time anyway :)
zachrab has quit [Ping timeout: 245 seconds]
Pupeno_ has joined #ruby
WillAmes has quit [Remote host closed the connection]
<shevy>
apeiros wrote a lot of php code when he was young
Neozonz has joined #ruby
<shevy>
and look what he now does - rails, rails, rails
oo_ has quit [Ping timeout: 258 seconds]
<jhass>
zlude: note that shevy talks a lot of nonesense if the day is long, don't take all of it too seriously ;)
<apeiros>
shevy says that right after I pasted javascript :-p
WillAmes has joined #ruby
<shevy>
well now that is an option
<shevy>
zlude you could learn javascript first
<zlude>
jhass, but, my code in this example, my Ruby code is bad written? or not.. i'm using it surely.?
doev has joined #ruby
<jhass>
there's not much room in there for bad code tbh
<zlude>
shevy, i know a little bit of javascript
Xeago_ has quit [Remote host closed the connection]
<jhass>
zlude: whatever language it is, focus on one to learn programming. picking up new languages is a lot easier afterwards
<apeiros>
"why does ruby complain about this non-ruby code?!?" well, no idea :-D
mkaesz has quit [Remote host closed the connection]
* jheg
looks sheepish
HOTMILF4U is now known as TPBallbag
* jheg
slowly exists irb
<jheg>
exits
<jheg>
ffs
<apeiros>
twohlix: now on to the next problem - intercept with an "orbit" (since weapons have an optimal firing distance) :)
<apeiros>
though, I'll probably not do that now. exercise for adjutant implementors too.
jheg has quit [Quit: jheg]
<apeiros>
providing intercept and orbit functions should be sufficient to get started
weemsledeux has joined #ruby
weemsledeux has joined #ruby
<jhass>
you game devs, I'll never get you. All wannabe mathematicians
mistermocha has joined #ruby
<apeiros>
jhass: guess why I totally support my wife studying maths :-p
noop has joined #ruby
<apeiros>
statistics will come in handy for balancing
manzo has quit [Ping timeout: 245 seconds]
<apeiros>
too sad she's not interested in computer games. well… not yet… *cooks up plans to drag her into it*
<Fire-Dragon-DoL>
are there any function to select an array of indexes of elements of an array? I need to pick index 3,7 and 10 from array
<apeiros>
Fire-Dragon-DoL: values_at
<Fire-Dragon-DoL>
thanks apeiros, and that's the right trick by the way :P
Insanity133 has quit [Ping timeout: 260 seconds]
Neozonz|Disc has quit [Ping timeout: 265 seconds]
geggam has joined #ruby
Neozonz has joined #ruby
TomyWork has quit [Ping timeout: 250 seconds]
jshultz has joined #ruby
lkba has joined #ruby
beneggett has joined #ruby
bigkevmcd has joined #ruby
klaut has joined #ruby
j_mcnally has joined #ruby
einarj has quit [Remote host closed the connection]
oo_ has joined #ruby
momomomomo_ has joined #ruby
jherbst has joined #ruby
akamel has joined #ruby
jaequery has joined #ruby
momomomomo has quit [Ping timeout: 265 seconds]
momomomomo_ is now known as momomomomo
Neozonz|Disc has joined #ruby
Neozonz|Disc has joined #ruby
manzo has joined #ruby
shredding has joined #ruby
patric100e99 has joined #ruby
manzo has quit [Remote host closed the connection]
zB0hs has joined #ruby
momomomomo has quit [Client Quit]
oo_ has quit [Ping timeout: 264 seconds]
Neozonz has quit [Ping timeout: 255 seconds]
treehug88 has joined #ruby
triple_b has quit [Read error: Connection reset by peer]
triple_b has joined #ruby
jfran has joined #ruby
lmickh has joined #ruby
patric100e99 has quit [Ping timeout: 245 seconds]
agrinb has joined #ruby
gsd has joined #ruby
jobewan has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
tobago has quit [Remote host closed the connection]
zachrab has joined #ruby
techsethi has joined #ruby
iwishiwerearobot has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
Neozonz|Disc has quit [Ping timeout: 255 seconds]
agrinb has quit [Ping timeout: 244 seconds]
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shredding has quit [Quit: shredding]
Akuma has quit [Ping timeout: 255 seconds]
zachrab has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
mistermocha has quit [Remote host closed the connection]
dANO_ has quit []
techsethi has quit [Quit: techsethi]
Luser has quit [Ping timeout: 265 seconds]
Akuma has joined #ruby
fawefeawfewa has quit [Ping timeout: 264 seconds]
Takle has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
Morkel has quit [Quit: Morkel]
sambao21 has joined #ruby
Neozonz has joined #ruby
mwagner_ has joined #ruby
mwagner_ has quit [Client Quit]
wagster has joined #ruby
TPBallbag has quit [Remote host closed the connection]
bricker`work has joined #ruby
Fractional has joined #ruby
avril14th has joined #ruby
<Fractional>
Anyone here who offers code reviews for student-level code? Please message me. It's < 1000 lines. Would be appreciated :)
olivier_bK has quit [Ping timeout: 250 seconds]
jwang__ has quit [Ping timeout: 265 seconds]
garethrees has quit [Ping timeout: 255 seconds]
Snowstormer has joined #ruby
<avril14th>
Hello, how does one write a ruby regex that could turn the string 'some key is the key' into the array ['some key', ' is the key'] (when using String#match) ?
mib_mib has joined #ruby
<havenwood>
Fractional: Paste a link to a Gist here in the channel?
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<avril14th>
jhass: 'key' appears nowhere in the regex, how can be?
* avril14th
goes trying
<jhass>
oh, three words
shazaum_ has joined #ruby
<jhass>
avril14th: maybe make a list with real world examples, I think your abstraction is wrong or at least confusing
Neozonz has quit [Read error: Connection reset by peer]
<havenwood>
avril14th: what are the rules for where to split?
beef-wellington has joined #ruby
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Neozonz has joined #ruby
<havenwood>
avril14th: more examples of correct split!
Darryl_ has quit [Quit: Connection closed for inactivity]
BlackGear has quit [Ping timeout: 244 seconds]
shazaum has quit [Ping timeout: 258 seconds]
<avril14th>
'some weird sentence with weird whatever 12384786/&() things in the weird' => ['some weird',' sentence with weird',' whatever 12384786/&() things in the weird']
mib_mib has quit [Ping timeout: 244 seconds]
allcentury has quit [Ping timeout: 245 seconds]
<avril14th>
split up to a given word (in above example 'weird')
<jhass>
avril14th: stop the abstractions already
<shevy>
that is a weird sentence
Snowstormer is now known as Paramore
lw has joined #ruby
roolo has quit [Remote host closed the connection]
<jhass>
if that's your real example this sounds like homework
<jhass>
in which case I only give you hints: split + lookbehind assertion
momomomomo has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
<avril14th>
homewhat?
AlexRussia has quit [Quit: WeeChat 1.1-dev]
pandaant has quit [Remote host closed the connection]
pietr0 has joined #ruby
AlexRussia has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
moritzs has joined #ruby
roolo has joined #ruby
jasooon has joined #ruby
dkb20k has quit [Ping timeout: 265 seconds]
sailias has quit [Read error: Connection reset by peer]
sailias has joined #ruby
AlexRussia has quit [Client Quit]
ndrei has quit [Ping timeout: 256 seconds]
AlexRussia has joined #ruby
Hijiri has joined #ruby
<shevy>
homesex
bigkevmcd has quit [Ping timeout: 255 seconds]
Neozonz has quit [Read error: Connection reset by peer]
Jake232 has joined #ruby
reisl has joined #ruby
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Neozonz has joined #ruby
TPBallbag has joined #ruby
<shevy>
you have come to the weird part of the internet
<shevy>
welcome to #ruby!
lw has quit [Read error: Connection reset by peer]
romistrub has joined #ruby
lw has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
troyready has joined #ruby
tier has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
<romistrub>
what kind of Error should I raise if a received string does not match the expected format?
Neozonz has quit [Read error: Connection reset by peer]
<romistrub>
for example, if I'm validating an HTTP request, and the request is malformed
jwang__ has joined #ruby
Neozonz has joined #ruby
Neozonz has quit [Changing host]
Neozonz has joined #ruby
<avril14th>
romistrub: 400 Bad Request I would do
TPBallbag has quit [Remote host closed the connection]
<romistrub>
avril14th: sure, that's what I'll send, but in the code itself, should I create my own Exception class called BadRequest? and if so, which Exception should it inherit from?
<avril14th>
romistrub: this is your own organization to decide
<jhass>
in doubt StandardError
sailias has quit [Quit: Leaving.]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
sailias1 has joined #ruby
jasooon has quit [Ping timeout: 265 seconds]
<romistrub>
hmm, ok, thanks guys
otherj has joined #ruby
<avril14th>
romistrub: my way: use api-pie gem and rescue the exception it throws
<gsd>
are there any tools / services that will automatically email me when either ruby or one of my gems has an updated version
rshetty has quit [Remote host closed the connection]
melik has joined #ruby
Gadgetoi- has joined #ruby
Gadgetoid has quit [Ping timeout: 272 seconds]
Gadgetoi- is now known as Gadgetoid
oo_ has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
reisl is now known as larissa
treehug88 has quit [Ping timeout: 265 seconds]
<Fractional>
havenwood: Thank you, will look into it. Is there anything else you are thinking of?
emlosis has left #ruby ["Leaving"]
klaut has joined #ruby
<havenwood>
Fractional: It's nice to have the file structure mirror the namespace. Think about what namespace your code should be in.
botwin has joined #ruby
<avril14th>
and if you don't follow the structur Rails will complain if u use rails
hamakn has quit [Remote host closed the connection]
<havenwood>
Fractional: Typically we require each file individually, explicitly.
jimmyhoughjr has joined #ruby
hamakn has joined #ruby
kwd has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
<wm3|busy>
avril14th: you can ignore the file structure in rails... you just need to explicitly require stuff like in normal ruby... it'll complain if you let anything fall back to autoloading that isn't in the convention-based structure
poulet_a has quit [Quit: Quitte]
<wm3|busy>
avril14th: i.e. it falls back to being as difficult as normal ruby, rather than not being possible ;)
chthon has quit [Ping timeout: 245 seconds]
klaut has quit [Remote host closed the connection]
<Fractional>
havenwood, Ok, got it. Will re-organise file structure, follow the RubyGems-style file structure and namespacing. Is there anything else you see in the code? I appreciate all feedback :D
allcentury has joined #ruby
<havenwood>
Fractional: Just in case you don't know the globbing double splat, what you're requiring in those three lines is equivalent to: Dir['lib/**/*.rb']
hmsimha has joined #ruby
centrx has joined #ruby
mtakkman has joined #ruby
<havenwood>
Fractional: looking
einarj has joined #ruby
<Fractional>
havenwood: Oh, that's cool!
<avril14th>
wm3|busy: indeed but you may expose yourself to strange behaviors, such as ActiveSupport::Concern modules complaining about multiple loadings or simple plain autoloading of failes failing silently
<havenwood>
Fractional: drop the './' prefix too
<havenwood>
Fractional: also the .rb suffix
<havenwood>
oh, nvm
hamakn has quit [Ping timeout: 244 seconds]
<havenwood>
from the require, but not your glob
<havenwood>
meh
<wm3|busy>
avril14th: heh :) I don't touch ActiveSupport::Concern modules, and autoloading just doesn't engage if the constant is already present (which is why rails has always needed you to do things like load monkey-patch files in lib/ext manually)
<wm3|busy>
avril14th: but yeah, it's less than ideal, and it can be awkward to work around
treehug8_ has quit [Read error: Connection reset by peer]
treehug88 has joined #ruby
aclearma_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
Fractional: If you don't need to support 1.8, which is past end-of-life, then I think 1.9-style Hash syntax when keys are Symbols is nice.
wallerdev has joined #ruby
<Fractional>
havenwood, I agree with you - are you referring to the resourceloader?
<havenwood>
Fractional: *code change for the humans :)
Timgauthier has joined #ruby
Timgauthier is now known as timgauthier_away
weaksauce has joined #ruby
mattmcclure has joined #ruby
timgauthier_away is now known as Timgauthier
dkphenom has joined #ruby
treehug88 has quit [Ping timeout: 265 seconds]
francisfish has quit [Remote host closed the connection]
Takle has joined #ruby
mtakkman has quit [Ping timeout: 255 seconds]
wm3|busy is now known as workmad3
<Fractional>
havenwood, good idea! :)
josephndenton has quit [Ping timeout: 265 seconds]
<Fractional>
havenwood, is there a prettier way to do the active? method in button.rb?
Pupeno has joined #ruby
sepp2k has joined #ruby
<havenwood>
Fractional: just keep the middle line
<havenwood>
Fractional: @active can only be `nil` or `false`, and line 32 returns correctly it seems
doev has quit [Ping timeout: 260 seconds]
Hijiri has quit [Ping timeout: 265 seconds]
momomomomo has quit [Quit: momomomomo]
timonv_ has quit [Remote host closed the connection]
<havenwood>
Fractional: is that what you want? ^
timonv_ has joined #ruby
<havenwood>
Fractional: @active = false if @active
<Fractional>
havenwood, will have to check in a moment! Working on the refactoring, thanks a lot for all the feedback ! :)
moritzs has quit [Remote host closed the connection]
dkphenom has quit [Ping timeout: 245 seconds]
timonv_ has quit [Remote host closed the connection]
Pupeno_ has quit [Ping timeout: 245 seconds]
<havenwood>
Fractional: No prob.
spider-mario has joined #ruby
danman has joined #ruby
diegoviola has joined #ruby
<Fractional>
havenwood, nope I wanted the state before the changed state to handle my button clicking events (in example_state.rb#update)
einarj has quit [Remote host closed the connection]
androidbruce has joined #ruby
Timgauthier has quit [Max SendQ exceeded]
<havenwood>
Fractional: Ahh
tier has joined #ruby
avril14th has quit [Remote host closed the connection]
<havenwood>
odd
kaspergr_ has joined #ruby
Timgauthier has joined #ruby
emmesswhy has joined #ruby
ptrrr has joined #ruby
rylev has quit [Remote host closed the connection]
tercenya_ has joined #ruby
benzrf is now known as benzrf|offline
rostam has quit [Read error: Connection reset by peer]
uxp_ has joined #ruby
Timgauthier has quit [Max SendQ exceeded]
jjasonclark has quit [Quit: jjasonclark]
jayne has quit [Read error: Connection reset by peer]
uxp has quit [Read error: Connection reset by peer]
Spami has quit [Quit: This computer has gone to sleep]
rostam has joined #ruby
klaut has joined #ruby
jimmyhoughjr has quit [Read error: Connection reset by peer]
kaspergrubbe has quit [Ping timeout: 255 seconds]
mdarby has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tercenya has quit [Ping timeout: 264 seconds]
<Fractional>
havenwood, I know what I am missing - a gemfile!
<havenwood>
Fractional: Seems strange to respond to `active?` by changing `@active`'s state to `false`, then return the past state which is no longer the case.
renderful has joined #ruby
<havenwood>
Fractional: Gemfile ftw!
<Authenticator>
Is there a way to use catch/throw (not raise/rescue) from a sub-thread?
<Fractional>
havenwood, it's only going to contain one gem, but might as well go for it!
<wallerdev>
no
auxbuss has joined #ruby
altamic has joined #ruby
<Fractional>
havenwood, will write up documenting in my to-do list
<havenwood>
Fractional: but yeah, simple enough to create a gem by hand ;)
<havenwood>
Fractional: a skill worth leveling up on
idoru has joined #ruby
tlarevo has quit [Read error: Connection reset by peer]
mib_mib has joined #ruby
tlarevo has joined #ruby
<Fractional>
havenwood, I am confused now. It created a git repository within my already existing git repository :o
chrishough has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iamjarvo has joined #ruby
<Fractional>
havenwood, is this how things should be?
porfa has quit [Ping timeout: 244 seconds]
<havenwood>
Fractional: the command creates a new directory for your new gem, it's just a presumption bundler makes
<havenwood>
Fractional: you can nuke the directory it creates, it's just a template for creating a gem from scratch
<havenwood>
Fractional: there're more than one ways to do it too
<havenwood>
tools other than bundler, plenty of folk just do it by hand, or write their own gem generator
baroquebobcat has joined #ruby
boombadaroomba has joined #ruby
porfa has joined #ruby
jenrzzz has joined #ruby
mib_mib has quit [Ping timeout: 244 seconds]
Gadgetoid_ has joined #ruby
<Fractional>
havenwood, what name does the 'nuke' command go under?
<workmad3>
Fractional: 'rm -rf' on a *nix
kaspergr_ has quit [Remote host closed the connection]
<workmad3>
Fractional: on windows... right click and 'delete'? :P
<Fractional>
workmad3, oh, thought you had to do more. Nevermind.
allcentury has quit [Ping timeout: 265 seconds]
<workmad3>
Fractional: :)
Peter__ has joined #ruby
payne__ has joined #ruby
workmad3 is now known as wm3|away
auxbuss has quit [Quit: I'm gone.]
lw has quit [Quit: s]
payne__ has quit [Read error: Connection reset by peer]
__MysT has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
centrx has quit [Ping timeout: 255 seconds]
m8 has joined #ruby
Timgauthier has joined #ruby
Gadgetoid_ is now known as Gadgetoid
Gadgetoid is now known as gadgetoid
nucatus has joined #ruby
gadgetoid is now known as Gadgetoid
rshetty has joined #ruby
<Fractional>
havenwood, how do I generate the gemfiles with bundler in working directory?
rdark has quit [Quit: leaving]
JohnBat26 has joined #ruby
shredding has joined #ruby
Insanity133 has joined #ruby
moritzs has joined #ruby
klaut has joined #ruby
jasooon has joined #ruby
bMalum_ has joined #ruby
<havenwood>
Fractional: copy the generated files to your working directory
icarus has joined #ruby
bMalum has quit [Ping timeout: 255 seconds]
bMalum_ is now known as bMalum
Peter__ has quit [Remote host closed the connection]
aclearman037 has joined #ruby
<havenwood>
Fractional: you can check `bundle help gem` but i don't think bundler has sophisticated options, you're left to your own devices
klaut has quit [Remote host closed the connection]
<havenwood>
it just has basic bootstrapping from scratch
rshetty has quit [Ping timeout: 272 seconds]
<Fractional>
havenwood, oh ok thank you for the advice. Will definitely do this.
Insanity133 has quit [Ping timeout: 258 seconds]
fr1eza has joined #ruby
ubra has left #ruby [#ruby]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jasooon has quit [Ping timeout: 272 seconds]
tlarevo_ has joined #ruby
Takle has quit [Remote host closed the connection]
<Fractional>
havenwood, your spotting of the odd button#active? method handling helped me solve a bug. Thank you!
altamic has quit [Quit: altamic]
<boombadaroomba>
Maybe better luck here. I need help with a conditional statement. https://gist.github.com/JasonY1/b9518ccf14b5d158d026 I want it to ensure end_date is after start_date but end_date is not required to create event.
sailias has quit [Quit: Leaving.]
sailias has joined #ruby
otherj has quit [Quit: .]
kaspertidemann has joined #ruby
davispuh has joined #ruby
tlarevo has quit [Ping timeout: 244 seconds]
TPBallbag has quit [Remote host closed the connection]
Musashi007 has joined #ruby
<wallerdev>
boombadaroomba: what do you need help with? whats the issue
shredding has quit [Quit: shredding]
emmesswhy has quit [Quit: This computer has gone to sleep]
tlarevo_ has quit [Ping timeout: 256 seconds]
jaequery has joined #ruby
centrx has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Max SendQ exceeded]
<boombadaroomba>
wallerdev: i think i figured it out. writing the question out helped me take a step back and evaluate
<wallerdev>
:)
jaequery has joined #ruby
<boombadaroomba>
I always get problems solved here. Thanks!
ramfjord has quit [Ping timeout: 260 seconds]
sevvie has joined #ruby
akamel has quit [Quit: Leaving.]
owen2 has joined #ruby
tier_ has joined #ruby
mdarby has joined #ruby
chrishough has joined #ruby
Areessell has quit [Quit: (null)]
Takle has joined #ruby
tier_ has quit [Remote host closed the connection]
iwishiwerearobot has joined #ruby
tier has quit [Read error: Connection reset by peer]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
byprdct has quit [Ping timeout: 265 seconds]
Takle has quit [Remote host closed the connection]
ctp has joined #ruby
iwishiwerearobot has quit [Ping timeout: 260 seconds]
jaequery has joined #ruby
jaequery has quit [Max SendQ exceeded]
jaequery has joined #ruby
mdarby has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
byprdct has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fwaokda has joined #ruby
tlarevo has joined #ruby
<fwaokda>
I setup ruby with rbenv, but I can't seem to figure out how to execute my ruby script. can anyone help me out?
mengu has joined #ruby
michael_mbp has quit [Excess Flood]
jaequery has quit [Client Quit]
<fwaokda>
I put "#!/usr/bin/env ruby" at the begininng of the script, but running "ruby myfile.rb" doesn't work. I did "which ruby" and get "/home/username/.rbenv/shims/ruby"
<romistrub>
Does Ruby infinitely loop if I do this: begin something rescue MyError raise MyError end (i.e. I'm raising the error within the rescue clause)
TPBallbag has joined #ruby
<jhass>
romistrub: no
iago-x86 has left #ruby [#ruby]
<romistrub>
fwaokda: what's the error output in the shell?
michael_mbp has joined #ruby
<romistrub>
jhass: thx
yfeldblum has joined #ruby
<shevy>
romistrub if you want looping rescues, you could use retry :)
<shevy>
begin rescue retry profit! end
TPBallbag has quit [Remote host closed the connection]
<fwaokda>
huh just typed it now and it works... i really don't know what has changed... :( romistrub, thanks for helping me ... figure it out?
jdj_dk has joined #ruby
bmurt has joined #ruby
lolmaus has joined #ruby
<romistrub>
fwaokda: anytime :P
Areessell has joined #ruby
<romistrub>
shevy: thxu but I was just trying to figure out the Exception handling behaviour
<shevy>
retry!
timonv_ has joined #ruby
sailias has quit [Quit: Leaving.]
mistermocha has joined #ruby
jimmyhoughjr has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
rkalfane has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
sailias has joined #ruby
tier has quit [Remote host closed the connection]
ndrei has joined #ruby
j_mcnally has quit [Ping timeout: 255 seconds]
iamjarvo has joined #ruby
mistermocha has quit [Remote host closed the connection]
claymore has quit [Ping timeout: 265 seconds]
mtakkman` has quit [Remote host closed the connection]
chrisja has joined #ruby
lw has joined #ruby
jenrzzz has joined #ruby
patrick99e99 has joined #ruby
wm3|away has quit [Ping timeout: 244 seconds]
dkb20k has joined #ruby
michael4 has joined #ruby
claymore has joined #ruby
treehug88 has joined #ruby
timonv_ has quit [Ping timeout: 256 seconds]
<bahar_>
has anyone here set up backburner or beaneater for job queuing?
xMopxShell has quit [Ping timeout: 250 seconds]
xMopxShell has joined #ruby
havenwood has quit [Remote host closed the connection]
treehug8_ has quit [Ping timeout: 255 seconds]
sk87 has joined #ruby
zwer has quit [Remote host closed the connection]
DLSteve has joined #ruby
zwer has joined #ruby
havenwood has joined #ruby
dkb20k has quit [Ping timeout: 258 seconds]
sk87 has quit [Client Quit]
St_Marx has quit [Quit: Ex-Chat]
luckyruby has joined #ruby
rylev has joined #ruby
Takle has joined #ruby
mib_mib has joined #ruby
dumdedum has quit [Quit: foo]
skolman_ has quit [Remote host closed the connection]
otherj has joined #ruby
lw has quit [Quit: s]
skolman_ has joined #ruby
jimmyhoughjr has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
nrsk has joined #ruby
rylev has quit [Ping timeout: 260 seconds]
kaspertidemann has quit []
mib_mib has quit [Ping timeout: 244 seconds]
timonv_ has joined #ruby
ki0 has joined #ruby
nrsk has quit [Client Quit]
corehook has joined #ruby
TPBallbag has joined #ruby
centrx has quit [Ping timeout: 250 seconds]
corehook has quit [Client Quit]
lw has joined #ruby
altamic has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lolmaus has quit [Ping timeout: 240 seconds]
ki0 has quit [Remote host closed the connection]
psyprus has quit [Ping timeout: 258 seconds]
jasooon has joined #ruby
patrick99e99 has quit [Quit: Lost terminal]
mikecmpbll has joined #ruby
omosoj has joined #ruby
ashdr0 has joined #ruby
ashdr0 has left #ruby ["Leaving"]
govg has quit [Remote host closed the connection]
jottr has joined #ruby
otherj has quit [Quit: .]
cpruitt has joined #ruby
iamjarvo has joined #ruby
decoponio has quit [Quit: Leaving...]
Hijiri has joined #ruby
jasooon has quit [Ping timeout: 245 seconds]
otherj has joined #ruby
allcentury has joined #ruby
tier has joined #ruby
jottr_ has quit [Ping timeout: 272 seconds]
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
otherj has quit [Client Quit]
psyprus has joined #ruby
sevvie has quit [Ping timeout: 245 seconds]
ki0 has joined #ruby
dkphenom has joined #ruby
ptrrr has quit [Quit: ptrrr]
jtdowney has joined #ruby
josephndenton has joined #ruby
lolmaus has joined #ruby
jtdowney has quit [Max SendQ exceeded]
ptrrr has joined #ruby
jtdowney has joined #ruby
Ankhers has joined #ruby
jtdowney has quit [Max SendQ exceeded]
jjasonclark has quit [Quit: jjasonclark]
jtdowney has joined #ruby
emmesswhy has joined #ruby
jtdowney has quit [Max SendQ exceeded]
jtdowney has joined #ruby
francisfish has joined #ruby
stunder has quit [Quit: Screw you guys I'm going home]
jtdowney has quit [Max SendQ exceeded]
ki0 has quit [Remote host closed the connection]
skolman_ has quit [Remote host closed the connection]
jtdowney has joined #ruby
ConstantineXVI has quit [Remote host closed the connection]
jtdowney has quit [Max SendQ exceeded]
b1nd has quit [Ping timeout: 240 seconds]
josephndenton has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
otherj has joined #ruby
jtdowney has joined #ruby
Rapier- has joined #ruby
jtdowney has quit [Changing host]
jtdowney has joined #ruby
ndrei has quit [Ping timeout: 255 seconds]
wald0 has quit [Ping timeout: 240 seconds]
djstorm has quit [Ping timeout: 255 seconds]
<Rapier->
Anyone happen to come across ruby functionality to extract internal domain name from SMTP (NTLM AUTH) challenge response?
mengu__ has joined #ruby
Hightower666 has joined #ruby
emmesswhy has quit [Quit: Leaving]
govg has joined #ruby
tercenya_ has quit []
mengu has quit [Ping timeout: 250 seconds]
tercenya has joined #ruby
<sweeper>
is there a convention documented somewhere for commands to be included with gems?
lolmaus has quit [Ping timeout: 240 seconds]
sinkensabe has quit [Remote host closed the connection]
shredding has joined #ruby
ballpointcarrot has joined #ruby
b1nd has joined #ruby
mengu__ has quit [Ping timeout: 256 seconds]
freerobby has quit [Quit: Leaving.]
Peter__ has joined #ruby
freerobby has joined #ruby
yfeldblum has joined #ruby
nateberkopec has quit [Quit: Leaving...]
timonv_ has quit [Remote host closed the connection]
nateberkopec has joined #ruby
pushpak has joined #ruby
renderful has quit [Remote host closed the connection]
Jake232 has joined #ruby
gaganjyot has joined #ruby
Neozonz has quit [Quit: Leaving]
renderful has joined #ruby
klaut has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
reinaldob has quit [Remote host closed the connection]
einarj has joined #ruby
iamjarvo has joined #ruby
centrx has joined #ruby
francisfish has quit [Remote host closed the connection]
slester has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agrinb has joined #ruby
dseitz has joined #ruby
lw has quit [Quit: s]
dangerousdave has joined #ruby
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
<jhass>
shevy: stop guessing and admit you have no idea what his data structure is either
<shevy>
jhass I am not guess, I am providing guides
<jhass>
porfa: you told us nothing about your datastructure, we can only guess stuff
Timgauthier is now known as timgauthier_away
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<porfa>
jhass: im very sorry, i always forget or ahve little knowledge on that, im new to programing and ruby is my first ever attemp to program, im really really ?high? level rightnow
<porfa>
??
jenrzzz has joined #ruby
naftilos76 has quit [Remote host closed the connection]
<porfa>
i am trying to get only the link that containts FR from ?temp = doc.xpath('//*[(@id = "Downloads")]//article ').collect {|node| node.text.strip}'
<porfa>
so i will just grep the output, because atm is the only way i know how
agrinb has joined #ruby
MattB2 has joined #ruby
sinkensabe has quit [Ping timeout: 272 seconds]
ssarah has quit [Ping timeout: 250 seconds]
<jhass>
so you got an Array (collect or its shorter alias map return one)
<jhass>
Array got a methods Array#grep
<jhass>
havenwood demonstrated its usage above
mikeg has quit [Remote host closed the connection]
ghostmoth has quit [Quit: ghostmoth]
<jhass>
or you can probably extend to xpath to match it
maasha has joined #ruby
<jhass>
[contains(text(), 'FR')] or something
bMalum has quit [Quit: bMalum]
dkb20k has joined #ruby
<havenwood>
or check #include? 'FR' when mapping then #compact
_maes_ has joined #ruby
<havenwood>
when collecting* >.>
josephndenton has quit [Ping timeout: 265 seconds]
agrinb has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby
* jhass
is still a .select.map'per
Peter__ has joined #ruby
moritzs has quit [Remote host closed the connection]
rbrs has quit [Remote host closed the connection]
siwica1 has quit [Remote host closed the connection]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
altamic has quit [Quit: altamic]
siwica has joined #ruby
Craft___ has quit [Quit: Craft___]
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
einarj has quit [Remote host closed the connection]
dkb20k has quit [Ping timeout: 250 seconds]
timonv_ has joined #ruby
owen2 has quit [Ping timeout: 265 seconds]
Peter__ has quit [Read error: Connection reset by peer]
Pete_____ has joined #ruby
siwica has quit [Remote host closed the connection]
Insanity133 has joined #ruby
siwica1 has joined #ruby
spider-mario has quit [Ping timeout: 255 seconds]
m4rCsi has quit [Remote host closed the connection]
ejfinneran has joined #ruby
charliesome has quit [Quit: zzz]
Peter__ has joined #ruby
Pete_____ has quit [Ping timeout: 258 seconds]
Marfi_ has joined #ruby
b1nd has quit [Ping timeout: 260 seconds]
Insanity133 has quit [Ping timeout: 258 seconds]
benzrf|offline is now known as benzrf
b1nd has joined #ruby
Peter__ has quit [Client Quit]
kaspertidemann has joined #ruby
mkaesz has joined #ruby
ejfinneran has quit [Client Quit]
<rpag>
.map is nicer cuz less characters to type
naftilos76 has joined #ruby
stunder has joined #ruby
sigurding has quit [Quit: sigurding]
<shevy>
yes
_djbkd has joined #ruby
<shevy>
the .collect-ers must die
<naftilos76>
Has anybody used ruby to connect to a mail server? I am connected as we speak but i can only access root messages (inside inbox). How can i access subfolders?
PNDPO has joined #ruby
<tobiasvl>
what gem is that?
<kyle__>
But I like .collect
pietr0 has quit [Quit: pietr0]
<jhass>
and what protocol?
mike32 has joined #ruby
<jhass>
kyle__: that goes away
timonv_ has quit [Remote host closed the connection]
<rpag>
i think the stdlib has Net::IMAP and Net::POP
<kyle__>
Noooooooooo
<kyle__>
jhass: Which version does it go away in?
<jhass>
I mean the feeling
<kyle__>
Ahh.
Peter__ has joined #ruby
ghostmoth has joined #ruby
<rpag>
kyle__, think of the hard drive space you end up wasting! :P
Peter__ has left #ruby [#ruby]
nucatus has quit []
renderful has quit [Remote host closed the connection]
<jhass>
naftilos76: if you want any help you need to answer the follow up questions
b1nd has quit [Ping timeout: 264 seconds]
robustus|Off has quit [Ping timeout: 255 seconds]
<jhass>
apeiros: quikole spams
x1337807x has joined #ruby
st1gma1 has quit [Read error: Connection reset by peer]
mib_mib has joined #ruby
b1nd has joined #ruby
<apeiros>
jhass: go ahead :)
quikole was banned on #ruby by jhass [*!~quikole@213.143.61.89]
<naftilos76>
jhass: what would those be?
quikole was kicked from #ruby by jhass [quikole]
yetanotherdave has joined #ruby
vectra has quit [Ping timeout: 272 seconds]
gsd has joined #ruby
<jhass>
apeiros: thanks. You know I had no problem to make this more permanent :P
<apeiros>
naftilos76: "22:10 tobiasvl: what gem is that?" for example
<kyle__>
I think it's imap.select, and in the terms of that library you're looking at a "box" not a folder.
<kyle__>
I think.
m4rCsi has joined #ruby
<kyle__>
Whoever it was asking about the imap library
shredding has quit [Quit: shredding]
ballpointcarrot has quit [Ping timeout: 255 seconds]
<apeiros>
jhass: hm? freenode irc doesn't let you add channel access flags just because you're op
robustus has joined #ruby
<naftilos76>
sorry, i thought it was irrelevant to my question
<jhass>
apeiros: mmh, I always forget that
xanderwebs has joined #ruby
<apeiros>
naftilos76: also "22:10 jhass: and what protocol?"
_djbkd has quit [Remote host closed the connection]
<banisterfiend>
xanderwebs sup civilian
<naftilos76>
i am using 'net/pop' gem
<xanderwebs>
sup banisterfiend
lw has quit [Quit: s]
<banisterfiend>
not a lot, just meditating on my immense ruby knowledge and feeling k00
Rapier- has quit [Ping timeout: 265 seconds]
claymore has quit [Read error: Connection reset by peer]
<rpag>
lol
<apeiros>
*sob*, I always forget how atan2 works, even though it is trivially simple :-|
Marfi_ has left #ruby ["Wychodzi"]
<naftilos76>
i connected to my email server but all i had in hand was : pop.emails (array) and with each array element i could do element.pop to get the full body of the message
<porfa>
i’ve just choosen “encoding” utf-8 in my irc client…is everything ok? quotes —> “
tokik has joined #ruby
yfeldblu_ has quit [Ping timeout: 272 seconds]
<porfa>
exclamation mark —> ? singles quotes —> ‘
siaw has joined #ruby
mattstratton has joined #ruby
<jhass>
the exclamation mark is still weird
<jhass>
the quotes are quotes but not the ascii variants
<dorei>
it showed a question mark
rshetty has quit [Ping timeout: 245 seconds]
<porfa>
it’s “utf-8” i need to change my irc client… im so sorry about this, i’ve been flooding the channel with help requests when i cant even paste right
<porfa>
im sorry it was meant to be question mark —> ? exclamation mark = !
<siaw>
nothing i just want like a different way to write it
<siaw>
:)
<jhass>
why?
bMalum has joined #ruby
<siaw>
because i want to see how someone else thinks :)
User458764 has joined #ruby
<jhass>
I'd write it that way exactly
bMalum has quit [Client Quit]
robustus is now known as robustus|Off
g0bl1n has quit [Quit: g0bl1n]
<WhereIsMySpoon>
i dont even remember what &: does
<WhereIsMySpoon>
or :+
<WhereIsMySpoon>
well :+ is a symbol for add i guess
<porfa>
new try…. i want to replace every — “, —in specs with — \newline+bulletpointchar• — so specs2 = “#{specs}.tr(‘“,’ , ‘\n•’) is taking all my commas not the quotation+comma
akamel has quit [Quit: Leaving.]
<crome>
not sure about the full context but activesupport has #sum
<siaw>
well i ask cause learning ruby i realised that i write some code that does one thing and another person write another code that does the same thing but in a different way so i wanted to see how someone would write it
Sgeo_ has joined #ruby
<WhereIsMySpoon>
porfa: if im understanding correctly, did u try to escape the quotation marks?
KC9YDN has quit [Remote host closed the connection]
<jhass>
porfa: the quotes are still the typographically correct ones, not " and ' like ruby expects them, so it's still a bit hard to follow