apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
_whitelogger has joined #ruby
_whitelogger0 has joined #ruby
_whitelogger0 has joined #ruby
Poapfel has joined #ruby
bluenemo_ has joined #ruby
jbw has joined #ruby
rcs has joined #ruby
sj26 has joined #ruby
Vert has joined #ruby
niklasb has joined #ruby
CheeToS has joined #ruby
dbgster has joined #ruby
sharms has joined #ruby
danheberden has joined #ruby
khakimov has joined #ruby
philcrissman has joined #ruby
benatkin has joined #ruby
uris has joined #ruby
arturaz has joined #ruby
cha1tanya has joined #ruby
TDJACR has joined #ruby
alx- has joined #ruby
lucasefe_ has joined #ruby
tayy has joined #ruby
emet has joined #ruby
<luke3321> Hey all, I am having an issue with Net::FTP#putbinaryfile. It gives an EOF when I try to pass a jpg
<luke3321> Anyone seen this before?
petercs has joined #ruby
mucker has joined #ruby
luckyruby has joined #ruby
Karmaon has joined #ruby
looopy has joined #ruby
ananthakumaran has joined #ruby
francisfish has joined #ruby
<shevy> luke3321 what is the mode you use
<luke3321> Active
kevinbond has joined #ruby
<shevy> I mean is it "When true, transfers are performed in binary mode. Default: true." ?
<luke3321> Ah. Never set that, so its the default, true
<shevy> hmm
gtuckerkellogg has joined #ruby
<luke3321> Once it hits the EOF, the ftp object becomes unusable. Any method calls after that all give EOF too
francisfish has joined #ruby
dustink has joined #ruby
<shevy> perhaps the connection was (auto)closed
zastaph has joined #ruby
<luke3321> I don't see why that would be :/
<luke3321> Though it would make sense
<luke3321> As to why it keeps getting an EOF
<shevy> have you tried with another FTP host yet?
<luke3321> Don't have one
<luke3321> I'm gonna keep prodding it though. Thanks for your help
kenperkins has joined #ruby
dustink has quit [#ruby]
linoj has joined #ruby
jbomo has joined #ruby
<shevy> I just tried with two differen hosts
<shevy> one host says the image contains errors
<shevy> another one shows the same image just fine
<shevy> none of them report a EOF though :)
<luke3321> hm
<luke3321> Either of them goddady by chance?
<shevy> but I have this "remote host closed the connection" thing
<shevy> nah
<shevy> I dont know how to reopen such a closed connection
<luke3321> Yeah. I wouldn't be surprised if it was Goddady messing me up somehow
<luke3321> Not sure you can
jimeh has joined #ruby
<luke3321> if you call login again, it complains
<shevy> hmm
LMolr has joined #ruby
strife25 has joined #ruby
jetblack has joined #ruby
jetblack has joined #ruby
ananthakumaran has joined #ruby
fukushima has joined #ruby
ronniy has joined #ruby
heldopslippers has joined #ruby
KL-7 has joined #ruby
savage- has joined #ruby
subbyyy has joined #ruby
<luke3321> Ugh. Hidden deep on godaddy's website
<luke3321> They only accept passive connections for binary uploads
quest88 has joined #ruby
andrewhl has joined #ruby
<shevy> hehe
<apeiros_> ftp…
<apeiros_> so 1980
<luke3321> Yeah. Again, godaddy :P No other way to access the account
<luke3321> (other than SFTP, but that wont work here)
ken_barber has joined #ruby
<Spaceghostc2c> People actually use godaddy for hosting still?
<luke3321> Not by choice, trust me lol
<luke3321> Thank god out rails apps aren't up there
<luke3321> eesh. That would be all bad
Seoman has joined #ruby
<banseljaj> Isn't it trivial to move off of GoDaddy hosting?
<luke3321> We don't host anything other than a few static html files there
mcwise has joined #ruby
<luke3321> We mainly abuse their unlimited disk space promise
<luke3321> ;)
<banseljaj> I don't do even that
<luke3321> Hence the FTP
<banseljaj> Although I do buy my domains off of them
<luke3321> Mmmm. My choice for cheap webhost is Dreamhost
<luke3321> but this be a work project, and their account is with godaddy
zakwilson has joined #ruby
eph3meral has joined #ruby
<banseljaj> I use FatCow
<Spaceghostc2c> luke3321: My choice for a cheap webhost is myself on my linodes. But for shared... hm.
<Spaceghostc2c> I haven't used shared hosting like that in years.
cantonic has joined #ruby
<luke3321> Spaceghostc2c: Mhm. I would love a VPS, but alas, it isn't my decision
<eph3meral> no reason to go shared anymore, not with EC3 and Rackspace Cloud
<Spaceghostc2c> luke3321: Hopefully in another lifetime. :D
<Spaceghostc2c> eph3meral: Why bother with rackspace?
<eph3meral> Spaceghostc2c, you don't like rackspace?
<luke3321> Spaceghostc2c: Hopefully once this damn school stops eating all my funds ;)
<eph3meral> Spaceghostc2c, or perhaps, please tell me why not, because I don't know :)
<Spaceghostc2c> eph3meral: I used it really shortly and didn't like paying for bandwidth. It should give some bandwidth initially.
<Spaceghostc2c> Nothing else really bugged me.
<eph3meral> ahh, right bandwith, sure - I kind of didn't like that either
<Spaceghostc2c> These days I just use AWS and Linode.
<eph3meral> i just use it for dev servers myself, so there's like zero traffic
<Spaceghostc2c> Linode has the best service support ever.
<eph3meral> rackspace is supposed to be "fanatical" :)
<Spaceghostc2c> Never waited longer than 15 minutes to receive a human reply.
<eph3meral> i've not had a problem with rackspace support so far, though not too many reasons to use it
<eph3meral> yeah that's pretty good
<luke3321> Rackspace used to be big on human to human contact
<Spaceghostc2c> Even on Christmas Eve.
<luke3321> I signed up for an account and they rang my cell 10 minutes later
<eph3meral> Spaceghostc2c, honestly the AWS web calculator was so ghetto, I didn't even bother trying their service! lol
<Spaceghostc2c> I might try voxel next though, for a dedicated server.
Eldariof-ru has joined #ruby
<Spaceghostc2c> eph3meral: It's pretty 'ugh', to be honest.
<eph3meral> i'm sorry, but, if you're gonna be a leet host, you need to not have web forms that look like they did when you were a startup
<Spaceghostc2c> Anything longlived goes onto linode.
<luke3321> Oy, don't knock startups
<luke3321> We can have nice stuff too :P
<eph3meral> luke3321, i'm not knokcking them at all, yo
<Spaceghostc2c> Pros shouldn't play like startups. :D
Manhose has joined #ruby
scb has joined #ruby
<eph3meral> luke3321, do you remember what amazon looked like in the 90s?
* Spaceghostc2c is in a pretty epic startup himself
wallerdev has joined #ruby
<eph3meral> it has nothing to do with the "startup" ness and has everything to do with the ghettoness
<luke3321> Hah. Not at all. Not old enough :P
<eph3meral> c'mon, a company that big - should be able to afford a few friggin graphic designers
<Spaceghostc2c> eph3meral: They're still using rails on their front-end, I believe.
<eph3meral> anyway - i'm well aware that form != function all the time, but still - anyway, I will have to check linode
<Spaceghostc2c> eph3meral: If you do, perhaps consider using my nifty invite code?
<luke3321> Spaceghostc2c: We'll be looking for VPS in the next few weeks here, we may use your code :P
<Spaceghostc2c> D'aw <3
mmcgrath has joined #ruby
<mmcgrath> I'm trying to build a rubygem but gem thinks it requires native build tools, where can I go to find out why it thinks that?
<Spaceghostc2c> I've got 13 people I've showed Linode to that bought it. It's cool.
<Spaceghostc2c> mmcgrath: Look through your dependencies?
schovi has joined #ruby
<mmcgrath> Spaceghostc2c: all of the deps are already installed
<Spaceghostc2c> But do they use extensions?
<mmcgrath> how can I tell? it's parseconfig, rest-client, rake, sshkey and net-ssh
<eph3meral> Spaceghostc2c, is there a control panel demo anywhere?
<eph3meral> Spaceghostc2c, they mention the "control panel" on the home page, so I'm curious to see what its like
<eph3meral> I'm actually a pretty big fan of the Rackspace control panel where you can start and stop your VPSes at will
<Spaceghostc2c> It's pretty nice. Let me see if I can dig something up.
<Spaceghostc2c> I'm going to open a support ticket to tell them to update this. http://www.linode.com/features.cfm
<luke3321> eph3meral: That is a pretty nifty CP. they also exposed it over REST
<Spaceghostc2c> This is the old dashboard.
<luke3321> So, who wants to play "Break Luke's rails app?" :D
<eph3meral> i should hope it's an old shot, Ubuntu 7.04! :P
workmad3 has joined #ruby
kstephens has joined #ruby
<luke3321> Spaceghostc2c: Which startup do you work at?
<Spaceghostc2c> DealerMatch.
<Spaceghostc2c> So, it's a Sunday, let's see how long Linode takes to respond.
<luke3321> Ah. Cool concept. You all do pretty well for yourselves businesswise?
MrGando has joined #ruby
foofoobar has joined #ruby
<Spaceghostc2c> luke3321: We're doing really stellar, actually. We're a startup of Cox Enterprises, so our amount of data in the vehicle trade field is massive.
ph^ has joined #ruby
<luke3321> Spaceghostc2c: Ah. Very cool. Lots of dealerships changing hands then I guess? Something you never really think about :P
<foofoobar> Hi. I'm using webrick for a simple http proxy. Is it possible to add/delete/modify some headers before sending it to the client?
<luke3321> Spaceghostc2c: Good for you guys to find a niche in there :D
<Spaceghostc2c> luke3321: Yeah, we just launched in March.
<luke3321> Spaceghostc2c: Ooh. Even newer than us. Cool cool
<Spaceghostc2c> luke3321: Already have 1.5 million cars in the database (way way way more than our competitors) and we have users actually asking when they can start paying to use our service.
<Spaceghostc2c> We had our first trade in the system last week. $4400 for a car. Then another the following day, I don't know the details on that trade though.
<Spaceghostc2c> luke3321: What's your startup?
rdesfo has joined #ruby
<otters> oops
<otters> wrong window
<luke3321> Spaceghostc2c: Little place called Social Print Studio. We run an Instagram printing business
<Spaceghostc2c> This is never the wrong window.
<Spaceghostc2c> luke3321: Oh bitchin'!
kenperkins has joined #ruby
<luke3321> Spaceghostc2c: You can check out the website: http://printstagr.am
maxok has joined #ruby
<Spaceghostc2c> luke3321: We're still in alpha, http://dealermatch.com
<luke3321> Spaceghostc2c: Time to try SQL injection ;)
<luke3321> haha
<Spaceghostc2c> luke3321: Good luck. We aren't using relational databases.
<luke3321> We are actualling pushin our new beta site now
Guest52251 has joined #ruby
<luke3321> Aw. Nuts. there goes that idea
<Spaceghostc2c> Although if you can exploit it using map reduce functions, I'd be impressed.
greenarrow has joined #ruby
<luke3321> Spaceghostc2c: Already in. Nice deal you guys made last week
<Spaceghostc2c> luke3321: Your startup looks awesome! Do you use another meatspace service for the printing?
<luke3321> Spaceghostc2c: FTP files to taiwan, a printer there knows how to print our crap
<Spaceghostc2c> Oh wow, they responded two minutes later on that linode ticket.
<workmad3> luke3321: international?
<luke3321> workmad3: You know it
* workmad3 looks for UK prices
<luke3321> Same prices, a bit more shipping
SphericalCow has joined #ruby
* shevy looks for workmad3's underwear
<luke3321> $6 more? something like that
<workmad3> that's a fair whack more :(
<luke3321> That's what our printer charges us :/
<workmad3> yeah, I know the reasons... but it does alter purchase behaviour
<luke3321> Wait.. $2 more
vjacob has joined #ruby
<workmad3> ah, that's a bit different then :)
<luke3321> $6 if you order 2 products that come from printers on opposite sides of the globe :P
<workmad3> heh
<luke3321> Its a really odd system. We have someone meeting with the printer right now trying to streamline it
<workmad3> so... are you tracking metrics for orders from different printers so you can standardize your costs? :)
<luke3321> We are
<luke3321> The analyzation of that data needs to be done though ;)
<workmad3> cool... I'd be interested in reading a blog post or article on that sort of stuff if you ever write one up
<luke3321> Maybe one day
<luke3321> My focus is our new site
<workmad3> yeah, I get that :)
<luke3321> We don't have a shopping cart as it is, so this new site is pretty high on the todo list
<luke3321> You all can screw around on it and try break it if you want: http://printstagr.am/testnew/
workmad3_ has joined #ruby
wallerdev has joined #ruby
<shevy> yay \o/
<shevy> that's the spirit, give the kids something to break and smash!
<luke3321> I garuntee you will find bugs. Especially once you try building an order lol
<shevy> laaaaaaaag
<luke3321> The atrocity that is my JS
<luke3321> Sorry, server is just coming out of a reboot
<luke3321> It will speed up
<workmad3> luke3321: .php <-- fills me with rage :P
<Spaceghostc2c> ^
<luke3321> Yeah.... Its written in ruby.... So......
<shevy> found something!
<shevy> http://printstagr.am/testnew/stickers.php# <-- that popup I can't close
<workmad3> luke3321: so why do you have php extensions? make people think it's PHP and put them off the trail? :)
<luke3321> workmad3: Our design guy thinks its funny to write HTML/JS and give it a php extension
<workmad3> luke3321: ah, so any files like that are pretty much static placeholders?
<luke3321> workmad3: Not pretty much, are
<luke3321> :P
kevinbond has joined #ruby
<workmad3> luke3321: :)
<luke3321> Just a few humble pages hosted on GoDaddy
<luke3321> Now let me wash my mouth out for having said that
<workmad3> luke3321: href="#" on your slider links... bleh :P
* workmad3 is nitpicking now :)
<luke3321> workmad3: Its all JS, so it has to be
<workmad3> luke3321: not true... you can just do href=''
<shevy> luke3321, http://oi50.tinypic.com/2m4djsl.jpg I click on that X and nothing happens
<workmad3> luke3321: and considering you're preventing default behaviour anyway, the href is lieing ;)
<luke3321> workmad3: Tell that to my JS guy. I do the backend :P
<workmad3> *lying
<luke3321> shevy: Your fault for clicking on the picture :P
<shevy> let's prank the JS dude!
<workmad3> luke3321: it's a wart is all :)
<workmad3> hardly matters either way... just... bleh :)
<shevy> the JS dude is full of warts
looopy has joined #ruby
<luke3321> shevy: Yeah, I will make sure to let him know that everything blows :P
ananthakumaran has joined #ruby
<workmad3> http://printstagr.am/testnew/memorybox/# <-- what's the 'bought' link meant to do there?
<shevy> nono not so unspecific... just show him the specific warts we discovered so far :D
<shevy> I should make my new profession "professional wart finder"
<luke3321> workmad3: Ah. Placeholder with a link to an article about the aquisition
<luke3321> Waiting to hear what article to put in there
cha1tanya has joined #ruby
<workmad3> shevy: if you can get paid well for it, that's a good idea :) it's pretty easy with JS after all... print off the code, hang it on the wall and throw darts at it. Anywhere the dart lands will be a wart :)
<shevy> hmm
<shevy> I dont like JS enough :(
<luke3321> workmad3: Truer words have never been spoken
<shevy> I mean to spend serious time with it
<luke3321> I am a fan of Node.js, but past that.....
A124 has joined #ruby
nimeacuerdo has joined #ruby
A124 has quit [#ruby]
<luke3321> Are you guys really reading the JS source? :P
<shevy> ewwwww
<shevy> not me
<shevy> my eyes turn blind if I look at wart code
<shevy> workmad3 is the professional
<shevy> he can look at uglies all the time
<luke3321> Okay good, because that's where I hid all the company passwords, in the JS comments
macmartine has joined #ruby
<luke3321> I have code that could make even him go blind ;)
<workmad3> luke3321: I had a quick look at what sources there were but it all looked fairly stock jquery stuff tbh
<workmad3> luke3321: and I cba to read through jquery plugin code :)
<luke3321> JQuery and Backbone.js
<luke3321> Yeah.
<luke3321> Mostly standard
<luke3321> Works, despite the uglies
<luke3321> That's all I care about lol
<workmad3> can't see any backbone in there (I'm looking at the testnew site)
<luke3321> nono, go and try buy something, there is more past what you are seeing
<workmad3> ah, I can't get to buying
<luke3321> Why's that?
<workmad3> it asks to link your instagram account and a) I wouldn't link an account to a beta site and b) I don't have an instagram account :)
<luke3321> Ah. fair enough.
<luke3321> That's where the heavy JS comes in
<workmad3> makes sense
<luke3321> its actually somewhat beautiful
<luke3321> and horrid
<workmad3> sounds like javascript
<luke3321> sounds like php
<luke3321> :P
<workmad3> no... PHP can't achieve beautiful
<luke3321> It can be beatiful for PHP
<workmad3> best PHP can manage is 'sorta pretty if you squint'
<luke3321> exactly
<luke3321> $whyDoAllMyVarsStartWithADollarSign
<workmad3> $this->sucks()
<luke3321> fun fact, in php: "a" + "b" == 0
Nathandim has joined #ruby
<luke3321> and "1.2" == "1.20" is true
<workmad3> luke3321: watched this yet? https://www.destroyallsoftware.com/talks/wat :)
<luke3321> I have not
<luke3321> I shall watch it once ALSA stop being dumb
<Nathandim> Do watch, I enjoyed it pretty much
scwh has joined #ruby
nlc has joined #ruby
<workmad3> luke3321: the JS ones in that vid are good :)
<luke3321> Ha. Very nice. I'm liking this so far
<luke3321> "Array plus Array is..... empty string"
rippa has joined #ruby
jameshyde has joined #ruby
nemesit|osx has joined #ruby
<luke3321> That was amazing
<luke3321> and much too short. I need more
<workmad3> :)
KillerFox has joined #ruby
<Nathandim> my reaction exactly!
TheShrew has joined #ruby
al3xnull has joined #ruby
nemesit has joined #ruby
<luke3321> This is the ruby room, so lets bash PHP
<luke3321> :P
mustafa has joined #ruby
frishi has joined #ruby
<workmad3> nah, that's more the rails room
* luke3321 goes to start a rails v php war
<workmad3> you think you need to start one? :)
scwh has joined #ruby
<banseljaj> luke3321: Don't we have enough ruby v wars already?
<banseljaj> Why can't we all ust get a long? :(
A66e9f1b8 has joined #ruby
<seanstickle> Oh, come now, no one uses Intercal
<banseljaj> luke3321: Fine. But If it's obvious., we don't need to prove that. :P
<seanstickle> But I use APL
<luke3321> SPARC assembly > all
<td123> apl is great, as long as you don't have to read it :P
<workmad3> seanstickle: intercal is like lisp... no one uses it, but everyone should :)
<seanstickle> APL is easy to read, once you learn the letters
<seanstickle> Just like any language
schovi has joined #ruby
<seanstickle> J is harder
<luke3321> Visual Basic > Ruby
<workmad3> seanstickle: do you java2k?
burgestrand has joined #ruby
<seanstickle> workmad3: I am unfamiliar with Java2k
<workmad3> seanstickle: every operation is probabalistic
<workmad3> seanstickle: system functions have about a 10% chance of failing randomly
tobago has joined #ruby
<seanstickle> workmad3: ah, neat!
<luke3321> Sounds like my kinda language
<luke3321> If they could get it up to 20%, I'd be in
<workmad3> luke3321: I'm sure you could tune it when compiling the compiler ;)
<banseljaj> <workmad3> seanstickle: every operation is probabalistic -- O.O
<luke3321> workmad3: Hmm... I could... I could also redefine string comparison to cast both string to ints and compare
<workmad3> banseljaj: good practice for distributed systems ;)
<luke3321> workmad3: Since I loved that feature in PHP just so much
<Veejay> Hi everyone, is it to be expected that Date.new(2012, 1, 4).cweek => 1 and Date.new(2012, 12, 31).cweek => 1 as well?
<workmad3> luke3321: :)
<banseljaj> :P
<Veejay> It doesn't make much sense
voodoofish430 has joined #ruby
<Veejay> (The two dates return 2012 as their year too)
<workmad3> luke3321: if you want a fun one, 'class TrueClass; def ==(lhs); false; end; end'
<seanstickle> Veejay: yup
<workmad3> Veejay: it can happen
<seanstickle> Veejay: unless you want to make years have 53 weeks
<workmad3> Veejay: depends on how calendar weeks are counted, and when they start #1
<Veejay> Damned dates
<workmad3> Veejay: indeed
<Veejay> They're finickey aren't they?
<workmad3> Veejay: yes, yes they are
Beakr has joined #ruby
<Veejay> The worst being that a good chunk of our app is using Javascript as well and handles dates differently too
Jamoka has joined #ruby
<workmad3> seanstickle: you can define cweek 1 as the first full week of the year, or cweek 52 as the last full week of the year and they both work
<luke3321> workmad3: Meh. Not even gonna try figure that out. Way too tired
<seanstickle> Yah, I was just looking at the source
<seanstickle> Responded too soon earlier
<workmad3> it's just both together that's... problematic :)
<workmad3> unless you want a 'witching week'
<Veejay> Maybe (day / 7.0).ceil.to_i would be a beter metric
<Veejay> better
Manhose_ has joined #ruby
<Veejay> What do you think?
<workmad3> Veejay: depends what you want it for
<luke3321> Just use 3 for the week no matte the date
<luke3321> *matter
<Veejay> luke3321: hahahah
<luke3321> It'll work, I promise
<Veejay> I wish sometimes I could take a massive brain dump in the code and have people cry over it
<Veejay> The week? 3 motherfucker.
<workmad3> :)
rdesfo has quit [#ruby]
<workmad3> Veejay: still... depending on what you are using the cweek for depends on suitability of your calculation
<workmad3> Veejay: and whether you couldn't just do (day / 7) instead (and have 0-based cweeks ;) )
<luke3321> I managed to get this line into a C program at work: l = --l % ++l
<luke3321> That made my coworkers cry a bit
cbuxton has joined #ruby
<luke3321> Especially since that behavior is undefined
<rippa> isn't that 1?
<luke3321> Not always
apeiros_ has joined #ruby
<luke3321> but usually
<luke3321> yeah
<luke3321> I used it as a replacment for i++ at the end of a loop
<luke3321> oops, +=, sorry
<workmad3> luke3321: hmm... 0 % 2
<Beakr> Getting a strange error involving require statements from lib/ https://gist.github.com/2551994
<luke3321> CRAP. l += ++l % --l
<luke3321> I'm too tired to be allowed on the internet
<workmad3> it's not normally 1... l = 4, 3 % 5, l = 5, 4 % 6...
<workmad3> ah, other way around, yeah :)
j-okta has joined #ruby
tayy has joined #ruby
<workmad3> ooh, fun... 2 % 0 :D
<workmad3> -1 % 1...
<workmad3> err... 1 % -1 even
<luke3321> You aren't supposed to think this far into it. Stop that
<workmad3> but it's fun.... it's like trying to work out numbers in base -2 :D
<workmad3> except a bit easier :P
j-okta has joined #ruby
<luke3321> lol. base -2. I know what I'm doing now....
* workmad3 wonders if luke3321's tired brain will explode with trying to work out base -2 numbering :D
<workmad3> banseljaj: because then we won't know who wins!!!
<banseljaj> :P
<luke3321> banseljaj: It's really quite simple
<virunga> omg that vid is awesome
Manhose__ has joined #ruby
pdtpatrick has joined #ruby
<luke3321> RoR/Ruby > PhP
* luke3321 managed to mistake octal values for 1-8 on his Discrete Math midterm, he has no chance here
<workmad3> luke3321: what? even CakePHP???
<seanstickle> Ruby vs APL!
KL-7 has joined #ruby
<workmad3> luke3321: also, intercal > *
<workmad3> luke3321: that's a valid (if unconventional) set of symbols for octal
<luke3321> workmad3: Not if you don't compensate for them being shifted up lol
<workmad3> luke3321: the question is, would you alter all values to correspond as 0 = 1, 1 = 2, etc... or just 8 = 0? :)
<luke3321> workmad3: in my case, 1=1 ... 8=8
<workmad3> luke3321: they're just symbolic representations... any 8 symbols will do :)
<Veejay> Ruby weeks start on a Monday, right?
<seanstickle> Yes, because Ruby is all about work.
<workmad3> luke3321: right... so you had an inconsistent symbolic representation for octal then :P
<luke3321> workmad3: Spot on. Best part is I knew it better than anyone else there
<seanstickle> Veejay: but, no seriously
<seanstickle> Veejay: Ruby weeks start on Sunday
<luke3321> workmad3: Shows what working fast can do for you
<seanstickle> Date.today.wday #=> 0
<workmad3> luke3321: I've picked up a very... peculiar... interpretation of maths nowadays :) basically, anything goes as long as you define it up front ;) it just doesn't examine well
<luke3321> workmad3: As nice as that sounds, that doesn't fly in a university math course
<luke3321> :P
<workmad3> luke3321: I *think* it's what you're meant to aim for with maths nowadays, but obviously they don't tell you about it @ school
<Veejay> seanstickle: Don't think so
<workmad3> luke3321: state your axioms, it's all just formal systems
<Veejay> Unless at_beginning_of_week does something tricky where it doesn't actually brings you to the beginning of the week
<luke3321> workmad3: True. The issue is, I don't think some of the professors grasp the concepts enough to understand that
<luke3321> workmad3: Its a sad day when you realize you know more in a class than the instructor
<workmad3> luke3321: I'm sure they *know* more than you... they just probably don't *understand* more :)
<luke3321> workmad3: Fair enough.
<Veejay> seanstickle: I feel you
<Veejay> But then
<Veejay> 1.9.3p0 :036 > Date.today.at_beginning_of_week.monday?
<Veejay> => true
<workmad3> luke3321: I notice that with a lot of things... it's not so much about knowing as about understanding
<luke3321> workmad3: Exactly. Sure, you can regurgitate the 2s compliment on an exam, but do you understand it well enough to be able to extend it to a 7s compliment
etehtsea has joined #ruby
daniel_hinojosa has joined #ruby
<seanstickle> Veejay: That looks a lot like Rails code
savage- has joined #ruby
<seanstickle> Veejay: not Ruby code
tayy has joined #ruby
<workmad3> luke3321: yeah... and in my case with 2's complement, I'd probably go with 'no' :)
<seanstickle> Veejay: which, as you can see, starts on Monday
<workmad3> seanstickle: it *defaults* to starting on monday... you can change it :)
<luke3321> workmad3: As a definition, (base)^(num digits) - (number to take compliment of in the base at left)
<seanstickle> workmad3: yes
<workmad3> luke3321: I never cared enough about 2's complement representation tbh...
<luke3321> workmad3: Nor do I. Knowing != caring :P
<Veejay> seanstickle: Yeah I just realized that
<Veejay> Sorry
<seanstickle> No worries
<workmad3> luke3321: low level internals never fascinated me enough, and now I've been out of uni for almost 5 years the non-fascinating stuff is starting to fade :)
<Veejay> Damn Rails creating inconsistencies
<luke3321> workmad3: I am 2 weeks out of the test and it is starting to fade ;) I much prefer the higher level stuff
cbuxton has joined #ruby
<workmad3> luke3321: I just remain confident that if I needed to, I know enough about representations etc. to figure it out from wikipedia ;)
nobitanobi has joined #ruby
<luke3321> workmad3: And that is all you really need. Its the "why memorize someones phone number if I have a phone book to look it up in"
<seanstickle> People still use phone books?
<luke3321> No lol
<workmad3> luke3321: oh, that one is easy... you lose your phone and need to call someone on a payphone
<luke3321> Not quite the point
<luke3321> workmad3: Tell Einstein that, not me :P
<nobitanobi> Given I have an array of hashes like this [{:category=>1, :name => 'rock'},{:category => 1, :name => 'indie'},{:category => 2, :name => 'classic'}]. How can I get an array with say, just hashes with category=1 ?
<seanstickle> nobitanobi: examine Enumberable#select
<workmad3> luke3321: which is why I have 4 numbers memorized... home, wife's mobile, my mobile (to make it easy to tell other people) and mothers...
<nobitanobi> seanstickle: ok
<luke3321> workmad3: You are doing it right ;) I have mine, parents, house, and yours memorized
<workmad3> luke3321: awesome :)
<workmad3> now, if I could only figure out why I memorized all my bank details too...
<workmad3> or at least rationalize it somehow
<luke3321> They always ask for them when you have the paperwork nowhere near you
<workmad3> other than 'don't need to dig anything out in order to buy stuff online' which is a really *bad* reason :)
<luke3321> Good reason to know em
<luke3321> and by "they", I mean the bank
<workmad3> I guess
<luke3321> Anywho, I am off to find something to eat.
<luke3321> Catch y'all later
<workmad3> cya
<luke3321> \quit "Looks like the octopus finally got to the router... Good game, sir... Good game..."
<luke3321> wow
<workmad3> lawl
<luke3321> way to screw me there chat client
<workmad3> :)
<workmad3> mixup between psql console and IRC there :P
<otters> I don't always typo a slash, but when I do, it involves pressing a key that's two spaces away
<luke3321> Worst part is, that is an alias
<workmad3> :D
<luke3321> I have to go edit a conf file now :(
<luke3321> lets try this again, manually
mikeycgto has joined #ruby
dv310p3r has joined #ruby
<Veejay> seanstickle: So Ruby weeks start on a Sunday. So the cweek for today and tomorrow should be the same, right?
<seanstickle> Veejay: I dunno
<Veejay> In irb this time, I'm getting 17 for Date.new(2012, 4, 29) and 18 for Date.new(2012, 4, 30)
<seanstickle> Sunday is day 0
<seanstickle> Which is different than saying this week starts on Sunday
<workmad3> but ISO week numbering starts on monday
<Veejay> :(
* Veejay grabs razor blade
<seanstickle> Welcome to the wonderful world of dates and times
<workmad3> Veejay: just wait till you need to deal with daylight savings ;)
<Veejay> Down the highway
<seanstickle> You think this is bad, wait until you have to deal with historical exceptions
<workmad3> ^^
<seanstickle> Like in 1752
<workmad3> that is fun too... the changeover from cesarian to gregorian calendar is awesome... there's like 10 missing days :D
<seanstickle> 11 days that don't exist
<Veejay> Time doesn't exist before the 1st of January 1970, everyone knows that
Boohbah has joined #ruby
<workmad3> Veejay: Time doesn't, but Dates do :P
<seanstickle> I remember doing coding to deal with the conversion to Y2K too.
<Veejay> haha, seriously?
fayimora has joined #ruby
<seanstickle> Dates are generally all fucked up.
<Veejay> What horror
<workmad3> right, I'm off :)
<workmad3> have fun with dates
<Veejay> Bye workmad3
piotr_ has joined #ruby
dotemacs` has joined #ruby
jgrevich has joined #ruby
aflag has joined #ruby
ananthakumaran has joined #ruby
mikepack has joined #ruby
nu7hatch has joined #ruby
ryandev70 has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [#ruby]
iMe has joined #ruby
ananthakumaran has joined #ruby
redgetan has joined #ruby
darren has joined #ruby
davidpk has joined #ruby
sebcioz has joined #ruby
chrxn_ has joined #ruby
<sebcioz> I would love to show my first small opensource project \o/ :D Comments welcome. http://blog.zuchmanski.com/2012/04/raxus-easy-file-sharing/
gtuckerkellogg has joined #ruby
<Spaceghostc2c> sebcioz: You should also support tar.gz and 7z!
tommyvyo has joined #ruby
waxjar has joined #ruby
<tommylommykins> hmm
<tommylommykins> one thing that's annoying me atm
<tommylommykins> is that printing of error messages is not serialised with things printed by puts in the same thread
<apeiros_> sebcioz: nice
<tommylommykins> so if a lot of stuff is being printed
<tommylommykins> the error message gets lost
<apeiros_> tommylommykins: it's your duty to handle error message and printing, so it's your duty to fix that…
ryandev70 has joined #ruby
<tommylommykins> hmm, I assume this means puts/print is nonblocking?
igotnolegs has joined #ruby
<apeiros_> it means puts/print is (almost) completely unaware of threading.
<apeiros_> if you thread, you are responsible for handling shared resources.
prometheus has joined #ruby
<apeiros_> since you print to the same $stdout, the $stdout is a shared resource. synchronize access (= printing) to it according to how you need/want it.
aj910martin has joined #ruby
dev_ryan70 has joined #ruby
<tommylommykins> mm, but in the case of an unhandled exception, I can't control how it's printed?
aj910martin has quit [#ruby]
<apeiros_> of course. handle it.
dev_ryan70 has joined #ruby
<apeiros_> have a toplevel rescue in your thread
zakwilson has joined #ruby
andrewhl has joined #ruby
maxok has joined #ruby
benatkin has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
aj910martin has joined #ruby
aj910martin has quit [#ruby]
Bosma has joined #ruby
nobitanobi has joined #ruby
sgaedu has joined #ruby
bak has joined #ruby
mikeric has joined #ruby
strife25 has joined #ruby
Russell^^_ has joined #ruby
workmad3_ has joined #ruby
LiranV has joined #ruby
LiranV has quit ["Leaving"]
burgestrand has joined #ruby
looopy has joined #ruby
bradyl0ve has joined #ruby
ukd1 has joined #ruby
Russell^^_ has joined #ruby
CheeToS has joined #ruby
indeterminate has joined #ruby
alem0lars has joined #ruby
rdesfo has joined #ruby
nobitanobi has joined #ruby
dv310p3r has joined #ruby
havenn has joined #ruby
kenperkins has joined #ruby
hukl_ has joined #ruby
rdesfo has quit [#ruby]
skaczor has joined #ruby
ronniy has joined #ruby
artm has joined #ruby
JonnieCache` has joined #ruby
zakwilson has joined #ruby
rdesfo has joined #ruby
andrewvos has joined #ruby
andrewvos has joined #ruby
andrewvos has quit [#ruby]
cdepue_ has joined #ruby
Bosma has joined #ruby
adman65 has joined #ruby
<shevy> dumdedum
twinturbo has joined #ruby
<canton7> slowday sunday
<dross> a bit
<dross> coding here
jgrevich_ has joined #ruby
Bosma_ has joined #ruby
kstephens has joined #ruby
audy has joined #ruby
<audy> what is the ampersand syntax doing in ary.map &:to_i ?
piotr__ has joined #ruby
<canton7> it's a litle cludge, called Symbol#to_proc
<Spaceghostc2c> ^
<Spaceghostc2c> kludge, even.
<TTilus> audy: its telling ruby that :to_i is _the_ parameter =D
nobitanobi has joined #ruby
<TTilus> audy: for real
<canton7> yeah, tired finger :S
<TTilus> audy: it tags parameter as block parameter
<TTilus> canton7: ampersand is no cludge, :to_i as block parameter is
<audy> you have confused me!
<audy> ary.map &:to_i is the same as ary.map { |x| x.to_i }
<TTilus> audy: as you probably know, every ruby method can receive a block as the last parameter even if it is not explicitly in parameter list
<canton7> the article I read originally was of the opinion that Symbol having a magic method that turned it into a proc, and using ampersand to magically call this method, was a bit of a kludge
<audy> so all the ampersand does is convert the symbol to a function and apply it to whatever variable the enumerator emits?
<TTilus> udk: ampersand does not do that
<TTilus> audy: ^
<TTilus> udk: sorry
punkrawkR has joined #ruby
<TTilus> audy: Symbol#to_proc does it
<audy> but it's not a proc. There is a missing variable there
<TTilus> audy: if .map gets something else than a proc as the block parameter, it calls #to_proc on it
<TTilus> audy: and lambda { |x| x.to_i } happens to be what #to_proc returns if you call it on :to_i
<audy> ah okay.
tayy has joined #ruby
<TTilus> audy: try it :to_i.to_proc.call("1")
baroquebobcat has joined #ruby
<audy> and that's how I'm going to program from now on
josefig has joined #ruby
<TTilus> audy: you can use the to_proc feature of #map et.al. yourself
josefig has joined #ruby
<TTilus> audy: =D
dagnachewa has joined #ruby
<dagnachewa> hi all
<dagnachewa> can't install ruby 1.9.3-p194 I get http://pastebin.com/FxGugRHK last lines of error.log
<dagnachewa> ffi stuff
<TTilus> audy: just remember how confused you were when you first saw it and only use it where speed is not crucial (it is slow) and it is readable
<Spaceghostc2c> dagnachewa: Using rvm?
becom33 has joined #ruby
<Spaceghostc2c> TTilus: Is the symbol to proc slow?
<dagnachewa> Spaceghostc2c, yes
<TTilus> audy: and if you really wanna confuse readers of your code, this is a nice way of accomplishing it, just define your own useful #to_proc shortcuts here and there and use them with #map et.al.
<Spaceghostc2c> TTilus: That reminds me of the dubstep tutorial song.
<audy> :to_proc.to_proc ??
<TTilus> audy: you got it \o/
sebastorama has joined #ruby
<Spaceghostc2c> Wrap that in a proc!
<TTilus> audy: or redefine Proc#to_proc and start having fun =D
<canton7> :to_proc.to_proc.call(:to_s).call(1)
<dagnachewa> Spaceghostc2c,
<becom33> https://gist.github.com/2552889 in this i made if only age is and if name is not set to enter the name 1st . but the problem is if I do like "ruby name.rb -a 21 -n John" it will check if the name is set 1st but I have enterd name in the list . how can I fix that .
<audy> lol
<becom33> another thing . Im not sure if I did this correctly
<becom33> anyone ?
* becom33 ?
<canton7> becom33, I'm not convinced you're doing it right... I'm not an OptionParser fan myself, but the man page suggests that you should be doing something like opts.on('-n', '--name NAME', 'Your name') do |name| ....
otherj has joined #ruby
<becom33> canton7, well I dont get . can you help ?
<otherj> guys, is there some easy way to separate objects in an array into categories to loop through? like i have @windows and or 3 of the things in the array thing.category is 'blue', and i want to loop through the blue bits into a table
<becom33> in |name| is just a boolian right ?
<shevy> use pp man
<shevy> pp name.class
<TTilus> becom33: id just switch to trollop right away...
<canton7> yeah, trollop is fantastic
waigani has joined #ruby
<becom33> shevy, Im sorry ? and TTilus what trollop ?
sei has joined #ruby
fayimora has joined #ruby
<TTilus> becom33: thats what i use if i need command line options
<becom33> TTilus, alright lemme check
<canton7> becom33, this is what I was on about: http://pastebin.com/KXt7hZNc
<shevy> becom33 you asked whether name is just a boolean. I say you dont have to ask, you can find out on your own any time, if you use pp
<canton7> but yeah, trollop is probably easier
<shevy> optionparser is annoying as hell though :D
jpagano has joined #ruby
<becom33> shevy, gimme a second to check your script and TTilus link
<shevy> what script ;P
<becom33> trollop I have to install right ?
<shevy> it is an addon, so yeah
toloykhan has joined #ruby
<becom33> aww
<toloykhan> hello every body
<Spaceghostc2c> Worth it.
<toloykhan> i need help with hashes
<toloykhan> could i set a hash value to a block?
<becom33> shevy, is it correct if I keep the lib_trollop.rb in the same directory as my script is . or should i put it into the ruby lib ?
<canton7> becom33, http://pastebin.com/zRsbr51M
<virunga> toloykhan, if the block is a Proc object i think so
<shevy> I have no idea what is lib_trollop.rb
jpagano has quit ["["Textual IRC Client: www.textualapp.com"]"]
davidpk has joined #ruby
<canton7> becom33, either make your user install the trollop gem, or stick trollop.rb in your gem's lib/
justinmcp has joined #ruby
<canton7> toloykhan, a = {:b => Proc.new{ puts "hi" }} ?
<toloykhan> virunga, i cant make it with irb
td123 has joined #ruby
<toloykhan> canton7, i will try this out
<becom33> another.rb:1:in `require': no such file to load -- trollop (LoadError)
<becom33> :( . I installed it by doing "sudo gem install trollop"
CannedCorn has joined #ruby
<shevy> did you never install anything via gems yet?
<becom33> nop :/
<shevy> and you use at least ruby 1.9.x right?
VegetableSpoon has joined #ruby
piotr_ has joined #ruby
<shevy> start irb, then do 'require "trollop"' and look if this returns true
<becom33> I just made dir named 'lib' and put the trollop file into it . works anyway :/
<becom33> btw Im getting warning on the script
<becom33> another.rb:3: warning: already initialized constant ARGV
<shevy> and what is the content of another.rb
<canton7> becom33, yeah, that's just because I overwrote ARGV for testing purposes. Just nuke it
<becom33> aghhh alright
jondot_ has joined #ruby
nobitanobi has joined #ruby
<becom33> I commented infront of it
<jondot_> a testing related question - how would you deal with an integration test going out to a 3rd party web service, and that service is stateful. would you mock out the service? how would you mock the state of it?
<jondot_> integration isn't between services/products, but between modules of your application
<Spaceghostc2c> integration is full stack testing.
<jondot_> the 'dry' definition, is integrating modules. modules can be classes, namespaces, services, products, buildings, etc.
<Spaceghostc2c> And yes, it's still integration when you test third party services. I just don't test them like that. I might smoke test in production. Otherwise, a mock.
<Spaceghostc2c> I don't do integration testing much. There's a number of other test types I use, and I really don't int test all that much.
<Spaceghostc2c> If you want to use your definition, I use request specs for int testing like that.
<jondot_> in the case of the mock, although i've done it quite a few times, i find myself into an interesting problem, where i'm kinda coding the service's logic.
<Spaceghostc2c> You shouldn't have to.
<jondot_> its not a big deal, its the service's logic in the most dumbest way, but it s still not simple to my taste
<jondot_> Spaceghostc2c, the simplest example, imaging the service just keeps array of things. every time you call it: Service.add(1), it will return the complete new array
<jondot_> so Service.add(1) => [1], Service.add(2) => [1,2]
<msch> is there any place like shootout.debian for the different ruby implementations?
bradyl0ve has joined #ruby
<jondot_> now you need to mock that in test
<Spaceghostc2c> msch: There's the shootout.
<Spaceghostc2c> jondot_: There's libs for helping out with it.
<msch> Spaceghostc2c: doesn't that only have one ruby implementation?
<Spaceghostc2c> It has a few.
<jondot_> what will you do? hold a temporary variable to represent the state, then mock it with something like rr. you'll give the mock a body to execute which will push things into the array.
<msch> Spaceghostc2c: ah it has JRuby and Ruby 1.9. too bad i would have hoped for it to also have 2.0 and rbx
<Spaceghostc2c> They aren't even that updated.
<jondot_> when you do Service.get_array, you'll return that same variable, again mocked out the function's logic to return the temporary variable thats bound to the test method scope
<Spaceghostc2c> I use jruby 1.7 (jruby-head) with the latest jdk release on java 7
<Spaceghostc2c> jondot_: So then define a method if you're going to be testing it.
<jondot_> what do you mean?
<Spaceghostc2c> If you need to test against an api and don't want a mock to gobble stuff up entirely, then perhaps, you know, do what you need to make your tests pass.
<jondot_> well i already have a working solution, i'm trying to advise with others to make sure i am also doing the 'clean' solution
nobitanobi has joined #ruby
cek has joined #ruby
mikeric has joined #ruby
<cek> dear friends, i've got ulimit -d equal to 1 and the following program succeeds: ruby -e 'zz="a"*1024*2'. Why?
kenichi has joined #ruby
hadees has joined #ruby
kvirani has joined #ruby
Watcher7 has joined #ruby
davidw has joined #ruby
srnty has joined #ruby
d3c has joined #ruby
luckyruby has joined #ruby
sohocoke has joined #ruby
jgrevich has joined #ruby
<macmartine> I have a Time object. And I have a tzinfo object. How do I set the offset of the time object to the tzinfo offset?
Zolrath has joined #ruby
nobitanobi has joined #ruby
jarred has joined #ruby
<toloykhan> canton7, virunga, thank you so much it's worked
<virunga> :)
francisfish has joined #ruby
ersoy has joined #ruby
yoklov has joined #ruby
gen0cide_ has joined #ruby
waxjar has joined #ruby
<macmartine> How do I take a time '2012-05-03 07:45:00 UTC' and get the exact same time but with a new offset such as '2012-05-03 07:45:00 -0700' ?
nobitanobi has joined #ruby
looopy has joined #ruby
headius has joined #ruby
nobitanobi has joined #ruby
<shevy> ewww crossposting
waigani has joined #ruby
waigani has joined #ruby
kvirani has joined #ruby
looopy has joined #ruby
vitor-br has joined #ruby
me_ has joined #ruby
Targen has joined #ruby
robert___ has joined #ruby
ziggles has joined #ruby
rdesfo has joined #ruby
nobitanobi has joined #ruby
me_ has joined #ruby
workmad3 has joined #ruby
jetblack has joined #ruby
noric has joined #ruby
greenarrow has joined #ruby
me_ has joined #ruby
eko has joined #ruby
eko has joined #ruby
eko has joined #ruby
me_ has joined #ruby
<tchebb> Is there a difference in behavior between . and :: or are they syntactically equivalent?
zakwilson has joined #ruby
krz has joined #ruby
thismax has joined #ruby
thismax has joined #ruby
locriani has joined #ruby
<shevy> tchebb for the most part. but . is shorter. and :: allows you to use it like so:
<shevy> ::Foo
thismax has joined #ruby
<shevy> which you cant quite do with . unless there is a recieve before
<shevy> *reciever
<shevy> when a method is call I try to prefer Foo.method_name rather than Foo::method_name
<shevy> *called
<shevy> somehow my words are not quite complete today :\
<tchebb> shevy: I see. So the convention is to use :: for subclasses and class methods, and . for instance methods?
dv310p3r has joined #ruby
KL-7 has joined #ruby
toddmorrill has joined #ruby
<shevy> I dont think there is any solid convention
lucasefe has joined #ruby
<shevy> you'll have to see what you prefer for yourself mostly
<shevy> I know I did not like the Foo::bla scheme
<tchebb> shevy: Alright. Thanks for the help!
<shevy> I'd also use . for all methods, irrelevant of whether they are class methods or instance methods
<shevy> and Constants via ::
<shevy> class Foo # <-- is also a constant
<shevy> module Bla; class Foo
<shevy> foo = Blaa::Foo.new
<shevy> foo.hello
ersoy has quit ["Leaving"]
nimeacuerdo has joined #ruby
<nimeacuerdo> hi there
sebcioz has joined #ruby
eko has joined #ruby
eko has joined #ruby
pubis has joined #ruby
baroquebobcat has joined #ruby
thorncp has joined #ruby
nobitanobi has joined #ruby
zschallz has joined #ruby
sohocoke has joined #ruby
zschallz has joined #ruby
nobitanobi has joined #ruby
Divinite has joined #ruby
redgetan has joined #ruby
nobitanobi has joined #ruby
c0rn has joined #ruby
tommyvyo has joined #ruby
cordoval has joined #ruby
eko has joined #ruby
eko has joined #ruby
nobitanobi has joined #ruby
cordoval has quit [#ruby]
nobitanobi has joined #ruby
Targen has joined #ruby
tommyvyo has joined #ruby
baroquebobcat has joined #ruby
jkingkong has joined #ruby
<jkingkong> so I'm trying to set up a rails environment in ubuntu
<jkingkong> when i run a rake db migrate
<jkingkong> i get an uninitialized constant error for Footnotes::Note::LogNote
<jkingkong> any ideas?
becom33 has joined #ruby
<jkingkong> it seems to be related to an active support dependency
<jkingkong> based on the trace
<becom33> http://pastebin.com/wLj4gfCn in this some of the \ and / are missing . why is that ?
igotnolegs has joined #ruby
kvirani has joined #ruby
<Mon_Ouie> \ is used to escape characters
peterhil` has joined #ruby
<becom33> Mon_Ouie, so wut can i do to prnt that banner ?
<Mon_Ouie> Replace \ with \\
<becom33> and /
<becom33> Mon_Ouie, btw is there ant other way ?
nobitanobi has joined #ruby
nobitanobi has quit [#ruby]
savage- has joined #ruby
Divinite has joined #ruby
<any-key> hmmmmmm you could surround it in single quotes
banisterfiend has joined #ruby
sc0 has joined #ruby
<any-key> nope never mind
<becom33> any-key, how ? each line ?
<any-key> I suppose
<becom33> :/
Watcher7 has joined #ruby
<becom33> anyother way ?
<virunga> change logo
<any-key> try %$
<Mon_Ouie> You can use the DATA section at the end of the file
robert___ has joined #ruby
kalleth_ has joined #ruby
kvirani has joined #ruby
robert___ has joined #ruby
BeLucid has joined #ruby
robert_ has joined #ruby
twinturbo has joined #ruby
indeterminate has joined #ruby
minijupe has joined #ruby
subbyyy has joined #ruby
<becom33> any-key, wuts %$
<any-key> another way of doing strings
<any-key> but disregard that since it didn't work
<tchebb> There's no heredoc syntax that doesn't have any escape sequences?
looopy has joined #ruby
<apeiros_> tchebb: no. there's only two variants of escape sequences in ruby
<apeiros_> no matter which literal
<becom33> damn
mikeric has joined #ruby
headius has joined #ruby
<any-key> place the logo in a file and read it in
<Tasser> what to load for array#shelljoin again?
waigani_ has joined #ruby
<banisterfiend> Tasser: hey
waxjar has joined #ruby
<any-key> Tasser: you shouldn't have to require anything
<Tasser> any-key, shellwords
<Tasser> banisterfiend, hey
<banisterfiend> Tasser: guten tag
<Tasser> learning some german, are you?
<banisterfiend> Tasser: yeah, what did i say exactly btw
<banisterfiend> literally
waigani__ has joined #ruby
<Tasser> good day approx.
sbanwart has joined #ruby
<banisterfiend> http://imgur.com/EfXfu
fayimora has joined #ruby
snip_it has joined #ruby
zaiste has joined #ruby
Mchl has joined #ruby
bluenemo_ has joined #ruby
bluenemo_ has joined #ruby
td123 has joined #ruby
waxjar has joined #ruby
voodoofish430 has joined #ruby
tommyvyo has joined #ruby
jetblack has joined #ruby
jonathanwallace has joined #ruby
srnty has joined #ruby
kaos01 has joined #ruby
redgetan has quit ["Leaving"]
srji has joined #ruby
c0rn has joined #ruby
bradyl0ve has joined #ruby
snip_it has joined #ruby
waxjar has joined #ruby
<rking> banisterfiend: When's gist going to get pry syntax highlighting?
<banisterfiend> rking: it used to work, it's the gist gem itself that's broken unfortunately
<rking> Oh, OK. I figured it was something that had to be done by github.
<deryl> i fixed it but using one hell of a dirty hack, hehe
<deryl> i just made the girst_extension var an ivar and replaced throughout :)
<deryl> github.com/deryldoucette/gist it works. does the job but definitely not professional
OomElvis has joined #ruby
OomElvis has quit ["Leaving"]
khakimov has joined #ruby
<deryl> i even fixed up the standalone
<banisterfiend> deryl: yeah, i wish defunkt would look into it
<deryl> figured it'll work for now
<deryl> yeah
<banisterfiend> rking: we may be able to get around it by writing out the highlighting as html and setting the file type as html
mrTheShadow has joined #ruby
<banisterfiend> but i havent looked into that yet
kaos01 has quit [#ruby]
<deryl> banisterfiend: well my cheapskate fix 8does* work. I use it locally
<rking> banisterfiend: Right. I was wondering that. BTW when it worked did it correctly distinguish between pry prompts, output, and code output?
<banisterfiend> rking: it never displayed prompts, does it now?
sam113101 has joined #ruby
<banisterfiend> it should output stuff as:
<banisterfiend> input
<banisterfiend> # => result
<deryl> not that i see
<deryl> yeah that it does
<rking> banisterfiend: Oh yeah, crud. I'm sorry - it does.
<deryl> banisterfiend: what i was gisting to you yesterday or the day before that *had* the prompt stuff was when I was C&Ping to gist
<banisterfiend> yeah
<deryl> oh cool, you knew that. ok :)
<rking> banisterfiend: The case that I was doing I was trying to show why a certain thing was a syntax error, so I C&P'd it for that as well.
<rking> (Because pry doesn't consider a syntax error to be an input expression.)
<banisterfiend> rking: hmm ok
<banisterfiend> let me check
<rking> But yeah, if the input\n# => result stuff was syntax highlighted, that would be fine.
<banisterfiend> rking: yeah you're right
Seoman has joined #ruby
chrxn_ has joined #ruby
<banisterfiend> rking: do u find gist -h sufficient to know how to work it?
savage- has joined #ruby
<rking> banisterfiend: Actually, my gist command is busted for some reason. I switched from rvm to rbenv, and it still has the rvm bangpath... and at this very moment I was trying to "gem install gist" again to see if I could fix it, but I am seeing this odd warning about not having libyaml -- even though that was the very first thing that came with "rbenv install 1.9.3-p194"
snip_it has joined #ruby
tommyvyo has joined #ruby
<rking> OK, despite the warning - the reinstall of the gist gem worked, and I can see -h fine. banisterfiend: what was your question about it?
sohocoke has joined #ruby
<banisterfiend> rking: is it enough info to understand how to properly use gist, is there any confusion about the options?
<rking> Nah, no confusion.
Beoran__ has joined #ruby
<banisterfiend> rking: is it clear what 'input expression history' is?
<banisterfiend> i never explained they correspond go the [n] beside the pry prompt
<rking> Oh, hehe.. you weren't talking about $PATH's gist -h, but pry's gist -h.
<banisterfiend> rking: Yeah
<rking> banisterfiend: I think I do understand it OK... unless you're saying there actually is a way to get a busted input expression to count as one that gist -i sees.
<deryl> banisterfiend: i had the gist gem installed already so i didn't notice, however, is the gist that pry doing using that gem or its own internal?
<deryl> just a driveby question
<banisterfiend> deryl: we use the gem, but our 'gist' command is quite different
<banisterfiend> as it lets you gist stuff from the pry environment
<rking> deryl: show-command gist. =)
<deryl> ok. was just checking
<banisterfiend> like methods, input, etc
<deryl> gotcha. i was going to sunhday drive through pry's source later this week. definitely going to do so, now that we're talkinga bout it :)
Akuma has joined #ruby
<banisterfiend> deryl: you can drive through it in pry itself, very cute ;)
<deryl> hahah thats cool actually :)
<deryl> just to look at things. i'm still working the well grounded rubyist so my ruby isn't up to where *I* want it, however, i wanted to see how things were done, learn a few things. so i'll definitely do :)
c0rn has joined #ruby
<deryl> i want to complete at least *one* damned book on the subject :) I've been toying around with ruby long enough. time to actually invest some education time, and then start writing a crapload of throwaways
<deryl> and pry is just my ticket to see where the hell i screw up :) (and learn a "so far proving pretty frickin snazzy" tool along the way)
<banisterfiend> deryl: i thought you'd been doing ruby for ages now
skaczor has joined #ruby
<deryl> well i've been around the channels for oh.. 2 years (?) but its been about a year that i've been writing stuff. but mostly half hazardly. i never really *sat down* and *really* attempted to learn it.
waxjar has joined #ruby
waigani has joined #ruby
<deryl> i've done pretty damned good for doing it that way, but now i really want to get serious with it. i've got my hands in enough pies, written some stuff thats used daily, but *I* don't really consider myself high calibre. so i asked myself what it was that i felt i needed to do *to* become that. complete a book on it, and knuckle down is what i came up with. so.. thats what i'm doing
<rking> Wow. These pry plugins are great.
<banisterfiend> rking: which ones?
<deryl> banisterfiend: i'v got a lot of holes in my knowledge is the problem. so, i'm reading the well grounded rubyist and walking the language end to end. like i had a *sever* misunderstanding of 'self' and scopes.
<rking> banisterfiend: Well, the architecture itself is something I like (the way it loads any /^pry-/ gem automatically, but you can disable that entirely or as 1-offs), but I'm liking pry-git already.
<rking> Seems like pry-colline is now core functionality?
<banisterfiend> rking: hehe, pry-git is just experimental ;) i'm going to pump it up when i get the time
<banisterfiend> rking: not quite, we now color lines after enter is pressed automatically in core, but pry-cooline has the ability to highlight code as you type it in
* rking expects to see pryde soon. (Complete IDE from within pry)
<rking> Aha.
<banisterfiend> rking: try it out, gem install pry-coolline
<Spaceghostc2c> banisterfiend: Whoa whoa whoa.
<banisterfiend> let me know if it works for u
<Spaceghostc2c> That's fucking bro.
<rking> banisterfiend: Yep! Is nice.
<banisterfiend> Spaceghostc2c: what are you referring to?
<rking> Actually, what IDE features are even missing at this point?
<Spaceghostc2c> coolline
eph3meral has joined #ruby
<eph3meral> is there some sort of timer object for constructing loops?
Xylo has joined #ruby
Targen has joined #ruby
<rking> eph3meral: I don't follow.
<eph3meral> like animation loops? in Qt for example (but not Qt, cuz I don't want to pull in Qt if possible)
<eph3meral> rking, well it just seems that while dont_quit ... isn't very good "form"
Peaker has joined #ruby
<rking> eph3meral: Hrm. Maybe some of the lighter game engines?
<Peaker> What's a good ruby REPL?
<rking> Peaker: pry!!
<Peaker> is there a package name on Ubuntu?
<eph3meral> rking, I really want to use as few libs/gems as possible
<eph3meral> if I need a lib for it, then I'll just stick with while foo...
<rking> Peaker: I would do it as: gem install pry{,-doc}
Indian has joined #ruby
<rking> eph3meral: I don't understand the problem still. while dont_quit seems fine to me, if that's all you are after. I thought you meant some kind of complicated timing setup, like what would be in a game engine.
<Peaker> rking, I'm worried of making a mess w.r.t apt-get/dpkg
vitor-br has joined #ruby
<rking> Peaker: gems will install fine. They are their own ecosystem that won't compete with .deb's.
khakimov has joined #ruby
levity_island has joined #ruby
<Spaceghostc2c> Peaker: Don't be. They're completely separate.
<eph3meral> rking, well, gaming engine timing setups (depending on the game) actually aren't that complicated - at least for e.g. a simple 2d physics sandbox, you just set up a timer to trigger say, every 5ms
<Spaceghostc2c> Don't use dpkg or apt-get to install ruby. Use rvm.
<Peaker> I thought "ruby" was the REPL (much like "python") and was initially disappointed at such a crappy REPL :)
<eph3meral> rking, I don't even need that kind of granularity, really I only need to trigger about once every minute
<rking> I say use rbenv instead of rvm, I think.
<rking> Peaker: Hehe... it's more of a REP than a REPL.
<eph3meral> though I do need to spawn about 1000 similar/nearly-identical workers each minute
<rking> Actually, an RE.
<tchebb> Peaker: irb is the default
<Spaceghostc2c> eph3meral: Lolwat.
<Spaceghostc2c> Using fork+exec?
alek_b has joined #ruby
<eph3meral> Spaceghostc2c, I hadn't gotten that far, that was mostly an aside, ignore that requirement for now
<rking> eph3meral: Regarding timer every 5ms... what about when the system gets lagged >5ms?
<eph3meral> for now I'm just dealing with getting one of them working
<eph3meral> rking, yeah, it's a very good question, one I was also about to pose
<rking> eph3meral: That's what I'm meaning re "complicated timing" loop that any game engine will solve.
<eph3meral> k
<Peaker> generally you just skip timings that end up in the past?
<rking> And then you have the other side - the case where the machine is ahead of schedule and the user wants to increase the graphics/physics resolution even more.
<eph3meral> ok, well I'll look in to some lightweight game engines in the future, for now I'll stick with `while` - it works for now, I'll abstract/adapt it when I get a little further with the app
<Spaceghostc2c> banisterfiend: Didn't you have a game that you used when showing off pry that had ticks nad timers?
<banisterfiend> Spaceghostc2c: yeah
<rking> eph3meral: Yeah. In the end it isn't more than a hearty paragraph of code.
<deryl> now just need a vim plugin to call pry when i'm in editing a ruby file (muahaha)
cdepue has joined #ruby
<rking> Hrm. So I'm getting no problem with "ruby -ryaml" (or "ruby -rpsych"), but "gem help" complains about missing psych. How would I start pry on "`which gem`"?
<deryl> lol will you stop?? you're fulfulling all my wishes! :)
<deryl> banisterfiend: lol, niiice
* deryl peers at banisterfiend
<deryl> you sure you're not a genie?
sohocoke has joined #ruby
<banisterfiend> deryl: that blog post isn't mine ;) but its a nice trick
<banisterfiend> however i dont use vim
Manhose has joined #ruby
zakwilson has joined #ruby
dagnachewa has joined #ruby
<deryl> i flip between textmate and vim
<deryl> more and more i'm in vim. especially now that i have tmux, tmuxinator, and most of the top plugins for it.
<rking> banisterfiend: Is it possible to invoke a ruby script from pry and have it follow into it?
<deryl> finding less and less reason to use TM other than the def<tab> for method completion and stuff. which snipmate heps with
sohocoke has joined #ruby
philcrissman has joined #ruby
<banisterfiend> rking: using pry-nav u mean?
rodayo has joined #ruby
<rking> Hrm, I missed pry-nav, because "gem search" doesn't show descriptions. Is there a way to fix this?
<rodayo> How would I remove occurences of a "\" in a string?
<rking> rodayo: .gsub '\\', ''
<rodayo> rking, great thank you. i was fumbling with the escapes and couldn't get it right
igotnolegs has joined #ruby
<rking> rodayo: It's kind of tricky to learn, but eventually you'll get it. The only one that happens, there, is the Ruby parser that builds the string -- it will take \x and turn it into the escaped char, so you have to do \\ to get a string with '\'
<rodayo> rking, alright i'll keep that in mind =)
<deryl> rking: gem search pry-nav -dr
<deryl> -d shows descriptions -r for remote -l for local
apok has joined #ruby
c0rn has joined #ruby
<deryl> works with gemn list as well
<rking> Oh, shoot... there it is, -d under "Options" of gem search --help.
<deryl> :)
kuzushi has joined #ruby
<deryl> i rarely search anymore without including -d
<rking> Right. Most distro tools are like that, by default (e.g., apt-cache and eix).
<rking> "gem" is basically a distro.
<banisterfiend> rking: most plugins are mentioned here http://banisterfiend.wordpress.com/2012/02/14/the-pry-ecosystem/
binaryplease has joined #ruby
<deryl> well, there's a new primary link for my browser (heh)
<rking> banisterfiend: Excellent. I still don't quite get how to work pry into an executable... other than "(echo 'require "pry"; pry; cat `which the-exe`) > tmp-exe; ruby tmp-exe
<binaryplease> hey im getting the following error with a new rails project http://pastebin.com/Th83TSKi
<binaryplease> can someone give me a hint, im beginner
<deryl> #rubyonrails is probably your better bet
<deryl> binaryplease: and you need to read your error messages. you're missing a javascript runtime
<binaryplease> deryl: but i installed it
<deryl> go hit that execjs url for one for your platform and follow the instructions over there. but i'll bet you didn;'t add it to your Gemfile and bundle install
<binaryplease> with gem install execjs
waigani has joined #ruby
<binaryplease> where is the gemfile located?
<deryl> umm