thisirs has quit [Remote host closed the connection]
yumike has quit [Quit: Computer has gone to sleep.]
outoftime_ has joined #ruby-lang
brunocoe_ has joined #ruby-lang
brunocoelho has quit [Ping timeout: 246 seconds]
rfx has joined #ruby-lang
macmartine has joined #ruby-lang
<rfx>
hi
macmartine has quit [Read error: Connection reset by peer]
<mistym>
Hi, rfx
fgomez has joined #ruby-lang
macmartine has joined #ruby-lang
brunocoelho has joined #ruby-lang
rhodee has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
kunsel has joined #ruby-lang
brunocoe_ has quit [Ping timeout: 246 seconds]
ttilley is now known as ttilley_off
hackeron_ has quit [Quit: leaving]
hackeron has joined #ruby-lang
brunocoelho has quit [Read error: Connection reset by peer]
<rfx>
I've worked with ruby a bit so far and not yet touched rails except some basic tutorial stuff. I want to write an application which is part web and part doing stuff "in the background" (in a thread). Background stuff is misc things, e.g. scanning directories for changes or getting some data request on non-web ports and eventually putting information back in a db.
RubyRedGirl has left #ruby-lang [#ruby-lang]
<hackeron>
hey, this is a general gps qeustion, not specific to ruby, but maybe you guys can help :) - I have a ruby socket just doing server.gets(';') -- The lines I'm getting from the tracker look like this: imei:012497000372775,tracker,1206202237,,F,143745.000,A,5136.1991,N,00013.1538,E,0.00,,; -- any ideas how I would convert that to longitude and latitude decimals?
brunocoelho has joined #ruby-lang
<rfx>
Ideally I don't want rely on cron for regular background tasks but provide everything "out of the box". I looked into sinatra and understand the minimal context how it works. However I'd like to use rails, but can't understand whether I've the same flexbility with it. Any ideas, pointers?
<oddmunds>
hackeron: i'd assume the N,00013.1538,E,0.00 to be the long, lat
tbuehlmann has joined #ruby-lang
<hackeron>
oddmunds: the long lat for the location is: 000.219230 and 51.603320 (this is what the tracker send ms as an SMS), but how do I get those from the format it uses to send the data to the TCP socket?
robotmay has quit [Ping timeout: 246 seconds]
wmoxam_ has quit [Quit: leaving]
wmoxam_ has joined #ruby-lang
banisterfiend has quit [Ping timeout: 252 seconds]
robotmay has joined #ruby-lang
cirenyc has joined #ruby-lang
<bnagy>
weird
<bnagy>
those numbers are too close to be a coincidence (before N and E)
<bnagy>
maybe there's a fudge in there, or maybe it uses a weird long lat system?
<bnagy>
what's A?
<hackeron>
bnagy: I tried to type into google, it shows +51° 36' 13.20", +0° 13' 9.25"
<bnagy>
ahh there we go
<hackeron>
bnagy: which almost coincide with the 51361991 000131538, hmm
Eric_ has quit [Ping timeout: 272 seconds]
<hackeron>
bnagy: but it's a little off, like a street off
kunsel|2 has joined #ruby-lang
nertzy has quit [Read error: Connection reset by peer]
yannis has joined #ruby-lang
msaffitz has joined #ruby-lang
<hackeron>
bnagy: where as the sms coordinates are accurate
<hackeron>
what is causing the seconds to be off? - I think I'm converting them wrong maybe?
<augustl>
hi folks. I want to write some integration tests with Ruby. How do I best shell out to start a server, make the server run in the background so that my actual integration tests can run, and then kill the server afterwards?
kunsel|2 has quit [Ping timeout: 252 seconds]
<workmad3>
hackeron: are you transferring floats?
bfreeman has quit [Quit: bfreeman]
<augustl>
I suppose the server part is irrelevant, this is just about processes in general.
<hackeron>
workmad3: I'm getting data like this from a GPS tracker: tracker,1206202314,,F,151404.000,A,5136.1991,N,00013.1538,E,0.00,,;
<hackeron>
I think the format is DDDMM.mmmm / DDMM.mmmm
apeiros_ has quit [Remote host closed the connection]
florentg2 has joined #ruby-lang
<oddmunds>
workmad3: maybe the sms-thing is doing something with floats
ben_m has joined #ruby-lang
<bnagy>
hackeron: that raw looked exactly right? or are you just inferring the seconds?
<workmad3>
hackeron: I was wondering if you were hitting float rounding issues
<augustl>
in general it would be useful with the buide "Ruby I/O from a Node.JS perspective" :)
Fullmoon has quit [Quit: Fullmoon]
<augustl>
I would also need to read stdin from my process so I can know when the server has actually started
<bnagy>
hackeron: fuckit, subtract 600 and divide by 100 for your seconds
<bnagy>
you're going to be within the accuracy of the satellite anyway
<hackeron>
oh I think I get it, it is giving me minutes, not seconds
<hackeron>
so I need to convert the 00013.1538 to be 0' 13.1538 minutes, so the 0.1538 is a minute, not number of seconds
jperry2_ has joined #ruby-lang
<bnagy>
no it's 0 deg 13'
<bnagy>
but (1538 - 600)/100 == 9.38
kunsel has quit []
<bnagy>
which is about 5m out
Fullmoon has joined #ruby-lang
<bnagy>
although more samples would help getting a fudgey algorithm
<hackeron>
13' and 0.1538 minutes - so that's 9.228 seconds
<hackeron>
brb going to drive around and test :D
jperry2 has quit [Ping timeout: 260 seconds]
jperry2_ is now known as jperry2
<andrewvos>
In god I want to have a process start, and when that process is running I want another process to launch. Any ideas how I do this?
judofyr has quit [Remote host closed the connection]
robotmay has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
<hackeron>
bnagy: think I figured it out - I do DD+(mm.mmmmm/60.0) then I get 51.603320 000.21923 from SMS and 51.603318 000.219230 with my calculation
tallship has joined #ruby-lang
<hackeron>
bnagy: pretty much spot on
kurko_ has quit [Ping timeout: 244 seconds]
<bnagy>
hackeron: what does 5136.1991 turn into?
<bnagy>
I thought it was supposed to turn into 51 36' 13.20" ?
<hackeron>
bnagy: I just want to turn it into some usable format :)
msaffitz has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
<bnagy>
ok. I think it's no closer than my bizare mystery 6 second fudge :)
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
apeiros_ has joined #ruby-lang
ivanoats has quit [Client Quit]
<hackeron>
bnagy: you what? - it's practically spot on, heh - the 6 second judge was half a mile down the road, lol
<bnagy>
6 second put it within like 5 metres :)
<bnagy>
51 36 13.91
<hackeron>
it wasn't 5 meters, it was 6 seconds away in each direction, that's like 36 meters :)
<bnagy>
that's .7 secs out, ok which is 20 metres, so not so great
<bnagy>
I don't know what the unit diffs work out to with those decimal converted ones though
brunocoelho has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<hackeron>
bnagy: 51+(36.1991/60.0) gives me the same result as sms (no visible difference on google map) and it's exactly where the car is parked, I'm happy with that :P
<bnagy>
yeah but it's still not right :/ I want to KNOW
<hackeron>
what's not right, lol?
sora_h is now known as s0ra_h
<hackeron>
there is some inherit GPS drift - I don't think you can get away from that
<hackeron>
also TCP is every 30 seconds, SMS is on demand when I call the tracker
<hackeron>
so it wasn't sampled at the exact same time, it was a few seconds off
<bnagy>
ah ok.. I thought they were 2 representations of the exact same event
<hackeron>
I tried to request the SMS as soon as the coordinate was reported to the TCP socket, but yeh, it's not the exact same event I guess :)
<bnagy>
ok well I guess that makes sense
<augustl>
tried passing a StringIO to the :out of a Kernel.spawn, seems it's not supported. What should I do instead?
heftig has quit [Ping timeout: 245 seconds]
savage- has joined #ruby-lang
<augustl>
not having much success with IO.popen either. Are there any guides I should read? :)
<savage->
Mon_Ouie: Do you have any general rule that you follow for using {} vs. do/end for blocks?
<augustl>
perhaps there are some libraries I can use so I don't have to talk directly to the stdlibs level of abstraction
<savage->
Mon_Ouie: It seems like some folks are using {} only when you care about the return value, otherwise do/end for "side-effect" type blocks
<augustl>
savage-: some people use {} for single lines, do/end for multi lines
francisfish has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<Mon_Ouie>
I use the rule augustl mentioned
<Mon_Ouie>
But I am aware of that other rule
<augustl>
Mon_Ouie: fyi, my end goal is to use Ruby to write some integration tests, part of the setup is to start a sub process that is the server I'm integration testing
<augustl>
I need to read out "Listening at port 34022" or something like that from the server, so I know when it's ready
<Mon_Ouie>
Did you try my last advice (using $stdout.sync)?
<savage->
Cool.
<augustl>
Mon_Ouie: cool, something changed :) It prints "[[#<IO:fd 7>], [], []]" once
outsmartin has joined #ruby-lang
cantonic_ has joined #ruby-lang
<Mon_Ouie>
Yep, whenever it returns an IO in res[0], there's something to read for you
<augustl>
with $stdout.sync = true, a plain "while line = stdout.gets" works too
bfreeman has joined #ruby-lang
<Mon_Ouie>
It may be fine in your case, but blocking IO doesn't always do the job
<augustl>
so the IO.sync stuff is what I can use to get notified when data is actually written by the sub process?
<Mon_Ouie>
If IO#sync is true, whenever you write something, the output gets flushed
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
<augustl>
and this is why they say Ruby is made for programmers, not computers? :)
msisk has quit [Ping timeout: 245 seconds]
vmoravec has quit [Quit: Leaving]
slyphon has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
asahi has joined #ruby-lang
Criztian has joined #ruby-lang
<asahi>
if I have an xpath, (something like '/html/body/div[2]/div'), how can I find the parent node of this?
<asahi>
without using a regex
<lianj>
.children?
burgestrand has joined #ruby-lang
<whitequark>
hm
<whitequark>
does Ripper.parse ever work?
<whitequark>
Ripper.parse("whatever") # => nil
<savage->
Mon_Ouie: If you SIgnal#trap two different signals, is it possible to be executing those two signals if they get sent at the same time concurrently?
<lianj>
asahi: oh parent. '..'
<savage->
Mon_Ouie: In other words, Ruby doesn't send one after the other, correct?
<outoftime>
i seem to have found myself (under the guise outoftime_) banned from this channel. was anyone around when this happened? someone else has been attempting to use my nick...
<outoftime>
i promise i'm not naughty.
msaffitz has joined #ruby-lang
<matti>
When was that?
<matti>
Hi tenderlove
<tenderlove>
HELLO!
<outoftime>
matti: unclear. i was cool last night around midnight EST, then just noticed a couple minutes ago
<outoftime>
er, EDT
<matti>
outoftime: I do not see anybody banning you.
<outoftime>
matti: it was outoftime_ that was banned. maybe it's unrelated to me altogether -- i was just signed in as outoftime_ because somebody was squatting on my real nick
<outoftime>
so yeah i guess i won't worry about it as long as I'm not on anyone's s**t list : )
<workmad3>
outoftime: if someone is squatting on your nick, you can reclaim it
<matti>
outoftime: Unless it was different server after a split :)
<workmad3>
outoftime: /msg nickserv identify <username> <password> followed by /msg nickserv ghost <username>
<outoftime>
matti: quite so
<outoftime>
workmad3: yep, that's why i'm here under my real nick now : )
<workmad3>
:)
<hackeron>
I have a regex question, I have a string "5136.2202" - the format is (d)dddmm.mmmm - I want to split the string to (d)dd and mm.mmmm -- so ["51","36.2202"] - I'm trying to do: "5136.2202".findall(/([0-9]*)([0-9][0-9]\.[0-9]$)/) but that doesn't seem to work. Any ideas?
<augustl>
I'm using Open3.popen3 to start a new process. It doesn't seem to die along with my top level ruby process. How can I set that up?
<augustl>
currently wrapping everything in a begin/ensure/end block
<hackeron>
quick question about GPS, whenever I am driving, the GPS tracker reports 2 numbers, for example 24.86 (speed?) and 155.06 -- what do you think could be the second number? - It isn't reported when the vehicle is stationary
tzvi|work has joined #ruby-lang
fayimora has quit [Quit: Busy…..zzzzz]
jarred has joined #ruby-lang
kurko_ has quit [Quit: This computer has gone to sleep]
brunocoelho has joined #ruby-lang
M4g1c5t0rM1 has joined #ruby-lang
sockmonk has joined #ruby-lang
naz has quit [Quit: Leaving]
dhruvasagar has joined #ruby-lang
M4g1c5t0rM has quit [Ping timeout: 248 seconds]
countdigi has quit [Remote host closed the connection]
countdigi has joined #ruby-lang
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 272 seconds]
elux has joined #ruby-lang
kurko_ has joined #ruby-lang
fayimora has joined #ruby-lang
futurechimp has quit [Quit: Leaving]
rhodee has quit [Quit: rhodee]
tzvi|netbook has quit [Ping timeout: 246 seconds]
<burgestrand>
hackeron: baring?
<burgestrand>
like, uh, direction
<erikh>
augustl: trap SIGCHLD, or maybe it double-forks?
<augustl>
erikh: not sure what it does :)
<hackeron>
burgestrand: yeh, I think it is, it is never more than 359
vesan has quit [Read error: Connection reset by peer]
brunocoelho has quit [Remote host closed the connection]
r0bby_ has quit [Ping timeout: 246 seconds]
imperator has joined #ruby-lang
rhodee has quit [Quit: rhodee]
r0bby has joined #ruby-lang
qpingu has joined #ruby-lang
<imperator>
what's the ruby rabbitmq client lib of choice these days?
burgestrand has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby-lang
heftig has quit [Ping timeout: 248 seconds]
heftig_ has joined #ruby-lang
benanne has joined #ruby-lang
<imperator>
bnagy, inspired by your question (about the WaitForSingleObject timeout), version 0.7.0 of win32-process will let you set the timeout value, the dll module and the exit proc if you like
workmad3 has quit [Ping timeout: 245 seconds]
anjen has quit [Quit: anjen]
riffraff has quit [Quit: This computer has gone to sleep]
yannis has quit [Quit: Bye!]
pygmael has quit [Ping timeout: 240 seconds]
r0bby is now known as robbyoconnor
<rue>
imperator: Ask antares on #travis… I think it’s hot bunnies or something like that
qwerxy has quit [Quit: offski]
<rue>
Or, well, he’s probably on other channels too, come to think of it. Like #rabbitmq maybe but anyway
ryanf has joined #ruby-lang
jacobwg has joined #ruby-lang
<imperator>
rue, looks like hot_bunnies is the java/jruby client, but i'll try bunny, thanks
workmad3 has joined #ruby-lang
tallship has quit [Ping timeout: 240 seconds]
tommyvyo_ has joined #ruby-lang
fayimora_ has joined #ruby-lang
heftig_ is now known as heftig
fayimora has quit [Ping timeout: 250 seconds]
fayimora_ is now known as fayimora
fayimora_ has joined #ruby-lang
sailias has joined #ruby-lang
francisfish has joined #ruby-lang
<imperator>
(or maybe i'll just try it with jruby)
rowanu has quit [Remote host closed the connection]
juanvieira has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
juanvieira has quit [Quit: juanvieira]
<tonni>
drbrain: or something like Paths.repo.fnmatch(pattern) ?
<drbrain>
tonni: sure
wardrop has joined #ruby-lang
<tonni>
drbrain: I'm asking what you meant :)
wardrop has left #ruby-lang [#ruby-lang]
<drbrain>
tonni: where exactly the method lives isn't really a big deal
<tonni>
oki
<drbrain>
tonni: put it where it makes sense to you, be that in the same object your test code lives, or in a separate object
<drbrain>
tonni: you may decide in the future it makes more sense in a different spot, so you can move it around then
<tonni>
sure
<tonni>
it makes sense - I just got confused :)
dhruvasagar has quit [Ping timeout: 260 seconds]
r0bby_ has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 244 seconds]
Hakon|mbp has joined #ruby-lang
chrismcg is now known as zz_chrismcg
outoftime has quit [Quit: Leaving]
msaffitz has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
fayimora has quit [Read error: Operation timed out]
saLOUt has joined #ruby-lang
benanne has quit [Quit: kbai]
dejongge has quit [Ping timeout: 240 seconds]
fayimora has joined #ruby-lang
srbartlett has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
s0ra_h is now known as sora_h
badfish129 has quit [Quit: badfish129]
badfish129 has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
mikkelb has joined #ruby-lang
<mikkelb>
Slightly off topic but - at https://gist.github.com/2900419 (zsh renaming script) - how do I prevent rule 3 from converting two or more underscores to -? They should be _.
<mikkelb>
(was gonna do it in Ruby but I figured it'd be overkill - kinda like taking a supersonic jet to visit your next door neighbor :-P)
shevy has left #ruby-lang ["I'll be back ... maybe"]
zmack has quit [Remote host closed the connection]
brushbox has joined #ruby-lang
macmartine has quit [Quit: macmartine]
<zenspider>
mikkelb: I use a very old perl script for file renaming. works great so I've not touched it since.
<zenspider>
basically it takes a s/// as an arg and then evals that over all the file names and calls rename with the result
<zenspider>
from the original perl book
<mikkelb>
zenspider: cool
msaffitz has quit [Quit: Computer has gone to sleep.]
<zenspider>
it's only 16 lines long and very powerful as a result
<ironcamel>
mikkelb, zenspider, there is a pretty powerful command line tool named rename
<mikkelb>
ironcamel: I'm happy with mine, I just need to fix one regex
<tintin>
I don't use rename, normally i use mv :)
<ironcamel>
mikkelb: rename is written in perl as well, and takes a regex as an argument
<mikkelb>
ironcamel: Mine is made especially for my purpose which is to rename large MP3 collections: see their filenames https://gist.github.com/2900419
<zenspider>
ben_m: meh. who cares.
<zenspider>
mikkelb: I don't know zsh. sorry.
<tintin>
zenspider: Do you use ruby on rails?
<mikkelb>
cool thanks though
<tintin>
To test or debug code what do you use?
<zenspider>
tintin: please stop asking me inane questions for hours on end.
<tintin>
zenspider: I asked that because i got zenspider.com
<tintin>
with rails connectin somewhere
<postmodern>
tintin, use irb to test code manually
<postmodern>
tintin, to debug, ruby 1.9 has a builtin debugger. Just "require 'debug'"
<tintin>
Which forum is used to discuss about devs?