fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
<tds> i think the source of your confusion really is just misleading output coming from L21
bluOxigen has quit [Ping timeout: 244 seconds]
<jlogsdon> yeah
<tds> it's not adding a make like Car.add_make does
<n_blownapart> jlogsdon: tds: hold on one sec let me ask: the constructor depends on the add_make method to first send the make to @@makes?
<jlogsdon> yes
<tds> yes
<tds> try commenting out the add_make lines
<jlogsdon> if add_make is never called, the constructor will always raise the error
<n_blownapart> is that why the constructor definition comes second? jlogsdon tds
<jlogsdon> it doesnt have to come second in the definiton order
<tds> the order of definition doesn't matter
td123 has joined #ruby
<n_blownapart> tds: jlogsdon but I guess it is easier to read.
<jlogsdon> correct
<tds> yes
<jlogsdon> class methods together, instance methods togehter
<jlogsdon> usually instance methods are all defined after the initialize method
baroquebobcat has quit [Quit: baroquebobcat]
<n_blownapart> jlogsdon: tds ok the fog is lifting but still thick
<n_blownapart> jlogsdon: tds thanks !
<jlogsdon> we could make it thicker again xD
<jlogsdon> (but i wont)
<tds> haha
<tds> it just takes practice, n_blownapart
<n_blownapart> this is a beginners book. I find this prog pretty tough. If you were to look at this, where do you first start reading to follow what its doing?
awarner has joined #ruby
<n_blownapart> tds: jlogsdon ^^
bradhe has quit [Remote host closed the connection]
<tds> follow the order of the calls
<n_blownapart> tds no capiche
<jlogsdon> n_blownapart: basically what tds said. I'd ignore the Class definition all together, then go down to the calls and follow them through
<jlogsdon> s I'd look at .add_make first. then #initialize
<jlogsdon> and then #make_mates, and then .total_count
baphled has joined #ruby
<jlogsdon> with that I can see that #initialize depends on .add_make being called (as @makes is defined as an empty array, so it would never include anything unless .add_make was called)
<n_blownapart> jlogsdon: would you grant that the unless and the following constructor if statement are logically hard to read?
<jlogsdon> and then I see the #make_mates returns some information handled in the constructor
<jlogsdon> and then .total_count does the same
wallerdev has quit [Quit: wallerdev]
<jlogsdon> I would grant that the logical statements can be confusing until you grok the diffreence between @@var and @var. Outside of that, the logic should not be difficult.
gavit has quit [Read error: Connection timed out]
<jlogsdon> .add_make: unless @@makes has this thing, add this thing to @@makes. also setup @@cars[make] with an integer
gavit has joined #ruby
<n_blownapart> jlogsdon: thanks got that.
<jlogsdon> #initialize: if @@makes has this thing, print a line, set the @make, add a value to @@cars[make] and @@total_count. if the first condition is NOT true, raise an exceptional condition
<jlogsdon> and then the other two just read information
xaq has quit [Ping timeout: 248 seconds]
chichou has quit [Remote host closed the connection]
timonv has joined #ruby
<jlogsdon> I think one thing that may through people off is unless versus if. If is *super* common in programming, but unless is a "wtf" the first few times you se e it
<jlogsdon> it makes sense, just not at first
chichou has joined #ruby
<jlogsdon> n_blownapart: ^^^
benson has quit [Remote host closed the connection]
Konboi has joined #ruby
Konboi has quit [Read error: Connection reset by peer]
<n_blownapart> the constructor is what threw me, after seeing the the make was comfortably in @@makes, it seems illogical. jlogsdon .
<n_blownapart> what do you mean if is super?
Konboi has joined #ruby
<n_blownapart> jlogsdon: ^6
<jlogsdon> super common*
<jlogsdon> * was for emphasis
c0rn has quit [Quit: Computer has gone to sleep.]
brdude has quit [Quit: brdude]
<n_blownapart> jlogsdon: cool thanks
<jlogsdon> i probably should have wrapped the keywords in backticks, `if` and `unless`, to make it a little clearer
Chryson has joined #ruby
arooni-mobile has joined #ruby
awarner has quit [Remote host closed the connection]
<n_blownapart> jlogsdon: if you have time one more thing. "following the calls..." do you mean just begin by reading the method definitions to see what they do, before looking at other parts?
timonv has quit [Ping timeout: 246 seconds]
t54393 has quit [Remote host closed the connection]
t29719 has joined #ruby
chichou has quit [Ping timeout: 260 seconds]
bricker88 has quit [Quit: Leaving.]
maxmmurphy has quit [Quit: maxmmurphy]
ianbrandt has quit [Quit: ianbrandt]
niklasb has quit [Ping timeout: 252 seconds]
bbttxu has quit [Quit: bbttxu]
luxurymode has joined #ruby
Nisstyre has joined #ruby
savage- has quit [Remote host closed the connection]
butblack has joined #ruby
whowantstolivefo has quit []
khakimov has joined #ruby
h4mz1d has joined #ruby
h8R has quit [Ping timeout: 246 seconds]
subbyyy has joined #ruby
verto|off is now known as verto
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
pskosinski has quit [Quit: http://www.redeclipse.net -- Fast-paced online FPS]
mxbtty has joined #ruby
tommyvyo has joined #ruby
opus has quit [Quit:]
opus has joined #ruby
gavit has quit [Read error: Connection timed out]
ezra has joined #ruby
gavit has joined #ruby
mxbtty has left #ruby [#ruby]
mxbtty has joined #ruby
twoism has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
freeayu has joined #ruby
patient has joined #ruby
brdude has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
Axsuul has joined #ruby
v0n has quit [Quit: Leaving]
<patient> hey guys, can you point me some nice resources about Rakefiles?
tfittsy has joined #ruby
seanstickle has quit [Quit: seanstickle]
verto is now known as verto|off
<banister`sleep> patient: google is a pretty good start
jlogsdon_ has joined #ruby
<jlogsdon_> n_blownapart: yes, thats what i mean
<jlogsdon_> follow the use of the class
<patient> right, that's where i started, but i didn't found any really good, so i thought about asking here, maybe you guys knew any pearl that didn't got to google's first page
tk_ has joined #ruby
tfitts has quit [Ping timeout: 244 seconds]
jlogsdon has quit [Disconnected by services]
luxurymode has joined #ruby
x77686d has quit [Ping timeout: 245 seconds]
jlogsdon_ is now known as jlogsdon
<banister`sleep> patient: there's on mentioned on reddit.com/r/ruby atm
justinmcp has quit [Remote host closed the connection]
<banister`sleep> check that out
<patient> will do, thanks for the tip
<n_blownapart> jlogsdon_: thanks. I was studying that prog. and now I cannot see where the key => value values are created for @@cars = {} in line 3. Don't those parameters need to be explicit?
<jlogsdon> in .add_make
<jlogsdon> L15, @@cars[make] = 0 sets the key => value
<patient> looks pretty cool banister`sleep, thanks
tomsthumb_ has quit [Quit: Leaving.]
<n_blownapart> jlogsdon: fog is lifting but thick...
<jlogsdon> all will become clear in time
Taranis has quit [Read error: Connection reset by peer]
joshman_ has quit [Quit: Computer has gone to sleep.]
<n_blownapart> but that is not a counter jlogsdon ?
<jlogsdon> it is a counter, for the number of specific objects that have been initialized with that make
Tomasso has quit [Ping timeout: 252 seconds]
<n_blownapart> cool got it thanks jlogsdon
<jlogsdon> if you were to print out @@cars after the script ran (sans the exception) it would look like: {'Honda' => 2, 'Ford' => 1}
quazimodo has quit [Ping timeout: 248 seconds]
<n_blownapart> jlogsdon: excellent I'll fiddle with it.
<jlogsdon> if you printed it *before* the Car.new calls but *after* the Car.add_make calls it would just be {'Honda' => 0, 'Ford' => 0}
<jlogsdon> anyhow, it's D&D time for me! Good luck with your learning stuffs
<n_blownapart> jlogsdon: many thanks
opus has quit [Quit:]
graft has quit [Ping timeout: 272 seconds]
luckman212_ has quit [Read error: Connection reset by peer]
tommyvyo has quit [Quit: Computer has gone to sleep.]
luckman212 has joined #ruby
freeayu has quit [Ping timeout: 246 seconds]
Taranis has joined #ruby
gavit has quit [Read error: Connection timed out]
adamkittelson has quit [Remote host closed the connection]
ezra has quit [Ping timeout: 276 seconds]
gavit has joined #ruby
td123 has quit [Read error: Connection reset by peer]
td123 has joined #ruby
walbert has quit [Remote host closed the connection]
kyb3r has quit []
mrsolo has quit [Quit: Leaving]
nateberkopec has quit [Quit: Leaving...]
tommyvyo has joined #ruby
patient has quit [Quit: leaving]
freeayu has joined #ruby
chrismcg is now known as zz_chrismcg
manizzle has quit [Ping timeout: 240 seconds]
dpk has quit [Quit: Asleep at the keyboard.]
davidcelis has quit [Quit: K-Lined.]
td123 has quit [Ping timeout: 245 seconds]
opus has joined #ruby
adeponte has quit [Remote host closed the connection]
qko has joined #ruby
perryh_away is now known as perryh
mikepack has quit [Remote host closed the connection]
QKO_ has quit [Read error: Operation timed out]
zodiak has quit [Quit: Leaving]
mengu has quit [Remote host closed the connection]
t29719 has quit [Remote host closed the connection]
adeponte has joined #ruby
perryh is now known as perry
t60640 has joined #ruby
asdfqwer has joined #ruby
adeponte has quit [Remote host closed the connection]
codeFiend has quit [Ping timeout: 246 seconds]
jarred_ has joined #ruby
brdude has quit [Quit: brdude]
ezra has joined #ruby
brianpWins has quit [Quit: brianpWins]
infinitiguy has joined #ruby
infinitiguy has quit [Client Quit]
Juul has quit [Ping timeout: 240 seconds]
quazimodo has joined #ruby
nari_ has joined #ruby
<asdfqwer> i, am, ass, clown = Class.new, 0..9, {}, [], String.new
<asdfqwer> RUBY
h4mz1d has quit [Ping timeout: 246 seconds]
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
awarner has joined #ruby
joekarma has joined #ruby
jjbohn has joined #ruby
mfridh has quit [Ping timeout: 268 seconds]
joekarma has quit [Remote host closed the connection]
jgrevich has quit [Quit: jgrevich]
joekarma has joined #ruby
n_blownapart has quit [Remote host closed the connection]
<kenneth> hey there
<kenneth> why does rescue Interrupt not work?
havenn has quit [Remote host closed the connection]
<kenneth> uninitialized constant ReqService::Service::Inteurrpt
<kenneth> i thought Interrupt was as globally available exception subclass
<kenneth> and in my case it would make more sense to do that instead of signal.trap
baphled has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
nu7hatch has left #ruby [#ruby]
eko has joined #ruby
eko has joined #ruby
eko has quit [Changing host]
jonatha__ has quit [Remote host closed the connection]
Ameck has joined #ruby
TorpedoSkyline has joined #ruby
<Ameck> Would anybody have any idea why I'm getting the error? -bash: load: command not found
joekarma has quit [Quit: joekarma]
liluo has joined #ruby
<kenneth> Ameck: you're running a ruby script as bash?
joekarma has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
codeFiend has joined #ruby
tds has quit [Ping timeout: 265 seconds]
tds_ has quit [Ping timeout: 265 seconds]
brdude has joined #ruby
<Ameck> derp, fixed it
<TorpedoSkyline> Ameck, derpity derp derp derp! =P
gavit has quit [Read error: Connection timed out]
Ivis has joined #ruby
gavit has joined #ruby
SCommette has quit [Quit: SCommette]
<Ivis> should i learn ruby for my first language? i heard that it's easy
mxbtty has quit [Quit: Leaving.]
nateberkopec has joined #ruby
perry is now known as perryh_away
g_rotbart has joined #ruby
awarner has quit [Remote host closed the connection]
<jenrzzz> Ivis: Programming in general is hard, no matter what language you use, but Ruby is definitely a good language to start with
<TorpedoSkyline> like all things, it takes work.
Speed has quit [Remote host closed the connection]
<Ivis> ok thanks then i will start with ruby
<TorpedoSkyline> I've been doing Ruby code for over a year and I still feel small. ;P
<bperry> problem solving in general is hard heh
<TorpedoSkyline> bperry, thinking is hard in general.
<bperry> heh
twoism has quit [Remote host closed the connection]
<Ivis> does finding job as ruby programmer is hard?
<TorpedoSkyline> much easier to eat ice cream and watch Bugs Bunny
<bperry> it becomes easier while inebriated
davidcelis has joined #ruby
<bperry> or maybe you question yourself less when inebriated
<bperry> who knows
<bperry> it's magic
<Ivis> mybe someone could recommend a book or somthing where i can start
<jenrzzz> Ivis: For starters, you might want to check out Why's (Poignant) Guide <http://mislav.uniqpath.com/poignant-guide/> or Learn to Program (with ruby) <http://pine.fm/LearnToProgram/>
<Ivis> jenrzzz ohh thanks
<Ivis> and should i order some book from amazon or just go with the information on the net?
<erikwb> Ivis: depends how you learn
<erikwb> Ivis: i personally always take the "pick a project and implement it" approach to learning a lang
ciopte7 has joined #ruby
<erikwb> the online docs are good
apok_ has joined #ruby
<jenrzzz> yeah, I agree... building something is usually the best way to learn
<Ivis> i think so too cuz you deal with the problems in the process and understand how it works
<jenrzzz> ruby wasn't my first language but I learned it by skimming the first few chapters of why's guide and then building something
<jenrzzz> lots of google and SO can get you by
<TorpedoSkyline> Why's Guide to Ruby is great, but incredibly distracting
<TorpedoSkyline> I had a hard time keeping up with all the stories. ;P
<Ivis> i'm wondering about job opportunities with ruby
<Ivis> for the future
apok has quit [Ping timeout: 240 seconds]
<jenrzzz> depends on the area, but here in southern california almost every tech company seems to be looking for rails developers
ringotwo has quit [Remote host closed the connection]
<jenrzzz> i'd imagine it's pretty much the same thing up north
<TorpedoSkyline> where as in southern Louisiana I don't think there's much of a need for Rails.
<TorpedoSkyline> Sinatra, maybe. Rails… eh.
<Ivis> i'm from EU but i wanna go to usa in future, it's my dream since i was a little kid
krz has quit [Quit: krz]
t60640 has quit [Remote host closed the connection]
<TorpedoSkyline> same with Austin, TX jenrzzz
t61225 has joined #ruby
<jenrzzz> TorpedoSkyline: austin's the same as socal or louisiana?
apok_ has quit [Ping timeout: 245 seconds]
<TorpedoSkyline> jenrzzz, socal
<jenrzzz> heh, I always imagined we're pretty similar
<jenrzzz> they have SXSW and whatnot
<jenrzzz> Ivis: If you end up in California with some decent skills I doubt you'll have too much of a problem finding a job
<jenrzzz> but elsewhere YMMV
<TorpedoSkyline> yeah, then you're better off learning Ruby and using Sinatra to build smaller web apps
yonggu has quit [Quit: yonggu]
<Ivis> my dream is to live in Montana, Vermont, North Carolina
<TorpedoSkyline> you won't be running the "next Twitter", which is becoming more and more like the Holy Grail
gavit has quit [Read error: Connection timed out]
mfridh has joined #ruby
<Ivis> i have a big project wich can bring me a lot of money in my country but i don't have knowlegde to do it myself or resource
<Ivis> it's a website
gavit has joined #ruby
<banister`sleep> Ivis: let me guess a "facebook killer" ? :)
<Ivis> no :D
<Ivis> medical stuff
jjbohn has quit [Quit: Leaving...]
SCommette has joined #ruby
linoj has joined #ruby
<banister`sleep> Ivis: what country are you from?
joekarma has quit [Quit: joekarma]
erichmenge has joined #ruby
<Ivis> in my country we don't have medical website where people can look up for info abot injuries and illness stuff so i thout creating a website where people can get information about all that stuff, imagine 3D human body where you can click on any body parts and get further information
<Ivis> money will come when i talk with drug stores who will be recomending pills on website
<Ivis> like sponsors
gfontenot has quit []
jenrzzz has quit [Quit: Lost terminal]
<Ivis> i'm from Latvia
<Ivis> north europe
etank has joined #ruby
asdfqwer has quit [Read error: Connection reset by peer]
<Ivis> it would be succes cuz we don't have anything like this in here and i must hurry up mybe somone will create somthing like this
asdfqwer has joined #ruby
SCommette has quit [Client Quit]
zeromodulus has quit [Read error: Connection reset by peer]
Juul has joined #ruby
zeromodulus has joined #ruby
seitensei has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
glistle has joined #ruby
codeFiend has quit [Read error: Connection reset by peer]
freeayu has quit [Read error: Connection reset by peer]
<banister`sleep> Ivis: that's a huge project
<banister`sleep> Ivis: that's the kind of thing where idea is 5% and implementation is 95%
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
<jenrzzz> what was the project? i missed it because I had to fix tmux
<banister`sleep> Ivis: and it's not that great an idea, there's tonnes of online medical sites afaik
<banister`sleep> s/great/original
brdude has quit [Quit: brdude]
<banister`sleep> (it is a great idea, just not original:P)
JustinCampbell has quit [Remote host closed the connection]
<Ivis> jenrzzz in my country we don't have medical website where people can look up for info abot injuries and illness stuff so i thout creating a website where people can get information about all that stuff, imagine 3D human body where you can click on any body parts and get further information
<Ivis> money will come when i talk with drug stores who will be recomending pills on website like sponsors
<banister`sleep> Ivis: also, you're only likely to get sponsorship/investment in that if you have a medical degree
<banister`sleep> if you're just some dude, i can't see you convincing anyone to invest
<Ivis> i will get doctors who will provride information and yea there is a lot medical sites but not in my language
<Ivis> if i create in local language then it will be huge
<jenrzzz> hmm, that sounds like it could be promising if you can target a market that can't or doesn't use sites like WebMD
seitensei has joined #ruby
gavit has quit [Read error: Connection timed out]
sepp2k has quit [Remote host closed the connection]
<jenrzzz> you'd need a pretty big investment in the beginning to bring in domain experts like doctors and medical researchers and shit
<banister`sleep> Ivis: but put it this way: you don't have programming skills, you dont have medical expertise, you dont have the money for investment. All you appear to have is an idea that's not even that original, i.e it exists for other languages, just not latvian
<Ivis> cuz drug stores always put ads everywhere and imagine if this website will provride information what pills you must use
<Ivis> banister`sleep i can't argue with that i know i have nothing
gavit has joined #ruby
<Ivis> but it would be huge
<banister`sleep> alright, i guess you're starting in the right place by picking up ruby programmers skills :)
<banister`sleep> so goodluck
<Ivis> thanks
<Ivis> :)
<banister`sleep> programming*
<Ivis> mybe some of you guys want to join on this project?
<Ivis> lot of money i smell here
<Ivis> :P
perryh_away is now known as perryh
Markvilla has quit [Quit: Computer has gone to sleep.]
<Ivis> btw and second project would be the same only with animals cats, dogs etc...
manizzle has joined #ruby
<Ivis> in LV net there is no such information provride all in one with local language and not that much knows ENG
<Ivis> here
radic has quit [Disconnected by services]
radic_ has joined #ruby
erichmenge has quit [Quit: Be back later]
radic_ is now known as radic
freeayu has joined #ruby
<jenrzzz> Ivis: you're gonna need a pretty good amount of money to make that happen regardless of the details
<jenrzzz> not sure what the venture capital scene is like in Latvia
<Ivis> i'm thinking of finding investor
<Ivis> i could make a good presentation
twoism has joined #ruby
<Ivis> jenrzzz let's say i can get money will you work on this project?
<Ivis> if i pay you
codeFiend has joined #ruby
<jenrzzz> heh, no guarantees but if you find and investor and want to talk i'm jenrzzz on github
<jenrzzz> s/and/an
kn330 has quit [Read error: Connection reset by peer]
<Ivis> i have no clue how much cost a work like that
<jenrzzz> the whole project?
<Ivis> jenrzzz nop i mean your job if you agreed
<Ivis> pay rate
Juul has quit [Ping timeout: 245 seconds]
<jenrzzz> oh, haha, yeah don't worry about that now
<Ivis> :D ok
<Ivis> and whole project?
<Ivis> i mean i will have to put ads on tv
<Ivis> and on the streets
<Ivis> + coding and design
freeayu has quit [Ping timeout: 252 seconds]
<Ivis> i think 100 000 ?
pdtpatrick has quit [Quit: pdtpatrick]
pu22l3r has joined #ruby
andrewhl has joined #ruby
freeayu has joined #ruby
Ameck has left #ruby [#ruby]
<TorpedoSkyline> Ivis, no not $100,000
<TorpedoSkyline> much more like $500,000+
<Ivis> ou
<TorpedoSkyline> When you bring in doctors, advertising in prominent areas, lots of servers, and employees it my hit over a million.
<Ivis> damn i should make a presentation and try to find investor some rich bastard who wanna try somthing new
<Ivis> lol
freeayu__ has joined #ruby
freeayu has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Read error: Operation timed out]
freeayu__ has quit [Read error: Connection reset by peer]
freeayu has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
gmci has quit [Ping timeout: 246 seconds]
ryanf has joined #ruby
kenneth has quit [Quit: kenneth]
iori has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
infinitiguy has joined #ruby
itnomad has quit [Quit: Leaving]
randomautomator has quit [Remote host closed the connection]
gmci has joined #ruby
jarred_ has quit [Quit: jarred_]
awarner has joined #ruby
kenneth has joined #ruby
shadoi has quit [Quit: Leaving.]
freeayu has quit [Ping timeout: 268 seconds]
kenneth has quit [Client Quit]
mxbtty has joined #ruby
ryanf has quit [Ping timeout: 244 seconds]
mxbtty1 has joined #ruby
awarner has quit [Remote host closed the connection]
<arooni-mobile> whats the best library to use if i want to send/receive HTTP GET/POST requests and do some screen scraping?
freeayu has joined #ruby
ryanf has joined #ruby
<arooni-mobile> way back in the day i used Hpriciot
<TorpedoSkyline> arooni-mobile, screen scraping?
mxbtty has quit [Ping timeout: 240 seconds]
<arooni-mobile> i guess i mean; regular expression matching
<arooni-mobile> the site im working with doesnt have an api as o fyet
adeponte has joined #ruby
<TorpedoSkyline> arooni-mobile, Sinatra
<glistle> arooni-mobile: I'd use hpricot and mechanize: http://rorguide.blogspot.com/2011/04/simple-ruby-screen-scraper-using.html
<TorpedoSkyline> **i think**
<glistle> arooni-mobile: replace hpricot with nokogiri
gavit has quit [Read error: Connection timed out]
<arooni-mobile> ok so that gives me a few things to check out: httparty, sinatra, nokogiri, mechanize
gavit has joined #ruby
<arooni-mobile> theres no definitive 'best' for this type of app from those 4?
savage- has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<glistle> arooni-mobile: ruby is a vast ecosystem, sinatra is a web framework so the glue around, you may use rails or ruby scripts instead. nokogiri is for the scraping. httparty or mechanize for doing gets/posts. mechanize makes it easy to work with existing webpages (clicking, posting forms) httparty for apis or form submissions.
<arooni-mobile> ok thats a good overview thank you
<glistle> arooni-mobile: nokogiri is the parsing part, mechanize will pull/scrape the content off the site to be parsed easily by nokogiri.
<arooni-mobile> so sounds like i need the part that does GET/POST (httparty or mechanize) ... and the parsing (Hpricot/Nokogiri)
<arooni-mobile> sounds like nokogiri is the clear winnre for the second half
<arooni-mobile> so i guess thing is to decide between httpparty and mechanize
pu22l3r has joined #ruby
ryanf has quit [Quit: broken pipes |||]
codeFiend has quit [Quit: codeFiend]
voodoofish430 has quit [Quit: Leaving.]
uris has joined #ruby
Spooner has quit [Ping timeout: 246 seconds]
vipaca has joined #ruby
vipaca has joined #ruby
vipaca has quit [Changing host]
maxmmurphy has joined #ruby
adeponte has quit [Remote host closed the connection]
gavit has quit [Read error: Connection timed out]
quazimodo has quit [Ping timeout: 244 seconds]
freeayu has quit [Ping timeout: 252 seconds]
quazimodo has joined #ruby
gavit has joined #ruby
Bosma has quit [Ping timeout: 268 seconds]
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
kyktommy has joined #ruby
pratyksp has joined #ruby
vipaca has quit [Quit: Leaving...]
freeayu has joined #ruby
kenneth has joined #ruby
<quazimodo> how do I get rubygems to use ruby1.9.3??
<quazimodo> its using 1.8 only :(
n_blownapart has joined #ruby
<bperry> gem is 1.8
<bperry> that is the version of gem
<n_blownapart> hi I know lines 50,51 and 59 are wrong (Car::Hybrid) but where is my mistake in this prog? thanks: http://pastie.org/4502844
RudyValencia- has joined #ruby
ctp_ has joined #ruby
linoj has quit [Quit: linoj]
[eko] has joined #ruby
Ivis has left #ruby [#ruby]
jjbohn has joined #ruby
butblack_ has joined #ruby
butblack_ has quit [Client Quit]
SegFault1X|work2 has joined #ruby
mvangala_ has joined #ruby
butblack_ has joined #ruby
patronus has joined #ruby
jenrzzz has joined #ruby
ctp has quit [Read error: Connection reset by peer]
yosafbridge has quit [Ping timeout: 245 seconds]
xargoon has quit [Ping timeout: 245 seconds]
mvangala has quit [Read error: Connection reset by peer]
eko has quit [Read error: Connection reset by peer]
<multi_io> when you're using bundle --path oder bundle --deployment to deploy a web app along with passenger, would you install passenger in the bundle too, rather than globally?
maxmmurphy has quit [Quit: maxmmurphy]
RudyValencia has quit [Read error: Connection reset by peer]
<RichieEvan> dumb question warning…. Does anyone know how to make text mate only space new line characters 2 spaces instead of 5?
<quazimodo> bperry: so gem 1.8 will work with ruby 1.9.3?
<RichieEvan> Perfereably for only erg and rb files
<RichieEvan> preferably*
<multi_io> is this a common setup?
butblack has quit [Ping timeout: 268 seconds]
butblack_ is now known as butblack
patronus_ has quit [Ping timeout: 245 seconds]
<RichieEvan> uh never mind found it
SegFaultAX|work2 has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Client Quit]
<bperry> quazimodo: yes
xargoon has joined #ruby
infinitiguy has quit [Quit: Leaving.]
jenrzzz has joined #ruby
Bosox20051 has quit [Quit: Leaving]
<n_blownapart> hi I know lines 50,51 and 59 are wrong (Car::Hybrid) but where is my mistake in this prog? thanks: http://pastie.org/4502844
<n_blownapart> newbie ^^
gavit has quit [Read error: Connection timed out]
joekarma has joined #ruby
klipeto has joined #ruby
gavit has joined #ruby
conor_ireland_ has joined #ruby
TomRone_ has joined #ruby
t61225 has quit [Remote host closed the connection]
pavelz has joined #ruby
<arooni-mobile> mechanize indicates: [checkbox:0x1d21260 type: checkbox name: female value: 1] .... however when i try to do form.female.... NoMethodError: undefined method `female' for #<Mechanize::Form:0x00000003a43398>
<arooni-mobile> no easy females for arooni thanks to mechanize haha
Fraeon has quit [Ping timeout: 240 seconds]
shadoi has joined #ruby
jjbohn has quit [Quit: Leaving...]
preller_ has joined #ruby
pavelz_ has quit [Ping timeout: 268 seconds]
TomRone has quit [Ping timeout: 268 seconds]
preller has quit [Ping timeout: 268 seconds]
t23176 has joined #ruby
mfridh has quit [Ping timeout: 268 seconds]
Fraeon has joined #ruby
g_rotbart has quit [Remote host closed the connection]
bigkevmcd_ has joined #ruby
justinmcp has joined #ruby
freeayu has quit [*.net *.split]
conor_ireland has quit [*.net *.split]
nat2610 has quit [*.net *.split]
cbuxton has quit [*.net *.split]
bigkevmcd has quit [*.net *.split]
klip has quit [*.net *.split]
ggreer has quit [*.net *.split]
Poapfel has quit [*.net *.split]
eighty4 has quit [*.net *.split]
iamtakingiteasy has quit [*.net *.split]
DarthGandalf has quit [*.net *.split]
Dr4g has quit [*.net *.split]
xclite has quit [*.net *.split]
gentz has quit [*.net *.split]
grillo has quit [*.net *.split]
flexd has quit [*.net *.split]
multi_io has quit [*.net *.split]
jhunter has quit [*.net *.split]
Koshian has quit [*.net *.split]
bnagy has quit [*.net *.split]
wang has quit [*.net *.split]
conor_ireland_ is now known as conor_ireland
kenichi has quit [Remote host closed the connection]
Dr4g_ has joined #ruby
yosafbridge has joined #ruby
Yu\2 has joined #ruby
<n_blownapart> hi anyone know why I need :: notation on lines 50,51 and59, to get this to work? thanks! http://pastie.org/4502844
ken_barber has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
nat2610 has joined #ruby
cbuxton has joined #ruby
multi_io has joined #ruby
freeayu has joined #ruby
eighty4 has joined #ruby
Poapfel has joined #ruby
ggreer has joined #ruby
iamtakingiteasy has joined #ruby
DarthGandalf has joined #ruby
xclite has joined #ruby
gentz has joined #ruby
grillo has joined #ruby
flexd has joined #ruby
Koshian has joined #ruby
jhunter has joined #ruby
wang has joined #ruby
bnagy has joined #ruby
t23176 has quit [Remote host closed the connection]
t69034 has joined #ruby
captproton has joined #ruby
SCommette has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
<captproton> hi all
<captproton> anyone here use CSV?
<captproton> I am trying to follow railscasts, but instead of getting nice CSV, I get a page of #<Lead:0x00000104c6b970>,#<Lead:0x00000103f29be0>,#<Lead:0x00000103f294d8>
joekarma has quit [Quit: joekarma]
k_89 has joined #ruby
jlogsdon has quit [Remote host closed the connection]
seoaqua has joined #ruby
maxmmurphy has joined #ruby
gavit has quit [Read error: Connection timed out]
td123 has joined #ruby
iamjarvo has joined #ruby
gavit has joined #ruby
k_89_ has joined #ruby
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
glistle has quit [Remote host closed the connection]
Axsuul has quit [Ping timeout: 260 seconds]
tommyvyo has joined #ruby
k_89 has quit [Ping timeout: 252 seconds]
pingfloyd has joined #ruby
jameshyde__ has joined #ruby
Axsuul has joined #ruby
<n_blownapart> hi . I don't understand why I needed to put class Hybrid < Car on line 45 to get this to work. It wouldn't work when it was at top.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<n_blownapart> http://pastie.org/4503013 ^^
ringotwo has joined #ruby
pratyksp has left #ruby ["Leaving"]
pygmael has joined #ruby
fbernier has joined #ruby
justinmcp has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 268 seconds]
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
k_89__ has joined #ruby
t69034 has quit [Remote host closed the connection]
opus has quit [Quit:]
t51663 has joined #ruby
k_89_ has quit [Read error: Connection reset by peer]
glistle has joined #ruby
cakehero has quit [Quit: Leaving...]
burgestrand has joined #ruby
syamajala has joined #ruby
maletor has joined #ruby
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
nXqd has joined #ruby
andrewhl has quit [Remote host closed the connection]
yonggu has joined #ruby
yonggu has quit [Client Quit]
bluebie has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
maletor has quit [Ping timeout: 246 seconds]
uris has quit [Quit: leaving]
nari_ has quit [Ping timeout: 252 seconds]
djleefn has joined #ruby
arietis has joined #ruby
gavit has quit [Read error: Connection timed out]
pygmael has quit [Read error: Connection reset by peer]
noyb has joined #ruby
pygmael has joined #ruby
d3vic3_ has quit [Ping timeout: 260 seconds]
asdfqwer has quit [Quit: Lost terminal]
gavit has joined #ruby
d3vic3 has joined #ruby
djleefn has left #ruby ["Leaving"]
<n_blownapart> hi anyone want to look at this? thanks: http://pastie.org/4503013 wondering why class Hybrid < Car needs to be at bottom of script to run.
maletor_ has joined #ruby
<bperry> n_blownapart: because that is exactly the order in which the script is interpretted
<bluebie> n_blownapart: You need to define Hybrid to be something. You can't subclass Car until Car is defined as something.
pu22l3r has quit [Remote host closed the connection]
<bluebie> classes and methods in ruby are not scanned in ahead of time - they are created as the program runs, so order matters
pu22l3r has joined #ruby
burgestrand has quit [Quit: Leaving.]
<n_blownapart> bluebie: I don't really follow. so when I put that line just below class Car, it won't piggyback with Car throughout the program? I'm a noob to programming thanks.
yasushi has joined #ruby
<bperry> n_blownapart: the issue you are having is only an issue with interpreted languages liek ruby
banister`sleep has quit [Read error: Connection reset by peer]
<bluebie> when you write "class Something" it begins a section of code which needs to be finished with a matching 'end' before it's done
<bluebie> if you create a class inside of that class, you'll end up with something like Class::Hybrid
<bluebie> er sorry
<bluebie> Car::Hybrid
<bluebie> instead of just Hybrid
k_89__ is now known as k_89
pu22l3r has quit [Ping timeout: 246 seconds]
<bluebie> This is called namespacing, where a class can have it's own internal set of constants - which can be anything = a class, a number, whatever. Math for example has Math::PI which is a float. If you just write PI though, you get an uninitialized constant error
igotnolegs has joined #ruby
<bluebie> give it a go and you'll see Car::Hybrid works :)
hemanth has joined #ruby
<n_blownapart> bluebie: I only have Ruby as a context...first language. I was putting Car::Hybrid on lines 51,52, and 60 and it would work while Hybrib < Car was at the top. I took out Car:: and then it wouldn't work while that line was at top. sorry I don't understand.
<bluebie> You can explicitly say to ruby 'don't namespace this - put it in the root namespace' by adding :: before your class name. class Car; class ::Hybrid < Car; end; end for instance creates both Car and Hybrid as global constants so you don't need the Car:: prefix when talking about Hybrid - but that's a weird and confusing way to code - it's clearer to avoid such strange nesting
<bluebie> right, so Car is not only a class, it's an object too!
<bluebie> just about everything is an object, even classes!
RichieEvan has quit [Quit: RichieEvan]
<bluebie> and inside the Car object, it has things like instance variables, some methods, and it also has some constants
<bluebie> by being inside the 'class Something … end' section of your program, you establish a context of which class you are in, so syntax like def, @vars, @@vars, and Constant = <something> all happen within that class object, instead of the main object (the global default one)
<bluebie> they're nested, a bit like folders within folders in a computer
<n_blownapart> bluebie: thanks. the point of the lesson was to add an instance variable so that the subClass could count on its own. But sorry, I don't follow the part you wrote about the finishing with an end.
<n_blownapart> bluebie: hold on, digesting that...
<bluebie> the :: operator is how you say 'get the constant to the right which is inside the thing on the left'
seoaqua has quit [Ping timeout: 240 seconds]
banister`sleep has joined #ruby
maletor_ has quit [Quit: Computer has gone to sleep.]
<bluebie> you've done "def self.total_count" and "def self.total_count=(n)" methods - the self means the method is added to the classes class (confusing I know)
banister`sleep has quit [Remote host closed the connection]
<n_blownapart> ok bluebie one sec. What I don't see is that if Hybrid is inheriting from Car, why the entire prog. doesn't pertain to Hybrid. why should it matter where Hybrid < Car is placed?
techsurvivor has joined #ruby
<bluebie> it doesn't matter where it's placed, so long as something called Car exists, and that thing is something you can inherit from (a class object)
<bluebie> if you put it before 'class Car' then it cannot, as nothing called Car exists yet when you run it
gavit has quit [Read error: Connection timed out]
<n_blownapart> bluebie: I thought we would just put it at the top. The book doesn't say where to put it. But Car does exist, so class Car: class Hybrid < Car end should work, right?
syamajala has quit [Remote host closed the connection]
t51663 has quit [Remote host closed the connection]
<bluebie> if you put it inside of 'class Car', it does work, but it is created inside of the Car class, instead of the program's main outter section, so you need to write Car::Hybrid instead of just Hybrid to access it from things which aren't also inside of Car
t47921 has joined #ruby
Guest23734 has joined #ruby
gavit has joined #ruby
<bluebie> you need to end the class Car before you write class Hybrid < Car
<bluebie> class Car; end; class Hybrid < Car; end
<n_blownapart> two ends ? bluebie
<bluebie> otherwise the hybrid class is inside the car class, instead of outside in the general area
<bluebie> you haven't finished doing the Car class till you end it
<bluebie> it's kind of like an if, or a def
<n_blownapart> ok, I think the fog is lifting. thanks bluebie let me ponder.
invsblduck has quit [Read error: Operation timed out]
strnx has quit [Excess Flood]
jasmina87SA__ has joined #ruby
<n_blownapart> ok, I think the fog is lifting. thanks bluebie let me ponder.
jasmina87SA__ has quit [Read error: Connection reset by peer]
hemanth has quit [Read error: Connection reset by peer]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
hemanth has joined #ruby
s1n4 has joined #ruby
g_rotbart has joined #ruby
freeayu__ has joined #ruby
tiripamwe has joined #ruby
SCommette has quit [Quit: SCommette]
freeayu has quit [Ping timeout: 245 seconds]
pygmael has quit [Read error: Connection reset by peer]
strnx has joined #ruby
mjb2k has joined #ruby
adeponte has joined #ruby
pygmael has joined #ruby
yxhuvud has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
Konboi has quit [Remote host closed the connection]
jimeh3 has quit [Ping timeout: 240 seconds]
Konboi has joined #ruby
<n_blownapart> bluebie: hey, you still on?
ciopte7 has quit [Quit: ciopte7]
seoaqua has joined #ruby
<bluebie> yep yep n_blownapart!
<n_blownapart> dang feelin a wee feeble-minded... bluebie
<bluebie> how can I help? :)
krz has joined #ruby
<n_blownapart> bluebie: I couldn't get it to work with class Car; end; class Hybrid < Car;end; -- it didn't like the attr_reader :make line 8 ... it called it an unrecognized method
<rking> Hrm. I've got to figure out a faster way to deterimine the bin/ dir used by gems. "gem environment" takes 1.5s, which means it's way too slow to do in a shell startup.
<rking> All I need is the string "1.9.1"
<bluebie> yeah you need that stuff in the Car class
<n_blownapart> one sec bluebie
GoGoGarrett has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<bluebie> rking: ruby -e 'puts RUBY_VERSION'
<bluebie> outputs "1.9.3\n"
yasushi has quit [Remote host closed the connection]
GoGoGarrett has quit [Client Quit]
<rking> bluebie: Right, which isn't the dir gems install to.
GoGoGarrett has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
yasushi has joined #ruby
<bluebie> n_blownapart: So all the things you want to be in cars and hybrids go after the line 'class Car' and before the end which goes with that class Car line
<bluebie> then anything you only want in the hybrids goes after the 'class Hybrid < Car' line and before it's own 'end' line
<n_blownapart> thanks bluebie let me check it out.
gavit has quit [Read error: Connection timed out]
<bluebie> rking: I thought you just wanted the string 1.9.1 o_o
Banistergalaxy has quit [Ping timeout: 260 seconds]
gavit has joined #ruby
<rking> bluebie: Right.
kyktommy has quit [Quit: kyktommy]
<rking> And that gives me "1.9.3"
<bluebie> rking: Maybe you can hack the output of 'gem which rubygems'?
<bluebie> well the ruby I'm using is ruby 1.9.3 o_o
<rking> I'm doing that but with "gem environment", and it takes 1.2 seconds
<bluebie> ah I see
<bluebie> takes 0.09 seconds to execute gem which rubygems on my computer, according to time
himsin has quit [Ping timeout: 246 seconds]
kenneth has quit [Quit: kenneth]
yasushi has quit [Ping timeout: 244 seconds]
<rking> Wow.
<rking> I wonder what my 1.2s thing is doing.
kenneth has joined #ruby
<rking> This is an i7 with SSD.
<rking> No excuse for that big a difference.
<rking> BTW, I find out from the rubygems source that "~>" is called, "spermy recommendation."
<bluebie> I'm on an i7 with a 5200rpm laptop sata2 drive
<bluebie> are you sure your filesystem isn't about to fail? O_o
brianpWins has joined #ruby
<bluebie> haha
nXqd has quit [Ping timeout: 240 seconds]
<bluebie> nice
a_a_g has joined #ruby
mrdodo has joined #ruby
<bluebie> huh
vectorshelve has joined #ruby
Stalkr_ has joined #ruby
burgestrand has joined #ruby
<bluebie> it takes 0.3 seconds cold on my 1.8ghz core 2 duo with ssd
<bluebie> then 0.2 when warmed up
dhruvasagar has quit [Ping timeout: 240 seconds]
dmiller has joined #ruby
cloud|droid has joined #ruby
nXqd has joined #ruby
hadees has quit [Read error: No route to host]
<n_blownapart> bluebie: this doesn't work. can't figure it out. http://pastie.org/4508604
<bluebie> what are all those def's supposed to do?
<burgestrand> n_blownapart: you will if you adjust your indenting to some consistent indenting
hadees has joined #ruby
<bluebie> they aren't in any classes
<bluebie> see you put your attr_reader inside the car class
Filuren has joined #ruby
<bluebie> which is nice, it's a little macro that automatically makes some method defs for you, called make and make=
<bluebie> but all your other methods are just haphasardly oddly indented and strewen all over the place, not connected to anything
<n_blownapart> bluebie: yeah, I know how that works, but its the ends that I think I have wrong.
<bluebie> of course it doesn't raise an error, because technically they're in the global context
<bluebie> yes
captproton has quit [Quit: captproton]
gavit has quit [Read error: Connection timed out]
<bluebie> you begin something with a statement like if, class, def, unless, while, that sort of stuff
<burgestrand> Probably more like the beginnings ^^
<bluebie> then you end it with an 'end'
<bluebie> all the stuff you want to put inside, you put between those two lines
<bluebie> methods go inside classes
gavit has joined #ruby
<bluebie> all the things you want in your class goes in that section
<arooni-mobile> trying to play around with "https://github.com/archiloque/rest-client" .. i *think* i instaleld it with a gem install rest-client... but not sure if this is something different. when i try require 'rest-client' i get an error of : LoadError: cannot load such file -- rest_client
<bluebie> otherwise how could ruby know which class it should put those methods in to?
cloud_droid has joined #ruby
<n_blownapart> bluebie: but we discussed putting end after Car and Hybrid at top?
<bluebie> your classes need ends, yes
<bluebie> you put the stuff in the class inside it, before the end
<bluebie> if you put the hybrid class inside the car class, it'll be inside the car class, not outside it
socialist has joined #ruby
<bluebie> that is all
patronus_ has joined #ruby
rotor` has joined #ruby
asteve has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Ping timeout: 260 seconds]
cloud|droid has quit [Ping timeout: 260 seconds]
Dreamer3 has joined #ruby
Stalkr_ has quit [Ping timeout: 260 seconds]
patronus has quit [Ping timeout: 260 seconds]
explody has quit [Ping timeout: 260 seconds]
rotor has quit [Ping timeout: 260 seconds]
Seventoes has quit [Ping timeout: 260 seconds]
blast_hardcheese has quit [Quit: ZNC - http://znc.sourceforge.net]
RichieEvan has joined #ruby
Seventoes has joined #ruby
<bluebie> your code at the bottom uses Hybrid, not Car::Hybrid, so it must be outside of the Car class when you make it unless you do special workarounds
<n_blownapart> bluebie: sorry I'm just confused now. I tried a shitload of solutions.
yoklov has quit [Quit: bye!]
ada2358 has quit [Read error: Operation timed out]
conor_ireland has quit [Quit: conor_ireland]
ada2358 has joined #ruby
justinmcp has joined #ruby
cjk101010_ is now known as cjk101010
<burgestrand> Guessing will not get you anywhere either. If you’re lucky you’ll just end up with a bad solution you don’t know how it works, but in the worst case nothing works and you still don’t know why.
<bluebie> n_blownapart: I'm redoing your code with comments and good indentation so you can read it how ruby understands it in plain english
<bluebie> give me a minute
butblack has quit [Quit: butblack]
blast_hardcheese has joined #ruby
<n_blownapart> I thought the end statements for both Car and Hybrid < Car go at the bottom of the script. so I wasn't guessing insofar ... burgestrand bluebie
darren has joined #ruby
<n_blownapart> the indentation I had decently but it fell apart as I rushed to follow your advice.
mahmoudimus has joined #ruby
<bluebie> n_blownapart: Wait a minute
<n_blownapart> bluebie: thanks
freeayu3 has joined #ruby
Banistergalaxy has joined #ruby
adeponte has quit [Remote host closed the connection]
luckyruby has joined #ruby
freeayu__ has quit [Ping timeout: 248 seconds]
t47921 has quit [Remote host closed the connection]
t5875 has joined #ruby
Konboi has quit [Ping timeout: 248 seconds]
<bluebie> n_blownapart: http://pastie.org/4510312
<bluebie> this is how ruby reads your code
<n_blownapart> thanks bluebie you're a saint I'll check it out.
a_a_g has quit [Ping timeout: 245 seconds]
<quazimodo> how does rvm work?
<quazimodo> does it set an alias for ruby?
<bluebie> erk typo - reload for updated comments n_blownapart
Chryson has quit [Quit: Leaving]
<bluebie> quazimodo something like that - bash functions I think maybe
<n_blownapart> bluebie: okie doke
<bluebie> it operates at the shell level, it doesn't manipulate symlinks or anything like that
bluOxigen has joined #ruby
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
twoism has quit [Remote host closed the connection]
ezra has quit [Ping timeout: 276 seconds]
twoism has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
tonini has joined #ruby
<bluebie> n_blownapart: To learn more about what you can do with classes and how they mingle, you might like to read http://ruby-doc.org/docs/ProgrammingRuby/html/classes.html
gavit has quit [Read error: Connection timed out]
<n_blownapart> bluebie: thanks i'm using the book the Well-Grounded Rubyist.
<bluebie> I've not heard about it
Konboi has joined #ruby
gavit has joined #ruby
<n_blownapart> bluebie: its David Black. respected, though its a little over my head.
<n_blownapart> thanks very much I'm studying your comments. bluebie
rails- is now known as rails
rails has quit [Changing host]
rails has joined #ruby
<quazimodo> my rvm tried to get rubygems but the file wasnt there
<bluebie> n_blownapart: Seeing as ruby is your first language (it's a good one to start off with!) You might also like to consider switching to Why's Poignant Guide
<quazimodo> how do i install rubygems into it?
<bluebie> http://mislav.uniqpath.com/poignant-guide/book/chapter-1.html It's written for first time programmers, with a friendly silly tone
<quazimodo> not *a* ruby gem, but rubygems itself
dmiller has quit [Remote host closed the connection]
<n_blownapart> its out of date isn't it? bluebie people were telling me to use a book featuring 1.9
<bluebie> n_blownapart: It is a little, but everything in that book still works in the latest version of ruby. Ruby 1.9 is mostly just a bunch faster at running your programs. It has a couple of nice new syntaxes which can be a bit easier to write, but aside from that it's very compatible
<bluebie> I'd not be too concerned about that really
drago757 has quit [Quit: drago757]
<bluebie> that said, you raise a good point. Perhaps I should go through and revise it when I have a spare moment
a_a_g has joined #ruby
<bluebie> Programming books tend be very poorly written - often they're written by people who learnt to program ten years ago or more! People who've entirely forgotten what it's like to try and understand this stuff
<bluebie> One day you'll be awesome and forget how to not understand programming too, but I think Why's guide is really good because his passion is teaching children, and he regularly did so both online and in person, so he never lost his sense for what people struggle to understand when starting out
flip_digits has joined #ruby
<bluebie> I actually taught myself without a book though, precisely because all the books back then were terrible!
<burgestrand> Some people just work better without books.
<bluebie> Though I'd never heard of ruby at the time - so I learnt Quick Basic - an old programming language for MS DOS. Ruby is a bit like basic, but so much better :D
<burgestrand> I never liked why’s guide as a programming book. I see it as a little comic book with random dabs of incomprehensible code in it.
answer_42 has joined #ruby
<bluebie> Yeah totally. If books aren't your thing, don't torture yourself. You don't need them
<bluebie> you can just get bits of open source code - rubygems and scripts and things and poke at them - change details, see how they respond. That's also a really good way to learn initially
<burgestrand> I appreciate that he wrote it, and even more so his passion for teaching, I just disagree with that book. I read it a few times. :p
<n_blownapart> bluebie: burgestrand well I don't know how to teach myself without a book. I'm becoming over-reliant on this chat but I do enjoy it a lot. but I don't understand your comments because I do have add_make as a method in Car. ??
<bluebie> It's good to skim through a book after though just to clear up any assumptions you might have gotten a bit wrong. I was pretty wrong about how I thought classes worked till I read through a good explanation, though i could basically make them and get things done regardless
ananthakumaran has quit [Quit: Leaving.]
<burgestrand> bluebie: I think you’ll need a mix of both to learn it either way
<bluebie> n_blownapart: No you don't - in that code it's after car's already done and closed up - there's been an end already!
<bluebie> burgestrand: Absolutely. It's just a matter of balance
<bluebie> The chat's a great way to learn too, and ruby
<bluebie> ruby's a nice place for that, as there are heaps of creative interesting helpful folks here
<bluebie> not just neckbearded incomprehensible computer scientists
<burgestrand> And even those dudes sing and draw foxes.
justsee has joined #ruby
<burgestrand> ;')
<n_blownapart> burgestrand: bluebie !!
lewis1711 has joined #ruby
<bluebie> n_blownapart: Yes? :)
<n_blownapart> bluebie: that was just enthusiasm
<lewis1711> graspee: this is me
<burgestrand> Rubyists are such a social little bunch, even the introverts and non-social dudes and dudettes.
<bluebie> nice :D
<n_blownapart> burgestrand: are there many dudettes? I always assume I'm chatting with men.
nXqd has quit [Ping timeout: 240 seconds]
<lewis1711> many of you are nice,normal people, and some of you are even very intelligent and helpful. but there a lot of bad apples
<bluebie> bats are cool hackers because their black eyes are like cool sunnies and they look a bit like vampires and vampires are kind of like computer hobbiests in that they both don't tend to get much sun
<bluebie> n_blownapart: I'm a girl
<burgestrand> n_blownapart: more than meets the eye, and more are joining
<bluebie> I'm also occasionally a compsci tutor at a local university
<bluebie> each year the proportion of girls to boys in compsci courses at uni increases, but ruby is still way ahead of the curve there
<burgestrand> bluebie: that’s an awesome hackerbat
<n_blownapart> bluebie: so I need self.class.add_make("Ford") bluebie ?
<burgestrand> bluebie: but it looks like more of a fox with a batcape
<quazimodo> fxed it :D
<bluebie> I think ruby's association with cool web development technologies and therefore close ties to design and CSS tends to bring in more chicks
<bluebie> as well as just being all around awesome
jlogsdon has joined #ruby
<graspee> i wish ruby weren't associated with web development
<bluebie> n_blownapart: No!
<burgestrand> lewis1711: there are always bad apples, all we can do is bonk them
<graspee> it makes me feel hollow and diseased
djdb has joined #ruby
t5875 has quit [Remote host closed the connection]
glistle has quit [Remote host closed the connection]
t22368 has joined #ruby
<lewis1711> many of you guys turn into terrible people if I try and get you to explain the benefits of dynamic typing to me
seoaqua has quit [Ping timeout: 240 seconds]
<graspee> the benefits are it's awesome
<bluebie> n_blownapart: I only showed that in the comments to say not to do it. That's not what you want at all. You need to add those methods to the car class instead of the global context is all.
<graspee> and easier
<burgestrand> lewis1711: eventually we all turn into bitter maniacs, usually after receiving a given amount of pull requests and/or issue reports from people who don’t read the README, you easily get a bit bitter :p
<bluebie> If you do that one thing everything will work
<graspee> and feels less like being bondage and discipline
<bluebie> n_blownapart: you don't even have to type any new letters - just move bits around!
mrdodo has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
<burgestrand> and frankly, sometimes you want to just smack people upside the head in this channel, especially the newbies
a_a_g has joined #ruby
<burgestrand> that’s when you draw hacker bats instead
<n_blownapart> bluebie: burgestrand ouch !
seoaqua has joined #ruby
<graspee> i find the experienced users more likely to score high on the douche scale
<burgestrand> bluebie: now that’s a hackerbat
<bluebie> Not going to do it for you though, because I'm sure you'll learn something worthwhile trying theories and seeing what happens. This is what we call 'test driven development' where you have some code which should work, and you go fix bugs in a piece of code it depends on until it works
<burgestrand> graspee: I’m sure one could draw a nice chart on bitterness vs. experience
<lewis1711> graspee: yeah but noon ever compares dynamic typing to GOOD statically typed systems. they point out like C++ and Java lol
elhu has joined #ruby
<lewis1711> of course you're going to win there'
<graspee> it's not a war
* burgestrand pitchfork
jenrzzz has quit [Ping timeout: 246 seconds]
<graspee> it's not a battleground of type systems
<graspee> use what you want
* burgestrand berret
gavit has quit [Read error: Connection timed out]
mrdodo has joined #ruby
hadees has quit [Ping timeout: 246 seconds]
Konboi has quit [Remote host closed the connection]
<graspee> you like scheme, don't you, lewis1711
gavit has joined #ruby
<lewis1711> yes
<lewis1711> yes I do
<graspee> well there you go then
<bluebie> I prefer dynamic typing. As much as haskall loving 'serious programmer' friends at uni talk about the benefits of static typing, I remain unconvinced.
<graspee> maybe you just don't like ruby!
<bluebie> I'd like to see some real double blind studies to show programmers are both more efficient and more happy in statically typed languages before I'll reconsider my position, I think. It's all a bit too subjective and oppinionated at the moment
<burgestrand> Haskell is nice. It has this fluffy but edgy feeling about it.
<bluebie> then I'll ignore the efficiency result because I couldn't care less which is faster xD
<graspee> the fact that it's opinionated shows you how futile such a study would be
<bluebie> I agree that one shouldn't use C++ as the general case for 'static typing results in languages like this'
<graspee> we are happy when we are using a language that fits in with our beliefs
maesbn has joined #ruby
<n_blownapart> bluebie: burgestrand thanks a lot for your patience. pax.
<burgestrand> n_blownapart: what’s a pax?
<graspee> latin for peace
<burgestrand> Ah.
<n_blownapart> burgestrand: pax is latin thanks graspee pax
Konboi has joined #ruby
<burgestrand> n_blownapart: inga problem, hejdå
<n_blownapart> burgestrand: are you in Norway?
ryanf has joined #ruby
Goles has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
patronus_ has quit [Remote host closed the connection]
<burgestrand> n_blownapart: close enough, I just figured an appropriate response would be in some other language as well :)
<graspee> e.g. pax romana, where you watch lalla ward on dr. who and think "I'd like a peace of that"
<burgestrand> n_blownapart: sweden
<n_blownapart> burgestrand: love sweden. I was there and in Denmark. loved it.
<oddmunds> n_blownapart: i'm in norway
Jotade11 has joined #ruby
<n_blownapart> oddmunds: can't wait to go there...iceland too.
jlogsdon has quit [Remote host closed the connection]
mmokrysz has joined #ruby
<burgestrand> bluebie: are there more hackerbats?
mmokrysz has left #ruby [#ruby]
tagrudev has joined #ruby
<bluebie> だれもがばかです :P
<bluebie> mmm one more thing
<burgestrand> pft
<burgestrand> だれもがバカです \o/
<bluebie> I made hackerbats for a hackety hack design proposal
justinmcp has quit [Remote host closed the connection]
<bluebie> but then their dumb mailing list thing wouldn't let me post emails and I gave up lol
ctp has joined #ruby
<burgestrand> bluebie: too bad, I like them because they’re just as quirky as the foxes
<oddmunds> they seem to be drawn in the style of _why
<burgestrand> bluebie: ^
<bluebie> were supposed to pay hommage to Why's hackety hack mouse, without just outright repurposing his characters
manizzle has quit [Quit: Leaving]
Filuren has quit [Quit: Leaving...]
<bluebie> I even have some half finished hacker bat dolls I was making to do some photo comics for tutorials and things
<bluebie> maybe stop motion videos
manizzle has joined #ruby
ctp- has joined #ruby
ryanf has quit [Ping timeout: 245 seconds]
<burgestrand> bluebie: you should keep at it, it would be great to keep the quirkyness alive
blast_hardcheese has left #ruby [#ruby]
<graspee> "i didn't turn people into zombies, i just repurposed them"
<burgestrand> I became a rubyist after the depart of why, and the quirkiness that initially drew my curiosity to ruby kind of died with him
nXqd has joined #ruby
<bluebie> mm thinking about updating some bits of the poignant guide to be 1.9ish now
<graspee> i'm quirky all the time, but people just treat me like an escaped mental patient
<bluebie> I'm supposed to be helping Judofyr on an article soon on event loops in ruby
<bluebie> (with illustrations)
ryanf has joined #ruby
<bluebie> burgestrand: I'm thankful to have been friend's with why while he was still in the community :)
<bluebie> He was a pretty cool guy
<bluebie> man did he pore himself in to it though
<bluebie> I don't know how he did it!
ctp_ has quit [Ping timeout: 252 seconds]
<bluebie> I would have burnt out in a week doing what he did
ryanf has quit [Client Quit]
<burgestrand> bluebie: some people just do, it’s not superhuman just rare
<oddmunds> bluebie: for the timeless repo?
ctp has quit [Ping timeout: 260 seconds]
<burgestrand> anybody who breaks the otherwise serious water with a little bit of music, cartoons and singing has my support
t22368 has quit [Remote host closed the connection]
t91917 has joined #ruby
<oddmunds> i dabble in all those, but I think doing all that now would hardly seem like anything else than copying _why
hemanth has quit [Read error: Connection reset by peer]
<bluebie> oddmunds: no
<burgestrand> oddmunds: naw
ananthakumaran has joined #ruby
<bluebie> It's for http://practicingruby.com - it's a paid journal thing on ruby - but the articles become free creative commons after a year or so
<bluebie> it's run by a friend of his
hemanth has joined #ruby
noyb has quit [Ping timeout: 240 seconds]
<graspee> land of lisp has a quirky style too
perryh is now known as perryh_away
gavit has quit [Read error: Connection timed out]
<oddmunds> that reminds me that i'm completely out of the ruby meetup loop since summer
gavit has joined #ruby
<burgestrand> oddmunds: there’s your chance for local artistery!
<oddmunds> meh
senny has joined #ruby
<burgestrand> :p
<oddmunds> seems like it has turned dormant
dr_bob has joined #ruby
<burgestrand> oddmunds: where do you live?
<oddmunds> one of the most initiativeful guys moved outside oslo some months ago
<oddmunds> oslo
<burgestrand> bluebie: you’re a firesticker?
Morkel has joined #ruby
<burgestrand> oddmunds: doesn’t oslo have a ruby user group?
<oddmunds> we di
<oddmunds> do
<oddmunds> but there hasn't been any activety lately
bigkevmcd_ is now known as bigkevmcd
<dr_bob> Morning!
<burgestrand> oddmunds: same with the gothenburgian user group
<oddmunds> i suspect that it is partly because oma left twon
<bluebie> burgestrand: I do a bit of poi and a bit of staff and a bit of constantly breaking my umbrellas
Jotade11 has quit [Quit: Linkinus - http://linkinus.com]
<dr_bob> Oslo is a nice place. I still have to see that onstad museum spelling (may be wrong)
<burgestrand> bluebie: sweet, I do quite a bit of flowersticking and have recently begun hitting myself with a pair of meteors :)
<bluebie> nice!
<bluebie> I did a bit of ropedart
<bluebie> got a bit bored of it
<bluebie> I don't like the asymetricality of it
<burgestrand> heh, that’s what I love about it, except the one I have is just a bunch of kevlar whick that weighs far too much and have a far too painful chain to play around with
<oddmunds> burgestrand: he was far from the only one pulling strings, and summer vacation (when norway goes into a hiatus) is just over, so I feel confident that things will happen soon
<oddmunds> dr_bob: morning
ttilley has quit [Ping timeout: 276 seconds]
<bluebie> Hoping to make a little money selling handmade LED poi and things like that, which are programmable through both graphical user interfaces offering fixed functions, and maybe a simple assembler
<burgestrand> oddmunds: sounds great, I’ll be sure to visit if I ever go to oslo for whatever reason, I need to get out of the country…
freeayu3 has quit [Ping timeout: 268 seconds]
<oddmunds> yeah, do
<bluebie> I believe I can undercut everything else on the market of similar quality (the higher end stuff) by a wide margin and deliver a much better product
<bluebie> but I'm working up to poi. Making electronics which withstand those kind of forces and standing behind their sturdiness with a warranty is a bit intimidating
<burgestrand> bluebie: oh neat, what do you use for controlling programming the leds?
<oddmunds> my experienve is limited, but the ruby meetup is by far the best of the meetups i've been to
<bluebie> I'm using AVR 8-bit microprocessors, running C
jjang has joined #ruby
<lewis1711> I wonder if my meetups happen around my part of the world
<bluebie> the virtual machine I have at the moment is programmed via a ruby build script - I made a little assembly DSL in ruby which generates the raw instructions to write in to the devices VM's program space
<oddmunds> lewis1711: you and banistefiend ought to hook up
jjang_ has quit [Ping timeout: 248 seconds]
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bluebie> I'm also experimenting with programming over light, rather than wires. The idea there is to use the LEDs in reverse as light sensors, so you can hold the light up to your phone's screen, choose a colour, and it'll flicker the data in to it as binary pulses out of the LCD
<burgestrand> bluebie: now that’s cool, I can’t imagine it’s easy finding components that enjoy being bashed into the ground
Drewch has quit [Quit: ZNC - http://znc.in]
<bluebie> it's only about 60 baud, but it's enough to do some interesting things :)
chriskk has joined #ruby
<bluebie> simple programs with added sinewaves and colour sequences and things like that
nXqd has quit [Quit: Lost terminal]
kaen has quit [Ping timeout: 252 seconds]
<bluebie> burgestrand: The circuity is pretty okay with it. it's mainly just batteries which can sometimes seperate out in to chemical layers when you put them in a centrifuge or poi - so then they stop outputting electricity for a few minutes
<bluebie> you have to be pretty careful about which batteries you use
<lewis1711> oddmunds: I can't, bannisterfiend wants to fight me. he's probably 120kg of solid muscle
<bluebie> for poi at least I'm experimenting with having the battery handheld as a handle, with a button to cycle through your programs, so you can do neat performances with specific colours and effects at different points
<burgestrand> bluebie: I understood about half of what you said, but LEDs as light sensors? to mimic some other light source?
<oddmunds> lewis1711: does i know what you look like?
<bluebie> LEDs are functionally very similar to solar cells - they're optimised to emit light instead of create voltage from it, but they do make a little bit of voltage when exposed to light equal to or of a higher frequency than the colour they emit
<burgestrand> lewis1711: I’m sure you’ll be herded like just another sheep, NZ has lots of sheep
<oddmunds> lewis1711: have you sent him treatpix?
<oddmunds> threatpix
<oddmunds> :P
<lewis1711> LOL
<bluebie> so you can look at the voltage coming out of your red LEDs to get a good sense of roughly how much white light is in the area, so long as the red LED isn't currently in use glowing!
<burgestrand> bluebie: TIL!
<lewis1711> not only do I not want to fight him, I imagine him to be socially inept and skinny
freeayu3 has joined #ruby
<bluebie> brightness is controlled by flicking the lights on and off tens or even hundreds of times per second though, so there's plenty of times when the light is off for a short moment
<oddmunds> lewis1711: yeah, you ought to dub yourself The English Setter and herd together a ruby community
<bluebie> TIL = ?
<burgestrand> bluebie: today I learned
<burgestrand> bluebie: :)
<lewis1711> what?
<oddmunds> you could open the first meetup by with a thundering talk on how dynamic typing is inferior
<lewis1711> the English Setter? I'm not English..
<lewis1711> LOL
<lewis1711> that'd be awesome
<burgestrand> bluebie: so you already make poi and sell them, or is that something you’re just planning on at the moment?
<bluebie> planning
<oddmunds> lewis1711: sorry, i thought they were sheep dogs. wikipedia informs me that they are gun dogs.
<bluebie> I'm working on a necklace at the moment - same tech, but miniaturized
<bluebie> I'm ordering up circuit boards and all that soon, and going to make a small number of them to sell on etsy and at raves and the likes
<oddmunds> lewis1711: You're obviously The Border Collie
<lewis1711> haha
<burgestrand> bluebie: if you ever get around to doing poi I’m probably more than interested to buy at least one set, I’ll probably just turn it into a meteor but I like your idea
chussenot has joined #ruby
<bluebie> the first versions wont be user programmable, but the circuit boards have spaces for the components needed to add that in later as a firmware update should it work out to be totally awesome :)
<bluebie> mm yeah :D
<burgestrand> bluebie: I go out juggling with a bunch of people from my area from time to time, maybe I could persuade them to buy some too and get them to split the shipping with me :p
graspee has quit [Quit: leaving]
ph^ has quit [Remote host closed the connection]
<burgestrand> bluebie: either way I’m interested if you ever get around to it, just ping me when the time is appropriate
<burgestrand> now I’ll just stop hogging this channel
* burgestrand coughs
mxbtty1 has quit [Ping timeout: 240 seconds]
igotnolegs has quit [Quit: Computer has gone to sleep.]
elhu has quit [Quit: Computer has gone to sleep.]
clocKwize has joined #ruby
gavit has quit [Read error: Connection timed out]
<shevy> burgestrand!
<shevy> all power to burger on the strand!!!
<burgestrand> burgerstand
arooni-mobile has quit [Ping timeout: 272 seconds]
gavit has joined #ruby
<burgestrand> it’s kind of my temporary stagename, I’ve adapted it as the first slide of every talk because it’s going to come up sooner or later
<burgestrand> either that or people are too polite to make the joke
indian has quit [Ping timeout: 272 seconds]
<bluebie> wee ^_^
darren has quit [Remote host closed the connection]
<bluebie> burgestrand: Is easy programmability (i.e. without special interfacing tools) a prerequisite for your interest?
<n_blownapart> bluebie: well the only way I could get it to work was to put class Hybrid < Car on line 40: http://pastie.org/4517133
<bluebie> brb
pingfloyd has quit [Quit: pingfloyd]
<burgestrand> bluebie: I’m not too hot on the hardware side of things, but as long as I can write some AVR-C, have a list of outputs to write to to make it blink and a good way to upload the code to the microprocessor I’m pretty much okay with it :P
[1]dtribble has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
chussenot has quit [Ping timeout: 246 seconds]
<burgestrand> bluebie: my experience goes as far as writing software for an arduino for a few months, but I never did play around with the hardware
vlad_starkov has joined #ruby
dtribble has quit [Ping timeout: 268 seconds]
<bluebie> ah right
s1n4 has quit [Quit: Lost terminal]
<bluebie> yeah at a minimum it'd be a programmable avr
<bluebie> I've not yet fully baked my ideas for the GUI and user friendly programming interfaces and all that stuff
<burgestrand> bluebie: however given some instructions I can probably work my way around that as well if necessary
<burgestrand> bluebie: but I’d guess you’re aiming (when done) to get it out to a less technical crowd?
<burgestrand> i.e. probably not have them upload code to the microprocessor unless they really want to? :p
<bluebie> I rather like the thought of using light or sound to transmit the program in to the device because iphones and other devices with weird or no ports can do it, they're easy to send around through the internet (animated gifs or wavs) and it's clear to even a total noob how it works, so they can intuitively fix a lot of problems - where something like a usb dongle is pretty opaque and magic
<bluebie> I'd release source code
<bluebie> yes, the nontechies are my main aim
<burgestrand> yeah, that idea of just… showing the device some light sounded awesome
<n_blownapart> bluebie: burgestrand did someone say nontechie?
<bluebie> still the firmware would be open source for noncommercial uses at minimum, and if I do end up using a turing machine model, I'd release some sort of assembler too
tomsthumb_ has joined #ruby
<burgestrand> n_blownapart: :)
<bluebie> I like the turing machine idea because it means I can add new features to the devices just by adding new modules to the programming app :D
a_a_g has quit [Quit: Leaving.]
a_a_g has joined #ruby
<burgestrand> bluebie: what alternatives are there?
<bluebie> n_blownapart: brilliant! That's perfect
subbyyy has quit [Quit: Leaving.]
haxrbyte_ has quit [Ping timeout: 246 seconds]
<bluebie> now fix the indentation of line 40 and 41 n_blownapart
<burgestrand> isn’t that what he had in the beginning? :P
<bluebie> then I give you permission to do the happy dance
<bluebie> almost :)
<n_blownapart> bluebie: you mean just to stick class Hybrid < Car on the bottom?
<burgestrand> n_blownapart: in most cases that’s what you’d do
<bluebie> if by "the bottom" you mean below your car class definition, then sure
<burgestrand> n_blownapart: actually, you would probably just put it in another file
brdude has joined #ruby
<burgestrand> n_blownapart: and load it at the bottom
<bluebie> but you should understand why, not just know it as a voodoo dance
<n_blownapart> burgestrand: interesting. by the way I'm a geezer. I'm 50 this shit is hard. you mean load / require at bottom? bluebie burgestrand?
<bluebie> burgestrand: I could have it just implement fixed functions - so for each 'program slot' you'd upload which function to use, and some data for it - settings, lists of colours, that sort of thing
Guest85391 has quit [Quit: Leaving]
<bluebie> so you'd be able to reconfigure and tweak animations already implemented, but not add entirely new things
<bluebie> it'd be good enough for a lot of uses and it'd upload faster
<bluebie> And I was feeling old! It's my 24th birthday today xD
<bluebie> time never stops o_o
Criztian has joined #ruby
kaneda has joined #ruby
iamlacroix has joined #ruby
kaneda is now known as Guest65370
<shevy> bluebie cool
<bluebie> n_blownapart: burgestrand: usual convention is for requires to be at the top?
<shevy> bluebie I think I started with PHP when I was about 24
<burgestrand> bluebie: welcome to the club of the 24s
kaen has joined #ruby
<burgestrand> bluebie: i.e. happy birthday
yaymukund has joined #ruby
<shevy> it's going downhill from there for sure
<shevy> :P
<burgestrand> bluebie, n_blownapart: yes, requires are usually at the top but sometimes you could also place them at the bottom
<bluebie> n_blownapart: The way I'd usually do this is have a file called 'hybrid.rb' and a file called 'car.rb' and at the top of hybrid.rb have: require './car.rb'
<lewis1711> pfft, speak for yourself
<shevy> hehehe
<bluebie> that way if you load up hybrid it'll make sure car is loaded first
gavit has quit [Read error: Connection timed out]
<bluebie> yeah, requires can technically be anywhere - even in methods and stuff!
<lewis1711> I'm heading on 25 and in the best shape of my adult life. sucks to be you
shadoi has quit [Quit: Leaving.]
gavit has joined #ruby
<burgestrand> bluebie: I don’t have a personal opinion on which is better (when it comes to the led poi thingies), I’m sure I’d form an opinion after the decision has been made, I’m just happy to have some programmable light toys to throw around :p
* bluebie sighs
workmad3 has joined #ruby
<bluebie> yeah :P
t91917 has quit [Remote host closed the connection]
<bluebie> yeah fair enough :)
t49908 has joined #ruby
<bluebie> maybe a compramise - one of the fixed functions is 'turing machine' :P
<burgestrand> bluebie, n_blownapart: about the requires, I mean something like this: https://github.com/Burgestrand/spotify/blob/master/lib/spotify/api.rb
<bluebie> that way it has quick upload for common stuff, and future upgrading is easier
<burgestrand> this is not inheritance per se, but the dependency is kind of the same, the attach_function needs to be defined before anything else
<bluebie> ah right yeah
<bluebie> that sort of thing is quite common in rubygems
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby
<bluebie> have you guys seen the rediculous things Camping does?
TPFC-SYSTEM has joined #ruby
<n_blownapart> bluebie: burgestrand : cool thanks. for the meantime, if all the code is in one file, I still thought that the subclass could be listed at the top, and the scope wouldn't be affected.
<bluebie> it reads in it's own source code and gsubs constant names to be other ones then evals itself them in some functions
<burgestrand> n_blownapart: like you probably noticed, ruby reads your code from top to bottom, if you say Hybrid < Car, ruby goes "Okay. But… there is no Car."
<bluebie> I love the project - it eternally challenges me to think how the heck it works
<burgestrand> bluebie: sounds like an interesting soup
cloud_droid is now known as cloud|droid
<bluebie> the compact version fits on one page too! https://github.com/camping/camping/blob/master/lib/camping.rb
LouisGB has joined #ruby
<n_blownapart> burgestrand: I meant just below class Car.
timonv has joined #ruby
<bluebie> below class Car means below class Car's 'end' line if you want it to work the way you expect
<bluebie> "class Car" describes the next section all the way until it's matching end as one conceptual thing.
elhu has joined #ruby
<n_blownapart> OK bluebie burgestrand I think I have it. you people are GREAT. I gotta go to bed. thanks !!
<bluebie> g'nite :)
<bluebie> Hope your dreams are more interesting than hallucinations of text editors!
<bluebie> I hate getting those after staying up late on the computer
<burgestrand> bluebie: holy hell
<n_blownapart> bluebie: I am a shaman dreamer !
<burgestrand> I only hallucinate shadow monsters. Anyway…
macer_ has joined #ruby
<bluebie> yeah
<bluebie> my dreams are pretty lame
<bluebie> but I make up for it in my waking moments :)
<krz> i have an array. ['foos_count', 'bars_count', 'foobars_count']. how do i execute something like User.update_attributes(:foos_coun => 1, :bars_count => 1, :foobars_count => 1)
mrdodo has quit [Remote host closed the connection]
g_rotbart has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
<burgestrand> Play enough tetris and you can replace the text editors with falling bricks.
<yaymukund> https://gist.github.com/06b2029128a5f0a09ffb What's the best way to select a value from a hash given a list of preferences?
iamlacroix has quit [Remote host closed the connection]
<burgestrand> krz: you need to turn it into a hash first. I assume the numbers are the count of the number of occurrences for each key?
macer_ is now known as macer1
macer1 has quit [Changing host]
macer1 has joined #ruby
rburton- has quit [Quit: rburton-]
<bluebie> krz: Hash[my_array.map { |name| [name.to_sym, 1] }] will do the trick
hoelzro|away is now known as hoelzro
inteq has quit []
<krz> let me try it out
<bluebie> oh if burgestrand is right and they're supposed to be the number of times those keys are in each array, my thing is wrong
<yaymukund> (I guess the .compact.first is decent, but I was wondering if there was a better solution I was missing)
<bluebie> I'm assuming it just sets some defaults on an activerecord gadget when you set it up
robbyoconnor has quit [Read error: Connection reset by peer]
<shevy> bluebie when I am tired, my view on the editor is quite blurred
LouisGB has quit []
<shevy> my brain usually still works better than my eyes in those moments
<burgestrand> krz: http://ideone.com/Qz4cG
jenrzzz has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
lurch_ has left #ruby [#ruby]
<bluebie> yaymukund: how about this: menu[preferences.find { |k| menu.has_key? k }]
<bluebie> that way it only computes till it finds the first one
vlad_starkov has quit [Remote host closed the connection]
twoism has quit [Remote host closed the connection]
<krz> bluebie: are you familiar with active record?
<bluebie> and still returns nil without raising anything if it doesn't find any
workmad3 has quit [Ping timeout: 244 seconds]
<bluebie> krz: nope
<bluebie> haven't touched it in years
Guest23734 has quit [Ping timeout: 256 seconds]
<yaymukund> bluebie: oo, interesting
<yaymukund> still a bit clever for my tastes but neat
brdude has quit [Ping timeout: 240 seconds]
joekarma has joined #ruby
<bluebie> I doubt you'll do much better than that or your values_at solution for a one-liner
<krz> bluebie: Hash[array.map { |name| [name.to_sym, 1] }] returns the results into {:foos_count=>1, :bars_count=>1, :footers_count => 1}. i need it without the {}
<burgestrand> krz: what? why?
<bluebie> you can break the key finder in to another line with a good variable name like 'first_key_found' if you like for bonus clarity points
<burgestrand> krz: wait, what?
<bluebie> krz: no you don't
<krz> because active record does not accept {}
<burgestrand> krz: ^
<burgestrand> krz: it does, it becomes exactly the same in fact
<bluebie> krz: the {} are implied when you call the function without them - it's functionally identical
<bluebie> it's only different syntactically - once that code hits the actual ruby bytecode running gadget, it's byte for byte identical
krz has quit [Quit: krz]
krz has joined #ruby
<krz> sorry shitty irc client froze
<yaymukund> bluebie: thanks, I think you're right. it was worth a shot-- sometimes, there's a very elegant one liner that I just overlooked because I'm a ruby noob :)
LouisGB has joined #ruby
<krz> with AR, i can't do: DailyStat.increment_counter({:foo => 1}, 17)
<bluebie> yeah :)
<krz> it has to be DailyStat.increment_counter(:foo => 1, 17)
zeromodulus has quit [Read error: Connection reset by peer]
<burgestrand> krz: that’s a syntax error
<bluebie> krz: no, that's the same. You're confused, or your ruby installation is broken
banister`sleep has joined #ruby
<bluebie> what why's it a syntax error?
zeromodulus has joined #ruby
<bluebie> am I blind?
<Seventoes> anyone know if i can limit the size of a page being downloaded with mechanize?
<burgestrand> bluebie: :foo => 1, 17 — where would ruby end the hash?
enroxorz-work has quit [Read error: Connection reset by peer]
<burgestrand> ruby’d expect yet another rocketship but there is none, so when you add the final bracket ruby goes booboo.
<bluebie> oh I see
<bluebie> it could figure it out. There's enough information there
<burgestrand> Yeah, but.
<burgestrand> It doesn’t. :p
<bluebie> aparently so!
<bluebie> I never knew :)
<bluebie> I guess because it's an annoying function definition and shouldn't exist anyway
<burgestrand> That’s why it’s annoying to have your options hash as the *first* argument, because you *have* to use the brackets.
<burgestrand> That or pass the parameter from a method/variable.
gavit has quit [Read error: Connection timed out]
<bluebie> so yeah krz you're so wrong in every regard
Criztian has quit [Remote host closed the connection]
gavit has joined #ruby
<krz> how so?
<bluebie> Seventoes: you could ask the server to only give you the first x-many bytes perhaps with a range request
Rochefort has joined #ruby
ph^ has joined #ruby
<bluebie> otherwise I'd just use timeout to kill it if it's wasting too much time. Bandwidth's cheap
dhruvasagar has quit [Ping timeout: 268 seconds]
seoaqua has quit [Ping timeout: 265 seconds]
<Seventoes> bluebie: yeah a timeout's probably a good idea
dhruvasagar has joined #ruby
<Seventoes> i'm writing a URL shortener for my game's chatroom
<bluebie> krz: the thing you propose as being what you 'have to do' is a syntax error in ruby. Nobody can do that. Not even you
<Seventoes> don't want players posting a bunch of ISO links
<Seventoes> lol
<bluebie> don't accept binary/octet-stream then
<bluebie> or whatever iso's content type is
t49908 has quit [Remote host closed the connection]
<Seventoes> where can i set the accepted mime types?
t11436 has joined #ruby
<bluebie> or do a head request to query the content size instead of trying to download it to find out
<bluebie> you don't need mechanise - any http client will do - even net/http built in to ruby
<bluebie> mechanise is for crawling and automating, not for simple low level http stuff
<Seventoes> i'm using mechanize to get the title of the page
<Seventoes> and extras like tweet text or youtube views
<bluebie> Ah
Monie has quit [Read error: Connection reset by peer]
<Seventoes> guess i can shoot out a quick HEAD request before starting mechanize
<bluebie> hmmmmm
<bluebie> why are you limiting it?
<bluebie> so people don't bog down your app with a lot of data in a response?
Russell^^ has quit [Quit: Russell^^]
<Seventoes> yeah, i don't want to download a 700MB ISO before returning a response
<bluebie> timeout + accept headers should do it then
mike4_ has quit [Remote host closed the connection]
<Seventoes> i think a 3 second timeout should take care of it
<bluebie> is a hack to set request headers in mechanize
<bluebie> limit it to html and xhtml and you'll be sorted :)
<Seventoes> meh, don't wanna trust the server to give me the right mime either
<Seventoes> i'll just do a 3 second timeout and call it a day
<bluebie> so timeout also
MarGarina has joined #ruby
ConstantineXVI has quit [Ping timeout: 245 seconds]
<bluebie> this cuts out three seconds of lag in your service almost all of the time
quazimodo has joined #ruby
dekroning has joined #ruby
krz has quit [Quit: krz]
quazimodo has quit [Remote host closed the connection]
<bluebie> objective c could be so much more pleasant if apple deleted it and used ruby instead
wallerdev has joined #ruby
banister`sleep has quit [Read error: Connection reset by peer]
thone_ has quit [Ping timeout: 244 seconds]
bluebie has quit [Quit: Linkinus - http://linkinus.com]
banister`sleep has joined #ruby
<Seventoes> bluOxigen: Accept header worked great :D
<Seventoes> err
m4rtijn has joined #ruby
<Seventoes> bluebie: ^^
<Seventoes> sorry bluOxigen :P
chichou has joined #ruby
thone has joined #ruby
vlad_starkov has joined #ruby
mjb2k has quit [Quit: mjb2k]
gavit has quit [Read error: Connection timed out]
eldariof has joined #ruby
gavit has joined #ruby
burgestrand has quit [Quit: Leaving.]
joephelius has quit [Ping timeout: 244 seconds]
gilead has joined #ruby
gry has quit [Quit: gone]
jimeh3 has joined #ruby
Markvilla has joined #ruby
seoaqua has joined #ruby
Bofu has joined #ruby
Jay_Levitt has joined #ruby
hakunin has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
Nisstyre has quit [Read error: Connection reset by peer]
shikamaru has quit [Ping timeout: 246 seconds]
Rious has quit [Quit: ZNC - http://znc.sourceforge.net]
Nisstyre has joined #ruby
ly_gs has joined #ruby
Boffers has quit [Ping timeout: 268 seconds]
shikamaru has joined #ruby
tightwork has quit [Read error: Operation timed out]
arturaz has joined #ruby
johnb003_ has quit [Read error: Connection reset by peer]
Rious has joined #ruby
johnb003_ has joined #ruby
c0rn has joined #ruby
gavit has quit [Read error: Connection reset by peer]
gavit has joined #ruby
m4rtijn has quit [Quit: Verlassend]
charliesome has joined #ruby
DanBoy has quit [Ping timeout: 248 seconds]
c0rn__ has quit [Remote host closed the connection]
tightwork has joined #ruby
tiripamwe has quit [Ping timeout: 245 seconds]
haxrbyte has joined #ruby
d3vic3 has quit [Ping timeout: 246 seconds]
s1n4 has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
d3vic3 has joined #ruby
chussenot has joined #ruby
a_a_g has quit [Quit: Leaving.]
a_a_g has joined #ruby
fixl has joined #ruby
haxrbyte_ has joined #ruby
seoaqua has quit [Quit: 离开]
nilg has joined #ruby
<aces1up> hey I have a question on passing a hash to a method call, the write up is on paste bin here: http://pastebin.com/utYGn3Jh any help would be appreciated!
[1]dtribble has quit [Ping timeout: 248 seconds]
ttilley has joined #ruby
Criztian has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
<charliesome> aces1up: don't use paste bin, use codepad, paste or gist instead
ringotwo has quit [Remote host closed the connection]
haxrbyte has quit [Ping timeout: 246 seconds]
patronus has joined #ruby
<aces1up> charliesome ok, will do, any ideas on that though?
<charliesome> aces1up: you can pass a hash with explicit braces to a method if you use parens
<charliesome> can you post some actual code?
<aces1up> charliesome if a hash is a single pair, how do you remove the curly? as the library I'm using I cannot change way it recieves variables.
<charliesome> aces1up: a hash is a hash, whether you drop the braces in a method call is purely a syntactic thing
GeekOnCoffee has quit [Read error: Connection reset by peer]
Konboi has quit [Ping timeout: 240 seconds]
gavit has quit [Read error: Connection timed out]
ConstantineXVI has joined #ruby
gavit has joined #ruby
AnarchoTroll has joined #ruby
ringotwo has joined #ruby
quazimodo has joined #ruby
charliesome has quit [Ping timeout: 265 seconds]
wallerdev has quit [Quit: wallerdev]
Konboi has joined #ruby
mrdodo has joined #ruby
tiripamwe has joined #ruby
banister`sleep has quit [Read error: Connection reset by peer]
ringotwo has quit [Remote host closed the connection]
cantonic has joined #ruby
banister`sleep has joined #ruby
mrdodo has quit [Ping timeout: 246 seconds]
ringotwo has joined #ruby
twoism has joined #ruby
Banistergalaxy has quit [Ping timeout: 268 seconds]
imami|afk is now known as banseljaj
kaen has quit [Ping timeout: 246 seconds]
twoism has quit [Ping timeout: 272 seconds]
wobr has joined #ruby
Markvilla has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
fantazo has quit [Remote host closed the connection]
quest88 has quit [Quit: quest88]
ringotwo has quit [Remote host closed the connection]
rburton- has joined #ruby
elaptics`away is now known as elaptics
dekroning has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
Criztian has quit [Remote host closed the connection]
flype has joined #ruby
t11436 has quit [Remote host closed the connection]
joekarma has quit [Quit: joekarma]
t18291 has joined #ruby
d3vic3 has quit [Ping timeout: 252 seconds]
freeayu__ has joined #ruby
freeayu3 has quit [Ping timeout: 246 seconds]
lkba has quit [Quit: Bye]
gavit has quit [Read error: Connection timed out]
CodeVision has joined #ruby
s1n4 has quit [Quit: Lost terminal]
gavit has joined #ruby
berserkr has joined #ruby
peterhellberg has joined #ruby
<peterhellberg> Good morning :)
<dr_bob> Hi peterhellberg
<peterhellberg> I spent the majority of the night hacking on https://humans.herokuapp.com/ and it turned out quite nicely.
jenrzzz has quit [Ping timeout: 244 seconds]
dr_bob has quit []
macer1 has quit [Remote host closed the connection]
<banister`sleep> peterhellberg: what is humans.txt
<peterhellberg> banister`sleep: More info http://humanstxt.org
d3vic3 has joined #ruby
<banister`sleep> k00
<peterhellberg> banister`sleep: Example http://webcatbcn.com/humans.txt ( My parsed output: https://humans.herokuapp.com/webcatbcn.com )
<banister`sleep> thx
m4rtijn has joined #ruby
<m4rtijn> hi
<peterhellberg> m4rtijn: Hi there
Vert has joined #ruby
<m4rtijn> i cant resist to troll after I logged in to #php :)
<m4rtijn> they make it so easy
BRMatt has quit [Ping timeout: 252 seconds]
BRMatt has joined #ruby
charliesome has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
<m4rtijn> yesterday I saved a progging newbie who wanted to start learning php... i saved his soul by redirecting him to rails :)
<m4rtijn> #php should have a permanent #303 to rails
<lupine_85> rails is a framework, not a library ^^
<lupine_85> erm, language
gavit has quit [Read error: Connection timed out]
<lewis1711> I keep trying to show python people that their language is worthless, but it never works
gavit has joined #ruby
eataix has joined #ruby
<lewis1711> it's tragic so many people are enarmoured with a slow, dynamically typed algol that manages to ignore most of lisp and smalltalk
<charliesome> lewis1711: self what's wrong with self python? ()
baphled has joined #ruby
<shell0x> is if !names.include? "foo" the same like unless names.include? "foo" or does it behave different in some situations?
<charliesome> shell0x: correct
<shell0x> k
<shell0x> should use unless then ;)
<lewis1711> LOL
<lewis1711> @ charliesome
<lewis1711> is python fully OOP like ruby though/ they keep saying it is but it strikes me as wrong
<charliesome> lewis1711: if you ever see a bunch of python guys, go straight up to them and introduce yourself. "self hey self guys what's self up"
CodeVision has quit [Quit: WeeChat 0.3.8]
<shell0x> :D
<charliesome> lewis1711: i believe it is, but it doesn't act like it most of the time
<shell0x> python isn't fully OOP
<JonnieCache> shell0x: they are exactly the same. its a matter of taste
<shell0x> just look at len(name)
<charliesome> i have no clue why things like len() and stuff are global functions
<JonnieCache> shell0x: if! / unless i mean
cantonic_ has joined #ruby
<lewis1711> yeah but isn't that same as name.len
<charliesome> shell0x: len(obj) is basically obj.__len__() iirc
<charliesome> why? PYTHON!
<AnarchoTroll> Guys, I am trying to create a ruby C extension that will need to include another library. I first tried to come up with a very simple "hello world" project where I have a library including another one, but I keep getting "checking for hello() in -lhello... no". Anyone here willing to help me? I can setup a github project to show what I am trying ot do
pskosinski has joined #ruby
<lewis1711> charliesome: and make sure it's obvious you're not asking a question when you say all that, because python can't have question marks as identifiers
<m4rtijn> maybe I should start posting this in #php everyday
<m4rtijn> very fun read.. if anyone is interested
<charliesome> m4rtijn: they've seen that a million times
<shell0x> JonnieCache: thanks. I just remember that there was a difference between .eql? and == or something like that, so I asked before chaning it :)
<lewis1711> AnarchoTroll: sounds like a good idea
<m4rtijn> I just found it a few days ago
<AnarchoTroll> lewis1711, I will do that now
<JonnieCache> shell0x: isnt that java youre thinking of there? where you have to compare strings with .eql() or whatever
<lewis1711> AnarchoTroll: I have a bit of experience with these things but I may be sleeping soon. you may also get ansers in #ruby-lang
<JonnieCache> never seen that in ruby
<charliesome> JonnieCache: ruby has #eql?
CodeVision has joined #ruby
<AnarchoTroll> lewis1711, thanks for the tip! I will set up the project now, worst case we can take a look at it tomorrow. thanks anyway for your willingness to help
<lewis1711> does ruby have TCO yet? if so, we should hang out
<shell0x> equal?/eql?/ == ;)
<JonnieCache> shell0x: ah right. ive always done those comparisons using the specific methods, .is_a? and comparing object_id and so on
tonini has quit [Remote host closed the connection]
<charliesome> i've never really found a good use for eql? and equal?
<lewis1711> wtf are in #scheme/?
<JonnieCache> tbh if you need to do that theres a good chance youre Doing It Wrong
<lewis1711> oh no that/s eq? eqv? equal?
cantonic has quit [Ping timeout: 248 seconds]
cantonic_ is now known as cantonic
<lewis1711> nevermind
<shell0x> m4rtijn: php has a big advantage over the other languages ;)
jimeh3 has quit [Quit: bye]
<m4rtijn> shell0x, enlighten me
<m4rtijn> :)
<lewis1711> so would anyone here like to show me why dynamic typing is superior to a static typing (and you have to use a good example of static typing like ML or haskell or scala, not C++ that's cheating)? or should I call it a night
tiripamwe has quit [Quit: Leaving]
<shell0x> m4rtijn: it's wide support by hosters
tiripamwe has joined #ruby
<shell0x> php hosting is mostly cheaper
<charliesome> heroku
<shell0x> still more expensive ;)
<charliesome> shell0x: can't beat free
<charliesome> heroku is free for small apps
<charliesome> and if you're large enough that you have to start paying for heroku, then odds are that you'd probably have already outgrown shared hosting anyway
<charliesome> at least the shitty one dollar a month php 5.1 shared hosts
<m4rtijn> I rent a vhost for 5euros / month with 2 big rails apps on it..
<m4rtijn> no problems so afr
<charliesome> m4rtijn: yeah that's a good approach
Jay_Levitt has quit [Quit: Leaving...]
<Muz> Other than the fact you're using Rails.
<JonnieCache> just make the client pay for it and you can buy whatever hosting you want. simple.
<charliesome> Muz: what would you prefer
<m4rtijn> and since RVM is OS independent.. I dont care about anything else
<Muz> charliesome: I wouldn't. I don't make my wage by having to bother with anything directly user-facing. :)
<Muz> Generally, dealing with users, or cross-browser issues, or aesthetics is a royal pain in the arse.
<charliesome> brb
jimeh has joined #ruby
<Muz> Because, frankly, been there, done that, got the tshirt (and stock options).
apeiros_ has joined #ruby
<JonnieCache> Muz: backend fo lyfe baby
<Muz> Ding!
hemanth has quit [Read error: Connection reset by peer]
jameshyde__ has quit [Quit: Leaving]
<JonnieCache> the code is just more fun tbh
<Muz> Some of the technical problems are too.
<JonnieCache> yeah thats basically what i meant
<Muz> Don't get me wrong, problems involving UX and UI are interesting, but not my cup of tea.
<JonnieCache> tbh dealing with browsers isnt a technical problem. its a navigation of a kafkaesque nightmare type of problem
gavit has quit [Read error: Connection timed out]
Shrink has quit [Ping timeout: 240 seconds]
gavit has joined #ruby
hemanth has joined #ruby
X-Jester has quit [Ping timeout: 260 seconds]
Nisstyre has quit [Ping timeout: 246 seconds]
srnty has quit [Ping timeout: 260 seconds]
etank has quit [Ping timeout: 246 seconds]
X-Jester has joined #ruby
jkyle has quit [Ping timeout: 260 seconds]
jkyle has joined #ruby
srnty has joined #ruby
<m4rtijn> Muz, I also been there.. and I loved it when i changed jobs and was able to concentrate on progging and leave the frontend + administration to other people
Nisstyre has joined #ruby
etank has joined #ruby
<m4rtijn> its a lot less annoyance
workmad3 has quit [Ping timeout: 252 seconds]
AnarchoTroll has quit [Quit: Leaving]
elspeth_ is now known as elspeth
fridim_ has joined #ruby
Rhainur has joined #ruby
elhu has quit [Ping timeout: 260 seconds]
Rochefort has quit [Remote host closed the connection]
cascalheira has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
elhu has joined #ruby
iori has quit [Read error: Connection reset by peer]
Shrink has joined #ruby
himsin has joined #ruby
joshman_ has joined #ruby
gavit has quit [Read error: Connection timed out]
rburton- has quit [Quit: rburton-]
gavit has joined #ruby
iori has joined #ruby
joephelius has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
t18291 has quit [Remote host closed the connection]
t11747 has joined #ruby
rakunHo has quit [Remote host closed the connection]
joshman_ has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby
Xethron_ has quit [Ping timeout: 245 seconds]
[Neurotic] has quit [Quit: Leaving]
Guest23734 has joined #ruby
berserkr has quit [Quit: Leaving.]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<shevy> lewis1711 dynamic "typing" is much faster to write
<lewis1711> are you cheating? is it much faster to write than statically typed languages that don;t need type annotations?
lkba has joined #ruby
<hoelzro> shevy: not necessarily
<hoelzro> in some static languages, the types are inferred
<hoelzro> ex. ML, Haskell
<shevy> lewis1711 why would I be cheating? I dont have to ever bother spending time writing types in advance see https://github.com/Araq/Nimrod/blob/master/lib/windows/nb30.nim at all the "type" declarations there
<shevy> well
<shevy> I do have to use @ivars in classes
gavit has quit [Read error: Connection timed out]
<shevy> but that's like 5% work compared to types like those in that example. and types have to be used for every method/function signature
<shevy> lewis1711 you explain how this is faster writing than not having to write it
<shevy> dont really know haskell well enough to comment
timonv has quit [Remote host closed the connection]
<lewis1711> I don't know what that is
<shevy> lewis1711 nimrod
gavit has joined #ruby
<lewis1711> shevy: do you know what type inference is?
<shevy> "<lewis1711> so would anyone here like to show me why dynamic typing is superior to a static typing"
chussenot has quit [Ping timeout: 248 seconds]
<shevy> question answered :P
<hoelzro> shevy: I'd say you were answering the question "would anyone here like to show me why Ruby is superior to Nimrod"
yasushi has joined #ruby
<shevy> yeah ruby vs. haskell can be a harder battle
<shevy> ruby loses
<hoelzro> eh, I don't know about that
<hoelzro> static and dynamic languages both have their uses
<JonnieCache> strongly typed languages without type inference obviously suck
<JonnieCache> but honestly who uses them? apart from corporate types
<hoelzro> ex. I wouldn't use a static language for a scripting language
<hoelzro> JonnieCache: C?
burgestrand has joined #ruby
<lewis1711> "would anyone here like to show me why dynamic typing is superior to a static typing (and you have to use a good example of static typing like ML or haskell or scala, not C++ that's cheating)?" was my original quote chevy
<JonnieCache> ah good point. not quite the same thing though because you dont have classes as such
<JonnieCache> less cognitive load
<shevy> lewis1711 no instance of cheating
<lewis1711> I should've said "not stuff like C++"
<hoelzro> JonnieCache: you mean classes increase or decrease cognitive load?
<shevy> "good example" eh
crl_ has joined #ruby
<shevy> your question is basically "why is haskell better than ruby"
<lewis1711> it's easy to show me some algol static typing mess and say dynamic is superior, but modern static systems are not like that
<lewis1711> no
<shevy> #haskell also has more people than #ruby
<JonnieCache> hoelzro: increase, when you have to declare types. a lot to remember, all those different classes
<lewis1711> you
<lewis1711> I remember you
<shevy> 877 vs 610 :(
<lewis1711> you're the guy that got hyper, hyper defensive about this before
<shevy> defensive about what?
<JonnieCache> lewis1711: sounds about right
<shevy> ruby has only one advantage compared to haskell
<shevy> it is easier to learn
<lewis1711> I asked why ruby couldn't catch incorrectly named methods being called, before they were being called, and you went ballistic
<JonnieCache> lol
rburton- has joined #ruby
<shevy> I have no idea what you refer about
<lewis1711> oh
<shevy> well, haskell *is* popular
crl_ has quit [Client Quit]
<lewis1711> no I just keep trying to find a reason to love dynamic typing
<burgestrand> haskell has the appearance of being popular, I wouldn’t go as far as to say it is
<shevy> and when many people like something, then that thing must have something going for itself
<lewis1711> this isn't about haskell. it;s about the strawman of comparing DT with the ST of languages with poor ST systems
<shevy> even PHP
<lewis1711> which I see too much
<hoelzro> lewis1711: why do you feel a need to find a reason to love dynamic typing?
<shevy> lectrick, but you said it is a good language / good example
<JonnieCache> lewis1711: its just the difference between sketching with charcoal and applying paint to the canvas. its a stylistic thing. you'll never find a hard and fast technical justification for it
<burgestrand> the choice is dynamic
<lewis1711> hoelzro: because there are so many wonderful dynamically typed languages
<burgestrand> :d
arkiver has joined #ruby
<shevy> and we should compare real languages to one another, so haskell on the one side... and [some other language here]
<lewis1711> and by many, I mean.... two or 3
<shevy> ok but let's get specific and compare two languages
<lewis1711> alright
<lewis1711> ruby and scala
freeayu__ has quit [Read error: Connection reset by peer]
<shevy> hmm
<lewis1711> both very OO
<lewis1711> everythings an object
<lewis1711> one very static, the other very dynamic
<hoelzro> lewis1711: well, in my experience, dynamic langauges tend to be more flexible, more inspectable at runtime, they allow metaprogramming, and they typically have a quicker development cycle
<hoelzro> emphasis on 'tend' and 'typically'
<lewis1711> hoelzro: inspectable at run time?
<JonnieCache> scala's type system is so crazy though that you can have quite dynamic behaviour
<shevy> well
<shevy> def isPrime(n: Int) = (2 until n) forall (n % _ != 0)
<lewis1711> yes, I follow
<JonnieCache> union types etc
<hoelzro> lewis1711: yes
<shevy> similar to nimrod, the arguments get to have types
<hoelzro> ex. I can ask a Ruby object "hey, what do you look like? what methods do you support?"
<lewis1711> ahhright
<shevy> actually, optional typing in ruby could be interesting
<banister`sleep> JonnieCache: coursea course on scala starts soon, given by martin ordersky (or whatever the creator is called)
happosade has quit [Read error: Operation timed out]
<JonnieCache> banister`sleep: must make a note of that, cheers
<lewis1711> hoelzro: yeah I often thought that refactoring is faster in DT
<JonnieCache> people keep saying that scala is running aground as a project though
<lewis1711> oh?
<banister`sleep> JonnieCache: whycome
<banister`sleep> JonnieCache: https://www.coursera.org/course/progfun
<JonnieCache> i cant remember the specifics, it was probably just hacker news gossip tbh. i think it was to do with them lacking direction for the next version.
<JonnieCache> oracle's influence may have been involved as well
whowantstolivefo has joined #ruby
<hoelzro> lewis1711: well, I can't really speak to that, because ina static language, you can have the compiler verify that you're not calling certain methods, etc
<lewis1711> that is also true
<JonnieCache> maybe it was to do with them running up agaainst the limited of the jvm's capacity for dynamic dispatch. even with the new invokeDynamic bytecode there is a limitation to how fast it can be
<lewis1711> I like the idea of testing behaviour with unit testing, rather than types with static types (of course it's not one or the other
<hoelzro> some Smalltalk implementations' approaches are interesting
zz_chrismcg is now known as chrismcg
<hoelzro> lewis1711: most DT languages have a fairly pervasive testing culture
<hoelzro> ex. Perl, Ruby
<hoelzro> so once you refactor, run your test suite
<hoelzro> and if it passes, you're good =)
<JonnieCache> lewis1711: yep. if you have 100% coverage on your tests you basically have most of the benefits of static typing
<JonnieCache> wrt to catching errors
t11747 has quit [Remote host closed the connection]
<lewis1711> but not quite all
t15009 has joined #ruby
<hoelzro> lewis1711: indeed not
<JonnieCache> obv not all. it doesnt help you reason while youre writing the code
<lewis1711> the behaviour idea sort of speaks to me
<lewis1711> does it quck like a duck, and all that
vlad_starkov has joined #ruby
bluenemo_ has joined #ruby
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has quit [Read error: Connection reset by peer]
happosade has joined #ruby
shaman42 has quit [Ping timeout: 265 seconds]
freeayu__ has joined #ruby
gavit has quit [Read error: Connection timed out]
shaman42 has joined #ruby
paolooo has joined #ruby
gavit has joined #ruby
<lewis1711> thank you for the rather civil discussion good sirs
<lewis1711> ruby is no longer a ghetto - but leaving your car unlocked anywhere is stupid
<lewis1711> night
lewis1711 has left #ruby [#ruby]
<JonnieCache> haha
pandalike has joined #ruby
<Muz> Zed Shaw ++
<JonnieCache> wasnt it the ruby stdlib that was a ghetto?
<Muz> It was Rails iirc.
<JonnieCache> oh yeah i remember
ciopte7 has joined #ruby
ciopte7 has quit [Client Quit]
<JonnieCache> the "stdlib is a ghetto" thing came later
Xethron has joined #ruby
Xethron has quit [Excess Flood]
<JonnieCache> i reckon _why and zedshaw are evil twins
<JonnieCache> or rather one is the evil twin
<zii> Is there some vim plugin or something to align hash key-values?
Xethron has joined #ruby
<hoelzro> zii: I use Align myself
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
DarthGandalf has quit [Ping timeout: 245 seconds]
<elaptics> zii: Tabular
<hoelzro> elaptics: thanks for your input; I'll have to investigate that one as well =)
adambeynon has joined #ruby
yasushi has quit [Ping timeout: 248 seconds]
DarthGandalf has joined #ruby
burgestrand has quit [Quit: Leaving.]
nari has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jjang has quit [Ping timeout: 244 seconds]
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
d3vic3 has quit [Ping timeout: 246 seconds]
d3vic3 has joined #ruby
tiripamwe has quit [Ping timeout: 256 seconds]
hemanth has quit [Quit: http://h3manth.com]
dr_bob has joined #ruby
ssspiff has quit [Ping timeout: 246 seconds]
bluenemo has quit [Quit: Verlassend]
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
sspiff has joined #ruby
sspiff has joined #ruby
s1n4 has joined #ruby
yuriy has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
himsin has quit [Ping timeout: 246 seconds]
arkiver has quit [Quit: Leaving]
t15009 has quit [Remote host closed the connection]
ezra has joined #ruby
t59369 has joined #ruby
maek has joined #ruby
freeayu3 has joined #ruby
Shrink has quit [Ping timeout: 246 seconds]
vlad_starkov has quit [Remote host closed the connection]
<hoelzro> banister`sleep: uh, no?
Axsuul has quit [Ping timeout: 256 seconds]
freeayu__ has quit [Ping timeout: 240 seconds]
paolooo has quit [Quit: Page closed]
<banister`sleep> i wouldn't admit to it, either
Axsuul has joined #ruby
paolooo has joined #ruby
paolooo has quit [Client Quit]
ephemerian has joined #ruby
gavit has quit [Read error: Connection timed out]
paolooo has joined #ruby
gavit has joined #ruby
timonv has joined #ruby
pandalike has quit [Ping timeout: 246 seconds]
mklappstuhl has joined #ruby
<msch> hi, i've got a string where i need to match a complex regexp via str.scan(/regexp/). now i want to see which parts of the string did not match (so that i can raise an error if something is unmatched that isn't whitespace) how do i best accomplish that? any ideas?
pandalike has joined #ruby
workmad3 has joined #ruby
<apeiros_> msch: use a block and $` (or $' - I always confuse these)
<msch> apeiros_: ah of course! global variables to the rescue!
<mklappstuhl> i have a csv file that starts with a BOM which causes CSV.foreach to break with "illegal quoting"
<apeiros_> mklappstuhl: did you state the encoding?
<apeiros_> (since BOM is only utf-16 and higher)
<mklappstuhl> apeiros_, no I did not. I want to parse multiple files with the same code and I cannot guarantee that they are all utf-16
Shrink has joined #ruby
<msch> apeiros_: hm, but now i have pre/post_match, what do i do with it? i mean i get the same pre/post_match strings no matter if the regexp matched those before or not
<apeiros_> mklappstuhl: an application *can not* determine the encoding on its own
<mklappstuhl> apeiros_, so I''m kind of looking for a "robust" way of handling that
<apeiros_> you *must* supply the encoding
<apeiros_> there is none.
<apeiros_> anything but explicitly providing the encoding is gambling
<Mon_Ouie> If you don't provide the encoding, all you can do is try guessing — which sure isn't robust
<mklappstuhl> apeiros_, and where do I get the encoding fromß
<apeiros_> you can do a bit of heuristics, but nothing absolute.
<apeiros_> mklappstuhl: either you know it, you require it or you need additional user input
<mklappstuhl> well okay that sounds bad
<apeiros_> re heuristics: you can check for the BOM and when present assume utf-16. you can check for valid_encoding? with utf-8 and assume utf-8 if it is valid, you can then go on to check character frequency
<apeiros_> good luck
eataix has quit [Quit: ZNC - http://znc.in]
<apeiros_> reminds me that I wanted to write a byte frequency implementation in C
rburton- has quit [Quit: rburton-]
<mklappstuhl> apeiros_, Isn't BOM there to tell which encoding is used?
<apeiros_> mklappstuhl: no
<apeiros_> BOM is Byte Order Mark
dpk has joined #ruby
<apeiros_> it tells you the byte order
<apeiros_> and you need to know that what you see is indeed a BOM
<apeiros_> because it's first and foremost just 2 bytes
<workmad3> mklappstuhl: also, if the CSV foreach is breaking with 'illegal quoting'... that's probably a malformed CSV file, not a bad encoding...
<apeiros_> but since those 2 bytes will rarely every be at the beginning of a file, you can infer from it that it is likely utf-16 or higher
<apeiros_> workmad3: well, if it reads it as single-byte encoding…
<apeiros_> all those null-bytes can certainly cause odd parsing exceptions
<workmad3> apeiros_: true, it could cause odd parsing exceptions... but I'd probably start by checking if it's a malformed CSV file myself :)
<apeiros_> sure
<apeiros_> got to follow all leads :)
<mklappstuhl> workmad3, did that before asking here of course. I was also able to "confirm" the BOM thing by opening the file in vim doing :set nobomb :wq and retrying
<apeiros_> nobomb, lol :)
<apeiros_> they set us up the bomb!
<apeiros_> aaaah, these were the days…
fermion_ has joined #ruby
<mklappstuhl> so. how does vim know that there is a bom char? I cannot really imagine that this really requires additional input -.-
<hoelzro> mklappstuhl: the BOM is special
<apeiros_> hoelzro: not really.
<apeiros_> it's just unlikely to be something else.
<apeiros_> i.e. - educated guess.
<hoelzro> and Vim assumes that if it sees a combination of two bytes that make up the BOM, it is encoded that way
<apeiros_> see heuristics in scrollback
<hoelzro> apeiros_: fair enough
t59369 has quit [Remote host closed the connection]
t47671 has joined #ruby
<apeiros_> it's fun how often people run against this issue
mike4_ has joined #ruby
<apeiros_> and it's sad that there still is no file container which would store the encoding
erichmenge has joined #ruby
<hoelzro> the BOM issue? or encoding?
<apeiros_> encoding
<hoelzro> encoding is a PITA
<hoelzro> and it's just the tip of the iceberg
<apeiros_> hoelzro: I disagree
<hoelzro> but as hard as it is, it's a really fascinating problem!
<workmad3> probably the most relevent quote from that is: 'If you have a string, in memory, in a file, or in an email message, you have to know what encoding it is in or you cannot interpret it or display it to users correctly.'
<apeiros_> the only PITA is that we have no, or only limited, ways of transporting the metadata
<apeiros_> the moment you save a file the information is gone.
<workmad3> apeiros_: well, the real PITA is that the metadata itself needs to be stored in some encoding...
<apeiros_> the moment you *have* the information, anything else is dead trivial
<workmad3> apeiros_: and then you just move the problem from how to work out the encoding of the data to how to work out the encoding of the metadata :)
<apeiros_> workmad3: not an issue. that's about protocol.
wobr1 has joined #ruby
<workmad3> apeiros_: that assumes you have a single prototcol
<workmad3> *protocol
<apeiros_> yes. and that IS an issue
<apeiros_> (and I said so before - no unified file container)
<workmad3> apeiros_: the encoding issue itself could be sorted out if we had only a single encoding...
<hoelzro> apeiros_: well, perhaps I misspoke
wobr has quit [Read error: No route to host]
<hoelzro> I should say that Unicode is complicated
<apeiros_> workmad3: that will likely not happen in our lifetime :)
<workmad3> hoelzro: it's not particularly complicated
<hoelzro> Unicode is the iceberg of which I speak
<apeiros_> hoelzro: unless you have to implement low level things - no
<hoelzro> I think case folding and collation and all that stuff is pretty complex!
<workmad3> hoelzro: it's just that people don't bother learning even the bare minimum and then start getting things wrong :)
<apeiros_> if you have to do low-level things, like implement a regex library, or a case-changing function - yes
<apeiros_> but even then, unicode provides you means you didn't even have before.
<hoelzro> apeiros_: right, I'm talking about the general problem
<hoelzro> like the work that the commitee and implementors have to do to make sure they get it right
<workmad3> hoelzro: once people stop assuming that string data has some implicit meaning that doesn't require an encoding...
<apeiros_> yes, but that's 0.00001% of all developers who have to be concerned
<apeiros_> *you* and *I* don't have to care about that. we get the libs based on their work
<workmad3> hoelzro: or even that *any* data has an implicit meaning and doesn't require an encoding...
<hoelzro> apeiros_: right
<hoelzro> I guess I'm trying to say that I appreciate the difficulty imposed on others, not myself
<hoelzro> workmad3: agreed
<mklappstuhl> I'm porting this csv stuff from php. and we did not handle any encoding there at all
<workmad3> mklappstuhl: so it only worked by fluke is what you're saying
<mklappstuhl> workmad3, yeah kind of
<apeiros_> hoelzro: ok, that part I agree. there's shitloads of knowledge in unicode
jenrzzz has joined #ruby
<workmad3> mklappstuhl: read that joel article then ;)
<mklappstuhl> so any recommendations how to progress? check file for BOM -> utf-16 otherwise utf-8
maek has left #ruby [#ruby]
<mklappstuhl> workmad3, I just put it on my read it later list. (which I actually read later)
wereHams1er is now known as wereHamster
geekbri has joined #ruby
Criztian has joined #ruby
<apeiros_> mklappstuhl: as said, you can use https://github.com/apeiros/tables/blob/master/lib/tables/detection.rb to see how one could go about guessing
rburton- has joined #ruby
philips_ has quit [Excess Flood]
<apeiros_> I don't have utf-16 as a case, but that'd indeed be a check for the BOM prior to the present guessing
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
tvw has joined #ruby
<apeiros_> but note that I developed it with the specific needs I had (i.e., western env with a huge chance of the encoding being either win1252 or macroman)
philips_ has joined #ruby
nateberkopec has joined #ruby
liluo has quit [Remote host closed the connection]
nanderoo has joined #ruby
quazimodo has quit [Remote host closed the connection]
Bofu has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 252 seconds]
flojistik is now known as Phlogistique
b26 has joined #ruby
k_89 has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
ctp- has quit [Quit: Linkinus - http://linkinus.com]
sspiff has quit [Remote host closed the connection]
clocKwize has quit [Quit: clocKwize]
banseljaj is now known as imami|afk
gavit has quit [Read error: Connection timed out]
chussenot has joined #ruby
sepp2k has joined #ruby
gavit has joined #ruby
vlad_starkov has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
ly_gs has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
rburton- has quit [Quit: rburton-]
vlad_starkov has quit [Ping timeout: 245 seconds]
bluenemo_ has quit [Remote host closed the connection]
<ksk> hi
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
joephelius has quit [Ping timeout: 246 seconds]
<m4rtijn> hi ksk
<ksk> how to find something about things like "=,==,=~" at ruby docs? some hint?
<m4rtijn> google ruby doc operators ..
<m4rtijn> maybe
MarioEIU has joined #ruby
<ksk> thanks
PapaSierra has joined #ruby
b26 has quit [Read error: Connection reset by peer]
<m4rtijn> here is one
`brendan has joined #ruby
<PapaSierra> learning ruby. what is this called thing[:otherthing] ? is it an array being referenced? or is it an object?
<m4rtijn> PapaSierra, everything in ruby is an object
Banistergalaxy has joined #ruby
<banister`sleep> PapaSierra: that looks like a hash
<PapaSierra> ok so how do i initialise a brand new hash object?
<banister`sleep> PapaSierra: my_hash = {} :)
<m4rtijn> PapaSierra, without the :)
<m4rtijn> PapaSierra, thats optional
<PapaSierra> i was going to ask ;) ok, it totally worked
kvirani has joined #ruby
<PapaSierra> i'm trying to refactor some ruby code (chef) without actually knowing ruby! took me an hour to initialise a hash, but now all is working great :)
<mklappstuhl> apeiros_, still can't get it to work even when specifying encoding:
<mklappstuhl> CSV.foreach(@csvpath, {:headers => true, :return_headers => false, :encoding => "UTF-16:UTF-8" }) do |row|
<apeiros_> mklappstuhl: I had issues with csv when I let the library read the file
<apeiros_> try using File.read with encoding and feeding that to the CSV lib
<apeiros_> I'm sorry, I never had the time to actually figure out the issue
diegoviola has joined #ruby
<diegoviola> hi
liluo has joined #ruby
<diegoviola> i want to run some code in a child process, fork() works but i want to avoid getting many child process as i call the same action, i want that code to execute once in the child process and then kill the process and keep going with the rest of my code, any ideas how to achieve that?
<mklappstuhl> apeiros_, Ok I'll give that a try
fermion_ has quit [Quit: Computer has gone to sleep.]
gavit has quit [Read error: Connection timed out]
nu7hatch has joined #ruby
gavit has joined #ruby
Progster has joined #ruby
joephelius has joined #ruby
freeayu3 has quit [Ping timeout: 244 seconds]
jrajav has joined #ruby
verto|off is now known as verto
erichmenge has joined #ruby
<mklappstuhl> apeiros_, did I get that right that the file is very likely encoded in UTF-16 when it starts with U+FEFF?
theRoUS has quit [Read error: Operation timed out]
Markvilla has joined #ruby
freeayu3 has joined #ruby
niklasb has joined #ruby
pandalike has quit [Remote host closed the connection]
ezra has quit [Ping timeout: 276 seconds]
freeayu3 has quit [Read error: Connection reset by peer]
freeayu3 has joined #ruby
fastred has joined #ruby
ezra has joined #ruby
iori has quit [Remote host closed the connection]
kpshek has joined #ruby
<mklappstuhl> apeiros_, had do use UTF-16BE instead of UTF-16 — don't have any idea what the BE stands for though
<JonnieCache> the new windows 8 theme is almost exactly the same as the whistler theme from the XP betas back in 2000
<JonnieCache> its only taken ms 12 years to realise that was the best one
<JonnieCache> HAHAHAHAHAAHAHAHA
wpaulson has joined #ruby
Markvilla has quit [Ping timeout: 265 seconds]
fastred has quit [Client Quit]
fbernier has joined #ruby
vlad_starkov has joined #ruby
<JonnieCache> i wonder if ballmer actually realises how much blame there is on his head, for singlehandedly destroying the worlds most successful company
<JonnieCache> somehow i doubt he sees it that way
TheFuzzball has quit [Disconnected by services]
sspiff has joined #ruby
sspiff has joined #ruby
Markvilla has joined #ruby
TheFuzzb_ has joined #ruby
workmad3 has joined #ruby
<mklappstuhl> Okay, UTF-16BE gives me loads of chinese stuff but not the real stuff
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
vectorshelve has quit [Quit: Page closed]
tommyvyo has joined #ruby
luckman212_ has joined #ruby
luckman212 has quit [Ping timeout: 260 seconds]
clocKwize has joined #ruby
Konboi has quit [Remote host closed the connection]
ezra has quit [Ping timeout: 276 seconds]
nwest has joined #ruby
wpaulson_ has joined #ruby
wpaulson has quit [Read error: No route to host]
wpaulson_ is now known as wpaulson
nohonor_alt has quit [Ping timeout: 244 seconds]
ctp has joined #ruby
pu22l3r has joined #ruby
ctp has quit [Client Quit]
<apeiros_> mklappstuhl: that's exactly what the BOM is about
<apeiros_> BE means BigEndian
linoj has joined #ruby
<apeiros_> and the BOM tells you whether it's utf-16 in BE or in LE (little endian)
pu22l3r has quit [Remote host closed the connection]
<mklappstuhl> apeiros_, yeah, noticed that few minutes ago
<apeiros_> so you should not just make it utf-16be, but rather depend on the BOM, which it is
pu22l3r has joined #ruby
<apeiros_> you may want to study this: http://de.wikipedia.org/wiki/Byte_Order_Mark
<mklappstuhl> unfortunately if I use BE or LE makes no difference (asian gibberish)
<mklappstuhl> apeiros_, If the file is opened in textmate it displays the windows-1252 representation of the UTF-8 BOM
<mklappstuhl> If I open the file in less it displays U+FEFF though
<workmad3> heh, still having encoding 'fun'?
<apeiros_> *sob*
nohonor has joined #ruby
<apeiros_> mklappstuhl: learn. how. encodings. work. seriously. the link workmad3 gave you should give you a headstart.
<apeiros_> there's no use if you're guessing around and don't understand what's going on.
<apeiros_> and yeah, some editors are not reliable. don't know whether TM is one of them.
<apeiros_> but iirc you can tell TM in what encoding to open a file.
<mklappstuhl> apeiros_, I read the joel article
gilead has quit [Quit: Leaving]
jgarvey has joined #ruby
GoGoGarrett has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<mklappstuhl> And where did I make a guess? I just tried BE/LE to make sure it's none of them ...
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<mklappstuhl> (and yeah I could have read that on the wiki page beforehand)
<apeiros_> and of course, nothing protects you from broken/invalid files
gilead has joined #ruby
<apeiros_> as said, if you don't know the encoding, the best you've got is guesses, and guesses are just that much harder with broken data.
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
v0n has joined #ruby
iamjarvo has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
sailias has quit [Quit: Leaving.]
niklasb has quit [Ping timeout: 246 seconds]
andrewhl has joined #ruby
Xethron has quit [Changing host]
Xethron has joined #ruby
_JamieD_ has joined #ruby
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<shevy> Encoding is a lot of fun
hynkle has joined #ruby
<matti> No ;/
<shevy> :D
suppp has joined #ruby
<suppp> :D
t47671 has quit [Remote host closed the connection]
localhost has joined #ruby
localhost has quit [Excess Flood]
<workmad3> matti: what? you don't find encodings 'fun'? :P
t38980 has joined #ruby
Squarepy has joined #ruby
<m4rtijn> we build a mail parser once.. and had a lot of fun with encoding
<matti> workmad3: I believe that UTF et al were invented to evil forces as a form of divine punishment.
<matti> s/to/by/
Jimmitos has joined #ruby
nacengineer has quit [Quit: Leaving.]
<dr_bob> i18n is one of the areas which IT industry has completely neglected far too long - that's why it is so quirky nowadays.
nacengineer has joined #ruby
Squarepy_ has joined #ruby
cjk101010 has quit [Ping timeout: 272 seconds]
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
<matti> Yeah.
carloslopes has joined #ruby
<joephelius> sadly
prtksxna has joined #ruby
<dr_bob> me other favorite in that discipline is arbitrary file metadata: if that were introduced in file systems a while ago there would not have to be all those workarounds like program "file", three letter extensions etc. Funnily encodings then could also be stored in a standard way...
<dr_bob> Maybe in a parallel universe
Squarepy has quit [Ping timeout: 244 seconds]
<dr_bob> sigh
<jrajav> Speaking of encoding
<jrajav> Someone tell me why al2o3cr chokes on Unicode
<jrajav> :(
<dr_bob> s/^me/my/
<jrajav> >> "〠"
<al2o3cr> -e:1:in `eval': (eval):1: invalid multibyte char (US-ASCII) (SyntaxError), (eval):1: invalid multibyte char (US-ASCII), from -e:1:in `<main>'
<mklappstuhl> anyone here an idea how I can have thor tasks not in the directory I'm executing thor from?
<jrajav> A cookie to the one who gets it
<mklappstuhl> (similar to /lib/tasks for rake)
m4rtijn has quit [Remote host closed the connection]
fowl has joined #ruby
erichmenge has quit [Quit: Be back later]
uris has joined #ruby
<jrajav> dr_bob: OS X ftw?
gavit has quit [Read error: Connection timed out]
<jrajav> dr_bob: (Resource forks)
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
<dr_bob> jrajav: NTFS and ext4 have it, too. That's not the point. The point is that there is no standard.
gavit has joined #ruby
<dr_bob> And that these were introduced so late that all sorts of workarounds had to be invented which we don't get rid of now.
jeff_sebring has quit [Quit: Leaving]
<dr_bob> If there was a standard, you could cp /ntf/file/system/file /ext4/file/system and be sure the type, encoding and other information is retained. You could also tar files and have their metadate along the way etc.
infinitiguy has joined #ruby
<apeiros_> jrajav: because US-ASCII != binary (aka ascii-8bit, which is a horrible name)
verto is now known as verto|off
<apeiros_> jrajav: US-ASCII is 7bit only
<jrajav> Okay..?
<jrajav> The issue here is mainly that I'm not assuming any encoding in my own code
<jrajav> Or if I am I have no idea where
<apeiros_> you probably want to add '-E', 'utf-8:utf-8' to your spawn
<apeiros_> alternatively: '-E', 'binary:binary'
<apeiros_> the latter is probably "safer"
kaen has joined #ruby
al2o3cr has quit [Remote host closed the connection]
<jrajav> Bot going down for a few minutes to try it
pen has joined #ruby
<jrajav> al2o3cr: :|
al2o3cr has joined #ruby
cantbecool has joined #ruby
al2o3cr has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
Tyler__ has joined #ruby
t38980 has quit [Remote host closed the connection]
t4736 has joined #ruby
QKO_ has joined #ruby
<jrajav> apeiros_: Wow, you weren't kidding. binary works great, but utf-8 makes the script splode at String#split
tfittsy has quit [Ping timeout: 245 seconds]
<jrajav> I shouldn't say binary works "great" actually, but at least it doesn't choke on it anymore
al2o3cr has joined #ruby
<jrajav> >> "〠"
<al2o3cr> (String) "\xE3\x80\xA0"
<jrajav> See?
jrist-afk is now known as jrist
Inoperable has joined #ruby
twock has joined #ruby
qko has quit [Ping timeout: 252 seconds]
wallerdev has joined #ruby
erichmenge has joined #ruby
asobrasil has joined #ruby
twock has quit [Client Quit]
<lectrick> oh dear. someone went and hacked Haskell list comprehensions into ruby. https://gist.github.com/3356675
<matti> LOL
cjk101010 has joined #ruby
SCommette has joined #ruby
internet_user has joined #ruby
freeayu3 has quit [Ping timeout: 240 seconds]
interne__ has joined #ruby
brasten has joined #ruby
<fowl> o_O
gavit has quit [Read error: Connection timed out]
<monobit_> i want to check for a nil return; will "if !returned_array" work?
gavit has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<fowl> yes
internet_user has quit [Ping timeout: 240 seconds]
<monobit_> i think i want to use .empty? or .nil?; in my case the return is actually an array sized one which is a bummer
<fowl> or if returnval.nil?
companion_ has joined #ruby
crodas has quit [Ping timeout: 272 seconds]
<monobit_> the return is [[nil]]
williamcotton_ has joined #ruby
<JonnieCache> returnval.flatten.empty?
fridim_ has quit [Ping timeout: 246 seconds]
stopbit has joined #ruby
williamcotton has quit [Ping timeout: 246 seconds]
williamcotton_ is now known as williamcotton
<monobit_> well returnval[0][0].empty? worked but I have a feeling I'm missing an edge case; returnval.flatten.empty? does not work
companion has quit [Ping timeout: 246 seconds]
companion_ is now known as companion
companion has quit [Changing host]
companion has joined #ruby
<monobit_> test.flatten
<monobit_> => [nil]
freeayu has joined #ruby
jonathanwallace has joined #ruby
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
gmci has joined #ruby
crodas has joined #ruby
johnlcox has joined #ruby
t4736 has quit [Remote host closed the connection]
t45136 has joined #ruby
companion has quit [Ping timeout: 246 seconds]
ph^ has quit [Remote host closed the connection]
companion has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
xaq has joined #ruby
cloud|droid has quit [Quit: Leaving]
maxmmurphy has joined #ruby
shachaf has joined #ruby
sailias has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
jrajav has quit [Quit: The best darkness is strange and surprising]
monobit_ is now known as asteve
<fowl> asteve: #compact to kill the nil
<asteve> fowl: thanks, that's exactly what i did
fastred has joined #ruby
gmci has quit [Ping timeout: 252 seconds]
berserkr has joined #ruby
Inoperable has quit [Quit: Rectified]
freeayu has quit [Quit: 离开]
Inoperable has joined #ruby
fridim_ has joined #ruby
zodiak has joined #ruby
codeFiend has joined #ruby
gmci has joined #ruby
Topcat has joined #ruby
apok has joined #ruby
Topcat has left #ruby [#ruby]
indian has joined #ruby
<shevy> hmm
tomsthumb_ has quit [Quit: Leaving.]
<shevy> is there a way to never come to the point where one thinks "rewriting this is never required"?
justinmcp has joined #ruby
<shevy> because those rewrites seem to take longer than starting the same project from 0 :(
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
emsilva has joined #ruby
emsilva has joined #ruby
emsilva has quit [Changing host]
<lectrick> rking: what... what is this? :)
bbttxu has joined #ruby
bbttxu has quit [Read error: Connection reset by peer]
bbttxu has joined #ruby
<Mon_Ouie> Code to parse C structure definitions in Ruby
Fraeon has quit [Remote host closed the connection]
enroxorz-work has joined #ruby
enroxorz-work has quit [Changing host]
enroxorz-work has joined #ruby
goyox86 has joined #ruby
<enroxorz-work> I am having the hardest time thinking up a way to tackle this issue. I have two arrays of hashes. I need to iterate through both arrays, find similar hashes based off keys, then compare the hashes. This comes from a need to compare two excel sheets.
lolmaus has quit []
<shevy> can you make a tiny example subset and put this on pastie.org
foofoobar has joined #ruby
<foofoobar> Hi
<shevy> with like only 3 or 4 entries at max
<enroxorz-work> shevy: I shall do you one better. Will paste my library
<foofoobar> I have a "simple proxy" built with webrick. Now I want a sinatra apps running parallel to this do serve some static content etc.
<enroxorz-work> Again, its messed up
<foofoobar> How can I start this parallel?
_fmm has joined #ruby
mahmoudimus has joined #ruby
<shevy> enroxorz-work, less paste is better than more paste ;)
<enroxorz-work> shevy: then hell, let me re pastie
tagrudev has quit [Remote host closed the connection]
<shevy> where is it!
<shevy> hehehe
<enroxorz-work> shevy: http://pastebin.com/t4ZqGBMS
<enroxorz-work> lol
<shevy> ewww pastebin ;(
<enroxorz-work> sorry, im just used to it
<shevy> pastie.org has such nice colours
<enroxorz-work> fine
<shevy> http://pastie.org/4521713 repasted, looks better now :P
<JonnieCache> shevy: check out http://hastebin.com/
<JonnieCache> v pretty
<shevy> well that is your code enroxorz-work but where is the data?
<shevy> use pp
<shevy> require 'pp'; pp array
<enroxorz-work> the data comes from two spreadsheets.
Synthead has joined #ruby
<shevy> cool JonnieCache
<enroxorz-work> pp?
<shevy> pp is pretty print
t45136 has quit [Remote host closed the connection]
<shevy> load data into ruby structures, then pp that object
<asteve> pp has become irritating "pp array" is really "pp array; nil"
<shevy> pp hash
<shevy> pp array
t22464 has joined #ruby
<shevy> JonnieCache that's a slick interface
<JonnieCache> more people should use it
<enroxorz-work> so pp array and pp hash and my crappy code wont explode?
<shevy> one could have this on the www where you could connect things, like on a desktop, just all in the browser :)
<shevy> enroxorz-work, no sorry. I dont know what your code wants to do, my brain can't work without a data structure to begin with
<shevy> cant you just load the excel thing, then do pp on it?
<enroxorz-work> ok, i will paste everything
<enroxorz-work> gimme a second
<shevy> !
<shevy> only need a small subset
<shevy> but ok
<foofoobar> any hints for me?
Inoperable has quit [Quit: Rectified]
axl_ has joined #ruby
<shevy> what was your question
<shevy> ah
<shevy> proxy with webrick and sinatra. sorry, no idea at all. perhaps #sinatra guys could help
kvirani has quit [Remote host closed the connection]
<enroxorz-work> LOC 12-19 is my pain
Inoperable has joined #ruby
<apeiros_> yeeeah, codesnake
<enroxorz-work> somehow it ballons to 2 gigs and the original excel spreadsheets only come up to 20 MB each
<apeiros_> death to structuring plain text!
<rcassidy> sorry to be repeating my Qs from yesterday! - but has anyone been using apache thrift and eventmachine together?
<enroxorz-work> there is a memory leak that I cant see.
<JonnieCache> foofoobar: webrick is a piece of crap. nginx for your proxying duties, then put sinatra behind that
Squarepy_ is now known as Squarepy
mjb2k has joined #ruby
<shevy> enroxorz-work looks like you got several problems :D
<rking> enroxorz-work: Why would you check .diff when left_row[key] == right_row[key] ?
<foofoobar> JonnieCache: It's a heavy customized proxy, so WEBRick is a good choice I think
<enroxorz-work> because within left_row[key] and right[row] key are a ton of other cells i need to compare
<apeiros_> enroxorz-work: use a hash, assuming eql? is good enough for you (instead of ==)
<rking> enroxorz-work: That's really weird semantics. I wouldn't expect a == b but then members of a to != b.
gavit has quit [Read error: Connection timed out]
<JonnieCache> foofoobar: be warned though, webrick is basically a toy
<JonnieCache> its not meant for serious use
<rking> Oh, nevermind, I'm being so dumb.
<foofoobar> JonnieCache: why?
gavit has joined #ruby
<foofoobar> JonnieCache: It saves a lot of time because I do not have to write a proxy on my own
<foofoobar> And it's easy customizable
<workmad3> foofoobar: you're just doing a proxy to another service?
<workmad3> foofoobar: why not just use apache?
<foofoobar> workmad3: no
<workmad3> foofoobar: or nginx?
<enroxorz-work> so the original problem is I have two excel sheets. Rows from left have to be in right, and data must match. All data on both is seriously screwed up with spacing and formatting, so I had to improvise just so I can compare. They want all differing data points through out the whole wooksheet
<foofoobar> the "proxy" modifies the request/response
<foofoobar> so it's not a normal proxy
<workmad3> foofoobar: that depends on how it modifies the request/response
<lectrick> How do I make a class monkeypatch that only works within blocks passed to a special method?
<workmad3> foofoobar: reverse proxies modify the request and response in limited ways after all ;)
<workmad3> foofoobar: sounds more like a filter than a proxy though...
<foofoobar> Yeah, kind of
<foofoobar> I think I'm fine with WEBRick. I'm not looking for a different solution the webrick. I'm looking for a way how to run a WEBRick-proxy and a sinatra app parallel
<workmad3> foofoobar: still... webrick is a very poor ruby app server
<foofoobar> They should interact in some way
<foofoobar> workmad3: but it fits my needs, so why looking for something different?
<foofoobar> it has to handle just a very little amount of request, it's okay I think
araujo has quit [Remote host closed the connection]
<workmad3> foofoobar: because I wouldn't trust webrick in production to not do weird crap
<workmad3> foofoobar: I only barely trust it as a dev server
elhu has quit [Ping timeout: 252 seconds]
<workmad3> foofoobar: that said, it's *really* easy to just write a ruby rack app and mount it on any one of several very good ruby app servers
<workmad3> foofoobar: including webrick if you really want to... but it's not advised :P
localhost has joined #ruby
localhost has quit [Excess Flood]
gfontenot has joined #ruby
elhu has joined #ruby
ph^ has joined #ruby
<foofoobar> workmad3: okay
joshman_ has joined #ruby
<foofoobar> I will think over it, but I think I'm fine with my current solution
DeeJayTwo has joined #ruby
<foofoobar> it does not have to be a "bullet proof web server"
<foofoobar> it just has to do some "filtering"
<DeeJayTwo> hi.. I need to install a gem but also I need to specify an include dir to look for header files...
<DeeJayTwo> How can I do that?
localhost has joined #ruby
<foofoobar> and I don't want an additional ruby app server running
<JonnieCache> the other thing is, sinatra isnt a webserver
<hoelzro> DeeJayTwo: header files? like C header files?
katherinem13 has quit [Quit: katherinem13]
<DeeJayTwo> hoelzro : right
<DeeJayTwo> Need to do something like this:
<DeeJayTwo> gem install sqlite3 -v '1.3.6' --with-sqlite3-include /usr/local/include
katherinem13 has joined #ruby
<DeeJayTwo> But it's obviously not the way to go...
ezra has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
ringotwo has joined #ruby
apeiros_ has quit [Remote host closed the connection]
beneggett has joined #ruby
t22464 has quit [Remote host closed the connection]
jrajav has joined #ruby
t59737 has joined #ruby
classix has quit [Remote host closed the connection]
apeiros_ has joined #ruby
mjb2k has quit [Quit: mjb2k]
mikepack has joined #ruby
qwerxy has joined #ruby
<enroxorz-work> shevy: So I said screw the fancy Modularization and whatnot, and went to a simpler script
GMFlash has joined #ruby
<enroxorz-work> .eql? is saving me too apeiros_
<GMFlash> when you're writing about class and instance methods, what is the convention to represent them? for example: Foo#bar is a class method and foo.save is an instance method.
<GMFlash> basically, is that the correct way to say it or is there a different way?
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
Jay_Levitt has joined #ruby
Jay_Levitt has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
apeiros_ has quit [Ping timeout: 256 seconds]
<diegoviola> i want to spawn a child process from a running rails app and do something in that child process, then when the child process is done processing the code, exit and keep doing whatever is next in the parent process, but i also want to avoid spawning many child processes when i hit the its action multiples times, how do i avoid this?
<diegoviola> should i check if the pid already exists or?
<diegoviola> i'm trying to create background jobs, but i don't want a queue
<JonnieCache> why dont you want a queue? queues are great
<JonnieCache> what youre describing will work, but 80% of the way through tearing your hair out trying to implement it, you will suddenly realise you wanted a queue all along
maesbn has quit [Remote host closed the connection]
Squarepy has quit [Read error: Connection reset by peer]
<lectrick> So does anyone know how I can have changes to a class only visible/active within a block?
Squarepy has joined #ruby
<lectrick> Let's say I want to add a new kind of + to Arrays, but only inside a block I pass to a special method
<diegoviola> JonnieCache: i actually don't mind having a queue, i just want something simple and something easy to implement
maxmmurphy has quit [Quit: maxmmurphy]
<diegoviola> any ideas?
stopbit has quit [Read error: Connection reset by peer]
<lectrick> diegoviola: You want queues.
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
Fraeon has joined #ruby
stopbit has joined #ruby
tomsthumb_ has joined #ruby
<diegoviola> ok so i need something like delayed job?
stopbit has quit [Read error: Connection reset by peer]
<diegoviola> or resque
stopbit has joined #ruby
<JonnieCache> yep
<JonnieCache> railscasts did some good ones on this stuff recently
<diegoviola> ok ty
qwerxy has quit [Quit: offski]
Eplemosen has joined #ruby
davidcelis has quit [Quit: K-Lined.]
nullsign_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
qwerxy has joined #ruby
ananthakumaran has joined #ruby
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<nullsign_> i need to make a simple 2 column lookup table in ruby, with about 2,000 to 5,000 rows; is there a quick and easy way to do this with a static array and a csv?
graspee has joined #ruby
peterhellberg has quit [Remote host closed the connection]
foofoobar has quit [Quit: bb]
Jay_Levitt has joined #ruby
gilead has quit [Quit: This computer has gone to sleep]
qwerxy has quit [Client Quit]
<ksk> hi again... is there a limitation of the number of entries of an array in ruby? my "logfile-analyzer" works with an inputfile of 1000 lines, but says "`<main>': undefined method `[]' for nil:NilClass (NoMethodError)" if I try with 10k (and the "real" logfile has even much more entries...)
justsee has quit [Quit: Leaving...]
ckrailo has joined #ruby
kvirani has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
eldariof has quit [Ping timeout: 268 seconds]
x77686d has joined #ruby
x77686d has quit [Client Quit]
erichmenge has joined #ruby
x77686d has joined #ruby
<nullsign_> i need to make a simple 2 column lookup table in ruby, with about 2,000 to 5,000 rows; is there a quick and easy way to do this with a static array and a csv?
dtribble has joined #ruby
darren_ has joined #ruby
x77686d has quit [Client Quit]
indian has quit [Ping timeout: 245 seconds]
gavit has quit [Read error: Connection timed out]
baroquebobcat has joined #ruby
gavit has joined #ruby
andrewhl has quit [Remote host closed the connection]
bluenemo has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
<ksk> graspee: yap, i found this already. thx. but i dont think that this i the problem, the error occurs if i want to load an 302K file into an array, too :X
wallerdev has joined #ruby
bluenemo has joined #ruby
savage- has quit [Remote host closed the connection]
t59737 has quit [Remote host closed the connection]
t46132 has joined #ruby
haxrbyte has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
<graspee> sorry then
virunga has joined #ruby
<graspee> does the 10k fail at the start before reading anything or does it fail when it gets up to a particular number?
wobr1 has quit [Ping timeout: 248 seconds]
justinmcp has quit [Remote host closed the connection]
_Twin has joined #ruby
peregrine81 has joined #ruby
darren_ has quit [Remote host closed the connection]
Guest55732 has quit [Quit: leaving]
Vert has quit [Ping timeout: 252 seconds]
<ksk> if i knew that :X
classix has joined #ruby
berserkr has quit [Quit: Leaving.]
khakimov has joined #ruby
luxurymode has joined #ruby
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
bluOxigen has quit [Ping timeout: 244 seconds]
<ksk> is there maybe a limited number of entries in an array? i do array.push in the line that throws this error
Jimmitos has quit []
Z_Mass has joined #ruby
<JonnieCache> ksk: its limited by your system memory
<JonnieCache> theres no hard limit
<JonnieCache> you'll never get a specific error either, when it starts running out your app will just start going a bit crazy
<ksk> mhhm, but i get one..
<graspee> ksk: can't you just use a debug print to see how many it has read in before failing?
invsblduck has joined #ruby
<JonnieCache> if you need a REALLY REALLY FUCKING BIG array, put it into redis
<JonnieCache> thats what its for
<JonnieCache> ksk: actually there is a specific error msg i was wrong on that
Squarepy has quit [Changing host]
Squarepy has joined #ruby
apeiros_ has joined #ruby
carloslopes has quit [Quit: Leaving.]
<JonnieCache> but yeah just use redis, thats why it exists
captproton has joined #ruby
arturaz has quit [Ping timeout: 246 seconds]
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
glistle has joined #ruby
captproton has quit [Client Quit]
axl__ has joined #ruby
Rhainur has left #ruby ["Leaving"]
<ksk> i cannot accept this :P but thanks for your time!
axl_ has quit [Ping timeout: 245 seconds]
axl__ is now known as axl_
ken_barber has joined #ruby
brianpWins has quit [Quit: brianpWins]
Yu\2 has quit [Quit: Leaving]
troessner has joined #ruby
<JonnieCache> holy shit textmate is now open source
<JonnieCache> how did i miss that?
mengu has joined #ruby
shevy has quit [Ping timeout: 244 seconds]
_Twin has quit [Quit: !quit]
<lectrick> Not sure it was all over the geek internets
MarioEIU has quit [Ping timeout: 246 seconds]
<ksk> you proabably use the wrong irc-channels :P
ScottNYC has joined #ruby
<lectrick> I think it sat on the frontpage of Hacker News all week
<JonnieCache> ah was it last weekend?
<JonnieCache> i was dancing in a field
<JonnieCache> from thursday to monday
<lectrick> Also subscribe to ruby-weekly email list, helps keep up with stuff, they mentioned it in there
<lectrick> So can someone tell me how I can add special behavior to the Array class that only works inside a block?
Monie has joined #ruby
Monie has joined #ruby
Monie has quit [Changing host]
<hoelzro> lectrick: I didn't think you could
jrajav has quit []
<JonnieCache> can you inspect binding to see if its a block or not?
<lectrick> I want a method called 'incredible' that will let me do: incredible { [].special_method } and it will work
<JonnieCache> tbh it all sounds like a bad idea
<lectrick> hoelzro: It is possible, I am sure of it
maxmmurphy has joined #ruby
qko has joined #ruby
<JonnieCache> ah actually maybe thats not such a bad idea
<JonnieCache> you mean so you can stop your core extensions polluting the entire environment?
<lectrick> JonnieCache: hahaha, well among other possible uses...
<hoelzro> I thought I read about a feature like that that was recently added
<hoelzro> hang on
qwerxy has joined #ruby
<JonnieCache> there was something like that proposed for ruby 2.0 called "refinements"
<hoelzro> that's it
<hoelzro> refinements
<JonnieCache> dunno if its going to happen or not
benson has joined #ruby
<hoelzro> I knew it began with 'r'!
<lectrick> JonnieCache: I think this is sort of the yehuda katz idea with regards to "refinements"
mahmoudimus has joined #ruby
<ScottNYC> anyone know how to uninstall ruby-build, the rbenv plugin on mac osx? I origionally installed it by pulling it from github but I want to install using homebrew instead
<lectrick> ah crap i'm too slow
timonv has quit [Remote host closed the connection]
<lectrick> but there is a way to have refinement-like functionality, right now
<JonnieCache> ScottNYC: theres just a plugins dir or something under the rbenv dir. its like one file
QKO_ has quit [Ping timeout: 265 seconds]
<JonnieCache> ScottNYC: you could also look at the script you used to install ruby-build and see where it put it
davidcelis has joined #ruby
<lectrick> crap. refinements is cool. I hope it goes in. It would do exactly what I'm looking for.
<ScottNYC> jonnieCache so deleting the ruby-build folder will uninstall the plugin? then Ill be able to reinstall using homebrew with out any issues you think?
gavit has quit [Read error: Connection timed out]
hero has joined #ruby
hero has joined #ruby
<infinitiguy> how can I pass a variable between instances? for example - I have a class - requires a util.rb I wrote that gets hostname and IP. I have a child class that inherits the parent and actually gets the hostname and IP. I'm currently setting those to instance variables within the child class. How can I get those to be able to be printed within another script that requires myclass.rb?
gavit has joined #ruby
savage- has joined #ruby
hoelzro is now known as hoelzro|away
axl_ has quit [Read error: Connection reset by peer]
<fowl> infinitiguy: attr_reader?
<Mon_Ouie> What you're saying sounds pretty confusing; show the actual code
<infinitiguy> yep - 1 min
axl_ has joined #ruby
brdude has joined #ruby
andrewhl has joined #ruby
<fowl> hola Mon_Ouie
<fowl> como te llama
erichmenge has quit [Quit: Be back later]
shevy has joined #ruby
mklappstuhl has quit [Ping timeout: 265 seconds]
<infinitiguy> utils rb has a get hostname and getip method im requiring that in my class Loadbalancer which is a parent to class AWS
<infinitiguy> class AWS actually uses the methods in the util.rb and I'm using the client test code to see if I can actually get those results from the AWS class back
dhruvasagar has joined #ruby
<infinitiguy> when I switched myip to a global variable I was able to see it - but I read last night that global variables are not commonly used
<infinitiguy> so I'm not sure if that's the right approach
axl_ has quit [Ping timeout: 265 seconds]
dr_bob has quit []
haxrbyte has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
ringotwo has quit [Remote host closed the connection]
hero has quit [Ping timeout: 260 seconds]
adamkittelson has joined #ruby
Phibs has left #ruby [#ruby]
<shevy> infinitiguy global variables are global wherever they are
axl_ has joined #ruby
<shevy> that makes containing them or controlling them hard
Stalkr_ has joined #ruby
Stalkr_ has quit [Changing host]
Stalkr_ has joined #ruby
<Mon_Ouie> Don't think of it in terms of files, just of classes. The file where you define a class has no importance to Ruby.
codeFiend has quit [Read error: Connection reset by peer]
aeontech has joined #ruby
<infinitiguy> I'm also wondering if I should be including the files that contain my classes and not requiring them
brdude has quit [Ping timeout: 244 seconds]
luxurymode has quit [Read error: Connection reset by peer]
<Mon_Ouie> And that code is just really confusing; your Nx_util doesn't seem to need to be a class, as an Nx_util object seems to have pretty much no purpose
Z_Mass has quit [Quit: Leaving]
<Mon_Ouie> You can't "include" files
dhruvasagar has quit [Ping timeout: 260 seconds]
<diegoviola> do i need to execute the jobs in resque manually? or they will get executed automatically as soon as they get into the queue?
mxbtty has joined #ruby
luxurymode has joined #ruby
i0n has joined #ruby
<Mon_Ouie> You can include modules, but that has nothing to do with loading code
<infinitiguy> the code is being driven from someone else that wants to have things very separated out which is why I have a utils class
<infinitiguy> im finding the whole thing very daunting and confusing :(
Stalkr_ has quit [Client Quit]
Eplemosen has quit [Quit: NOPE]
<Mon_Ouie> Having code separated isn't a problem; but there isn't a single way to do that. You could use a module with module functions
randomautomator has joined #ruby
liluo has quit [Remote host closed the connection]
<Mon_Ouie> Another thing that looks pretty terrible is the way you handle errors in Nx_util#getip
<fowl> why do we fall?
Speed has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
<infinitiguy> yea that still needs work
<Mon_Ouie> Exceptions provide the user of the code with the information they need to understand the problem. Rescuing every exception you see and exiting upon them is a very intrusive behavior, and makes it harder to handle them properly
clocKwize has quit [Quit: clocKwize]
<Mon_Ouie> Remove the whole rescue clause from there and raise an exception when "no valid iface is defined"
tds has joined #ruby
t46132 has quit [Remote host closed the connection]
tds is now known as Guest49175
<lectrick> This is crazy but I feel like it is possible to add "refine Class do" to Ruby 1.9.3, although it could get ugly
t53902 has joined #ruby
gavit has quit [Read error: Connection timed out]
revans has joined #ruby
bgupta_ has joined #ruby
gavit has joined #ruby
BrokenCog has quit [Quit: leaving]
apok has quit [Quit: apok]
axl_ has quit [Quit: axl_]
<lectrick> How about this: Can you *un*extend a module from a class?
Guest49175 is now known as tds
<tds> lectrick: yes
adeponte has joined #ruby
pygmael has quit [Quit: pygmael]
<tds> there's no built-in feature, but you could
senny has quit [Remote host closed the connection]
BrokenCog has joined #ruby
Eldariof-ru has joined #ruby
<troessner> tds, how?
mxbtty has quit [Read error: Operation timed out]
arooni-mobile has joined #ruby
bgupta has quit [Ping timeout: 244 seconds]
bgupta_ is now known as bgupta
<tds> extending, but in reverse
cantbecool has quit [Quit: Computer has gone to sleep.]
<tds> iterate over the methods of a module, removing them from a class
BrokenCog has quit [Client Quit]
<troessner> tds, but this doesnt "unextend"
dhruvasagar has joined #ruby
<troessner> since it leaves the module effectively in the ancestors chain
<troessner> that's not the same thing
axl_ has joined #ruby
<tds> that's true
pen has quit [Remote host closed the connection]
BrokenCog has joined #ruby
<tds> actually, is it?
<lectrick> found this: http://docs.seattlerb.org/un/
<tds> ah it is
<lectrick> Also ran across the evil gem (again) which does things like that, and something from eigenclass.org that is not loading currently
<tds> 1.9.3p194 :013 > eigen(C).ancestors => [A, Class, Module, Object, Kernel, BasicObject]
ananthakumaran has quit [Quit: Leaving.]
ananthakumaran has joined #ruby
<lectrick> also found this https://github.com/dan-manges/mixology
<tds> does un.rb redefine Module#extend?
imami|afk is now known as banseljaj
sepp2k has quit [Read error: Connection reset by peer]
<troessner> lectrick, tds yeah, but they do that in C which is cheating..:)
<troessner> i want to be able to do that in plain ruby
mike4_ has quit [Ping timeout: 276 seconds]
rubious has joined #ruby
<troessner> actually this could be possible in rubinius
<lectrick> troessner: ah i agree
<tds> i was about to say
<tds> should see how it's implemented in rubinius
Z_Mass has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
<Mon_Ouie> I think banisterfiend wrote some C code that implemented something similar to refining
opus has joined #ruby
jlogsdon has joined #ruby
<tds> i guess it's that old saying: you can change who your friends are, but you can't change who your family are
<troessner> Mon_Ouie, which wouldnt work on a lot of platforms
<troessner> i want that in ruby, god damn it!
<troessner> :)
ringotwo has joined #ruby
<lectrick> troessner: yeah, Mixology actually has a pure-ruby Rubinius implementation I see
<Mon_Ouie> Well it would work on Ruby 1.8/1.9
<Mon_Ouie> MRI that is
terrellt has joined #ruby
<lectrick> troessner: It's basically the Refinement pattern. I just have a feeling it's possible to do it with pure ruby on 1.9 although it might get hacky
<troessner> yeah, but who uses that
<troessner> mri, i mean
<tds> me
twoism has joined #ruby
<tds> a lot of people
<tds> do you use rubinius?
<troessner> yeah, i wasn't absolutely serious
<troessner> :)
<tds> ah
<tds> a little slow this morning
<troessner> yeah, rubinius where i can and the occasional jruby
<lectrick> heh, the "un" gem used RubyInline so it too used C basically
<troessner> i can't wait for rubinius to become fully 1.9 compatible
twoism has quit [Read error: Connection reset by peer]
MarGarina has quit [Ping timeout: 244 seconds]
liluo has joined #ruby
brianpWins has joined #ruby
twoism has joined #ruby
<tds> troessner: do you ever contribute?
<tds> to rubinius that is
<troessner> hihi
<troessner> i have had some petty commits
twoism has quit [Remote host closed the connection]
Rajesh has joined #ruby
banisterfiend` has joined #ruby
Rajesh is now known as Guest15244
<troessner> not much
Guest15244 has quit [Max SendQ exceeded]
twoism has joined #ruby
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
<troessner> actually i had just picked some low hanging fruits
<troessner> :)
<tds> i was thinking of trying the same
bricker88 has joined #ruby
binw has joined #ruby
banister`sleep has quit [Ping timeout: 246 seconds]
<troessner> tds, unfortunately most "low hanging fruits" are gone by now. most of the still failing specs are ugly things like IO and unicode
Rajesh_ has joined #ruby
Petru has joined #ruby
<tds> i'll have to wait till ruby 2.0 :)
<troessner> haha
<tds> actually i googled contributing to rubinius yesterday, and i came across your blog post
Rajesh_ has quit [Client Quit]
<tds> strange coincidence
ananthakumaran has quit [Quit: Leaving.]
Inoperable has quit [Quit: Rectified]
<troessner> :)
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
_JamieD_ has quit [Quit: _JamieD_]
carloslopes has joined #ruby
khakimov has quit [Ping timeout: 244 seconds]
pdtpatrick has joined #ruby
TorpedoSkyline has joined #ruby
FaceBack has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
ssspiff has joined #ruby
ssspiff has joined #ruby
stopbit has quit [Read error: Connection reset by peer]
elhu has quit [Quit: Computer has gone to sleep.]
sspiff has quit [Ping timeout: 246 seconds]
stopbit has joined #ruby
sepp2k has joined #ruby
pdtpatrick has quit [Ping timeout: 252 seconds]
binw has quit [Quit: leaving]
Petru has left #ruby ["Leaving"]
GMFlash has quit [Quit: Computer has gone to sleep.]
TPFC-SYSTEM has joined #ruby
binw has joined #ruby
ringotwo has quit [Remote host closed the connection]
<diegoviola> does resque jobs get started as soon as they hit the queue? automatically... or i need to start them manually
<diegoviola> how does it work?
dhruvasagar has joined #ruby
pdtpatrick has joined #ruby
<davidcelis> diegoviola: it's a queue
<diegoviola> ok so the first job gets executed, and then the others wait
peregrine81 has quit [Quit: Computer sleeping.]
<davidcelis> diegoviola: FIFO
<diegoviola> ok
<davidcelis> diegoviola: first in, first out
<diegoviola> thanks
<davidcelis> yep
apok has joined #ruby
<davidcelis> of course if you have more than one worker running, then multiple jobs can execute at once
Squarepy has quit [Quit: Leaving]
ringotwo has joined #ruby
<davidcelis> but with resque that can get expensive. if you want multiple jobs running at once with a single worker, you might want to checkout sidekiq
adeponte has quit [Remote host closed the connection]
<diegoviola> thanks
flip_digits has joined #ruby
<revans> or queue_classic
<diegoviola> cool
<diegoviola> awesome
<diegoviola> ty
pdtpatrick_ has joined #ruby
bradhe has joined #ruby
kpshek has quit []
chrismcg is now known as zz_chrismcg
bier has quit [Ping timeout: 268 seconds]
mohits has quit [Ping timeout: 246 seconds]
macer_ has joined #ruby
macer_ has quit [Read error: Connection reset by peer]
mxbtty has joined #ruby
no_i_wont has joined #ruby
macer_ has joined #ruby
specialGuest has joined #ruby
haxrbyte has quit [Remote host closed the connection]
rburton- has joined #ruby
t53902 has quit [Remote host closed the connection]
bluenemo has quit [Read error: Connection reset by peer]
t53729 has joined #ruby
nu7hatch has left #ruby [#ruby]
<terrellt> Okay. I'm trying to get my head around operator precedence in ruby - specifically &&/and. Anyone want to explain to me why if(a=1 && b=2) then puts "A: #{a} B: #{b}"; end says that both a and b are 2?
timonv has joined #ruby
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
alvaro_o has joined #ruby
cbuxton has quit [Quit: Leaving.]
<Gate> terrellt: because = is assignment, == is equality check
gavit has quit [Read error: Connection timed out]
bowlowni has joined #ruby
<terrellt> I know - I meant to assign.
<terrellt> It's a test after all.
<Gate> ah
<Gate> well, then I would look at it this way
<davidcelis> well, that's not that what i'd expect from that
gavit has joined #ruby
<Gate> what would: a = 1 = 2 produce?
lkba has quit [Quit: Bye]
<terrellt> That is exactly what I wanted to hear.
<Gate> syntax error
<terrellt> Thank you.
<terrellt> Er.
<terrellt> Maybe not.
<davidcelis> terrellt: what was exactly what you wanted to hear/
<terrellt> My thought was it does &&, then a=1=b=2, or something.
adeponte has joined #ruby
mklappstuhl has joined #ruby
<terrellt> But you're right, syntax error. >.>
kenichi has joined #ruby
<Gate> so I think this is equivalent to a = ( 1 && b = 2 )
<Gate> or a = ( 1 && ( b = 2) )
<Gate> so && and = are *equal* in precedence?
<terrellt> No, && is higher precedence.
<terrellt> I can force what I expect with parenthesis obviously, just trying to figure out how it's parsing it to make a = 2.
cdabba has joined #ruby
blazed has joined #ruby
<tds> if you did
<tds> (a=1 and b=2)
bier has joined #ruby
<terrellt> Then it'd work like I expect.
<tds> yup
<terrellt> Since and is lower precedence than =.
<tds> yeah
<terrellt> But I imagine, someday, I'll want to use &&.
<terrellt> It has to have a purpose. I wanna know what it is.
<tds> && has many purposes :)
<tds> it's just not useful with multiple assignment
brdude has joined #ruby
bowlowni has quit [Read error: Connection reset by peer]
<ggreer> "and" being lower-precedence than ternary caused some issues for me
<ggreer> I naively assumed && and "and" had the same precedence
bowlowni has joined #ruby
goyox86 has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
a_a_g has joined #ruby
joephelius has quit [Ping timeout: 244 seconds]
apok has joined #ruby
opus has quit [Quit:]
Goles has joined #ruby
timonv has quit [Remote host closed the connection]
<terrellt> So, the only use I can think of off the top of my head is something like a &&= b. That'd only set a equal to b if they're both set to something already, right?
workmad3 has quit [Ping timeout: 240 seconds]
timonv has joined #ruby
<tds> it would only execute a = b if a was not nil or false
stkowski has joined #ruby
qko has quit [Ping timeout: 240 seconds]
sneakyness_wk has joined #ruby
localhost has quit [Read error: Connection reset by peer]
xbayrockx has quit []
<tds> terrellt: im not sure of your level of knowledge with ruby
<tds> but && is mostly used in conditionals
<tds> like if this && that do this
lkba has joined #ruby
danheberden has quit [Excess Flood]
qko has joined #ruby
<terrellt> Very little, I'm used to languages that only have one "and" operator, so I'm figuring out the possibilities of having two. =D
<tds> car.start if car.has_gas && car.has_oil
danheberden has joined #ruby
<tds> ah
<tds> i think 'and' is only useful in the context of multiple assignment
<tds> it is more idiomatic to use &&
Z_Mass has quit [Quit: Leaving]
fantazo has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
<fowl> and is not much different than &&, it has a lower precedence though
<tds> they are the exact same, except for the precedence i believe
<fowl> and/or have the lowest precedence, they dont even get invited over to dinner most nights
beneggett has quit [Quit: Computer has gone to sleep.]
shadoi has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
localhost has joined #ruby
cbuxton has joined #ruby
qwerxy has quit [Quit: offski]
jrajav has joined #ruby
uris has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 244 seconds]
uris has joined #ruby
timonv has quit [Remote host closed the connection]
<cdabba> I have an array of objects with a name and a version_number. how can i sort first by name, then by version number? is there a better, faster, or more straightforward way then what i have here? http://pastebin.com/VzBy5Kw6
baphled has quit [Ping timeout: 272 seconds]
mucker has joined #ruby
chrisja has joined #ruby
<apeiros_> cdabba: sort_by
timonv has joined #ruby
blazed has quit []
luxurymode has quit [Read error: Connection reset by peer]
<apeiros_> obj_array.sort_by { |a| [a.name, a.version_number] }
Emmanuel_Chanel has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
dpk has joined #ruby
axl_ has joined #ruby
FaceBack has quit [Ping timeout: 245 seconds]
paolooo has quit [Ping timeout: 245 seconds]
iamjarvo has joined #ruby
joephelius has joined #ruby
<DeeJayTwo> hmm..
s1n4 has quit [Quit: peace out]
<DeeJayTwo> Obviously, rails 2.3.11 is installed as it's shown under `gem list`
<DeeJayTwo> but my thin server says otherwise..
<DeeJayTwo> any idea?
timonv has quit [Ping timeout: 252 seconds]
darren has joined #ruby
the_jeebster has joined #ruby
TorpedoSkyline has quit [Ping timeout: 260 seconds]
opus has joined #ruby
<musl> DeeJayTwo: RVM?
<cdabba> apeiros_, thank you
darren has quit [Ping timeout: 268 seconds]
<musl> DeeJayTwo: (Are you using RVM to manage your rubies?)
<DeeJayTwo> musl: FreeBSD
<DeeJayTwo> for gem, I'm doing gem install..
walbert has joined #ruby
dukedave has joined #ruby
jbw has quit [Read error: Operation timed out]
<musl> What happens if you su to www run 'gem list'?
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
Rajesh has joined #ruby
Bosma has joined #ruby
<musl> It might be helpful to see the output from 'gem env' as well.
Rajesh is now known as Guest37020
gavit has quit [Read error: Connection timed out]
rubious has quit [Read error: Connection reset by peer]
chussenot has quit [Quit: chussenot]
gavit has joined #ruby
rubious has joined #ruby
<DeeJayTwo> musl: same result from user www
etehtsea has joined #ruby
<DeeJayTwo> su -m www -c 'gem list' |grep rails
<musl> hm.
_Vile has joined #ruby
_Vile has joined #ruby
_Vile has quit [Changing host]
<nullsign_> i need to make a simple 2 column lookup table in ruby, with about 2,000 to 5,000 rows; is there a quick and easy way to do this with a static array and a csv?
cylence has joined #ruby
<nullsign_> anyone have a code example?
<DeeJayTwo> Here's the gem env
chadkeck has joined #ruby
maletor has joined #ruby
<nullsign_> hey, i just met you, and this is crazy, but here's my pastebin, help me maybe?
GMFlash has joined #ruby
<musl> nullsign_: require 'csv'; CSV::read( 'path' )
<musl> nullsign_: It yields an array of arrays, so if all you have is two columns, you're set.
<musl> nullsign_: I think.
luckyruby has quit [Remote host closed the connection]
<nullsign_> musl: thank you :) any advice on how to query the columb b if i know columb a? (lookup table from array) ?
mrdodo has joined #ruby
lkba has quit [Ping timeout: 246 seconds]
macer_ is now known as macer1
macer1 has quit [Changing host]
macer1 has joined #ruby
k_89 has joined #ruby
<musl> DeeJayTwo: Is the gem installed in your user (.gem) folder?
<musl> eek. s/folder/directory/
<asteve> we gemmin, we gemmin, we gemmin, i hope you like gemmin too!
joe-mac has joined #ruby
<joe-mac> hello ruby people, say i open a unix command with Open4.popen4, is there a way for me to tell if that process is waiting for input on stdin?
<joe-mac> i basically want to abort if it's an interactive process
<musl> nullsign_: You could turn it into a hash or use something like this to search the array: a.select{ |row| row[0] == 1 }.first
<apeiros_> musl: select.first --> find
luxurymode has joined #ruby
<musl> apeiros_: Awesome.
cantonic has quit [Quit: cantonic]
yaymukund has quit [Ping timeout: 240 seconds]
t53729 has quit [Remote host closed the connection]
t3953 has joined #ruby
mohits has quit [Ping timeout: 245 seconds]
macmartine has joined #ruby
<apeiros_> nullsign_: "query the columb b if i know columb a?" -> use a Hash, much faster than linear search in an array
<apeiros_> especially with 2k-5k items
jbw has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
SeySayux has quit [Ping timeout: 240 seconds]
<nullsign_> apeiros: what should i read about to learn how to use and query from a hash? ill be making the hash from a csv import.
<apeiros_> nullsign_: hash[key] # => value
<nullsign_> apeiros: just a nudge in the right direction would be awesome, im still a ruby noob
mike4_ has joined #ruby
<apeiros_> not much to it, really. other related methods: Hash#[], #fetch, #values_at
<asteve> hashish.keys.each { |k,v| puts k; puts v }
<nullsign_> awesome.
<apeiros_> to create a hash from a csv (array of arrays essentially) see Hash::[] - example:
<apeiros_> >> Hash[[[:key1, :value1], [:key2, :value2]]]
<al2o3cr> (Hash) {:key1=>:value1, :key2=>:value2}
<apeiros_> asteve: without the .keys
<nullsign_> ah
<apeiros_> or more readable example:
elux has quit [Quit: Leaving...]
<apeiros_> >> ary_of_arys = [[:key1, :value1], [:key2, :value2]]; Hash[ary_of_arys]
<al2o3cr> (Hash) {:key1=>:value1, :key2=>:value2}
Guest37020 has quit [Ping timeout: 260 seconds]
<nullsign_> ag
<nullsign_> ah/
elux has joined #ruby
gavit has quit [Read error: Connection timed out]
bhaa has joined #ruby
elux has quit [Client Quit]
gavit has joined #ruby
<bhaa> hey can anybody help me
mklappstuhl has quit [Ping timeout: 246 seconds]
<bhaa> i am learning ruby on rails
goyox86 has joined #ruby
elux has joined #ruby
mrdodo has quit [Remote host closed the connection]
cakehero has joined #ruby
<fowl> bhaa: only god can help you now
mike4_ has quit [Ping timeout: 276 seconds]
specialGuest has quit [Ping timeout: 246 seconds]
walbert has quit [Remote host closed the connection]
<sphera> or that crazy #rubyonrails channel
<musl> fowl: Doesn't god use C anyway?
v0n has quit [Ping timeout: 245 seconds]
<DeeJayTwo> I have some .gemspec files under ~/.gem/specs/rubygems.org%80/quick/Marshal.4.8
fermion has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<DeeJayTwo> musl..
<bhaa> fiwl ..what do you mean ?
<apeiros_> yeah fiwl
SeySayux has joined #ruby
<musl> DeeJayTwo: run 'gem which rails'
prtksxna has quit [Ping timeout: 246 seconds]
<musl> DeeJayTwo: If it's a system path (/usr/local/...) I'm not sure.
mike4_ has joined #ruby
uris has quit [Ping timeout: 240 seconds]
QKO_ has joined #ruby
aantix has joined #ruby
<DeeJayTwo> it returns /usr/local/lib/ruby/gems/1.8/gems/railties-3.2.6/lib/rails.rb
<musl> Yeah, I'm not sure what's going on with thin then.
hynkle has quit [Ping timeout: 244 seconds]
<DeeJayTwo> Maybe that's the problem..it's not the right version
antlong has joined #ruby
<DeeJayTwo> I need it to use 2.3.11
peregrine81 has joined #ruby
<antlong> hello, has anyone come across a ruby to python converter?
kaen has quit [Quit: Leaving]
<infinitiguy> back to a converstaion earlier - how can you rescue only on a certain case - in my case if a variable iface isn't defined?
peregrine81 has quit [Client Quit]
Speed has quit [Remote host closed the connection]
nari has quit [Ping timeout: 244 seconds]
qko has quit [Ping timeout: 246 seconds]
<infinitiguy> my current rescue block just catches all Exceptions.. would I do a if iface.nil? I kind of did that above the rescue with an if elsif else block
hynkle has joined #ruby
Guest37020 has joined #ruby
<asteve> i want to get the first key and value from a hash
<joe-mac> seems like reopening stdin to be dev null will work
<joe-mac> anybody think of a reason why i shouldn't do this?
echobravo has joined #ruby
<asteve> hash.keys[0] returns the first key, how do I get the associated value of the key
LouisGB has quit [Ping timeout: 260 seconds]
<davidcelis> hash[hash.keys[0]]
prtksxna has joined #ruby
<musl> hash.first.last </cheek>
<musl> hash.values.first also works
blazed has joined #ruby
mahmoudimus has quit [Ping timeout: 240 seconds]
iamjarvo has quit [Ping timeout: 246 seconds]
mahmoudimus has joined #ruby
<eam> asteve: there's no such thing as the first key
<eam> hashes are unordered
conor_ireland has joined #ruby
<eam> a.keys[0] may return a different value each time you call it (it *probably* won't because of implementation details, but this is not guaranteed)
<asteve> eam: that's fine, I just needed to find "any" key to understand the structure
<eam> cool
<matti> eam: 1.9 tries had to have ordered hashes.
gavit has quit [Read error: Connection timed out]
<musl> Yeah, per the 1.9.3 docs: "Hashes enumerate their values in the order that the corresponding keys were inserted."
<eam> matti: hm does it really? weird
<eam> matti: I imagine it doesn't quite succeed
<asteve> they keys point to values which are actually yaml dumps and it got complicated when I was trying to pick out a value from the dump
<davidcelis> yep, 1.9 hashes are ordered
<eam> I hope there's a way to get unordered hashes in 1.9
gavit has joined #ruby
<eam> I wouldn't want to pay for that
<davidcelis> oh, you'll pay for it
<davidcelis> you'll pay dearly...
<davidcelis> matz will be here soon for your firstborn
iamjarvo has joined #ruby
<matti> davidcelis: Hehe
LouisGB has joined #ruby
<musl> matz: kill -9 1
<musl> :p
<eam> what's the units conversion between GB and "arm/leg"
<eam> 'cause I'm already paying for it
<davidcelis> eam: that depends on how many legs you have
voodoofish430 has joined #ruby
<davidcelis> eam: if you lost them in vietnam, you're gonna get a division by 0 error
<matti> Hehe
<eam> integer or float division?
banister`sleep has joined #ruby
<davidcelis> true, you could have nubs
banisterfiend` has quit [Read error: Connection reset by peer]
<davidcelis> so lets say float division. in which case 0 legs would get you Infinity
<apeiros_> eam: you pay 16bytes per key/value pair for ordered hashes. and I agree, it'd have been nice if unordered hashes were still available.
<davidcelis> am I going to hell yet?
syamajala has joined #ruby
<apeiros_> (might actually be less than 16bytes since the DLL is in C too…)
pricees has joined #ruby
elhu has joined #ruby
opus has quit [Quit:]
pricees has left #ruby [#ruby]
nari has joined #ruby
baphled has joined #ruby
pricees has joined #ruby
<musl> davidcelis: NameError: uninitialized constant Hell
<DeeJayTwo> musl: no more idea..?
<aces1up> just curious, the ruby runtime that runs on windows is always ming right? specifically from the if installed via the rubyinstaller?
a_a_g has quit [Quit: Leaving.]
aspiers has joined #ruby
<davidcelis> musl: Hahahaha
<davidcelis> stealing that
antlong has left #ruby ["Textual IRC Client: www.textualapp.com"]
macer1 has quit [Read error: No route to host]
<matti> musl: +1
<aspiers> what's the point of catching an exception and then using raise with no arguments to re-raise it?
<aspiers> does it achieve anything other than alter the backtrace?
<davidcelis> aspiers: a false sense of control
<aspiers> haha
<matti> Hahah
pricees has quit [Client Quit]
pricees has joined #ruby
macer__ has joined #ruby
macer_ has joined #ruby
<Mon_Ouie> Maybe sometimes you can actually rescue some of the exceptions of a certain class, and will reraise the others
luxurymode has quit [Quit: Computer has gone to sleep.]
pricees is now known as ted_price
<matti> Goddammit.
macer_ has quit [Remote host closed the connection]
macer__ has quit [Read error: Connection reset by peer]
<matti> I cannot believe that http://refactormycode.com/ is down.
mrsrikanth has joined #ruby
<bricker88> I guess that "public" is a keyword just like "protected" and "private", but is there ever a reason you *have* to use it, or is it just if you want to organize your class a little better?
<aspiers> I'm not sure what that actually achieves
<matti> I loved looking at other people funny code.
<davidcelis> Mathieu: they're undergoing a code refactoring
<matti> aspiers: LOL, that is moronic.
<troessner> bricker88, i can't think of any reason why you would ever *have* to
<aspiers> matti: OK, good - so it's not just me :)
<matti> aspiers: No, no.
<davidcelis> that rescues two Exception classes and raises a different one
<davidcelis> they're raising a RuntimeError instead
<davidcelis> perhaps it will get caught somewhere further up the line
<davidcelis> so, not necessarily moronic
<aspiers> why does it raise a RuntimeError?
<apeiros_> bricker88: private/protected/public are all methods, not keywords
<davidcelis> aspiers: raise with no class given raises a RuntimeError
opus__ has joined #ruby
<Mon_Ouie> aspiers: That's because they don't want SystemExit and Interrupt exceptions to be rescued afterwards
<Mon_Ouie> davidcelis: Unless $! is set
<davidcelis> right
<matti> Mon_Ouie: I see.
<davidcelis> (i say right but i didnt actually know that)
<matti> davidcelis: ;p
<aspiers> ah ok
<davidcelis> Mon_Ouie: teaching me about the $ variables since forever
<bricker88> apeiros_: interesting... And it takes all of the code as the argument, or how does that work?
<apeiros_> bricker88: you mean the form without argument?
<apeiros_> I'd assume it sets a flag or something
<apeiros_> you couldn't really implement those methods in pure ruby, since they are lexically scope. can't reproduce that with vanilla ruby (ok, might, using set_trace_func, but that'd be awful)
GoGoGarrett has quit [Remote host closed the connection]
luxurymode has joined #ruby
<bricker88> apeiros_: I see
ted_price has left #ruby [#ruby]
grauwoelfchen has left #ruby ["WeeChat 0.3.5"]
yaymukund has joined #ruby
* matti praises Mon_Ouie
jgrevich has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
v0n has joined #ruby
Juul has joined #ruby
ttilley has quit [Read error: Connection reset by peer]
IPGlider has joined #ruby
ttilley has joined #ruby
pricees has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
beneggett has joined #ruby
kirun has joined #ruby
<troessner> apeiros_, as far as i can tell they are implemented in plain ruby in rubinius
gavit has quit [Read error: Connection timed out]
Russell^^ has joined #ruby
<apeiros_> troessner: yes, but rubinius probably provides a bit more in order to do that
gavit has joined #ruby
<apeiros_> if you can show me how to do it in plain MRI/KRI ruby without set_trace_func, I'd be interested
ScottNYC has quit [Quit: Linkinus - http://linkinus.com]
Petru has joined #ruby
<troessner> apeiros_, i can't
<troessner> :)
syamajala has quit [Remote host closed the connection]
ScottNYC has joined #ruby
Petru has left #ruby ["Leaving"]
Tyler__ is now known as tfitts
Axsuul has joined #ruby
rburton- has quit [Quit: rburton-]
kenichi has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
pricees has quit [Quit: leaving]
ninegrid has joined #ruby
Guest65466 has joined #ruby
<Guest65466> how i install rvm as sudo / system wide properly?
Guest65466 is now known as klj613-
tk_ has quit [Quit: ばいばい]
ScottNYC has quit [Quit: Linkinus - http://linkinus.com]
bluOxigen has joined #ruby
<fowl> klj613-: someone said recently you need ruby installed to install rvm.. how lol is that?
bhaa has quit [Read error: Connection reset by peer]
t3953 has quit [Remote host closed the connection]
t29358 has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
goyox86 has quit [Remote host closed the connection]
<klj613-> fowl: erm. now im confused alol
<jlogsdon> fowl: um, is that still the case? https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer looks like a straight up bash script
<jlogsdon> (which is what get.rvm.io points to)
pricees has joined #ruby
troessner has quit [Remote host closed the connection]
<fowl> idk, i'd rather lol than know the truth
BrokenCog has quit [Read error: Connection reset by peer]
kenneth has quit [Quit: kenneth]
<apeiros_> fowl: I think you meant that you need ruby in order to install ruby, which afaik is the case for 1.9
<apeiros_> which is kinda bit a sadlol
bigkevmcd has quit [Quit: outta here]
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
Speed has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
JarJar has joined #ruby
c0rn_ has joined #ruby
mrsrikanth has quit [Quit: Leaving]
twoism has quit [Ping timeout: 265 seconds]
opus__ has quit [Quit:]
Stalkr_ has joined #ruby
Goles has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
gmci has quit [Quit: Computer has gone to sleep.]
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
tvw has quit [Remote host closed the connection]
jaylevitt has joined #ruby
uris has joined #ruby
opus has joined #ruby
eikko has quit [Read error: Connection reset by peer]
eikko has joined #ruby
mucker has quit [Remote host closed the connection]
kenneth has joined #ruby
Jay_Levitt has quit [Ping timeout: 246 seconds]
jaylevitt has quit [Ping timeout: 246 seconds]
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
BrokenCog has joined #ruby
cmarques has joined #ruby
opus has quit [Ping timeout: 268 seconds]
adambeynon has quit [Ping timeout: 252 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
darren has joined #ruby
v0n has quit [Ping timeout: 245 seconds]
cokanut has joined #ruby
cek has joined #ruby
adambeynon has joined #ruby
robustus has joined #ruby
goyox86 has joined #ruby
gavit has quit [Read error: Connection timed out]
gmci has joined #ruby
gavit has joined #ruby
darren has quit [Ping timeout: 272 seconds]
pastjean has joined #ruby
aeontech has quit [Quit: aeontech]
gmci has quit [Client Quit]
VictorMartins has joined #ruby
pastjean has quit [Remote host closed the connection]
pastjean has joined #ruby
phinfonet has joined #ruby
chadkeck has quit [Remote host closed the connection]
burgestrand has joined #ruby
s1n4 has joined #ruby
s1n4 has left #ruby [#ruby]
mikepack has quit [Remote host closed the connection]
Guest37020 has quit [Quit: Leaving to Quit]
rippa has joined #ruby
ph^_ has joined #ruby
SQLStud has joined #ruby
johncrest has joined #ruby
mikepack has joined #ruby
v0n has joined #ruby
johncrest has quit [Client Quit]
gmci has joined #ruby
ph^ has quit [Ping timeout: 246 seconds]
robustus has quit [Quit: robustus]
mengu has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
gavit has quit [Read error: Connection timed out]
verto|off is now known as verto
gavit has joined #ruby
ken_barber has quit [Ping timeout: 268 seconds]
v0n has quit [Ping timeout: 252 seconds]
specialGuest has joined #ruby
<vlad_starkov> Question: In what format it is better to store audio-track duration in database: 'time' OR 'decimal' OR 'float' OR 'integer'?
<jlogsdon> integer. # of seconds
<davidcelis> # of milliseconds
<vlad_starkov> or decimal for more accurate
<jlogsdon> i mean, if you need it more accurate than seconds yes
<vlad_starkov> thank you
ken_barber has joined #ruby
yekta has joined #ruby
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
stopbit has quit [Read error: Connection reset by peer]
stopbit has joined #ruby
evenix has joined #ruby
<evenix> hi all
<burgestrand> vlad_starkov: if you need it more accurate store the sample rate and how many samples it consist of instead
adeponte has joined #ruby
<vlad_starkov> burgestrand: now I do (samples / rate).to_f
<vlad_starkov> burgestrand: anyway thank you for your advice
tommyvyo has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rburton- has joined #ruby
diegoviola has quit [Ping timeout: 265 seconds]
v0n has joined #ruby
twoism has joined #ruby
chrisbolton has joined #ruby
lkba has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
c0rn_ has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
goyox86 has quit [Remote host closed the connection]
<infinitiguy> when I call a class - LB.new("something") how do I define the class to get something assigned to a variable
yekta has quit [Quit: yekta]
<infinitiguy> I tried class LB(variable) but I don't think that's right
cokanut has quit [Quit: leaving]
c0rn_ has joined #ruby
<infinitiguy> class LB(variable); a = variable; puts a; end
t29358 has quit [Remote host closed the connection]
pdtpatrick has quit [Quit: pdtpatrick]
pdtpatrick_ is now known as pdtpatrick
gavit has quit [Read error: Connection timed out]
t98309 has joined #ruby
gavit has joined #ruby
glistle has quit [Remote host closed the connection]
luxurymode has quit [Quit: Computer has gone to sleep.]
<cek> infinitiguy, go read a book
<infinitiguy> good idea. Thanks.
bigkevmcd has joined #ruby
<cek> !next
the_jeebster1 has joined #ruby
the_jeebster has quit [Ping timeout: 245 seconds]
the_jeebster1 has quit [Client Quit]
k_89 has quit [Ping timeout: 252 seconds]
Stalkr_ has quit [Read error: Connection reset by peer]
Stalkr_ has joined #ruby
Tomasso has joined #ruby
arkiver has joined #ruby
pastjean has quit [Remote host closed the connection]
JarJar has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
dukedave has left #ruby ["PONG :wright.freenode.net"]
ken_barber has quit [Remote host closed the connection]
robustus has joined #ruby
pastjean has joined #ruby
pricees has left #ruby [#ruby]
jimeh has quit [Ping timeout: 240 seconds]
kfries has joined #ruby
SCommette has quit [Quit: SCommette]
JarJar has joined #ruby
jgrevich_ has joined #ruby
SCommette has joined #ruby
SCommette has quit [Client Quit]
<kfries> I need some advice on how to handle extremely large datasets. I need to be able to access a array that can extend into the Million+ entries.
jgrevich has quit [Ping timeout: 244 seconds]
jgrevich_ is now known as jgrevich
mrmist is now known as groupcat
VictorMartins has left #ruby [#ruby]
<kfries> Without wanting to start a flame war, I was hoping to get some experts advice on how to cache, and run arrays to front datasets that large.
Eldariof-ru has quit []
<tds> are you sure an array is the right data structure?
<kfries> No
<tds> i'd need to know more
<tds> what's your typical data access pattern?
<tds> like are you doing searching?
<tds> or do you always know the indices of the elements?
nari has quit [Ping timeout: 260 seconds]
cmarques has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
<kfries> I have data that I access via a REST interface. I read in the tree, level by level. On most levels, I get a few hundred entries, and the array works perfectly. But now I am accessing areas that have thousands and millions of entries, and I am running out of ram
<tds> yeah
<tds> that's interesting
<tds> an in-memory array is probably not the way to go
chichou has quit [Remote host closed the connection]
<tds> if you're going to be handling datasets of that size, you likely need a database that will persist that data to disk
gavit has quit [Read error: Connection timed out]
jbw has quit [Ping timeout: 246 seconds]
kenichi has joined #ruby
chichou has joined #ruby
adeponte has joined #ruby
<kfries> I have data that is stored as contain1/ provides all elements at that level, contain1/value1 would be an element in that first array, but it may also have contain2 and a value in it value2 that I would access as /contain1/value1/contain2/value2
<tds> right
gavit has joined #ruby
<kfries> My original design would get the array, then validate the value entries before returning the object.
<tds> is there no way to limit the amount of information that you get in one call?
<kfries> few hundred, fine, past that, EOM
<tds> how big are these objects?
<apeiros_> infinitiguy: how do you mean?
<kfries> There is, and I was looking at the LRU arrays
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
chrisja has quit [Quit: leaving]
mklappstuhl has joined #ruby
<infinitiguy> I think what I was looking for was attr_accessor
<infinitiguy> I used that to define a variable and I think that got me what I wanted
<kfries> But I think I am just confusing myself on the different options. So, I thought I might ask what others are actually using
<tds> well an LRU cache is not going to solve your problem
<infinitiguy> thanks for asking and not telling me to just read a book :)
<tds> unless what is not in the cache is persisted to disk
h4mz1d has joined #ruby
<apeiros_> infinitiguy: well, just ignore cek
Juul has quit [Quit: Leaving]
<apeiros_> infinitiguy: so you've solved your problem then I gather?
<infinitiguy> i did
Juul has joined #ruby
<tds> your fundamental problem is that you are trying to a lot of information in memory
<tds> so you either need to reduce your memory needs
<apeiros_> great, glad to hear
<tds> well actually you need to reduce your memory needs, either by paging through the dataset
<kfries> Exactly. Even the keys can't fit in ram on some of these lists
<tds> yeah
<tds> there's no real solution to that problem
chichou has quit [Ping timeout: 246 seconds]
<tds> you have to change your design
t98309 has quit [Remote host closed the connection]
<tds> IMO
t11802 has joined #ruby
eikko_ has joined #ruby
joe-mac has left #ruby [#ruby]
eikko has quit [Ping timeout: 268 seconds]
<kfries> The problem is that not all the data is accessed sequentially, so paging becomes tough. How deep into the set to I need to jump to find the record in question? things like that
<kfries> Once my data comes back, it is usually an XML document.
eikko_ has left #ruby [#ruby]
<tds> i mean
<tds> that's why we have databases
<tds> im guessing the web service you're using
<tds> doesn't have a very robust interface?
<shevy> let's make love, not java
<kfries> When I have a locator, life is good, the back end to this application is MarkLogic, so their is my database, I am trying to build front end tools to access that data store.
<shevy> are many folks using sublime here?
<Sou|cutter> what does /asdf/is the "s" do there?
<Sou|cutter> in a regex literal...
<kfries> MarkLogic is like a bigger version of Mongo or Couch
<tds> so use the querying tools of your database to extract the information you need
nullsign_ has quit [Quit: Changing server]
nullsign_ has joined #ruby
<tds> the way i see it is that you are taking all the data from the datastore just as a big chunk
<tds> and then trying to do operations that the database should really be handling
<tds> filtering, searching, etc
<eam> Sou|cutter: it changes how patterns match line boundaries
<apeiros_> Sou|cutter: //s means the pattern uses Windows-31J encoding
<Sou|cutter> ugh looks like an encoding.. yeah :/
<Sou|cutter> wtf is that encoding anyway?
<apeiros_> >> //s.encoding
<al2o3cr> (Encoding) #<Encoding:Windows-31J>
<tds> kfries: if you are transforming the data in some way, maybe map/reduce is what you need
<kfries> That would make life easier, that is for sure, but I have intermediate software that is killing me.
<eam> oh shit, I'm in the wrong channel
pastjean has quit [Remote host closed the connection]
pdtpatrick has quit [Quit: pdtpatrick]
goyox86 has joined #ruby
mklappstuhl has quit [Ping timeout: 246 seconds]
<davidcelis> eam: i use sublime
<tds> kfries: yeah you need to get that intermediate software improved
<kfries> Sublime, I will look
nullsign_ is now known as nullok
<Sou|cutter> thanks for pointing me at that
<kfries> Oh, god I wish I could
kenichi has quit [Remote host closed the connection]
axl_ has joined #ruby
<apeiros_> Sou|cutter: I'd assume wikipedia can tell you more about the encoding :) never heard of it before either.
<Sou|cutter> I have to imagine that this use of /s was a mistake...
pdtpatrick has joined #ruby
mikepack has quit [Remote host closed the connection]
<apeiros_> may well be
<Sou|cutter> apeiros_: looks like something to do with japanese on windows
<apeiros_> since //s means other things in other languages, as eam pointed out
macmartine has joined #ruby
opus has joined #ruby
<Sou|cutter> Scarily enough encoding stuff is starting to make sense to me... don't know how anybody got along with 1.8's treatment of encoding
jbw has joined #ruby
krz has joined #ruby
dukedave has joined #ruby
<apeiros_> Sou|cutter: well, just the same as if you'd have default_internal and default_external set to binary and all # encoding to binary too
Spooner has joined #ruby
specialGuest has quit [Changing host]
specialGuest has joined #ruby
CodeFriar has joined #ruby
arkiver has quit [Quit: Leaving]
<CodeFriar> I'm trying to write a module that i know will be included in a class that defines certian constants. How can I use those constants in my module?
linoj has quit [Quit: linoj]
<dukedave> I have a method which return an Array, but I'd like to return some 'meta' information with the Array, what is the most Ruby way of doing it: Return [array, meta]; return a subclass of Array which has a 'meta' member; return a Struct.new(:array, :meta); something else?
<apeiros_> CodeFriar: via self/self.class
<apeiros_> e.g. self::Foo or self.class::Foo
kfries has quit [Quit: Leaving]
<apeiros_> dukedave: viable options. another one would be to return an array and extend with with a module
pastjean has joined #ruby
<TTilus> dukedave: extend the the object you return with a module handling the meta
cek has quit [Quit: жопа диридай диридиридай]
<TTilus> apeiros_: you were faster again :)
<shevy> hmm when you guys have a method that removes the extension part of a string, for instance: "htop-1.0.tar.bz2" -> run through method -> "htop-1.0" how would you call that method? what name would you give it?
nanderoo has quit [Quit: Leaving.]
axl_ has quit [Quit: axl_]
<CodeFriar> apeiros_: so in my module i hitup self.class::constant to access the constant specified in the class extending the module ?
<TTilus> damn this cellphone keyboard =D
<shevy> remove_extension() ? would that make any sense?
<TTilus> shevy: basename
<apeiros_> CodeFriar: depends on you use it in an instance method or class method
<apeiros_> *whether
<CodeFriar> class method
pdtpatrick_ has joined #ruby
<apeiros_> then just self::Foo
<TTilus> shevy: see Pathname#basename and File.basename
<shevy> TTilus, you mean basename("htop-1.0.tar.bz2")? Hmm.. there is File.basename, I just wonder what name to give that method though. TTilus, reason I make this a method is because I want to re-use it across the project
kenichi has joined #ruby
t11802 has quit [Remote host closed the connection]
<dukedave> apeiros_: TTilus: Is there a name for such a technique? And can I do with without defining a new class which subclasses Array and extends a metadata module?
t87281 has joined #ruby
yxhuvud has quit [Ping timeout: 240 seconds]
alek_b has joined #ruby
<dukedave> Ah, I can just call .extend on the returned Array ?
<TTilus> dukedave: you dont need to subclass Array
<TTilus> dukedave: exactly
<dukedave> TTilus: It's good this Ruby isn't it? :)
<TTilus> dukedave: and only _that_ instance of Array gets the module
jrajav has quit [Quit: The best darkness is strange and surprising]
vlad_starkov has quit [Remote host closed the connection]
* dukedave nods
gavit has quit [Read error: Connection timed out]
<TTilus> dukedave: jury is still out on that one ;) ... but i like it
TorpedoSkyline has joined #ruby
gavit has joined #ruby
<TTilus> dukedave: ruby that is...
pastjean has quit [Read error: Connection reset by peer]
fantazo has quit [Remote host closed the connection]
alek_b_ has quit [Ping timeout: 244 seconds]
<CodeFriar> apeiros_: so no matter which of the self::Foo or self.class::Foo i choose I still get uninitialized constant. It's happening when it's being "required 'd "
brdude has quit [Quit: brdude]
cylence has quit [Quit: Linkinus - http://linkinus.com]
eikko has joined #ruby
mklappstuhl has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
bluOxigen has quit [Ping timeout: 252 seconds]
pastjean has joined #ruby
qko has joined #ruby
KensoDev has joined #ruby
KensoDev has quit [Remote host closed the connection]
KensoDev has joined #ruby
xie_xie has joined #ruby
phinfonet_ has joined #ruby
<apeiros_> CodeFriar: care to paste the code?
<apeiros_> dukedave: no idea whether that has a name. I'd simply stick with "extending an object"
<CodeFriar> gisting now
phinfonet has quit [Ping timeout: 246 seconds]
geekbri has quit [Remote host closed the connection]
QKO_ has quit [Ping timeout: 248 seconds]
hynkle has quit [Quit: Computer has gone to sleep.]
<apeiros_> CodeFriar: use tab completion for nicks. less embarassing :-p
<apeiros_> *embarrassing
elux has quit [Quit: Bye!]
<CodeFriar> ?
interne__ has quit [Remote host closed the connection]
<CodeFriar> my bad
c0rn_ has quit [Quit: Computer has gone to sleep.]
<shevy> yeah
<apeiros_> yeah, no, it doesn't work like that. you're trying to access the constants in the module *body*
<shevy> we all know that his real name is apieros_
<apeiros_> which is executed right away
ezra has quit [Ping timeout: 276 seconds]
<apeiros_> i.e., it is not connected to any of the classes which *might* include it in the future
robustus has quit [Quit: robustus]
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<CodeFriar> i was afraid of that. sigh.
ianbrandt has joined #ruby
<apeiros_> so within the module body, there is no way to access constants of yet unknown entity
<apeiros_> you'll have to think of another way
carloslopes has quit [Quit: Leaving.]
<Synthead> a blind "raise" doesn't catch Timeout::Error. is there a way I can "add" Timeout::Error to a blind rescue?
timonv has joined #ruby
axl_ has joined #ruby
<Synthead> sorry, s/"raise"/"rescue"/
goyox86 has quit [Remote host closed the connection]
glistle has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<apeiros_> Synthead: what ruby version are you using?
gavit has quit [Read error: Connection timed out]
<Synthead> apeiros_: 1.8.7 EE
<apeiros_> :-/
mikepack has joined #ruby
<apeiros_> can't upgrade to 1.9?
<Synthead> apeiros_: not atm, but it's on the roadmap
<apeiros_> well, in 1.8, you have to rescue Timeout::Error explicitly
gavit has joined #ruby
<Synthead> apeiros_: yeah. but if I do "rescue Timeout::Error", it won't catch anything else
rippa has quit [Read error: Connection reset by peer]
terrellt has quit [Quit: Quit]
<apeiros_> Synthead: you should read up on ruby syntax then :-p
<apeiros_> rescue Timeout::Error, StandardError
<Synthead> apeiros_: ah, that's what I thought
<apeiros_> StandardError is what a "blind" rescue defaults to.
kirun_ has joined #ruby
<Synthead> apeiros_: very nice. I'll add that :)
terrellt has joined #ruby
<Synthead> apeiros_: thank you very much!
<apeiros_> yw
sailias has quit [Read error: Connection reset by peer]
<rcassidy> you can also have multiple rescue clauses to handle different things that are raised, yeah?
<shevy> yes, you rescue the specific error you want to rescue
kirun_ has quit [Client Quit]
<shevy> rescue IAmOutOfWeed
rippa has joined #ruby
<shevy> rescue HalpMartianAttacks
<shevy> retry
<shevy> hmm does retry even exist?
cbuxton1 has joined #ruby
<shevy> a blind rescue defaults to StandardError? Not Exception?
artOfWar has joined #ruby
kirun has quit [Ping timeout: 272 seconds]
<apeiros_> shevy out of weed? teh horror!
pastjean has quit [Read error: Connection reset by peer]
<apeiros_> has that ever happened?
rakunHo has joined #ruby
eikko has quit [Quit: Forget progress by proxy. Land on your own moon.]
pastjean has joined #ruby
cbuxton has quit [Ping timeout: 265 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
<shevy> it has!
<shevy> but as long as one has beer...
AlienElite has joined #ruby
fbernier has quit [Ping timeout: 260 seconds]
AlienElite has left #ruby [#ruby]
BrokenCog has quit [Quit: leaving]
MarioEIU has joined #ruby
banister`sleep has quit [Ping timeout: 246 seconds]
pastjean has quit [Ping timeout: 246 seconds]
havenn has joined #ruby
jbpros has quit [Read error: Operation timed out]
opus__ has joined #ruby
jbpros has joined #ruby
mattp_ has quit [Read error: Operation timed out]
mattp_ has joined #ruby
schwap has quit [Read error: Operation timed out]
opus has quit [Ping timeout: 256 seconds]
opus__ is now known as opus
schwap has joined #ruby
Foxandxss has joined #ruby
JarJar has quit [Quit: Leaving]
kvirani has quit [Read error: Connection reset by peer]
jmcphers has quit [Quit: Leaving]
jmcphers has joined #ruby
banisterfiend has joined #ruby
IPGlider has quit []
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
beneggett has joined #ruby
t87281 has quit [Remote host closed the connection]
t7856 has joined #ruby
brdude has joined #ruby
slyv has joined #ruby
phinfonet has joined #ruby
c0rn_ has joined #ruby
pastjean has joined #ruby
chichou has joined #ruby
phinfonet_ has quit [Ping timeout: 244 seconds]
answer_42 has quit [Remote host closed the connection]
gavit has quit [Read error: Connection timed out]
c0rn_ has quit [Client Quit]
gavit has joined #ruby
dukedave has left #ruby ["PING 1345152864"]
adeponte has quit [Remote host closed the connection]
glistle has quit [Remote host closed the connection]
Guest73417 is now known as mafs
mafs has quit [Changing host]
mafs has joined #ruby
Eplemosen has joined #ruby
c0rn_ has joined #ruby
goyox86 has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
pastjean has quit [Read error: Connection reset by peer]
pastjean_ has joined #ruby
darren has joined #ruby
c0rn_ has quit [Client Quit]
joshman_ has quit [Ping timeout: 240 seconds]
justinmcp has joined #ruby
indian has joined #ruby
verto is now known as verto|off
eikko has joined #ruby
Markvilla has joined #ruby
mafs has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
kirun has joined #ruby
sailias has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
pdtpatrick_ is now known as pdtpatrick
adeponte has joined #ruby
xie_xie has left #ruby [#ruby]
c0rn_ has joined #ruby
bbttxu has quit [Quit: bbttxu]
ilyam has joined #ruby
[1]dtribble has joined #ruby
t7856 has quit [Remote host closed the connection]
t33661 has joined #ruby
skrewler has joined #ruby
dtribble has quit [Ping timeout: 240 seconds]
ph^_ has quit [Remote host closed the connection]
eikko has quit [Ping timeout: 240 seconds]
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
binaryplease has joined #ruby
gfontenot has quit []
BrokenCog has joined #ruby
phinfonet_ has joined #ruby
AlbireoX has joined #ruby
nateberkopec has quit [Quit: Leaving...]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
phinfonet has quit [Read error: Connection reset by peer]
clocKwize has joined #ruby
erichmenge has joined #ruby
Juul has quit [Quit: Leaving]
rburton- has quit [Ping timeout: 272 seconds]
rburton- has joined #ruby
waxjar has joined #ruby
clocKwize has quit [Client Quit]
balki_ has joined #ruby
alanp has joined #ruby
gavit has quit [Read error: Connection timed out]
cbuxton1 has quit [Ping timeout: 260 seconds]
infinitiguy has quit [Ping timeout: 268 seconds]
pastjean_ has quit [Remote host closed the connection]
etehtsea has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
gavit has joined #ruby
hero has joined #ruby
hero has joined #ruby
prtksxna has quit [Ping timeout: 245 seconds]
jimeh has joined #ruby
prtksxna has joined #ruby
kenichi has quit [Remote host closed the connection]
<kenneth> hey there
balki has quit [Ping timeout: 240 seconds]
alanp_ has quit [Ping timeout: 240 seconds]
<kenneth> anybody has experience generating short unique ids with no incrementing pattern and no collisions across a multi-server cluster?
justinmcp has quit [Remote host closed the connection]
phinfonet_ has quit [Quit: Linkinus - http://linkinus.com]
<apeiros_> kenneth: have a unique id per server and increment per server?
elhu has quit [Quit: Computer has gone to sleep.]
elaptics is now known as elaptics`away
<kenneth> apeiros_: how would you co-ordinate which id the server has, without telling it
asobrasil has left #ruby [#ruby]
<apeiros_> why "without telling it"?
kenichi has joined #ruby
<apeiros_> it has an IP in a local network
<apeiros_> so you probably already told it
klj613- has quit [Quit: leaving]
<apeiros_> assuming it is only a class C network, that'd be 1 byte of your unique id.
<matti> kenichi: Type 5 UUID?
<matti> kenneth:
<matti> Ops
banseljaj is now known as imami|afk
<apeiros_> that too, I assumed 128bit to be beyond his definition of short. but if it isn't, that's a viable solution.
qwerxy has joined #ruby
<matti> And its easy, realitvely.
<apeiros_> totally. SecureRandom.uuid
vaicine has quit [Ping timeout: 244 seconds]
* apeiros_ still waits for kenneth's answer on "why 'without telling it'"
pavelz has quit [Ping timeout: 244 seconds]
t33661 has quit [Remote host closed the connection]
t86630 has joined #ruby
chiel has quit [Ping timeout: 244 seconds]
hero has quit [Quit: Lost terminal]
baudoin has joined #ruby
vaicine has joined #ruby
pavelz has joined #ruby
<matti> apeiros_: He won't tell ;/ Does not want to share.
chiel has joined #ruby
justsee has joined #ruby
<davidcelis> secret sauce
verto|off is now known as verto
banisterfiend has quit [Remote host closed the connection]
<matti> Yeah
baudoin has quit [Client Quit]
rburton- has quit [Quit: rburton-]
<shevy> he is just thinking very slowly
banisterfiend has joined #ruby
<matti> Phew... shevy
<shevy> :)
<matti> shevy: You always bring the worse in people ;p
<shevy> my idol is the joker from The Dark Knight
<matti> Ah.
<matti> Fair enough.
<matti> Joker was actually awesome.
<matti> ;d
<shevy> yeah, very good acting
<shevy> made the others look less competent :P
<matti> Yeah
<shevy> but you see, the joker is a proponent of "there is more than one way to do things"
<shevy> he was pretending to be crazy as disguise
KillerFox has quit [Ping timeout: 265 seconds]
<matti> NaNNaNNaNNaNNaN ...
<matti> ;d
beneggett has quit [Quit: Computer has gone to sleep.]
<matti> [ I assume that everyone here has seen the talk ...
<matti> ]
timonv has quit [Remote host closed the connection]
<matti> Why is so damn hot .
<shevy> which one
<matti> shevy: The one about Watman.
<shevy> what temperature
[Neurotic] has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
Progster has quit [Ping timeout: 240 seconds]
<shevy> here it is 20.2°
tacheshun has joined #ruby
tacheshun has quit [Remote host closed the connection]
<matti> 20 in London
<apeiros_> hm, funny… with an 8byte ID, 2byte of it being the local part of the IP, 6bytes being used, with 1000 rows created per second and server, you'd not run out of ids for over 8000 years…
<apeiros_> 24.0°C here
brasten has quit [Quit: brasten]
Progster has joined #ruby
juarlex has joined #ruby
workmad3 has joined #ruby
tommyvyo has joined #ruby
<matti> And mosquitos.
joephelius has quit [Quit: reboot]
<apeiros_> did we put kenneth into a catharsis? o0
<kenneth> i'm trying things out
eikko has joined #ruby
<kenneth> i'm thinking of doing this, it's cleaner: while id = rand(2**32).to_s(32); break unless id_exists?(id); end
KillerFox has joined #ruby
<kenneth> pretty scary O notation, but considering how unlikely collisions will be, i think i'll be fine
pricees has joined #ruby
jlogsdon has quit [Remote host closed the connection]
cakehero has quit [Quit: Computer has gone to sleep.]
<matti> kenneth: Mix with Time.now and throw at SHA1 ;d
<apeiros_> kenneth: and how do you test id_exists? in a distributed env without race conditions?
<apeiros_> I think you're choosing one of the more horrible solutions
<apeiros_> also to_s(32)?!?
<kenneth> er, 36, i mean
<apeiros_> same question really…
GMFlash has quit [Quit: Computer has gone to sleep.]
<apeiros_> your db only supports non-binary string id's or what?
yasushi has joined #ruby
<apeiros_> (seems to beat the only possible purpose of "short" ids - cheap joins)
<workmad3> kenneth: SecureRandom.uuid
nateberkopec has joined #ruby
blazed has quit []
theRoUS has quit [Ping timeout: 244 seconds]
<apeiros_> (ok, the only other purpose would be: low memory requirement - but that's beaten too, and only matters with literally billions of records)
<kenneth> apeiros_: well, this is for a link-shortener type thing. i'm fine with the db containing a longer id (the string)
<workmad3> kenneth: SecureRandom.uuid
Stalkr_ has quit [Ping timeout: 268 seconds]
<apeiros_> that'd make 4 mentions of SecureRandom.uuid :)
<kenneth> you have a point about race conditions in the distributed system
<workmad3> apeiros_: I'm about to make it 5 ;)
qwerxy has quit [Quit: offski]
<apeiros_> workmad3: I'm all in favor of uuid, but I still wonder what the issue is with per-server incremented id…
<apeiros_> kenneth: base64 is probably shorter btw.
Synthead has quit [Quit: p33 ba115]
azm has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
pricees has left #ruby [#ruby]
<kenneth> apeiros_: yeah but uppercase chars in urls are kind of shady
<workmad3> apeiros_: yeah, uuid is really best if you want an ID that you can share across multiple systems
gmci has quit [Quit: Computer has gone to sleep.]
<apeiros_> workmad3: not best. but certainly easiest. at least type5
<kenneth> workmad3: uuids are great, and i use them a lot, but for a link shortener they don't do
yasushi has quit [Ping timeout: 248 seconds]
Progster has quit [Ping timeout: 244 seconds]
<kenneth> workmad3: the reason uuids are unique is because they just have so much entropy
<apeiros_> kenneth: random garbage characters are already shady
<apeiros_> using a wider variety makes no difference
<apeiros_> unless you intend to share the urls by voice/phone
jgarvey has quit [Quit: Leaving]
<kenneth> apeiros_: fine, but how do you suggest i create non-consecutive ids that are < char long in a distributed system without having to write my own version of zookeeper?
baphled has quit [Ping timeout: 240 seconds]
juarlex has quit [Read error: Connection reset by peer]
Aphelion has joined #ruby
juarlex has joined #ruby
Aphelion has quit [Changing host]
Aphelion has joined #ruby
gavit has quit [Read error: Connection timed out]
ttilley has quit [Disconnected by services]
Aphelion is now known as ttilley
<workmad3> kenneth: you could always try for SecureRandom.base64(4)
don1 has joined #ruby
gavit has joined #ruby
ringotwo_ has joined #ruby
beneggett has joined #ruby
<workmad3> kenneth: distributed uniqueness is a difficult problem in most cases though...
xargoon has quit [Ping timeout: 260 seconds]
<apeiros_> kenneth: as said, how about the local part of the IP?
ringotwo has quit [Read error: Connection reset by peer]
<workmad3> kenneth: and also gotta ask, do we really need another link shortener? :P
banisterfiend has joined #ruby
hsbt_ has quit [Ping timeout: 260 seconds]
<kenneth> workmad3: it's part of a different product. i'm not re-writing bit.ly ;)
hsbt_ has joined #ruby
<workmad3> heh
<apeiros_> workmad3: if you use 4, you can just as well use 6
Dreamer3 has quit [Ping timeout: 260 seconds]
pricees has joined #ruby
xargoon has joined #ruby
jenrzzz has joined #ruby
<workmad3> apeiros_: fair point :)
stopbit has quit [Quit: Leaving]
waxjar has quit [Ping timeout: 260 seconds]
techsurvivor has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 252 seconds]
Dreamer3 has joined #ruby
waxjar has joined #ruby
pricees has left #ruby [#ruby]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
pricees has joined #ruby
fastred has quit [Quit: fastred]
<krz> am i not allowed to throw an array into a function? i.e. foo(['foo', 'bar'])
revans has quit [Quit: Linkinus - http://linkinus.com]
<apeiros_> krz: those are methods. and yes, you're allowed.
<krz> i get undefined method `merge' for ["non_followers_count", "males_count", "views_count"]:Array
<apeiros_> krz: well, that sounds like that particular method does not *want* an array
<apeiros_> but rather a hash
cakehero has joined #ruby
<apeiros_> mep, I think I'll never be told why that local part of IP is deemed unworthy :-(
<kenneth> workmad3: SecureRandom.random_number(2**32).to_s(36)
<kenneth> how does this sound?
mynameisted has quit [Remote host closed the connection]
brasten has joined #ruby
GMFlash has joined #ruby
<krz> apeiros_: but why? my method looks like def foo(some_array)
<workmad3> kenneth: like a long-winded way of SecureRandom.urlsafe_base64
jimeh has quit [Ping timeout: 240 seconds]
<krz> by default, methods don't accept arrays?
<krz> only hashes?
<workmad3> krz: no... j
<apeiros_> krz: oh my
<davidcelis> w...tf
<apeiros_> krz: no, your method tells you that it does not want an array
<apeiros_> krz: and no, it has absolutely nothing to do what ruby itself wants. ruby itself doesn't care what kind of object you pass.
<kenneth> workmad3: except it's base 36 -- we want ids to not have caps
<workmad3> kenneth: meh, whatever
syamajala has joined #ruby
<apeiros_> kenneth: with base 36 you can increase your entropy to 2**36. but… meh
<apeiros_> yeah, whatever :)
<workmad3> kenneth: sounds like you've convinced yourself what you want to do
<workmad3> kenneth: and nothing anyone here says will be listened to unless it's 'yes, go ahead'
<workmad3> kenneth: so sure, go for it... whatever
<krz> apeiros_: how do i set the method to accept an array
<apeiros_> krz: why do you use merge on your argument?
baroquebobcat has quit [Quit: baroquebobcat]
<workmad3> krz: you accept an array by not treating it like a hash...
MarioEIU has quit [Ping timeout: 246 seconds]
<krz> I'm not using merge on any argument
<apeiros_> yes you do
<apeiros_> ruby tells you as much
<apeiros_> 00:40 krz: i get undefined method `merge' for ["non_followers_count", "males_count", "views_count"]:Array
<apeiros_> maybe you want to actually *read* the exception you get.
<krz> is rails enforcing something in my models?
t86630 has quit [Remote host closed the connection]
jrist is now known as jrist-brb
<apeiros_> oh dear
<krz> i literally have foo(array_here) and def foo(array_here)
<shevy> more so than in your pants!
t45972 has joined #ruby
manizzle has quit [Read error: No route to host]
<apeiros_> krz: it does *not matter*, *at all* how your arguments are called
<apeiros_> it's not like ruby understood english.
<shevy> my ruby does!
<krz> where am i explicitly throwing a merge?
<shevy> but with a japanese accent
nilg has quit [Read error: Connection reset by peer]
gmci has joined #ruby
<matti> shevy: ...
<matti> shevy: Yours is just the Bruce Lee edition.
pipegeek has joined #ruby
<apeiros_> krz: you ask without giving the code? what do we think? that we can tele-read your code? read your mind?
<apeiros_> seriously, things like that annoy me
* apeiros_ off
bowlowni has quit [Remote host closed the connection]
<shevy> krz you must show code on pastie.org
<krz> apeiros_: no. again. i told you how my methods are
juarlex has quit [Remote host closed the connection]
<krz> read properly
<apeiros_> krz: "def foo" is NOT the method body
juarlex has joined #ruby
azm has quit [Ping timeout: 272 seconds]
<krz> if you suggest that rails is implicitly throwing a merge. then yes that makes sense
<apeiros_> but hey, have fun finding coders who are psychic and willing to help.
<matti> apeiros_: --> shevy
<shevy> krz rails is based on ruby
mklappstuhl has quit [Ping timeout: 246 seconds]
<shevy> you use .merge on class Array
<shevy> this method does not exist in pure ruby
jimeh has joined #ruby
pricees has quit [Quit: leaving]
pricees has joined #ruby
saispo has quit [Ping timeout: 260 seconds]
SQLStud has quit [Quit: Leaving]
<shevy> the only m methods there are #map and #map!
<shevy> rails does wicked black voodoo magic
<shevy> we have sent them on another island, which can be found on #rubyonrails
<matti> ActiveSupport kills kittens.
<shevy> :(
cakehero has quit [Quit: Computer has gone to sleep.]
<shevy> that's not nice
rburton- has joined #ruby
<davidcelis> it's not magic if people would just RTFM
manizzle has joined #ruby
saispo has joined #ruby
<matti> davidcelis: That is even more impossible than magic.
<davidcelis> haha
<matti> davidcelis: Pigs will fly, shevy will sing in alto...
<matti> davidcelis: But get folks to read documentation...
<matti> davidcelis: Man..
gavit has quit [Read error: Connection timed out]
MrWGW has quit [Ping timeout: 244 seconds]
<shevy> documentation ought to be fun to read
justinmcp has joined #ruby
<shevy> die, rdoc, DIE
<matti> shevy: When you have pop-put 3D things like in the childrens books ;d
<shevy> hey
<shevy> I like children books
<apeiros_> davidcelis: if only they didn't decide that a couple of things are internal and thus don't need documentation :-(
<shevy> they are easy to understand :)
<matti> shevy: I know ;ppp
gavit has joined #ruby
<shevy> I used to love reading donald duck etc... comics
bradhe has quit [Remote host closed the connection]
<shevy> watching tom and jerry all the time... I loved the intro music
<matti> shevy: :)
<krz> ah i got it. update_counters was a reserved method. works otherwise
<matti> shevy: Go Anime then!
<krz> foo was update_counters
<matti> krz: :)
<shevy> matti hmmm anime never "clicked" in my mind much
<shevy> krz good man
<workmad3> shevy: just like ruby, eh? :P
<shevy> workmad3 nah, ruby clicked
<shevy> I just have a very definite style
<shevy> oh one thing does not click yet
<shevy> rewrite vs. start-from-zero-anew
<workmad3> shevy: isn't that because those are the same thing?
<shevy> not completely! right now I rewrite my oldest and largest ruby project, I started from zero, but I also want to retain most of the old features... but I can't copy / paste 1:1
v0n has quit [Ping timeout: 246 seconds]
axl_ has quit [Ping timeout: 244 seconds]
<shevy> and it annoys me
<shevy> I am in the mood where I say "screw it" and discard the old stuff entirely
<shevy> but then I would lose old features that used to work :(
chrisbolton has quit [Quit: chrisbolton]
<workmad3> shevy: right, so what you're trying to do isn't what most people call a rewrite, it's trying to clean up the original
<shevy> I used to be able to compile similar to linux-from-scratch from zero in the past
LouisGB has quit []
<shevy> with that project. right now I am not too close to it anymore :(
<workmad3> shevy: rewrite generally means throw it all away and start again :P
fridim_ has quit [Ping timeout: 246 seconds]
<shevy> don't tempt me!!!
<shevy> well
<shevy> it all feels a bit silly to rewrite
<shevy> it used to work in the past... just was not very clean and such
<shevy> I'd rather like to come to a point where I would never have to rewrite anything at all again
<workmad3> shevy: yeah, the rewrite argument goes 'if we start from scratch, we can do a better job with the design, we know more, we can do it all better now'
MrWGW has joined #ruby
<shevy> hehe
axl_ has joined #ruby
johnlcox has quit [Ping timeout: 244 seconds]
<shevy> yeah
<shevy> the beginning was easy
<shevy> but now I have about 40 different old .rb files left
<workmad3> shevy: while the refactoring to more maintainable code says that the big rewrite argument is bs and you shouldn't throw the entire thing away, you should gradually refactor it to turn it into a more reasonable code base
SegFaultAX has quit [Ping timeout: 244 seconds]
brasten has quit [Quit: brasten]
<shevy> I do this with my newer projects, rewriting things slowly one thing at a time
pricees has quit [Quit: leaving]
<shevy> but that old one here... was just awful
brianpWins has quit [Quit: brianpWins]
joephelius has joined #ruby
pricees has joined #ruby
cloudpokerdb has joined #ruby
<shevy> well
<workmad3> shevy: end of the day, it has to come to a cost-benefit argument...
mmokrysz has joined #ruby
<shevy> if I could jump back in time, I would not rewrite it from 0 again
mmokrysz has left #ruby [#ruby]
kevlar_ has joined #ruby
pricees has quit [Client Quit]
pricees has joined #ruby
<kevlar_> Is $! set when a sub-process exits?
t45972 has quit [Remote host closed the connection]
<workmad3> shevy: bearing in mind that a complete rewrite does mean you need to invest resources into just getting it back to the current level of implementation, but it might still be more cost-effective to do that as opposed to refactoring if the code base is *really* bad
waxjar has quit [Ping timeout: 245 seconds]
jrist-brb is now known as jrist
<shevy> hmm
t50348 has joined #ruby
brasten has joined #ruby
butblack has joined #ruby
erichmenge has quit [Quit: Be back later]
<shevy> workmad3 are there ways to never reach the point where one feels "screw this all, I am going to rewrite this whole shit rather than patch-fix it"?
<workmad3> shevy: none that I've come across yet
<workmad3> shevy: but that because, given a few months or a year, I'll almost always find a better way to do *something*
<shevy> hmmm
MrWGW has quit [Ping timeout: 240 seconds]
xaq has quit [Remote host closed the connection]
tomsthumb_ has quit [Quit: Leaving.]
waxjar has joined #ruby
<workmad3> shevy: and besides that, no design is perfect, it always has some things it helps and some things it hinders... if your current design happens to not be brilliant for where you actually want to take the project, you're probably going to end up with a bit of cruft or technical debt
kirun has quit [Quit: Client exiting]
MrWGW has joined #ruby
<workmad3> shevy: although there is some code I never think of rewriting... code I never look at anymore :P
<shevy> it's not only the code btw... I'll also have to check whether the documentation is ok, and update the tutorial... :( is not much fun
<shevy> well
banisterfiend has quit [Remote host closed the connection]
<shevy> with small projects, things are so much easier
brasten has quit [Ping timeout: 246 seconds]
<shevy> I seem to lose the overview once there are around ~50 different .rb files
quest88 has joined #ruby
Banistergalaxy has joined #ruby
<workmad3> how much source file organisation do you do?
ilyam has quit [Quit: ilyam]
SegFaultAX has joined #ruby
<shevy> hahaha
<shevy> what is that :P
<workmad3> shevy: yeah... that's probably where I'd start then :P
<shevy> ok specific example
<shevy> there is lib/ ...
<shevy> lib/name_of/project/
<shevy> oops
<shevy> lib/name_of_project/
<workmad3> shevy: I want to start organising files once I hit about 5-10 files in a single directory
goyox86 has quit [Remote host closed the connection]
<shevy> four directories in that latter directory. core/ addons/ dependencies/ and yaml/
<shevy> and most .rb files reside right at the base of lib/name_of_project/
<shevy> hmm 34 .rb files in that base dir right now
<workmad3> right, so that file organisation says to me 'I have no real structure, I'm probably filled with quite tightly coupled subsystems'
<shevy> yeah
<workmad3> whether that's true or not... that's what the file structure says :)
<shevy> sorry, afk just a few minutes, have to go downstairs
Guest23734 has quit [Ping timeout: 252 seconds]
artOfWar has quit [Remote host closed the connection]
<workmad3> and if the files are saying that, it's easy to slip and let it actually happen... a bit of organisation in your files and it's easier to remember that 'no, this Foo widget can't talk to the Bar dohicky because they shouldn't know about each other... do this properly dammit!'
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
virunga has quit [Quit: Sto andando via]
<workmad3> I've g2g now though... time to get to bed, work in the morning :(
resure has joined #ruby
SegFault1X|work2 is now known as SegFaultAX|work2
macmartine has joined #ruby
don1 has quit [Quit: WeeChat 0.3.8]
techsurvivor has joined #ruby
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
resure has quit [Read error: Connection reset by peer]
resure has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
emmanuelux has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
<kenneth> hey, how can you convert a yaml object to a hash
<kenneth> to in this case, a yaml seq to an array
tommyvyo has quit [Quit: Computer has gone to sleep.]
<bperry> YAML.parse(yaml_string)
<bperry> require 'yaml'
<bperry> returns a hash
artOfWar has joined #ruby
flip_digits has quit [Quit: Computer has gone to sleep.]
seanstickle has joined #ruby
<matti> kenneth: YAML.load "--- \n- 1\n- 2\n- 3\n" ?
joephelius has quit [Quit: WeeChat 0.3.8]
<bperry> maybe it is load
<bperry> I thought it was parse though, willing to eat my words
<matti> JSON has parse
<matti> ;]
emmanuelux has quit [Read error: Connection reset by peer]
<bperry> ah
<bperry> that is what I am thinking of
<bperry> too many acronyms
ephemerian has left #ruby [#ruby]
SCommette has joined #ruby
<matti> :>
waxjar has quit [Quit: Ah! Well, prepare to put mustard on those words, for you will soon be consuming them along with this slice of humble pie that comes direct from the oven of shame, set at gas mark "egg on your face"! I sort of forget what I was talking about.]
pu22l3r has quit [Ping timeout: 245 seconds]
emmanuelux has joined #ruby
drago757 has joined #ruby
cj3kim has joined #ruby
gavit has quit [Read error: Connection timed out]
gavit has joined #ruby
<aces1up> just curious, the ruby runtime that runs on windows is always ming right? specifically from the if installed via the rubyinstaller?
subbyyy has joined #ruby
cj3kim has quit [Client Quit]
Russell^^ has quit [Quit: Russell^^]
drago757 has quit [Read error: Connection reset by peer]
Eplemosen has quit [Quit: NOPE]
havenn has quit [Remote host closed the connection]
cbuxton has joined #ruby
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
t50348 has quit [Remote host closed the connection]
t90666 has joined #ruby
<Spooner> aces1up : Yeah, it is compiled under mingw. You can compile it with VC++, I think, but no reason to bother any more.
cj3kim has joined #ruby
kevlar_ has quit [Remote host closed the connection]
<kenneth> bperry: it doesn't, it returns a YAML::Syck object
<kenneth> which i can't figure out how to just convert to a hash
<kenneth> oh wait
xbayrockx has joined #ruby
<kenneth> load returns a hash, while parse returns random YAML objects
<kenneth> i get it
<kenneth> weird
uris has quit [Quit: leaving]
xbayrockx has quit [Client Quit]
apeiros_ has quit [Ping timeout: 240 seconds]
<Spooner> kenneth : It can return an array or hash. Depends on the contents of the file.
Juul has joined #ruby
ken_barber has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
resure has quit [Remote host closed the connection]
flip_digits has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
brdude has quit [Quit: brdude]
emmanuelux has joined #ruby
gavit has quit [Read error: Connection timed out]
chadkeck has joined #ruby
kenichi has quit [Remote host closed the connection]
cj3kim has left #ruby ["Leaving"]
gavit has joined #ruby
binaryplease has quit [Read error: Operation timed out]
h4mz1d has quit [Ping timeout: 245 seconds]
binaryplease has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
emmanuelux has quit [Read error: Connection reset by peer]
phanousit has joined #ruby
tomsthumb_ has joined #ruby
nu7hatch has joined #ruby
chadkeck has quit [Remote host closed the connection]
emmanuelux has joined #ruby
jimeh has quit [Ping timeout: 265 seconds]
chadkeck has joined #ruby
walbert has joined #ruby