<Yzguy>
maybe valid? I'm new to all the crazy consolidation stuff you can do with ruby
<Yzguy>
forgot the other " on Verde
<denom>
oh man, the recipe 'rbenv-binstubs' was binstubbing the 'make' command. that seems really strange..
<Yzguy>
@diegoviola ^^
Azure has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Arnvald_ has joined #ruby
Arnvald has quit [Read error: Connection reset by peer]
Azure has quit [Remote host closed the connection]
gusrub has joined #ruby
pwnd_nsfw has joined #ruby
<diegoviola>
Yzguy: that just gives me false back
spt0 has joined #ruby
Moosashi has quit [Quit: Moosashi]
zarubin has joined #ruby
<Yzguy>
i might have mssed up the !.nill thing
crazydiamond has quit [Ping timeout: 246 seconds]
<Yzguy>
i've used a guard clause like twice before
bronson has joined #ruby
arooni has quit [Ping timeout: 264 seconds]
<Yzguy>
yeah take out the !
nbdy has joined #ruby
avahey has joined #ruby
Arnvald_ has quit [Read error: Connection reset by peer]
Arnvald has joined #ruby
<diegoviola>
Yzguy: that won't work either
symm- has quit [Ping timeout: 256 seconds]
<diegoviola>
undefined method
spuk has joined #ruby
PaulCapestany has quit [Quit: .]
<diegoviola>
Yzguy: I'll just use a if else block
zarubin has quit [Ping timeout: 272 seconds]
RegulationD has quit [Ping timeout: 250 seconds]
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
PaulCapestany has joined #ruby
yfeldblum has quit [Remote host closed the connection]
Azure has joined #ruby
wildlander has quit [Quit: Saliendo]
<Yzguy>
ok, it shoulda worked though.
yfeldblum has joined #ruby
rubie has joined #ruby
<rubie>
hi all: im getting unexpected behavior in the little script im writing, could someone take a look https://repl.it/B6ky
supermarin has quit [Remote host closed the connection]
devbug has joined #ruby
<diegoviola>
Yzguy: maybe it's because I'm calling that helper method from my view so it has nothing to return to?
jimmybomb1 has joined #ruby
cdg has quit [Remote host closed the connection]
patdohere has joined #ruby
bronson has quit [Remote host closed the connection]
<diegoviola>
actually
jimmybomb has quit [Ping timeout: 250 seconds]
<Yzguy>
rubie i'm taking a look
devbug has quit [Ping timeout: 240 seconds]
<diegoviola>
yeah the return doesn't work there
colleenmcguckin has quit []
fullofcaffeine has quit [Ping timeout: 240 seconds]
lacuna has quit [Remote host closed the connection]
djbkd has quit [Quit: My people need me...]
<rubie>
Yzguy: thanks
jbrhbr has quit [Ping timeout: 272 seconds]
sarkis has quit [Ping timeout: 240 seconds]
sarkis has joined #ruby
fullofcaffeine has joined #ruby
<Yzguy>
rubie its happening on line 14
<Yzguy>
so somewhere in the function
<rubie>
well i mutate it on line 24
<rubie>
using #unshift
<rubie>
but once it finishes the loop i would expect the value of test_word to be reset to word
<rubie>
since we never mutate word
exadeci has quit [Quit: Connection closed for inactivity]
skweek has joined #ruby
denom has quit [Quit: leaving]
<Yzguy>
right
<Yzguy>
the shift is what is causing that h to go away
<Yzguy>
im still trying to understand why
uberjar has joined #ruby
p1k has quit [Quit: Leaving]
maneco has left #ruby ["WeeChat 1.3"]
Moosashi has joined #ruby
<uberjar>
Hi. For some reason after a fresh install issuing the following command just hangs for me.. what could be the problem ? gem install bundler
jessemcgilallen has joined #ruby
<Radar>
uberjar: how did you do the install?
fullofca_ has joined #ruby
baweaver has joined #ruby
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<uberjar>
Radar: well for some reason, you know how it it can be.. this just started working all of a sudden
<Radar>
uberjar: Yup.
howdoicomputer has quit [Ping timeout: 272 seconds]
<uberjar>
so how about I just come back if it happens again… maybe some kind of odd network glitch
<uberjar>
chers
uberjar has quit [Quit: uberjar]
maloik has joined #ruby
fullofcaffeine has quit [Ping timeout: 256 seconds]
houhoulis has quit [Remote host closed the connection]
Aerillith has quit [Quit: Leaving]
tahon has joined #ruby
Moosashi has quit [Quit: Moosashi]
dlitvak has joined #ruby
dlitvak has quit [Remote host closed the connection]
maloik has quit [Ping timeout: 240 seconds]
Moosashi has joined #ruby
<nerium>
Is there a way to list all classes in a folder?
ScottNYC has quit [Quit: WeeChat 1.3]
TyroneBlack has joined #ruby
chouhoulis has joined #ruby
rsc___ has quit [Quit: rsc___]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TyroneBlack has left #ruby [#ruby]
jgpawletko has joined #ruby
diegoviola has quit [Ping timeout: 264 seconds]
diego1 has joined #ruby
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as diegoviola
lacuna has joined #ruby
<Radar>
nerium: no
howdoicomputer has joined #ruby
<Radar>
?xy
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
sucks has quit [Ping timeout: 272 seconds]
TomPeed has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
Moosashi has quit [Quit: Moosashi]
blackmesa has joined #ruby
dfockler has quit [Ping timeout: 272 seconds]
sucks has joined #ruby
cjbottaro has joined #ruby
triangles has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
howdoicomputer has quit [Ping timeout: 272 seconds]
ramfjord_ has quit [Ping timeout: 250 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<nerium>
@Radar I
<Radar>
nerium
<nerium>
@Radar I need to access and call all classes that exists in a folder
<nerium>
I guess I can load all classes, that’s simple and then just look at all existing classes in that scope
<jhass>
we should just make a bot that we can point at some one and it will reply with why? the next five times they say something
brendan- has joined #ruby
<nerium>
jhass: Are you refering to me?
sucks has quit [Remote host closed the connection]
<jhass>
not just
Spami has quit [Quit: This computer has gone to sleep]
<nerium>
I’ll try to explain it a bit better then.
<nerium>
I’m building something similuar to homebrew where each class represents a lib, like ”ps”. I need to call each class in the lib folder as each lib/class encapsulates its own tests
sucks has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nerium>
That’s why I need to list all classes in a folder
Moosashi has joined #ruby
devbug has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jgpawletko has quit [Quit: jgpawletko]
<Yzguy>
rubie word is definitely getting changed
<rubie>
where?
<Yzguy>
not sure yet, but I'm doing some crazy "puts word = #{word}" everywhere
<Yzguy>
and it has different values during the loop
<rubie>
hah
<Radar>
nerium: example code please kthx
<Yzguy>
but nothing is directly touching the "word" variable
<Yzguy>
blowing my mind
<rubie>
unless test_word is being passed by reference
<rubie>
like test_word is just a reference to word
<baweaver>
nerium: why not just do something sane like use YML/JSON for packages and make a parser
* Radar
opens mouth to sigh, gives up entirely on everything
<nerium>
baweaver: What do you mean?
Moosashi has quit [Quit: Moosashi]
<baweaver>
he meant your code
<baweaver>
not homecrew
<baweaver>
brew*
TheHodge has quit [Quit: Connection closed for inactivity]
tahon has quit [Remote host closed the connection]
<Radar>
p.s. Forumla probably defines an inherited callback
JDiPierro has quit [Remote host closed the connection]
tonko has joined #ruby
<Radar>
This is the whole "Radar is being silent on this because there is no actual code and he doesn't want to look like an idiot suggesting a fix for a non-issue"
<nerium>
@Radar What did you expect? I not sure what code I could post that would be relevant
<nerium>
I do. I just need to list all classes in a folder. That would solve my problem.
<Radar>
I guess something like that MIGHT womrk.
tonko has quit [Ping timeout: 252 seconds]
<Yzguy>
is when "word" changes to "ello"
ap4y has joined #ruby
<nerium>
Radar: Aha, that would be even better
<rubie>
Yzguy: so it happens in the helper method?
<Yzguy>
yeah something happening in that and returning is changing word
<rubie>
Yzguy: maybe something to do with #shift
bronson has joined #ruby
<Yzguy>
yeah I'm thinking so
<Radar>
nerium: I missed the subclasses method, but it works for me.
<Yzguy>
its just super weird because no where does "word" explicity get reassigned
<Radar>
nerium: Anything that inherits from that Formula class will be available in subclasses, and then you'll have access to each of those subclasses that way.
<nerium>
Radar: I think I can use that. Thanks
<Radar>
np.
claw has joined #ruby
devbug has quit [Ping timeout: 244 seconds]
maloik has quit [Ping timeout: 250 seconds]
jhonglim has quit [Quit: jhonglim]
colegatron has quit [Ping timeout: 250 seconds]
<Yzguy>
rubie yeah when rearrange gets assigned the second time its ["h"], then word is ["e","l","l","o"]
<rubie>
Yzguy: maybe once we are in the while loop and test_word is assigned to word, ruby will not reach out of the while loop scope to reassign word. It will just re assign test_word to whatever test_word was in the previous iteration of the while loop
<Yzguy>
well check_word doesn't know anything about "word", its out of scope
<tejasmanohar>
like a way to programmatically interact with homebrew (on the user's system) without just executing `brew ...` commands and parsing their output with pattern matching?
kfrz has joined #ruby
<tejasmanohar>
i see it is a ruby project but dont see a gem or anything i can plug into
bb010g has joined #ruby
cubicme has joined #ruby
DurstBurger has quit [Ping timeout: 240 seconds]
underplank has joined #ruby
lubarch has quit [Client Quit]
lubarch has joined #ruby
sucks has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
phillips1012 has quit [Ping timeout: 272 seconds]
moeSeth has joined #ruby
diegoviola has quit [Ping timeout: 272 seconds]
cryocaustik has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
dmcp has quit [Quit: Disconnecting...]
hahuang65 has quit [Ping timeout: 240 seconds]
rsc___ has quit [Quit: rsc___]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diego1 has joined #ruby
dimik has joined #ruby
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as diegoviola
bronson has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 250 seconds]
devoldmx has joined #ruby
cwong_on_irc has joined #ruby
bronson has joined #ruby
cwong_on_irc has quit [Client Quit]
phillips1012 has joined #ruby
supermarin has joined #ruby
favadi has joined #ruby
tahon has quit [Remote host closed the connection]
mahk has quit [Ping timeout: 256 seconds]
rubie has joined #ruby
devoldmx has quit [Remote host closed the connection]
mtmcfarl has quit [Remote host closed the connection]
cryocaustik has quit [Quit: went to chop soup]
tildes has joined #ruby
Arnvald has joined #ruby
<cubicme>
hi, is there any reason that calling a lot of IO.popen {} should cause memory/resource leak? I’m caliing tiny script in my server process, and after a while it’s consuming all of the memory and I get “Cannot allocate memory”
sarkis has quit [Ping timeout: 264 seconds]
AlexRussia has quit [Ping timeout: 260 seconds]
Arnvald has quit [Remote host closed the connection]
Arnvald_ has joined #ruby
bubbys has quit [Ping timeout: 246 seconds]
kfrz has quit [Quit: Leaving.]
S01780 has joined #ruby
IrishGringo has quit [Ping timeout: 272 seconds]
supermarin has quit [Remote host closed the connection]
rakm has joined #ruby
jud^ has joined #ruby
skade has joined #ruby
sarkis has joined #ruby
bronson has quit [Remote host closed the connection]
lubarch has quit [Quit: leaving]
rakm has quit [Client Quit]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
htmldrum has quit [Ping timeout: 244 seconds]
sarkis has quit [Ping timeout: 250 seconds]
Arnvald_ has quit []
Arnvald has joined #ruby
sapslaj has joined #ruby
supermarin has joined #ruby
bubbys has joined #ruby
last_staff has joined #ruby
otherj has joined #ruby
sarkis has joined #ruby
rattatmatt has joined #ruby
tahon has joined #ruby
EasyCo has quit [Quit: Connection closed for inactivity]
tahon has quit [Remote host closed the connection]
chouhoulis has joined #ruby
tahon has joined #ruby
FatKuntz has joined #ruby
FatKuntz has left #ruby [#ruby]
sarkis has quit [Ping timeout: 240 seconds]
leat has joined #ruby
rubie has quit [Remote host closed the connection]
edwinvdg_ has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
mahk has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
tahon has quit [Ping timeout: 250 seconds]
George|Orwell has joined #ruby
George|Orwell has left #ruby [#ruby]
blackmesa has joined #ruby
sarkis has joined #ruby
jud^ is now known as jud
jud has quit [Changing host]
jud has joined #ruby
underplank has quit [Quit: underplank]
sarkis has quit [Ping timeout: 250 seconds]
blackmesa has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
duckpuppy has joined #ruby
sarkis has joined #ruby
yqt has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
sarkis has quit [Ping timeout: 240 seconds]
yardenbar has joined #ruby
ur5us has joined #ruby
Moosashi has joined #ruby
Oog has joined #ruby
ur5us has quit [Remote host closed the connection]
RegulationD has joined #ruby
dionysus69 has joined #ruby
diegoviola has quit [Ping timeout: 240 seconds]
B1n4r10 has quit [Ping timeout: 240 seconds]
sarkis has joined #ruby
skade has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Client Quit]
maloik has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
dionysus69 has joined #ruby
trautwein has joined #ruby
tagrudev has joined #ruby
ta has quit [Remote host closed the connection]
sarkis has quit [Ping timeout: 264 seconds]
moeabdol has quit [Ping timeout: 256 seconds]
maloik has quit [Ping timeout: 250 seconds]
moeabdol has joined #ruby
lacuna has quit [Remote host closed the connection]
Arnvald has quit [Remote host closed the connection]
otherj has quit [Quit: .]
mahk has quit [Quit: mahk]
sarkis has joined #ruby
djbkd has quit [Quit: My people need me...]
ramfjord has joined #ruby
diegoviola has joined #ruby
jimmybomb has quit [Ping timeout: 250 seconds]
lacuna has joined #ruby
Arnvald has joined #ruby
lacuna has quit [Read error: Connection reset by peer]
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
christiandsg has quit [Remote host closed the connection]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
tildes has quit [Ping timeout: 272 seconds]
bubbys has quit [Ping timeout: 244 seconds]
bubbys has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
sarkis has quit [Ping timeout: 250 seconds]
diegoviola has quit [Quit: WeeChat 1.3]
cornerman has quit [Ping timeout: 260 seconds]
sandstrom has joined #ruby
ur5us has joined #ruby
ohaibbq has joined #ruby
cornerman has joined #ruby
tesuji has joined #ruby
amclain has quit [Quit: Leaving]
sarkis has joined #ruby
Arnvald has quit [Remote host closed the connection]
tahon has joined #ruby
sarkis has quit [Ping timeout: 272 seconds]
Jet4Fire has joined #ruby
dimik has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 244 seconds]
naftilos76 has joined #ruby
B1n4r10 has joined #ruby
tahon has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
anisha has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
jbrhbr has joined #ruby
Emmanuel_Chanel has joined #ruby
maloik has joined #ruby
devoldmx has joined #ruby
chouhoulis has quit [Ping timeout: 250 seconds]
roshanavand has joined #ruby
kmckelvin has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
roshanavand has quit [Remote host closed the connection]
maloik has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
devoldmx has quit [Ping timeout: 250 seconds]
naftilos76 has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
googleAPIsucks has joined #ruby
tjad has joined #ruby
yfeldblum has quit [Remote host closed the connection]
therealcode has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<S01780>
Morning. I'm trying to install a github program using RoR and bundler. Upon running install bundle in the file, it says "error, cannot find pg_conf," which is from the PostgreSQL install.
<S01780>
I installed PostGre using sudo, would that mess up the path?
jgt2 has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
therealcode has quit [Client Quit]
rsc___ has joined #ruby
rsc___ has quit [Client Quit]
googleAPIsucks has quit [Quit: Page closed]
muON has joined #ruby
rsc___ has joined #ruby
<muON>
hi, is anyone familiar with the google drive API here?
<muON>
I'm having some trouble discerning the difference between oauth2 creds and implementing service accounts
<muON>
main issue is that I can only refresh oauth once an hour and only 5 times a day, and i get auth errors if it refreshes after an hour which is inevitable
lacuna has quit [Remote host closed the connection]
glenny has joined #ruby
Bloomer has quit []
maloik has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Oog has quit []
juddey has quit [Ping timeout: 256 seconds]
edwinvdgraaf has joined #ruby
norc_ has joined #ruby
symm- has joined #ruby
ohaibbq has quit [Quit: Leaving...]
shredding has joined #ruby
kmckelvin has joined #ruby
supermarin has quit [Remote host closed the connection]
aufi has joined #ruby
SCHAAP137 has joined #ruby
TomyWork has joined #ruby
amincd has joined #ruby
JiYu has left #ruby [#ruby]
brunto has joined #ruby
<amincd>
Hi, if I assign the value of str to str2, then modify str2 with sub!(pattern, replacement), why does the value of str also change?
zeroDivisible has quit [Quit: WeeChat 1.3]
Unicorn| has quit [Quit: Connection closed for inactivity]
<norc_>
The thing is you are passing objects by value.
jud has quit [Quit: Leaving]
<norc_>
Which means you can directly modify them
sarkis has joined #ruby
duckpupp1 has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
TheHodge has joined #ruby
duckpupp1 is now known as duckpuppy
Rodya_ has quit [Remote host closed the connection]
mooe has joined #ruby
steffkes has joined #ruby
<amincd>
isn't "passing objects by value" the same as passing by reference?
duckpuppy has quit [Client Quit]
<amincd>
ah nevermind, I don't know the terminology well enough to even comment
duckpuppy has joined #ruby
sarkis has quit [Ping timeout: 256 seconds]
peterhil_ has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
<norc_>
amincd: Ruby is pass by value, but the value passed is a reference.
<norc_>
Think of it that way.
yfeldblum has quit [Remote host closed the connection]
<amincd>
norc_: I see
skade has joined #ruby
<amincd>
norc_: I don't understand the distinction well enough to fully grok this yet, but that helps
yfeldblum has joined #ruby
saneax is now known as saneax_AFK
<norc_>
amincd: Pass by reference would be something like void foo(int &bar) {} in c++
<amincd>
right..
<amincd>
and pass value as reference?
<norc_>
Where as void foo(int *bar) {} is pass by value (but the value is a reference)
tvw has joined #ruby
<norc_>
Since you are passing a pointer which really is just a memory address.
Mon_Ouie has quit [Ping timeout: 240 seconds]
<norc_>
Which is just a value itself.
sarkis has joined #ruby
<norc_>
amincd: So when you pass an argument to a ruby function it creates a local variable and stores that object in there. If you assign a new object, you are just changing the content of that variable.
mark4 has joined #ruby
joonty has joined #ruby
<norc_>
amincd: Try to inspect the whole thing with #object_id - that should make things clearer.
<amincd>
so in ruby, assigning var1 to var2, means assigning var1's object id to var2
<amincd>
*assigning the value of var
peterhil_ has joined #ruby
jgt2 has joined #ruby
Rumbles has joined #ruby
<norc_>
amincd: In a nutshell, yes. Remember we also have op= though, but that is just a method that happens to look the same.
<norc_>
Errr, nevermind that.
sarkis has quit [Ping timeout: 240 seconds]
<norc_>
op[]= I meant. :)
<norc_>
or generally assignment operator.
<amincd>
ok thanks, I think I get it. I still don't fully understand how a pass-by-reference assignment would be different, in practice, from a pass by reference-of-value assignment which happens in Ruby
<Cork>
anyone know a way to handle exitcode and stderr from Shell.new executions?
djbkd has quit [Ping timeout: 256 seconds]
Cantaberry has quit [Ping timeout: 260 seconds]
skade has quit [Quit: Computer has gone to sleep.]
bweston92 has joined #ruby
joonty has joined #ruby
peterhil_ has quit [Ping timeout: 256 seconds]
AlexRussia has joined #ruby
sarkis has joined #ruby
phillips1012 has quit [Ping timeout: 240 seconds]
nkts_ is now known as marius
ur5us has quit [Remote host closed the connection]
rsc___ has quit [Quit: rsc___]
rodfersou has joined #ruby
InvGhostt has joined #ruby
<sami>
Hi, I'm trying to write a ruby gem. I have a class within my module for block configuration and trying to use the config, configured in what ever script/rails in another class in the same module. Anyone have any experience in that? Happy to post a couple of examples.
<ljarvis>
sami: probably lots of people, do you have a question?
sarkis has quit [Ping timeout: 240 seconds]
Averna has joined #ruby
<sami>
Well, can't post examples it seems :(. This is going to be a lot harder. Sitting on a highly resctricted wifi.
SegFaultAX has quit [Ping timeout: 260 seconds]
<sami>
Hmm. Where do I begin :)
<ljarvis>
the first problem, perhaps :)
colegatron has quit [Ping timeout: 272 seconds]
<sami>
First of, my minitests works however, I can't access the "newly set" configuration from my other class.
<ljarvis>
we're going to struggle without examples here I think
moeSeth has quit [Quit: Connection closed for inactivity]
sarkis has quit [Ping timeout: 240 seconds]
Moosashi has quit [Client Quit]
<rikkipitt>
thanks ljarvis, that looks good!
<rikkipitt>
i'll try and adapt it to work in my case
<norc_>
[1,3,6,8] - Given a float f, I want to obtain the number from the array that is the next one in descending order. Is this doable in a compact one liner?
<Caius>
Not as short in characters, but saves building an intermediate array
<KrzaQ>
I have trouble with this code: http://melpon.org/wandbox/permlink/0KHGzPLh4nIFLaO5 When I uncomment lines 75-77 I'm getting "wrong number of arguments (1 for 0) (ArgumentError)", but the same thing above and below doesn't trigger that warning :(
c355E3B has joined #ruby
Rodya_ has joined #ruby
<shevy>
KrzaQ which method do you use
blackmesa has joined #ruby
mahk_ has quit [Remote host closed the connection]
sarkis has joined #ruby
joonty has quit [Quit: joonty]
<KrzaQ>
shevy: I'm not sure what you mean.
<KrzaQ>
I add methods to Calc as I read their definitions from stdin
NET||abuse has joined #ruby
puria has joined #ruby
<KrzaQ>
calc.b is very simple, it returns some integer and it seems to work
Rodya_ has quit [Ping timeout: 250 seconds]
<shevy>
you got the error above but you did not show the full error message
naftilos76 has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
<KrzaQ>
I guess dependency graph would be a better name
<Ox0dea>
Right.
<Ox0dea>
So, what does "doesn't run" even mean?
Evan_ has joined #ruby
platzhirsch has quit [Quit: Leaving.]
<KrzaQ>
https://gist.github.com/KrzaQ/c75bb3e9a8bafebc286d - if I uncomment lines 75-77 I get prog.rb:75:in `block (2 levels) in <main>': wrong number of arguments (given 1, expected 0) (ArgumentError)
<KrzaQ>
which is weird, because if they're commented, I get the desired result (line b is trivial for my input and is directly a number)
brunto has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
shredding has quit [Ping timeout: 250 seconds]
Snowy has joined #ruby
Rickmasta has joined #ruby
ij has joined #ruby
akem has quit [Remote host closed the connection]
<ij>
Why does this produce an error "child fd 8 is not redirected"? i, o = IO.pipe; IO.popen(%w{date - -}, :err => [:child, o]) { |p| }
dlitvak has quit [Remote host closed the connection]
Evan_ has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
joeyjones has quit [Ping timeout: 240 seconds]
ixti has joined #ruby
csmb has quit [Ping timeout: 256 seconds]
gbailey has joined #ruby
akem has joined #ruby
bronson has joined #ruby
CloCkWeRX has quit [Ping timeout: 256 seconds]
solars has joined #ruby
M-shine has joined #ruby
raenk has quit [Ping timeout: 240 seconds]
roshanavand has quit [Remote host closed the connection]
<Ox0dea>
KrzaQ: I realize you almost certainly aren't trying to write obfuscated code, but you've managed to do so. :P
CloCkWeRX has joined #ruby
<Ox0dea>
You're doing this with on-the-fly methods to defer evaluation, right?
skade has quit [Quit: Computer has gone to sleep.]
FifthWall has joined #ruby
Couch has joined #ruby
Rodya_ has quit [Ping timeout: 256 seconds]
<KrzaQ>
yeah, mostly
ixti has quit [Client Quit]
keyviewer_210489 has joined #ruby
Evan_ has joined #ruby
<Ox0dea>
How do you mean?
csmb has joined #ruby
<Ox0dea>
What other "advantage" do you perceive?
joeyjones has joined #ruby
joeyjones has quit [Changing host]
joeyjones has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
favadi has joined #ruby
<KrzaQ>
They'll be truly function calls. I guess that's weak
bMalum has quit [Quit: bMalum]
shanemcd has joined #ruby
<KrzaQ>
Still, I see no reason for this not to work
<KrzaQ>
yet it doesn't
raenk has joined #ruby
InvGhosttt has joined #ruby
<shevy>
foo.rb:32: warning: ARGF#lines is deprecated; use #each_line instead
<shevy>
aha, we need 'data.txt' right?
Robert_ has joined #ruby
passerine has left #ruby ["Leaving"]
Robert_ is now known as Guest62985
<KrzaQ>
shevy: that's why I put it on wandbox, it was a running live example
<KrzaQ>
Added data.txt to the gist
InvGhostt has quit [Ping timeout: 264 seconds]
<KrzaQ>
hm, funny
<KrzaQ>
it seems I redefined p
<shevy>
does this take a long time
<shevy>
or does nothing happen?
<shevy>
I invoke the ruby code but it just seems to not do anything
<KrzaQ>
<0.1 second to execute/fail
<shevy>
save for the "warning: ARGF#lines is deprecated; use #each_line instead"
myztic has joined #ruby
Cantaberry has joined #ruby
<KrzaQ>
ah, I modified it to read from stdin for wandbox
<shevy>
ah
<KrzaQ>
anyhow, I found the problem
<KrzaQ>
maybe I should have used longer method names
Kruppe has joined #ruby
<shevy>
which method was it? .p() on class Calc?
<Ox0dea>
Get 'im!
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
<Ox0dea>
That class is perfectly useless, by the way.
<Ox0dea>
"Classes as namespaces" is derpy as.
<KrzaQ>
shevy: yeah
<KrzaQ>
Ox0dea: I'm not a ruby proffessional :P
<KrzaQ>
I think you kinda gathered that by now
<Ox0dea>
I mean, you clearly know enough Ruby to be dangerous.
<Ox0dea>
To yourself and others.
<Ox0dea>
Look at this mess you've made for all of us.
chouhoulis has joined #ruby
<Ox0dea>
KrzaQ: You can use `::Kernel.p` instead of just `p` to invoke the right method.
<Ox0dea>
You'll be better able to see what's going wrong.
dlitvak has joined #ruby
<KrzaQ>
mhm
<KrzaQ>
Ox0dea: it's toy code, so I don't have any inhibitions
<ij>
Solved my issue, :child was unneccessary.
<Ox0dea>
KrzaQ: I'm not sure I follow?
puria has quit [Ping timeout: 240 seconds]
<Ox0dea>
Giving one fuck is a fool's errand.
<KrzaQ>
it's advent of code, if something looks particularly clever or nice or fun: I'll do it, even if I would scalp myself for it in code review in a real project
akem has quit [Remote host closed the connection]
<Ox0dea>
KrzaQ: And are you having fun?
<Ox0dea>
Your code certainly doesn't look nice. Do you reckon it's clever?
<KrzaQ>
until this one I had
<Ox0dea>
Oh, right.
<Ox0dea>
Day 7 was definitely tricksy.
<Ox0dea>
And then a dead-simple Day 8. Bah humbug.
<KrzaQ>
I'll see how it looks after cleanup anyway
dlitvak has quit [Remote host closed the connection]
<KrzaQ>
I can always redo it in a saner way
chouhoulis has quit [Ping timeout: 256 seconds]
<Ox0dea>
But zen eet vood not be a toy, ja?
puria has joined #ruby
<KrzaQ>
Ja
p0wn3d has joined #ruby
<adaedra>
Nein
<ij>
eet is a dutch woord for eat
<Ox0dea>
I believed you immediately because of the repeated O.
<Ox0dea>
So Dutch.
lubarch has quit [Quit: leaving]
boxofrox has joined #ruby
soulisson has joined #ruby
mooe has quit [Quit: Connection closed for inactivity]
Mon_Ouie has quit [Ping timeout: 250 seconds]
<soulisson>
Hi, I'm new to unit testing and I have troubles understanding what a unit test is exactly, when writing a TestCase is each method a unit test?
rikkipitt has quit [Quit: Leaving...]
<Ox0dea>
soulisson: You could do much worse as first approximations go.
yfeldblum has quit [Ping timeout: 264 seconds]
platzhirsch has joined #ruby
<soulisson>
Ox0dea, sorry I don't understand
<Ox0dea>
soulisson: One test case per method isn't a bad way to start testing.
<Ox0dea>
A case can (and generally should) contain multiple assertions, mind.
<soulisson>
Ox0dea, so if we speak in a general manner each method defined in a TestCase class is a unit test?
<Ox0dea>
soulisson: Oh, you're hung up on the terminology? Technically, the definition of "unit test" is predicated on what constitutes a "unit" in a given project.
dlitvak has joined #ruby
ij has left #ruby ["WeeChat 1.3"]
<Ox0dea>
soulisson: But yeah, your intuition is pretty much correct.
sameerynho has joined #ruby
<soulisson>
Ox0dea, ok,thanks
icey has joined #ruby
icey has quit [Changing host]
icey has joined #ruby
InvGhosttt has quit [Ping timeout: 250 seconds]
JDiPierro has joined #ruby
<Ox0dea>
soulisson: Happy to help. Any reason you went with test/unit?
nertzy has quit [Quit: This computer has gone to sleep]
JDiPierro has quit [Remote host closed the connection]
<soulisson>
Ox0dea, I read something about TDD, I thought it was nice
<Ox0dea>
soulisson: Hm? TDD is great, but test/unit is pretty spare.
<Ox0dea>
It'll certainly suffice for getting your feet wet, I suppose.
krzkrzkrz has quit [Read error: Connection reset by peer]
<soulisson>
ok, I see, thanks
krzkrzkrz has joined #ruby
<Ox0dea>
To clarify, test/unit is one of many unit testing libraries availa
<Ox0dea>
ble to you.
blackmesa has joined #ruby
<Ox0dea>
In hindsight, I suppose you could already be using Minitest, but with the old API.
epochwolf has joined #ruby
sdothum has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
pandaant has joined #ruby
JammyHammy has quit [Read error: Connection reset by peer]
skweek has joined #ruby
arup_r has quit [Remote host closed the connection]
<KrzaQ>
but is it weird or is it wrong? (let's put the dynamic method creation aside)
<Ox0dea>
Oh, shit. I thought you'd got it working.
<Ox0dea>
Don't visit that link.
<adaedra>
TOO LATE
<Ox0dea>
Onoes!
<KrzaQ>
I did get that working Ox0dea
<Ox0dea>
Okay, good.
peterhil_ has quit [Ping timeout: 240 seconds]
<Ox0dea>
Then it's definitionally not wrong?
<KrzaQ>
It worked correctly for my input
<Ox0dea>
Unorthodox as hell, sure, but it makes the right figures come out.
<KrzaQ>
Trying to decipher your code now :P
skade has joined #ruby
lubarch has joined #ruby
<KrzaQ>
what's the upcase for?
<[k->
DOOM
atomical has joined #ruby
<KrzaQ>
upcase of DOOM?
<Ox0dea>
KrzaQ: Can't have identifiers named `do`, `if`, or `in`.
<[k->
damn that hack
<KrzaQ>
ah
<Ox0dea>
KrzaQ: Don't you love it?
<Ox0dea>
Whoops. That was for [k-.
wmdrossard has joined #ruby
<[k->
this is why we should have comments!
<KrzaQ>
p is pretty dangerous, if I can say so myself
<KrzaQ>
too*
<KrzaQ>
but wait
<KrzaQ>
aren't upcase names constants?
decoponio has joined #ruby
<KrzaQ>
I guess you write to them only once, so it works
<[k->
ruby does allow you to override constants
last_staff has quit [Quit: last_staff]
d0nn1e has quit [Ping timeout: 260 seconds]
<[k->
there are warnings in the output
<KrzaQ>
Fair enough
sgambino has joined #ruby
<KrzaQ>
okay
synthroid has joined #ruby
<KrzaQ>
so you're relying on the fact that, when sorted, there are no references to yet-to-be-defined constatns
peterhil_ has joined #ruby
d0nn1e has joined #ruby
<solars>
is vim-ruby-refactoring dead?
<KrzaQ>
and you're not taking into account that ~ will return negative result
<KrzaQ>
but overall, awesome Ox0dea
<[k->
the power of functional programming!
<Ox0dea>
KrzaQ: More technically, I'm taking advantage of the fact that the input is just the "taps" of an LFSR.
<Ox0dea>
The math for ~ works out fine regardless of integer width.
favadi has joined #ruby
<Ox0dea>
Not in the general case, obviously.
<KrzaQ>
it could be a problem if they made it so, same with <<
<KrzaQ>
not a big one, but you'd see -1 instead of 65535 for example :P
chouhoulis has joined #ruby
ruid has quit [Ping timeout: 256 seconds]
rsc___ has quit [Quit: rsc___]
<shevy>
this has now reached NASA quality!
solocshaw has joined #ruby
<Ox0dea>
That was insensitive?
devoldmx has joined #ruby
DurstBurger has joined #ruby
kmckelvin has quit [Ping timeout: 272 seconds]
ruid has joined #ruby
ruid has quit [Changing host]
ruid has joined #ruby
yqt has quit [Ping timeout: 272 seconds]
dmoe has quit [Quit: Connection closed for inactivity]
chouhoulis has quit [Ping timeout: 256 seconds]
CloCkWeRX has quit [Ping timeout: 256 seconds]
arup_r has joined #ruby
toomus has joined #ruby
mikecmpbll has joined #ruby
<toomus>
Hi all
<toomus>
Why this doesnt work?
mloy is now known as mloy|afk
<toomus>
"+".gsub('+', '\+')
<KrzaQ>
Heh, day 8 was so simple
devoldmx has quit [Ping timeout: 256 seconds]
<shevy>
toomus perhaps because + is special
<jhass>
>> "+".gsub('+', '\+'
<ruboto>
jhass # => /tmp/execpad-14ec7efdfcaf/source-14ec7efdfcaf:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/482178)
<Ox0dea>
In fact, KRI calls that argument (Caius' "\\1") `backref` internally.
malconis has joined #ruby
<Ox0dea>
Never mind.
keyviewer_57179 has joined #ruby
<[k->
suddenly a new ruby interpreter pops up?
<mikecmpbll>
heh
<mikecmpbll>
did you write it, [k- ?
<Ox0dea>
It's more Koichi's (and nobu's) than matz's, in my opinion.
aryaching has quit [Ping timeout: 272 seconds]
Rumbles has quit [Ping timeout: 272 seconds]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
favadi has joined #ruby
<[k->
i do not have much knowledge on much
<devster31>
ok, today I even went on reddit to check the solutions but they're not doing it in a substantially different way... http://dpaste.com/26VNDBY problem is 2fold, the first line is a lower number than the solution, the second errors out with a bad unicode escape
<Ox0dea>
[k-: There's wisdom in knowing that.
_stu_ has joined #ruby
emilkarl has joined #ruby
<emilkarl>
How could you wrap digits in a string when a span-tag the easiest way?
blackmesa has joined #ruby
<emilkarl>
with*
bnizzle has joined #ruby
goodcodeguy has joined #ruby
<emilkarl>
ex “15 hours 10minutes” -> “<span>15</span> hours 10<span>minutes</span>”
<BSarante>
I'm doing a program in ruby to enter a website
<jhass>
actually I see a #ruby-br, only 4 people though
roshanavand has joined #ruby
<Ox0dea>
I have some anecdata here which suggest that people who at least occasionally talk to themselves aloud do so most frequently while they are cooking for themselves. I'm in the market for corroborators.
<jhass>
not sure if it's country or language code
<jhass>
?offtopic Ox0dea :P
<ruboto>
Ox0dea, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<Ox0dea>
I'll ask again later. ^_^
<devster31>
wow, the bot is smart
puria has joined #ruby
<jhass>
wow, there's a #ruby-creative
<jhass>
do I want to know?
yardenbar has quit [Ping timeout: 256 seconds]
allcentury has quit [Ping timeout: 240 seconds]
<[k->
ruboto is equipped with machine learning and natural language processing abilities
mostlybadfly has quit [Quit: Connection closed for inactivity]
devoldmx has joined #ruby
<Ox0dea>
jhass: Yep.
<jhass>
Ankhers: this is nothing something we can use locally to reproduce your issue
<jhass>
er, s/something//
davedev24 has quit [Ping timeout: 240 seconds]
<[k->
correction: this is not* something [...]
<Ankhers>
jhass: Unfortunately I cannot really give my company's code. Which is why I was just asking about scenarios where one would work, and not the other.
<jhass>
>> class MyObject; def key; end; end; o = MyObject.new; [o.public_send(:key), o.method(:key)]
<jhass>
Ankhers: if you're not able to produce a minimal reproducing example nor share your real code and not able to solve your issue yourself, it's time to hire a consultant
freerobby has quit [Quit: Leaving.]
<[k->
if you do not tell us the error, we might not be able to tell the issue at all
kp666 has joined #ruby
<[k->
error loggggg
<Ox0dea>
Symbol.new should do gensym.
akem has joined #ruby
tesuji has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 256 seconds]
allcentury has joined #ruby
cwong_on_irc has quit [Quit: Leaving.]
dlitvak has quit [Remote host closed the connection]
stamina has joined #ruby
mary5030 has joined #ruby
InvGhost has quit [Ping timeout: 256 seconds]
dlitvak has joined #ruby
sankaber has joined #ruby
InvGhost has joined #ruby
lukeasrodgers has joined #ruby
puria has quit [Ping timeout: 250 seconds]
banister has joined #ruby
<devster31>
Ox0dea, http://dpaste.com/0MY4YAH I've tried .encode('utf-8') eval (returns an error for unicode escape) and inspect, but I can't get it to print as intended
<Ox0dea>
devster31: "As intended"?
<devster31>
the paste contains what I'd like to output
<devster31>
basically the same string I used as input
<Ox0dea>
devster31: Are you *certain* AoC gave you this string?
<devster31>
this is line 8 in my input "ckhorczuiudfjmmcc\\u\"wozqxibsfjma"
<Ox0dea>
devster31: How are you getting hold of your input?
<devster31>
copy paste, like in the paste I gave you, I copy the input, open a single quote in a repl, paste everything in, close the single quote
tagrudev has quit [Remote host closed the connection]
RegulationD has joined #ruby
treehug88 has joined #ruby
kmckelvi1 has joined #ruby
krzkrzkrz has quit [Read error: Connection reset by peer]
synthroid has quit [Remote host closed the connection]
kobain has joined #ruby
podman has joined #ruby
dhollinger has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BTRE has joined #ruby
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zacts|pi is now known as zacts
psy_ has quit [Ping timeout: 250 seconds]
noark9 has quit [Remote host closed the connection]
sh4d0wD1 has joined #ruby
maloik has quit [Ping timeout: 240 seconds]
puria has joined #ruby
araujo has quit [Ping timeout: 246 seconds]
sh4d0wD has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
sneakerhax has quit [Ping timeout: 260 seconds]
dlitvak has quit [Ping timeout: 256 seconds]
devoldmx has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
roshanavand has quit [Read error: Network is unreachable]
SCHAAP137 has quit [Remote host closed the connection]
nerium has joined #ruby
favadi has joined #ruby
dlitvak has joined #ruby
ilovelinux has joined #ruby
<ilovelinux>
hi
<blub>
hi i love linux
<havenwood>
ilovelinux: hi
puria has quit [Ping timeout: 240 seconds]
<ilovelinux>
i have problem :(
<blub>
whats that
<ilovelinux>
:/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- msf/core (LoadError)
devoldmx has quit [Ping timeout: 250 seconds]
<ilovelinux>
this ^
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ilovelinux>
why it return this error?
imperator has joined #ruby
hobodave has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
agit0 has joined #ruby
pdoherty has quit [Ping timeout: 272 seconds]
<jhass>
?metasploit
<ruboto>
I don't know anything about metasploit
<jhass>
meh
<imperator>
I don't suppose there's a base64_encoded? method somewhere in core that i'm missing, is there?
jbrhbr has joined #ruby
cwong_on_irc has joined #ruby
<jhass>
?metasploit=Please join #metasploit for help with it.
<ruboto>
I don't know anything about metasploit
<jhass>
derp
<jhass>
!fact add metasploit Please join #metasploit for help with it.
<ruboto>
jhass, I will remember that metasploit is Please join #metasploit for help with it.
<jhass>
?metasploit ilovelinux
<ruboto>
ilovelinux, Please join #metasploit for help with it.
duckpuppy has joined #ruby
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uri_ has joined #ruby
baroquebobcat has joined #ruby
favadi has joined #ruby
<ilovelinux>
uhm
zotherstupidguy has quit [Ping timeout: 245 seconds]
<ilovelinux>
ruboto, jhass, thank you :)
<ilovelinux>
ruboto, is a bot gh
<adaedra>
?justabot
<ruboto>
I'm just a bot. You don't need to address me.
duckpuppy has quit [Ping timeout: 256 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DurstBurger has quit [Ping timeout: 240 seconds]
atomical has joined #ruby
ramortegui has joined #ruby
<shevy>
?cookie
<ruboto>
here's your cookie:
aryaching has quit [Ping timeout: 256 seconds]
favadi has quit [Client Quit]
nfk|laptop has quit [Quit: yawn]
sh4d0wD1 has quit [Quit: Leaving.]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
?rejected
<ruboto>
I don't know anything about rejected
<blub>
hi ruboto
atomical_ has quit [Ping timeout: 240 seconds]
<diegoviola>
you have to be kidding me, sqlite is like the slowest db I ever tried
<diegoviola>
importing 3k records to it shouldn't take like 5 minutes
nettoweb has joined #ruby
solars has joined #ruby
<diegoviola>
with postgres it takes like 5 seconds
noark9 has joined #ruby
[Butch] has joined #ruby
<sarkis>
what version
<canton7>
get your transactions right
<canton7>
then it flies
sh4d0wD has joined #ruby
<diegoviola>
[diego@myhost beta360]$ time rake import_csv
huyderman has quit [Ping timeout: 256 seconds]
<diegoviola>
real 5m39.009s
<diegoviola>
:(
pdoherty has joined #ruby
<shevy>
diegoviola postgres is very fast and great for big data
aryaching has joined #ruby
kp666 has quit [Read error: Connection reset by peer]
sh4d0wD has quit [Client Quit]
<shevy>
I can see it when I download the official NCBI taxonomy database ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz - importing through INSERT takes much longer in sqlite than it does in postgresql
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
<jhass>
?crosspost diegoviola
<ruboto>
diegoviola, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
kp666 has joined #ruby
kp666 has quit [Client Quit]
dlitvak has quit [Remote host closed the connection]
agit0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh4d0wD has joined #ruby
edwinvdgraaf has quit [Ping timeout: 256 seconds]
<diegoviola>
sorry
<diegoviola>
with pg
<diegoviola>
[diego@myhost beta360]$ time rake import_csv
<diegoviola>
real 0m35.988s
<diegoviola>
user 0m21.837s
<diegoviola>
sys 0m1.040s
<diegoviola>
it's not much better, but still
skade has quit [Quit: Computer has gone to sleep.]
<shevy>
I mean the filesize of the csv originally? the NCBI taxonomy one is about 100 MB or extracted, becomes much bigger when one has it as .sql insert statements
<diegoviola>
I'm on a 5 years old computer
<diegoviola>
with 2GB of RAM
<diegoviola>
should be faster on my new thinkpad
jas02 has joined #ruby
freerobby has quit [Quit: Leaving.]
Wsewolod has joined #ruby
brunto has quit [Ping timeout: 250 seconds]
psy_ has joined #ruby
qhartman has quit [Quit: Ex-Chat]
pdoherty has quit [Ping timeout: 250 seconds]
synthroid has joined #ruby
DurstBur1er has joined #ruby
favadi has joined #ruby
noark9 has quit []
Coldblackice has joined #ruby
Pumukel has joined #ruby
RobertBirnie has joined #ruby
godzillaenlacasa has quit [Quit: Peace Out Peeps!]
davedev2_ has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
davedev24 has quit [Ping timeout: 250 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
zacts is now known as acts
acts is now known as zacts
SCHAAP137 has joined #ruby
ur5us has joined #ruby
DexterLB has quit [Ping timeout: 260 seconds]
joonty has quit [Quit: joonty]
dlitvak has joined #ruby
DexterLB has joined #ruby
sh4d0wD has quit [Quit: Leaving.]
ur5us has quit [Ping timeout: 272 seconds]
dlitvak has quit [Remote host closed the connection]
hxegon has joined #ruby
nertzy has joined #ruby
thejamespinto has joined #ruby
lacuna has quit [Remote host closed the connection]
<ljarvis>
not much better? it went from 5 minutes to 30 seconds?
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
devbug has joined #ruby
amclain has joined #ruby
akem has joined #ruby
bb010g has joined #ruby
ethe has joined #ruby
andikr has quit [Remote host closed the connection]
thejamespinto has quit [Client Quit]
ur5us has joined #ruby
tomphp has quit [Ping timeout: 240 seconds]
agit0 has joined #ruby
<[k->
what is this magic doohickey rake that hides all the magic
chandlerbing has joined #ruby
maloik has joined #ruby
yqt has joined #ruby
banister has quit [Read error: Connection reset by peer]
iateadonut has left #ruby [#ruby]
Lorn has quit [Changing host]
Lorn has joined #ruby
bronson has joined #ruby
minimalism has joined #ruby
pdoherty has joined #ruby
Ishido has joined #ruby
duckpuppy has joined #ruby
sh4d0wD has joined #ruby
maloik has quit [Ping timeout: 244 seconds]
RTG` has quit [Ping timeout: 245 seconds]
sh4d0wD has quit [Client Quit]
christiandsg has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
Snowy has quit [Remote host closed the connection]
RegulationD has quit [Remote host closed the connection]
wldcordeiro has quit [Ping timeout: 256 seconds]
zast has joined #ruby
KensoDev has quit [Remote host closed the connection]
rakm has joined #ruby
KensoDev has joined #ruby
<solars>
does anyone know if vim ruby refactoring is dead? or are there any alternatives?
JDiPierr_ has quit [Remote host closed the connection]
kmckelvi1 has quit [Ping timeout: 256 seconds]
JDiPierro has joined #ruby
mostlybadfly has joined #ruby
RobertBirnie has joined #ruby
codecop has joined #ruby
jbrhbr has quit [Quit: Leaving.]
programmerq has quit [Ping timeout: 245 seconds]
lacrymology has joined #ruby
sucks has quit [Ping timeout: 240 seconds]
<lacrymology>
how can I get a variable or call a method from its name, as a symbol?
<lacrymology>
(I'm not sure which one it is right now, I'll check when I know how to do it)
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
tomphp has joined #ruby
<adaedra>
To call a method, you have ri:Object#public_send
tenderlove has quit [Remote host closed the connection]
mrtomme has joined #ruby
<lacrymology>
ljarvis: it's complicated, I'm using rspec and I need to access a thing that is defined in a let from an example group. That is not possible, so I'm thinking of passing a symbol (call this method to find the value for this thing). I just did it and works (it's a method, not a variable)
freerobby has joined #ruby
sh4d0wD has joined #ruby
<ljarvis>
wouldn't a hash do?
KensoDev_ has joined #ruby
sh4d0wD has quit [Client Quit]
Rodya_ has quit [Remote host closed the connection]
tier has joined #ruby
tier has quit [Remote host closed the connection]
mark4 has left #ruby ["PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PONG :wilhelm.freenode.net"]
KensoDev has quit [Ping timeout: 256 seconds]
hahuang65 has joined #ruby
jpfuentes2 has joined #ruby
platzhirsch has left #ruby [#ruby]
christiandsg has quit [Remote host closed the connection]
programmerq has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
howdoicomputer has joined #ruby
Eiam has joined #ruby
jbrhbr has joined #ruby
hxegon has quit [Quit: leaving]
bronson has joined #ruby
hxegon has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
wldcordeiro has joined #ruby
colli5ion has quit [Ping timeout: 255 seconds]
Xiti has quit [Quit: Xiti]
wldcordeiro has quit [Client Quit]
JDiPierro has quit [Remote host closed the connection]
wldcordeiro has joined #ruby
Xiti has joined #ruby
FLeiXiuS has joined #ruby
christiandsg has joined #ruby
<FLeiXiuS>
Is there an easy way to do a tail -f in ruby?
<jhass>
FLeiXiuS: open the file and read_nonblock from it in a loop?
<jhass>
or even just gets
hobodave has quit [Quit: Computer has gone to sleep.]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ishido has quit [Ping timeout: 240 seconds]
<FLeiXiuS>
jhass, Thats actually a good idea. I was going about it way wrong lol
christiandsg has quit [Remote host closed the connection]
<hxegon>
is rspec-mocks a part of rspec by default?
<hxegon>
I'm having trouble using the allow way of stubbing.
<mg^>
ruby -e 'print ARGF.read while true' /var/log/messages
Tempesta has quit [Ping timeout: 256 seconds]
ur5us has quit [Remote host closed the connection]
atomical has joined #ruby
dlitvak has quit [Remote host closed the connection]
<jhass>
ruby -ne 'print $_' or whatever it was
InvGhost has quit [Ping timeout: 240 seconds]
<blub>
ruby -pe ''
sh4d0wD has joined #ruby
Tempesta has joined #ruby
djbkd has joined #ruby
<mg^>
ahh I should have remembered that
nertzy has quit [Quit: This computer has gone to sleep]
<jhass>
there should be an stdlib called l so we can -perl
<mg^>
actuale -pe doesn't work because it quits at EOF
<mg^>
I have all the typos today
kmckelvi1 has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
davedev24 has joined #ruby
davedev2_ has quit [Ping timeout: 250 seconds]
sameerynho has quit [Remote host closed the connection]
steffkes has joined #ruby
steffkes has joined #ruby
mloy has joined #ruby
mloy has quit [Client Quit]
mattyohe has joined #ruby
dhollinger has quit [Quit: WeeChat 1.3]
Hounddog has quit [Remote host closed the connection]
spider-mario has joined #ruby
Ishido has joined #ruby
<slash_nick>
you can keep 'em
berserk_ren has joined #ruby
* slash_nick
doesn't need them
arup_r has quit []
dfockler has joined #ruby
InvGhost has joined #ruby
kirun has joined #ruby
RegulationD has joined #ruby
skade has joined #ruby
freerobby has quit [Quit: Leaving.]
Xentil has joined #ruby
last_staff has joined #ruby
christiandsg has joined #ruby
<Xentil>
hello
saddad has quit [Ping timeout: 272 seconds]
edwinvdgraaf has joined #ruby
RegulationD has quit [Remote host closed the connection]
RegulationD has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
weemsledeux has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
puria has joined #ruby
Peg-leg has quit [Quit: Leaving.]
livcd has joined #ruby
<livcd>
can anyone point me to a very simple static-site generator in Ruby (something like jekyll)
<jhass>
livcd: jekyll
<jhass>
scnr
<jhass>
I like middleman
<[k->
i wanted to say that!
dhollinger has joined #ruby
<livcd>
I am looking to study the code but jekyll looks too big / complicated
The_Phoenix has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dkphenom has joined #ruby
blackmesa has joined #ruby
saddad has joined #ruby
allcentury has quit [Quit: WeeChat 1.2]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has joined #ruby
zarubin has quit [Ping timeout: 240 seconds]
skade has quit [Ping timeout: 272 seconds]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has joined #ruby
hobodave has joined #ruby
skade has quit [Read error: Connection reset by peer]
hxegon has joined #ruby
davejlong has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
dlitvak has quit [Ping timeout: 240 seconds]
tenderlove has joined #ruby
jas02 has quit [Quit: jas02]
jas02 has joined #ruby
bmurt has joined #ruby
iamnix has joined #ruby
skade has joined #ruby
otherj has joined #ruby
ohaibbq has joined #ruby
unreal has joined #ruby
ScottNYC has joined #ruby
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
dlitvak has joined #ruby
ur5us has joined #ruby
unreal_ has quit [Ping timeout: 272 seconds]
tenderlove has quit [Remote host closed the connection]
nertzy has joined #ruby
freerobby has joined #ruby
ScottNYC has quit [Quit: WeeChat 1.3]
blackmesa has joined #ruby
norc has joined #ruby
<norc>
Hi.
Xentil2 has joined #ruby
<Xentil2>
hi
bubbys has quit [Ping timeout: 250 seconds]
jessemcgilallen has joined #ruby
bubbys has joined #ruby
dlitvak has quit [Remote host closed the connection]
jas02 has quit [Quit: jas02]
unreal has quit [Read error: Connection reset by peer]
<norc>
I cant figure out how to reference global variables (in particular Im interested about ruby_current_thread) using Fiddle alone. Any pointers? Ox0dea maybe?
unreal has joined #ruby
hahuang65 has quit [Ping timeout: 272 seconds]
jessemcgilallen_ has joined #ruby
hakunin has joined #ruby
ghoorst has joined #ruby
jessemcgilallen has quit [Ping timeout: 250 seconds]
jessemcgilallen_ is now known as jessemcgilallen
<ghoorst>
hi! I'm trying to encrypt and decrypt using openssl, it works, but the first few characters are scrambled, how can this be?
<apeiros>
ghoorst: you do something wrong. that's how.
nertzy has quit [Quit: Leaving]
colleenmcguckin has joined #ruby
<ghoorst>
apeiros: obviously, but my thought was that if something regarding the encryption/decryption was wrong, nothing of the original text would come out right
ramfjord has quit [Ping timeout: 256 seconds]
huddy has joined #ruby
<hxegon>
apeiros: make a gist so we can see what you are doing
<ghoorst>
so I'm wondering where it might have gone wrong, encoding? File.open?
* apeiros
points hxegon at the backlog
<apeiros>
wrong recipient :-p
<apeiros>
ghoorst: how'd we know?
<apeiros>
ghoorst: reading your thoughts?
<ghoorst>
hxegon: one second
<hxegon>
apeiros: oops :P
brunto has joined #ruby
Moosashi has joined #ruby
Eiam has joined #ruby
shadoi has joined #ruby
zast has quit [Remote host closed the connection]
* hxegon
looks up how to make /me posts
kadoppe has quit [Ping timeout: 256 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
<apeiros>
by typing /me does stuff
dstarh has joined #ruby
* shevy
does stuff
* apeiros
thinks hxegon already figured
saddad has quit [Quit: WeeChat 1.4-dev]
* hxegon
agrees with apeiros
<apeiros>
shevy: lies
kadoppe has joined #ruby
<jhass>
no drugs shevy!
dlitvak has joined #ruby
* hxegon
puts bong under the desk
peterhil_ has quit [Ping timeout: 272 seconds]
otherj has quit [Quit: .]
<apeiros>
hxegon: doesn't that make it a bit difficult?
bronson has quit [Remote host closed the connection]
JDiPierro has joined #ruby
JDiPierro has quit [Remote host closed the connection]
<Papierkorb>
hxegon: if you just want to check that #to_s is called, but not override its implementation, replace the .and_return with .and_call_original
hahuang65 has quit [Ping timeout: 272 seconds]
maloik has quit [Ping timeout: 250 seconds]
JDiPierro has joined #ruby
<hxegon>
Papierkorb: so I'm getting a new anonymous class, but not an instance of that class?
<Papierkorb>
tubbo: #digest gives you the binary representation
jas02 has quit [Client Quit]
<tubbo>
ugh
<tubbo>
lol
<tubbo>
was that always the case? i distinctly remember this being a lot easier like 2 years ago.
<apeiros>
anyway, the problem is trivial to solve.
freerobby has quit [Quit: Leaving.]
<hxegon>
maybe stubbing isn't what I think it is? I want to make a fake method so I can test #to_json...
<apeiros>
tubbo: hm, no, I think your problem stems from how you deal with the output
<Papierkorb>
hxegon: a stub: def read; end
<apeiros>
because it reads utf-8 just fine.
dlitvak has quit [Ping timeout: 256 seconds]
<Papierkorb>
maybe there's something more fancy than that. OTOH, it won't get much more readable than good ol' def
PlasmaStar has quit [Ping timeout: 240 seconds]
<hxegon>
Papierkorb: :|
<tubbo>
it is, but the fact that i had to solve it seems wrong. ruby is supposed to be utf-8 by default, all the time, everywhere...so i don't assume that i have to deal with encoding problems.
<tubbo>
because i haven't really had to in a long time!
prestorium has quit [Quit: Leaving]
<tubbo>
:)
<apeiros>
tubbo: that makes no sense
<apeiros>
digest data is *binary* data
<apeiros>
you *cannot* represent it in utf-8
<Papierkorb>
hxegon: also, use expect when you *expect* it to happen (so, it must happen). use allow when you allow it to happen, and then act upon it. but it may not happen, and in that case, you don't really care either.
ldnunes has quit [Quit: Leaving]
<apeiros>
tubbo: did you in all seriousness embed binary as-is in a utf-8 template?
<apeiros>
because frankly, that's just insane.
<Papierkorb>
^ ahahahaha
duckpuppy has quit [Ping timeout: 250 seconds]
<tubbo>
apeiros: agreed...it's not a problem with the code, it's a problem with the docs. i wasn't aware digest() was returning binary data to me.
<tubbo>
if i cared enough i might contribute to ruby/ruby just to say "hey, if you want a String version of this, use hexdigest"
aryaching has quit [Ping timeout: 256 seconds]
<Papierkorb>
the docs could maybe add the word 'binary' ..
<apeiros>
um, digest returns a string just fine
IrishGringo has joined #ruby
<apeiros>
s/String/printable ascii-only string/
* apeiros
prefers just using appropriate naming. .hex_digest, .binary_digest
<tubbo>
apeiros: so in your world, digest() throws a NoMethodError.
<apeiros>
it raises, but yes.
<hxegon>
Papierkorb: thanks, I don't know why I was trying to do it that way
Moosashi has joined #ruby
<tubbo>
apeiros: im not interested in discussing samantics with u
<tubbo>
disgusting* sory 4 speling
<apeiros>
tubbo: I noticed that semantics isn't up your alley
<tubbo>
br0 do u even spel
peterhil_ has quit [Ping timeout: 250 seconds]
<Papierkorb>
I feel like punching someone when s/he's using a letter as substitute for a proper word. kthxbai
centrx has quit [Remote host closed the connection]
decoponio has quit [Quit: Leaving...]
<hxegon>
u mad bruh?
<tubbo>
Papierkorb: well, i feel like punching people whenever they drop pronoun
<mg^>
If I were implementing it from scratch, I'd want to get a digest back as its own String-like object with conversion methods (.hex!, .binary!)
<mg^>
but of course that's just opinion
<tubbo>
Papierkorb: but i realize it's just because y'all aren't from God's Country
* apeiros
suggests the two of you get punching bags
<tubbo>
and you don't have pointless chain words like "a", "or", "as", "the", etc
<Papierkorb>
tubbo: instead, we've got proper health care
<tubbo>
well seeing as i'm a programmer, i also have proper health care ;)
<tubbo>
i just have to pay for it
<tubbo>
unfortunately
* hxegon
quietly puts on murica shirt and red/white/blue stunner shades
<Papierkorb>
mhenrixon_: imo too verbose
Fredrich010 has quit [Remote host closed the connection]
colleenmcguckin has quit [Read error: Connection reset by peer]
colleenmcguckin has joined #ruby
uri__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
maloik has joined #ruby
symm- has joined #ruby
uri_ has joined #ruby
skade has joined #ruby
naftilos76 has joined #ruby
<naftilos76>
Hi, is there a gem that lets me set a terminal's cursor position or draw certain characters with certain colors on certain x,y cursor coordinates. I am talking about text mode!!! Not graphics mode.
<hxegon>
naftilos76: isn't that curses?
lemur has joined #ruby
lemur has quit [Remote host closed the connection]
christiandsg has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
moeabdol has joined #ruby
sucks has joined #ruby
<naftilos76>
mg^, thanks looks nice
codecop has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
<jhass>
naftilos76: you can some stuff with ANSI codes
InvGhost has quit [Ping timeout: 250 seconds]
<naftilos76>
jhass, not sure how to do that. Can you pls be more specific?
<jhass>
naftilos76: google "ANSI codes ruby"
<naftilos76>
ok
DeXterbed has quit [Ping timeout: 272 seconds]
bronson has quit [Ping timeout: 256 seconds]
tvw has quit [Remote host closed the connection]
ascarter has joined #ruby
goodcodeguy has joined #ruby
p0wn3d has quit [Ping timeout: 244 seconds]
BTRE has quit [Read error: Connection reset by peer]
jbrhbr has quit [Quit: Leaving.]
nerium has quit [Quit: nerium]
lemur has joined #ruby
<shevy>
ncurses!
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nerium has joined #ruby
fmcgeough has joined #ruby
stannard has quit [Remote host closed the connection]
BTRE has joined #ruby
krzkrzkrz has quit [Ping timeout: 272 seconds]
stannard has joined #ruby
christiandsg has joined #ruby
InvGhost has joined #ruby
skweek has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Ping timeout: 250 seconds]
shanemcd has quit [Remote host closed the connection]
shanemcd has joined #ruby
nerium has quit [Quit: nerium]
evlute has joined #ruby
<evlute>
hey dudes :)
nerium has joined #ruby
<evlute>
someone here who knows how to use the composite design pattern in ruby in a very easy example?
shanemcd has quit [Remote host closed the connection]
shanemcd has joined #ruby
<Papierkorb>
evlute: you mean compared to Java interfaces?
podman has joined #ruby
<evlute>
no, compared to nothing :) just wanna learn this pattern for school :)
<evlute>
normally you have an abstract class, a leaf class and a composite class
Moosashi has joined #ruby
uri_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bMalum has joined #ruby
<Papierkorb>
evlute: You can inherit from another class. there are no per-se 'abstract' classes in ruby though.
akem has joined #ruby
davedev2_ has joined #ruby
<mg^>
It really is about the interfacing. You make the behavior of the individual objects and the composite object meet the expectations of the things making use of those objects.
<Papierkorb>
evlute: Ruby uses mostly what we call 'duck typing'. If you have an object, which walks like a duck, and quacks like a duck, then that object *is* a duck. For this it doesn't matter if the object 'inherits' from Animal or whatever, it's a duck.
davedev24 has quit [Ping timeout: 250 seconds]
<Papierkorb>
(If you're wondering: Yes, duck-typing is the official name)
thiagofm has joined #ruby
<adaedra>
\_o< kwak
jgt2 has quit [Ping timeout: 272 seconds]
IrishGringo has quit [Ping timeout: 256 seconds]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
<evlute>
i tried this one as an example for composite - but i'm not sure if this goes into the right direction - http://nopaste.linux-dev.org/?878775
trautwein has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Papierkorb>
...
<evlute>
???
<Papierkorb>
evlute: please see attr_accessor
<evlute>
yeah i know attr_accessor to get easy access to variables :)
dkphenom has joined #ruby
spk has left #ruby ["WeeChat 1.3"]
<evlute>
but how to i access objects in objects in objects?
<Papierkorb>
Mh. I'm not even sure if that concept, if taken by the letter, makes sense without abstract methods
nerium has quit [Quit: nerium]
<Papierkorb>
evlute: objects in objects? What do you mean?
tomchapin has joined #ruby
shanemcd has quit [Remote host closed the connection]
nerium has joined #ruby
shanemcd has joined #ruby
devgiant has joined #ruby
devgiant has quit [Read error: Connection reset by peer]
tildes has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
DavidDudson has joined #ruby
<evlute>
the composite pattern makes sense for a part of relationship where every object in the "tree" is handled equaly. so i have an atomic leaf and a composite class which could have more composite classes or one or more leafs
uri_ has joined #ruby
puria has quit [Quit: Leaving]
<evlute>
who do i access a composite in a composite
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mg^>
the composite is a tree structure
<mg^>
where a tree and a leaf have the same interface (both look like a duck)
<evlute>
yeah that's what i mean
FooMunki has quit [Quit: FooMunki]
<evlute>
but how to i access the tree in the tree
<evlute>
to/do
<mg^>
well if you do it right
<mg^>
then you access it like a leaf
Moosashi has quit [Quit: Moosashi]
<mg^>
e.g. if you have c = composite with a and b as children, you don't care if a is a composite and b is a leaf
<mg^>
what c does with them is exactly the same
<mg^>
if you implement the pattern correctly
InvGhostt has joined #ruby
<evlute>
yeah in theory it is like this, but how do i implement it in ruby
moeabdol has quit [Ping timeout: 272 seconds]
<Papierkorb>
attr_accessor :children; def initialize; @children = []; super; end
<mg^>
exactly the same as you'd implement it in any other language. If you must have some abstract class to define your interface
<mg^>
then do something like def perform; fail "implement me!"; end
shanemcd has quit [Ping timeout: 250 seconds]
DavidDud_ has joined #ruby
<evlute>
why attr_accessor :children?
hahuang65 has joined #ruby
pdoherty has quit [Ping timeout: 272 seconds]
InvGhost has quit [Ping timeout: 256 seconds]
<mg^>
then your composite and your individual classes inherit from that, and you deal with implementing #perform for both classes
<mg^>
normally the composite would gather and compose whatever data is contained in its children
DavidDudson has quit [Ping timeout: 272 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<mg^>
or call the method that does the action, etc.
tildes has quit [Ping timeout: 256 seconds]
<mg^>
For instance, if your objects are each steps in a process, and you have to gather performance times and execute composite or single steps. Well, you have perform and time_to_perform methods. The individuals do their thing and report what time it takes to do that thing, and the composite will implement them such that perform calls perform on all the children, and time_to_perform sums all of the time_to_perform of its children.
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nerium has quit [Quit: nerium]
<mg^>
then, anything expecting to use them can call perform or time_to_perform, and the underlying object, whether a single or composite, is transparent to the user.
<evlute>
i don't see the sense of this... but i have to understand it for school.... :/
rayzaum has joined #ruby
supermar_ has joined #ruby
GiveMe1Like has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
<mg^>
well, that's a start, but in order to implement the pattern, your objects have to *do* something with a well-defined interface
bMalum has quit [Quit: bMalum]
<Papierkorb>
evlute: IMO it makes more sense in a language outside of ruby.
<Papierkorb>
*language other than
<evlute>
hmmm
<mg^>
that is, they have to quack the right way whether you ask A to quack or B to quack
<evlute>
hm
<mg^>
and whether the object is a single or a composite does not matter to you when you ask
thelastinuit has joined #ruby
Gadgetoid has quit [Ping timeout: 246 seconds]
banister has joined #ruby
<rayzaum>
algum brasileiro para me tirar uma duvida
<rayzaum>
?
banister has quit [Client Quit]
<mg^>
if you ask your single duck or composite duck to quack, and you care about whether or not it was a single or a composite, you haven't implemented the pattern
<adaedra>
rayzaum: in English, please.
<mg^>
does that make sens?
<mg^>
sense
gravspeed has joined #ruby
supermarin has quit [Ping timeout: 272 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<evlute>
you mean, if its a leaf or a composite - in the tree it does not matter, both will behave like a "duck" because from outside the tree it's not important if its a composite or leaf
<mg^>
exactly
rdark has quit [Ping timeout: 260 seconds]
<gravspeed>
hey guys, i'm having an issue capturing the shell output of snmpget ... | grep ...
rubie has quit [Remote host closed the connection]
moeabdol has joined #ruby
nerium has quit [Quit: nerium]
moeabdol has quit [Client Quit]
<evlute>
i understand this mg^ but its hard for me to translate this to a programming language. maybe i should try java with interfaces
djbkd has joined #ruby
<hxegon>
rayzaum: não há brasileiros aqui
edwinvdgraaf has quit [Remote host closed the connection]
<evlute>
i don't know how i can modulate the qack method for the leaf and the composite
<gravspeed>
if i run it myself it returns an integer value
<Papierkorb>
evlute: No information is leaked outside of the Node (sub-)class, the user just calls #value on it and it does whatever it wants basically. Which in this case is doing a little computation
<adaedra>
hxegon: what's this about?
<hxegon>
adaedra: rayzaum asked a question in portuguese
<hxegon>
adaedra: or rather, asked if anyone spoke portuguese here
<evlute>
thank you Papierkorb - this is really interessting - study it right now
<Papierkorb>
evlute: note that there's ValueNode, which is a node which has just a value, and BinaryNode, which is binary (as in 'two'), which is basically a helper to implement Sum and Multiply
_djbkd has joined #ruby
poguez_ has joined #ruby
moeabdol has joined #ruby
RTG` has joined #ruby
<adaedra>
hxegon: ok
jhn has joined #ruby
Jackneill has quit [Ping timeout: 256 seconds]
bmurt has joined #ruby
djbkd has quit [Ping timeout: 256 seconds]
<Papierkorb>
mg^: could you have a look, does my example match the definition? I think it does, but don't wanna teach something wrong heh ..
christiandsg has quit [Read error: Connection reset by peer]
diegoviola has quit [Quit: WeeChat 1.3]
momomomomo has joined #ruby
christiandsg has joined #ruby
<rayzaum>
ok sorry, =) thanks for answer
<mg^>
Papierkorb: It looks like a fine example to me.
colegatron has quit [Ping timeout: 250 seconds]
akem has quit [Remote host closed the connection]
timonv has joined #ruby
<evlute>
this looks very interessting to me :) i'm facinated
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lacuna has quit [Read error: Connection reset by peer]
Gadgetoid has joined #ruby
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
berserk_ren has quit [Ping timeout: 240 seconds]
rubie has joined #ruby
_djbkd has quit [Ping timeout: 256 seconds]
DurstBur1er has quit [Ping timeout: 256 seconds]
<Papierkorb>
evlute: That concept is regularly used for "ASTs", Abstract Syntax Trees. You can use an AST to 'store' instructions the computer can then evaluate (like #value does in the example). While you don't need this concept every day, it is a really elegant solution for such problems.
<mg^>
ahh AST is a *perfect* example of a real-world use of this pattern
passcod has quit [Remote host closed the connection]
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
<mg^>
basically anything that can be represented in BNF can be implemented this way
<evlute>
i will memorize ast for my classmates - have to introduce this pattern
jbrhbr has joined #ruby
<mg^>
er, described in BNF I should say
nerium has quit [Quit: nerium]
passcod has joined #ruby
ochkoffein has joined #ruby
maloik has quit [Ping timeout: 240 seconds]
nerium has joined #ruby
<Papierkorb>
evlute: if you want a challenge (note that I don't know how far you are knowledge wise, also this requires quite some time investment), you could try implementing a calculator: Have the user input a string like "4+3*2", and then calculate the correct result. The groundwork for the computational part is what I posted. The part of getting the string into that form is where a parser comes into play, for which in turn knowing BNF is really helpful
<Papierkorb>
evlute: This is an advanced topic if you're new to this, so beware.
<Papierkorb>
More like a week-end project (I'm really bad at estimating this, so maybe even more) than a "2 hour challenge"
<evlute>
i know the a little about bakus naur form - so this would be a great practise for me
DurstBur2er has joined #ruby
shanemcd has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
<Papierkorb>
evlute: afterwards, you can toy around with the 'parser' gem. it's a parser for ruby code. I use it for code and template instrumentation for my stuff.
shanemcd has quit [Remote host closed the connection]
<Papierkorb>
(You could even cheat and use that gem, but then you'd learn nothing about parsers themselves :P)
christiandsg has quit [Remote host closed the connection]
art-solopov has joined #ruby
djbkd has joined #ruby
moeabdol has quit [Read error: Connection reset by peer]
<Papierkorb>
fsck now I forgot what I was working on >_>
moeabdol has joined #ruby
kies has quit [Ping timeout: 245 seconds]
momomomomo has quit [Quit: momomomomo]
colegatron has joined #ruby
<evlute>
Papierkorb: i have to thank you very much. And thanks mg^ too. Both of you put me a huge step forward.
nerium has quit [Quit: nerium]
<Papierkorb>
Cheers!
<mg^>
No proib
<mg^>
prob
timonv has quit [Ping timeout: 256 seconds]
cjbottaro has joined #ruby
ibouvousaime has joined #ruby
nerium has joined #ruby
skade has joined #ruby
skade has quit [Client Quit]
futilegames has joined #ruby
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DavidDud_ has quit [Quit: Goodbye all, and thankyou.]
skade has joined #ruby
djbkd has quit [Quit: My people need me...]
tomphp has joined #ruby
momomomomo has joined #ruby
shanemcd has quit [Ping timeout: 250 seconds]
calderonroberto has joined #ruby
BTRE has joined #ruby
djbkd has joined #ruby
c355E3B has quit [Quit: Connection closed for inactivity]
chadmandoo has joined #ruby
yfeldblum has joined #ruby
<chadmandoo>
hey all. if i want to learn ruby on rails should I learn ruby first or dive right into ruby on rails
skweek has joined #ruby
shanemcd has joined #ruby
<hxegon>
?rails chadmandoo
<ruboto>
chadmandoo, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
naftilos76 has quit [Quit: Αποχώρησε]
<hxegon>
chadmandoo: but you want to get some ruby under your belt for sure
<chadmandoo>
maybe i learn simultaneously
ascarter has joined #ruby
<hxegon>
chadmandoo: It's not impossible, but rails by itself is already a lot, and learning that without knowing ruby basics at least is going to be challenging
fumduq has joined #ruby
Ox0dea has quit [Read error: No route to host]
<chadmandoo>
so maybe ruby first then rails
<hxegon>
chadmandoo: IMHO
shanemcd has quit [Remote host closed the connection]
<chadmandoo>
sounds good thats what ill do. thank you
_djbkd has quit [Read error: Connection reset by peer]
fmcgeough has quit [Quit: fmcgeough]
_djbkd has joined #ruby
_djbkd has quit [Client Quit]
_djbkd has joined #ruby
Contigi has joined #ruby
malconis has quit [Ping timeout: 250 seconds]
djbkd has quit [Ping timeout: 256 seconds]
circ-user-mgcmJ has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
sandstrom has quit [Quit: My computer has gone to sleep.]
[Butch] has quit [Quit: I'm out . . .]
solars has quit [Ping timeout: 244 seconds]
uri_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev2_ has quit [Ping timeout: 250 seconds]
freerobby has quit [Quit: Leaving.]
TomPeed has joined #ruby
freerobby has joined #ruby
davedev24 has joined #ruby
_djbkd has quit [Quit: My people need me...]
jeips has quit [Quit: Leaving]
edwinvdgraaf has joined #ruby
dhollinger has quit [Quit: WeeChat 1.3]
lipoqil has joined #ruby
djbkd has joined #ruby
kobain has quit [Read error: Connection reset by peer]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brunto has quit [Ping timeout: 250 seconds]
synthroid has quit []
stannard has quit [Remote host closed the connection]
jgpawletko has joined #ruby
devbug has quit [Ping timeout: 244 seconds]
steffkes has quit [Ping timeout: 256 seconds]
NotTheFBI is now known as TheHackOps
TheHackOps has quit [Changing host]
TheHackOps has joined #ruby
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
jimmybomb has joined #ruby
lxsameer has quit [Quit: Leaving]
jimmybomb has quit [Read error: Connection reset by peer]
hxegon has quit [Quit: leaving]
colleenmcguckin has quit []
rayzaum has quit [Quit: Leaving]
jgpawletko has quit [Quit: jgpawletko]
last_staff has quit [Quit: last_staff]
kallisti5 has quit [Remote host closed the connection]
kallisti5 has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TheHackOps has quit [Read error: Connection reset by peer]
ScottNYC has joined #ruby
myztic has quit [Ping timeout: 272 seconds]
spider-mario has quit [Read error: Connection reset by peer]
art-solopov has quit [Quit: Konversation terminated!]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jgpawletko has joined #ruby
jgpawletko has quit [Client Quit]
kobain has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
colleenmcguckin has joined #ruby
jgt2 has joined #ruby
iamnix has quit [Ping timeout: 256 seconds]
cdg has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 256 seconds]
skweek has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chandlerbing has joined #ruby
aptrcki has joined #ruby
nerium has quit [Quit: nerium]
moeabdol has quit [Quit: WeeChat 1.3]
kies has joined #ruby
nerium has joined #ruby
lkba has joined #ruby
diegoviola has joined #ruby
malconis has joined #ruby
devbug has joined #ruby
daivyk has joined #ruby
tomphp has joined #ruby
ur5us has quit [Remote host closed the connection]
cdg has joined #ruby
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lemur has quit [Remote host closed the connection]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ropeney has joined #ruby
tomphp has quit [Client Quit]
<evlute>
Papierkorb: are you there?
<Papierkorb>
?
tsou has quit [Remote host closed the connection]
Azure|dc has joined #ruby
<evlute>
in the class sum - why do the values left and right have value as method?
supermarin has joined #ruby
<Papierkorb>
evlute: have a look what type left and right have
M-shine has quit [Read error: Connection reset by peer]
M-prosodyContext has quit [Write error: Connection reset by peer]
DavidDudson has joined #ruby
malconis has quit [Ping timeout: 256 seconds]
hobodave_ has quit [Quit: Computer has gone to sleep.]
<evlute>
thats the thing i don't see the relation to the value method. binarynode inhertis from node. but @left and @right are just variables of BinaryNode
Azure has quit [Ping timeout: 272 seconds]
saneax_AFK is now known as saneax
devbug has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
blub` has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uri_ has joined #ruby
shanemcd has joined #ruby
xet7 has quit [Ping timeout: 245 seconds]
<Papierkorb>
evlute: what values are those two initialized to?
<evlute>
oh yes i see to ValueNode and the value method :)
blub has quit [Ping timeout: 260 seconds]
arescorpio has joined #ruby
<evlute>
damn this is crazy, love it :) thank you for making me see :D
skweek has quit [Ping timeout: 250 seconds]
aptrcki has left #ruby [#ruby]
stannard has joined #ruby
<Papierkorb>
np
supermarin has quit [Remote host closed the connection]
supermarin has joined #ruby
shanemcd has quit [Remote host closed the connection]
lemur has joined #ruby
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stannard has quit [Ping timeout: 256 seconds]
momomomomo has quit [Quit: momomomomo]
futilegames has left #ruby [#ruby]
grill has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
bmurt has joined #ruby
<ramfjord>
Hey guys, I've got a question about unix pipes in ruby. I've got one process reading from one DB, and another writing to a much slower DB. They are connected by a unix pipe. I want the fast DB to be able to store as much as it could want on the file system, but the process is clearly not getting scheduled once the pipe reaches a certain size. I've found that I can emulate this behavior with the following one line snippet:
<ramfjord>
fork { rd.close; 100000.times { |i| wr.write "#{i}\n"; puts i if (i % 5000) == 0 } }
<ramfjord>
this will print out up to 10,000 on my machine, but after that will only start printing more once I call wr.read
<Papierkorb>
ramfjord: sounds like your kernel is blocking after the pipe buffer gets full
InvGhostt has quit [Ping timeout: 250 seconds]
yqt has quit [Ping timeout: 240 seconds]
mostlybadfly has joined #ruby
<ramfjord>
Papierkorb: yeah, that makes sense
_stu_ has quit [Quit: _stu_]
diegoviola has quit [Ping timeout: 264 seconds]
shanemcd has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
M-mistake has joined #ruby
M-prosodyContext has joined #ruby
JDiPierro has quit [Remote host closed the connection]
chandlerbing has quit [Remote host closed the connection]
<ramfjord>
hmmm, doesn't look like there's a way I can set any kind of buffer size on IO.pipe - would there likely be a way to configure this through the OS?
SCHAAP137 has quit [Quit: Leaving]
<jhass>
not that will never write to disk, just use up your RAM
<jhass>
*note
<ramfjord>
that must be why it's faster. I guess I'll have to write to a file directly then...
peterhil_ has joined #ruby
<jhass>
/proc/sys/fs/pipe-max-size seems to control the system wide limit, you still need a fcntl to set it for a particular instance and I doubt ruby exposes that
uri_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lukeasrodgers has quit [Quit: Leaving.]
<ramfjord>
right - I'll have to look more into this. I don't know why I assumed a named pipe would just page to disk if necessary, and it wouldn't matter.
M-Kodo has joined #ruby
<ramfjord>
I need at least 100MB for this, which shouldn't be a problem with the available RAM, but if I IO.read it into memory at the beginning I'll have to wait for the first db read to finish before I can start writing
FooMunki has joined #ruby
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
toretore has quit [Ping timeout: 256 seconds]
<jhass>
you probably could have a thread and a StringIO, db -> stringio -> fifo -> db
shanemcd has joined #ruby
M-shine has joined #ruby
lemur has quit [Ping timeout: 250 seconds]
BTRE has quit [Ping timeout: 250 seconds]
<ramfjord>
Process 1: (Thread A: DB -> StringIO), (Thread B: StringIO -> FIFO)
<jhass>
yeah
<ramfjord>
Process 2: (Thread C: FIFO -> DB2)
<ramfjord>
eh, seems like it could work
bmurt has joined #ruby
ohaibbq has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
<ramfjord>
not quite as clean as I was initially hoping, but I'll give it a go
djbkd_ has joined #ruby
bmurt has quit [Client Quit]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thiagofm has quit [Remote host closed the connection]
<ramfjord>
ahh, nice - IO::copy_stream
<jhass>
not sure that works with StringIO though
ur5us has joined #ruby
asteros has joined #ruby
axl_ has left #ruby [#ruby]
cloaked1 has quit [Ping timeout: 250 seconds]
lemur has joined #ruby
DurstBur2er has quit [Ping timeout: 272 seconds]
djbkd_ has quit [Ping timeout: 256 seconds]
evlute has quit [Ping timeout: 240 seconds]
c355E3B has joined #ruby
thiagofm has joined #ruby
DavidDudson has joined #ruby
jgt3 has joined #ruby
chandlerbing has joined #ruby
devoldmx has joined #ruby
devbug has joined #ruby
bruce_lee has joined #ruby
bb010g has joined #ruby
<ramfjord>
I feel like this is going to get ugly writing to the end and reading from the front concurrently