JMcAfreak has left #ruby ["Still here. /msg me if you really really need me."]
<snugglepus>
apeiros_, thanks for the help.
j^2 has joined #ruby
tcstar has quit [Read error: Connection reset by peer]
hybris has quit [Quit: hybris]
reset has quit [Ping timeout: 245 seconds]
adamjleonard has quit [Quit: Leaving...]
arya has quit [Ping timeout: 256 seconds]
arya has joined #ruby
ph^ has joined #ruby
Fitzsimmons has left #ruby ["Leaving"]
pyx has quit [Quit: WeeChat 0.4.0]
love_color_text has quit [Read error: Connection reset by peer]
drKreso has joined #ruby
samuel02 has quit [Remote host closed the connection]
zoned has quit [Quit: zoned]
jodjdu has joined #ruby
endzyme has quit [Ping timeout: 272 seconds]
<jodjdu>
Hello - I know that Math::sqrt(1) and Math.sqrt(1) are the same, so why doesn't Math.PI work?
<apeiros_>
PI is a constant, sqrt a method
nik_-_ has quit [Quit: nik_-_]
<Paradox>
pi is a c…oh damnit apeiros_
<Paradox>
you beat me
<Paradox>
lol
<Paradox>
:)
zenergi has quit [Remote host closed the connection]
<apeiros_>
while :: works to invoke methods (everywhere, afaik), . does not work to resolve constants
zenergi has joined #ruby
zenergi has quit [Changing host]
zenergi has joined #ruby
bradhe has quit [Remote host closed the connection]
zenergi has quit [Client Quit]
<apeiros_>
note though, :: to invoke methods looks rather antiquated
bradhe has joined #ruby
ph^ has quit [Ping timeout: 252 seconds]
tish has joined #ruby
<jodjdu>
Ok, so I'm confused about what :: and . are really intended for. :: resolves either a constant, or any other variable, or dispatches a method, and . just dispatches a method?
j^2 has quit [Quit: for i in `/names` ; do adios $i; done]
<apeiros_>
"or any other variable"?
<Paradox>
jodjdu, no
<apeiros_>
:: only resolves constants
<Paradox>
. is how you dispatch methods on things
tish has quit [Read error: Connection reset by peer]
angusiguess has joined #ruby
<jodjdu>
aepiros_: i say or any other variable, because a constant is just a variable with a naming convention isn't it?
<Paradox>
:: is how you call constants
tish has joined #ruby
<Paradox>
no, they're different internally two
<Paradox>
constants are…constant
<Paradox>
they never change
_nitti has joined #ruby
<Paradox>
during the runtime of the program
<Paradox>
two
<apeiros_>
(sadly) only theoretically true
<Paradox>
stupid swiftkey
<jodjdu>
Paradox: that's just a convention, not the actual semantics tho isn't it?
<Spooner_>
Paradox, You could use a different name to put a factory method on the module.
jgarvey has quit [Quit: Leaving]
rezzack has quit [Quit: Leaving.]
<Paradox>
i woke up like half an hour ago
<apeiros_>
I'd agree that Snoo.new would be confusing
<Paradox>
so im still a bit brain fuzzy
<apeiros_>
given that the general expectation is that Foo.new.instance_of?(Foo)
<jodjdu>
What I really want to know i guess, is whether or not :: and ., when used as method dispatch, are semantically equivalent? do they produce the same AST? and from what you're saying i guess they are
<Paradox>
again
<apeiros_>
they are
<Paradox>
nothing we say will be 100% true
<Paradox>
but mostly yes
benlieb has quit [Quit: benlieb]
<banisterfiend>
apeiros_: Paradox: thought :: can be useeful for methods that are 'fake' constructors
<apeiros_>
:: is 100% usable where . is
<banisterfiend>
though*
daniel_- has joined #ruby
<apeiros_>
banisterfiend: you mean like Nokogiri::XML() ?
<Paradox>
sigh, nokogiri
<banisterfiend>
apeiros_: yeah i guess
<apeiros_>
fugly IMO. but maybe that's just me.
<Paradox>
fugly as sin
<apeiros_>
I use that as Nokogiri.XML in all my code.
<Paradox>
i always have to open an old file or something if its been months since i used nokogiri
<Paradox>
just to remember to do it right
predator117 has joined #ruby
<banisterfiend>
apeiros_: well, i usually use it like this: A::B(c) instead of A::B.new(c)
<Paradox>
why io-console not install native binary
<Paradox>
its compilation fails
jodjdu has quit [Quit: Page closed]
<banisterfiend>
apeiros_: i think, (to use an example from p-dogg): Pry::Method(method) (which returns a Pry::Method instance) is nicer than: Pry.Method(method)
<banisterfiend>
apeiros_: it looks weird invoking a method that starts with a capital
<apeiros_>
banisterfiend: that's why I said b, not B
<apeiros_>
Pry.method, but that'd collide with Object#method
<banisterfiend>
apeiros_: ah
<apeiros_>
Nokogiri.xml(doc)
<banisterfiend>
fair enough, i just like that: Pry::Method(meth) makes it clear that an instance of Pry::Method will be returned
<apeiros_>
I understand that
<apeiros_>
I find it reasonable, but it's not the way I prefer
<apeiros_>
bedtime for me anyway :-/
<banisterfiend>
sleep well bb
<apeiros_>
gn8
<banisterfiend>
i should sleep too
<banisterfiend>
we're in teh same timezone :)
adkron has quit [Ping timeout: 264 seconds]
<banisterfiend>
>> p RubyVM::InstructionSequence.compile("Math.sin")
spider-mario has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
subbyyy has joined #ruby
occupant has quit [Quit: Leaving]
Bosma has joined #ruby
chrishough has quit [Quit: chrishough]
rupee has quit [Quit: Leaving]
chrishough has joined #ruby
angusiguess has joined #ruby
bradhe has joined #ruby
apok has joined #ruby
reset_ has quit [Quit: Leaving...]
danblack has quit [Ping timeout: 276 seconds]
splud has quit [Quit: splud]
rburton- has quit [Quit: Leaving...]
newUser1234 has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
skattyadz has joined #ruby
jpcamara has quit [Quit: jpcamara]
nachtwandler has quit [Remote host closed the connection]
sambao21 has joined #ruby
cableray has quit [Quit: cableray]
codespectator has quit [Ping timeout: 252 seconds]
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
codespectator has joined #ruby
codespectator has quit [Max SendQ exceeded]
takeru has joined #ruby
dhruvasagar has joined #ruby
codespectator has joined #ruby
codespectator has quit [Max SendQ exceeded]
juarlex has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
codespectator has joined #ruby
codespectator has quit [Max SendQ exceeded]
Chryson has joined #ruby
codespectator has joined #ruby
codespectator has quit [Max SendQ exceeded]
jrendell has quit [Ping timeout: 252 seconds]
ortuna has quit [Ping timeout: 272 seconds]
codespectator has joined #ruby
kristofers has quit []
etcetera has quit []
aleph-null has quit [Remote host closed the connection]
rupee has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
chrishough has quit [Quit: chrishough]
takeru has quit [Ping timeout: 248 seconds]
chrishough has joined #ruby
newUser1234 has quit [Remote host closed the connection]
newUser1234 has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
newUser1234 has quit [Read error: Connection reset by peer]
MrZYX is now known as MrZYX|off
dhruvasagar has quit [Ping timeout: 246 seconds]
newUser1234 has joined #ruby
thecarlhall has joined #ruby
dhruvasagar has joined #ruby
chrisnicola has quit [Quit: This computer has gone to sleep]
splud has joined #ruby
thecarlhall has quit [Client Quit]
SCommette has joined #ruby
freeayu has joined #ruby
pskosinski has quit [Ping timeout: 245 seconds]
chrishough has quit [Client Quit]
apeiros_ has joined #ruby
mikurubeam has joined #ruby
emanu has joined #ruby
tylersmith has quit [Quit: tylersmith]
ortuna has joined #ruby
angle has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
hadees has quit [Quit: hadees]
takeru has joined #ruby
sambao21 has quit [Ping timeout: 252 seconds]
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 244 seconds]
Kruppe has joined #ruby
werdnativ has quit [Ping timeout: 255 seconds]
chrishough has joined #ruby
dogweather has joined #ruby
takeru has quit [Ping timeout: 252 seconds]
zeade has quit [Quit: Leaving.]
jpfuentes2 has joined #ruby
bw_ has joined #ruby
apok has quit [Quit: apok]
apeiros_ has quit [Ping timeout: 246 seconds]
joeycarm_ has quit [Remote host closed the connection]
codespectator has quit [Ping timeout: 244 seconds]
adamjleonard has joined #ruby
danblack has joined #ruby
jpcamara has joined #ruby
dhruvasagar has joined #ruby
newUser1234 has quit [Remote host closed the connection]
newUser1234 has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
jpcamara has quit [Client Quit]
enebo has quit [Quit: enebo]
newUser1234 has quit [Ping timeout: 256 seconds]
ortuna has quit [Ping timeout: 252 seconds]
NiteRain has joined #ruby
aleph-null has joined #ruby
<lewix>
what's the difference between array[4] = "four" and array.replace("four")
<lewix>
sorry
<lewix>
what's the difference between array[4] = "four" and array[4].replace("four")
reset has joined #ruby
reset_ has joined #ruby
slainer68 has joined #ruby
pdamer has joined #ruby
ebobby has quit [Quit: Lost terminal]
<Spooner_>
lewix, The former creates a new string and puts it into the array. The latter replaces the characters in the string already in the array.
joeycarmello has joined #ruby
ph^ has joined #ruby
<lewix>
Spooner_: what's the difference between the two things youhave just said
reset has quit [Ping timeout: 272 seconds]
emergion has joined #ruby
<Spooner_>
In the latter case the string contents change, but the array is unchanged. In the former the array changes and the old string is thrown away.
skattyadz has quit [Quit: skattyadz]
mibitzi has joined #ruby
emergion has quit [Client Quit]
etcetera has joined #ruby
skattyadz has joined #ruby
aleph-null has quit [Ping timeout: 272 seconds]
<lewix>
Spooner_: if the string contents change doesn't it mean that the array changed
<Spooner_>
Well, not directly.
squidBits has quit [Quit: whoops]
ph^ has quit [Ping timeout: 272 seconds]
<Spooner_>
There is a difference between a String (object) and the characters (data) it contains.
dogweather has quit [Remote host closed the connection]
<lewix>
Spooner_: can you elaborate on the string contents change, but the array is unchanged
aleph-null has joined #ruby
senayar has quit [Quit: Quitte]
sam113101 has quit []
rburton- has joined #ruby
dhruvasagar has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
<Spooner_>
lewix, x, y = "x", "y"; p [x.object_id, y.object_id]; x = "a"; y.replace("b"); p [x.object_id, y.object_id] #=> output is [26550460, 26550420] then [26550180, 26550420]
aleph-nu_ has joined #ruby
bradhe has joined #ruby
<Spooner_>
x becomes a completely new String. y stays the same String, but its contents are changed.
<lewix>
I'm under the impression that the string contents change either way but one return a new array while another return the same?
havenwood has joined #ruby
aleph-nu_ has quit [Remote host closed the connection]
<Spooner_>
No, you are missing the difference between a variable and the Object that it points to.
apeiros_ has joined #ruby
Demux has left #ruby [#ruby]
Bosox20051 has joined #ruby
etcetera has quit []
codespectator has joined #ruby
aleph-null has quit [Ping timeout: 272 seconds]
thmz has quit []
<Spooner_>
If I do x = "frog" then x = "fish" then the String that is in x has been replaced. The old one will then be garbage collected since it has no references to it.
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<lewix>
Spooner_: what do you mean. didn't i just say the same thing you said phrased differently
bradhe has quit [Ping timeout: 248 seconds]
<lewix>
Spooner_: I understand that. I was referring to array in particular
<Spooner_>
If I do x << "y" it appends y to the end of the String in x (so it becomes "fishy" now). It is the same String object, but it has been altered.
<lewix>
Spooner_: so it returns a new array while the other don't
<Spooner_>
The fact that it is an array isn't important. An array just contains a list of objects; a regular variable holds one.
skattyadz has quit [Quit: skattyadz]
<lewix>
Spooner_: thanks y the way
<lewix>
by*
<lewix>
Spooner_: right I don't think you understood me. but you enlighten me. thank you
<bluesnow>
Hi, I'm getting a stack level too deep error from the line Dir[dump_dir.to_s+"/*.jpg"].sort
<bluesnow>
And I'm not sure why it's happening. There's a single .jpg file in the dump_dir directory
Voodoofish430 has quit [Quit: Leaving.]
ortuna has joined #ruby
<Spooner_>
Each Object has a unique ID, so you can see the way the String changes in my earlier example where I print out the ID at different points. The id of x changes; the id of y stays the same.
<Spooner_>
So, say I did z = y early on, it would still refer to the same String as y at the end, but if I did z = x, it would point to a different Object at the end than x does.
<lewix>
Spooner_: i do understand that. As I said,I was confused with reference to an object inside a collection
gtc has quit [Quit: kill -9 gtc]
Icarot has joined #ruby
arya__ has quit [Ping timeout: 248 seconds]
<Spooner_>
I see. It is just the same.
bonhoeffer has quit [Quit: bonhoeffer]
reset_ has quit [Ping timeout: 252 seconds]
sam113101 has joined #ruby
gtc has joined #ruby
<havenwood>
bluesnow: I don't know what is causing your problem, but (if you don't need File.join) good idea to: Dir["#{dump_dir}/*.jpg"].sort
<Spooner_>
bluesnow, Depends what dump_dir is. Maybe the stack is locked inside that (if it is a method), not in the Dir[] part.
<Spooner_>
The recursion error message in Ruby has always been absurd. I can't understand why it can't give you a stack trace at least for the last few methods it has passed through.
<lewix>
Spooner_: I would still say that the string content changed in both, the string object didn't change when i use the method replace.. what I didn't know was that Array[number] = foo returned a new array
<bluesnow>
The odd thing is that the dump_dir method was working before..
sn0wb1rd has quit [Ping timeout: 244 seconds]
<bluesnow>
Not sure what I changed to make it keep recursing
<wedgeV>
"gem --version" is 2.0.0 and "gem update --system" says latest version is installed. but the github repo has 2.0.1
atno has quit [Remote host closed the connection]
utf1000 has joined #ruby
kpshek has joined #ruby
araujo has quit [Quit: Leaving]
kpshek has quit [Client Quit]
<utf1000>
on a mac I can do this in ruby: exec 'say "test"' ... let's say I have a variable called "insult", what do I type?>
malkomalko has quit [Remote host closed the connection]
ph^ has quit [Ping timeout: 248 seconds]
<utf1000>
exec 'say "', insult, '"' isn't working
chico_chicote has quit [Remote host closed the connection]
jpcamara has quit [Quit: jpcamara]
<elliottcable>
you can embed a variable into a string, between the quotes
<elliottcable>
you have to put it inside curly brackets, with an octothorpe
<utf1000>
like a ${insult} ?
<elliottcable>
like this:
<elliottcable>
#{insult}
<utf1000>
ah
<elliottcable>
but, better yet, you don't need to use exec for that; you can use backticks
<elliottcable>
like this:
<elliottcable>
`say #{insukt}`
<elliottcable>
er, insult*
<elliottcable>
... incase it wasn't clear, you don't type that after exec; you just put it all alone
<utf1000>
sweeeet it works yes
<utf1000>
octothorpe eh? I'll note that.
philcrissman has joined #ruby
Es0teric has quit [Remote host closed the connection]
<elliottcable>
I just think “hash” is a stupid name for it (pot.); and “number sign” is even worse (that's №.)
karl___ has joined #ruby
danblack has joined #ruby
thinkclay has quit [Quit: Leaving.]
<utf1000>
pound?
alvaro_o has quit [Quit: Ex-Chat]
<utf1000>
"thingy" always works too
jjbohn|afk is now known as jjbohn
<karl___>
can the =~ and !~ operators be used to match a single character in a string? ie, should 'Albion' =~ /a/ return true?
<sam113101>
no because it's case sensitive by default
<sam113101>
'Albion' =~ /A/ works though
jdunck has quit [Quit: Computer has gone to sleep.]
<karl___>
thank you very much
blahwoop has joined #ruby
<sam113101>
(but what it really says is "does it contain an A?")
<sam113101>
don't know if that's what you wanted
<karl___>
that's exactly what i want
<karl___>
:)
<sam113101>
ok
<sam113101>
you could do 'Albian'['A'] also
<sam113101>
puts 'it does contain A' if 'Albian'['A']
<Spooner_>
Or 'Albion'.include? 'A'
<karl___>
this is all great stuff
<karl___>
much appreciated
twoism has quit [Remote host closed the connection]
<Spooner_>
For the regexp, you might have wanted 'Albion' =~ /a/i #=> 0 (which is a match)
Spooner_ has quit [Quit: Leaving]
luckyruby has quit [Remote host closed the connection]
ortuna1 has quit [Ping timeout: 248 seconds]
jjbohn has quit [Quit: Leaving...]
allaire has joined #ruby
jamesfung14 has quit [Ping timeout: 248 seconds]
Beakr has joined #ruby
apeiros_ has joined #ruby
philcrissman has quit [Remote host closed the connection]
Es0teric has joined #ruby
dogweather has quit [Remote host closed the connection]
<Beakr>
I know this is pretty nebbish, but since I've never done it before, if you declare a method like 'def something(arg=12)' will it make 'arg' optional, and unless explicitly defined in the functions arguments have a default value of 12?
jpcamara has joined #ruby
benlieb has joined #ruby
Takehiro has joined #ruby
lewix has quit [Remote host closed the connection]
Eerbin has quit [Read error: Connection reset by peer]
slainer68 has quit [Remote host closed the connection]
adamjleonard has joined #ruby
codespectator has quit [Ping timeout: 264 seconds]
heliumsocket has quit [Quit: heliumsocket]
heliumsocket has joined #ruby
poikon_work has joined #ruby
codespectator has joined #ruby
rickmasta has joined #ruby
ortuna1 has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
waxjar has quit [Ping timeout: 264 seconds]
robert__ is now known as robert_
poikon_work has quit [Ping timeout: 260 seconds]
waxjar has joined #ruby
codespectator has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
DrShoggoth has joined #ruby
brooks has joined #ruby
ortuna1 has quit [Ping timeout: 252 seconds]
dmerrick has quit [Quit: dmerrick]
<brooks>
how come no one talks in here??
fire has joined #ruby
hbpoison has joined #ruby
nik_-_ has joined #ruby
nik_-_ has quit [Client Quit]
<aytch>
we do
<aytch>
it's more active during US working hours
huoxito has quit [Ping timeout: 244 seconds]
razibog has quit [Read error: Operation timed out]
kofno has quit [Remote host closed the connection]
d2dchat has joined #ruby
naughtystyle has joined #ruby
ph^ has joined #ruby
lledet has quit [Quit: lledet]
sayan has joined #ruby
mneorr has joined #ruby
Chryson has quit [Ping timeout: 264 seconds]
hbpoison has quit [Ping timeout: 256 seconds]
dopie has quit [Ping timeout: 245 seconds]
ph^ has quit [Ping timeout: 255 seconds]
yacks has joined #ruby
apeiros_ has joined #ruby
ocnam has joined #ruby
philcrissman has joined #ruby
mneorr has quit [Ping timeout: 255 seconds]
hakunin_ has joined #ruby
mneorr has joined #ruby
<brooks>
hello
<brooks>
is anyone in here?
<aytch>
hi
naughtystyle is now known as naughtystyle458
<brooks>
let's talk about ruby!
<aytch>
Got a topic in mind?
<brooks>
no, I was hoping others would be in the room discussiong ruby issues… it seems this room isn't very active
hakunin has quit [Ping timeout: 245 seconds]
<aytch>
It does get active, but late friday evenings is not that time
d2dchat_ has joined #ruby
<brooks>
what?? that's when programmers are supposed to be on the computer eating cold pizza lol
cyberflux has quit []
<aytch>
strangely enough...not everyone is a stereotype
<brooks>
haha - I understand
<aytch>
for example, I'm a neckbeard, and I have little *nix-fu
<aytch>
I'm also skinny
<brooks>
yeah, I figured you were a unix guy if you have a beard!
codespectator has joined #ruby
<brooks>
go check out linus' most recent rant at some of the other contributors over microsoft's secure boot issue - interesting read
radic has quit [Disconnected by services]
radic_ has joined #ruby
<aytch>
I'm currently working through the Ruby Koans, but that sounds interesting
d2dchat has quit [Ping timeout: 248 seconds]
<brooks>
you just starting?
<aytch>
pretty much, yeah
<brooks>
cool
rickmasta has quit [Quit: Leaving...]
<aytch>
I'm a sysadmin, not a developer, but I learned some Puppet, got interested in Ruby so I could use Puppet better, and now I think Ruby is awesome
<brooks>
oh yeah, that is cool.
waxjar has quit [Ping timeout: 264 seconds]
kofno has joined #ruby
<aytch>
Now I've written horrible things like using Powershell to write out Puppet configs, and Ruby programs that run powershell scripts
kofno has quit [Read error: Connection reset by peer]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
angusiguess has joined #ruby
lewix has quit [Remote host closed the connection]
codespectator has quit [Ping timeout: 245 seconds]
VonKingsley has joined #ruby
codespectator has joined #ruby
sambao21 has joined #ruby
<aytch>
I will say my scripting is *way* more robust now, though
apeiros_ has quit [Ping timeout: 255 seconds]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
sambao21 has quit [Client Quit]
codespectator has quit [Ping timeout: 272 seconds]
codespectator has joined #ruby
sambao21 has joined #ruby
jamesfung14 has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 255 seconds]
IrishGringo has joined #ruby
tish has quit [Quit: Leaving.]
tjbiddle has joined #ruby
bradhe has joined #ruby
rupee has joined #ruby
philcrissman has quit [Remote host closed the connection]
kofno has joined #ruby
[rupee] has joined #ruby
[rupee] has quit [Read error: Connection reset by peer]
chrishunt has quit [Quit: ZzZzZz...]
chrishunt has joined #ruby
bradhe has quit [Ping timeout: 252 seconds]
rupee has quit [Ping timeout: 245 seconds]
mneorr has quit [Read error: Connection timed out]
aeontech has joined #ruby
hbpoison has joined #ruby
mneorr has joined #ruby
poikon has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
xemu has quit [Ping timeout: 256 seconds]
pdamer has quit [Quit: pdamer]
crackfu has joined #ruby
takeru has joined #ruby
sambao21 has quit [Quit: sambao21]
jamesfung14 has joined #ruby
sambao21 has joined #ruby
takeru has quit [Ping timeout: 248 seconds]
sambao21 has quit [Client Quit]
pdamer has joined #ruby
jamesfung14 has quit [Read error: Operation timed out]
Cyrus has joined #ruby
Cyrus has quit [Max SendQ exceeded]
apeiros_ has joined #ruby
Cyrus has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
Cyrus has quit [Max SendQ exceeded]
naughtystyle458 has quit [Quit: naughtystyle458]
pdamer has quit [Client Quit]
sirish has joined #ruby
SDr is now known as NightCreature
JaTochNietDan has quit [Ping timeout: 276 seconds]
uris has quit [Quit: Leaving]
Pandaen has quit [Ping timeout: 244 seconds]
trumpeter2003 has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 248 seconds]
trumpeter2003 has joined #ruby
joofsh has joined #ruby
Beakr has quit [Quit: Beakr]
rickmasta has joined #ruby
mneorr has quit [Read error: Connection timed out]
sirish has quit [Ping timeout: 245 seconds]
angusiguess has quit [Ping timeout: 264 seconds]
sirish has joined #ruby
mneorr has joined #ruby
d34th4ck3r has joined #ruby
aeontech has quit [Quit: aeontech]
JaTochNietDan has joined #ruby
arya has joined #ruby
apeiros_ has quit [Ping timeout: 246 seconds]
sambao21 has joined #ruby
dogweather has joined #ruby
elico has joined #ruby
miso1337 has quit [Quit: afk]
codespectator has quit [Ping timeout: 252 seconds]
pepper_chico has joined #ruby
phantasm66 has quit [Quit: *poof*]
dogweather has quit [Remote host closed the connection]
codespectator has quit [Ping timeout: 256 seconds]
Takehiro has joined #ruby
takeru has joined #ruby
codespectator has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
apeiros_ has joined #ruby
Honeycomb has joined #ruby
codespectator has quit [Ping timeout: 245 seconds]
takeru has quit [Ping timeout: 260 seconds]
allaire has quit []
redbaritone has joined #ruby
arya has quit [Ping timeout: 248 seconds]
codespectator has joined #ruby
redbaritone has quit [Client Quit]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mibitzi has joined #ruby
mockra has quit [Remote host closed the connection]
codespectator has quit [Ping timeout: 252 seconds]
Myconix has quit [Quit: Server Error 482: The server has been shot by a 12-gauge, please contact an administrator]
ershad has quit [Quit: ershad]
Takehiro has quit [Remote host closed the connection]
JaTochNietDan has quit [Ping timeout: 256 seconds]
<lewix>
VonKingsley: it's correct
SCommette has quit [Quit: SCommette]
<reactormonk>
nope. return in initialize tends to fail
<VonKingsley>
lewix: doesn't the constructor return the object not a string from return?
arietis has joined #ruby
<reactormonk>
VonKingsley, changed it.
<lewix>
return is optional
codespectator has joined #ruby
hakunin has joined #ruby
<reactormonk>
return is useless
apeiros_ has quit [Ping timeout: 246 seconds]
<VonKingsley>
reactormonk: thanks for the change, I get whats going on now.
SCommette has joined #ruby
hakunin_ has quit [Ping timeout: 272 seconds]
HecAtic has joined #ruby
<lewix>
VonKingsley: puts was missing, I missed that. you were right. return is optional, most people don't use it
<reactormonk>
aytch, small warning: puppet is messy
<reactormonk>
lewix, it is _not_ optional in initialize. It is useless, because it will always return the new instance.
<Hanmac>
isnt the return value of initialize totaly ignored?
ph^ has joined #ruby
codespectator has quit [Ping timeout: 248 seconds]
<lewix>
reactormonk: you get the exact same output in irb whether you use return on not
drKreso has quit [Quit: drKreso]
Apocalypse has quit [Ping timeout: 245 seconds]
<VonKingsley>
thats because the code is run in initialize the return in the object that was created
tomzx_mac has quit [Ping timeout: 252 seconds]
jankly has joined #ruby
drKreso has joined #ruby
drKreso has quit [Client Quit]
ph^ has quit [Ping timeout: 272 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
subbyyy has quit [Ping timeout: 252 seconds]
mockra has joined #ruby
<lewix>
VonKingsley: what?
Apocalypse has joined #ruby
whowantstolivefo has joined #ruby
yashshah has joined #ruby
arya has joined #ruby
ClownZ has joined #ruby
ClownZ has left #ruby [#ruby]
ClownZ has joined #ruby
<ClownZ>
clear
<ClownZ>
ops
mockra has quit [Remote host closed the connection]
znode has joined #ruby
<VonKingsley>
lewix: Are you doing return puts "foo" in the initialize method? Or just return "foo" ?
<lewix>
return puts "foo"
znode has quit [Remote host closed the connection]
IrishGringo has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0/20130215130331]]
<VonKingsley>
when Class.new is called, the puts "foo" is still evaluated and shows up in irb, its not really returned, the return is ignored and instead an instance of the class is returned
yshh_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
<ClownZ>
*o apeiros
araujo has joined #ruby
bubblehead has quit [Remote host closed the connection]
<lewix>
VonKingsley: ok . thanks
toekutr has quit [Remote host closed the connection]
aedornm has joined #ruby
yshh has joined #ruby
hbpoison has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
adamjleonard has quit [Quit: Leaving...]
yshh has quit [Ping timeout: 252 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
hbpoison has joined #ruby
arya has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
<pandawarrior>
i want to include a module into a singleton class, but when I do - i get no method error for the module methods. do i have to extend the module in order to gain access to its instance methods?
joschi has quit [Remote host closed the connection]
joschi has joined #ruby
mulinux has quit [Quit: mulinux]
khismetix has joined #ruby
Kuifje has joined #ruby
Kuifje has joined #ruby
Kuifje has quit [Changing host]
skattyadz has quit [Client Quit]
horofox has quit [Quit: horofox]
velCzupa has joined #ruby
sayan has quit [Ping timeout: 272 seconds]
zoonfafer has quit [Remote host closed the connection]
m8 has joined #ruby
ozgura has quit [Remote host closed the connection]
banister`sleep has joined #ruby
drale2k has quit [Ping timeout: 245 seconds]
codespectator has quit [Ping timeout: 255 seconds]
horofox has joined #ruby
BRMatt has joined #ruby
whitedawg has quit [Quit: Leaving.]
BRMatt has quit [Client Quit]
banister`sleep is now known as banisterfiend
gokul has quit [Quit: Leaving]
d34th4ck3r has quit [Read error: Connection reset by peer]
ph^_ has quit [Remote host closed the connection]
atno has joined #ruby
elaptics is now known as elaptics`away
codecop has quit [Ping timeout: 248 seconds]
jetblack has quit [Ping timeout: 240 seconds]
codespectator has joined #ruby
tritlo has joined #ruby
m3pow has joined #ruby
nari has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
spider-mario has joined #ruby
Break has joined #ruby
Break has quit [Client Quit]
cephalopod has joined #ruby
noxoc has quit [Quit: noxoc]
<cephalopod>
when I .capitalize a string, shouldn't all words in the string get capitalized?
elaptics`away is now known as elaptics
<cephalopod>
i.e. hello = "hello world"; hello.capitalize
elaptics is now known as elaptics`away
himsin has joined #ruby
pac1 has joined #ruby
<apeiros_>
no
<apeiros_>
capitalize is first character of string upcase, rest downcase. there's no concept of words.
<heftig>
activesupport has #titlecase
sayan has joined #ruby
quazimodo has quit [Ping timeout: 264 seconds]
elico has quit [Quit: elico]
<cephalopod>
ah. it activesupport a gem?
horofox has quit [Quit: horofox]
chussenot has quit [Quit: chussenot]
Morkel has joined #ruby
<cephalopod>
basically I'm on linux and I'm a fan of Tomboy (notes) and it's wiki-word function. I wanted to convert user input say: "Three blind mice" to convert into "ThreeBlindMice" so I can then turn that string into a link
tritlo has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<apeiros_>
I think rails has a helper for that. I'd ask in #rubyonrails
<cephalopod>
now that I think of it... it's probably just going to be easier to have the tomboy-notes on the site and just tell them to use the WikiWord format
<cephalopod>
I appreciate the input.
tritlo has joined #ruby
krz has quit [Quit: krz]
<banisterfiend>
cephalopod: its*
<banisterfiend>
how does tomboy compare to evernote?
<Hanmac>
>> p "Three blind mice".scan(/\w+/).map(&:capitalize).join
<cephalopod>
never tried nevernote.. tomboy is pretty basic, but I like the simplicity. I've had a lot of trouble getting tomboy to convert notes into a mindmap.... that's my next mini-project
tritlo has quit [Quit: leaving]
tritlo has joined #ruby
<banisterfiend>
cephalopod: evernote is simple too, but the cool thing is it's cloud-based
<banisterfiend>
so you access/add/modify notes on all your devices
takeru has joined #ruby
<cephalopod>
what's with #rubyonrails? the chanserv keeps replying in #railsnoob...
browndawg has quit [Quit: Leaving.]
<cephalopod>
and my nick is already reg'd on freenode
Stilo has joined #ruby
ozgura has joined #ruby
<cephalopod>
when I try and do anything re: nickserv.... freenode responds
<Hanmac>
bjhaid your problem is that you forgot the || before the = []
<shevy>
bjhaid are you using ruby since years?
ph^ has quit [Ping timeout: 272 seconds]
<bjhaid>
shevy been coding ruby for 2 - 3 years, but I have never met a ruby developer in person, so I learn all off the internet, moreover, I work in a coy where most of the developers are java dudes
<Hanmac>
also interesting:
<Hanmac>
>> p [[:x,1,2,3],[:y,1,2,4],[:x,1,6,3],[:y,1,7,4]].group_by(&:first)
<shevy>
yeah, not many (pure) ruby guys I know either... I know some railsers in vienna though
<Hanmac>
"ruby developer in person" does not exists ... we are all bots there :P
<QKO>
very intelligent bots
<bjhaid>
Hanmac: sorry quick question, why do I need the || ??
<bjhaid>
:D
<QKO>
from the google code project
<Hanmac>
bjhaid: "x[y.first] = []" resets the entry everytime, "x[y.first] ||= []" does it only the first time
one has quit [Ping timeout: 245 seconds]
<bjhaid>
oh okay, nice one, wouldnt forget that
takeru has quit [Remote host closed the connection]
tritlo has quit [Quit: restarting irc client]
<QKO>
oh and our responses are so slow because we're all running from the same 486 with 56k
<QKO>
with 32mb diskspace
tritlo has joined #ruby
<bjhaid>
Hanmac thanks for saving my day(s) though :-)
<banisterfiend>
bjhaid: i would never write code this complicated :P [[:x,1,2,3],[:y,1,2,4],[:x,1,6,3],[:y,1,7,4]].inject({}) { |x,y| x[y.first] = []; x[y.first] << y[1..3]; x }
<banisterfiend>
sounds like you need an object there
philcrissman has joined #ruby
ianfleeton has joined #ruby
<banisterfiend>
[:x, 1, 2, 3] ==> make that into some kind of class
khismetix has quit [Quit: Computer has gone to sleep.]
mootpointer has joined #ruby
<pandawarrior>
is there a way to get something from the command line but if nothing is given use a default value in the code
<bjhaid>
banisterfiend: its a result from quering with OCI8, previously I had to split all this into separate classes and sorts,but I just thought of it, why not use ruby syntatic sugar??
tjbiddle has joined #ruby
<pandawarrior>
i tried number = ARGV[0] ||= 3
<pandawarrior>
but that always uses ARGV even if nothing was entered into the command line
kristofers has quit []
Mon_Ouie has quit [Ping timeout: 255 seconds]
kofno has quit [Read error: Connection reset by peer]
<Spooner>
with_object makes more sense than inject here: [[:x,1,2,3],[:y,1,2,4],[:x,1,6,3],[:y,1,7,4]].with_object({}) { |y, x| (x[y.first] ||= []) << y[1..3] }
<shevy>
pandawarrior no need to use ARGV directly, pass it through a method instead
<pandawarrior>
shevy: how would i know if something has been entered, though?
yshh has quit [Remote host closed the connection]
<shevy>
ARGV always exists
<shevy>
if you dont provide commandline arguments, ARGV will be empty
<shevy>
so in your code, the method, you could check whether you pass an array or not, if yes, you could assume that you try to use ARGV
<pandawarrior>
so i can say: number = 2 if ARGV[0].empty?
<shevy>
and if it is empty, you can use default values
<shevy>
yes, but dont use ARGV directly
<shevy>
pass it through a method
<pandawarrior>
k
<pandawarrior>
got it
<pandawarrior>
i'll use a ternay operator
bonhoeffer has quit [Quit: bonhoeffer]
<pandawarrior>
the ARGV stuff will be in a method
<shevy>
ARGV may used be tainted input, so that's one more reason to not use it directly
<Spooner>
pandawarrior, number = ARGV[0] || 3
<shevy>
or frozen, I forgot the proper term
<apeiros_>
if you want to use inject, use merge: ary.inject({}) { |h,(k,*v)| h.merge({k => v}) { |_k,v1,v2| v1+v2 } }
<pandawarrior>
Spooner: that looks good
<apeiros_>
^ @ pandawarrior
<apeiros_>
or actually
<apeiros_>
whose question was that? :)
jphpsf has quit [Ping timeout: 248 seconds]
<pandawarrior>
which question in particular?
<Spooner>
apeiros_, It was bjhaid
<shevy>
Spooner always is in full control on #ruby :)
techlife has joined #ruby
techlife has quit [Max SendQ exceeded]
bonhoeffer has joined #ruby
techlife has joined #ruby
cephalopod has quit [Quit: Nice Scotty, now beam my clothes up too!]
<Spooner>
I wish.
cephalopod has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
cephalopod has quit [Client Quit]
cephalopod has joined #ruby
banisterfiend has quit [Remote host closed the connection]
cephalopod has quit [Client Quit]
cephalopod has joined #ruby
nicoulaj has joined #ruby
pandawarrior has quit [Quit: Leaving.]
xardas has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
cuci has joined #ruby
`brendan has joined #ruby
<cuci>
hi guys! I'm trying to populate, through a rake task in rails, a sql database form a csv file but it takes forever and a day and I was thinking maybe using multithreads or multiprocessing would help
<cuci>
what should I google for here?
<cuci>
could point me to a nice tutorial in that direction?
<Hanmac>
cuci #rubyonrails ?
<Spooner>
cuci look at parallel gem perhaps? If it is primarily waiting for the database, however, parallelising it isn't going to help too much.
drale2k has joined #ruby
poga has quit [Remote host closed the connection]
browndawg has joined #ruby
<Spooner>
cuci, You might be better off trying to optimise the code by, for example, setting several records in the DB with a single action if you aren;'t already doing that now.
codecop has joined #ruby
cephalopod has quit [Quit: Nice Scotty, now beam my clothes up too!]
cephalopod has joined #ruby
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
nari has joined #ruby
sandGorgon has joined #ruby
Morkel has quit [Quit: Morkel]
bonhoeffer has joined #ruby
drale2k has quit [Read error: Connection reset by peer]
krz has joined #ruby
drale2k has joined #ruby
robustus has quit [Ping timeout: 248 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
cephalopod has quit [Quit: Nice Scotty, now beam my clothes up too!]
mpfundstein has quit [Remote host closed the connection]
carlyle has joined #ruby
TheFuzzball has joined #ruby
<kevingriffin>
That would give the class access to the module's methods
arya has joined #ruby
<kevingriffin>
But it doesn't really make sense, right?
TheFuzzball has quit [Max SendQ exceeded]
TheFuzzball has joined #ruby
maycon has quit [Ping timeout: 260 seconds]
drale2k has quit [Quit: Leaving...]
otherj has joined #ruby
ortuna has joined #ruby
drale2k has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
horofox_ has quit [Quit: horofox_]
angusiguess has quit [Ping timeout: 248 seconds]
jerius has joined #ruby
takeru has joined #ruby
philcrissman has quit [Remote host closed the connection]
cuci has quit [Read error: Connection reset by peer]
ianfleeton has quit [Quit: ianfleeton]
cuci has joined #ruby
b26 has joined #ruby
ddd has joined #ruby
`brendan has quit [Read error: Connection reset by peer]
takeru has quit [Ping timeout: 245 seconds]
verysoftoiletppr has quit []
allaire has joined #ruby
allaire has quit [Excess Flood]
cyberflux has joined #ruby
slainer68 has quit [Remote host closed the connection]
crackfu has joined #ruby
marwinism has joined #ruby
carlyle has quit [Remote host closed the connection]
skattyadz has quit [Quit: skattyadz]
bonhoeffer has joined #ruby
huoxito has joined #ruby
<shevy>
guys, anyone knows if I can find out whether a remote file exists, in ruby-ftp ?
<shevy>
I'd like to do: "if remote file bla.txt exists, download it, else display that it does not exist"... but it seems as if there either is no direct way to do that, or I can't find it
<shevy>
for ftp that is
bonhoeffer has quit [Client Quit]
sonda has quit [Ping timeout: 252 seconds]
sonda has joined #ruby
b26 has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<epitron>
what happens if you download a nonexistant file?
<epitron>
does it just write a zero-byte file?
<ddd>
it *should* error the attempted GET
<epitron>
you mean RETR :)
<ddd>
hehe yeah sorry
<epitron>
and yes, ruby-ftp sounds like it needs a patching
daniel_-_ has joined #ruby
<epitron>
a good hard patching
<ddd>
been talking in rails chan, so got gets and puts on the brain right now :)
<epitron>
the web is taking over!!!!
<ddd>
yeah no shit :)
<epitron>
eventually the CPU will just be an http server
<epitron>
GET 0x0e817f7
hbpoison has quit [Ping timeout: 256 seconds]
<epitron>
PUT ax
<ddd>
i was reading Bill Gate's Business @ the Speed of Thought. Most of his predictions are already true or are happening now. He predicted it would become not only mainstream but critical infrastructure.
khismetix has joined #ruby
<epitron>
wasn't bill's plan to crush the web and replace it with a microsoft platform like .NET?
<epitron>
or had he accepted his fate in 1999?
quazimodo has quit [Ping timeout: 246 seconds]
ortuna has quit [Ping timeout: 252 seconds]
tomzx_mac has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
<epitron>
in the review it says he's talking about a digital nervous system
<epitron>
that doesn't have to be the web, necessarily
<ddd>
hehe he never planned to do that.
drale2k has quit [Quit: Leaving...]
cuci has quit [Read error: Connection reset by peer]
<epitron>
that was his approach when he crushed netscape and extended java in the mid-late nineties :)
cuci has joined #ruby
<ddd>
yeah he's talking about a digital nervous system as the computer network being like the neural system inthe human body
<epitron>
maybe he wrote that in the book because of his antitrust problems
sambao21 has quit [Quit: sambao21]
drale2k has joined #ruby
<ddd>
being able to conduct business at near-same speeds
<epitron>
sure, that's just the evolution of all large organisms
<epitron>
businesses included
<ddd>
true, but for a long time, even business execs didn't realize that
<epitron>
you need all your "limbs" coordinated :)
<shevy>
epitron hmm it throws a Net::FTPPermError
locriani_ has joined #ruby
<ddd>
the integration of the web and the Web Lifestyle was *just* beginning to take shape and form
<epitron>
shevy: oic. i guess that's how they expect you to check if a file exists then :)
<shevy>
"#<Net::FTPPermError: 550 DELE: Couldn't get file status for bla.txt"
<shevy>
epitron yeah :(
<ddd>
actually, many predicted the web would fail. funnily
<epitron>
DELE?
<epitron>
i thought the problem was RETR :)
sambao21 has joined #ruby
<shevy>
not right now, I am killing some ancient remote files before I upload new ones hehehe
<epitron>
ddd: i think most people just hoped the web would be replaced with something that didn't suck so hard
<epitron>
but, alas, for-profit corporations can't agree on anything
<epitron>
and their fighting allowed the browser to glacially evolve
jpcamara has joined #ruby
<ddd>
the underlying tech is facinating, from the IP protocol suite to the languages in use to design / code for it.
<shevy>
until everyone is using chrome!
<ddd>
i truly find the tech we use daily simply amazing.
<epitron>
20 years later, and look! we can almost write games in a browser! if not for that lousy caching
sambio has joined #ruby
locriani_ has quit [Remote host closed the connection]
<epitron>
but chrome extensions solve the caching problem!
<epitron>
everyone just has to use chrome
<epitron>
:D
<ddd>
i was thinking last night about just whats involved generically in just something like downloading a file to my computer and displaying it via wifi
locriani has quit [Ping timeout: 245 seconds]
atno has quit [Remote host closed the connection]
<ddd>
if you stop and think about all the individual tech involved, and then think back to say 1988 (I was 18) and now.. man has the world changed
<shevy>
well, a protocol for communication
<epitron>
it is truly amazing that our systems work at all :D
<ddd>
and then twitter and facebook.. interactive web, movies and tv by network.. phone calls, email, etc. our world has been transformed more by just the internet and the various techs it makes use of or caused to grow up FOR it, than all the inventions previously like the car etc
daniel_-_ has quit [Quit: WeeChat 0.3.9.2]
<epitron>
you're right, if you look at the big picture, humanity makes amazing progress
<epitron>
it just takes lifetimes to do it
<epitron>
that's so goddamn slow, in my opinion :)
<ddd>
yeah, we're slow to mainstream, but when we do.. wow
<shevy>
ddd yeah, it always reminds me of the phrase "to stand on the shoulders of giants"
<epitron>
that's pretty scary, actually
fatih1982 has joined #ruby
<epitron>
if something that mainstreams destroys the planet, it's like, "ah well! too late to stop it now!"
<ddd>
shevy: I have that book. with the foreword by Stephen Hawking
<ddd>
epitron: hehe, nukes
<epitron>
"i guess we'll just all have to die!"
<shevy>
a friend had a smartphone with us here, he was shaking it forward, and it made a whipping sound effect (like indiana jones movie whip)
<epitron>
not nukes.. the insidious, useful things
<epitron>
like oil
postmodern has quit [Quit: Leaving]
<ddd>
ah yeah
<shevy>
and I thought... a smartphone is like a sound maker!
kirun has joined #ruby
<epitron>
guns, germs, and steel talks about how civilizations just destroy themselves because they don't want to give up conveniences
<ddd>
when humanity as a whole decides to move off fossil fuels to some alternative, that will be our next 'revolution' i believe
<epitron>
some ancient island civilzation just cut down all their trees, then died off
<shevy>
epitron I think if one thing would destroy humanity, it would be either greed or boredom
<epitron>
they knew they were running out of trees
<ddd>
Michio Kaku was mentioning that very thing
<epitron>
but they were like, "eih, what're we gunna do"
<shevy>
ddd but as long as you can generate huge profits, how is moving away from it possible?
cuci has quit [Read error: Connection reset by peer]
cuci has joined #ruby
<ddd>
shevy: its not
<epitron>
ddd: hopefully it will be mainstreamed quickly, and won't itself be an insidious destroyer :D
ozgura has joined #ruby
girija has joined #ruby
<shevy>
one would need a better alternative to replace existing (sucking) tools
<ddd>
the world is so money centric that until we can make it more advantageous TO change, we're going to be in a fight with the fossil fuel moguls
<shevy>
like ruby versus php :D
<shevy>
yeah ddd
atno has joined #ruby
<shevy>
and, fossil fuel is also hugely important for the synthetic chemistry, it's not easy to replace all that
<epitron>
shevy: how would boredom destroy civilization? you mean, because people would end up doing pathological things to while away the time?
davetherat has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 260 seconds]
<ddd>
epitron: the problem will be laws and corporate mentalities. Buy alternative techs that could *feasibly* replace fossil fuels and bury them in corporate vaults is the norm right now
davetherat has joined #ruby
<ddd>
another is the cost of retooling
<ddd>
so many industries to retool
<shevy>
epitron well, I think that people do stupid things when they are bored
cuci has quit [Read error: Connection reset by peer]
<epitron>
shevy: yeah. some scientists were saying that it would be way better to save all the remaining oil and use it as a building material instead of burning it. you can turn a barrel of oil into lots of awesome things.
<epitron>
and those things don't pollute :)
<epitron>
they're inert, like plastic
kraljev has left #ruby [#ruby]
<epitron>
(there's probably some runoff in the production process, tho)
<shevy>
epitron and imagine a perfect society where everyone has everything he/she wants to have
ceez has joined #ruby
<shevy>
then I would be almost sure that idiots pop up, the more bored they are :)
<epitron>
utopia \o/
<shevy>
hehehe
<ddd>
another problem is power
skattyadz has joined #ruby
<epitron>
robots can have power
<epitron>
let the humans just be pets
<epitron>
:D
<shevy>
ddd what kind of power? you mean in society?
adkron has joined #ruby
<epitron>
galactitron megabrain is the best ruler
<ddd>
controlling the source (mining, delivery, etc) gives you tons of societal and social-mindspace power
sambao21 has quit [Quit: sambao21]
<shevy>
yeah
cuci has joined #ruby
<shevy>
or patents. you can use them strategically to exclude or limit (or milk money) from competition
<ddd>
yeah
<epitron>
eventually, all our activity will be turned over to computer coordination
jpcamara has quit [Quit: jpcamara]
<shevy>
I should have become a lawyer
Morkel has joined #ruby
<epitron>
i suppose whoever put the backdoors into that computer will be the ultimate power
khismetix has quit [Quit: Computer has gone to sleep.]
<shevy>
epitron hehe
<shevy>
epitron and implanted id chips to get rid of anonymity
<epitron>
lawyering is weird. it's like programming. it mostly involves understanding arcane systems, and logic.
<ddd>
i understand this is how humans work. we're warrior-minded at heart. self centered (whether personally or business-wise), however, if we *don't* destroy ourselves first (like the Civilization Type model predicts) we'll eventually get out of this mind-phase, but we're probably still several 100 years away from that
ceez has left #ruby [#ruby]
<epitron>
i guess it also involves human psychology to a large degree
<epitron>
kinda like economics
<shevy>
well, with programming I at least have the feeling that sometimes I build/write something that is useful
<shevy>
lawyers for the most part seem to be cargo-cult carriers
sambao21 has joined #ruby
<ddd>
i'd say probably 200 years before we see humankind start aggregating (like countries on the same landmass or hemisphere combining into huge global voting and buying blocks)
<epitron>
you're right -- if you want to make big changes, you gotta go from lawyering/economics to congress :D
<epitron>
then you can change the outcomes of MILLIONS of court cases
<epitron>
not just one :D
<shevy>
yeah
<shevy>
and lobbyist
<ddd>
well, humankind isn't going to *really* accomplish *global* unity projects until we start combining
<ddd>
for example
<shevy>
ddd hard to do so as long as there is the "us versus them" mentality of trying to find enemies to fight against on the planet
cuci has quit [Read error: Connection reset by peer]
<ddd>
Say the EU's space agency and the US's space agency combine together as a single entity. Combining for research, purchasing, etc in order to build a space bridge
<epitron>
shevy: that's just the result of (real or perceived) scarcity
<ddd>
meaning moving the building of space vehicles TO space in order to launch farther out than our solar system.
iamjarvo has joined #ruby
<shevy>
yeah, they do that a lot already though. didn't NASA hire russian carriers for the next ~10 years to bring them into orbit?
<epitron>
the planet does have a lot of limits -- amount of resources, amount of land, amount of pretty caribbean islands
<epitron>
too many people who want those things == war
<shevy>
epitron yeah... once again it comes down to profit!
<ddd>
the cost of moving the initial construction equipment and resources to build a large spaceport is prohibitive for individual countries. but *combined* its cheaper
<epitron>
political and religious reasons are like... boredom :)
cuci has joined #ruby
<epitron>
actually, that's true
S2kx has quit [Quit: Leaving]
<epitron>
religions are about profit too
<epitron>
NEED MORE CUSTOMERS
<shevy>
yeah... the vatican bank
<ddd>
but with humankind's penchant for wanting and demanding profit position advantagous JUST for themselves rather than as a species, its not going to happen until the species as a whole realises the valueof doing it together
khismetix has joined #ruby
<ddd>
and then finding a way to actually make that come about
<epitron>
ddd: coordination is how single cells turned into mammals :)
joofsh has joined #ruby
<epitron>
it required every cell to be running the same program though
<epitron>
ROBOTS!
<shevy>
quite a big leap you stay here ;)
<shevy>
I mean, describe
<ddd>
epitron: true, but look how long it takes even mother nature to do so :)
<shevy>
Bacteria: "Hey, I am bored... let's team up and become a mammal guys!"
<epitron>
well, mother nature is doing it randomly
<ddd>
epitron: actually, i believe that robots are going to BE our saving grace
<epitron>
which is how humans are doing it too, for the most part
<ddd>
its whats REALLY going to open the human race to the stars
skattyadz has quit [Quit: skattyadz]
<epitron>
or our terminator downfall :D
atno has quit [Remote host closed the connection]
<shevy>
ddd we haven't even brought humans to mars yet!
<epitron>
it can go both ways
<shevy>
robots should start building towns on the mars though
<epitron>
shevy: i think what's going to drive people into space is asteroid mining
<ddd>
robotic mining of asteroid belts, robotic construction builders etc
<epitron>
there are asteroids out there made entirely of gold
<epitron>
or platinum
<epitron>
or uranium
<ddd>
shevy: yeah thats why i'm predicting at least 200 years out
<shevy>
epitron is that worth it at all? I mean, that surely costs a lot
<ddd>
I just wish i could live long enough to see if my prediction ends up being true
jphpsf has joined #ruby
<shevy>
ddd how long would you want to live :P
<epitron>
shevy: it costs a lot, but there's more gold out in a single asteroid than on the entire planet
<ddd>
150
<shevy>
epitron cool
<epitron>
(well, there's a lot of gold in the earth's core, but we can't get to it)
<shevy>
ddd why 150... why not 200... or 250... or 1000 ...
<epitron>
all the gold on our surface came from asteroid impacts
<ddd>
thats basically 2 human generations
davetherat has quit [Remote host closed the connection]
<ddd>
shevy: because i don't want to live forever
<shevy>
hehe
davetherat has joined #ruby
<ddd>
i'm 42 and thats a long time so far.
<shevy>
in medieval times you might have been well dead by now
<ddd>
i've seen lots change in this world. even doubling that i'll see many more great (and some terrible) things
<ddd>
but i don't want to live forever
<epitron>
ddd: i'm sure by the time you're 150 there will be lots of technologies that allow you to reincarnate yourself, like Doctor Who
<epitron>
you won't need to die :)
<ddd>
oh yeah. iirc the average age was 32
ortuna has joined #ruby
<epitron>
when you get bored, you can just reformat and reinstall
<ddd>
epitron: hahahah
<ddd>
niiiice
jerius has quit []
<epitron>
again, assuming we make it through robocalypse
atno has joined #ruby
<ddd>
i just find all this stuff facinating
<ddd>
the world, she be a'changing
<shevy>
epitron hah "when you get bored" told you! boredom :D
<epitron>
humanity's early 20's will be interesting
<epitron>
lots of experimentation
<epitron>
:D
<shevy>
after a few thousand years living, I think things just become repetitive
<ddd>
my 6yo is growing up with computers being as commonplace as dirt.
<ddd>
can you imagine what the world will be like for *his* kids?"
<Spooner>
epitron, I am planning to snuff it in the zombiapocalypse, long before the robot one.
<ddd>
s/'//
<ddd>
grr
<epitron>
shevy: yeppp... marvin the manically depressed robot \o/
<shevy>
lol
<ddd>
lol
<shevy>
I dont get why robots must have emotions
<ddd>
shevy: because its emotions that let us see the grey areas of life
<shevy>
not quite logical is it?
<epitron>
Spooner: what if you become a zombie?
<shevy>
ddd yeah but that is human centric
<ddd>
it grants us compassion, empathy, etc
<ddd>
rather than just straight logic
<shevy>
yes yes yes... you sound like a girl! :P
<epitron>
Spooner: do you have a plan for that? :)
<ddd>
right, but its humans' ability to have emotions that give us shades of grey
kofno has joined #ruby
<shevy>
ddd I'd like to view it purely as an intellectual thing, like the question: How can we populate the universe with robots
BizarreCake has quit [Ping timeout: 255 seconds]
<ddd>
shevy: i don't care if i sound like a girl, they got it right
jphpsf has quit [Ping timeout: 260 seconds]
drale2k has quit [Quit: Leaving...]
preyalone has joined #ruby
preyalone has quit [Remote host closed the connection]
<ddd>
i know that when I make decisions based soley on logic, many times the better decision would have been one that allowed emotions to at least color my decision data.
<Spooner>
epitron, No, that was the plan. I'd maybe last an hour in the zombiapocalypse as a human.
jphpsf has joined #ruby
<ddd>
epitron: reading snippet. brb
atno has quit [Remote host closed the connection]
<epitron>
shevy: emotions are what make sure animals don't do socopiathic things
<epitron>
some things make you feel bad, some things make you feel good
<epitron>
it's our social programming
drale2k has joined #ruby
<ddd>
exactly
<epitron>
they're just a subset of all of our neural signals
<ddd>
and hard logic, while definitely a plus, does not always make the best decision in the human world
<epitron>
they're fuzzier because social situations are fuzzy :)
<epitron>
you get very clear messages when you stub your toe
<epitron>
ddd: hard logic requires pre-programming everything
<epitron>
it's not adaptive
<ddd>
like someone steals your wallet. cold logic says have him or her arrested and put in jail. But, that person stole your wallet to get the money to feed his two kids that haven't eaten in 2 weeks. Should he really be put in jail?
<epitron>
NOT ADAPTIVE DIES
atno has joined #ruby
<ddd>
well not 2 weeks because th body can only survive a week without food
<ddd>
3 days without water
<pandawarrior>
i've got a test that needs to read from stdout.how can i gain access to stdout in rspec?
<epitron>
ddd: seems like a waste to pay hundreds of thousands of dollars of taxpayer money to put a guy in jail for stealing $200 in a wallet
<epitron>
:D
sambio has quit [Ping timeout: 245 seconds]
<apeiros_>
ddd: you can still use straight logic to solve that "moral" problem
<ddd>
isn't it $std.out?
<Spooner>
I was going to say that trying to get money to feed corpses implied they should be in a loony bin, rather than jail.
<ddd>
i do forget
<epitron>
this is why megatron omnibrain will be a better ruler
<epitron>
it can see the big picture
hbpoison has joined #ruby
<ddd>
apeiros_: expand on that?
jpfuentes2 has joined #ruby
<apeiros_>
ddd: a) likeliness of family becoming criminal due to person in jail, b) cost to community to support the family
<ddd>
epitron: ahh but we do still do that
<apeiros_>
you might not put him into jail for logical reasons, i.e., change his punishment to something that avoids a&b
<epitron>
apeiros_: sure, but the point we were talking about was flexibility
<ddd>
apeiros_: recitivism
BizarreCake has joined #ruby
<epitron>
apeiros_: "Cold hard logic" is fixed
<ddd>
right
jerius has joined #ruby
<apeiros_>
are we making up terms or is "cold hard logic" somewhere defined?
mpfundstein has joined #ruby
<epitron>
you can add massive amounts of detail, but then the world changes, and there are more cases missing
<ddd>
i see apeiros_'s point, but its the emotional and fuzziness of compassion that comes from the emotional response to that situation that allows us to make a better decision
<ddd>
both for society and for the individual that committed the 'crime'
<epitron>
ddd: the fuzziness is because we don't know what the outcomes will be
<epitron>
if we did, it wouldn't be fuzzy :)
<ddd>
well partly
<epitron>
it would be like pain
<apeiros_>
I think emotion is a kind of pattern matching, evolved to increase survival rate of the community
<epitron>
we know exactly where we cut ourselves
<Spooner>
pandawarrior, You can do stuff like $stdout.should_receive(:puts).with("hello") or just replace $stdout with a StringIO object if you want a lot of output collected.
drale2k has quit [Quit: Leaving...]
<apeiros_>
iow, it could be emulated/simulated/calculated
<ddd>
apeiros_: cold hard logic for this conversation is no emotional input allowed
<epitron>
apeiros_: yeah, that's what i said earlier
sandGorgon has quit [Read error: Connection reset by peer]
sandGorgon has joined #ruby
cuci has quit [Read error: Connection reset by peer]
<ddd>
epitron: ahh, but what about in cases like mine. i have nerve damage. i don't feel when i walk into a coffee table.
cuci has joined #ruby
<pandawarrior>
Spooner: i tried that but go expected 1 but received 0 times… i haven't tried StringIO, though
<pandawarrior>
so i'll give that a bash..
<ddd>
so there are additionals that impact
<epitron>
ddd: you are defective!
<ddd>
hahah
* epitron
recycles ddd
<ddd>
ass;)
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
<epitron>
my emotions tell me that that is a waste
<ddd>
pandawarrior: also, check out Session
<epitron>
but my logic tells me that that is efficient use of resources
<ddd>
gem seach session
adkron has quit [Ping timeout: 264 seconds]
<pandawarrior>
ddd ok
<ddd>
epitron: right, so logic says recycle me. emotion says i have a right to live
<ddd>
it also says that maybe i have other skills that my neuro deficiency doesn't affect
<apeiros_>
oooh, :( useless: "lineno counts the number of times #gets is called rather than the number of newlines encountered"
wallerdev has joined #ruby
<robert_>
apeiros_: wtf?
<Spooner>
apeiros_, You can use gets("\x00") to separate by whatever you like, so it does sort of make sense to do it that way.
<apeiros_>
Spooner: not really
<apeiros_>
File should have #line_separator and then "just do the right thing"
Takehiro has quit [Remote host closed the connection]
jphpsf has quit [Ping timeout: 252 seconds]
<apeiros_>
relying on a global is stupid anyway…
horofox has joined #ruby
<pandawarrior>
apeiros_: yup i'm adding rspec tests now, then i'm going to migrate
<Spooner>
Yeah, I'm not a fan of $anything, but it is how it is ;(
<apeiros_>
ew rspec
<pandawarrior>
?
* apeiros_
does not like rspec
<apeiros_>
but it's your choice ;-)
<pandawarrior>
apeiros_: ...
eliasp has quit [Ping timeout: 248 seconds]
<pandawarrior>
the rspec channel is pretty dead, that's why i'm here asking for rspec help
Eldariof-ru has quit [Read error: Operation timed out]
<pandawarrior>
it's a bit late for me to switch, but out of curiosity
<pandawarrior>
which other test frameworks do you prefer?
<Spooner>
I've tried others, but I end up back with rspec ;)
Eldariof-ru has joined #ruby
<apeiros_>
pandawarrior: until I finally finish my own baretest - plain test/unit with a bit of helper code
lledet has joined #ruby
Beakr has joined #ruby
generalissimo has joined #ruby
<Spooner>
I do use rr though, to replace rspec's verbose mocking though, if I have a lot of it to do.
<apeiros_>
rr+
mpfundstein has quit [Remote host closed the connection]
<pandawarrior>
i've sean steak
<apeiros_>
*rr++
<pandawarrior>
seen *
crackfu has quit [Remote host closed the connection]
<pandawarrior>
not seen rr
<pandawarrior>
will check it out
<pandawarrior>
what about steak, thoughts on that?
hogeo has joined #ruby
statarb3 has quit [Quit: Leaving]
mityaz has joined #ruby
freakazoid0223 has joined #ruby
samphippen has joined #ruby
hogeo_ has quit [Ping timeout: 260 seconds]
jphpsf has joined #ruby
m_3 has quit [Remote host closed the connection]
<aedornm>
I like steak medium-rare
lolmaus has quit [Read error: Connection reset by peer]
lolmaus has joined #ruby
dagnachew has quit [Read error: Connection reset by peer]
jphpsf has quit [Ping timeout: 248 seconds]
adayzdone has joined #ruby
Voting has joined #ruby
endzyme has quit [Remote host closed the connection]
<Spooner>
pandawarrior, Main advantage of rr is that it's syntax looks like a method call, rather than a sentence ;)
sayan has joined #ruby
<adayzdone>
this AppleSript reserves a pdf file to pdf … Is there a quick way of tweaking this to have it accept html as the in file? http://bpaste.net/show/1niHKqQJFmqJQTzqUoux/
locriani has joined #ruby
<adayzdone>
resaves*
mneorr has joined #ruby
<Spooner>
I've also considered using wrong as well. I've used a similar library in Python and it seems cleaner too. So Ideally, I'd use rspec without rspec :D
<banisterfiend>
adayzdone: this is #ruby
<adayzdone>
banisterfiend Hi … the meat of the script is ruby
<banisterfiend>
adayzdone: but the part you want help with is not ruby ;)
<Spooner>
"reserves a pdf file to pdf" - huh?
<adayzdone>
Spooner … For a strange bug in indesign
Eldariof-ru is now known as eldariof
<Spooner>
Why not just use Ruby for the conversion of the HTML-> pdf rather than generating a script for another language in Ruby? *boggles*
<adayzdone>
Spooner It is a small part of a larger AppleScript
<Spooner>
Oh no, you generate Ruby with Applescript. Crazy days :D
mercwithamouth has joined #ruby
<adayzdone>
So is there a way to change the ruby section to accept html files ?
<adayzdone>
Spooner … I don't know ruby yet … I hear it is fantastic
<Tricon>
I <3 Ruby.
<Spooner>
adayzdone, Most people in here are biased for Ruby though ;)
<Tricon>
JAVA FOREVER!
pdamer has joined #ruby
<Tricon>
LOLJKBRO.
enebo has quit [Quit: enebo]
crackfu has joined #ruby
<adayzdone>
Spooner :) … So is it possible to convert the script to accept a html file an output a pdf ?
<apeiros_>
why kidding? there must be a place to send all those who need punishment
<adayzdone>
I tried using cupsfilter but the output is horrible
<Spooner>
adayzdone, There is a simple example on that page I linked. Admittedly, ignore the stuff about markdown and just put the html in directly.
Eldariof-ru has joined #ruby
lledet has quit [Quit: lledet]
chussenot has quit [Quit: chussenot]
<Spooner>
Oh, since you are getting the code from a url, the second example is directly what you need.
<Spooner>
*getting the html from a url
<adayzdone>
I am getting the html for a file
<adayzdone>
kit.to_file("my_web_site.pdf") this ?
Takehiro has joined #ruby
eldariof has quit [Ping timeout: 244 seconds]
chussenot has joined #ruby
ffranz has quit [Quit: Leaving]
Takehiro has quit [Remote host closed the connection]
mikurubeam has joined #ruby
<Spooner>
PDFKit.new(infile).to_file(outfile)
<Spooner>
However, I believe that your script is getting PDFKit from Cocoa, not from Ruby. Never used Cocoa though, so not 100% sure.
newUser1234 has joined #ruby
<banisterfiend>
Hanmac: do u have a Backpfeifengesich ?
fire has quit [Quit: WeeChat 0.4.0]
crackfu has quit [Remote host closed the connection]
imami|afk is now known as banseljaj
samphippen has quit [Quit: Computer has gone to sleep.]
drale2k has joined #ruby
* apeiros_
hands banisterfiend a 't'
BizarreCake has quit [Ping timeout: 256 seconds]
samphippen has joined #ruby
sepp2k has joined #ruby
samuel02 has joined #ruby
drale2k has quit [Ping timeout: 248 seconds]
pen has quit [Remote host closed the connection]
samuel02_ has quit [Ping timeout: 248 seconds]
d2dchat has quit [Remote host closed the connection]
<adayzdone>
Spooner what does this line do ? pdf = PDFDocument.alloc.initWithURL(url)
<adayzdone>
takes the first argv and does what ?
Kruppe has joined #ruby
<Spooner>
I assume it is wrapping some Cocoa code. Creates a new PDF document from a url.
bonhoeffer has quit [Quit: bonhoeffer]
samphippen has quit [Quit: Computer has gone to sleep.]
<Spooner>
adayzdone, Yeah, it seems to be just wrapping Mac stupidlanguage: pdfDoc = [[PDFDocument alloc] initWithURL: [NSURL fileURLWithPath: [self fileName]]]
<Spooner>
But all this info is readily googleable.
lewix has joined #ruby
lewix has quit [Changing host]
lewix has joined #ruby
chussenot has quit [Quit: chussenot]
ddd has quit [Ping timeout: 245 seconds]
noxoc has joined #ruby
otters`away is now known as otters
lolmaus has quit [Read error: Connection reset by peer]
zul_ has joined #ruby
lolmaus has joined #ruby
Chryson has joined #ruby
BizarreCake has joined #ruby
ddd has joined #ruby
whowantstolivef1 has joined #ruby
<zul_>
hi guys I have a problem, I assign to a string variable a html code which refer to a file in the file system, http://pastebin.com/7m57yPNz when I try to run it I get localhost - - [02/Mar/2013:18:29:12 CET] "GET /tmp/data.tsv HTTP/1.1" 404 483
<zul_>
why?
<Spooner>
zul_, Either use separate files for your css/html or use the standard Sinatra way of embedding them in your source.
<zul_>
spooner that is all the code, just that file.rb
<Spooner>
But the reason you are getting 404 is because you aren't accepting anything but / and /a, but you are requesting /tmp/data.tsv
<Spooner>
But to fix the code to work (rather than to be "correct"), you need to do get '/tmp/data.tsv' do; a; end
Mattix has joined #ruby
testingb0t has quit [Quit: Leaving.]
<Spooner>
zul_, @@ marks an inline template (which makes it googleable :D).
chrisramon has joined #ruby
enebo has joined #ruby
wallerdev has joined #ruby
horofox has quit [Quit: horofox]
<Spooner>
zul_, Though if you are using Sinatra to serve just a single static page, it is slightly overkill!
<nmeum>
seems legit
kodeart has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
drale2k has joined #ruby
elico has joined #ruby
adamjleonard has joined #ruby
mneorr has joined #ruby
crackfu has joined #ruby
drale2k has quit [Ping timeout: 256 seconds]
philcrissman has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
yshh has joined #ruby
browndawg has joined #ruby
DrShoggoth has quit [Quit: Leaving]
browndawg has left #ruby [#ruby]
uris has joined #ruby
bryanjswift has quit [Ping timeout: 248 seconds]
<pandawarrior>
when is enough, enough?
niklasb has joined #ruby
<pandawarrior>
i have a module that gets included in a class
tommyvyo has joined #ruby
samuel02_ has joined #ruby
<pandawarrior>
i have tested the class
<pandawarrior>
but now i'm thinking of testing the modules methods too
yashshah has quit [Ping timeout: 244 seconds]
sepp2k has quit [Remote host closed the connection]
<pandawarrior>
all of the methods in this module get used to produce a final result and i have tests against what the results should look like and what they should contain
<pandawarrior>
that said is it good to just leave the module alone?
samuel02 has quit [Ping timeout: 252 seconds]
<pandawarrior>
if i do test it, it will be on line of test code for every line in the module
<pandawarrior>
and that seems a bit off
yshh has quit [Ping timeout: 272 seconds]
mpfundstein has joined #ruby
<apeiros_>
1:1 test ratio isn't bad
<apeiros_>
some advocate even higher test:code ratios
fire has joined #ruby
elico has quit [Remote host closed the connection]
newUser1234 has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 248 seconds]
hbpoison has joined #ruby
<pandawarrior>
true..
<pandawarrior>
i suppose
<pandawarrior>
but i was hoping to hear the other
<apeiros_>
then don't ask :-p
<shevy>
nah
<shevy>
pandawarrior, don't test
* apeiros_
's curios for the rationale…
<pandawarrior>
lol
<apeiros_>
*is
<shevy>
extra time spent
<apeiros_>
saved time
<pandawarrior>
i should have tested *first*
<apeiros_>
saved time upon every bug which doesn't happen in the first place
<pandawarrior>
retro fitting tests sucj
<apeiros_>
saved time upon every bug which still does happen
generalissimo has quit [Remote host closed the connection]
<apeiros_>
saved time upon every change/refactor/rewrite
crackfu has quit [Remote host closed the connection]
mpfundstein has quit [Remote host closed the connection]
<epitron>
a big refactor means you have to throw out all your tests tho
<epitron>
:)
<epitron>
(well, a subset of them)
mockra has joined #ruby
<Kuifje>
good morning
jonathanwallace has quit [Read error: Connection reset by peer]
thone has joined #ruby
thone_ has quit [Read error: Operation timed out]
maxmanders has joined #ruby
<apeiros_>
epitron: that's not a refactor then
adamjleonard has quit [Quit: Leaving...]
<apeiros_>
or you completely messed up coupling
bryanjswift has joined #ruby
<pandawarrior>
i must admit tests make me less scared to move stuff around
<apeiros_>
epitron: `Code refactoring is a "disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior"`
jonathanwallace has joined #ruby
drale2k has joined #ruby
<apeiros_>
emphasis on 'without changing its external behavior'
<apeiros_>
so either you a) don't refactor, or b) screwed up your tests if you have to rewrite your tests upon refactoring
stopbit has joined #ruby
<apeiros_>
pandawarrior: exactly
bubblehead has joined #ruby
drale2k has quit [Ping timeout: 272 seconds]
heliumsocket has joined #ruby
bubblehead has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
VonKingsley has joined #ruby
generalissimo has joined #ruby
joeycarmello has quit [Remote host closed the connection]
joeycarmello has joined #ruby
d34th4ck3r has quit [Ping timeout: 256 seconds]
fire has quit [Quit: WeeChat 0.4.0]
mtfk__ is now known as mtfk
chrishough has joined #ruby
philcrissman has quit [Remote host closed the connection]
ananthakumaran has quit [Ping timeout: 252 seconds]
sayan has quit [Ping timeout: 272 seconds]
adkron has quit [Ping timeout: 256 seconds]
Weazy has joined #ruby
bryanjswift has quit [Quit: Computer has gone to sleep.]
freakazoid0223 has quit [Read error: Connection reset by peer]
moos3 has joined #ruby
fire has quit [Client Quit]
samuel02_ has quit [Ping timeout: 255 seconds]
cableray has joined #ruby
Takehiro has joined #ruby
chrisramon has quit [Quit: chrisramon]
drale2k has joined #ruby
moos3 has quit [Client Quit]
arya has quit [Ping timeout: 248 seconds]
drale2k has quit [Ping timeout: 248 seconds]
heliumsocket has quit [Read error: Connection reset by peer]
moos3 has joined #ruby
sepp2k has joined #ruby
Takehiro has quit [Ping timeout: 264 seconds]
arya has joined #ruby
cephalopod has quit [Ping timeout: 256 seconds]
himsin has quit [Ping timeout: 255 seconds]
generalissimo has quit [Remote host closed the connection]
BizarreCake has quit [Quit: Leaving]
Beakr_ has joined #ruby
horofox has joined #ruby
<epitron>
apeiros_: "external behaviour" could be an api, or it could be the behaviour from the end-user's perspective
<apeiros_>
epitron: you're stretching it
<epitron>
there are many layers to a piece of software
<epitron>
you're telling me you've never refactored a system, and needed to change an API? :)
<apeiros_>
what behaviour wrt libraries is, is well discussed
<apeiros_>
I'm telling you you're abusing the term "refactor" if you really mean "rewrite"
chussenot has joined #ruby
niklasb has quit [Ping timeout: 248 seconds]
Beakr has quit [Ping timeout: 248 seconds]
Beakr_ is now known as Beakr
<epitron>
okay, throwing away all tests could be a rewrite situation
<apeiros_>
no. not "could". is.
<epitron>
depending on how you wrote your tests, though... a serious API change could break all of them
<epitron>
(probably bad test design tho :)
<apeiros_>
you do very much by definition NOT refactor if you have to change your tests. Or you test internal state in your tests (which may be valid, but usually should not be done)
SCommette has quit [Quit: SCommette]
moos3 has quit [Quit: Computer has gone to sleep.]
<epitron>
this sounds like a good working definition of refactor vs. rewrite. thank you for correcting me.
<apeiros_>
yw :)
mpfundstein has joined #ruby
<epitron>
i've always taken a more broad definition of "factor"
undersc0re97 has quit [Ping timeout: 248 seconds]
<epitron>
like in mathematics, where you decompose and recompose "things"
<aytch>
I've taken to understanding it as refactoring being "cleaning up the code" in order to make it easier to read; rewriting would be starting over to achieve the same functions in a different way. Is that a valid description?
<epitron>
in software, those things could be at any level of absrtaction
lastk has quit [Quit: Leaving]
<epitron>
hmmm
<apeiros_>
aytch: the deciding thing is whether you break your API in the process
fire has joined #ruby
<epitron>
refactoring can involve rewriting large parts of the code.
<aytch>
hmmm...in the codeacademy courses, they most teach refactoring as things like using one-line do blocks instead of the multi-line style
<apeiros_>
epitron: re different layers of software/code - yes, but there's different layers of tests too. if you refactor one given layer, you should not have to change any of the tests for *that* layer
<epitron>
again, it depends on the level.
undersc0re97 has joined #ruby
<epitron>
right.
<epitron>
that makes sense.
SCommette has joined #ruby
<apeiros_>
aytch: usually the intent of a refactor is to simplify the internal code, yes
<apeiros_>
at least I see no other reason to refactor
<epitron>
performance is a good reason :)
vlad_starkov has joined #ruby
<apeiros_>
ah, right
<apeiros_>
good point :)
kirun_ has joined #ruby
<apeiros_>
so we have: improve cpu footprint, improve memory footprint, make code nicer
<aytch>
is there a performance hit to using multi-line blocks as opposed to one-line blocks?
<apeiros_>
no
<apeiros_>
on how many lines you spread the same code makes no difference
<aytch>
then "refactoring" for performance would change your methodology, which would be a rewrite, yeah?
<apeiros_>
no
mikurubeam has joined #ruby
Edward__ has joined #ruby
kirun has quit [Ping timeout: 256 seconds]
<apeiros_>
take Array#sort
<epitron>
ruby's parser takes 378 nanoseconds longer to read a multiline codeblock actually
<apeiros_>
as long as the result is the same, it doesn't matter what algorithm is used internally
fire has quit [Client Quit]
Virunga has joined #ruby
<apeiros_>
but the different algorithms could vary wildly with regards to all three - readability, perfomance, used memory
<apeiros_>
*performance
sambao21 has joined #ruby
<epitron>
always write your code the simplest way first. :)
<epitron>
optimize later
jamesfung14 has joined #ruby
fire has joined #ruby
<epitron>
premature optimization is the root of all evil
thinkclay has joined #ruby
<epitron>
(that doesn't mean you shouldn't think about how you're structuring things though)
<epitron>
(analysis is also important)
<apeiros_>
those things change with experience
davorb_laptop has joined #ruby
<apeiros_>
but it's a solid advice for a long time at the start of your coding career
fir_ed has quit [Ping timeout: 248 seconds]
<epitron>
sure, if you've written some kind of app like 50 times, you generally can optimize it in your head
<epitron>
that's kinda what happens when you're an expert at anything -- you stop experimenting in the real world, and you start simulating the results of the experiments in your head
<epitron>
it leads to much faster evolution of the thing you're making
<apeiros_>
or you get "a feel" for it
<epitron>
frank lloyd wright, in his 80's, could "shake a design out of his sleeve"
scruple has joined #ruby
<apeiros_>
where you rarely even have to experiment, you just know a given solution will likely be the better (for whatever value of "better" in the given context)
<epitron>
he made the plans for "falling water" in about 2 hours
lledet has joined #ruby
<epitron>
he spent 3 months thinking about it though :)
<apeiros_>
and that's another important aspect of experience - you'll judge on what aspect means "better"
<apeiros_>
since quite often performance, memory footprint and readability are tradeoffs of each other
lledet has quit [Client Quit]
newUser1234 has joined #ruby
himsin has joined #ruby
<epitron>
you can actually solve all of those at once, but you also have to build your own compiler :)
drale2k has joined #ruby
fire has quit [Quit: WeeChat 0.4.0]
<epitron>
slight initial cost there
fire has joined #ruby
mfcabrera has quit [Quit: This computer has gone to sleep]
sambao21 has quit [Ping timeout: 272 seconds]
bonhoeffer_ has joined #ruby
blahwoop has joined #ruby
samuel02_ has joined #ruby
drale2k has quit [Ping timeout: 264 seconds]
VegetableSpoon has quit [Quit: Leaving]
chrisramon has joined #ruby
samuel02 has quit [Ping timeout: 256 seconds]
chrisramon has quit [Client Quit]
chrisramon has joined #ruby
chrisramon has quit [Client Quit]
sambao21 has joined #ruby
sirfilip has joined #ruby
himsin has quit [Ping timeout: 272 seconds]
blahwoop has quit [Ping timeout: 256 seconds]
yacks has quit [Read error: Connection reset by peer]
RyanD has joined #ruby
bonhoeffer_ has quit [Quit: bonhoeffer_]
tenmilestereo has joined #ruby
etcetera has joined #ruby
thinkclay has quit [Quit: Leaving.]
Voting has quit [Read error: Connection reset by peer]
lewix has quit [Remote host closed the connection]
shevy has quit [Ping timeout: 252 seconds]
Voting has joined #ruby
Virunga has quit [Remote host closed the connection]
lolmaus has quit [Read error: Connection reset by peer]
lolmaus has joined #ruby
<apeiros_>
damit, stupid 1.8, no String#end_with?
<davorb_laptop>
i hate old systems with 1.8
razibog has quit [Ping timeout: 248 seconds]
dhruvasagar has quit [Ping timeout: 248 seconds]
asdasdasdasdas has joined #ruby
drale2k has joined #ruby
fire has quit [Ping timeout: 246 seconds]
mockra has quit [Remote host closed the connection]
d2dchat has joined #ruby
<asdasdasdasdas>
i know this is ruby channel but... is ruby dead as many websites say?
drale2k has quit [Ping timeout: 245 seconds]
<asdasdasdasdas>
i would like to start learning ruby, it just looks cool, but if its dead...
<apeiros_>
news to me that many websites would say that
backjlack has quit [Remote host closed the connection]
<aytch>
I hang in #rubyonrails so I can watch people ask questions, because sometimes they ask smart questions and I can learn from the answers.
<epochwolf>
yay, another witness to my dickery. :/
undersc0re97 has joined #ruby
joofsh has quit [Remote host closed the connection]
<aytch>
Even if it's not a problem I have, it's a problem I may one day encounter.
<epochwolf>
aytch: yeah, there's plenty of room for funky problems.
coolj1 has quit [Remote host closed the connection]
hiroyuki has joined #ruby
<aytch>
I like seeing people's different approaches to problems, I think
statarb3 has joined #ruby
<aytch>
You get an idea for common problems and edge cases
<palladium>
interesting
<palladium>
smart move
<epochwolf>
aytch: I wish I worked with people who's approach to problems was enlightening instead of baffling.
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<palladium>
i'm trying to make a career change eventually but i have no formal training in CS just an undying passion to do anything other than what im doing
<epochwolf>
insurance = poor quality programmers
orospakr has quit [Excess Flood]
orospakr has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
cyong has joined #ruby
endzyme has joined #ruby
<epochwolf>
palladium: the basics of programming is easy to learn if you have the right mindset. Mastering it requires a lot of work.
enebo has quit [Quit: enebo]
<aytch>
I take it you're both newbies to programming, palladium & epochwolf?
endzyme has quit [Remote host closed the connection]
<palladium>
I've been fiddling for years but never formally
<epochwolf>
aytch: I've been doing rails applications for 5 years
<aytch>
(that's not intended to be offensive, I'm a newbie myself)
<epochwolf>
programming for 7.
<palladium>
I like Ruby and I like SQL
mockra has quit [Remote host closed the connection]
<epochwolf>
I'd consider myself an expert.
<Boohbah>
you like SQL? what's wrong with you?
<aytch>
I'm a systems admin who is trying to get better with devops
<epochwolf>
Boohbah: he hasn't used it enough to hate it yet.
<palladium>
My industry is all about datamining yet
<aytch>
I've found the Ruby Koans to be pretty awesome for learning
<palladium>
So I've been using Crystal Reports and learning SQL on the side
<palladium>
I did a couple of Ruby courses on Codeschool too
justsee has quit [Quit: Leaving...]
<palladium>
and I did Peter's Ruby 1.9.2 book
<banisterfiend>
palladium: cool, teach me about outer joins :P
<palladium>
Any recommendations on a good IRC client for Linux (Mint)?
<epochwolf>
banisterfiend: you mean hinges?
<epochwolf>
palladium: xchat or irssi
mahmoudimus has joined #ruby
<aytch>
palladium: screen+irssi
JonathanVeg has quit []
<Boohbah>
irssi
<epochwolf>
irssi if you like console
joofsh has joined #ruby
<epochwolf>
xchat if you are one of those poor gui lovers.
<Boohbah>
with screen or tmux
<palladium>
I'm a poor GUI lover
<aytch>
Gui lovers belong on windows, like they deserve.
<Morrolan>
KVIrc \o/
<palladium>
although MySQL is teaching me to love CLI
<Morrolan>
aytch - Shush.
<epochwolf>
and before I troll too much, I'm a mac user that is 60% gui tooling.
<palladium>
I was using MS SQL Server for the first course I took but I might move to MySQL
<epochwolf>
palladium: bah… navicat.
<aytch>
...I'm on a mac, too.
<Boohbah>
Morrolan: have you tried Konversation?
<aytch>
And I'm using Limechat
<palladium>
Whuz navicat?
ph^ has quit [Ping timeout: 272 seconds]
<epochwolf>
palladium: I love me gui tools.
<palladium>
shit...
<Morrolan>
Boohbah - I have not.
<palladium>
That's a whole new ball park
<Morrolan>
Boohbah - Not using KDE on my Linux machines.
<Boohbah>
i love me some QT
<palladium>
I've been hacking away at CLI for the last 7 hours wishing I had a GUI
<epochwolf>
palladium: navicat is a paid gui database client.
<epochwolf>
$20 for the basic version
<palladium>
Sweet
<Boohbah>
Morrolan: so kvirc is a qt client with no kdelibs dependencies?
<epochwolf>
Don't get me wrong, I use terminals for 40% of my work.
<Morrolan>
Boohbah - Oh, no, KVIrc is on my Windows machine.
angusiguess has quit [Ping timeout: 246 seconds]
<epochwolf>
but I also use gui tools.
cyong has quit [Quit: Leaving.]
<palladium>
Linux or otherwise?
<epochwolf>
if I'm remoted into a server, I can do all command line.
* Boohbah
cheers for cross-platform gui toolkits
<epochwolf>
palladium: OS X has bash just like linux doe.
<palladium>
yes
<palladium>
Ive got an Imac I never euse anymore
<epochwolf>
my servers are linux
<Boohbah>
epochwolf: i've heard OS X's bash is very old...
Kuifje has quit [Ping timeout: 272 seconds]
<palladium>
I use a dual boot HP laptop but I spent more time in Linux the lat week or so
<epochwolf>
my secondary machine is a chromebook
<epochwolf>
Boohbah: I use zsh. :P
enebo has joined #ruby
<Boohbah>
oh right, all the cool kids are using zsh
<palladium>
I dunno if Navicat is $20 I can't see it
<epochwolf>
chromebook in dev mode is a fine ssh terminal
freakazoid0223 has quit [Read error: Connection reset by peer]
<epochwolf>
palladium: there's some free mysql gui tools, those will work well enough
lledet has quit [Quit: lledet]
<epochwolf>
palladium: I just buy pretty software because I can afford it.
<epochwolf>
finally purchased omnigraffle last week. $200 and I'm a happy wolf.
<epochwolf>
Google draw works in a pinch though
<arusso>
omnigraffle is amazing. i'll miss it most when i leave OSX.
<arusso>
that is, if it doesnt keep me from jumping ship :)
<epochwolf>
arusso: I've used it a few times in my life and I decided I'm ont going to live without it.
<aytch>
omnigraffle++
v0n has joined #ruby
<arusso>
yea, im in that boat now. i do a lot of presentations, and i havent found anything as easy and pretty to use.
<epochwolf>
I have a 15" retina macbook pro. Omnigraffle isn't expensive in comparision :P
<arusso>
i work for a university, so it costs me like 40 bucks
<arusso>
:)
<epochwolf>
though I will say my computer costs more than my car D:
<arusso>
in the bay area, thats not uncommon
<epochwolf>
arusso: I got the pro version so I could use it at work.
<arusso>
so dont feel too bad
<epochwolf>
I'm in Seattle. :)
<epochwolf>
I've got a 12 yera old suv.
greenarrow has quit [Quit: IRC is just multiplayer notepad]
<arusso>
ah, you guys have a good bus system though right?
<epochwolf>
not here.
<epochwolf>
Seattle sucks for transit.
<arusso>
huh. Grey's Anatomy lied to me.
<epochwolf>
I drive everywhere.
<epochwolf>
I live in bothell though, not down town
<epochwolf>
Seattle is between 30 to 90 minutes from my place.
Bosma has quit [Quit: leaving]
<arusso>
ah yea. that's a bit far for good public transit :)
<epochwolf>
arusso: being across the lake means transit sucks
iamjarvo has quit [Quit: Leaving.]
jpfuentes2 has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
Bosma has joined #ruby
<epochwolf>
okay, I need to drive home from this cafe.