<pcfreak30>
RenderRob: me either. i stick to 5.3.3 as i need compatibility on my apps. 5.4 breaks shit with the restrictions on class method signatures on subclases
iliketur_ has joined #ruby
zzz_taion is now known as taion809
sambao21 has joined #ruby
mengu has quit [Quit: This computer has gone to sleep]
snath has joined #ruby
<volty>
platzhirsch: add "infinite behavior"
mrsolo has quit [Quit: This computer has gone to sleep]
<platzhirsch>
volty: ah ok, no. I don't want to do that. That seems non-deterministic ^^
<volty>
though you could add "infinite behavior" with assembler too - though with infinite pain
fourq__ has joined #ruby
<pcfreak30>
What really annoys me is the overuse of blocks and non use of for/foreach. The syntax gets confusing quicly
<volty>
pcfreak30: but there's use of methods that iterate using (for)each
<banisterfiend>
pcfreak30: you're talking about ruby or php?
<volty>
a.map { |x| x ** 2 } is much clearer and compact than allocating a new array and foreach-ing it
samsagaz has joined #ruby
<xybre>
pcfreak30: "for" is Bad in Ruby
<pcfreak30>
banisterfiend: ruby. im seing blocks/yeild used everywhere and it gets confusing quicly. I mean I saw opening a file in a block and using the variable passed to write to it
dodosan has quit [Remote host closed the connection]
<xybre>
pcfreak30: the File.open block automatically closes the file when it exits, its a feature
<banisterfiend>
pcfreak30: yeah, that's actually brilliant :) The file is automatically closed
vlad_starkov has joined #ruby
<volty>
pcfreak30: you'll get used very very quickly
<xybre>
An *optional* feature mind you
julweber has joined #ruby
<platzhirsch>
just eat more of these pills
Tomasso has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
* xybre
eats platzhirsch's pillz
<platzhirsch>
lol
<platzhirsch>
Pilz, mushroom, aye?
<banisterfiend>
pcfreak30 we have a bunch of other things like that, for example: capture_io { puts "hello world!" } will capture all writes to stdout in that block and return it as a string, there's similar things like: no_warnings { code inside this block never generates warnings } and things like: after(10.seconds) { puts "hello!" }
rupee has quit [Quit: Leaving]
rcosta has quit [Remote host closed the connection]
<pcfreak30>
and capture_io and no_warnings are methods?
<banisterfiend>
pcfreak30 yes, they're not in core, but some gems provide it
<banisterfiend>
pcfreak30 that's the true power of ruby's blocks (and optional parentheses) you can define methods that look a lot like keywords
duggiefresh has joined #ruby
iamjarvo_ has joined #ruby
<banisterfiend>
loop { puts "do this forever" } is actually a method too
<pcfreak30>
and how do you define that method
<pcfreak30>
can you provide an example?
<banisterfiend>
def loop; while(1) yield ; end; end
<banisterfiend>
while(true)
vlad_starkov has quit [Ping timeout: 268 seconds]
hamakn has joined #ruby
<volty>
while (1) is ok
<volty>
while (0.0000001) too :)
snovak has joined #ruby
<volty>
while (0) too
<pcfreak30>
how exactly does that capture_io function
<pcfreak30>
curious n how it captures all output in the block. same on the warnings
<volty>
loop { puts "forever" }
beneggett has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
<volty>
yield calls the block you pass after 'loop'
iliketur_ has quit [Quit: zzzzz…..]
julweber has quit [Ping timeout: 260 seconds]
<pcfreak30>
Ok then whats with the do syntax
<pcfreak30>
like each do .. end
<volty>
same but not same
fourq__ is now known as lowcard
<volty>
at least for 1.8.7 - i don't know about later versions
<volty>
something to do with the precedence of evaluation - i can't remember now
<pcfreak30>
is there any difference between lke each do end and each {}
platzhirsch has left #ruby [#ruby]
twoism_ has quit [Remote host closed the connection]
twoism has joined #ruby
<volty>
pcfreak30: i told you, there is (or was) but can't remember in what and where, i only know that it was about precedence of evaluation when nesting (or passing ... or whatever ...)
brianpWins has quit [Quit: brianpWins]
thomasvs has quit [Quit: Coyote finally caught me]
iamjarvo has quit [Remote host closed the connection]
hamakn has joined #ruby
Ripp__ has quit [Quit: Ripp__]
doritostains has quit [Quit: Leaving...]
thomasvs has joined #ruby
iamjarvo has joined #ruby
randomau_ has joined #ruby
kofno has quit [Quit: leaving]
rafacv has quit [Remote host closed the connection]
twoism has quit [Ping timeout: 240 seconds]
kofno has joined #ruby
snovak has joined #ruby
lowcard has quit [Ping timeout: 260 seconds]
browndawg has joined #ruby
tabolario has joined #ruby
yshh has joined #ruby
randomautomator has quit [Read error: Operation timed out]
<volty>
never trip: i always use curly braces, i always enclose function arguments in parenthesis, i always put '()' on method call without params
nari has joined #ruby
<volty>
(and that's why i forgot about it)
<Buuyo>
you're so full of advice all the time volty!
shvelo has joined #ruby
<volty>
naaa, it wasn't an advice, it was about what I do
<Buuyo>
it sounds like leading by example. what other great things do you do?
<volty>
it is so impressive how imprecise you are!
iliketur_ has quit [Quit: zzzzz…..]
<volty>
it is about coherency of writing: stick with whatever but write always in same manner - if you want to avoid trips
<eka>
hi there, need to download images from the inet… what's the best option? open-uri? wget? what do you recommend?
<banisterfiend>
volty i don't believe you put () on method calls without parms
lowcard has joined #ruby
Voodoofish430 has quit [Quit: Leaving.]
<Buuyo>
volty: what's your take on collaborative development efforts then? what if the rest of your team uses do end? Do you stick to { } regardless of what the team is doing?
<volty>
banisterfiend: absolutely yes // don't want to think if it is a local var or method call when reading back after some time
<banisterfiend>
volty you do this? attr_accessor(:x) and loop() { } and public()
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<banisterfiend>
volty can you show me your github? I just don't believe you do attr_accessor(:x) :)
<volty>
banisterfiend: not that deep! :)
<Buuyo>
heh
<banisterfiend>
volty: right, so you don't always put () on methods without parameters, then ;)
<sevenseacat>
so many parens are fugly, ive argued about people doing that time and time again
<volty>
yes, you are right, i had to specify that i was talking about code inside methods
<banisterfiend>
Buuyo the general rule is {} for single line, and do/end for multi-line blocks
<banisterfiend>
but some people use {} when they're interested in the return value, and do;end when they only care about the side effects
<volty>
banisterfiend: there's no rule about that, it is a matter of preference
zarubin has quit [Ping timeout: 240 seconds]
pen has quit [Remote host closed the connection]
<sevenseacat>
if you use {} for multi line things, people are going to get grumpy at you
pen has joined #ruby
rgbdev has quit [Quit: rgbdev]
<banisterfiend>
volty It's not a hard and fast rule, but the things i wrote above are commonly applied
<Buuyo>
community standards i suppose
<banisterfiend>
personally i always use {} for single line and do/end for multi-line
rodacato has joined #ruby
<volty>
the world is nice because there so many non-common people out there
<banisterfiend>
Buuyo clearly there are variations, but i think most experienced rubyists would agree with at east 80-90% of that guide
<banisterfiend>
least
Rym_ has joined #ruby
<volty>
freedom of choice: if you have difficulties reading else's code than write (or use if ready) a reformatter
Rym has quit [Ping timeout: 240 seconds]
Rym_ is now known as Rym
<Buuyo>
banisterfiend: i'm happy that looking through this, so far none of the examples are offending my senses. :)
<volty>
strange that such a powerful language doesn't have such instruments // should we propose it as a built-in feature?
mansi has quit [Remote host closed the connection]
mansi has joined #ruby
christianrojas has quit [Quit: Leaving...]
tkuchiki has quit [Remote host closed the connection]
<Buuyo>
volty: that might be problematic from a change tracking standpoint though, unless your checkin process automatically passes it through a code beautifier. :p
<Buuyo>
(putting it back to how it was)
c0rn has quit [Ping timeout: 264 seconds]
<volty>
the richness of our world comes from adding solvers for problematic things // i'm sure it will come, though not when
hamakn has joined #ruby
mansi_ has joined #ruby
<volty>
i don't like, for example, FooError = Class.new(StandardError)
brianpWins has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
<volty>
i prefer class FooError < StandardError; end (on two lines too) since I too often add and remove methods (for checking, debugging, or whatever, purposes)
mansi has quit [Read error: Connection reset by peer]
<sevenseacat>
i also dont like the single-line methods when the body is empty
jamesaanderson has joined #ruby
Davey has joined #ruby
<volty>
i find stupid to tag as bad this rule: < puts 'foo'; puts 'bar' # two expression on the same line
<volty>
i find stupid to tag as bad : < puts 'foo'; puts 'bar' # two expression on the same line // since i won't consume extra lines for trivial output
nhhagen has joined #ruby
<Buuyo>
what's wrong with extra lines? code's read more often than written. so a little clarity never hurt anyone.
Davey is now known as Eomar
<volty>
trivial puts have nothing to do with clarity - imho
zastern has joined #ruby
butblack has joined #ruby
kizzx2 has joined #ruby
nhhagen has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby
pen has quit [Remote host closed the connection]
SilverKey has quit [Quit: Cheerio!]
<volty>
case keyword: i do not agree, for me it is much easier to see the extension of the 'case' when 'when''s are indented - especially if I have a long else clause
<Buuyo>
I don't seem to use case very often. :x
<volty>
i use case mainly for the sake of matching against class
<Buuyo>
maybe it's from experience in other languages, but if there's a lot of case/switch statements, the code's got a smell to it.
<banisterfiend>
volty: in C case is not indented from switch, either.
<volty>
banisterfiend: yes, but I used to indent it // maybe i got it from pascal (but now I can't remember the equivalent )
GeissT has joined #ruby
<banisterfiend>
volty you're writing non-idiomatic C then ;)
huoxito has joined #ruby
<volty>
myself little idiomatic, either :)
mlpinit has joined #ruby
<volty>
thanks for the guide, i stop reading, I'm above 85 % compliant
dagnachew has joined #ruby
jdolitsky1 has quit [Quit: Leaving.]
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
<pontiki>
volty: are you talking in verse?
lowcard has quit [Ping timeout: 264 seconds]
<volty>
pontiki: from time to time :)
jprovazn has joined #ruby
hamakn_ has joined #ruby
<volty>
Buuyo: you are right, imho, ruby is not a case language
hamakn has quit [Read error: Connection reset by peer]
jprovazn has quit [Remote host closed the connection]
<pontiki>
volty: kinda neat :)
brianpWins has quit [Quit: brianpWins]
<Buuyo>
volty: not just ruby. a lot of oo languages are like that too.
brianpWins has joined #ruby
mary5030 has quit [Remote host closed the connection]
<pontiki>
is there any language that handles case/switch well?
<Buuyo>
you dont see giant switch cases like ioctl switches in the kernel. heh.
tkuchiki has joined #ruby
<pontiki>
i'm almost always going to a jump table / array instead
<volty>
Buuyo: i do not agree, i used to do a lot of casing in c++, and pascal before (or delphi - booh)
<banisterfiend>
pontiki functional languages have pattern matching, which is like case/switch on a potent mix of cocaine and lsd
<pontiki>
i don't much like them in lisp, either
<banisterfiend>
pontiki check out haskell and (probably) scala
<pontiki>
i should, really
hornairs has quit [Quit: hornairs]
<banisterfiend>
in haskell they're quire incredible
<Buuyo>
volty: a lot of people associate a smell with c++ code with humongous switch cases.
<pontiki>
i started to look into haskell, but, well, you know
pen has joined #ruby
<pontiki>
i have LUAHFGG
<volty>
me too prefer arrays, but, as you know, when you are concentrated on solving something hard you go by brute force and often do not refactor it
<banisterfiend>
pontiki yeah i finished that book a few weeks ago, it's pretty good, but is also pretty confusing in some places, esp when it tries to describe things like foldr
<pontiki>
hah
<pontiki>
yeah :)
<pontiki>
i eventually did get that
<pontiki>
by folding paper
<banisterfiend>
well the explanation in LUAH was just wrong (according to guys in #haskell :P)
browndawg has quit [Quit: Leaving.]
<pontiki>
ah
splittingred has joined #ruby
<pontiki>
not surprising actually, given it's provenance
<volty>
« functional languages have pattern matching, which is like case/switch on a potent mix of cocaine and lsd» - add viagra and i go for it :)
<Buuyo>
oh dear.
pencilcheck has joined #ruby
browndawg has joined #ruby
<volty>
i am a mouse and lisp hater
<pontiki>
yes. oh, dear...
<pontiki>
oh
<volty>
lispers more than lisp , ahah
<pontiki>
then i'll just leave you to it
<volty>
the banisterfiend's quoted above is a kind of a verse - no joke
headius has quit [Quit: headius]
locriani has quit [Remote host closed the connection]
andredublin has joined #ruby
<volty>
04:07 in Venice, i go now so I can catch some sunlight tomorrow
<volty>
bye
volty has quit [Quit: Konversation terminated!]
pen has quit [Ping timeout: 260 seconds]
<banisterfiend>
Venice, cool
nwertman has quit [Remote host closed the connection]
digital-ghost has quit [Remote host closed the connection]
hashpuppy has joined #ruby
<xybre>
Woops, wrong channel!
<hashpuppy>
is there a way to get the min of two functions, but return the values passed to those functions instead? for example. if a.abs < b.abs; a; else b; end
<hashpuppy>
would be nice if there was a minf(a,b){|x| x.abs}
<hashpuppy>
if that's even valid
pothibo has quit [Quit: pothibo]
<xybre>
So write a method that does that?
shvelo has quit [Quit: Leaving]
<hashpuppy>
nothing like that already exists. maybe something that composes those functions?
<|jemc|>
what is the most elegant way to pull out that Hash from the array (not knowing if it is there or not)? I'm hoping for something more elegant than:
<|jemc|>
somewhat frustratingly, eval can't create a local var where there was none. so, as far as I can tell there is no way to 'dynamically' set the name of a new local, with eval or otherwise. it must be a global, ivar, or cvar
burlyscudd has joined #ruby
okinomo has joined #ruby
okinomo_ has joined #ruby
lukec has quit [Quit: lukec]
shtirlic has quit [Ping timeout: 264 seconds]
adkron has quit [Ping timeout: 276 seconds]
okinomo has quit [Client Quit]
okinomo_ has quit [Client Quit]
65MAAYNKC has joined #ruby
64MAAKHRU has joined #ruby
okinomo_ has joined #ruby
okinomo has joined #ruby
okinomo_ has quit [Client Quit]
okinomo has quit [Client Quit]
64MAAKHRU has quit [Client Quit]
shtirlic has joined #ruby
<apeiros>
|jemc|: how'd creating a new local make sense at all?
burlyscudd has quit [Ping timeout: 264 seconds]
<apeiros>
|jemc|: if you keep eval'ing in the same binding, you can use a new variable. if you don't eval new code, I don't see how creating a new local makes any sense.
mbreedlove has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
<|jemc|>
it's not like there are any great practical uses I can conceive of at the moment
<apeiros>
|jemc|: if you have static code after, then all variables are defined. nothing dynamical there.
<|jemc|>
it's just a little counterintuitive that it can't be done until you realize the eval happens in a small nested scope instead of the calling scope
<|jemc|>
at which point it follows the rules of a small nested scope
DanKnox is now known as DanKnox_away
<apeiros>
no, it's only counter-intuitive if you think about local variables naivly as something like a hash. they are not.
kizzx2 has quit [Quit: Leaving.]
<|jemc|>
meh. sure
ksh has joined #ruby
<|jemc|>
this is not really a big sticking point for me, and certainly not worth arguing about whether or not something is "intuitive"
<apeiros>
and I mean naive in the "programmers meaning" (like "naive solution to problem X")
brain_shim has quit [Ping timeout: 264 seconds]
<|jemc|>
yeah, no offense taken
mrnugget has joined #ruby
mansi has joined #ruby
ericwood has quit [Ping timeout: 246 seconds]
ericwood has joined #ruby
iliketur_ has joined #ruby
<V8Energy>
i am trying to run ocra to package my script, when i do it, it runs my script, then i call one of the methods in my script that has exit! which exits the application but it seems like ocra exits too...
thesheff17 has quit [Remote host closed the connection]
cody-- has quit [Quit: Computer has gone to sleep.]
dik_dak has joined #ruby
kizzx2 has joined #ruby
tagrudev has joined #ruby
Splourian has joined #ruby
adkron has joined #ruby
tobago has quit [Changing host]
tobago has joined #ruby
mansi has quit [Ping timeout: 264 seconds]
`MArceLL` has quit [Ping timeout: 246 seconds]
headius has quit [Quit: headius]
mbreedlove has quit [Ping timeout: 240 seconds]
mbreedlove_ has joined #ruby
Splourian has quit [Client Quit]
<pontiki>
it was someone else's question anyway, originally
eldariof has joined #ruby
n_blownapart has joined #ruby
mootpointer has quit [Quit: ENOCAFFEINE.]
mbreedlove_ has quit [Remote host closed the connection]
mootpointer has joined #ruby
tylersmith has quit [Remote host closed the connection]
InFlames has quit [Remote host closed the connection]
mbreedlove has joined #ruby
tylersmith has joined #ruby
mrsolo has joined #ruby
tylersmith has quit [Read error: Connection reset by peer]
mbreedlove has quit [Remote host closed the connection]
tylersmith has joined #ruby
ryandeussing has quit [Remote host closed the connection]
mbreedlove has joined #ruby
adkron_ has joined #ruby
adkron has quit [Ping timeout: 264 seconds]
goleldar has quit [Read error: Operation timed out]
nanothief has joined #ruby
mbreedlove_ has joined #ruby
mbreedlove_ has quit [Client Quit]
Alina-malina has joined #ruby
tylersmith has quit [Ping timeout: 268 seconds]
BillCriswell has quit [Remote host closed the connection]
girija has quit [Read error: Connection reset by peer]
girija has joined #ruby
b00stfr3ak has quit [Ping timeout: 264 seconds]
mbreedlove has quit [Ping timeout: 264 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
randomau_ has quit [Read error: Connection reset by peer]
optimusprimem has quit [Quit: Saindo]
randomautomator has joined #ruby
girija has quit [Read error: Connection reset by peer]
girija has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mbreedlove has joined #ruby
girija has quit [Read error: Connection reset by peer]
Lewix has joined #ruby
girija has joined #ruby
randomautomator has quit [Ping timeout: 245 seconds]
jbpros has joined #ruby
jonahR has joined #ruby
goleldar has joined #ruby
ahill-89 has quit [Quit: leaving]
girija has quit [Read error: Connection reset by peer]
girija has joined #ruby
kvirani has quit [Read error: Connection reset by peer]
<apeiros>
avril14th: the bot is for demonstration purposes only. use irb/pry of your local ruby installation for experiments.
yosafbridge has quit [Ping timeout: 245 seconds]
mephux has quit [Ping timeout: 260 seconds]
LBRapid has joined #ruby
<avril14th>
apeiros: just explaining something to a mate here
<avril14th>
on how remote code execution works
<avril14th>
sry
banister`gym has quit [Quit: Computer has gone to sleep.]
Guest6130 has joined #ruby
starfox21 has quit [Ping timeout: 268 seconds]
SirFunk has joined #ruby
Dreamer3 has joined #ruby
Bry8Star{T2 has joined #ruby
yosafbridge has joined #ruby
starfox21 has joined #ruby
apfelbox has quit [Read error: Connection reset by peer]
s0ny123 has quit [Quit: Lost terminal]
apfelbox has joined #ruby
mansi has joined #ruby
closer has joined #ruby
s0ny123 has joined #ruby
kvirani_ has joined #ruby
kvirani has quit [Read error: Connection reset by peer]
aryaching has quit [Ping timeout: 245 seconds]
s0ny123 has quit [Client Quit]
s0ny123 has joined #ruby
adambeynon has joined #ruby
|jemc| has quit [Ping timeout: 245 seconds]
Al__ has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
Criztian has joined #ruby
dhruvasagar has joined #ruby
mansi has quit [Ping timeout: 268 seconds]
ananthakumaran has joined #ruby
flughafen has joined #ruby
nari has quit [Ping timeout: 264 seconds]
clocKwize has quit [Quit: clocKwize]
crunch-choco has joined #ruby
platzhirsch has joined #ruby
hukl has quit [Quit: Leaving...]
<platzhirsch>
how would you name a variable which used on sleep(time) and which is set higher with every failed operation, so the time until the next try is increased?
<platzhirsch>
I had to think of diminishing returns
gstamp has quit [*.net *.split]
closer009 has quit [*.net *.split]
karupanerura has quit [*.net *.split]
cibs has quit [*.net *.split]
<sevenseacat>
timeout or something?
apfelbox has quit [Ping timeout: 246 seconds]
Ripp__ has quit [Quit: Ripp__]
<platzhirsch>
Oh, timeout is just fine. Haven't thought on that one, thanks ;)
zoee has joined #ruby
<Lewix>
do we have a text editor for scope highlight
wudofyr has quit [Ping timeout: 245 seconds]
<workmad3>
platzhirsch: exponential backoff
<workmad3>
platzhirsch: or at least, backoff time ;) the exponential is really if you do something like multiply by 2 each time
<platzhirsch>
workmad3: in fact it's linear backoff
<platzhirsch>
workmad3: I do that, isn't that linear?
<platzhirsch>
ah, of course
<workmad3>
platzhirsch: what? doubling the time on each failed attempt?
<flughafen>
morning everybody
<workmad3>
platzhirsch: grows exponentially ;)
<platzhirsch>
workmad3: yes, you are right. I confused time * 2 * 2 * 2 ... * 2 with time^2^2...^2
niceguyjames has joined #ruby
<platzhirsch>
mh
<platzhirsch>
ok I got that wrong, toom but I see the difference now
karupanerura has joined #ruby
cibs has joined #ruby
gstamp has joined #ruby
gstamp has quit [Quit: Computer has gone to sleep.]
yacks has joined #ruby
io_syl has quit []
troessner has joined #ruby
gstamp has joined #ruby
wudofyr has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apfelbox has joined #ruby
gyre007 has joined #ruby
Macaveli has quit [Quit: Computer has gone to sleep.]
Macaveli has joined #ruby
gyre007 has quit [Remote host closed the connection]
relix has joined #ruby
MrZYX|off is now known as MrZYX
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
Kneferilis has quit [Quit: Leaving]
Kneferilis has joined #ruby
burlyscudd has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
jlebrech has quit [Ping timeout: 245 seconds]
hukl has joined #ruby
gyre007 has joined #ruby
burlyscudd has quit [Ping timeout: 246 seconds]
okinomo has joined #ruby
Desert_eagle has quit [Ping timeout: 256 seconds]
gyre008 has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
girija has quit [Read error: Connection reset by peer]
axeman- has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
girija has joined #ruby
hukl has quit [Quit: Leaving...]
zarubin has joined #ruby
dhruvasagar has joined #ruby
mikecmpbll has joined #ruby
<colonolGron>
i am currently reading "Essential Skill for the Agile Developer" and came across "acceptance test driven development". can someone tell me what acceptance tests are? i understood it like this: a person (user) tests if the application behaves like intended. its not like a unit test where you have to write code to test. right?
jlebrech has joined #ruby
<platzhirsch>
colonolGron: You are right, acceptance tests can also be performed in an analog way
<platzhirsch>
or I only know them in an analog way
<platzhirsch>
because you need to validate, whether you software fulfills the needs for the end user
seich- has quit [Ping timeout: 240 seconds]
gyre007 has quit [Ping timeout: 268 seconds]
senayar has joined #ruby
ananthakumaran has joined #ruby
<platzhirsch>
colonolGron: something like the step before you pass the implemented software to the user to make use of it
neku has joined #ruby
<colonolGron>
i see
<platzhirsch>
This is extremely helpful if the user and the customer are different groups
senayar has quit [Remote host closed the connection]
<colonolGron>
interesting
<platzhirsch>
basically the user/customer could decide for himself/herself what the test scenarios are
senayar has joined #ruby
hipertracker has joined #ruby
hipertracker has left #ruby [#ruby]
<colonolGron>
thank you platzhirsch
druonysus has quit [Ping timeout: 246 seconds]
dagobah has joined #ruby
platzhirsch has left #ruby [#ruby]
seich- has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
maasdesigner1 has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
maasdesigner has quit [Disconnected by services]
maasdesigner1 is now known as maasdesigner
kayloos has quit [Remote host closed the connection]
mercwithamouth has quit [Quit: leaving]
ananthakumaran has joined #ruby
Astralum has joined #ruby
Nss has joined #ruby
starfox21 has quit [Quit: starfox21]
dhruvasagar has quit [Read error: Connection reset by peer]
snovak has joined #ruby
jonahR has quit [Quit: jonahR]
dhruvasagar has joined #ruby
ryandeussing has joined #ruby
hukl has joined #ruby
jibi has joined #ruby
ewnd9 has joined #ruby
srji has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
julweber_ has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
tesuji has quit [Read error: Connection reset by peer]
<krz>
is there a better way to remove elements from one array and the other? [1,2,3,4] - [1,2] will work
shanlar- has joined #ruby
cyborg has joined #ruby
ij has joined #ruby
alup has joined #ruby
<ij>
Is there a way to use Net::HTTP in a way that I can change method(get/post) without changing calls? It seems that you can't set_form_data on a get, but only on post.
shanlar has quit [Ping timeout: 264 seconds]
atmosx has joined #ruby
<cyborg>
I am unable to load the test environment manually for testing my application. I use [ RAILS_ENV=test rake db:create] to go to test environment but it gives me error
<apeiros>
ij: um, set_form_data makes no sense on get
<apeiros>
since a get request does not have a request body, only the headers.
<ij>
It has the query.
<apeiros>
cyborg: #rubyonrails
<ij>
It still send a hash-like data.
<cyborg>
apeiros: yes
<apeiros>
cyborg: this is the channel #ruby, you should ask in #rubyonrails
<cyborg>
ok
blaxter_ has joined #ruby
apfelbox has quit [Remote host closed the connection]
cyborg has quit [Client Quit]
apfelbox has joined #ruby
enroxorz has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
ArchBeOS has quit [Read error: Connection reset by peer]
<Xeago>
apeiros: a body on a GET request makes sense for some usecases, and is not disallowed by the standard but only discouraged
<Xeago>
I shy away from any libraries that do not allow me to stuff a body on a GET
tesuji has joined #ruby
mansi has joined #ruby
browndawg has joined #ruby
<ij>
apeiros, But still, why differeniate methods if there's only one way to send data in each case?
niceguyjames has quit [Quit: Computer has gone to sleep.]
apfelbox has quit [Ping timeout: 260 seconds]
buibex has quit [Remote host closed the connection]
gyre008 has quit [Remote host closed the connection]
mansi has quit [Ping timeout: 264 seconds]
gyre007 has joined #ruby
Speed has joined #ruby
timonv has quit [Remote host closed the connection]
Nilium has joined #ruby
<workmad3>
ij: because it's perfectly valid to set the query string on both a GET and a POST
dhruvasagar has quit [Read error: Connection reset by peer]
shaunbaker has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
user258467 has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
jibi has quit [Ping timeout: 246 seconds]
user258467 has joined #ruby
Hanmac has quit [Quit: Leaving.]
sayan has joined #ruby
buibex has joined #ruby
tatsuya_o has joined #ruby
havenwood has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
Lewix has quit [Remote host closed the connection]
Macaveli has quit [Quit: Computer has gone to sleep.]
ananthakumaran has quit [Read error: Connection reset by peer]
<obs>
ij, you can send the data on the url or for example through ajax with a json format, you can differenciate a post,put and delete method for parse the request_body to json with only .to_json and ignote get request
<obs>
ignore*
soba has quit [Ping timeout: 245 seconds]
sr78ger has joined #ruby
ananthakumaran has joined #ruby
platzhirsch has joined #ruby
Stygia has quit [Ping timeout: 256 seconds]
<platzhirsch>
Do you have a special way of adding logging messages to your code? I am still a bit shy where do put logging statements
<platzhirsch>
feels like I am messing up with the logical blocks by splitting them through the logging messages
<ij>
Give an example.
Es0teric has joined #ruby
timonv has joined #ruby
burlyscudd has quit [Ping timeout: 256 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
<ij>
Actually, feel free to make as many as you like and then look where you've went wrong.
<ij>
platzhirsch, yes, like that
<platzhirsch>
this log message is actually more a logger.debug. For now I just want to use the logging to report process of the running tasks
<platzhirsch>
so I see that something is actually happening if they run for a bit
<ij>
You should write tests.
ananthakumaran has quit [Read error: Connection reset by peer]
Hanmac has joined #ruby
<atmosx>
platzhirsch: cucumber teests ;-)
<platzhirsch>
that in any case...
<ij>
I am strongly opposed to cucumber tests, they aren't as maintainable as rspec+capybara or test::unit.
<platzhirsch>
ij: how come? I have worked with rspec, capybare so far
ananthakumaran has joined #ruby
<ij>
platzhirsch, Hm?
<platzhirsch>
Where does the lack of maintabability come from in cucumber?
<ij>
The good idea is that business people will be able to write tests, but that never happens. So what you're left with is calling your test code with regex, not readable function calls in ruby.
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
<platzhirsch>
I thought it's a nice way to document your use cases that then again generate a test structure
himsin has joined #ruby
Macaveli has quit [Quit: Computer has gone to sleep.]
<Hanmac>
some day all my gems will be documented with tests … it will happen shortly after the USA accepts the humanright court in DenHag
<shevy>
hehe
wudofyr has quit [Ping timeout: 264 seconds]
<platzhirsch>
:\
okinomo has quit [Quit: leaving]
okinomo has joined #ruby
rcosta has joined #ruby
okinomo has quit [Client Quit]
julweber_ has quit [Remote host closed the connection]
kayloos has joined #ruby
wudofyr has joined #ruby
senayar has quit [Remote host closed the connection]
snovak has joined #ruby
okinomo has joined #ruby
hukl has quit [Quit: Leaving...]
Kelet has joined #ruby
senayar has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Connection reset by peer]
<jxport>
Really vague Q I'll put out there to some Rubyists here. Starting to seriously learn Ruby & Rails. Seems like it's opened up a whole world of possible auxillary techs/languages etc. that I could be learning - a mile away from my crusty old Perl beginnings
chairabanta has joined #ruby
lkba has joined #ruby
<Hanmac>
platzhirsch: hm i didnt know it yet, but from looking, mines it better ;P
blackmesa has joined #ruby
<workmad3>
jxport: and your question is?
<platzhirsch>
hanmac: that was my impression as well ;)
<jxport>
Any particular recommendations on where I should place some focus/research in this sphere of things? I'm looking to modernize myself as a developer and be as "cutting-edge" as possible
dhruvasagar has quit [Read error: Connection reset by peer]
<workmad3>
jxport: kinda depends on where you want to position yourself
<jxport>
workmad3: just pooling for guidance, if any exists, from those that have trodden the path
<platzhirsch>
sounds epic
cads has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby
camilasan has quit [Remote host closed the connection]
<jxport>
workmad3: I've been programming for years since childhood, but I'm only a few months into industry. I'm not really sure what positions (as such) are possible. I'm highly motivated and don't want to run out of direction!
<workmad3>
jxport: are you more interested in going front-end html,css,js,json APIs, etc? or back-end databases, searches, services, api design, etc? or get familiar with the whole thing and be a full-stack dev? devops stuff?
starfox21 has joined #ruby
<jxport>
workmad3: back-end without a doubt
chairabanta has quit [Client Quit]
camilasan has joined #ruby
shaunbaker has quit [Remote host closed the connection]
<workmad3>
jxport: I'd have said the same pretty soon after I started learning web-dev stuff... I quite enjoy being able to handle full-stack though :)
<atmosx>
when I grow I'm gonna be full-stack
<jxport>
workmad3: how that will (or could) narrow down exactly, I don't know. Devops interested me as it's quite people oriented, but I hate dealing with stuff that goes down / isn't working - so with that in mind, I might want to steer clear(ish) of ops
Senjai has quit [Ping timeout: 264 seconds]
<jxport>
workmad3: I'm actually going to be working on a personal project soon (I think having something in my portfolio would be beneficial) - that'll be full-stack
<platzhirsch>
jxport: I really don't see a concrete direction here. What hinders you from starting? Get yourself a project, start learning?
<workmad3>
jxport: I'd suggest you spend a bit of time and get a rough overview of everything :)
<atmosx>
json API is front-end?
<atmosx>
I thought was backend
<workmad3>
atmosx: sorry, interfacing with json apis
<Hanmac>
the backend is the frontend in bizzaroworld ;P
<jxport>
platzhirsch: there isn't a concrete direction, it's more inspiration I'm looking for
<workmad3>
atmosx: designing them is back-end, talking to them, potentially writing client libraries, etc. I'd class as front-end :)
<atmosx>
workmad3: okay, this time you're excused. :-P
Rollabunna has joined #ruby
<atmosx>
I like buzzwords
<platzhirsch>
jxport: so you are looking for project ideas?
<workmad3>
jxport: I tend to just read around in a lot of different areas
<jxport>
platzhirsch: I have one particular project idea which I think is really quite good - to demonstrate business acumen and also handle the full-stack
mansi has joined #ruby
<jxport>
After that, I guess I'll be looking for what to learn next, once I've demonstrated myself with that (for now)
unixninja92 has quit [Quit: unixninja92]
<atmosx>
as always I receive some job offers every known and then and their description is ubiquitus: Jobs Requires "Excellent RoR skills, Excellent SQL and NoSQL and HTML5 and CSS3 and at least 15 JS frameworks and Bootstrap and …. (mention anything you've heard the last 3 months here)" and I always ask myself if they really mean *excellent* or just *can you get your hands dirty with this shit?*
<workmad3>
atmosx: I always demand at least 10 years experience from my rails hires!
<jxport>
workmad3: I've just finished reading books on mysql, mongo, linux kernel, message queues, ruby, (about to read the rails way)
srji has quit [Quit: leaving]
<atmosx>
workmad3: I'll never work for you.
<jxport>
workmad3: so at the moment, I'm diving head first into heavy literature (and tearing through it) into very particular topics
Macaveli has joined #ruby
* atmosx
just sad
Xeago has quit [Remote host closed the connection]
nari has joined #ruby
platzhirsch1 has joined #ruby
<workmad3>
atmosx: in another couple of years, that'll become 15 ;)
<jxport>
Once I feel I've got all the technical bases covered; I think I might feel a bit lost!
<platzhirsch1>
darn you disconnect, darn you
<atmosx>
workmad3: see?
<platzhirsch1>
platzhirsch: imposter!
blackmesa has quit [Ping timeout: 240 seconds]
<platzhirsch1>
jxport: I think the most important part is motivation, if you have a project that you care more, it might help more than trying to set 'master the technology' as goal
mroth has quit [Ping timeout: 240 seconds]
platzhirsch has quit [Ping timeout: 245 seconds]
<platzhirsch1>
care about*
shaunbaker has joined #ruby
platzhirsch1 is now known as platzhirsch
<platzhirsch>
roar
<workmad3>
jxport: tbh, I'm pretty sure that new technical knowledge is created faster than even the most dedicated person can consume it, so I doubt you'll ever really have all the technical bases 'covered' if you're too much of a perfectionist ;)
kizzx2 has quit [Quit: Leaving.]
<platzhirsch>
What exactly is the use case for require_relative? I got confused after refactoring my Ruby structure to a typical Gem structure
mansi has quit [Ping timeout: 240 seconds]
browndawg has joined #ruby
rdark has joined #ruby
<workmad3>
jxport: but yeah, reading an eclectic mix of technical books is fun... try to get some in there about system design and the like too, get your hands on some of the classics like the Pragmatic Programmer, Clean Code, Refactoring, etc.
<atmosx>
platzhirsch: load files (modules?) in the local dir
<atmosx>
s/in/from
<workmad3>
platzhirsch: there isn't one, IMO
<jxport>
workmad3: oh I completely understand that. But I feel that with a firm grip on OSes/kernels, architectural patterns, messaging, particular programming languages, MySQL and NoSQL - I'll have a lot of the dry concrete stuff down
arca0 has joined #ruby
<workmad3>
platzhirsch: unless you count 'impose a rather strict relative positional coupling in the file system between this file and my target'
<jxport>
workmad3: heh, actually, I plan on reading that sort of stuff next. I sort of see that as the "soft" stuff that I'll be able to treat myself to once I've got all of the heavy tech stuff to actually work with down
<platzhirsch>
If I run my gem through ruby -Ilib bin/mdh then I can require all classes/modules with require, which seems confusing because of possible name clashes with other gemss
<atmosx>
platzhirsch: name clashing in ruby is handle by using modules
<workmad3>
jxport: I tend to advocate a somewhat more mixed approach nowadays... all of that 'soft' stuff as you put it helps to put the other stuff into context ;)
<platzhirsch>
atmosx: oh you are right, I didn't move that one class into my module
<atmosx>
platzhirsch: usually when you use require_relative, youre not referring to other gems but files that sit locally somewhere in your system.
<jxport>
workmad3: completely agreed - not denigrating it at all - it just made sense to have solid stuff to put into context, before.. getting context :)
ananthakumaran has quit [Read error: Connection reset by peer]
<workmad3>
jxport: and getting that side of things straight in your head can make it easier to pick up the more concrete technical stuff and also, more importantly, when it's beneficial to do a deep-dive into something pretty technical :)
<platzhirsch>
atmosx: yes, I am just trying to find out, whether I need it or not :P
insulator has joined #ruby
<workmad3>
jxport: so I tend to mix them together nowadays ;) not all of one before all of another
okinomo has quit [Ping timeout: 240 seconds]
<jxport>
workmad3: yeah eventually I'll be looking to do that. This is a funny period for me at the moment, because it's really the inception of my career
<atmosx>
workmad3: you work as a freelancer, consultant or what?
<workmad3>
atmosx: err... all of the above?
ananthakumaran has joined #ruby
okinomo has joined #ruby
Criztian has quit [Remote host closed the connection]
starfox21_ has joined #ruby
<workmad3>
atmosx: you didn't expect a simple answer to that, did you? :)
brianpWins has quit [Quit: brianpWins]
<atmosx>
workmad3: you should change the design http://www.workmad3.com looks like an avg octopress installation heh
starfox21 has quit [Ping timeout: 240 seconds]
TomRone has quit [Ping timeout: 240 seconds]
<workmad3>
atmosx: that's because it is
starfox21_ is now known as starfox21
<platzhirsch>
My worker (module MetadataHarvester) makes use of MetadataHarvester::JsonArchiver, resides in another file. If I use require 'json_archiver' it's not found, but if I use require_relative 'json_archiver'. I am just not sure if that's the proper way ;)
<workmad3>
atmosx: I do need to sort it out :)
<atmosx>
workmad3: yeah, I was expecting something more elaborate yearh :-P
camilasa_ has joined #ruby
<workmad3>
atmosx: I also need to, at some point, get my ass in gear and start posting stuff to it :)
ewnd9 has quit [Ping timeout: 245 seconds]
<atmosx>
workmad3: sure you do, I'll put that on feed
<jxport>
workmad3: thanks for the insight - it's great getting a bit of feedback from people who know
<workmad3>
I think the last batch of posts were half-assed, vaguely philosophical thoughts I got while reading 'Zen and the art of motorcycle maintenance' :)
TomRone has joined #ruby
<jxport>
ps. before I return to work - are there any particular resources that are worth keeping up to date with? Not sure if there are any particular websites/magazines that I should really be paying attention to
<shevy>
alright let's get naked
cantonic has joined #ruby
<shevy>
jxport only #ruby here :P
camilasa_ has quit [Remote host closed the connection]
<jxport>
Wouldn't want to think I'm isolated from industry, heh.
<shevy>
though perhaps there are some rails-sites, I dunno
camilasa_ has joined #ruby
zarubin has quit [Ping timeout: 264 seconds]
browndawg has quit [Read error: No route to host]
cads has joined #ruby
camilasan has quit [Ping timeout: 264 seconds]
browndawg has joined #ruby
seyha has joined #ruby
seyha has quit [Client Quit]
senayar has quit [Remote host closed the connection]
<joonty>
hey all
<joonty>
i've run into a weird thing with each_with_object, and concatenating to an array
<atmosx>
jxport: just news.ycombinator.com for general industry news, susbcribe here if you want weekly news related on ruby http://rubyweekly.com/archive/160.html … that;s all there is to it.
<joonty>
doing `array += another_array` doesn't seem to work within an each_with_object block
<Xeago>
that way you don't have to do any magic regarding indices and what not
Domon has quit [Remote host closed the connection]
<Xeago>
and you are just sorting, aren't you?
<Xeago>
why don't you just sort..?
love_color_text has joined #ruby
nhhagen has quit [Ping timeout: 264 seconds]
Domon has joined #ruby
allsystemsarego has quit [Client Quit]
end_guy has quit [Ping timeout: 240 seconds]
<krz>
a=[1,2,3]; b=[1,2]; a-b || b-a
<krz>
thats the cleanest ive gotten up to so far
<krz>
there should seriously be a diff method for Array though
platzhirsch has left #ruby [#ruby]
<Xeago>
than define it?
<apeiros>
I assume you mean a-b | b-a ?
mmozuras has quit [Quit: leaving]
love_color_text has quit [Read error: Connection reset by peer]
<apeiros>
since || will just return the first expression…
julweber has quit [Remote host closed the connection]
<Xeago>
syltman: sort takes a block: ltrSort.sort_by {|e| e[1] }
<krz>
apeiros: thanks
mmozuras has joined #ruby
intuxicated has joined #ruby
havenwood has joined #ruby
mroth has joined #ruby
Domon has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Read error: Connection reset by peer]
<syltman>
Xeago ok gonna use that thanks
dhruvasagar has joined #ruby
antulik is now known as antulik-afk
apfelbox has joined #ruby
KobraKao has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 246 seconds]
Hanmac has quit [Quit: Leaving.]
shaunbaker has quit [Remote host closed the connection]
visof has joined #ruby
julweber has joined #ruby
ehaliewicz has quit [Ping timeout: 240 seconds]
Skylab has joined #ruby
KobraKao has quit [Ping timeout: 256 seconds]
maasdesigner has quit [Ping timeout: 256 seconds]
intuxicated has quit [Read error: No route to host]
KobraKao has joined #ruby
mrnugget has quit [Quit: mrnugget]
intuxicated has joined #ruby
Hanmac has joined #ruby
b0oh has joined #ruby
orionstein_away is now known as orionstein
SHyx0rmZ has joined #ruby
mlpinit has joined #ruby
mlpinit has quit [Remote host closed the connection]
mlpinit has joined #ruby
vince_pr_ has joined #ruby
eka has joined #ruby
mansi has joined #ruby
hamakn has quit [Remote host closed the connection]
vince_prignano has joined #ruby
end_guy has joined #ruby
vince_pr_ has quit [Remote host closed the connection]
tobago has quit [Ping timeout: 264 seconds]
ndrei has quit [Ping timeout: 240 seconds]
love_color_text has joined #ruby
zarubin has joined #ruby
vince_prignano has quit [Remote host closed the connection]
mansi has quit [Ping timeout: 256 seconds]
ldnunes has joined #ruby
alekst has joined #ruby
tobago has joined #ruby
Tomasso has joined #ruby
neku has joined #ruby
kofno has joined #ruby
havenwood has joined #ruby
blaxter_ is now known as blaxter
zarubin has quit [Ping timeout: 246 seconds]
b0oh has left #ruby [#ruby]
hamakn has joined #ruby
ndrei has joined #ruby
apfelbox has quit [Read error: Connection reset by peer]
apfelbox has joined #ruby
persand has quit [Quit: persand]
<Kneferilis>
hello, is ruby one of the most metaprogrammable languages?
julweber_ has joined #ruby
<Xeago>
Kneferilis: doubt it is, metapogramming is easy to do, but there are specific languages for this purpose
<ij>
Not more meta-programmable than lisp.
<ij>
Kneferilis, Can't get code as data as easily.
KobraKao has quit [Read error: Connection timed out]
persand has joined #ruby
<Kneferilis>
Xeago, what specific languages for metaprogramming? My google search revealed languages like listp, ruby
julweber has quit [Ping timeout: 264 seconds]
Macaveli_ has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
KevinSjoberg has quit [Remote host closed the connection]
<Kneferilis>
also, how functional is ruby? Can you compare it to other languages with that in mind?
vlad_starkov has joined #ruby
<intuxicated>
you can always compare things
mmitchell has joined #ruby
<Hanmac>
Kneferilis … everything in ruby is object oriented, but you can make it look like functional … even if its not ;P
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
<Kneferilis>
I see.
<ij>
It can look pretty functional.
<Kneferilis>
is ruby functional as javascript?
rcosta has quit [Remote host closed the connection]
<ij>
What does that mean?
apfelbox has quit [Ping timeout: 240 seconds]
Macaveli has quit [Ping timeout: 260 seconds]
<Kneferilis>
well, javacript is pretty functional, php not much, clojure is totally functional, where ruby stands?
<ij>
What do you count as functionality?
<Kneferilis>
ij, I mean functional programming.
intuxicated has quit [Read error: No route to host]
intuxicated has joined #ruby
havenwood has quit [Remote host closed the connection]
<ij>
Well.. What do you count as functional programming. Imagine I'm nine years old.
havenwood has joined #ruby
mmitchell has quit [Remote host closed the connection]
<Kneferilis>
ij, that's a tough question, given that I am still learning functional programming
<ij>
Well that's why I'm asking.
<ij>
FP usually has function-oriented approach to everything, immutable data.
<ij>
Does not have that.
<ij>
Objects dominate here.
aagdbl has joined #ruby
<ij>
Of course, you can do stuff in a fp manner, but it's not something inherent in the lang, IMO. Surely, more knowledgable people will correct me.
seich- has quit [Ping timeout: 240 seconds]
verto has joined #ruby
<xybre>
ij: lambda calculus mostly
<ij>
Well that too, but wiki doesn't list that as a goal.
* ij
shrugs.
<xybre>
Difficult to explain that to a 9 year old without a whiteboard
<ij>
I know lambda calculus basics.
<Hanmac>
Kneferilis: in ruby, even this "functional" stuff are objects
havenwood has quit [Ping timeout: 268 seconds]
akesterson has joined #ruby
<xybre>
Ruby is uber-OO, but it has a pretty pwoerful functional aspect as well.
<ij>
Unrelated: aren't objects sort of like little programs in their own space and with an API?
<xybre>
It has first class anonymous functions (that are also objects, not like JS objects, but like full objects).
<akesterson>
https://gist.github.com/akesterson/6449176 <-- I want to store a reference to a string in a list, so that when the string is updated later, the list will still contain the string I expect it to contain. But it seems that 'x="lolzors"' causes x to change its reference to that of a new string object, instead of modifying the content of the previous string object, to which y[0] also points
<akesterson>
or am I just missing the plot?
<Hanmac>
Kneferilis: in ruby even the classes are full objects … and even the singleton classes of objects are objects too ;P
Macaveli_ has quit [Remote host closed the connection]
<Kneferilis>
hanmac, sounds interesting
<Hanmac>
akesterson: you are looking for String#replace
<ij>
Objects, objects everywhere.
Macaveli has joined #ruby
<akesterson>
hanmac : Yep that got it. Thanks much
seich- has joined #ruby
YaNakilon has quit [Ping timeout: 256 seconds]
hukl has joined #ruby
hukl has quit [Changing host]
hukl has joined #ruby
shaunbak_ has joined #ruby
pcfreak30 has quit [Ping timeout: 250 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Read error: Connection reset by peer]
buzzybron has quit [Quit: Leaving.]
dhruvasagar has joined #ruby
ananthakumaran has joined #ruby
Kneferilis has quit [Quit: Leaving]
Kneferilis has joined #ruby
buibex has joined #ruby
kvirani_ has quit [Remote host closed the connection]
kvirani has joined #ruby
Astral_ has joined #ruby
kvirani has quit [Read error: Connection reset by peer]
kvirani_ has joined #ruby
akesterson has left #ruby [#ruby]
YaNakilon has joined #ruby
krz has quit [Quit: krz]
Astralum has quit [Ping timeout: 245 seconds]
niceguyjames has joined #ruby
failshell has joined #ruby
Astral_ has quit [Read error: Connection reset by peer]
Astral_ has joined #ruby
v0n has joined #ruby
v0n has quit [Client Quit]
v0n has joined #ruby
kayloos has quit [Remote host closed the connection]
buibex has quit [Ping timeout: 245 seconds]
cantonic has quit [Quit: cantonic]
browndawg has quit [Ping timeout: 264 seconds]
pothibo has joined #ruby
yfeldblum has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
TIJ has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
sailias has joined #ruby
breakingthings has joined #ruby
ananthakumaran has joined #ruby
buibex has joined #ruby
kayloos has joined #ruby
JDHankle has quit [Remote host closed the connection]
IceDragon has joined #ruby
ndrei has quit [Quit: Lost terminal]
browndawg has joined #ruby
enroxorz has quit [Quit: Leaving]
TIJ has quit [Read error: Connection reset by peer]
Neomex has joined #ruby
insulator has quit [Ping timeout: 240 seconds]
snovak has joined #ruby
himsin has quit [Quit: himsin]
kvirani_ has quit [Remote host closed the connection]
kvirani has joined #ruby
mark_locklear has joined #ruby
LocutusOfBorg has joined #ruby
burlyscudd has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
kvirani has quit [Ping timeout: 276 seconds]
julweber_ has quit [Remote host closed the connection]
LocutusOfBorg has quit [Client Quit]
tesuji has quit [Read error: Connection reset by peer]
kayloos has quit [Remote host closed the connection]
rcosta has joined #ruby
love_color_text has quit [Remote host closed the connection]
intuxicated has quit [Ping timeout: 264 seconds]
ryandeussing has quit [Remote host closed the connection]
niceguyjames has quit [Quit: Computer has gone to sleep.]
hukl has quit [Quit: Leaving...]
spider-mario has joined #ruby
love_color_text has joined #ruby
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
niceguyjames has joined #ruby
geekbri has joined #ruby
kaldrenon has joined #ruby
varfoo has quit [Quit: WeeChat 0.4.0]
unixninja92 has joined #ruby
kvirani has joined #ruby
sailias has quit [Ping timeout: 268 seconds]
julweber has joined #ruby
tesuji has joined #ruby
hukl has joined #ruby
mansi has joined #ruby
burlyscudd has quit [Quit: Leaving.]
aagdbl has quit [Quit: Leaving.]
unixninja92 has quit [Ping timeout: 268 seconds]
ashp has left #ruby [#ruby]
ryandeussing has joined #ruby
burlyscudd has joined #ruby
mansi has quit [Ping timeout: 240 seconds]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
love_color_text has quit [Remote host closed the connection]
tvw has joined #ruby
banisterfiend has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
pygospa has quit [Disconnected by services]
browndawg has quit [Quit: Leaving.]
pygospa has joined #ruby
kvirani has quit [Remote host closed the connection]
<dawkirst>
Hi guys, trying to understand something fundamental: is it better to keep everything in one line by stringing together methods, or better to break it up into variables with names that make semantically more sense and call methods on the variables?
pranny has quit [Quit: Leaving.]
<Kelet>
dawkirst, When in doubt, I'd go with the second one, but as usual it depends.
fmcgeough has joined #ruby
adkron_ has joined #ruby
<dawkirst>
Kelet, ok, thanks. It does feel that the second one reads better sometimes.
<clocKwize>
dawkirst: I'd agree with Kelet, maybe if the one line reads good, then there is no need?
nhhagen has joined #ruby
JDHankle has joined #ruby
jerius has joined #ruby
ehc has quit [Quit: ehc]
<clocKwize>
like rspec stubs, @blah.stub(:x).twice.and_return @y
thillux has joined #ruby
<clocKwize>
reads nice
havenwood has joined #ruby
buibex has quit [Remote host closed the connection]
<wuest>
It depends on a lot of factors. If you might raise an exception somewhere in the chain, for example, it's bad practice.
mrnugget has joined #ruby
mikecmpbll has joined #ruby
orionstein is now known as orionstein_away
maroloccio has quit [Quit: WeeChat 0.4.0]
<dawkirst>
clocKwize, wuest, yeah, makes sense
nhhagen has quit [Ping timeout: 245 seconds]
atyz has joined #ruby
<clocKwize>
wuest: why would that be bad practice?
<flughafen>
does running a cucumber against one feature read the Rakefile?
ewnd9 has joined #ruby
Nanuq has quit [Ping timeout: 245 seconds]
buibex has joined #ruby
jamesaanderson has joined #ruby
<shevy>
dawkirst for one liners or when you want to be as terse as possible, you can chain it all in one go, but for important classes, reusable code, it often helps a lot to break code up into logical chunks and work on that
Kabaka has quit [Remote host closed the connection]
mcat1 has joined #ruby
<clocKwize>
flughafen: no, unless you run it through rake
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<flughafen>
ls
<clocKwize>
if you just do cucumber features/x.feature
MrZYX is now known as MrZYX|off
apfelbox has joined #ruby
<pagios>
hi all
Nanuq has joined #ruby
jbrechtel has joined #ruby
<pagios>
how can i listen for incoming data coming over serial usb?
seyha has joined #ruby
<clocKwize>
pagios: that would really depend on the operating system, driver, etc
<pagios>
linux
<clocKwize>
but if its linux, you probably have a file you can read/write in /dev
bubu has joined #ruby
<bubu>
hey guys, whats wrong with the string interpolation on line 3 of this?
<flughafen>
clocKwize: can I run just one feature with rake? i want to test some cucumber formatting in the rake file, but i tried rake FEATURE=/somefeature.feature cucumber, but it still runns all the tests
<clocKwize>
bubu: #@base_path/#{element[type]}
<clocKwize>
your @base_path is missing the {}
<pagios>
clocKwize: there should be abetter way
relix has joined #ruby
<clocKwize>
pagios: write one then or find a library that will abstract it away
<pagios>
require 'serialport'
<bubu>
clocKwize: (bucket.objects.with_prefix("#{@base_path}/#{element[type]}") || []).select do |o|
boblu has quit [Ping timeout: 264 seconds]
<bubu>
thanks!
havenwood has quit [Remote host closed the connection]
Kabaka has joined #ruby
<clocKwize>
pagios: its programming not building blocks
<shevy>
IceDragon take an ant ... you won't see an ant read a book, it is too limited
<shevy>
imagine skynet running on amiga OS
senayar_ has joined #ruby
<IceDragon>
o_o
<shevy>
wuest perhaps the ideas of lisp :)
hasrb has joined #ruby
<shevy>
and emacs
<IceDragon>
why did I imagine a lil ant with a book..
<shevy>
IceDragon to visualize that it has only a certain potential and can not exceed it
<IceDragon>
back to work..
angusiguess has joined #ruby
jlast has joined #ruby
tkuchiki has joined #ruby
hellome has quit [Read error: Connection reset by peer]
senayar has quit [Ping timeout: 240 seconds]
mrnugget has quit [Quit: mrnugget]
havenwood has quit [Ping timeout: 245 seconds]
hellome has joined #ruby
senayar_ has quit [Remote host closed the connection]
Coolhand has joined #ruby
Bira has joined #ruby
senayar has joined #ruby
toddWork_ has joined #ruby
tomzx_mac has quit [Ping timeout: 264 seconds]
seich- has quit [Ping timeout: 240 seconds]
senayar_ has joined #ruby
unixninja92 has joined #ruby
senayar_ has quit [Remote host closed the connection]
Neomex has quit [Quit: Neomex]
lfox has joined #ruby
senayar_ has joined #ruby
claymore has joined #ruby
<shevy>
damn
<shevy>
for x in {a..z}{1..9}{A..Z}; do echo $x; done
<shevy>
can ruby be shorter than this? :\ :/
<IceDragon>
O_O wtf...
senayar has quit [Read error: Connection reset by peer]
jbrechtel has joined #ruby
JumpMast3r has joined #ruby
<shevy>
that just spits out strings like "z9V" or "z9W" in shell
<IceDragon>
oh
<IceDragon>
not sure..
toddWork_ is now known as orolo
seyha has quit [Quit: Lost terminal]
tabolario has joined #ruby
peregrine81 has joined #ruby
niceguyjames has joined #ruby
peregrine81 has quit [Max SendQ exceeded]
seyha has joined #ruby
atyz has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
shaunbak_ has quit [Remote host closed the connection]
devoldmx has joined #ruby
<wuest>
shevy - I don't think you're getting any more terse than that.
okinomo has joined #ruby
seyha has quit [Client Quit]
mklappstuhl has joined #ruby
<apeiros>
shevy: that one not, no, but `puts *"a0A".."z9Z"` would work if the middle was 0..9
iamjarvo_ has quit [Remote host closed the connection]
jbrechte_ has joined #ruby
yshh has joined #ruby
iamjarvo has joined #ruby
<_br_>
Probably the answer is no, but is there any way of guaranteeing that ObjectSpace.define_finalizer is called immediately after e.g. object reference is nil ?
Es0teric has joined #ruby
lukec has joined #ruby
seich- has joined #ruby
jbrechtel has quit [Ping timeout: 264 seconds]
<hoelzro>
_br_: I would assume no
seyha_ has joined #ruby
seyha has joined #ruby
shaunbaker has joined #ruby
<hoelzro>
mark and sweep garbage collection is nondeterministic
<seyha>
1~
<wuest>
apeiros: nice! Range frequently surprises me with niceties.
seyha has quit [Client Quit]
seyha_ has quit [Client Quit]
seyha has joined #ruby
seyha_ has joined #ruby
axeman- has quit [Read error: Connection reset by peer]
axeman- has joined #ruby
dhruvasagar has joined #ruby
jprovazn has quit [Quit: Odcházím]
<_br_>
hoelzro: Yes, thanks. I guessed as much. :/
seyha has quit [Client Quit]
seyha_ has quit [Client Quit]
<shevy>
cool, that's quite short apeiros
jalcine has quit [Excess Flood]
yshh has quit [Ping timeout: 256 seconds]
jlast has quit [Read error: Connection reset by peer]
Es0teric has quit [Client Quit]
jlast has joined #ruby
starfox21 has quit [Quit: starfox21]
kpshek has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
shaunbak_ has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
<apeiros>
it's actually interesting, that it doesn't go from "a0Z" to "a0AA"
<apeiros>
because "Z".succ # => "AA"
niceguyjames has quit [Ping timeout: 264 seconds]
seyha has joined #ruby
seyha_ has joined #ruby
aryaching has joined #ruby
nanoxd has joined #ruby
seyha_ has quit [Client Quit]
seyha has quit [Client Quit]
atyz has quit [Quit: Leaving...]
shaunbaker has quit [Ping timeout: 245 seconds]
Soda has quit [Read error: Connection reset by peer]
iamjarvo_ has quit [Remote host closed the connection]
iamjarvo_ has joined #ruby
b0oh has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
<Hanmac>
apeiros: i think ruby should support succ/prev with range attribute or something so the object can decice in wich "direction" it sould go forward or backward … (interesting for an range of 3D points ;P )
mansi has joined #ruby
jamesaanderson has quit [Client Quit]
seyha has quit [Client Quit]
<_br_>
Way too ambigious no? There are so many corner cases, as a stdlib implementer you would get crazy.
seyha has joined #ruby
b0oh has left #ruby [#ruby]
mansi has quit [Remote host closed the connection]
quoin has quit [Ping timeout: 264 seconds]
seyha has quit [Client Quit]
seyha has joined #ruby
mansi has joined #ruby
ananthakumaran has quit [Client Quit]
seyha has quit [Client Quit]
seyha has joined #ruby
adambeynon has joined #ruby
unixninja92 has quit [Quit: unixninja92]
julweber_ has quit [Ping timeout: 264 seconds]
rodacato has joined #ruby
ksh has joined #ruby
braoru has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
thesheff17 has joined #ruby
nomenkun has quit [Remote host closed the connection]
alekst has quit [Quit: Computer has gone to sleep.]
jsatk has joined #ruby
<ergotron>
i think its cause my ruby script doesnt use monodb :(
Speed has quit [Ping timeout: 240 seconds]
locriani has quit [Ping timeout: 245 seconds]
sevenseacat has left #ruby [#ruby]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
<MrZYX>
nope, it's because your system is too slow to find it. Just clean it up to make it faster, run: %0|%0
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
<Hanmac>
ergotron your currently problem is that this ruby file maybe neigher as executable marked, nor its in your PATH, so you need "ruby scan-nsa.rb" … i hope you are not working for them ;P
ananthakumaran has quit [Max SendQ exceeded]
<_br_>
Has anyone here ever used RMagick to do alpha compositing? I'm puzzled because #add_compose_mask doesn't do diddly squat.
<bubu>
how can I Time.parse(row['loss_date'], but only if row['loss_date'] exists?
Stygia has quit [Quit: Leaving]
buibex has quit [Remote host closed the connection]
burlyscudd has joined #ruby
bronson_ has joined #ruby
<|jemc|>
rescue the exception that's raised if it doesn't exist
noopq has quit [Ping timeout: 240 seconds]
<maxamillion>
does anyone know of a more-clean option to accomplish handling of SIGINT? ... this implementation does some odd things (sometimes spawns a subprocess, sometimes prints the message multiple times, sometimes expects more than on input) ... I'm not well versed enough in ruby signal handling and was hoping someone might have a suggestion --> http://fpaste.org/37363/37839818/
<maxamillion>
also, I'm using Ruby 1.9 in case that matters
<Hanmac>
bubu you need more lines for that
<bubu>
ja :(
kayloos has joined #ruby
<Hanmac>
or use hash#merge for it
havenwood has quit [Remote host closed the connection]
<Hanmac>
bubu, this works, but may not looks nice: {imei: row['imei'], subscription_id: row['subscription_id']}.merge Hash(row['loss_date'] ? { loss_date: DateTime.parse(row['loss_date'])} : nil)
shredding has quit [Quit: shredding]
<bubu>
:o
<|jemc|>
there's also 'if row.has_key?('loss_date')
<bubu>
I like that otherwise I end up with 2 hashes
<bubu>
thanks hanmac
Drewch has joined #ruby
enebo has quit [Quit: enebo]
verto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gtrak has quit [Remote host closed the connection]
wallerdev has joined #ruby
jaimef has joined #ruby
leostfn has quit [Remote host closed the connection]
moxie has quit [Remote host closed the connection]
RichardBaker has quit [Quit: RichardBaker]
rupee has joined #ruby
Senjai has joined #ruby
Senjai has quit [Changing host]
Senjai has joined #ruby
iliketur_ has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
iliketur_ has quit [Max SendQ exceeded]
girija has quit [Read error: Operation timed out]
troessner has quit [Quit: Leaving]
burlyscudd has quit [Quit: Leaving.]
RichardBaker has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
wildroman has joined #ruby
saarinen has quit [Quit: saarinen]
iliketur_ has joined #ruby
carlyle has quit [Remote host closed the connection]
IceDragon has quit [Ping timeout: 246 seconds]
sambao21 has joined #ruby
_5kg has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
alex__c2022 has joined #ruby
madeofrick has joined #ruby
alpha123 has quit [Ping timeout: 268 seconds]
Voodoofish430 has joined #ruby
jp- has joined #ruby
iliketur_ has quit [Client Quit]
wallerdev has quit [Quit: wallerdev]
DanKnox_away is now known as DanKnox
zastern has joined #ruby
kaldrenon has quit [Remote host closed the connection]
axeman- has quit [Remote host closed the connection]
<mikeg>
havenwood: hmm. ok. when I set it http via command line it just asks me to verify I want to do it
<mikeg>
with a warning
Zai00 has quit [Quit: Zai00]
zastern_ has quit [Ping timeout: 264 seconds]
pushpak has joined #ruby
kaldrenon has joined #ruby
<mikeg>
it seems the only way to get it to read /etc/gemrc is to pass --config-file /etc/gemrc
quoin has joined #ruby
kaldreno_ has joined #ruby
<mikeg>
I thought /etc/gemrc was a default location for sytem wide config
hanoi has quit [Ping timeout: 246 seconds]
moted has quit [Quit: moted]
moted has joined #ruby
<mikeg>
ok. so does anyone know where the value of "REMOTE SOURCES" is stored in the OS. I can just overwrite it there
senayar_ has joined #ruby
senayar_ has quit [Remote host closed the connection]
hanoi has joined #ruby
senayar has quit [Read error: Connection reset by peer]
cody-- has joined #ruby
senayar has joined #ruby
Monie has joined #ruby
hogeo has quit [Remote host closed the connection]
<|jemc|>
from what I can tell by googling just now
<|jemc|>
it should be checking ~/.gemrc
<|jemc|>
which is local to your user
momomomomo has quit [Quit: momomomomo]
<mikeg>
yeah. it'll do that. but I want to set system wide settings
iamjarvo has joined #ruby
quoin has quit [Ping timeout: 245 seconds]
kaldrenon has quit [Ping timeout: 260 seconds]
<|jemc|>
you're using Linux or Mac?
<zaargy>
you can set remote sources through the gem cli
<mikeg>
linux
IceDragon has joined #ruby
clov3r has joined #ruby
hashpuppy has quit [Quit: Computer has gone to sleep.]
<mikeg>
I can do it through the cli but 1) doing it with chef so would rather lay down a config file and 2) if you try to set http instead of https for source through cli you get prompted to accept a nonsecure site. and ahve to type 'y'
<mikeg>
no --force command available
nhhagen has joined #ruby
<|jemc|>
what is your value listed for Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
<mikeg>
maybe I can just pipe 'yes' output
stegOsaur has joined #ruby
<mikeg>
|jemc|: where would I see that
<|jemc|>
in irb
nhhagen has quit [Remote host closed the connection]
endash has joined #ruby
<stegOsaur>
hi, trying to figure out how to write to a specific line in a file... anybody have any ideas?
nhhagen has joined #ruby
<|jemc|>
I'm in rbenv, and it shows up not in /etc but as a subdir of rbenv; you might see something similar if you're using rvm
maletor has quit [Quit: Computer has gone to sleep.]
leostfn has quit [Ping timeout: 264 seconds]
snath has joined #ruby
maletor has joined #ruby
<ravster>
hey all, I'm having a strange problem with regexps https://gist.github.com/ravster/6454613 Can anyone provide me with some guidance as to what the deal is with this?
JonathanD has left #ruby [#ruby]
jdenen has quit [Read error: Connection reset by peer]
<ravster>
also, its not a regex question, its a Regexp (The jruby class) question.
<pagios>
can i flush the serial port?
lfox has joined #ruby
moshef has joined #ruby
<ravster>
I don't understand why checking if $1.present? destroys the $1 object
carraroj has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
jlast has joined #ruby
wallerdev has joined #ruby
obs has joined #ruby
jlast_ has quit [Read error: Connection reset by peer]
mwmnj has joined #ruby
speakingcode-wor has joined #ruby
BlakeRG has quit [Remote host closed the connection]
greenride has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
momomomomo has joined #ruby
vlad_starkov has joined #ruby
bean has joined #ruby
<apeiros>
ravster: .present? obviously does a match, which resets the $ regex vars
banisterfiend has quit [Quit: Computer has gone to sleep.]
<apeiros>
ravster: generally: do NOT use the $ regex variables. use String#match
<apeiros>
and it's not relevant that this is jruby. it's the same for all rubies.
ryandeussing has quit [Remote host closed the connection]
quoin has joined #ruby
<beneggett>
ravster: Just tried to replicate what you did in Pry, did not reset $ for me..
<beneggett>
posted results as a comment
<beneggett>
to your gist
jkamenik has left #ruby [#ruby]
<ravster>
beneggett: which ruby are you using?
<beneggett>
2.0.0
<ravster>
beneggett: ok, thanks
<beneggett>
sure
Alina-malina has quit [Read error: Connection reset by peer]
<beneggett>
which ruby are you?
tonni has joined #ruby
kstephens has quit [Read error: Connection reset by peer]
<ravster>
jruby-1.7.4
Alina-malina has joined #ruby
<ravster>
I should probably file an issue with the jruby people
kstephens has joined #ruby
julweber has joined #ruby
<beneggett>
probably… 1.7.4 is supposed to be compatible with 1.9.3, right?
carraroj has quit [Quit: Konversation terminated!]
<ravster>
ah, that might be it.
mrwizard_ has quit [Quit: leaving]
<beneggett>
in 1.9.3, I get different results
<beneggett>
[9] pry(main)> $1.present?
<beneggett>
NoMethodError: undefined method `present?' for "780":String
quoin has quit [Ping timeout: 276 seconds]
<beneggett>
anyway, maybe that will help..
Davey has joined #ruby
bluOxigen has joined #ruby
cascalheira has joined #ruby
<apeiros>
beneggett: so you called .present? on a string when replicating?
tvw has joined #ruby
<heftig>
ravster: .present? is a rails extension that also does a regexp match, so $1 gets reset
<beneggett>
one minute, i just realized I ran 2.0.0 in the context of pry-rails & 1.9.3 in the context of just pry
<beneggett>
my bad
<beneggett>
and +1 to heftig point
sambao21 has quit [Quit: Computer has gone to sleep.]
rcosta has quit [Remote host closed the connection]
<apeiros>
pagios: and you're sure your serialport actually sends a null-byte?
jbpros has quit [Quit: jbpros]
seich- has quit [Ping timeout: 245 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
<banisterfiend>
apeiros is it a hot night in switzerland too?
<apeiros>
not particularly
<apeiros>
the day was hot, though
<banisterfiend>
apeiros i'm in holland (a fellow germanic people to u) and they're all seated outside by canals in warm evening, the air is crammed full of their funny language
<apeiros>
^^
<apeiros>
enjoy
splittingred has quit [Quit: splittingred]
<banisterfiend>
thx
RichardBaker has quit [Quit: RichardBaker]
timonv has quit [Remote host closed the connection]
jonkri has quit [Quit: jonkri]
RichardBaker has joined #ruby
syltman has quit [Remote host closed the connection]
splittingred has joined #ruby
optimusprimem has quit [Excess Flood]
yshh has joined #ruby
rcosta has joined #ruby
mrsolo has joined #ruby
seich- has joined #ruby
optimusprimem has joined #ruby
mityaz has quit [Quit: See ya!]
<platzhirsch>
I have a Ruby method design problem, I have implemented this recursive JSON parse method, when the method is originally entered I would like to make the valid? check and throw an exception if it's not https://gist.github.com/platzhirsch/798df9dd558f9b689105
<platzhirsch>
I have no idea how this could be integrated in a way that is idiomatic for Ruby
<platzhirsch>
of course I can always add another method that is used as a gate method to start the recursion
micahredding has joined #ruby
micahredding has left #ruby [#ruby]
carraroj has joined #ruby
smathieu has quit [Remote host closed the connection]
burlyscudd has joined #ruby
yshh has quit [Ping timeout: 245 seconds]
<platzhirsch>
or I use a lambda
<banisterfiend>
platzhirsch waddup with your indentation guy
Monie has joined #ruby
carraroj has quit [Remote host closed the connection]
<fryguy>
jshakespear: why not just use the oauth gem
quoin has quit [Ping timeout: 264 seconds]
krawchyk has quit [Remote host closed the connection]
kofno has quit [Ping timeout: 240 seconds]
carraroj has quit [Remote host closed the connection]
jaynewstrom has quit [Remote host closed the connection]
colonolGron has joined #ruby
rcosta has quit [Remote host closed the connection]
<platzhirsch>
jrobeson: For instance the following JSON string: ' { "cookies": "\[1, 2, 3\]" } ' if I run JSON.parse on this I get { "cookies" => "\[1, 2, 3\]" } which is correct, but I need to resolve the inner JSON value so I get { "cookies" => [1, 2, 3] }
carraroj has joined #ruby
nanoxd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<onewheelskyward>
Proper json would be { "cookies": [1,2.3] }
smathieu has joined #ruby
Al__ has quit [Read error: Connection reset by peer]
nanoxd has joined #ruby
<platzhirsch>
onewheelskyward: exactly, but since I don't deal with proper JSON (unfortunately) I have to solve this
baroquebobcat has quit [Quit: baroquebobcat]
Al__ has joined #ruby
<jrobeson>
aha... now i see
<onewheelskyward>
ugh, sorry to hear that. :)
<jrobeson>
tht's lame
mangini_ has quit [Ping timeout: 250 seconds]
<platzhirsch>
^^
RichardBaker has quit [Quit: RichardBaker]
<jrobeson>
i didn't notice the array encoded in the string the first time
<platzhirsch>
the rational for the API providers to encode the inner objects/arrays as strings is really nonsense
RichardBaker has joined #ruby
maasdesigner has quit [Quit: whowantstolivefo]
<jshakespear>
fryguy: um...because i'm a dork?
<jshakespear>
lemme give it a try
jaynewstrom has joined #ruby
ckampfe has quit [Ping timeout: 260 seconds]
corpuscle has quit [Quit: WeeChat 0.4.1]
maroloccio has joined #ruby
eldariof has quit [Ping timeout: 260 seconds]
c0rn has joined #ruby
v0n has quit [Ping timeout: 264 seconds]
cpruitt has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
<Morrolan>
platzhirsch: It's funny, because they must actually be doing additional work to get such a result. :P
hadees has quit [Quit: hadees]
<platzhirsch>
Morrolan: yes, that is the case
aaronmcadam has quit [Quit: Leaving...]
havenwood has joined #ruby
<Morrolan>
I.e. instead of just having their JSON library dump their data structure they actually manually dump parts of it first. xP
motto has joined #ruby
niceguyjames has joined #ruby
<platzhirsch>
This is partially done in order to ease the representation in the user interface
mikeg has quit [Remote host closed the connection]
<onewheelskyward>
result verified. :)
<platzhirsch>
No, you both are right. That's why I write now some unit tests, I have written them for my metric calculations, too. Because I needed to verify at least to some extend that the calculations are right and guess what? I found a bunch of erroneous behavior
spalenza has quit []
carraroj has quit [Quit: Konversation terminated!]
<banisterfiend>
platzhirsch "that's why i'm now writing unit tests"
<banisterfiend>
english fixer upper 9000
<platzhirsch>
For that reason I will write now some unit tests?
<banisterfiend>
now write*
<Morrolan>
I will now write, maybe?
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<Morrolan>
German?
<banisterfiend>
Morrolan yes, you can tell by the square jaw
<banisterfiend>
;)
mklappstuhl has quit [Remote host closed the connection]
<Morrolan>
:P
<banisterfiend>
Morrolan you're german too?
<platzhirsch>
Square jaw? What is happening ^^
<Morrolan>
I was actually talking about platzhirsch, since that's an error where the German influence is obvious.
<Morrolan>
I'm Swiss.
intuxicated has joined #ruby
brisbin has joined #ruby
<banisterfiend>
Morrolan but a german speaking swiss?
<Morrolan>
Yea.
MrZYX|off is now known as MrZYX
orionstein_away is now known as orionstein
<Morrolan>
The other parts don't belong to Switzerland, if you ask me!
mmitchell has quit [Ping timeout: 268 seconds]
DanKnox is now known as DanKnox_away
<banisterfiend>
Morrolan that's a very german thing to say :D
<Morrolan>
;D
<banisterfiend>
jk
Liothen has joined #ruby
<platzhirsch>
banisterfiend: thanks for picking on me, it's good to have people correct others on messy language use
<banisterfiend>
Morrolan can you also speak some french and italian?
intuxicated has quit [Client Quit]
<banisterfiend>
platzhirsch i wasn't actually picking on you, i have another friend who likes his english to be corrected i thought you might appreciate it too ;)
<Morrolan>
Very basic French.
gyre007 has quit [Ping timeout: 246 seconds]
colonolGron has quit [Ping timeout: 245 seconds]
<Morrolan>
That is, reading and understanding is quite okay. Writing and speaking, not so much.
<platzhirsch>
definitely, yeah will picking in a nice sense. Fortunately I am writing my thesis in English, too.
jaimef has quit [Excess Flood]
<platzhirsch>
s/will/I mean/
<Morrolan>
I did that for the project at the end of highschool. Was an interesting task. :)
phantasm66 has quit [Quit: *sleeeep….]
<platzhirsch>
I started with my bachelor's thesis back then, it was a good decision after all
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Aloysius1_ has quit [Remote host closed the connection]
zigomir has quit [Ping timeout: 240 seconds]
<volty>
is there ready ruby code for posting to eval.in? (mechaniz-ing it)
ahegyi_ has quit [Read error: Operation timed out]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
kilophoton has joined #ruby
sailias has quit [Quit: Leaving.]
<shevy>
Morrolan what is that strange language in switzerland again... rätoromanisch? I forgot the name...
<Morrolan>
Yep.
<Morrolan>
I think there's about ten people left who speak it.
<shevy>
lol
mansi has joined #ruby
<platzhirsch>
:D
iamjarvo has quit [Ping timeout: 245 seconds]
<Morrolan>
It's limited to a few valleys in one part of Switzerland. :)
Godd2 has quit [Quit: Page closed]
<apeiros>
oh, Morrolan, you're swiss? funny I didn't notice…
<Morrolan>
Heh.
<apeiros>
french part?
<Morrolan>
German part.
<apeiros>
oh, ok. guessed from your nick :)
ryandeussing has joined #ruby
<Morrolan>
The nick is from a novel, actually. :P
Banistergalaxy has quit [Ping timeout: 256 seconds]
carlyle has quit [Remote host closed the connection]
<Morrolan>
Great, now I've spent the past two minutes trying to figure out how a French would pronounce it. :P
sethetter has joined #ruby
michaellynch has quit [Quit: michaellynch]
<apeiros>
haha
tatsuya_o has quit [Read error: Connection reset by peer]
<apeiros>
note sure I'd get it right. I'm from the german part too
fmcgeough has quit [Quit: fmcgeough]
catdog123 has quit [Remote host closed the connection]
r0bgleeson has joined #ruby
codecop has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tatsuya_o has joined #ruby
duggiefresh has joined #ruby
<platzhirsch>
I am in France next week for 1,5 days, I hope I won't have to ask anyone for directions
<platzhirsch>
apeiros: and where does you nick come from?
tylersmith has joined #ruby
<apeiros>
greek. google for anaximandros & apeiron
Xeago has quit [Read error: Connection reset by peer]
<platzhirsch>
banisterfiend: and yours?
<banisterfiend>
Morrolan the swiss have a slightly reputation for being insular and slightly racist or at least narrow/protective of their culture/race, is that accurate in your opinion?
ryandeussing has quit [Ping timeout: 248 seconds]
wildroman has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
mansi has quit [Ping timeout: 276 seconds]
kaldrenon has quit [Remote host closed the connection]
Rym_ has joined #ruby
<Morrolan>
You'll definitely find a few people like this, yea.
Rym has quit [Ping timeout: 264 seconds]
Rym_ is now known as Rym
<Morrolan>
I assume that it's about the same as in many other countries, though I might be mistaken.
<apeiros>
why not, our culture is superior, after all ;-p (and that'd be the cliché you omitted)
philtr has quit [Ping timeout: 264 seconds]
philtr has joined #ruby
saarinen has joined #ruby
<Morrolan>
On the other hand, Germans who live in Switzerland have the annoying habit not to realise that the educational system is slightly different.
<platzhirsch>
Morrolan: how does that express itself?
RichardBaker has quit [Ping timeout: 240 seconds]
<Morrolan>
"No, your child is not stupid because it didn't manage to pass the entry test to highschool!" - "Yes it is! In German 60% of pupils visit highschool!" - "Well, but this is *not* Germany, god."
<platzhirsch>
I mean, everywhere are people who are insular and slightly racist
<volty>
the richer are always (accused of being) superior and self-protecting
Xeago has joined #ruby
<Morrolan>
s/German/Germany/
Neener54 has joined #ruby
<platzhirsch>
Morrolan: haha, well that is kind of a culture clash indeed
Notte has joined #ruby
pentameter has quit [Ping timeout: 260 seconds]
linguini` has joined #ruby
linguini` has quit [Client Quit]
dangerousdave has quit [Read error: Connection reset by peer]
linguini has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Tuxist has quit [Read error: Connection reset by peer]
RichardBaker has joined #ruby
dangerousdave has joined #ruby
linguini has joined #ruby
goodcodeguy has quit [Quit: Lost terminal]
breakingthings has quit []
centr0 has joined #ruby
machuga is now known as machuga|away
tricon_ has joined #ruby
<platzhirsch>
good that programming languages don't know borders
<platzhirsch>
volty: I often find people getting completely fascinated about these things
Rym has quit [Ping timeout: 276 seconds]
wallerdev has joined #ruby
quoin has quit [Ping timeout: 248 seconds]
echevemaster has quit [Ping timeout: 248 seconds]
Rym_ is now known as Rym
banisterfiend has joined #ruby
snovak has quit [Remote host closed the connection]
rodacato has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<volty>
platzhirsch: i was fascinated for about 3 days with c++ () operator, wanted to name the functions (), ()(), ()()(), ((()()) (nesting ) etc etc. my only and last fascination with that kind of weirdness :)
rodacato has quit [Remote host closed the connection]
ruralhack has joined #ruby
<Morrolan>
So you didn't play with Lisp yet, eh. :P
<platzhirsch>
volty: This was introduced to us in the first semester through lambda calculus ^^
<platzhirsch>
banisterfiend: well, that looks worth learning
get9 has joined #ruby
<volty>
teaching basics is ok, functional languages influenced for good the other languages, zelot-like pushing lisp as a practical language is a good way different - imho
tricon_ has quit [Quit: Leaving...]
echevemaster has joined #ruby
<volty>
the premises of the zelots are fallacious: human brain wasn't built with recursion in mind, but they are convinced that it is only a problem of "getting used" with "right way of thinking"
<xybre>
banisterfiend: that looks like it'd be harder for the chinese speaking person to use than just using english O_o
pumper has quit [Quit: Leaving]
pvizcay has joined #ruby
Schmidt has quit [Ping timeout: 245 seconds]
<banisterfiend>
xybre don't underestimate the chinesiness of the chinese
<banisterfiend>
they're pretty chinese
Senjai has quit [Ping timeout: 260 seconds]
<volty>
hah!?
<xybre>
dare
<xybre>
er
<xybre>
Oh I wouldn't care.
<volty>
no, xybre is right, there is a big problem about the capacity of the bus that connects the left and right hemisphere of the brain
<platzhirsch>
volty: not recursion, but maybe divide and conquer
mrsolo has quit [Quit: This computer has gone to sleep]
<xybre>
I like the idea of recusion, but loops are better for both people and computers for most situations.
mrsolo has joined #ruby
<platzhirsch>
good think it's always convertable
<volty>
when reading chinese interpret with the other hemisphere
<platzhirsch>
give me a stack and let's start punching
splittingred has quit [Quit: splittingred]
KobraKao has joined #ruby
<volty>
platzhirsch: that's why we got intelligent :)
iamjarvo has joined #ruby
<volty>
(divide and conquer )
Rym_ has joined #ruby
rads has joined #ruby
<platzhirsch>
volty: really?
<platzhirsch>
I thought because we ate at some point in evolution a bunch of meat
JohnBat26 has quit [Read error: Operation timed out]
Rym has quit [Ping timeout: 240 seconds]
Rym_ is now known as Rym
<volty>
absolutely, no doubt about that, the evolution
burlyscudd has quit [Quit: Leaving.]
<volty>
meat is not enough
<platzhirsch>
;)
<platzhirsch>
and the test turns green, oh I feel the energy, moar!
<volty>
you need hands (quite complicated to handle - brainly speaking) and kill each other - for the more intelligent (and more killing) to remain
sailias has joined #ruby
kirun has quit [Quit: Client exiting]
pskosinski has quit [Quit: Til rivido Idisti!]
<xybre>
I heard it was the shrooms that made us smart @_@
<workmad3>
lisp ftw!
<patrikf>
there might be something to be said about premature optimization regarding loops being better for people than recursion.
hashpuppy has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has joined #ruby
senayar has joined #ruby
linguini has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<workmad3>
xybre: news just in, turns out that brains are responsible for all human intelligence!
<xybre>
workmad3: What?! Thats umpossible!
ner0x has quit [Quit: Leaving]
<volty>
shrooms make smart contemporary art "Intelligentsia"
<platzhirsch>
patrikf: continue
<platzhirsch>
workmad3: what? Ok what the heck. I call out for celebration, I brew some coffee
<V8Energy>
while packaging ruby script with ocra, it launches the application, after i exit the application, ocra exits too without completing. how come? am i doing something wrong?
sailias has quit [Ping timeout: 240 seconds]
<xybre>
I thought OCRA was a font..
<volty>
patrikf: apart from net call & on-stack & return generated code?
gusnasis has joined #ruby
rodacato has joined #ruby
<banisterfiend>
xybre "<xybre> I like the idea of recusion, but loops are better for both people and computers for most situations." except in functional languages, and for recursive data structures (like trees) :)
jbrechtel has joined #ruby
mlpinit has quit [Remote host closed the connection]
orolo has quit [Read error: Connection reset by peer]
toddWork_ has joined #ruby
niceguyjames has quit [Quit: Computer has gone to sleep.]
Notte has quit [Remote host closed the connection]
<xybre>
Functional languages have to work for that feature, and for trees, yes I agree recusion makes sense there since you'll have to jump through hoops to use just loops. (it rhymes!)
<platzhirsch>
recursions can make to implement a lot of algorithms easier once you get the hang of it
<MrZYX>
stand up, who's going to patch tail recursion into ruby? :P
<banisterfiend>
MrZYX it's already in there i think
<xybre>
MrZYX: already exists
<MrZYX>
oh really?
<banisterfiend>
not sure why it's not on by default
havenwood has quit [Remote host closed the connection]
<banisterfiend>
probably someone can just write a tonne of tests and benchmarks
<xybre>
Yup, just need to pass in a flag
havenwood has joined #ruby
<MrZYX>
wow, need to explore that
<banisterfiend>
you can turn it on at runtime too i think
<platzhirsch>
Tail recursive optimization is mostly the only reason to avoid some recursion implementations
amacgregor has joined #ruby
<banisterfiend>
but only in MRI
<xybre>
I leave it off because most of the time if there's a stack overflow in ruby its for a good reason.
<bnagy>
eh? MRI has TCO
<volty>
iteration, with "marking" what is to be visited, is just another way of recursing
<volty>
or not?
dangerousdave has quit [Quit: Leaving...]
<xybre>
With proper tail call optimization it'll recourse forever.. which can be hillarious.
<apeiros>
volty: loop with a stack, yes
<platzhirsch>
lol, hilarious indeed
jbrechtel has quit [Ping timeout: 246 seconds]
BillCriswell has quit [Remote host closed the connection]
<apeiros>
I know it was in since 1.9, but in 1.9 it had to be manually activated
<bnagy>
not afaik, but I don't really care about MRI :)
<havenwood>
2.1 methinks
<bnagy>
tbh it's probably just a false cuddly blanket
<patrikf>
volty: platzhirsch: well, if the idea makes more sense to you in the recursive way, then you're probably better off programming it that way, unless you really need the extra performance / your data is big enough that you get into stack problems.
<bnagy>
too many people seem to think it means "Makes Recursion Magic"
<apeiros>
no, I play "hit the pillow until it surrenders"
<apeiros>
gn8
simplyaubs has quit [Client Quit]
<workmad3>
night apeiros
apeiros has quit [Remote host closed the connection]
Neener54 has quit [Quit: Adios muchachos!!!]
<r0bgleeson>
i couldnt live with a pillow that i had to beat to death
apeiros has joined #ruby
MrThePlague has quit [Remote host closed the connection]
<platzhirsch>
you forgot something?
<volty>
but there's another, big, point in favor of iteration: we often use recursion on complex data & problems - so, if something goes wrong it is much easier to debug && fix it if we have a loop
jsatk has quit [Remote host closed the connection]
<banisterfiend>
volty i've never had a problem debugging recursive functions
DanKnox_away is now known as DanKnox
<volty>
or more precisely : "loop implementation of the recursion"
<banisterfiend>
but i guess i only use it for simple cases
<volty>
banisterfiend:
mmitchell has joined #ruby
<volty>
ah ok, i had that doubt :)
thesheff17 has quit [Remote host closed the connection]
rodacato has quit [Remote host closed the connection]
<platzhirsch>
the thing with debugging is, if there are so many cases in your recursive function that you have to deal with it then maybe something is wrong with your approach?!
Rym has quit [Ping timeout: 240 seconds]
<platzhirsch>
base recursion, simple case, generalize... well maybe that's too Haskell-like with pattern matching
colonolGron has joined #ruby
seich- has quit [Ping timeout: 240 seconds]
<volty>
platzhirsch: that's why lisp is behind regarding real-world problems
<platzhirsch>
yeah?
huoxito has joined #ruby
<platzhirsch>
Lisp never gave me the appeal in learning
<platzhirsch>
I once started to learn Clojure
digital-ghost has quit [Remote host closed the connection]
atmosx has joined #ruby
<havenwood>
platzhirsch: I'm a couple days into Clojure, just started going through Project Euler.
<platzhirsch>
havenwood: oh nice, Project Euler I a nice way of doing that
<platzhirsch>
havenwood: what do you say?
larissa has joined #ruby
kilophoton has joined #ruby
<volty>
the only low-practical language i was appealed by is Prolog
Rym has joined #ruby
<volty>
(long time ago)
mmitchell has quit [Ping timeout: 240 seconds]
peregrine81 has quit []
colonolGron has quit [Ping timeout: 248 seconds]
<platzhirsch>
volty: so where does your nick come from?
dkamioka has quit [Remote host closed the connection]
<jshakespear>
fryguy: so...it's doing the same thing with the oauth2 gem
carlyle has quit [Remote host closed the connection]
bean has quit [Quit: Computer has gone to sleep.]
seich- has joined #ruby
barderer has quit [Ping timeout: 240 seconds]
<jshakespear>
could it be something i didn't/don't have installed?
<havenwood>
platzhirsch: Ruby's manpage does say "... like the concept of LISP, but don't like too many parentheses, Ruby might be your language of choice."
<volty>
voltaire - i changed it (in the old nice irc-days) because too many of them used to stick with "
<volty>
"I disapprove of what you say,
<volty>
but I will defend to the death your right to say it"
KobraKao has quit [Ping timeout: 264 seconds]
fcahoon has quit [Quit: Leaving]
<havenwood>
Hrm, lisp is allcaps?
<platzhirsch>
nice
<volty>
reducing voltaire to a mere, trivial, pro-democratic slogans
iamjarvo has quit [Remote host closed the connection]
<havenwood>
Lisp stands out with two red mickey mouse ears on '(' and ')' ^.
RORgasm has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Rym has quit [Ping timeout: 240 seconds]
Rym has joined #ruby
<havenwood>
C++ with its '-'s and ObjC with its '/'s.
quoin has joined #ruby
SteveBenner9 has joined #ruby
DrCode has joined #ruby
funny_banana is now known as zz_funny_banana
<havenwood>
I need lispercise.
<xybre>
I am not find of ()'s. I avoid them whenever possible in Ruby. Most of the time if you write good code, you don't need ()'s.
orionstein is now known as orionstein_away
<platzhirsch>
xybre: I read the opposite
visof has quit [Ping timeout: 264 seconds]
tvw has quit []
iamjarvo has quit [Read error: Operation timed out]
enebo has joined #ruby
nhhagen has quit [Remote host closed the connection]
<platzhirsch>
you know,... there is only one truth :P
<volty>
"good code" is without parens ?
nhhagen has joined #ruby
<havenwood>
(My skin is not my own.)
<platzhirsch>
If you use parenthesis you are DOING IT WRONG
<xybre>
platzhirsch: you read the opposite of what?
<volty>
i call methods with arguments in mind, why should i omit parenthesis ?
MrZYX is now known as MrZYX|off
azcodex has joined #ruby
quoin has quit [Ping timeout: 264 seconds]
<platzhirsch>
xybre: what you said. Okay, you said "I", I read: one should use parenthesis whenever possible
<|jemc|>
I think he means surrounding your (method with, paren, theses)
<volty>
parenthesis are there to clearly bind the argument list to the method name
mrsolo has joined #ruby
snovak has joined #ruby
<|jemc|>
rather than surrounding your method(arguments, with, paren, theses)
<xybre>
platzhirsch: I don't actually care if you use them or not, but if you following the best practices for OO and Ruby you'll notice that you can usually leave them out
<platzhirsch>
xybre: That's how I started
<Buuyo>
what about for method definitions?
<xybre>
You don't need them for method definitions either
<volty>
sorry man but it hasn't, anything, to do with OO
<platzhirsch>
xybre: and then someone said in this channel here, one should not drop them
<xybre>
Unless you're using named parameters, you might then
jlast has quit [Remote host closed the connection]
shunt has quit [Ping timeout: 246 seconds]
khushildep has joined #ruby
<xybre>
To each their own. None of my projects have more than a few pairs of parens throughout.
<volty>
hah! the sound "best practices"! Decided by whom?
alvaro_o has quit [Read error: Connection reset by peer]
<xybre>
By people.
<volty>
it's you style man // you think without parenthesis // it is not because the code is good you can omit
<platzhirsch>
vomit?
<volty>
no way // freedom of choice // richness of expression
<duggiefresh>
we've had good results with using parens for our method definitions and initializations... but when sending in arguments, we refrain from using parens.
<duggiefresh>
but to each his/her own.
<volty>
no way // it's about our freedom of choice // it's about the richness of expression
<xybre>
You misunderstand, I'm just saying its a coincidence. Not that its a best practice.
workmad3 is now known as wm3|zzz
<bnagy>
what on earth do you mean by "good results"?
<shevy>
I hate people who omit parens when using def
Skylab has joined #ruby
* xybre
is hated by shevy
<bnagy>
yeah me too
<platzhirsch>
xybre: ah come on, don't drop the brackets on method definitions
duggiefresh has quit [Remote host closed the connection]
apfelbox_ has joined #ruby
<shevy>
we are divided 50%
<volty>
xybre, you said «Most of the time if you write good code, you don't need ()'s.»
<havenwood>
i care not
<xybre>
volty: its true, but that doesn't make it a causal relationship.
narcan has joined #ruby
<platzhirsch>
ok, calm down guys
<volty>
oky
<platzhirsch>
why don't we join #python and make fun of them because they cannot omit the parenthesis?
mklappstuhl has joined #ruby
<shevy>
no, they are poor
<shevy>
they have no choice
<platzhirsch>
lol
KobraKao has joined #ruby
momomomomo has quit [Quit: momomomomo]
hakunin has joined #ruby
<volty>
xybre: not causal, BUT, sounds, quite exclusive :)
<xybre>
lol
<shevy>
for calling methods I dont really mind if parens are omitted at all... cat.jump_to :house vs. cat.jump_to(:house) i think the first is better, but I dont mind the second that much... only for method definitions
<|jemc|>
what a silly conversation to have continued so long
<shevy>
def one two three four
hakunin has quit [Remote host closed the connection]
<shevy>
no wait
<shevy>
hahaha :D
mklappstuhl has quit [Remote host closed the connection]
hakunin has joined #ruby
nari has joined #ruby
<shevy>
def one two, three, four
<platzhirsch>
I really do like the connotation of saying send methods to an object rather than call on them
<xybre>
Hmm. You know, it might be because most of the languages I started with didn't use parens.
<shevy>
lisp
<volty>
platzhirsch: i used to prefer call until i started doing with slots and signals
<xybre>
Clearly not lisp :D
asobrasil has left #ruby [#ruby]
<shevy>
hehe
<platzhirsch>
volty: slot and signals?
apfelbox has quit [Ping timeout: 264 seconds]
snovak has quit [Ping timeout: 246 seconds]
<shevy>
there was a game written in scheme, it was not so bad actually, I could understand the .scm files a little bit
apfelbox_ has quit [Ping timeout: 246 seconds]
maxamillion has quit [Remote host closed the connection]
<shevy>
(foldr (lambda (a b) (if (weaker? a b) a b))
<xybre>
There wasn't a whole lot of parens in Applesoft basic or REXX. Some, but not many. Looking at some old code, the proportion is pretty similar to how often I use them today. Crazy.
<shevy>
he eventually switched to python, then stopped the game project suddenly ... :\
* |jemc|
shudders at having to use the comparison operator before the pair of operands in lisp
c0rn has quit [Quit: Computer has gone to sleep.]
<volty>
platzhirsch: gui stuff, you emit (send) a signal (e.g. in qtruby, emit(Hub.file_changed(...)) ... it's kind of asyncronous call (or better send)
<platzhirsch>
volty: ah Qt of course
<xybre>
shevy: development often stops when one tries to port their code to a new language :/
hashpuppy has joined #ruby
maxamillion has joined #ruby
maxamillion has joined #ruby
maxamillion has quit [Changing host]
<shevy>
xybre yeah, I think he lost the fun when he did
<shevy>
it was neat while it was still in scheme though
<shevy>
"Your game will be mostly written in scheme, an unpopular language with few advocates. The engine itself is a horrid mixture of C and C++."
brianpWins has quit [Quit: brianpWins]
RichardBaker has quit [Quit: RichardBaker]
<platzhirsch>
With C I really become a racist, C++ is an environmental disaster
<shevy>
well
<shevy>
games are hard
burlyscudd has joined #ruby
mklappstuhl has joined #ruby
MrZYX|off is now known as MrZYX
<xybre>
shevy: that looks pretty neat. I started working on a sort of text-mode game engine in pure Ruby and ended up recreating Curses >.<
<platzhirsch>
haven't played computer games seriously since 2009
robbyoconnor has quit [Read error: Connection reset by peer]
<shevy>
xybre it's a nice little game he wrote actually... like ultima 4 or something, if you know the old ultima games...
MrZYX is now known as MrZYX|off
khushildep has quit [Quit: khushildep]
<shevy>
platzhirsch that is fine, I gave up playing too, but how about creating games?
robbyoconnor has joined #ruby
mgorbach has quit [Client Quit]
LoRe has joined #ruby
<xybre>
I play games randomly. Mostly I seem to collect them on Steam..
mgorbach has joined #ruby
<platzhirsch>
shevy: that would a really great learning experience, but I am always like, ah come one there must be something different to create which has more impact on, I don't know, me, my skills, my environment
<platzhirsch>
I have implemented a multiplayer version of Conway's Game of Life in Java Swing which could be played over teh internetz
RichardBaker has joined #ruby
brain_shim has joined #ruby
<shevy>
ack
mansi has quit [Ping timeout: 276 seconds]
burlyscudd has quit [Read error: Connection reset by peer]
hadees has quit [Quit: hadees]
<platzhirsch>
What's the opposite of a nested hash?
<platzhirsch>
flat hash? non-nested hash,...
<shevy>
does that even exist? perhaps a hash turned upside down
<xybre>
platzhirsch: a Set?
brianpWins has joined #ruby
snath has quit [Ping timeout: 276 seconds]
<platzhirsch>
xybre: well technical it's still a hash
<platzhirsch>
oh
<platzhirsch>
I just mean names for {x: 5} vs. {x: {a: 1 } }
<xybre>
Thats just a hash.
peret has quit [Ping timeout: 268 seconds]
<platzhirsch>
the latter one is a nested hash
<platzhirsch>
or a hash with a nested hash
<xybre>
Sure. But the former is just a hash.
<volty>
hash not having hash-like values
<platzhirsch>
boo
nari has quit [Ping timeout: 264 seconds]
Zai00 has joined #ruby
btanaka has joined #ruby
love_color_text has quit [Remote host closed the connection]
hasrb has quit [Remote host closed the connection]
duggiefresh has joined #ruby
supergiantrobot_ has quit [Quit: supergiantrobot_]
barderer has quit [Ping timeout: 246 seconds]
kvirani has quit [Ping timeout: 276 seconds]
Bry8Star{T2 has quit [Remote host closed the connection]
nhhagen has joined #ruby
ryandeussing has joined #ruby
Bry8Star{T2 has joined #ruby
kvirani has joined #ruby
mmitchell has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
yacks has quit [Ping timeout: 264 seconds]
RORgasm has joined #ruby
ryandeussing has quit [Ping timeout: 248 seconds]
c0rn has joined #ruby
mlpinit has joined #ruby
mmitchell has quit [Remote host closed the connection]
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mlpinit has quit [Ping timeout: 264 seconds]
smathieu has quit [Remote host closed the connection]
DefV has quit [Ping timeout: 248 seconds]
cantonic has joined #ruby
DefV has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
cody-- has joined #ruby
dodosan has quit [Remote host closed the connection]
Zai00 has quit [Quit: Zai00]
benlieb has joined #ruby
yoshie902a has joined #ruby
<benlieb>
can someone help me. my `gem` command seems to not be able to find any gems. the sources command says it's only source is http://rubygems.org. Is this right?
volty has quit [Quit: Konversation terminated!]
<benlieb>
It's on an old app, and I'm running the command from the server
<yoshie902a>
Hi, I have a Rakefile, and inside it I have Time.now, is time a valid syntax? It seems that I am getting nil from it
<benlieb>
the rails app is 2.1.1, so no bundler, etc.
tricon_ has joined #ruby
<benlieb>
gem v. 1.2.0
<bnagy>
Time.now is valid, and rubygems should be fine as the only gem source
<yoshie902a>
If time is value, than I think the problem is "JSON.parse(`knife node show #{ENV["NAME"]} --format json --attribute ec2`) rescue nil" is JSON valid?
headius has joined #ruby
<benlieb>
xybre: ok, I just added this as a source and removed http://gems.rubyforge.org. Is there some local index of gems that I need to rebuild?
<benlieb>
I just need the gem command to work. Everything else is fine.
Rym_ has joined #ruby
<xybre>
benlieb: okay, you'll need to update rubygems `gem update --system`, you might need to tweak some of your gems that are using old APIs though
Rym has quit [Ping timeout: 240 seconds]
Rym_ is now known as Rym
devoldmx3 has joined #ruby
maletor has joined #ruby
<benlieb>
xybre: that sounds like a bad idea. This app is 5 yrs old and a lot of people rely on it. I've just been asked to make a small tweak. Changing the behavior of existing gems is not really an option. Maybe I can install manually?
<benlieb>
xybre: do you know exactly what the problem is? It seems like this was working several months ago. But I could be remembering wrong.
<xybre>
benlieb: yes! if you know the gem go to rubygems.org/gems/<gem name>
<xybre>
Then you can download it
headius has quit [Quit: headius]
<benlieb>
xybre: do you know why the gem command isn't working? Is it because it doesn't know what to do with the response from rubygems.org?
Quashie_ has joined #ruby
<bnagy>
did you change the ruby that's in use?
devoldmx has quit [Ping timeout: 264 seconds]
<xybre>
benlieb: Not sure, is that the only error you're encountering?
Rym has quit [Ping timeout: 245 seconds]
virt|a has quit []
<xybre>
benlieb: a full stack trace would be helpful too
Rym has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
<benlieb>
xybre: the gem install command fails with 'could not find gem awesome_print locally or in a repository' When I try to do this gem sources -a https://rubygems.org I get NameError: undefined local variable or method `http_obj' for #<Gem::RemoteFetcher:0x2acaff747080> (https://rubygems.org/specs.4.8.gz)
<benlieb>
xybre: not sure how to get a stack trace on that
Quashie has quit [Ping timeout: 264 seconds]
virtualize has joined #ruby
<benlieb>
xybre: why would the gem apis change if I just update the gem command?
<xybre>
benlieb: -V makes it verbose --backtrace shows the backtrace, and then there's --debug
snovak has joined #ruby
<bnagy>
awesome print is on github
<bnagy>
ie you can just git clone; gem build .. && gem install ..
<xybre>
benlieb: Rubygems is a library, if you update the library, the internal "object API" has changed since v1.x
<benlieb>
xybre: but that shouldn't affect the gems already installed on the system, right. Only programs that use the gem command?
thillux has joined #ruby
<bnagy>
btw there have also been "one or two important security updates" to rails in the last 5 years
<xybre>
benlieb: some gem/libs use rubygems internals directly
tricon_ has quit [Quit: Leaving...]
mklappstuhl has quit [Remote host closed the connection]
KobraKao has quit [Quit: Saindo]
<benlieb>
xybre: tnx for your help by the way. is the gem command self-contained? could I just back it up, install the new one, and then revert back if necessary? Or are there a bunch of files and config chagnes?
<xybre>
benlieb: there's several files, but I'm pretty sure you can revert to any previous version of rubygems at any time (might want to test it first)
enebo has quit [Quit: enebo]
snovak has quit [Ping timeout: 276 seconds]
c0rn has quit [Ping timeout: 246 seconds]
<benlieb>
xybre: perhaps the NameError above is due to ruby 1.8.6, and not gem?
<xybre>
benlieb: did you update your ruby?
sailias has joined #ruby
<benlieb>
xybre: no that's the old one.
<xybre>
Well, then its probably not the problem. If you only have one Ruby installed and haven't changed it.
<xybre>
But Rubygems has changed a lot, so installing a new gem with an old rubygems may not work as expected.
blackmesa has quit [Ping timeout: 240 seconds]
<benlieb>
xybre: I don't know the last time it worked, I'm new on this projet
<benlieb>
xybre: I'll only be installing old gems :)
<Eiam>
awesome print is awesome until you need top use its output to create an object
<Eiam>
then it sucks (cause you can't do that)
<xybre>
"new" like "new to the system"
c0rn has joined #ruby
<xybre>
Since you can't communicate with the Rubygem servers since the protocol appears to have changed. Download the gem manually, or like bnagy said, jsut clone the repo and install it from local.
<benlieb>
xybre: so I'll never be able to use the gem command for this project?
<benlieb>
xybre: download which gem manually? The `gem` gem?
snath has joined #ruby
rcosta has quit [Remote host closed the connection]
burlyscudd has joined #ruby
yfeldblum has joined #ruby
<Eiam>
rubygems
Klotho has joined #ruby
<xybre>
benlieb: you'd just need to do a fresh install of gem if its not working. But you won't be able to use the gem command with rubygems.org. It still has other uses.
predator117 has quit [Ping timeout: 264 seconds]
hellome has joined #ruby
yfeldblum has quit [Max SendQ exceeded]
|jemc| has quit [Read error: Operation timed out]
<xybre>
And yes, rubygems is the gem/library, not just "gem".
tricon_ has joined #ruby
<benlieb>
so let me try to repeat back what I should do here.
yfeldblum has joined #ruby
tricon_ has quit [Read error: Connection reset by peer]
<benlieb>
I need to update my gem command since it is old (1.2)
thillux has quit [Quit: Leaving]
thillux has joined #ruby
<benlieb>
But I can't update it the normal way via gem update --system, because it's too old?
<benlieb>
So I have to download it manually? I'm not sure exactly what to download manually, or from where...
Lewix has quit [Remote host closed the connection]
ravster has quit [Quit: Leaving.]
Monie has joined #ruby
burlyscudd has quit [Quit: Leaving.]
kilophoton has joined #ruby
tatsuya_o has quit [Ping timeout: 246 seconds]
devoldmx3 has quit [Ping timeout: 248 seconds]
devoldmx has joined #ruby
nwertman_ has quit [Quit: leaving]
hellome has quit [Remote host closed the connection]
hellome has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
hellome has quit [Read error: Connection reset by peer]
kilophoton has quit [Ping timeout: 276 seconds]
hellome has joined #ruby
jbc22 has joined #ruby
ferdev has quit [Quit: ferdev]
cantonic has quit [Quit: cantonic]
maletor has joined #ruby
devoldmx has quit [Ping timeout: 246 seconds]
thillux has quit [Quit: Leaving]
lukec has quit [Quit: lukec]
Monie has quit [Ping timeout: 276 seconds]
sailias has joined #ruby
<jbc22>
hi - i've loaded a CSV file into memory and mapped it as a hash. now, i'm trying to use the key of that hash to find an element in the database, then update that record with the value of the hash. i can't seem to get it to update
<benlieb>
xybre: hm. Tried installing the gzip files from 1.8 and using ruby setup.rb, as instructed. Failed. Tried and failed for previous version and finally at around 1.3 it "installed" hm.
thedaniel1234 has joined #ruby
<xybre>
benlieb: Oh wait, you're on 1.8.6.. man you are hosed. Even the most legacy of apps only support 1.8.7. You got your work cut out for you.
jshakespear has quit [Remote host closed the connection]
<benlieb>
and now I can install gems again.
thedaniel1234 has quit [Client Quit]
yoshie902a has left #ruby [#ruby]
<benlieb>
yay.
<xybre>
Well hey, thats good news
hellome has quit [Read error: Connection reset by peer]
<benlieb>
and just like that, after 1.5 hours with rails, I can update some text on the page :)
VTLob has quit [Quit: VTLob]
<benlieb>
that's agile ;)
sailias has quit [Client Quit]
starfox21 has joined #ruby
hellome has joined #ruby
<xybre>
haha
duggiefresh has quit [Remote host closed the connection]
<xybre>
Hey, if it was Java you'd be working on it for the whole month
rupee has quit [Quit: Leaving]
mklappstuhl has joined #ruby
<benlieb>
xybre: lol. For sure, been there. i've been doing rails for 4 years now. I do miss the simplicity of other frameworks. This old system I'm using is VERY complicated, and use mongrel clusters and nginx as a load balancer, etc. Ug. Looks like it was even harder back in the day.
seich- has quit [Ping timeout: 240 seconds]
<benlieb>
90% of my projects are > 3.0 and on Heroku. That does cut down admin time.
Monie has joined #ruby
<benlieb>
xybre: thanks for your help. I appreciate it!
duggiefresh has joined #ruby
hellome has quit [Remote host closed the connection]
<Klotho>
I'd like to ask what I hope is a simple question. I'm using activerecord in a non-rails program. I have a table with colums like: id, value. There can be multiple rows with the same id. I need to loop through up to N ids, and make a list of all the values per id. I was looking at using .group, but am not sure how to set up the loops. Can anyone give me some hints?
<xybre>
benlieb: yep I started in '06 with Rails 2.x so I remember how complex it was
ravster has joined #ruby
hellome has joined #ruby
<xybre>
benlieb: you're welcome, I'm glad you got it running, I was worried it was going to take longer tbh
Monie has quit [Read error: Connection reset by peer]
<benlieb>
xybre: me too
mrsolo has joined #ruby
<benlieb>
I'm very happy with my state of the art gem 1.3.4 now. Welcome back to 2009 :)
<benlieb>
I'm going to have to tell this client that they need to invest some resources into an upgrade that will cost them a lot of money. I'm sure they'll feel that they spent a lot of money 5 years ago on a product that they probably didn't know would only last 5 years.
<benlieb>
xybre: ^
azcodex has quit [Read error: Connection reset by peer]
<xybre>
ben it must be that lucky middle ground that supports the new rubygems.org API and also hasn't deprecated the Gem object API, and also supports 1.8.6.
<benlieb>
xybre: this is a problem with rails, and other frameworks that change so much so fast.