senayar_ has quit [Remote host closed the connection]
lfox has quit [Quit: ZZZzzz…]
petey has quit [Ping timeout: 240 seconds]
senayar has joined #ruby
v1n has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
scmaccal_ has joined #ruby
scmaccal_ has quit [Excess Flood]
scmaccal_ has joined #ruby
scmaccal_ has quit [Excess Flood]
yekta has joined #ruby
senayar has quit [Ping timeout: 245 seconds]
yekta has quit [Client Quit]
jb41 has quit [Ping timeout: 260 seconds]
PragCypher has quit [Quit: Leaving]
scmaccal has joined #ruby
scmaccal has quit [Excess Flood]
<volty>
jb41: that simplicity made me forgot a.values_at(*b) // and I wonder why they defined values_at -- think that it is more difficult to remember that there's values_at than to just map
scmaccal has joined #ruby
scmaccal has quit [Excess Flood]
Matriks has quit [Remote host closed the connection]
sailias has joined #ruby
Zai00 has joined #ruby
Zai00 has quit [Client Quit]
boboc has joined #ruby
<boboc>
how can i format an flaot to show with the $ at the begining? from 10.5 to format $10.5 ?
PixelShuck is now known as SleeepingShuck
endash has quit [Quit: endash]
nerdy has quit [Quit: Computer has gone to sleep.]
yestermorn16 has quit [Remote host closed the connection]
petey has quit [Remote host closed the connection]
petey has joined #ruby
lemonsparrow has joined #ruby
funburn has joined #ruby
petey has quit [Ping timeout: 260 seconds]
roadt__ has joined #ruby
mxweas has joined #ruby
aryaching_ has joined #ruby
senayar has joined #ruby
roadt_ has quit [Read error: Operation timed out]
sectionme has joined #ruby
aryaching has quit [Ping timeout: 245 seconds]
senayar has quit [Ping timeout: 245 seconds]
sectionme has quit [Ping timeout: 264 seconds]
hogeo has joined #ruby
brennanMKE has joined #ruby
heidi has joined #ruby
<akemrir>
hi, it is possible to check length of unpack format?
brennanMKE has quit [Ping timeout: 246 seconds]
heidi has quit [Read error: Connection reset by peer]
heidi has joined #ruby
notjohn has quit [Quit: notjohn]
heidi has quit [Client Quit]
akemrir has quit [Quit: WeeChat 0.4.1]
a1ph4g33k has joined #ruby
<a1ph4g33k>
greetings all ... quick question I've never found an answer for ... # vs . ... as in Foo#bar vs Foo.bar ...
ehc has quit [Quit: ehc]
Xeago has joined #ruby
milesforrest is now known as milesforrest|afk
<ryanf>
a1ph4g33k: # = instance method, . = class method
Al___ has quit [Read error: Connection reset by peer]
<ryanf>
Foo.new.bar() vs Foo.bar()
<a1ph4g33k>
just as a notation for the function?
<ryanf>
yeah
<ryanf>
it's just a documentation thing
Al___ has joined #ruby
akemrir has joined #ruby
<a1ph4g33k>
gotcha. just wanted to be sure.
<a1ph4g33k>
because in code, # is going to be a comment and be thrown out.
<ryanf>
yeah
<a1ph4g33k>
just wanted to be sure.
<a1ph4g33k>
thansk.
<a1ph4g33k>
... thanks.
<ryanf>
yeah, kind of hard to google
<ryanf>
no prolbem
rippa has joined #ruby
<a1ph4g33k>
( 10 years of Ruby and still learning =) )
<a1ph4g33k>
( not being boastful )
Xeago has quit [Ping timeout: 245 seconds]
<a1ph4g33k>
anyways ... again thanks.
<LLckfan>
I have a Gateway laptop and when I opened the lid the power light was on but the laptop was asleep. When I pushed the power it started flashing with the lights for the light bulb and the battery but only when it was plugged in. Is this a sign I need a new tip end for my charger?
Al___ has quit [Read error: Connection reset by peer]
Al___ has joined #ruby
mrnugget has joined #ruby
<xybre>
I've seen that exact chat a few days ago. Are you some sort of weird bot?
<LLckfan>
not a bot
<BraddPitt>
thanks a1ph4g33k i actually had the same question
iliketurtles has quit [Quit: zzzzz…..]
mxweas has quit [Ping timeout: 260 seconds]
ukd1 has joined #ruby
ewnd9 has quit [Ping timeout: 264 seconds]
<xybre>
Why would someone post weird questions about laptops copy pasted over different days to different non-hardware related channels.
danshultz has joined #ruby
<pontiki>
maybe they're like the person with a phone problem
<Hanmac1>
xybre: a few days ago it was in this channel too (not a different)
Hanmac1 is now known as Hanmac
<pontiki>
we have become the general problem solving channel
<pontiki>
RUBY CAN DO EVERYTHING
<Hanmac>
xD
Al___ has quit [Quit: Al___]
dhruvasagar has joined #ruby
<ryanf>
that guy pasted the same thing in #bundler earlier today
LLckfan has left #ruby [#ruby]
<ryanf>
very subtle trolling?
<xybre>
Hanmac: You keep track of all the channels I'm in?
maletor has quit [Quit: Computer has gone to sleep.]
<pontiki>
how about real output
<xybre>
Wh..why are you doing throw catch?
<pontiki>
i guess now i'm wondering what the actual question is
<pontiki>
is this not data you are expecting?
<akemrir>
This is script that is launched at environment starts, and it gets SIGTERM from systemd.
workmad3 has joined #ruby
danshultz has joined #ruby
<xybre>
fantastic, so?
maletor has joined #ruby
<xybre>
Anyway, whats the problem?
<xybre>
(other than throw/catch)
dagen has left #ruby [#ruby]
<akemrir>
I`m not quite sure of that output format is correct.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<xybre>
Do you know what the encoding of the binary data is?
DrCode has joined #ruby
<pontiki>
how does it compare to your python script?
<xybre>
Do you know the schema with which they have encoded it, so that if you could adequately explain it, you could be assured of its correctness with which to test it?
<akemrir>
pontiki: only timestamp is correct
<pontiki>
then i'll point you to the doc link above
<xybre>
The numbers the python script are giving like 39045, 59977, and 20840 seem to be way out of range.
banisterfiend has joined #ruby
<akemrir>
hmm
senayar has quit [Ping timeout: 245 seconds]
<xybre>
And also they're expecting 5 sets of data, while the specification you sent me indicates only 4. So its almost certainly an incorrect format specification.
<akemrir>
it could be
Mars` has joined #ruby
Nuck has quit [Ping timeout: 264 seconds]
<akemrir>
xybre: I think my script is incorrectly built. When its gathering data, I cant select text in terminal.
DrCode has joined #ruby
PLejeck has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
<akemrir>
but only when I gather data from mouse.
brennanMKE has joined #ruby
<akemrir>
In that case, these responses from python script are out of range too.
<pontiki>
you're collecting data from the mouse input, and you're wondering why using it might not work? what?
<akemrir>
pontiki: I`am reading data only
<pontiki>
so?
<akemrir>
Maybe this way is not correct, with popen and cat.
BizarreCake has joined #ruby
<akemrir>
cat opens endless stream, that outputs data when events occur.
claymore has joined #ruby
gmas has quit [Ping timeout: 245 seconds]
hogeo has quit [Remote host closed the connection]
GeissT has quit [Read error: Connection reset by peer]
GeissT has joined #ruby
lukec has joined #ruby
<akemrir>
value is not needed, only code. To correctly count keypresses
<akemrir>
Don`t know why, I always have type and code that equals to 0
maletor has quit [Quit: Computer has gone to sleep.]
arietis has quit [Quit: Computer has gone to sleep.]
Tearan has quit [Quit: Sleepy Badger....]
<xybre>
akemrir: Thsoe keyboards operate using nonstandard protocols
<xybre>
iirc
<xybre>
akemrir: pretty sure all you need is value
<xybre>
akemrir: thing is, its returning nonstandard values
totem has quit [Quit: totem]
<akemrir>
This could be a problem
coderhs has quit [Quit: Leaving]
funburn has quit [Quit: funburn]
<xybre>
akemrir: And you should probably just File.open instead of using cat.
<akemrir>
No need for this loop?
<xybre>
You need the loop if it hits EOF, so it can reopen the file.
<xybre>
The throw/catch stuff is a mess, and the trap hooks don't work like you think they do.
tsykoduk is now known as zz_tsykoduk
adambeynon has joined #ruby
danshultz has joined #ruby
nso95_ has quit [Ping timeout: 252 seconds]
_adeponte has quit [Remote host closed the connection]
<akemrir>
xybre: when I use File.open it get new data everytime when I call gets on it. This could be easier solution.
<akemrir>
In case of trap. I want to exit script when it gets SIGTERM.
Zai00 has joined #ruby
dbjeepn has joined #ruby
gyzmodo has joined #ruby
lukec has quit [Quit: lukec]
<akemrir>
And of course save calculated data before it exits
danshultz has quit [Ping timeout: 245 seconds]
<akemrir>
Maybe I`am doing it wrong
dbjeepn has quit [Client Quit]
JeanMertz has joined #ruby
DanKnox is now known as DanKnox_away
Jetchisel has quit [Read error: Connection reset by peer]
Jetchisel has joined #ruby
mansi_ has joined #ruby
Tearan has joined #ruby
Tearan has quit [Client Quit]
funburn has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
funburn has quit [Client Quit]
nomenkun has joined #ruby
amacgregor has quit [Ping timeout: 240 seconds]
noopq has joined #ruby
heftig has joined #ruby
<xybre>
akemrir: make a method that the trap block calls and use that to record the values and then exit.
mansi_ has quit [Ping timeout: 240 seconds]
goganchic has quit []
Nss has joined #ruby
lucazi has joined #ruby
dangerousdave has joined #ruby
arietis has joined #ruby
amacgregor has joined #ruby
sergicles has joined #ruby
fgo has quit [Remote host closed the connection]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
joesavage has joined #ruby
Squarepy has joined #ruby
ewokchew_ has joined #ruby
mrnugget has quit [Quit: mrnugget]
<joesavage>
I have a Ruby script that runs once a day, and writes to a binary file using File.open(…, 'rb+') file for approx half an hour a day (from its 8 hours of processing). When the script ran yesterday, something went wrong and so I woke up this morning to see a tone of garbage values in my binary file (the script goes through and increments a bunch of values some number of times, and I've been left with 33987s which is far too high).
<joesavage>
anyone have any tips on how I might troubleshoot this? (I'm guessing, for starters, that I should be locking the file for every write, but I have no idea)
funburn has joined #ruby
MrZYX|off is now known as MrZYX
ewokchewy has quit [Ping timeout: 264 seconds]
<joesavage>
Alternatively, is the solution here that I shouldn't be writing to the file with the new data each time and should be storing all the results in memory as a Hash table and then only writing after all the collection?
<xybre>
joesavage: It might be a more robust solution to write the data out more often. Is there a reason you need to write it as binary?
ewokchew_ has quit [Remote host closed the connection]
<joesavage>
Yeah, I need to read the file very efficiently for its later uses
ananthakumaran has quit [Quit: Leaving.]
<joesavage>
The weird thing in this case is that a bunch of the values in the file (which are usually written completely separately) have been changed to the same value -- either "c484" or "c483", which translate to 33988 and 33732
Jetchisel has joined #ruby
shvelo has joined #ruby
brennanMKE has joined #ruby
nomenkun has quit [Remote host closed the connection]
colonolGron has joined #ruby
VTLob has joined #ruby
Xeago has joined #ruby
brennanMKE has quit [Ping timeout: 240 seconds]
Xeago_ has joined #ruby
SleeepingShuck is now known as PixelShuck
<jrobeson>
joesavage, you're writing to the exact same file everyt time?
<joesavage>
Yeah
<jrobeson>
you should consider writing to a temp file and then renaming it
<joesavage>
I should?
<jrobeson>
yes..
<jrobeson>
why would i say it otherwise?
<joesavage>
:D I was wondering _why_ I should
<jrobeson>
unless the file is meant to always be read even when incomplete
<jrobeson>
so you have a chance to make sure it was written correctly
<jrobeson>
you could perform various tests and then rename it to the one it should be once you're sure
<xybre>
Yeah I'd save the data to a timestamp-prefixed file each time.
<jrobeson>
and then you wouldn't have to lock it
<joesavage>
It can't really get written to wrongly -- each increment to a byte it does is an extra datapoint, which is always useful
<jrobeson>
just make sure you rename atomically
<jrobeson>
you just said it was wrong..
<joesavage>
Well, it _is_ wrong, but I have no idea why.
Xeago_ has quit [Ping timeout: 260 seconds]
<joesavage>
Typically it shouldn't go wrong
<jrobeson>
like everything else in computers that does
<jrobeson>
hah
<jrobeson>
anyways.. that's my advice.. and xybre's too
<xybre>
Its difficult to rule things out when things are behaving anomlously.. since by definition something isn't as you expected.
<pontiki>
isn't that liek famous last words?
<shevy>
anyone knows of a library that does: 5 -> five, 123 -> one-hundred-twenty-three
<joesavage>
XD "Typically it shouldn't go wrong" would make a great software developers shirt. Yeah, I'll make some cases for if it goes wrong, but specifically right now I'm more interested in how to stop it going wrong
<xybre>
shevy: doesn't something in AS do that?
codecop has joined #ruby
leonidlm has quit [Read error: Connection reset by peer]
<xybre>
joesavage: well, since we can't see the code and we don't know what it does or why, thats pretty tricky.
<jrobeson>
xybre, :)
jefflyne has quit [Ping timeout: 252 seconds]
<jrobeson>
pontiki, bon soir
<joesavage>
Yeah - I was kind of hoping writing to binary files often was something that commonly screws up. I can show you some code if you have the time to take a look though
<pontiki>
ciao, jrobeson
Xeago_ has joined #ruby
<jrobeson>
i thought it was more like good evening.. perhaps i misunderstood.. not like i'm leaving
<joesavage>
xybre: Here's the important part: https://gist.github.com/joesavage/f018f0d133b84db740f5 -- teamA and teamB are guaranteed to have 5 values in each, and the seek just deals with writing to the correct place in my custom binary format (which I've used all over the place previously -- it works)
<xybre>
joesavage: thing is, other than today, where everone seems to be having binary problems, most people I know don't write binary in ruby by hand
<joesavage>
XD
<Hanmac>
shevy you are right, it sounds a bit "rasistic" ...
<Hanmac>
:P
<xybre>
argh my eyes the goggles do nothing
spider-mario has joined #ruby
<shevy>
pr0n goggling
<xybre>
Tabs, no paragraphs, no methods, no classes, 4 levels of nesting, completely procedural.
<jrobeson>
oh.. got it.. pontiki .. i assume you actually took french :)
funburn has quit [Quit: funburn]
<xybre>
Thats not even n+1, thats like n*n*n*n
<Hanmac>
and imo number_to_human_size is still wrong
<joesavage>
The code was actually written with spaces initially, got converted to tabs in the gist somehow, but admittedly it's not the cleanest piece of Ruby.
<shevy>
huh
<shevy>
what evil magic is it that converts spaces to tabs on pasting
<xybre>
shevy +1
<shevy>
some mysteries in life can never be solved :)
<xybre>
joesavage: I bet if you rewrote it to be idiomatic your problem would be either 1. Solved. 2. Much easier to solve.
relix has joined #ruby
<joesavage>
I'm not totally sure on the idiomatic way to write such data -- I'm comfortable with looping through a few things, and so I wrote it in that manor.
fgo has quit [Ping timeout: 240 seconds]
<xybre>
I can tell what I'm looking at is likely a small part of a larger piece of code, and its indicative of larger stuctural problems that make it more difficult to maintain and understand.
dbjeepn has joined #ruby
<xybre>
And indeed, debug. I'm assumimg there's no tests.
<michael_mbp>
banisterfiend: hello
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
<xybre>
I'd recommend writing some tests too.
danshultz has joined #ruby
Guest20398 has joined #ruby
dbjeepn has quit [Client Quit]
funburn has joined #ruby
leonidlm has joined #ruby
danshultz has quit [Ping timeout: 264 seconds]
SilverKey has quit [Quit: Zzzzzz.]
mansi_ has joined #ruby
Jetchisel has joined #ruby
thebastl has joined #ruby
pellenation has joined #ruby
thebastl has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
ner0x has quit [Quit: Leaving]
leonidlm has joined #ruby
fgo has quit [Remote host closed the connection]
obs has joined #ruby
sniffingcats has joined #ruby
wildroman has joined #ruby
jibi has joined #ruby
<sniffingcats>
hello. I'm doing something like: %x{cat 1 2 > 3} on big files and keep getting "cannot allocate memory", while typing that command in bash shell works fine. Any tip how to do it in Ruby using less memory or why it happens?
popl has quit [Quit: We must make an idol of our fear, and call it God.]
obs has quit [Client Quit]
obs has joined #ruby
<xybre>
sniffingcats: don't use cat
obs has quit [Client Quit]
obs has joined #ruby
<sniffingcats>
I like cats, cats be my friends :<
<sniffingcats>
xybre: Why not?
<xybre>
sniffingcats: Well, you'll run out of memory.
<sniffingcats>
I don't in shell
dhruvasagar has quit [Ping timeout: 264 seconds]
<xybre>
Cool, then use bash.
<sniffingcats>
just when executing that shell command from Ruby
<sniffingcats>
Umh... but I want to do it from Ruby…
obs has quit [Client Quit]
obs has joined #ruby
<xybre>
Then don't use cat?
<sniffingcats>
:|
<sniffingcats>
Any explanation why?
leonidlm has quit [Ping timeout: 260 seconds]
<xybre>
Because cat is an external program being run in a shell, which is opening up at least 1 more external process.
robertjpayne has joined #ruby
<sniffingcats>
It doesn't explain why it uses too much memory in that case
<robertjpayne>
Is there an easy way to take an array of hashes that all have a key :id and create a hash that is arrays stored by :id?
boxmein has quit [Quit: [02:26.00] <Ristovski> mozzarella filofax fadget]
<robertjpayne>
Right now I do something like by_id = {}; values.each { |v| by_id[v[:id]] ||= []; by_id[v[:id]] = v };
<xybre>
sniffingcats: Well, you could profile it and find out.
<xybre>
robertjpayne: can you give an example of the input and output?
<robertjpayne>
xybre: Actually I quoted it a bit wrong, I don't need arrays of ID's I just need an inverse index sorta
<robertjpayne>
xybre: Have a array of "user" models and want a dictionary to look them up by id
<jrobeson>
group_by ? or is that a railsism ?
<robertjpayne>
jrobeson: exactly what I was after thanks!
<robertjpayne>
jrobeson: though group_by results in arrays which is good in some cases other cases I just want the value itself
Mars` has quit [Remote host closed the connection]
Mars` has joined #ruby
<Hanmac>
{ |v| by_id[v[:id]] ||= []; by_id[v[:id]] = v }; <<<< that part means, that you first set it with [] when nil and then you overwrite it with v ... dont make sense doesnt it?
<robertjpayne>
Hanmac: typo'd should have been <<
mityaz has joined #ruby
<robertjpayne>
Hanmac: anyways, group_by solves that use case and then i suppose I can just reduce the arrays
mm__ has quit [Read error: Connection reset by peer]
puppeh has joined #ruby
<robertjpayne>
A bit reworded I have an array of users which can be thought of as: {id: <user_id>, username: <username>} I want to generate a hash that is like {<user_id>: <user>} so it can be used to easily lookup users in further code
Mars` has quit [Ping timeout: 256 seconds]
mm__ has joined #ruby
codecop has quit [Remote host closed the connection]
<apeiros>
robertjpayne: .each_with_object({}) { |user, hash| hash[user[:id]] = user }
<apeiros>
in rails/with AS: .index_by { |user| user[:id] }
<robertjpayne>
apeiros: :)
<robertjpayne>
apeiros: thanks
threesome has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
wildroman has quit [Remote host closed the connection]
leonidlm has joined #ruby
Mon_Ouie has quit [Ping timeout: 264 seconds]
ner0x has joined #ruby
wildroman has joined #ruby
<Hanmac>
i dont like active support or other stuff ... even after so many years they still doesnt get the file size standard currect ...
DonRichie has quit [Ping timeout: 260 seconds]
dzhulk has joined #ruby
fgo has joined #ruby
DonRichie has joined #ruby
jb41 has joined #ruby
leonidlm has quit [Ping timeout: 252 seconds]
danshultz has joined #ruby
dzhulk1 has quit [Ping timeout: 240 seconds]
adeponte has joined #ruby
wildroman has quit [Remote host closed the connection]
Xeago__ has joined #ruby
Xeago___ has joined #ruby
jbpros has joined #ruby
danshultz has quit [Ping timeout: 245 seconds]
yfeldblum has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
Mon_Ouie has joined #ruby
Xeago__ has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 264 seconds]
mengu has joined #ruby
Xeago_ has quit [Ping timeout: 264 seconds]
mercwithamouth has joined #ruby
smlgs has joined #ruby
Xeago has joined #ruby
mansi has joined #ruby
adeponte has quit [Ping timeout: 264 seconds]
mengu has quit [Ping timeout: 245 seconds]
blastDAbLast has joined #ruby
<blastDAbLast>
hello
<blastDAbLast>
how can i make a constructor to have optional arguments?
codecop has joined #ruby
<blastDAbLast>
like i want to do
<blastDAbLast>
a = Appclass.new
<blastDAbLast>
and
<blastDAbLast>
a = Appclass.new(obj)
<MrZYX>
just like with any other method, def initialize(obj=default)
mansi has quit [Ping timeout: 245 seconds]
leonidlm has joined #ruby
<blastDAbLast>
can that be called using Appclass.new?
<MrZYX>
yes
<blastDAbLast>
hmm ok lemme try it out :D ty
<blastDAbLast>
how do i check for it? obj.nil?
<MrZYX>
really depends on your default value
spacebug has joined #ruby
maroloccio has joined #ruby
<blastDAbLast>
what im trying to do is just passing a url to the initialize method
<Freeaqingme>
Say I've got a Hash like H = {'F' => 'oo', 'B' => 'ar', 'R' => 'fooba' }. Can I somehow reorder it in a specific manner by specifying a hash that contains the keys of elements that I'd like to put first in that particular order? So: O = ['R', 'F'] will put the elements in the order of R, F, B?
svector has quit [Ping timeout: 252 seconds]
cauffe has quit [Remote host closed the connection]
Mermaid has joined #ruby
sectionme has joined #ruby
senayar has quit [Remote host closed the connection]
r0bgleeson has quit [Ping timeout: 252 seconds]
senayar has joined #ruby
threesome has quit [Ping timeout: 252 seconds]
edwardly has quit [Read error: Operation timed out]
<alexandernst>
Running './myapp' from bash will show a new shell and will start outputting data, but %x(./myapp) will block and it won't show me the new shell. How can I prevent it from blocking and from hidding the shell?
<Mon_Ouie>
Actually you can just do lazy.with_index (as #each with a block is a no-op on enumerators)
spider-mario has quit [Ping timeout: 264 seconds]
sniffingcats has joined #ruby
zerun0 has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
pskosinski__ has joined #ruby
pskosinski__ is now known as pskosinski
pskosinski has quit [Client Quit]
jbpros has quit [Quit: jbpros]
<sniffingcats>
hello! maybe now someone will help. I have problem with "Cannot allocate memory … (Errno::ENOMEM)" while %x{a shell command}. Any tip why?
kreeves has joined #ruby
<banisterfiend>
Mon_Ouie 'alut, good to see you. It's been a long time, i heard you'd lost interest in computer programming and began a course of study in feminist philosophy at university
mrsolo has joined #ruby
<sniffingcats>
When I run "a shell command" in shell it is using ~150 MB. I have 2600 MB of free RAM and it's too little for Ruby to run that command
<Mon_Ouie>
Nah :p I just don't have an internet connection during the week. We're supposed to get it on Tuesday.
mengu has quit [Remote host closed the connection]
xcv has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
<apeiros>
sniffingcats: maybe your "a shell command" generates too much output (%x captures the output in a string)
mklappstuhl has quit [Ping timeout: 246 seconds]
T_T has joined #ruby
vst0rm has quit [Ping timeout: 256 seconds]
senayar has joined #ruby
blastDAbLast has quit [Read error: Connection reset by peer]
jefflyne has joined #ruby
nemesit|znc has quit [Ping timeout: 246 seconds]
gja has quit [Quit: This computer has gone to sleep]
havenwood has joined #ruby
Elhu has joined #ruby
Xeago has joined #ruby
fridim_ has joined #ruby
senayar has quit [Ping timeout: 245 seconds]
kobain has joined #ruby
<sniffingcats>
apeiros: Well, it generates 4 lines… but I used system which is not returning command output and I don't get error anymore. Thank you. :)
hukl has quit [Quit: Leaving...]
T_T has quit [Remote host closed the connection]
relix has joined #ruby
mklappstuhl has joined #ruby
kraljev2 has quit [Read error: Operation timed out]
NicolasTarzia has quit [Ping timeout: 246 seconds]
petey has joined #ruby
chairabanta has joined #ruby
Clooth has quit [Quit: Leaving...]
ArchBeOS has quit [Quit: Peace Out, jerks!]
xcv has quit [Remote host closed the connection]
NicolasTarzia has joined #ruby
rippa has joined #ruby
wallerdev has joined #ruby
xcv has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
abstrusenick has quit [Quit: abstrusenick]
Sammael has joined #ruby
Elhu has joined #ruby
<kapowaz>
I'm trying to make use of a gem I found that I think does exactly what I need (https://github.com/divshot/rack-tumblr) but I can't figure out how to get it wired up correctly. The readme is somewhat terse, so I *think* I'm interpreting it correctly… the `use …` call is for Rack, so that should go in my config.ru, right…?
<canton7>
<canton7> so you've got the 'use' and the 'run' both inside the 'map', from way back ;)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Elhu has quit [Quit: Computer has gone to sleep.]
preyalone has left #ruby ["Killed buffer"]
banisterfiend has joined #ruby
nathancahill has joined #ruby
wallerdev has quit [Quit: wallerdev]
dallasm has joined #ruby
nathancahill has quit [Client Quit]
mklappstuhl has quit [Remote host closed the connection]
jefflyne has quit [Ping timeout: 264 seconds]
<admin0>
hi guys .. does any function exist in ruby to make it possible to do string-matching ? my issue is here: http://pastebin.com/GsP30hJP ..
razi has quit [Ping timeout: 264 seconds]
arietis has quit [Quit: Computer has gone to sleep.]
mklappstuhl has joined #ruby
helloworld has quit [Ping timeout: 245 seconds]
shredding has joined #ruby
drumsrgr8forn8_ has joined #ruby
flagg0204 has joined #ruby
<MrZYX>
why 1001 in the fourth case?
<admin0>
10011 will match 1001, because 1001 exists in the list
lkba has joined #ruby
mhodgson has joined #ruby
<admin0>
its matching phone numbers to area codes .. if area code is 1001, number 10011 will match 1001 ..
brennanMKE has joined #ruby
arietis has joined #ruby
k610 has joined #ruby
<MrZYX>
Hm, I guess I'd end up converting everything to strings, sort the area_codes descending by length, then something like area_codes.find {|code| number.start_with? code }
drumsrgr8forn8_ has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
bsaboia_ has quit [Ping timeout: 264 seconds]
Amnesia has joined #ruby
dallasm has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 245 seconds]
Zai00 has quit [Quit: Zai00]
mansi_ has joined #ruby
<Amnesia>
question for the vim users over here: does one of you know how to get sane ruby autocompletion in vim?
xk_id has joined #ruby
vst0rm has quit [Ping timeout: 256 seconds]
soba_ has joined #ruby
elaptics is now known as elaptics`away
mrsolo has quit [Quit: This computer has gone to sleep]
soba__ has joined #ruby
mansi_ has quit [Ping timeout: 240 seconds]
<Dwarf>
I just want to thank you guys for making my life more fun
<banisterfiend>
ha someone needs to get out more
<banisterfiend>
:P
soba_ has quit [Ping timeout: 240 seconds]
<Dwarf>
Lol
skaflem has quit [Quit: This computer has gone to sleep]
<Dwarf>
Maybe
<Dwarf>
Probably
<Dwarf>
Still tho, ruby might one of the better scripting languages I've seen
<Dwarf>
Compared to PHP, it's heaven
<plotter>
oh thats a given :)
<banisterfiend>
Dwarf we prefer the term "dynamic language"
wallerdev has joined #ruby
<banisterfiend>
"scripting language" has almost lost its meaning these days
<plotter>
i always refer to it as "interpreted" language
<banisterfiend>
plotter but that's an implementation detail ;)
<plotter>
generally speaking =\
dallasm has joined #ruby
sepp2k has quit [Quit: Leaving.]
eka has quit [Quit: Computer has gone to sleep.]
nathancahill has joined #ruby
nathancahill has quit [Client Quit]
nathancahill has joined #ruby
nathancahill has quit [Client Quit]
threesome has joined #ruby
platzhirsch has joined #ruby
araujo has quit [Read error: Connection reset by peer]
<platzhirsch>
Wow, if you ever need to detect languages in Ruby, CLD is pretty fast and very accurate
araujo has joined #ruby
razi has joined #ruby
T_T has quit [Remote host closed the connection]
T_T has joined #ruby
<Dwarf>
platzhirsch: care to elaborate?
<platzhirsch>
Dwarf: it's based on the Chromium Language Detection
nemesit|znc has quit [Ping timeout: 240 seconds]
<Dwarf>
Oh that's pretty fancy
<platzhirsch>
I have used whatlanguage, which I found very handy, it's using bloom filter on a basis of language files
Matix has joined #ruby
<platzhirsch>
but unfortunately, rather inaccurate for some cases
<Matix>
Hello
<Matix>
given a string I'm getting the class using Kernel.eval(myclass)
leonidlm has quit [Ping timeout: 252 seconds]
<Matix>
it works for many classes but I have one that is called "Resource"
JRizzle has joined #ruby
<Matix>
which it's not finding inside a module
<Inside>
because there's nothing here
<Matix>
Inside, was it for me?
k611 has joined #ruby
<JRizzle>
Hi all, does anyone know of any good rails tutorials that include how to create a product listings or something similar with 'Products' ? Any help would be appreciated
k610 has quit [Ping timeout: 240 seconds]
mansi_ has joined #ruby
<Matix>
I call this module many times throughout the application, it's when I want to find "Resource" that it doesn't work, the rest is working
<Matix>
do you have any clue?
hogeo has joined #ruby
<MrZYX>
Matix: have a look at the get_const method
Vivekananda has quit [Read error: Connection reset by peer]
<heftig>
JRizzle: the Agile Development with Rails book
T_T has quit [Ping timeout: 245 seconds]
<JRizzle>
heftig: Thanks, is it compatible with the newest versions? ruby 2.0 and rails 4 ?
<MrZYX>
why does it come as string in the first place then?
threesome has quit [Ping timeout: 252 seconds]
<Matix>
long story, it's how a library I'm using works
<MrZYX>
kraljev2: the else is basically redundant
<MrZYX>
you also might want to look into require_relative and $LOAD_PATH
<Matix>
but basicalle you call a method with the name of an association (link). that link has a link.class_name, which is the name (string) of the class the object that should be created. so Kernel.eval(link.class_name).new whatever
rippa has joined #ruby
bl4ckdu5t has joined #ruby
<MrZYX>
Matix: I'd still use get_const over eval
<Matix>
yeah, that could be a better idea. I'm going to do a pull request
<Inside>
hey
matchaw has quit [Remote host closed the connection]
<bl4ckdu5t>
Hanmac: I checked for rubymine in my apt repositories and I couldn't find it! How can I get it installed?
Rich_Morin has left #ruby [#ruby]
vst0rm has joined #ruby
<Matix>
you meant Kernel.const_get I guess
emergion has quit [Quit: Computer has gone to sleep.]
shredding has quit [Quit: shredding]
<apeiros>
Object is the toplevel
<Hanmac>
bl4ckdu5t: as gem?
raphaelivan has joined #ruby
<bl4ckdu5t>
I just did an "apt-cache search ruby-mine" and "apt-cache search rubymine" but they both returned 0 results
hogeo has quit [Remote host closed the connection]
matchaw has joined #ruby
hogeo has joined #ruby
Vivekananda has joined #ruby
mrsolo has joined #ruby
<kraljev2>
how can i force map to skip first element
lukec has joined #ruby
michael_mbp is now known as zz_michael_mbp
mklappstuhl has quit [Remote host closed the connection]
<Morrolan>
bl4ckdu5t: Closed source, proprietary, IDE. Get it from the Jetbrains' website.
<apeiros>
kraljev2: by not providing the first element to map
<apeiros>
e.g. ary[1..-1].map
<Morrolan>
kraljev2: ary[1..-1].map { ... }
<kraljev2>
but i want to have first element unchanged
Elhu has joined #ruby
<bl4ckdu5t>
Morollan: As a .deb file?
mklappstuhl has joined #ruby
<Morrolan>
I don't think they package it, no.
matchaw has quit [Remote host closed the connection]
hogeo has quit [Ping timeout: 245 seconds]
<Morrolan>
It's probably just a compressed tarball.
IceDragon has quit [Ping timeout: 260 seconds]
hemanth has quit [Quit: This computer has gone to sleep]
senayar has joined #ruby
nathancahill has joined #ruby
shredding has joined #ruby
matchaw has joined #ruby
kobain has quit [Ping timeout: 252 seconds]
nathancahill has quit [Client Quit]
senayar has quit [Remote host closed the connection]
kobain has joined #ruby
senayar has joined #ruby
senayar_ has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
brennanMKE has quit [Remote host closed the connection]
dzhulk has joined #ruby
nemesit|znc has joined #ruby
tatsuya_o has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
timonv has quit [Remote host closed the connection]
mac___ has quit [Remote host closed the connection]
senayar has quit [Ping timeout: 264 seconds]
mac___ has joined #ruby
mac___ has quit [Read error: Connection reset by peer]
jb41 has quit [Ping timeout: 260 seconds]
IceDragon has joined #ruby
mac___ has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
timonv has joined #ruby
helloworld has joined #ruby
wildroman has quit [Read error: No route to host]
noop has joined #ruby
chairabanta has quit [Quit: Leaving...]
zz_tsykoduk is now known as tsykoduk
kraljev2 has quit [Quit: kraljev2]
noopq has quit [Ping timeout: 264 seconds]
arietis has joined #ruby
fgo has joined #ruby
agjacome has quit [Ping timeout: 245 seconds]
tsykoduk is now known as zz_tsykoduk
ukd1 has joined #ruby
agjacome has joined #ruby
user64 has joined #ruby
arclit has joined #ruby
mac___ has quit [Remote host closed the connection]
* Hanmac
hates Jetbrains IDEs ... because i need one that support more than one language ,P
user64 has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 246 seconds]
nemesit|znc has quit [Ping timeout: 252 seconds]
nemesit|znc has joined #ruby
siwica has joined #ruby
Matriks has joined #ruby
zenloop has joined #ruby
emergion has joined #ruby
schaerli has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
<zenloop>
hey guys, quick question. I want to use the include method on a list but instead of 1 argument I want to use 2. is there a way to dothis? my_list.include?(a) works but not my_list.incude?(a,b) does not.
<zenloop>
Is there a way to do that?
mklappstuhl has quit [Remote host closed the connection]
platzhirsch has left #ruby [#ruby]
<apeiros>
zenloop: no. you have to call it twice.
v1n has quit [Ping timeout: 256 seconds]
<zenloop>
apeiros: Ok. Thanks.
aspires has joined #ruby
mklappstuhl has joined #ruby
<yxhuvud>
well. (list && [a,b]).empty?
<apeiros>
not the same, though
<apeiros>
errr, that one is even probably not what you wanted to say :D
<apeiros>
& not &&, I guess?
S0da has quit [Read error: Connection reset by peer]
arclit has quit [Remote host closed the connection]
<Morrolan>
Oh, with two, sure.
<apeiros>
and with more than 2, Array#& has probably better performance
<apeiros>
being O(n+m) rather than O(n*m)
mrsolo has quit [Quit: This computer has gone to sleep]
<Morrolan>
I'll think about sacrificing readability for the sake of performance when this turns out to be a bottleneck. ;D
mklappstuhl has quit [Remote host closed the connection]
carraroj has joined #ruby
mklappstuhl has joined #ruby
<zenloop>
Morrolan: that did it.
r0bgleeson has joined #ruby
bean has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
ukd1_ has joined #ruby
soba__ has quit [Read error: Connection reset by peer]
julian-delphiki has quit [Ping timeout: 264 seconds]
<heftig>
apeiros: hm, can't really tell
<heftig>
which one is superior depends on a lot of factors
carraroj has quit [Ping timeout: 252 seconds]
bl4ckdu5t has quit [Ping timeout: 252 seconds]
ukd1 has quit [Ping timeout: 245 seconds]
<heftig>
size of the set of needles; size of the haystack; how many of the needles are actually in the haystack
AzizLight has joined #ruby
<AzizLight>
hi everybody
tkuchiki has quit [Remote host closed the connection]
<apeiros>
heftig: don't think those matter.
timonv has quit [Remote host closed the connection]
IceDragon has quit [Ping timeout: 246 seconds]
<apeiros>
algorithmic complexity abstracts that away.
tkuchiki has joined #ruby
timonv has joined #ruby
IceDragon has joined #ruby
<apeiros>
what you cite are worst-case/best-case scenarios
NealJ has joined #ruby
<AzizLight>
I just created a gem. It has a bin dir with a shell script inside. But I think that the script is being executed by ruby instead of sh when I install the gem and try to use it... is that normal?
timonv has quit [Read error: Connection reset by peer]
timonv has joined #ruby
<Morrolan>
Proper shebang line?
JeanMertz has joined #ruby
lucazi_away is now known as lucazi
Ox6abe has quit [Remote host closed the connection]
rubyracer has joined #ruby
carraroj has joined #ruby
<AzizLight>
Morrolan: yeah. But I just foud a source saying that I can't include shell scripts in rubygems :-(
<Morrolan>
Oh?
<Morrolan>
Didn't expect that. :)
Ox6abe has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
tkuchiki has quit [Ping timeout: 240 seconds]
Ox6abe_ has joined #ruby
ukd1_ has quit [Remote host closed the connection]
chairabanta has joined #ruby
ukd1 has joined #ruby
Ox6abe has quit [Ping timeout: 240 seconds]
volty has joined #ruby
carraroj has quit [Ping timeout: 245 seconds]
pygospa has quit [Disconnected by services]
bl4ckdu5t has joined #ruby
TheRealPygo has joined #ruby
ukd1 has quit [Ping timeout: 256 seconds]
bl4ckdu5t has quit [Max SendQ exceeded]
<Amnesia>
is anyone using Vim over here?
sepp2k has joined #ruby
lkba has quit [Read error: Connection reset by peer]
taptapdan has quit [Quit: taptapdan]
dhruvasagar has joined #ruby
krz has quit [Quit: krz]
lkba has joined #ruby
julian-delphiki has joined #ruby
<AzizLight>
Amnesia: yeah
<Amnesia>
AzizLight: do you have same completion with it ?
bean has quit [Ping timeout: 260 seconds]
<Amnesia>
(so something else as omnicompletion)
<AzizLight>
Amnesia: yes, I use YouCompleteMe
<AzizLight>
it's pretty awesome
<Amnesia>
hm, from what I saw, it's a pita to get that installed...
<AzizLight>
Amnesia: not if you don't include the CLang stuff, which you don't need with ruby
coderhs has quit [Ping timeout: 245 seconds]
<Amnesia>
did you use vundle?
nisstyre has joined #ruby
aspires has quit [Quit: aspires]
nouitfvf has quit []
daaaan has quit [Ping timeout: 264 seconds]
jefflyne has joined #ruby
mikepack has joined #ruby
matchaw has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 256 seconds]
likemike has quit [Ping timeout: 253 seconds]
likemike has joined #ruby
pixelshuck is now known as GamingShuck_TF2
tbrock_ has joined #ruby
matchaw has joined #ruby
<banisterfiend>
apeiros ping
<apeiros>
beer pong
<banisterfiend>
apeiros can i pm you a q?
<apeiros>
sure
<banisterfiend>
thx
tatsuya_o has quit [Remote host closed the connection]
petey has quit [Remote host closed the connection]
maroloccio has quit [Quit: WeeChat 0.4.0]
petey has joined #ruby
Soda has quit [Ping timeout: 248 seconds]
tbrock_ has quit [Quit: Computer has gone to sleep.]
petey has quit [Read error: Connection reset by peer]
petey has joined #ruby
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby
senayar_ has quit [Remote host closed the connection]
senayar has joined #ruby
<sniffingcats>
or maybe just midget rex! we know that people can be 230 and 70 cm tall but we assume that all dinosaurs from one family are almost identical
hakunin_ is now known as hakunin
coderhs has joined #ruby
nemesit|znc has quit [Ping timeout: 245 seconds]
shredding has quit [Quit: shredding]
mary5030 has joined #ruby
carraroj has joined #ruby
schaerli has quit [Ping timeout: 264 seconds]
mklappstuhl has quit [Remote host closed the connection]
nemesit|znc has joined #ruby
adeponte has joined #ruby
senayar has quit [Ping timeout: 246 seconds]
arietis has joined #ruby
raphaelivan has quit [Quit: Leaving.]
carraroj has quit [Ping timeout: 240 seconds]
ukd1 has joined #ruby
adeponte has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
ukd1 has quit [Remote host closed the connection]
workmad3 has joined #ruby
mklappstuhl has joined #ruby
codecop has quit [Remote host closed the connection]
ukd1 has joined #ruby
v0n has quit [Quit: WeeChat 0.4.2-dev]
petey has quit [Remote host closed the connection]
sniffingcats has quit [Quit: Til rivido Idisti!]
ukd1 has quit [Ping timeout: 256 seconds]
petey has joined #ruby
gogunners has joined #ruby
noop has quit [Quit: Leaving]
noop has joined #ruby
<gogunners>
anyone around to answer a noob question?
<MrZYX>
you'll never find out without asking ;)
Bosox20051 has quit [Remote host closed the connection]
lucazi has quit [Ping timeout: 252 seconds]
<gogunners>
ok
<gogunners>
well ive got a hash with strings for keys (which is fine) and strings for values. however the values are floats masquerading as strings
devoldmx3 has joined #ruby
<gogunners>
and i want them all to me floats
<gogunners>
such as "key" => "5.4"
<gogunners>
and i want "key" => 5.4
mayorga has joined #ruby
<AzizLight>
Amnesia: I do use vundle
shvelo has joined #ruby
<Amnesia>
For some reason I'm not getting any automatic completion..
petey has quit [Ping timeout: 256 seconds]
Bish has quit [Excess Flood]
petey has joined #ruby
<MrZYX>
gogunners: you want to call to_f on them or pass them through the Float method
devoldmx has quit [Ping timeout: 245 seconds]
<gogunners>
right
<Amnesia>
AzizLight: ycm_core has been compiled in /home/amnesia/.vim/bundle/YouCompleteMe
<gogunners>
and im actually able to do that
<gogunners>
sort of
mayorga has quit [Max SendQ exceeded]
<AzizLight>
Amnesia: weird..
sayan has joined #ruby
<gogunners>
like with an array if i was converting all the elements to floats it would just be arr.map!{|x| x.to_f}
mary5030 has quit [Remote host closed the connection]
<havenwood>
apeiros: silly me, didn't realize there was a `hashie` >.>
<gogunners>
havenwood. it worked
<gogunners>
i dont know what i did before but I could have sworn i tried that
<gogunners>
thanks a million man
mercwithamouth has joined #ruby
<havenwood>
gogunners: de nada
mary5030 has joined #ruby
<gogunners>
havenwood, would you mind explaining the Hash[] syntax there
<gogunners>
and how that works when just myhsh.map does not
Xaitec has joined #ruby
Xaitec has quit [Remote host closed the connection]
<Ziarkaen>
I need to send an HTTP GET request, but do not care about the response. IS there a more efficient way than open-uri (which is what I'd usually use)
<udoprog>
vasilakisFiL: it's a pretty common convention to lazy define variables in accessor/mutator methods, most often when you are dealing with mixins
<havenwood>
vasilakisFiL: change line 18 to: @logger = ::Logger.new(STDOUT)
gcds has quit [Quit: gcds]
<vasilakisFiL>
did that but no luck
<havenwood>
vasilakisFiL: new error?
<vasilakisFiL>
I get this NameError: uninitialized constant Celluloid::Logger::DEBUG
<havenwood>
vasilakisFiL: With the `::` preceding `Logger`?
<vasilakisFiL>
yes
<ravster>
I've looked at the followredirect Faraday middleware, butthink I'm missing something obvious. What am I doing incorrectly (Or not at all)? https://gist.github.com/ravster/6857696
siwica has quit [Ping timeout: 260 seconds]
<havenwood>
vasilakisFiL: update pastie?
<vasilakisFiL>
@logger = ::Logger.new(STDOUT) with that
<vasilakisFiL>
just a sec
DrCode has quit [Remote host closed the connection]
popl_ has joined #ruby
timonv has quit [Remote host closed the connection]
mm__ has quit [Read error: Connection reset by peer]
mm__ has joined #ruby
BizarreCake has quit [Ping timeout: 264 seconds]
ewokchewy has joined #ruby
relix has joined #ruby
kevind has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
fenicks has joined #ruby
tatsuya_o has joined #ruby
kvirani has quit [Remote host closed the connection]
sayan has joined #ruby
mm__ has quit [Ping timeout: 252 seconds]
kvirani has joined #ruby
felipec has left #ruby ["Leaving"]
poisonarms has joined #ruby
mm__ has joined #ruby
<poisonarms>
So this HTTP library is no good to me, https://github.com/tarcieri/http -- It's not returning anything when using the Reddit API, but when I use WWW::Mechanize in Perl, I'm getting results -- Anyone got any idea why that might be?
ewokchewy has quit [Remote host closed the connection]
Matriks has quit [Read error: Connection reset by peer]
colonolGron has quit [Ping timeout: 245 seconds]
Matriks has joined #ruby
S0da has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mklappstuhl has joined #ruby
carraroj has joined #ruby
mayorga has quit [Ping timeout: 256 seconds]
w3pm has joined #ruby
Macaveli has joined #ruby
colonolGron has joined #ruby
ahawkins has joined #ruby
zarubin has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
arietis has quit [Quit: Computer has gone to sleep.]
marcgg has quit [Ping timeout: 264 seconds]
idoru has joined #ruby
zz_michael_mbp is now known as michael_mbp
Sammael has quit [Ping timeout: 260 seconds]
mayorga has joined #ruby
<shevy>
hmmm so when should I use a block, and when lambda... proc {|a| puts a } vs b = lambda {|b| puts b }
<shevy>
it seems one gets more flexibility with proc
maletor has joined #ruby
<bnagy>
95% of the time it doesn't matter ime
<bnagy>
I use procs
Matip has joined #ruby
<bnagy>
just because the word lambda squicks me out
boboc has joined #ruby
<shevy>
hehe
<shevy>
yeah
arietis has joined #ruby
<shevy>
It reminds me of haskell
osvico has quit [Ping timeout: 245 seconds]
gcds has joined #ruby
<shevy>
I don't understand how so many people can use haskell, #haskell has 300 people more than we have here :(
mayorga has quit [Max SendQ exceeded]
ping-pong has quit [Ping timeout: 245 seconds]
polaco_zZz is now known as polaco
<bnagy>
academia?
<boboc>
guys how can i use regex to replace a value with a saved in the parantheses from a regex pattern? for exi would like to apend 0 in front of the last 2 digits from a string: str.gsub(-(/\d{2})$/,0\1)
mayorga has joined #ruby
<|jemc|>
I'll start using "lambdas" instead of procs when the ruby parser starts accepting the greek character
<boboc>
but this doesn't work in code, only in the editor (text wrangler) using find and replace
<shevy>
|jemc| can't you use the -> operator thingy?
michael_mbp is now known as zz_michael_mbp
amacgregor has joined #ruby
<shevy>
boboc try "\\1" instead... in .gsub() second argument
<boboc>
with 2 back slashes?
<shevy>
I think so
<|jemc|>
shevy: that's not nearly as fun as the λ
<shevy>
perhaps '\\1'
mklappst_ has joined #ruby
<shevy>
puts x.gsub(/(.{80})/,"\\1\n")
<boboc>
yup, it worked, thanks :)
<shevy>
boboc definitely with "\\1"
Matix has quit [Ping timeout: 264 seconds]
<shevy>
but it's kinda ugly
<shevy>
I'd wish regexes would be as pretty as the rest of the ruby code
<|jemc|>
havenwood's shameless plug for his own gem
drumsrgr8forn8_ has quit [Client Quit]
<|jemc|>
:)
kreeves has joined #ruby
vst0rm has left #ruby [#ruby]
deens has quit [Client Quit]
<gogunners>
i dont see how the first suggestion changes the key to the new value
<havenwood>
bnagy: someone proposed addition of #map_pair, #map_key, and #map_value and Nobu suggested cutting a gem to see if anyone uses it: https://www.ruby-forum.com/topic/4410595
framling has quit [Quit: Lost terminal]
robbyoconnor has joined #ruby
fuhgeddaboudit has joined #ruby
shredding has joined #ruby
<havenwood>
bnagy: i forget there was a `hashie` gem already, so that sucks since i wasn't trying to cause confusion just cut a little gem :P
<bnagy>
hrmmmm ;)
araujo has quit [Ping timeout: 245 seconds]
framling has joined #ruby
<bnagy>
gogunners: which suggestion?
raphaelivan has joined #ruby
snearch has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
<gogunners>
any of them
<gogunners>
but his first one in particular
chrishough has quit [Ping timeout: 264 seconds]
raphaelivan has quit [Client Quit]
adeponte has joined #ruby
raphaelivan has joined #ruby
raphaelivan has quit [Client Quit]
<gogunners>
i just want to go thru a hash and replace all the values with a value determined elsewhere in the method
<gogunners>
i finally got it to work. really appreciate it. later
gogunners has left #ruby [#ruby]
colonolGron has joined #ruby
valesk_ has quit [Remote host closed the connection]
mikepack has quit [Ping timeout: 248 seconds]
gcds has joined #ruby
Mars` has quit [Ping timeout: 246 seconds]
headius has joined #ruby
devoldmx has joined #ruby
kevind has quit [Quit: kevind]
axsuul has joined #ruby
Clooth has quit [Quit: Leaving...]
r0bgleeson has quit [Ping timeout: 246 seconds]
sectionme has quit [Ping timeout: 264 seconds]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx3 has quit [Ping timeout: 240 seconds]
devoldmx has joined #ruby
workmad3 has joined #ruby
araujo has quit [Ping timeout: 240 seconds]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
colonolGron has quit [Ping timeout: 268 seconds]
fryguy has left #ruby ["WeeChat 0.4.0"]
robbyoconnor has joined #ruby
Lewix has quit [Remote host closed the connection]
dzhulk has quit [Quit: Leaving.]
Clooth has joined #ruby
<shevy>
time = Time.now + (5 * 24 * 60 * 60)
<shevy>
ahhh... wanted to ask something, but noticed that I can run .strftime on that
<shevy>
so that is solved
Lewix has joined #ruby
Mars` has joined #ruby
deens has joined #ruby
staafl has quit [Ping timeout: 264 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
sniffingcats has joined #ruby
ahawkins has quit [Quit: leaving]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
gcds has quit [Quit: gcds]
devoldmx3 has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
deens has quit [Quit: deens]
deens has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
sayan has quit [Ping timeout: 246 seconds]
rubyracer has quit [Read error: Connection reset by peer]
mois3x_ has quit [Quit: Konversation terminated!]
rubyracer has joined #ruby
aep has left #ruby ["WeeChat 0.4.1"]
devoldmx3 has quit [Ping timeout: 268 seconds]
sayan has joined #ruby
arclit has joined #ruby
deens has quit [Remote host closed the connection]
deens has joined #ruby
deens has quit [Client Quit]
deens has joined #ruby
w3pm has joined #ruby
deens has quit [Client Quit]
PixelShuck is now known as GamingShuck_TF2
deens has joined #ruby
chrishough has quit [Ping timeout: 268 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
chrishough has joined #ruby
siwica has joined #ruby
deens has quit [Remote host closed the connection]
arclit has quit [Remote host closed the connection]
deens has joined #ruby
noop has quit [Ping timeout: 240 seconds]
ericmathison has joined #ruby
iliketurtles has joined #ruby
gcds has joined #ruby
Kar- has quit [Quit: leaving]
petey has quit [Remote host closed the connection]
petey has joined #ruby
<chrishough>
anyone familiar with guard? I am a noob to using it and I am getting this odd error "guard-2.0.0/lib/guard/commander.rb:113:in `block in within_preserved_state': undefined method `start' for nil:NilClass" with live reload :(
poisonarms has quit [Ping timeout: 252 seconds]
fgo has quit [Remote host closed the connection]
petey has quit [Ping timeout: 256 seconds]
<pontiki>
what guards do you have loaded?
ping-pong has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<pontiki>
and show your Guardfile
<pontiki>
typical course of debugging: remove all guards and start adding them back one at a time
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
noname001 has joined #ruby
havenwood has quit [Ping timeout: 248 seconds]
Inside has joined #ruby
Inside has quit [Changing host]
Inside has joined #ruby
gcds has quit [Quit: gcds]
aryaching has quit [Ping timeout: 240 seconds]
tbrock_ has joined #ruby
jarm has joined #ruby
threesome has quit [Read error: Operation timed out]
elaptics`away is now known as elaptics
polaco_zZz is now known as polaco
gcds has joined #ruby
cads has joined #ruby
leynos has joined #ruby
coderhs has quit [Ping timeout: 264 seconds]
noname001 has quit [Ping timeout: 240 seconds]
<shevy>
the RUBY OS ...
<|jemc|>
eh?
jarm has quit [Ping timeout: 264 seconds]
<shevy>
we need it!
havenwood has joined #ruby
tvw has quit []
iliketurtles has quit [Quit: zzzzz…..]
tbrock_ has quit [Quit: Computer has gone to sleep.]
petey has joined #ruby
petey has quit [Remote host closed the connection]
Beoran has joined #ruby
<shevy>
or
<shevy>
or I will just wait for Haiku ...
petey has joined #ruby
khushildep has quit [Quit: khushildep]
<|jemc|>
what about Haiku do you find attractive? (I hadn't heard of it before now)
Apocalypse has quit [Ping timeout: 245 seconds]
ahawkins has joined #ruby
shredding has quit [Quit: shredding]
<shevy>
hmmmm
<|jemc|>
I don't see the advantage of it over a tweaked linux-based distro installation
<shevy>
I am wondering about that too in a way
<shevy>
but I don't like linux
<shevy>
kinda odd :\
petey has quit [Ping timeout: 245 seconds]
pyx has joined #ruby
<shevy>
I am compiling kernel 3.11.4 right now...
<shevy>
the first time I saw haiku perhaps 5 years ago
<pontiki>
write your own
havenwood has quit [Remote host closed the connection]
<shevy>
|jemc| it feels a bit different, as if everything is one integrated part
colonolGron has joined #ruby
knigitz has quit []
havenwood has joined #ruby
deens has quit [Read error: Connection reset by peer]
<shevy>
though you are probably right... linux + kde seems to be like +10 years ahead
GamingShuck_TF2 is now known as PixelShuck
<|jemc|>
I use xfce and not kde or gnome
<|jemc|>
but if you're into trying alternative oses
<|jemc|>
but I'd be hesitant myself to jump into haiku when the linux kernel is so much more ubiquitous. I have to deal with enough compatibility issues as it is dealing with companies who insist on windows-only software. I wouldn't want to migrate to something even more obscure.
havenwood has quit [Ping timeout: 268 seconds]
PixelShuck is now known as GamingShuck_BF2
<|jemc|>
but it's cool that they're doing it, at the very least
mrnugget has joined #ruby
sayan has quit [Ping timeout: 240 seconds]
mrsolo has joined #ruby
<|jemc|>
but yeah, upon closer inspection it looks like luna/elementary os is an ubuntu derivative marketed toward apple users
<shevy>
|jemc| yeah... they said on #haiku just now that it is not very stable.. as in I might experience crashes after a while
<chrishough>
I am about to give up on it pontiki
<shevy>
(well ~8 minutes ago)
mrsolo has quit [Client Quit]
hasrb has joined #ruby
sniffingcats has quit [Quit: Til rivido Idisti!]
sayan has joined #ruby
vkr has joined #ruby
<|jemc|>
yeah, and it looks like most linux apps you'd want to run would have to be ported
vkr has left #ruby ["Išeinu"]
<shevy>
:(
<shevy>
I cant live without ruby anymore
<|jemc|>
which sounds like a pain the moment you reach a package the haiku devs hadn't gotten to yet
ahawkins has quit [Quit: leaving]
<shevy>
or, I would have to switch to another language, but I would not know which
<shevy>
yeah
<xybre>
If you don't like the linux distro you've used you can just make your own.
mrnugget has quit [Ping timeout: 264 seconds]
jonahR has joined #ruby
jibi has quit [Quit: .]
<xybre>
You can replace literally every binary on the system with your own preference. And of course there's alwaus Free/OpenBSD if you don't want to start from scratch and like the BSD userspace tools.
snearch has quit [Quit: Verlassend]
Al___ has joined #ruby
<shevy>
well that is what I was wondering
<shevy>
about the BSDs
Nss has quit [Ping timeout: 240 seconds]
<shevy>
I am not really able to determine if they are better or worse than linux
<xybre>
And then there's the Solaris-based distros like OpenIndiana and SmartOS
iliketurtles has joined #ruby
staafl has joined #ruby
<xybre>
What do you think "linux" is?
vikhyat has joined #ruby
mityaz has quit [Quit: See ya!]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
banisterfiend has quit [Quit: Computer has gone to sleep.]
nathancahill has quit [Quit: nathancahill]
pyx has quit [Quit: WeeChat 0.4.1]
Al___ has quit [Quit: Al___]
banisterfiend has joined #ruby
sayan has quit [Ping timeout: 240 seconds]
<shevy>
the linux kernel, a shell, xorg server and associated apps, glibc and gcc and a WM or DE, and some more applications loosely following an outdated UNIX tradition model
<shevy>
I think the "everything is a file" and unix pipes are the best parts
maletor has joined #ruby
<shevy>
xorg server model absolutely sucks
<popl>
shevy: water is wet
beilabs has quit [Ping timeout: 252 seconds]
k611 has quit [Quit: Leaving]
<shevy>
popl depends on the temperature
<pontiki>
well said, shevy
<Xeago>
shevy: on my linux box I run just urxvt and luakit
<popl>
shevy: so by analogy the xorg model doesn't always suck?
<shevy>
well water is really strange... have you seen those "water bridges"? I mean not the small ones one can not see with the eye, but the large ones
jarm has quit [Ping timeout: 245 seconds]
<popl>
I'm not sure I know what you're talking about.
<pontiki>
yes, sometimes it actually works
<shevy>
pontiki I show you what water can do
mary5030 has quit [Remote host closed the connection]
<shevy>
now show me something cool as this for xorg!
<pontiki>
it doesn't have to be cool to work
mary5030 has joined #ruby
beilabs has joined #ruby
<shevy>
actually... I lied... water can only do this when there is an electric current :\
<xybre>
Linux is just the kernel. Everything else is optional and while they often use the GNU userspace utils, they don't always and there are alternatives. If you don't need a GUI you don't need X, and they are *right now* building replacements for X because everyone knows it sucks. There's no real alternatives though, SkyOS went away, Haiku isn't done cooking and probably never will be, you could use ReactOS but
<xybre>
then why not just use Windows, and pretty much everything else is embedded or uses X anyway.
zarubin has quit [Read error: Operation timed out]
<|jemc|>
Xeago: haven't seen luakit yet- looks like something I could get behind
<shevy>
but it's still cool
<|jemc|>
Xeago: downloading now, in fact
<popl>
oh right, I have seen that.
<popl>
shevy: it's pretty neat.
<shevy>
xybre I need a GUI! I love GUIs... I think there should not be a separation between GUIs and the commandline... in an ideal OS
<xybre>
shevy: then use Windows NT?
Fuzai has quit [Quit: No Ping reply in 180 seconds.]
<shevy>
nah, ruby works better on linux
Fuzai has joined #ruby
Soda has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
<shevy>
xybre I think Haiku and ReactOS will never really manage to catch up :(
gcds has quit [Quit: gcds]
DrShoggoth has joined #ruby
Mars` has quit [Remote host closed the connection]
petey has joined #ruby
<xybre>
I'd love to see a better OS, but it seems that most projects are poorly managed or maintained.
Mars` has joined #ruby
mary5030 has quit [Ping timeout: 264 seconds]
deens has joined #ruby
<xybre>
It doesn't seem like there's enough people willing to risk it anymore in the Open Source Community, it would need real funding and solid backing. But then it'd have a profit motive, so it'd be challenging to keep it doing the right thing.
mac___ has joined #ruby
Clooth has quit [Quit: Leaving...]
<shevy>
yeah
<shevy>
noone has time anymore, other things are more important
<shevy>
well
<shevy>
like there is a lack of enthusiasm as well
<xybre>
There's plenty of dev happening for the Linux kernel and all the assorted userland tools, but people don't want to risk working on a dead end project.
<shevy>
linus did not have financial backing initially
<|jemc|>
I think it's just hard to justify the effort expended when "linux" is so customizable
sectionme has joined #ruby
<shevy>
math neither had financial backing
apeiros has quit [Remote host closed the connection]
<xybre>
No, but there also wasn't much competition.
<shevy>
sorry
<shevy>
*matz
<shevy>
my brain is telling me to go to bed slowly...
<xybre>
Yeah but we're not talking programming languages, many of them did not have financial backing, but thats not the same as an OS.
Mars` has quit [Ping timeout: 245 seconds]
<xybre>
Well, usually its not. I actually found out recently that that the REBOL v3 language was originally being built for Blackberry as their OS, but they bailed and used QNX instead.. and you can see how well that worked out for them.
mercwithamouth has quit [Ping timeout: 240 seconds]
mercwithamouth has joined #ruby
<xybre>
And of course Java is both an OS and a language that just happens to run on the JVM virtual hardware, but it was intended to be physical hardware and there were even a couple of Java processors developed, but they never went mainstream.
JRizzle has quit [Quit: Leaving]
<xybre>
But both of those had financial backing, of course.
<shevy>
yeah, a kernel is more work than a programming language
siwica has quit [Ping timeout: 264 seconds]
<xybre>
Well, its funny, because a functional OS isn't *that* hard, but you have to do everything yourself.
mengu has quit [Remote host closed the connection]
mengu has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
yfeldblum has joined #ruby
sepp2k1 has joined #ruby
jrobeson has quit [Read error: Connection reset by peer]
kofno has joined #ruby
sepp2k has quit [Ping timeout: 240 seconds]
mengu has quit [Ping timeout: 256 seconds]
<nhmood>
When I pass a variable to a function/method, does it not create a local instance in Ruby (like in C/C++)?
aapzak has quit [Read error: Operation timed out]
<nhmood>
I'm seeing that when I pass a local variable to a method (within the same class) if I try to access the variable after it is modified by the method?
<|jemc|>
nhmood: yes, you can think of it somewhat like it is passing by value instead of by reference
<|jemc|>
or rather
<|jemc|>
the reverse of that
<|jemc|>
but often, your method should not be "mutating" the input object unless that is the desired effect
jrobeson has joined #ruby
<|jemc|>
the notions of passing by value or reference aren't the same in ruby as in c/c++
aapzak has joined #ruby
<davidcelis>
#dup dat shit
<|jemc|>
but when you pass an object to a method, you are passing the actual object
<|jemc|>
rather than duplicating it, which as davidcelis ntoed can be done with my_object.dup
ewnd9 has quit [Ping timeout: 245 seconds]
xkickflip has quit [Ping timeout: 264 seconds]
maletor has joined #ruby
<nhmood>
Interesting, I wonder what the reasoning behind by reference was for methods
kofno has quit [Ping timeout: 264 seconds]
<|jemc|>
but there are often other ways to acheive what you want
<nhmood>
As most languages I have dealt with by default take it by value as opposed to reference
<|jemc|>
the design patterns intended are just _different_
<|jemc|>
like I said, 'by value' and 'by reference' don't have meaning in the same way they do in c
<nhmood>
I see
xkickflip has joined #ruby
<nhmood>
Do you have a recommended reference/article/write up for this topic?
<|jemc|>
in the ruby/python style of languages, we talk more about 'mutable' vs 'immutable'
<nhmood>
Yes, I see that a lot reading articles about Ruby/Python
<nhmood>
I come from a C/C++ bg so I'm fairly new to this style language I guess
<|jemc|>
yeah, it's a big shift
funburn has joined #ruby
<nhmood>
Another related question: If I take the input argument and assign it to a new variable, does that act as a reference?
<|jemc|>
yeah
<nhmood>
e.g. def mymethod(arg)
<nhmood>
_myarg = arg
<nhmood>
If I modify _myarg, I'm guessing it will affect arg?
<|jemc|>
yes
<nhmood>
As it is a reference and not a dup
<nhmood>
I see
<nhmood>
.dup() is universal to all objects?
<nhmood>
#dup*
staafl has quit [Ping timeout: 248 seconds]
<|jemc|>
it is defined in Object, so it works for all objects that inherit from it
<|jemc|>
although it might not always do what you want, in which case you can redefine it
flipture has quit [Ping timeout: 246 seconds]
<nhmood>
I see
<|jemc|>
as a side note, yes, all objects inherit from Object by default
<nhmood>
That is a pretty big detail I seem to have missed :P
<nhmood>
I need to go back over all the code I've written so far and address this lol
<|jemc|>
but you can explicitly specify BasicObject, for example, and not get all of Object's methods
<|jemc|>
also, I'd recommend reading about Enumerable
<|jemc|>
if you're dealing with an enumerable collection of objects, it defines a bunch of useful methods for doing so
<nhmood>
With respect to this scoping issue or in general (with respect to the "Ruby way")
<nhmood>
I've briefly looked at Enumerable
<|jemc|>
eh, because it sort of applies to this discussion
<|jemc|>
but not quite directly
tatsuya_o has joined #ruby
mlpinit has joined #ruby
<|jemc|>
for example, '#map' vs '#map!'
<nhmood>
In place vs return mapped?
<|jemc|>
the latter modfies the receiver object and the former does not
<|jemc|>
yes
<nhmood>
Yeah, I've seen that notation with things like slice! or gsub!
<nhmood>
Which I guess are also Enumerable methods?
nwertman_ has quit [Ping timeout: 240 seconds]
<nhmood>
Well, gsub is for String and slice for Array
<|jemc|>
slice is also for String as well
kvirani has quit [Remote host closed the connection]
<|jemc|>
but yeah, I bring that up because I don't often find myself explicitly 'dup'ing objects just to avoid modifying them
kvirani has joined #ruby
<nhmood>
Yeah there is probably a better way of doing what I am doing to avoid duping
<|jemc|>
rather it's more ruby-ish to chain together methods that return objects that are related to the input but did not modify the input
Apocalypse has quit [Ping timeout: 245 seconds]
<nhmood>
I see
<nhmood>
Yeah I am not very well versed in the "Ruby" way of doing things
<|jemc|>
especially with Arrays and other collections
amacgregor_ has joined #ruby
<nhmood>
I feel like a lot of my code right now is still in the non-Ruby mindset
<nhmood>
Do you know of any good resources for helping me see the "Ruby" way haha
siwica has quit [Ping timeout: 240 seconds]
<nhmood>
It'd be great if there was a resource that just had examples of "Traditional way --> Ruby way"
<banisterfiend>
waxjar cos the method is only defined after you run x
<volty>
waxjar: what, precisally ?
<waxjar>
aaah
<waxjar>
that makes sense, thx banisterfiend
<banisterfiend>
waxjar np fellow leidenite
<roflmaus>
Hi. I've read about the object model in Ruby that a class is just an object of class "Class" (which is a subclass of object of class "Object"), and an instance of a class is actually a subclass of "Class". So i wonder: is it possible to subclass directly from an arbitrary object?
<|jemc|>
banisterfiend: I pushed my first gem that (ab)uses the Ruby 2.1 def return value to act as a decorator