<sandbags>
randym: hi there, you must have eyes like a hawk
<zenspider>
rawr
dhruvasagar has joined #ruby-lang
<yorickpeterse>
Morning
<randym>
nah, just lucky
<sandbags>
randym: thanks for getting back to me
<randym>
sandbags: no worries. What can I do for you?
<sandbags>
i was having an issue with putting images into a spreadsheet, never having looked at VBA before (and by god!!!) but I did finally manage to get it to work modulo
<sandbags>
the fact that it only links them, it doesn't embed them
<sandbags>
i was looking at maybe using your lib to generate me the spreadsheet
<sandbags>
since it seemed a good deal easier than figuring out excel macros
<whitequark>
and it will block really hard if something is not responding
<davidw>
whitequark, we're not terribly happy with it, but it's up in production... we'd need to rewrite to utilize something else to write to s3 directly
<whitequark>
davidw: exactly
<whitequark>
see, if you lose connectivity, your app will block forever. you couldn't even kill it with SIGKILL
<whitequark>
because SIGKILL does not interrupt I/O
<whitequark>
this is why you don't use s3fs/sshfs/whatever
Averna has quit [Quit: Leaving.]
<whitequark>
POSIX filesystem abstraction just isn't suited for network operations.
<davidw>
whitequark, it has actually worked fairly well so far, all things considered
<davidw>
but yeah, we're coming to the conclusion that it's time to replace it
nitti has quit [Ping timeout: 244 seconds]
<whitequark>
davidw: depends on your location
<whitequark>
moscow, for example, has very bad connectivity with s3 for some reason. you won't have any luck putting anything over 200mb
<whitequark>
and even with that, 1/10 operations will ECONNRESET
<davidw>
it's an EC2 instance
<davidw>
so it's pretty close
<zenspider>
rawr
<whitequark>
should be fine then, yeah
<whitequark>
zenspider: are you a lion?
banisterfiend has joined #ruby-lang
<zenspider>
something like that
justinseiter has quit [Remote host closed the connection]
<zenspider>
making good progress on ruby_parser.
<whitequark>
good to know!
<whitequark>
I've already modified my infrastructure to work with both melbourne and RP, btw.
areil has quit [Ping timeout: 244 seconds]
<soahccc>
What will happen if I extend a module via Module.send(:extend, OtherModule) to classes already included or extended it?
<zenspider>
how you call something doesn't change what it does
<zenspider>
and you can answer that question very easily in about 10 lines of example code
<banisterfiend>
zenspider: what's up
<zenspider>
not much... just overhauling ruby_parser
<zenspider>
trying to get to beta
<zenspider>
and I think this was the last big change for it
<zenspider>
odd... DNS... my network is totally toast, but irc keeps going. *shrug*
<zenspider>
just did about 1800 lines o' diff and made things a lot cleaner and more covered
<clocKwize>
if its your dns then existing connections and cached dns entries are fine?
<clocKwize>
inc irc..
<zenspider>
assuming that's all it is... sure
<banisterfiend>
zenspider: nice, i'm using ruby_parser to find me method definitions, but is there a way to get the corresponding line number in the file where the method definition appears?
<zenspider>
just ask the sexp for the line
<soahccc>
zenspider: My conclusion of my testing is that you can't inject functionality to modules just directly override it (if you mentioned me)
<whitequark>
zenspider: I guess you've meant "idempotent"
<banisterfiend>
zenspider: awesome! is it pretty reliable on 1.9 code now?
<zenspider>
banisterfiend: its... alpha... soooo... no
<zenspider>
whitequark: ??
Mon_Ouie has joined #ruby-lang
justinmcp has joined #ruby-lang
<banisterfiend>
Mon_Ouie: 'alut
<Mon_Ouie>
'alut
<zenspider>
you ppl talk funny... speak ruby like god intended
<injekt>
heh
<whitequark>
zenspider: #extend and #include are idempotent
<zenspider>
what does that have to do with anything? also, not really... #included/#extended is triggered so extra side effects are possible... tho I have yet to abuse that.
<zenspider>
OOOH. no. I was commenting on using #send vs calling directly not changing how a method works.
vlad_starkov has joined #ruby-lang
earthquake has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 244 seconds]
postmodern has quit [Quit: Leaving]
nitti has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
nitti has quit [Ping timeout: 244 seconds]
banisterfiend has quit [Remote host closed the connection]
karel has joined #ruby-lang
karel is now known as Guest62844
cultureulterior_ has joined #ruby-lang
therod has quit [Quit: Leaving...]
cultureulterior has quit [Ping timeout: 244 seconds]
futurechimp has quit [Quit: Leaving]
Guest62844 has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/2012101000]]
postmodern has joined #ruby-lang
postmodern has quit [Quit: Leaving]
karel_ has joined #ruby-lang
<whitequark>
zenspider: Idempotence ( /ˌaɪdɨmˈpoʊtəns/ eye-dəm-poh-təns) is the property of certain operations in mathematics and computer science, that they can be applied multiple times without changing the result beyond the initial application.
Assurbanipal has quit [Quit: Konversation terminated!]
<whitequark>
except for the fact that #include mutates the class, it adheres to this definition. and the definition does not cover mutation.
<whitequark>
that is, the callbacks are triggered once, just like the mutation of ancestrance chain itself
<whitequark>
oh, disregard what I said, they are not.
<whitequark>
through I have no idea who would actually want that.
carloslopes has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
karel_ has quit [Quit: Konversation terminated!]
karel_ has joined #ruby-lang
<zenspider>
I know what the fucking word means...
therod has joined #ruby-lang
<zenspider>
and it is again irrelevant to anything previously mentioned above
<zenspider>
btw... I just closed several of your tickets on ruby_parser...
<zenspider>
aaand it is 5am... laters
tsou has quit [Quit: leaving]
<zenspider>
ruby_parser 3.0.0.a10 released
<andrewvos>
Umm, the heroku gem is now deprecated?
<andrewvos>
And I have to install a .pkg :/
therod has quit [Ping timeout: 264 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
justinram has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
<zenspider>
ok. sleep. for reals
fsvehla has joined #ruby-lang
fsvehla has quit [Client Quit]
justinmcp has joined #ruby-lang
nitti has joined #ruby-lang
benanne has joined #ruby-lang
<andrewvos>
Is mperham in here?
nitti has quit [Ping timeout: 244 seconds]
mwjcomputing has joined #ruby-lang
robotmay has quit [Ping timeout: 244 seconds]
gix has quit [Ping timeout: 256 seconds]
robotmay has joined #ruby-lang
lemon__ has joined #ruby-lang
lemon__ has quit [Client Quit]
gix has joined #ruby-lang
chrismcg is now known as zz_chrismcg
richo has joined #ruby-lang
therod has joined #ruby-lang
<richo>
keys = rb_funcall(_envp, rb_intern("keys"), 0); # This returns an RArray of the values in my hash.. am I doing soemthing stupid? As a secondary question, is there a better way to get all the keys in a hash?
justinmcp has quit [Ping timeout: 245 seconds]
codefyre has joined #ruby-lang
Bwild has quit [Ping timeout: 268 seconds]
therod has quit [Ping timeout: 255 seconds]
codefyre has quit [Quit: Leaving]
justinmcp has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 244 seconds]
shtirlic has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
justinmcp has quit [Ping timeout: 244 seconds]
voker57 has quit [Ping timeout: 252 seconds]
Uranio has joined #ruby-lang
mistym has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
charliesome has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
justinmcp has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
cantonic_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mistym has quit [Remote host closed the connection]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
robotmay_ has joined #ruby-lang
Bwild has joined #ruby-lang
slyphon has joined #ruby-lang
robotmay has quit [Ping timeout: 240 seconds]
lun_ has quit [Remote host closed the connection]
ruurd has quit [Quit: Leaving...]
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<totallymike>
It's basically about how to use singleton objects as immutable constant objects when you don't need state, and Avdi demonstrates it in the context of a short Conway's Game of Life simulator.
<totallymike>
Avdi Grimm is an excellent dude; his work is worth supporting.
karel_ has quit [Client Quit]
blazes816 has quit [Quit: blazes816]
karel_ has joined #ruby-lang
clocKwize has quit [Remote host closed the connection]
ddfreyne has quit [Excess Flood]
krohrbaugh has quit [Quit: Leaving.]
ddfreyne has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
apeiros_ has quit [Remote host closed the connection]
<manveru>
heh, i know him
lun_ has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 255 seconds]
senekis has joined #ruby-lang
<manveru>
oh well, that was a waste of time :(
sepp2k has quit [Read error: Connection reset by peer]
<manveru>
and he didn't even show singleton.rb
<injekt>
I assumed that was the point behind it, too
lun_ has joined #ruby-lang
<manveru>
or module_function
cschwartz has quit [Ping timeout: 276 seconds]
<totallymike>
I thought it was pretty good
<totallymike>
it's a four minute video, and it expresses its message clearly
dhruvasagar has quit [Ping timeout: 260 seconds]
<totallymike>
It's not about preventing multiple objects of a class from being created, it's about using a singleton as a sort of value, like true or false or nil
<manveru>
totallymike: don't get me wrong, i think it's good, just not interesting if you've done ruby a lot :)
<totallymike>
Fair. I've only been doing Ruby for a few months, and I'm still absorbing as much as I can about Ruby OO best practices, so I'm into things like RubyTapas and DestroyAllSoftware and such
<manveru>
my idiom for that would be: alive = Object.new{ def x; end }.new
<manveru>
sorry, .new too much
cultureulterior_ has quit [Quit: cultureulterior_]
<totallymike>
That's how he starts off in the video, isn't it?
cultureulterior has quit [Ping timeout: 245 seconds]
mikeneedshelp has joined #ruby-lang
<totallymike>
if my understanding is correct (often it isn't)
jarib has quit [Excess Flood]
carloslopes has joined #ruby-lang
rdavila has joined #ruby-lang
jarib has joined #ruby-lang
<totallymike>
As opposed to, say, a singleton that is stateful where it's a singleton because there MUST be only one of them, in which case if you go and force another to exist, you're introducing bugs
rue|w has joined #ruby-lang
anachronistic has joined #ruby-lang
<akahn>
where should I look for mkmf.log when compiling native extensions fails? mkmf.log
rue|w has quit [Ping timeout: 260 seconds]
<manveru>
find . -name mkmf.log
<darix>
manveru: i bet he forgot to mention "while installing a gem"
<darix>
so it is: calling "gem env" -> take gem paths -> look into $(gempath)/gems/gemname-version/ext/
<darix>
something like that
carloslopes has quit [Ping timeout: 252 seconds]
enebo has joined #ruby-lang
<akahn>
thanks
senekis has joined #ruby-lang
<akahn>
apparently this server doesn't have `patch`. d'oh
robotmay has quit [Remote host closed the connection]
zomgbie has joined #ruby-lang
nignaztic has joined #ruby-lang
dfanjul has joined #ruby-lang
areil has joined #ruby-lang
nazty has quit [Ping timeout: 256 seconds]
romeroabelleira has joined #ruby-lang
zomgbie has quit [Ping timeout: 240 seconds]
<darix>
why would a gem call "patch"?
<darix>
o.O
therod has quit [Quit: Leaving...]
alvaro_o has joined #ruby-lang
gsav has joined #ruby-lang
cultureulterior has joined #ruby-lang
cultureulterior has quit [Client Quit]
ruskie has quit [Excess Flood]
gsav has quit [Read error: Connection reset by peer]
cultureulterior has joined #ruby-lang
fsvehla has joined #ruby-lang
Uranio has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
shtirlic has quit [Remote host closed the connection]
cultureulterior_ has joined #ruby-lang
thatdutchguy has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
cultureulterior has quit [Ping timeout: 245 seconds]
romeroabelleira has quit [Remote host closed the connection]
ruskie has joined #ruby-lang
zomgbie has joined #ruby-lang
sush24 has joined #ruby-lang
VGoff is now known as VGoff_afk
fsvehla has quit [Quit: fsvehla]
dfanjul has quit [Ping timeout: 264 seconds]
th_ has left #ruby-lang [#ruby-lang]
<Uranio>
if exist JRuby, I guest that cuold be a ruby for cellphones
wallerdev has joined #ruby-lang
krohrbaugh has joined #ruby-lang
havenn has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby-lang
nitti has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
nitti has joined #ruby-lang
irleif has joined #ruby-lang
goshakkk has joined #ruby-lang
runeb has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
Taranis has left #ruby-lang [#ruby-lang]
ryanlecompte has joined #ruby-lang
ruskie has quit [Excess Flood]
havenn_ has joined #ruby-lang
blazes816 has joined #ruby-lang
adambeynon has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
roadt` has quit [Ping timeout: 244 seconds]
<whitequark>
Uranio: ruboto
<Uranio>
humm.. android only.. well.. is something at less
<whitequark>
j2me is too constrained anyway
<whitequark>
not that anyone still uses it.
TheMoonMaster has quit [Ping timeout: 245 seconds]
<Uranio>
whitequark: and ruboto is writed on j2me?
amirinat_ has joined #ruby-lang
amirinator has quit [Ping timeout: 272 seconds]
apeiros_ has quit [Remote host closed the connection]
rhizmoe has joined #ruby-lang
nignaztic has quit [Read error: Operation timed out]
TheMoonMaster has joined #ruby-lang
toertore has joined #ruby-lang
jxie has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
savage- has joined #ruby-lang
mbr has quit [Read error: Operation timed out]
x0F_ is now known as x0F
mbr has joined #ruby-lang
toretore has quit [Ping timeout: 256 seconds]
dRbiG has quit [Ping timeout: 256 seconds]
ryanlecompte has quit [Read error: Operation timed out]
dRbiG has joined #ruby-lang
apeiros_ has joined #ruby-lang
adityamenon has joined #ruby-lang
adityamenon has left #ruby-lang [#ruby-lang]
ruby-lang234 has joined #ruby-lang
nazty has joined #ruby-lang
ruskie has joined #ruby-lang
rdavila has quit [Quit: rdavila]
wiremaster has joined #ruby-lang
<wiremaster>
hello everyone
<wiremaster>
I am just getting started with RoR, and I am going to install Ruby on my Debian Squeeze
<wiremaster>
I read on S.Overflow that installing via Debian's packages is obsolete
Serial_Killer_C has quit [Remote host closed the connection]
<wiremaster>
but apparently ruby 1.9.3 is available from aptitude
<wiremaster>
that appears to be the most recent version, can I just use that?
ruby-lang234 has quit [Ping timeout: 245 seconds]
<zzak>
wiremaster: i would say rvm is probably the easiest way to avoid any problems, http://rvm.io also the people in #rvm on freenode are very helpful
<wiremaster>
okay, thanks zzak, I'll use rvm
Serial_Killer_C has joined #ruby-lang
__butch__ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
runeb has joined #ruby-lang
thinkdevcode has joined #ruby-lang
davidw has quit [Read error: Operation timed out]
__butch__ has quit [Client Quit]
<matti>
Hey zzak
<apeiros_>
wiremaster: I wouldn't wonder if aptitude still had 1.9.3-p0 which is already a year old already. I wouldn't wonder either if they stayed on it for another 2 years… iow: apts track record wrt ruby is rather horrible
gearaholic has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
<wiremaster>
ohkay
irleif has quit [Quit: Computer has gone to sleep.]
carloslopes has joined #ruby-lang
<wiremaster>
...why are Ruby version numbers so small, when actually large parts of the language change, apparently?
runeb has quit [Ping timeout: 240 seconds]
sailias has quit [Quit: Leaving.]
<wiremaster>
ten years old... and only 1.9.3? I'm merely curious, no negative vibes at all
<wmoxam>
ten years old?
<wmoxam>
1.0 was released in 1996 ;)
benanne has quit [Quit: kbai]
<wiremaster>
ah, sorry, should have read the wiki, says Ruby appeared in 1995
<apeiros_>
wiremaster: matz did a good job with the first version
<apeiros_>
there aren't too many changes on the syntax or other core mechanics
<ddfreyne>
yeah, considering language design is quite hard :)
mrsolo has joined #ruby-lang
<wiremaster>
okay, so it has remained stable... I guess I should get competent enough to read the changelogs in order to understand what really changed..
__butch__ has joined #ruby-lang
gsav has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
<wiremaster>
that was pretty simple, one command to install ruby
<wiremaster>
thanks rvm
icooba has quit [Quit: Computer has gone to sleep.]
gsav has quit [Client Quit]
karel_ has quit [Quit: Konversation terminated!]
areil has quit [Remote host closed the connection]
rippa has joined #ruby-lang
robotmay has joined #ruby-lang
codefyre has joined #ruby-lang
richo has joined #ruby-lang
gokul has joined #ruby-lang
<richo>
Is it normal to expect sigprocmask to not do anything inside a ruby process, even though there are no references to it in the source?
gsav has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
workmad3 has quit [Ping timeout: 264 seconds]
codefyre has quit [Quit: Leaving]
goshakkk has quit [Quit: Computer has gone to sleep.]
robotmay has quit [Remote host closed the connection]
havenn_ has quit [Remote host closed the connection]
Oloryn_lt2 has joined #ruby-lang
goshakkk has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
Mon_Ouie has quit [Ping timeout: 244 seconds]
zeedre has joined #ruby-lang
geopet has joined #ruby-lang
zeedre has quit [Client Quit]
wiremaster has left #ruby-lang ["Leaving"]
zeedre has joined #ruby-lang
mistym is now known as mistym_lunch
gearaholic has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
<zeedre>
Total neeb here. Can someone tell me what I'm doing wrong here : http://pastie.org/5119911. Should take about 2 seconds.
khaase has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby-lang
khaase has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 255 seconds]
sailias has joined #ruby-lang
<richo>
you're setting an instance variable in the class
<richo>
which is almost certainly not what you want
<richo>
if you want to set a variable in all isntances, it should def initialize; @v = "Thing"; end
<richo>
also, you're interpolatingn the symbol itself when you probably want the variable
<zeedre>
o, its cause I'm not in the initialize method??
<zeedre>
flagelating now. yup, I should have h not :here. ok.
chimkan has quit [Quit: chimkan]
<zeedre>
tks richo
<richo>
np
<zeedre>
ok, for the real thing. in rails. I want an applicaiton wide variable sensitive to dev/prod/test. I found config/environments/development.db. I added config.test = "hi" but I can't seem to figure out how to access it in a controller. Any tips?
<steveklabnik>
zeedre: that's not how you do that. make a constant in an initializer
<steveklabnik>
initailzers don't take env into account, i missed that part of your sentence
<steveklabnik>
config.* is a way to configure componenets of rails
<steveklabnik>
not configure your app itself
<zeedre>
rereading it too. yup. i see that now how its for the built in stuff.
<apeiros_>
hello mr. retwitter :-)
Axsuul has joined #ruby-lang
<gokul>
Hello, I am new to ruby, read first few chapters of pickaxe book. Can somebody suggest an app i should be programming now ?
thinkdevcode has quit [Remote host closed the connection]
<zeedre>
Hmm, so is there no easy way to do config based on env without switches or ifs?
fsvehla has joined #ruby-lang
<steveklabnik>
zeedre: just define a constant in the environmen files
<steveklabnik>
add FOO=whatever to config/environments/development.rb
<steveklabnik>
add FOO=whatever2 to config/environments/test.rb
<steveklabnik>
done
cultureulterior_ has quit [Quit: cultureulterior_]
ddd has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
<zeedre>
constants are just so. . . inflexible. If I were to try to mimick the structure in there for my task by writing config.test. How would I acccess it in a controller?
<steveklabnik>
ha
<steveklabnik>
constants are totally flexible in ruby
<steveklabnik>
;)
<apeiros_>
sadly
joast has quit [Ping timeout: 260 seconds]
* apeiros_
still thinks that warning should be replaced with an exception being raised
<steveklabnik>
meh
<steveklabnik>
it is useful at times
<apeiros_>
you still have const_set
<apeiros_>
if you really really want to
<apeiros_>
but my experience with warnings is - nobody reads them.
<steveklabnik>
we're actively removing warnings in rails
<steveklabnik>
actually
<steveklabnik>
anyway, zeedre, these questions are better asked in #rubyonrails
* zzak
digs up an old commit
<zeedre>
haha. yup. im a total newb. Hmm. thats interesting. aha, another chat. Ill go there. Any quick answer to using the conf.test var in a controller?
nitti has quit [Remote host closed the connection]
<zzak>
const_set is the shit
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
thinkdevcode has joined #ruby-lang
Bwild has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby-lang
gokul has quit [Quit: Leaving]
voker57 has quit [Read error: Connection reset by peer]
chimkan_ has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
chimkan_ has quit [Quit: chimkan_]
scampbell has joined #ruby-lang
runeb has joined #ruby-lang
mistym_lunch is now known as mistym
amirinat_ has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby-lang
amirinator has joined #ruby-lang
_Mon_Ouie_ has left #ruby-lang [#ruby-lang]
Mon_Ouie has joined #ruby-lang
mattsgarrison has quit [Remote host closed the connection]
shtirlic has joined #ruby-lang
headius has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
amirinat_ has joined #ruby-lang
amirinator has quit [Ping timeout: 240 seconds]
chimkan has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 252 seconds]
filipechagas has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ivanoats has joined #ruby-lang
filipechagas has quit [Remote host closed the connection]
ivanoats has quit [Remote host closed the connection]
filipechagas has joined #ruby-lang
bluepojo has joined #ruby-lang
runeb has quit [Remote host closed the connection]
nitti has joined #ruby-lang
burgestrand has joined #ruby-lang
freedrull has joined #ruby-lang
davidw has joined #ruby-lang
Bwild has joined #ruby-lang
davidw is now known as Guest22795
Guest22795 has left #ruby-lang [#ruby-lang]
intellitech has quit [Quit: Leaving]
dhruvasagar has quit [Ping timeout: 272 seconds]
<pdm>
I was thinking about subclassing OpenStruct so that any updates to the structure would auto save out to a yaml file (ala yaml/store, but easier), how would you detect though if any of the stores objects, be it hashes, arrays, strings, were updated though? since OpenStruct itself wouldn't receive the push or == method calls
ridders24 has joined #ruby-lang
bluepojo has quit [Quit: Leaving.]
<Mon_Ouie>
I wouldn't. I would call a #save method manually or I would modify the record object, not by mutating its attributes, but by calling methods on the record directly.
filipechagas has quit [Quit: Leaving]
runeb has joined #ruby-lang
<Mon_Ouie>
i.e. use foo.push_value over foo.values.push
dhruvasagar has joined #ruby-lang
<pdm>
I like the #save idea
lcdhoffman has joined #ruby-lang
<pdm>
that still provides simpler interface than yaml/store provides
mwjcomputing has quit [Quit: Leaving]
bluepojo has joined #ruby-lang
nitti has quit [Ping timeout: 252 seconds]
enebo has quit [Quit: enebo]
lcdhoffman has quit [Quit: lcdhoffman]
nitti has joined #ruby-lang
nitti_ has joined #ruby-lang
ddd has quit [Remote host closed the connection]
nitti has quit [Ping timeout: 245 seconds]
ddd has joined #ruby-lang
joast has joined #ruby-lang
nitti_ has quit [Remote host closed the connection]
nitti_ has joined #ruby-lang
headius has quit [Quit: headius]
<ridders24>
when using json parse, how do I specify what I want to extract from the data?
enebo has joined #ruby-lang
sepp2k has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Kingy has joined #ruby-lang
runeb has joined #ruby-lang
CaptainJet has joined #ruby-lang
spinagon has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
nitti has joined #ruby-lang
runeb has quit [Remote host closed the connection]
tsou has joined #ruby-lang
Taranis has joined #ruby-lang
nitti_ has quit [Ping timeout: 245 seconds]
Taranis has left #ruby-lang [#ruby-lang]
nitti_ has joined #ruby-lang
<apeiros_>
ridders24: JSON parse doesn't extract. it parses. it'll parse the whole string you give it.
nitti__ has joined #ruby-lang
nitti__ has quit [Remote host closed the connection]
nitti__ has joined #ruby-lang
spinagon has quit [Ping timeout: 260 seconds]
<ridders24>
apeiros: my script currently outputs a webpage, I want to parse the data to find specific info, and then just output that instead. Thats what I was trying to say
<ridders24>
new to parsing, still trying to get to grips with it
<apeiros_>
ridders24: well, after you parsed it, you can do whatever you want with the data you get back
<apeiros_>
you get back ordinary ruby objects
nitti has quit [Ping timeout: 252 seconds]
nitti_ has quit [Ping timeout: 240 seconds]
<ridders24>
apeiros: heres the bit of data in interested in ,"id_str":"225226860248842240","text, but all i want in the numeric value as that changes. but the info by its side, helps find the value in the overall data
<ridders24>
how do i tell ruby that
<apeiros_>
ridders24: yeah, without any context, no way to tell
<apeiros_>
you can't just grab a small bit out of context and expect people to magically know the context themselves…
<mistym>
ridders24: The JSON gets you arrays and hashes. Do you know how to access content from those?
<ridders24>
mistym: hi im trying to progress further on from last time, so still have the code you helped me with. currently im able to get an output using json.parse
<ridders24>
sorry if i struggle to understand this guys
<mistym>
ridders24: Are you familiar with how to get content that's in an array or a hahs?
<mistym>
*hash
<ridders24>
no
<ridders24>
im stuck on that
runeb has joined #ruby-lang
<mistym>
OK. Well, that's a pretty common feature in ruby (and other programming languages). Something you'll use a lot.
sandbags has quit [Remote host closed the connection]
verbad has joined #ruby-lang
verbad has quit [Client Quit]
runeb has quit [Remote host closed the connection]
anachronistic has quit [Quit: anachronistic]
justinmcp has joined #ruby-lang
justinram has joined #ruby-lang
<mistym>
ridders24: I'd recommend reading up on a good introductory ruby book - it'll give you a lot of the tools you'll use regularly for stuff like this.
<ridders24>
mistym: thanks I will do this, but I also like to learn by trial and error. I appear to getting an error of unexpected token: http://pastie.org/5120656
amirinat_ has quit [Remote host closed the connection]
<mistym>
ridders24: JSON.parse takes data which has been serialized in JSON format and turns it into ruby objects. "id_str" is not JSON.
<apeiros_>
what's up today with people giving like no information at all and expecting help
dabradley has quit [Ping timeout: 245 seconds]
<apeiros_>
ridders24: if you have an error, and you want help, *PASTE THE DAMN ERROR*
<mistym>
You want to parse the Twitter API response first, and then access content from that.
<apeiros_>
srsly, isn't that self evident?
verbad has joined #ruby-lang
<apeiros_>
also, ID is a constant. use id instead, that's a local variable (first letter being uppercase means the variable is a constant)
verbad has left #ruby-lang [#ruby-lang]
<ridders24>
ok ta
icooba has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
sailias has quit [Quit: Leaving.]
carloslopes has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
runeb has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
scampbell has quit [Quit: Ex-Chat]
<mistym>
I'm making an ffi extension which translates bitmasks into named options. Which is less icky, returning a boolean hash {:foo => true, :bar => false}, or an array of present options [:foo]?
goshakkk has quit [Quit: Computer has gone to sleep.]
<drbrain>
the Hash is a better conceptual mapping
<mistym>
Good, that was my first instinct. I'll keep that.
<drbrain>
bit flags don't have an implied order
<mistym>
True.
krz has quit [Quit: krz]
<mistym>
Thanks!
<mistym>
Now to see if I can write a finalizer for this object-oriented wrapper that doesn't have unexpected bugs. Yay!
therod has joined #ruby-lang
runeb has quit [Ping timeout: 252 seconds]
justinmcp has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #ruby-lang
<mistym>
I don't suppose there's a decent way to a) test the finalizer does what it's supposed to, and b) actually works, is there? a) I can do by calling the class method on its own, but I'm not so sure about b)
ridders24 has quit [Read error: Connection reset by peer]
ridders24 has joined #ruby-lang
Schafro has joined #ruby-lang
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Carnage\ has quit []
swarley has joined #ruby-lang
Kingy has quit [Quit: Leaving]
headius has joined #ruby-lang
<whitequark>
mistym: but why are you writing an ffi ext for that?
<whitequark>
as per finalizers, GC.start should work on MRI.
<drbrain>
last I checked, GC.start wouldn't necessarily run finalizers
<mistym>
whitequark: That's tangential, sorry. The ffi ext isn't the part with the finalizer.
<mistym>
I wrote the ffi ext to help with part of a C lib wrapper. (I'm probably going to extract it from my main code.)
perryh has quit [Excess Flood]
<mistym>
The finalizer's for the high-level API based on the C lib, since FFI pointers have to be explicitly freed by whatever interface the C library provides.
<mistym>
They won't be freed by MRI GC.
icooba has quit [Quit: Computer has gone to sleep.]
<mistym>
</tl;dr>
Schafro has quit [Quit: Leaving]
perryh has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
jarib has quit [Excess Flood]
Schafro has joined #ruby-lang
jarib has joined #ruby-lang
therod has quit [Quit: Leaving...]
geopet is now known as geopet_
<apeiros_>
d'aw, föck, I lost my js benchmark :(
geopet_ is now known as geopet
<apeiros_>
(or it's on my work laptop which is - accidentally - at work…)
swarley has quit [Ping timeout: 240 seconds]
<TTilus>
you accidentally have tools at work to do your work? :)
<apeiros_>
accidentally, yes
<apeiros_>
I'm at home now
<TTilus>
i gather
<apeiros_>
well, hardest part was rolling stddev, but I think if I got that right once, I'll get it right again :)
geopet has left #ruby-lang [#ruby-lang]
<TTilus>
math is nice
<TTilus>
floating point arithmetics make things ugly
shtirlic has quit [Remote host closed the connection]
<apeiros_>
yeah, but this doesn't need to be very precise
<apeiros_>
I just try to avoid imprecision by going to very high numbers, thus rolling stddev
<TTilus>
getting something right the second time is usually way faster
<apeiros_>
not if you're watching sc2 at the same time :-D
geopet has joined #ruby-lang
<TTilus>
yes, avoiding sums of numers of very different scale (say summing up shitload of small numbers) helps alot
<TTilus>
sc2 might slow things down abit :)
<mistym>
So, my `rake test` task is aborting mysteriously. I take it my finalizer isn't working.
thinkdevcode has quit [Remote host closed the connection]
runeb has joined #ruby-lang
enebo has quit [Ping timeout: 246 seconds]
<drbrain>
mistym: when I try to run the tests I get "cannot load such file -- exempi/namespaces (LoadError)"
Dreamer3 has joined #ruby-lang
<mistym>
drbrain: Oh, right. It depends on another gem - https://github.com/mistydemeo/exempi (low-level wrapper) and a C library, also named exempi. Sorry.
slyphon has joined #ruby-lang
<drbrain>
mistym: I don't see a before { } in test/fasttrack_test.rb, though
chimkan has quit [Quit: chimkan]
<mistym>
drbrain: That only has one test. The bulk are in file_test.rb and xmp_test.rb, which do have before { }
<drbrain>
ok
bluepojo has quit [Remote host closed the connection]
runeb has quit [Ping timeout: 255 seconds]
<drbrain>
too many rabbit holes for me, there's now exempi in brew ☹
<mistym>
Sure there is ;) When was the last time you brew updated?
<mistym>
Anyway, yeah. Too many deps to be convenient. Sorry!
<drbrain>
two weeks ago, probably
<drbrain>
ugh, I don't have the bandwidth to download boost, it's crawling ☹
* jaimef
hunts for a shorter way to pull the first letter off a string instead of "string".split('')[0]
<CaptainJet>
you could always try, you know... "string"[0]
<mistym>
boost :( I like how even when you're getting a binary it can take forever, much less building from source.
macmartine has quit [Quit: Computer has gone to sleep.]
<drbrain>
mistym: sorry, I can't try running it ☹
<mistym>
No worries, thanks for trying!
<mistym>
Boost! (╯°□°)╯︵ ┻━┻
<drbrain>
mistym: if your tests are just aborting, though, it makes me think the problem is deeper
<drbrain>
minitest tries hard to return useful information
<mistym>
drbrain: Yeah. I suspect this isn't a new problem so much as exposing a problem that was already there.
<mistym>
Is there anything that *looks* bad in my tests?
CaptainJet has quit []
justinmcp has quit [Remote host closed the connection]
<drbrain>
I don't see anything unusual
Oloryn_lt2 has joined #ruby-lang
ridders24 has quit [Quit: Leaving]
Serial_Killer_C has quit [Remote host closed the connection]
Sundown has joined #ruby-lang
<mistym>
That's good, anyway. Thanks.
outoftime has quit [Quit: Leaving]
Kingy has joined #ruby-lang
mistym has quit [Remote host closed the connection]
Sundown has quit [Quit: leaving]
blacktulip has quit [Remote host closed the connection]
slyphon has quit [Ping timeout: 245 seconds]
mikeneedshelp has quit [Ping timeout: 248 seconds]
Sundown has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
gsav_ has joined #ruby-lang
Sundown has quit [Client Quit]
Sundown has joined #ruby-lang
Sundown has quit [Client Quit]
gsav has quit [Ping timeout: 255 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
Sundown has joined #ruby-lang
gsav_ has quit [Ping timeout: 268 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
bluepojo has joined #ruby-lang
Sundown has quit [Quit: leaving]
geopet has left #ruby-lang [#ruby-lang]
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
mistym has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
toertore has quit [Quit: Leaving]
Mon_Ouie has quit [Ping timeout: 240 seconds]
enebo has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
slyphon has joined #ruby-lang
perryh has quit [Excess Flood]
davidbalbert is now known as davidbalbert_awa
perryh has joined #ruby-lang
davidbalbert_awa is now known as davidbalber_away
davidbalber_away is now known as davidbalber|away
alvaro_o has quit [Quit: Ex-Chat]
davidbalber|away is now known as davidbalbert
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
m3nd3s has joined #ruby-lang
alvaro_o has joined #ruby-lang
crunk has joined #ruby-lang
crunk has quit [Remote host closed the connection]
crunk has joined #ruby-lang
crunk has quit [Remote host closed the connection]
crunk has joined #ruby-lang
Nisstyre-laptop has quit [Read error: Operation timed out]
sailias has joined #ruby-lang
GarethAdams has joined #ruby-lang
crunk has quit [Client Quit]
crunk has joined #ruby-lang
ChadStudmuffin has quit [Ping timeout: 245 seconds]