bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
ellcs has joined #ruby
phaul has joined #ruby
AJA4350 has joined #ruby
ramfjord has joined #ruby
tristanp has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 268 seconds]
arahael1 has joined #ruby
arahael1 is now known as ArahaelPi
tristanp has quit [Ping timeout: 272 seconds]
bijan_ has quit [Remote host closed the connection]
bijan_ has joined #ruby
clemens3 has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
bijan_ has quit [Ping timeout: 252 seconds]
Emmanuel_Chanel has quit [Quit: Leaving]
spiette has quit [Ping timeout: 268 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
lomex has joined #ruby
spiette has joined #ruby
bijan_ has joined #ruby
sticaz has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
t0xik has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
JoshS has quit [Ping timeout: 272 seconds]
phaul has quit [Quit: WeeChat 2.2]
tristanp has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
thy0 has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
k0mpa has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
thy0 has quit [Quit: TTFN]
bijan_ has joined #ruby
thy0 has joined #ruby
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
lomex has quit [Client Quit]
bijan_ has joined #ruby
moei has joined #ruby
alex`` has quit [Quit: WeeChat 2.2]
alex`` has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
sameerynho has quit [Ping timeout: 244 seconds]
siery has joined #ruby
<siery>
Hey guys, can someone help me to figure out whats wrong with this simple bubble sort?
<siery>
(arr.length - 1).times do |i|
<siery>
if arr[i] > arr[i + 1]
bijan_ has quit [Remote host closed the connection]
<siery>
arr[i], arr[i + 1] = arr[i + 1], arr[i]
<siery>
p "#{i}. #{arr[i]} > #{arr[i + 1]}"
<siery>
end
<siery>
end
bijan_ has joined #ruby
bijan_ has quit [Client Quit]
<apeiros>
siery: two things, 1) please use a paste service for >3 lines as told in the topic, 2) you could start with telling us why you think something was wrong with it
<siery>
apeiros: Right, sorry, I am kinda rough today.
<siery>
well, the condition is producing a wrong effect. I get things like, "0. swapped 45 > 85"
<siery>
I simply don't see how cold this if statement be wrong
kevinsjoberg has joined #ruby
<siery>
(I just pased the result from the first time it enters the condition, thats why this '0.' is there)
<apeiros>
well, you swap, then you print
<apeiros>
that'd be the reason for the seemingly wrong if
<apeiros>
i.e. it's […, 85, 45, …], and you compare 85 > 45, swap, then print the positions as before the swap, so you get "45 > 85".
k0mpa has quit [Remote host closed the connection]
<apeiros>
also, you iterate the array one time. so if it's [3,5,1], you'll skip the 3 > 5, but then swap 5 and 1, so your result will be [3,1,5].
<apeiros>
btw., got to go in ~3min
<apeiros>
which is actally now :) well, somebody else can surely help you! good luck!
k0mpa has joined #ruby
bijan_ has joined #ruby
faitswulff has joined #ruby
bryanray has joined #ruby
bryanray has quit [Client Quit]
peirama has quit [Remote host closed the connection]
jottr has joined #ruby
peirama has joined #ruby
bryanray has joined #ruby
bijan_ has quit [Remote host closed the connection]
peirama has quit [Remote host closed the connection]
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t0xik has quit [Quit: Connection closed for inactivity]
aupadhye has joined #ruby
bijan_ has joined #ruby
bryanray has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
aupadhye has quit [Quit: Leaving]
bijan_ has joined #ruby
ramfjord has joined #ruby
peirama has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
bijan_ has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
jottr has quit [Ping timeout: 272 seconds]
Emmanuel_Chanel has joined #ruby
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
faitswulff has quit [Remote host closed the connection]
jottr has quit [Client Quit]
jottr_ has joined #ruby
faitswulff has joined #ruby
Emmanuel_Chanel has quit [Remote host closed the connection]
faitswulff has quit [Remote host closed the connection]
bryanray has joined #ruby
bryanray has quit [Client Quit]
faitswulff has joined #ruby
bryanray has joined #ruby
tty has joined #ruby
Dbugger has quit [Remote host closed the connection]
Dbugger has joined #ruby
faitswulff has quit [Remote host closed the connection]
bijan_ has quit [Ping timeout: 252 seconds]
faitswulff has joined #ruby
Emmanuel_Chanel has joined #ruby
faitswul_ has joined #ruby
bryanray has quit [Ping timeout: 252 seconds]
faitswu__ has joined #ruby
Emmanuel_Chanel has quit [Client Quit]
SuperLag has quit [Remote host closed the connection]
faitswulff has quit [Ping timeout: 264 seconds]
Emmanuel_Chanel has joined #ruby
faitswul_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
cats has quit [Ping timeout: 260 seconds]
cats has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
lomex has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
tpendragon has joined #ruby
sameerynho has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has joined #ruby
lomex has quit [Client Quit]
doubledup has joined #ruby
lomex has joined #ruby
Emmanuel_Chanel has joined #ruby
fmcgeough has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
conta has quit [Quit: conta]
faitswu__ has quit [Remote host closed the connection]
faitswulff has joined #ruby
dorian has joined #ruby
<dorian>
'morning
<dorian>
i have a question around best practices for introducing backward-compatibility-breaking changes to behaviour in a gem
<dorian>
what i've done so far is make a parameter that defaults to the old behaviour that one can set to the new behaviour, but eventually i want to set the default to the new behaviour and then eliminate the parameter altogether
c0ncealed2 has quit [Remote host closed the connection]
<dorian>
so what i'm interested in is if there's a protocol i can follow for warning people of the impending change
<dorian>
ie when they install the gem
c0ncealed2 has joined #ruby
conta has joined #ruby
jottr_ is now known as jottr
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
Zaab1t has joined #ruby
kapil___ has joined #ruby
segy has joined #ruby
jottr has quit [Quit: WeeChat 2.2]
jottr has joined #ruby
ramfjord has joined #ruby
<havenwood>
dorian: I usually warn on use, rather than on install. There's no canonical deprecation path that I'm aware of in terms of a deprecation spec or api.
<dorian>
hmm
<havenwood>
dorian: In Rails land they have ActiveSupport::Deprecation apis.
<dorian>
i just put a `version` parameter in the calls that can be 0 or 1 to trigger the formatting version and i'm going to demand the user set it explicitly
<havenwood>
dorian: A lot of folk really dislike gem installation warnings - but mostly the IF YOU HTTP PARTY, PARTY HARD! types. :-P
<dorian>
ha
<dorian>
(well, not *demand* but warn)
segy has joined #ruby
Freshnuts has joined #ruby
conta has quit [Quit: conta]
orbyt_ has joined #ruby
vondruch has joined #ruby
<weaksauce>
siery you figure it out?
DTZUZO has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
bijan_ has quit [Remote host closed the connection]
_ari has joined #ruby
vondruch has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
bijan__ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
Emmanuel_Chanel has joined #ruby
bijan__ has quit [Remote host closed the connection]
sagax has quit [Ping timeout: 260 seconds]
faitswulff has quit [Remote host closed the connection]
bijan_ has joined #ruby
peirama has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 272 seconds]
peirama has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
alex`` has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
bryanray has joined #ruby
peirama has quit [Remote host closed the connection]
peirama has joined #ruby
bijan_ has joined #ruby
peirama has quit [Remote host closed the connection]
doubledup has quit [Remote host closed the connection]
bijan_ has quit [Ping timeout: 252 seconds]
doubledup has joined #ruby
reber is now known as neoreb
bak1an_ has joined #ruby
DTZUZO has joined #ruby
bak1an has quit [Ping timeout: 252 seconds]
peirama has joined #ruby
bijan_ has joined #ruby
nopolitica has joined #ruby
DTZUZO has quit [Read error: Connection reset by peer]
bijan_ has quit [Ping timeout: 252 seconds]
zapata_ has joined #ruby
zapata has quit [Ping timeout: 240 seconds]
bijan_ has joined #ruby
DTZUZO has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
bijan_ has quit [Ping timeout: 252 seconds]
jottr has quit [Quit: WeeChat 2.2]
bijan_ has joined #ruby
faitswulff has joined #ruby
jottr has joined #ruby
akaiiro has joined #ruby
jottr has quit [Client Quit]
jottr has joined #ruby
jottr has quit [Client Quit]
jottr has joined #ruby
orbyt_ has joined #ruby
doubledup has quit [Quit: Leaving]
jottr has quit [Quit: WeeChat 2.2]
jottr has joined #ruby
DoubleMalt has joined #ruby
jottr has quit [Client Quit]
SuperLag has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doubledup has joined #ruby
k0mpa has quit [Quit: k0mpa]
jottr has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has quit [Remote host closed the connection]
Nicmavr has quit [Read error: Connection reset by peer]
bijan_ has quit [Ping timeout: 252 seconds]
Nicmavr has joined #ruby
peirama has quit [Remote host closed the connection]
peirama has joined #ruby
nopolitica has quit [Ping timeout: 252 seconds]
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Quit: WeeChat 2.2]
herbmillerjr has quit [Excess Flood]
herbmillerjr has joined #ruby
Emmanuel_Chanel has joined #ruby
jottr has joined #ruby
jottr has quit [Client Quit]
bryanray has joined #ruby
jottr has joined #ruby
bryanray has quit [Client Quit]
t0xik has joined #ruby
Andrevan has joined #ruby
Andrevan has quit [Client Quit]
bryanray has joined #ruby
bijan_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
Andrevan has joined #ruby
isene has joined #ruby
<isene>
I'm officially going nuts. Having banged my head against this problem for a couple of hours, I yield. Can some genius here lend a hand? I am trying to execute this shell command from within a Ruby script: curl -u $USER https://api.github.com/user/repos -d "{\"name\": \"$REPO\", \"description\": \"Presentation\", \"private\": $PRIV, \"has_issues\": true, \"has_downloads\": true, \"has_wiki\": false}"
<isene>
There is something about escaping or some such that whacks this off balance, but I can't figure it out (it may be related to the cat that it is 5am here in Tokyo)
<isene>
s/cat/fact/
zapata_ is now known as zapata
<weaksauce>
isene can you gist the ruby code?
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 244 seconds]
mikhael_k33hl has joined #ruby
<mikhael_k33hl>
Given a line: 2012/05/12 11:59:29 [18094] total size is 241.57G speedup is 1.00. How do I extract the 241.57G substring? Tried line[/^*(total size is )\d+\.\d+.\S/] can't get rid of the 'total size is '
jeffreylevesque has joined #ruby
<weaksauce>
best bet is to do (?:total size...
<isene>
The whole thing is here: https://dpaste.de/aghX Compared to the shell script (with less functionality) here: https://dpaste.de/iRzq The shell scripts works nicely, the Ruby script does not create a new repo on Github :-/
<isene>
weaksauce: ^^
<weaksauce>
isene have you tried running that line from irb?
<mikhael_k33hl>
weaksauce: what's with the (?: ?
<weaksauce>
it's an ignoring capture group
<weaksauce>
as in it captures it and ignores it
<mikhael_k33hl>
wow, did not know that
<weaksauce>
at least i think that's the correct syntax for it
<weaksauce>
isene guess your json payload is incorrect
<mikhael_k33hl>
weaksauce: gee, thanks, didn't know why my previous pattern didn't work. perhaps something to do with groupings
<weaksauce>
i had to add a match group to the part you cared about
<isene>
Yes. But it is correct with the bash script, and I can't get my wits around why the Ruby version isn't. Some escaping of characters or something...
<mikhael_k33hl>
weaksauce: tried it in irb, doesn't give the same output
<weaksauce>
and also ignore the part you were matching on but you could have actually just removed the parens for the same effect i would wager
<apeiros>
`ClassA > ClassB` is Module#> and returns true if ClassA is an ancestor of ClassB
<apeiros>
I'd usually rather write that as `ClassB < ClassA` for its similarity to `class ClassB < ClassA`
<apeiros>
wild_buffalo: oh, wow, those examples are just flat out broken code
<wild_buffalo>
apeiros: ah, that makes more sense
<wild_buffalo>
I've been looking around because that made no sense
<apeiros>
the code on the page you just linked has broken code. should be < there, not >.
<wild_buffalo>
Next time I should just repl it first
<wild_buffalo>
apeiros: that was my initial thought, but I'm just learning Ruby so I had no idea
<wild_buffalo>
apeiros: thanks
<apeiros>
you should probably inform the page maintainer about that.
bmurt has quit [Read error: Connection reset by peer]
phoo1234567 has joined #ruby
bmurt has joined #ruby
<wild_buffalo>
apeiros: yup, sent a message on their IRC
socomm has joined #ruby
<socomm>
Hello. I'm new to ruby and just playing around with it. I wonder how I would access this variable in puts "x=['blue', ['weak' => 'strong']]" -- I tried puts "x['blue']['weak']" but I get nothing
<apeiros>
socomm: those are nested arrays. arrays are accessed by index (position)
<apeiros>
so: x[0] gives you "blue", x[1] gives you [{'weak' => 'strong'}], and x[1][0] gives you {'weak' => 'strong'}
<apeiros>
I somewhat assume the ['weak' => 'strong'] is a mistake, though, as it makes little sense. it's a shorthand for [{'weak' => 'strong'}], and probably should be just {'weak' => 'strong'}
<socomm>
Gotcha. How about I do it with a hash?
<socomm>
nvm I'll look it up, sorry to bug
<weaksauce>
replace the [] with {}
<weaksauce>
and have blue =>
<weaksauce>
instead of ,
<weaksauce>
think of an array as positional and a hash as relational
<socomm>
weaksauce: got it thanks for the clarification
alex`` has quit [Ping timeout: 252 seconds]
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nicoulaj has quit [Quit: quit]
roshanavand has quit [Quit: leaving]
socomm has left #ruby ["WeeChat 2.2"]
kapil___ has quit [Quit: Connection closed for inactivity]
bryanray has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jane_booty_doe has joined #ruby
peirama has joined #ruby
nfk has joined #ruby
<nfk>
so i asked google "ruby gui" and out came http://shoesrb.com/ so i went and started reading "The Book" and... is this framework for real or is it some elaborate joke?
<gizmore>
nfk: you maybe want ruby qt or kde bindings?
<apeiros>
nfk: shoes is real
<nfk>
gizmore, i have tried it plenty, no more suffering of that
<nfk>
it's either javascript or nothing when it comes to qt/kde
<apeiros>
the original author did like to include a lot of jokes, though. google for "_why the lucky stiff"
<nfk>
apeiros, more like someone went off their meds..
peirama has quit [Ping timeout: 252 seconds]
<weaksauce>
nfk unfortunately i haven't found a decent gui for ruby
<nfk>
yes, that's exactly why i just did "ruby gui" T_T
<weaksauce>
i just wanted one for visualization of things
<nfk>
weaksauce, in that case i suspect it's easier to just output to png or something
<nfk>
or even just compile CLI calls to gnuplot if that can do your bidding
BTRE has joined #ruby
<nfk>
i know i did plenty of homework that way
<weaksauce>
well not a static image
<nfk>
i used ffmpeg to turn them into mp4, natch'
<weaksauce>
i was looking for something that you can visualize easily and interact with
<nfk>
comes with being from the scene
<weaksauce>
like say you want to interactively create quad trees or whatever and visualize that ds
<nfk>
weaksauce, hmm.... yeah, i'm thinking of something like that for some other stuff.. i really can't think of anything better than HTML5, though
bak1an_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<weaksauce>
or quick interfaces for scripts
<nfk>
apeiros, so.. is shoes any good and how does it compare to other solutions out there?
<weaksauce>
it would be nice to have a good ruby gui
beefjoe has joined #ruby
<apeiros>
nfk: I'm sorry, I don't use GUI toolkits with ruby, so I wouldn't know.
<nfk>
i haven't so far either but at this point it's like "gotta find something decent, usable and preferably cute" or i'm doing GUI in RoR...
beefjoe has quit [Remote host closed the connection]
<nfk>
yeah, i have seen it before, can't say I liked any of them
dbz has joined #ruby
BTRE has quit [Ping timeout: 252 seconds]
<nfk>
i'm not looking forward to making a gui in rails but it should be good enough for my needs and there's going to be either mongo or sqlite db behind the app anyway
<nfk>
it just feels a bit crazy to go that route, besides i'm sure there's some limitations to leaving the project folder or even app folder, and i want to interact with the entire / tree
<havenwood>
nfk: Whatcha making a GUI for? Or just wondering in general?
dbz has quit [Ping timeout: 272 seconds]
<havenwood>
nfk: TK was in the Ruby standard library until fairly recently.
peirama has joined #ruby
<nfk>
hmm... for starters i want to to able to calculate file hashes in various folders to deal with my 10+ years of rampant "oh, this USB stick probably is 100% duplicate but I don't have time to check, mv'ed"
<nfk>
then i might want to look for files that have changed slightly (metadata or something) but are actually the same
<nfk>
even under different names, and finally making the mess work with my android phone would be great
<nfk>
likely via webav or something as mtp is so broken that getting it working is le work
bryanray has joined #ruby
<nfk>
oh, can i haz' imporant and deduped file replication to my other computers, while at it?
dbz has joined #ruby
<havenwood>
nfk: Is a gui better than a command line app for it?
<havenwood>
nfk: I guess the file selector is handy?
* baweaver
wanders in
<havenwood>
o/
<nfk>
for me, probably and for a change i should actually publish it, so, yes, gui is a must