hopsoft has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has quit [Ping timeout: 258 seconds]
dviola has quit [Quit: WeeChat 1.9.1]
sumobob has joined #ruby
sucks has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
Technodrome has joined #ruby
xco has quit [Quit: xco]
xco has joined #ruby
xco has quit [Client Quit]
mim1k has quit [Ping timeout: 268 seconds]
xco has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 240 seconds]
waveprop has joined #ruby
karapetyan has quit [Remote host closed the connection]
<waveprop>
instance_eval(&config) within call did it
<waveprop>
sorry for the noice
<waveprop>
s/c/s/
banisterfiend has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Client Quit]
sumobob_ has joined #ruby
sumobob has quit [Ping timeout: 250 seconds]
kus_ubuntui686 has joined #ruby
kus_ubuntui686 has quit [Max SendQ exceeded]
troys is now known as troys_
alveric1 has joined #ruby
chouhoulis has joined #ruby
sumobob_ has quit [Quit: WeeChat 1.7]
fishcooker has quit [Quit: Leaving.]
sumobob has joined #ruby
alveric4 has quit [Ping timeout: 268 seconds]
ivanskie has quit [Quit: Leaving]
friday has quit [Ping timeout: 260 seconds]
tekk has quit [Ping timeout: 255 seconds]
friday has joined #ruby
tekk has joined #ruby
sumobob_ has joined #ruby
hndk has joined #ruby
sumobob has quit [Ping timeout: 250 seconds]
faces has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
enterprisey has joined #ruby
Ayey_ has joined #ruby
knight33 has joined #ruby
Ayey_ has quit [Ping timeout: 268 seconds]
cschneid_ has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
|ifei5good has joined #ruby
tpendragon has quit [Remote host closed the connection]
Guest20101 has quit [Remote host closed the connection]
|ifei5g00d has quit [Ping timeout: 260 seconds]
cschneid_ has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
marxarelli is now known as marxarelli|afk
troys_ is now known as troys
cdg has quit [Ping timeout: 250 seconds]
Exagone313 has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 240 seconds]
sagax has quit [Remote host closed the connection]
Exagone313 has joined #ruby
giraffe has joined #ruby
giraffe is now known as Guest32325
cschneid_ has joined #ruby
tpendragon has joined #ruby
guardianx has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
voice_ftp has quit [Quit: Leaving]
govg has quit [Ping timeout: 268 seconds]
jesuitx has joined #ruby
jesuitx has quit [Client Quit]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 258 seconds]
govg has joined #ruby
mson has joined #ruby
govg has quit [Ping timeout: 248 seconds]
bob_f has quit [Ping timeout: 248 seconds]
Ayey_ has joined #ruby
sumobob has joined #ruby
bob_f has joined #ruby
sumobob_ has quit [Ping timeout: 240 seconds]
iooner has quit [Ping timeout: 248 seconds]
Ayey_ has quit [Ping timeout: 268 seconds]
cdg has joined #ruby
iooner has joined #ruby
eb0t_ has quit [Read error: Connection reset by peer]
eb0t has quit [Read error: Connection reset by peer]
Orbixx[m] has left #ruby ["User left"]
haraoka has joined #ruby
hinbody has quit [Ping timeout: 268 seconds]
cschneid_ has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
hinbody has joined #ruby
eb0t has joined #ruby
chouhoulis has quit [Remote host closed the connection]
eb0t_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
chouhoulis has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
chouhoulis has quit [Ping timeout: 250 seconds]
the_f0ster has joined #ruby
jphase has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<the_f0ster>
if I split my tests to only use spec_helper and rails_helper when necessary, would that speed things up? isnt the cost just one rails initialization ?
sucks has quit [Remote host closed the connection]
David_H_Smith has joined #ruby
<baweaver>
Use Guard and Spork
<baweaver>
Then that's not really much of an issue
<baweaver>
Guard is a test runner that watches for changes and runs the correct test afterwards
<baweaver>
like you save person.rb it runs person_spec.rb
<baweaver>
Spork keeps Rails loaded in the background
<elomatreb>
Isn't that spring (and isn't it enabled by default now)?
<baweaver>
...yes, that
* baweaver
wonders where he got spork from
sucks has joined #ruby
<elomatreb>
You need to run the test command from the bin/ directory, those have the proper code for spring preloading inserted
<elomatreb>
Doesn't speed up the individual tests, but the boot time before the tests start is almost completely eliminated on all but the first test run
cschneid_ has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
cschneid_ has quit [Ping timeout: 250 seconds]
Ayey_ has joined #ruby
kculpis has joined #ruby
orbyt_ has joined #ruby
Toggi3 has quit [Ping timeout: 248 seconds]
jphase has quit [Ping timeout: 268 seconds]
tcopeland has joined #ruby
ramfjord has joined #ruby
Ayey_ has quit [Ping timeout: 240 seconds]
Toggi3 has joined #ruby
the_f0ster has quit [Ping timeout: 260 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
|ifei5good has quit [Read error: Connection reset by peer]
troys is now known as troys_
gizmore has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
Devalo has quit [Ping timeout: 240 seconds]
gizmore|2 has quit [Ping timeout: 250 seconds]
Ayey_ has joined #ruby
charliesome has joined #ruby
d^sh has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
Ayey_ has quit [Ping timeout: 248 seconds]
d^sh has joined #ruby
hackeron_ has joined #ruby
hackeron has quit [Read error: Connection reset by peer]
hackeron has joined #ruby
hackeron_ has quit [Ping timeout: 250 seconds]
nofxx has quit [Remote host closed the connection]
lucz has quit [Remote host closed the connection]
nofxx has joined #ruby
haylon has quit [Changing host]
haylon has joined #ruby
biox_ has quit [Quit: brb servers are ded]
ResidentBiscuit has joined #ruby
sucks has quit [Remote host closed the connection]
arescorpio has quit [Quit: Leaving.]
sucks has joined #ruby
sucks has quit [Remote host closed the connection]
Ayey_ has joined #ruby
uZiel has joined #ruby
sagax has joined #ruby
Ayey_ has quit [Ping timeout: 250 seconds]
the_f0ster has joined #ruby
cschneid_ has joined #ruby
electrostat has quit [Quit: uwotm8]
PaulCapestany has quit [Read error: Connection reset by peer]
electrostat has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
PaulCape_ has joined #ruby
nofxx has quit [Remote host closed the connection]
electrostat_ has joined #ruby
nofxx has joined #ruby
electrostat has quit [Read error: Connection reset by peer]
electrostat_ is now known as electrostat
quobo has quit [Quit: Connection closed for inactivity]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit has quit [Remote host closed the connection]
the_f0ster has quit [Ping timeout: 268 seconds]
ResidentBiscuit has joined #ruby
cschneid_ has joined #ruby
ResidentBiscuit has quit [Ping timeout: 250 seconds]
cschneid_ has quit [Ping timeout: 250 seconds]
howdoi has joined #ruby
Toggi3 has quit [Ping timeout: 240 seconds]
hndk has quit [Remote host closed the connection]
jphase has joined #ruby
vee__ has quit [Ping timeout: 268 seconds]
Toggi3 has joined #ruby
zanoni has quit [Ping timeout: 268 seconds]
jphase has quit [Ping timeout: 240 seconds]
lucz has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
jphase has joined #ruby
cschneid_ has joined #ruby
lucz has quit [Remote host closed the connection]
nofxx has quit [Remote host closed the connection]
ogres has quit [Quit: Connection closed for inactivity]
vee__ has joined #ruby
cschneid_ has quit [Ping timeout: 250 seconds]
ramfjord has joined #ruby
sucks has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
lks128 has quit [Remote host closed the connection]
gix has quit [Ping timeout: 248 seconds]
gix has joined #ruby
uneeb has joined #ruby
uptime has left #ruby [#ruby]
uneeb has quit [Read error: Connection reset by peer]
xall has joined #ruby
kies has joined #ruby
the_f0ster has joined #ruby
nofxx has joined #ruby
the_f0ster has quit [Ping timeout: 250 seconds]
vee__ has quit [Ping timeout: 248 seconds]
JsilverT has joined #ruby
fullstack has quit [Ping timeout: 258 seconds]
Dimik has joined #ruby
ramfjord has joined #ruby
Rodya_ has joined #ruby
AnoHito has quit [Quit: Leaving]
ramfjord has quit [Ping timeout: 250 seconds]
<csmrfx>
Do you add Gemfile.lock in your repo? Or .gitignore it?
ur5us has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<Radar>
csmrfx: depends. What kind of repo is it?
ozcanesen has joined #ruby
<Radar>
In a gem you wouldn't commit it but in other codebases you'd normally commit it. That is because you want to make sure that everyone is using the same dependenie.s
<Radar>
dependencies*
vee__ has joined #ruby
<csmrfx>
Radar so its just a game engine project that I'm going to open source and put up on github
<csmrfx>
I guess the problem is I don't understand what Gemfile.lock is
fullstack has joined #ruby
<Radar>
csmrfx: When you run `bundle install` it resolves all your gems' dependencies (and their dependencies) and LOCKS them down to just those exact versions. Next time you run `bundle install` it will install those exact versions.
<Radar>
csmrfx: You _don't_ want this in a gem because in a gem you'll have a `gemspec` which tells RubyGems which versions to install... and the gems installed by the gemspec's dependencies _might_ be different from what's in your `Gemfile.lock`
michael1 has joined #ruby
fullstack has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
iamarun has joined #ruby
xall has quit [Ping timeout: 250 seconds]
sumobob has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
sumobob has quit [Client Quit]
cschneid_ has joined #ruby
AnoHito has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 252 seconds]
ozcanesen has quit [Quit: ozcanesen]
ramfjord has joined #ruby
guardianx has quit [Remote host closed the connection]
k3rn31 has joined #ruby
sucks has quit [Ping timeout: 240 seconds]
oleo has quit [Quit: Leaving]
jphase has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
ap4y has quit [Quit: WeeChat 1.9.1]
cschneid_ has joined #ruby
anisha has joined #ruby
Azure has quit [Quit: Oops.]
cschneid_ has quit [Ping timeout: 252 seconds]
jphase has quit [Ping timeout: 248 seconds]
the_f0ster has joined #ruby
rabajaj has joined #ruby
michael1 has quit [Ping timeout: 268 seconds]
jphase has joined #ruby
the_f0ster has quit [Ping timeout: 240 seconds]
<dminuoso>
apeiros: Mmm. I gave this some good thought, and Im starting to agree with you.
<dminuoso>
It's just too weird to have floating point represent monetary values.
<dminuoso>
And is that a good way to represent how much money you have?
<RickHull>
no, that's a simple example of floating point imprecision relative to decimal intuition
<dminuoso>
Either you have 30 seconds, or you have 0.3000000000000204010273582489 cents.
<dminuoso>
*cents
<dminuoso>
nevermind then
jphase has quit [Ping timeout: 240 seconds]
xall has joined #ruby
<RickHull>
i'm just saying, 0.1 + 0.2 is a good example of one float pitfall. it doesn't quite explain the pitfall of using floats for currency
<RickHull>
if there were a similar simple example, that would be a good thing
<RickHull>
but I'll take a complex one -- I am convinced it is a pitfall
cschneid_ has joined #ruby
<RickHull>
your sense that double precision should be plenty for money -- this is compelling
<RickHull>
so what's a good example to refute?
jphase has joined #ruby
cschneid_ has quit [Ping timeout: 258 seconds]
jameser has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
Technodrome has joined #ruby
cdg has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
troys_ is now known as troys
mson has quit [Quit: Connection closed for inactivity]
cdg has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
csmrfx is now known as c-c
uZiel has quit [Ping timeout: 268 seconds]
dinoangelov has joined #ruby
shoogz has quit [Quit: shoogz out]
uZiel has joined #ruby
shoogz has joined #ruby
shoogz has quit [Max SendQ exceeded]
wewlad has joined #ruby
shoogz has joined #ruby
shoogz has quit [Max SendQ exceeded]
kculpis has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
shoogz has joined #ruby
shoogz has quit [Max SendQ exceeded]
<wewlad>
I'm having a brainfart. I'm working my way down for a code golf challenge, and I need to move the contents of my method inside of a loop. Any advice? https://pastebin.com/sAQFqTWy
<Sparky>
I have no idea what's going on, did I mention that I've only been studying for a day?
mikecmpbll has quit [Quit: inabit. zz.]
jphase has quit [Ping timeout: 240 seconds]
<RickHull>
>> sparky = 'new'; "here is a #{sparky} example of string interpolation"
<ruby[bot]>
RickHull: # => "here is a new example of string interpolation" (https://eval.in/895135)
alfiemax has quit [Read error: Connection reset by peer]
<Sparky>
A new example of a string interpolation?
<Sparky>
OH!
alfiemax has joined #ruby
<Sparky>
hah, right you set a variable
<Sparky>
I get that
<RickHull>
the first example, I show a simple string delimited with double quotes, and then a similar string delimited similarly, but with double quotes embedded
reber has joined #ruby
<RickHull>
if you use 'single quotes' to delimit the string, you are allowed to use naked "double quotes" within
<RickHull>
likewise if you use "double quotes" to delimit the string, you can use naked 'single quotes' within
Rodya_ has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
<RickHull>
if you need both "double quotes" and 'single quotes' then you can use %q{} to delimit the string
<RickHull>
or you can just escape them "like \"this\""
<RickHull>
it's all good, I have to leave soon, you are on the path!
jphase has joined #ruby
ahrs has joined #ruby
<Sparky>
I'm picking up and understanding most of what is going on int he code that I have been using, I've even been able to modify it to do other things. Really simple things, but I think I have a basic understanding of what is being taught
<RickHull>
make sure you are using irb or pry
<RickHull>
are you familiar with irb?
<Sparky>
Right!
ramfjord has joined #ruby
<Sparky>
So when I go into my linux terminal, I can type "irb"
<Sparky>
and then I get a.. ruby shell
zapata has joined #ruby
<Sparky>
I think its a shell, right?
<RickHull>
yes, a REPL
<RickHull>
Read Eval Print Loop
<c-c>
Ideas on how to create a print-method that prints the name of the particular instace that calls it?
<RickHull>
it accepts an expression, prints the result
<Sparky>
So basically I can do irb, and do real time- uhh coding?
<RickHull>
c-c: see #caller
<RickHull>
Sparky: yup
Rodya_ has quit [Ping timeout: 252 seconds]
<RickHull>
>> like_what = 'this'; "rather like #{like_what}"
<ruby[bot]>
c-c: # => "[\"/tmp/execpad-118043d7f45e/source-118043d7f45e:2:in `<main>'\"]: foo" ...check link for more (https://eval.in/895144)
<Sparky>
>> %w{here is also an expression represented as an array}
<Sparky>
><
<c-c>
its strange
<RickHull>
c-c: it looks ok -- i think it has an array representation
ramfjord has quit [Ping timeout: 250 seconds]
<RickHull>
Sparky: try it irb :)
fishcooker has quit [Quit: Leaving.]
<Sparky>
Got it!
<RickHull>
also c-c : things like caller and such can behave differently in a REPL like irb
quobo has joined #ruby
<RickHull>
gotta run, g'night
<c-c>
I want to know what the instance is. ID and class. Kernel#caller returns a call stack, with ruby filenames.
RickHull has quit [Quit: Page closed]
<c-c>
I can get the ID and class of the instance that calls the printing method, by passing it in as argument: prt mstr, self
<c-c>
but wouldn't mind if the prt -method could just deduce that
ramfjord has joined #ruby
<dminuoso>
c-c: look into binding-of-caller
<dminuoso>
Arguably the most useful native extension in existence, making me wonder why this has not went into Ruby.
jphase has quit [Ping timeout: 268 seconds]
gix has quit [Quit: Client exiting]
uZiel has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
Ayey_ has joined #ruby
cschneid_ has joined #ruby
<waveprop>
hm. in Rack, when i set @request['some_var'] = {'some' => 'data'} then @request['some_var'] is nil when i try to read it further down the middleware stack
mim1k has quit [Ping timeout: 246 seconds]
wewlad has quit [Quit: Page closed]
BTRE has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
conta has joined #ruby
ramfjord has joined #ruby
<Sparky>
Can someone eli5 what is going on in this? I got the code to work, but I really don't understand what is happening.
kryptoz has quit [Remote host closed the connection]
Toledo has joined #ruby
Toledo is now known as croberts
Vaanir has joined #ruby
nowhereman has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
Toggi3 has joined #ruby
tcopeland has joined #ruby
guille-moe has quit [Ping timeout: 268 seconds]
alfiemax has joined #ruby
milardovich has quit [Remote host closed the connection]
the_f0ster has joined #ruby
oleo has joined #ruby
ta has quit [Remote host closed the connection]
milardovich has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
rippa has joined #ruby
faces has quit [Ping timeout: 252 seconds]
the_f0ster has quit [Ping timeout: 250 seconds]
kryptoz has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 268 seconds]
<Bish>
LyndsySimon: why as a rule?
uZiel has quit [Ping timeout: 268 seconds]
the_f0ster has joined #ruby
synthroid has joined #ruby
Rodya_ has joined #ruby
Guest17098 has joined #ruby
kryptoz has quit [Remote host closed the connection]
Rapture has joined #ruby
the_f0ster has quit [Ping timeout: 246 seconds]
FahmeF has joined #ruby
<LyndsySimon>
Bish: because I'm honestly not a huge fan of Ruby, like I said. I am a fan of writing stuff I like, though, and this CSV gem is one of those things. Hence, I'm writing Ruby in my personal time even though it's not my preferred language and not something I would normally work in without a financial reason.
FrostCandy has joined #ruby
alfiemax has quit [Remote host closed the connection]
cr3 has joined #ruby
oded has quit [Quit: Konversation terminated!]
alfiemax has joined #ruby
orbyt_ has joined #ruby
banisterfiend has joined #ruby
polishdub has joined #ruby
alfiemax_ has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
hopsoft has joined #ruby
Guest17098 has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 268 seconds]
_aeris_ has quit [*.net *.split]
kryptoz has joined #ruby
dviola has joined #ruby
eclm has joined #ruby
kryptoz has quit [Read error: Connection reset by peer]
kryptoz has joined #ruby
lucz has joined #ruby
alan_w has quit [Ping timeout: 268 seconds]
paranoicsan has quit [Quit: paranoicsan]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has joined #ruby
_aeris_ has joined #ruby
nowhereman has joined #ruby
alex`` has joined #ruby
<Bish>
LyndsySimon: whats wrong with ruby
dionysus69 has joined #ruby
<LyndsySimon>
Bish: Nothing is *wrong* with Ruby
<Bish>
it's just boxes sending messages to each other, with block-proc syntax
<LyndsySimon>
At least, not that I know of.
<LyndsySimon>
It just doesn't fit the way I think about problems as well as many other languages. Personal preference is all.
<Bish>
it's fukin slow, other than that, i cannot think of something bad
<LyndsySimon>
If I had to wrap my complaints into a single statement, I'd say: Ruby encourages developers to create things that behave in unexpected and difficult-to-debug ways.
<havenwood>
Ruby, you'll shoot your eye out!
lobloblobster has quit [Quit: Connection closed for inactivity]
<LyndsySimon>
Metaprogramming, for instance. It's a pain in the ass in Python, and as a result while it's available it's something that isn't done much unless it's really the best solution. It's super-easy in Clojure, and as a result at least when you run in to it, it's more obvious what's happening and easier to debug.
eclm has quit [Ping timeout: 268 seconds]
<Bish>
weird, i had the feeling that happens less to me in ruby
<LyndsySimon>
Ruby takes a more middle path. It's approachable for less-experienced developers, but it has a much steeper learning curve and it's not always obvious when you're dealing with something you don't fully understand.
<Bish>
ven with metaprogramming
<Bish>
i choose the oddest programming style for my current project
<LyndsySimon>
... because it doesn't conform to the class syntax used elsewhere, and because classes in Ruby don't have metaclasses in the same way that other languages do ...
<Bish>
well, yeah ruby does it correctly
<Bish>
what a bummer
<havenwood>
LyndsySimon: Smalltalk had some good ideas.
cschneid_ has joined #ruby
milardovich has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
nicesignal has quit [Remote host closed the connection]
<LyndsySimon>
havenwood: I don't think it's a bad idea, and I don't think Ruby is a bad language. I just prefer a different way of dealing with it :)
<LyndsySimon>
Bish: "Correct", in this case, is subjective.
nicesignal has joined #ruby
<LyndsySimon>
Bish: It's more flexible without question. I just see the point of this sort of language to be to reduce the depth at which I have to think about things when I'm writing code. For me, Python does that much more effectively than Ruby
<LyndsySimon>
I really miss Python decorators when I'm working in Ruby, much more than I miss blocks in Python.
nofxx has quit [Remote host closed the connection]
<havenwood>
TL;DR: "Python decorators do in fact provide a certain amount of additional power and elegance over the Python before decorators. However, this power is simply a subset of the available Ruby functionality."
Senecea has joined #ruby
uZiel has joined #ruby
<LyndsySimon>
havenwood: Right - that's exactly my complaint with Ruby. It's not that it's lacking features, it's that it has too many features.
<havenwood>
I can see reaching for the pattern, but there's nothing missing in Ruby on that front.
alfiemax has quit [Ping timeout: 252 seconds]
<LyndsySimon>
Python decided on a pattern, made is easy to use, and eschewed others.
<havenwood>
LyndsySimon: Yeah, TIMTOWTDI is something that some folk love and some folk hate.
<LyndsySimon>
AFK - going into a meeting.
Rodya_ has quit [Quit: Leaving...]
kryptoz has quit [Remote host closed the connection]
cschneid_ has joined #ruby
<Bish>
regarding the fact that abstraction itself might be a human-made construct.. everything is subjective when it comes to programming
<Bish>
but if you mean with "metaclasses like ruby" that classes itself are objects, i think that is very correct
<Bish>
and not like in javascript/c++ where you kinda like lose the information what something was at compiletime, or more information that is
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta has joined #ruby
deathwisdave has joined #ruby
[Butch] has joined #ruby
<deathwisdave>
hello
iamarun has joined #ruby
anisha has joined #ruby
jrafanie has joined #ruby
alfiemax has joined #ruby
synthroid has quit [Remote host closed the connection]
conta has quit [Ping timeout: 240 seconds]
apparition has joined #ruby
synthroid has joined #ruby
troys has joined #ruby
Technodrome has joined #ruby
eclm has joined #ruby
lucz has quit [Remote host closed the connection]
milardovich has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kculpis has joined #ruby
rahul_bajaj has quit [Quit: Leaving]
dinfuehr has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: Bye]
dinfuehr has joined #ruby
clemens3 has quit [Quit: WeeChat 1.0.1]
nowhereman has quit [Ping timeout: 260 seconds]
apeiros_ has quit [Remote host closed the connection]
thinkpad has quit [Ping timeout: 240 seconds]
milardov_ has joined #ruby
aufi has quit [Quit: Leaving]
anisha has quit [Ping timeout: 250 seconds]
milardovich has quit [Ping timeout: 264 seconds]
bkxd has joined #ruby
raatiniemi has quit [Read error: Connection reset by peer]
raatiniemi has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
connor_goodwolf has joined #ruby
apeiros_ has joined #ruby
eroux has joined #ruby
guille-moe has joined #ruby
the_f0ster has joined #ruby
<deathwisdave>
hello
mson has quit [Quit: Connection closed for inactivity]
<havenwood>
deathwisdave: hi
anisha has joined #ruby
eroux has quit [Ping timeout: 240 seconds]
mochiyoda_ has quit [Ping timeout: 260 seconds]
mochiyoda_ has joined #ruby
lucz has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FahmeF_ has joined #ruby
FahmeF has quit [Ping timeout: 268 seconds]
lucz has quit [Remote host closed the connection]
fishcooker has quit [Quit: Leaving.]
lucz has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
cvander has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
gix has quit [Quit: Client exiting]
anisha has quit [Ping timeout: 250 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
Technodrome has joined #ruby
guille-moe has joined #ruby
jaruga has quit [Ping timeout: 268 seconds]
gix has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
iamarun has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
anisha has joined #ruby
michael1 has joined #ruby
FahmeF_ has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 258 seconds]
alfiemax_ has joined #ruby
Guest88823 has joined #ruby
Guest88823 has quit [Client Quit]
Serpent7776 has quit [Quit: Leaving]
the_f0ster has quit [Ping timeout: 250 seconds]
the_f0ster has joined #ruby
JsilverT has joined #ruby
lucz has quit [Remote host closed the connection]
<cr3>
if I have class Bar < Foo; ALIASES = [1,2,3]; end and a class method in the Foo base class, how should I be accessing ALIASES from the subclass?
exchgr has quit [Ping timeout: 240 seconds]
guacamole has joined #ruby
alex`` has quit [Quit: WeeChat 1.9.1]
nowhereman has joined #ruby
<havenwood>
cr3: What have you tried?
<cr3>
havenwood: the problems turns out I need @@ALIASES
<havenwood>
cr3: If you gist your attempt it might help reveal your intention.
<havenwood>
cr3: I don't turn to class variables like `@@aliases` very often.
<cr3>
havenwood: nor do I, that's why I forgot that syntax :)
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hopsoft has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troys is now known as troys_
nowhereman has joined #ruby
tvw has quit [Remote host closed the connection]
<lamduh>
I just need to get random characters 'a'-'z' and 'A-'Z' but there are random characters between Z and a that are messing things up..i want a hole in my range
<baweaver>
>> [*'A'..'Z', *'a'..'z'].sample(50)
<ruby[bot]>
baweaver: # => ["W", "y", "m", "A", "j", "l", "K", "F", "P", "R", "f", "t", "M", "b", "G", "N", "d", "x", "o", "r", ...check link for more (https://eval.in/895761)
milardov_ has quit [Ping timeout: 260 seconds]
<baweaver>
Though I think that can only get each char once
conta2 has quit [Ping timeout: 240 seconds]
<baweaver>
anyways, you can map it for similar effect
ur5us has quit [Remote host closed the connection]
<baweaver>
shorthand is fair game in ze REPL
<jhass>
Array.new(10) { set.sample } ;P
<jhass>
splat assigned to a constant is fine IMO
<baweaver>
jhass: good call
orbyt_ has joined #ruby
<baweaver>
also welcome back
<jhass>
ty
<apeiros_>
o/ jhass
lucz has joined #ruby
<mochiyoda_>
splat is bad now?
pork13 has joined #ruby
milardovich has quit [Remote host closed the connection]
ta has joined #ruby
<jhass>
to create another array it's kinda inefficient compared to say a.to_a.concat(b), so don't do it in a loop
<RickHull>
mochiyoda_: nah, just a joke -- we were benching various array and hash creation / mutation
<jhass>
but as part of program setup it should be fine
<RickHull>
and when constructing an array or set from multiple ranges, i think splat is maybe more natural
<RickHull>
than range.to_a
<lamduh>
ruby so fancy
workmad3 has quit [Ping timeout: 240 seconds]
Archrover has quit [Ping timeout: 240 seconds]
<mochiyoda_>
ahh got you. cheers.
lucz has quit [Ping timeout: 260 seconds]
Senecea has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pork13>
Hello all... I'm having a little trouble with the jdbc/mysql gem, trying to execute a prepared_statement. I have a ? in my where clause, but whether I quote it or not I get a SQL syntax error.
<mochiyoda_>
RickHull: I'd splat that myself out of habit
chmurifree has quit [Ping timeout: 250 seconds]
<lamduh>
Well your examples gave me a good wayt to do it (0...50).map { [*'A'..'Z', *'a'..'z'].to_a[rand(52)] }.join
<lamduh>
Really quick though...what does the * before the range mean?
<RickHull>
it means, put them like ['A', 'B' .. ]
<pork13>
%q{SELECT id, blahblah from `table` WHERE id = ?}
<RickHull>
like *args where args is an array. foo(arg1, arg2, arg3)
<lamduh>
That is what I would have expected as the default...what is the actual default
<jhass>
does mysql have server side bind params yet or is it still all client side? well with jdbc it probably is client side anyway
Freshnuts has joined #ruby
<jhass>
lamduh: the default is to just put it there as is, so in this case an array of two range objects
ta has quit [Ping timeout: 250 seconds]
<pork13>
then I run execute_query(myVar) I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myValue' at line 1
Archrover has joined #ruby
kculpis has quit [Remote host closed the connection]
[[thufir]] has quit [Ping timeout: 248 seconds]
babykosh has joined #ruby
<jhass>
pork13: what's the real thing behind myValue?
kculpis has joined #ruby
<pork13>
It's a String
<jhass>
I promise as long as it's not a password copy pasting it to us will tell us nothing :P
<pork13>
Fair enough... I'm just trying to keep it short, but I'll keep it real.. one sec!
chmurifree has joined #ruby
<RickHull>
keep it real, short
<RickHull>
the error in your SQL syntax is within myVar almost certainly
<pork13>
Yeah.. I'm here because when I do this with JDBC in java, it works :( Was hoping you might have some light to shed on the jdbc/mysql gem's particular implementation...
<pork13>
Hm, good call @jhass I'll try it
<Sparky>
Do I have to gets.chomp.to_i for numbers? I can't just gets.chomp?
<pork13>
Actually... The syntax error getting reported has the substituted value in it, so I think that stmtSelect.execute_query(hostname) is indeed handling the subbing.
<RickHull>
ok yeah
raatiniemi has quit [Read error: Connection reset by peer]
<RickHull>
that would do the substitution
<jhass>
but maybe in the wrong way
<jhass>
maybe it needs to know it's a string
<RickHull>
where is the error happening?
<jhass>
or "string value"
<RickHull>
is a line of your paste causing the error?
<havenwood>
lamduh: Range mixes in Enumerable, which provides #map based on the Range#each implementation.
michael1 has quit [Ping timeout: 250 seconds]
<Sparky>
havenwood: So gets gives the get/n and gets.to_i gives just the get without /n
<lamduh>
Ah I see the included modules thing. Ive never used ruby before but my QA is trying to learn it so she can write your selenium tests and I am trying to explain to her why the method we came up above works
<havenwood>
Sparky: There's another difference
<RickHull>
Sparky: it's that to_i ignores the newline
<havenwood>
Sparky: (Look for quotes on both return values.)
<Sparky>
OH! gets puts it in a string?
<RickHull>
yes
<RickHull>
get-s -- s for string
<RickHull>
gets puts it in a string and puts gets it in a string ;)
<zanoni>
Maybe I can get some help, been trying to print out some directories and files, specifically in the format that I need. This is the best code I have, and almost would work if I could filter Dir.entries https://gist.github.com/stuartambient/89a4fecee1a1873fb233cadc5e3472cc
<RickHull>
zanoni: fix your indentation, and it looks like you're missing an `end`
dionysus69 has quit [Ping timeout: 240 seconds]
<Papierkorb>
Changing the filename in the gist to end in `.cr` will also enable highlighting
<RickHull>
oh, maybe not
<RickHull>
the poor indentation makes it hard to read
milardovich has quit [Ping timeout: 250 seconds]
<RickHull>
the `end` corresponding to `if` should be at the same level, and the body of the conditional should be indented further
<zanoni>
i changed it but, I could do better on idents and styles
<RickHull>
two spaces per indent level is the convention
<Papierkorb>
zanoni: You misunderstood #reject. You just put a condition in there, like what you have *after* the if. Then you #each over what the #reject returns, which now doesn't contain anymore what you just threw out
<apeiros_>
RickHull: cr like crystal? :D
<zanoni>
i know about the 2 spaces, but always get confused about when it doesn't apply in a block
<Papierkorb>
apeiros_: Dang, wrong channel lawl
ta has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
<Papierkorb>
Well, the highlighting rules aren't that different...
<apeiros_>
oh, right, sorry RickHull - that was @ Papierkorb
apeiros_ is now known as apeiros
<RickHull>
i'm offended
<apeiros>
rightly so!
<apeiros>
want to duel?
<RickHull>
1v1 corewars?
<apeiros>
1v1 starcraft2
jrafanie_ has joined #ruby
<zanoni>
Papierkorb: you saying drop the reject?
<zanoni>
or add an each
<apeiros>
I should add stone paper scissors to rubybot
<Papierkorb>
zanoni: Not at all. The whole thing should end up looking like this: `Dir.entries(dir).reject{|x| x =~ /your regex/}.each{|x| p x}`
<apeiros>
inline duel for the channel :)
<apeiros>
and/or battleships (is that the english name?)
michael1 has quit [Ping timeout: 240 seconds]
<Sparky>
I could totally almost program rock paper scissors in ruby right now
<apeiros>
Sparky: go for it :)
jrafanie has quit [Ping timeout: 260 seconds]
ta has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
And then we'll have a golf course.
<zanoni>
Papierkorb, nope that leaves me back with the dots
<Sparky>
apeiros: I don't know how to give if/then arguments yet
<zanoni>
No, the reject and regex is working, but i need a condition on the entries for reject entries that are not acutally files
<apeiros>
Sparky: if/then doesn't take arguments. it only contains an expression
<Papierkorb>
zanoni: Oh those you wanna get rid of, now I understand. Two solutions: Either use a `Dir["#{path}/*"]`, or: `Dir.entries(path).reject{|x| [ ".", ".." ].include? x}`
<apeiros>
if some_expression then …code… end
ap4y has joined #ruby
<Papierkorb>
zanoni: If you want to get rid of *all* leading-dot entries, just do `.reject{|x| x.start_with? '.'}`
<apeiros>
e.g. if your_choice == "scissors" and their_choice == "rock" then puts "you lost!" end
<Sparky>
I'm sure the book I'm following will get me to that point eventually :P
<Sparky>
Why == and not = ?
<apeiros>
It'd be a terrible book if not ;-)
<apeiros>
= is assignment
<apeiros>
== is comparison
<Sparky>
So I can do 3 + 5 == 10 and get a false?
<apeiros>
and === is very different kind of comparison (used in case/when)
<zanoni>
no , i 've gotten rid of dot files, but still get entries that are not files
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
ta has quit [Ping timeout: 240 seconds]
<RickHull>
next, def spaceship ?
<jhass>
lizard, spock
olblak has quit [Remote host closed the connection]
<zanoni>
Papierkorb, it is !x.start_with?'.' Which is all good, but still in the same place , not being able to drop the entries that are devoid of file. Like /app/assets/views/views.rb I only want to see views since that actually contains the file
<ruby[bot]>
Sparky: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<Sparky>
Thanks rubybot
lucz has quit [Ping timeout: 268 seconds]
<adaedra>
What kind of push do you want?
<Sparky>
A small nudge, give me a topic to google
<llua>
does someone know why this .irbrc doesn't print the ansi escape sequences correctly in my prompt on freebsd but does on linux? http://sprunge.us/QVeN
<eam>
well the giraffe is ridiculously underpriced, for one
<adaedra>
Do you have a problem with it Sparky ?
Psybur has joined #ruby
<Sparky>
I need a way to associate the price of the thing with the name... I think that's what I need?
<RickHull>
also, 1.23 is an IEEE float and it does not represent monetary amounts very well
lagweezle is now known as lagweezle_away
<RickHull>
it's better to represent monetary amounts as integers of the indivisible unit -- e.g. pennies
<eam>
Sparky: associating names with values is generally done with a Hash
<RickHull>
you can format them as money where needed, e.g. def dollars(pennies); "$0.2f" % pennies / 100r; end
<eam>
mapping any object to another object
<RickHull>
ah crap, messed up the format string again
<c-c>
So I have this class that represents game interface -process. I have currently solved the refresh at intervals in the following way. Can you suggest how to improve/comments on this? https://gist.github.com/csmr/87eae0fa218efba43f9fc661b270ceb4
<RickHull>
it seems reasonable. it shouldn't be necessary to call #to_f on Time.now
<RickHull>
and what's up with drawing_bool vs _drawing_bool ?
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cr3 has quit [Ping timeout: 268 seconds]
<RickHull>
oh, just kidding, you do need .to_f
lagweezle_away is now known as lagweezle
<c-c>
RickHull: yes
<c-c>
Otherwise it somehow ends up being time as milliseconds on even fraction (12.0, 12.0, ..etc for the remaining frames for this sec.., 13.0, 13.0, ... 14.0, 14.0...)
<c-c>
not sure if 'on even fraction' is proper english though :)
<elomatreb>
This seems like a bad idea for UI refreshing, normally you'll want to use proper threads and sleep for as much time as possible. What you seem to be doing here is busy-waiting
<c-c>
threads are not ruby, nor are they linux
<RickHull>
?
<c-c>
elomatreb: one needs to use processes for concurrency
<Sparky>
Oh poop, I tried doing the hash thing and got- ery good, you have chosen beach ball, that will be {"beach ball"=>12.99}
<elomatreb>
no...?
<RickHull>
both ruby and linux have threads
<RickHull>
ruby also has fibers, which are like cooperative rather than preemptive threads
<c-c>
Have you guys done a lot of concurrent multi-core programming with threads?
<RickHull>
ruby threads are green threads, so single core
<RickHull>
unless using jruby (or rbx?)
<c-c>
yes
<c-c>
also, for linux, the concurrency model is processes
nofxx has quit [Read error: Connection reset by peer]
<elomatreb>
Not "a lot", but it's not a complicated thing you're trying to do. If you want your UI to refresh every N ms you just sleep N ms
<elomatreb>
Absolutely false. Open htop, press "H", see all the threads your applications are using
alfiemax has quit [Remote host closed the connection]
nofxx has joined #ruby
<c-c>
elomatreb: tell me, on the left in htop, whats the colum "PID" signify? :)
<headius>
RickHull: MRI has native threads but they're locked to only allow one running Ruby code at once
<headius>
green threads are different
<c-c>
elomatreb: is it the thread id, or the process id? (rhetoric)
<eam>
c-c: you should be tracking the time since your last refresh, then add your refresh_time, subtract now() and sleep for that long
<RickHull>
ah, thanks -- when did that happen?
selim has quit [Ping timeout: 240 seconds]
<eam>
ideally, if this is a game, you can poll the vsync
<elomatreb>
c-c: Every linux process can have any amount of threads
<RickHull>
or was "green threads" just a misnomer for a long time?
vee__ has joined #ruby
<c-c>
elomatreb: well, process based concurrency just makes sense
<elomatreb>
You do you
<c-c>
in my humble opinion, threads make things complicated and difficult to partition
<RickHull>
c-c: the point is, there is a choice. you were implying there is no choice
selim has joined #ruby
<c-c>
also, I like the option of having the ui, the server and the logic/engine on different machines altogether - process based concurrency gives me this easily
<c-c>
RickHull: well, afaics, threads are not an attractive option
<eam>
right now you don't have concurrency at all
StarSeed0000 has joined #ruby
Technodrome has joined #ruby
<c-c>
eam I have 3 process concurrency
<RickHull>
c-c: nothing wrong with multiprocess, go for it :)
<eam>
I mean, in the code you're sharing
<c-c>
but will have to clean this up before I wont shame myself for putting it up on github :*)
sepp2k has joined #ruby
<RickHull>
what is your plan for IPC?
<c-c>
RickHull: I implemented named pipes already
<RickHull>
oh, i remember that, i think :)
<eam>
you don't need threads for a simple game btw
rhyselsmore has joined #ruby
<c-c>
its also clean, can be replaced with sockets if multiplayer-server-solution, and uses kernel for super fast throughput
<eam>
I'm not sure what that means
<c-c>
it means 3 different scenarios, so vague
<RickHull>
when you go to multi-machine, will sockets have the same semantics as named pipes? authentication?
<c-c>
lets just say named pipes keep IPC as fast as possible without sharing memory directly
<c-c>
RickHull: not exactly. Named pipes are bit simpler. But afaics the outcome is it won't be painful for example to use tcp sockets for multiplayer server <-> client.
<c-c>
anyway I want to simulate the weather and state of a planet, so it might need all the cores possible
<RickHull>
if you are concerned about squeezing every drop of performance, ruby might not be the best choice
<c-c>
- this is the dream, anyway, probably 2 man years worth of work left, minimum.
<RickHull>
have you looked at e.g. Crystal ?
<c-c>
RickHull: ok I thought about that too
raatiniemi has quit [Read error: Connection reset by peer]
<RickHull>
jruby / truffle might be worth a look
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<c-c>
RickHull: thats *another* reason I use process based conc, and named pipes. The plan is - use crystal or rust for the state server eventually, once a POC exists.
<headius>
RickHull: Ruby 1.9 switched to native threads with a lock
<headius>
like 2007 or 8
<c-c>
- If need be. I have used things like nmatrix gem for computation intensive with ruby, and its pretty nice.
<RickHull>
part of me is still stuck in the 1.8 mindset :)
raatiniemi has joined #ruby
<headius>
also jruby and truffle are separate projects now btw
<c-c>
I started this on jruby
<c-c>
but threads give me headache
<c-c>
hehe pesterd headius years ago about it like half dozen times
<RickHull>
price is a data structure, not a scalar
<RickHull>
it rarely makes sense to stick a data structure inside a string
<c-c>
price[:giraffe] ?
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
<nofxx>
Hash#default ... jez, you'll never know everything =P
<nofxx>
before rdoc I was "is this guy thinking this is JS?"
<Sparky>
RickHull: I was going to use purchase later after I get this sorted
Psybur has quit [Ping timeout: 252 seconds]
<RickHull>
to get a single price (i.e. a scalar) out of the data structure, you should address it with a key
<RickHull>
price[some_key] returns some value
<c-c>
elomatreb: btw, was going to add that the reason there is the test for refreshtime and not just sleep is grabbing the input. I'm not sure how its going to be exactly, but the refresh rate for view is going to be 24-48 fps, but I want the input be grabbed minimum 50 times a sec, ideally at least 100
<RickHull>
in your case, the value would be 0 if some_key does not exist
zautomata has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
<c-c>
Most people can tell if theres ~20 ms or more of delay. Less than 10 ms is hard to tell even for many musicians.
<eam>
c-c: why not just poll on input, with a timeout of the delta until the next display cycle?
<RickHull>
i like the idea of sleep_time = interval - computation_time
<c-c>
eam: so how it works now is 100 times a second it ui_gran_input (should be grab_input). It also calls ui_refresh, which tests if its time to start view refresh.
<eam>
yeah, but why have that interval?
<eam>
you can poll on input and respond to it immediately
<c-c>
Hm, I probably don't understand how "poll on input" might work. It now tests with 0 ms timeout select if theres input or not.
<eam>
you're writing a single threaded state machine, so you want to gather up all the things that can trigger an event (network, keyboard, etc) and sleep for up to the refresh cycle waiting for them to perform i/o
<c-c>
so currently its ie. non-locking
<eam>
instead of a non-blocking select, you block select for up to the refresh interval delta
vifino has quit [Ping timeout: 240 seconds]
<eam>
and then if select returns an event, you re-calculate the delta and sleep waiting for events for that new delta
<c-c>
I see
<c-c>
interesting
<eam>
this means you respond to any input instantly and you never loop unless you either 1) have an input event or 2) the refresh interval is reached and you need a repaint
Rangerst has joined #ruby
<c-c>
yes, I thought this way as attempting to "do as much nothing/sleep as possible most of the time" so times of heavy load would (theoretically) not be a problem
<eam>
the main thing is now you have 0.01s added latency
alnewkirk has quit [Read error: Connection reset by peer]
<RickHull>
sleeping instead of working while there is work to be done doesn't seem to have a benefit
Rangerst has quit [Client Quit]
<eam>
and the lower you shrink that interval, the higher the idle cost becomes
<eam>
there's also the added twist that on a system with a low Hz, this might not even sleep at all
<c-c>
yeah. In reality I have no idea where the bottleneck is going to be, in terms of the UI/view/input
<eam>
because timers aren't perfectly granular
vifino has joined #ruby
<eam>
granted, it's been a while since 100Hz was common, now we have tickless linux
<adaedra>
I'd say if you're using Ruby, you're not at this performance difference
<RickHull>
perhaps you want the "standard" IPC for windows rather than chasing "named pipes"
<c-c>
the latency is the key here, as the messages should remain rather small
<adaedra>
That's for UWP, c-c
<adaedra>
I guess this doesn't apply to you
<galtgendo>
first thing: I know very little of ruby; given that: how should I go about adding a generic :encode_with method to a list of classes to prevent yaml dump going recursively out of stack ?
<c-c>
I wish I knew whats a UWP on windows
<RickHull>
galtgendo: please paste an example of the problem you're having
<RickHull>
e.g. show the code, the input, the execution, and the error
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<adaedra>
c-c: If only search engines were a thing. :)
<c-c>
but windows is priority 4 after linux, osx and - android
<RickHull>
galtgendo: I haven't had this problem with yaml before
<c-c>
Thanks for all the input channel, I appreciate it 8)
alfiemax has quit [Remote host closed the connection]
charliesome has joined #ruby
brucebag has quit [Quit: brucebag nipped out]
<c-c>
hehe is there even an android ruby, probably no more
Toggi3 has joined #ruby
<RickHull>
c-c: i would make sure you have a prototype, a spike, that shows a working project on linux, with the proper refresh and perf characteristics
troys is now known as troys_
<RickHull>
it's good to keep multiplatform in mind, but extremely ambitious
<c-c>
yes, I keep it in mind while barely making progress on linux
<c-c>
;)
brucebag has joined #ruby
brucebag has quit [Changing host]
brucebag has joined #ruby
lucz has quit [Remote host closed the connection]
jenrzzz_ has joined #ruby
lucz has joined #ruby
<galtgendo>
RickHull: it's somewhat hard to paste, it's a little (not mine) project, that loads a marshal dump file (with some of the classes having their own definitions, other just turned into classes via const_set(name, Class.new)), then dumps it into yaml, then can go back after yaml is edited; the problem is that sometimes accept goes into target.respond_to?(:encode_with) == false branch which ends up with dump_ivars getting called recursively
<galtgendo>
orry, typing speed low)
<RickHull>
can you link to some code?
jenrzzz has quit [Ping timeout: 240 seconds]
FrostCandy has quit []
<adaedra>
try to produce a minimal example. it can even help you pin down your problem.
<galtgendo>
there's a block in RGSS.rb calling process(Object, *x) on a long list, where process is that thing that ends up with const_set(name, Class.new)
zautomata has joined #ruby
<RickHull>
at the risk of being uncharitable, this is low quality code that appears to be doing a lot of unnecessary stuff
<baweaver>
Oh man! RGSS!
<RickHull>
i wouldn't want to debug it, especially lacking strong ruby skills
<baweaver>
RPG Maker XP / MV eh?
<baweaver>
It's basically an odd offshoot of 1.9.2
<baweaver>
Nostalgia abounds
<galtgendo>
well, mostly used for VX Ace, but XP/VX too, not MV - that's js
* baweaver
reads back up on the problem
<RickHull>
galtgendo: to try to answer your original question, it is pretty easy to add a specific method signature to many classes
<baweaver>
Ah yeah
jenrzzz_ has quit [Ping timeout: 240 seconds]
<RickHull>
klasses.each { |k| def k.encode_with; nil; end } # something like that
<RickHull>
assuming it's a class method
Toggi3 has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
<RickHull>
and all you need is k.respond_to? :encode_with
<baweaver>
Typically the RM forums are the best source for specific questions on that. Few years back Solistra was fairly active and would answer questions
<RickHull>
galtgendo: you can set up klasses = [String, Array, Foo, Bar, Baz]
<c-c>
ah, its Rpg Maker again
raatiniemi has quit [Ping timeout: 240 seconds]
Rapture has joined #ruby
<galtgendo>
RickHull: it goes like this: call to visit_Object, call to dump_ivars, call to accept, from target.respond_to?(:encode_with) == false branch call to send (which is effectively a call to visit_Object for the file in question) (again, low typing speed - now I need to read your comments)
<baweaver>
RPG Maker
vee__ has quit [Ping timeout: 250 seconds]
raatiniemi has joined #ruby
Toggi3 has joined #ruby
<galtgendo>
RickHull: but won't a nil method prevent a proper dump (that is one where a round trip is possible) ?
reber has quit [Remote host closed the connection]
<RickHull>
if you need instance methods, it's trickier. and I wouldn't be surprised if the workaround for this stack/recursion bug causes more problems down the line
<RickHull>
galtgendo: uh, probably? my suggestion is TOTAL_HAX
dgsntro has joined #ruby
<RickHull>
and frankly I would like to retract it and back slowly away from the tarpit ;)
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<galtgendo>
RickHull: do you have any idea how a trivial *working* encode_with method would look like ?
<RickHull>
none
<RickHull>
just curious, I looked for tests for this project...
<galtgendo>
..please, don't
zautomata has quit [Quit: WeeChat 1.7]
<RickHull>
heh -- I would suggest not wasting your time on this particular project
<baweaver>
It's basically impossible to "test" without a crap-ton of assumptions and unit test stubs
<galtgendo>
anyway, in such case do you know a place with some simple psych usage samples ?
VladGh_ has quit [Ping timeout: 268 seconds]
<baweaver>
That said this is some of the better RM code I've seen
<RickHull>
i would just use 'yaml' i forget why psych and syck and all the other yaml impls exist
<baweaver>
yes RickHull, better, fancy that XD
<galtgendo>
or rather some complex usage, but well commented ones
<baweaver>
I can take a look into this more later tonight or this weekend maybe.
milardovich has joined #ruby
<baweaver>
Ah, it wants Ruby 1.9.3
<baweaver>
see the README at the bottom
vee__ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<galtgendo>
baweaver: not quite: VX Ace is ruby 1.9.3, but that thing still seems to work with 2.2
<baweaver>
Mmm. I've been out of the game of toying with this for a while
<baweaver>
Really since RMXP years ago.
<galtgendo>
not sure about 2.4, as I've recently read that there where some marshal format changes
<baweaver>
Took a while to get them off pastebin on things
polishdub has quit [Quit: leaving]
<dminuoso>
baweaver: Does one need a reason to blame others?
<RickHull>
and if it's no longer actively developed, then subtract more points from "should i use this project?"
hopsoft has joined #ruby
<dminuoso>
Mundane people seem to do it without one on the streets all the time.
<dminuoso>
Why cant I?
lucz has quit [Remote host closed the connection]
<galtgendo>
also 'require 'yaml'' is an alias for 'require 'psych''
<baweaver>
There's a significant chance this is the only project which does this
<baweaver>
Considering Solistra was one of the better OSS types around
fishcooker has joined #ruby
<galtgendo>
RickHull: well, technically, VXAce is no longer developed, as MV is js
<RickHull>
what I mean is: if you can come with a small example that blows the stack, and you file an issue, will it get fixed?
<RickHull>
if not, then you're on your own and you will git gud at ruby
AndBobsYourUncle has joined #ruby
alfiemax has quit [Remote host closed the connection]
the_f0ster has quit [Ping timeout: 260 seconds]
Gadgetoid has quit [Read error: Connection reset by peer]
<RickHull>
your best bet is to come up with that small example that triggers the bug
<RickHull>
file the issue
<RickHull>
and if the project can't fix it, then maybe you or someone else can. having the example is a huge 1st step
InfinityFye has quit [Quit: Leaving]
GodFather has quit [Read error: Connection reset by peer]
the_f0ster has joined #ruby
GodFather has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<galtgendo>
RickHull: ...TBH, I'm close to certain, that this 'project' *is* dead
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
so the main question is, how much time do you want to spend debugging it?
Technodrome has joined #ruby
<RickHull>
definitely see if you can get baweaver to assist :)
<RickHull>
and in the meantime, try to come up with a minimal example / test case
<RickHull>
like some dump file in yaml or marshal format
tvw has joined #ruby
tcopeland has quit [Quit: tcopeland]
<RickHull>
it's possible you were on the right track -- of needing to define the encode_with method (properly?) for classes / objects that are missing it
nolakat has joined #ruby
<RickHull>
but... the whole enterprise smells of self-created problems in a very complicated approach to what seems outwardly simple
jphase has quit [Remote host closed the connection]
ruby[bot] has quit [Remote host closed the connection]
Gadgetoid has joined #ruby
ruby[bot] has joined #ruby
sagax has quit [Ping timeout: 240 seconds]
nolakat has quit [Client Quit]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
eb0t has quit [Read error: Connection reset by peer]
eb0t_ has quit [Read error: Connection reset by peer]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
jphase has joined #ruby
eb0t has joined #ruby
thinkpad has joined #ruby
eb0t_ has joined #ruby
safetypin has quit [Ping timeout: 250 seconds]
nymous has joined #ruby
steph_ has joined #ruby
<nymous>
hey folks, i need an advice
<elomatreb>
One advice, coming right up
banisterfiend has joined #ruby
jphase has quit [Ping timeout: 250 seconds]
<nymous>
what is the best way to run user code with mine dsl?
<nymous>
i mean something like Rakefile
milardov_ has joined #ruby
<RickHull>
I don't quite follow...
<elomatreb>
A common way is having the user require a module/class of your code in the user file, and having them write the DSL in a block
jphase has joined #ruby
mim1k has joined #ruby
<nymous>
i'm writing a small gem for collecting system/app metrics (externel, non-ruby)
<nymous>
it's a dsl with some execution code
jenrzzz_ has quit [Ping timeout: 248 seconds]
<RickHull>
can you give an example (use a paste site) of how it works currently, and/or how you would like it to work?
<RickHull>
nymous: I still suggest that your DSL will work fine with `require 'salus'` and using ruby as the runner
<baweaver>
Someone's over the moon for Lua eh?
<_aeris_>
small question : why with debian ruby, gem are search on 2.3.0/extensions/x86_64-linux/2.3.0, but rbenv looks for 2.3.0/extensions/x86_64-linux/2.3.0*-static* ?
<RickHull>
is that a problem? you can make your own runner later if you really want to
<nymous>
so, stupid way is just to load?
<elomatreb>
In a context where the DSL methods are available, yes
<raynold>
Llua the chatter is a troll
jphase has quit [Ping timeout: 246 seconds]
<elomatreb>
nymous: From your code: `name, user, nice, csystem, idle, iowait, irq, softirq = l.split(/\s+/)` -- Oo
<nymous>
RickHull: i just want to make some more magic for a user, like maintaining state files
<baweaver>
raynold the chatter is a troll too, or do they have something Ruby to say?
<nymous>
if his asking to though
milardov_ has quit [Remote host closed the connection]
<RickHull>
nymous: i don't quite follow -- what format for your state files?
<raynold>
Stop trolling baweaver
<nymous>
elomatreb: it's just a quick example
troys_ is now known as troys
<elomatreb>
:)
<llua>
raynold: if you disable that auto-message, i'll unban you.
<nymous>
RickHull: well, you know, some metrics are just gauges, but others, like cpu jiffies in unix are counters. so if you have to calculate load % of a cpu, you have to know a value from previous run, and know how far in time it was. i my example that info is saved to a yaml
<RickHull>
sure
<nymous>
*in my
<raynold>
What auto message?
<RickHull>
my only point is that you don't need a custom runner to execute a DSL script, if you just put the require statement at the top
<llua>
'ahh it's a wonderful day'
fishcooker has quit [Quit: Leaving.]
<RickHull>
i think it's a negative win to omit require statements
<nymous>
you see, in that case this little bits of code would mandatory for a user
<nymous>
*would be
<elomatreb>
RickHull: I have to agree with nymous here, it sounds like a runner could be nice
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
You could still have a shebang and the require in the files if you want to, since requiring an already required file does nothing
<RickHull>
I don't disagree -- but I'm not sure what justifies the effort
<nymous>
gem also supports running in a daemon mode, without any state files
<RickHull>
is it so you can say `salus do_the_thing` like a rake task?
<RickHull>
versus `ruby do.rb the_thing` ?
<baweaver>
raynold: well you're more than welcome to talk about Ruby, but let's leave the attacks out of it
shinnya has joined #ruby
<RickHull>
or `./do.rb the_thing`
<raynold>
llua: that's not an auto message
<nymous>
well, idk, i think i can implement several approaches, unfortunately i don't have time to try them all
<raynold>
baweaver: you should follow your own advice and leave me out of it
jphase has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
raynold: everything you have talked about so far is off topic
<nymous>
if you can suggest a better way of implementing the thing, i don't mind to implement your approach
<raynold>
RickHull: youre being selective. Im responding to baweaverv who's offtopic.
<RickHull>
my approach is simply the standard default. write your script as an .rb file
<nymous>
i have to separate 4 stages i have: loading previous state, collecting things, rendering (sending) things, saving current state
<RickHull>
put the require 'salus' at the top
<RickHull>
and execute it
orbyt_ has joined #ruby
ledestin has joined #ruby
<nymous>
i don't think that implementing first and last each time is a fun thing to do
<RickHull>
your script itself can parse args if need be
<elomatreb>
It's only a matter of interface, you decide which one you find more aesthetically pleasing. For perspective, the approach with the runner and no require is fairly common, I can think of e.g. Rakefiles, Gemfiles, Guardfile...
<RickHull>
elomatreb: i think omitting the require does not justify the runner in these cases
<RickHull>
e.g. `bundle` does tons of stuff
<nymous>
yeah, i was thinking of a dir with bunch of *.salus or whatever
DTZUZO has joined #ruby
<elomatreb>
RickHull: From the sound of it this project here does quite a bit as well
<RickHull>
yep -- if that's the case, where the runner is already necessary, and it feels like a big win to omit a require statement, then sure, eval/load it :)
<nymous>
one thing that also bothers me is that renderers code should be pretty reusable
jphase has quit [Ping timeout: 252 seconds]
<nymous>
so writing it in each script would be annoying
<RickHull>
i would put the common functionality in a lib -- so it's just a call from a script
<nymous>
i can't write renderers for every system, it should be up to a user
<baweaver>
raynold: So what have you done in Ruby lately?
<nymous>
graphite, zabbix, collectd, whatever
<elomatreb>
Another benefit of a runner binary is that you can probably package it for OS distribution more easily
<elomatreb>
I.e. associate man pages and the like
Puffball has quit [Remote host closed the connection]
<nymous>
yeah, i really like things like fpm
Technodrome has joined #ruby
jphase has joined #ruby
<nymous>
damn, i'm a little bit confused
moei has quit [Quit: Leaving...]
nolakat has joined #ruby
minimalism has quit [Quit: minimalism]
<nymous>
my first idea was a runner which is doing something like salus collect -f md_array
<nymous>
optionally with trying something like Salusfile in the current directory
jphase_ has joined #ruby
duderonomy has quit [Ping timeout: 268 seconds]
<nymous>
you can put it in your crontab and you have a simple collector right away
jphase has quit [Ping timeout: 250 seconds]
<RickHull>
eh, where does crontab find the current dir? that can get hairy
<nymous>
but i'm actually confused where to put renderers code, as they should be pretty reusable between checks
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
jphase_ has quit [Ping timeout: 250 seconds]
cdg has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
minimalism has joined #ruby
jphase has joined #ruby
steph_ has quit [Read error: Connection reset by peer]
cdg has quit [Ping timeout: 248 seconds]
steph_ has joined #ruby
<KeyJoo>
nymous: Andrey, do you have access to telegramm-chats? You are welcome to https://t.me/rubyschool (Russian community)