tenderlove has quit [Remote host closed the connection]
igotnolegs has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
sora_h is now known as s0ra_h
Nisstyre has joined #ruby-lang
s0ra_h is now known as sora_h
scampbell has quit [Remote host closed the connection]
sailias has joined #ruby-lang
sora_h is now known as s0ra_h
s0ra_h is now known as sora_h
Nisstyre has quit [Ping timeout: 246 seconds]
neoesque has joined #ruby-lang
dymk2 has joined #ruby-lang
<dymk2>
Is it possible to access public class properties with the scope operator in Ruby?
<dymk2>
EG, class Foo @@bar = "baz" end; Foo::bar?
dymk2 is now known as dymk
<apeiros>
no
<apeiros>
they're not properties either
<apeiros>
:: is only for namespaces (that's modules & classes only) and method invocation (don't use it for method invocation, though)
fgomez has quit [Quit: Lost terminal]
<dymk>
Alright, thanks
<aef>
in C++ an iostream has a method #peek which hints the next character on the stream without removing it and without blocking. this way i could check if the next read would block. is there a way to do this in Ruby?
Nisstyre has joined #ruby-lang
<apeiros>
aef: I'd guess getc & ungetc
<apeiros>
it might be wise to change the way to tackle the problem from C++ to ruby…
<aef>
i'm not a C++ programmer. but i have never found a good solution for this in Ruby
<apeiros>
I wonder what problem you're trying to solve…
perryh_away is now known as perryh
<aef>
i find myself often in the situation in which i need to check if a read would block to avoid blocking. otherwise i would need threading which increases complexity heavily
<aef>
currently its an external process, kind of a shell, into which i send a command (a line) and want to receive all the output which is generated afterwards
<apeiros>
well, getc would block too
<apeiros>
read_nonblock
<apeiros>
*sob* I really need to get that gist up on why cross-posting is rude and you shouldn't do it…
lsegal has joined #ruby-lang
<aef>
read_nonblock is kind of unhandy. is there a good reason why there is no readline_nonblocking?
<apeiros>
I'm sorry but I refuse to help cross-posters.
<aef>
what is a cross poster?
<apeiros>
somebody who posts the same question in multiple places.
<aef>
well, why is that a problem now?
<headius>
ok, my turn to ask a question
<apeiros>
it's rude.
<headius>
this code reads '1234567890' on MRI and '' on JRuby
<headius>
File.open('foo', {:mode => 'a+'}) {|f| p f.read}
<headius>
rdoc says a+ should position at end of file if it exists, so I'm confused why MRI would not also be EOF and produce ''
<apeiros>
you're not keeping the people in the different channels that you ask up to date. people waste time. you probably don't even read answers anymore once you've got your answer somewhere else. (and don't go on to tell me that you're that one out of thousand who's different - you'd have announced that you ask in other places if you were)
ilyam has quit [Quit: ilyam]
<headius>
am I crazy or does MRI's behavior not make any sense, going on what the rdoc says
ilyam has joined #ruby-lang
<aef>
well maybe you're right, but I've never seen anyone having a problem with that
sora_h is now known as s0ra_h
<apeiros>
headius: different pointers for read & write? just guessing, though
<headius>
hmm, that would be weird
<headius>
it's a theory I guess
<apeiros>
aef: oh how unexpected… how many knew you were cross-posting?
<headius>
it just says "positions at the end of the file"
<apeiros>
and yeah, thanks for making me nobody.
<apeiros>
headius: I'd have the same expectation as you
<apeiros>
if that's any help
<headius>
"a+" | Read-write, starts at end of file if file exists,
nofxxx has quit [Remote host closed the connection]
<headius>
it's not, but I appreciate it :)
<aef>
apeiros: well if they don't know, i guess they don't care anyway
<headius>
actually, I suppose it is
<headius>
means I should probably take it to ML
<apeiros>
headius: the moment you write the position is at the end, though
<apeiros>
and read will be ""
<headius>
mmm
<headius>
I'll have a look at how MRI actually handles this case
<headius>
if I can find it
<apeiros>
aef: not knowing why the behavior of somebody sucks is not equal to the behavior of that somebody not sucking
<headius>
it seems unexpected to me
<apeiros>
headius: I can't find a second pointer. so I guess the a+ takes effect only at the first write
<headius>
weird
<apeiros>
but yes, I'd say the only conclusive answer is in the source
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
<headius>
this is either some funky ruby mode or a libc mode I never knew before
ilyam has quit [Ping timeout: 248 seconds]
<apeiros>
aef: also the way you deal with being confronted about your behavior is telling IMO.
<aef>
apeiros: i think you were just looking for a reason to start a fight. a lot of people on IRC do that. i think that's rude.
<headius>
ok, so it is a libc flag
<apeiros>
aef: I'm not. so don't make it into one.
<headius>
docs there look like MRI description though
<apeiros>
aef: I told you I won't help you. *you* asked why. I told you. so stop that line right there.
<aef>
apeiros: actually you helped me, and afterwards you told me that you don't help me.
<apeiros>
aef: yes, the moment I noticed you were cross-posting.
<headius>
" For these offerings, development is free, but royalties are required upon deployment on anything other than general purpose systems. "
<headius>
no idea what that means
<headius>
but it sounds like fiddling around with it would be fine
<apeiros>
scientes: ok. let me rephrase: confusing
<scientes>
apeiros, its that ruby C modules built for 1.9.3 will run on 1.9.1
woollyams has joined #ruby-lang
<scientes>
apeiros, its only confusing, cause they didn't fallow GNU versioning, in that they broke binary compatibility between 1.9 and 1.9.1 (probably for good reasons)
<headius>
jruby works fine on those embedded javase from oracle
<apeiros>
headius: cool
<apeiros>
already 0300 here, though. So I'll try it when I come back on sunday
<scientes>
apeiros, why are you using ipkg on such a powerful system?
<apeiros>
headius: Java SE Embedded 7, the topmost I guess?
<scientes>
use emdebian
<scientes>
if you have limited space
savage- has quit [Remote host closed the connection]
<apeiros>
scientes: limited space? haha, it's a NAS, it's got 12TB of space :) ram & cpu are the issue. I won't run emdebian as synology's software probably won't run on it :(
<headius>
apeiros: yeah, that would perform best
<headius>
invokedynamic etc
<scientes>
apeiros, it probably would, you just just run debian in a chroot
<scientes>
and then have sanity
<apeiros>
great. will definitively give it a shot on sunday
<scientes>
its all linux
<scientes>
which is the beauty
<scientes>
otherwise just install gcc, and compile ruby from source
<apeiros>
scientes: yeah, tried that. running into problems, though.
<apeiros>
scientes: but if you've got experience there, I'll probably love to talk to you, should the jruby approach fail…
<scientes>
apeiros, if you can't get ruby compiled you will never get c extensions compiled, and you need a sane environment that a chroot will give you
<scientes>
and jruby also needs to compile c extenstion
<apeiros>
phew, chroot is installed. at least one thing…
<headius>
most of jruby's extensions are not in C and require no compilations
<scientes>
apeiros, its probably just busybox chroot, anyways its just a wrapper for a syscall
<apeiros>
the only relevant gems with C extensions are available in a jruby-c-free-version afaik
<scientes>
apeiros, install debootstrap via ar and tar (manually from deb package)
<scientes>
and then unpack a debian chroot
<apeiros>
(nokogiri, imagemagick, json)
sora_h is now known as s0ra_h
<scientes>
apeiros, what OS is this?
<apeiros>
busybox
Jay_Levitt has quit [Ping timeout: 246 seconds]
<scientes>
well i know that
<headius>
imagemagick might be the only sticker, but depending on what you want to do with it there's alternatives
<scientes>
but with ipkg?
<headius>
the others are fine
<scientes>
you would be alot happier just installing debian
<lianj>
just use archlinuxarm in the chroot..
tomb_ has quit [Ping timeout: 246 seconds]
<apeiros>
ok. I'll drop those words when I'm back on sunday. but now I've got to get the 3h of sleep that I've got left :)
<apeiros>
cya guys & thx for showing me some options
retro|cz has joined #ruby-lang
cczona has joined #ruby-lang
cczona has left #ruby-lang [#ruby-lang]
<headius>
have fun
apeiros has quit [Remote host closed the connection]
<headius>
a
s0ra_h is now known as sora_h
tomb_ has joined #ruby-lang
towski has quit [Remote host closed the connection]
seanstickle has quit [Quit: Nihil sub sole novum]
srbartlett has joined #ruby-lang
sora_h is now known as s0ra_h
<headius>
ah-ha, found it
<headius>
we had a File.open path that seeked to end of file right away
<headius>
which it seems like we SHOULD do, but apparently libc docs are lying
dymk2 has joined #ruby-lang
ilyam has joined #ruby-lang
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
dymk has quit [Ping timeout: 246 seconds]
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
fgomez has joined #ruby-lang
ilyam has quit [Quit: ilyam]
petercooper has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
QoQOoO has quit [Read error: Connection reset by peer]
woollyams has quit [Quit: Computer has gone to sleep.]
QoQOoO has joined #ruby-lang
QoQOoO has quit [Client Quit]
QoQOoO has joined #ruby-lang
headius has quit [Quit: headius]
Bwild has joined #ruby-lang
deryl has joined #ruby-lang
richardjortega has left #ruby-lang [#ruby-lang]
QoQOoO has quit [Read error: Connection reset by peer]
headius has joined #ruby-lang
JustinCampbell has quit [Remote host closed the connection]
QoQOoO has joined #ruby-lang
qpingu has quit [Quit: Leaving.]
s0ra_h is now known as sora_h
QoQOoO has quit [Remote host closed the connection]
jtoy has joined #ruby-lang
sailias has quit [Ping timeout: 246 seconds]
petercooper has quit [Remote host closed the connection]
QoQOoO has joined #ruby-lang
fgomez has quit [Quit: Lost terminal]
fgomez has joined #ruby-lang
fgomez has quit [Client Quit]
sepp2k has joined #ruby-lang
sora_h is now known as s0ra_h
jackhammer|AFK is now known as jackhammer2022
andrewhl has joined #ruby-lang
cha1tanya has joined #ruby-lang
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby-lang
orend_ has joined #ruby-lang
jtoy has quit [Quit: jtoy]
banisterfiend has quit [Read error: Connection reset by peer]
<andkerosine>
Which means ObjectSpace was picking up on the newly declared string... from within the enumeration?
<drbrain>
probably
<andkerosine>
Are blocks eagerly evaluated?
zmack has joined #ruby-lang
<andkerosine>
I mean, they must be for that to be case, but I can't quite wrap my head around how that would work under the hood.
<drbrain>
to_a should nail it down, but there may be an extra copy for some reason
mssola has joined #ruby-lang
tooky has joined #ruby-lang
the-newsman has joined #ruby-lang
<the-newsman>
i cannt start loading file, loading module . i dunno why the irb gives me error message
<the-newsman>
aany1 to help me ?
<andkerosine>
Have you recently installed Rubinius?
<andkerosine>
drbrain: I assumed at first that perhaps a separate interpreter gets started up for a moment to handle some strange edge cases, but main having a to_s makes much more sense.
tooky has quit [Remote host closed the connection]
<drbrain>
andkerosine: I haven't
tooky has joined #ruby-lang
<drbrain>
the-newsman: you have given no specifics, such as what you typed or what error you recieved
<andkerosine>
Heh, my question was for the-newsman.
<andkerosine>
Installing Rubinius gave me a bit of trouble with certain imports at first, so I thought that might be his issue.
QoQOoO has quit [Remote host closed the connection]
neoesque has quit [Quit: Bye!]
<drbrain>
it's my bedtime
<andkerosine>
I will save my other interesting question for some other time, then. : )
<andkerosine>
Rest well.
tooky has quit [Ping timeout: 260 seconds]
sora_h is now known as s0ra_h
ruurd has joined #ruby-lang
wpaulson has quit [Ping timeout: 252 seconds]
wpaulson has joined #ruby-lang
henrikhodne has joined #ruby-lang
cantonic has quit [Quit: cantonic]
joast has quit [Ping timeout: 250 seconds]
zmack has quit [Remote host closed the connection]
<ryez>
\using Ruby in data warehouse? any example?
iamjarvo has quit [Ping timeout: 255 seconds]
<ryez>
oh, I don't need an example, just want to know if there's anyone doing it with ruby
groszek has joined #ruby-lang
ruurd has joined #ruby-lang
<erikh>
zzak: you there?
<groszek>
hi. how would i go if i need to force numeric type to be UInt32? e.g. in this: http://slexy.org/raw/s21tZWWkqh i need to make sure "h" is uint32 ...
<groszek>
otherwise the results are wrong
<lianj>
you want a binary string out of it?
<groszek>
normally it returns a number in uint range
<groszek>
eg. "test" => 4282592 (this works as expected), "test test" => -1545581088 (and here i have broken result of 167600963210720)
<groszek>
its an algorithm i'm rewriting 3rd time, from python to javascript to ruby, haha.
jtoy has joined #ruby-lang
jtoy has quit [Client Quit]
verbad has joined #ruby-lang
verbad has quit [Client Quit]
Defusal_ has joined #ruby-lang
yugui is now known as yugui_zzz
verbad has joined #ruby-lang
rippa has joined #ruby-lang
Defusal has quit [Ping timeout: 260 seconds]
verbad_ has joined #ruby-lang
kitallis has joined #ruby-lang
ridders24 has joined #ruby-lang
verbad has quit [Client Quit]
<ridders24>
hey guys, im struggling with a simple script to show file size of a directory - http://pastie.org/4295085 it wont show C:'s file size and keeps seeking random files and then errors
<ridders24>
ive also tried Dir.glob, but the result =0
bglusman has quit [Remote host closed the connection]
tomb_ has joined #ruby-lang
bglusman has joined #ruby-lang
seanstickle has quit [Quit: Nihil sub sole novum]
tomb_ has quit [Client Quit]
bglusman has quit [Remote host closed the connection]
areil has quit [Remote host closed the connection]
gsav has quit [Ping timeout: 260 seconds]
Albot has joined #ruby-lang
Albot has left #ruby-lang [#ruby-lang]
<andrewvos>
ridders24: Try "C:/" ?
ruurd has quit [Quit: Leaving...]
outsmartin has joined #ruby-lang
gsav has joined #ruby-lang
Cidiomar has joined #ruby-lang
<the-newsman>
hello guys, any1 here itnersted in modules and mixins ?
lsegal has joined #ruby-lang
<the-newsman>
lsegal
<lsegal>
the-newsman
<ridders24>
andrewvos: ive tried that, still does not work
<andrewvos>
lsegal
<lsegal>
andkerosine
<lsegal>
oh damn
<andrewvos>
groszek
<lsegal>
completion fail
<lsegal>
are we playing a highlight game?
<andrewvos>
Joke ruined. I'm outta here.
<lsegal>
me too
lsegal has quit [Client Quit]
<andrewvos>
ridders24: Try Dir.glob("C:/*")
<andrewvos>
ridders24: Try Dir.glob("C:/**/*") if you want to recursively search all directories in a path.
<ridders24>
nope still does it
<andrewvos>
ridders24: Let's see your new code
<ridders24>
andrewvos: im trying to write a hostmonitor script to display available drive size on networked servers and UNC paths, is this the best aproach im trying?
<the-newsman>
andkerosine, can i private u ?
<the-newsman>
andrewvos, can i private u ?
<andrewvos>
the-newsman: No
<andrewvos>
ridders24: What about `du`?
<the-newsman>
andrewvos then can u help me in here ?
neocoin has quit [Remote host closed the connection]
cldwalker has quit [Quit: Connection closed for inactivity]
jstemmer has quit [Quit: leaving]
sora_h is now known as s0ra_h
neocoin has joined #ruby-lang
jxie has quit [Ping timeout: 264 seconds]
gsav has joined #ruby-lang
jxie has joined #ruby-lang
jxie has quit [Remote host closed the connection]
jxie has joined #ruby-lang
ryanf has joined #ruby-lang
ryanf has quit [Ping timeout: 255 seconds]
ridders24 has joined #ruby-lang
ryanf has joined #ruby-lang
kain has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
kain has joined #ruby-lang
tbuehlmann has quit []
ruurd has joined #ruby-lang
verbad has joined #ruby-lang
ryanf has quit [Quit: leaving]
ruurd has quit [Client Quit]
ThatDudeGuy_ has joined #ruby-lang
havenn has quit [Remote host closed the connection]
ridders24 has quit [Quit: Leaving]
brianpWins has quit [Ping timeout: 240 seconds]
ThatDudeGuy_ has quit [Quit: Quit]
kitallis has joined #ruby-lang
verbad has quit [Remote host closed the connection]
headius has quit [Quit: headius]
ridders24 has joined #ruby-lang
<ridders24>
how to do output my results into a html page?
seanstickle has quit [Quit: Nihil sub sole novum]
kennyvb has quit [Read error: Connection reset by peer]
kennyvb has joined #ruby-lang
<andrewvos>
ridders24: Use sinatra?
Axsuul has joined #ruby-lang
qpingu has joined #ruby-lang
Asher has joined #ruby-lang
gsav has quit [Ping timeout: 260 seconds]
mssola has quit [Quit: Konversation terminated!]
iamjarvo has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
<erikh>
zzak: ping ping
gsav has joined #ruby-lang
ridders24 has quit [Ping timeout: 248 seconds]
heftig has quit [Quit: leaving]
heftig has joined #ruby-lang
Hakon has joined #ruby-lang
<scientes>
how should I cache open-uri?
<andkerosine>
scientes: Single or repeat process?
<scientes>
andkerosine, rails 2.3 controller
<scientes>
youtube api calls
<andkerosine>
MongoDB goes very well with saving JSON for later retrieval.
<erikh>
set up a caching proxy?
<scientes>
that overkill
<andkerosine>
If you want to be able to query the JSON without making another API call, a database makes the most sense.
<andkerosine>
You could simulate one with a hash, I suppose, but that might eat memory pretty quickly depending on how much data you're grabbing.
gsav has quit [Ping timeout: 255 seconds]
bglusman has joined #ruby-lang
<scientes>
i also want second-request expiration, so when it expires it still send the stale info, but fetches the new one for the next request
<andkerosine>
Add your own fields to the results?
<scientes>
it just means it creates a thread to update the cache
headius has joined #ruby-lang
ridders24 has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
eddified has joined #ruby-lang
gsav has joined #ruby-lang
<eddified>
found this little snippet on stackoverflow: str = "String"; str.chars.sort_by(&:downcase).join
<eddified>
my question is, how does scoping work with the :downcase symbol so that it can be turned into a block? If I run this in irb, i would expect it to not work because downcase isn't a method on main. But it does work. I undertstand that '&' passes it as a block, but how does it find the correct String#downcase block to pass?
<Mon_Ouie>
:downcase is a symbol, not a method
<eddified>
right..
<eddified>
ok, so how can it be turned into a block?
<eddified>
is that what is going on? i thought the '&' means "turn this symbol into a block"
<Mon_Ouie>
some_method(&obj) passes obj as a block to some_method, calling #to_proc on obj to convert it
<eddified>
yeah....
<Mon_Ouie>
So if you want to use some_method(&:foo), since :foo is a symbol, Symbol#to_proc must be defined
<eddified>
what is this "#to_proc" you speak of? you mean, WhateverClass#to_proc ?
<Mon_Ouie>
And Symbol#to_proc is basically proc { |recv, *args, &block| recv.public_send(self, *args, &block) }
<eddified>
k, parsing
<eddified>
..
<eddified>
thx
<eddified>
neat.
<eddified>
thanks
voker57 has quit [Read error: Connection reset by peer]
imajes has quit [Excess Flood]
andkerosine has left #ruby-lang [#ruby-lang]
imajes has joined #ruby-lang
brianpWins has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
bglusman has quit [Ping timeout: 248 seconds]
gsav has quit [Read error: Connection reset by peer]
andrewhl has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
ridders24 has quit [Quit: Leaving]
gsav has joined #ruby-lang
ruurd has joined #ruby-lang
headius has quit [Quit: headius]
rippa has quit [Ping timeout: 248 seconds]
iamjarvo has quit [Quit: Computer has gone to sleep.]
iamjarvo has joined #ruby-lang
deryl has quit [Quit: Time To Go, Too Bad, So Sad!]
igotnolegs has joined #ruby-lang
deryl has joined #ruby-lang
lele has joined #ruby-lang
jackhammer2022 has quit [Read error: Connection reset by peer]
the-newsman has quit [Ping timeout: 245 seconds]
wpaulson has joined #ruby-lang
kennyvb has left #ruby-lang [#ruby-lang]
coryf has joined #ruby-lang
lbrent has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby-lang
s0ra_h is now known as sora_h
iamjarvo has quit [Quit: Computer has gone to sleep.]