<petercooper>
There must be a reason, I just haven't turned my head on full today :-)
<drbrain>
petercooper I think send is better too, I forgot about it
fayimora joined #ruby-lang
korch left #ruby-lang
heppy_ joined #ruby-lang
<tjgillies>
petercooper: what would syntax for that be?
<petercooper>
send spell_name
<petercooper>
as the entirety of that cast method
<tjgillies>
petercooper: thnx
wallerdev joined #ruby-lang
takaokouji joined #ruby-lang
nofxx joined #ruby-lang
banister_ joined #ruby-lang
Cerales joined #ruby-lang
<Cerales>
I just built my own gem for the first time, and installed it with gem install from the local directory. when I try to require it, though - with the name I specified in the gem spec - I get "no such file to load". any ideas, anyone?
<Cerales>
oh, it was a problem with my require_path. never mind!
srbaker joined #ruby-lang
replore_ joined #ruby-lang
livinded joined #ruby-lang
banisterfiend joined #ruby-lang
wyhaines joined #ruby-lang
yfeldblum joined #ruby-lang
fenicks left #ruby-lang
resetexistence joined #ruby-lang
wyhaines_ joined #ruby-lang
jmontross joined #ruby-lang
<zenspider>
sexp_processor 3.0.9 released
<zenspider>
Cerales: you wouldn't have that problem if you didn't hand roll your own gemspec
<zenspider>
Hoe is your friend (tm)
looopy_ joined #ruby-lang
vesan joined #ruby-lang
neoesque joined #ruby-lang
mbriggs joined #ruby-lang
lianj joined #ruby-lang
chris2 joined #ruby-lang
artOfWar joined #ruby-lang
cjs226 joined #ruby-lang
srbaker joined #ruby-lang
<zenspider>
minitest 2.9.0 released
<zenspider>
rawr
jmontross joined #ruby-lang
<erikh>
ha, I just installed 2.8.3 or w/e hte last release was about 30 minutes ago
<erikh>
oh fwiw there's something up with hoe's rake newb on 1.8.7. haven't sorted it yet
<erikh>
I'm pretty sure it and 'rake test' are running two different battery commands
<erikh>
it's that test/unit problem we were seeing ages ago where it gets confused with minitest plugin installed
<erikh>
anyhow, I'll file if I run across it again and find anything I can pinpoint.
ryanf joined #ruby-lang
andrewhl joined #ruby-lang
slyphon joined #ruby-lang
amerine joined #ruby-lang
Kero joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
jbwiv__ joined #ruby-lang
<josh9>
in 1.9.3, bcrypt is not part of the standard-library?
jmontross joined #ruby-lang
<rue>
N-uh
slyphon joined #ruby-lang
slackstation joined #ruby-lang
lightcap joined #ruby-lang
looopy joined #ruby-lang
looopy_ joined #ruby-lang
Nisstyre joined #ruby-lang
looopy joined #ruby-lang
robbyoconnor joined #ruby-lang
krz joined #ruby-lang
wyhaines joined #ruby-lang
tallship joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
r0bby joined #ruby-lang
looopy_ joined #ruby-lang
headius joined #ruby-lang
artOfWar joined #ruby-lang
dr0id joined #ruby-lang
twittard joined #ruby-lang
<drbrain>
nope
<steveklabnik>
tenderlove wants to add it for 2.0
x0F__ joined #ruby-lang
gfarfl joined #ruby-lang
phlipper joined #ruby-lang
rohit joined #ruby-lang
Nisstyre joined #ruby-lang
Ruthenium joined #ruby-lang
spuk joined #ruby-lang
r0bby joined #ruby-lang
<rue>
2.0? I think you mean 2.awesome!
<Asher>
few people are aware that awesome is a number
<lianj>
textmate-2.nevar
<livinded>
lianj: you just stole my joke~
<livinded>
!
<petercooper>
it's the square root of -i
<lianj>
livinded: hehe
<livinded>
I can't wait for textmate 2 alpha to not be delivered in time for christmas and hopefully everyone realizes it's vaporware and moves on to vim
<drbrain>
gah, no
<drbrain>
at least, don't bring any of that crappy hand-holding bullshit with you
<drbrain>
learn you a command mode
<livinded>
and some text-objects!
<drbrain>
YES!
<petercooper>
would you like an operating system with that?
<livinded>
petercooper: I don't need one, vim runs on everything!
<dr0id>
I want some ruby
<drbrain>
petercooper: I learned that emacs is all about meta-x-fuck-fuck-fuck
<drbrain>
but I learned from zenspider so I may have been stunted
<livinded>
the best part about emacs is meta-x spook
<erikh>
why do I feel I need a set of liberty spikes and a jacket with safety pins all over it when I look in here
<rue>
bnagy: You get to write LOTS of code in Java, and plenty of debug experience with PHP
<bnagy>
what are liberty spikes?
<rue>
erikh: That doesn't sound like hipster wardrobe at all
<bnagy>
rue: which leaves 1% of the time for programming! Yay!
towski joined #ruby-lang
<WhiteHorse>
havent tried that yet
srbaker joined #ruby-lang
<erikh>
sheena is
<WhiteHorse>
well im not experienced but i understand a lot of object oriented concepts and stuff
<ryanf>
wait yeah uh
<ryanf>
is ruby punk now?
<ryanf>
if so, I am clearly working with the wrong people
macmartine joined #ruby-lang
<WhiteHorse>
lol ryanf
<twittard>
WhiteHorse: Depends on what you're looking to do. You can always do the Rails / Sinatra tutorials, if you want to do web development. This will give you a feel for Ruby while "doing something" in the beginning.
<bnagy>
WhiteHorse: what do you want to do?
<WhiteHorse>
yes im following the rails 3 tutorial from michael hartl
<WhiteHorse>
but i feel like.. id like to learn ruby lang first
<erikh>
some dork in here wrote it, can't remember his name
<erikh>
:P
<zenspider>
I heard he's a jerk
<WhiteHorse>
well if ruby were similar to C in syntax i wouldnt care. but it is really different from C-like langs so... i think that i have to put some time learning it first before the actual framework
<twittard>
But I don't really care for the layout of the book
<erikh>
which obviously did not work
<bnagy>
I hate the 'hard way' solutions, they look like ported python
<twittard>
It's below your level and doesn't get into the "magic" of ruby.
<twittard>
Exactly
<twittard>
Problem is, there are books about Ruby for absolute beginners.
tomzx joined #ruby-lang
<twittard>
WhiteHorse: To some extent, it might be worth it to just do the Rails tutorial and swallow some of the magic.
<rue>
erikh: Right, that's the wrong way around?
<twittard>
WhiteHorse: Or maybe, I can help you through the magic as you come across it. It might help me, too. I'm doing a presentation to some Java developers tomorrow.
<bnagy>
I want 'swallow some of the magic' on a tshirt now
<twittard>
And I've forgotten all the things that surprised me.
<erikh>
is it %(?!\\)
<erikh>
sorry, mysql server just went tits up, be back in a bit
<twittard>
about Ruby, that is.
<ryanf>
erikh: don't you want (?<!\\)% or something like that?
<erikh>
1.8
<erikh>
anyhow really gtg
<ryanf>
ahh
<ryanf>
man I don't know why people are always so down on zero-width assertions
<oddmunds>
WhiteHorse: i'm just quickly looking at that, but am i wrong in that it's not very ruby idiomatic?
<twittard>
WhiteHorse: The problem with the guide is, while it will port some concepts over from other languages, it doesn't give you a "ruby" way. So you're barely learning ruby syntax.
<oddmunds>
and more or less directly translated from python?
<oddmunds>
haha
<twittard>
err, you're only learning ruby syntax.
<oddmunds>
twittard: i think we noticed the same thing
<twittard>
You're not, for example, learning about blocks.
<twittard>
Or Mixins
<twittard>
WhiteHorse: In ruby, you don't write "for" loops. Ever. They look stupid after using Ruby.
<oddmunds>
actually that's not the same as a for-loop
<oddmunds>
it's better
<twittard>
Right
<WhiteHorse>
oh ive seen those in the tutorial :S
<twittard>
["foo", "bar"].each_with_index { |item, index| "#{item} is at index #{index}" }
<lianj>
each.with_index
<twittard>
Or each_with_index
Pip joined #ruby-lang
<twittard>
WhiteHorse: 5.times { puts "Hello!" }
<twittard>
Without blocks, Ruby is just Python with a less hideous syntax.
<lianj>
twittard: sure bit .with_index suggests that it works with map etc too
<lianj>
*but
<twittard>
lianj: I do each_with_index.map all the time
<twittard>
Or are you saying map.with_index ?
<lianj>
yes, map.with_index
[dmp] joined #ruby-lang
[dmp] joined #ruby-lang
<twittard>
Same effect. I imagine the overhead to both are identical
* twittard
ponders a benchmark
aef joined #ruby-lang
<WhiteHorse>
so u can call an each method in any object that behaves like an array/vector?
corecode joined #ruby-lang
darix joined #ruby-lang
darix joined #ruby-lang
<oddmunds>
every object that "includes" Enumerable
<twittard>
WhiteHorse: Any class that includes Enumerable and implements an #each method
valeri_ufo joined #ruby-lang
rane_ joined #ruby-lang
<twittard>
But you don't actually have to include Enumerable
<oddmunds>
twittard: i like that we're on the same track :)
<twittard>
WhiteHorse: You can code it yourself. It's just more painful.
<twittard>
oddmunds: :D
jwollert joined #ruby-lang
<lianj>
twittard: each_with_index.map is different from map.with_index
<twittard>
WhiteHorse: Well, not painful. Just, you have to write the details yourself. It's pretty easy, tbh.
tekin joined #ruby-lang
LanceHaig joined #ruby-lang
jasiek joined #ruby-lang
comboy joined #ruby-lang
vereteran joined #ruby-lang
<twittard>
lianj: Is it? How? (Looking at the API docs)
_rane joined #ruby-lang
<lianj>
you will find out ;)
soahccc joined #ruby-lang
denysonique joined #ruby-lang
denysonique joined #ruby-lang
a3li joined #ruby-lang
takaokouji joined #ruby-lang
timbleck joined #ruby-lang
<twittard>
lianj: I don't see anything describing how it's different :(. Seems like identical behavior so far.
<twittard>
Oh fine, I'll open up IRB
<WhiteHorse>
by include you mean inheritance? or just a java like "import"
<twittard>
Same behavior
<twittard>
WhiteHorse: Ruby is Single Inheritance only.
mccraig joined #ruby-lang
meise joined #ruby-lang
<lianj>
twittard: nope
<twittard>
WhiteHorse: Mixins let you get around that. They're akin to interfaces, but not really. They let you, in a sense, do the multiple inheritance thing but more cleanly.
<WhiteHorse>
twittard: PRY looks better than IRB ;)
<twittard>
WhiteHorse: If you have several different pieces of functionality, you can include or extend them.
<jammi>
hi, any other ideas about a ruby timezone library than tzinfo?
<WhiteHorse>
whats a module? like a java package?
<erikh>
well that was fun
<WhiteHorse>
lol
<twittard>
WhiteHorse: Not really. The common comparison is an Interface.
<twittard>
WhiteHorse: Except you're implementing the details of it.
<twittard>
WhiteHorse: I added another example. A lot of "magic" in ruby comes from callbacks: https://gist.github.com/1446231
<twittard>
so, included / extended / inherited ... all can get called (if defined) when those things happen. So you can inject functionality behind the scenes.
mrchrisadams joined #ruby-lang
<twittard>
WhiteHorse: Not sure what the best Java analogy would be. A module is just a bunch of functionality that you want to share between classes (generally)
<drbrain>
yes
kitallisii joined #ruby-lang
simon_weber joined #ruby-lang
abuiles joined #ruby-lang
<WhiteHorse>
ok.. so you can choose to extend or include that bundle of functionality?
<twittard>
WhiteHorse: Without the "instance_exec", "FooBar" would have never inherited those methods from the modules. It's pretty nice, imo, and prevents things from becoming a ball of mud.
<twittard>
WhiteHorse: Right. Generally, "include" gives the functionality to instances of the class... While extend gives it to the class itself.
<headius>
zenspider: another issue with excludes implemented like this...it still runs setup
<headius>
if setup has an issue, it still fails (or in this case, hangs)
<headius>
I'll poke at it
vereteran joined #ruby-lang
<headius>
hmm, does setup and teardown run before and after each test method or before and after the whole thing?
<bnagy>
or create the hash with a default object in the first place
<rue>
That'd be sensible
<rue>
ri Hash.new
Pupeno joined #ruby-lang
<bnagy>
but don't forget to use the block form or you won't get what you expect
<bnagy>
h=Hash.new {|h,k| h[k]={}}
<rue>
Why can't we just make people RTFM?
<Rich_Morin>
I know about that, but this way seemed to be working (and a lot simpler) until I tried to do a rescue {} instead of a rescue nil.
<bnagy>
Rich_Morin: as I said, it's not raising, it's just returning nil from the lookup, which is what Hash does by default
<bnagy>
you would only rescue there if you were trying to cope with a 'sub' hash not being there
<Rich_Morin>
Well, if the hash returns a nil, the next level lookup will fail (as shown in the pastie)
<bnagy>
that's right
<bnagy>
but obviously that's not happening
<Rich_Morin>
so, indeed, I can get an exception (but may not if only the last leookup fails)
<bnagy>
s/may/will/
neoesque joined #ruby-lang
<Rich_Morin>
right - so, I think I'll use (a[:q][:w] rescue nil) || {}
roha joined #ruby-lang
<bnagy>
yes, that is definitely the ugly and hacky way to do it
<bnagy>
go forth and be a prel programmer in ruby
<Rich_Morin>
go forth and read "Exceptional Ruby"
<rue>
Rich_Morin: Why in the fuck would you use that?
<Tasser>
bnagy, the recall of {} is high, but the precision sucks.
<manveru>
why does nobody like fetch :P
<bnagy>
I do
<bnagy>
I was just about to say so
<bnagy>
although I like having a default object better
<Rich_Morin>
rue: Well, one reason is that I have quite a bit of code that I'd have to rework to use Hash.new. Another is that Hash.new is a bit ugly. Finally, what the @#$%%^ is wrong with using Ruby's exception mechanism?
<rane_>
not a huge fan of using exceptions like that
<manveru>
yeah, but 3 nested ones?
<bnagy>
makes it clearer when you're reading the code
<manveru>
Rich_Morin: exceptions are slow
<rippa>
exceptions are for exceptional situations
<rippa>
when you have a nerror
<rippa>
*an error
<manveru>
that too :)
benanne joined #ruby-lang
<Rich_Morin>
speed is not an issue in this case. and, indeed, not finding the element I'm looking for is an exceptional situation That said, I'll think about it...
<rue>
If that's the exceptional situation, it'd be best for your code to reflect it
<rane_>
if it was an exceptional situation you would log it
<manveru>
i'm assuming the default-proc one becomes quite GC heavy
<manveru>
the rescue one creates exceptions and backtraces for every iteration
postmodern joined #ruby-lang
<Rich_Morin>
if hash failures are unusual, there won't be many exceptions.
<Tasser>
manveru, point for you ;-)
<manveru>
i like going for worst-case :)
<rane_>
Rich_Morin: why so adamant about using rescue?
<Rich_Morin>
I think I explained that several minutes ago
<rane_>
didn't notice any good points
<Rich_Morin>
uhuh
workmad3 joined #ruby-lang
fish_ joined #ruby-lang
<fish_>
hi
<rue>
If Avdi actually recommends such an approach, I will set him on fire
robotmay joined #ruby-lang
<Rich_Morin>
I would be interested to know what he thinks. In the meanwhile, it wouldn't be hard to whip up a method that does multi-level fetches, based on the number of input arguments.
<rippa>
manveru: breaks if length is not divicible by 10
jensn joined #ruby-lang
<shevy>
manveru breaks bananas
saLOUt joined #ruby-lang
<ddfreyne>
bananas?
<shevy>
yeah
<shevy>
heard of it?
<bnagy>
scan(/.{1,10}/) then
<shevy>
back in 2001 banans were the thing
adiblinux joined #ruby-lang
<shevy>
*bananas
<shevy>
but nowadays in the year 2053, bananas are rare
jensn joined #ruby-lang
madsheep joined #ruby-lang
Manhose joined #ruby-lang
Manhose_ joined #ruby-lang
NARKOZ joined #ruby-lang
Kanolesic joined #ruby-lang
jimmy1980 joined #ruby-lang
geoffw8_ joined #ruby-lang
cjs226 joined #ruby-lang
beiter joined #ruby-lang
geoffw8_ joined #ruby-lang
yalue joined #ruby-lang
Spooner joined #ruby-lang
rpall joined #ruby-lang
slyphon joined #ruby-lang
mark_locklear joined #ruby-lang
Manhose__ joined #ruby-lang
jimmy1980 joined #ruby-lang
m1d4s joined #ruby-lang
jbwiv_ joined #ruby-lang
nark-1 joined #ruby-lang
<shevy>
dumdedum
<muzone>
coke and rum
<muzone>
cuz the day is young, girl u want some
Pip joined #ruby-lang
Pip joined #ruby-lang
malev joined #ruby-lang
<dr0id>
f
jimmy1980 joined #ruby-lang
adiblinux joined #ruby-lang
<shevy>
I suppose there is no easy way to convert ... 93822 seconds into HH:MM:SS format? Like 03:15:33
<shevy>
I wrote a little class that does that, so it is solved for me, but I wonder if there is an easier way
<molgrew>
what do you mean with easier way?
<molgrew>
how easy is your way?
adiblinux left #ruby-lang
<shevy>
molgrew well, the task to do the conversion is pretty simple, at threshold 60, overflow into the higher part (minutes to hours, seconds to minutes), but it's still like ... 15 lines of code in total. And ideally I'd rather like to try and use something in-built, or something shorter, rather than have to carry around this class in my projects :(
tommyvy__ joined #ruby-lang
macmartine joined #ruby-lang
yfeldblum joined #ruby-lang
gearaholic joined #ruby-lang
<manveru>
15?
<manveru>
>> n = 93822; h, m = n.divmod(3600); m, s = m.divmod(60); "%02d:%02d:%02d" % [h,m,s]
<manveru>
=> "26:03:42"
mnoble joined #ruby-lang
mnoble left #ruby-lang
robbrit joined #ruby-lang
geoffw8_ joined #ruby-lang
mantono joined #ruby-lang
zerokarmaleft joined #ruby-lang
zerokarmaleft joined #ruby-lang
niklasb_ joined #ruby-lang
shevy joined #ruby-lang
Pupeno left #ruby-lang
leonL joined #ruby-lang
zerokarmaleft joined #ruby-lang
Indian joined #ruby-lang
looopy joined #ruby-lang
slyphon joined #ruby-lang
zerokarmaleft joined #ruby-lang
rippa joined #ruby-lang
scampbell joined #ruby-lang
outoftime joined #ruby-lang
MistyM joined #ruby-lang
uniqanomaly joined #ruby-lang
RomD` joined #ruby-lang
zerokarmaleft joined #ruby-lang
wi43 joined #ruby-lang
RomD joined #ruby-lang
<wi43>
I have read in some LDAP data into an array and I have read into another array some data from a file. When i do @ldapdata-@filedata, the arrays are not compared. I am using the @filedata << line to read in data.
<wi43>
Could it be because the types inside of the array are different, so they are not compared?
<wi43>
they should both be strings
neilmiddleton joined #ruby-lang
<imperator>
wi43, then you may need to flatten them before comparing, i.e. make sure you don't have nested arrays
<wi43>
imperator, each element should just contain one word
<wi43>
ill try and flatten
<wi43>
and see real quick
<molgrew>
you say should a lot
<imperator>
wi43, i think what molgrew means is that it's up to you to make sure each element contains a single word then before comparing
<wi43>
hehe - cheers
<wi43>
agreed
imajes joined #ruby-lang
zerokarmaleft joined #ruby-lang
andrewhl joined #ruby-lang
vicegrip joined #ruby-lang
<wi43>
aha.... i SHOULD of check that they were strings... thanks!
zerokarmaleft joined #ruby-lang
rayners joined #ruby-lang
Sailias joined #ruby-lang
ksinkar joined #ruby-lang
zerokarmaleft joined #ruby-lang
tomzx joined #ruby-lang
kmeehl joined #ruby-lang
zerokarmaleft joined #ruby-lang
dnjaramba joined #ruby-lang
zerokarmaleft joined #ruby-lang
jkyle joined #ruby-lang
looopy joined #ruby-lang
Sailias joined #ruby-lang
looopy_ joined #ruby-lang
Silowyi joined #ruby-lang
RomD` joined #ruby-lang
sepp2k joined #ruby-lang
yorickpeterse joined #ruby-lang
jasox joined #ruby-lang
ksinkar joined #ruby-lang
jimmy1980 joined #ruby-lang
gearaholic joined #ruby-lang
Natch| joined #ruby-lang
headius joined #ruby-lang
dejongge joined #ruby-lang
slyphon joined #ruby-lang
hebz0rl joined #ruby-lang
tenderlove joined #ruby-lang
ksinkar joined #ruby-lang
slackstation joined #ruby-lang
slackstation joined #ruby-lang
hagabaka joined #ruby-lang
hagabaka joined #ruby-lang
nofxx joined #ruby-lang
jimmy1980 joined #ruby-lang
srbaker joined #ruby-lang
scottschecter joined #ruby-lang
<headius>
zenspider: I'm around to discuss the additional fixes
<manveru>
shevy: you died?
thone_ joined #ruby-lang
io_syl joined #ruby-lang
jbsan_ joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
butchanton joined #ruby-lang
nofxx joined #ruby-lang
io_syl_ joined #ruby-lang
io_syl_ joined #ruby-lang
wyhaines joined #ruby-lang
pbjorklund joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
<pbjorklund>
How can I write "session[:counter] ||= 0 ; session[:counter] += 1" in a less repetitive way?
io_syl joined #ruby-lang
vmatiyko joined #ruby-lang
io_syl_ joined #ruby-lang
<MistyM>
pbjorklund: Is session a hash? I guess you could set a default value of 0 so you can increment keys that didn't previously exist, if you don't otherwise depend on accessing potentially undefined keys.
<pbjorklund>
MistyM: Just looking for a nifty way to set it to something if nil and increment, otherwise just increment
<MistyM>
I didn't realize nil.to_i would return 0. Nifty!
RickHull joined #ruby-lang
RORgasm joined #ruby-lang
amerine joined #ruby-lang
tobiasvl joined #ruby-lang
<pbjorklund>
manveru: Thanks, but doesn't that mean I have to repeat :counter twice in the line? Or did I miss something. Not really a ruby expert
savage- joined #ruby-lang
<manveru>
pbjorklund: it does mean that
<manveru>
once for setting, once for lookup
<pbjorklund>
Ok so there is no ||=+(0,1) construct in ruby (yet)? :)
<manveru>
i doubt it'll get one of those
<pbjorklund>
My attempts at humor always goes unnoticed.. Thanks for helping out though manveru
<robbrit>
what is ||= +(0,1) ?
FylGood joined #ruby-lang
<rippa>
that actually would work
<rippa>
it means the same as
<rippa>
||=0,1
heppy joined #ruby-lang
<rippa>
nah
<rippa>
comma messes it up
<manveru>
kids these days... back in my days we'd have to carve each instruction into brittle stone tablets and feed them to the Interactive Broken Machine
Pip joined #ruby-lang
Pip joined #ruby-lang
towski joined #ruby-lang
lightcap joined #ruby-lang
darkf joined #ruby-lang
darkf joined #ruby-lang
WhiteHorse joined #ruby-lang
<shevy>
manveru what
<shevy>
I am alive and kicking ass!
lightcap joined #ruby-lang
heppy_ joined #ruby-lang
sodani joined #ruby-lang
<sodani>
hello. open(url) creates a Tempfile object, and I'm wondering how I can then save this to a file
hagabaka joined #ruby-lang
nekid joined #ruby-lang
<Mon_Ouie>
Tempfile are actual files somewhere in /tmp/ (or whatever is the temporary directory in your system)
jimmy1980 joined #ruby-lang
<Mon_Ouie>
So you can just copy/move it as you want
<Mon_Ouie>
(They have a #path method)
<sodani>
ah I see that now. thanks!
<nekid>
whats the command for finding out what something is?
<nekid>
like finding out if its a class
<robbrit>
nekid: obj.class
<nekid>
ty
<steveklabnik>
nekid: obj.is_a?(SomeClass)
<steveklabnik>
obj.kind_of?(SomeClass)
lightcap joined #ruby-lang
gearaholic joined #ruby-lang
hagabaka joined #ruby-lang
RickHull joined #ruby-lang
<nekid>
2 spaces as an indent is more concise? than a tab?
dhoss_ joined #ruby-lang
<robbrit>
nekid: 2 spaces is just a convention that the ruby community seems to use
<steveklabnik>
yep.
<steveklabnik>
two spaces, all the time.
dhoss_ joined #ruby-lang
jmontross joined #ruby-lang
Pip joined #ruby-lang
<shevy>
' '
<shevy>
you may borrow but give it back one day
sodani left #ruby-lang
yorickpeterse joined #ruby-lang
heppy joined #ruby-lang
slackstation joined #ruby-lang
knu joined #ruby-lang
Oloryn_lt1 joined #ruby-lang
towski joined #ruby-lang
butchanton joined #ruby-lang
<nekid>
does anyone know what a program is called that basically extracts and reorganizes the content of a website?
<robbrit>
nekid: a scraper or crawler
<robbrit>
hmm maybe not crawler
perryh joined #ruby-lang
<Tasser>
nekid, reoganize in what way?
<nekid>
basically, there are these science articles
<nekid>
i want to organize it a different way(based on how i make the scraper?)
<Tasser>
nekid, scraper: wget
LeoNerd joined #ruby-lang
<shevy>
reorganizes?
<shevy>
reorganize how
<LeoNerd>
Hi all. Total meta-question: I have a question about the pastie.org paste site; it says on there this is where the bot lives. Is here a good place for that, or where would anyone suggest?
<nekid>
so that it's useable in programs
<nekid>
not for just reading knowledge
<shevy>
what :)
<nekid>
I don't know how, yet but will update you when I do
retro|cz joined #ruby-lang
<shevy>
what kind of science articles are you trying to dig in nekid ?
<nekid>
medicine
<shevy>
cool
<nekid>
still ways to go
<LeoNerd>
Well, I'll ask anyway as it's quiet: Is there any way to pre-fill the syntax field of a new paste, perhaps by a URL parameter? I'd like to have a link that sets Perl automatically
<manveru>
>> n = 93822; h, m = n.divmod(3600); m, s = m.divmod(60); "%02d:%02d:%02d" % [h,m,s]
<manveru>
=> "26:03:42"
<manveru>
@ shevy
<shevy>
whoa
<shevy>
that's damn short
sepp2k joined #ruby-lang
<manveru>
i could make it shorter, but it'd be a bit brainwrecking
<shevy>
:(
<shevy>
I wrote such a nice class! and a one-liner kills it
<rippa>
In modern usage, "Luddite" is a term describing those opposed to industrialisation, automation, computerisation or new technologies in general.
<imperator>
it's usually not used that severely though
<nekid>
irb cannot display unicode on windows?
<rippa>
more like
<nekid>
my friends say lagger
<rippa>
windows default command promtp cannot
<nekid>
oh
<ReinH>
I called someone a luddite on twitter once
<ReinH>
they blocked me
<rippa>
at least in my experience
LeoNerd left #ruby-lang
<imperator>
think you gotta change your default code page
<imperator>
can't remember now
sodani joined #ruby-lang
<ReinH>
or your OS
cjs226 joined #ruby-lang
<imperator>
nekid, chcp 65001
* imperator
releases sys-uname 0.9.0 into the wild
nuclearsandwich joined #ruby-lang
<imperator>
hm, i no longer see a way to set the default branch on a github project
<yxhuvud>
can't you do it through git? I recall having been able to do it that way before
<yxhuvud>
or maybe it was just master I set.
<nekid>
imperator: where do you do that, i'm new
Codif joined #ruby-lang
<imperator>
yxhuvud, it defaults to master
<imperator>
nekid, on the windows command line
<imperator>
yxhuvud, if there's a way to do it in git itself, i'm unaware how
<nekid>
hmm i got some symbols, not the currency but better than \u00A5
<imperator>
ReinH, how ironicle
shapeshed joined #ruby-lang
<imperator>
yxhuvud, oh, found it, it's under "admin" now
gearaholic joined #ruby-lang
<imperator>
nekid, what currency? euro symbol?
<rue>
€
<nekid>
yen
shapeshed joined #ruby-lang
hagabaka joined #ruby-lang
<imperator>
might need to use a different cp then
<nekid>
puts money = "\u{20AC}"
<nekid>
gets me rho e w/ tilde and 1/4th
<ReinH>
imperator: ?
ilyam joined #ruby-lang
<manveru>
nekid: >> "\u20ac"
<manveru>
=> "€"
lsegal joined #ruby-lang
mytrile joined #ruby-lang
nofxx joined #ruby-lang
hhatch joined #ruby-lang
<nekid>
"€"
Manhose joined #ruby-lang
brianpWins joined #ruby-lang
<manveru>
nekid: what's your terminal?
nuclearsandwich joined #ruby-lang
bryanl joined #ruby-lang
fra000 joined #ruby-lang
workmad3 joined #ruby-lang
<queequeg1>
Ruby koans are a good leaning experience. Are there any other collections of learning challenges like that?
twittard joined #ruby-lang
slyphon joined #ruby-lang
Codif joined #ruby-lang
<manveru>
what's good material for getting into predictive input algorithms?
<bougyman>
something written for lisp, i'd bet.
Jake232 joined #ruby-lang
<manveru>
i wanna build something like what stephen hawkins uses for my mother
<nuclearsandwich>
queequeg1: check Ryan Bates's Ruby Warrior gem.
<nuclearsandwich>
I also like testfirst.org and rubymonk.com just launched their alpha.
<manveru>
i.e. just a kind of joystick or eyetracking to select letters and have as much as possible predicted
<nuclearsandwich>
If you want to play around in other languages and paradigms, Ruby Koans inspired the Clojure Koans project. Pretty sure there are coffescript/javascript koans now as well.
woollyams joined #ruby-lang
zkl joined #ruby-lang
r0bby joined #ruby-lang
<Spooner>
nuclearsandwich: I found Rubywarrior recently. It was incredibly good :)
<nuclearsandwich>
me too. I was updating the RailsBridge Learning Resources and thought "huh, what's this?"
<nuclearsandwich>
then suddenly lost four hours of my day. :)
<nuclearsandwich>
I had to put it away until finals are over
<Spooner>
I put it away being stuck on the last level (intermediate-9). I need to go back to it and finish it.
srbaker joined #ruby-lang
benanne joined #ruby-lang
curtism joined #ruby-lang
nofxx joined #ruby-lang
robbrit left #ruby-lang
zmack joined #ruby-lang
Indian joined #ruby-lang
envygeeks joined #ruby-lang
Natch| joined #ruby-lang
<envygeeks>
Is there a way to dup chain? EXP ENV.dup.delete('KEY')?
mksm_ joined #ruby-lang
<rue>
manveru: ☹ Is there no commercially available software for that? Or do you just want it as a combined interesting experiment?
<RickHull>
envygeeks: try it and see
<rue>
Prediction might be a little under the wraps, I seem to recall it was a Big Competitive Advantage for e.g. Nokia back in the day
<envygeeks>
RickHull... it failed that's why I'm asking :/
<rue>
What does #dup do? It should return a new instance of the same class, with the same data
<RickHull>
str #=> 'asdf'
<envygeeks>
ENV.dup.delete('XAUTHORITY')
<envygeeks>
NoMethodError: undefined method `delete' for #<Object:0x00000000dd3c68>
<RickHull>
did you try without the dup?
<envygeeks>
Doing delete on ENV without a dup is reckless
<rue>
:D
<rue>
You want two envs?
<RickHull>
ENV.class == ENV.dup.class #=> true
<envygeeks>
No, I just wanted to pull a variable like I do with ARGV where it will return nil or the value quickly
<rue>
You probably need ENV#to_hash
<envygeeks>
hmmm... actually I never thought of that let me try
postmodern joined #ruby-lang
<rue>
ENV is *the* env
<RickHull>
using delete to "pull" a variable seems like a funny idea
<RickHull>
why not: ENV['asdf'] #=> nil
<RickHull>
ENV['PATH'] #=> "/usr/local ..."
<erikh>
ENV isn't a hash
<erikh>
it just looks like one.
<erikh>
oh I see from my second pass at the scrollback this has already been addressed
* erikh
returns to his rock
jkyle joined #ruby-lang
<jorgenpt>
Is there a nice way to deal with binary protocols that normally require pack/unpack etc, to nicely wrap it in something like a Struct?
<rue>
There's a gem, I think
<rue>
Also, depending on the use case, perhaps FFI may be more appropriate
<jorgenpt>
It'd be cool to have a way to say something like Message = BinaryStruct.new(:foo, "v", :bar, "v"), and then be able to do Message.new(data).foo etc
<MistyM>
Jake232: The full colon was tolerated syntax in Ruby 1.8, but doesn't work in 1.9. Use semicolons or then
<Mon_Ouie>
It's not what is in your code
<Jake232>
Ahh
<Jake232>
That would explan it
<Jake232>
Wow, this is annoying. It would seem this library
<Jake232>
Uses this in alot of places
dv310p3r joined #ruby-lang
<RickHull>
Jake232: congratulations on your new maintainership!
<Jake232>
Did Ruby 1.8.x, accept semi-colons?
<Jake232>
Or is that only 1.9.x?
<Mon_Ouie>
Yes, it did
<Mon_Ouie>
Also new-lines
<Jake232>
Right, that's a safe fix then.
<MistyM>
then also works in 1.8
<Jake232>
Is there a preffered standard?
<Mon_Ouie>
I use then when there is just one small expression in each case, new-line otherwise
<RickHull>
agreed
<Jake232>
AHh, it's not even on GitHub. Using RUbyForge, great :/
edwardsharp joined #ruby-lang
Wardrop joined #ruby-lang
<edwardsharp>
is there some way i can check to see if nested hash key exists ( if hash[:foo].has_key?(:bar, :baz) ) so if hash[:foo] is nil i get a NoMethodError, can I check is_hash? or something similar in one if statement?
chessguy joined #ruby-lang
<edwardsharp>
well, is_a?(Hash)
<rue>
hash[:foo] && hash[:foo][:bar] +
<rue>
?
<edwardsharp>
oh &&, of course!
<edwardsharp>
thx
kennyp joined #ruby-lang
fridim_ joined #ruby-lang
dr_bob joined #ruby-lang
adambeynon joined #ruby-lang
dejongge joined #ruby-lang
<queequeg1>
nuclearsandwich: Thanks for the recommendation
adambeynon joined #ruby-lang
<andrewvos>
omfg I just installed oh-my-zsh
leonL joined #ruby-lang
<deryldoucette>
careful if using RVM. The RVM plugin with oh-my-zsh needs work. that and the bundler one
gix joined #ruby-lang
<andrewvos>
deryldoucette: Careful how?
<edwardsharp>
overwriting you .zshrc
<edwardsharp>
your
<deryldoucette>
also, mpapis is going to work with the omz author to fix the plugin
<edwardsharp>
looks neat, tho. wonder if there's a bash flavor
<deryldoucette>
not sure if he's gotten to that yet. he's been seriously busy
<andrewvos>
WTH I don't even have to cd
apeiros_ joined #ruby-lang
Austin__ joined #ruby-lang
roha joined #ruby-lang
kennyp joined #ruby-lang
jimmy1980 joined #ruby-lang
rafaelchacon joined #ruby-lang
workmad3 joined #ruby-lang
<rafaelchacon>
Hello
zzak joined #ruby-lang
<rafaelchacon>
I'm founding an issue with URI.extract in both ruby 1.8.7 and ruby 1.9.2
mksm joined #ruby-lang
<drbrain>
rafaelchacon: show it!
<rafaelchacon>
If you try to extract un URI from the following text: