<ykk`>
people usually use Javascript for it but I don't know enough of it and if it can be resolved with Ruby might as well stick to what i know
elliotec has joined #ruby-lang
AngelofSilence has quit [Ping timeout: 245 seconds]
araujo has joined #ruby-lang
jacky has joined #ruby-lang
jacky has quit [Changing host]
jacky has joined #ruby-lang
jacky has quit [Excess Flood]
amerine has quit [Quit: Computer has gone to sleep.]
jhass is now known as jhass|off
kalehv has quit [Remote host closed the connection]
elia has quit [Quit: Computer has gone to sleep.]
rnea has joined #ruby-lang
rnea has quit [Client Quit]
dingus_khan has quit [Remote host closed the connection]
kotk1 has quit [Quit: Leaving...]
solars has quit [Ping timeout: 245 seconds]
AngelofSilence has joined #ruby-lang
senseinerd has joined #ruby-lang
senseinerd has quit [Client Quit]
Lewix has joined #ruby-lang
VTLob has quit [Quit: VTLob]
<AngelofSilence>
Note to self: make sure to read the entire virtualbox preset text before spending half an hour trying to figure out why virtualbox wouldn't use amd-v
elia has joined #ruby-lang
havenwood has joined #ruby-lang
DevDoo has quit [Read error: No route to host]
francisfish has joined #ruby-lang
DevDoo has joined #ruby-lang
saarinen has joined #ruby-lang
hahuang65 has joined #ruby-lang
DevDoo has quit [Remote host closed the connection]
DevDoo has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
francisfish has quit [Ping timeout: 252 seconds]
Lewix has quit [Remote host closed the connection]
elliotec has quit [Remote host closed the connection]
jackyalc- has joined #ruby-lang
elliotec has joined #ruby-lang
elliotec has quit [Remote host closed the connection]
jackyalc- has quit [Excess Flood]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
elliotec has joined #ruby-lang
rsl has quit [Read error: Connection reset by peer]
rsl has joined #ruby-lang
saarinen has quit [Quit: saarinen]
kalehv has joined #ruby-lang
mistym has quit [Remote host closed the connection]
kalehv has quit [Ping timeout: 252 seconds]
Onixs has quit [Ping timeout: 272 seconds]
dingus_khan has joined #ruby-lang
saarinen has joined #ruby-lang
ykk` has quit [Quit: ykk`]
jackyalc- has joined #ruby-lang
jackyalc- has quit [Excess Flood]
DevDoo has quit [Remote host closed the connection]
jsullivandigs has quit [Remote host closed the connection]
mistym has joined #ruby-lang
DevDoo has joined #ruby-lang
amerine has joined #ruby-lang
amerine_ has joined #ruby-lang
sepp2k has quit [Read error: Connection reset by peer]
amerine has quit [Ping timeout: 260 seconds]
dingus_khan has quit [Remote host closed the connection]
iliketurtles has quit [Quit: zzzzz…..]
heftig has quit [Quit: Quitting]
jackyalc- has joined #ruby-lang
jackyalc- has quit [Excess Flood]
kig has joined #ruby-lang
dingus_khan has joined #ruby-lang
asahi has quit [Quit: Leaving.]
kig is now known as kigster
<dingus_khan>
centrx: if you're around, could i bother you for a some advising on an OO design question?
<centrx>
Shoot
kalehv has joined #ruby-lang
<dingus_khan>
ok that was fast, hang on while i make a paste, lol
<dingus_khan>
fully expected more latency hah
<centrx>
Depends on where I am
<dingus_khan>
totally, i just figured most people are busy most of the time, heh, sorry for being unprepared; here's the paste: http://codepad.org/WsPUrgMX
<centrx>
You must be very lucky
<dingus_khan>
so i think i'm going insane, lost in my own head on how to *properly* structure this thing
<dingus_khan>
centrx: definitely feeling lucky right now!
marcdel has quit []
<dingus_khan>
obviously not complete, i keep writing individual parts while i struggle with how best to tie them together, that sort of thing
DevDoo has quit [Remote host closed the connection]
<centrx>
What is Customer going to use from Reader?
<dingus_khan>
i guess the question is, for best OO design in a standalone program like this in pure ruby, does it make sense to separate out those Reader functions into a module like that?
kalehv has quit [Ping timeout: 245 seconds]
<dingus_khan>
ah right, so i was about to place some methods that Customer could use, like inputs, but i feel like that doesn't make sense
mistym has quit [Remote host closed the connection]
<centrx>
It makes sense to have your CsvReader in a separate class/module
<centrx>
But it seems awkward to have Hotel extend Reader or Customer extend Reader
<dingus_khan>
right? how do i create a collection that exists as an object in an OO way that isn't just a disembodied method?
Lewix has joined #ruby-lang
<dingus_khan>
i can't think of a sensible way to make a separate class for the purposes of handling the data structure that houses the hotel selections
marcdel has joined #ruby-lang
<centrx>
dingus_khan, You could have the Reader return an array of hashes, instead of creating Hotels within it
<dingus_khan>
or am i wrong, that there should be a separate class to manage things like IO and providing the hash of hotels? i seriously feel insane, like this is obvious somehow
cnivolle has quit [Remote host closed the connection]
DevDoo has joined #ruby-lang
<centrx>
dingus_khan, This would separate and genericize the Reader logic from the particular class that is being read
<dingus_khan>
ok, so have reader in fact create the data structure--does it then make sense to move the methods like #cheapest and #return_rates to the module if i'm extending it, or am i moving too many Hotel-specific concerns out to a module?
<dingus_khan>
right, that makes sense. hmm... so i would return the array of hashes/hash it currently creates to the global scope?
<centrx>
dingus_khan, Right now it seems small enough that you should keep it there
<centrx>
cheapest should be a class method
surtin has joined #ruby-lang
<dingus_khan>
yeah that feels right too; so the extending of Reader in Hotel isn't a good practice, or is patently unnecessary in a program this small?
<dingus_khan>
part of it is that i wanted to sort of design it "with the future in mind", as in if i ever decided to make it more complex or swap out CSVs for an ORM like AR or something
surtin has quit [Client Quit]
<centrx>
Mixing the Reader with the object seems unnecessary or would cause confusion
<centrx>
The component that handles input from data sources should be separate from the object ultimately created
<dingus_khan>
centrx: ok, yeah, it's definitely only mostly confused me so far, my original line of thought having become more vague as i added more parts
<dingus_khan>
centrx: so in this case, Reader should in fact handle data input from a file/CSV, but the CLI input should be separate from the Reader?
tanema has joined #ruby-lang
<centrx>
dingus_khan, If you mean command-line argument, yes
existensil_ has quit [Read error: Operation timed out]
<centrx>
dingus_khan, Otherwise, reading a CSV from stdin is the same logic as reading a CSV with File.open
<dingus_khan>
i was thinking of making the #inputs for collecting CLI arguments a class method of customer, part of the extending Reader in Customer
<dingus_khan>
centrx: yep, i did mean command arguments from the terminal when it's running
jackyalc- has joined #ruby-lang
jackyalc- has quit [Excess Flood]
mbj has quit [Quit: leaving]
havenwood has quit [Read error: Connection reset by peer]
<dingus_khan>
centrx: whoa, definitely going to need to study that for a minute, thank you! is that part of the standard library?
<centrx>
Yes
existensil has joined #ruby-lang
<dingus_khan>
sweet, reading now
marcdel has quit [Ping timeout: 272 seconds]
Lewix has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 260 seconds]
Lewix has joined #ruby-lang
<dingus_khan>
wow, that's interesting, a bit for complex for me right now, but i'm messing with the demo
jackhammer2022 has quit [Quit: Computer has gone to sleep.]
mykoweb has quit [Remote host closed the connection]
<dingus_khan>
centrx: given the time constraints on this, i think i need to push learning the option parser for right now--i intend to explore it further in the future though. my needs are pretty basic for the moment, so i'm going to try and get this functional first, fair?
<dingus_khan>
push back*
<centrx>
Sure
<centrx>
I would mention that the OptionParser is really much easier than the documentation looks
<centrx>
I had the same thought when I read it, but in the end it is simple if you are using basic arguments
jackhammer2022 has joined #ruby-lang
<dingus_khan>
ah see, i had a feeling that was the case, given the difference between the "simple" example and the full-size program they use as the demo
<dingus_khan>
so the method i have for splitting and converting user input i have now, that would transfer fairly easily to the option parser?
jackyalc- has joined #ruby-lang
jackyalc- has quit [Excess Flood]
<centrx>
dingus_khan, I don't know what that inputs method does. It would take some digging to figure it out :)
havenwood has quit [Ping timeout: 246 seconds]
arBmind has quit [Ping timeout: 252 seconds]
bzalasky has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
<dingus_khan>
centrx: ah yes, sorry, i definitely did not observe the conventional wisdom of "if you use a regex to solve one problem, you've now got two problems", hah
bzalasky has joined #ruby-lang
jsullivandigs has joined #ruby-lang
<dingus_khan>
i'm just more comfortable using rubular to smash out those expressions in the kind of rush i'm in
<dingus_khan>
old habits!
havenwood has joined #ruby-lang
jackyalc- has joined #ruby-lang
jackyalc- has quit [Excess Flood]
marcdel has joined #ruby-lang
mistym has joined #ruby-lang
SteveBenner09 has joined #ruby-lang
pr0ton has joined #ruby-lang
francisfish has joined #ruby-lang
tanema has quit [Remote host closed the connection]
tanema has joined #ruby-lang
francisfish has quit [Ping timeout: 272 seconds]
elliotec has quit [Remote host closed the connection]
elliotec has joined #ruby-lang
<dingus_khan>
centrx: if i'm not bothering you yet, a thought: removing the #return_rates out of Hotel and placing in Reader, or somehow using something like a class containing something like the OptionParser to contain that?
<centrx>
Does return_rates read from a CSV?
tanema has quit [Ping timeout: 252 seconds]
amerine_ has quit [Quit: Computer has gone to sleep.]
<centrx>
Is return_rates a command-line option?
<dingus_khan>
centrx: it does not, it's relying on a hash of the hotel objects being passed in
<dingus_khan>
it is not; it's an instance method for Hotel right now.
<dingus_khan>
that changes invoking the #cheapest method though
<dingus_khan>
scoping, ack
<centrx>
Right, so sounds like it belongs in Hotel
SteveBenner09 has quit [Remote host closed the connection]
SteveBenner09 has joined #ruby-lang
<dingus_khan>
ok, thanks for that; i feel like that's mostly the way it's supposed to be, just wanted a check on that
RoxasShadowRS has quit [Read error: Connection reset by peer]
nirix has quit [Read error: Operation timed out]
mykoweb has joined #ruby-lang
ykk` has joined #ruby-lang
ykk` has quit [Client Quit]
havenwood has quit [Remote host closed the connection]
PantsMeh has joined #ruby-lang
havenwood has joined #ruby-lang
abstr4ct has quit [Ping timeout: 260 seconds]
Lewix has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 246 seconds]
pabloh has joined #ruby-lang
michaeldeol has quit [Quit: Computer has gone to sleep.]
Mousse_ has quit [Quit: Computer has gone to sleep.]
michaeldeol has joined #ruby-lang
dorei has quit []
savage-_ has quit [Ping timeout: 272 seconds]
michaeldeol has quit [Ping timeout: 260 seconds]
chancancode has quit [Ping timeout: 264 seconds]
bzalasky has quit [Remote host closed the connection]
lacrosse has quit [Ping timeout: 272 seconds]
lacrosse has joined #ruby-lang
savage-__ has joined #ruby-lang
mjc_ has quit [Ping timeout: 272 seconds]
bcardarella has quit [Ping timeout: 272 seconds]
kigster has quit []
chancancode has joined #ruby-lang
mjc_ has joined #ruby-lang
jackyalcine has joined #ruby-lang
tectonic has joined #ruby-lang
bcardarella has joined #ruby-lang
sree has joined #ruby-lang
<AngelofSilence>
Hey guys, I'm having a bit of trouble..
ikrima has quit [Ping timeout: 260 seconds]
<AngelofSilence>
I rarely use linux, but I'm using ubuntu in a vm to work with this gem.
<AngelofSilence>
I'm attempting to install the gem, but it says it needs ruby 1.9.1 or greater.
<AngelofSilence>
I installed ruby 1.9.1 but when i do ruby -v it tells me the version is 1.8.7
<AngelofSilence>
does ubuntu have a built-in version of ruby or something?
elliotec has quit [Remote host closed the connection]
elliotec has joined #ruby-lang
DevDoo has quit [Remote host closed the connection]
<dingus_khan>
AngelofSilence: is it possible to install something like RVM on that vm?
pabloh has quit [Ping timeout: 260 seconds]
nXqd has joined #ruby-lang
<centrx>
zenspider, What is the difference between Ruby Parser and Ripper?
new_programmer has quit []
pabloh has joined #ruby-lang
skade has joined #ruby-lang
michaeldeol has joined #ruby-lang
ansos has quit [Read error: Connection reset by peer]
Barrin6 has quit [Quit: Leaving]
ansos has joined #ruby-lang
marcdel has quit []
skade has quit [Client Quit]
michaeldeol has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby-lang
earthquake has joined #ruby-lang
<AngelofSilence>
Found it now, thanks dingus_kahn
saarinen has quit [Quit: saarinen]
michaeldeol has quit [Ping timeout: 260 seconds]
DevDoo has joined #ruby-lang
<AngelofSilence>
Well what the hell?
<AngelofSilence>
I'm installing this gem but it doesn't install
dingus_khan has quit [Remote host closed the connection]
<AngelofSilence>
it goes over well and then i cant use it and i cant find it in any bin
dingus_khan has joined #ruby-lang
pabloh has quit [Quit: Saliendo]
<AngelofSilence>
aaand fixed
kiddorails has joined #ruby-lang
kiddorails has quit [Read error: Connection reset by peer]
<dingus_khan>
AngelofSilence: right on, what did it take?
<AngelofSilence>
Well for some reason I messed up the bundle thing and when i went to install the generated gem it was empty
<AngelofSilence>
I then attempted to gem install from github
<AngelofSilence>
gem install from the gem repo*
<AngelofSilence>
and for whatever reason, it would repeatedly attempt to install the empty gem
<AngelofSilence>
so i had to uninstall the gem then reinstall
<AngelofSilence>
so now I'm working with a slightly outdated version of the gem, but whatevs
<AngelofSilence>
thanks be to whitequark
<AngelofSilence>
16k classes decompiled hah
<AngelofSilence>
er
<AngelofSilence>
4k classes decompiled
<AngelofSilence>
oh.. well thats not super helpful: 8.5k out of 11k methods failed to decompile
marcdel has joined #ruby-lang
nertzy2 has joined #ruby-lang
<dingus_khan>
AngelofSilence: you're referring to the install log output there? interesting--i've never worked on a vm before, so i'm not really sure what's going on there. have you tried #linux?
<AngelofSilence>
Everythings good in #linux
<AngelofSilence>
er
<AngelofSilence>
in linux
<dingus_khan>
the channel that is
<AngelofSilence>
I'm using a tool of whitequark's to decompile something
<dingus_khan>
gotcha
<AngelofSilence>
it deobfuscates and decompiles, but it failed to decompile about 70% of the classes :/
nertzy has quit [Ping timeout: 252 seconds]
bzalasky has joined #ruby-lang
<AngelofSilence>
anyone know an online paste tool that can take insanely large text?
<AngelofSilence>
Pastebin appears to have commited suicide.
<SteveBenner09>
have you had this error in ruby 2.1: uninitialized constant FILE (NameError)
<SteveBenner09>
thrown on a line where I use File.open
<lisberoia>
does anyone know these scripts? or, could anyone take a look at it? thanks
<certainty>
lisberoia: what dou you mean by, "it's not working"?
<lisberoia>
to be more specific, I can code binary to sound, but the script to read from tape seems to do nothing
<certainty>
it needs the sox binary. Do you have it installed?
<lisberoia>
I do have it
<lisberoia>
I bough a tape recorder, which was very hard to find :(
<lisberoia>
the script to read from tape only lets me press Ctrl C to exit ...
<certainty>
ok that was my first shot. And you have a correct configuration file?
<lisberoia>
I'm affraid I cannot answer that question correcly
<lisberoia>
I think I do, but I'm not sure
<certainty>
can you gist your config.yml?
<lisberoia>
my config.yml file reads exactly as the default from the web site
<lisberoia>
I can edit it, modify it, etc., only I don't know what to change or ammend
<certainty>
i don't know this code. I just read it and guess what could go wrong :)
<lisberoia>
I don't know ruby
<lisberoia>
you do, could you please take a look at the tape-read.rb script and tell me what it is supposed to do? thanks
<certainty>
it reads the output of the sox command and does something with it
jonr22 has joined #ruby-lang
<lisberoia>
fantastic!
<certainty>
it uses global state alot which doesn't make it exactly easy to follow
<lisberoia>
it should process the output of the sox application
<certainty>
it does
tylersmith has quit [Remote host closed the connection]
<certainty>
with the configuration given it invokes it with: sox -q '-t alsa "hw:0"' -t .raw -r 44100 -c 1 -b 16 -e signed-integer -
<certainty>
whatever that does
<lisberoia>
it should read the audio signal from a tape player plugged to the computer
<lisberoia>
and then transform that to bytes
<apeiros>
the '-' at the end might mean it waits for input on stdin
<certainty>
yeah
<lisberoia>
I'm trying to recover the experience of saving computer files to ordinary audio tapes and then loading them back; I'm a nostalgic from the 80s
<certainty>
yeah it's a cool idea. I'm just reading the blog post
<lisberoia>
the blog is just awesome
<lisberoia>
the video there, from Youtube, actually displays an early version of the script, in Perl, not Ruby
<certainty>
lisberoia: i was going to ask if that's actually a port of some perl script
<lisberoia>
it probably is
<lisberoia>
I'm illiterate in Ruby or Perl
<lisberoia>
just some BASIC from the 80s
<lisberoia>
I'm from the field of the ... liberal arts ... :(
<certainty>
lisberoia: unfortunatelly without a possibility to test it it's hard to debug
<lisberoia>
I see
<lisberoia>
if you don't have a tape recorder, you can use the "rec" command, record the audio output of the first script, and then play it back with mplayer or vlc to test the troublesome script
<rue|w>
The script seems pretty simple. You sure you have sox working right and the device properly connected and so on?
<lisberoia>
I'm almost positive
<lisberoia>
sox does right anything else I tell it to; doesn't seem to be a problem with it
<certainty>
and the problem is that it doesn't finish?
cnivolle has quit [Remote host closed the connection]
<lisberoia>
the device is properly connected; I can even turn monitoring the audio input through my speakers on, it works great
<lisberoia>
the problem is that when I run tape-read.rb it keeps waiting for god knows what, doesn't do anything, and the only possibility I have is exiting with Ctrl C
<certainty>
i guess it does something but is stuck in a loop or something
<lisberoia>
perhaps, but:
<certainty>
or waiting for input
Mousse_ has joined #ruby-lang
<lisberoia>
others should have reported such a bug before me
<lisberoia>
it seems to be a problem in my end
<lisberoia>
or perhaps literaly nobody else tested that script! :)