jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Robtop__ has quit [Ping timeout: 258 seconds]
jgnagy_ has quit [Remote host closed the connection]
patarr has joined #ruby
lightheaded has quit [Ping timeout: 258 seconds]
jgnagy has joined #ruby
jameser has joined #ruby
Priyanka has quit [Ping timeout: 258 seconds]
muelleme_ has quit [Ping timeout: 268 seconds]
marcdel_ has joined #ruby
marcdel has quit [Ping timeout: 260 seconds]
jgnagy has quit [Ping timeout: 240 seconds]
patarr has quit [Ping timeout: 240 seconds]
mdqtpt has joined #ruby
UnknownSoldier is now known as tau
bronson has joined #ruby
thadtheman has quit [Ping timeout: 240 seconds]
SteenJobs has joined #ruby
marcdel_ has quit [Ping timeout: 260 seconds]
actionh4nk has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
hutch34_ has joined #ruby
cfec0b8d has joined #ruby
actionh4nk has quit [Ping timeout: 256 seconds]
Benyamin has quit []
vuoto has joined #ruby
muelleme_ has joined #ruby
brent__ has joined #ruby
eblip has quit [Quit: WeeChat 1.4]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34_ has quit [Ping timeout: 264 seconds]
thadtheman has joined #ruby
muelleme_ has quit [Ping timeout: 260 seconds]
brent__ has quit [Ping timeout: 264 seconds]
unshadow has joined #ruby
xenops has joined #ruby
nofxxx has joined #ruby
CloCkWeRX has joined #ruby
nofxxxx has quit [Ping timeout: 264 seconds]
muelleme_ has joined #ruby
jameser has joined #ruby
lightheaded has joined #ruby
Qchmqs has joined #ruby
muelleme_ has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
VladGh_ has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
Pumukel has quit [Ping timeout: 246 seconds]
VladGh has quit [Ping timeout: 268 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
patarr has joined #ruby
jameser has joined #ruby
mbertul has joined #ruby
jameser has quit [Client Quit]
jamesaxl has joined #ruby
muelleme_ has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
thadtheman has quit [Ping timeout: 240 seconds]
robnester has joined #ruby
muelleme_ has quit [Ping timeout: 268 seconds]
nobitanobi has joined #ruby
thadtheman has joined #ruby
hutch34_ has joined #ruby
nobitanobi has quit [Ping timeout: 256 seconds]
hutch34_ has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
muelleme_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
charliesome has joined #ruby
mdqtpt has quit [Read error: Connection reset by peer]
igniting has quit [Ping timeout: 256 seconds]
SteenJobs has quit [Quit: SteenJobs]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pulkit4tech has quit [Quit: Connection closed for inactivity]
nofxxxx has joined #ruby
igniting has joined #ruby
nofxxx has quit [Ping timeout: 260 seconds]
bkxd has quit [Quit: leaving]
bkxd has joined #ruby
charliesome has joined #ruby
Pumukel has joined #ruby
tau has quit [Remote host closed the connection]
rhyselsmore has joined #ruby
bkxd_ has joined #ruby
heyimwill has quit [Ping timeout: 240 seconds]
krasnus has quit [Ping timeout: 240 seconds]
pandaant has joined #ruby
Pumukel has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 260 seconds]
Zarthus has quit [Ping timeout: 260 seconds]
Elysia has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd_ has quit [Ping timeout: 246 seconds]
blackwind_123 has quit [Ping timeout: 258 seconds]
vuoto has quit [Remote host closed the connection]
bungoman has joined #ruby
blackwind_123 has joined #ruby
charliesome has joined #ruby
dionysus69 has joined #ruby
spicerack has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Zarthus has joined #ruby
spicerack has joined #ruby
bronson has joined #ruby
spicerack has quit [Client Quit]
spicerack has joined #ruby
spicerack has quit [Client Quit]
spicerack has joined #ruby
spicerack has quit [Client Quit]
spicerack has joined #ruby
spicerack has quit [Client Quit]
spicerack has joined #ruby
spicerack has quit [Client Quit]
bronson has quit [Ping timeout: 260 seconds]
heyimwill has joined #ruby
mbertul has quit [Quit: Leaving]
hutch34_ has joined #ruby
Elysia has joined #ruby
esObe_ has quit [Remote host closed the connection]
hutch34_ has quit [Ping timeout: 260 seconds]
eugenmayer has joined #ruby
<eugenmayer>
is there yet any way / workarround to let a thor command to return the proper exit code? yet it always returns 0, no matter what happened
oliv_____ has joined #ruby
bkxd has joined #ruby
jameser has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pulkit4tech has joined #ruby
oliv_____ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 240 seconds]
Autolycus has quit []
krasnus has joined #ruby
brent__ has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
antgel has joined #ruby
Berith has joined #ruby
blackmesa has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agent_white has quit [Quit: agent_white]
Berith has quit [Quit: WeeChat 1.0.1]
jgnagy has joined #ruby
sneakerhax has quit [Ping timeout: 264 seconds]
jgnagy has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
banisterfiend has joined #ruby
vuoto has quit [Client Quit]
CloCkWeRX has left #ruby [#ruby]
charliesome_ has joined #ruby
doublemalt_ has joined #ruby
nobitanobi has joined #ruby
despai has joined #ruby
DoubleMalt has quit [Ping timeout: 246 seconds]
nobitanobi has quit [Read error: No route to host]
nobitanobi has joined #ruby
xenops has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 268 seconds]
bkxd has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
xenops has joined #ruby
hutch34_ has joined #ruby
hutch34_ has quit [Ping timeout: 258 seconds]
blackmesa has joined #ruby
eugenmayer has left #ruby [#ruby]
muelleme_ has quit [Ping timeout: 268 seconds]
thadtheman has quit [Ping timeout: 256 seconds]
foxxx0 has quit [Quit: WeeChat 1.7]
flying has joined #ruby
tomphp has joined #ruby
foxxx0 has joined #ruby
tomphp has quit [Client Quit]
User458764 has joined #ruby
thadtheman has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 260 seconds]
thadtheman has quit [Ping timeout: 256 seconds]
davorb has quit [Read error: Connection reset by peer]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
davorb has joined #ruby
Pumukel has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
James123 has joined #ruby
Mon_Ouie has joined #ruby
<James123>
I have a hash of the form: { "foo" => 1, "bar" => [2, 3], "baz" => [4,5] }. Any ideas how to get all combinations of foo, bar, baz i.e. foo=1, bar=2, baz=4 | foo=1, bar=2, baz=5 etc.?
<elomatreb>
Verity: ^, Integer#chr may be useful too
<j416>
Verity: you seem rather stressed and confused. Perhaps take a step back and think about what you want your program to do; perhaps even write a short test for it. That way it'll be easier to reason about it, because you'll be able to say "I have this code, and I expect exactly this output".
muelleme_ has quit [Ping timeout: 240 seconds]
Jackneill has joined #ruby
<Verity>
j416, I keep running into things not working as I'd expect
<j416>
it's hard for us to know what you expect without a concrete example of what you have and what output you desire
<elomatreb>
You're doing something that's rather uncommon, treating strings as arrays of bytes is one of the things Ruby abstracts away normally
<Verity>
I';m working on a new program now
<Verity>
just for fun
<Verity>
I put my other one aside last night for a bit
<Verity>
it was too frsutrating
psychicist__ has joined #ruby
gloscombe has quit [Quit: gloscombe]
<j416>
Verity: instead of wrestling with Ruby as a language, try to think about your problem -- ask rather "How do I reverse a string in Ruby?" than "How can I make sure that one byte comes after another if I am modifying an array of bytes in-place?" -- XY issues.
<ruby[bot]>
Verity: # => /tmp/execpad-219a7c889505/source-219a7c889505:6:in `raise': exception object expected (TypeError) ...check link for more (https://eval.in/761466)
Mon_Ouie has quit [Ping timeout: 246 seconds]
<Verity>
thats odd
<j416>
and I apologise if I sound condescending; I am trying to offer advice on getting efficient assistance.
<Verity>
I need to get good at working byte level in ruby
<Verity>
I know its an odd choice for that
<j416>
^
<Verity>
but it seems to provide everything I need once I get it figured out
<j416>
well it's surely usable.
minimalism has quit [Quit: minimalism]
<Verity>
I need to get better at slowing odwn
<j416>
yes.
brent__ has joined #ruby
<Verity>
I often will get frustrated and go to read doc and gain nothing from it, only to go back and realize thats because I skipped a whole paragraph during my exasperation
<Verity>
making progress now with this unpack doc
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nofxxxx has quit [Remote host closed the connection]
renchan has joined #ruby
nofxx has joined #ruby
<plantfood>
you could make it complete a whole scrabble game from beginning to end. or perhaps more curious would be to play it against other peoples' scrabble solvers, like 100 times each
bkxd has joined #ruby
<Verity>
good idea =)
A124 has quit [Quit: '']
A124 has joined #ruby
hfp_work has quit [Quit: bye]
renchan has quit [Remote host closed the connection]
<grillon>
seems nice to make your environment reproductible
<j416>
interesting concept.
bkxd has joined #ruby
mbertul has joined #ruby
<grillon>
j416: sure, I'm just starting to use it and I have problems with gems.
kernelPaniq has joined #ruby
<grillon>
but don't mind I'll search a solution later. I was just searching a way to evite...hmmm to search :)
robnester has quit [Ping timeout: 240 seconds]
ixti has quit [Ping timeout: 264 seconds]
robnester has joined #ruby
<j416>
grillon: since each proper project will declare what gems and what gem versions it depends on, my guess is it's better to leave the gem stuff to ruby and not try to shoehorn that into something else
kith has quit [Quit: kith]
pankaj has joined #ruby
<grillon>
j416: I think you're right
bkxd has quit [Ping timeout: 240 seconds]
<Verity>
DONE
<Verity>
scrabble solver only took 15 mins or so =P
<Verity>
its nothing special, but it was fun
<Verity>
I submit it to the community now for audit
<Verity>
two problems, 1. it takes forever to read in large files. 2. it adds two bytes to the file for each op. Encreypt = +2 bytes Decrypt = +2 bytes
<Verity>
this is corrupting the file
<Verity>
it looks like it works ok for text files, but when I tried a program binary it broke
<eam>
instead of File.open(file_name, "r"), try File.open(file_name, "rb")
<eam>
same for writing
<eam>
this tells ruby to treat the data as binary data, not encoded text
<Verity>
I'll give this a try :)
<eam>
that's the first super easy thing to try, without looking further at what's going on
houhoulis has quit [Remote host closed the connection]
<Verity>
wow that fixed it
<Verity>
thank you eam
mooser has quit [Ping timeout: 240 seconds]
<eam>
you got it
<Verity>
its 1000x faster and works now
<eam>
without telling ruby the data is binary, it will try to use characters as the index unit instead of bytes
<eam>
if using bytes, foo[5] is "the start of foo plus 5 bytes" and so is O(1)
<eam>
but if using characters, foo[5] is "the start of foo, then count each character in the string until we find 5 -- because characters can be of different lengths"
thadtheman has quit [Ping timeout: 260 seconds]
<eam>
for short strings this doesn't matter, but when you get megabyte sized it becomes prohibitively expensive
<Verity>
aha, I see. that explains why this is so much faster now
<Verity>
but the extra bytes and the file corruption... what was causing that?
Pumukel has joined #ruby
<Verity>
reading it as chars instead of bytes, I assume but not sure the details of why
<eam>
not sure, I didn't really read the rest of yoru code - it looked like you were encrypting a file using crypt(3)?
<eam>
why not use openssl?
<eam>
generally it's not a good idea to roll your own encryption methods
<Verity>
it was a manual algorithm yerah
enterprisey has quit [Read error: Connection reset by peer]
<Verity>
I was ORing each keybyte with every msgbyte
<eam>
two big reasons: 1) it's proven to work and is a known quantity in terms of strength and 2) if performance is a concern, AES/openssl has hardware acceleration on modern intel chips and will be hundreds of times faster
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Verity>
I'll read over thjat example you sent
<eam>
these cpu extensions are essentially the reason large internet providers were able to offer ssl everywhere -- previously it was much, much more expensive
Pumukel has quit [Ping timeout: 256 seconds]
<Verity>
very cool =D, I didn't realize that
Fernando-Basso has quit [Quit: WeeChat 1.7]
DARPA has joined #ruby
pankaj has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Arpanet69 has quit [Ping timeout: 260 seconds]
muelleme_ has joined #ruby
thadtheman has joined #ruby
nertzy has joined #ruby
_joes_ has joined #ruby
jhack has joined #ruby
shinnya has joined #ruby
Deviation has quit [Ping timeout: 260 seconds]
SteenJobs has joined #ruby
roamingdog has joined #ruby
JeanCarloMachado has joined #ruby
hutch34_ has joined #ruby
roamingdog has quit [Ping timeout: 240 seconds]
DARPA has quit [Ping timeout: 240 seconds]
Arpanet69 has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
nobitanobi has joined #ruby
tenderlove has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
tenderlove has joined #ruby
_sfiguser has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
oliv_____ has joined #ruby
oliv_____ has quit [Remote host closed the connection]
thadtheman has quit [Ping timeout: 240 seconds]
antgel has quit [Ping timeout: 240 seconds]
br0d1n has quit [Quit: Leaving]
User458764 has joined #ruby
Pumukel has joined #ruby
pankaj has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
SteenJobs has joined #ruby
thadtheman has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
ace05 has joined #ruby
Tempesta has quit [Quit: See ya!]
<ace05>
hi
nofxxx has quit [Ping timeout: 240 seconds]
<Verity>
hey ace05 , welcome to ruby
Pumukel has quit [Ping timeout: 240 seconds]
pandaant has quit [Remote host closed the connection]
<ace05>
hi Verity
<ace05>
have a quick question to ask and see if anyone can shed some light on it
<Verity>
sure, go right ahead.
SteenJobs has quit [Ping timeout: 268 seconds]
<ace05>
i've got a ror application that calls a rails api when requesting data
Cohedrin has joined #ruby
<ace05>
when you run the api on a terminal and you effectively request something that return s a status 204 error for no content
<ace05>
however when you look at the page of the ror app using developer tools for a chrome browser, you see a status 200
<ace05>
how is that so?
<ace05>
i would have expected to see a 204 status error for no content from the api and a 204 status also shown when loading the page
<ace05>
i written an error handling helper to specifically catch 204 errors and when i check the logs to see what gets printed, i can see it is a 204 error
<ace05>
so is it between controller and view that somehow it is converted to a 200 ?
Channel6 has joined #ruby
<Verity>
I've never used rails, and it may even have its own channel, but hopefully someone will chime in
ace05 has quit [Remote host closed the connection]
ace05 has joined #ruby
<Verity>
ty, I see now
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Verity>
matthewd, one last question. "hey".chars.permutation.map &:join could you explain how thats working? .chars is the characters of the string, .permutation is all permutations of those chars, but what happens when map and &:join start getting involved
<Verity>
I'm trying to figure out this syntax so I can use it myself
<Verity>
if I put in "abcdefghijklmnopqrstuvwxyz" and processed for each group of 1, 2, 3, 4..etc letters, I would get every word in existence?
aglorei has quit [Quit: WeeChat 1.4]
aglorei has joined #ruby
<matthewd>
43! is 60415263063373835637355132068513997507264512000000000, so... yeah, that's gonna take a while.
<matthewd>
Verity: No.
<Verity>
I would need a loop that calculates all permutations of the string and then deletes the last character of the string and does it again until string empty
<matthewd>
Verity: You'd need repeated_permutation for that
User458764 has joined #ruby
* Verity
googles
ujjain has quit [Read error: Connection reset by peer]
<Verity>
wait that wouldnt work either
<Verity>
you['re right =D
<Verity>
took me a moment of thinking and then it clicked
oliv_____ has joined #ruby
<Verity>
this is all for fun right now anyway, time for some lunch and I'll take a look at repeated_permutation after
Rodya_ has joined #ruby
oliv_____ has quit [Ping timeout: 246 seconds]
noob has quit [Read error: Connection reset by peer]
nadir has quit [Quit: Connection closed for inactivity]
noob has joined #ruby
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Verity>
hopefully when I come back its done
<Verity>
bbl
d3d1rty has joined #ruby
Danny_ has joined #ruby
Danny_ has quit [Client Quit]
despai has joined #ruby
ujjain has quit [Ping timeout: 258 seconds]
tristanp has quit []
flegent has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thadtheman has quit [Ping timeout: 260 seconds]
kirun has joined #ruby
warrshrike has joined #ruby
<warrshrike>
Oi
<warrshrike>
whats the slickest one liner to do this in ruby?
<warrshrike>
Given an array of integers, return indices of the two which add to a target
<Nilium>
Too early for goldf
<Nilium>
golf
<Nilium>
Wow keyboard thanks ruin my joke
Arpanet69 has quit [Read error: Connection reset by peer]
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
<warrshrike>
Nilium: the jokes ruined...maybe you can tellme how now lol
<Nilium>
Still too early for golf.
<warrshrike>
~{*_*}~
<Nilium>
Anyway, since you have an array, I'd just sort it, walk it, and look for Y (assuming you want Y out of X + Y = Z)
<elomatreb>
Array#combination is another way
<Nilium>
Sort it specifically so you can just do a binary search on it for Y
psychicist__ has quit [Ping timeout: 257 seconds]
<warrshrike>
Nilium: would that be nlogn?
<Nilium>
Some log-ish
<Nilium>
I haven't had near enough coffee to analyze the words I type
<warrshrike>
yeah im looking for a slick looking one liner actually....
whiteline has quit [Remote host closed the connection]
muelleme_ has joined #ruby
ta_ has joined #ruby
<salih`>
matthewd: i saw rdoc , alot of file in doc folder
Xiti has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
inkshark has joined #ruby
thadtheman has joined #ruby
milardovich has joined #ruby
<matthewd>
salih`: I'm still not sure what you want, but the `ri` tool might help?
muelleme_ has quit [Ping timeout: 260 seconds]
<salih`>
ahh
<salih`>
i am checking
milardovich has quit [Remote host closed the connection]
<salih`>
yes matthewd
<salih`>
working
ta_ has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
<salih`>
matthewd: dir(
<salih`>
dir(
armando has quit [Remote host closed the connection]
<salih`>
dir() working in ruby ? matthewd
<matthewd>
That's a python function, so.. no.
inkshark has quit [Client Quit]
<salih`>
okey
whiteline has joined #ruby
inkshark has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
<Disavowed>
salih`: I've been using <your_object>.methods which is similar to dir()
tau has quit [Remote host closed the connection]
<Disavowed>
Although I'm sure there's a better way
<Disavowed>
Urgh, seems like every month I have to fix some readline dependency if I want to use a repl. I have no idea how I manage to mess it up so frequently
inkshark has quit [Client Quit]
bronson has joined #ruby
User458764 has joined #ruby
bronson has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 246 seconds]
br0d1n has joined #ruby
armando has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<salih`>
Disavowed: i am new at ruby , i am looking how works etc..
<salih`>
i did try Math.methods working well but require 'openssl' not works
<salih`>
:: could be different
<salih`>
i am not writing any program i am looking how works etc..
<salih`>
ahh
<salih`>
OpenSSL
<salih`>
working now
mooser has quit [Remote host closed the connection]
<salih`>
matthewd: thanks for ir etc.. i am looking
SteenJobs has joined #ruby
PaulCape_ has quit [Quit: .]
SteenJobs has quit [Client Quit]
volty has joined #ruby
marsjaninzmarsa has quit [Quit: ZNC 1.7.x-git-487-cbf5c38 - http://znc.in]
<cseder>
?
<salih`>
have a good day
salih` has quit [Remote host closed the connection]
<cseder>
wtf was that?
PaulCapestany has joined #ruby
<Radar>
"Have a nice day is a commonly spoken expression used to conclude a conversation"