<rue>
It's like LOGO, but the turtles go all the way down
<seanstickle>
I've never seen the appeal of graphical programming
<petercooper>
Yahoo Pipe was the closest I got to grokking it but even that turned out to be a hideous mess
<seanstickle>
And the absence of any graphic programming to make a dent in the market doesn't help matters
<petercooper>
Pipes, even.
<rue>
seanstickle: It's because you're a programmer
<seanstickle>
rue: huh?
<rue>
You'd find graphical programming appealing were you not a programmer.
<seanstickle>
rue: what makes you think that?
erpuds has joined #ruby-lang
havenn has joined #ruby-lang
shajith has joined #ruby-lang
looopy has joined #ruby-lang
znouza has joined #ruby-lang
<cirwin>
composability is lacking in a graphical UI
<cirwin>
but I do see the appeal of graphical programming
darkf has joined #ruby-lang
<petercooper>
I guess I see it as being more along the lines of a DSL rather than a whole new way to achieve the same ends as regular programming.
xjiujiu has joined #ruby-lang
<petercooper>
These folks seem to be pushing it as a way to interact with robots, home automation, and similar stuff. Could be ideal for a certain level of user in those fields.
<petercooper>
But for building a complete web app? I think I'd freak out ;-)
<seanstickle>
I suppose, in the same way you can do basic calculus by drawing.
<seanstickle>
But beyond a certain point, that doesn't work.
<petercooper>
Yeah
<seanstickle>
Take it from the guy who learned calculus by drawing pictures for a year.
<petercooper>
That said, I'm definitely all for more visualizations in development, just not as the input mechanism.
<dean_m>
But here I should only get 2.3.6 and not any other details
<dean_m>
where c = Mozilla/5.0 (Linux; U; Android 2.3.6; fr-fr; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
DRCALKIN has joined #ruby-lang
x0F__ has joined #ruby-lang
<Asher>
anyone know how to set sort order on Btree for Kyoto Cabinet?
<Asher>
or where docs correspond to sort order
rippa has joined #ruby-lang
havenn has joined #ruby-lang
tomzx has joined #ruby-lang
thone has joined #ruby-lang
csherin has joined #ruby-lang
artOfWar has joined #ruby-lang
xaio has joined #ruby-lang
zmack has joined #ruby-lang
gianlucadv has joined #ruby-lang
urbanmonk has joined #ruby-lang
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
srbartlett has joined #ruby-lang
banisterfiend has joined #ruby-lang
havenn has joined #ruby-lang
fragmachine has joined #ruby-lang
<fragmachine>
anyone know if gem comes installed by default on mac lion?
Gekz has joined #ruby-lang
Gekz has joined #ruby-lang
solars has joined #ruby-lang
kaiwren has joined #ruby-lang
chimkan has joined #ruby-lang
jredvill` has joined #ruby-lang
Banistertab has joined #ruby-lang
sat00 has joined #ruby-lang
rpall has joined #ruby-lang
carlosed has joined #ruby-lang
krz has joined #ruby-lang
gjaldon has joined #ruby-lang
Taranis has joined #ruby-lang
isale-eko has joined #ruby-lang
looopy has joined #ruby-lang
tbuehlmann has joined #ruby-lang
sat has joined #ruby-lang
sat has joined #ruby-lang
yxhuvud has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
seanstickle has joined #ruby-lang
fireglow has joined #ruby-lang
adambeynon has joined #ruby-lang
rob_ has joined #ruby-lang
<rob_>
hi
PatrixCR has joined #ruby-lang
<seanstickle>
hollo
<PatrixCR>
Hello
<PatrixCR>
Test
PatrixCR has quit ["Quit"]
<rob_>
if i do 'def SomeClass < Array' how can i access the array methods on a SomeClass object?
<burgestrand>
rob_: yes
<rob_>
how? :)
<burgestrand>
rob_: also subclassing built-in classes is crazy and should be avoided
<rob_>
oh why?
<burgestrand>
rob_: oh, you call them like normal :o
Dotan has joined #ruby-lang
<burgestrand>
rob_: ruby takes a few shortcuts for different methods, you’ll need to override a bunch of them to actually get your SomeClass back when doing many operations
<seanstickle>
Ruby is crazy in general, but it's delightful.
<burgestrand>
It’s more trouble than it’s worth; delegation is often better, or even a whole other approach
<burgestrand>
There are a few rare cases that have a legitimate use for it where it could make sense, but those are few
<rob_>
i want to compare the hashes for files in two directory structures
tekin has joined #ruby-lang
<burgestrand>
rob_: for small one-off things you’re fine, but I’d say that if you’re planning on building on this I’d recommend a normal class that support the methods you need
<rob_>
burgestrand: what concepts should i look up? :)
<rob_>
if i initialize a class with @files = {} then won't i just have to provide access to all the Hash methods i want to access individually? it seems like it would be a pain..
<rob_>
i suppose i can move the logic inside my class?
fayimora has joined #ruby-lang
<rob_>
is it generally ok to call self.some_method from the initialize declaration? or should i initialize an object and then call the method afterwards?
<burgestrand>
rob_: the reason is, when you’re subclassing a core ruby class you’re making yourself Hash’s bitch, this way you keep the little bugger in check and only allow the light of day to see the storage if you let it
<burgestrand>
Mind my language.
<rob_>
:)
<burgestrand>
Actually, you don’t even need the store in that implementation.
<burgestrand>
rob_: super calls the same method in the parent, and in this case passes along the hash
<burgestrand>
rob_: SimpleDelegator is a thin wrapper that makes it appear that Files is a Hash, making it support the same methods that it support
<manveru>
rob_: implementing rsync?
<rob_>
ok i think i understand SimpleDelegator but am not quite clear on 'super', it's always confused me a bit
<burgestrand>
rob_: I think of it as 1-upping the current method with the parents’ implementation :)
<rob_>
manveru: i want to sync a local and remote filesystem but first move any moved files on the remote side so they don't get deleted and re-uploaded :)
<rob_>
burgestrand: in your first example where you do super(@store = {})
<rob_>
@store becomes a Hash instance and then we inherit it's methods into Files?
<rob_>
(so the same as super({}) basically?)
Dotan has joined #ruby-lang
<rob_>
but this wouldnt work without being a subclass of SimpleDelegation?
<rob_>
so i suppose my question is, what happens if you don't subclass SimpleDelegation? what would super achieve in that case?
<burgestrand>
rob_: it’d be superfluous
<burgestrand>
rob_: it might not even work at all, depending on which method you call it from
QaDeS has joined #ruby-lang
<burgestrand>
Anyhow, got to go
<rob_>
burgestrand: thanks for your elp :)
<rob_>
help too :>
<shevy>
hmm got a question about OptionParse. When I have ... two options, short and long form, like this: '-b', '--build-dir=[val]'
<shevy>
will -b be used the same as --build_dir? In other words, both would require a "= value" setting?
<shevy>
ruby foobar.rb -b=foo
<shevy>
ruby foobar.rb --build_dir=foo
<shevy>
?
<manveru>
shevy: did you try it? :P
benanne has joined #ruby-lang
<shevy>
nope
<shevy>
I am thinking of parsing the options on my own actually
<manveru>
lol
pemeon has joined #ruby-lang
<pemeon>
Hi does anybody know good equivalent for with function from JavasScript in Ruby ?
<manveru>
instance_eval
<pemeon>
thanks manveru I forgot about this
pemeon has quit [#ruby-lang]
<manveru>
shevy: thing is, [] are optional
<shevy>
aaaaah
<manveru>
did you read the docs at all?
<shevy>
so I guess "--build-dir" would take the default argument then?
<shevy>
yeah. they suck
<manveru>
"--build-dir=VAL"
<manveru>
or "--build-dir VAL"
<manveru>
either works
<shevy>
hmm
<shevy>
what about "--build-dir" without arguments?
<shevy>
come to think about it, I actually barely see the "=" used
pemeon has joined #ruby-lang
<manveru>
that would just ignore the arg
<shevy>
manveru, do you use "foo=bla" on commandline to ruby scripts?
<manveru>
no
<manveru>
optionparser allows both anyway
<manveru>
no matter which one you use to document the switch
<shevy>
hmm
<manveru>
ι ~ % ruby -roptparse -e 'OptionParser.new{|o| o.on("-f", "--foo"){|f| p f }}.parse!' -- -f bar
<manveru>
true
<manveru>
ι ~ % ruby -roptparse -e 'OptionParser.new{|o| o.on("-f", "--foo=DUH"){|f| p f }}.parse!' -- -f bar
<manveru>
"bar"
QaDeS has joined #ruby-lang
brownies has joined #ruby-lang
h4y4shi has joined #ruby-lang
<h4y4shi>
Hello
setmeaway has joined #ruby-lang
toretore has joined #ruby-lang
<Tasser>
is there a method for hashes such that the result of the block is the new value?
m3nd3s has joined #ruby-lang
<manveru>
no
<Tasser>
can I use hash.peach {|k,v| hash[k] = v.to_s} # aka is [] thread-safe enough?
tcurdt has joined #ruby-lang
<tcurdt>
I need to transfer an object ... easy - just use Marshal::dump(obj) ... but then I realized ... it needs to be on one line ... which means it needs to be encoded
<tcurdt>
so Base64.encode64(Marshal::dump(obj)) ... but that's again not on one line
<tcurdt>
how would you do this?
neoesque has joined #ruby-lang
<tcurdt>
hex encoding/decoding of the marshal dump should be good enough I think
leriksenau has joined #ruby-lang
<tcurdt>
guess I could use unpack for this ... but is there a better way to encode/decode a string to/from hex?
Stalkr_ has joined #ruby-lang
<shevy>
peach? is there really a #peach method?
tcurdt has quit [#ruby-lang]
<shevy>
hmm
<shevy>
peach and banana
nazty has joined #ruby-lang
jamw has joined #ruby-lang
<manveru>
well, in case tcurdt comes around, [Marshal.dump(obj)].pack('m0') does the trick
Fullmoon has joined #ruby-lang
Spooner has joined #ruby-lang
codefriar has joined #ruby-lang
carlosed has joined #ruby-lang
sat has joined #ruby-lang
ruxpin has quit [#ruby-lang]
Keva161 has joined #ruby-lang
stephenp has joined #ruby-lang
codewrangler has joined #ruby-lang
rushed has joined #ruby-lang
<rob_>
hi is there a way to get an array of keys that have the same value from a hash?
<rob_>
Hash.key() only seem's to return the first match
<manveru>
rob_: select
<rob_>
thanks :)
<manveru>
hm
<manveru>
well, that's if you know the value already
<manveru>
>> {a: "foo", b: "bar", c: "foo"}.group_by{|k,v| v }["foo"]
<manveru>
=> [[:a, "foo"], [:c, "foo"]]
<manveru>
that's another way
<manveru>
transpose[0] or map(&:first) to get only the keys
gentz_ has joined #ruby-lang
jtoy has joined #ruby-lang
dejongge has joined #ruby-lang
robotmay has joined #ruby-lang
dous has joined #ruby-lang
dfr|mac has joined #ruby-lang
nark-1 has joined #ruby-lang
Sailias has joined #ruby-lang
savage- has joined #ruby-lang
knu has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
niklasb has joined #ruby-lang
fayimora has joined #ruby-lang
seanstickle has joined #ruby-lang
slimfit has joined #ruby-lang
PatrixCR has joined #ruby-lang
zmack has joined #ruby-lang
elux has joined #ruby-lang
PatrixCR has quit [#ruby-lang]
jtoy has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
chimkan has joined #ruby-lang
enebo has joined #ruby-lang
benanne has joined #ruby-lang
slimfit has joined #ruby-lang
rob_ has quit [#ruby-lang]
virunga has joined #ruby-lang
fayimora_ has joined #ruby-lang
diegoviola has joined #ruby-lang
urbanmonk has joined #ruby-lang
lordofthedance has joined #ruby-lang
<andrewvos>
ruby-lang: Is there a gem that has a list of rnadom words?
<andrewvos>
ruby-lang: I suppose a dictionary file would be alright too, but I'm very lazy
savage- has joined #ruby-lang
dous_ has joined #ruby-lang
tomzx has joined #ruby-lang
<andrewvos>
Anyone know an easy way to strip html tags from a string?
<andrewvos>
Other than a regex
rippa has joined #ruby-lang
<Tasser>
andrewvos, thou shalt not parse html with regex
<andrewvos>
Tasser: yeah yeah yeah
<andrewvos>
Tasser: I'm not
<andrewvos>
I just want to get a wikipedia rndom page, and then mess around with the text content
<seanstickle>
Actually, that sounds exactly like you're parsing HTML
<seanstickle>
Unless you're including the javascript and title content and all that in the term "text content"
<andrewvos>
Mon_Ouie: Can't get anything better from there I think
<andrewvos>
Nokogiri to the rescue!
<Mon_Ouie>
Well, you still need a way to strip the HTML (I guess you could iterate over it using a parser and only printing the text); you just get direct access to the content of the page
<shevy>
hmmm a bit semi off-topic
<shevy>
web_object.background_color = '#ffffee'
<shevy>
any idea how to ... uhm... turn this colour darker or lighter without having to know the values?
looopy has joined #ruby-lang
elux has joined #ruby-lang
<shevy>
perhaps something like ... web_object.background_color = '#ffffee ++++' for several grades of lighter
<shevy>
web_object.background_color = 'pink' is a lot easier to understand :\
gregf has joined #ruby-lang
<yorickpeterse>
shevy: 0to255.com
<andrewvos>
Why doesn't this work? "dsfsd dsfsdf sdf sdf".scan("\w+")
<andrewvos>
Am I being stupid?
vbatts_tab has joined #ruby-lang
<Mon_Ouie>
/\w+/
<andrewvos>
Mon_Ouie: OH MY GOD
<yorickpeterse>
^
<yorickpeterse>
quotes as usual
* andrewvos
gives up programming
<shevy>
yorickpeterse hmm cool site
<seanstickle>
andrewvos: or you could just use Mechanize
<andrewvos>
Meh, this works kind of: html.css(".mw-content-ltr p").map { |node| node.text }.join(" ").scan(/\b\w{3,}\b/).sample.downcase
<elux>
darix: yea.. im aware of that gem.. it gets the job done, i just dont see why thats even necessary
<elux>
im trying to understand the fundamental problem in net/http that prevents persistent connnections..
<darix>
drbrain: any reasons why you didnt push net-http-persistent into ruby itself?
skryking has joined #ruby-lang
cirwin has joined #ruby-lang
tommyblue has joined #ruby-lang
outoftime_ has joined #ruby-lang
nofxx has joined #ruby-lang
<josh9>
i have a 1 liner webapp - run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Rack using the rackup tool"]]} why do i see 'NoMethodError at /' at the chrome's tab?
<nofxx>
Hm.. mechanize floods /tmp ... is there some option I'm missing? gonna write a cron
<whitequark>
josh9: works for me
<whitequark>
cache?
igotnolegs has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
Axsuul has joined #ruby-lang
Axsuul has joined #ruby-lang
<apeiros_>
urgs
<apeiros_>
better :)
rpall has joined #ruby-lang
<josh9>
whitequark: maybe it's chrome..
<josh9>
whitequark: i can see the text, it's just the chrome tab
<josh9>
that show this message
Banistertab has joined #ruby-lang
<josh9>
what is so special with #call? what happens when i access my website? is it creating an instance of the object i passed into Thin.run?
<josh9>
and running #call ?
seanstickle has joined #ruby-lang
DRCALKIN has joined #ruby-lang
macmartine has joined #ruby-lang
<josh9>
i am looking at the initialize method of thin. it accepts the object. not sure what it does with it..
<josh9>
@app = arg if arg.respond_to?(:call)
<apeiros_>
thin uses rack
Jade has joined #ruby-lang
<apeiros_>
rack uses that
<apeiros_>
anything that responds to call and returns an array with status code, headers and body is a proper middleware
<josh9>
yeah. it looks like thin has an instance var called @app. so my object that i passed to thin is assigned into this variable.
<josh9>
i am curious to see what happens when a request comes to thin. i guess it create an instance of @app and calles #call
<apeiros_>
I think it just calls .call
<apeiros_>
after all, the object you hand it responds to call directly, not its instances.
<josh9>
true
<apeiros_>
however, you can - of course - create an instance of whatever in that .call method and do whatever you want with it.
<apeiros_>
(alias is syntax, hence no , is needed, yet he uses symbols - which isn't necessary either…)
<apeiros_>
I also dislike this: log ">> Thin
<apeiros_>
the >> isn't part of the message. it's part of the formatting. it doesn't belong into the message.
* apeiros_
is being a nitpick again
melter has joined #ruby-lang
looopy has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
heftig has joined #ruby-lang
Sailias has joined #ruby-lang
futurechimp has joined #ruby-lang
rushed has quit [#ruby-lang]
mahlon has joined #ruby-lang
Dotan has joined #ruby-lang
havenn has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<dominikh>
alias instead of alias_method is barely ever needed as well.
andrewhl has joined #ruby-lang
apeiros_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
apeiros_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
duckinator has joined #ruby-lang
apeiros_ has joined #ruby-lang
tenderlove has joined #ruby-lang
tjgillies has joined #ruby-lang
shachaf has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
urbanmonk has joined #ruby-lang
dejongge has joined #ruby-lang
<shevy>
ur mom is barely ever needed as well!!!
<apeiros_>
shevy: behave…
<shevy>
I tend to use more aliases ... I'd say around 3:1 alias:alias_method some such
workmad3 has joined #ruby-lang
<shevy>
but it can be quite insane. I think ruby-tk uses alias foo_bar foobar for all methods or something like t hat.
BadQuanta has joined #ruby-lang
workmad3 has joined #ruby-lang
headius has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
ryanf_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
Tref has joined #ruby-lang
<josh9>
let's assume my stack is nginx -> thin -> sinatra. so what exactly happenes on each request? that's what i understand: nginx pass the request to thin, thin create instance of my sinatra app.
<apeiros_>
josh9: raise an exception, check the backtrace
<josh9>
also when i first start thin, it loads my sinatra class and libraries to memory.
<apeiros_>
or use caller.join("\n") in your response