<ruboto>
Phrohdoh, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
baweaver has joined #ruby
<Phrohdoh>
oh, ok
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bnobu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
maletor sevenseacat has a crush on him
michaeldeol has joined #ruby
mroach has quit [Quit: mroach]
<sevenseacat>
on who?
wallerdev has quit [Quit: wallerdev]
<shevy>
that cat coder
<FernandoBasso>
qty
FernandoBasso has quit [Quit: leaving]
<shevy>
stephen the cat
<sevenseacat>
:3
wallerdev has joined #ruby
<maletor>
casshern2: i cannot read that
<shevy>
producer of elegant code
<maletor>
let's behave. i'm sorry i started this.
reinaldob has joined #ruby
<shevy>
casshern2 you defince the same method twice?
<shevy>
*define
riotjones has joined #ruby
<casshern2>
no it's just that
<casshern2>
it didnt work until I swithted those places.. but if I used the syntactic sugar version price=(amount) it didn't matter
<casshern2>
switchted*
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
apoplexy_da_boss has joined #ruby
martin_work has quit [Ping timeout: 252 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Sawbones has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 245 seconds]
hmsimha has joined #ruby
amclain has joined #ruby
mitchellhenke has joined #ruby
thumpba has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 256 seconds]
thumpba has joined #ruby
Sawbones has joined #ruby
gregf1 has quit [Quit: WeeChat 1.0.1]
iotouch has joined #ruby
sinkensabe has joined #ruby
reset has quit [Ping timeout: 256 seconds]
sevvie has joined #ruby
<nahtnam>
Hey! I have this code: `bitcoin_price = JSON.parse(response.body)`. It returns something like this: {"amount"=>"247.63", "currency"=>"USD"} How can I access the amount? I tried bitcoin_price[:amount], bitcoin_price[0], and bitcoin_price.amount, none of which work
MatthewsFace has quit [Remote host closed the connection]
<sevenseacat>
it wouldnt, because the key is a string
jack_rabbit has joined #ruby
<sevenseacat>
not a symbol
<nahtnam>
sevenseacat: It was a symbol, I added .to_s so i can output it
jack_rabbit is now known as Guest56551
<sevenseacat>
no, its not
<nahtnam>
sevenseacat: Oh, its a hash: TypeError: no implicit conversion of Hash into String
oo_ has quit [Ping timeout: 244 seconds]
<nahtnam>
^ I get that error when I try to print it
<zeroasterix>
Hi! I am looking to get started in Ruby, do you know if there are any online courses like udacity or coursera style that offer classes in ruby?
<gusrub>
zeroasterix, code school, they are not free, but they are good, especially the ruby bits
<matugm>
You could also try rubymonk.com
<zeroasterix>
oh cool! thanks-
gusrub has quit [Client Quit]
pwnz0r has joined #ruby
gusrub has joined #ruby
digitalextremist has joined #ruby
<zeroasterix>
wow, both sites look awesome! can't wait
gusrub has quit [Client Quit]
RegulationD has joined #ruby
tosbourn has joined #ruby
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrmagneto has joined #ruby
<mrmagneto>
hola
_1_deep has joined #ruby
astrobun_ has quit [Remote host closed the connection]
godzirra has joined #ruby
amystephen has quit [Quit: amystephen]
<godzirra>
Hey guys. How come DateTime.parse("10/13/1994") says invalid date, but 10/12/1994 doesn't/
<godzirra>
Oh crap. It's doing day, month, year isn't it.
<godzirra>
duh.
<sevenseacat>
because there is no 13th month
maletor has quit [Quit: Computer has gone to sleep.]
<godzirra>
Is there a way to tell it it's actually doing month/day/year because american dates are dumb?
tosbourn has quit [Ping timeout: 245 seconds]
RegulationD has quit [Ping timeout: 256 seconds]
_1_deep has quit [Read error: Connection reset by peer]
cjim has joined #ruby
ghr has joined #ruby
havenwood has quit []
Guest25632 has joined #ruby
sevvie has joined #ruby
<godzirra>
Nevermind, I figured it out. Pretty much as soon as I realized it was day/month/year...
nateberkopec has quit [Quit: Leaving...]
tier has quit [Remote host closed the connection]
kblake has joined #ruby
msnyon has joined #ruby
<Porfa>
matugm: thank you!
<godzirra>
sevenseacat: thanks
Sawbones has joined #ruby
<sevenseacat>
np
Guest25632 has left #ruby [#ruby]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
astrobun_ has joined #ruby
godzirra has quit [Quit: leaving]
ghr has quit [Ping timeout: 264 seconds]
<Porfa>
guys i need to do something… but i dont know how to do it!!!
maximski has joined #ruby
ebbflowgo has joined #ruby
<Porfa>
im using ruby to fetch me data from a category from my online store, that category contains everything i need to generate a html newsletter/code using sinatra… the thing is… i have a .sh script that runs the sinatra app, and the next line is wget 127,0,0,1:4567 -O newsletter.html
msnyon has quit [Ping timeout: 264 seconds]
maletor has joined #ruby
cjim has quit [Quit: (null)]
reinaldob has quit [Remote host closed the connection]
sevvie has quit [Ping timeout: 252 seconds]
havenwood has joined #ruby
<Porfa>
but since sinatra doesn’t quit… and even if it did quit, there’s nothing left for wget to fetch… is it possible to write the output of a sinatra request into an HTML file from whithin the ruby script?
Sawbones has quit [Remote host closed the connection]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
fabrice31 has joined #ruby
ponga has joined #ruby
DavidDudson has joined #ruby
juanpablo__ has joined #ruby
sankaber has joined #ruby
Filete has joined #ruby
dseitz has joined #ruby
sevvie has joined #ruby
Sawbones has joined #ruby
fabrice31 has quit [Ping timeout: 244 seconds]
tosbourn has joined #ruby
astrobun_ has quit [Ping timeout: 276 seconds]
moblib has joined #ruby
astrobun_ has joined #ruby
tosbourn has quit [Remote host closed the connection]
juanpablo__ has quit [Ping timeout: 256 seconds]
Beoran has quit [Ping timeout: 265 seconds]
Sawbones has quit [Remote host closed the connection]
rebel has joined #ruby
kblake has quit [Remote host closed the connection]
ringarin has quit [Ping timeout: 264 seconds]
<shevy>
porfa should be doable, it's just an URL query right? you get fed back some html/string response from the server
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
apoplexy_da_boss is now known as apoplexy
ponga has quit [Remote host closed the connection]
jack_rabbit_ has quit [Remote host closed the connection]
nb_bez___ has quit [Quit: Connection closed for inactivity]
hobodave has quit [Quit: Computer has gone to sleep.]
RegulationD has joined #ruby
casshern2 has quit [Ping timeout: 246 seconds]
astrobu__ has joined #ruby
astrobun_ has quit [Ping timeout: 245 seconds]
Sawbones has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 264 seconds]
Feyn has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
isxek_ has joined #ruby
hyperjuice has joined #ruby
isxek has quit [Ping timeout: 250 seconds]
moblib has quit [Ping timeout: 246 seconds]
aswen has quit [Ping timeout: 248 seconds]
astrobu__ has quit [Ping timeout: 244 seconds]
greenbagels has quit [Read error: Connection reset by peer]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Phrohdoh has joined #ruby
Sawbones has joined #ruby
<Phrohdoh>
Hey guys, found some substring code that I’m unfamiliar with. creator.sub /^@/, what does the /^@/ part mean?
<mozzarella>
Phrohdoh: it's a regex
<Phrohdoh>
Ah should have known.
djbkd has quit [Remote host closed the connection]
pontiki has quit [Quit: sleepy time, and still no cheese]
hyperjuice has quit [Remote host closed the connection]
<Phrohdoh>
Looks to remove @ if it is the first char.
ponga has joined #ruby
Porfa has quit [Quit: porfa]
braincra- has quit [Quit: bye bye]
beneggett has joined #ruby
isxek_ has quit [Ping timeout: 272 seconds]
coderhs has joined #ruby
<Phrohdoh>
Yep, thanks!
Phrohdoh has left #ruby [#ruby]
fenzil has joined #ruby
rebel has quit []
Peter___ has joined #ruby
beneggett has quit [Client Quit]
PNDPO has joined #ruby
DrShoggoth has quit [Quit: Leaving]
amystephen has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
hyperjui_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
juanpablo__ has joined #ruby
mleung has quit [Quit: mleung]
aghalarp has joined #ruby
coderhs has quit [Client Quit]
Megtastique has quit []
hyperjui_ has quit [Remote host closed the connection]
hyperjuice has joined #ruby
lemur has joined #ruby
<tmoor>
Hey guys, real noob question here, hoping someone can help out. In the following section of code, whats the best way to expose (view) the attributes and variables for 'tenant '?
<tmoor>
# Create the new tenant
<tmoor>
tenant = conn.create_tenant({
<tmoor>
:description => description,
<tmoor>
:enabled => true,
<tmoor>
:name => name
<tmoor>
})[:body]["tenant"]
serivichi has quit [Ping timeout: 245 seconds]
tosbourn has joined #ruby
juanpablo__ has quit [Ping timeout: 252 seconds]
phutchins has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
hyperjuice has quit [Ping timeout: 244 seconds]
tosbourn has quit [Ping timeout: 246 seconds]
StevenXL has quit [Ping timeout: 245 seconds]
vt102 has quit [Ping timeout: 276 seconds]
sinkensabe has joined #ruby
zzing has joined #ruby
Channel6 has joined #ruby
towski_ has quit [Remote host closed the connection]
User458764 has joined #ruby
aghalarp has quit [Read error: Connection reset by peer]
aghalarp has joined #ruby
sinkensabe has quit [Ping timeout: 256 seconds]
amystephen has quit [Quit: amystephen]
pdoherty has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cjim has quit [Read error: Connection reset by peer]
cjim has joined #ruby
sivsushruth has quit [Ping timeout: 248 seconds]
hpoydar has joined #ruby
casadei has quit [Remote host closed the connection]
hpoydar has quit [Ping timeout: 265 seconds]
pdoherty has quit [Quit: Leaving]
casadei has joined #ruby
sent-hil has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
<sent-hil>
is there a way to get result of invoking a rake task in another task?
kblake has joined #ruby
Zen-Zen has joined #ruby
Sawbones has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<sent-hil>
ex: i've a `checkpg` task that checks if postgres is up and running as a task, in 2nd task i want to get success/failure output from the original task and decide to continue or stop execution
musashi1 has quit [Ping timeout: 265 seconds]
cscheib has quit [Ping timeout: 246 seconds]
cscheib has joined #ruby
<Radar>
sent-hil: move the code from the 1st task into a class that you can call from the 1st task and the 2nd task?
davispuh has quit [Remote host closed the connection]
<Ellis>
(terminator voice) ill be back
mroach has quit [Read error: Connection reset by peer]
Sawbones has joined #ruby
<sevenseacat>
Ellis: don't assume everyone is a 'brotha'.
<Ellis>
i dont, i thought i checked once that u were a male
<sevenseacat>
or a 'sista'. or whatever other colloquiallism you want to come up with.
fabrice31 has joined #ruby
<Ellis>
it’s been a while so sorry if i’m confusing u with someone else
<Ellis>
brotha as a floating signifier
<Nilium>
I'm pretty sure sevenseacat is a seacat.
<sevenseacat>
just a 'thank you' would have sufficed.
<shevy>
of course
<shevy>
australia is surrounded by water
<Nilium>
And deadly jellyfish
<shevy>
yeah, it has biological defence systems
<Ellis>
brotha communicates kin ness, to differentiate you from stranger society
tkuchiki_ has joined #ruby
<Nilium>
I'm going to go pass out and finish my beer now that I've finished my taxes.
<shevy>
sista sevenseacat
tkuchiki has quit [Read error: Connection reset by peer]
<Nilium>
Ellis: I think you need to just stop trying to defend it and say that you won't refer to people as things they'd rather not be referred to as.
<shevy>
ma brotha Ellisa is in da housa
<Nilium>
Being kind is a lot better than being stubborn.
<shevy>
ma true words from ma brotha Nilium
dfinninger has quit [Remote host closed the connection]
neanderslob has joined #ruby
_cake has joined #ruby
<Nilium>
I'm not your brother.
<Ellis>
i refer to ppl the way the want to be referred to, never said otherwise
<shevy>
ma sista Nilium
dfinninger has joined #ruby
<_cake>
hey
<shevy>
Ellis ok call me Duke Shevy!
<Ellis>
i will refer to u as duke shevy
<shevy>
yay!
<Ellis>
damn principles
<shevy>
I like Ellis... if only he would not be lured to the dark side of ruby ...
<shevy>
the rails
<Ellis>
l0l
Sawbones has quit [Remote host closed the connection]
<pain>
Is rais that bad?
fabrice31 has quit [Ping timeout: 246 seconds]
<pain>
rails
fedexo has quit [Ping timeout: 245 seconds]
iwishiwerearobot has joined #ruby
<sevenseacat>
pain: errr, no
snath has quit [Ping timeout: 255 seconds]
<shevy>
rails is pain and pain is rails
<Nilium>
No, not really.
snath has joined #ruby
<pain>
my company is using rails now
maletor has joined #ruby
BradPitt has joined #ruby
Sawbones_ has joined #ruby
riotjones has joined #ruby
<sevenseacat>
good for them.
thumpba has quit [Ping timeout: 246 seconds]
dfinninger has quit [Ping timeout: 272 seconds]
yvemath has quit [Remote host closed the connection]
BLuEGoD has quit [Remote host closed the connection]
<Nilium>
My company's switching to Git after using Mercurial for like 5 months.
<Ellis>
why wouldn’t they use git in the first place
<Nilium>
Because a past employee migrated everything to Mercurial and didn't really ask for feedback on it
<Nilium>
He'd also never used Git.
<Ellis>
what a bitch
frem has quit [Quit: Connection closed for inactivity]
<sevenseacat>
git ftw
<Nilium>
I think he was trying to do the right thing and had the right idea by going with a DVCS, he just didn't consider that Mercurial is dying.
mengu has joined #ruby
sigurding has quit [Quit: sigurding]
BLuEGoD has joined #ruby
fenzil has quit [Ping timeout: 256 seconds]
iwishiwerearobot has quit [Quit: Be back later ...]
<coderkevin>
probably because mercurialhub.com is too long to type?
hyperjuice has quit [Remote host closed the connection]
BradPitt has quit [Ping timeout: 245 seconds]
<Nilium>
Probably just because GitHub was the beginning of the end for the forges and whatnot.
Macaveli has joined #ruby
ghr has joined #ruby
<Nilium>
Aside from that, we ended up moving away from hg for technical reasons
MatthewsFace has quit [Remote host closed the connection]
<Nilium>
hg has arguably better data structures but worse tools, worse support, worse just about everything else.
<coderkevin>
what about speed?
<Nilium>
Slower, too.
<Nilium>
Side-effect of it being Python.
<Nilium>
Whereas git is mostly C.
<coderkevin>
I thought it was mostly bash, haha
<Nilium>
No, though I believe there's some perl in there.
<coderkevin>
python is a beast...long startup time.
codecop has joined #ruby
codecop_ has joined #ruby
turtil has joined #ruby
<Nilium>
Long relative to something or other. Either way, the worse tools part was what got us.
BradPitt has joined #ruby
RegulationD has joined #ruby
<coderkevin>
tools are a popularity problem, I would guess.
<Nilium>
Sort of, but it's also that Mercurial is just less flexible
andrewdotnich has joined #ruby
<coderkevin>
I wouldn't know, I've rarely used it.
<Nilium>
You can add stuff to it, but you can't change the way the basics work, and the basics are really strict
<sevenseacat>
i remember many years ago looking to move away from svn to a dcvs, i looked at bzr, hg, and git.... that sentence has a lot of acronyms in it
juanpaucar has joined #ruby
phutchins has joined #ruby
<sevenseacat>
*dvcs even
<coderkevin>
I went from cvs, to svn, to git... seems like the most logical progression.
<sevenseacat>
i picked bzr lol, then ended up moving to git when i changed to a job that used it
tkuchiki has joined #ruby
<Nilium>
I used a self-hosted CVS once, nuked my repo by accident, used SVN, didn't work out, then after like 5 years of doing zip backups of code I used git and it made sense, so I used that.
tkuchiki_ has quit [Read error: Connection reset by peer]
<coderkevin>
git feels pretty natural to svn users. You get the comfortable checkout and commit options, even though they behave completely different.
ghr has quit [Ping timeout: 252 seconds]
<Nilium>
Mercurial is a lot like a strict Subversion, so I suspect that's why a lot of svn converts pick it
<sevenseacat>
and honestly, not having to have an svn server, huge win.
Takle has joined #ruby
<coderkevin>
At one point in time, I actually made a bunch of python scripts around svn to make it sort of distributed.
<sevenseacat>
it can be tricky getting svn people used to having a staging area, though
<Nilium>
That was another factor for me back when I started with git, just 'cause I had no real way of hosting an svn server.
<coderkevin>
Where I could keep my own distro and sync it up using scripts.
<Nilium>
Yeah, but the stage/index is so useful
<Nilium>
And mercurial's lack of it drives me insane
<sevenseacat>
ooh that would annoy me
<sevenseacat>
i have to get more familiar with the options around stashing in git
<Nilium>
Out of all the things I can't really live without, it's probably the index, just because the ability to build a commit is extremely useful
<coderkevin>
That's another reason why Michael Hartl's tutorial is so great. It has people making local branches and using them from the beginning with git.
RegulationD has quit [Ping timeout: 245 seconds]
iteratorP has quit [Remote host closed the connection]
* sevenseacat
bites tongue
Ellis has left #ruby [#ruby]
<coderkevin>
sevenseacat: I usually only use stashing when I mess something up, like start editing files on the wrong branch.
bal has joined #ruby
<Nilium>
Never heard of him, but I don't use local branches all that often. I'm stash-heavy, not branch-heavy.
<sevenseacat>
i use stashing a lot when switching between multiple branches of work
<sevenseacat>
and i tend to either stash too many changes, or not all of them
<Nilium>
I do use them, since sometimes I need to keep stuff separate, but usually I just work in master in a fork of a repo.
<sevenseacat>
and things get muddled
<coderkevin>
I used to be too, but branches are more versatile.
phutchins has quit [Ping timeout: 255 seconds]
<Nilium>
It's been nice since we set up GitLab at work.
<sevenseacat>
my current and previous jobs both just use github
<Nilium>
Drastic workflow improvement for me and a few other people because now we don't have to ssh into a server to create a new repo
<coderkevin>
We use gerrit where I work.
sinkensabe has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
codecop_ has quit [Quit: Išeinu]
<Nilium>
I almost went with gerrit but decided it was very un-git-like to repeatedly amend and push the same commit
<Nilium>
I say "I" because I'm the one who set up GitLab
<coderkevin>
Yeah, it's kind of strange...but lots of people squash PRs on github anyway, so isn't that basically the same thing?
Takle has quit [Ping timeout: 264 seconds]
<Nilium>
Sort of, though I've been discouraging it at work
<coderkevin>
I would agree.
<Nilium>
Better to have the commits
<sevenseacat>
i dont get the reasoning behind suqashinfg commits
<sevenseacat>
squashing even
<coderkevin>
tidyness of the tree? that's about all I can come up with.
<Nilium>
I think it's part of the "it must always build" mentality
<sevenseacat>
when i bisect and blame, i want to know exactly when something happened and why
<flughafen>
moin sevenseacat certainty shevy
<Nilium>
Which I don't really subscribe to. There's releases and then there's intermediate points in history.
<sevenseacat>
not just 'it happened as this chunk of work'
Dopagod has quit [Quit: WeeChat 1.0]
Dopagod has joined #ruby
<sevenseacat>
flughafen: buon pomeriggio
<coderkevin>
At least with gerrit you deal with individual commits...nothing to squash.
<Nilium>
If something comes in wholly-formed, it's probably with the line "initial commit"
<andrewdotnich>
I don't really use squash - I do use fixup though, for fixing the mistakes as I realise them then rebasing so they never happened
rbennacer has joined #ruby
<Nilium>
Fixup's great.
* sevenseacat
looks up fixup
<Nilium>
I don't think anyone views fixup as having the same purpose as squash, so I've never really heard of it being used the same
<flughafen>
sevenseacat: araraar
<andrewdotnich>
clue's in the name, I guess
pantsu has joined #ruby
agrinb has quit [Remote host closed the connection]
<Nilium>
fixup is basically squash in git-rebase --interactive, but it discards the commit message.
<coderkevin>
Oh, so fixup is just like an amend?
pantsu is now known as Guest53782
<Nilium>
The handy thing is git commit --fixup
MatthewsFace has joined #ruby
<Nilium>
Since then you can just do a rebase and line things up
<undeadaedra>
there should be a way of sorting case-insensitive
hanmac has joined #ruby
<hs366>
downcase
demiurgen has joined #ruby
craigp has quit [Remote host closed the connection]
tosbourn has quit [Ping timeout: 272 seconds]
<sevenseacat>
there probably is, but i dont see much of a use case for it
RegulationD has quit [Ping timeout: 256 seconds]
sigurding has quit [Quit: sigurding]
craigp has joined #ruby
Echoes-- has quit [Read error: Connection reset by peer]
universa1 is now known as universaL
<undeadaedra>
is that a pun
universaL is now known as universa1
Echoes-- has joined #ruby
krz has quit [Ping timeout: 256 seconds]
<hs366>
pun ?
juanpaucar has quit [Ping timeout: 265 seconds]
marr has joined #ruby
ghr has joined #ruby
dumdedum has joined #ruby
tesuji has joined #ruby
terlar has quit [Quit: WeeChat 1.1.1]
DerisiveLogic has quit [Remote host closed the connection]
livathinos has joined #ruby
terlar has joined #ruby
craigp has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 264 seconds]
craigp has joined #ruby
mengu has quit [Remote host closed the connection]
jenrzzz has joined #ruby
apoplexy has joined #ruby
sent-hil has quit [Quit: Connection closed for inactivity]
krisquigley has joined #ruby
dumdedum has quit [Ping timeout: 246 seconds]
sigurding has joined #ruby
ghr has quit [Ping timeout: 252 seconds]
Takle has joined #ruby
reinaldob has joined #ruby
ki0 has quit [Remote host closed the connection]
rocknrollmarc has joined #ruby
musashi1 has quit [Ping timeout: 265 seconds]
jason^ has joined #ruby
demiurgen has quit [Quit: Leaving.]
<avril14th>
hello
<undeadaedra>
5 days
craigp has quit [Remote host closed the connection]
ghr has joined #ruby
steven43126 has joined #ruby
reinaldob has quit [Ping timeout: 265 seconds]
mikecmpbll has joined #ruby
ki0 has joined #ruby
<hs366>
can i have a simple example of comparable mixin <=> ?
chthon has joined #ruby
einarj has joined #ruby
<undeadaedra>
?
<hs366>
oh find one
<hs366>
lol
rocknrollmarc has quit [Ping timeout: 250 seconds]
<hs366>
funny name 'spaceship' operator :))
<diegoviola>
if you can redefine methods and monkeypatch pretty much anything in ruby, you can end up extending and changing the whole language pretty much, no?
<diegoviola>
not saying I would do that, I won't
<sevenseacat>
apart from its keywords, probably.
Mark-6ma has joined #ruby
ponga has joined #ruby
dumdedum has joined #ruby
musashi1 has joined #ruby
havenwood has quit [Remote host closed the connection]
<jhass>
and less things are keywords than one might think
camilasan has quit [Remote host closed the connection]
<kq_away_>
Can you still change meaning of the whitespace (as displayed in the famous wat presentation)?
<workmad3>
canton7: oh yeah, that's a more efficient bucket-sort than the group_by :)
<jokke>
hanmac: that's great!
<jokke>
because i'll have only very few different items
<jokke>
at least i expect that
<Mon_Ouie>
You don't have to iterate over the hash table you're building separately though, you can just keep track of the current maximum in a variable and change it if the value you just increased is larger than the one associated to the maximum
<canton7>
true
<jokke>
true
<hanmac>
workmad3: i dont know which version, but in my version you can replace group_by { |e| e } with group_by(&:itself)
<workmad3>
hanmac: canton's point is that you can short-circuit the creation of all the subararys in a group_by by using a hash of value => count instead
<workmad3>
canton7: or at least overlapping with your long one ;)
jottr_ has joined #ruby
<workmad3>
canton7: super-long one has had run-times from 0.42s to 0.49s on my machine, and group_by has had run-times from 0.42 to 0.46
<canton7>
so finding the max in the hash is surprisingly expensive
tosbourn has joined #ruby
<canton7>
and group_by is surprisingly cheap, despire the need to create sub-arrays
<canton7>
*despite
<canton7>
case closed: go with group_by!
Pupeno has joined #ruby
bim has joined #ruby
<workmad3>
canton7: if I was wanting to be honest, I'd also benchmark memory use ;)
RegulationD has joined #ruby
<canton7>
no-one cased about memory :P
<canton7>
*cares
<workmad3>
canton7: jokke might :P
<canton7>
he's using ruby.... :P
<workmad3>
:D
knikolov has quit [Quit: WeeChat 1.2-dev]
wald0 has joined #ruby
juanpaucar has joined #ruby
roolo_ has joined #ruby
<workmad3>
canton7: memory use could also be important if it's large enough to require ruby to malloc more space from the system because it needs to increase its heap ;)
<canton7>
that would show up as a speed cut, though?
tosbourn has quit [Ping timeout: 244 seconds]
apoplexy has quit [Ping timeout: 264 seconds]
einarj has quit [Read error: Connection reset by peer]
roolo has quit [Ping timeout: 245 seconds]
<workmad3>
canton7: only if you managed to replicate it in a benchmark (which is unlikely)
einarj has joined #ruby
<canton7>
true
RegulationD has quit [Ping timeout: 246 seconds]
<undeadaedra>
allocate ALL the data!
LJT has quit [Ping timeout: 256 seconds]
juanpaucar has quit [Ping timeout: 248 seconds]
oo_ has quit [Remote host closed the connection]
User458764 has joined #ruby
mengu has joined #ruby
Zai00 has joined #ruby
LJT has joined #ruby
sevvie has quit [Ping timeout: 256 seconds]
ldnunes has joined #ruby
labria has joined #ruby
Oreolek has joined #ruby
ponga has quit [Remote host closed the connection]
<toretore>
i just don't like messing with the thread scheduler, because i don't understand all the possible ways it can impact my code
<toretore>
in my mind it just does what it wants, whenever it wants
<toretore>
out of my control
hpoydar has joined #ruby
<djellemah>
mikecmpbll: a bit late, but how about work.join(10) - that times out and returns nil if the thread isn't finished, or the thread object if it has finished.
<apeiros>
toretore: ok. I'm pretty sure your select solution just hits the scheduler too ;-)
blackmesa has quit [Ping timeout: 252 seconds]
<toretore>
should be the kernel no?
<mikecmpbll>
djellemah: fo real? ;<
<apeiros>
toretore: so IMO yours just adds 2 IOs to the solution. (that's why I asked).
<toretore>
not ruby's scheduler
<apeiros>
toretore: how do you think select allows ruby to schedule threads?
<jhass>
I don't think ruby has scheduler
anaeem1_ has quit [Remote host closed the connection]
<toretore>
haha yeah i think djellemah is right
<mikecmpbll>
haha oh crap
<mikecmpbll>
+1 djellemah
<jhass>
it's just pthreads these days, no?
<apeiros>
djellemah: oh wow, when did Thread#join gain a timeout?
<toretore>
apeiros: don't ask difficult questions, my brain doesn't work right now :P
<djellemah>
toretore: that as well. if the thread raises an exception, it only shows up once .join or .value is called.
<djellemah>
from another thread.
<apeiros>
djellemah: or if you set Thread.abort_on_exception = true
<apeiros>
which IMO should be the default.
<djellemah>
eeek!
orionstein has joined #ruby
Matadoer has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
stef204 has joined #ruby
wottam has joined #ruby
<djellemah>
I prefer to make sure I always call .join or .value.
<apeiros>
I rather have my program explode loudly than fail silently
<undeadaedra>
^
<apeiros>
djellemah: sadly you don't always control all thread spawning
<jhass>
so you could never write erlang :P
<apeiros>
or rather, joining
<djellemah>
apeiros: Try this in pry, cos ruboto won't: Thread.new{raise :eeek}.join
bkxd_ has joined #ruby
bkxd_ has quit [Client Quit]
<apeiros>
I assume you meant raise "eeek", not :eeek? :)
<apeiros>
(well, it serves the purpose - it'll raise :D)
<djellemah>
Nice catch, I did.
bkxd_ has joined #ruby
bkxd_ has quit [Client Quit]
bkxd_ has joined #ruby
<apeiros>
djellemah: yes, I understand. but that requires you to write perfect code.
norc has joined #ruby
juanpaucar has quit [Ping timeout: 256 seconds]
sigurding has quit [Quit: sigurding]
colorisco2 has quit [Ping timeout: 244 seconds]
<apeiros>
it also requires your dependencies to use perfect code.
Matadoer has joined #ruby
<toretore>
apeiros: also, your solution isn't thread safe ;) you don't know that sleep is going to run before current.wakeup
<djellemah>
apeiros: Well, abort_on_exception is useful for debugging then :-p
<apeiros>
toretore: true. needs a CV
<apeiros>
toretore: you say "also"? did I miss the first part?
<toretore>
apeiros: you can just set it globally to make all threads a_o_e though
<toretore>
apeiros: as in "why i chose to use select, part II"
<apeiros>
toretore: now I'm confused :D
<apeiros>
15:23 toretore: apeiros: you can just set it globally to make all threads a_o_e though
<apeiros>
yes, I said that
lethosor|away has quit [Quit: Connection closed for inactivity]
<apeiros>
15:19 apeiros: djellemah: or if you set Thread.abort_on_exception = true
enebo has joined #ruby
bkxd_ has quit [Client Quit]
bkxd has quit [Ping timeout: 250 seconds]
<toretore>
apeiros: re: other people's code spawning threads that raise
bkxd has joined #ruby
<apeiros>
toretore: yes, that's my argument in favor of aoe
<toretore>
if you want them to blow up, you can set it globally yourself
B1n4r10 has joined #ruby
<apeiros>
though, one could use it against too
<apeiros>
that other's code relies on .join raising
<apeiros>
(which won't be the case anymore once you set aoe)
bal has quit [Quit: bal]
<apeiros>
and I'm back at being unhappy about ruby's threading primitives :<
jconnolly has joined #ruby
bal has joined #ruby
<toretore>
anyway, with concurrency you just have to work with each other, there's no other way
kp666 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
hgl- has joined #ruby
<apeiros>
there is. but not in ruby.
B1n4r10 has quit [Client Quit]
tkuchiki has joined #ruby
<toretore>
if you enforce restrictions on the concurrency primitives available, yes
<mikecmpbll>
fwiw the idea that i was scoping out is that potentially long running tasks in a rails request lifecycle can be moved to the background if they take longe than x seconds and a response sent back to browser
<mikecmpbll>
if anyone knows that that exists already, point me at it and i'll stop :d
<norc>
http://pastie.org/10082477 -- This performs horribly slow at up to 10s. Any ideas how to make this a lot faster?
<apeiros>
norc: not with madeup code, no
<jhass>
norc: no, not if you keep the actual code hidden
roolo_ has quit [Quit: Leaving...]
<apeiros>
norc: also you may want to profile your code. maybe your expressions are bad.
<toretore>
norc: i want to see your real code
Advocation has quit [Quit: Advocation]
<djellemah>
apeiros: but a_o_e just kills the whole process if the (a) thread raises, right? So whether some of the other part of the code calls .join on that thread doesn't matter anymore?
<apeiros>
or even something you didn't consider
tosbourn has joined #ruby
Pharaoh2_ has joined #ruby
Pharaoh2 has quit [Disconnected by services]
StevenXL has joined #ruby
<toretore>
djellemah: fail early, and so on
<apeiros>
djellemah: right, whole process dies. wrong, it makes a difference. could have wrapped the join in begin/rescue.
<workmad3>
djellemah: I think apeiros's point is that a thread being used by a library may raise an exception that the library knows how to handle and could have recovered from, if you'd let the exception raise from join...
<apeiros>
djellemah: and I didn't think of that until yet, which is why in my threaded code, I have abort_on_exception on, and make sure my threads properly deal with exceptions as to not kill my process :)
jottr_ has quit [Quit: WeeChat 1.1.1]
<apeiros>
now that I thought of it, I'm no longer sure it's a good idea.
<apeiros>
and yes, workmad3 understood it correctly.
hgl has quit [Ping timeout: 264 seconds]
hgl- is now known as hgl
GnuYawk has joined #ruby
hpoydar has quit [Remote host closed the connection]
<toretore>
workmad3: but that would be part of the library's contract with the user: "i may raise exception x, which means ..."
tkuchiki has quit [Ping timeout: 256 seconds]
<toretore>
i don't think "exceptional" exceptions from a library should be expected
<workmad3>
toretore: not if it's an entirely hidden implementation detail ;)
<apeiros>
toretore: that's not what I'm talking about
fmcgeough has joined #ruby
<toretore>
that's what i'm saying; if it's actually an exception that shouldn't happen, it should crash the program
<workmad3>
toretore: i.e. the library has created the thread, and the library is .join ing the thread, and is expecting to handle exceptions at that point, so the exception is not part of the library's contract
<apeiros>
toretore: this library will work correctly with Thread.abort_on_exception = false
<workmad3>
toretore: but if a_o_e is on, then the exception aborts the program rather than being handled inside the library and your app continuing on
<apeiros>
it will stop to work correctly once you set Thread.abort_on_exception = true
tosbourn has quit [Ping timeout: 250 seconds]
<toretore>
yes yes, we all agree ;)
<workmad3>
toretore: ah, you mean the library's contract should say "I'm raising exceptions inside threads, so don't f***ing turn on a_o_e globally!!!"?
<apeiros>
and up until today I expected exception handling to happen *within* the thread. and then .abort_on_exception = true will not break.
fryguy9 has joined #ruby
<toretore>
workmad3: well, i think that'd be bad form, but yes that was the scenario
<apeiros>
but it will find silent crashes
<workmad3>
toretore: sure, I assume that the library author will be a bit more diplomatic with their language ;)
<toretore>
i have no issue with the language, just the code :P
<jhass>
the argument is that it requires knowledge and corporation of code running inside the thread
<jhass>
not that we lack mechanisms
slackbotgz has joined #ruby
<catphish>
doesn't thread#kill just raise an exception?
User458764 has joined #ruby
vozcelik has joined #ruby
<catphish>
i'm actually surprised we don't execute: puts "rescuing!"
polysics has quit []
<catphish>
but running the ensure is cool as long as you're expecting it
rbennacer has joined #ruby
gregf1 has joined #ruby
freerobby has quit [Quit: Leaving.]
mitchellhenke has joined #ruby
sigurding has quit [Quit: sigurding]
pika_pika has quit [Ping timeout: 245 seconds]
vt102 has quit [Remote host closed the connection]
ta_ has joined #ruby
Kricir has joined #ruby
Spami has quit [Quit: Leaving]
xenokiller has quit [Ping timeout: 250 seconds]
tvw has quit [Remote host closed the connection]
sevvie has joined #ruby
ascarter has joined #ruby
Macaveli has quit [Ping timeout: 272 seconds]
bruno- has joined #ruby
sigurding has joined #ruby
vt102 has joined #ruby
jayeshsolanki has joined #ruby
yh has joined #ruby
juanpablo__ has joined #ruby
Aswebb_ has joined #ruby
aryaching has joined #ruby
sevenseacat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
jlast has joined #ruby
withnale_ has quit [Ping timeout: 244 seconds]
<apeiros>
djellemah: the problem is that the exception happens uncontrolled anywhere in the execution of the thread. making it basically impossible to return to a clean state within ensure.
Channel6 has joined #ruby
withnale_ has joined #ruby
SouL_|_ has quit [Remote host closed the connection]
vt102 has quit [Remote host closed the connection]
sectionme has joined #ruby
sevvie has quit [Remote host closed the connection]
vt102 has joined #ruby
sevvie has joined #ruby
anaeem1 has joined #ruby
Spami has joined #ruby
wolf4ood has joined #ruby
Lloyd is now known as lloyd
tuelz has quit [Ping timeout: 240 seconds]
agarie has joined #ruby
sevenseacat has joined #ruby
anaeem1 has quit [Remote host closed the connection]
anaeem1 has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
mengu has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
knikolov has quit [Quit: WeeChat 1.2-dev]
rbennacer has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hobodave has joined #ruby
devans has joined #ruby
jottr has joined #ruby
juanpaucar has joined #ruby
juanpaucar has quit [Read error: Connection reset by peer]
tuelz has joined #ruby
juanpaucar has joined #ruby
khebbie has quit [Remote host closed the connection]
evanfreeman is now known as evanjs
johnchalekson has joined #ruby
linoj has joined #ruby
Splourian has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
ta has quit [Remote host closed the connection]
aryaching has joined #ruby
sevvie has quit [Remote host closed the connection]
mrmargolis has joined #ruby
horsecowdog has joined #ruby
bim has joined #ruby
FernandoBasso has quit [Quit: Leaving]
hobodave has quit [Quit: Computer has gone to sleep.]
kyrylo has quit [Ping timeout: 264 seconds]
evanjs is now known as evanfreeman
terlar has quit [Ping timeout: 255 seconds]
snath has joined #ruby
bim has quit [Remote host closed the connection]
ahmetkapikiran has joined #ruby
hmsimha has joined #ruby
bim has joined #ruby
knikolov has joined #ruby
joonty has quit [Read error: Connection reset by peer]
evanfreeman has quit [Quit: Leaving...]
Megtastique has joined #ruby
horsecowdog has quit [Ping timeout: 276 seconds]
evanjs has joined #ruby
sigurding has quit [Quit: sigurding]
sinkensabe has quit [Remote host closed the connection]
bal has quit [Quit: bal]
GnuYawk has quit [Quit: WeeChat 1.0]
d10n-work has joined #ruby
<djellemah>
Oh, the Thread.kill thing was tangential. Mostly undocumented, and quite useful IMO. Not a response to the previous discussion ;-)
<undeadaedra>
thread is kill?
ascarter has joined #ruby
<gregf_>
one is scared, the other is confused, the third is a coward and the fourth blames the rest for any and every failure amongst other awful harmless crimes
<gregf_>
er, sorry :/ wrong chat :/
hmsimha has quit [Ping timeout: 252 seconds]
krz has quit [Quit: WeeChat 1.0.1]
<undeadaedra>
seems interesting
<djellemah>
gregf_: Still, a noble sentiment...
jefus_ has joined #ruby
<gregf_>
heh.. its a reality... unfortunately
iwishiwerearobot has quit [Quit: Be back later ...]
oddskill_away is now known as oddskill
knikolov has quit [Quit: WeeChat 1.2-dev]
craigp has quit []
<mikecmpbll>
haha wut
hyperjuice has joined #ruby
jefus has quit [Ping timeout: 256 seconds]
sevenseacat has quit [Quit: Me dun like you no more.]
brainslug has quit [Quit: all glory to hypnotoad]
knikolov has joined #ruby
bim has quit [Remote host closed the connection]
brainslug has joined #ruby
b0t00 has joined #ruby
<jhass>
I think I know who number four is
aswen has quit [Ping timeout: 248 seconds]
joonty has joined #ruby
brainslug has quit [Client Quit]
brainslug has joined #ruby
pagios has quit [Remote host closed the connection]
<jhass>
but as said, usually you want to keep it as a nested array or such
<undeadaedra>
I should have mixed something then
jayeshsolanki has quit [Ping timeout: 264 seconds]
<jhass>
to signal clearly that you depend on an ordered structure
Jackneill has joined #ruby
<undeadaedra>
but my data is not really nested
<jhass>
or not nested, not the point
Sawbones_ has quit [Remote host closed the connection]
tosbourn has joined #ruby
doodlehaus has joined #ruby
Sawbones_ has joined #ruby
Megtastique has quit []
<undeadaedra>
Ok so I messed the Hash order insertion in my head, sorry
Rollabunna has quit [Remote host closed the connection]
<undeadaedra>
But I don't follow about the nested array then
Rollabunna has joined #ruby
byprdct has joined #ruby
beatrichartz has joined #ruby
sigurding has quit [Ping timeout: 250 seconds]
byprdct has quit [Max SendQ exceeded]
<jhass>
While Rubys map type implementation (Hash) guarantees insertion order, being ordered is not in the intention/nature of a map, it's in the intention/nature of a list (like Array)
dfinninger has joined #ruby
ponga has quit [Remote host closed the connection]
<undeadaedra>
mh yes
Pupeno has quit [Ping timeout: 256 seconds]
<jhass>
so when relying on the order of something, using a data structure who's not only in its implementation, but also in its nature/definition ordered leaders to clearer code IME
<jhass>
*leads
tosbourn has quit [Ping timeout: 248 seconds]
<undeadaedra>
yes, I agree
Pupeno has joined #ruby
joonty has quit [Quit: joonty]
Takle has joined #ruby
<undeadaedra>
But if I have an array of elements, and a Hash with element's name as key, it would be more efficient to lookup using Hash#[] than Array#find, no?
GaryOak_ has joined #ruby
ta has quit [Remote host closed the connection]
<jhass>
well sure
davispuh has joined #ruby
mjuszczak has quit [Ping timeout: 240 seconds]
<jhass>
but from that question I don't follow why the order of the hash would matter
<jhass>
as said, some code might clarify
<undeadaedra>
Because here my data are both with non-numerical access (but I need random access by their key) and ordered by insertion
riotjones has joined #ruby
<jhass>
can you remove the abstractions? what would be the data and what do you do with it?
pullphinger has joined #ruby
<undeadaedra>
it's a routing system – so I have routes which I have names on them (to retrieve them and their path by name) and I record them by insertion order to process them in same order when matching
fgjfjs has quit [Ping timeout: 265 seconds]
Takle has quit [Remote host closed the connection]
<jhass>
mh, and why do you need (constant) key access? do you optimize for routes that match literally and require no pattern matching?
JDiPierro has quit [Remote host closed the connection]
<undeadaedra>
for url construction from a name
<undeadaedra>
I just give a pre-determined name and it returns the real path
<jhass>
ah, I see
rippa has joined #ruby
<jhass>
mh, I guess I would consider making an exception there indeed, though I'd try to wrap it up in a thin class that also does the matching
<jhass>
and not expose the hash anywhere
<undeadaedra>
This is what I'm doing, this wrapper class
<undeadaedra>
And I was wondering which data structure I would put into it
<shevy>
are you guys still struggling with code
<shevy>
it should be like poetry!
<undeadaedra>
like wiping your ass with silk?
Lucky__ has joined #ruby
jeff_laplante has joined #ruby
<shevy>
like thinking that you are doing creative work while you are in the toilet
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
<mg^>
I just did creative work on the toilet.
<undeadaedra>
jhass: thanks for the discussion anyway
<mg^>
Inspiration starts with the prior meal!
<jhass>
undeadaedra: yw, thanks for bearing with me I guess ;)
<undeadaedra>
np
lemur has joined #ruby
<mg^>
ahh the inappropriate things I say that keep me from having a normal social life.
icebourg has joined #ruby
MatthewsFace has joined #ruby
krisquigley has quit [Remote host closed the connection]
mjuszczak has joined #ruby
ahmetkapikiran has joined #ruby
<shevy>
mg^ yeah, you are what you eat. I have been not feeling too well about certain food types in the past. While I have no allergy, I decided to avoid certain things. like potato chips, there is sometimes some strange covering on them, I have been feeling not too well afterwards, in one case was sick for 2 days
krisquigley has joined #ruby
Zamyatin has quit [Quit: Knocking out. Peace y'all...]
ebbflowgo has quit [Read error: Connection reset by peer]
<mg^>
yikes
<mg^>
Pre-prepped store potatoes get me
ebbflowgo has joined #ruby
<mg^>
they put some kind of anti-oxidant on them that roughs up my gut
beneggett has quit [Remote host closed the connection]
eoeamy has joined #ruby
TheNumb is now known as OpenRC
djbkd has quit [Ping timeout: 240 seconds]
<shevy>
oh?
nerium has quit [Quit: nerium]
<shevy>
I always thought it was some chili-pepper covering that got me
opes has quit [Max SendQ exceeded]
<shevy>
now you made me nervous
riotjones has quit [Ping timeout: 255 seconds]
opes has joined #ruby
maletor has joined #ruby
Porfa has joined #ruby
krisquigley has quit [Ping timeout: 245 seconds]
<mg^>
I'm not sure about potato chips, as I don't eat them often, but things like these http://www.simplypotatoes.com/products/ have something that keeps them from browning from air exposure
<atmosx_bsd>
aloha
cartothemax has quit [Remote host closed the connection]
cartothemax has joined #ruby
palms has quit [Ping timeout: 252 seconds]
JDiPierro has joined #ruby
maletor has quit [Client Quit]
Porfa has quit [Client Quit]
dumdedum has quit [Quit: foo]
Hounddog_ has quit [Ping timeout: 252 seconds]
maletor has joined #ruby
mjuszczak has quit []
deuterium has quit [Quit: zzZZZzzz..]
mjuszczak has joined #ruby
maletor has quit [Client Quit]
Sawbones_ has quit [Remote host closed the connection]
<shevy>
aha
linoj has quit [Quit: linoj]
mkode has quit [Quit: For Sale: Intergalactic Proton Powered Electrical Tentacled Advertising Droids]
CustosLimen has quit [Ping timeout: 265 seconds]
<shevy>
I guess that makes sense when you "design" food...
serivich has quit [Quit: Leaving]
<shevy>
until it becomes no longer edible/digestable :)
zorak8 has joined #ruby
<shevy>
atmosx_bsd hey... why are you on BSD and not LSD or linux
<apeiros>
jhass: not today. today is valaptor's turn
<jhass>
you have too many projects :P
<latemus>
apeiros what are you quoting
<apeiros>
latemus: the response of the bot needs quotes
<latemus>
apeiros: ah.
<apeiros>
funny, valaptor is the first project where I write the full "how to use" first, and code after. I hope that helps me figure the best way to do its interface.
<apeiros>
still feel like I'm missing something :-/
<jhass>
what will it even do?
SolarSailor has quit [Quit: My Turing machine has gone to sleep. ZZZzzz…]
<apeiros>
value validation & adaptation
juanpaucar has quit [Ping timeout: 252 seconds]
<apeiros>
in a less annoying or coupled fashion than existing solutions
<jhass>
ah, so basically a component of jacob?
<apeiros>
i.e. you could implement AR's validations in a couple of lines with it (which is one reason of what I use them for)
<apeiros>
yes. but one of the few components which are in a separate gem.
<jhass>
figured
<apeiros>
unlike rails, I don't only do validation in models.
<apeiros>
IMO rails got that quite wrong. which leads to some convoluted situations.
wolf4ood has quit [Quit: (null)]
krisquigley has joined #ruby
ki0 has joined #ruby
<apeiros>
i.e., it shouldn't be the model which adapts a date select's 3 separate values into a Date object. that's controller duty.
marr has quit [Read error: Connection reset by peer]
<apeiros>
one consequence of how rails does it -> invalid date means the selected values can't be rendered anymore (because e.g. 2015-02-31 can't be turned into a Date)
bim has joined #ruby
DerisiveLogic has quit [Remote host closed the connection]
dstarh has joined #ruby
DerisiveLogic has joined #ruby
wald0 has joined #ruby
jerius has quit [Changing host]
jerius has joined #ruby
ki0 has quit [Ping timeout: 252 seconds]
DrShoggoth has joined #ruby
krisquigley has quit [Ping timeout: 250 seconds]
jerius has quit [Quit: /part]
momomomomo has quit [Quit: momomomomo]
rdark has quit [Read error: Connection reset by peer]
jerius has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
FernandoBasso1 has joined #ruby
joshs has joined #ruby
DerisiveLogic has quit [Remote host closed the connection]
longfeet has quit [Ping timeout: 240 seconds]
lolmaus has quit [Quit: Konversation terminated!]
kaleido has joined #ruby
FernandoBasso has quit [Ping timeout: 245 seconds]
chinmay_dd_ has joined #ruby
chinmay_dd_ has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
n80 has quit [Client Quit]
rrichard_ has joined #ruby
Takle has joined #ruby
Takle has quit [Read error: Connection reset by peer]
dseitz has joined #ruby
Takle has joined #ruby
mikenovikov has joined #ruby
tier has joined #ruby
Azure has joined #ruby
rrichard_ has quit [Client Quit]
rrichardsr3 has quit [Ping timeout: 240 seconds]
pandaant has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
akurilin2 has joined #ruby
gfawcettpq has quit [Ping timeout: 245 seconds]
duggiefresh has joined #ruby
RegulationD has quit [Remote host closed the connection]
akurilin has quit [Ping timeout: 245 seconds]
Takle has quit [Ping timeout: 248 seconds]
ghr has joined #ruby
kirun has joined #ruby
sevvie has quit [Ping timeout: 255 seconds]
riotjones has quit [Ping timeout: 252 seconds]
cartothemax has quit [Remote host closed the connection]
<pagios>
hi all
poguez_ has quit [Quit: Connection closed for inactivity]
joshs has quit [Remote host closed the connection]
sankaber has quit [Ping timeout: 264 seconds]
Sawbones_ has joined #ruby
einarj has joined #ruby
dfinninger has joined #ruby
djbkd has joined #ruby
akurilin3 has joined #ruby
<wallerdev>
hi
ghr has quit [Ping timeout: 264 seconds]
bayed has quit [Quit: Connection closed for inactivity]
akurilin2 has quit [Ping timeout: 256 seconds]
Sawbones_ has quit [Remote host closed the connection]
mamiya has quit [Remote host closed the connection]
einarj has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
einarj has joined #ruby
vudew has joined #ruby
Sawbones_ has joined #ruby
palms has joined #ruby
livathinos has quit []
sevvie has joined #ruby
mjuszczak has quit []
Sawbones_ has quit [Remote host closed the connection]
Limix has joined #ruby
nettoweb has quit [Ping timeout: 272 seconds]
baweaver has joined #ruby
Pharaoh2 has joined #ruby
Sawbones_ has joined #ruby
dseitz has quit [Read error: Connection reset by peer]
horsecowdog has joined #ruby
dseitz has joined #ruby
meschiv2 has quit [Ping timeout: 264 seconds]
rocknrollmarc has joined #ruby
ponga has joined #ruby
momomomomo has joined #ruby
danman has joined #ruby
mjuszczak has joined #ruby
devans has quit [Read error: Connection reset by peer]
bim has quit [Remote host closed the connection]
chinmay_dd has quit [Remote host closed the connection]
blueOxigen has joined #ruby
devans has joined #ruby
scottelundgren has left #ruby ["Textual IRC Client: www.textualapp.com"]
bluOxigen has quit [Ping timeout: 245 seconds]
gfawcettpq has joined #ruby
bim has joined #ruby
dseitz_ has joined #ruby
Takle has joined #ruby
rocknrollmarc has quit [Max SendQ exceeded]
CpuID has joined #ruby
meschiv2 has joined #ruby
rocknrollmarc has joined #ruby
horsecowdog has quit [Ping timeout: 256 seconds]
dseitz has quit [Ping timeout: 256 seconds]
yfeldblum has joined #ruby
<shevy>
all hi
<headius>
the CLR's JIT only runs once, immediately before execution
<arup_r>
o/
<arup_r>
bye
ponga has quit [Ping timeout: 240 seconds]
<headius>
oops, out of context
<arup_r>
who?
cartothemax has joined #ruby
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 37.0.1/2015040300]]
ki0 has joined #ruby
horsecowdog has joined #ruby
nettoweb has joined #ruby
Sawbones_ has quit [Remote host closed the connection]
sevvie has quit [Ping timeout: 244 seconds]
rocknrollmarc has quit [Ping timeout: 246 seconds]
<pagios>
!help
A124 has joined #ruby
Karpuragauram has joined #ruby
Pharaoh2 has quit [Disconnected by services]
Pharaoh2_ has joined #ruby
davidhq has quit [Read error: Connection reset by peer]
vivekananda has quit [Read error: Connection reset by peer]
davidhq_ has joined #ruby
GaryOak_ has quit [Remote host closed the connection]
<jhass>
apeiros: me, we should let ruboto answer "no" to ^ :P
<jhass>
*mh
chipotle has quit [Read error: Connection reset by peer]
spyderma_ has joined #ruby
chipotle has joined #ruby
baweaver has quit [Remote host closed the connection]
Sawbones_ has joined #ruby
cartothemax has quit [Read error: Connection reset by peer]
pietr0 has joined #ruby
ki0 has quit [Ping timeout: 248 seconds]
Takle_ has joined #ruby
cartothemax has joined #ruby
tesuji has joined #ruby
<apeiros>
while funny, I'd prefer a helpful answer. akin to "Help us help you. Put your code on gist.github.com, along with the input, the expected output and the actual output. if your actual output is an exception, gist the full backtrace.
<apeiros>
"
CorpusCallosum has quit [Remote host closed the connection]
Fraeon has quit [Ping timeout: 256 seconds]
spyderman4g63 has quit [Ping timeout: 265 seconds]
Fraeon has joined #ruby
joshs has joined #ruby
Takle has quit [Ping timeout: 252 seconds]
lavros has quit [Quit: leaving]
vozcelik has quit [Read error: Connection reset by peer]
phale has joined #ruby
<jhass>
yeah, could probably do that fuzzy, like word count < 10 and searching for (some|any)body
spyderma_ has quit [Read error: Connection reset by peer]
ghostmoth has joined #ruby
dumdedum has quit [Quit: foo]
towski_ has quit [Remote host closed the connection]
<jhass>
the use of globals is a bit alarming, but for unrelated reasons
<jhass>
are you sure your script even hits the logger calls?
amdbcg has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kadoppe has joined #ruby
rbennacer has joined #ruby
rodfersou has quit [Read error: Connection reset by peer]
rodfersou has joined #ruby
rbennacer has quit [Remote host closed the connection]
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
Kricir has quit [Remote host closed the connection]
iamjarvo has joined #ruby
wallerdev has quit [Quit: wallerdev]
iamjarvo has quit [Max SendQ exceeded]
Sawbones_ has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Ellis has joined #ruby
<Ellis>
is a method a design pattern? i mean it is used to solve a problem
rbennacer has joined #ruby
<drocsid>
jhass: maybe I'm making a poor assumption, but the response code seems to return a value in my case statment. Regarding the use of globals, should I make this a class and use "private fields" instead? Not sure if that's the proper ruby terminology?
speaking1ode has joined #ruby
speaking1ode has joined #ruby
<jhass>
drocsid: verifying assumptions is always good, so add an else branch to your case statement for unmatched values
speaking1ode is now known as jalapeno
<jhass>
regarding the globals, half of them are constants, half of them want to be arguments to your method or a class if you you wrap your method into one
<drocsid>
jhass: thanks. I am also going to try the log.info elsewhere.
speakingcode has quit [Disconnected by services]
<jhass>
Ellis: no
jalapeno is now known as speakingcode
baweaver has joined #ruby
<Ellis>
jhass: but according to wikipedia “a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.” so what doesn’t this count?
apoplexy has joined #ruby
pontiki has joined #ruby
<drocsid>
jhass: yeah I was thinking about constants... I don't really like passing lots of arguments to methods. Considering a class. I'm only a novice programmer. Thanks for the tips.;
<jhass>
Ellis: a method structures implementation, a design pattern structures software design
tosbourn has joined #ruby
n80 has quit [Quit: n80]
<jhass>
drocsid: yw
davispuh has joined #ruby
<Ellis>
jhass: doesn’t a factory method structure implemenation?
momomomomo has joined #ruby
willharrison has joined #ruby
quimrstorres has joined #ruby
<baweaver>
Ellis: There's little to no point in debating semantics.
<Ellis>
i’m not debating i’m asking for clarification
<jhass>
factory method defines a way how your child classes interact with the parent class, that's a design decision
<jhass>
maybe it helps to clarify that design patterns are nothing static
<jhass>
they're not like keywords in a programming language
<jhass>
they're rather terms for recurring patterns to easy conversation about your code
<jhass>
*ease
<GaryOak_>
beginners seem to get confused by this a lot
stef204 has joined #ruby
<jhass>
"Oh, I see, this is a singleton?", "Yeah"
<Ellis>
jhass: you said methods “structure implemenation” what does that mean?
<Ellis>
btw thanks for responding to my question
<jhass>
instead of "Oh, I see, this is a classes that makes sure there's only one instance of it by making the constructor private?"
jconnoll1 has quit [Quit: Lost terminal]
gfawcettpq has quit [Ping timeout: 244 seconds]
tosbourn has quit [Ping timeout: 250 seconds]
<djellemah>
I don't like my patterns reified.
Sawbones_ has joined #ruby
<Ellis>
you just like them abstract
<jhass>
Ellis: structure as in divide into understandable, reusable chunks of code
FernandoBasso1 has quit [Quit: Leaving]
<Ellis>
jhass: gotcah
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
<Ellis>
so MVC is a design pattern, what are some other common ones?
<Ellis>
active record
<baweaver>
PubSub, Singleton, Factory
<jhass>
Wikipedia has a nice category for that
<GaryOak_>
If you remember that an 'object' in code is similar to an 'object' in the real world you'll have an easier time
r3dK1ng has quit [Remote host closed the connection]
<Ellis>
so designpatterns are used to create software and methods create parts of software?
<centrx>
the apperception of an object is the same whether the object exists in code or whether it exists in some 'underlying reality' posited by quantum physicists
<jhass>
I think that's a common misconception about design patterns
<baweaver>
Depending on how new you are I'd almost hesitate on fixating on design patterns.
<jhass>
stuffing as many patterns into your application design doesn't lead to a good application design
<baweaver>
that ^
hyperjuice has quit [Remote host closed the connection]
<jhass>
I rather let them emerge naturally and use them as terms for those emerging constructs and maybe sometimes to go the last step
<djellemah>
Ellis: write lots of code. The patterns will start becoming obvious.
bim has quit [Remote host closed the connection]
amdbcg has quit [Ping timeout: 276 seconds]
<jhass>
which also mean there's not "the right way" to do "pattern X"
<baweaver>
As to what happens when you're a near religious member of the cult of pattern
<baweaver>
Class AbstractSingletonProxyFactoryBean
<jhass>
you're allowed to bend and adjust them to your usecase
johnchalekson has quit [Ping timeout: 250 seconds]
<jhass>
Observer is a good example of that, you'll find hundreds of variations of that
momomomomo has quit [Ping timeout: 245 seconds]
momomomomo_ is now known as momomomomo
<GaryOak_>
I wrote a blog post about design patterns, but I'm not going to post it for fear of humiliation :P
<djellemah>
baweaver: I will memorise that for the next time I run into someone with pattern vision.
<baweaver>
That's one of the best jabs in public source
<baweaver>
though I've seen way worse in private Java code I had to deal with.
<baweaver>
part of the reason I flat out refuse to touch Java
linoj has joined #ruby
<GaryOak_>
that's because of enterprise Java, and the std lib, not because of Java itself
dfinninger has joined #ruby
<baweaver>
Java itself is still an annoying language.
phutchins has quit [Ping timeout: 245 seconds]
pontiki has quit [Remote host closed the connection]
ki0 has quit [Remote host closed the connection]
<baweaver>
enterprise aside.
n80 has quit [Quit: n80]
zzing has joined #ruby
sgambino has quit [Remote host closed the connection]
nerium has quit [Quit: nerium]
<GaryOak_>
We should be asking what makes enterprise code need to look like that, and it's probably a type system
<baweaver>
Part of me dies inside every time I see something like: new Function<String, Boolean>() {
<baweaver>
GaryOak_: Nope
<Ellis>
what kind of job can i get besides a rails developer if i learn ruby??
<GaryOak_>
sinatra developer
<baweaver>
Haskell and Scala are most certainly statically typed and far better languages
<baweaver>
SysAdmin
mjuszczak has quit []
<baweaver>
Chef
<djellemah>
Coffeescript developer.
<GaryOak_>
Python Dev
<Ellis>
can i create desktop software with ruby? or is that dumb
<pagios>
samurai
<baweaver>
Doable but annoying
Soda has quit [Remote host closed the connection]
<baweaver>
the toolkit for it never really took off well, but it can be done.
<Ellis>
baweaver: i see
freerobby has joined #ruby
<baweaver>
GaryOak_: Bad news if type systems really do create a problem, Matz was talking about going static in 3.0
<GaryOak_>
whoa
<baweaver>
both have their advantages
kyrylo has joined #ruby
<GaryOak_>
definitely
<Ellis>
baweaver: what does going static mean
<baweaver>
types aren't the problem
<baweaver>
static typing
<baweaver>
instead of dynamic.
<ducklobster>
Is there a way to catch a kill (Kernel#exit) from within a thread and NOT terminate the entire ruby application?
<jhass>
baweaver: well, rather type checks
<baweaver>
yeah, granted.
<weaksauce>
the minitest docs say that it comes with rake tasks for running the tests. but for non rails projects it complains that there is no rakefile found. adding an empty rakefile talks about how there is no test task or no default task. Are the docs wrong or am I doing something wrong?
robbyoconnor has quit [Read error: Connection reset by peer]
CaptainCibai has joined #ruby
xenokiller has joined #ruby
duncannz has joined #ruby
<ninjs>
thanks! You guys rock
<shevy>
that nick is so cool
<shevy>
there is ninja and then there is ninjs
<drocsid>
I'm doing something wrong with the net/http library. My request string is turning null. I'm trying to use the same http session for each of my download requests. I'm only a ruby novice, can somebody explaing to me what I'm doing wrong?