<blazes816>
self.game and self.game= are getters and setters that manipulate @game
<blazes816>
self.game simply returns @game. however, you could override that method to do something else
<vjt>
eka: behind the scenes, attr_accessor :foo defines two methods: a "foo" method that returns the value of @foo, and "foo=(something)" that sets "@foo" to "something"
<blazes816>
perhaps set @game to a default if it's not yet set
<vjt>
eka: in Ruby a class-level method can define dynamically instance-level methods, and this is what attr_accessor does
<eka>
vjt: yes i understand that... but in this case it makes only sense if in the future games= is overriden right?
<vjt>
yes, it is preferable to always use methods, so that subclasses can override their behaviour
<eka>
vjt: oh I see
Russell^^ has quit [Quit: Russell^^]
<eka>
vjt: thanks
<vjt>
:)
<vjt>
going, bye!
rjsamson has joined #ruby
lkba has joined #ruby
otters has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
Artheist has joined #ruby
icooba has quit [Ping timeout: 252 seconds]
slainer68 has quit [Remote host closed the connection]
<MarcWeber>
chazu`: thanks
F1skr has joined #ruby
tomsthumb has joined #ruby
adeponte has joined #ruby
joeycarmello has joined #ruby
adeponte has quit [Remote host closed the connection]
tchebb has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
samphippen has quit [Ping timeout: 256 seconds]
samphippen has joined #ruby
lahwran has quit [Excess Flood]
icooba has joined #ruby
chazu` has quit [Remote host closed the connection]
tds has quit [Quit: tds]
jrajav has quit []
tomsthumb has quit [Quit: Leaving.]
cakehero has quit [Quit: Computer has gone to sleep.]
lahwran has joined #ruby
blazes816 has quit [Quit: blazes816]
F1skr has quit [Quit: WeeChat 0.3.9]
jamjam has quit [Ping timeout: 255 seconds]
fgro_ has joined #ruby
F1skr has joined #ruby
jaygen has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Trioke has quit [Ping timeout: 252 seconds]
mercwithamouth has joined #ruby
fgro has quit [Ping timeout: 255 seconds]
irleif has joined #ruby
davidcelis has quit [Quit: K-Lined.]
otters has quit [Ping timeout: 252 seconds]
jrajav has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
mrsolo has quit [Quit: Leaving]
sn0wb1rd has quit [Quit: sn0wb1rd]
jaygen_ has joined #ruby
keymone has joined #ruby
cousine has joined #ruby
jblack has joined #ruby
joeycarmello has quit [Remote host closed the connection]
keymone_ has quit [Ping timeout: 260 seconds]
joeycarmello has joined #ruby
jaygen has quit [Ping timeout: 252 seconds]
mahmoudimus has joined #ruby
dmerrick has quit [Quit: dmerrick]
otters has joined #ruby
kiyoura has joined #ruby
cousine has quit [Remote host closed the connection]
seanyo has joined #ruby
_jesse_ has quit [Ping timeout: 245 seconds]
g_bleezy has quit [Remote host closed the connection]
_jesse_ has joined #ruby
SCommette has joined #ruby
irleif has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
juarlex_ has quit [Ping timeout: 244 seconds]
dmerrick has joined #ruby
juarlex_ has joined #ruby
xjiujiu_ has joined #ruby
dmerrick has quit [Client Quit]
jimeh has quit [Ping timeout: 240 seconds]
yshh has joined #ruby
apok has quit [Remote host closed the connection]
apok has joined #ruby
swarley has joined #ruby
guns has quit [Ping timeout: 276 seconds]
slainer68 has quit [Ping timeout: 256 seconds]
twopoint718 has joined #ruby
twopoint718 has quit [Changing host]
twopoint718 has joined #ruby
moshee has quit [Ping timeout: 260 seconds]
irleif has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
invapid has joined #ruby
dakine has joined #ruby
kbeddingfield has joined #ruby
butblack has joined #ruby
Jonah11_ has quit [Ping timeout: 264 seconds]
butblack is now known as help
F1skr has joined #ruby
help is now known as butblack
loocorez has left #ruby [#ruby]
Jonah11_ has joined #ruby
icole has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
JohnTeddy has joined #ruby
Takehiro has joined #ruby
mklappstuhl has joined #ruby
rakl has quit [Quit: sleeping]
<JohnTeddy>
What is the best (in the opinion of whomever wishes to respond) ascii learn ruby tutorial and/or a course (like udemy, udacity, cousersa, etc) for learning ruby?
irleif has quit [Read error: Connection reset by peer]
Cache_Money has joined #ruby
kbeddingfield has quit [Ping timeout: 264 seconds]
Squarism was kicked from #ruby by seanstickle [Squarism]
mklappstuhl has quit [Ping timeout: 244 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Remote host closed the connection]
nyrb has quit [Remote host closed the connection]
nyrb has joined #ruby
yshh has quit [Read error: No route to host]
yshh_ has joined #ruby
mercwithamouth has joined #ruby
caleb_io has quit [Quit: caleb_io]
omry has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
pr0ton has joined #ruby
<pr0ton>
i have this strange hostname failure in production
<pr0ton>
Hostname not found: domain (domain:443)
<pr0ton>
how can i debug this?
<pr0ton>
host domain works
chrishunt has quit [Quit: Leaving...]
medik has quit [Quit: Leaving]
skcin7 has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
robertotauille has quit [Quit: Leaving...]
F1skr has joined #ruby
<jrajav>
Where's dat xeago :|
v0n has quit [Ping timeout: 260 seconds]
croz has joined #ruby
croz has quit [Excess Flood]
croz has joined #ruby
<rking>
mr-rich: Pong.
Cache_Money has quit [Ping timeout: 276 seconds]
ij has quit [Read error: Connection reset by peer]
chriskk has quit [Quit: chriskk]
ij has joined #ruby
nazty has quit [Read error: No route to host]
v0n has joined #ruby
<dekz>
anyone familiar enough with capistrano to educate me on why roles in tasks don't propagate to sub tasks called?
mneorr has joined #ruby
L1 has joined #ruby
nazty has joined #ruby
chriskk has joined #ruby
rakl has joined #ruby
jslowe has quit [Quit: Leaving]
ttt has joined #ruby
<L1>
Anyone know why compass can't find my gems on Windows? I did "gem install susy", added "require'susy'" to my config.rb, but when I use @import "susy" in my scss compass tells me "File to import not founf or unreadable: susy"
caleb_io has joined #ruby
<L1>
If I do "gem env" I get two GEM PATHS, one of which is the directory I can see susy has installed itself to
bricker has joined #ruby
<L1>
Someone mentioned it might be because my config.rb is in a non-standard location (this is a .NET project so the directory structure is probably a bit different), can anyone advise how I might check if that is the case?
JonnieCache has joined #ruby
<matti>
We need Ruby Gangnam Style.
sepp2k1 has quit [Read error: Connection reset by peer]
SCommette has quit [Quit: SCommette]
ksaw123 has joined #ruby
jjang has quit [Remote host closed the connection]
<ksaw123>
hello all
v0n has quit [Ping timeout: 260 seconds]
<ksaw123>
I am writing a program to create a christmas list. For some reason my "loop do" isn't working properly
joeycarmello has quit [Remote host closed the connection]
Faris has joined #ruby
philcrissman has quit [Ping timeout: 256 seconds]
SCommette has quit [Quit: SCommette]
<MarcWeber>
autoload :TEST1, 'some str' is fine, but autoload str.to_sym, 'some str' fails with : autoload must be a constant name. So how does ruby distinguish a constant from a symbol? Aren't symbols always written by :SOMETHING ?
<MarcWeber>
:TEST1.class in irb shows Symbol.
SCommette has joined #ruby
wpaulson has joined #ruby
Vert has quit [Remote host closed the connection]
<MarcWeber>
My fault, my symbol ended in ";" which is not a valid constant
BoomCow has joined #ruby
cakehero has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
apok_ has joined #ruby
BoomCow has joined #ruby
BoomCow has quit [Client Quit]
GoGoGarrett has joined #ruby
kpshek has joined #ruby
apok has quit [Ping timeout: 255 seconds]
twopoint718 has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
<rking>
WhoNeedszzz: So many things. Tell me your background and white kind of code you write, and I'll give you a response other than, "How long is a piece of string?"
apok_ has quit [Ping timeout: 264 seconds]
<rking>
white? ⇒ what
<WhoNeedszzz>
I'm just refreshing my knowledge of Ruby. I didn't know much to begin with. I can't remember what reflection is used for and everything i've looked up says how to do it, but not the practical uses
<WhoNeedszzz>
Like something said it was good for testing. How is it good for testing?
jblack has quit [Ping timeout: 244 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
swarley has quit [Ping timeout: 264 seconds]
xpen has joined #ruby
FifthWall has joined #ruby
tomsthumb has joined #ruby
__miha__ has joined #ruby
kpshek has quit [Ping timeout: 245 seconds]
<rking>
WhoNeedszzz: Well, it's good for testing in many ways, also. You could use it to improve failure output, or you could use it to loop over all of an objects methods that end in '=' and assign it garbage to see how well it handles error input, etc.
forced_request has quit [Read error: Connection reset by peer]
<rking>
WhoNeedszzz: You would probably really enjoy Metaprogramming Ruby. The title makes it sound like it might be obsessed with arcane uses of Ruby, but actually it lays a great foundation for understanding how Ruby works (and happens to also answer your question page after page)
pipopopo has quit [Ping timeout: 246 seconds]
philcrissman_ has quit [Remote host closed the connection]
jblack has joined #ruby
Takehiro has joined #ruby
jenrzzz has joined #ruby
chimkan has quit [Remote host closed the connection]
chimkan_ has joined #ruby
rjsamson has quit [Remote host closed the connection]
dmerrick has quit [Quit: dmerrick]
rjsamson has joined #ruby
mneorr has quit [Remote host closed the connection]
redbull has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
Guest16022 has joined #ruby
nateberkopec has quit [Quit: Leaving...]
_LowKey has joined #ruby
philcrissman has joined #ruby
rjsamson has quit [Ping timeout: 260 seconds]
n_blownapart has joined #ruby
_LowKey is now known as LowKey
LowKey has quit [Changing host]
LowKey has joined #ruby
<n_blownapart>
hi the notation on lines 7 and 11 here continue to mess me up. thanks for any explanation: http://pastie.org/4906423
seanyo has quit [Read error: Connection reset by peer]
seanyo has joined #ruby
seoaqua has joined #ruby
areil has joined #ruby
<MarcWeber>
Does ruby provide a def which causes an error if a class already responds to the method name to avoid accidental monkey patching (eg because a different library is doing the same?)
kbeddingfield has joined #ruby
philcrissman has quit [Remote host closed the connection]
BoomCow has joined #ruby
<MarcWeber>
I know that I probably can write my def_no_monkey_patch (:name, block) easily - just trying to understand whether this is considere a good practise.
butblack has quit [Quit: butblack]
seanyo has quit [Ping timeout: 244 seconds]
k4k1_c0der has joined #ruby
radic has joined #ruby
Serial_Killer_C has joined #ruby
radic_ has quit [Read error: Operation timed out]
ananthakumaran has joined #ruby
CaptainKnots has joined #ruby
<n_blownapart>
hi the notation on lines 7 and 11 here continue to mess me up. thanks for any explanation: http://pastie.org/4906423
mneorr has joined #ruby
Progster has quit [Ping timeout: 276 seconds]
<jcaudle>
Hi n_blownapart, what's throwing you off?
adeponte has joined #ruby
g-ram has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
mneorr has quit [Remote host closed the connection]
aces23up has quit [Ping timeout: 248 seconds]
<n_blownapart>
jcaudle: thanks for responding...could you break down how line 7 returns line 9. all that notation \\1 , $1 etc. and how it works.
WNz has joined #ruby
joeycarm_ has joined #ruby
mockra has joined #ruby
_bart_ has joined #ruby
<iosctr>
n_blownapart: $1, $2 are set when the regex is evaluated. Since those lines are defining and array, the first element (with the regex) is being eval'd first. then, the next two elements are using those variables to assign the their values.
recycle has joined #ruby
WhoNeedszzz has quit [Ping timeout: 246 seconds]
WNz is now known as WhoNeedszzz
<n_blownapart>
iosctr: thanks hold on I'm working on that.
<iosctr>
the first examplel isn't doing much... it matches the first 2 words, and replaces them with the same 2 words.
<iosctr>
then, matches the next two, doing the same. so, the orig phrase doesn't change.
Astral__ has joined #ruby
<iosctr>
but the last two matched is setting $1 $2
<iosctr>
in the 2nd example, each 2 word match is being replaced with 2 copies of the 1st word in the 2 word match.
Astral_ has quit [Ping timeout: 246 seconds]
thone has joined #ruby
<iosctr>
but the 2nd regex eval is still setting $1 $2 to those 2 words - "word here"
<n_blownapart>
iosctr please hold on. 'the first example' you refer to is line 7 and its output, right?
<iosctr>
correct
<seoaqua>
is there any workable 'pagerank checking' gem ? the Pagerankr doesn't work any more:(
jlwestsr has quit [Remote host closed the connection]
matled has quit [Remote host closed the connection]
matled has joined #ruby
<iosctr>
gsub/regex first matches "double every", then matches "word here"
thone_ has quit [Ping timeout: 240 seconds]
<iosctr>
since the replacement is \1 \2, nothing changes. but the last eval sets $1 $2 to 'word' and 'here'
<n_blownapart>
cool iosctr so those two matches are notated by \\1 and \\2 ?
<iosctr>
correct
<iosctr>
and they set the global variables
<richardjortega>
how would i handled special characters in Ruby CSV? getting really wonky characters for degree symbol, asterisk, etc
Serial_Killer_C has quit [Read error: Connection timed out]
Serial_Killer_C has joined #ruby
lukeholder has joined #ruby
Faris has quit [Ping timeout: 260 seconds]
crackfu has quit [Remote host closed the connection]
<n_blownapart>
iosctr: the last eval sets $1 and $2 to 'word' and 'here'...why use $1 and $2 for the third and fourth words?
crackfu has joined #ruby
Bosma has joined #ruby
<iosctr>
you mean the 2nd/3rd array elements? I wouldn't know :)
<n_blownapart>
iosctr: i.e. how does it set it? and if they are not included in the arguments, what are they exactly (global variables doesn't make sense to me) thanks
quest88 has joined #ruby
ninegrid has quit [Quit: brb]
<iosctr>
any regex capture group () will set them.
savage- has quit [Quit: savage-]
jblack has quit [Ping timeout: 240 seconds]
<iosctr>
if you simply eval: 'abc' =~ /a(\w)c/ then $1 will be set to 'b'
justinmcp has joined #ruby
<n_blownapart>
iosctr: but in those expressions on lines 7 and 11 there are no capture groups. confused...sorry
marius has quit []
<n_blownapart>
iosctr: oh, are they just (/w+) ?
crackfu has quit [Ping timeout: 256 seconds]
<n_blownapart>
(\w+) *
headius has quit [Quit: headius]
<iosctr>
right
<n_blownapart>
iosctr: thanks for your patience I'm going to go soak my head and return to it.
lukeholder has quit [Quit: Computer has gone to sleep.]
Cultofmetatron has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
g-ram has quit [Quit: Computer has gone to sleep.]
BoomCow has quit [Client Quit]
Takehiro has joined #ruby
blazes816 has joined #ruby
verbad has joined #ruby
JonnieCache has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
verbad has quit [Client Quit]
yshh_ has quit [Ping timeout: 260 seconds]
zf_ has joined #ruby
JonnieCache has quit [Ping timeout: 252 seconds]
tds has joined #ruby
WhoNeedszzz has left #ruby ["P00f!"]
zf has quit [Read error: Connection reset by peer]
g-ram has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
GoGoGarrett has quit [Remote host closed the connection]
savage- has joined #ruby
Serial_Killer_C has joined #ruby
dakine has quit [Ping timeout: 246 seconds]
quest88 has quit [Quit: quest88]
jeremywrowe has left #ruby [#ruby]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
SCommette has joined #ruby
guest has joined #ruby
guest has quit [Client Quit]
haxrbyte has joined #ruby
Mon_Ouie has joined #ruby
SCommette has quit [Quit: SCommette]
chimkan___ has joined #ruby
g-ram has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
joeycarm_ has quit [Remote host closed the connection]
yshh has joined #ruby
chimkan_ has quit [Ping timeout: 260 seconds]
g-ram has joined #ruby
n_blownapart has quit [Remote host closed the connection]
hakunin has quit [Remote host closed the connection]
davidcelis has joined #ruby
g-ram has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
haxrbyte has quit [Remote host closed the connection]
g-ram has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
mercwithamouth has joined #ruby
sabooky has joined #ruby
slainer68 has joined #ruby
<sabooky>
Hi, quick question. if in class Chef::Nexus (module), I redefine Chef::EncryptedDataBagItem, would the scope of that change be limited to the module, or will EncryptedDataBagitem change behavior from now on?
psycho_one has joined #ruby
lobak has quit [Ping timeout: 255 seconds]
slainer68 has quit [Ping timeout: 252 seconds]
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
cakehero has joined #ruby
Takehiro has joined #ruby
mneorr has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
mikepack has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
lobak has joined #ruby
jarred_ has joined #ruby
d2dchat has quit [Remote host closed the connection]
haxrbyte has joined #ruby
mneorr has joined #ruby
jarred_ has left #ruby [#ruby]
iamjarvo has quit [Quit: Computer has gone to sleep.]
tds has quit [Quit: tds]
joofsh has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 260 seconds]
kiyoura has quit [Quit: Leaving]
walbert has quit [Remote host closed the connection]
invapid has quit [Ping timeout: 252 seconds]
BoomCow has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
Serial_Killer_C has quit [Remote host closed the connection]
WhoNeedszzz has joined #ruby
<WhoNeedszzz>
What are the main application areas of Ruby?
<rburton->
cross functional synergy.
<reactormonk>
WhoNeedszzz, rails.
<WhoNeedszzz>
and?
<rburton->
cross functional synergy
<WhoNeedszzz>
?
<rburton->
There are a lot of cases, like chef and puppet as well
cakehero has quit [Quit: Computer has gone to sleep.]
<rburton->
I'm just poking fun at how you phrased the question
<WhoNeedszzz>
What's wrong with how i phrased it?
<rburton->
So sterile I guess
<WhoNeedszzz>
It's common programming language terminology
<rburton->
It's how you speak, I just feel it's too corporate
Chryson has quit [Quit: Leaving]
<WhoNeedszzz>
I prefer academic
<WhoNeedszzz>
As i'm a comp sci student
charliesome has joined #ruby
<rburton->
Same difference :)
<BoomCow>
cross functional synergy :D
<rburton->
Just training for being a corporate slave :D
<WhoNeedszzz>
corporate is so far from academic
maletor has joined #ruby
<BoomCow>
why academia?
<BoomCow>
not judging, simply curious
<WhoNeedszzz>
what is your question?
<BoomCow>
why do you prefer academia
<BoomCow>
I jumped in late to the convo
k4k1_c0der has quit []
<BoomCow>
so I assume when you said I "I prefer academic"
<WhoNeedszzz>
Because the connotations of academia are different from corporate
<BoomCow>
you meant: "I want to study/teach"
<BoomCow>
would you consider startups corporate?
<WhoNeedszzz>
I don't have any intentions on being a corporate code monkey
<WhoNeedszzz>
I'm just studying it
<rburton->
That's how it always starts. Very few break from it :)
<WhoNeedszzz>
Simply to expand my knowledge of programming languages
<WhoNeedszzz>
Hell I'm doing landscaping now, so that has nothing to do with coding
<rburton->
I think it's better to look at what the langauge supports vs. how people are using it in different applications
<WhoNeedszzz>
I believe you should look at both
<WhoNeedszzz>
What it supports and what it supports well are two different situations
<rburton->
It's an opinion. I say look at the language first and what it offers
ryanf has quit [Ping timeout: 252 seconds]
<WhoNeedszzz>
I've already done that
<WhoNeedszzz>
Now i want to know the practical side
<WhoNeedszzz>
I know it usually boils down to language wars, but the fact is that for different application areas you wouldn't want to use language x over language y
<blazes816>
Ruby is a general purpose scripting language. You would use it for things that call for that type of language.
<blazes816>
you won't be using it to write graphics drivers or tablet firmware
<rburton->
I'm not speaking about a language war, speaking about really understanding the fundimentals of what the language provides
codezombie has joined #ruby
<blazes816>
but you can use it for anything you'd use python/perl/etc for
<rburton->
java, vb, etc..
<WhoNeedszzz>
For example Ruby supports image manipulation, but it sucks
<rburton->
it's really a general purpose langage for the most part
<rburton->
rmagic?
_dnyy has quit [Remote host closed the connection]
<rburton->
there's solutions
<rburton->
that's not a language feature, that's a library
<WhoNeedszzz>
Never said it was
<WhoNeedszzz>
:p
<rburton->
Your example implies it
<blazes816>
rmagick sucks but that's not really ruby's fault. regardless, jruby has decent image stuff
<rburton->
"Ruby supports image manipulation, but it sucks"
<blazes816>
(given all the crap available for the jvm)
<WhoNeedszzz>
No a languages available libraries are just about as important as it's built-in featuers
<WhoNeedszzz>
features*
<rburton->
WhoNeedszzz false
SCommette has joined #ruby
<blazes816>
luckily i'm on the other coast
psycho_one has quit [Remote host closed the connection]
<rburton->
Then again we're speaking opinons
<rburton->
blazes816: I'm moving to San Fran nov 6th
<rburton->
heading to Den CO for RubyConf
<blazes816>
nice, I just moved out here in august
<blazes816>
nice, wish I could go
<rburton->
to San Fran?
<rburton->
what part?
<WhoNeedszzz>
Well considering when you decide what language you want to use for a given task you would look to see if there are libraries to make the job simpler
<blazes816>
yeah. I work in soma, live near oakland in emeryville
<rburton->
I moved to 11th Mission
<blazes816>
great
<rburton->
Awesome, we should meet up sometime when you're in the area
<blazes816>
cool man
<blazes816>
i have a few friends in the mission
<blazes816>
they love it
<blazes816>
b
<blazes816>
u
<blazes816>
t
<rburton->
trying to launch a website soon, but been busy
<blazes816>
but I prefer the east bay
perryh has quit [Excess Flood]
jcaudle has quit [Quit: jcaudle]
<blazes816>
yeah same here. always busy haha
cantonic_ has joined #ruby
<rburton->
I just need to work out this deployment script with God running ResquePool
perryh has joined #ruby
<WhoNeedszzz>
Concord++
mikepack has quit [Remote host closed the connection]
<WhoNeedszzz>
Better yet Walnut Creek
<WhoNeedszzz>
Love me some Mt. Diablo
<BoomCow>
lol walnut creek
<BoomCow>
gf got groped there
cantonic has quit [Ping timeout: 256 seconds]
cantonic_ is now known as cantonic
<rburton->
Sorry about that :)
<rburton->
I thought it was my back pocket
<rburton->
in front of me
ananthakumaran has joined #ruby
<WhoNeedszzz>
Yeah as if something that happens everywhere has anything to do with the place itself
wargasm has quit [Ping timeout: 260 seconds]
<rburton->
It increases the odds.
<rburton->
So yes,
mikepack has joined #ruby
<WhoNeedszzz>
Psychology fail
<rburton->
Go to the hood and see if you're asked to buy drugs.
<rburton->
It has something to do with it.
mikepack has quit [Remote host closed the connection]
cakehero has joined #ruby
<blazes816>
go to macarthur bart after 10 and you don't have to wait to get asked
<BoomCow>
blazes816, I am having such a hard time testing… not sure what the scope of my tests should be
<WhoNeedszzz>
In my city
FifthWall has quit [Quit: Goodbye everyone]
<rburton->
WhoNeedszzz: good job, now you get a gangster badge. Now carry on
<BoomCow>
blazes816, seems like testing is one of those things you just pick up by doing
<blazes816>
BoomCow: many, small scoped tests
<blazes816>
it is
sebastorama has quit [Quit: ;)]
<WhoNeedszzz>
Haha i'm no gangster
<WhoNeedszzz>
Not even close
<blazes816>
start with unit tests
vlad_starkov has joined #ruby
<rburton->
I just find it funny how you mention your location and in relation to violence.
<blazes816>
basic "if I do this to the object, this is should be it's output", etc
<rburton->
Sort of goes against what you were saying before. Anyhow #ruby
<BoomCow>
blazes816, yeah, it always sounds more simple than it is
<BoomCow>
hahaha
<BoomCow>
blazes816, when I sit down, I have no idea where to start
thinkdevcode has quit [Remote host closed the connection]
<blazes816>
think of your application in terms of states, and test each state
<blazes816>
yeah, it's rough to start stuff
<BoomCow>
blazes816, elaborate on state?
<blazes816>
as in state machine
dhruvasagar has quit [Ping timeout: 240 seconds]
<rburton->
I focuse on expected behavior
artnez has joined #ruby
<BoomCow>
so a method?
<rburton->
when function blah is called, I have an expection of behavior that I verify
monkegjinni has joined #ruby
<blazes816>
ditch the idea you'll have 100% coverage, and it gets less discouraging
artnez has quit [Client Quit]
monkegjinni has quit [Remote host closed the connection]
<blazes816>
pick a model, and write basic unit tests for it
<blazes816>
literally just start anywhere
<BoomCow>
okay
<rburton->
If you're looking for a starting point
<BoomCow>
well, I have to write a model test for work
<rburton->
Select a requirement
<BoomCow>
basically
<BoomCow>
when a user clicks on a button
<BoomCow>
it should create a new record
<blazes816>
okay
<rburton->
it "should let a user login with valid credentials" do
<BoomCow>
but can't this also be a controller test?
<rburton->
You can
<rburton->
there's different levels of testing
dhruvasagar has joined #ruby
<rburton->
unit, integration, functional, etc
Monie has joined #ruby
<blazes816>
there are many different tests you could make out of it
<rburton->
unit test means testing logic in isolation of dependencies
<blazes816>
especially if the application is written well
<rburton->
integration is testing object collboration
<rburton->
functional is testing the functionality as a user basically
joeycarmello has joined #ruby
<BoomCow>
do those have any relation to mvc?
<BoomCow>
i.e.
<blazes816>
no
<BoomCow>
okay
<blazes816>
OOP in general
<blazes816>
have you checked out rails casts?
<blazes816>
railscasts*?
<BoomCow>
yeah, recently bought a subscription
<blazes816>
nice
<BoomCow>
I saw his video "how I test"
<BoomCow>
it's a great intro
Guest15771 has joined #ruby
<BoomCow>
but still leaves me lost
lukeholder has joined #ruby
<BoomCow>
I'll just keep writing tests
<BoomCow>
it'll come eventually
joeycarmello has quit [Ping timeout: 256 seconds]
<blazes816>
yeah man, any test is a good test. with experience you'll get good at writing really well structured tests.
<BoomCow>
:D
cakehero has quit [Quit: Computer has gone to sleep.]
<BoomCow>
we should all grab a beer sometime
<rburton->
just dont' try for 100% coverage
icole has joined #ruby
<BoomCow>
from normal too
<BoomCow>
yeah, I learned that at work rburton-
<rburton->
75% is good enough and you can add more as you go
<rburton->
Most people say GO FOR 100%!
<BoomCow>
so I changed career and am now a programmer
<BoomCow>
my first task was to build a feature
<rburton->
pointless and ends up being fragile
<blazes816>
how much programming experience do you have?
<BoomCow>
proj. manager ended up telling me not to try to create a perfect feature
<BoomCow>
< 1 year
<BoomCow>
i quit my job
<BoomCow>
put in about 60-70hrs/week
<rburton->
Project managers suck for guidence :)
<rburton->
find yourself a passionate engineer and work with him
<blazes816>
damn man
<BoomCow>
rburton-, point being that I was trying to account for every test case
<blazes816>
did you just get a job at a startup?
<BoomCow>
yeah, a month ago
<blazes816>
shit man, good luck
<BoomCow>
haha thanks
<BoomCow>
it's a handful
cakehero has joined #ruby
<rburton->
BoomCow: here's my general advice. Test parameters coming in, expected output
<BoomCow>
learning javascript and mysql at the same time
<rburton->
if you do bounds checking for parameters (Never trust anyone calling your method).
<rburton->
Avoid returning nil when a reasonable return type can be returned. e.g., empty array etc
<BoomCow>
why is that
<rburton->
Just keep your methods tight. 1 function and very specific
<rburton->
BoomCow: because you don't want to have to check for null everywhere.
<rburton->
imagine
<rburton->
you call a function find_friends()
<rburton->
if there are no friends you return nil
<BoomCow>
ok
<rburton->
now the person needs to do unless friends.nil? ...
bricker has quit [Ping timeout: 260 seconds]
<rburton->
instead return [] and they can iterate over that safely
<rburton->
friends.each {..}
<BoomCow>
ahhh
<BoomCow>
I haven't seen anyone do it that way
<rburton->
nil is a messy return value. Leads to the caller not trusting your return values
<BoomCow>
when I write my feature/code
<BoomCow>
I still have to check
<BoomCow>
i.e.
<BoomCow>
if friend
<BoomCow>
if friends*
<BoomCow>
friends.each do |f|
<rburton->
Now you have what I call noise. The first check is just noise
<BoomCow>
well
Elhu has joined #ruby
<BoomCow>
what happens if you're checking for the opposite case
<blazes816>
worst case scenario: else
<BoomCow>
friends.blank?
<rburton->
You can always say friends.empty?
<blazes816>
empty?
<BoomCow>
ahh
<blazes816>
blank? is a rails method
<rburton->
blank sorry
<blazes816>
that patches around this issue
<blazes816>
empty? is correct
<BoomCow>
sorry, I think in rails
<BoomCow>
rails/ruby
<blazes816>
empty? is an Array method that checks an empty array
<rburton->
Also consider this
<BoomCow>
haven't had time to distinguish the two
<blazes816>
blank? checks nil? and empty?
<blazes816>
it's difficult to do
<rburton->
Think about cases too when you expect to find something
<blazes816>
I love blank?
<rburton->
e.g., User.find(id)
<rburton->
if it's not there raise an exception
<rburton->
Since the method call is using an ID, it's expected that a user exists for that idea.
<rburton->
I like to code objects like people
mercwithamouth has quit [Ping timeout: 256 seconds]
<rburton->
Each object does something specific
<rburton->
each method does on function no more.
<BoomCow>
oh yeah
<BoomCow>
I've noticed
<BoomCow>
that it's common to raise errors
<rburton->
Then I like to play well with my callers
<BoomCow>
didn't do this while going through rails tutorial
<BoomCow>
but I've seen a lot of begin/rescue
<blazes816>
it's a common general programming practice
swex has joined #ruby
<rburton->
If I have a function that takes a hash for its argument
<rburton->
you have two things to consider
<rburton->
default values and required values
<rburton->
sensable defaults if you can
<BoomCow>
blazes816, any tip on when to use begin/rescue? when I'm querying for something?
<rburton->
e.g., defaults.merge(args)
Takehiro has joined #ruby
<rburton->
if you can't then throw an exception if you didn't get what you want
<blazes816>
BoomCow: well, you use begin/rescue any time you need to catch and exception and do something with it. and not let it bubble up to the top to halt processing
<rburton->
BoomCow: when you can recover from something
<rburton->
if you can't recover from an exception, let it go
<blazes816>
I only raise exceptions myself for exceptional behavior
<BoomCow>
okay
<BoomCow>
I've seen code
<blazes816>
for example, I don't think User.find(id) should raise an exception if the record isn't there
<BoomCow>
where if a query fails
<blazes816>
I think it should be expected the record might not exist
<BoomCow>
there's a rescue that redirects to root_path
<BoomCow>
I suppose you can do that with every query to be safe
<blazes816>
eh, that sounds sketchy
katherinem13 has quit [Ping timeout: 252 seconds]
<rburton->
blazes816: why not?
<rburton->
You're making the assumption that this id exists
<BoomCow>
rburton-, are you saying that's good practice?
<blazes816>
i don't think that's a fair assumption
<rburton->
I am
<rburton->
blazes816 in most cases, it is
<BoomCow>
one more question (outside of ruby)
<BoomCow>
any tip on where I can learn mysql fast
<rburton->
BoomCow: learn SQL first
<rburton->
/user/1 assumes that user 1 exists
<rburton->
if someone is playing with the links, then that's an exceptional case
<BoomCow>
is that like
<BoomCow>
SELECT * FROM * WHERE
<rburton->
yes
<BoomCow>
awesome
<BoomCow>
that's what I want to learn
<rburton->
There's DDL, DML
<rburton->
one defines tables and objects (Sequences etc) that's called DDL (Data Definition Language)
d2dchat has joined #ruby
<JohnTeddy>
I'm trying to display a chart with rows/columns 100x100, each 'cell' has a number 1-100. What is a simple/good way to output a chart like this with ruby, using a terminal, or some simple gui, or even a graphic output.. anything
<rburton->
and the other is for manipuating data
blazes816 has quit [Quit: blazes816]
<rburton->
INSERT INTO ..
<rburton->
UPDATE BLAH ..
<JohnTeddy>
I don't really know what the best way is to display this data, I'm looking for ideas.
<rburton->
JohnTeddy: why not console it and just use padding
Takehiro has quit [Ping timeout: 260 seconds]
<rburton->
e.g., printf
<JohnTeddy>
rburton-: Well it starts to get just a bit to big/ugly. So like numbers above 9 have two digits, so 91*2 is (182+10)+100
<JohnTeddy>
So it's like 292 wide
fantazo has joined #ruby
<rburton->
Can you calculate the longest number in the grid?
fantazo has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
BrianJ has quit [Quit: BrianJ]
artOfWar has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
tagrudev has joined #ruby
dakine has joined #ruby
bluOxigen has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk_ has joined #ruby
ryanf has joined #ruby
WhoNeedszzz has left #ruby ["P00f!"]
JohnBat26 has joined #ruby
elsifaka has joined #ruby
roadt has joined #ruby
answer_42 has joined #ruby
rippa has quit [Ping timeout: 252 seconds]
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
cakehero has joined #ruby
mneorr has quit [Remote host closed the connection]
slainer68 has joined #ruby
dv_ has quit [Ping timeout: 260 seconds]
cakehero has quit [Client Quit]
rakl has quit [Quit: sleeping]
mneorr has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
gabrielrotbart has quit [Remote host closed the connection]
<seoaqua>
how do u guys describe a software project? is there any standard graphical way?
slainer68 has quit [Ping timeout: 240 seconds]
MrSamuel has joined #ruby
tonini has joined #ruby
<RubyPanther>
"describe?"
JonnieCache has quit [Ping timeout: 244 seconds]
<seoaqua>
"to show to others"
<RubyPanther>
I like to translate everything into ponies and woodland creature terminology.
<seoaqua>
just the key ideas and the main structure of a project
<seoaqua>
is there a common way? UML?
Takehiro has joined #ruby
<RubyPanther>
Everybody can understand, they want to ride the pony but they don't want to scoop up its crap. A good project is all about riding, and the crap doesn't get talked about.
jaygen_ has joined #ruby
<seoaqua>
i don't get it
seoaqua has left #ruby ["离开"]
<RubyPanther>
People don't actually use UML, as far as I can tell, but they often use UML-ish diagrams.
nemesit has joined #ruby
seoaqua has joined #ruby
<seoaqua>
accidentally pressed cmd+w
dv_ has joined #ruby
justinmcp has quit [Remote host closed the connection]
kadel has joined #ruby
jaygen has quit [Ping timeout: 252 seconds]
Takehiro has quit [Ping timeout: 260 seconds]
<RubyPanther>
I don't know, I have shift control alt meta and super keys, but no cmd. Does that spawn a gnome or something?
pureluck has quit [Read error: Operation timed out]
maesbn has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWa__ has joined #ruby
jaygen_ has quit [Remote host closed the connection]
jaygen has joined #ruby
freakazoid0223 has quit [Ping timeout: 240 seconds]
irleif has joined #ruby
yxhuvud has joined #ruby
pureluck has joined #ruby
casheew has quit [Read error: Connection reset by peer]
jaygen has quit [Remote host closed the connection]
casheew has joined #ruby
workmad3 has joined #ruby
casheew has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
Axsuul has quit [Ping timeout: 268 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
monkegjinni has joined #ruby
icole has quit [Remote host closed the connection]
marius has joined #ruby
casheew has joined #ruby
icole has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<heftig>
RubyPanther: cmd is a mac keyboard modifier
<RubyPanther>
so you press it and the parachutes turn green?
<heftig>
huh?
mneorr_ has joined #ruby
mneorr has quit [Ping timeout: 260 seconds]
d2dchat has quit [Remote host closed the connection]
artOfWa__ has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
Faris has quit [Ping timeout: 260 seconds]
chimkan___ has quit [Quit: chimkan___]
ShiintoRyuu has joined #ruby
jprovazn has joined #ruby
jgrevich has quit [Quit: jgrevich]
burgestrand has quit [Ping timeout: 268 seconds]
SCommette has quit [Quit: SCommette]
mercwithamouth has quit [Ping timeout: 276 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
artOfWar has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
artOfWar has joined #ruby
Rydefalk has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
blacktulip has joined #ruby
hotovson has joined #ruby
Morkel has joined #ruby
dekroning has joined #ruby
icole has quit [Remote host closed the connection]
icole has joined #ruby
codecaster has joined #ruby
emergion has joined #ruby
emergion has quit [Client Quit]
xjiujiu_ has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
xorigin has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar_ has joined #ruby
hamed_r has joined #ruby
shtirlic has joined #ruby
Morkel_ has joined #ruby
eldariof has joined #ruby
slainer68 has joined #ruby
Morkel has quit [Ping timeout: 255 seconds]
Morkel_ is now known as Morkel
u89 has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 260 seconds]
Vinz_` is now known as Vinz_
dr_bob has joined #ruby
u89 has joined #ruby
justinmcp has joined #ruby
irleif has joined #ruby
timonv has quit [Remote host closed the connection]
slainer68 has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
elico has joined #ruby
arturaz has joined #ruby
haxrbyte_ has joined #ruby
artOfWar_ has quit [Read error: Connection reset by peer]
filipe has joined #ruby
artOfWar has joined #ruby
dangerousdave has joined #ruby
haxrbyte has quit [Ping timeout: 265 seconds]
nohonor has joined #ruby
ij has quit [Read error: Connection reset by peer]
sspiff has joined #ruby
hoelzro|away is now known as hoelzro
u89 has quit [Remote host closed the connection]
ij has joined #ruby
slainer68 has quit [Remote host closed the connection]
heftig has quit [Read error: Connection reset by peer]
kil0byte has joined #ruby
savage- has quit [Quit: savage-]
heftig has joined #ruby
baphled has quit [Ping timeout: 248 seconds]
und3f has joined #ruby
marius has quit []
wallerdev has quit [Quit: wallerdev]
burgestrand has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
Takehiro has quit [Remote host closed the connection]
artOfWar has quit [Read error: Connection reset by peer]
hbpoison has joined #ruby
manizzle_ has quit [Ping timeout: 252 seconds]
bigmac has joined #ruby
Astral_ has joined #ruby
Takehiro has quit [Remote host closed the connection]
rdark has joined #ruby
Elhu has quit [Read error: Connection reset by peer]
cezar has joined #ruby
cezar has quit [Client Quit]
Astral__ has quit [Ping timeout: 256 seconds]
lukeholder has quit [Quit: Computer has gone to sleep.]
Elhu has joined #ruby
jamjam has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
noxoc has joined #ruby
dangerousdave has quit [Quit: Leaving...]
codecaster has joined #ruby
eataix has joined #ruby
<seoaqua>
i was ark, i meant i accidentally closed the window
<seoaqua>
*afk
Morkel has quit [Quit: Morkel]
Morkel has joined #ruby
shtirlic has quit [Remote host closed the connection]
manizzle_ has joined #ruby
haxrbyte has joined #ruby
psycho_one has joined #ruby
jimeh has joined #ruby
artOfWar_ has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
haxrbyte_ has quit [Ping timeout: 260 seconds]
artnez has joined #ruby
bluOxigen has quit []
artnez has quit [Client Quit]
`gregorg` has quit [Changing host]
`gregorg` has joined #ruby
`gregorg` is now known as gregorg
jenrzzz has joined #ruby
ij has quit [Read error: Connection reset by peer]
ij has joined #ruby
jarred has joined #ruby
jarred has left #ruby [#ruby]
daniel_- has joined #ruby
ryanf has quit [Ping timeout: 256 seconds]
bigmac has quit [Quit: Leaving]
nitti has joined #ruby
ephemerian has joined #ruby
hsbt has quit [Read error: Connection reset by peer]
pcarrier has quit [Ping timeout: 240 seconds]
hsbt has joined #ruby
nitti has quit [Ping timeout: 260 seconds]
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
RudyValencia- has joined #ruby
robotmay has joined #ruby
RudyValencia has quit [Read error: Connection reset by peer]
sabooky has quit [Quit: leaving]
Vinz_ is now known as Vinz_`
freakazoid0223 has joined #ruby
workmad3 has joined #ruby
JonnieCache has joined #ruby
workmad3_ has joined #ruby
workmad3_ has quit [Client Quit]
pcarrier has joined #ruby
pcarrier has quit [Changing host]
pcarrier has joined #ruby
elaptics`away is now known as elaptics
slainer68 has joined #ruby
skum has joined #ruby
hamed_r has quit [Read error: Connection timed out]
nyrb has quit [Remote host closed the connection]
nyrb has joined #ruby
<JonnieCache>
morning
seoaqua has quit [Ping timeout: 248 seconds]
daniel_- has quit [Quit: WeeChat 0.3.9]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
lkba has quit [Quit: Bye]
<workmad3>
morning
havenn has quit [Remote host closed the connection]
nazty has quit [Ping timeout: 260 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
Astral has joined #ruby
Astral is now known as Guest41863
seoaqua has joined #ruby
und3f has quit [Ping timeout: 245 seconds]
gregorg_taf has joined #ruby
tchebb has quit [Read error: Connection reset by peer]
tchebb has joined #ruby
Astral_ has quit [Ping timeout: 245 seconds]
maesbn_ has joined #ruby
xpen has quit [Remote host closed the connection]
artOfWar has quit [Read error: Connection reset by peer]
xpen has joined #ruby
gregorg has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
Rix has joined #ruby
hotovson has quit [Ping timeout: 260 seconds]
nesoi has joined #ruby
maesbn has quit [Ping timeout: 240 seconds]
klip has quit [Ping timeout: 240 seconds]
klip has joined #ruby
nari has quit [Ping timeout: 260 seconds]
<nesoi>
does anyone know how a program that I ran a few hours ago can now fail with an incorrect library version when I haven't modified it or any of the libraries?
chussenot has joined #ruby
<nesoi>
windows, btw
icole has quit [Remote host closed the connection]
<nesoi>
Incorrect MySQL client library version! This gem was compiled for 6.0.0 but the
<nesoi>
client library is 5.0.18. (RuntimeError)
Xeago has joined #ruby
hotovson has joined #ruby
<nesoi>
what could be going on?
<JonnieCache>
bundler?
Shrink has quit [Ping timeout: 276 seconds]
tchebb has quit [Ping timeout: 260 seconds]
thisirs has joined #ruby
berserkr has joined #ruby
baphled has joined #ruby
<nesoi>
JonnieCache : what do you mean?
pcpc has joined #ruby
BrianJ has joined #ruby
<nesoi>
somehow it thinks active_record is incompatible with the mysql version
<nesoi>
although I have not changed anything at all
<nesoi>
in fact I wasn't even using the computer
fyolnish has joined #ruby
<nesoi>
I just pressed up arrow twice and re-ran the program, and it crashed with that error
<nesoi>
where before it ran fine
und3f has joined #ruby
pcpc has quit [Read error: Connection reset by peer]
hbpoison has quit [Ping timeout: 260 seconds]
pcuser has joined #ruby
pcuser has left #ruby [#ruby]
fir_ed has quit [Read error: Connection reset by peer]
xpen has quit [Ping timeout: 260 seconds]
pcuser has joined #ruby
goraxe has quit [Read error: Connection reset by peer]
fir_ed has joined #ruby
<Xeago>
is there an up to date alternative for Markaby?
<nesoi>
could active_record or active_support somehow have updated themselves?
pcuser has left #ruby [#ruby]
<nesoi>
how could I tell?
<nesoi>
it's very strange
goraxe has joined #ruby
alexhanh has quit [Remote host closed the connection]
seoaqua has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
timmow has joined #ruby
fermion has joined #ruby
Shrink has joined #ruby
<burgestrand>
nesoi: you or somebody else changed something. Computer did not go Terminator on you.
<burgestrand>
nesoi: a bundle update, a new installation of mysql, things like that.
<nesoi>
burgestrand : no one else uses the computer, I have only 2 command windows open, I can see the command recall and nothing has been done
<burgestrand>
nesoi: you don’t have to convince me I already know your computer is not the new Skynet.
<nesoi>
since I last ran this program, I have only done web browsing and viewed videos, etc.
<nesoi>
oh, and converted a video using a conversion utility
<nesoi>
which I've used before
<nesoi>
so how would I fix the error?
<nesoi>
it's really odd
<nesoi>
oh wait. I know
casheew has quit [Read error: Connection reset by peer]
<burgestrand>
nesoi: given the error is an incompatibility in the mysql library version between the one you have now, and the one you had when you installed the gem, I’d try reinstalling the mysql gem (or whatever gem you use for mysql).
casheew has joined #ruby
<nesoi>
I started dropbox and it updated a file. nevermind :)
<nesoi>
it did seem uncanny though
<Xeago>
working on sourcefiles in dropbox
<Xeago>
that is your issue
artOfWar has quit [Read error: Connection reset by peer]
<Xeago>
use an scm
<Xeago>
like git or hg
artOfWar has joined #ruby
<nesoi>
Xeago : good idea, however I don't want to pay for it and I do want it to be private and I also want to be able to work on it at home and at a cafe on different machines, so what would you do?
BrianJ has quit [Quit: BrianJ]
justinmcp has quit [Remote host closed the connection]
tvw has joined #ruby
Rix is now known as Bulgaria
niklasb has joined #ruby
<Politoed>
use git and dropbox :D
Villadelfia has quit [Read error: Connection reset by peer]
SeySayux has quit [Read error: Connection reset by peer]
dr_bob has quit [Read error: Connection reset by peer]
dr_bob has joined #ruby
pskosinski has joined #ruby
<pskosinski>
Can I somehow use Ruby in place of PHP without RoR? I would like to get a form from user, validate it, etc. Is it possible, how?
<JonnieCache>
pskosinski: sinatra is probably what you want
<JonnieCache>
its not quite like php in the sense of one-page-per-file
<JonnieCache>
but you dont want that anyway. its about as minimal as youd ever want
<pskosinski>
But I don't need any framework...
<JonnieCache>
its barely a framework. it just matches urls to methods, and fires templates. it doesnt really do anything
vlad_starkov has joined #ruby
<pskosinski>
I want let user put into a form an input, send, I will do something with it and display result. With Sinatra it seems much overcomplicated…
<pskosinski>
Hm…
<JonnieCache>
if you really want no framework, you could write a bare rack application
niklasb has quit [Ping timeout: 245 seconds]
alanp_ has quit [Read error: Connection reset by peer]
artOfWar has quit [Read error: Connection reset by peer]
kylemcgill has quit [Remote host closed the connection]
alanp has joined #ruby
oponder has joined #ruby
artOfWar has joined #ruby
filipe_ has joined #ruby
larissa has joined #ruby
jdripper has joined #ruby
jipiboily has joined #ruby
lkba has joined #ruby
<Androidnewbe>
how can i run command for command line fomr ruby script ?
ij has quit [Read error: Connection reset by peer]
<pskosinski>
`ls -lh` or x{ls -lh}
<pskosinski>
iirc
ij has joined #ruby
seoaqua has quit [Quit: 离开]
<JonnieCache>
or system(command)
AndChat| has joined #ruby
AndChat| has quit [Read error: Connection reset by peer]
hamed_r has joined #ruby
lkba has quit [Ping timeout: 244 seconds]
<pskosinski>
And how am I getting post input in Sinatra…
<JonnieCache>
pskosinski: its in the params hash
<JonnieCache>
just call the "params" method
<Androidnewbe>
in my scrpi ihave #!/bin/env ruby and next line 'cucumber'
<Androidnewbe>
it works but it does not print the out put to terminal
<pskosinski>
Thank you, need to try. :)
<JonnieCache>
Androidnewbe: try it with system() instead of ``
lkba has joined #ruby
elico has quit [Quit: elico]
<Takehiro>
i thought i could get a hash which has 1~5 in the values by doing arr = [1..5]
<Takehiro>
i cant...?
<Androidnewbe>
thanks JonnieCache
<burgestrand>
Takehiro: what would the keys be?
<Takehiro>
0,1,2,3,4 is fine
oponder has quit [Remote host closed the connection]
<Takehiro>
arr[0] = 1 arr[1] = 2
<Takehiro>
and so on..
<Takehiro>
burgestrand:
<burgestrand>
Takehiro: [1..5] is an array containing one element, [*1..5] is an array containing five elements
<burgestrand>
Takehiro: neither of them are a hash
classix has quit [Ping timeout: 246 seconds]
<Takehiro>
oooo i have to use *
<Takehiro>
what would be arr[0] if arr = [1..5] ?
<Takehiro>
1..5?
<burgestrand>
Takehiro: you could also do (1..5).to_a, or Array(1..5)
<burgestrand>
Takehiro: yep
<burgestrand>
Takehiro: [1..5][0] == 1..5, which is a Range
<csmrfx>
Just in case: is return within if-clause a "proper way" to exit from a method to caller?
carloslopes has joined #ruby
<burgestrand>
csmrfx: this is ruby, it is *a* way.
<Androidnewbe>
of if i have a loop in rurby like for i in (0..10) do ENV["BrowserType"] = i end how can i make it work
<Androidnewbe>
convert i to string ?
<Androidnewbe>
i.string ?
<csmrfx>
(keep trying to write ecmascript after a long ecma job so I ask simple stuff)
<burgestrand>
Androidnewbe: yep. Ruby won’t allow you to set ENV[anything] to a number.
Vinz_` is now known as Vinz_
<burgestrand>
Androidnewbe: i.to_s
<tintin>
How do you run ruby rack based website on windows?
Paradox has quit [Read error: Operation timed out]
<burgestrand>
tintin: using rackup.
Paradox has joined #ruby
<pskosinski>
burgestrand: Thank you. :)
mpereira has joined #ruby
<burgestrand>
pskosinski: :)
<burgestrand>
pskosinski: ruby is very different to PHP, it can be confusing at times.
Xeago has quit [Ping timeout: 260 seconds]
<tintin>
burgestrand: rackup is not a webserver
kil0byte has joined #ruby
<burgestrand>
tintin: no, but it will start one.
<tintin>
Which webserver do you use on windows to run ruby website?
<pskosinski>
yeah, I was never writing "web app" in Ruby…
zf_ is now known as zf
<burgestrand>
tintin: WEBrick by default, but it can start just about any rack-enabled webserver.
<tintin>
like apache or other
<tintin>
burgestrand: I know what webrick or rackup does on console, but i'm talking about dedicated webserver
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<burgestrand>
tintin: you don’t run ruby in apache; most often you run it on a webserver like webrick, or thin, or puma, or whatever, and proxy requests from apache or possibly using fcgi.
<Androidnewbe>
hmmm
<burgestrand>
tintin: you can also have a look at passenger, but I have no idea if that runs on windows, it’s pretty much the same thing though.
daniel_- has quit [Ping timeout: 260 seconds]
<burgestrand>
tintin: but, for pretty much all setups, ruby run it’s own webserver with webrick or similar. No idea what you mean by dedicated.
<Androidnewbe>
if ENV["BrowserType"] == '0' is this correct ?
<burgestrand>
Androidnewbe: sure.
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
gregorg_taf is now known as gregorg
kil0byte_ has quit [Ping timeout: 264 seconds]
<Androidnewbe>
so something is wrong
<tintin>
How do you run ruby website on windows except webrick and rackup ?
jipiboily has joined #ruby
<burgestrand>
Somebody else take him.
rafter has joined #ruby
<burgestrand>
>.>
* burgestrand
coughs
<Androidnewbe>
hmmm
d3vic3 has joined #ruby
eph3meral has joined #ruby
hbpoison has joined #ruby
<Androidnewbe>
is i set up environmental varialbe in command line does it only exist till i reboot the machine ?
<burgestrand>
Androidnewbe: probably only until you close the terminal.
vickaita has joined #ruby
chussenot has quit [Quit: chussenot]
mark_locklear has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
<Androidnewbe>
ohhhhh
<Androidnewbe>
didn'know
<Androidnewbe>
thanks
<pskosinski>
But... I can tell Apache/Lighttpd to interpret some files with Ruby interpreter. Can't I access a global array like in PHP, $_SERVER or like this? That would be best for so simple thing as I want to do...
<burgestrand>
pskosinski: how would you tell apache/lighttpd to interpret the files? The only way I know of is running them with the interpreter using CGI.
<burgestrand>
pskosinski: personally I avoid CGI, it tends to be more complicated than the alternatives in ruby. Most common way to run web applications in ruby is to run them *inside* the webserver, that itself is also ruby: like webrick, or thin, or puma, or perhaps phusion passenger.
<burgestrand>
pskosinski: this is different from PHP, where the webserver is separate and only runs the php script.
<pskosinski>
Ok…
enroxorz-work has joined #ruby
<pskosinski>
So Sinatra won't work from CGI?
maasha has quit [Quit: Page closed]
<burgestrand>
pskosinski: no idea, trying to find out if rack works with cgi.
<pskosinski>
Hm...
<tintin>
How does rack get the form request value from env ?
<Androidnewbe>
how do i remove the evn varaible ?
<Androidnewbe>
delete <varaiblename> ?
<tintin>
Who sets/updates/initialize the env variables
skaczor has joined #ruby
hbpoison has quit [Ping timeout: 265 seconds]
skaczor has quit [Remote host closed the connection]
geekbri has joined #ruby
love_color_text has joined #ruby
<burgestrand>
Androidnewbe: ENV.delete(key)
<Androidnewbe>
is this from command line ?
iamjarvo has joined #ruby
<burgestrand>
tintin: you set the env variables, rack gets the form request from the request itself.
<pskosinski>
Well, I have a static website. I can tell lighttpd to interpret a file with Ruby so I can generate something from Ruby... And I want to make a script on that website but I need to get user input...
<burgestrand>
Androidnewbe: I thought you were asking about ruby. In the console you can do… unset VARNAME
<tintin>
burgestrand: question is: how does rack get the value internally from server? i/users just type the value in textbox of a form
<Androidnewbe>
thanks
artOfWar_ has quit [Remote host closed the connection]
<burgestrand>
tintin: when the form is sent, a request is sent to the server, which itself is running rack; rack is *in* the webserver
artOfWar has joined #ruby
squidz has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
<pskosinski>
So I would just need to use different webserver? ^^ So maybe I will just use PHP…
<tintin>
burgestrand: rack is in the webserver? how? does webbrick runs rack internally?
<tintin>
What do you mean?
<eph3meral>
pskosinski: I think you should just use rails
<eph3meral>
pskosinski: then apache is irrelevant
<eph3meral>
or maybe sinatra if you like, which is rack based
<mfridh>
is there any specific ruby version where "func1.func2\n.func3" started working? Trying the FnordMetric gem and my ruby is bailing all over the place on these linebreaks
<squidz>
I have this file http://www.monkeywalk.com/wp/wp-content/uploads/2011/07/progressive-dictionary.txt and I want get some of the lines into my sqlite DB I thought the easiest way would be converting that file to csv, but that's where im stuck. I need the columns: |word|definition|pronounciation| meaning that I would ignore the additional phrases(all other lines besides the numbered lines and the line following a numbered line) can somebody give me some tips?
<csmrfx>
tintin scroll back and carefully copypaste what he answered and read again and google until you understand
v0n has joined #ruby
<Androidnewbe>
if i do puts(ENV["BrowserType"]) it does not print anything
<csmrfx>
squidz: well, use a csv importer?
<squidz>
eph3meral: im not at the point yet where i am going to write the csv, i need help processing the file i gave, because I have to exclude some lines and separate some words
<Androidnewbe>
tired also puts(ENV["BrowserType"].to_s)
filipe_ has quit [Ping timeout: 260 seconds]
jonathanwallace has joined #ruby
<csmrfx>
squidz: (to import data into ruby, save as plain "clean" csv, load into sqlite2)
<csmrfx>
*3
<Androidnewbe>
so the condition if ENV["BrowserType"].to_s == '0' wont work
<tintin>
csmrfx: he didn't answer my last question, the inner works of rack
<csmrfx>
tintin: so?
jonathanwallace has quit [Remote host closed the connection]
<Androidnewbe>
oh shit wait
<Androidnewbe>
my falut
<squidz>
csmrfx: Yes i know that, but like I said, that isnt yet my problem, my question is processing my text file to get it into the csv layout that I want. I know I can use the csv library when I am ready, but I need to do some processing on the file first. The processing is where im stuck
<tintin>
csmrfx: so what are you trying to say to me?
dekroning has quit [Ping timeout: 255 seconds]
ltsstar has quit [Quit: ltsstar]
<csmrfx>
squidz: if a csv importer cant handle the whitespace, just read that line-by-line and split-by-whitespace or regex-columns
<csmrfx>
tintin: stop typing, start reading.
<squidz>
some of the lines look like this "的 [de] of; stru....", and I need the chinese word to be a separate column, the [de] to be a separate column, then the rest of the line as yet another column
<eph3meral>
squidz: text processing is like, pretty close to the most basic task in computer programming
<tintin>
tintin: when the form is sent, a request is sent to the server, which itself is running rack; rack is *in* the
<tintin>
tintin: when the form is sent, a request is sent to the server, which itself is running rack; rack is *in* the webserver
<tintin>
csmrfx: ARe you talking about this? ^
<squidz>
eph3meral: yes, I know, I am new to ruby, I normally programm java and haskell. With haskell I would do this with the parser called parsec, and with java probably regex. So would you also use regex in ruby for a case like this?
psycho_one has quit [Remote host closed the connection]
<eph3meral>
squidz: sure, regex will probably work
<squidz>
eph3meral: yes im not asking what will probably work , I know it will work, i am asking what is the preferred/best standard for this
skaczor has joined #ruby
<eph3meral>
squidz: for parsing extremely domain specific and non-standardly formatted data?
fixl has joined #ruby
<eph3meral>
there isn't one, it's called Your Own Ingenuity ™ :)
<squidz>
yes
<squidz>
alright, then I guess I will have to use regex, I just would have rather not have. I guess there is no other big alternatives for a problem like this?
<JonnieCache>
dont turn your nose up at billable hours
<JonnieCache>
;)
<eph3meral>
++
Monie has quit [Ping timeout: 244 seconds]
moshee has quit [Ping timeout: 260 seconds]
irleif has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Axsuul has quit [Ping timeout: 260 seconds]
banisterfiend has joined #ruby
krawchyk has joined #ruby
<banisterfiend>
anyone here got anyone here got 'practical object oriented programming' http://www.poodr.info/book/ is it good?
enroxorz-work has quit [Read error: Connection reset by peer]
verto is now known as verto|off
mpereira has quit [Read error: Connection reset by peer]
noxoc has quit [Ping timeout: 256 seconds]
F1skr has joined #ruby
enroxorz-work has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
baphled has quit [Ping timeout: 265 seconds]
filipe_ has quit [Ping timeout: 260 seconds]
afader has joined #ruby
afader has joined #ruby
afader has quit [Changing host]
Rydefalk has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
d3vic3 has quit [Ping timeout: 252 seconds]
Rydefalk has joined #ruby
awarner has joined #ruby
<burgestrand>
pskosinski: what you typically do is run your main server in the front (e.g. lighttpd, nginx, apache), and for requests matching a certain pattern are proxied to another server running on another port
Vinz_ is now known as Vinz_`
d3vic3 has joined #ruby
<burgestrand>
pskosinski: I found out you can run pretty much any rack-enabled web framework (or just a raw rack app) through CGI though
Rydefalk_ has joined #ruby
Morkel has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
nateberkopec has quit [Quit: Leaving...]
<burgestrand>
(no idea exactly how, but it’s doable ^^)
<pskosinski>
Thank you. :)
<pskosinski>
It's complicated as hell for so simple as I want to do. I will just use PHP…
casheew has quit [Read error: Connection reset by peer]
<pskosinski>
so simple app *
casheew has joined #ruby
jcaudle has joined #ruby
casheew has quit [Read error: Connection reset by peer]
demet8 has quit [Quit: demet8]
Iszak has joined #ruby
Iszak has quit [Changing host]
Iszak has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
Shrink has quit [Ping timeout: 246 seconds]
dev_ryan70 has joined #ruby
jipiboily has left #ruby [#ruby]
awarner has quit [Remote host closed the connection]
nyuszika7h has joined #ruby
ffranz has joined #ruby
casheew has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
filipe_ has joined #ruby
v0n has joined #ruby
Morkel has quit [Quit: Morkel]
Rydefalk has joined #ruby
Artheist has quit [Remote host closed the connection]
Rydefalk_ has quit [Read error: Connection reset by peer]
nitti has joined #ruby
macabre has joined #ruby
kil0byte has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
dr_bob has quit [Quit: Leaving.]
answer_42 has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
GoGoGarrett has joined #ruby
sspiff has quit [Remote host closed the connection]
kil0byte_ has quit [Ping timeout: 248 seconds]
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
jrajav has joined #ruby
nitti has quit [Ping timeout: 260 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
v0n has quit [Ping timeout: 260 seconds]
Xeago_ has quit [Remote host closed the connection]
rafter has quit [Remote host closed the connection]
Shrink has joined #ruby
<JonnieCache>
can someone explain to me what this is doing?
<burgestrand>
JonnieCache: Sequel::Model becomes a method in this case. Whatever that returns is the superclass of the Publication.
<solirc>
I need to actually modify a and b
nateberkopec has joined #ruby
enroxorz-work has joined #ruby
<JonnieCache>
burgestrand: riiight. so how the hell have we ended up in that state?
<burgestrand>
lxsameer: ruby’s parameters are not necessarily named, you can inspect the parameters of a method if you have it’s instance though but I don’t believe the names are available there.
<burgestrand>
JonnieCache: beats me. :)
<JonnieCache>
ahh, with module Sequel; def self.Model
Cultofmetatron has joined #ruby
<JonnieCache>
simple as that
<JonnieCache>
thats some tricky shit right there
dhruvasagar has joined #ruby
chussenot has quit [Remote host closed the connection]
<burgestrand>
Ah, I thought you asked what drove the design decision.
ananthakumaran has quit [Quit: Leaving.]
<csmrfx>
JonnieCache: ok, that only wokss if the former hash already exists
<JonnieCache>
csmrfx: indeed
Coolhand has joined #ruby
<JonnieCache>
burgestrand: oh and apparently just under that is class Model
<burgestrand>
lxsameer: actually, it does expose the names, that is cool.
<JonnieCache>
and in the self.Model method it returns Class.new(Model)
<JonnieCache>
clever bastards
<burgestrand>
JonnieCache: a subclass of Model it is :)
<lxsameer>
burgestrand: i think you misunderstand me, for example , we have a method called A, i want to call that when any parameter name i want for example : A(:z=>1,:x=>2) or A(:foo=>"bar")
<burgestrand>
lxsameer: you can call it that way, except you only receive one parameter in both your examples, and that is a hash.
<burgestrand>
lxsameer: you can have any number of required parameters before that as well.
dr_bob has joined #ruby
<lxsameer>
burgestrand: i see
<burgestrand>
lxsameer: but there is nothing special about the parameter itself; once ruby notices you are passing hash syntax in a method call it bunches them all up into one hash and passes it as one parameter.
m4rtijn is now known as gay-man
<gay-man>
hallo
<burgestrand>
lxsameer: for this reason, it can become quite convoluted if you accept two or more options hashes in this way, in which case you’ll need to surround the call with brackets: moo({ "a" => "b" }, { "b" => "c" }) becomes two parameters, while moo("a" => "b", "b" => "c") becomes one parameter.
gay-man is now known as martijnchen
<martijnchen>
php rules
* burgestrand
shrugs
<lxsameer>
burgestrand: thanks man
solirc has left #ruby ["WeeChat 0.3.2"]
<burgestrand>
lxsameer: you’re welcome
samphippen has joined #ruby
dmerrick has joined #ruby
macabre has quit [Remote host closed the connection]
Xeago has joined #ruby
cdzombak has joined #ruby
ttt has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
nemesit has joined #ruby
<csmrfx>
I have a method that gets an arg _u (which I test puts and it outputs string contents). Why does $result[ _u ] give: undefined local variable or method `_u ' for main:Object (NameError)
love_color_text has quit [Remote host closed the connection]
<csmrfx>
(the test puts is on the line before)
lxsameer has quit [Quit: Leaving]
<burgestrand>
csmrfx: show your code.
irleif has quit [Quit: Computer has gone to sleep.]
<csmrfx>
had result[ _u ] and ruby got angry at me.
<csmrfx>
changed to result[_u] and now it works.
* csmrfx
?
<burgestrand>
Both works fine for me.
ttt has quit [Ping timeout: 240 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
<burgestrand>
Interestingly enough, so does "result [ _u ]", looks weird.
martijnchen is now known as m4rtijn
<csmrfx>
I have a theory involving a haphazard ctrl+space before or after _u, but have to hurry due to job
<burgestrand>
Yeah, non-breaking spaces can creep in at times.
<burgestrand>
Ruby won’t like those.
<burgestrand>
Disabled them on my keyboard.
g_bleezy has joined #ruby
thisirs has quit [Ping timeout: 240 seconds]
sambio has joined #ruby
thisirs has joined #ruby
irleif has joined #ruby
invisime has joined #ruby
Iszak has quit []
rjsamson has joined #ruby
jblack has joined #ruby
ffranz1 has joined #ruby
ffranz has quit [Quit: Leaving]
filipe_ has quit [Ping timeout: 260 seconds]
philcrissman has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
daniel_-_ has joined #ruby
macabre has joined #ruby
thisirs has quit [Ping timeout: 244 seconds]
kpshek has joined #ruby
codefyre has joined #ruby
vlad_sta_ has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
Androidnewbe has quit [Read error: Operation timed out]
rjsamson has quit [Remote host closed the connection]
`Mew_ has quit [Read error: Connection reset by peer]
stopbit has joined #ruby
<squidz>
how can I define multine line string literals with utf-8 characters
Whackatre has joined #ruby
Whackatre has quit [Changing host]
Whackatre has joined #ruby
<burgestrand>
invisime: except 0x1020 does not fit in one byte
<invisime>
right. it should be two.
Voxxit has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
mikepack has quit [Remote host closed the connection]
<burgestrand>
invisime: ah, I understand what you want now. Originally thought you were playing around with characters.
<invisime>
burgestrand: Array#pack is what I was looking for.
<invisime>
I was expecting it to be in String or Fixnum.
<burgestrand>
:)
<burgestrand>
Yeah it’s a bit confusing.
dhruvasagar has joined #ruby
<invisime>
burgestrand: oh. and it looks like this'll use my native endian-ness. eeexcellent. I'm reading from this pipe with C code on the other end, so that'll help. XD
<squidz>
im getting an 'unexpected $end, expecting ')'' when i run: processLine ("2. 一")
<squidz>
whats wrong with my string?
instinkt has quit [Quit: leaving]
iamjarvo has joined #ruby
<burgestrand>
squidz: tried without the space between the method and parameters?
<squidz>
burgestrand: yes same
<burgestrand>
squidz: runs fine here. The error is not in the code you posted.
artOfWar has quit [Read error: Connection reset by peer]
<burgestrand>
squidz: runs without syntax errors here.
<burgestrand>
squidz: look for invisible characters.
artOfWar has joined #ruby
jaygen has joined #ruby
<burgestrand>
squidz: if you are on a mac, you can accidentally type non-breaking space characters using ALT-SPACE which will trip ruby up.
<squidz>
burgestrand: im using linux
<burgestrand>
squidz: you are missing the point.
tomsthumb has quit [Quit: Leaving.]
<burgestrand>
squidz: it was just an example.
atmosx has joined #ruby
samuel02 has joined #ruby
m4rtijn has quit [Quit: Verlassend]
postmodern has quit [Quit: Leaving]
<squidz>
still not finding any hidden characters
vickaita has joined #ruby
Russell^^ has joined #ruby
F1skr has joined #ruby
<burgestrand>
squidz: copy the code from your paste, and paste it in your script.
philips_ has quit [Excess Flood]
codefyre has quit [Quit: Leaving]
jaygen has quit [Ping timeout: 252 seconds]
<squidz>
burgestrand: after pasting, i still have the error
atmosx has left #ruby [#ruby]
<burgestrand>
squidz: I don’t. Perhaps you are using an old ruby version?
<burgestrand>
squidz: 1.8.x and down is considered old.
pskosinski has left #ruby ["Whatever"]
<squidz>
im usint 1.9.2
<burgestrand>
squidz: no idea if it could really have an impact, the syntax looks correct to me.
<burgestrand>
And the code runs.
<burgestrand>
squidz: …
<burgestrand>
squidz: you didn’t paste the full error did you.
<squidz>
sorry 1.9.3
v0n has joined #ruby
tallow has joined #ruby
philips_ has joined #ruby
<samuel02>
I have an array with 'unknown' elements. How can I get a slice of the array from a given element and two elements to the left. So array = [0,1,2,3,4], element = 4 gives slice [2,3,4] but array = [0,1], element = 1 gives slice [0,1]
<squidz>
here is the full error
<squidz>
ChDictParse.rb:7: invalid character property name {Lo}: /^\p{Lo}\s/
<heftig>
samuel02: hmm, this may work as well: slice = array[[0,array.index(elem)-2].max,3]
<samuel02>
heftig, seems less obvious though?
<heftig>
ah, that will always try to return 3 elements, even at the leftmost edge
Emmanuel_Chanel has quit [Quit: Leaving]
mercwithamouth has joined #ruby
swex has quit [Read error: Connection reset by peer]
banisterfiend has quit [Remote host closed the connection]
cakehero has joined #ruby
swex has joined #ruby
seydar has joined #ruby
jonathanwallace has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
crankycoder has left #ruby ["Leaving..."]
artOfWar has joined #ruby
mikepack has joined #ruby
m4rtijn has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
elsifaka has quit [Ping timeout: 260 seconds]
prezioso has quit [Ping timeout: 268 seconds]
mmitchell has joined #ruby
JohnBat26 has quit [Ping timeout: 264 seconds]
Androidnewbe has joined #ruby
dhruvasagar has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
nari has quit [Ping timeout: 244 seconds]
tds has joined #ruby
carloslopes has quit [Ping timeout: 260 seconds]
elsifaka has joined #ruby
kaleido has quit [Changing host]
kaleido has joined #ruby
SCommette has joined #ruby
ddd has quit [Quit: Leaving.]
fixl has quit [Remote host closed the connection]
rasbonics has joined #ruby
ddd has joined #ruby
awarner has quit [Remote host closed the connection]
und3f has quit [Ping timeout: 260 seconds]
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
wargasm has joined #ruby
L1 has quit [Remote host closed the connection]
und3f has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
carlyle has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
nyuszika7h has joined #ruby
anachronistic has joined #ruby
dhruvasagar has joined #ruby
carlyle has quit [Remote host closed the connection]
mucker has joined #ruby
carlyle has joined #ruby
artOfWar has quit [Read error: Connection reset by peer]
artOfWar has joined #ruby
thisirs has quit [Remote host closed the connection]
seydar has quit [Quit: leaving]
mmitchell has quit [Remote host closed the connection]
<squidz>
does anybody know how to write to a csv file all at once given a a matrix of the rows?
mmitchell has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<eph3meral>
squidz: "all at once" and "matrix"?
<squidz>
eph3meral: yes I have an array of rows
<eph3meral>
squidz: if by matrix you mean an array of lines
<squidz>
well its an array of arrays
<eph3meral>
and if by all at once, you mean one line at a time with a loop, then yeah sure
tommyvyo has quit [Read error: Connection reset by peer]
<squidz>
so yes a matrix
<eph3meral>
squidz: eh, whatever, if you're not doing matrix transformations, it's not particularly acting as a matrix - it's more aptly called what it is, which is an array of arrays
<squidz>
okay so is there a function in the CSV library that allows me to write that?
seanyo has quit [Remote host closed the connection]
beiter has joined #ruby
<squidz>
im looking at it, but havent found what i am talking about
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
<eph3meral>
i don't see what's wrong with something like lines.each …. write line to csv ...
seanyo has joined #ruby
<eph3meral>
if your data is sanely prepped, it could be a one liner if you like
<kapowaz>
I'm trying to set up guard-sprockets, but I get this error when I run bundle exec guard init sprockets:
<kapowaz>
15:01:46 - ERROR - Could not load 'guard/sprockets' or '~/.guard/templates/sprockets' or find class Guard::Sprockets
<Xeago>
CSV.open "file" do { |csv| ary.each { |e| csv << e } }
<Xeago>
wops, remove the do
<kapowaz>
but I don't get it when I run without bundle exec
Virunga has quit [Remote host closed the connection]
tk__ has quit [Quit: ばいばい]
<Xeago>
kapowaz: are guard and sprockets in your gemfile?
<kapowaz>
Xeago: aha, you may have the right hint there. guard-sprockets is, but guard isn't.
<kapowaz>
I assumed it'd just pull in guard too, but maybe it needs to be specified?
<kapowaz>
I mean, the gem is installed…
<eph3meral>
kapowaz: bundle install | grep guard will tell you
<Xeago>
bundler will exclude it if it is not in gemfile and not an explicit dependency
<kapowaz>
Using guard (1.5.2)
<kapowaz>
from that output
<Xeago>
I'd expect it to be included tho
<eph3meral>
kapowaz: so you're fine on that angle
<kapowaz>
yeah... I've added it to the gemfile and rebundled, but it still gives the same error
<kapowaz>
that said, it's in the group :development
<eph3meral>
kapowaz: if it works with bundle exec, then what's the big deal? (aside from having to type bundle exec each time)
tk__ has joined #ruby
<Xeago>
it doesn't work with be, it does without
<kapowaz>
eph3meral: it *doesn't* work with bundle exec :)
vickaita has quit [Ping timeout: 276 seconds]
<eph3meral>
oh, umm… ok so if it works without, then what's the issue?
<kapowaz>
well, guard itself complains when I do that
<eph3meral>
kapowaz: when you do what?
<eph3meral>
kapowaz: (please don't use pronouns when possible)
apok has joined #ruby
<kapowaz>
when I run it *without* bundle exec
<kapowaz>
(sorry, thought that was obvious in context)
<kapowaz>
‘when I run it’ = `guard init sprockets`
vickaita has joined #ruby
<eph3meral>
kapowaz: just assume it's never obvious - so many people misuse and abuse pronouns… in computer communication, it always behooves you to be verbose
LowKey has quit [Quit: changing servers]
<eph3meral>
kapowaz: good :)
<Xeago>
nice use of quotes there ;p
LowKey has joined #ruby
<kapowaz>
when you run bundle exec from the command line, which environment does it assume you're using ?
<eph3meral>
kapowaz: with that said, I don't know the answer to your question, sorry :P
<eph3meral>
kapowaz: development
und3f has quit [Ping timeout: 255 seconds]
<eph3meral>
kapowaz: development = the default environment if not specified
dnyy has joined #ruby
tk__ has quit [Client Quit]
<kapowaz>
that's what I thought...
<kapowaz>
I am kind of confused then.
fa1ur has joined #ruby
arkiver has joined #ruby
n1x has joined #ruby
cdt has joined #ruby
nga4 has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
<kapowaz>
need to find somebody who's used guard-sprockets, I guess.
geggam has joined #ruby
<eph3meral>
kapowaz: not to be facetious, but have you googled your specific error?
<workmad3>
kapowaz: have you used a git dependency for guard-sprockets?
<kapowaz>
yes, nothing obvious returned.
<kapowaz>
I'm just seeing a similar error in connection with a different guard module though
artOfWar has quit [Read error: Connection reset by peer]
<kapowaz>
so I'm investigating that.
artOfWar_ has joined #ruby
<kapowaz>
workmad3: no, just using rubygems
<workmad3>
kapowaz: did you bundle install to a path?
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<kapowaz>
interestingly, if I do bundle console, then require 'guard/sprockets' in there, it tells me it's missing the 'execjs' dependency
jslowe has joined #ruby
<kapowaz>
I'm wondering if there is a broken gemspec or something?
<kapowaz>
workmad3: nope
<eph3meral>
kapowaz: well, do you have a js runtime?
<eph3meral>
kapowaz: install node or something similar
<kapowaz>
I do have node installed
<eph3meral>
k
<kapowaz>
but even so, you'd expect it to flag dependencies as part of the bundling process, wouldn't you?
<workmad3>
kapowaz: is in execjs saying that you're missing a dependency?
<kapowaz>
no, that's from within the bundle console
<eph3meral>
kapowaz: what you need, is something that serves as a js runtime, if you have node then you're fine, otherwise you need another gem such as 'therubyracer'
elsifaka has quit [Read error: No route to host]
<eph3meral>
kapowaz: and also, bundle install | grep execjs
samphippen has quit [Quit: Computer has gone to sleep.]
vickaita has quit [Ping timeout: 265 seconds]
<eph3meral>
kapowaz: ok, well the execjs gem doesn't take care of making sure you have a runtime installed
<kapowaz>
I've just added it and the error in the above gist no longer happens
<kapowaz>
I already have a runtime installed
<eph3meral>
kapowaz: it works with several runtimes
joeycarmello has joined #ruby
<Xeago>
osx and windows provide a javascript runtime, there's also mozilla's
<eph3meral>
hmm, ok
<kapowaz>
and now bundle exec guard init works
<eph3meral>
good to know
nateberkopec has quit [Read error: Connection reset by peer]
<jrajav>
Xeago: Where were you last night? :O
<jrajav>
My torrent was lonely
<eph3meral>
i guess I was probably thinking I was in the rails channel, nm me :)
<Xeago>
I fell asleep at work :<
<kapowaz>
so I'd say guard-sprockets requires execjs but doesn't have it in the dependencies
<Xeago>
woke up at midnight when the alarm fired
<Xeago>
hoe big is the vm?
<jrajav>
2.8gb or so
mikemac has joined #ruby
crazymykl has quit [Ping timeout: 260 seconds]
elsifaka has joined #ruby
Goles has joined #ruby
manizzle_ has quit [Ping timeout: 240 seconds]
<Xeago>
damnit, doesn't fit my cloud downloader, I'll have to use my homebox — 10 * Gbit connection vs 300Mbit connection :<
DrShoggoth has joined #ruby
rippa has joined #ruby
yshh has quit [Remote host closed the connection]
<squidz>
i see that the CSV library converts a csv file to a table object. If I have a table object though, how can i write a CSV file with it?
hbpoison has joined #ruby
<regedarek>
Hello, anybody know how to stub in rspec after_create callback self.target.save! ?
<Xeago>
jrajav: should I mail you for the torrent?
<kapowaz>
it damned well requires execjs, but it's not in the gemspec. That's an outright mistake, surely?
<eph3meral>
kapowaz: sounds like it - and it doesn't surprise me
<kapowaz>
why not?
<eph3meral>
cuz it's open source software
<eph3meral>
people make mistakes
djdb has quit [Remote host closed the connection]
<kapowaz>
given that its very own command line tool tells you to run it through bundle exec, I'm surprised it's gone undetected this long
<eph3meral>
not like closed source is perfect - but I often find there's less rigorous testing and quality assurance that goes in to most OSS - the attitude is usually "eh, works for me, and then if you find a bug let me know"
<kapowaz>
it seems like the only way to avoid it is to already have execjs in your bundle
hbpoison has quit [Ping timeout: 265 seconds]
<kapowaz>
*in your Gemfile
banisterfiend has joined #ruby
und3f has joined #ruby
kil0byte has quit [Remote host closed the connection]
<eph3meral>
you can argue this way and that - but this has been my real world experience over the past 5 years or so
<eph3meral>
kapowaz: fork, patch, pull request, get teh eFames, rinse repeat :P
kadel has quit [Remote host closed the connection]
<eph3meral>
did I mention all the ladies you'll get as well?
ezra has joined #ruby
ezra has joined #ruby
ezra has quit [Changing host]
v0n has joined #ruby
<kapowaz>
I've posted an issue on github. I have other things I'd rather be doing.
hsbt is now known as hsbt_away
cascalheira has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
tallow has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
nga4 has quit [Remote host closed the connection]
blacktulip has quit [Ping timeout: 260 seconds]
joeycarmello has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
ckrailo has joined #ruby
blacktulip has joined #ruby
Vert has joined #ruby
marty_mcfly has joined #ruby
ltsstar has joined #ruby
<marty_mcfly>
trying to get this straight in my head ... when is it suitable to use sudo with gem install and when is it not suitable ?
u89 has joined #ruby
<eph3meral>
kapowaz: don't we all :)
<kapowaz>
marty_mcfly: ideally, never
<eph3meral>
not true
<Sou|cutter>
marty_mcfly: I never use sudo for gems
<marty_mcfly>
ok
<eph3meral>
er, wait no nm
<lupine_85>
"depends" is about the only answer you can give
<marty_mcfly>
so if i do a gem install without sudo
<kapowaz>
I can't say I've used sudo gem install since I started using bundler
artOfWar_ has quit [Ping timeout: 240 seconds]
<marty_mcfly>
it will install the package files in a user-owned directory no ?
<eph3meral>
marty_mcfly: if you use RVM then you probably never need to use sudo
<lupine_85>
it affects whether the gem ends up in ~/.gem or /usr/... (or /var/..., for debian, of course)
<eph3meral>
if you're setting up a production server, the wise thing to do is install a .rpm or .deb of your ruby version system wide
<Xeago>
because rvm sets the gempath in ~/.gem
<burgestrand>
Even if you use rvm you should never use sudo.
<burgestrand>
… except for installing rvm itself, and doing it system-wide.
<eph3meral>
marty_mcfly: in which case, since your gem path will be in the "system" you'll need to use sudo most likely, to install gems
<lupine_85>
in development, use rvm or rbenv by preference. in production, try to avoid using gems at all
<burgestrand>
… but maybe that has changed.
<Xeago>
burgestrand: how about when not using rvm
v0n has quit [Ping timeout: 248 seconds]
<burgestrand>
Then you’re on your own.
<eph3meral>
lupine_85: what do you do in prod then? make a separate package for each gem?
hbpoison has joined #ruby
<lupine_85>
eph3meral, pretty much, aye
<eph3meral>
that seems… non-optimal, from a maintenance standpoint
<Xeago>
eph3meral: we bundle it into vendor
<Xeago>
and upload it with the source
<eph3meral>
Xeago: that sounds like a better idea
<lupine_85>
eh, it's perfectly worth it
<lupine_85>
if you're a production environment worth mentioning, it makes life a lot easier
monkegjinni has quit [Remote host closed the connection]
<eph3meral>
having to re-package any time your gems change? doesn't sound easier to me
prezioso has joined #ruby
samphippen has joined #ruby
<lupine_85>
in production, your gems don't change that often
<lupine_85>
or mine certainly don't
<lupine_85>
and the packaging is almost entirely automatic
Takehiro_ has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
<eph3meral>
sure, I guess in that case you're fine
eldariof has quit []
maletor has joined #ruby
elico has quit [Quit: elico]
* lupine_85
has a current deployment across about 30-40 machines which uses a wide variety of ruby libraries, and two different ruby VMs, and sticking everything into .deb packages has definitely made life better
<lupine_85>
if your production environment changes every other day and you're rolling the debs/rpms by hand, things are likely to be different
baroquebobcat has joined #ruby
<lupine_85>
apparently, bundler and gemfiles get a lot of love these days
headius has joined #ruby
monkegjinni has joined #ruby
hotovson has quit [Remote host closed the connection]
irleif has quit [Quit: Computer has gone to sleep.]
blazes816 has joined #ruby
solidoodlesuppor has joined #ruby
irleif has joined #ruby
classix has quit [Ping timeout: 244 seconds]
nitti_ has joined #ruby
clj_newb has quit [Ping timeout: 268 seconds]
<kapowaz>
I need to find a good working example of a sprockets + guard-sprockets environment for heroku deployment (that isn't Rails 3.1)
blacktulip has quit [Ping timeout: 244 seconds]
walbert has joined #ruby
blacktulip has joined #ruby
<kapowaz>
iirc sprockets should generate concatenated/minified files with a name that is like application-xxxxxxx.js (say) where xxxxx is a hash or similar
<kapowaz>
but what I've got working now with guard is just generating files with a flat name
<kapowaz>
application.js
<kapowaz>
for production it'll be something else entirely, rendering the paths wrong
<kapowaz>
>_<
prezioso has quit [Ping timeout: 252 seconds]
nitti has quit [Ping timeout: 265 seconds]
quest88 has joined #ruby
nga4 has joined #ruby
dr_bob has quit [Quit: Leaving.]
arkiver has quit [Quit: Leaving]
khakimov has joined #ruby
alfism has joined #ruby
Takehiro_ has quit [Read error: Connection reset by peer]
rjsamson has quit [Remote host closed the connection]
SCommette_ has joined #ruby
Nektye has joined #ruby
rjsamson has joined #ruby
Takehiro has joined #ruby
yshh has joined #ruby
<blazes816>
"C++11 and Boost - Succinct Like Python" - awesome
SCommette has quit [Ping timeout: 260 seconds]
SCommette_ is now known as SCommette
adeponte has quit [Remote host closed the connection]
irleif has quit [Quit: Computer has gone to sleep.]
<jrajav>
"But still just as obfuscated and unmaintainable as the good ol' C++ you know and love"
irleif has joined #ruby
cakehero has joined #ruby
morf has quit [Quit: eof]
rjsamson has quit [Ping timeout: 265 seconds]
apok has quit [Quit: apok]
aganov has quit [Remote host closed the connection]
ananthakumaran has quit [Ping timeout: 252 seconds]
monkegjinni has quit [Remote host closed the connection]
bfrog has joined #ruby
ananthakumaran has joined #ruby
<bfrog>
is there some rack server that does something like nginx, spawns off workers and does the appropriate thing?
Takehiro_ has joined #ruby
<bfrog>
if a worker dies, its restarted
<bfrog>
that sort of thing
Takehiro has quit [Read error: Connection reset by peer]
<keymone>
unicorn?
williamherry has quit [Quit: WeeChat 0.3.7]
<blazes816>
unicorn!
<bfrog>
thanks
Slivka has joined #ruby
quest88 has quit [Quit: quest88]
<juha_>
unicorns are awesome
x82_nicole has joined #ruby
_alejandro has joined #ruby
<blazes816>
they're like ponies but magic or bourgeois
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
Ry has joined #ruby
<Edward_>
I never understood why we need things like unicorn
<Edward_>
why can't we just couple a rails install with a web server
<Edward_>
what does unicorn *actually* do
<Gate>
Edward_: decouples it :)
<Edward_>
Hm?
<Gate>
manages worker threads and acts on a queue just as fast as it can, your ruby doesn't need to run in your web server's user doesn't need to be globally installed, etc
blacktulip has quit [Ping timeout: 246 seconds]
<blazes816>
no, no, no, we do not need Rails coupling a webserver
<Gate>
^^
<blazes816>
that's the opposite of what we should do
<Edward_>
it seems this unicorn/passenger thing just adds an additional component
<blazes816>
Apache or Nginx is all php needs
<Xeago>
it is a good thing rails doesn't provision a web server
<Edward_>
to the stack
<hoelzro>
Edward_: php-fpm is the closest thing, I think
juha_ has quit [Ping timeout: 240 seconds]
dpatel has joined #ruby
elsifaka has quit [Quit: Veloma e!]
caleb_io has joined #ruby
ananthakumaran1 has quit [Client Quit]
<blazes816>
but it's a component vital to being a web application - the server
<Xeago>
and therefore it conforms to a defacto standard: rack
<Xeago>
or should I say rack-app
ffranz1 is now known as ffranz
<Xeago>
any webserver that can host a rack-app can host a rails web application
sn0wb1rd has quit [Quit: sn0wb1rd]
<Xeago>
sinatra padrino and even goliath are in rack
cakehero has quit [Quit: Computer has gone to sleep.]
<Edward_>
Mm..looks like I got a bit of reading to do. I was never familiar with what a rack app is
<Edward_>
thank you.
<Xeago>
rack is the middleware between webserver and application code
<Edward_>
fyi blazes816: PHP doesn't need middleware as far as I am concerned. I don't use PHP. Just making an observation.
<Xeago>
php uses mod_php as middleware on apache
maesbn_ has quit [Remote host closed the connection]
<blazes816>
php needs an apache mod to run
<Xeago>
not necessarily apache..
<Xeago>
php, just like ruby, can accept raw sockets
<Xeago>
and do all parsing themselves
<Gate>
right, there is always a layer from the httpd to the actual code, beit mod_php, passenger, unicorn or fast_cgi
<Xeago>
however, that is a bad thing
<Xeago>
Gate: as I just said, not always :P
maesbn has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
savage- has quit [Quit: savage-]
<Gate>
Xeago: assuming you are using an httpd (better?)
<Xeago>
even then.. I wrote a script that upon requesting a page listens on a certain port and streams that to the client
kil0byte has joined #ruby
jblack has quit [Read error: Operation timed out]
noxoc1 is now known as noxoc
<Edward_>
Thanks^ for the explanation
samphippen has quit [Quit: Computer has gone to sleep.]
jblack has joined #ruby
burgestrand has quit [Quit: Leaving.]
heftig has quit [Quit: leaving]
rakl has joined #ruby
Virunga has joined #ruby
Dreamer3__ has joined #ruby
davidcelis has joined #ruby
maesbn has quit [Ping timeout: 248 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
hotovson has joined #ruby
nga4 has quit []
hsbt_away is now known as hsbt
failshell has joined #ruby
<failshell>
hello. im wondering if anyone here ever used the spreadsheet gem? any way to dynamically adjust the width of a column based on the data it contains? short of counting the number of chars i mean
<zeknox>
Xeago: I know nothing about GIL or anything sophisticated, just getting my start in ruby
<hoelzro>
the GIL shouldn't matter in this situation, should it? most of the lifting is I/O based, and plus, it's being done by a subprocess
<csmrfx>
ruby threads are useless, except in jruby
<Xeago>
csmrfx: rubinius
<hoelzro>
granted, I wouldn't use threads for this either, but I'm more comfortable with event stuff anyway
<RubyPanther>
That's true, when you're not using them for any advantages you just want to mimic an algorithm from another language, then yeah, you can port your Java thread algorithm instead of re-writing using traditional fork+IPC that Ruby is optimized for
<csmrfx>
oh, that too, Xeago ?
spacebug1 has joined #ruby
<RubyPanther>
The threads won't run at the same time, of course. It is not substantially different from just looping.
<csmrfx>
Except in jruby and rubinius, huh
alem0lars has joined #ruby
mucker has quit [Quit: leaving]
niklasb has joined #ruby
<hoelzro>
but since each thread is just blocking on an nmap process (which would run at the same time), does it matter?
artOfWar has joined #ruby
<hoelzro>
I wouldn't suggest starting out with a thread-based implementation, but since it already exists...
<headius>
Ruby threads aren't useless in MRI, they're just not useful for concurrent Ruby code execution
<headius>
they work quite well for multiplexing IO streams, etc
Nektye has quit [Quit: Leaving]
paulsamuels has joined #ruby
classix has joined #ruby
emaiax has joined #ruby
Monie has joined #ruby
<Xeago>
zeknox: yes that link is a good introduction
spacebug1 has quit [Client Quit]
<zeknox>
Xeago: thanks I'm going to look into it
paulsamuels is now known as paul_s
<zeknox>
alright, im going to ask the loaded question, what is the big diff between ruby and jruby?
<lupine_85>
one is a language, one is a VM that runs the language
<headius>
hah
<RubyPanther>
one is Ruby, the other is Java that can run some ruby scripts
<headius>
indeed
baphled has joined #ruby
<headius>
zeknox: I suppose you mean MRI and JRuby
<lupine_85>
anyway, the main difference between ruby 1.8/1.9 and jruby comes with threading
<headius>
that's probably the most obvious user-facing difference
<RubyPanther>
Don't let the fans fool you, there are various "real" rubies, and then there are some alternates that are mostly compatible, but can't actually use Ruby gems
BoomCow has joined #ruby
<lupine_85>
jruby has native threads and no GIL. 1.8 lacks both, 1.9 still has a GIL
<headius>
RubyPanther: are you saying JRuby can't use Ruby gems?
<RubyPanther>
headius: grab one out of a hat, can you assume it runs? No.
<lupine_85>
there are some gems jruby can't use (not many). it can, however, use most of the JRE
banisterfiend has quit [Read error: Connection reset by peer]
nazty has joined #ruby
juha_ has joined #ruby
<RubyPanther>
A specific gem, maybe it does.
<headius>
RubyPanther: that's totally untrue
* lupine_85
has a go
<headius>
the vast majority of gems just work
<RubyPanther>
lol it is totally _true_ not "untrue"
<RubyPanther>
headius: Now, come on, you could argue the other side yourself instead of just ignoring it like nobody told you many gems are written in C
spacebug_ is now known as spacebug
<headius>
most gems are not written in C
<lupine_85>
it's also worth noting that jruby can support gems with C extensions, although it's not perfect
<lupine_85>
zing, etc
<headius>
well, we have deprecated that…MRI's C API cripples any modern VM
<RubyPanther>
No, lupine_85, apply the test: pick a random gem, okay, but don't tell yourself the name yet. You've got a gem in your closed hand. Can you claim it will work? What is the "correct" answer? The correct answer is, you don't know if it works, and many of the most popular gems don't. You can't just choose a popular gem and think it works.
<headius>
it worked, but only in very specific cases where we had to dumb down JRuby to act like GIL-threaded MRI
<lupine_85>
RubyPanther, you're asking about probability
<headius>
RubyPanther: you're speaking in gross generalities
<lupine_85>
and I'd suggest that any random gem has at least a 75% chance of working
<headius>
the probability is that it *will* work
<headius>
if it doesn't have C code, and it doesn't work, I want to know about it
<headius>
and then it will work :)
alem0lars has quit [Quit: quit]
alem0lars_ has joined #ruby
_JamieD_ has joined #ruby
* lupine_85
is using jruby extensively. it makes some very nasty threaded ruby *actually feasible*
<lupine_85>
jury's still out on whether that's good or bad, of course ^^
<RubyPanther>
writing JRuby is a useful thing. Teaching people who aren't stuck in Java that it is the normal Ruby, or a reasonable replacement, is just wrong and an insult to Matz.
<lupine_85>
it's a perfectly fine ruby
mahmoudimus has joined #ruby
<Xeago>
MRI is the standard official and reference implementation of the ruby-spec
<lupine_85>
it does many things MRI doesn't do, and doesn't do a small number of things that MRI does
<Xeago>
wops, forgot punctuation there
mneorr has joined #ruby
<wca>
what does jruby do that mri doesn't?
<csmrfx>
Wat a discussion!
<csmrfx>
wca it runs on top of Oracle Java runtime
mneorr_ has quit [Read error: Connection reset by peer]
<csmrfx>
Oracle Java runtime has native threads
zeromodulus has quit [Read error: Connection reset by peer]
<csmrfx>
mri just has "one single thread"
<lupine_85>
wca, mostly-direct access to any java API out there (barely useful to me), native threads (ruby 1.9 has those), and scalable threading (that GIL will bite you eventually)
Araxia has joined #ruby
<Ry>
(MRI 1.9 doesn't have a GIL, it has a GVL)*
<lupine_85>
JIT compilation is fun too, of course
<headius>
RubyPanther: until you have used JRuby in some significant way, you do not know what you are talking about
Monie has quit [Quit: Quit]
Araxia has quit [Read error: Connection reset by peer]
samphippen has joined #ruby
<lupine_85>
it's a good troll, though
<csmrfx>
wait what ruby 1.9 has native threads?
<csmrfx>
noo
<Sou|cutter>
jruby is great, and it's pretty damn good at matching MRI behavior
* csmrfx
's planetary sim is aimed at jruby
<csmrfx>
well, the server part, anyways
dmiller has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
Araxia has joined #ruby
<wca>
headius: care to comment on my question about jruby over mri?
maesbn has joined #ruby
kbeddingfield has joined #ruby
<wca>
the only limitation I'm aware of is that you can't use C extensions (though I wonder if they could be linked via JNI or something?)
<wca>
and I guess there are probably some specs that don't pass?
<BoomCow>
what exactly is jruby
<BoomCow>
I"m looking at jruby.org
<lupine_85>
an implementation of the ruby language, on top of the JVM
carloslopes has joined #ruby
<BoomCow>
ty lupine_85
<BoomCow>
meaning you can package your program
<BoomCow>
and run it on almost any system?
minijupe has joined #ruby
<lupine_85>
that's certainly one use for it, aye
cakehero has joined #ruby
<csmrfx>
run it on jvm
<wca>
assuming the JVM is actually portable...
* wca
notes that many aspects of modern JDK implementations are not portable
zeromodulus has joined #ruby
beiter has quit [Quit: beiter]
<xclite>
the JVM is more portable than .NET at least
maesbn has quit [Remote host closed the connection]
<xclite>
and a given user is more likely to have the JVM than Ruby
<Xeago>
xclite: excluding embedded software, .net/mono runs on more stuff reliably then mono
<Xeago>
err jvm
<lupine_85>
if you're planning on packaging an entire JVM to make your ruby program portable with jruby, packaging a ruby to run your ruby program is not an insane option
<lupine_85>
we actually do that for our windows client deployments
<lupine_85>
we install our own ruby 1.9 and run our ruby program on that
jaygen has joined #ruby
<xclite>
Xeago, I dunno that claiming that .NET on Linux is easier than the JVM
<lupine_85>
(on mac os x and linux, we just rely on the system-provided ruby)
<xclite>
is accurate
bluenemo has quit [Quit: Verlassend]
u89 has quit [Remote host closed the connection]
<xclite>
lupine_85, yeah packaging it can be nice. JRuby allows calling Java from Ruby (very seamlessly) which can be nice if you need some java libs
<csmrfx>
Next up: dalvruby
<lupine_85>
already done, kind of
<csmrfx>
kind of, not really
<lupine_85>
you can run jruby on android - I've got it installed right now
<csmrfx>
I know
samphippen has quit [Quit: Computer has gone to sleep.]
<BoomCow>
pardon my ignorance
wallerdev has quit [Quit: wallerdev]
<csmrfx>
but thats diff than having ruby engine produce bytecodes for dalvik
<BoomCow>
Are there any great ruby framework for mobile applications
<lupine_85>
I'm... not sure it is
<xclite>
BoomCow, I could be way wrong on this (I don't CARE about mobile) but isn't RubyMotion for that?
mityaz has joined #ruby
<xclite>
or some ruby
<xclite>
somebody's doing something with ruby for mobile
<xclite>
i'm useless, i know.
<Gate>
BoomCow: rubymotion for iOS development
<xclite>
BoomCow: MRuby, RubyMotion, and Ruboto
<wca>
that seems to be iOS only, but I suppose "mobile" == "iOS" these days :D
<xclite>
I hear the most things about RubyMotion
<Gate>
BoomCow: I haven't found a satisfactory implementation for android
<xclite>
and MRuby
<lupine_85>
but maybe I'm wrong, and the JITed JVM bytecode doesn't end up with dalvik
samphippen has joined #ruby
caleb_io has quit [Quit: caleb_io]
<xclite>
The article I'm reading mentions that Ruboto is for Android, but it seems less complete.
jaygen has quit [Ping timeout: 252 seconds]
Voxxit has quit [Ping timeout: 246 seconds]
<lupine_85>
iOS has a relatively small amount of market share
<wca>
ah, $200 for a license. That's how that works. :)
<lupine_85>
then we're just talking about two different markets
<xclite>
wca, JRuby doesn't suffer from the GIL
<kapowaz>
well, if we're talking about writing mobile apps (which I thought was the subject here?) then it's only the latter that matters.
<lupine_85>
I'm sure iOS devices are much better at extracting money from their users than android devices. I don't think that's a feature though
arielpts has quit [Read error: Connection reset by peer]
Danielpk has quit [Read error: Connection reset by peer]
<kapowaz>
I think it's more accurate to say that iOS device owners are more inclined to buy apps
Voxxit has joined #ruby
jgrevich has joined #ruby
<kapowaz>
whereas a lot of Android device owners never buy a single app, ever.
<lupine_85>
mm, including me
<kapowaz>
and a lot of Android device owners pirate software routinely
<lupine_85>
I'm not sure that's a bad thing
<kapowaz>
what, piracy?
<lupine_85>
not buying apps, whatever the reason
<kapowaz>
it's neither a bad thing nor a good thing — it's a choice
Danielpk has joined #ruby
<lupine_85>
anyway, this is a language channel, so I assumed we were talking about developing software, not selling it
sn0wb1rd has joined #ruby
fms has joined #ruby
<Muz>
kapowaz: different revenue models though, Ad sales versus app sales etc.
<headius>
wca: I think others have summed a lot of this up, but real parallel threads, *much* better GC and memory management, faster in most cases (and likely faster in all cases over times)
cakehero has quit [Quit: Computer has gone to sleep.]
<wca>
yeah, especially if you have a JIT that tunes itself.
<kapowaz>
there are a lot of ad-supported apps on the iOS app store too
<lupine_85>
headius, how's cold startup time coming along?
<headius>
JRuby extensions are usually written in a JVM language, so they don't impact GC/memory model and they're far less likely to crash
<headius>
wca: yeah, Java 7+ have JVM support for dynamic languages…that has made a lot possible for us in the perf department
* lupine_85
is still stuck on jruby 1.5 for now *sadface*
<Muz>
kapowaz: mm, I'd imagine that on Android there's a greater tendancy to rely on ad sales though.
<headius>
lupine_85: back and forth…1.7 starts up large apps faster, but base startup (jruby -e 1) took a hit because we're implementing more of JRuby in Ruby now
brianpWins has quit [Quit: brianpWins]
alem0lars_ has quit [Read error: Connection reset by peer]
* lupine_85
uninstalls programs if they come with advertisements
CaptainKnots has quit [Quit: bazinga!]
<headius>
I'm a cheap bastard so I usually suffer through adware
d3vic3 has quit [Ping timeout: 260 seconds]
<kapowaz>
lupine_85: do you ever pay for any smartphone software?
<lupine_85>
no, I don't think so
<kapowaz>
so you only ever install free, ad-free stuff?
xorigin has quit [Quit: leaving]
<lupine_85>
I don't ever pay for any desktop software either, so at least I'm consistent
<lupine_85>
headius, interesting. the obvious pain point for startup with me is tests and one-shot command-line programs
d3vic3 has joined #ruby
<lupine_85>
1.5's startup times made both of those fairly painful by comparison to MRI
arielpts has joined #ruby
<m4rtijn>
I just install add-blocker
<headius>
lupine_85: yeah, we've improved steadily, but there's always more to do
ryanlecompte has joined #ruby
moted has quit [Remote host closed the connection]
<wca>
tests should be run in a single process anyway
<headius>
JVM is to blame for some of it, so we're a bit limited
<headius>
the various "guard" setups work well with JRuby too
<lupine_85>
wca, ideally, but there are some failure cases that can be obscured as a result
martinklepsch has joined #ruby
<Xeago>
We develop on MRI, test locally on MRI, test hourly/daily on MRI and JRuby, some of our production runs JRuby
<lupine_85>
(metaprogramming weirdness and require dependencies being the obvious ones)
Trioke_ has joined #ruby
hbpoison has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
Trioke_ has quit [Client Quit]
<headius>
I wish the Ruby-Java Bridge matched all features of our Java integration…it would make it theoretically possible to run everything on MRI at dev time
J-_-L has joined #ruby
Voxxit has quit [Ping timeout: 246 seconds]
seich- has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
adeponte has joined #ruby
claymore has joined #ruby
<wca>
well, I suppose if you do a lot of AOP and metaprogramming it can be hard to clear the effects between tests
arturaz has quit [Remote host closed the connection]
Voxxit has joined #ruby
jaygen has joined #ruby
hbpoison has quit [Ping timeout: 265 seconds]
CaptainKnots has joined #ruby
<Xeago>
zeknox: sorry it is not a gem
tintin has joined #ruby
<Xeago>
you have to load the code he wrote
<zeknox>
Xeago: gotya, add the class and stuff
<tintin>
HOw can i skip installing ri docs during gem install anygemname ?
filipe_ has quit [Ping timeout: 268 seconds]
<Sou|cutter>
tintin: create a ~/.gemrc file containing: gem: --no-ri --no-rdoc
voodoofish430 has joined #ruby
<Xeago>
or use those optoins at the command line
u89 has joined #ruby
nitti_ has quit [Remote host closed the connection]
<Sou|cutter>
sure, or that
Paradox has quit [Ping timeout: 246 seconds]
mneorr has quit [Remote host closed the connection]
mkillebrew2 has joined #ruby
timonv has quit [Remote host closed the connection]
Trioke has joined #ruby
fms is now known as ebobby
<tintin>
Sou|cutter: Ok, thank you very much.
Virunga has joined #ruby
dmiller has quit [Remote host closed the connection]
cascalheira has quit [Ping timeout: 256 seconds]
iamjarvo has joined #ruby
snearch has joined #ruby
<wca>
claymore: the problem is that when you push $a, you're not pushing a new copy to each element of $cells, you're pushing a reference to $a. Which means that i=0, i=1, and i=2 change the same $a.
<claymore>
wca: ack, of course
<claymore>
wca: thanks!
Paradox has joined #ruby
u89 has quit [Remote host closed the connection]
seich- has joined #ruby
<headius>
you know I have to say, it's disappointing that there's still folks who not just consider JRuby a second-class citizen, but try to convince others to look at it that way
Trioke has quit [Client Quit]
<lupine_85>
well, they're sillies
Trioke has joined #ruby
Trioke has quit [Client Quit]
jblack has joined #ruby
<wca>
headius: I wouldn't consider it a second-class citizen, it just has a different set of advantages and disadvantages.
tenmilestereo has joined #ruby
mneorr has joined #ruby
<tintin>
Can i ask question about passenger here?
c0rn_ has joined #ruby
ianbrandt has joined #ruby
dr_bob has joined #ruby
kaneda__ has quit [Ping timeout: 276 seconds]
nazty has quit [Ping timeout: 260 seconds]
Trioke has joined #ruby
m4rtijn has quit [Remote host closed the connection]
Trioke has quit [Client Quit]
Trioke has joined #ruby
mrsolo has joined #ruby
Uranio has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<Gate>
tintin: yep, ask away
<Gate>
tintin: if someone can help you, they will
lxsameer has joined #ruby
ryanf has joined #ruby
<lxsameer>
how can i delete a hash key?
walbert has quit [Remote host closed the connection]
<Gate>
hash.delete :key
slainer68 has quit [Remote host closed the connection]
<tintin>
I got this: Forbidden
<tintin>
You don't have permission to access / on this server.
<lxsameer>
thanks
<csmrfx>
tintin: server or roures conf
<csmrfx>
*routes
philcrissman has quit [Remote host closed the connection]
<csmrfx>
not a passanger q per se
nazty has joined #ruby
<Gate>
tintin: usually that means that a: the permissions are wrong on the directory or b: you are pointing to the wrong directory
<csmrfx>
what he said
Vinz_` is now known as Vinz_
dakine has joined #ruby
<tintin>
Gate: This time it lists all files there, but it's supposed to run the config.ru
mneorr has quit [Ping timeout: 256 seconds]
apeiros_ has joined #ruby
martinklepsch has quit [Ping timeout: 248 seconds]
<Gate>
tintin: I'm not sure of this in all cases, but normally you don't point to the root where config.ru is, you point to the public directory underneath that
dnstbr has quit [Quit: Computer has gone to sleep.]
dmiller has joined #ruby
mneorr has joined #ruby
banisterfiend has joined #ruby
failshell has quit [Quit: Lost terminal]
<tintin>
Gate: config.ru form.erb form_rack.rb result.erb , i have these files in rubytest/ folder , should i create public folder and copy these there?
<Androidnewbe>
how can i delete cookis form ruby on my ie driver ?
<Gate>
tintin: section 4
Araxia has quit [Ping timeout: 260 seconds]
<Gate>
tintin: no, create a public directory, leave it empty
<Androidnewbe>
ie keeps storing login details each time i run test
<Xeago>
tintin: is there any reason why you are using passenger over developer webservers?
<Gate>
tintin: public is meant to contain static files, like css, images and javascript so that apache can serve those *fast* without needing to go through ruby
boolean_ has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
cakehero has joined #ruby
mneorr has joined #ruby
irleif has joined #ruby
_JamieD_ has quit [Quit: _JamieD_]
brianpWins has joined #ruby
luckyruby has joined #ruby
CaptainKnots has quit [Quit: bazinga!]
prezioso has joined #ruby
mneorr_ has joined #ruby
kbeddingfield has quit [Remote host closed the connection]
horrror has joined #ruby
J-_-L has quit [Ping timeout: 240 seconds]
philcrissman has joined #ruby
kbeddingfield has joined #ruby
Vert has quit [Read error: Connection reset by peer]
hoelzro is now known as hoelzro|away
clj_newb has joined #ruby
fa1ur has quit [Quit: Leaving]
bricker has joined #ruby
mneorr has quit [Ping timeout: 260 seconds]
Tuxist has joined #ruby
<tintin>
Gate: ?
<tintin>
Gate: config.ru form_rack.rb
<tintin>
public:
<tintin>
form.erb result.erb
SCommette_ has joined #ruby
<tintin>
Gate: I have put form.erb and result.erb in public
<rking>
Anyone have strong opinions on the exact spacing of a one-line block? I'm leaning arr.map{|e| e.hihi}
<Xeago>
tintin: is there any reason why you are using passenger over developer webservers?
<Gate>
tintin: nope, erb are still files that need to be processed by ruby
<Xeago>
rking: arr.map { |e| e.hihi }
<tintin>
Gate: So will the public be empty?
<Xeago>
tintin: yes that's what he said 20minutes ago
martinklepsch has joined #ruby
<Gate>
tintin: yeah
<rking>
Xeago: I used to do that, but it s e e m s s o a i r y n o w.
jdripper has quit [Quit: Leaving.]
<Xeago>
conside rsymbol to proc
<lxsameer>
how can i create a dynamic class that inherit from Exception class
<tintin>
Xeago: Gate Thank you both of you. Thanks very much.
<Xeago>
arr.map(&:hihi)
<tintin>
It's done at last.
SCommette has quit [Ping timeout: 248 seconds]
SCommette_ is now known as SCommette
dhruvasagar has quit [Ping timeout: 268 seconds]
<kaleido>
lxsameer: class Generic << Exception ?
<tintin>
Xeago: What is it? arr.map(&:hihi)
<rking>
Xeago: I wrote a pair of vim macros that switch it between the multiline-with-do's format and the single-with-{'s format, so it's now easy for me to toggle, but it means I need to settle in on a perfect format for the short form.
philcrissman has quit [Remote host closed the connection]
<Xeago>
tintin: symbol-to-proc
<rking>
Xeago: arr.map &:hihi
<lxsameer>
kaleido: dynamic one
nitti has joined #ruby
_alejandro has quit [Remote host closed the connection]
<tintin>
Xeago: Which developer webserver would you recommend/prefer?
<Xeago>
yea without parentheses works aswell ;p
<Xeago>
webrick is everywhere
<Xeago>
Thin is popular and aught to be better than webrick
<Xeago>
there is pow.cx
<banisterfiend>
lxsameer: Class.new(Exception)
<rking>
I hate webrick because of its incessant warnings in development.log
<rking>
It's so unprofessional to just leave warnings like that.
<Xeago>
which is a 0 config rack application server
dpatel has quit [Ping timeout: 260 seconds]
<tintin>
Xeago: webbrick runs on local machine, what would you run on production server?
<Xeago>
tintin: read: development web server
<Xeago>
>.<
<lxsameer>
banisterfiend: thats it , thanks
dpatel has joined #ruby
sepp2k1 has joined #ruby
dmiller has quit [Read error: Connection reset by peer]
<tintin>
Xeago: But what would you recommend for production webserver?
<kbeddingfield>
Can anyone point to an official doc that explains classes should be nouns? Doing a code review and I'd like to cite a canonical source
<Xeago>
I dislike apache, so I would use something with nginx
<tintin>
Xeago: Why do you use disline apache?
<Xeago>
long story
<Xeago>
probably nginx with passenger with varnish in front of that
Mon_Ouie has joined #ruby
<apeiros_>
apache works fine for production. so does nginx and a couple of others.
<apeiros_>
if you know one of them beforehand and know how to configure it, I'd use that one
failshell has joined #ruby
dhruvasagar has joined #ruby
<apeiros_>
anything else only starts to matter when you're having lots of vhosts or millions of visitors per day.
<tintin>
Xeago: If you configure with passenger with nginx then what's wrong with apache?
JonnieCache has quit [Ping timeout: 245 seconds]
<tintin>
What are other options for production webserver except apache and nginx?
<Xeago>
lighttpd
artem has joined #ruby
<failshell>
im using the following code: https://gist.github.com/3988666 anyone knows how to have the columns width changed dynamically based on the data in it?
artem has quit [Client Quit]
<tintin>
And what else but lighttpd ?
<Xeago>
tintin: look at wikipedia, we are not duckduckgo
<Xeago>
the apache part — I dislike apache because it is slow(er), a resource hog and has had more security threats
<Xeago>
it also is a dependency hell
<csmrfx>
Some people contest the "apache is slower than nginx" -myth
<tintin>
What's wrong with PassengerRuby /home/user1/.rvm/rubies/ruby-1.9.3-p194/bin/ruby ?
<tintin>
in virtual host
<csmrfx>
People I see as eleet
<csmrfx>
They keep telling me it is a matter of configuring your apache right
<Gate>
tintin: awesome (that its done)!
<yxhuvud>
apache is somewhat harder to configure correctly.
<tintin>
PassengerRuby /home/user1/.rvm/wrappers/ruby-1.9.3-p194/ruby , this works but
<Xeago>
csmrfx: do they contest the fact that it is a myth, or that apache is faster
skum has quit [Quit: Leaving...]
<Xeago>
I have not seen a case where apache runs better than nginx on commodity hardware
<tintin>
Gate: but this PassengerRuby /home/user1/.rvm/rubies/ruby-1.9.3-p194/bin/ruby doesn't work , why?
<failshell>
apache is ubber fast when you know how to tweak it
<csmrfx>
Then again, if you have a car with all the bells and whistles, and a car with just a big motor, which is going to be faster?
robustus has joined #ruby
<Xeago>
failshell: also, apache fails to implement the http spec properly
<tintin>
Gate: What's wrong with this?
<csmrfx>
Obvious
<tintin>
which ruby says: PassengerRuby /home/user1/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
nitti has quit [Ping timeout: 276 seconds]
<csmrfx>
So, dont perpetuate the "apache is slower" myth, kids!
<tintin>
Can anyone answer my question?
<csmrfx>
tintin: if you need to ask
<apeiros_>
you can configure apache like shit and it'll still be fast enough for 99.9% of all websites out there
<csmrfx>
tintin: you aint ready to deploy a production web server
<Gate>
tintin: my only guess would be where you are configuring it, my PassengerRuby line is outside the vhost, in a different config file
timmow has quit [Ping timeout: 252 seconds]
<apeiros_>
and that's probably true for most webservers.
<csmrfx>
yeah, worry once you get more than 100k hits per day
<apeiros_>
even more so if you run a ruby based app behind it
<Gate>
apeiros_: except JBOSS, that's not fast enough to run anything, ever.
<csmrfx>
you conf things right, JBOSS will be fast enough - it is not supposed to take the load, webserver or proxy is
<Gate>
csmrfx: I'm aware, but the joke was worth the innaccuracy.
<failshell>
im using the following code: https://gist.github.com/3988666 anyone knows how to have the columns width changed dynamically based on the data in it?
<apeiros_>
zeknox: what's up with that horrible indentation?
Uranio has quit [Read error: Connection reset by peer]
<rking>
Dang, a small quandary: I'm making an initializer that is more convenient than the existing one. I'm tempted to call this MyObj.nw bcz its trsr thn #new
<rking>
Oh, hrm, MyObj()
Iszak has joined #ruby
heftig has joined #ruby
cascalheira has joined #ruby
imami|afk is now known as banseljaj
caleb_io has joined #ruby
Virunga has quit [Remote host closed the connection]
timonv has joined #ruby
minijupe has quit [Quit: minijupe]
BrianJ has joined #ruby
djbpython has quit [Ping timeout: 260 seconds]
alejandro_ has joined #ruby
tintin has quit [Quit: leaving]
samphippen has quit [Quit: Computer has gone to sleep.]
<apeiros_>
zeknox: more readable now ;-)
DanielPCox has quit [Remote host closed the connection]
<apeiros_>
zeknox: I'd make a Scanner class, which has a pool as instance variable
clj_newb has quit [Ping timeout: 255 seconds]
<apeiros_>
means you don't have to pass pool to scan anymore
<Paradox>
i dont think any in-place sort would be optimal for something like this
timonv has joined #ruby
Guest41863 has quit [Ping timeout: 265 seconds]
<apeiros_>
maasha: ok, thanks
dakine has quit [Quit: Leaving]
<maasha>
I think I remember something about merge-sort being well suited for disk based sort. And hence also sort in parallel.
<maasha>
apeiros_: I can marshal the records into single lines.
<Paradox>
maasha, i'd go read some of the old soviet CS papers on sort
<Paradox>
back when 1mb was an astronomically large amount of storage
<maasha>
Paradox: do that!
<Paradox>
now
<Paradox>
i got out of CS because i couldnt stand the egos and bullshit
<Paradox>
but you may enjoy it :)
<apeiros_>
maasha: I'd assume the bigger impact isn't that it is multiline but that it isn't seekable
<apeiros_>
marshalling to a single line won't change that
<Xeago>
how do you want it to be sorted?
<yxhuvud>
if you control the file generation it might help to make it several smaller files instead. A lot easier to handle in parallell.
<maasha>
Nah, I was thinking that this is such a common task that plenty of tools should be around. Perhaps there even is a super sorting gem...
sailias has quit [Ping timeout: 260 seconds]
<Paradox>
doubtful
<Paradox>
ruby isnt exactly known for its big data sorting prowess
<Paradox>
you want languages that are closer to the iron
<Paradox>
fortran or C
seanyo has quit [Ping timeout: 260 seconds]
<apeiros_>
well, a couple of millions shouldn't be hard with ruby either. the slowest part will be parsing and writing.
<Paradox>
yeah
<Paradox>
but i was under the impression that we were dealing with millions of millions
gyre008 has joined #ruby
<maasha>
I need so sort alphabetically according to one of the keys. So my crufty idea was to print lines prefixed with this key followd by a tab and the marshalled record - and then I can use unix sort.
areil has quit [Remote host closed the connection]
<gyre008>
how do I uninstall gem non-interactively ?
<yxhuvud>
apeiros_: reading can be pretty slow if the approach is to read everything into memory at once at the start.
<apeiros_>
just tried. an array of 1e6 random numbers is sorted in 1.8s on this machine
<Paradox>
like i said
<apeiros_>
yxhuvud: yes, as I said :)
<Paradox>
i'd have a file writer or something
<gyre008>
I mean when I run sudo gem uninstall gem_name…sometimes it queries me about the version…but I want to uninstall all version of certain gem…like gem uninstall -a gem_name…without any interaction...
<Paradox>
read a million values or so into memory
<Paradox>
sort them in place
<Paradox>
dump them into the file
<gyre008>
is it even possible ? so far Google failed me :(
<Paradox>
repeat
<maasha>
The files I need to sort are 40G
<apeiros_>
maasha: and how big is the data you need to sort it by?
<apeiros_>
because I'd probably do something like an index and sort that
locriani has quit [Remote host closed the connection]
<Paradox>
a radix sort might work too…
<apeiros_>
gyre008: -a might help
<Xeago>
maasha: look into storm, it is fairly well suited for big clusters but also for single node ones
<Xeago>
you can queue up multiple steps
<gyre008>
apeiros_, -a still tries to interact with you if you have multiple versions installed
* apeiros_
thinks Xeago & Paradox know quite a bit more about that field of problems and leaves the stage to them
<Xeago>
1: a script to extract the value so you can construct what you said earlier, and a second one which is unix sort
<Xeago>
apeiros_: hell no..
<apeiros_>
gyre008: that sucks
<Xeago>
I am a newby I just read twitter :P
<Paradox>
apeiros_, lol no, i only took 2 semesters of CS and then said "fuck that noise" and transferred to Mass. Comm
<apeiros_>
gyre008: ask drbrain over in #ruby-lang
<gyre008>
:)
<maasha>
apeiros_: hm. so how will you retrieve the sorted records? 60M seeks is not good.
krawchyk_ has quit [Remote host closed the connection]
<Paradox>
as i've said before, i dont think this is something ruby is suited for
<Xeago>
ruby is suited for small steps of it
<Xeago>
but you want something that manages all of it
theRoUS has joined #ruby
ShiintoRyuu has joined #ruby
<apeiros_>
Xeago, Paradox, you disappoint me! I wanted to go play SC2! Now stop making excuses and help that guy! ;-p
krawchyk has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
<Paradox>
alternatively, you could dump the whole thing into a postgres database
<Xeago>
apeiros_: play on EU?
hbpoison has joined #ruby
<Paradox>
use postgres' sort
<apeiros_>
(j/k, just in case that wasn't obvious)
<Paradox>
or cassandra if you want to cluster
<Paradox>
then pull values one at a time and dump them in a file
<apeiros_>
Xeago: yes, but at the moment I'm replaying the campaign, I never did it on brutal
<Paradox>
postgres has some of the better sorting algorithims
<apeiros_>
(was forced to when the servers where down last week-end)
gyre008 has left #ruby ["Leaving"]
<maasha>
apeiros_: dont let me hold you back :o)
<maasha>
I can easily fit all the keys in memery and sort those along with an index
<maasha>
*memory
vlad_starkov has joined #ruby
psychouroboros is now known as deadalus
deadalus has quit [Changing host]
deadalus has joined #ruby
<apeiros_>
maasha: if you control the writing, I'd write the index right when you serialize the data. including offset & length of the multiline record
<maasha>
ah. hm, I got an idea that I need to test.
<apeiros_>
that way you can perform a straight read at the right position and append it to the sorted file
<maasha>
apeiros_: lemme mess a bit with this. thanks
slainer68 has joined #ruby
AndChat- has joined #ruby
BoomCow has quit [Quit: Leaving]
hbpoison has quit [Ping timeout: 248 seconds]
insulator has quit [Remote host closed the connection]
cjs226 has joined #ruby
clj_newb has joined #ruby
yalue has quit [Quit: Leaving]
Takehiro has quit [Remote host closed the connection]
alfism has quit [Quit: alfism]
adeponte has joined #ruby
Xeago_ has joined #ruby
samphippen has joined #ruby
scx has joined #ruby
kirun has joined #ruby
martinklepsch has quit [Ping timeout: 246 seconds]
emaiax has quit [Ping timeout: 260 seconds]
Xeago has quit [Ping timeout: 248 seconds]
Xeago_ has quit [Ping timeout: 255 seconds]
emaiax has joined #ruby
emaiax has quit [Remote host closed the connection]
Markvilla has quit [Quit: Computer has gone to sleep.]
J-_-L has joined #ruby
mmitchel_ has joined #ruby
awarner has joined #ruby
vlad_starkov has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
Vinz_ is now known as Vinz_`
allanm has joined #ruby
JonnieCache has quit [Ping timeout: 248 seconds]
mmitchell has quit [Ping timeout: 244 seconds]
ShiintoRyuu is now known as shiin
DDAZZA has joined #ruby
jrist is now known as jrist-afk
medik has joined #ruby
hotovson has quit [Remote host closed the connection]
cdzombak has left #ruby [#ruby]
awarner has quit [Ping timeout: 260 seconds]
n1x has quit [Quit: Ex-Chat]
<rking>
OK, I think I'm doing something wrong. I have a class instance var Array @x that I add to in class method, but now I'm attempting to add a superclass, and then that superclass's @x is a different one. I'm about to write an accessor that combines the superclasses' @x's plus @x, but it is so gross.
awestroke has joined #ruby
clj_newb has quit [Ping timeout: 246 seconds]
<apeiros_>
rking: you may want to paste code…
prezioso has joined #ruby
<rking>
apeiros_: Right, definitely. Let me redo it as a standalone snippet. I'm definitely xy-problem'ing you here
DanielPCox has quit [Remote host closed the connection]
<maasha>
HASH: Out of overflow pages. Increase page size
<maasha>
what is this crap from DBM ?
<apeiros_>
ouch
<apeiros_>
increase page size! energy!
<apeiros_>
</piccard>
DanielPCox has joined #ruby
prezioso has quit [Client Quit]
kbeddingfield has joined #ruby
<maasha>
apeiros_: so much for using DBM as index
DanielPCox has left #ruby [#ruby]
headius has quit [Quit: headius]
dmerrick has quit [Ping timeout: 260 seconds]
Juul has joined #ruby
<apeiros_>
based on what are you sorting the data btw.?
hotovson has quit [Read error: No route to host]
Cultofmetatron has quit [Remote host closed the connection]
<maasha>
apeiros_: actually, with an index based solution I dont need sorting - I am in fact looking for pairs based on trailing /1 or /2 in the identifier.
jarred_ has joined #ruby
invisime has quit [Quit: Leaving.]
Takehiro has quit [Remote host closed the connection]
<apeiros_>
results in the same as: result.sort_by { |x| x[:distance] }
kaneda__ has joined #ruby
<apeiros_>
in sort, you perform the comparison
<BoomCow>
but is much faster no?
<apeiros_>
in sort_by, you return the value by which should be sorted
<apeiros_>
depends. in many cases, yes
daniel_-_ has quit [Ping timeout: 252 seconds]
<BoomCow>
ty for the explanation apeiros_
<JohnTeddy>
rows = [{"A"=>"foo", "B"=>"bar"}] ... How can I generate an array where A, B, C... all are 100, 99, 98, etc. I basically want to fill this array with numbers 100-1
carlyle has joined #ruby
mvangala_ has quit [Remote host closed the connection]
dangerousdave has quit [Quit: Leaving...]
Markvilla has joined #ruby
<apeiros_>
JohnTeddy: do you mean hash?
<BoomCow>
is that hash inside the array intensional?
boolean_ has quit [Remote host closed the connection]
<BoomCow>
intentional*
<BoomCow>
lol
<apeiros_>
Array.new(100) { |i| 100-i } # this will give you the array 100..1
<apeiros_>
the rest isn't really clear from your question
carlyle has quit [Remote host closed the connection]
Markvilla has quit [Client Quit]
<JohnTeddy>
I don't think so, I just copied that code from stackexchange since it kind of worked.
IrishGringo has quit [Read error: Operation timed out]
paul_s has quit [Quit: paul_s]
Markvilla has joined #ruby
hefgi has quit [Quit: This computer has gone to sleep]
<JohnTeddy>
My /etc/alternatives picks 1.8 by default iirc.
Takehiro has joined #ruby
<apeiros_>
ruby -v says you're not using that
<lolsuper>
JohnTeddy, im new to rails but I thought rvm managed the versions...
<apeiros_>
well, I don't know about how your OS/package manager/whatever handles your ruby versions, but make ruby 1.9.3 the default. anything else is bad.
<lolsuper>
you could just pick sudo update-alternatives and do it that way
<apeiros_>
lolsuper: rvm is one (good) way to deal with ruby versions
<apeiros_>
there are others, though
<apeiros_>
(and JohnTeddy seems to use another)
<JohnTeddy>
lolsuper: Well I'm talking about from my shell/distribution. I think Ubuntu manages which things are run in this case.
shadow_fox has joined #ruby
recycle has joined #ruby
<JohnTeddy>
Though I don't put a lot of confidence in that statement, that's what I was told at some point.
<apeiros_>
JohnTeddy: anyway, in your ruby version, hashes are *unordered*
macabre has quit [Remote host closed the connection]
<dominikh>
apeiros_: stop telling everyone that I hang out here :P
<apeiros_>
which means the order of your values is totally arbitrary
<lolsuper>
JohnTeddy, run the command 'sudo update-alternatives'
<apeiros_>
DaDaDOSPrompt: and that'd be the author of it :-D
<JohnTeddy>
Perhaps if I install the latest Ubuntu revision that would help.
<dominikh>
dammit
<JohnTeddy>
apeiros_: I see.
<apeiros_>
dominikh: now, you've asked for it :-p
<DaDaDOSPrompt>
heh
<dominikh>
I suppose I did
<DaDaDOSPrompt>
don't worry, I don't think I know enough Ruby yet to be a nuisance
<apeiros_>
dominikh: anyway, your fault you wrote your own instead of helping with silverplatter-irc
<dominikh>
those are usually the worst :P
monkegjinni has joined #ruby
<DaDaDOSPrompt>
I was pondering an IRC bot for building wiki pages of meeting minutes
<dominikh>
apeiros_: well, helping with that would've been basically the same as writing it from scratch, so yeah... ;)
Takehiro has quit [Ping timeout: 240 seconds]
<apeiros_>
dominikh: wtf?
<dominikh>
I ported a bot from silverplatter-irc to Cinch a couple months ago
<apeiros_>
silverplatters basics were all done
<dominikh>
apeiros_: entirely different architecture and design
kbeddingfield_ph has quit [Remote host closed the connection]
<apeiros_>
s/different/superior/
<apeiros_>
there, fixed that :-p
<dominikh>
mine? sure :P
<dominikh>
thanks for fixing it
<apeiros_>
pfff
<apeiros_>
sp can be used evented or looped
<apeiros_>
don't see what architecture you couldn't build on top of that
workmad3 has quit [Ping timeout: 260 seconds]
<dominikh>
sure, I could've built Cinch on top of silverplatter-irc, but really
Emmanuel_Chanel has quit [Quit: Leaving]
<dominikh>
no gain from that for me
hbpoison has joined #ruby
kaneda__ has quit [Ping timeout: 256 seconds]
<apeiros_>
less work?
IrishGringo has joined #ruby
<dominikh>
not really. silverplatter-irc makes for the smallest part of Cinch
<dominikh>
*would make
<apeiros_>
but since we're at the topic, I never got around adding irc via ssl, does cinch?
<apeiros_>
then cinch misses quite a lot of functionality or goes way beyond being an irc framework…
_alejandro has quit [Remote host closed the connection]
shikamaru has joined #ruby
<dominikh>
apeiros_: Officially, Cinch is a bot framework. Inofficially, it's an IRC framework that's hiding most of IRC. Like, when you request an attribute of a user (hostname, e.g.), we'll block, retrieve it, update the object, then return.
<apeiros_>
block…
<dominikh>
apeiros_: it hides many of the asynchronous aspects of IRC, really, and does a lot of parsing of various lists and data
<apeiros_>
optionally I hope?
<apeiros_>
so does sp…
<apeiros_>
you could get banlists etc. as ordinary objects
kvevert has joined #ruby
<dominikh>
nope, Cinch is built around threading
alejandro_ has quit [Ping timeout: 245 seconds]
undyingrage has quit [Read error: Operation timed out]
justinmcp has joined #ruby
<BoomCow>
apeiros_, are hashes ordered in 1.9.3?
<apeiros_>
BoomCow: yes
<dominikh>
insertion order
<BoomCow>
I thought hashes are always unordered
<apeiros_>
dominikh: anyway, I'll take a look at cinch when/if I write my next irc bot
iamjarvo has joined #ruby
<dominikh>
apeiros_: heh. just don't write a bot. IRC sucks :P
<apeiros_>
the frameworks before sp were all more or less crap
kvevert has quit [Quit: Leaving]
<apeiros_>
dominikh: I KNOW THAT!
<apeiros_>
I felt the pain
<dominikh>
before I wrote Cinch, I wrote a mostly functional IRCd in Ruby
<dominikh>
that didn't teach me
Serial_Killer_C has quit [Remote host closed the connection]
kaneda__ has joined #ruby
hbpoison has quit [Ping timeout: 268 seconds]
<apeiros_>
e.g. ban-list requests you have to queue until your last ban-list request gets the end command
<apeiros_>
otherwise you can get mixed up banlists
<dominikh>
apeiros_: did silverplatter-irc take care of faulty implementations? irc networks doing things differently?
<apeiros_>
dominikh: yes
<apeiros_>
I only added the specializations of freenode
<dominikh>
heh. freenode only has additions, not quirks really. but ircnet e.g. gives you funny ban lists, missing half of the information
<apeiros_>
but the parser had loading routines to patch depending on the recognized server. it'd start in an "almost rfc2812" mode
<dominikh>
ah
ddd has quit [Quit: Leaving.]
djbpython has quit [Ping timeout: 248 seconds]
undyingrage has joined #ruby
<dominikh>
yeah, doing server recognition as well
<dominikh>
and SASL, we have SASL :P
<apeiros_>
I didn't default to 2812 since most ircd's are utter crap.
<apeiros_>
yes, that's one thing I never got around to and really missed.
<apeiros_>
you don't want to log into your bot over an insecure line
<dominikh>
(not just SSL but SASL, too :>)
<apeiros_>
but that's why I had a REPL in my bot :D
<dominikh>
hehe
<apeiros_>
origins of irb_drop
geggam has quit [Read error: Connection reset by peer]
<apeiros_>
a REPL via ssh/local connection I mean
<dominikh>
recently I started working on support for encryption (FiSH), but that's really a gimmick. FiSH is horribly insecure
dmiller has quit [Remote host closed the connection]
elementz has joined #ruby
<apeiros_>
if it's insecure, don't support it
<apeiros_>
there's no point in giving people a false sense of security
<apeiros_>
it's even detrimental IMO
preller has joined #ruby
<dominikh>
prolly. for now it lives in a feature branch, to show some guy that it's possible :P There _are_ safer implementations building on top of it, so it's a good foundation for encryption support
<elementz>
hi all. i am a bit confused: i am trying to run an rspec-test. i keep getting "`require': no such file to load -- rspec (LoadError)" although "rspec -v 2.11.1" . what to do?
<dominikh>
boils down to ECB vs CBC in that case
<apeiros_>
but I want to build a sane chat protocol for quite a while now
<apeiros_>
the only halfway sane protocol I know out there is XMPP
<dominikh>
xmpp and sane? lol sure
<dominikh>
IRC is saner :P
monkegjinni has quit [Read error: Connection reset by peer]
<apeiros_>
there you go
jgrevich_ has joined #ruby
<apeiros_>
I'd probably use JSON as the serialization layer, even though I very much dislike json. but it opens up the avenue for simple webchat clients.
<dominikh>
not doing a lot of ruby recently, anyway
<apeiros_>
what are you doing then?
<apeiros_>
clojure? node?
gabrielrotbart has joined #ruby
<dominikh>
hell no
<dominikh>
started doing Go some time ago
mmitchell has quit [Remote host closed the connection]
jgrevich has quit [Ping timeout: 264 seconds]
jgrevich_ is now known as jgrevich
<apeiros_>
meh
<apeiros_>
well, what do you think of it?
<dominikh>
a nice language with nice concepts. sometimes too simplistic, but over all a nice alternative to Ruby
<dominikh>
it's a bit like type-checked ducktyping
<apeiros_>
I wish somebody did a sane C
solidoodlesuppor has quit [Remote host closed the connection]
<apeiros_>
with as little features as possible
<dominikh>
well, Go then :P
<csmrfx>
I get no zero, instead 4.440892098500626e-16
<apeiros_>
a very small, very fast, very portable language
<apeiros_>
I hoped Go was that. but I was underwhelmed
<dominikh>
oh, portable. forget that :>
* elementz
tap tap tap
<apeiros_>
csmrfx: welcome to the world of IEEE754 floats
<csmrfx>
scheme?
<csmrfx>
ocaml.
ltsstar has quit [Quit: ltsstar]
<apeiros_>
scheme: slow. ocaml: ick
<csmrfx>
scheme is faster than ruby.
<apeiros_>
csmrfx: yes. ruby is *very* slow
<apeiros_>
it's no big deal being faster than ruby, really.
<csmrfx>
<3 ocaml
<csmrfx>
yet on a very superficial level
<apeiros_>
ever written something bigger, serious in it?
DrShoggoth has quit [Quit: Leaving]
<apeiros_>
(I haven't, but I'm not sure I could)
shadow_fox has left #ruby [#ruby]
<csmrfx>
well I hope to very soon
<csmrfx>
but I will write the concept in ruby first
<dominikh>
my main problem with Ruby currently is memory usage and managing dependencies
maasha has quit [Ping timeout: 245 seconds]
<dominikh>
quite a fan of the (almost) statically compiled binaries Go produces
<apeiros_>
fun, I didn't expect the latter
<apeiros_>
ah, self contained apps
<apeiros_>
yes, ruby is missing that.
<dominikh>
yeah.
<apeiros_>
and for no reason really.
<dominikh>
rsync the binary up and done
<csmrfx>
jruby gives you that
<csmrfx>
okay
<dominikh>
yeah, but then there's the j in jruby...
<apeiros_>
let require be capable of handling zips
<dominikh>
didn't I just say memory usage? :P
<apeiros_>
embedd the whole source + interpreter
<csmrfx>
you want self contained apps or not?
mmlac has quit [Quit: mmlac]
<apeiros_>
probably not at any price
<dominikh>
I want low memory footprint AND self contained at once :P
<csmrfx>
jvm + interpreter + libs or no self contained apps
<csmrfx>
dominikh: ok, use ocaml
<dominikh>
I'm happy with Go, apeiros_ is the one not liking it ;)
<apeiros_>
oh, a camel
<csmrfx>
OCaml
<mr-rich>
How does one access a Struct in a class?
<apeiros_>
mr-rich: what?
<mr-rich>
apeiros_: I have a Struct in a class and I want to populate it ...
<apeiros_>
vague
<csmrfx>
class, or instance
<apeiros_>
what do you mean by "having a struct in a class"?
<mr-rich>
apeiros_: I have a Struct: @userInfo3 = Struct.new(:name, :full_name, :is_encrypted, :password, :role, :partition, :login_shell) do ... inside a class and when I call on it, I get wrong number of arguments 7 for 0 ...
<apeiros_>
oh wow, that's bad
cpruitt has quit [Quit: cpruitt]
recycle has quit [Remote host closed the connection]
<apeiros_>
you do: @userInfo3.new("some name", "full name", "is encrypted", …)
kaneda__ has quit [Remote host closed the connection]
<apeiros_>
and that's bad code as it creates the same struct over and over again
<apeiros_>
assign it to a constant. use it like an ordinary class.
<TTilus>
UserInfo = Struct.new( ... )
<csmrfx>
def sihe curr, len, max, min; curr = curr.to_f / len.to_f * (2*Math::PI); val = Math.sin( curr.to_f ); min + (1+val)/2 * dist; end
<TTilus>
user = UserInfo.new( .. )
martinklepsch has quit [Quit: Leaving]
<mr-rich>
apeiros_: I'm still learning ruby ... the reason I used Struct is because I have to put the arguments into a hash of hashes ...
<csmrfx>
that took me like 2 hours to write! *lol*
jaygen has joined #ruby
<TTilus>
csmrfx: what is that max for in args?
<apeiros_>
csmrfx: curr.fdiv(len)
<apeiros_>
saves you all that to_f stuff
<apeiros_>
also I think Math.sin already coerces to float
<mr-rich>
apeiros_: perhaps I need to use a method instead ...
<csmrfx>
that method is for scaling sine curve of custom len (x) to arbitrary range min..max on (y)
nitti has joined #ruby
<csmrfx>
curr is the value on the custom len axis
<csmrfx>
I bet there is a lot better bitwise for it
vickaita has quit [Ping timeout: 260 seconds]
<TTilus>
mr-rich: you get more usefull feedback if you tell us what you are aiming at and pastie/gist the whole app even if it is not complete and does not work
<TTilus>
mr-rich: don't be shy
kil0byte has joined #ruby
<matti>
a
c0rn has quit [Remote host closed the connection]
c0rn_ is now known as c0rn
<csmrfx>
I use sine curves to approximate effect of rotation and orbiting and axial tilt
dagnachewa has joined #ruby
zodiak has quit [Quit: Leaving]
<csmrfx>
sunspot and magnetic storms from sun, too
<csmrfx>
lol
hbpoison has joined #ruby
<csmrfx>
I bet thats what Sid Meyer used too
ltsstar has joined #ruby
* apeiros_
blinks
jrajav has joined #ruby
nitti has quit [Ping timeout: 240 seconds]
<TTilus>
csmrfx: still dont get how does it do scaling to range min..max, it doesn't refer to the max var at all (or im just plain blind)
kbeddingfield_ph has joined #ruby
<mr-rich>
TTilus: I got it working with a method ... I am doing work for a bank, so some of what I do is a bit sensitive ... BUT ... this will eventually be an OSS project, so pastebin'ing may be ok ...
twopoint718 has quit [Ping timeout: 240 seconds]
cpruitt has joined #ruby
Trioke has quit [Ping timeout: 260 seconds]
bigmac has quit [Remote host closed the connection]
<csmrfx>
TTilus: hm, I erased dist it seems
dagnachewa has quit [Quit: Leaving]
<csmrfx>
def sinus2range curr, len, max, min; curr = curr.to_f / len.to_f * (2*Math::PI); val = Math.sin( curr.to_f ); dist = max - min; min + (1+val)/2 * dist; end
<csmrfx>
That should be the correct paste
elico has joined #ruby
JustinCampbell has joined #ruby
nari has joined #ruby
jblack has quit [Quit: Lost terminal]
<JustinCampbell>
anyone love CSS so much that they want to redesign an entire app overnight and have their work/name announced at the RubyConf keynote? ;)
<apeiros_>
what if len == 0?
vickaita has joined #ruby
<apeiros_>
JustinCampbell: that's a two sided sword…
<JustinCampbell>
apeiros_: theres only one side and it hurts
<apeiros_>
you're not supposed to hold it on that side…
<JustinCampbell>
oh so thats why
armando_canals has quit [Ping timeout: 276 seconds]
<dominikh>
so in a nutshell: let's not use it so there's no reason for people to obey to sane versioning so we can't use it?
cableray has quit [Quit: cableray]
<JustinCampbell>
ive always spelled it tiddly-wakka
<apeiros_>
don't wakka my spermy :(
<csmrfx>
Is calculating with integers faster than with floats?
<JustinCampbell>
dont spermy my pessimism :)
<dominikh>
csmrfx: hopefully so :P
hsbt_away is now known as hsbt
<csmrfx>
or, is calculating with fewer bits good idea?
<apeiros_>
csmrfx: depends, bignum overflow is an issue
<JustinCampbell>
csmrfx: are you crunching tons of numbers?
<csmrfx>
well
<apeiros_>
on C level, int math is faster on most CPUs, though
<csmrfx>
I have lot of little objects wanting to know where they stand
mmlac has joined #ruby
<csmrfx>
I was thinking maybe should do everything with 8 bit numbers
<csmrfx>
just not sure if that would really work in practice
<apeiros_>
8 bit numbers means 256 positions max, though
<apeiros_>
and no, smaller numbers != faster
khakimov has quit [Quit: Computer has gone to sleep.]
<dominikh>
in ruby you don't get to decide that. besides, 8 bit and 32 bit integers should be equally fast
<apeiros_>
the native integer size is the fastest (and that's C again)
<csmrfx>
At first I was thinking 4 bits would be enough resolution
<dominikh>
(assuming 32 bit CPU here)
<apeiros_>
dominikh: no
<apeiros_>
native int is almost guaranteed to be the fastest
<csmrfx>
float uses what?
<csmrfx>
+ruby
<dominikh>
apeiros_: see my parentheses :P
ltsstar has quit [Quit: ltsstar]
<apeiros_>
dominikh: you said "equally fast"
rasbonics has quit [Quit: rasbonics]
<dominikh>
apeiros_: ah, yeah, and I still stand by that. I don't see how smaller than native could slow it down
<apeiros_>
8 bit will be slower on a cpu with 32bit int ALU
cakehero has joined #ruby
<apeiros_>
it has to add a step
<apeiros_>
two actually
<apeiros_>
padding, then truncating
dhruvasagar has quit [Ping timeout: 264 seconds]
n00b982 has joined #ruby
<JustinCampbell>
csmrfx: write a quick benchmark and find out
<dominikh>
apeiros_: use unsigned integers ;)
<n00b982>
Hello, I have a quick question if nobody minds.
<apeiros_>
dominikh: that doesn't change
<JustinCampbell>
n00b982: dont ask to ask ;)
<csmrfx>
JustinCampbell: now you are talking!
<n00b982>
What is the best free Ruby compiler?
<dominikh>
apeiros_: no padding whatsoever there. high bits will be zero, no matter what
<apeiros_>
dominikh: where do you guess those zeros come from?
alanp has quit [Read error: Connection reset by peer]
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
<JustinCampbell>
n00b982: Ruby isnt compiled, its interpretted by a VM
rdark has quit [Ping timeout: 265 seconds]
alanp has joined #ruby
<JustinCampbell>
n00b982: there are quite a few of them, although most people use MRI, or JRuby if you already have Java ties
<n00b982>
Oh I am new at this I wrote a quick hello world in Notepad++ but I am wondering how exactly it works
<apeiros_>
dominikh: anyway, the difference will be negligible in almost every situation.
<dominikh>
apeiros_: so where do they come from in an native size int that holds the value "1"? the register is zeroed anyway, you add your bits, enjoy
<csmrfx>
it is just for that sinus range method anyway
<apeiros_>
csmrfx: within ruby, it won't matter
<csmrfx>
everything else I made to work 0-255
<apeiros_>
method call overhead will eat up any difference anyway
<csmrfx>
may have to go 32 bit
atmosx has joined #ruby
<dominikh>
apeiros_: but no, the stackoverflow thread only says "it is so", not giving an explanation. but really, I don't care enough to further investigate :P
SCommette has quit [Quit: SCommette]
<csmrfx>
but, will the reduction in amount of IO data over socket mean a lot, 8 bit vs 32 bit
<apeiros_>
dominikh: he supports my POV, so he must be right!
<dominikh>
haha
jenrzzz has joined #ruby
<dominikh>
csmrfx: depends how many numbers you transmit, and how they get transmitted :P
<csmrfx>
or, better yet, just use 4 bits
icole has quit [Remote host closed the connection]
miphe has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
radic has quit [Read error: Connection reset by peer]
kirun has quit [Quit: Client exiting]
<apeiros_>
I'd use 1 bit!
Takehiro has quit [Ping timeout: 240 seconds]
<apeiros_>
to be or not to be, that's all that really matters!
<dominikh>
thanks for stealing that line from me :P
<dominikh>
was just typing it
<arietis>
hey
<csmrfx>
Well, it is a planetary simulation. Sampling EM / Solar / UV irradiance, air pressure, temp, rainfall, biome * effect of gravitation + atmosphere on those
DDAZZA has quit [Ping timeout: 252 seconds]
<arietis>
i have text file which i convert to string
<apeiros_>
that poor textfile
<arietis>
i wanna replace each "#dddd" with char
<apeiros_>
gsub
<csmrfx>
sampling frequency can be variable, but there are quite a few locations on any given planet
<apeiros_>
String#gsub
<arietis>
so i'm creating new emty string and iterate trhu string chars
<arietis>
empty*
<csmrfx>
temporal frequency, like "how often"
ckrailo has quit [Quit: Computer has gone to sleep.]
<arietis>
is it good idea?
<blazes816>
unless i've massively misunderstood you, no, it is not
<blazes816>
use String#gsub like apeiros_ said
<csmrfx>
ri String.replace
<csmrfx>
or
<csmrfx>
ri String.gsub
minijupe has joined #ruby
<arietis>
yeah
<apeiros_>
String#replace does not do what you think it does
<arietis>
somehow i missed it when looking for method in docs
<arietis>
yeah replace is wrong
<arietis>
but gsub is fine
<csmrfx>
haha so better read the ri
stopbit has quit [Quit: Leaving]
<arietis>
thanks
vickaita has quit [Ping timeout: 260 seconds]
hefgi has joined #ruby
cantonic_ has joined #ruby
xcvd`` has joined #ruby
shtirlic_ has joined #ruby
<arietis>
writing converter between Borland C++ Turbo and Borland C++ Builder 5.0
<arietis>
:D
skcin7 has quit [Quit: Computer has gone to sleep.]
<arietis>
pretty old stuff but i'm forced to do homework in it
icole has joined #ruby
ebobby_ has joined #ruby
<arietis>
and projects are incompatible with each other
<arietis>
due to encoding issues
<arietis>
:)
<csmrfx>
do you realize that the daylenght can vary +-~15 minutes due to orbital effects
Trioke_ has joined #ruby
<apeiros_>
it can vary even more due to mountains!
kbeddingfield_ph has quit [Remote host closed the connection]
<csmrfx>
the period is only 182 days
<csmrfx>
(on earth)
<csmrfx>
well, 182.66 dats
adeponte has quit [Remote host closed the connection]
<csmrfx>
or somewhere there
hbpoison has quit [Ping timeout: 260 seconds]
jslowe has quit [Read error: Connection reset by peer]
ebobby has quit [Read error: Connection reset by peer]
zz_Cidan has quit [Ping timeout: 264 seconds]
zipkid has quit [Ping timeout: 264 seconds]
Kudos has quit [Ping timeout: 264 seconds]
perryh has quit [Ping timeout: 264 seconds]
shtirlic has quit [Ping timeout: 264 seconds]
ksk has quit [Ping timeout: 264 seconds]
cantonic has quit [Ping timeout: 264 seconds]
Poapfel has quit [Ping timeout: 264 seconds]
araujo has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
zipkid has joined #ruby
<arietis>
weird
Poapfel has joined #ruby
<arietis>
sounds like server is down
ksk has joined #ruby
Trioke has quit [Ping timeout: 256 seconds]
Kudos has joined #ruby
ryanf has joined #ruby
drbawb has quit [Ping timeout: 264 seconds]
<csmrfx>
hm, orbital is probably a wrong word in english. but due to how earth moves around the sun
<arietis>
apeiros_: what if i don't have replacement?
nemesit has quit [Quit: Leaving...]
<apeiros_>
arietis: you mean you want to delete it?
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
slainer68 has joined #ruby
<arietis>
so i call gsub, i get match but i can only set replacement after converting match to unicode char
<apeiros_>
gsub with a block
<arietis>
kk, thanks
<arietis>
love blocks
<arietis>
:)
elico has quit [Remote host closed the connection]
<jrajav>
Xeago: Hey, is that you getting the torrent?
<davidcelis>
so i have a newbie rails programmer who's going through Learn Ruby the Hard Way. they got to exercise 5 and, for some reason, that exercise has syntax errors but only when run as a file. if i paste the whole file into IRB or Pry and run it, it's fine. when I pass the file itself to ruby, it gets a syntax error on line 1 (unless I comment out the rest of the file): https://gist.github.com/5c8849ab27f515c43002
<davidcelis>
i can't figure out what's wrong with it
IrishGringo has quit [Read error: Operation timed out]
<csmrfx>
comment everything and uncomment until you find
beilabs has quit [Ping timeout: 245 seconds]
catepillar has joined #ruby
<arietis>
is it proper format of regexp? str.gsub(%r/\#\d{4}/)
<catepillar>
667 people? wow.
lupine_85 has joined #ruby
radic has joined #ruby
<arietis>
it's halloween what do u expect
<arietis>
:)
<catepillar>
667 is a low number?
<csmrfx>
crazy I didn't realize that orbit accounts for about 50% of temp variation on earth
<dominikh>
false, co2 accounts for 100% of temp variations on earth
<catepillar>
anyways, i wanted to say that I love ruby and its awesome. learn new things about it every day.
<davidcelis>
csmrfx: Commenting out the first line removes the syntax error, but then the script just abruptly halts and nothing ever gets printed.
jeremywrowe has joined #ruby
<davidcelis>
something is up with the first line, but I can't figure out what.
<csmrfx>
well, surprise!
<csmrfx>
you found it!
<jrajav>
dominikh: I assume by co2 you mean Al Gore
<dominikh>
jrajav: yep
<csmrfx>
increase orbit radius by 1% and our co2 would freeze over
<apeiros_>
arietis: yes, but if you use / as delimiter anyway, then you don't need %r
<davidcelis>
I found what, exactly?
IrishGringo has joined #ruby
<csmrfx>
what am I, an irc psychic?
<davidcelis>
So you also see nothing wrong there?
<csmrfx>
"I see... utf-characters...."
<csmrfx>
"its... utf-8 something"
* csmrfx
leans into the chrystal ball
mikepack_ has quit [Remote host closed the connection]
JonnieCache has joined #ruby
<davidcelis>
wow it's like i'm in #rubyonrails right now or something, crazy
<davidcelis>
must be leaking
drbawb has joined #ruby
Dreamer3__ has quit [Quit: Computer has gone to sleep.]