<burgestrand>
macer1: it can be, but since the classes never change what would be the point? you plan on adding more classes during run?
<macer1>
no
<macer1>
add it inside the module?
<burgestrand>
macer1: but yeah, unless you have many many classes it probably does not matter anyway :)
darren_ has quit [Remote host closed the connection]
<macer1>
module[class class class; mapping = codetomadeit]
<macer1>
like that?
<EstanislaoStan>
burgestrand: For some reason, just defining methods that don't use the .method notation doesn't work. How does Ruby know whether I want there to be a dot or not? And how do I take the string before my method as an argument for the method?
<burgestrand>
EstanislaoStan: ruby has a list of methods that you can define that don’t need to be called in the regular way (I call them infix methods, but there is also unary + and - that can be defined). It also means you can’t just make up your own.
dankest has joined #ruby
bradhe has joined #ruby
darren has joined #ruby
und3f has quit [Ping timeout: 260 seconds]
<burgestrand>
Oh, yeah, unary ! can also be defined. :)
<shevy>
that was the strangest thing
<EstanislaoStan>
So I can't add to that list. And there isn't a way to take the receiver as an argument?
<bricker88>
macer1: Okay, what if the error was still occurring?
sevvie has quit [Read error: Connection reset by peer]
sdwrage has left #ruby [#ruby]
sent-hil has joined #ruby
centipedefarmer has joined #ruby
<bricker88>
macer: `y 1` gives the error 'undefined method `y' for main:Object', and yaml is required
<macer1>
emm
tvw has quit [Ping timeout: 272 seconds]
<burgestrand>
Huh, cool, I never knew yaml defined a method y.
<macer1>
u r doing it wrong
<bricker88>
macer1: how so
<macer1>
no, hmm
<macer1>
works for me
<burgestrand>
bricker88: use YAML.dump(obj) instead
<macer1>
are you using windows?
<EstanislaoStan>
Thanks burgestrand. I need to figure out the variable name for a string object's stored string then. The ruby core documentation only shows what methods work with the classes. Is there a place I can find the actual class definition?
sailias has quit [Quit: Leaving.]
benson has quit [Remote host closed the connection]
tvw has joined #ruby
<bricker88>
burgestrand: I know I can do that, or a number of other things, I am just wondering why the `y` method is no longer working. macer1: No, OSX
troyack has joined #ruby
<macer1>
me too...
pen has quit [Remote host closed the connection]
<macer1>
using rvm?
sailias has joined #ruby
sailias has quit [Client Quit]
nari has quit [Read error: Operation timed out]
<bricker88>
macer1: yes, 1.9.2 and 1.9.3 both gave the same error
jorge has quit [Remote host closed the connection]
<burgestrand>
bricker88: which engine are you using, Psych or Syck? Type YAML and you should see the name.
sailias has joined #ruby
<macer1>
ehh no idea
sailias has quit [Client Quit]
<bricker88>
macer1: if I change YAML::ENGINE.yamler to 'syck' it works.
andrewhl has joined #ruby
dagnachewa has joined #ruby
sailias has joined #ruby
sailias has quit [Client Quit]
<burgestrand>
EstanislaoStan: you need to figure out the _variable name_?
sailias has quit [Read error: Connection reset by peer]
htroyack has quit [Ping timeout: 240 seconds]
sailias has joined #ruby
adamkittelson has quit [Remote host closed the connection]
vish has quit [Quit: vish]
htroyack has joined #ruby
<burgestrand>
EstanislaoStan: also, some classes are defined in C, some classes are defined in Ruby, some are defined with both.
d3c has quit [Ping timeout: 248 seconds]
vvgomes has quit [Ping timeout: 260 seconds]
troyack has quit [Ping timeout: 244 seconds]
<burgestrand>
EstanislaoStan: looking at ruby-doc I believe the files the class is defined in is listed at the top.
centipedefarmer has quit [Quit: This computer has gone to sleep]
htroyack has quit [Client Quit]
<EstanislaoStan>
I need to be able to add a method to the String class that lets access the string's value. So if I used "hello, world".my_method my_method would somehow be accessing "hello, world".
andrewhl has quit [Remote host closed the connection]
<EstanislaoStan>
*lets me access
itnomad has quit [Ping timeout: 264 seconds]
<macer1>
burgestrand: what if I have more constants in my classes...it is using first one
<macer1>
ah
Hawklord has joined #ruby
<macer1>
nevermind, logic fail
sailias has quit [Ping timeout: 260 seconds]
raphie has joined #ruby
<raphie>
having a very weird problem concerning Mountain Lion, Shoes.rb, and Rgeo if anyone can help
<burgestrand>
EstanislaoStan: the string’s value is the string, it’s a string.
beakerman has joined #ruby
itnomad has joined #ruby
pskosinski has quit [Remote host closed the connection]
<EstanislaoStan>
I guess I'm confused on how to add methods that operate on the string's value. I thought that I'd have to, in the class definition, modify a variable inside of the String class. But from what I'm seeing online I just put the method to operate on the string inside of the string class and it'll automatically pick up on the value. That somewhat confuses me because I don't understand how a string
<EstanislaoStan>
can be an object of a class and not have it's value stored somewhere. I guess it's because I'm poking around the roots of the language where things get less intuitive because they're probably defined in C or whatever.
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
centipedefarmer has joined #ruby
Araxia has quit [Read error: No route to host]
baroquebobcat has quit [Quit: baroquebobcat]
Araxia has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
<burgestrand>
EstanislaoStan: strings are mutatable, and you can replace the contents of one string with another if you wish: http://codepad.org/EAlCmR89
<burgestrand>
EstanislaoStan: in addition, you can access many other aspects of a string (i.e. transformed into upcase, array of its bytes, its encoding)
raphie has quit [Read error: Connection reset by peer]
MasterIdler_ has joined #ruby
dagnachewa has quit [Quit: Leaving]
<burgestrand>
EstanislaoStan: however, for CRuby, the actual *raw* data is stored in C and is not directly accessible from memory, but given String#replace exists you don’t need to be able to access it.
<EstanislaoStan>
Yeah, thanks. I figured out how to do what I wanted. I needed to use self. I.E. regex_occurance_position = self =~ regex. I'm not trying to replace the string, I'm trying to make a method of the String class that will out put the integer values of the positions that every occurance of the regex happens. Whereas =~ only give the first position of the occurance.
bosent has quit []
<burgestrand>
EstanislaoStan: aye, I remember. I’d suggest you use String#scan with it’s block form, it’ll give you all matches in a given string. You could iterate through these to find the indices after that.
havenn has quit [Remote host closed the connection]
wiskey5alpha has joined #ruby
sdwrage has joined #ruby
<EstanislaoStan>
Ok, thanks for all your help. I'll give that a try.
<burgestrand>
EstanislaoStan: another hint, $~ contain’s the MatchData for the previous match, you’ll be likely to want to use it. :)
havenn has quit [Remote host closed the connection]
<bricker88>
So there is a discrepancy it seems between ruby-1.9.3-p0 and ruby-1.9.3-p194… in the former `y 1` works, in the latter it throws "NoMethodError: undefined method `y' for main:Object"
tompsony has joined #ruby
<tompsony>
Hello! I got the following error in my ftp client that is preventing the script to continue a new section.
<burgestrand>
macer1: something is not what you think it is
mrsolo has quit [Quit: Leaving]
cantonic has quit [Quit: cantonic]
<macer1>
p map, p id, p map[id]
kvirani has joined #ruby
<macer1>
correct map, 1, nil
<macer1>
:(
fbernier has quit [Ping timeout: 260 seconds]
<burgestrand>
macer1: use pry instead of printing things, less margin for error
<burgestrand>
also easier to test things
kvirani has quit [Remote host closed the connection]
darren has quit [Remote host closed the connection]
<macer1>
I used pp
<macer1>
still nil
pdtpatrick has quit [Quit: pdtpatrick]
jrajav has quit [Ping timeout: 250 seconds]
<macer1>
oh
<macer1>
guess what
<macer1>
it was a hex byte or sthing :)
tiripamwe has joined #ruby
tompsony has quit [Quit: CyberScript - It is. Are you? (www.cyberscript.org)]
<macer1>
id.to_i fixed it
nesoi has joined #ruby
<macer1>
yay, it automaticaly converts it to proper packet ^.^
tiripamwe has quit [Client Quit]
tiripamwe has joined #ruby
Gurpartap has joined #ruby
<Gurpartap>
Is there a concern about obfuscating developer's email in gemspec?
<Gurpartap>
what do devs do commonly?
<nesoi>
I have a very stupid question: some time ago I set up ruby on my macbook, but now I forget how I would have set it up, and when I type ruby, it is invoking the older version that came with 10.6. Can anyone suggest how I should try invoking a newer version I would have set up?
savage- has quit [Remote host closed the connection]
<Gurpartap>
nesoi: `ls ~/.r*`
<Gurpartap>
nesoi: does it have .rvm or .rbenv ?
GeekOnCoffee has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
<nesoi>
Gurpartap, no idea. It's what I would have installed as 1.9.2 or whatever
<Gurpartap>
nesoi: if you use brew, see if you installed the ruby-build brew formula
<nesoi>
yeah, I have brew
<Gurpartap>
`brew list`
<nesoi>
but no ruby-build
foEs has joined #ruby
<Gurpartap>
nesoi: do you have anything informative your $PATH ?
opus has quit [Quit:]
<nesoi>
hm. just libgpg-error and libk.sba
<Gurpartap>
in your*
<nesoi>
nothing useful in $PATH
<nesoi>
where would it usually be installed?
bradhe has quit [Remote host closed the connection]
Hawklord has quit [Ping timeout: 276 seconds]
liluo has joined #ruby
stephenjudkins has joined #ruby
artOfWar has quit [Ping timeout: 244 seconds]
richardcreme has quit [Ping timeout: 244 seconds]
uris has joined #ruby
EstanislaoStan has quit []
Hanmac1 has joined #ruby
yugui is now known as yugui_zzz
Hanmac has quit [Ping timeout: 264 seconds]
nari has joined #ruby
SCommette has joined #ruby
SCommette has quit [Client Quit]
maletor has quit [Quit: Computer has gone to sleep.]
richardcreme has joined #ruby
maucat has joined #ruby
yugui_zzz is now known as yugui
<nesoi>
Gurpartap, any idea where I should look?
SCommette has joined #ruby
<Gurpartap>
nesoi: the OS default is usually at /usr/bin/ruby
jarjar_prime has quit [Quit: Sleep time.]
TorpedoSkyline has joined #ruby
<burgestrand>
Gurpartap: did you check your home directory for .rbenv or .rvm?
<burgestrand>
Uh.
<burgestrand>
nesoi: ^
<burgestrand>
Username fail.
<Gurpartap>
nesoi: a custom install would unlikely be overriding that. so maybe look some where in dot dirs your home directory?
<Gurpartap>
burgestrand: i asked that. apparently not there
<Gurpartap>
in your home*
<burgestrand>
Gurpartap: your response was "no idea", I don’t take that for an answer :p
monkegjinni has quit [Remote host closed the connection]
<Gurpartap>
burgestrand: nesoi's response. not mine XD
<Gurpartap>
although you're right. could still be the case
<burgestrand>
Gurpartap: response to you, your response :d
<Gurpartap>
response to you != your response :P
<burgestrand>
;)
* Gurpartap
is not fighting
<Gurpartap>
:P
adamkittelson has joined #ruby
justsee is now known as justsee|away
lorandi has joined #ruby
<nesoi>
yes, the default is /usr/bin/ruby, but I don't know where the custom install is
htroyack has joined #ruby
richardcreme has quit [Ping timeout: 244 seconds]
adeponte has joined #ruby
<nesoi>
ruby is not in my home dir
<nesoi>
where does it go by default when installed?
htroyack has quit [Client Quit]
balki has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
adeponte has quit [Remote host closed the connection]
yugui is now known as yugui_zzz
adeponte has joined #ruby
richardcreme has joined #ruby
<Quadlex>
nesoi: I imagine that depends on your OS
htroyack has joined #ruby
baroquebobcat has joined #ruby
<nesoi>
osx 10.6 Quadlex
<Gurpartap>
Quadlex?
<Gurpartap>
did canonical ship this osx version?
<Gurpartap>
:p
<Gurpartap>
Great. rubygems signup form takes me to Page not found
voodoofish430 has quit [Quit: Leaving.]
balki has joined #ruby
alanp has joined #ruby
<Quadlex>
nesoi: No idea, I'm afraid:P
bradhe has joined #ruby
<Quadlex>
Gurpartap: I didn't know it was OSX, I joined the conversation late
<Gurpartap>
Quadlex: ah wait. i misinterpreted his response. i didn't know we have someone with the name Quadlex in the chat
<Gurpartap>
and thought that his os had a nick "Quadlex"
<Gurpartap>
:)
* Quadlex
doffs his bonnet
<Gurpartap>
lol
phanousit has joined #ruby
<phanousit>
hello
<Quadlex>
There's a unix xommand to show where something's insalled isn't therE?
<Quadlex>
...installed
<Quadlex>
Isn't that what where does?
<Gurpartap>
which / whereis
<burgestrand>
You also have locate
<nesoi>
which only shows you the default path
<Gurpartap>
but that'll only show the ruby version that nesoi already knows
<burgestrand>
At least on OS X.
vvgomes has joined #ruby
adeponte has quit [Ping timeout: 248 seconds]
foEs has quit [Remote host closed the connection]
apok_ has joined #ruby
locriani has quit [Remote host closed the connection]
apok has quit [Ping timeout: 244 seconds]
lunitikcalm has quit [Remote host closed the connection]
apok_ has quit [Ping timeout: 260 seconds]
justsee|away is now known as justsee
jarednorman has quit [Ping timeout: 252 seconds]
Ionic` has joined #ruby
freeayu__ has joined #ruby
MasterIdler_ is now known as MasterIdler
mascool has quit [Ping timeout: 244 seconds]
freeayu has quit [Ping timeout: 250 seconds]
vitor-br has joined #ruby
schickung has quit [Quit: schickung]
sent-hil has joined #ruby
rakm has quit [Quit: Computer has gone to sleep.]
<nesoi>
ok, so I found a bunch of ruby in my home dir under .gem/ruby, etc. I don't think that's how I was invoking it though
sent-hil has quit [Remote host closed the connection]
<nesoi>
also under .rvm
<burgestrand>
nesoi: you have an .rvm?
<nesoi>
yeah
<burgestrand>
nesoi: if you type rvm -v, what do you see?
<nesoi>
rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
<burgestrand>
nesoi: rvm list
<nesoi>
rvm rubies
<nesoi>
ruby-1.9.3-p125 [ x86_64 ]
<nesoi>
# Default ruby not set. Try 'rvm alias create default <ruby>'.
<nesoi>
# =* - current && default
<nesoi>
# => - current
<nesoi>
# * - default
<burgestrand>
nesoi: you see, rvm is one of the few preferred ways of installing ruby yourself :)
<burgestrand>
nesoi: you can switch to your installed ruby 1.9.3 with "rvm use 1.9.3-p125"
<burgestrand>
nesoi: after that, ruby -v should show you 1.9.3 instead of your system’s default
jorge has quit [Remote host closed the connection]
<nesoi>
yes, it worked, thanks
<burgestrand>
nesoi: you can make it your default one with "rvm use 1.9.3-p125 --default"
<burgestrand>
nesoi: that way it will be that ruby when you start a new terminal, too
<nesoi>
cool, do I have to install gems some special way too?
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<burgestrand>
nesoi: no, once you have made "rvm use rubyversion" both ruby, gem and irb have all been replaced
<nesoi>
so just gem install gemname
<burgestrand>
I shouldn’t say replaced, but you’ll be using the correct version of them all
stephenjudkins has quit [Ping timeout: 250 seconds]
<nesoi>
I guess so
<nesoi>
I'm following the instructions on that webpage now
<burgestrand>
nesoi: it should be enough to install libiconv with homebrew, the webpage doesn’t say anything about that
TorpedoSkyline has joined #ruby
Targen has quit [Ping timeout: 244 seconds]
<nesoi>
it says it doesn't work
gtuckerkellogg has joined #ruby
vjacob has joined #ruby
<burgestrand>
nesoi: doing "brew install libiconv" and then "brew link libiconv" and try to install your gem again
tomzx has joined #ruby
benyarb has joined #ruby
<burgestrand>
nesoi: it says if you have issues when it should work, which is probably not the problem you are having, you most likely don’t have it at all
yugui_zzz is now known as yugui
<nesoi>
oops I just issued those 2 brew commands on that page. did I screw something up?
benyarb has quit [Client Quit]
<burgestrand>
nesoi: the libxml xslt things? Naw, you should be alright. Was probably a good thing :)
<tomzx>
hi, I'm running a very small test suite, 12 tests with 20 assertions, and it's taking over 12s to complete... I'm running the tests with -rprofile and #toplevel is only 0.64s. Any idea what's going on here?
seanstickle has joined #ruby
jblack_ has joined #ruby
TheShadowFog has joined #ruby
beakerman has joined #ruby
Araxia has quit [Quit: Araxia]
jarjar_prime has joined #ruby
jarjar_prime has quit [Client Quit]
<reuf>
anybody used octopress in herE?
havenn has joined #ruby
manizzle has quit [Ping timeout: 260 seconds]
dagnachewa has quit [Quit: Leaving]
darren_ has joined #ruby
jblack_ has quit [Quit: leaving]
jblack has joined #ruby
macer1 has quit [Remote host closed the connection]
fivetwentysix has joined #ruby
abdulkarim has quit [Ping timeout: 264 seconds]
ianbrandt has quit [Quit: ianbrandt]
<nesoi>
burgestrand, gem install still gives me the not found message... any idea what to try next?
darren_ has quit [Ping timeout: 260 seconds]
<burgestrand>
nesoi: now it’s probably time to follow the website I’m afraid :)
<nesoi>
Another version is already linked: /usr/local/Cellar/libxml2/2.7.8
<nesoi>
Error: Cannot link libxml2
ryanf has joined #ruby
freeayu__ has quit [Read error: Connection reset by peer]
<phanousit>
hey are we able to put methods in hashes?
<burgestrand>
phanousit: yep
<phanousit>
i like that
<burgestrand>
phanousit: *high five*
<phanousit>
I'm looking to land an internship doing ruby, does anyone have any tips?
justsee|away is now known as justsee
ngoldman has quit [Remote host closed the connection]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<burgestrand>
phanousit: yeah, find a ruby user group in your area, you’ll meet a bunch of rubyists and might get some good leads.
<fowl>
phanousit: don't get caught having sex with the president
<phanousit>
hah
<phanousit>
why do you guys think of the job prospects of ruby in the future
sdwrage has quit [Quit: geekli.st/programmer]
<burgestrand>
I’m still hoping for flying cars by then.
<fowl>
hoping for flying burger stands
odigity has quit [Ping timeout: 264 seconds]
<fowl>
by then the Son of Rails will have fulfilled the prophecy and slain his father (hopefully)
htroyack has quit [Quit: see you tomorrow]
locriani has quit [Ping timeout: 250 seconds]
locriani has joined #ruby
nesoi has quit [Quit: This computer has gone to sleep]
freeayu has joined #ruby
nesoi has joined #ruby
stefanp_ has joined #ruby
<nesoi>
burgestrand, any other ideas? I tried what's on that page and it still can't find libiconv
jrajav has joined #ruby
<burgestrand>
nesoi: I’m afraid not. If following those instructions to install nokogiri does not help I’d just turn to googling. Never had this issue myself, even though I reinstall my mac fairly often.
noganex has quit [Read error: Operation timed out]
odigity has joined #ruby
<burgestrand>
nesoi: it doesn’t look like you supplied the necessary install options when installing nokogiri there.
stefanp has quit [Ping timeout: 265 seconds]
brianpWins has quit [Quit: brianpWins]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
<nesoi>
burgestrand, for brew 0.8 it said to just do gem install nokogiri
<burgestrand>
nesoi: make sure /usr/local/Cellar/libiconv/1.13.1 exists, and that you pass all the extra —with-xml2-include, etc when you install nokogiri
<burgestrand>
nesoi: ah, so it does, I’d still give the —with-thing a try though.
cakehero has quit [Quit: Leaving...]
Tomasso has quit [Ping timeout: 252 seconds]
noganex has joined #ruby
adeponte has joined #ruby
stefanp_ has quit [Ping timeout: 265 seconds]
ryanf has quit [Ping timeout: 264 seconds]
ttilley has quit [Ping timeout: 245 seconds]
ttilley has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
seanstickle has quit [Quit: seanstickle]
MasterIdler has quit [Quit: MasterIdler]
dhruvasa1ar has joined #ruby
fbernier has joined #ruby
fbernier has quit [Client Quit]
epochwolf has quit [Ping timeout: 260 seconds]
denysonique has quit [Excess Flood]
icambridge has quit [Excess Flood]
epochwolf has joined #ruby
epochwolf has quit [Changing host]
epochwolf has joined #ruby
icambridge_ has joined #ruby
mdickens has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
wallerdev has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
rutkla_ has joined #ruby
rutkla has quit [Ping timeout: 260 seconds]
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
itnomad has quit [Quit: Leaving]
andrewhl has joined #ruby
<Gurpartap>
Why would (int)RSTRING_LEN ever return 0 for a string that really exists :S
mengu has quit [Remote host closed the connection]
<Gurpartap>
in this particular case, i'm passing an instance attribute to a method which ends up calling RSTRING_LEN to check for the var's length. and it fails there.
<Gurpartap>
even though if i puts out the variable myself, it definitely is fine.
<Gurpartap>
if, instead of referencing to the attribute variable, i pass in a string manually, then it works fine.
<Gurpartap>
anyone know where i'm going wrong?
<Gurpartap>
s/know/knows/
<burgestrand>
Gurpartap: could you provide a minimal example?
nesoi has quit [Quit: This computer has gone to sleep]
jorge has quit [Remote host closed the connection]
<Gurpartap>
burgestrand: and i'm overriding an attribute's getter in my model, where i decrypt the value of that attribute for display (the value is stored as encrypted in the db; the encryption being done in before_save hook)
w400z has joined #ruby
<Gurpartap>
burgestrand: the openssl line #334 is where it fails if i pass it like this:
ananthakumaran has joined #ruby
bier has quit [Remote host closed the connection]
<Gurpartap>
def my_attr; AESCrypt.decrypt(read_attribute(:my_attr), "p4ssw0rd"); end
w400z has quit [Client Quit]
<Gurpartap>
the above produces the error
<Gurpartap>
the following however, doesn't:
bier has joined #ruby
<Gurpartap>
def my_attr; AESCrypt.decrypt("a long encrypted value that i copy pasted here from the value of stored my_attr", "p4ssw0rd"); end
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
beakerman has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
w400z has joined #ruby
<burgestrand>
Gurpartap: to the receiving method, AESCrypt.decrypt, there is no difference
<burgestrand>
Gurpartap: the only thing that has an impact is the return value of read_attribute, which is probably just returning an empty string here
<Gurpartap>
burgestrand: def my_attr; read_attribute(:my_attr); end
<Gurpartap>
burgestrand: this works as excepted, however
<Gurpartap>
which is why i'm uncertain about what's happening
grey__ has joined #ruby
<burgestrand>
Gurpartap: I don’t know what you expect
mucker has quit [Ping timeout: 272 seconds]
<Gurpartap>
burgestrand: i dont know why, when i pass the reference to read_attribute(:my_attr) to decrypt, it doesn't read it :/
<burgestrand>
Gurpartap: read it to a local variable, hop into a pry session, inspect the local variable, run decrypt on it
vvgomes_ has joined #ruby
vvgomes has quit [Ping timeout: 246 seconds]
davidcelis has joined #ruby
<Gurpartap>
let me
<burgestrand>
Gurpartap: ought to reveal what’s happening to you :)
gmci has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
lorandi has quit [Quit: Leaving]
manizzle has joined #ruby
havenn has quit [Ping timeout: 246 seconds]
indian has quit [Read error: Operation timed out]
kpshek has joined #ruby
kpshek has quit [Client Quit]
baroquebobcat has joined #ruby
tiripamwe has quit [Quit: Leaving]
brianpWins has joined #ruby
grey__ has quit [Quit: Leaving]
nedbat has quit [Ping timeout: 276 seconds]
sgronblo1 has joined #ruby
friskd has quit [Ping timeout: 240 seconds]
sgronblom has quit [Ping timeout: 255 seconds]
jameshyde has joined #ruby
Bosma has quit [Ping timeout: 255 seconds]
Nanuq has quit [Ping timeout: 245 seconds]
vvgomes_ is now known as vvgomes
mockra has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
igotnolegs has joined #ruby
Rezwan has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
verbad has joined #ruby
vitor-br has quit [Quit: Saindo]
jonathanwallace has quit [Ping timeout: 255 seconds]
jarred has joined #ruby
vvgomes has left #ruby [#ruby]
AlbireoX`Mac has joined #ruby
AlbireoX`Laptop has quit [Ping timeout: 246 seconds]
Vert has quit [Ping timeout: 252 seconds]
td123 has joined #ruby
Foxhoundz has joined #ruby
<Foxhoundz>
Ruby.
jrajav has quit [Quit: The best darkness is strange and surprising]
TPFC-SYSTEM has joined #ruby
Nanuq has joined #ruby
<fowl>
RUBY!
tommyvyo has joined #ruby
adeponte has quit [Remote host closed the connection]
centipedefarmer has quit [Quit: This computer has gone to sleep]
<Paradox>
rewbie
codora has quit [Quit: Heaven is not a place, it's being with people who love you.]
krz has quit [Quit: krz]
<davidcelis>
rübee
fralcon_ has joined #ruby
fralcon has quit [Read error: Connection reset by peer]
htroyack has quit [Ping timeout: 240 seconds]
<Paradox>
®øߥ
td123 has quit [Quit: WeeChat 0.3.8]
td123 has joined #ruby
<davidcelis>
roby?
<Foxhoundz>
I'm new to Ruby.
<davidcelis>
Foxhoundz: I'm new to you.
<Foxhoundz>
Also RoR for that matter.
<Foxhoundz>
As well as MVC...
<Spaceghostc2c>
I'm new to being new.
solofight has joined #ruby
<solofight>
people is there any ready made library which i can utilize for solving a transportation problem ?
statix_ has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
<davidcelis>
solofight: how delightfully vague
stat1x has joined #ruby
<davidcelis>
what constitutes "a transportation problem"?
<heftig>
sounds like travelling salesman to me
<solofight>
davidboy: shipment problem in other words
<heftig>
that's not any better
savage- has joined #ruby
AndChat| has joined #ruby
<solofight>
davidboy: vehicle routing software library that uses algorithms to calculate an optimized allocation of orders and stops to mobile resources
<solofight>
heftig: ^
juarlex has joined #ruby
andrewhl has joined #ruby
jblack has quit [Ping timeout: 264 seconds]
phoe6 has joined #ruby
havenn has joined #ruby
jblack has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
<jblack>
One of my contracts uses it. It wasn't long before I started using it everywhere else. =)
<Hanmac>
ecksit RPGMaker2000 and its sequel RPGMakerXP
elhu has joined #ruby
<ecksit>
my story is similar to jblack's
jhunter has joined #ruby
Foxhoundz has quit [Quit: Leaving]
mockra has joined #ruby
<Hanmac>
seiaqua update rdoc first
jarred has quit [Quit: jarred]
<seoaqua>
Hanmac, ok
und3f has joined #ruby
apok has quit [Quit: apok]
leoncamel has quit [Remote host closed the connection]
<fowl>
Hanmac: thank god ruby saved you from rpgmaker
n1x has quit [Ping timeout: 260 seconds]
dekroning has joined #ruby
<dekroning>
hi all
jblack has quit [Ping timeout: 255 seconds]
<Hanmac>
fowl the rpgmaker versions make me think: "i can do it better" :P
mockra has quit [Ping timeout: 250 seconds]
Targen has joined #ruby
friskd_ has joined #ruby
friskd has quit [Read error: Connection reset by peer]
friskd_ is now known as friskd
gtuckerkellogg has joined #ruby
JarJar has joined #ruby
maesbn has joined #ruby
qwerxy has joined #ruby
<klotho>
I may have fixed the problem with ports
ananthakumaran has joined #ruby
wallerdev has quit [Quit: wallerdev]
freeayu__ has joined #ruby
<Bauer>
when compiling ruby from sources, how do I know which possible parameters can I pass to ./configure? I want to see the list of options
andrewhl has quit [Remote host closed the connection]
mascool has joined #ruby
freeayu has quit [Ping timeout: 264 seconds]
mobilegamelabs has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
<klotho>
ok, now I'm getting my code to run a bit, but it's choking on mysql and activerecord. which gem should I install?
<td123>
Bauer: ./configure --help
<td123>
Bauer: that applies to pretty much all ./configures
cj3kim has quit [Quit: This computer has gone to sleep]
hippyphysicist has joined #ruby
conor_ireland has quit [Quit: conor_ireland]
<Bauer>
ahh, thanks td123 :) never was interested in that before, until I learned some applications just dont include everything by default compilation :(
kennyvb has quit [Read error: Operation timed out]
hippyphysicist has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
reuf has quit [Quit: Leaving]
AndChat| has quit [Ping timeout: 260 seconds]
<Bauer>
td123: any idea what is RUBY_DEBUG environment variable
friskd has quit [Quit: friskd]
<td123>
no, I would have to check
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<td123>
is this from the ./configure --help?
nesoi has joined #ruby
<Bauer>
yes, I wonder if its required for debuggin ruby programs, or ruby itself
sent-hil has quit [Remote host closed the connection]
igotnolegs has quit [Quit: Computer has gone to sleep.]
<shevy>
they still have not fixed that one?
jonathanwallace has quit [Ping timeout: 240 seconds]
rutkla has joined #ruby
gavilan2 has left #ruby [#ruby]
Criztian has joined #ruby
Wizek has joined #ruby
<Hanmac>
not yet but it is planed
<Wizek>
hello
<Wizek>
what is `(a, b) = [1, 2]` called in Ruby?
<Mon_Ouie>
parallel assignment
<Wizek>
I'm trying to do something similar with return values of methods on an object,
<Wizek>
ty
<Mon_Ouie>
A method that returns "multiple values" in Ruby is just a method that returns an array
<Wizek>
Not like that :)
mascool has quit [Ping timeout: 244 seconds]
<Wizek>
I meant that there is an object with multiple methods, which each return single values
<Wizek>
I meant that there is an object with multiple methods, and each returns a single value*
<heftig>
a, b, c = foo.a, foo.b, foo.c
banghouse has quit [Remote host closed the connection]
dhodgkin has quit [Read error: Operation timed out]
<Wizek>
yep :)
<Wizek>
ty
brianpWins has quit [Quit: brianpWins]
<Hanmac>
or like this: a, b, c = [:a,:b,:c].map {|s| foo.send(s)}
<Hanmac>
or like this: a, b, c = [:a,:b,:c].map(&foo.method(:send))
justsee|away is now known as justsee
jameshyde has quit [Remote host closed the connection]
jgrevich has quit [Quit: jgrevich]
aganov has joined #ruby
mockra has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
elhu has joined #ruby
aTastyCookie_ has joined #ruby
aTastyCookie_ is now known as aTastyCookie
m4rtijn has joined #ruby
<m4rtijn>
good morning
<m4rtijn>
does anyone know how to generate step definitions from a cucumber feature .. with cucumber?
<aTastyCookie>
I'm a beginner looking for project ideas...
telling has quit [Remote host closed the connection]
<m4rtijn>
im reading "the cucumber book" which just reads.. now run cucumber to generate step def.
mockra has quit [Ping timeout: 245 seconds]
nesoi has quit [Quit: This computer has gone to sleep]
<Bauer>
hmmm I compiled from sources, and getting this:
<Bauer>
It seems your ruby installation is missing psych (for YAML output).
<Bauer>
To eliminate this warning, please install libyaml and reinstall your ruby.
Criztian has quit [Remote host closed the connection]
<Bauer>
I did compile yaml from the source: yaml-0.1.4 and re-installed, but still the same msg
<Bauer>
to be correct, did configure, make and make install all over
<m4rtijn>
Bauer, why not use gems?
Criztian has joined #ruby
<Bauer>
m4rtijn: what do you mean? how? I am totally new to ruby
mobilegamelabs has quit [Quit: Angry Polygon (iPhone/Android/Mac) - http://www.MGGGGG.com/ap #ratingexchange]
<Hanmac>
Bauer what is your os? some kind of debianoid?
kennyvb has joined #ruby
<Bauer>
Hanmac: Centos
<Bauer>
5.4
<m4rtijn>
Bauer, i'd recommend reading up on RVM - it makes your ruby env totally OS independent
<m4rtijn>
it's a bit of an overkill to start.. but makes everything a lot easier afterwards
<m4rtijn>
especially usefull for outdated centOsses
<m4rtijn>
:)
bluOxigen has joined #ruby
<Bauer>
m4rtijn: how long would that take? ruby is only a means to an end to install redmine, not something I wanna spend the whole day at , today at least
<Hanmac>
before you install ruby you should install its build-depends ... (i dont know how it sounds on centos)
<m4rtijn>
ah.. k Bauer
<shevy>
Bauer, this can not be
<m4rtijn>
Bauer, i would recommend using an up to date OS version then anyways
<m4rtijn>
and forget about rvm :)
<shevy>
Bauer, I compiled yaml-0.1.4 from source into /usr prefix. Then I compiled ruby from source into /usr prefix. I get no error message
arkiver has quit [Remote host closed the connection]
Bofu2U has quit [Ping timeout: 246 seconds]
<Paradox>
i got a bundler t-shirt today
<Paradox>
out of the blue
Wizek has quit [Ping timeout: 246 seconds]
<Paradox>
its a sexy shirt
<Paradox>
looks like the kind my girlfriend wears
<shevy>
ok good
<shevy>
Bauer, you can ask Paradox
[eko] has quit [Quit: This computer has gone to sleep]
arturaz has joined #ruby
<Bauer>
lol, Paradox can you help with the bundler issue? :)
<Paradox>
what issue?
<Paradox>
my first suggestion is run --pre
<Paradox>
my scrollback isnt working for some reason
<Bauer>
Paradox: I just did gem install bundler, and then doing bundle install --without development test I get: Could not locate Gemfile
<Paradox>
do you have a gemfile?
tvw has joined #ruby
arkiver has joined #ruby
<Paradox>
i know its obvious
<Paradox>
but i have to ask
<shevy>
lol
<Bauer>
Paradox: I am not sure, how to check?
<Paradox>
ls
<Bauer>
ls where?
<Paradox>
project root
<Paradox>
is this a rails app?
mahmoudimus has joined #ruby
<Paradox>
or something else
<Bauer>
OHH, lol dumb me! I was still in the ruby source directory, not in remine... thanks Paradox :) hehe
<Paradox>
lol
arkiver has quit [Max SendQ exceeded]
<shevy>
!!!
<Paradox>
"hello it have you tried turning it off and on again"
freeayu has joined #ruby
<aces23up>
anyone know how I store a constant in a yaml file?
JasonBr0x has joined #ruby
<JasonBr0x>
hello all, I got a server with "Red Hat Enterprise Linux ES release 4" and I wanted to install "libxml-ruby" but I got "libxml-ruby requires Ruby version >= 1.8.6" my actual version is 1.8.5, so how to upgrade that version if the repository says it's the last version it has ?
arkiver has joined #ruby
<Paradox>
key: value
<Paradox>
thats how
<Bauer>
hmmm Paradox: it fails with: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. and another line: checking for mysql.h... no
<Paradox>
then in your initialization parse it once
<banisterfiend>
does apple have a streaming music service yet?
<Hanmac>
JasonBr0x install ruby1.9.1-full
<Paradox>
banisterfiend, nope
<Paradox>
Bauer, you are missing a C dep
<JasonBr0x>
Hanmac: thanks , let me try
<Bauer>
Paradox: why does it miss? and how to add it?
<Paradox>
thats not a bundler issue
<Paradox>
can you install the gem normally?
<Bauer>
Paradox: I just tried, same error
<shevy>
Bauer it tells you
<shevy>
mysql.h
<Paradox>
then its not bundler's fault
sepp2k has joined #ruby
<Paradox>
you're missing some system library
<Paradox>
what os
<shevy>
which is the C header file for mysql database
<Bauer>
centos 5.4
<banisterfiend>
sepp2k: hey seppy
<Paradox>
yum install mysql
<Paradox>
or something like that
<shevy>
distributions by default believe that users are idiots and never need .h files
<Paradox>
This is why OS X is nice
<Paradox>
it doesnt do half of anything
<Paradox>
you either get a perfectly working install
<Paradox>
or nothing
<shevy>
yeah
<shevy>
Bauer is stuck with centos
<Paradox>
poor bastard
jonathanwallace has joined #ruby
<hoelzro>
shevy: depends on the distro
<hoelzro>
but that *is* the trend =(
<shevy>
once we are done with RubyOS, that will all have changed
<Bauer>
Paradox: well this centos server has a working in production mysql server
<Paradox>
Bauer, but not the header files
<hoelzro>
shevy: =)
<Paradox>
shevy, i just want a ruby shell that doesnt suck
<Paradox>
no
<hoelzro>
shevy: do you have a repo out there? =P
<Paradox>
rush is NOT a good shell
<shevy>
Paradox you mean, one that aims to replace bash, or one that uses only valid ruby code?
arkiver has quit [Ping timeout: 260 seconds]
<hoelzro>
Paradox: you mean like a bash replacement?
<Paradox>
both
<Paradox>
more like a zsh or fish replacement
<Paradox>
but yah
<Mon_Ouie>
Ruby syntax feels bad for a shell
<shevy>
hoelzro, hehehe ... not really... I think I am too lazy for a real RubyOS... and, I also think it would have to follow the C/UNIX model (Ruby/RubyOS), but ruby can't be as fast as C, so that kinda means, no real RubyOS alone... (unless one mixes in C ... but then one could use linux anyway...)
<Paradox>
Mon_Ouie, i know
<Paradox>
but some things it would work well for
<Mon_Ouie>
Have to quote strings, globs that aren't expanded automatically, etc
<shevy>
Paradox, I see
<hoelzro>
I think that a Ruby shell (or any shell that uses a non-shell syntax for its scripting) is difficult by nature
<shevy>
Paradox, I think one would need to use C for a ruby shell
<Paradox>
i know
<Paradox>
its a pipe dream
<Bauer>
ok.. I am installing mysql-devel package now :( I hate the separation into devel packages...
<Paradox>
Mon_Ouie, i've use rush
<Paradox>
its terribal
<hoelzro>
shevy: that's kinda what I'm thinking; thin Linux underneath, but with a sophisicated Ruby API on top
<banisterfiend>
Paradox: what kind of thing do u have in mind? can u give example?
<shevy>
I tried to write a replacement for bash, but listing content of directories is always slower than with bash so far :(
<hoelzro>
kinda like what Android does
<shevy>
yeah hoelzro, that could work
<shevy>
still a lot of work :P
<hoelzro>
because why write a kernel if you have to maintain it, and add drivers, etdc
<hoelzro>
oh, totally
<Mon_Ouie>
I'd think just adding the ability to run Ruby code easily from the shell (always keeping the same VM) would be more helpful than creating a whole replacement
<Paradox>
banisterfiend, some drunken idea of ls.each { |f| f.mv('/aadsfakjsdfhadsf/') } or some shit like that
<Paradox>
never anything coherent
<banisterfiend>
Paradox: yuck
<Paradox>
just something easier to use than Dir
jonathanwallace has quit [Ping timeout: 248 seconds]
<Paradox>
as i said though
<hoelzro>
Paradox: reminds me of hotwire
<shevy>
Paradox well you could use all bash-like commands in such a shell too
<Paradox>
drunken ideas
<hoelzro>
what if you embedded a Ruby interpreter into bash?
<hoelzro>
and used a custom prefix to turn on "Ruby mode
<shevy>
hmm
<shevy>
Hanmac, can you do this ^^^
* hoelzro
thinks that could actually work
<Mon_Ouie>
hoelzro: Yeah, that's what I was thinking of
<Paradox>
hoelzro, hell i'd use it
<banisterfiend>
Paradox: u can interpolate ruby code in shell code using pry, like this: .cd #{my_dir} but we dont optimize for the shell case at all, and dont provide many features aside from ruby interpolation
<hoelzro>
and gradually phase out the C portions for Ruby bits >:)
<hoelzro>
mwahahahahaha
<Hanmac>
shevy writing a shell? yeah why not ... but not currently
<Paradox>
but gsub(/bash/, 'zsh')
<Paradox>
banisterfiend, i know
<hoelzro>
but the Ruby mode and the shell mode would have to integrate well together
<Paradox>
i pop into pry whenever i have a slightly complex rename
<hoelzro>
ex. R$ puts "$HOME" would have to print ENV['HOME']
indian has joined #ruby
<Paradox>
ie naming pictures based off of an exif tag in a way that would take far too fucking long in lightroom
icambridge_ is now known as icambridge
<Hanmac>
shevy about feeding gremlins after midnight ... what kind of? local time or Greenwich time?
odigity has quit [Quit: Leaving]
Markvilla has joined #ruby
ReTFEF has quit [Changing host]
ReTFEF has joined #ruby
<banisterfiend>
hoelzro: the difficult part is mixing the ruby and the bash
<Paradox>
banisterfiend, yeah
<Paradox>
thats why rush fails
<banisterfiend>
hoelzro: cos if they're just completely separate, i dont really see much use in that..
<hoelzro>
banisterfiend: indeed
<hoelzro>
yeah, that's what I meant with my puts "$HOME" example
<hoelzro>
does Ruby have a global_missing lookup hook?
<banisterfiend>
no
<banisterfiend>
they're initialized to nil
<banisterfiend>
same as @vars
<Hanmac>
hoelzro no ... but with c-exts you could define globals as virtual
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
But you have to know their name in advance
<Hanmac>
but you are right ... imo there should be some kind of global_missing
<banisterfiend>
Paradox: btw we also have an undocumented feature in pry
<zii>
Doesn't matter the way you make it call stuff.
<zii>
They way you call doesn't matter*.
<shevy>
did I already mention that I hate rewrites
brotspinne has joined #ruby
saschagehlich has joined #ruby
<JasonBr0x>
Hello, I got an error while compilinge ruby: ./ruby: symbol lookup error: /root/sources/ruby-1.9.3-rc1/.ext/i686-linux/enc/encdb.so: undefined symbol: rb_encdb_declare
<JasonBr0x>
make: *** [rdoc] Error 127
<shevy>
then rb_encdb_declare was not declared
nikeita has joined #ruby
<JasonBr0x>
shevy: what that means exactly
<shevy>
what OS are you on
<JasonBr0x>
shevy: Red Hat Enterprise Linux ES release 4 (Nahant Update 5)
<brotspinne>
hello. can someone explain me the difference between defined? myobj.mymethod and myobj.respond_to?(:mymethod)?
<shevy>
JasonBr0x not sure why encoding.c is not compiling for you
<shevy>
JasonBr0x perhaps there is some earlier check that fails for you, make sure to look at config.log as well
<JasonBr0x>
shevy: I haven't got any clue too :(
<shevy>
sometimes the errors are hidden there
<JasonBr0x>
shevy: ok let me check
<shevy>
all I can say is that I can compile ruby from source without that error popping up :)
<shevy>
brotspinne, dunno. .respond_to? acts on the object in question, defined? I think is more low level
<Hanmac>
brotspinne: respond_to? as a sister named repsond_to_missing, its interesting on dynamic methods using method_missing
<Mon_Ouie>
brotspinne: defined? isn't affected by how you redefine #respond_to?
<Mon_Ouie>
But really, don't use it to check for methods
cantonic has joined #ruby
Gab0 has quit [Remote host closed the connection]
<Paradox>
war were declared
<Hanmac>
imo the only useful thing for defined? is defined?(super)
bullicon has joined #ruby
<Paradox>
use method missing to print out strings from /dev/random
<brotspinne>
shevy: Hanmac: Mon_Ouie: so from the behaviour side there is no difference?
<Paradox>
;p
<banisterfiend>
Hanmac: it's cool for lots of things
<shevy>
waaah... I finished the 200 lines of code rewrite finally
<banisterfiend>
Hanmac: i use it to discover whether something is a local or a method
<brotspinne>
Mon_Ouie: why I shouldn't use defined?
<shevy>
brotspinne, defined? is strange
<Hanmac>
brotspinne: its possible that respond_to? return true while defined? returns false
<shevy>
I forgot why, but I remember that it was strange. I think it is cheating
<brotspinne>
shevy: I only know it is an operator instead of a build in method. but why it is strange?
<shevy>
I dont quite remember
<brotspinne>
Hanmac: this is interesting. when is this the case?
<shevy>
use .respond_to?
<Mon_Ouie>
Whey you override respond_to?
<Hanmac>
Mon_Ouie no i only need to override respond_to_missing
lxsameer has joined #ruby
<Mon_Ouie>
No, defined? is aware of respond_to_missing? — which is the right way to do it
nyuszika7h has joined #ruby
<brotspinne>
my question was about the difference without redefining or manipulating anything. so what is now the exact difference and why I should not use defined?
<Mon_Ouie>
If you override respond_to?, defined? will still only use the actual methods and respond_to_missing?
<Mon_Ouie>
Partly because there are people who wrongly override respond_to? instead of respond_to_missing?, and because respond_to? has a clearer intent
GeekOnCoffee has quit [Ping timeout: 244 seconds]
br4ndon has joined #ruby
elhu has quit [Ping timeout: 260 seconds]
justsee has quit [Quit: Leaving...]
<Hanmac>
brotspinne sample: OpenStruct.new.xyz
<brotspinne>
Mon_Ouie: you mean when someone intent to change the behaviour of defined? and respond_to? but instead of overwriting respond_to_missing he mistakenly overwrites respond_to? so that defined? does not work anymore like desired, right?
justsee has joined #ruby
fearoffish has joined #ruby
friskd has joined #ruby
<Mon_Ouie>
Yeah. Actually, Hanmac's example shows that you can find that even in stdlib.
lxsameer has quit [Max SendQ exceeded]
<Mon_Ouie>
I'd consider it a bug
friskd has quit [Client Quit]
<banisterfiend>
Mon_Ouie: stdlib has some of the worst ruby code in it
<Mon_Ouie>
I know
workmad3 has joined #ruby
robotmay has joined #ruby
lxsameer has joined #ruby
<Mon_Ouie>
That's kind of a shame in fact
<brotspinne>
Hanmac: can you explain me that? so openstruct overwrites the wrong method or what is going on there?
<Hanmac>
defined? cant work with OpenStruct ... its not designed to work
elhu has joined #ruby
GeekOnCoffee has joined #ruby
<banisterfiend>
Yeah, hopefully it'll be a non-issue when stdlib is gemified
<Mon_Ouie>
It could work, if only they'd define respond_to_missing? properly
znouza_ has joined #ruby
<Mon_Ouie>
Actually they don't define respond_to? either, so even #respond_to? is false
<shevy>
the deeper one digs, the more crap is brought up to surface
<shevy>
gemifying the stdlib could be nice even if only for more people scrutinizing it
<brotspinne>
okay I didn't really get the openstruct example
<Hanmac>
Mon_Ouie: xyz in my sample is only defined when its set
<Mon_Ouie>
Yeah, but that's because they use #define_method
<Mon_Ouie>
So respond_to? and defined? will work exactly the same way
<banisterfiend>
brotspinne: you have two people saying somewhat opposing things, who do you trust Mon_Ouie or Hanmac?
arkiver has quit [Ping timeout: 260 seconds]
<brotspinne>
I'm not often in irc. so maybe you can tell me that? :D
* workmad3
wonders what the original issue was
<brotspinne>
workmad3: difference between defined? and respond_to?
withnale has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
<banisterfiend>
brotspinne: i think we should make them mud wrestle, and u take the advice of the winner
<Mon_Ouie>
You'd like thiat
blacktulip has joined #ruby
<withnale>
if I want to pass a logger object to a class to store, and use from that class, whats the best way to do it?
<banisterfiend>
Mon_Ouie: Yeah.
<brotspinne>
Mon_Ouie: cool I will look into this
<workmad3>
Mon_Ouie: cool, so basically what that says is that the default respond_to? implementation is awesome and shouldn't be overridden :)
<Mon_Ouie>
Yeah
<Mon_Ouie>
In 1.9, that is; back in 1.8, there was no #respond_to_missing?
freeayu has quit [Ping timeout: 246 seconds]
<workmad3>
yeah, but who uses 1.8 outside of legacy code now? :)
Rochefort has joined #ruby
<Mon_Ouie>
Surprisingly, ack stdlib, there are two wrong redefinition (on in minitest/mock and another in DRb), and a right one (in delegate)
<banisterfiend>
workmad3: we should make people who use 1.8 wear a t-shirt saying "Pig." on it
xorigin has joined #ruby
apacala has joined #ruby
<brotspinne>
Mon_Ouie: okay got it. thanks!
havenn has quit [Remote host closed the connection]
<banisterfiend>
Mon_Ouie: is teaching/helping people on #ruby a selfless act or is there some element of egoism involved as you demonstrate superior knowledge over other would-be teachers ?
JasonBr0x has left #ruby [#ruby]
<banisterfiend>
what's your motivation Mon_Ouie
rashila has joined #ruby
flype has joined #ruby
<rashila>
hi, I have created an engine which depends on faye-rails. I have added dependency to the gemspec file. When I install the gem to the dependencies are also installed, but undefined method error is shown for methods in the dependency gems.
<hoelzro>
smu43: so you mean that you want to be able to use the files in your CWD as if there were packaged and installed, but without constantly rebuilding and installing?
<seoaqua>
how to skip test-b when text-a fails with Rspec?
<smu43>
hoelzo, yes exactly
<hoelzro>
smu43: why not just set your RUBYLIB appropriately?
Vakaris has joined #ruby
<smu43>
hoelzro, sorry, I mispelled your name
<hoelzro>
no problem =)
<smu43>
RUBYLIB you say ? I will take a look at that
<smu43>
thanks a lot !
<hoelzro>
I think that require 'rubygems' may consider the gem version first, so be careful
pratz has quit [Read error: Connection reset by peer]
pratz has joined #ruby
<smu43>
you mean I should uninstall the gem first ?
<hoelzro>
well, create a test script in your working directory
<hoelzro>
set RUBYLIB to where your stuff is located
liluo has quit [Remote host closed the connection]
znouza_ has joined #ruby
mohits has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<_br_>
How do I turn a byte stream into a UTF-8 String? The byte stream was originally a UTF-8 encoded string.
<burgestrand>
_br_: do you have the byte stream as a string?
arkiver has joined #ruby
<_br_>
well when I get the data via the socket I get a string yes.
<_br_>
looks a bit like unicode ... "{\u0000\"\u0000I\u0000D\u0000\"\u0000:\u0000\"\u00001\u0000\
Criztian has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
arkiver has quit [Max SendQ exceeded]
<burgestrand>
_br_: for IO objects, I believe you should be able to set their encoding directly, and ruby should interpret it correctly, however if you have a string that ruby has set to a BINARY encoding, you can tell ruby it’s in UTF-8 by doing your_string.force_encoding("UTF-8")
<_br_>
and in the middle some hex values?! \xC9l\xAC0
<_br_>
I did a force_encoding("UTF-8") on it but didn't do the trick
arkiver has joined #ruby
<_br_>
experiments with .unpack aren't quite either helping
<banisterfiend>
where is remove_instance_variable mentioned there? :)
mneorr has quit [Quit: Leaving.]
Foxandxss has quit [Changing host]
Foxandxss has joined #ruby
`heliar is now known as anyone
anyone is now known as `heliar
xcorex has joined #ruby
<Tasser>
banisterfiend, context is only the gist
joesavage has joined #ruby
jjbohn has joined #ruby
MarGarina has joined #ruby
<joesavage>
I have a directory which contains several directories for each category of my website, each of which has a number of articles inside - what would be the easiest way of generating an XML feed (sitemap-style) to list all these tutorials for use in client-side search functionality at a later date?
<joesavage>
[in Ruby of course]
nari has joined #ruby
Banistergalaxy has joined #ruby
JarJar has quit [Quit: Leaving]
<workmad3>
joesavage: probably using nokogiri's builder
<joesavage>
workmad3: I'm not familiar, could you link me up?
<joesavage>
Ooh looks interesting, thanks, I'll take a look and come back if I'm having problems dynamically doing everything with the directory structure and stuff!
seoaqua has quit [Ping timeout: 244 seconds]
seoaqua has joined #ruby
vish_ has quit [Quit: Leaving...]
shashin has joined #ruby
jjbohn is now known as jjbohn|afk
xcorex has quit [Remote host closed the connection]
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
fralcon has joined #ruby
Vakaris has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<_br_>
Wow, this is ridiculous. C# JSON UTF8 Data via Byte array, socket to Ruby. Gives me serious headache.
Markvilla has quit [Quit: Markvilla]
elhu has joined #ruby
<burgestrand>
_br_: the string you showed us before looked very weird, and not at all like raw UTF-8 bytes :o
<_br_>
burgestrand: Yes, its a good question where the error lies.
Markvilla has joined #ruby
nateberkopec has joined #ruby
<burgestrand>
_br_: even if ruby got the encoding wrong, I’d expect it to be in BINARY and not anything else, so I wonder if the error happens before the data is sent on the wire to ruby, i.e. not ruby’s fault
<_br_>
what is this anyway? hex values with three digits? \xA20\xB70
tze` has joined #ruby
<burgestrand>
_br_: naw, just the bytes 0xA2, character 0, byte 0xB7 and character 0
<_br_>
burgestrand: Hm, I am starting to think its not rubys fault either. Its really weird. This encoding stuff is a horrible mess.
Progster has joined #ruby
<_br_>
burgestrand: I see..... thanks
<burgestrand>
Hm, perhaps it’s not in UTF-8 but UTF-16?
<_br_>
o.O
<burgestrand>
Oh, naw, nvm
tze` has quit [Client Quit]
<burgestrand>
For a second there I thought the character 0 = 0x00
<burgestrand>
:p
<_br_>
you gave me a small heartattack
<Spooner>
Maybe it is UTF-24 :D
<_br_>
ahhh
maucat has quit [Quit: 离开]
<bnagy>
could be UTF-11
<Spooner>
Oops, I meant UTF-12. Same thing, isnt' it?
emmanuelux has quit [Ping timeout: 252 seconds]
<_br_>
<- exploded
Markvilla has quit [Client Quit]
<_br_>
ok, time to blame the C# guy.
bullicon has quit [Quit: Computer has gone to sleep.]
sendoushi has joined #ruby
<workmad3>
Spooner: heh
zii has left #ruby ["WeeChat 0.3.8"]
<workmad3>
Spooner: don't forget UTF-9, for efficient unicode on DSP processors with 9-bit bytes :)
jjbohn|afk has quit [Quit: Leaving...]
ssspiff has joined #ruby
ssspiff has joined #ruby
<bnagy>
yeah but UTF-9 is really just the same as three trytes
<Spooner>
Oh yeah, I forgot that. I usually used UTF-9.5 for that, since I used the extra half a bit for error correction.
<workmad3>
bnagy: err... two trytes, isn't it?
<workmad3>
bnagy: hmm... actually, ignore me, would need to work that out more :)
<_br_>
the horror... horror....
nateberkopec has quit [Quit: Leaving...]
arkiver has quit [Ping timeout: 260 seconds]
sspiff has quit [Ping timeout: 260 seconds]
<bnagy>
_br_: what's the data supposed to be, anyway?
tvw has joined #ruby
jonathanwallace has joined #ruby
<bnagy>
I'm tempted to ask why you're using raw sockets, but the answer will only irritate me
<workmad3>
bnagy: for efficientz binary processingz!!!
`brendan has joined #ruby
<_br_>
I don't want to use raw sockets but the other braindamaged people here insist.
sendoushi has quit [Remote host closed the connection]
<bnagy>
ok well tcp etc doesn't respect serialisation boundaries
<_br_>
That stuff is supposed to be a json, and now I can read part of it. But seems the japanese payload was converted to unicode and that garbled it?! omfg.
<bnagy>
I'm assuming you looked at all this
<_br_>
jep
<bnagy>
you need a streaming processor, which is a pita
<_br_>
I think its now a problem on the server side again. So its ok....
<shevy>
I am happy, today I learned something new in ruby
<_br_>
bnagy: tell me about it.... making this clear to C# people is...... impossible.
<hoelzro>
shevy: what's that?
<bnagy>
can you convince them to use netstrings or something?
<shevy>
hoelzro, the remove_instance_variable() part
<hoelzro>
ah
Vakaris has quit [Ping timeout: 255 seconds]
<_br_>
bnagy: I can try ;o;
<bnagy>
at least then you have some idea when you have your message
<bnagy>
it's super simple, len,data (literal comma)
<bnagy>
sorry len:data,
<_br_>
Thanks... I'll try. Lets see what happends.
<bnagy>
then you can verify that you at least have the correct raw for the serialised object
wataken44 has quit [Remote host closed the connection]
<bnagy>
imvho json sucks donkey balls
<bnagy>
msgpack is way better and faster
<bnagy>
but I dunno about C# support
jonathanwallace has quit [Ping timeout: 260 seconds]
<_br_>
bnagy: Jep. That was the first think I tried to convince them. Lets use msgpack. Answer, doesn't work.. <insert bs explanation>
<_br_>
bnagy: Anyway, thanks for the help appreciate it. Lets give netstrings a try..
<bnagy>
json is a whiny bitch about non utf8 data
wataken44 has joined #ruby
<bnagy>
well netstrings is only a way to make sure your raw is correct
<bnagy>
it doesn't help with your serialisation
vectorshelve has quit [Quit: Page closed]
<_br_>
actually, I am suspecting also that these guys are garbling the data from their $win encoding to utf8.
<_br_>
sign. bbl
mneorr has joined #ruby
br4ndon has joined #ruby
strife25 has joined #ruby
jds has joined #ruby
rutkla has quit [Read error: Connection reset by peer]
mpereira has joined #ruby
geekbri has joined #ruby
clocKwize has quit [Quit: clocKwize]
geekbri has quit [Remote host closed the connection]
geekbri has joined #ruby
clocKwize has joined #ruby
vjacob has left #ruby ["Leaving"]
TheFuzzball has quit [Ping timeout: 252 seconds]
indian has joined #ruby
Tomasso has joined #ruby
jds has quit [Quit: jds]
jds has joined #ruby
jds has quit [Client Quit]
jds has joined #ruby
robbyoconnor has quit [Ping timeout: 246 seconds]
Vakaris has joined #ruby
freeayu has joined #ruby
ken_barber has quit [Remote host closed the connection]
Rochefortes has joined #ruby
freeayu__ has quit [Ping timeout: 246 seconds]
mockra has joined #ruby
tomb_ has quit [Quit: Computer has gone to sleep.]
a_a_g has quit [Quit: Leaving.]
arkiver has joined #ruby
burgestrand has quit [Quit: Leaving.]
ken_barber has joined #ruby
indian has quit [Ping timeout: 264 seconds]
mehlah has quit [Quit: Leaving...]
ken_barber has quit [Remote host closed the connection]
Rochefort has quit [Ping timeout: 255 seconds]
Squarepy has quit [Read error: Connection reset by peer]
jstew has joined #ruby
Squarepy has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
krusty_ar has joined #ruby
sendoushi has joined #ruby
<_br_>
bnagy: AHAhaahahahaahahahaa
<_br_>
bnagy: Guess what.
<_br_>
"Oh, my bad. I thought it was UTF8 seems its little endian UTF16"
AlbireoX`Laptop has quit [Remote host closed the connection]
<_br_>
*facepalm*
jds has quit [Quit: jds]
<hoelzro>
...
nwest has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
nikeita has joined #ruby
ananthakumaran has joined #ruby
nikeita has quit [Client Quit]
<bnagy>
ew
<bnagy>
that's ok, ruby has utf16le easily available, right?
Morkel has quit [Quit: Morkel]
<bnagy>
doesn't make netstrings not a good idea, either way :P
<bnagy>
it's very convenient for stuff like tcp where you don't know how much data you're getting per packet, you can just read the length, then read(len);read(1) and check that it's ','
<_br_>
True, I am not worrying about the ruby side. Its just that the C# guys are like, yes. We are sending you utf8. Are you sure?! Really?! Hm, look here it is in the code ... oh...
<_br_>
I was reading the djb spec of netstring, sounds pretty reasonable...
<bnagy>
I used to use messagepack over netstrings when I had some EM streaming stuff
<bnagy>
now I just use zmq and things where it is guaranteed to deliver a full message :/
<_br_>
those guys can't wrap their head around msgpack or zeromq. Forget it. ;.;
Vakaris has quit [Ping timeout: 248 seconds]
<seoaqua>
suppose i define a method '[]' how to use it within the class?
ZachBeta has quit [Quit: Computer has gone to sleep.]
<hoelzro>
seoaqua: self[key] = value?
<bnagy>
well zmq I accept is a brainfuck, but msgpack is just a drop in serialisation replacement
moshef has joined #ruby
<seoaqua>
hoelzro, oh ,i wrote 'self.[key]' . thanks
<_br_>
bnagy: true, but useless in this case. Dealing here with Monkeys apparently.
<seoaqua>
hoelzro, it works :)
flip_digits has joined #ruby
bullicon has joined #ruby
beakerman has joined #ruby
ken_barber has joined #ruby
<workmad3>
seoaqua: the valid ways to call it are self[key] or self.[](key) :)
jonathanwallace has quit [Ping timeout: 248 seconds]
<Spooner>
Muz that will just evaluate as true for all of the hashes.
verbad has joined #ruby
<Spooner>
Or rather just find the one with the longest text. Oops.
gmci has joined #ruby
<Muz>
Oh whoops, yeah
<Spooner>
Ack, simpler than my one slightly (and what I think Muz meant) a.max_by { |h| [h[:probability], h[:text].length] }
<bnagy>
this sound like sort with a block .first
<bnagy>
oh yeah or that which is the same :)
pabloh has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 264 seconds]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
jrist-afk is now known as jrist
Rochefort has joined #ruby
lxsameer has joined #ruby
freeayu has quit [Quit: 离开]
peterhellberg has joined #ruby
<JonnieCache>
Spooner: ooh didnt know you can recursively compare arrays like that
<JonnieCache>
very clever
<JonnieCache>
doesnt sound very fast though
<Spooner>
Speed rarely matters, JonnieCache, unless it matters :)
<bnagy>
twss
<JonnieCache>
hah true. thats why we're using ruby i guess
fbernier has joined #ruby
<Muz>
Rule 1. Make it work, make it fast.
<Muz>
Premature optimisation is the bane of al programming.
<Muz>
*all
<shevy>
I think speed can come almost automatically with a clean design
lxsameer has quit [Ping timeout: 260 seconds]
<peterhellberg>
Also, fast is rarely the same thing for every stakeholder in a project.
erichmenge has joined #ruby
habib has joined #ruby
<Muz>
Also fast is rarely heard of in Ruby.
<peterhellberg>
:)
Nanuq has quit [Ping timeout: 245 seconds]
<Muz>
There's "acceptable" and then varying levels of "dog slow" in my books for Ruby. If speed's a concern, Ruby's probably not the right tool for any large/critical item.
ortho_stice has joined #ruby
jimeh has quit [Ping timeout: 246 seconds]
hynkle has joined #ruby
<shevy>
yeah
Nanuq has joined #ruby
<peterhellberg>
I often think my code is too slow and in need of optimization, then it often turns out to be an order of magnitude faster than the old solution…
<shevy>
I wanted to write a bash replacement in pure ruby
mockra has joined #ruby
<peterhellberg>
There are a LOT of low hanging fruit out there…
<shevy>
but listing the content of directories is a lot faster in bash than in my pseudo shell :(
<JonnieCache>
peterhellberg: what, in terms of slow code waiting to be replaced you mean?
ttilley has quit [Ping timeout: 245 seconds]
w400z has joined #ruby
<Spooner>
shevy: Bash already is a good implementation of the Bash shell.
<JonnieCache>
bash is basically a C layer over the posix api. youre going to struggle to make it faster
<peterhellberg>
JonnieCache: I mean slow business processes replaced by a simpler solution in Ruby…
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<shevy>
there is like a 0.4 seconds delay before all 600 of my .mp3 files are listed in my ruby-shell. there is about a 0.0 seconds delay when I do the same in bash... not sure why so far, but I have this feeling that, no matter how much I do, ruby would always be slower here
Guest97636 has quit [Quit: it puts the packet in the socket or else it gets the close() again]
ttilley has joined #ruby
* hoelzro
had a bit of deja vu there
<peterhellberg>
JonnieCache: There is obviously room for improvements when it comes to speed, but I’ve found that it rarely matters
<hoelzro>
shevy: did you implement ls in Ruby?
Markvilla has joined #ruby
<JonnieCache>
shevy: the ruby is going to have to do everything bash is doing, and then a whole lot of overhead
<JonnieCache>
so its always going to be slower really
<shevy>
hoelzro kinda.
gift has joined #ruby
<hoelzro>
shevy: why not just shell out to ls, then? it'll go a *lot* faster
<shevy>
one class tries to act as ls replacement
<shevy>
hmm
liluo has joined #ruby
<shevy>
I could try that
ken_barber has quit [Remote host closed the connection]
infinitiguy has joined #ruby
<banisterfiend>
JonnieCache: hey jonnie
<banisterfiend>
wat's up
ken_barber has joined #ruby
<JonnieCache>
not a great deal
jonathanwallace has joined #ruby
<shevy>
yeah JonnieCache ... and not only that, I always wonder if my ruby style is a very slow style or not
<JonnieCache>
its not hot here any more so i can actually work properly
<JonnieCache>
on the downside, its not hot anymore
<shevy>
if ruby would be as fast as C!
mockra has quit [Ping timeout: 240 seconds]
chee has quit [Ping timeout: 245 seconds]
uris has joined #ruby
justsee has quit [Quit: Leaving...]
<hoelzro>
shevy: I think the speed comes down to what you're doing
<peterhellberg>
shevy: Unfortunately it isn’t, and I don’t think it will be in the foreseeable future.
imami|afk has quit [Ping timeout: 246 seconds]
<hoelzro>
ex. a naive implementation of Sieve of Eratosthenes will be slow in Ruby because you're creating a bunch of data over and over
<JonnieCache>
banisterfiend: hows you?
<hoelzro>
whereas in C I would use a bitmap
<banisterfiend>
JonnieCache: bored as a baby horse, do u know any good movies or documentaries?
<Spooner>
Ruby is designed for convenience, not speed. You can write it in a faster style, but then it loses all elegance and terseness, so you might as well use something else.
gheegh has joined #ruby
iori has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 246 seconds]
<peterhellberg>
Intel Fortran is probably a better bet ;)
andrewhl has joined #ruby
banseljaj has joined #ruby
<peterhellberg>
Faster than C!
Guest40040 has joined #ruby
<JonnieCache>
banisterfiend: have you seen breaking bad? if you want something to watch id reccommend that
<JonnieCache>
not a movie or docu though
<banisterfiend>
JonnieCache: Yeah, seen it. Not this season though
<banisterfiend>
somehow im not interested in this season
<JonnieCache>
no. i dont watch too many drama shows. i already waste too much time with other stuff
<m4rtijn>
anyone seen misfits ? I liked it
twinturbo has quit [Ping timeout: 260 seconds]
<banisterfiend>
JonnieCache: wouldn't really describe it as drama..
<banisterfiend>
it's kind of epic fantasy
<banisterfiend>
like LOTR, but with more political stuff
<hoelzro>
banisterfiend: have you read the books?
<banisterfiend>
hoelzro: no
<JonnieCache>
i meant drama as in, "a thing with a story that isnt a comedy or a genre thriller"
<gheegh>
Question. I've got an array of hashes. I'd like to generate from it an array of hashes.. where each has has the key… and a list of other keys that are within say 500 of the primary key.. Is there a way to do this other than a massive amount of iterations over the array? The array can be 30k items long…
<JonnieCache>
there's The Killing which is supposedly very good
<Spooner>
gheegh : They are not Hashes, as we'd call them, which was confusing :)
phao has joined #ruby
<JonnieCache>
if you dont mind subtitles. or you speak danish :)
carloslopes has joined #ruby
phao has left #ruby ["Not Here"]
<gheegh>
Spooner: Yeah, i realized that calling it a hash was confusing.. since there is a hash.. and that's what I want to go to.. :-)
ken_barber has joined #ruby
<bnagy>
gheegh: it will be slow :P
ken_barber has quit [Remote host closed the connection]
ken_barber has joined #ruby
liluo has quit [Remote host closed the connection]
hynkle has quit [Read error: Connection reset by peer]
<bnagy>
which usually suggests that your algorith is broken
rippa has joined #ruby
<gheegh>
bnagy: Yeah, trying to sort out the best way to do this.. i tried a simple iteration.. but that was exceedingly painful.. and inefficient..
stefanp_ has joined #ruby
<bnagy>
I don't think it's inefficient
<Spooner>
Why on earth do you want to group based on hash codes?
jimeh has quit [Ping timeout: 248 seconds]
<bnagy>
it's a hugely high order algorithm
<shevy>
gheegh try to keep all your data structures as simple as possible
<peterhellberg>
gheegh: So you want to get a single list of strings where the integer representation is somewhere between -250 and +250 away from a given number?
<Spooner>
I mean nearest to hash codes.
krusty_ar_ has joined #ruby
<gheegh>
pteterhellberg: yep.
<shevy>
I have seen access stuff like @hash['foo'][0]['bar'][1]['bla'] some days ago here on #ruby
cantbecool has joined #ruby
<gheegh>
Spooner: they are hashes of documents.. i'm doing duplicate detection.
<bnagy>
I think he wants h={};ary.each {|e| h[e]=ary.select {|i| (i.to_i - e.to_i).abs < 500}}
<bnagy>
or similar
<banisterfiend>
bnagy: hey wanna watch a movie with me
<Spooner>
gheegh: But unless your hash generation is odd, being within 500 of another hash doesn't imply the original data was in any way similar.
<peterhellberg>
gheegh: Why are your digests strings in the first place?
krusty_ar has quit [Ping timeout: 260 seconds]
<bnagy>
gheegh: oh right. use ssdeep or something
<gheegh>
bnagy: it's a lot faster than manualy comparing documents
<bnagy>
or cosine similarity
<bnagy>
or one of the million well studied ways to do this :)
stefanp has quit [Ping timeout: 265 seconds]
<peterhellberg>
gheegh: And I’m with Spooner on this one. What makes digests numerically close to each other signify?
sncz has quit []
<gheegh>
bnagy: the hashes are simhashes actually..
<peterhellberg>
s/makes/does/
<bnagy>
gheegh: well you've got an n*2 problem, so it'll be slow, like I said
<bnagy>
it's simple to write (as above)
<bnagy>
I would only do it on demand
<bnagy>
you can also parallelize
hynkle has joined #ruby
<Tasser>
... use jruby for that
<gheegh>
right.. might make sense to run through and cluster..
<Axsuul>
How would I go about initializing an instance variable within an object from a mixin?
<bnagy>
I do something like this, and I used NCD
<bnagy>
which is more accurate than ssdeep, definitely so for binary files
<Axsuul>
The instance variable needs to be initialized when the object gets init
<bnagy>
you could google normalized compression distance and then do that with xz
sspiff has joined #ruby
liluo has joined #ruby
<bnagy>
you can optimise by only considering files that are also within X of each other in size
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!]
<GeekOnCoffee>
mparodi: because you like simple and elegant code
<mparodi>
m4rtijn, ?
<mparodi>
I have to
<m4rtijn>
why?
<mparodi>
because I have to develop a project, and I can choose one of them to work with
<Muz>
mparodi: because the project you're working on is more suitably done with Ruby, and not Java with bullshit subjective measures aside.
<Muz>
What is the project?
<mparodi>
ok, let me explain you a little more
lorandi has joined #ruby
<m4rtijn>
just specify the domain of the project - make a pro / con list of the languages.. then choose
<m4rtijn>
you shouldnt ask in here.. :p
<bnagy>
Tasser: no
<JonnieCache>
because you like being able to do simple programming tasks without an order, signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters.
<Tasser>
bnagy, hm, oke
<bnagy>
well not ime anyway
Nanuq has quit [Ping timeout: 245 seconds]
<bnagy>
I only have that in for jruby / mri
ortho_stice has left #ruby [#ruby]
bbttxu has joined #ruby
<Progster>
can you add bools together easily?
<mparodi>
next semester I'll take a course that requires to build a project (no, I still don't know what it is!) but I have to choose a language first
<Tasser>
Progster, define
<bnagy>
no, nor with difficulty
<Tasser>
mparodi, use jruby if you want to be able to use both
<Muz>
mparodi: in that case, what's your programming background like?
<m4rtijn>
mparodi, what shit uni are you at.. decide the language before the project?
<mparodi>
in any case, the project will be adapted so it's best developed in that language (it's not the same project regardless the language)
<shevy>
mparodi and what is the project about?
<bnagy>
that is the most retarded thing I have ever heard
<bnagy>
but in any case, choose ruby
<mparodi>
haha
<bnagy>
if you turned out to be wrong you can cheat and use jruby and still win
<Muz>
mparodi: to put the foam-at-the-mouth fanboyism in perspective, join ##java and ask the same question. ;)
<m4rtijn>
:)
<shevy>
what is this
<shevy>
noone knows what this project is about
dv310p3r has joined #ruby
<shevy>
WRITE 99 BOTTLES OF BEER
<Tasser>
shevy, we're joining a collective troll
<Hanmac>
if you want elegant, choose ruby, if you want speed make an c-ext gem and then choose ruby
<JonnieCache>
just choose JVM bytecode as your language. then you'll have a choice of excellent tools at your disposal
<shevy>
must be some fake project indeed
<m4rtijn>
gtg
<m4rtijn>
bye
m4rtijn has quit [Quit: Verlassend]
jimeh has joined #ruby
<mparodi>
I want to choose ruby but I have to convince 14 people to do that so I'm looking for arguments to do so :P
<bnagy>
mparodi: try google
<Tasser>
mparodi, oh, that's a different story.
<bnagy>
or learn the language and then reason yourself
<workmad3>
mparodi: first question - are they actually receptive to learning a new language at the moment?
<shevy>
mparodi what.is.this.project.about?
<shevy>
notice that my question is valid ruby code
<shevy>
try this with java
<mparodi>
well, I think so but they prefer Java because they already know Java...
<mparodi>
workmad3, ^
<shevy>
14 people and noone knows what this project is about
* Hanmac
sings "everything java can, can ruby do better ..."
<workmad3>
shevy: NoMethodError: Unknown local variable or method 'what'
<Spooner>
Is the project large enough that learning a new language, even one that would enable faster development, wouldn't increase dev time and effort?
<shevy>
workmad3, hah you miss the what object!
<shevy>
i wanna know what this project is about
<shevy>
but he won't tell us
<Hanmac>
"14 people and noone knows what this project is about" sound after a group of politicans
chimkan has joined #ruby
<bnagy>
shevy: it's actually a social engineering project about trolling programmers
uris has quit [Quit: leaving]
<shevy>
lol
<Spooner>
shevy : It is "print a line of text onto the screen". Definitely hugely simpler in Ruby :)
<workmad3>
shevy: def method_missing(method, *args); ([method] + args).join(" "); end; this is now also valid ruby
<shevy>
I think his real mission is to probe #ruby
<shevy>
then he'll do the same with #java
<JonnieCache>
workmad3: that is horrendous
<Muz>
##java. Oracle won't let them have an official presence on Freenode. :p
<shevy>
java today is no longer the java when Sun was in charge
<JonnieCache>
im imagining larry ellison busting in and shutting the place down
<JonnieCache>
haha
<shevy>
mparodi you should use ruby because matz is cool
<Hanmac>
imo java was better when it was under the sun
johnernaut has joined #ruby
<shevy>
perl was better off when larry was young
<mparodi>
<shevy> but he won't tell us <- I don't know. the process is: your group choose the language, the professors give you a client that wants a product that fits in that language
<bnagy>
haha
<bnagy>
choose brainfuck
<shevy>
...
<Tasser>
\o/ brainfuck
<mparodi>
lol
<shevy>
so you have a professor
<workmad3>
mparodi: ok, so this is group coursework...
<shevy>
who says "Hey my student slaves. You will get a project, but you won't know which one. You must pick a language in advance."
<workmad3>
mparodi: do you actually have time to learn a new language in the timescale for this?
<shevy>
this professor is a criminal
<Hanmac>
yeah ... choose "C" and the prof wants a website
<shevy>
OH
<shevy>
PHP!!!
<shevy>
GIVE HIM PHP!
<bnagy>
also... 15 people per project?
<bnagy>
YIKES
<Muz>
If you choose Ruby, I bet the project is a failed web-startup site for noo-meedja.
<shevy>
add one subtle bug for it
<mparodi>
workmad3, I would say yes unless you think it's impossible to learn Ruby from less than 10% to more than 80% in a couple of weeks :)
stopbit has joined #ruby
mrwalker has quit [Remote host closed the connection]
<bnagy>
shevy: you don't need to
<bnagy>
PHP is self bugging
w400z has quit [Quit: Computer has gone to sleep.]
<shevy>
depends... you can learn the basics of ruby in 3 days
<JonnieCache>
to knock out a rails website you dont actually need to know much ruby at all
<shevy>
but to really learn everything ruby has to offer... 2 weeks would seem not enough
<workmad3>
mparodi: and, more importantly... do you have time, as a group of 14 (which is quite a large team) for all of you to learn how to work as a good team, while all also learning a new language and also implementing a project
vlad_starkov has joined #ruby
<workmad3>
mparodi: couple of weeks... that's probably enough to learn a good 10% of what ruby has to offer
<mparodi>
it has been done before...
<shevy>
mparodi, today I learned about remove_instance_variable()
<JonnieCache>
i had to do a project like that at uni with about 6 people. it sucked. i ended up having to do 80% of the work because they were useless
berserkr has quit [Quit: Leaving.]
<shevy>
hahaha
<shevy>
I know how that goes...
<shevy>
we were four and everyone had to finish 25% of the same project
<Hanmac>
shevy whats ruby ... even if you think you know everything, it has a function you dont know
<workmad3>
mparodi: I'm not asking 'has it been done with a different team', I'm asking do *you* have time
<Spooner>
That is higher education for you, JonnieCache, it prepares you for the real world of work, where you will always have to carry the idiots.
<JonnieCache>
to be fair it was a software engineering class so that was kind of the point - getting experience working in a team with people you dont choose
chimkan has quit [Quit: chimkan]
<shevy>
somehow you would think that 4 * 25% would equal 100%, but somehow we never finished completely...
<workmad3>
mparodi: different teams, with different people, do something shocking... they work *differently*
<mparodi>
<workmad3> mparodi: I'm not asking 'has it been done with a different team', I'm asking do *you* have time <- me? yes
awarner has joined #ruby
<workmad3>
mparodi: 'you' in the sense of 'your group'
<shevy>
oh yeah I learned something... don't rely on others when you want to get things done (unless you constantly kick them in the nuts, then things could proceed...)
<workmad3>
mparodi: when talking about teams 'you' is always a collective you
<shevy>
ok
<shevy>
mparodi will do 100% of the work in ruby
<shevy>
:)
<shevy>
let the others write in java
dhruvasagar has quit [Ping timeout: 255 seconds]
<Spooner>
I remember that my project team refused to consider SVN (it was a while ago :D) and decided that emailing a .zip was the most efficient way to collaborate. Those were the days!
<shevy>
you'll need only "0% of the code they need
<shevy>
20%
iamjarvo has joined #ruby
<workmad3>
shevy: the learning curve is asymtotic :)
<shevy>
yeah so he better get started today
<mparodi>
<Spooner> I remember that my project team refused to consider SVN (it was a while ago :D) and decided that emailing a .zip was the most efficient way to collaborate. Those were the days!
<mparodi>
lol
<shevy>
mparodi, go start learn ruby now
maxmmurphy has joined #ruby
<shevy>
Spooner my team also thought that emails would be great
<workmad3>
mparodi: you don't need to repeat someone's entire sentence to reply btw...
<mparodi>
(it happened to me too >_>)
<shevy>
but one guy in my team never replied at all...
<banisterfiend>
shevy: u have a team? ppl pay for u to write code? :P
noyb has quit [Quit: Leaving.]
<Hanmac>
git or hg are VERY better then svn
<shevy>
banisterfiend was not for programming
<JonnieCache>
mparodi: you might be best off with java then. if they wont even accept SVN over zipfiles they're not going to like ruby over java
<banisterfiend>
shevy: ah, then maybe it made sense not to use version control ;)
<shevy>
the only thing I could have done related to programming would have been to populate excel files via ruby
<Spooner>
hanmac No, they were not. Not having been implemented at the time makes them infinitely worse than SVN!
<workmad3>
Hanmac: they are... but they also have a steeper learning curve, especially if you're coming from no SCM
<Muz>
shevy: win32ole!
<shevy>
Muz ewwwwww
<mparodi>
JonnieCache, it is, in fact, the same kind of "software engineering class" you had
<Hanmac>
svn its a bit monotheism imo ...
nari has quit [Ping timeout: 252 seconds]
<workmad3>
Hanmac: and in fairness, sometimes SVN is a good tool
<JonnieCache>
mparodi: theyre asking you to do the whole waterfall development model right?
<Spooner>
I'm not suggesting anyone should use it any more. It was better than the alternative at the time (CVS or some other ancient crap).
<JonnieCache>
with pages and pages of UML?
Nanuq has joined #ruby
<workmad3>
Spooner: visual sourcesafe!!!
<Spooner>
UML! What a great joy.
<Spooner>
Oh yeah, I used that at work a few years later. At uni, however, noone was really interested in any tools that weren't taught (and graded) in the class.
<workmad3>
Spooner: visual sourcesafe to store all your diagrams from your UML CASE tool :D
carlyle has joined #ruby
<JonnieCache>
so many hours of my life wasted doing UML. the fact that it took place in my youth, which is apparently the most valuable time you get, is just salt in the wound
<peterhellberg>
IBM Rational ClearCase!
<mparodi>
JonnieCache, yes, from the very beginning... analysis, design, development, testing, etc, etc, etc. all of that well documented in endless documents
sspiff has quit [Ping timeout: 260 seconds]
<workmad3>
mparodi: yay, you have a software engineering course that is about 2 decades out of date :D
<shevy>
oh god
<Spooner>
workmad3 Yep, I did exactly that at work :) Amusingly, I had to correct my bosses UML, but then he explained that it was generated for appearances, not because it was useful, so it being right was pointless :D
habib has quit [Read error: Operation timed out]
<mparodi>
workmad3, how does it work nowadays?
<JonnieCache>
workmad3: its still wanted by BigCorps and theyre the ones that dictate university curricula
<shevy>
(1) you get the problem (2) you solve it (3) you sit on the beach and relax
<shevy>
JonnieCache :(
<shevy>
ZOMBIE CODERS
<JonnieCache>
agreed
<workmad3>
mparodi: seriously? you want me to in effect give you a 3 month university course in a few minutes over IRC???
<mparodi>
I would say it's not the correct approach with big projects
<workmad3>
mparodi: and I *know* this stuff is at least a 3 month university course... because I've actually taught agile methods @ uni, in a 6 week course and that was barely enough to give the essentials
LBRapid has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
sspiff has joined #ruby
sspiff has joined #ruby
<bnagy>
agile is wank
<mparodi>
yep, it's a 4 month course in fact
uris has joined #ruby
strnx has quit [Excess Flood]
verbad has quit []
<JonnieCache>
shevy: they merged rails 2 with merb 1 to make rails 3. it actually reduced the codebas substantially though
<JonnieCache>
*codebase
<shevy>
ok
<shevy>
but I mean rails-0.x or something like that
<shevy>
I really forgot how rails started
andrewhl has quit [Remote host closed the connection]
<workmad3>
JonnieCache: some bigcorps still want it, but fewer, and there's a lot of medium businesses that want agile skills... a lot of leeds and yorkshire won't touch CS graduates for example, because they need to untrain them too much, they'd rather just get other science and engineering graduates and train them properly
* Hanmac
has multible projects ... all of them are "rails-size" :P
<JonnieCache>
workmad3: yeah its a joke. CS courses are so pointless. fortunately I worked that out early and spent most of my time doing stupid shit, and only went to the good lectures
statarb3 has joined #ruby
statarb3 has joined #ruby
<JonnieCache>
not to say all CS courses are pointless. just most of them
joshman_ has joined #ruby
<shevy>
hehe
<workmad3>
JonnieCache: most of them have a point... but the point isn't software engineering
<shevy>
not all girls are evil. just most of them
<hoelzro>
workmad3: indeed
w400z has joined #ruby
<workmad3>
JonnieCache: it's dubious (IMO) whether most CS courses even need to bother teaching programming... it's not really needed for a lot of academic CS work
<bnagy>
if CS is preparing you for vocational programming then it's a stupid course
<workmad3>
JonnieCache: and it's something that CS courses aren't very good at teaching :)
<bnagy>
that's why they put the 'S' in there
<JonnieCache>
my CS degree wasnt a proper one at all tbh
<JonnieCache>
thinking back, actual Computer Science was a minority of the material
<bnagy>
if you want to get a job you can just take a 3 week rails bootcamp and buy a clipon tie
<workmad3>
JonnieCache: a lot of my CS degree was actual CS... logic, language theory, database theory, formal methods
havenn has joined #ruby
twinturbo has joined #ruby
<workmad3>
JonnieCache: I even did a quantum computing course, that was sort of interesting :)
<hoelzro>
workmad3: that sounds pretty cool
<workmad3>
hoelzro: large amounts of linear algebra
<hoelzro>
I'm pretty happy with my CS education
<hoelzro>
we covered a lot of useful, as well as interesting, stuff
_bart has quit [Read error: Operation timed out]
<JonnieCache>
yeah we did cover all that stuff. there was SO MUCH crappy software engineering stuff, and really basic courses about networking etc
baroquebobcat has joined #ruby
<bnagy>
that is the best prank ever, whoever came up with that is a genius
<workmad3>
hoelzro: the only problem was I didn't realise it was linear algebra until just before the exam... I'm pretty good at linear algebra, but I had issues with the notation :)
<JonnieCache>
in the second and third year it was a lot better
vlad_starkov has quit [Remote host closed the connection]
<bnagy>
quantum computing == ambush linear algebra
<workmad3>
JonnieCache: first year tends to be an 'equalizer'
burgestrand has joined #ruby
<workmad3>
bnagy: quantum physics is masses of linear algebra
<JonnieCache>
quantum physics is supposedly just probability theory with complex numbers
<bnagy>
odds of ever seeing a quantum computer -> 0, odds of needing linear algebra, though?
<workmad3>
bnagy: however, it's complex linear algebra (as in, complex numbers)
<JonnieCache>
i cant verify that though :)
<JonnieCache>
workmad3: I did get to do a lot of cool stuff though, like music technology, generative creativity, and robotics
cantonic has quit [Read error: Operation timed out]
<workmad3>
JonnieCache: there's probabilities that come into play when doing observations, and there's transformations that are linear (and I think, some non-linear) algebra on phase spaces for the system as the system evolves without observation
jjbohn has joined #ruby
w400z has quit [Quit: Computer has gone to sleep.]
<workmad3>
JonnieCache: and there's some really, really weird results that come out of it as a whole :)
kevinbond has joined #ruby
<workmad3>
bnagy: they have built some quantum computers... but yeah, I'm doubtful they'll become household items anytime soon
<joesavage>
I'm creating a client-side search system which utilises a Ruby-generated XML file. I don't want to put the content for every article inside this XML file (people could easily duplicate my content, view without advertisements elsewhere, etc), but I need some indication on the words used in the article so the search is actually useful. Is there any easy way to pick out keywords from a large section of text, easily, using Ruby?
kevinbond has left #ruby [#ruby]
<JonnieCache>
i love physics. it blows my mind. i watched a thing about black hole entropy the other day and I had to go and have a lie down
<workmad3>
bnagy: but then, they said the same about normal computers only about 50 years ago...
<workmad3>
JonnieCache: ditto :D
<workmad3>
JonnieCache: relativity is, IMO, almost as mind-blowing as quantum physics, but it's the quantum stuff that gets the reputation for strangness
<JonnieCache>
workmad3: i only recently worked that out. relativity is easier to understand but the implications are harder to see
<JonnieCache>
thats why black hole entropy is so mad: it sort of combines the two. and it brings entropy into it just to seal the deal :)
<workmad3>
JonnieCache: I love the idea that, at the speed of light, time and distance become almost meaningless
sailias has joined #ruby
GoBin has joined #ruby
davidpk has joined #ruby
mockra has joined #ruby
<bnagy>
uh
<workmad3>
joesavage: I'm not sure that semantic reasoning technology is at the point where any programming language has the capabilities to usefully pick out keywords in large sections of text
<JonnieCache>
workmad3: well massless particles dont really travel at all. they really even exist as objects as I understand it, theyre just pairs of events, emission and absorbtion
<bnagy>
which is why 'search engines' will never take off
<joesavage>
workmad3: Darn - I don't really want to have a massive array or hash or something which contains the count for different words -- do you have any suggestions for any kind of solution to my problem?
<JonnieCache>
s/really/dont really
sspiff has quit [Remote host closed the connection]
<workmad3>
bnagy: search engines have a different problem ;)
<JonnieCache>
tbh youd be best off getting an intern to do it or something
<workmad3>
I guess if you had a large body of pre-categorised content, you could actually do some reasoning by doing some comparison with the existing content to try and figure out categories
<workmad3>
wouldn't surprise me if that's the sort of stuff google does at times :)
kpshek has quit []
<workmad3>
but then... not many people have either the dataset or the computing resources of google to hand...
nari has joined #ruby
ryh has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
sernin has joined #ruby
mneorr has quit [Quit: Leaving.]
jonathanwallace has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
verto|off is now known as verto
bsp has joined #ruby
mockra has quit [Remote host closed the connection]
moshef has quit [Read error: Connection reset by peer]
Synthead has joined #ruby
SCommette has joined #ruby
moshef has joined #ruby
moshef has quit [Client Quit]
jimeh has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
yakko has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
Cache_Money has joined #ruby
macer1 has joined #ruby
<macer1>
hi
<macer1>
how can I decrypt des md5 salted msg in ruby?
<macer1>
I tried but failed
<Spooner>
macer1 : Paste up the code you have failed with?
<workmad3>
otters: not saying you don't have a point... it gets a bit annoying in python for that (although it was less annoying than I thought it would be when I did some python), but dissing on 'whitespace sensitive' leaves openings in the argument
ukwiz has joined #ruby
<otters>
okay
<otters>
to be fair, haskell is the same way, but it doesn't annoy me there
deryl has joined #ruby
<Spooner>
I find it actually quite nice in YAML/HAML/Slim to have indention meaningful.
<otters>
Perhaps because Haskell is functional
<ukwiz>
how do I force all access to ruby on a system (opensuse) to use 1.9?
<sernin>
Remove all other versions?
<bnagy>
hhah opensuse
chimkan_ has quit [Ping timeout: 260 seconds]
<otters>
Nature, uh, uh, uh, finds a way.
Goles has quit [Quit: Computer has gone to sleep.]
<ukwiz>
I was told that it is a bad idea to remove the "system installed" version
ananthakumaran has joined #ruby
<sernin>
but in essence you're overriding the 'system installed' version by forcing 1.9
<sernin>
so that point is moot
<bnagy>
well you can either use an OS package that is up to date, or use rbenv / rvm etc
<deryl>
you could use rvm as well in a multi-user install configuration. You can force root to use a specific RVM controlled ruby as well, BUT that is NOT a supported configuration. (Most distribs still default to using 1.8.7-p### for the *system* ruby, which means any 1.9 specific code will not work and can cause problems.)
revans has joined #ruby
<_bart>
Spooner: heh I get it now, it was pretty stupid, but I didn't noticed because [a|b], does select a or b just like (a|b) does but also '|'. :p
<bnagy>
if you use rvm as a system install you have a very high chance that everything will be Just Fucked
<bnagy>
rbenv handles that better, you can just link it into usr local or wherever
aganov has quit [Quit: aganov]
<deryl>
bnagy: exactly. which is why its not a supported config by the Project
<bnagy>
or just use ruby-build directly
<deryl>
well, its no less of a chance with rbenv than with rvm.
<Spooner>
_bart : Yeah, it works with single-character sets (sort of). I hope you find (?:xx|yy) useful in the future though.
<bnagy>
personally, I'd use ruby-build directly into usr local, but ymmv
<bnagy>
tbh I don't like forcing a system version
<deryl>
me either
chimkan has joined #ruby
<ukwiz>
bnagy: I am thinking more of things like apache
<Spooner>
deryl I found someone only yesterday, using yum on CentOS, that had Ruby 1.8.5 :)
strife25 has joined #ruby
<deryl>
Spooner: damn!
<shevy>
hehe
<bnagy>
isn't apache a user?
<deryl>
bnagy: on most systems its run under www-data
<ukwiz>
yes...
<deryl>
or 'nobody'
<bnagy>
not to mention, I would normally run apache chroot :P
<Spooner>
deryl It mostly worked, but had odd bugs where gems actually tried to do anything clever :)
<shevy>
weakling!
<shevy>
ALL POWER TO THE APACHE
<deryl>
Spooner: hehe
rutkla has joined #ruby
<deryl>
or the gems were using something that old a version of ruby didn;t support (e.g new hash syntax etc)
<deryl>
is it etcetera or ectera (etc or ect)
<sernin>
it is etc
<bnagy>
etc
<deryl>
always get that confused
<bnagy>
et cetera and others
<deryl>
got it :) thanks
<bnagy>
don't they teach latin in schools these days?
<deryl>
nope. I'm 41. haven't been in school in ages hehe
<sernin>
technically
<sernin>
et alia is 'and others', referring to people
<Spooner>
deryl : I think it was something like instance_variable_get, which was introduced in 1.8.6 back when Adam was a lad.
<deryl>
and they definitely don't teach it in the Army unless you go to the Defence Language Institute
<sernin>
et cetera is 'and other things'
<deryl>
Defense
<bnagy>
sernin: that would usually be inter alia
<deryl>
Spooner: ahh yeah that would cause issues
<deryl>
sernin: oo. believe it or not i've never heard of et alia
<ukwiz>
if you remember et is and, then you should always get it right
<bnagy>
cetera is closest to 'the rest' but pff colloquial translation
jjbohn has quit [Ping timeout: 260 seconds]
<sernin>
inter alia is 'among' others. :)
jonathanwallace has quit [Remote host closed the connection]
GoBin has quit [Quit: Verlassend]
<bnagy>
sernin: yeah, and is also a latin phrase that is used as opposed to one you made up to try and look smart
mneorr has joined #ruby
<bnagy>
but whatever gets you hard, bro
<sernin>
bnagy: et al. ?
jjbohn has joined #ruby
robbyoconnor has joined #ruby
arkiver has quit [Quit: Leaving]
<bnagy>
sernin: that is an extremely good point and I retract my earlier statement
<ukwiz>
I am trying to use rvm, but want to ensure that things like apache, cron jobs, etc use 1.9.3
<deryl>
now that one i know. et al means 'everything' right?
<bnagy>
ukwiz: honestly, don't
<bnagy>
no, it means what sernin said before, just abbreviated
jprovazn is now known as jprovazn_away
<deryl>
ukwiz: dude, I was (and am still listed as) part of the RVM project and I will tell you, bnagy is correct. don't.
<sernin>
ukwiz: that'll probably cause subtle and unexpected breakage. package maintainers assume things about the state of other packages in the distro
<deryl>
sernin++
fearoffish has joined #ruby
<deryl>
doesn't opensuse have something similar to debian's update-alternatives?
<bnagy>
what does suse use, anyway? yum?
ecksit has quit [Quit: Laters.]
shevy has quit [Read error: Operation timed out]
<deryl>
OS has ruby19 packages so wouldn't he be able to install those and then update-alternatives to point the main ruby at the 1.9?
<bnagy>
that is the Hanmac Approved Method I think
<deryl>
bnagy: I believe it does. like centos
nateberkopec has quit [Quit: Leaving...]
SQLStud has joined #ruby
tomb_ has joined #ruby
<deryl>
but if nothing else its still rpm, so he could d/l the pkgs on his own and install using rpm directly
<deryl>
its the symlink changes i am not sure how he'd do
<bnagy>
:(
<bnagy>
it all sounds like shit
<deryl>
its pkgs so, you're right :)
robbyoconnor has quit [Remote host closed the connection]
statarb3 has quit [Quit: Leaving]
cbuxton has joined #ruby
robbyoconnor has joined #ruby
mikepack has joined #ruby
berserkr has joined #ruby
<deryl>
damn, its not until you cut the crap out of it that you realize just how much you use your middle finger when typing. just popped the damned seal again, it feels like.
<macer1>
hah, fixed my des enc
<deryl>
nope, no blood, but damned sure hurts tapping keys with it
<macer1>
first, md5::digest not hexdigest and iv and key are same(key[0..8])
nateberkopec has joined #ruby
_bart has quit [Ping timeout: 240 seconds]
<Synthead>
is there a way to test if a is either 'this' or 'that' in a way other than a == 'this' or a == 'that' ?
<bnagy>
['this','that'].include? a
<hoelzro>
Synthead: ['this', 'that'].include? a
<bnagy>
WINS
<hoelzro>
jynx
<deryl>
lol
<deryl>
hot on the heels of each other
<otters>
how much overhead is that?
davidcelis has quit [Quit: K-Lined.]
<deryl>
as in execution speed of the check? idk
canigetawitness has quit [Quit: leaving]
monkegjinni has joined #ruby
linduxed has quit [Quit: WeeChat 0.3.7]
<macer1>
what is the most pretty way to md5 something 5 times :P?
<deryl>
open pry and require benchmark and test
<workmad3>
Synthead: or even a =~ /th(is
<workmad3>
|at)
<workmad3>
(except without the newline, obviously :P)
<deryl>
workmad3: doesn't that do a replace though?
<hoelzro>
macer1: inject?
<workmad3>
deryl: no
<hoelzro>
macer1: why would you want to, though?
<Synthead>
workmad3: ahhh, that's more what I was thinking, haha
<Synthead>
a = 'that'; a =~ /(this|that)/ returns 0. why?
<bnagy>
macer1: it might, but you need to check the value of digest
<otters>
it's the vertical bar
<ukwiz>
bnagy: yes it is shit, which is why I am still using python for most things rather than ruby. unfortunately things like sass need ruby, as does tracks which I am using
<hoelzro>
is _ a special variable in Ruby, or just a convention?
<workmad3>
otters: yeah, it is... it's just above return on this kb
<macer1>
@_@
<hoelzro>
|a,| would also work, right?
<otters>
same
<workmad3>
hoelzro: it's a bit of both :)
Stalkr_ has joined #ruby
<hoelzro>
workmad3: oh? in what way is it special?
<macer1>
how to do this with inject?
<workmad3>
hoelzro: _ stores the result of the last expression, at least in IRB
<workmad3>
hoelzro: but I tend to use it for a block param I want to ignore :)
<hoelzro>
(1..5).inject(data) { |a,| md5 a }
<hoelzro>
macer1: ^^
<hoelzro>
workmad3: we use it for that in Lua as wel
<hoelzro>
*well
Jay_Levitt has joined #ruby
<macer1>
looks like works
<bnagy>
macer1: where md5 is probablt Digest::MD5.hexdigest( a )
w400z has quit [Read error: Connection reset by peer]
w400z has joined #ruby
chimkan has quit [Quit: chimkan]
<hoelzro>
perl isn't *that* bizarre =)
<bperry>
I like malbolge
<hoelzro>
don't forget that Ruby has Perl heritage =)
maxmmurphy has joined #ruby
<hoelzro>
bperry: heh
Morkel has joined #ruby
<otters>
yeah, well, I have ape heritage
<otters>
but I don't go around blabbing about it
<bperry>
a teacher was getting on to me in high school for not doing a paper, and I told her I would rather rewrite linux in brainfuck than write her paper
dhruvasagar has joined #ruby
<bperry>
got detention :(
verbad has joined #ruby
benson has joined #ruby
<bperry>
GO FIGURE
GlenK has joined #ruby
<otters>
for saying "fuck"?
<bperry>
probably that and being disrespectful and not doing the work she asked me to
<GlenK>
hi. is there a difference between collect and map?
davidcelis has joined #ruby
<hoelzro>
GlenK: I think they're synonymous
<GlenK>
k, thanks.
<otters>
collect is named so for the *ect family of methods
burgestrand has quit [Quit: Leaving.]
Morkel has quit [Client Quit]
stkowski has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
<hoelzro>
I thought it was because Smalltalk had collect?
<otters>
wouldn't know
<otters>
collect, reject, accept, select
<otters>
or whatever the hell it is
<banisterfiend>
otters: 'accept' ? :)
<otters>
it almost ends in ect
kvirani has quit [Remote host closed the connection]
<otters>
whether it's an Array method or not I do not remember
<hoelzro>
banisterfiend: accept == select, iirc
<otters>
accept doesn't exist after all
<hoelzro>
oh, sure enough
<otters>
inspect, then
kevinbond has left #ruby [#ruby]
skrite has quit [Quit: WeeChat 0.3.7]
bradhe has quit [Remote host closed the connection]
hoelzro is now known as hoelzro|away
verbad has quit [Quit: Computer has gone to sleep.]
ttilley is now known as ttilley_off
robbyoconnor has quit [Remote host closed the connection]
w400z has quit [Read error: Connection reset by peer]
w400z has joined #ruby
devdazed has joined #ruby
chimkan_ has joined #ruby
w400z has quit [Read error: Connection reset by peer]
banghouse has joined #ruby
<macer1>
how can I get a fully hex dump of byte string
<macer1>
because it is dispalying half hex half ascii
w400z has joined #ruby
<macer1>
and I want to paste this to some hex editor
havenn has quit [Remote host closed the connection]
thisirs has joined #ruby
robotmay has quit [Remote host closed the connection]
<macer1>
thanks
w400z has quit [Read error: Connection reset by peer]
<macer1>
anyone here was using bindata? I have a small problem with number
w400z has joined #ruby
w400z has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Read error: Connection reset by peer]
w400z has joined #ruby
eph3meral has joined #ruby
Z_Mass has joined #ruby
<eph3meral>
so I'm trying to do a simple HTTP get request, but the URL that I'm hitting, when I go to it in my browser, automatically has me download a file
wallerdev has quit [Quit: wallerdev]
<eph3meral>
is there a way to have ruby's Net::HTTP class detect that the browser is trying to have me download a file and do so also?
bsp has left #ruby [#ruby]
crankyco_ has joined #ruby
crankycoder has quit [Read error: Connection reset by peer]
Beoran_ has quit [Ping timeout: 252 seconds]
<GlenK>
so I was sorta expecting this to work on an array of strings: "words.sort {|a, b| a.length < b.length}" Ha, it's not of course.
<macer1>
how to decode this? ""\x18\e\x9D\x1C\xE3\xBE}W" it is actually 10 and linuks
<macer1>
actually rest of the string decodes normally to utf-8
<macer1>
which is weird
<bnagy>
GlenK: words.sort_by &:length
Fretta has joined #ruby
<GlenK>
bnagy: assuming I wanted to do it the way I'm trying, what's going wrong there?
<bnagy>
use <=> not <
jeff_sebring has joined #ruby
wallerdev has joined #ruby
jblack has quit [Ping timeout: 264 seconds]
brianpWins has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
kevinbond has joined #ruby
darren_ has joined #ruby
crankyco_ has quit [Read error: Connection reset by peer]
minijupe has joined #ruby
ph^ has joined #ruby
lorandi has quit [Quit: Leaving]
<GlenK>
bnagy: thanks
w400z has quit [Quit: Computer has gone to sleep.]
Araxia has joined #ruby
carloslopes has quit [Quit: Leaving.]
<joesavage>
How can I make use of something like pygments to highlight certain code snippets in a static site generation system where I have access to Ruby helper methods like Frank [https://github.com/blahed/frank]?
crankyco_ has joined #ruby
w400z has joined #ruby
anderse_ has quit [Quit: anderse_]
<banisterfiend>
joesavage: ruby has coderay
cbuxton has quit [Ping timeout: 260 seconds]
<macer1>
can ruby be included in osx .app?
<macer1>
in the Frameworks or something
artOfWar has joined #ruby
<joesavage>
banisterfiend: I'll take a look into Coderay then, but as far as I'm aware my problem is the same - how can I make use of the syntax highlighting that Coderay offers to highlight certain code snippets in my articles in a system like Frank?
<JonnieCache>
a very gimmicky percussion instrument :)
TPFC-SYSTEM has joined #ruby
lunitikcalm has joined #ruby
bradhe has joined #ruby
d3vic3 has quit [Quit: leaving]
maletor has joined #ruby
lunitikcalm has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
lunitikcalm has joined #ruby
<joesavage>
banisterfiend: CodeRay.scan seems to scan individual files, but how can I make it scan my whole article and only highlight the code snippets?
<JonnieCache>
joesavage: put the code snippits inside some kind of tags
cbuxton has joined #ruby
<banisterfiend>
joesavage: it scans strings
Squarepy has quit [Read error: Connection reset by peer]
<JonnieCache>
there is a good railscast on syntax highlighting
<JonnieCache>
its not specific to rails
<jarek>
Hi
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
<jarek>
is there something like console.dir() from JavaScript in Ruby?
<joesavage>
JonnieCache: I can put the snippets in HTML tags, but how can I target these sections? I can't just call coderay.scan on the whole "yield"
Squarepy_ is now known as squarepy
<banisterfiend>
jarek: present directory, or what?
<banisterfiend>
jarek: maybe u want: Dir.pwd
<joesavage>
banisterfiend: I need it to scan for all the code snippets in an article though, I can't just use CodeRay.scan to surround every code snippet
<JonnieCache>
joesavage: put them in <code> tags and then grab them out using nokogiri
havenn has quit [Remote host closed the connection]
<jarek>
banisterfiend: I would like to see all properties and methods of an object (including those that were inherited)
<JonnieCache>
but i think coderay does that anyway tbh
<joesavage>
JonnieCache: I was rather hoping CodeRay would do it automatically, I wouldn't know how to do it using nokogiri, but I can't find out how
<banisterfiend>
jarek: is this inside the repl? or just in a program?
<macer1>
actually the email is linukstesting1@gmail.com
<macer1>
this is weird
<_br_>
wth
<macer1>
yeah :)
<_br_>
is this some utf8 vs utf16 issue?
jlogsdon has joined #ruby
<macer1>
no
<macer1>
it is originally utf8
oddmunds has joined #ruby
jarred has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
adamkittelson has joined #ruby
<eph3meral>
ok, so I've been googling for a bit, but I don't see any immediate/apparent solution aside from possibly trying to clean this JSON myself with regex
<eph3meral>
but, that seems... well.. problematic at best
<macer1>
maybe it is something with openssl -.-
mrsolo has quit [Quit: This computer has gone to sleep]
awarner has quit [Remote host closed the connection]
Bosma has joined #ruby
verbad has joined #ruby
cj3kim has quit [Client Quit]
<_br_>
eph3meral: Hm, maybe its a serialization issue? I'm not sure how you are transporting it from ruby to python. Why don't you shoot with msgpack at it?
<_br_>
Sorry, not sure where to ask this otherwise. In the HTTP protocol, am I correct in assuming that accept header tells the server what the client wants to hear (e.g. application/json) and content-type tells the server what the client sends the server (e.g. application/xml) ? (building a rest api at the moment)
mrsolo has joined #ruby
jarek_ has joined #ruby
ephemerian has joined #ruby
jarek_ has quit [Changing host]
jarek_ has joined #ruby
jarek_ has quit [Client Quit]
t0mmyvyo has joined #ruby
jarred has quit [Ping timeout: 246 seconds]
qwerxy has quit [Ping timeout: 252 seconds]
<GlenK>
Can someone help me out here? http://www.fpaste.org/ej7o/ I'm kinda lost. so far I added the "pair[0] + " " + pair[1] part.
<GlenK>
I was thinking that would get passed to yield, but I just get an empty array being spit out.
bier has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
<Spooner>
GlenK You can just do array.map {|a| a.join " " } but maybe that isn't your intention
paolooo has joined #ruby
<GlenK>
Spooner: yeah, it's an exercise from this rubymonk website. I'm not supposed to use map.
<eph3meral>
_br_, der, python? :)
<Spooner>
Oh I see. You aren't actually modifying result at all.
<eph3meral>
hmm, what's message pack?
bricker88 has joined #ruby
<eph3meral>
basically the issue is that this JSON has a bunch of "blank commas"
<Spooner>
You probably want result << yield(pair)
<GlenK>
Spooner: ha. now I real real stupid
<eph3meral>
arrays like [,,,"hello",,0,,,,,,102010010,,]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<eph3meral>
which, are well formed, but still, there's nested arrays, it's kind of a mess
<eph3meral>
*otherwise* it basically seems to be well formed JSON
<GlenK>
Spooner: thanks.
<eph3meral>
er, except perhaps with the exception of non quoted numbers, though I'm not sure if *everything* has to be quoted in JSON does it?
ProLoser|Work has joined #ruby
sgronblom has quit [Ping timeout: 252 seconds]
<Spooner>
eph3meral: That doesn't look like proper json to me.
test432432425 has joined #ruby
<Spooner>
[nil, ""].to_json => "[null,\"\"]"
<Spooner>
So what those missing values are supposed to be is anyone's gues.
<eph3meral>
Spooner, er, well it's basically not, but... at least it is in fact well formed
<eph3meral>
just wondering if there's a way to parse this that's already established
<eph3meral>
or if I'm gonna have to roll my own
no-1 has joined #ruby
<Spooner>
You can't automatically parse soething that doesn't follow the actual spec :)
wilmoore has joined #ruby
bricker88 has quit [Client Quit]
ttilley_off is now known as ttilley
<eph3meral>
sure, but seems like other folks may have potentially figured this out
<Spooner>
And no, it isn't well formed.
nir has quit [Ping timeout: 255 seconds]
test432432425 has quit [Changing host]
test432432425 has joined #ruby
<eph3meral>
i've seen this is in more than one place
bricker88 has joined #ruby
tcopp has joined #ruby
<eph3meral>
it's regular
<eph3meral>
it's computer parsable
tommyvyo has quit [Quit: Computer has gone to sleep.]
<Spooner>
You _can_ parse it, but that doesn't mean that it is valid json.
<eph3meral>
that's what I mean
<eph3meral>
i didn't say "well formed json"
<eph3meral>
i just said well formed, you're nit picking
<Spooner>
Everything is well-formed according to a schema which isn't a standard :D
oposomme has quit [Ping timeout: 240 seconds]
test432432425 has quit [Client Quit]
apok has quit [Remote host closed the connection]
apok has joined #ruby
wilmoore has quit [Remote host closed the connection]
<Spooner>
But to answer your original query, if you have badly formed json, your only recourse would be to manually convert it to something which is well formed or parse it yourself.
jarek has joined #ruby
wilmoore has joined #ruby
denysonique has joined #ruby
kvirani has joined #ruby
whitedawg has quit [Quit: Leaving.]
br4ndon has joined #ruby
tvw has quit [Remote host closed the connection]
no-1 has quit [Quit: Leaving]
carloslopes has joined #ruby
oposomme has joined #ruby
<Spooner>
I'd guess s.gsub("[,", "[null,").gsub(",,", ",null,") is a simple way to "fix" it, assuming those characters aren't found in strings.
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!]
guillaum has joined #ruby
guillaum has quit [Client Quit]
workmad3 has quit [Ping timeout: 252 seconds]
BlackShadow has joined #ruby
<Spooner>
I love the fact that sensible devs have to spend their lives struggling to compensate for the insensible devs who find it too much of a struggle to follow simple schema :)
<eph3meral>
that's the problem
<eph3meral>
assuming ,, is never found in a string
oposomme has quit [Ping timeout: 265 seconds]
carloslopes has quit [Quit: Leaving.]
nyuszika7h has joined #ruby
carloslopes has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
zemanel has joined #ruby
<heftig>
Spooner: even then those gsubs won't work
<heftig>
this seems to be better: "[,,,,,]".gsub(/([\[,])(?=[,\]])/, "\\1null")
zipace has joined #ruby
Morkel has joined #ruby
jarred has joined #ruby
nir has joined #ruby
wallerdev has quit [Quit: wallerdev]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<Spooner>
Oh wow, yeah, mine really doesn't work :D
linoj_ has joined #ruby
wallerdev has joined #ruby
<Spooner>
I probably should have tested it :$
<eph3meral>
but again, checking that it's not inside a string...
headius has joined #ruby
<eph3meral>
that's just, that's basically impossible without writing a parser
bluOxigen has joined #ruby
Wizek has quit [Ping timeout: 246 seconds]
pdtpatrick has quit [Quit: pdtpatrick]
awarner has joined #ruby
<Spooner>
It isn't text that is likely to be in a string, so you might be alright.
linoj has quit [Read error: Operation timed out]
linoj_ is now known as linoj
br4ndon has quit [Ping timeout: 252 seconds]
jarred has quit [Ping timeout: 246 seconds]
otters has quit [Ping timeout: 255 seconds]
blazes816 has quit [Quit: Leaving]
shashin has quit [Quit: shashin]
Filuren has joined #ruby
_JamieD_ has joined #ruby
Filuren has quit [Read error: Connection reset by peer]
cbuxton has quit [Ping timeout: 246 seconds]
cbuxton has joined #ruby
paolooo has quit [Quit: Page closed]
tommyvyo has joined #ruby
paolooo has joined #ruby
clocKwize has quit [Quit: clocKwize]
Eldariof-ru has joined #ruby
preller has joined #ruby
Filuren has joined #ruby
Stalkr_ has quit [Ping timeout: 248 seconds]
<eph3meral>
yeh, I basically agree
<eph3meral>
if it is in a string, someone is a douchebag :P
tiripamwe has joined #ruby
<eph3meral>
hmm, wow
paolooo has quit [Quit: Page closed]
<eph3meral>
getting an error apparently JSON.parse can't deal with UTF-8
<joesavage>
Quick question, anyone know how to turn line numbers on when using Pygments.rb?
<eph3meral>
or rather, the string I have is ASCII-8bit
havenn has quit [Remote host closed the connection]
chrisja has joined #ruby
jgrevich has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
stefanp has quit [Ping timeout: 265 seconds]
elhu has joined #ruby
voodoofish430 has joined #ruby
jonathancutrell has joined #ruby
<jonathancutrell>
Hey folks.
Hawklord has joined #ruby
<jonathancutrell>
What is commonly accepted as the right way to parse and filter a dom (scraping) in ruby?
<jonathancutrell>
Hpricot I assume.
mrsolo has joined #ruby
SCommette has quit [Quit: SCommette]
<shevy>
ack
<shevy>
XML!!!
otters has joined #ruby
<banisterfiend>
shevy: wanna be friends?
elhu has quit [Client Quit]
<shevy>
does that mean I have to look at pictures you link :(
jbw has joined #ruby
sidusnare has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
ringotwo has joined #ruby
<banisterfiend>
shevy: Yeah.
<sidusnare>
anyone have sugestions for s good quick Ruby 101 book for someone who already knows several programing languages?
<banisterfiend>
sidusnare: 'the ruby programming language'
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
jbohn has joined #ruby
<shevy>
that scares me too much
Eiam has joined #ruby
<sidusnare>
banisterfiend: the oriley book ?
jjbohn|thedarkne has joined #ruby
jjbohn has quit [Read error: Connection reset by peer]
<banisterfiend>
sidusnare: Yeah.
adeponte has quit [Remote host closed the connection]
<banisterfiend>
sidusnare: it's great
chriskk has left #ruby [#ruby]
adeponte has joined #ruby
leembarnes has joined #ruby
Araxia has quit [Read error: No route to host]
kpshek has joined #ruby
Lubinski has joined #ruby
redpanda has quit [Remote host closed the connection]
SCommette has joined #ruby
<banisterfiend>
sidusnare: what languages do u know already?
pdtpatrick has joined #ruby
mparodi has quit [Quit: Leaving]
<banisterfiend>
sidusnare: maybe we can give u a quick scoot through of some of what ruby brings to the table
<leembarnes>
@find eas
centipedefarmer has quit [Quit: This computer has gone to sleep]
paolooo has quit [Quit: Page closed]
sailias has joined #ruby
johnlcox has quit [Read error: Connection reset by peer]
<sidusnare>
banisterfiend: bash php python perl c c++ (in order of proficiency)
jbohn has quit [Ping timeout: 264 seconds]
johnlcox has joined #ruby
<banisterfiend>
sidusnare: weird :P
redpanda has joined #ruby
redpanda has quit [Remote host closed the connection]
<banisterfiend>
maybe not if you're a sysadmin actually
<banisterfiend>
that looks about right for a sysadmin
adeponte has quit [Ping timeout: 248 seconds]
<sidusnare>
yep
RubyPanther has quit [Ping timeout: 240 seconds]
phinfonet has joined #ruby
<Hanmac>
sidusnare if you can python you will learn ruby very easy ... ruby is like pythons little twin-sister
<banisterfiend>
Hanmac: ruby is python's hotter, dirtier younger sister, you can do things to her that python would call the cops on you for trying
<Hanmac>
or like banister said :P
theRoUS has quit [Ping timeout: 264 seconds]
chichou has joined #ruby
chriskk has joined #ruby
redpanda has joined #ruby
chichou_ has quit [Ping timeout: 260 seconds]
havenn has joined #ruby
erratic has joined #ruby
darren_ has quit [Remote host closed the connection]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
chichou has quit [Remote host closed the connection]
<BlackShadow>
Hello ppl! I'm learning python , but when i get to wxPython and trying to create some UI it's very complicated and seems that i never get used to doing it this way, what frameworks in ruby exist so i can compare?
<banisterfiend>
BlackShadow: look into 'shoes' maybe
<Hanmac>
there exist an wxRuby too but imo its outdated
<Spooner>
Now if there is something Ruby fails at, it is having a decent GUI binding.
Asher has joined #ruby
Naeblis has joined #ruby
<banisterfiend>
Asher: hey boy, my bro is in chicago
Naeblis has left #ruby ["Leaving"]
<banisterfiend>
Asher: u should travel out and hang with him, take him for a night on the town and cruise around those obscene american fast food joints eating artificial sugar froth
fermion_ has joined #ruby
<banisterfiend>
together
havenn has quit [Remote host closed the connection]
<davidcelis>
mmmmm, artificial sugar froth
ryh has quit [Remote host closed the connection]
<sidusnare>
I didn't like wxPython, it was simple enough, but wasnt integrated well, didnt trap exceptions
chimkan_ has quit [Quit: chimkan_]
<BlackShadow>
Shoes look much easier, for me.
<Hanmac>
BlackShadow ... i am building an wxRuby rebuild that should work with newest wx ... but it is not finish yet ...
xaq_ has joined #ruby
sgronblom has joined #ruby
ttilley is now known as ttilley_off
Squarepy_ has joined #ruby
xaq has quit [Ping timeout: 260 seconds]
<BlackShadow>
where i can find descriptions for built-in methods and so on, like on docs python i mean, can't find this on a ruby website
Spooner has quit [Ping timeout: 240 seconds]
<matti>
There is a Ruby Documentation web site.
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
xaq_ has quit [Remote host closed the connection]
joesavage has quit [Ping timeout: 245 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Guest56159 is now known as mksm
<eph3meral>
how can I *ensure* that the ENTIRETY of a string is encoded a certain way?
mksm has quit [Changing host]
mksm has joined #ruby
xaq has joined #ruby
<eph3meral>
i keep getting these weird errors when using JSON.parse on a string that I thought was encoded UTF-8
<eph3meral>
but apparently has some ASCII-8bit encoded characters in it?
<eph3meral>
JSON::ParserError: Caught Encoding::CompatibilityError at ',null,null,null,"4bd': incompatible character encodings: UTF-8 and ASCII-8BIT
<eph3meral>
when I puts .encoding on the string I'm trying to parse, it says UTF-8
BlackShadow has quit [Remote host closed the connection]
<fowl>
string#force_encoding
cakehero has quit [Quit: Leaving...]
adeponte 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!]
<eph3meral>
fowl, i tried that, i'm still getting errors
squarepy has quit [Ping timeout: 260 seconds]
sgronblom has quit [Ping timeout: 264 seconds]
fbernier has quit [Ping timeout: 260 seconds]
<eph3meral>
i ran string.force_encoding('UTF-8') and then JSON.parse(string)
ryh has joined #ruby
<eph3meral>
i still get that above error about incompatible encodings
<fowl>
i dunno :x
xaq has quit [Remote host closed the connection]
RubyPanther has joined #ruby
xaq has joined #ruby
johnlcox_ has joined #ruby
BlackShadow has joined #ruby
linoj has quit [Remote host closed the connection]
_bart has joined #ruby
linoj has joined #ruby
jeff_sebring has quit [Quit: Leaving]
kjellski has joined #ruby
redpanda has quit [Remote host closed the connection]
xmesg has left #ruby ["Leaving"]
redpanda has joined #ruby
ttilley_off is now known as ttilley
conor_ireland has joined #ruby
mutexkid has quit [Ping timeout: 240 seconds]
Criztian has quit []
dankest has joined #ruby
cakehero has joined #ruby
johnlcox has quit [Ping timeout: 246 seconds]
jarek has quit [Quit: jarek]
manizzle has quit [Read error: No route to host]
beneggett has joined #ruby
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
Markvilla has joined #ruby
mascool has quit [Quit: leaving]
johnlcox_ has quit [Remote host closed the connection]
mutexkid has joined #ruby
johnlcox has joined #ruby
adeponte has quit [Remote host closed the connection]
xaq has quit [Read error: Connection reset by peer]
havenn has joined #ruby
SeySayux has quit [Quit: SeySayux]
fridim_ has joined #ruby
chussenot has joined #ruby
havenn has quit [Read error: Connection reset by peer]
<sernin>
chicochicote: You'd need to post some code/examples, and I highly suspect that your problem is server configuration, not ruby
<thetabyte>
I need a line of code inside my gem to run conditionally if you are inside the dev environment
<fratello>
can anyone help-me?
<blazes816>
thetabyte: try #rubyonrails
<thetabyte>
It's not Rails
<thetabyte>
It is an independent gem
<blazes816>
oh, sorry, misread
havenn has joined #ruby
tester has joined #ruby
tester has left #ruby [#ruby]
<thetabyte>
No problem. I have a gem that I'm creating. And I want to run a line of code *only* if it's in the gem's development environment, *not* after I've built it
<blazes816>
I'd just set a constant. DEV=true, then check that it exists and is true
<fowl>
fratello: what exactly are you doing there
cascalheira has quit [Remote host closed the connection]
<sernin>
thetabyte: set an environment variable, read it with the ENV hash
<lectrick>
I want to write a "which_is_faster" method, which takes 2 blocks. Is that feasible? :)
<workmad3>
lectrick: you can't take 2 blocks
<workmad3>
lectrick: however, you *can* take two proc objects or lambda objects
<workmad3>
lectrick: which can look reasonable with 1.9 stabby lambda syntax :)
gmci has joined #ruby
<workmad3>
lectrick: e.g. 'which_is_faster ->{this}, ->{or_this}'
<lectrick>
ooooh.
<fowl>
or proc{}
<workmad3>
fowl: or even Proc.new{}, or lambda{} :)
<workmad3>
several different syntaxes... but my personal opinion (which may be because I've had to do far too much coffeescript recently) is for the stabby lambda when you're taking a couple of methods
<lectrick>
I guess I should rename that hi_i_take_2_lambdas eh
yugui_zzz is now known as yugui
<workmad3>
lectrick: 'hi_i_take_2_callables'
<workmad3>
lectrick: because, in fairness, you don't care if it's a proc, a lambda, a method object or what... just that it has a call method, making it a callable ;)
<lectrick>
what if I took a block which contained 2 blocks
<otters>
the word "lambda" is replaced by "->"?
<lectrick>
/lol
<otters>
Is that it?
ph^ has joined #ruby
<workmad3>
otters: not quite
tomb_ has quit [Quit: Computer has gone to sleep.]
<lectrick>
that's mostly it yes. But also, the args are passed differently
<pozic>
I think the whole proc lambda {} is a mess in Ruby.
<banisterfiend>
i thnk c# uses => though
lupine_85 has quit [Excess Flood]
<workmad3>
minijupe: help? with a segfault? wow, you're hopeful
<pozic>
Same with the function call syntax foo(12,"dsds") { dasdasd }
<workmad3>
otters: how about this 'I learnt CS, not CS on my CS course' :D
<otters>
exactly
<otters>
I'd like to see a CS course that teaches coffee fucking script
<minijupe>
workmad3: was in #heroku, they think it's a ruby issue
tiripamwe has joined #ruby
<otters>
pozic: that looks like fairly simple syntax to me
<workmad3>
minijupe: they're probably right
redpanda has quit [Remote host closed the connection]
anderse has joined #ruby
xorgnak has joined #ruby
<pozic>
otters: sure, because you are already used to it.
<banisterfiend>
workmad3: didn't ruby's -> syntax exist before CS's though?
<banisterfiend>
so technically it's CS's fault
<pozic>
otters: it reads great.
<banisterfiend>
though you probably werne't laying blame
<otters>
well, I mean
<pozic>
otters: but that's it.
<otters>
function(arg1, arg2, arg3)
<workmad3>
minijupe: however, segfaults are fracking hard to debug
<otters>
it's C-like
<pozic>
otters: but that's completely different.
<pozic>
otters: the { } part is an argument.
<otters>
yeah
<pozic>
otters: and you cannot have multiple of those, AFAIK.
jimeh has joined #ruby
<pozic>
otters: as such, these are artificial restrictions.
<workmad3>
minijupe: and that's when you can manage to reproduce them locally...
<pozic>
otters: which in turn increase cognitive load.
<otters>
blocks?
nir has quit [Quit: Ex-Chat]
<minijupe>
workmad3: this came up when I "updated" rvm
<minijupe>
I think
<pozic>
Smalltalk is at least consistent.
<otters>
sure, but you can pass lambdas/procs as arguments too
<pozic>
otters: a proc is just a lambda which allows yield?
<otters>
having a built-in block syntax just makes it simpler for the functions that require a single block
<otters>
which is quite a few
lupine_85 has joined #ruby
<pozic>
Seems rather silly to introduce special keywords for that.
anderse has quit [Client Quit]
<workmad3>
otters: heh :) exactly what I was going to say
<otters>
well, yeah, I don't know why there's proc AND lambda
<fowl>
pozic: they also handle 'return' differently
<fowl>
otters: its worth looking into..
<workmad3>
fowl: and lambda checks argument cardinality
<pozic>
fowl: return generates an element in proc?
mneorr has joined #ruby
<fowl>
unless you have ->(*) {}
<pozic>
fowl: like all co-routine implementations do.
<otters>
fowl: I mean, I know the technical reasons, but the philosophy escapes me
<otters>
or rather, I know the differences
sidusnare has left #ruby [#ruby]
wilmoore has quit [Remote host closed the connection]
<pozic>
I don't think Python has special lambdas.
<workmad3>
pozic: no, return in a proc (attempts to) return from the scope the block is defined in, return in a lambda returns just from the block's scope
lunitikcalm has joined #ruby
<pozic>
workmad3: uh, what?
Eldariof-ru has quit []
<pozic>
I will just read the manual, but that sounds like a mess.
<Mon_Ouie>
They are nothing more than lambda functions
<pozic>
Or 'one shot continuations'.
<workmad3>
lambda acts more like a normal method
<pozic>
Yeah, I get it.
<workmad3>
proc acts a bit differently (in as I paraphrase, odd and sometimes annoying ways)
<pozic>
I think I'd prefer delimited continuations :)
<urbann>
hi all
<Mon_Ouie>
Ruby does have continuations and coroutines concepts — see #callcc and Fibers and Enumerator
<urbann>
do anybody know the Thor action for overriding a file?
<pozic>
Mon_Ouie: also delimited ones?
<Mon_Ouie>
I don't know what that is
<TorpedoSkyline>
Hey everyone, I'm trying to figure out this problem with Ruby. The goal is to take the arrays created by the Hero object and combine the names of each hero into a full name. I'm not making this stuff up. XD http://pastie.org/4367234
<pozic>
Mon_Ouie: google knows, basically a generalization of continatuons.
<pozic>
Mon_Ouie: continuations.
akem has quit [Ping timeout: 246 seconds]
<jlogsdon>
@TorpedoSkyline @names.join(' ')?
beneggett has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
pozic: procs are lambdas with non-local returns
<TorpedoSkyline>
jlogsdon, that would be it in def full_name, but what should I be doing in def names?
vlad_starkov has quit [Remote host closed the connection]
<urbann>
now I do remove_file foo.rb and then create_file foo.rb but that is an ugly solution
<TorpedoSkyline>
jlogsdon to then pass the names to the full_name function?
havenn has joined #ruby
<jlogsdon>
why do you need to pass anything to full_name? You have the list of names in @names from the initializer
<jlogsdon>
just use it in the full_names method
<pozic>
banisterfiend: yes, 'one shot continuations' as they are called in the scheme community.
<TorpedoSkyline>
no, it's more of a full on introduction to Ruby workmad3
<workmad3>
TorpedoSkyline: I was meaning the 'really abstract problems' you were referring to :)
andrewhl has quit [Ping timeout: 252 seconds]
<TorpedoSkyline>
workmad3, it's the way they try to explain it though… It was really good until they got to lambdas.
<workmad3>
TorpedoSkyline: ah, fair enough
krz has joined #ruby
ken_barber has quit [Remote host closed the connection]
xaq has quit [Ping timeout: 264 seconds]
ken_barber has joined #ruby
pdtpatrick has quit [Read error: Connection reset by peer]
<workmad3>
TorpedoSkyline: good example problems for blocks and lambdas that fit in with a mostly procedural OO book are quite hard
<TorpedoSkyline>
workmad3, they are hard… I've been beating my head against the wall for a couple days on this section.
<workmad3>
TorpedoSkyline: especially as lambdas and anonymous functions really come from a different style of coding... really useful, but not something you can (IMO) easily build a foundation for out of pure OO
<TorpedoSkyline>
so workmad3, is this something I'll come across a lot in Ruby or is the more of a brain stretch? ;P
<workmad3>
Hanmac: awesome :D
<TorpedoSkyline>
Because I can do a good bit of Ruby code, but this is… weird.
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
<workmad3>
TorpedoSkyline: you'll actually come across blocks a lot in idomatic ruby
<shevy>
method { the_block }
pskosinski has joined #ruby
dankest has quit [Quit: Leaving...]
<shevy>
lambdas you will see less often, blocks a lot
<TorpedoSkyline>
workmad3, Yeah, I use blocks all the time
<workmad3>
TorpedoSkyline: you've probably already come across them a lot without realising... .each {|item| do_stuff} is a block
<TorpedoSkyline>
Everytime I use do each. ;P
<TorpedoSkyline>
Yes
xorigin has quit [Quit: leaving]
<shevy>
.each do
jlogsdon has quit [Remote host closed the connection]
<workmad3>
TorpedoSkyline: lambdas are basically just a way of wrapping a block in an object so you can store it and use it later
revans has joined #ruby
<urbann>
No Thor users here? Is this the right channel to ask questions about Thor ?
* Hanmac
wishs that he could make a proc without an binding ...
<Hanmac>
urbann i think you should ask in an celtic channel :P
Rajesh_ has joined #ruby
<workmad3>
Hanmac: thor isn't celtic
<workmad3>
Hanmac: thor is nordic
<workmad3>
do people not know their pantheons here? :P
* matti
does
macer1_ has joined #ruby
fbernier has joined #ruby
undert has quit [Ping timeout: 248 seconds]
Rajesh_ has quit [Max SendQ exceeded]
* workmad3
hopes he isn't questioned on celtic patheism... he's crap on the celts
<TorpedoSkyline>
ok, thanks workmad3. I'll be around with more questions. ;P
<shevy>
Thor Wauki is fighting Loki on channel 3 right now!
cakehero has quit [Quit: Computer has gone to sleep.]
* matti
looks at shevy and rolls eyes
Rajesh_ has joined #ruby
<macer1_>
hmm, if I have a class a, and b,c,d inherits a how can I make b,c,d have method do_blabla
<macer1_>
by putting it in a?
<macer1_>
I mean
<workmad3>
TorpedoSkyline: ok... once you've gotten your head around lambdas in an OO sense, you can blow/expand your mind by reading about the lambda calculus ;)
<macer1_>
b,c,d have constanst Id
<urbann>
what was the answer on the question?
<macer1_>
and a method to read the id
cakehero has joined #ruby
<TorpedoSkyline>
workmad3, oi. XD
<TorpedoSkyline>
I never took calculus. ;P
<macer1_>
*nevermind*
<workmad3>
TorpedoSkyline: lambda calculus != the calculus of differentiation and integration
<matti>
LOL
Morkel has quit [Quit: Morkel]
jonathanwallace has quit [Remote host closed the connection]
<matti>
workmad3: Are you seriously explaining this to him?
<workmad3>
TorpedoSkyline: there any many different calculuses (calculii?), with calculus being a method of reasoning or calculation
geekbri has quit [Remote host closed the connection]
anderse has quit [Client Quit]
nyuszika7h has joined #ruby
brianstorti has joined #ruby
<workmad3>
matti: not everyone knows this sort of maths
<TorpedoSkyline>
Wow, ok.
<TorpedoSkyline>
This is why people go to college for a computer science degree, matti?
stephenjudkins has joined #ruby
<workmad3>
TorpedoSkyline: I wish my uni had done a course on lambda calculus and functional programming while I was there :(
jamiejackson has joined #ruby
<TorpedoSkyline>
workmad3, I'm still just trying to figure all this stuff out. I had no clue there was such a thing as lambda calculus.
<workmad3>
TorpedoSkyline: if you think you can understand that lambda calculus intro, go for it, it's probably worth a shot :)
<macer1_>
if I have a one class(name it A) and some classes inherits from it, how in method that is in A class get an object of class that inherits class A?
<macer1_>
x.X
<TorpedoSkyline>
I'll give it a shot, I don't know how far I'll get though.
<jamiejackson>
just playing with ruby to try to learn the language. i have a pipe-delimited string i want to split into an array, but i also want to strip leading and trailing whitespace from its members....
<jamiejackson>
i know that's not right (it does the operation, but it doesn't modify the array's members). what's the trick to modifying the array members?
<workmad3>
TorpedoSkyline: if you don't get very far, the important thing to take away is that lambda calculus is a model for computation (there are several models for computation... the one most people are familiar with is the turing machine, which is probably conceptually easier, while the lambda calculus is simpler because it relies on less machinery)
fratello has quit [Quit: Leaving]
<TorpedoSkyline>
ok… That makes sense.
thetabyte has quit [Quit: leaving]
<TorpedoSkyline>
Yeah, it does. Turing require a huge amount to computing power (from what I've heard)
<workmad3>
TorpedoSkyline: 'machinery' in an abstract sense
<workmad3>
TorpedoSkyline: we're talking about abstract models here, not physical constructs ;)
<jamiejackson>
thanks, Hanmac, i need to read up on map, then.
jonathanwallace has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
<TorpedoSkyline>
workmad3, I've only heard of Turing in the sense of a computer that is powerful enough to understand and react to human speech as well as a human.
romain1189 has quit [Quit: romain1189]
<workmad3>
TorpedoSkyline: that's the turing test, not the turing machine ;)
<TorpedoSkyline>
>.<
* TorpedoSkyline
slaps TorpedoSkyline around a bit with a large trout
sevvie has joined #ruby
<workmad3>
TorpedoSkyline: turing turns up a lot... he was a pioneer in computing :)
<TorpedoSkyline>
Thanks for bearing with me workmad3. I have so much I need to study and learn about, but I'm going to stick to it. ;)
cantonic has joined #ruby
<workmad3>
TorpedoSkyline: heh :) it's fun for me to exercise this knowledge at times
i0n has joined #ruby
reuf has quit [Quit: Leaving]
i0n has quit [Changing host]
i0n has joined #ruby
<TorpedoSkyline>
lol ;P
Rajesh_ has joined #ruby
<TorpedoSkyline>
well thanks anyway! I've got to head out, so I'll talk to you all later.
<workmad3>
TorpedoSkyline: if you're not careful, I'll branch off into amateur physics and maths too... you wanted a ramble about affine transformations in linear algebra, right?
<workmad3>
macer1_: with great difficulty... constants are looked up with lexical scope
<Hanmac>
workmad3 it has a turing version too ...
blacktulip has quit [Remote host closed the connection]
<workmad3>
Hanmac: cool :)
<macer1_>
welll what I can use other than constants
<macer1_>
def self.id
<jamiejackson>
workmad3: thanks. does the former syntax have a name?
<macer1_>
?
* Hanmac
want to make an finite state machine engine in ruby ...
<workmad3>
Hanmac: that's the great thing about models of computation... you're able to transform them into each other ;)
<workmad3>
Hanmac: and there are several state machine gems in ruby... AASM, StateMachine...
rakm has joined #ruby
<macer1_>
of course I can make a method def with_id; return sthing + id;end and add this to every class that is a Packet
<macer1_>
but DRY
<Hanmac>
macer1_ you dont need to
<ggreer>
let's say I want a templating language with inheritance, but I don't want to use rails (I'm using sinatra right now). what would be a good templating language to try?
<ggreer>
haml and erb don't seem to have built-in support for partials or inheritance
<macer1_>
Hanmac: what are you proposing?
xorgnak has quit [Ping timeout: 260 seconds]
bbttxu has quit [Quit: bbttxu]
fbernier has quit [Ping timeout: 240 seconds]
<Hanmac>
workmad3 do you know the RPGMaker? i thought it would be funny when all the Events are finite state machines ... :P
zemanel has quit [Quit: zemanel]
wmoxam_ has joined #ruby
TrueColors has joined #ruby
Rajesh_ has quit [Max SendQ exceeded]
jorge has quit [Remote host closed the connection]
<macer1_>
actually the goal is to make method to get the packet contents + id at the end
locriani has quit [Remote host closed the connection]
<TrueColors>
it's the if statement im on about
<workmad3>
Hanmac: several small FSMs can be transformed into one large FSM that encompasses all the small ones (basically, take the starting states for all the FSMs, that's state 1, then transition one state machine, that's state2, and so on until you've exhaustively assigned a single state to all the possible combinations of states)
<TrueColors>
line 2 of my paste.
xaq_ has quit [Remote host closed the connection]
<workmad3>
Hanmac: I'm kinda stuck in an abstract theory mindset at the moment btw :)
cakehero has quit [Quit: Computer has gone to sleep.]
<Hanmac>
TrueColors: $5 =~ /^[[:upper:]]+$/
<TrueColors>
but wouldn't that return true if the string ONLY contained ?
sailias has quit [Ping timeout: 246 seconds]
<TrueColors>
as in the actual ? symbol
ZachBeta has joined #ruby
adeponte has joined #ruby
stkowski has quit [Quit: stkowski]
<Hanmac>
it matchs "ABC" but not "Ab" and no "AB1" and no "1AB"
<workmad3>
TrueColors: no... it would return true if the string consists only of 1 or more uppercase letters
carlyle has quit [Remote host closed the connection]
<workmad3>
(or, more accurately, it'll give you the position of the first match, which will be truthy)
johnlcox_ has joined #ruby
beneggett has joined #ruby
carlyle has joined #ruby
<TrueColors>
hmm...
<Hanmac>
want someone ask me whats the difference between [A-Z] and [[:upper:]] ?
<TrueColors>
that'll be why my $4 used between that if and the end, isn't doing it's thing.
<workmad3>
Hanmac: wouldn't surprise me it [[:upper]] is locale aware
<jamiejackson>
".map(&:strip)" can you point me to the documentation for this syntax? i'm not how/if i would chain methods, as in .map { |i| i.strip.reverse }
johnlcox_ has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
adeponte has quit [Remote host closed the connection]
johnlcox has joined #ruby
TrueColors has quit [Quit: Dear Pringles, now that I am an adult I am no longer able to fit my hand in your tube.]
Lubinski has quit [Quit: Leaving]
jarred has joined #ruby
jarred has quit [Client Quit]
bbttxu has joined #ruby
<workmad3>
lectrick: the better phrasing of Hanmac's objection is 'there isn't conceptually a second pair in a hash, because hashes are conceptually unordered... the fact that 1.9 made the order determinate doesn't mean you should rely on this fact'
thone has joined #ruby
<lectrick>
Hanmac: We are clever today eh
<workmad3>
lectrick: a.k.a. please stop abusing poor, defenceless data structures
<lectrick>
workmad3: LOL ok
_JamieD_ has quit [Quit: _JamieD_]
<jamiejackson>
is there a more shorthand way to populate a hash from an array than the following? h['a'], h['b'], h['c'] = [1,2,3]
mneorr has joined #ruby
<jamiejackson>
maybe a way to factor out the hash's name?
otters has quit [Read error: Connection reset by peer]
<workmad3>
jamiejackson: or, if you have the keys and values in separate arrays, Hash[keys.zip(values)]
otters has joined #ruby
oddmunds has quit [Ping timeout: 255 seconds]
<jamiejackson>
workmad3: nice, i'll look that up, thanks.
<Spooner>
workmad3 : Hash is {} after thhose
thone_ has quit [Ping timeout: 240 seconds]
nfk has quit [Quit: yawn]
<workmad3>
Spooner: damn, I thought it could accept a flat array
<heftig>
needs to be *ary
jlogsdon has joined #ruby
<Spooner>
Ah yeah, that works.
<workmad3>
heftig: ah, thanks :)
<workmad3>
Spooner: [['a',1],['b',2],['c',3]] also works btw
oddmunds has joined #ruby
<Spooner>
I didn't say it didn't :)
<workmad3>
Spooner: :)
<Spooner>
No, I did asy those, implying both the flat and zipped version didn't work, whereas the zipped does, as you say. My mistake.
mneorr has quit [Ping timeout: 248 seconds]
<heftig>
you can either give Hash[] a single array, which must contain key-value pairs; or an even number of arguments, which must be keys and values alternating
<workmad3>
heftig: thanks, I'd forgotten you needed to splat a flat array :)
mneorr has joined #ruby
cjlicata has joined #ruby
tommyvyo has joined #ruby
mneorr has quit [Client Quit]
internet_user has quit [Remote host closed the connection]
cjlicata has quit [Remote host closed the connection]
<Spooner>
While we are being clever with hashes, I have something that works, but seems painfully inefficient: [{prob: 5}, {prob: 2}].map {|h| [h] * h[:prob] }.flatten.sample (that is, pick a random hash, based on relative probabilities defined in those hashes). Any less horrible way to do it?
<Spooner>
It isn't a performance bottleneck though, so I'm not too worried. Just thought there might be a nicer way to do it than produce a huge array :)
kjellski has quit [Read error: Connection reset by peer]
grzywacz has quit [Remote host closed the connection]
kjellski has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
<Spooner>
You would presumably have to start a new Ruby process, unless you need to pass data back to the web request.
<burgestrand>
You could just start a thread in the background to execute the commands.
Banistergalaxy has joined #ruby
stopbit has quit [Quit: Leaving]
mehlah has joined #ruby
<burgestrand>
That way you don’t need to bother about request timeouts, even if rails happens to abort your action somehow.
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!]
mjbamford has quit [Quit: Leaving...]
chichou has quit [Ping timeout: 264 seconds]
TorpedoSkyline has joined #ruby
jasonLaster has quit [Remote host closed the connection]
joshman_ has quit [Read error: Operation timed out]
jasonLaster has joined #ruby
alphabitcity has joined #ruby
urbann has quit [Ping timeout: 240 seconds]
burgestrand has left #ruby [#ruby]
burgestrand has joined #ruby
burgestrand has quit [Quit: Leaving.]
jasonLaster has quit [Read error: Connection reset by peer]
jasonLas_ has joined #ruby
<TorpedoSkyline>
So here's a question. Let's say I have an array that looks like this: ["1","2","3","4"]. Now I want to pair them into a string showing "12" and "34". How would this be done in Ruby?
burgestrand has joined #ruby
<TorpedoSkyline>
Because they're not in their own arrays like [["1","2"],["3","4"]], I'm interested to know this.
Wizek has quit [Ping timeout: 246 seconds]
jasonLas_ has quit [Remote host closed the connection]
jasonLaster has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<delinquentme>
burgestrand, you're saying just as in a normal ruby thread process ... spool them off like that?
bglusman has quit [Remote host closed the connection]
sepp2k1 has quit [Remote host closed the connection]
<delinquentme>
kk burgestrand thanks
ethicalhack3r has joined #ruby
towelrod has joined #ruby
<alphabitcity>
anyone know of a good place to read about error handling in libraries? i'm writing a gem and am trying to figure out the best practices .. i notice some people create classes for each error type
mutexkid has quit [Quit: mutexkid]
dankest has joined #ruby
<ckrailo>
any of yall seeing IPv6 addresses in rack's request after upgrading to mountain lion? (i see 0:0:0:0:0:0:0:1%0) i need to get it back to IPv4...
fridim_ has quit [Ping timeout: 246 seconds]
bowlowni has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
bowlowni has joined #ruby
AlbireoX`Laptop has joined #ruby
jamiejackson has quit [Ping timeout: 245 seconds]
dv310p3r has quit [Ping timeout: 260 seconds]
chichou has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
yfeldblum has joined #ruby
greenysan has quit [Ping timeout: 240 seconds]
<Spooner>
alphabitcity : Not sure, but I'd make sure all my exception classes inherited from MyGemError, so they are easy to catch if the user wants to handle them all together. And don't create new ones for existing problems; only stuff which is specific to your gem.
johnlcox has quit [Remote host closed the connection]
chichou has quit [Remote host closed the connection]
Vert has quit [Ping timeout: 252 seconds]
<alphabitcity>
was hoping for an article of some sort with tips like that :)
chichou has joined #ruby
<Spooner>
And as there, make sure you inherit from StandardErorr, not Exception.
wmoxam_ has quit [Quit: leaving]
Goles has joined #ruby
AlbireoX`Laptop has joined #ruby
emsilva has joined #ruby
<alphabitcity>
ok, will do. thank you
jellosea has joined #ruby
<Spooner>
I'm surprised everyone else doesn't have an opinion though.
DrShoggoth has quit [Quit: Leaving]
mosheeee has quit [Ping timeout: 255 seconds]
<alphabitcity>
any chance you can give me some quick feedback on my approach with this gem? https://github.com/maxstoller/referly … specifically whether you think the proxy approach is acceptable
<alphabitcity>
haven't seen that pattern in many other gems
tiripamwe has quit [Quit: Leaving]
thisirs has quit [Remote host closed the connection]
chichou has quit [Ping timeout: 250 seconds]
verbad has quit [Quit: Computer has gone to sleep.]
<yfeldblum>
is there an option to the csv stdlib in ruby-1.9 to *force* it *never* to quote values? the force_quotes: true option typically means the output will not be quoted if i strip out any special characters beforehand, but it *will* quote any blank values ... is there a way to force the lib *not* to quote any values, even blank values?
johnlcox has joined #ruby
ken_barber has quit [Remote host closed the connection]
<chee>
i'm very bad at thinking in objects, guys
<Spooner>
alphabitcity : the API looks pretty normal. Reminds me of ActiveRecord (which I don't use, so I might be very off the mark :D).
<macer1_>
when I am creating gem, and requiring it in other program all files will be included yes?
baphled has quit [Ping timeout: 248 seconds]
<alphabitcity>
Spooner: great, that's what I was shooting
<macer1_>
or I need in gem to require_relative the files?
<alphabitcity>
Spooner: thanks for looking
<Spooner>
macer1_ : All it does is require the main file (usually lib/my_gem.rb). You still have to require all the other files.
<Spooner>
It will also ensure that lib/ is in the path, so you can use regular require too (but rr is better, of course).
<Spooner>
What do you mean by "good"? Depends what you want it to do :D
ken_barber has joined #ruby
<macer1_>
:/
<macer1_>
oh
<macer1_>
in path you sau
<TorpedoSkyline>
Ok, another question. I've figured this out using other methods besides inject, but here it goes. I have an array: ["emperor", "joshua", "abraham", "norton"] and I want to use inject to combine them and capitalize them. array.inject("") { |result, each| result << " " << each.capitalize } but the problem is that there's now a space at the beginning of this new string.
<macer1_>
say*
<macer1_>
I will try
johnlcox has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
<macer1_>
also if there is lib/mcp/protocol/protocol.rb can I can call in other part of gem require 'mcp/protocol'?
johnlcox has joined #ruby
<TorpedoSkyline>
How does one do this without concatenating a space at the beginning of it? I have my own solution without inject here: http://pastie.org/4367790
<Spooner>
No, because you can't require a directory.
davidpk has quit [Quit: Computer has gone to sleep.]
<macer1_>
Spooner: do you know any good gem examples to look at?
<Spooner>
You could do require_relative "mcp/protocol/protocol" or require "mcp/protocol/protocol"
<Spooner>
Assuming you are doing it in lib/mcp.rb, of course.
<macer1_>
it is more complicated than that
yugui is now known as yugui_zzz
<macer1_>
:D
sent-hil has joined #ruby
jonathanwallace has quit [Ping timeout: 252 seconds]
<macer1_>
lib/mcp/protocol/protocol.rb lib/mcp/protocol/protocol29/packets.rb(this need to require the protocol.rb)
banisterfiend has quit [Remote host closed the connection]
<Spooner>
It would either require "mcp/protocol/protocol" or require_relative "../protocol"
<macer1_>
I asked if that first one
<Spooner>
It is just standard Ruby behaviour, macer1_
TheFuzzball has quit [Read error: Connection reset by peer]
jorge has quit [Remote host closed the connection]
nari has joined #ruby
<TorpedoSkyline>
Spooner, can't use that because the code school requires that I use .inject. I ended up using this: http://pastie.org/4367831
<TorpedoSkyline>
I'm trying another solution using .rstrip!
<Spooner>
If it is for school, why are you asking me to do it for you? :D
lunitikcalm has quit [Remote host closed the connection]
<TorpedoSkyline>
Spooner, not like "education school". I'm doing the RubyMonk thing. ;P
beneggett has joined #ruby
<Spooner>
inject is a pretty poor fit for what you want to do.
<TorpedoSkyline>
It is. It's terrible.
<TorpedoSkyline>
So many better ways to do it from what I'm seeing.
Guest91275 has quit [Quit: Guest91275]
<Spooner>
array.map(&:capitalize).join " " is probably the best way (without considering the names as actual names.
<Spooner>
The way you posted works. As does .lstrip at the end of your original idea.
TheFuzzball has joined #ruby
<TorpedoSkyline>
Spooner, now I'm seeing you use (&:capitalize) and I've never seen that done before.
x77686d_ has joined #ruby
<Spooner>
It is just shorthand for {|s| s.captitalize }
Filuren has joined #ruby
Stalkr_ has quit [Read error: Connection reset by peer]
[Neurotic] has joined #ruby
Filuren is now known as Stalkr_
<TorpedoSkyline>
Spooner
<TorpedoSkyline>
You just blew my mind.
jrajav has joined #ruby
x77686d has quit [Ping timeout: 252 seconds]
x77686d_ is now known as x77686d
x77686d has left #ruby [#ruby]
<TorpedoSkyline>
This school does some terrible stuff.
bowlowni has quit [Remote host closed the connection]
towelrod has quit [Quit: Leaving]
jorge has joined #ruby
conor_ireland has joined #ruby
ylluminate has quit [Ping timeout: 240 seconds]
bontaq has joined #ruby
<yfeldblum>
TorpedoSkyline, you can pass any object you like in the "proc slot", that is, the argument slot which is normally filled up by the block you pass to a method, simply by passing it last in the arguments list and using the & prefix
<yfeldblum>
TorpedoSkyline, the object must only respond to #to_proc, which must return an instance of Proc
<yfeldblum>
TorpedoSkyline, so you can pass a symbol as the last argument, prefixed with &, and the symbol gets passed as though it were the block passed to the method
jgarvey has quit [Quit: Leaving]
jrist is now known as jrist-afk
<yfeldblum>
TorpedoSkyline, ruby will call to_proc on the symbol, which returns a Proc, and ruby actually passes that resulting Proc instance into the method in the proc slot
wallerdev has joined #ruby
<macer1_>
what is an good alternative of jeweler
fantazo has quit [Remote host closed the connection]
<yfeldblum>
macer1_, why not just have a gemspec?
<macer1_>
why not
<Spooner>
macer1_ : I use Gem::PackageTask
<macer1_>
jewler generates outdated dependecies
<yfeldblum>
macer1_, if you run `bundle gem NEW_GEM_NAME` it will make a skeleton gem directory structure, including a good-to-go gemspec template
<macer1_>
oh
<macer1_>
it was there all time? -.-
SCommette has quit [Quit: SCommette]
ryh has quit [Read error: Connection reset by peer]
ken_barber has quit [Remote host closed the connection]
<macer1_>
yfeldblum: big thx
adeponte has quit [Remote host closed the connection]
<yfeldblum>
macer1_, cheers
<macer1_>
my code is working but packaging it to gem is a little hard ;)
ryh has joined #ruby
adeponte has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
ethicalhack3r has quit [Quit: Leaving]
adeponte has quit [Read error: Connection reset by peer]
SQLStud has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
adeponte has joined #ruby
<Spooner>
It is a little fiddly at first, but you get used to it.
<TorpedoSkyline>
yfeldblum, thanks. I'm going to have to read that over a couple times, but I'll get it. ;P
TomRone has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
burgestrand has joined #ruby
<Spooner>
Some of that is implementation detail though. You only actually need to know that &:capitalize runs #capitalize on the object passed to the block :)
chrisbolton has quit [Quit: chrisbolton]
w400z has joined #ruby
GlenK has quit [Ping timeout: 240 seconds]
ylluminate has joined #ruby
<macer1_>
how can I package it to .gem or some container?
<macer1_>
and install ofc.
andrewhl has joined #ruby
Criztian has quit [Remote host closed the connection]
<Spooner>
In your Rakefile: spec = Gem::Specification.load Dir['*.gemspec'].first
<Spooner>
Gem::PackageTask.new spec do
<Spooner>
end
<Spooner>
And then you get the tasks to build and install.
ryh has quit [Remote host closed the connection]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<macer1_>
it is all?
<yfeldblum>
Spooner, it's how you call methods in ruby, not just the implementation - you can pass *any* object in the proc slot which responds to to_proc, and ruby will pass the resulting proc into the method in the proc slot
<macer1_>
Spooner: undef. Gem
<macer1_>
I need to require something in rakefile
<yfeldblum>
macer1_, if you run `bundle gem NEW_GEM_NAME`, bundler will also generate a new Rakefile in the new gem skeleton dir, which includes a gem-building task, as well as task for building the gem, tagging and pushing the git tag, and releasing to rubygems.org
<Spooner>
You need to require "rubygems" if you are on 1.8.7, but that should be all.
<macer1_>
yfeldblum: the rakefile was empty
<macer1_>
and I generated that way
<macer1_>
so why??
Rezwan has joined #ruby
locriani has quit [Ping timeout: 248 seconds]
<macer1_>
OK, I writed the package task, works
<macer1_>
however I want to have all the tasks yfeldblum said :P
TomRone has joined #ruby
<macer1_>
hm?
<yfeldblum>
macer1_, the generated Rakefile should look like this:
<macer1_>
but it doesn't
<yfeldblum>
#!/usr/bin/env rake
<yfeldblum>
require "bundler/gem_tasks"
<macer1_>
no, it does
eggie5 has joined #ruby
<macer1_>
:P
<macer1_>
but where are all that magic tasks :D?
uris has quit [Quit: leaving]
<yfeldblum>
macer1_, they're defined in the file lib/bundler/gem_tasks.rb in the bundler gem
Stalkr_ has quit [Read error: Connection reset by peer]
<yfeldblum>
macer1_, you can if you want, or you can let bundler define them for you
infinitiguy has joined #ruby
<macer1_>
Bundler::GemHelper.install_tasks paste that there?
infinitiguy has quit [Client Quit]
<eggie5>
i want to get all the numbers in-between a range from a sorted list of numbers. short of a loop w/ an if(left <= number <= right) what are some other ways to do this?
<yfeldblum>
macer1_, yes
<macer1_>
how can I list rake cmds avaible?
<macer1_>
to check if it's working
justsee is now known as justsee|away
<macer1_>
it looks like it doesn't work because rake package fails
awarner has quit [Remote host closed the connection]
jorge has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
akem has joined #ruby
Jay_Levitt has quit [Quit: Leaving...]
<yfeldblum>
macer1_, rake --tasks
<macer1_>
ok
<macer1_>
it is early indev alpha but can I release it to rubygems? it will be easier to manage
jorge has joined #ruby
chimkan has joined #ruby
<yfeldblum>
macer1_, why is that?
<macer1_>
because I can just type gem install mcp
mxweas has quit [Quit: Leaving...]
<macer1_>
oh ok pushed
<macer1_>
with warning ;p
<yfeldblum>
macer1_, you can install it with `rake install`
<yfeldblum>
macer1_, without pushing to rubygems.org
fermion_ has joined #ruby
<macer1_>
ok
<macer1_>
:P
<yfeldblum>
macer1_, which you probably shouldn't do if it's too early
nobitanobi has joined #ruby
dotnull has quit [Read error: Connection reset by peer]
ringotwo has quit [Remote host closed the connection]
kirun has quit [Quit: Client exiting]
sent-hil has joined #ruby
chichou has joined #ruby
SCommette has joined #ruby
akem has quit [Ping timeout: 264 seconds]
<macer1_>
ehh, now bunlder is saying about error in Gemfile
<macer1_>
I have completly no idea what could i brok
<macer1_>
broke*
jasonLaster has quit [Remote host closed the connection]
<macer1_>
nevermind, fixed it :P
jasonLaster has joined #ruby
jorge has quit [Remote host closed the connection]
sgronblom has joined #ruby
jasonLaster has quit [Read error: Connection reset by peer]
jasonLaster has joined #ruby
greenysan has joined #ruby
jorge has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
<aces23up>
is there a difference between the way obj.instance_variables returns stuff from 1.8.7 to 1.9.3?
akem has joined #ruby
JohnRedcorn has joined #ruby
wvms has quit [Read error: Connection reset by peer]
greenysan has quit [Ping timeout: 240 seconds]
jonathanwallace has quit [Remote host closed the connection]
wvms has joined #ruby
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
mxweas has joined #ruby
justsee|away is now known as justsee
_adeponte has joined #ruby
adeponte has quit [Read error: No route to host]
<yfeldblum>
aces23up, yes, 1.9 returns an array of symbols but 1.8 returns an array of strings
JohnRedcorn is now known as enroxorz
savage- has quit [Remote host closed the connection]
<aces23up>
yfeldblum gotcha, ok wanted to make sure it wasn't me who broke the code..
savage- has joined #ruby
<aces23up>
ok thats where its breaking thanks.
oz has quit [Quit: brb]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
JustinCampbell has quit [Remote host closed the connection]
graspee has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
chimkan has quit [Quit: chimkan]
nobitanobi has quit [Read error: Connection reset by peer]
mwilson_ has quit [Excess Flood]
jasonLas_ has joined #ruby
mwilson_ has joined #ruby
nobitanobi has joined #ruby
mwilson_ has quit [Excess Flood]
jasonLas_ has quit [Remote host closed the connection]
mwilson_ has joined #ruby
jasonLas_ has joined #ruby
<macer1_>
if I want a syntax for using like this: mcp.connect(localhost,port) do {chat "hello"; chat "trololo";} will the "chat" just call the chat method on returned object?
jasonLas_ has quit [Remote host closed the connection]
jasonLas_ has joined #ruby
blazes816 has quit [Quit: Leaving]
jasonLaster has quit [Ping timeout: 260 seconds]
<aces23up>
is this correct?
<aces23up>
instance_variables.include?(:@args)
<keyvan>
that syntax is wrong first of all, you either use "do" and "end" or "{" and "}"
<enroxorz>
macer1_ i believe it calls the chat method
<macer1_>
awesome, thx
<enroxorz>
and what kevan said
<macer1_>
keyvan: I always confuse that. I mean without do
<macer1_>
too much bash
<enroxorz>
dont bash bash bro
jasonLas_ has quit [Ping timeout: 246 seconds]
<davidcelis>
zsh > bash
<macer1_>
what that amazing is zsh doing
brianpWins has quit [Quit: brianpWins]
<keyvan>
and yeah it just calls chat, whatever it is in that scope where the block gets called, in fact the #connect method there shall be defined to take a block, (def connect(host, port, &block)) where you can do whatever with the block, doesnt have to be limited to some automatically returned object or whatever
<enroxorz>
oooooh. dem be fightin text. as for your question i believe chat method will be called, not returned
minijupe has joined #ruby
<macer1_>
keyvan: interesting
<macer1_>
and then I somehow call the block?
<keyvan>
block.call
<davidcelis>
or you yield to it
<keyvan>
err yea what davidcelis says seems more correct
<davidcelis>
yield if block_given?
<macer1_>
def initialize(args = {}, &block)
<davidcelis>
args = {} ??
<davidcelis>
why would you name an options hash "args"?
<macer1_>
I mean
<macer1_>
...
<yfeldblum>
aces23up, it's not recommended to do it that way ... prefer to use `instance_variable_defined?(:@args)`
<davidcelis>
do you mean *args
<macer1_>
yes
<davidcelis>
def initialize(*args, &block)
<keyvan>
then it'd be an array, not a hash, no?
<aces23up>
yfeldblum thanks.
<keyvan>
oh wait, sorry, nvm
<davidcelis>
yes, it would be an array
<keyvan>
expanded list of arguments
<davidcelis>
spl*t
<macer1_>
also after the block is end the object is destroyed?
<macer1_>
when using bla.connect {do something with bla}
<keyvan>
object destruction is handled by the GC, if u retain a reference to it, it wont be destroyed, otherwise it is (correct me if wrong)
<davidcelis>
destroyed?
<davidcelis>
no
centipedefarmer has joined #ruby
<macer1_>
hmm maybe that way
<macer1_>
if block given
<macer1_>
call the block and close the socket at the end
<macer1_>
without block user will must close the socket using method
nari has quit [Ping timeout: 252 seconds]
<keyvan>
macer1_ yea thats nice, similar to File.open, if u use the block style of doing work with a File, it calls File#close for you automatically, otherwise you do it yourself.