<elico>
the next step after established is to be closed right?
bluebie has joined #ruby
SegFaultAX|work has quit [Ping timeout: 240 seconds]
<elico>
He was saying about half close can still get data from the client
<elico>
but it's only for fin\ack and not other data
ukd1 has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
AndChat- has quit [Ping timeout: 248 seconds]
chin-tastic has joined #ruby
<elico>
like in the fin_wait you cant get data from the other side
Banistergalaxy has quit [Ping timeout: 248 seconds]
<elico>
graft: ??
duracrisis has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
dekz has joined #ruby
ianblenke1 has joined #ruby
Asher has quit [Ping timeout: 245 seconds]
elaptics is now known as elaptics`away
DrShoggoth has joined #ruby
duracrisis has joined #ruby
elaptics`away is now known as elaptics
Banistergalaxy has joined #ruby
pskosinski has quit [Quit: Some unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb]
AndChat- has joined #ruby
<RubyPanther>
Elico: you don't worry about that, you just use the stdlib
SegFaultAX|work has joined #ruby
<graft>
err... i'm not sure what exactly you're asking, but i'm skeptical that you need to worry about fin/ack stuff
AndChat| has quit [Ping timeout: 252 seconds]
rakunHo has joined #ruby
Banistergalaxy has quit [Ping timeout: 252 seconds]
yshh has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<graft>
can someone help me explain how i can use a pull parser to read in a large XML file?
<graft>
i'm trying to wrap my head around this and failing
<graft>
i have a file with a bunch of <entry></entry> records, each of which is a fairly complex xml structure... i'd like to just read in those <entry> records one-at-a-time and do some stuff to them
<graft>
how do i accomplish this?
<elico>
how about xml parser?
flovv has joined #ruby
duracrisis has quit [Ping timeout: 260 seconds]
nightfalcon has joined #ruby
lggr has joined #ruby
<graft>
i can't load the whole thing into memory, it's too big
<chiel>
a lot of the code in the post path is obviously shared, i'm trying to figure out the best place to put this code. should it be in a class, or so?
seanstickle has quit [Quit: seanstickle]
statarb3 has quit [Quit: Leaving]
jenrzzz has joined #ruby
ttt has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
blazes816_ has quit [Read error: Connection reset by peer]
blazes816 has joined #ruby
lggr has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
elaptics is now known as elaptics`away
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
Banistergalaxy has joined #ruby
AndChat| has joined #ruby
Chryson has joined #ruby
stkowski has quit [Quit: stkowski]
ttt has quit [Ping timeout: 260 seconds]
AndChat- has quit [Ping timeout: 252 seconds]
yigal has quit [Quit: leaving]
Banistergalaxy has quit [Ping timeout: 244 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
goyox86 has quit [Read error: Connection reset by peer]
goyox86_ has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
colinbm has quit [Quit: colinbm]
Banistergalaxy has joined #ruby
philcrissman has quit [Remote host closed the connection]
freeayu__ has quit [Remote host closed the connection]
wallerdev has quit [Read error: Connection reset by peer]
goyox86 has joined #ruby
wallerdev has joined #ruby
goyox86_ has quit [Read error: Connection reset by peer]
My_Hearing is now known as Mon_Ouie
<flovv>
mildfate: negating a regex is not so easy, I can remember that I've researched this on stackoverflow, in the end I gave it up, but give it a try
asteve has quit [Quit: Computer has gone to sleep.]
chrstphrhrt has joined #ruby
chrstphrhrt has left #ruby [#ruby]
lggr has joined #ruby
cbuxton has joined #ruby
cbuxton has quit [Client Quit]
<mildfate>
flovv: Looks like you have to make a character class with the carrot operator: /[^]/. After the character operator comes all characters you don't want to be matched.
lurraca__ has joined #ruby
jimeh has joined #ruby
joofsh has quit [Remote host closed the connection]
yoklov has joined #ruby
g-ram has joined #ruby
wpaulson has joined #ruby
lurraca_ has quit [Read error: Connection reset by peer]
DrShoggoth has quit [Quit: Leaving]
lggr has quit [Ping timeout: 252 seconds]
Trioke has joined #ruby
jimeh has quit [Ping timeout: 244 seconds]
butblack has joined #ruby
<thaostra>
I am having a couple issues with implementing a method for downloading files. One is that it does not write to file until the download is finished, and secondly it does not resume partial downloads. I can tolerate wasted bandwidth and time for small files, but not so much for large files. Basically I want to implement something that is not unlike ( wget -P PATH/TO/FILE -c URL ). I have a snippet of my code so far: https://gist.github.com/4e01da8091ab2525a
dmiller has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
Beoran__ has joined #ruby
iamjarvo has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
dmiller has joined #ruby
Takehiro has joined #ruby
dmiller has quit [Remote host closed the connection]
dmiller has joined #ruby
rabidpraxis has joined #ruby
bluebie has joined #ruby
bluebie has quit [Changing host]
bluebie has joined #ruby
Beoran_ has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
wpaulson has quit [Read error: Connection reset by peer]
dmiller has quit [Ping timeout: 256 seconds]
Takehiro has quit [Ping timeout: 256 seconds]
bluebie has quit [Ping timeout: 272 seconds]
mensvaga has quit [Ping timeout: 240 seconds]
jgrevich_ has joined #ruby
jgrevich has quit [Ping timeout: 246 seconds]
jgrevich_ is now known as jgrevich
lggr has quit [Ping timeout: 244 seconds]
m3pow has quit [Ping timeout: 240 seconds]
g-ram has joined #ruby
g-ram has quit [Client Quit]
m3pow has joined #ruby
lggr has joined #ruby
jenrzzz has joined #ruby
Chryson has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
<bnagy>
thaostra: first issue you can solve with chunking
vitor-br has quit [Ping timeout: 246 seconds]
<bnagy>
out_fh.write in_fh.read(2048) or whatever
<bnagy>
resuming I dunno, I don't use open-uri - would depend on the API for starting to download from an offset
<bnagy>
normally I think people use a .partial file or somesuch and then mv it over at the end
vitor-br has joined #ruby
lggr has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
<bnagy>
also I thought the point of mkdir_p is that you don't have to test for existence first...
dv_ has quit [Ping timeout: 246 seconds]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<thaostra>
bnagy, I am unfamiliar with using file chunking, so could you write up a snippet? I would really appreciate it, as it is usually how I learn new code
gry has quit [Ping timeout: 615 seconds]
<bnagy>
you just pass a length arg to read
friskd has quit [Ping timeout: 240 seconds]
<thaostra>
bnagy, Well I am coming from Bash land, and I have not benchmarked to see if using a testing operation would speed things up
icole has joined #ruby
vitor-br has quit [Ping timeout: 246 seconds]
gry has joined #ruby
<bnagy>
doubt it would be noticably faster, you only do it once, it just looks weird and it's dead code
dv_ has joined #ruby
CaptainJet has quit []
<thaostra>
bnagy, Not really, I have seen noticeable differences in performance with my bast scripts when testing over 11000 times for destinations of files.
nwest has quit [Quit: Computer has gone to sleep.]
jenrzzz has joined #ruby
<thaostra>
However, I do not know if Ruby is more intelligent than indiscriminately running mkdir -p
lggr has quit [Ping timeout: 246 seconds]
ianblenke1 has quit [Quit: Leaving.]
patrickximenes has joined #ruby
patrickximenes has quit [Client Quit]
lggr has joined #ruby
vitor-br has joined #ruby
dmiller has joined #ruby
bigmcq77 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
nat2610 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 245 seconds]
chin-tastic has joined #ruby
cakehero has joined #ruby
kyb3r has joined #ruby
kenneth has quit [Quit: kenneth]
macmartine has joined #ruby
Banistergalaxy has quit [Ping timeout: 252 seconds]
macmartine has quit [Read error: Connection reset by peer]
goyox86 has quit [Ping timeout: 246 seconds]
swarley has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 245 seconds]
<thaostra>
bnagy, To help give you an idea of what I am doing, I am porting one of my projects -- a download manager -- from Bash to Ruby. So far I have most of the functionality working and even appears to perform better in Ruby, but I have yet to find a good equivalent for wget. I could just run the command in-line, but that is platform-specific and would create a dependency.
cantonic has quit [Quit: cantonic]
butblack has quit [Quit: butblack]
goyox86 has joined #ruby
lurraca__ has quit [Quit: Leaving]
goyox86__ has joined #ruby
lggr has joined #ruby
goyox86_ has quit [Ping timeout: 246 seconds]
JohnBat26 has joined #ruby
macmartine has joined #ruby
linoj has quit [Quit: linoj]
goyox86 has quit [Ping timeout: 246 seconds]
g-ram has joined #ruby
hsbt is now known as hsbt_away
cantonic has joined #ruby
icole has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
tommyvyo has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
CannedCorn has quit [Quit: Computer has gone to sleep.]
hsbt_away is now known as hsbt
horofox has quit [Quit: horofox]
Takehiro has joined #ruby
lggr has joined #ruby
cantonic has quit [Quit: cantonic]
kenneth has joined #ruby
cakehero has quit [Ping timeout: 256 seconds]
goyox86 has joined #ruby
goyox86_ has joined #ruby
goyox86 has quit [Read error: Connection reset by peer]
goyox8___ has joined #ruby
Takehiro has quit [Ping timeout: 252 seconds]
fungoat has quit [Quit: fungoat]
iamjarvo has quit [Ping timeout: 240 seconds]
cakehero has joined #ruby
goyox86__ has quit [Ping timeout: 260 seconds]
fungoat has joined #ruby
fungoat has quit [Client Quit]
CodeFriar has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 260 seconds]
goyox86_ has quit [Ping timeout: 260 seconds]
jgwong has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
mikepack has joined #ruby
CodeFriar has joined #ruby
Guest74235 has quit [Ping timeout: 260 seconds]
puppy is now known as thomas
Guest74235 has joined #ruby
ffranz1 has quit [Quit: Leaving]
goyox8___ has quit [Ping timeout: 246 seconds]
ananthakumaran has joined #ruby
ryanlecompte has joined #ruby
burgestrand has quit [Ping timeout: 256 seconds]
Banistergalaxy has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
masteraka has joined #ruby
charliesome has joined #ruby
masteraka has left #ruby [#ruby]
ken_barber has quit [Remote host closed the connection]
<Banistergalaxy>
It's ruby not pry that provides that :)
<Banistergalaxy>
No
tommyvyo has joined #ruby
justinlilly has quit [Quit: Peace.]
rubious has joined #ruby
<rking>
kenneth: If you use pry's `edit` command, it will do that automatically.
<Banistergalaxy>
True
<rking>
Also `edit-method`
bjhaid has quit [Ping timeout: 255 seconds]
justinmcp has quit [Remote host closed the connection]
nat2610 has quit [Ping timeout: 256 seconds]
ananthakumaran has quit [Quit: Leaving.]
justinlilly has joined #ruby
<thaostra>
I seemed to have found a fix with writing to directly to file. Unfortunately, when I stop and restart the download it overwrites the file. I have switched from open-uri to Net::HTTP which allows one to use headers to perhaps get partial downloads by using the range header like wget does, but I have little idea of how to implement that in code. Updated snippet: https://gist.github.com/4e01da8091ab2525a446
lggr has quit [Ping timeout: 252 seconds]
otters has quit [Ping timeout: 246 seconds]
monkegjinni has joined #ruby
lggr has joined #ruby
monkegjinni has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
Juul has joined #ruby
tommyvyo has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
justinlilly has quit [Quit: Peace.]
margle has joined #ruby
justinlilly has joined #ruby
Takehiro has joined #ruby
Fretta has quit [Quit: Fretta]
lggr has joined #ruby
dakine has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 240 seconds]
lolmaus has joined #ruby
bluebie has joined #ruby
bluebie has quit [Changing host]
bluebie has joined #ruby
codecop has joined #ruby
Takehiro has quit [Ping timeout: 246 seconds]
Banistergalaxy has joined #ruby
Solnse has joined #ruby
ttt has quit [Remote host closed the connection]
Takehiro has joined #ruby
ttt has joined #ruby
Forevernade has quit [Ping timeout: 246 seconds]
icole has joined #ruby
thecreators has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 252 seconds]
bluebie has quit [Ping timeout: 252 seconds]
rotev has joined #ruby
Juul has quit [Read error: Connection reset by peer]
aantix has joined #ruby
<mildfate>
I have this regex: /'^\'\\\[^\n]\''/ which when implemented in my code matches "'\n\". But when I use it in rubular.com, it doesn't say there's a match between these. Why is there this discrepancy?
lggr has joined #ruby
icole has quit [Ping timeout: 244 seconds]
otters has joined #ruby
<Gate>
mildfate: that doesn't match in my interpreter either. What version of ruby are you using?
<mildfate>
I used both 1.8.7 and 1.9.3
<mildfate>
matches in both
<mildfate>
I don't get it
ananthakumaran has joined #ruby
<mildfate>
this is the line of code: "charRE1 = Regexp.new('^\'\\\[^\n]\'')"
yoklov has quit [Quit: computer sleeping]
<Gate>
mildfate: that regexp throws a warning in my code
<mildfate>
Gate: Interesting, charRE1 = Regexp.new('^\'\\[^\n]\'') threw a warning in mine
<mildfate>
(that's subtracting one slash)
<Gate>
mildfate: I had the match string wrong.
<mildfate>
Gate: Does it work with 3 forward slashes?
<Gate>
mildfate: using regexp.new doesn't throw the warning, but // does
triptec has joined #ruby
<Gate>
mildfate: so what string are you trying to match, exactly? "'\n\" is incomplete
<Gate>
(its escaping the terminating quote)
<mildfate>
I'm sorry, I mean: '\n'
justsee has joined #ruby
tomaw has quit [Ping timeout: 604 seconds]
justsee has quit [Changing host]
justsee has joined #ruby
ontoillogical has joined #ruby
<mildfate>
It should match [singlequote][forwardslash][n][singlequote]
<Gate>
mildfate: it might help if you used gist.github.com or pastebin to put up your exact code
Takehiro has quit [Remote host closed the connection]
ltsstar has quit [Quit: ltsstar]
lggr has quit [Ping timeout: 255 seconds]
aantix has quit [Quit: aantix]
josh^ has joined #ruby
<ontoillogical>
Hey all, quick question --- I'm trying to read a file full of binary data as a string. In Python after doing string = file.read() I would get "\x00\x00\x00", in Ruby it's defaulting to Unicode so I get a string like "\u0000\u0000". How do I turn the UTF encoding off --- string.encoding("us-ascii") isn't working since I have non ascii bytes
xorgnak has quit [Remote host closed the connection]
<Gate>
yeah, neither one matches, still
<mildfate>
Gate: I'm using line = STDIN.gets
xorgnak has joined #ruby
<mildfate>
and entering: '\n' manually
<mildfate>
could that make a difference?
<Gate>
yes
lggr has quit [Ping timeout: 256 seconds]
<Gate>
that could very much make a difference
<Gate>
that's the difference between the \n being interpreted as enline vs. just a string...
<Gate>
trying again
<mildfate>
Sorry, how does that make a diff?
answer_42 has joined #ruby
<Gate>
mildfate: \n is a control character
macmartine has quit [Quit: Computer has gone to sleep.]
<Gate>
so, if you were, in a ruby shell like I have been using, to type "\n" that would be a string ONE character long, containing an endline
<Gate>
whereas if you type \n into a stdin gets it will be interpreted as two seperate characters (like typing "\\n" in the ruby shell)
<mildfate>
Gate: But that's not what I type, I type: '\n'
lggr has joined #ruby
<Gate>
ok, i'm getting the same results as you now
n_blownapart has joined #ruby
<Gate>
mildfate: the difference is where you are typing it
<Gate>
using STDIN.gets and typing in '\n' would give you the same string from a ruby shell as typing "'\\n'" in the ruby shell
<mildfate>
Gate: So, assuming I have the string "'\n'" in a file
<mildfate>
and I redirect it to my program which reads from stdin
<mildfate>
which regex do I want to match said string?
thaostra has quit [Quit: Leaving]
xorgnak has quit [Remote host closed the connection]
<Gate>
then ruby will get the literal. I'm still not sure about the third \ though
Solnse has quit [Ping timeout: 265 seconds]
eldariof has joined #ruby
xorgnak has joined #ruby
<Gate>
mildfate: you have desended into string escape hell ;)
<mildfate>
Gate: So for file redirection, matching '\n', I should use the 3 \ variant?
<Gate>
mildfate: yes
<Gate>
mildfate: it has to do with how you are building the regular expression (inside a single quoted string)
<mildfate>
Gate: Do you have any ideas as to why the 3 slashes are needed?
<Gate>
harRE1 = Regexp.new('^\'\\\[^\n]\'')
<Gate>
=> /^'\\[^\n]'/
<Gate>
when Regexp compiles it, it compiles it down to two slashes
<mildfate>
...
<mildfate>
what? why?
bluebie has joined #ruby
bluebie has quit [Changing host]
bluebie has joined #ruby
<Gate>
I think because you are using a single quote string to build the regexp
cakehero has quit [Quit: Computer has gone to sleep.]
rippa has joined #ruby
<mildfate>
Gate: Should I be using double-quote? (I'm very new at ruby and regex)
<Gate>
mildfate: I personall would use just this: /^'\\[^\n]'/
<Gate>
that is much easier to read and is perfectly identical to Regexp.new('^\'\\\[^\n]\'')
lggr has quit [Ping timeout: 245 seconds]
<Gate>
mildfate: however, on a seperate note, I don't think that regular expression is exactly what you want
<mildfate>
Gate: fuck yea that works with only 2 slashes
<mildfate>
wth?
<mildfate>
Gate: Why not?
xorgnak has quit [Remote host closed the connection]
<Gate>
mildfate: because of [^\n]
<n_blownapart>
hi what about a regex like this: re = /[a-c]{3}/ ...I'm a bit confused over what this will match. thanks
<Gate>
that matches everything except an endline, which is not what I think you are trying to do
AlbireoX has quit [Remote host closed the connection]
<mildfate>
Gate: It is
JonnieCache has joined #ruby
xorgnak has joined #ruby
<Gate>
mildfate: OK, then ignore my last :)
AlbireoX has joined #ruby
<mildfate>
Gate: Coolio, thanks for your help
<mildfate>
Gate: I don't get why using quotes messed with the slashes, but moving to /'s solved it
<Gate>
n_blownapart: that will match aaa, abc, bbb, etc. any combination of a, b and c three characters long
<Gate>
mildfate: in ruby there are several ways to build strings
<n_blownapart>
thanks Gate
jenrzzz has joined #ruby
<Gate>
mildfate: using single quotes like 'abc' will IGNORE control sequences (like \n), whereas double quotes will interpret them
bluebie has quit [Ping timeout: 260 seconds]
<mildfate>
Gate: Ah, ok
<mildfate>
and what do /s do?
lggr has joined #ruby
<Gate>
mildfate: those build a regular expression on the fly
<Gate>
and they interpret it like it was a double quoted string
<Gate>
Incidentally, that means you can use ruby string interpolation with them, which can make them really fun
<mildfate>
Gate: so / and " are the same in terms of interpretation?
sj26 has quit [Quit: Rainbows!]
xorgnak has quit [Remote host closed the connection]
<Gate>
mildfate: basically, yes.
AlbireoX has quit [Ping timeout: 246 seconds]
<n_blownapart>
Gate I always wonder about single quotes should one just never use them?
<Gate>
oh, they are very useful
<Gate>
and if you are a performance nut they are slightly faster than double quoted strings.
rippa has quit [Ping timeout: 240 seconds]
xorgnak has joined #ruby
<Gate>
Basically, I use single quoted strings whenever I need to have a lot of double quotes or other things that would force me to put a lot of \s in my code
kyb3r has quit []
jerius has joined #ruby
<n_blownapart>
Gate: I need to review the differences. interpolation is very cool though. thanks will check it out.
<Gate>
n_blownapart: Enjoy.
<n_blownapart>
like the moniker too Gate
<Gate>
:)
awestroke has joined #ruby
burgestrand has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
ojongerius has joined #ruby
lggr has joined #ruby
leehambley has joined #ruby
mahmoudimus has joined #ruby
<n_blownapart>
Gate if you have time could you rephrase this or give an example? thanks: Basically, I use single quoted strings whenever I need to have a lot of double quotes or other things that would force me to put a lot of \s in my code
senny has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
baphled has quit [Ping timeout: 260 seconds]
samuel02 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Takehiro has quit [Remote host closed the connection]
Tearan has joined #ruby
arturaz_ has joined #ruby
n_blownapart has quit [Remote host closed the connection]
bartj3 has joined #ruby
leehambley has quit [Quit: leehambley]
Mon_Ouie has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
aganov has joined #ruby
Erfankam has joined #ruby
matrixise has quit [Ping timeout: 240 seconds]
dmiller has quit [Remote host closed the connection]
<mildfate>
Is there a one line assignment for assigning the value to a variable if the value is not null, and assigning an empty object to the var if it is null
lggr has quit [Ping timeout: 256 seconds]
ryanlecompte has quit [Remote host closed the connection]
nigelb has joined #ruby
dlh has joined #ruby
xorgnak has quit [Remote host closed the connection]
falieson has joined #ruby
slicslak has joined #ruby
friskd has joined #ruby
dhruvasagar has joined #ruby
lggr has joined #ruby
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
dmiller has joined #ruby
dmiller has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 246 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
justinmcp has joined #ruby
leehambley has quit [Quit: leehambley]
diegoviola has quit [Ping timeout: 244 seconds]
Eplemosen has quit [Read error: Connection reset by peer]
Eplemosen has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
jimeh has joined #ruby
mr_dynamix has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
dr_bob has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dr_bob has quit [Client Quit]
Eldariof-ru has joined #ruby
mahmoudimus has joined #ruby
awestroke has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 252 seconds]
dr_bob has joined #ruby
kstephens has joined #ruby
dr_bob has quit [Client Quit]
lggr has quit [Ping timeout: 256 seconds]
rotev has joined #ruby
dr_bob has joined #ruby
thaz has joined #ruby
elaptics`away is now known as elaptics
lggr has joined #ruby
indel has joined #ruby
maesbn has quit [Ping timeout: 246 seconds]
maesbn has joined #ruby
leehambley has joined #ruby
thaz has quit [Client Quit]
zigomir has joined #ruby
thaz has joined #ruby
maesbn has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
samphippen has joined #ruby
thaz has quit [Client Quit]
samuel02 has quit [Remote host closed the connection]
maesbn_ has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
berkes has joined #ruby
justinmcp has quit [Remote host closed the connection]
maesbn has quit [Read error: Connection reset by peer]
maesbn_ has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
slainer68 has joined #ruby
lggr has joined #ruby
slainer6_ has joined #ruby
chussenot has joined #ruby
chussenot has quit [Client Quit]
maesbn has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
limon7 has quit [Quit: limon7]
dangerousdave has joined #ruby
xorgnak has quit [Ping timeout: 260 seconds]
slainer68 has quit [Ping timeout: 252 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
wallerdev has quit [Quit: wallerdev]
rubious has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 240 seconds]
<roadt>
hi, rubygems-mirror is deprecated, i got ' Net::HTTPServiceUnavailable 503 Service Temporarily Unavailable readbody=false' after fetching rubygems.org/specs.4.8.gz (success).
<roadt>
is rubygems-mirror deprecated?
duracrisis_ has quit [Ping timeout: 246 seconds]
Banistergalaxy has joined #ruby
limon7 has joined #ruby
maesbn_ has joined #ruby
colinbm has joined #ruby
maesbn has quit [Read error: Connection reset by peer]
Axsuul has quit [Remote host closed the connection]
lggr has joined #ruby
AndChat| has quit [Ping timeout: 246 seconds]
Vainoharhainen has joined #ruby
Hanmac has quit [Ping timeout: 256 seconds]
tomaw_ has joined #ruby
maesbn_ has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
apok has quit [Ping timeout: 252 seconds]
GeekOnCoffee has quit [Ping timeout: 244 seconds]
cezar has joined #ruby
lggr has joined #ruby
Kruppe has quit [Ping timeout: 245 seconds]
thillux has joined #ruby
cezar has quit [Client Quit]
sepp2k has joined #ruby
Xeago has joined #ruby
monkegji_ has quit [Read error: Connection reset by peer]
monkegji_ has joined #ruby
Hanmac has joined #ruby
Eplemosen has quit [Ping timeout: 256 seconds]
GeekOnCoffee has joined #ruby
<Xeago>
kenneth: you could also use -> syntax for lamda/proc
<bnagy>
nataraj: lossy transliteration from something -> ascii is possible, but the reverse is simply impossible in huge numbers of cases
<bnagy>
because you can't reverse a lossy transformation
<bnagy>
['ü', 'u']-> 'u'
<bnagy>
chinese is worse
<Hanmac>
"its easy to piss in the ocean, but its hard to get the piss back"
<Xeago>
what you can do is dictionary it
shiki has quit [Remote host closed the connection]
dwon has quit [Quit: Leaving]
lggr has joined #ruby
<Xeago>
You'll have to transliterate the dictionary, and then use the entry that matches to get the original
<bnagy>
won't work, same reason
<Xeago>
bnagy: why won't it work?
<bnagy>
well, won't work reliably
<Xeago>
true
<Xeago>
but it's best effort
<bnagy>
because there are multiple word entries that will have the same transliteration
<bnagy>
so you don't know which one to pick
<bnagy>
chinese is again the pathological example
<Xeago>
chinese is horrible ;p
<bnagy>
or thai
mr_dynamix has quit [Quit: mr_dynamix]
<bnagy>
in any case, it would have to be very language specific
<Xeago>
dict/lang
<Hanmac>
korean has funny looking chars :P they look like alien-language :D
<bnagy>
whereas this unidecoder thing does some kind of a job for many languages
jenrzzz has quit [Ping timeout: 246 seconds]
<bnagy>
Hanmac: actually korean would probably be one of the better ones
<bnagy>
like, it's phoenetic, so with 'correct' transliteration it would probably reverse ok
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
<nataraj>
mine is an Indian language, Malayalam
<Xeago>
well, if it is only 1 language, dictionary might work
JonnieCa1he has joined #ruby
<Xeago>
depends on the collisions you get
JonnieCa1he is now known as JonnieCache|work
<bnagy>
nataraj: what's the script most like?
<bnagy>
it might work OK, if you can drop the implied vowels
<Hanmac>
bnagy korean language may look funny, but it sounds a bit "wrong" (i watched korean anime) ... japanise sounds better, but the language does not look so funny ...
<bnagy>
like for devanagari you'd have to convert 'ma' to म which should be ok
lggr has quit [Ping timeout: 246 seconds]
<bnagy>
as long as it's properly transliterated in the first place so ma and maa are different
<bnagy>
this is assuming your script is in that family
Elico1 has joined #ruby
arturaz has quit [Read error: Connection reset by peer]
arturaz has joined #ruby
lggr has joined #ruby
<clocKwize>
I did a few weeks of chinese lessons.. the only thing I can remember is how to ask where the toilet is
<clocKwize>
and the word for bar/pub
<clocKwize>
which I guess means I can ask where the bar/pub is
LouisGB has joined #ruby
<nataraj>
bnagy, emacs does a good transliteration, near perfect
<bnagy>
backwards?
<nataraj>
except for a few chars like 'in' 'ir' etc
<bnagy>
find out what it uses and use that then :)
<nataraj>
i select input-method as 'malayalam-itrans'
<nataraj>
"/usr/share/emacs/24.2/lisp/language/indian.el.gz" defines the letters
hsbt is now known as hsbt_away
samphippen has quit [Quit: Computer has gone to sleep.]
<nataraj>
anyway to map the unicode string a font?
<nataraj>
i wish type these in a ruby coded editor
<bnagy>
nataraj: it's not a font thing
lggr has joined #ruby
dhruvasagar has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegji_ has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 260 seconds]
beiter has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
xsdg has joined #ruby
Erfankam has quit [Read error: Connection reset by peer]
prtksxna has joined #ruby
ZubKonst has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
Erfankam has joined #ruby
levabalkin has joined #ruby
samphippen has joined #ruby
hsbt_away is now known as hsbt
ZubKonst_ has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
Gal3rielol has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
hsbt is now known as hsbt_away
Mon_Ouie has joined #ruby
SleepN0T has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
roadt has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Guedes_out is now known as Guedes
KevinSjoberg has joined #ruby
lggr has joined #ruby
Erfankam1 has joined #ruby
Erfankam has quit [Ping timeout: 246 seconds]
Criztian has joined #ruby
tvw has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.8]
xorgnak has quit [Ping timeout: 246 seconds]
atmosx has joined #ruby
<dangerousdave>
What does this do? @current_user = current_user_session && current_user_session.user
lggr has quit [Ping timeout: 255 seconds]
Russell^^ has joined #ruby
<dangerousdave>
i don't understand the &&
<Muz>
Runs "current_user_session", checks if a non-falsey return result appears. If it's falsey, returns the returned value. If it's non-falsey, runs current_user_session.user, and assigns the return value of that to @current_user
<Muz>
So, if current_user_session isn't valid, it'd never run the second argument, preventing the raising of a horrible runtimeerror or exception.
rotev has quit [Ping timeout: 246 seconds]
bartj3 has quit []
lggr has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<dangerousdave>
Muz: thanks, what is that construct called?
dpk has quit [Quit: Ceci n'est pas une broken pipe.]
<jcoglan>
is there a good intro to that? I know what I want to do in theory, but I don't know the openssl APIs to well
<Xeago>
openssh!=openssl
<Xeago>
how do you access your resource from the client?
<Xeago>
over http?
<jcoglan>
ah, thought you were referring to the OpenSSL module
lggr has quit [Ping timeout: 248 seconds]
<jcoglan>
I'm looking to encrypt something using authenticated encryption
<jcoglan>
been advised to use GCM, or one of the things SSL does, combining AES with HMAC
<Xeago>
what is the transport?
<matti>
;-)
reset has quit [Quit: Leaving...]
GoogleGuy has quit [Ping timeout: 260 seconds]
<Xeago>
or how does the client access the encrypted resource
<jcoglan>
there's a couple places I want to apply this
robertotauille has joined #ruby
<jcoglan>
one is generation of oauth tokens or sessions that self-contain data rather than just being identifiers
<Xeago>
if it is over http, use ssl with whatever authentication scheme you want
<jcoglan>
and the other is to encrypt a file I keep in dropbox
lggr has joined #ruby
<jcoglan>
this is stuff I can't just delegate to the transport, it's within http, e.g. tokens, cookies
<Xeago>
oauth usually works over http
<Xeago>
cookies are from http
<jcoglan>
oauth is delivered over https, but the token is exposed to the client, and must be protected from access and modification
<Xeago>
jcoglan: the client can do whatever he wants with the token
<Xeago>
if he modifies it, it is likely to get invalid
xyzodiac has joined #ruby
<Xeago>
jcoglan: go to coursera, and do the course about encryption
<jcoglan>
so, just getting away from http for a minute -- all I want to do is encrypt a blob of data, with an authenticated encryption scheme
<jcoglan>
I did that course, is why I'm asking how to apply it in ruby :)
<Xeago>
then you do not understand what went on in that course
<jcoglan>
how do you mean?
nataraj has quit [Ping timeout: 248 seconds]
rippa has joined #ruby
<Xeago>
do you know the difference between asymmetric and symmetric encryption?
JonnieCache|work has quit [Ping timeout: 240 seconds]
<jcoglan>
yes
<matti>
I do ;-)
<Xeago>
then encrypt your block using whatever encryption algorithm you please, share a secret, whether shared secret or personal secret over https with the oauth access_token
<Xeago>
s/block/blob
vlad_starkov has joined #ruby
<matti>
;-)
<jcoglan>
in this case I need to do symmetric -- I'm talking about transferring information from the server to the client. I want the server to send a blob to the client that the client simply sends back later, e.g. a token or cookie value
<Xeago>
than just use ssl + http authentication
<jcoglan>
the client never gets to read or change the content, and the server is both the encryptor and decryptor of the messages
<Xeago>
jcoglan: you cannot enforce that
prtksxna has quit [Remote host closed the connection]
<Xeago>
if you transfer something to a client, he can do whatever he want
<jcoglan>
I cannot enforce what?
<Xeago>
s
<Xeago>
you do not control the instructions on the client
lggr has quit [Ping timeout: 240 seconds]
<Xeago>
jcoglan: base64 it, put it in a secure cookie
<Xeago>
done
<jcoglan>
that's what I'm trying to prevent -- if the value you give to the client is either signed or authentically encrypted, you can tell if the client changed it when it sends the value back to you
<Xeago>
yes but even though you can tell that, you cannot prevent it
<Xeago>
use a secure cookie
<Xeago>
and encrypt the contents of that cookie however you want
<jcoglan>
in the oauth case, I'm talking about a token that the client JavaScript has to read and store and send back itself, it's not something the browser handles for you
vitoravelino`afk is now known as vitoravelino
demet8 has joined #ruby
<Xeago>
you absolutely have no idea what you want to do
<Xeago>
therefore neither do I
levabalkin has quit [Quit: Page closed]
<jcoglan>
in the case of cookies, even if you send them over a secure transport, the client can read them and send back a modified copy -- you need to be able to deny access if the cookie has been modified
prtksxna has joined #ruby
<Xeago>
you really don't read what I am saying are you?
prtksxna has quit [Remote host closed the connection]
lggr has joined #ruby
<Xeago>
encrypt the contents of the cookie, base64 that, put that in a secure cookie
<Xeago>
if he changes it, it will render the contents invalid
<Xeago>
unless cracked
<Xeago>
and even than, it depends on whether the content is valid or not
<jcoglan>
okay, so that's what I'm asking -- given I've decided I want encrypt the cookie with GCM, what are the ruby APIs for doing that?
<Xeago>
GCM is more than just encryption
<Xeago>
duckduckgo will have an answer
<jcoglan>
it's authenticated encryption, right?
<Xeago>
yes but you have not considered authentication yet
<Xeago>
anyways, off for food
_bart has joined #ruby
leehambley has joined #ruby
Hamed-R has joined #ruby
yshh has quit [Remote host closed the connection]
xyzodiac has quit [Quit: Computer has gone to sleep.]
arietis has quit [Read error: Connection reset by peer]
<burgestrand>
jcoglan: rails does this out of the box for session cookies. Perhaps you could find implementation ideas there.
<jcoglan>
okay, great
<jcoglan>
thanks!
horofox has joined #ruby
<jcoglan>
does it default to the cookie store, or to server-side storage?
<burgestrand>
jcoglan: cookie store as far as I am aware.
<_bart>
how do I get all p tags that are 2 levels in using path on a nokogiri doc?
lggr has quit [Ping timeout: 256 seconds]
<burgestrand>
jcoglan: uses a configuration named session_secret which is used to encrypt the cookie contents to prevent fiddling.
<_bart>
I thought '//*/*/p' but I think that gets all the p tags at levels 3, 4, 5 and so on too
<burgestrand>
Oh, maybe it’s named cookie_secret, not session_secret.
<jcoglan>
right
<jcoglan>
thanks for the tip :)
<_bart>
Ah I think I only need to remove the first /
omry__ has joined #ruby
<Xeago>
/ wil see any subnode as a possible root node, and will in your case find everything
<Xeago>
//*
<Xeago>
iirc
lggr has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
flype has quit [Quit: Computer has gone to sleep.]
moshee has quit [Ping timeout: 240 seconds]
limon7 has quit [Quit: Leaving.]
d3vic3 has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
larissa has joined #ruby
samphippen has joined #ruby
kroniksenvy has joined #ruby
sspiff has quit [Remote host closed the connection]
<_bart>
Xeago: but doing //li for example, does select any li, not only the li's at the level just below root.
sspiff has joined #ruby
sspiff has joined #ruby
<Xeago>
it sees every node as a possible root, and then finds a li
berkes has quit [Quit: Ex-Chat]
<_bart>
Xeago: how do I specify that the root is the first element?
<_bart>
I mean, I want the root to be the real root if you know what I mean.
nataraj has joined #ruby
<Xeago>
/
<Xeago>
iirc
<_bart>
also I found this //*[count(ancestor::*) = 2], is it possible to limit that to selecting only p, li and tr?
<_bart>
oh
<Xeago>
no idea, my xpath knowledge is 10 years old kinda
<_bart>
you're right
<_bart>
the / works
morozovmorg has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
morozovmorg has left #ruby [#ruby]
morozovmorg has joined #ruby
morozovmorg has left #ruby [#ruby]
morozovmorg has joined #ruby
morozovmorg has left #ruby [#ruby]
freeayu has joined #ruby
hekin has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
margle has quit [Quit: Computer has gone to sleep.]
dpk has joined #ruby
morozovm has joined #ruby
lggr has joined #ruby
morozovm has left #ruby [#ruby]
nataraj has quit [Ping timeout: 246 seconds]
rotev has joined #ruby
morozovm has joined #ruby
morozovm has left #ruby [#ruby]
colinbm has quit [Quit: colinbm]
awestroke has joined #ruby
demet8 has quit [Quit: demet8]
justinmcp has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
morozovmdotorg has joined #ruby
awestroke has quit [Remote host closed the connection]
codefyre has joined #ruby
lggr has joined #ruby
mensvaga has joined #ruby
jerius has joined #ruby
cantonic has joined #ruby
d1zzYLuLz_ has quit [Remote host closed the connection]
Eldariof-ru is now known as eldariof
Jeff_D has joined #ruby
jerius has quit [Client Quit]
scx has joined #ruby
<Jeff_D>
Anybody know of a decent or promising Wiki implementation in Ruby out there? Padrino, Sinatra, Rails, anything… looking for a local project note catcher and possible project to contribute to
<Xeago>
gollum
haxrbyte has joined #ruby
SleepN0T has left #ruby [#ruby]
morozovmdotorg has left #ruby [#ruby]
<scx>
i have ruby script in UTF-8; i want to execute shell command from it, but in other locale/encoding (latin-x, where x is [[:digit:]]); how to do that?
morozovm has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
mark_locklear has joined #ruby
fbernier has joined #ruby
haxrbyte has quit [Remote host closed the connection]
jhchabran has quit [Ping timeout: 255 seconds]
haxrbyte has joined #ruby
luckyruby has joined #ruby
geekbri has joined #ruby
<Jeff_D>
Xeago: d'oh! should have remembered. Thanks :)
<Xeago>
not sure if you want to git commit every thought you ever have tbh :)
<burgestrand>
scx: you mean you need the command string to be in a latin encoding?
flype has joined #ruby
flype has quit [Client Quit]
lggr has joined #ruby
jhchabran has joined #ruby
williamherry has joined #ruby
<scx>
burgestrand: yes, and i want to convert result from latin to utf-8
<burgestrand>
scx: all ruby strings come with an #encode method that accepts the target encoding. Say "å".encode("ISO-8859-1")
<burgestrand>
scx: it will allow you to convert from/to UTF-8 and your latin encodings
<Jeff_D>
Xeago: Not really. My sweet spot would be something about on the complexity/functionality balance of Dokuwiki (PHP) that lets me poke around and learn from other people's Ruby code.
dhruvasa1ar has joined #ruby
<scx>
when i execute command using "exec" or "system" i can't get results in ruby; when i use `command` i can't use custom string
<Jeff_D>
ideally Padrino, since I'm learning that now, but I've been working on a commercial Rails project for over a year now, so that works, too. You'd think I'd have remembered Gollum
<scx>
burgestrand: ^^
jerius has joined #ruby
dhruvasagar has quit [Quit: leaving]
<Xeago>
Jeff_D: you want to do note taking, and hav eit synced through mobile devices?
dhruvasagar has joined #ruby
krawchyk has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
<burgestrand>
scx: you can do string interpolation inside `
<Jeff_D>
Xeago: don't care so much about mobile; something I can run from my local Mac and have accessible on the LAN would work just fine
<burgestrand>
scx: be careful with shell escape characters, use Shellwords.escape from shellwords in stdlib
<burgestrand>
Jeff_D: note taking? Have you looked at notational velocity?
<burgestrand>
I mean, it’s not a wiki, but hey.
<Jeff_D>
point. I haven't, I'll take a look at it. Thanks.
<Xeago>
notational velocity is the one I was looking for
<Xeago>
ty
lggr has joined #ruby
ndboost has quit [Remote host closed the connection]
<Jeff_D>
Xeago: Need to head out now… back to the salt mines, to work with my trusty toothpick
dhruvasagar has quit [Client Quit]
Jeff_D has quit [Quit: JMP $]
dhruvasagar has joined #ruby
<burgestrand>
It’s awfully useful. You don’t even need the tagging behaviour to boot, just write plaintext words and add a weird prefix to them and use that in the fulltext search, e.g. #ruby, #sinatra, #web.
invisime has joined #ruby
<scx>
burgestrand: thx
frogprince_mac has joined #ruby
<burgestrand>
scx: :)
<burgestrand>
scx: keep in mind the output is *expected* to be in Encoding.default_external
otters has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Client Quit]
<burgestrand>
scx: but it is in no way converted by default, so for the return value you’ll either need to change Encoding.default_external, or force the encoding of the output before you convert it back to UTF-8
<KevinSjoberg>
I just created a gist for a little problem solving challenge? Anyone interested in submitting a solution in Ruby? :)
<Xeago>
Can you solve it? If the answer is yes, can you write => Write a program
<Xeago>
don't ask if they can, tell them to
colinbm has quit [Quit: colinbm]
<Xeago>
also, what do you mean by the note?
g-ram has joined #ruby
<Xeago>
KevinSjoberg: shouldn't be too hard to write
tommyvyo_ has joined #ruby
<KevinSjoberg>
Xeago: I removed the "can". I agree, it was unnecessary. I also removed the note.
JonnieCache|work has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<KevinSjoberg>
Now I'm looking forward for solutions.
<Xeago>
it still says "Can you solve it?"
lggr has quit [Ping timeout: 252 seconds]
lanli has quit [Quit: lanli]
sailias has quit [Quit: Leaving.]
<Spooner>
KevinSjoberg : The most obvious difficulty is 99 not being 099. I assume it is a string, not a BigNum, by the way?
daniel_- has quit [Ping timeout: 240 seconds]
Elico1 has quit [Quit: Elico1]
daniel_- has joined #ruby
carlyle has joined #ruby
<KevinSjoberg>
Xeago: I missed that part. Removed. Now it just tell the user to write a program that encrypt/decrypt.
deadalus has joined #ruby
colinbm has joined #ruby
<KevinSjoberg>
Spooner: The numbers should all be integers and then converted.
lggr has joined #ruby
<Spooner>
You mean they are [1, 1, 5, 1, 1, etc]? It really isn't clear what they actually are.
luckyruby has quit [Remote host closed the connection]
<Spooner>
Or [115, 115, 95, etc] ?
<Spooner>
Or "115115etc"
<KevinSjoberg>
Spooner: That it part of the solving. First you have to determine what they actually are, when you have done that, the easy part is left.
<Spooner>
No, I don't know what I'm _given_.
<Spooner>
I'm not talking about working out what they represent. I need to know what the input is!
JustinCampbell has joined #ruby
carloslopes has joined #ruby
luckyruby has joined #ruby
<Spooner>
Oh, 4th option: 1151159511610110199114 might be given as a BigNum.
<KevinSjoberg>
Spooner: Oh, my bad. I'll make that more clear. The input to encrypt and decrypt should be a string.
bawer has joined #ruby
<Spooner>
Yeah, that is what wasn't clear. Thanks.
dr_bob has joined #ruby
luckyruby has quit [Remote host closed the connection]
<KevinSjoberg>
Spooner: Sorry about that. I just updated the gist.
GoGoGarrett has joined #ruby
<Spooner>
Also, since I'm being picky, "letters" is terribly vague. I assume you mean A-Za-z, not all possible letters (e.g. ö). The example only uses a-z (and underscore, of course).
[Neurotic] has quit [Remote host closed the connection]
<Xeago>
Spooner: limit it to ascii
lggr has quit [Ping timeout: 244 seconds]
xpen has joined #ruby
<Spooner>
xeago Not my choice what the limitations of the problem are.
snearch has joined #ruby
<KevinSjoberg>
Spooner: The limitation is ASCII characters a-zA-Z 0-9.
<Xeago>
wops quoted the wrong guy
jeffreybaird has joined #ruby
slainer68 has joined #ruby
tnk1 has quit [Ping timeout: 252 seconds]
<KevinSjoberg>
Spooner: I've also added the solution to the first example so now the order of the characters in the final output should be more clear.
lggr has joined #ruby
bluenemo has quit [Ping timeout: 240 seconds]
<Xeago>
KevinSjoberg: I have no idea how you went from ss_teecr to s_ecrets
fixl has joined #ruby
<Spooner>
Thanks! I like clear specifications. I'd also say "write a program to" is unclear. It should be "two methods, #encode and #decode that each take a string parameter". Why? Because you could be asking for a single method that first decides whether it is an encoded or decoded string. alternatively, it could be a CLI program...etc, etc, etc.
<KevinSjoberg>
Spooner: Great feedback.
<KevinSjoberg>
Xeago: There is some logic behind it :)
<Xeago>
alright figured that out
codefyre has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<Spooner>
KevinSjoberg : The current version now allows numbers and doesn't allow underscores! ;)
<Xeago>
pop 0 or -1 from the string, but reverse this
<Spooner>
The secret word wasn't s_ecrets it was ss_teecr
<KevinSjoberg>
Spooner: Fixed, it slipped through.
<Spooner>
That was Xeago saying s_ecrets!
fermion has joined #ruby
<Xeago>
!
<KevinSjoberg>
Spooner: The secret word is s_ecrets but before repositioned it is something else.
<Spooner>
Xeago Oh no, you were correcting Kevin too. Sorry.
<KevinSjoberg>
Brb.
<Xeago>
wot?
<Xeago>
I have no idea
lggr has quit [Ping timeout: 260 seconds]
<Xeago>
to go from s_ecrets to ss_teecr is doable, reversing it is a bit harder
ffranz has joined #ruby
<Xeago>
I guess you can just insert it at an index
<Xeago>
toggling between i and length-i
beiter has quit [Quit: beiter]
gani has joined #ruby
_try4_ has joined #ruby
<Xeago>
where length is the string in construction and i is 0 to the length of the ascii you computed
codefyre has quit [Quit: Leaving]
lggr has joined #ruby
mohits has quit [Read error: Connection reset by peer]
xpen has quit [Ping timeout: 240 seconds]
samphippen has joined #ruby
fmcgeough has joined #ruby
ndboost has joined #ruby
philcrissman has joined #ruby
Coolhand has joined #ruby
shiki has quit [Remote host closed the connection]
xclite has quit [Remote host closed the connection]
mohits has joined #ruby
asuka has quit [Ping timeout: 240 seconds]
<KevinSjoberg>
Xeago: The repositioning is done by taking the string in characters of two. So "ss_teecr" becomes [['s', 's'], ['_', 't'], ['e','e'], ['c', 'r']] and then printing the first in each pair which is "s_ec" and then first in each pair reversed "rest", together "s_ecrets".
Kruppe has joined #ruby
<KevinSjoberg>
"rest" should be "rets", a typo of mine.
asuka has joined #ruby
LBRapid has joined #ruby
<Xeago>
that is easier :)
<KevinSjoberg>
Xeago: :)
karakedi has joined #ruby
elaptics is now known as elaptics`away
S3kx has joined #ruby
S2kx has quit [Read error: Connection reset by peer]
lggr has joined #ruby
xiexie_11 has joined #ruby
fixl has quit [Remote host closed the connection]
tchebb has quit [Ping timeout: 264 seconds]
<KarlHungus>
anyone know offhand what config option i set in bundle to override the value of --with-opt-dir= for all gem builds
daniel_- has quit [Ping timeout: 240 seconds]
philcrissman has quit [Remote host closed the connection]
asuka has quit [Ping timeout: 240 seconds]
_try4_ has left #ruby [#ruby]
philcrissman has joined #ruby
uris has joined #ruby
CodeFriar has quit [Quit: Leaving...]
asuka has joined #ruby
roelof has joined #ruby
roelof has quit [Client Quit]
Criztian has quit [Remote host closed the connection]
pygmael has joined #ruby
margle has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
asuka has quit [Ping timeout: 244 seconds]
justinmcp has quit [Remote host closed the connection]
asuka has joined #ruby
Knodi has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
JonnieCache|work has quit [Ping timeout: 248 seconds]
CodeFriar has quit [Quit: Leaving...]
burgestrand1 has joined #ruby
yshh has joined #ruby
nochamani has left #ruby [#ruby]
burgestrand has quit [Ping timeout: 256 seconds]
rumba has joined #ruby
Drewch has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
freeayu has quit [Remote host closed the connection]
mikepack has joined #ruby
theRoUS has quit [Ping timeout: 240 seconds]
Drewch has joined #ruby
macmartine has joined #ruby
flashuni has joined #ruby
reuf has joined #ruby
<emdub>
anyone familiar with using a LogFormatter with Logger? i'd like to be able to use a LogFormatter to prepend the class name of the class that i'm in that makes the call to write a log line, but when using a LogFormatter all my class.name's are LogFormatter, not the calling class
lggr has quit [Ping timeout: 256 seconds]
jerius has quit [Quit: Computer has gone to sleep.]
BadLarry has joined #ruby
jerius has joined #ruby
lggr has joined #ruby
juarlex has quit [Ping timeout: 245 seconds]
davidcelis has quit [Quit: K-Lined.]
davidcelis has joined #ruby
bawer has quit [Ping timeout: 248 seconds]
und3f has quit [Quit: Leaving.]
flashuni has quit [Remote host closed the connection]
aquarant_ has quit [Remote host closed the connection]
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 245 seconds]
<lectrick>
shevy: 1) considering pole dancing is mainstream now, i thought that was a good sign of female archetype resolution ("angel" vs. "sex bomb"). 2) for everything else there's fetlife.com
<lectrick>
shevy: (responding to your comment from 45 mins ago)
<shevy>
ah
<shevy>
wait what
jgrevich has joined #ruby
<shevy>
female archetype resolution
<shevy>
???
<shevy>
lectrick, I am a simple person... can you bring this down to my level of understanind?
<shevy>
understanding
<lectrick>
you know, how women kind of have to choose between being "good" and "bad" even though they're two sides of the same coin
<shevy>
hmmm
sent-hil has quit [Remote host closed the connection]
<shevy>
you mean those women that slap you after they kiss you passionately?
<lectrick>
Schwing.
<Gate>
I figured the comment was just meant to say that the tech world is a sausage-fest.
<lectrick>
Gate: Well that too. What else is new lol? But hey there's this http://railsgirls.com/ Watch the drooling.
<shevy>
Gate man I picture the tech world as a place filled with snipers and assassins
<lectrick>
It's not just a sausagefest, it's often a misogynist sausagefest
<shevy>
a bit like the game assassin's creed, but you never know who is an assassin and who is a real person...
<lectrick>
shevy: i like your analogy
* shevy
peers at lectrick suspiciously.
lggr has joined #ruby
<shevy>
I think you are an assassin
Takehiro has joined #ruby
<lectrick>
hahahaha
<Gate>
lectrick: I wouldn't go to the extreme of mysogynist. Only the brogineers would qualify, I think
<shevy>
lectrick I am a bit bored right now... I am going through old ruby code, and trying to look at places I can improve
<lectrick>
well, since we're speaking in stereotypes... lol.
<Gate>
techies do tend to latch on to archetypal views of people (especially women) but I've met mysogynists and most of us don't qualify
`gregorg` has quit [Ping timeout: 245 seconds]
<lectrick>
shevy: some guy pointed to his new site today. i said what was it built in. he said CakePHP. I said that's like choosing masturbation over Sex on Rails.
carlyle has joined #ruby
<lectrick>
/some sarcasm there, but not 10)%
cantonic_ has joined #ruby
<lectrick>
100% even
<lectrick>
I am stuck on a horrendous deep bug in the middle of a Rails 3.1 codebase upgrade
<lectrick>
I want a medal after I get this suite passing on 3.1
Hanmac has joined #ruby
zigomir has quit [Quit: Leaving]
<shevy>
yeah I dont really understand why people still use php
<lectrick>
Gate: Yes re: your opinion on techies.
<shevy>
I think it is because of .php files and how quickly you can build something
<shevy>
in Ruby, learning RoR is HUGE compared to that
<lectrick>
That's good. Keeps all the riffraff out
<shevy>
and using .cgi instead of .php really just sucks too ... :(
<shevy>
I think it is a mistake
<shevy>
the entry barrier should be as low as possible
<lectrick>
I agree. I was being sarcastic again.
<shevy>
I really like scripting languages
<shevy>
if I could pick only between C and C++ perhaps I would have never started to write anything much at all
jerius has joined #ruby
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
<shevy>
lectrick, I am among the dumb people of the population :)
SegFaultAX|work has joined #ruby
<shevy>
the HTML/CSS/Javascript guys (I hate javascript though...)
<lectrick>
shevy: you mean the men? :)
<shevy>
hmm
<shevy>
kind of yeah
<shevy>
well it depends
allanm has joined #ruby
<shevy>
I think designers are quite balanced between women and men
<shevy>
programmers though, tend to have much higher ratio in favour of men
<lectrick>
it's all good as long as nobody stands in anyone's way
<shevy>
it is strange too because in university, we here tend to have more women in %, and also more women who finish with a degree
<shevy>
(for most courses)
<shevy>
hehe
<shevy>
lectrick, do you like your boss :)
<lectrick>
yep
lggr has quit [Ping timeout: 260 seconds]
<Xeago>
shevy: php is made for web, ruby is not
ZubKonst_ has joined #ruby
<Xeago>
most tutorials for php start with html
<Xeago>
for ruby they do not :)
<lectrick>
it may be that more men enjoy being analytical. it isn't useful to stereotype since some women enjoy that too. maybe not a majority, but it doesn't matter. so I say just let everyone run down the road they want to
jlebrech has quit [Remote host closed the connection]
<Xeago>
because php is for web, it is bad at everything, because the web is not a homepage it has changed too much
<shevy>
yeah php is really usable pretty much only for web stuff
<shevy>
8 years ago I started writing a MUD in php
<Gate>
We could always get a pure-erb web frameworkd out there, and firmly debase the entire ruby community ;)
<shevy>
that SUCKED ...
<lectrick>
there's plenty of room for women in tech, in fact dev teams are often sorely in need of some sensitivities that women are often better at (stereotype disclaimer)
dmiller has joined #ruby
<shevy>
(in fairness though, I did not finish it in ruby either... it's so much work)
* Xeago
used some php for sysadmin scripts a loong time ago
<arturaz>
Gate, ever heard of mod_ruby?
juarlex has joined #ruby
<lectrick>
php standing for "personal homepage" seems to indicate it's web-focused
<Gate>
arturaz: as in the deprecated name for passenger, or something else?
<Xeago>
lectrick: php is designed for homepages from the 1995's
ZubKonst has quit [Ping timeout: 256 seconds]
<Xeago>
or older
<Xeago>
it has then been monkeypatched
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<lectrick>
Pretty Horrible Programming
<blazes816>
php doesn't stand for personal homepage
savage- has joined #ruby
<Xeago>
blazes816: the initial acronym did
<lectrick>
^^
x0F_ is now known as x0F
<Gate>
its a recursive backronym
nochamani has quit [Remote host closed the connection]
<Xeago>
they changed it because it got too many negative critic
<lectrick>
whatever guido says
<arturaz>
bah. I wish ie & safari would die
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
<Xeago>
atm it is php hypertext processor
<lectrick>
arturaz: why safari? it's ok
davidcelis has joined #ruby
<Xeago>
safari is ok arturaz, it follows standards
<blazes816>
interesting. didn't realize they changed what their acronym stood for.
<blazes816>
not surprising
prox|a has joined #ruby
<arturaz>
lectrick, until you want to set a cross-domain cookie
<Xeago>
arturaz: that is a security 'feature' :)
pigggie_ has joined #ruby
<arturaz>
yeah
<arturaz>
sure
tekmaster has joined #ruby
<arturaz>
it still deserves to die
<lectrick>
yeah it is
Morkel has quit [Quit: Morkel]
JJMalina has joined #ruby
<shevy>
hmm
<Xeago>
arturaz: try using lynx :)
<shevy>
I hope that matz makes mruby super fast
AlbireoX`Laptop has joined #ruby
<lectrick>
i still have no idea how twitter messaged all my contacts by clicking a link in a hacked tweet. I thought XSS protection is the standard these days
jaylevitt has joined #ruby
<lectrick>
Cross domain cookies seem like a XSS security nightmare
<arturaz>
cookies and xss?
fredjean_ has joined #ruby
karstensrage has quit [Quit: changing servers]
<Xeago>
arturaz: yes, cookies and xss
<lectrick>
yes, since any site you trigger a request to sends the cookies for that site along
<Xeago>
or actually, CORS
<lectrick>
including any auth cookies you have
SegFault1X has joined #ruby
<Xeago>
arturaz: do you want a solution?
<Xeago>
load a hidden iframe, inject javascript to set cookie, done
<lectrick>
would an iframe work?
<lectrick>
boom
<Xeago>
that is the 'official' workaround
<Xeago>
which is well documented since 2008
<Xeago>
welcome to the web :)
ryanlecompte has quit [Read error: Connection reset by peer]
tekacs has quit [Ping timeout: 246 seconds]
fortysixandtwo has quit [Ping timeout: 246 seconds]
pigggie has quit [Ping timeout: 246 seconds]
Mon_Ouie has quit [Ping timeout: 246 seconds]
SegFaultAX has quit [Ping timeout: 246 seconds]
piotr__ has quit [Ping timeout: 246 seconds]
roadt has quit [Ping timeout: 246 seconds]
fredjean has quit [Ping timeout: 246 seconds]
fbernier has quit [Ping timeout: 246 seconds]
Jay_Levitt has quit [Read error: Connection reset by peer]
tekmaster is now known as tekacs
tommyvyo_ has quit [Ping timeout: 246 seconds]
fredjean_ is now known as fredjean
piotr_ has joined #ruby
AlbireoX has quit [Read error: Connection reset by peer]
nateberkopec has quit [Read error: Connection reset by peer]
kenneth has quit [Ping timeout: 246 seconds]
zii has quit [Ping timeout: 246 seconds]
virtualentity has quit [Ping timeout: 246 seconds]
<lectrick>
i knew it. and even that is gross.
tchebb has quit [Ping timeout: 246 seconds]
fortysixandtwo has joined #ruby
tommyvyo_ has joined #ruby
roadt has joined #ruby
Takehiro has quit [Remote host closed the connection]
<Xeago>
lectrick: the other option is cors in header thing
<Xeago>
safari follows the http standard here strictly
Hanmac has quit [Remote host closed the connection]
<Spooner>
zcreative : There are also #rails and #ror and #rubyonrails channels, since I assume you are leaping into Rails then (though look at Sinatra too, depending on your needs).
elaptics is now known as elaptics`away
<zcreative>
yeah, im sitting in rubyonrails atm too.
<_bart>
dup(p1 = v1) Copy this Document. An optional depth may be passed in, but it defaults to a deep copy. 0 is a shallow copy, 1 is a deep copy.
<Spooner>
OK, that isn't so good.
<_bart>
but it doesn't work because when I try to do .dup(1) I get, 1 argument for 0 error.
<_bart>
but I think they mean duplicate_node
<_bart>
Spooner: because the source ('show source') doesn't match
<Spooner>
That would tend to imply that you don't have a Document that you are trying to dup?
nat2610 has quit [Quit: Leaving.]
notVert has quit [Read error: Connection reset by peer]
<_bart>
undefined method `duplicate_node' for #<Nokogiri::XML::Element :(
* Spooner
shrugs.
<_bart>
Spooner: but ::element == ::node and that one also has dup, "Copy this node. An optional depth may be passed in, but it defaults to a deep copy. 0 is a shallow copy, 1 is a deep copy."
<_bart>
Spooner: I'm confused, why doesn't this work like they state.
<blazes816>
_bart: what about something like my_clone = Nokogiri::HTML(other_doc.to_s)
nat2610 has joined #ruby
sebastorama has joined #ruby
<_bart>
ugly code :(
lggr has joined #ruby
<blazes816>
i guess go with the prettier, non working code
<Spooner>
_bart : I dunno. Yeah, I'm with blazes816 on that ;)
<_bart>
In my opinion marshalling is very ugly too
<_bart>
I'll resort to regexping the non-html out..
<Xeago>
lol
notVert has joined #ruby
<scx>
how to do: sed -r -e 's/"/\\"/g; using gsub on string?
havenn has quit [Remote host closed the connection]
codefyre has quit [Quit: Leaving]
<Spooner>
Although I'm one to talk for implementing stuff in extensions that I probably should have just wrapped :$
dakine has joined #ruby
mucker has quit [Ping timeout: 240 seconds]
philcrissman has joined #ruby
deadghost has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 260 seconds]
dpk has quit [Quit: Asleep at the keyboard.]
kpshek has quit []
havenn has joined #ruby
jenrzzz has joined #ruby
zcreative_ has joined #ruby
alek_b has quit [Read error: Connection reset by peer]
kenneth has joined #ruby
alek_b has joined #ruby
lggr has joined #ruby
sent-hil has joined #ruby
zcreative has quit [Ping timeout: 245 seconds]
zcreative__ has joined #ruby
Hanmac has joined #ruby
morozovm has joined #ruby
<rafacv>
guys, i'm using headless gem in my jenkins server and I'm getting false negatives because of a race condition when two jobs start their builds at same time and headless share the Xvfb instance with the same screen number
<rafacv>
the first to finish terminates Xvfb and the other build fails
peneconleche has joined #ruby
parzorep has joined #ruby
<rafacv>
the author is using a tempfile with pids to control concurrency and i believe it's not the best way to achieve that
zcreative_ has quit [Ping timeout: 245 seconds]
deadghost has joined #ruby
<rafacv>
I looked into File#flock to control the access to the file when both jobs happen to try the same screen name, but I had no luck
cespare has quit [Quit: WeeChat 0.3.7]
<rafacv>
do you guys know of any IPC technique or semaphores implementation in ruby?
griffindy has joined #ruby
<Spooner>
rafacv : I think drb or eventmachine are perhaps better ways. Sure there are many other implementations in Ruby.
slicslak has quit [Ping timeout: 244 seconds]
<Spooner>
But maybe I'm not understanding your use-case.
BMF has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 244 seconds]
Spooner has quit []
cespare has joined #ruby
DracoDan has left #ruby [#ruby]
<rafacv>
I'd like to guarantee that no two ruby processes running independently tries to create/write the same file at the same time
Russell^^ has joined #ruby
<rafacv>
Mutexes doesn't work here because they are for threads only
lggr has joined #ruby
pradeepto has quit [Quit: Coyote finally caught me]
tvw has joined #ruby
dpk has joined #ruby
dipnlik has joined #ruby
ltsstar has joined #ruby
jcoglan has quit [Ping timeout: 255 seconds]
dipnlik has quit [Client Quit]
dipnlik has joined #ruby
Trioke_ has joined #ruby
tmttt is now known as roadt
roadt is now known as tmttt
nochamani has joined #ruby
nochamani has quit [Remote host closed the connection]
hadees has joined #ruby
ForevernadeAFK has joined #ruby
dipnlik has left #ruby [#ruby]
Trioke has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
haxrbyte has quit [Ping timeout: 246 seconds]
bbttxu has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
Neomex has joined #ruby
Forevernade has quit [Ping timeout: 240 seconds]
beiter has quit [Quit: beiter]
Russell^^ has quit [Read error: Connection timed out]
hadees has quit [Ping timeout: 246 seconds]
jmorton_ has quit [Quit: jmorton_]
lggr has joined #ruby
dakine has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
jimeh has quit [Ping timeout: 245 seconds]
Targen has joined #ruby
<kenneth>
hey, what's the best way of making a hash conform to a certain standard. say, i want to only keep certain keys, throw the rest away
craq has joined #ruby
Meon has quit [Quit: Leaving]
awestroke has quit [Remote host closed the connection]
Meon has joined #ruby
<kaleido>
you could do something like myhash.each { |k,v| blahblahblah }
tyfighter has joined #ruby
<kaleido>
and evaluate tht way
<kaleido>
but im sure theres a better way
notVert has quit [Read error: Connection reset by peer]
<leehambley>
I wonder if someone can help me, i'm trying to make a call to find something in MongoDB, they don't have a blocking call (lame.) so I have to try and recreate those semantics myself, I've been trying with an "until result = mongo.find(......)", i've tried all sorts of wizardry with Timeout#timeout and Thread.pass,e tc
bbttxu has quit [Quit: bbttxu]
Ankhers has quit [Remote host closed the connection]
jrist-dogwalk is now known as jrist
lggr has quit [Ping timeout: 260 seconds]
Enchilada has joined #ruby
<Enchilada>
Is Ruby a good replacement for sed/awk?
* Hanmac
says maybe
<Enchilada>
I don't have time to learn everything under the sun.
<Enchilada>
hmm ok
jgarvey has quit [Quit: Leaving]
<leehambley>
Enchilada: in some cases, it can be - but more often than not it's a terribly *slow* substitute
carlyle has quit [Ping timeout: 245 seconds]
<leehambley>
but the answer is "it depends"
<Enchilada>
ok
sepp2k has quit [Remote host closed the connection]
thone_ has quit [Ping timeout: 246 seconds]
<Hanmac>
Enchilada learning ruby is good, you can do mostly everything you could in other languages ... you could even make 3D-Games in ruby
jrist is now known as jrist-bbl
<Enchilada>
heh
lggr has joined #ruby
thone has joined #ruby
Meon__ has joined #ruby
baphled has quit [Ping timeout: 256 seconds]
daniel_- has quit [Ping timeout: 240 seconds]
jmorton_ has quit [Quit: jmorton_]
Ysgard has quit [Quit: Leaving]
hadees has joined #ruby
bassclef has joined #ruby
bapa has quit [Ping timeout: 256 seconds]
pygmael has quit [Quit: pygmael]
Guedes0 has joined #ruby
saschagehlich has quit [Ping timeout: 255 seconds]
_nitti has quit [Remote host closed the connection]
<bassclef>
anyone have any idea when i use json gem i get the follow error /Users/fluffheadsr/.rvm/gems/ruby-1.9.3-p125/gems/json-1.7.5/lib/json/ext/parser.bundle: undefined class/module Encoding (ArgumentError)?
Meon_ has quit [Ping timeout: 260 seconds]
jmorton_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
<pdtpatrick>
bassclef: maybe post the full error along with how you are trying to use it. Someone might be able to better that way.
<bassclef>
pdt yep one sec
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
ZubKonst_ has quit [Remote host closed the connection]
ltsstar has quit [Quit: ltsstar]
alanp has joined #ruby
lggr has joined #ruby
Ysgard has joined #ruby
Takehiro has joined #ruby
Ysgard has quit [Client Quit]
atmosx has left #ruby ["WeeChat 0.3.8"]
stopbit has quit [Quit: Leaving]
CarlB_the_great has quit [Remote host closed the connection]
alanp_ has quit [Ping timeout: 256 seconds]
bricker has quit [Ping timeout: 246 seconds]
jmorton_ has quit [Quit: jmorton_]
daniel_- has joined #ruby
internet_user has quit [Remote host closed the connection]
<falieson>
then again… the join statement is matching two text-fields
<falieson>
so think that's it?
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<Spooner>
pdtpatrick : We don't usually manually loop like that with while and i -= 1. Instead: i.downto(1) do |i|...end
<pdtpatrick>
?
<bassclef>
anyone have any idea why this is telling me that my api has moved to a new URL, i'm pretty sure my code points to that URL correct? https://gist.github.com/3823722
rtl has joined #ruby
tvw has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
<pdtpatrick>
sounds like it is saying -- whatever site you're hitting has moved "300" error.
uris_ has joined #ruby
tvw has joined #ruby
bapa has quit [Ping timeout: 255 seconds]
nat2610 has quit [Quit: Leaving.]
<pdtpatrick>
Spooner: I didn't ask a looping question. I think you were referring to falieson
dnstbr has quit [Quit: Computer has gone to sleep.]
<Spooner>
Oh, I'm sorry. You are right. Comment about "while" was at falieson
<bassclef>
no its giving me a 301 redirect pdt, or were you talking to someone else?
chrishunt has quit [Ping timeout: 246 seconds]
<pdtpatrick>
bassclef: what's the full site you are trying to hit? im only seeing three octets up there. Is there a fourth ?
nat2610 has joined #ruby
kpshek has quit []
uris has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
justinmcp has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
scx has quit [Ping timeout: 245 seconds]
mmitchell has joined #ruby
Dreamer3 has joined #ruby
swarley has joined #ruby
rubious has joined #ruby
havenn has quit [Remote host closed the connection]
frogprince_mac has quit [Quit: Leaving...]
mmitchel_ has joined #ruby
<bassclef>
yea
<bassclef>
i just didnt wanna post my ip's to the world
<bassclef>
the api is there
<bassclef>
i got past that i think
<bassclef>
i'm getting a 400 bad request back now
<bassclef>
so that's abetter result :)
lggr has quit [Ping timeout: 260 seconds]
conor_ireland has quit [Quit: conor_ireland]
<pdtpatrick>
cool deal :)
mmitchell has quit [Ping timeout: 248 seconds]
<bassclef>
a little unsure how to format json in ruby
<Spooner>
As it uses there, you just #to_json it ;)
lggr has quit [Ping timeout: 248 seconds]
<Synthead>
with optionparser, if I set an option as --thislongoption, but run my script as --thislongoptio, it doesn't fail with OptionParser::InvalidOption. Why?
<bassclef>
spooner
<bassclef>
yes, but i'm unsure how to have 2 values in one section, they don't show an example
tvw has quit [Read error: Connection reset by peer]
<Spooner>
Two values?
<bassclef>
like "params" => "users" => @user,"password" => @pass
<bassclef>
think i got it though
bzprod has quit [Quit: Leaving...]
scx has joined #ruby
aquaranto has quit [Remote host closed the connection]
<Spooner>
Oh, you mean nesting your hashes. h = {"a" => { "b" => { "c" => "d"}}} would be valid (and h["a"]["b"]["c"] == "d" in this case).
<bassclef>
yes
<bassclef>
thanks
lggr has joined #ruby
chrishunt has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
shadoi has joined #ruby
ckrailo has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
uris_ has quit [Quit: leaving]
<falieson>
Spooner: "we usually do i.downto(1) do |i| … end , is there something on ruby's end that it would process that significantly faster than the current way? like i said its taking 20s+ to do each row… and its only 280 rows
uris has joined #ruby
sailias has quit [Quit: Leaving.]
<Spooner>
falieson : It isn't a speed thing, but a style thing.
lggr has joined #ruby
<falieson>
haha, well I suppose I'll get more stylish as I go
<Spooner>
You do seem to be making a lot of database requests in the loop. They will take 99.99999% of the processing time.
<falieson>
its interesting you were just talking about hash tags
bier has quit [Ping timeout: 248 seconds]
dmiller has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
chrxn has joined #ruby
nightfalcon has joined #ruby
<falieson>
I have a conditional matrix with 48 possibilities and I'm afraid that I have to right an if then statement for each one
<falieson>
*to write an
<chrxn>
You have that right.
<falieson>
lol
mxweas has joined #ruby
<falieson>
it seems like there should be a better way to do it...
<Spooner>
falieson : You almost definitely don't need to use a 48-condition if/else unless something is very wrong.
<chrxn>
You may choose to exercise it, if you dare.
<falieson>
haha
elux has joined #ruby
sheenobu has left #ruby [#ruby]
Foxandxss has joined #ruby
Xeago has quit [Remote host closed the connection]
<chrxn>
A conditional matrix, huh?
Takehiro has joined #ruby
<falieson>
well same overall project I've been working on for a week now. I have about 10K pieces of text (tweets) which were analyzed over 3 questions. question 1 has 2 responses, q2 8responsibilities, and q3 3 responsibilities
<falieson>
I want to count how many times each of the 3x2x8 possibilities were selected…. each day
<Spooner>
OH yeah, that "thing" ;)
<falieson>
haha yeah
<falieson>
I'm finally too the fun part! analysis
<chrxn>
That problem doesn't seem as complex as you think it is, I think :-)
<falieson>
haha probably not
quazimodo has quit [Ping timeout: 244 seconds]
<falieson>
at least once each day's results are counted, its done . just planning to store 48 rows per day into another table and then reference the data statically
<chrxn>
It sounds like you need to just set up three filters that feed each other and feed each tweet into them
lggr has quit [Ping timeout: 246 seconds]
<chrxn>
bah
Takehiro has quit [Ping timeout: 248 seconds]
<falieson>
hmm
icole has quit [Remote host closed the connection]
<chrxn>
you already analyzed them, you just need to count
<falieson>
chrxn: that's what I'm thinking it will look like, i'm open to alternatives though… but I think that will be the easiest way to later do graphs against the mysql table
joofsh has quit [Ping timeout: 246 seconds]
<chrxn>
hmmm
bricker has joined #ruby
<Spooner>
You could generate graphics from the database directly, but I'm not sure how. Usually done in webby Railsy things and I'm no web guy.
mrsolo has quit [Quit: Leaving]
samphippen has quit [Quit: Computer has gone to sleep.]
<falieson>
Spooner: yeah that's what i'll do later once i get the data. I don't want to dynamically draw the graphics because the data for September 19th isn't going to change
<Spooner>
You have a very linear interpretation of time then.
ckrailo has quit [Quit: Computer has gone to sleep.]
<falieson>
people can't tweet backwards in time
My_Hearing has quit [Ping timeout: 246 seconds]
<chrxn>
This is an example of what you think it should look like?
baroquebobcat has quit [Quit: baroquebobcat]
ephemerian has quit [Quit: Leaving.]
<chrxn>
Or is this something you have already
<falieson>
chrxn: yeah, there's 8 options for policy
My_Hearing has joined #ruby
<falieson>
chrxn: so thats what i'm thinking it will look like but i'm open to alternatives
<falieson>
chrxn: just what i came up with my own limited understanding of the world
mrsolo has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
<falieson>
but its going to be the same 2x8x3 options everyday…
<chrxn>
Okay, l think that using associations, you could make this easier on yourself later
<chrxn>
btw, have you ever heard of datamapper?
<falieson>
chrxn: its an ORM right? I'm using sequel
<chrxn>
You're right. Sequel is along the same lines
<chrxn>
I'm not too familiar with sequel
<chrxn>
anyways, let me sketch what i'm thinking
lkba has joined #ruby
lggr has joined #ruby
<falieson>
sweet
<chrxn>
one resource may have contributed to more than one row if more than one policy was discussed? or is it one for one?
sent-hil has joined #ruby
sent-hil has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
recycle has quit [Remote host closed the connection]
<falieson>
1 to 1
<chrxn>
perfect
<falieson>
yeah, i tried to simplify it as much as possible
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
rakunHo has joined #ruby
Knodi has quit [Quit: Knodi]
chendo__ has quit [Ping timeout: 255 seconds]
bricker has quit [Ping timeout: 260 seconds]
skogis has quit [Ping timeout: 260 seconds]
chendo_ has joined #ruby
pskosinski has quit [Ping timeout: 256 seconds]
tbrock has joined #ruby
<tbrock>
hey guys, is there a way to avoid requiring 'test/unit' at the top of all my tests
<tbrock>
shouldn't i be able to require it in my fakefile and then use it in all the test tasks