rgrmatt has quit [Remote host closed the connection]
aadam21 has quit [Ping timeout: 255 seconds]
<failedatmath>
i am trying to write a little something to randomly generate a coordinate in the dark red space. and i have to make sure it does not give me a coordinate in the lighter red space
fgo has joined #ruby
<Ox0dea>
Diabolik: sub(/\d*$/) { $&[0] ? $&.next : 1 } is about as clever as it'll get, I think.
<Ox0dea>
failedatmath: This only requires addition and subtraction...
weemsledeux has joined #ruby
<failedatmath>
okay, give me a second. i think i've gone full retard
<Diabolik>
Ox0dea how did you get so good at this?
banister has joined #ruby
swgillespie has joined #ruby
<Ox0dea>
At using Perlvars?
shock_one has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
<Diabolik>
at problem solving like this
<Diabolik>
the other clever alternative is input.sub(/\d*$/) { |n| n.empty? ? 1 : n.succ }
CloCkWeRX has joined #ruby
<Ox0dea>
Diabolik: That's the "obvious" approach, so to speak.
mistermocha has quit [Remote host closed the connection]
<odigity>
Is there a way to change the source (from rubygems.org to a local mirror) on the command line? In other words, to override the source line in the Gemfile at run-time.
yqt has quit [Ping timeout: 240 seconds]
paradisaeidae has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
rgrmatt has joined #ruby
aadam21 has quit [Ping timeout: 255 seconds]
axsuul has quit [Ping timeout: 246 seconds]
sapceCase has quit [Ping timeout: 246 seconds]
tkuchiki has joined #ruby
moeabdol1 has joined #ruby
axsuul has joined #ruby
ledestin has joined #ruby
rgrmatt has quit [Remote host closed the connection]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgtk has quit [Read error: No route to host]
<Ox0dea>
That's not the fastest way to calculate popcount, but it's nice to know 0xdefacedbeeffece5's is prime.
rgtk has joined #ruby
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
donske has joined #ruby
donske has quit [Max SendQ exceeded]
<FailBit>
really?
rgtk has quit [Read error: No route to host]
<FailBit>
I'm pretty sure it decomposes
<FailBit>
*badum psst*
pglombardo has joined #ruby
fgo has joined #ruby
rgtk has joined #ruby
<Ox0dea>
FailBit: Its popcount.
platzhirsch has quit [Ping timeout: 265 seconds]
pdoherty has quit [Ping timeout: 240 seconds]
<FailBit>
:Y
<Ox0dea>
In any case, pelican.jpg.
<FailBit>
shall I perhaps introduce myself properly?
<FailBit>
since I skipped that
rgtk has quit [Read error: No route to host]
<FailBit>
I'm an idiot and I run a website full of freaks. :D
<FailBit>
Yes, thank you. *bows*
rgtk has joined #ruby
<Ox0dea>
Does it follow then that the primes are inorganic?
rgtk has quit [Read error: No route to host]
<FailBit>
is that something you really want to find the answer to?
rgtk has joined #ruby
moeabdol1 has joined #ruby
pglombardo has quit [Ping timeout: 240 seconds]
c355E3B has quit [Quit: Connection closed for inactivity]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fgo has quit [Ping timeout: 250 seconds]
rgrmatt has quit [Remote host closed the connection]
rgtk has quit [Read error: No route to host]
Rinzlit has joined #ruby
rgtk has joined #ruby
Rickmasta has joined #ruby
Yzguy has quit [Quit: Zzz...]
rgtk has quit [Read error: No route to host]
rgtk has joined #ruby
Rinzlit_ has quit [Ping timeout: 264 seconds]
moeabdol1 has quit [Ping timeout: 260 seconds]
rgtk has quit [Read error: No route to host]
leafybas_ has quit [Remote host closed the connection]
rgtk has joined #ruby
<shevy>
do you people only have questions and no answers?
Musashi007 has quit [Quit: Musashi007]
<FailBit>
>> !!?==='='
<ruboto>
FailBit # => /tmp/execpad-a9091bc0181b/source-a9091bc0181b:2: warning: string literal in condition ...check link for more (https://eval.in/465136)
rgtk has quit [Read error: No route to host]
Rodya_ has joined #ruby
vigintas has quit [Ping timeout: 250 seconds]
rgtk has joined #ruby
<dorei>
shevy: usually the question is more important that the answer ;-)
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Mia has quit [Ping timeout: 244 seconds]
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
build22_ has joined #ruby
cdg has joined #ruby
Axy has quit [Read error: Connection reset by peer]
darkf has joined #ruby
moeabdol1 has joined #ruby
skcin7_ has joined #ruby
paradisaeidae has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 240 seconds]
braincrash has quit [Quit: bye bye]
houhoulis has joined #ruby
blubjr has joined #ruby
build22_ has quit [Ping timeout: 240 seconds]
rbennacer has quit [Remote host closed the connection]
skcin7 has quit [Ping timeout: 255 seconds]
duckpupp1 has joined #ruby
axsuul has joined #ruby
skcin7 has joined #ruby
astrobunny has joined #ruby
kp666 has joined #ruby
kp666_ has quit [Ping timeout: 250 seconds]
gix has quit [Ping timeout: 272 seconds]
moeabdol1 has quit [Ping timeout: 260 seconds]
framling has joined #ruby
skcin7_ has quit [Ping timeout: 244 seconds]
<odigity>
geminabox and gemirro are both completely broken. is there no good solution for setting up a caching proxy for rubygems?
opensource_ninja has quit [Quit: opensource_ninja]
<Ox0dea>
odigity: It's an unorthodox thing to want to do, for what it's worth.
gix has joined #ruby
jdawgaz has joined #ruby
fgo has joined #ruby
d34th4ck3r has quit [Quit: zzz]
pdoherty has joined #ruby
mattwildig has quit [Remote host closed the connection]
braincras has joined #ruby
minimalism has quit [Quit: leaving]
agentmeerkat has quit [Ping timeout: 244 seconds]
<odigity>
Ox0dea, I don't see why. I have plenty of friends that run local caches at home for debian packages because they install things over and over during dev. I'm experiencing the same thing right now with gem installs. It's the slowest part of my docker build.
<odigity>
And then there's the case of private gems you don't want to push to rubygems...
<odigity>
Plenty of valid and common cases.
psy_ has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
<Ox0dea>
odigity: I trust you're aware that you can install locally built gems?
<odigity>
Yes, but that requires referencing a local filesystem. Hardly appropriate on a multi-developer project.
<Ox0dea>
Aye, fair enough.
<Ox0dea>
How's geminabox proving deficient?
<odigity>
A caching proxy is the right solution for this situation. Just can't believe there isn't a working one. All the past ones are broken.
<odigity>
It doesn't respond with content.
<Ox0dea>
Is that just, like, your opinion, man?
h99h9h88 has quit [Remote host closed the connection]
minimalism has joined #ruby
duckpupp1 has quit [Ping timeout: 255 seconds]
h99h9h88 has joined #ruby
vdamewood has quit [Excess Flood]
paradisaeidae has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
paradisaeidae has joined #ruby
mistermocha has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
h99h9h88 has quit [Ping timeout: 240 seconds]
Oog has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
roxtrongo has quit [Remote host closed the connection]
solocshaw has quit [Ping timeout: 240 seconds]
northfurr has quit [Quit: northfurr]
to_json has joined #ruby
to_json has joined #ruby
_michael has quit [Ping timeout: 272 seconds]
astrobunny has quit [Remote host closed the connection]
jaredrhine has quit [Ping timeout: 240 seconds]
mburns has quit [Ping timeout: 272 seconds]
vdamewood has joined #ruby
lidaaa has quit [Quit: Leaving]
s00pcan has quit [Ping timeout: 255 seconds]
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_michael has joined #ruby
ThatsNotJack has quit [Remote host closed the connection]
sapslaj has joined #ruby
s00pcan has joined #ruby
astrobunny has joined #ruby
ThatsNotJack has joined #ruby
ThatsNotJack has quit [Remote host closed the connection]
<Radar>
although that looks like it's a proxy. Damn.
<Radar>
But... if I read right, that's what you want?
ThatsNotJack has joined #ruby
<VeryBewitching>
gemstash looks pretty cool, haven't seen that before.
<blubjr>
dynamic types @_@
bruno- has joined #ruby
<Ox0dea>
blubjr: You took a wrong turn somewhere, mate.
bruno- is now known as Guest50656
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iateadonut has joined #ruby
<blubjr>
v_v
<blubjr>
whats nondestructive push
Guest50656 has quit [Ping timeout: 240 seconds]
blue_deref has joined #ruby
<mus>
Hmm.
roxtrongo has joined #ruby
duncannz has joined #ruby
blue_deref has quit [Client Quit]
leafybas_ has joined #ruby
jmonreal has quit [Ping timeout: 252 seconds]
psy_ has quit [Read error: Connection reset by peer]
infamos has quit [Ping timeout: 240 seconds]
wprice has joined #ruby
chipotle has quit [Quit: cheerio]
astrobunny has quit [Remote host closed the connection]
leafybas_ has quit [Ping timeout: 260 seconds]
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
s00pcan has quit [Remote host closed the connection]
s00pcan has joined #ruby
infamos has joined #ruby
krz has quit [Ping timeout: 246 seconds]
mburns has joined #ruby
chipotle has joined #ruby
build22_ has joined #ruby
cdg has quit [Remote host closed the connection]
dravine_ has joined #ruby
krz has joined #ruby
moeabdol1 has joined #ruby
dravine has quit [Ping timeout: 265 seconds]
dravine_ is now known as dravine
<djellemah>
odigity: gem generate_index; gem server
Trynemjoel has joined #ruby
build22_ has quit [Ping timeout: 240 seconds]
vigintas has joined #ruby
kp666 has quit [Ping timeout: 240 seconds]
to_json has quit [Quit: Leaving.]
<odigity>
djellemah, I think that will only serve gems you already have installed locally, not cache new gems as they're requested. however, this ended up working: https://github.com/mumoshu/docker-squid-gem-proxy
to_json has joined #ruby
to_json has quit [Changing host]
to_json has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
to_json has quit [Client Quit]
moeabdol1 has quit [Ping timeout: 240 seconds]
kp666 has joined #ruby
UtkarshRay has quit [Remote host closed the connection]
vigintas has quit [Ping timeout: 244 seconds]
tubuliferous_ has joined #ruby
UtkarshRay has joined #ruby
Trynemjoel has quit [Ping timeout: 264 seconds]
fgo has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kp666_ has joined #ruby
jmonreal has joined #ruby
Musashi007 has quit [Quit: Musashi007]
fgo has quit [Ping timeout: 246 seconds]
howdoicomputer has joined #ruby
aadam21 has joined #ruby
astrobunny has joined #ruby
vdamewood has quit [Quit: Life beckons.]
jmonreal has quit [Ping timeout: 265 seconds]
Musashi007 has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
kp666 has quit [Ping timeout: 255 seconds]
ESpiney has quit [Read error: Connection reset by peer]
aadam21 has quit [Ping timeout: 260 seconds]
Arkon has joined #ruby
trosborn has joined #ruby
joufflu has quit [Quit: Leaving]
UtkarshRay has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
rgrmatt has joined #ruby
vdamewood has joined #ruby
RobertBirnie has joined #ruby
_michael has quit [Ping timeout: 240 seconds]
paradisaeidae has quit [Remote host closed the connection]
rgrmatt has quit [Ping timeout: 252 seconds]
beauby has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
trosborn has quit [Quit: trosborn]
<ja>
Radar: What's wrong with you and who the heck gave you any privileges in #rubyonrails?
<Radar>
ja: lol
mburns has quit [Ping timeout: 246 seconds]
<Radar>
I worked for them. What have you done?
chipotle has quit [Quit: cheerio]
<ja>
Now you sound like Steve Jobs. “What have you done that's so great?” I like it. I hope we can become friends, Radar.
<Radar>
Great.
RegulationD has quit [Ping timeout: 250 seconds]
_michael has joined #ruby
codecop has joined #ruby
krz has quit [Ping timeout: 240 seconds]
sanjayu has joined #ruby
bruno- has joined #ruby
bruno- is now known as Guest24402
eminencehc has joined #ruby
jmonreal has joined #ruby
s00pcan has quit [Remote host closed the connection]
<ruboto>
norc # => == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== ...check link for more (https://eval.in/465329)
<norc>
So obviously Ruby optimizes the branchunless away, but leaves dead YARV instructions there. Why?
gard_ has joined #ruby
<Ox0dea>
That is a little weird.
moeabdol1 has quit [Ping timeout: 255 seconds]
aadam21 has quit [Ping timeout: 240 seconds]
<norc>
I mean Im even more confused when I change the conditional to:
<norc>
>> puts RubyVM::InstructionSequence.compile("puts 1 if true").disasm
<ruboto>
norc # => == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== ...check link for more (https://eval.in/465330)
<Ox0dea>
That's the same program.
abucha_ has quit [Remote host closed the connection]
_michael has quit [Quit: WeeChat 1.3]
<norc>
Except it doesn't jump.
yosiat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Unarmed has joined #ruby
Oog has quit []
anisha has joined #ruby
abucha has joined #ruby
CloCkWeRX has joined #ruby
CloCkWeRX has left #ruby [#ruby]
<norc>
In the first case you just have dead code in there, the second executes pop/putnil at 7/8 - which I dont get.
<Ox0dea>
It does seem to just be a missed optimization in the first case.
shock_one has joined #ruby
abucha has quit [Remote host closed the connection]
shock_one has quit [Read error: Connection reset by peer]
<Ox0dea>
The instruction definitions are just as you'd expect to find. :/
abucha has joined #ruby
<norc>
Mmm.
shock_one has joined #ruby
yardenbar has joined #ruby
abucha_ has joined #ruby
kimegede has joined #ruby
poguez_ has joined #ruby
abucha__ has joined #ruby
tmtwd has quit [Ping timeout: 250 seconds]
aspiers has joined #ruby
Arkon has quit [Remote host closed the connection]
jim1138 has joined #ruby
Trynemjoel has joined #ruby
Arkon has joined #ruby
abucha has quit [Ping timeout: 272 seconds]
abucha_ has quit [Ping timeout: 244 seconds]
<norc>
Ox0dea: Oh Im stupid yeah I get it now. But that too would be a missed optimization, would it not?
vigintas has joined #ruby
<norc>
I mean if the compiler is smart enough to leave immediately, instead of branchunless around the code.
desmondhume has quit [Ping timeout: 272 seconds]
<Ox0dea>
norc: `1 if true` and `1 unless false` should compile to the exact same bytecode, yes.
fgo has quit [Quit: WeeChat 1.3]
User458764 has joined #ruby
yashinbasement has joined #ruby
<norc>
Ox0dea: Alright, thank you.
Rodya_ has quit [Quit: Leaving...]
chipotle has joined #ruby
<Ox0dea>
norc: I'm still trying to figure out exactly what's happening.
ta has quit [Remote host closed the connection]
Musashi007 has joined #ruby
Arkon has quit [Remote host closed the connection]
<Ox0dea>
The `branchif` and `branchunless` instructions are sane, so it must be something in `trace`, but that doesn't seem to be doing any optimizations for `Qtrue` being the top of the stack.
<Ox0dea>
I can't say with certainty, but I think that line leaves `Qundef` at the top of the stack for `1 unless false`, but YARV can't send that up to Ruby land.
Unarmed has left #ruby [#ruby]
ciampix has joined #ruby
DoubleMalt has joined #ruby
<Ox0dea>
That doesn't really hold, though, so I'm sure the problem is in another castle, namely the actual instruction execution code and not just the definitions.
abucha__ has quit [Remote host closed the connection]
abucha has joined #ruby
build22_ has joined #ruby
build22_ has quit [Remote host closed the connection]
lsmola has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Trynemjoel has quit [Ping timeout: 264 seconds]
moeabdol1 has joined #ruby
C0r3 has joined #ruby
mooru has joined #ruby
|K|K|K| has joined #ruby
<C0r3>
I just don't understand what is Ruby MRI?? I looked up the Wikipedia page yet have no idea what is it about?? How is it different from Ruby??
d34th4ck3r has quit [Quit: zzz]
jas02 has joined #ruby
timonv has joined #ruby
<Ox0dea>
norc: I found it.
<Ox0dea>
It's just there as an easy safeguard against stack inconsistency.
<Ox0dea>
If the compiler has reached the end of a label and didn't have to "do anything", a dummy `putnil` gets compiled in.
abucha_ has joined #ruby
<Ox0dea>
I can't say how exactly its removal might lead to stack inconsistency, but that's the line that generates the dead code.
Pupp3tm4st3r has joined #ruby
TvL2386 has joined #ruby
vF3hNGxc47h8 has quit [Ping timeout: 260 seconds]
<C0r3>
Ox0dea: Can you please help me with my question?
abucha_ has quit [Client Quit]
<Ox0dea>
C0r3: What even is Ruby, really?
<C0r3>
Ox0dea: If it is the same then why call it Ruby MRI?
<Ox0dea>
C0r3: Honest question: what is Ruby?
desmondhume has joined #ruby
<norc>
Ox0dea: Ah alright. Thank you for your pointer. :)
abucha has quit [Ping timeout: 272 seconds]
<Ox0dea>
norc: Sure thing. Do let me know if you end up getting right to the heart of the thing.
<C0r3>
Ox0dea: Ruby is a scripting language, and it's interpreter is written in C.
<Ox0dea>
> it's interpreter
<Ox0dea>
That phrase is grammatically incorrect and factually ignorant.
Mon_Ouie has quit [Ping timeout: 244 seconds]
jim1138 has quit [Ping timeout: 260 seconds]
Trynemjoel has joined #ruby
<C0r3>
Ox0dea: Can you help me understand?
Rickmasta has joined #ruby
<Ox0dea>
C0r3: The original implementation was and remains written in C, but there have been many other implementations since; thus, we must differentiate between them, and so we call the canonical C interpreter MRI and/or YARV.
<Ox0dea>
MRI != Rubinius != JRuby != IronRuby, and yet they are all Ruby.
<C0r3>
Ox0dea: I need to understand what is a reference implementation. Any good links other than Wikipedia?
<Ox0dea>
C0r3: The reference implementation is just... the first one.
desmondhume has quit [Ping timeout: 255 seconds]
bigkevmcd has joined #ruby
<certainty>
:D
<certainty>
moin
<Ox0dea>
certainty: Apologies if I woke you.
<Ox0dea>
You're very pingable.
astrobunny has quit [Read error: Connection reset by peer]
astrobu__ has joined #ruby
<certainty>
Ox0dea: nope you didn't :) no worries
<|K|K|K|>
anyone else in a frat?
<Ox0dea>
A Twitch troll here in #ruby?!
<|K|K|K|>
no
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dnewkerk has quit [Quit: dnewkerk]
<Ox0dea>
Wanna bet?
<|K|K|K|>
just another rubyist who happens to be in a kick ass frat
<|K|K|K|>
tri kap represent!
desmondhume has joined #ruby
devoldmx has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
karapetyan has joined #ruby
aufi has joined #ruby
sinkensabe has joined #ruby
<C0r3>
Ox0dea: Thanks.
desmondhume has quit [Ping timeout: 240 seconds]
desmondhume has joined #ruby
sinkensa_ has joined #ruby
rgrmatt has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
krz has quit [Ping timeout: 240 seconds]
scmx has joined #ruby
desmondhume has quit [Remote host closed the connection]
<Ox0dea>
C0r3: For most intensive porpoises, "Ruby" really does mean MRI/YARV, but considerable effort goes into JRuby and Rubinius to make the distinction immaterial.
imstar has joined #ruby
linocisco has joined #ruby
krz has joined #ruby
<C0r3>
Ox0dea: I see.
<C0r3>
Ox0dea: If I plan to code walk the entire ruby source code then where should I start?
rgrmatt has quit [Ping timeout: 244 seconds]
vdamewood has quit [Quit: Life beckons.]
imstar has quit [Client Quit]
yardenbar has quit [Ping timeout: 264 seconds]
d34th4ck3r has joined #ruby
astrobu__ has quit [Remote host closed the connection]
tvw has joined #ruby
bruno- has joined #ruby
<Ox0dea>
C0r3: What's your favorite method?
bruno- is now known as Guest19409
d34th4ck3r has left #ruby [#ruby]
<C0r3>
Ox0dea: I've never done something like that before.. I'm still learning things.
<Ox0dea>
C0r3: Your favorite Ruby method.
User458764 has joined #ruby
<C0r3>
select, delete_if
Guest19409 has quit [Ping timeout: 260 seconds]
krz has quit [Read error: Connection reset by peer]
lsmola has quit [Ping timeout: 272 seconds]
<mus>
:)
krz has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
malcolmva has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
<Ox0dea>
C0r3: Well, why not endeavor to gain a deep understanding of exactly how #select works?
crystalmaiden has quit [Ping timeout: 240 seconds]
<Ox0dea>
Starting at the very top of a program as large as MRI is gonna put your hands in too many cookie jars.
<C0r3>
Ox0dea: Thank u
yardenbar has joined #ruby
<|K|K|K|>
can a self taught beginner programmer get a good job if they have a GED and no college degree but graduated from one of those programming boot camps like hack reactor, bloc, or coding dojo?
<mus>
Yup.
agent_white has joined #ruby
<|K|K|K|>
what is the criteria?
ibouvousaime has joined #ruby
<mus>
Generally just a cpacity for problem solving, data structures, algorithms.
<mus>
Four week bootcamps aren't really going to delve into such things.
<mus>
A lot more self-study is required.
chipotle has quit [Quit: cheerio]
<mus>
So about a year, before you find yourself in a capacity where you're able to find yourself competent enough.
<mus>
A lot of these people don't even have any idea what a red-black tree is.
SenpaiSilver has quit [Quit: Leaving]
<mus>
So do your best to understand as much as you can, about all that you can.
<mus>
Not just bootcamps that teach you how to make a timer in Rails.
<mus>
You need to be at your absolute best. So good you cannot be ignored.
<mus>
Bootcamps really won't get you that far.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Arkon has quit [Remote host closed the connection]
trosborn has joined #ruby
solars has joined #ruby
Arkon has joined #ruby
krz has quit [Read error: Connection reset by peer]
adac has joined #ruby
krz has joined #ruby
trosborn has quit [Client Quit]
Arkon has quit [Ping timeout: 240 seconds]
lsmola has joined #ruby
malcolmva has joined #ruby
C0r3 has quit [Quit: leaving]
Arkon has joined #ruby
vigintas has joined #ruby
davedev24 has quit []
<daxroc>
Anyone know of a pure ruby library for generating ISO image files ?
zeroDivisible has joined #ruby
pard has joined #ruby
build22_ has joined #ruby
<pard>
greet ye all nobles
vigintas has quit [Ping timeout: 240 seconds]
htmldrum has quit [Ping timeout: 272 seconds]
<apeiros>
|K|K|K|: please change your nick
<mus>
daxroc: It shouldn't be too difficult to write, should it?
<|K|K|K|>
why a period
<|K|K|K|>
apeiros
<|K|K|K|>
kkk is tri kap
<mus>
No, I'm not currently aware of such a project being in existence, but feh.
<apeiros>
|K|K|K|: I don't care. change your nick.
<mus>
apeiros: Lover. Where've you been all weekend?
<apeiros>
mus: busy spreading love.
<|K|K|K|>
by you saying you don't care means you are willfully ignorant
<apeiros>
!kick |K|K|K| last warning.
|K|K|K| was kicked from #ruby by ruboto [last warning.]
|K|K|K| has joined #ruby
<mus>
Effective.
<pard>
?
<|K|K|K|>
why should I change my name?
<mus>
Because you were told to. :)
<|K|K|K|>
I haven't broken any rules
<apeiros>
!ban |K|K|K| !P you've been warned
|K|K|K| was banned on #ruby by ChanServ [|K|K|K|!*@*]
|K|K|K| was kicked from #ruby by ChanServ [Banned: you've been warned]
astrobunny has joined #ruby
<mus>
Perhaps he's a Kardashian, and this is all so terribly innocent of him?
<apeiros>
mus: they've been here before and told before
<mus>
Ah.
<apeiros>
not sure why I even warned. I should have known better and just straight banned.
symm- has quit [Ping timeout: 260 seconds]
<mus>
Last time I was around was when I went by "sp_", didn't really pay attention to the trolls.
zeroDivisible has quit [Quit: WeeChat 1.3]
rgtk has joined #ruby
<apeiros>
before sp_ you had another nick iirc?
<mus>
Da.
TomyWork has joined #ruby
<mus>
Which is why you re-vouched for me. :)
<apeiros>
faint memories. I'm getting old :(
<pard>
is it a correct claim: calling a lmbda recursivly is faster than calling a meth in that manner?
shock_one has quit [Remote host closed the connection]
<mus>
Is pro active yet?
<apeiros>
nope
<pard>
in ruby?
<apeiros>
pard: just benchmark?
<mus>
pard: Hash recursion is usually faster than lambda recursion, …
Xeago has quit [Read error: Connection reset by peer]
<mus>
But premature optimzation is the devil.
SCHAAP137 has joined #ruby
<apeiros>
fastest in ruby is usually to reimplement the recursion as a loop. ruby is quite bad wrt recursion :-/
<apeiros>
and +1 @ premature opt
<pard>
apeiros, thanks; i was postulating that, if i've not been mistaken, calling a lmbda won't involve a name lookup, recursiveny calling it might be faster
blaxter has joined #ruby
<pard>
*because
mattwildig has joined #ruby
Oog has quit [Read error: Connection reset by peer]
<apeiros>
pard: method calls are optimized in ruby
<apeiros>
and calling a lambda is an additional method call
<apeiros>
since in order to execute the lambda, you do Proc#call
<pard>
thanks a lot; did not know it :\
<mus>
Understand that hash recursions keep the calculated values on memory, and lambda recursion doesn't. Try a testcase for something like a fibonacci sequence against a number like 100. With lambda recursion, you're inherently creating a huge tree of calls before you meet your edge conditions. Tail recursion may circumvent, or ultimately avoid this, but that's not very optimized in Ruby as far as I'm aware.
<apeiros>
so I'm not quite so certain using lambdas would be faster. as said: benchmark.
rgtk has quit [Ping timeout: 260 seconds]
<apeiros>
ruby doesn't have TCO by default
<apeiros>
it's there, you can enable it at compile time. but by default it's off.
mark2 has joined #ruby
desmondhume has joined #ruby
bayed has joined #ruby
<mus>
But yeah, for the purpose of exercising this, test against a hash and a lambda using Benchmark against a big number, just to see the variances.
<pard>
could i maybe ask you for a benchmark lib?
<Ox0dea>
pard: benchmark-ips
<apeiros>
^
<pard>
thanks a lot
<Ox0dea>
apeiros: At *either* compile time, to be precise.
<apeiros>
Ox0dea: hm?
<Ox0dea>
That is, you can compile Ruby itself with TCO, but also individual RubyVM::InstructionSequences.
<apeiros>
ah
<mus>
pard: There's a Benchmark module, it's called Benchmark. Benchmark-ips is something different.
<apeiros>
RubyVM is still a black box for me. I really should play around with that. seems to be an interesting thing.
<mus>
pard: It's like Benchmark on steroids. :P)
mattwildig has quit [Ping timeout: 246 seconds]
shock_one has joined #ruby
<Ox0dea>
Not even that, really; it just benchmarks The Right Thing.
<pard>
mus, thanks; i was actually going to ask the differece between the libs :)
<mus>
pard: It's mostly an iteration-per-second enhancement to the module that exists.
shredding has joined #ruby
<desmondhume>
0c0dea can you give me a quick glimps on the differences between the two libs?
<mus>
3652: Alright.
<apeiros>
Ox0dea: you've been promoted to Oc0dea :D
<pard>
when doing a benchmark, is it recommended to benchmark a call 12 times, or do it one time on 12 calls?
<desmondhume>
lol sry
<Ox0dea>
Most benchmarkers run a thing `n` times and tell you how long it took; benchmark-ips runs your thing for `n` seconds and tells you how many times it was able to do so.
ta has joined #ruby
<apeiros>
more importantly, it also gives you a stddev
<desmondhume>
ok so the .ips vs .bm is just a matter of scale?
<Ox0dea>
No.
<pard>
Ox0dea, thanks
<mus>
Converting hex into decimal in my mind sometimes yields incorrect results, apeiros. :(
<Ox0dea>
mus: Who's 3652?
gard_ has quit [Ping timeout: 240 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Ox0dea>
mus: apeiros' comment was aimed at desmondhume's typo.
dhjondoh has quit [Remote host closed the connection]
DEA7TH has joined #ruby
<mus>
3652 [3562] was geared at you
<mus>
I'll always see you for what you are.
<Ox0dea>
I'd've never guessed.
<desmondhume>
is there any way to avoid typos when answering somebody? :D
<pard>
>> Ox0dea
<ruboto>
pard # => uninitialized constant Ox0dea (NameError) ...check link for more (https://eval.in/465370)
<Ox0dea>
desmondhume: That's the gist of most approaches to benchmarking, and it's just plain wrong.
<pard>
i have mostly suspectd it to be; but why?
<Ox0dea>
It's prone to remarkable inconsistency.
<desmondhume>
teach me master
<desmondhume>
(i'm serious, please teach me :'( )
<Ox0dea>
Rather than guessing at how many times you need to iterate in order to obtain a consistent result, just let the thing run as often as it can in a given time frame.
Xeago has joined #ruby
devoldmx has joined #ruby
<pard>
how then could the results be reliably collectd?
<Ox0dea>
pard: How do you mean?
<pard>
i mean, how could i know how many tines has the call run after the time frame expires?
<Ox0dea>
pard: benchmark-ips will kindly provide you with all the relevant data points.
<pard>
thanks
djbkd_ has quit [Quit: Leaving...]
<desmondhume>
i never saw it this way, guessing a n-times number looks so wrong to me now lol
agent_white has quit [Read error: Connection reset by peer]
<Ox0dea>
Yay, Ruby! Yay, science! <3
<pard>
>> [print print 12, 12]
<ruboto>
pard # => /tmp/execpad-5ff92e206747/source-5ff92e206747:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/465373)
<pard>
thanks
* pard
is going to abscond
pard has quit [Quit: Leaving]
devoldmx has quit [Ping timeout: 246 seconds]
<apeiros>
Ox0dea: I'm sorry. I'm not convinced that running N times is worse than running N seconds.
<apeiros>
Ox0dea: if your problem is CPU bound, you measure CPU time anyway (if you don't, you're bound to measure other load on your machine)
<Ox0dea>
apeiros: Are you suggesting benchmarking should be done in as isolated an environment as is feasible?
agent_white has joined #ruby
arup_r has quit [Quit: Leaving]
<apeiros>
additionally, if you measure a loop which runs N times, you a) only have an overhead of measuring time once, and b) have an easier time to subtract the cost of the loop itself
<mus>
I hope I get some good news this week.
VeryBewitching has quit [Quit: Konversation terminated!]
rgrmatt has joined #ruby
<apeiros>
Ox0dea: CPU time can be measured without isolation. Benchmark (the stdlib) provides that.
drizzle has joined #ruby
<apeiros>
IO bound problems OTOH are quite difficult to properly measure, regardless of running it N times or N seconds.
<Ox0dea>
apeiros: How do you reliably subtract the (time) cost of the loop itself?
<apeiros>
the "run problem N seconds" of IPS is more a convenience thing than a precision thing. the value is added by stddev.
<heftig>
my using cpu time, not real time
<heftig>
by
<apeiros>
by measuring CPU time of the empty loop
solenoids has quit [Ping timeout: 240 seconds]
<Ox0dea>
But `GC.disable` makes things melt.
rgrmatt has quit [Ping timeout: 246 seconds]
Hounddog has joined #ruby
build22_ has quit [Ping timeout: 265 seconds]
skade has joined #ruby
<Ox0dea>
I suppose GC shouldn't really factor into it if you've properly minimized what you're benchmarking, but guessing still feels weird, and IPS feels more like a high score board than elapsed time.
<apeiros>
I guess that's one of the reasons why bmbm runs things twice. and I hope IPS does something similar.
<Ox0dea>
IPS does do a warmup, yes.
sjums has joined #ruby
<sjums>
is there a kind of "StringBuilder" like in C# for concatenating large ammounts of strings?
<heftig>
you can concat to a string using <<
<sjums>
is that faster than var += "string"
<heftig>
it mutates the existing string, which may or may not be faster
<sjums>
:b may or may not
<heftig>
there's no such thing as a string builder because strings are mutable
<mus>
Wonder why the speed of such a thing even matters.
bruno- has joined #ruby
<sjums>
mus because I have 32MB file I (stupidly) load into memory
<apeiros>
and the 20bytes object overhead for the 32MB string object doesn't matter much either :)
<Ox0dea>
sjums: Yeah, you should always be using #<< for string building.
<sjums>
apeiros, it's like 1.5% of mine :)
<apeiros>
sjums: so… still nothing?
<desmondhume>
isn't it better to keep it away from the memory for better scalability (just asking)?
<apeiros>
there's no silver bullets in performance
<sjums>
hush apeiros :P Stop being reasonable.
<desmondhume>
(I'm going to keep asking noob questions, this channel is so full of knowledge and wisdom D:)
<sjums>
desmondhume, no doubt. It's just for fun, nothing that runs near any production environment :)
<sjums>
And the file size will remain pretty static
<apeiros>
sjums: whether you can get any performance out of what you do depends entirely on how you process the data anyway.
solenoids has joined #ruby
stamina has joined #ruby
kp666_ has quit [Ping timeout: 240 seconds]
<apeiros>
if you ask for a stringbuilder because you want to read the file in chunks and build the 32MB string, then that's utterly pointless and definitively a lot slower than just File.read(path)
<apeiros>
if you construct a dom object from it, then same thing again
<desmondhume>
apeiros: sometimes you sound like the most balanced, sane and polite full-of-knowledge bot
<sjums>
the probability that it's my disk being the bottleneck is probably higher than it's += not performing
<apeiros>
if you use a sax or pull parser to process it, then it might make sense.
<desmondhume>
talking about tech stuff lol
Juanchito has joined #ruby
<apeiros>
but then again - it depends on a) what you do in that, and b) whether you expect the file to become bigger over time
<mus>
:(
<apeiros>
desmondhume: I… take that as a compliment? :)
<mus>
I feel so old.
<desmondhume>
apeiros: yes lol
kp666_ has joined #ruby
<apeiros>
desmondhume: 10y ago it was me asking noob questions ;-)
Musashi007 has quit [Quit: Musashi007]
<sjums>
guys.. just stop >.< I'm convinced.. I'll stop being a dirty script hacking machine and start being logical in my file-parsing code
<sjums>
It just feels so good doing dirty things and see them work :D
<desmondhume>
sjums: I agree w/ you on that
minimalism has quit [Quit: leaving]
Kabal has joined #ruby
<desmondhume>
"I'll eventually rewrite that" -> never happened
Kabal has quit []
<apeiros>
sjums: in all likeliness whatever you do with that xml after reading it will consume much more memory than the string itself
Kabal has joined #ruby
<apeiros>
at least iirc Nokogiri.XML for a 32MB xml string would result in ~150-200MB of ram usage
<sjums>
I can tell you that's pretty precice
<apeiros>
and since the dom needs the full xml, building it from chunks wouldn't help.
dhjondoh has joined #ruby
<sjums>
well, one line in the file corresponds to one full object, so potentially I could read a line, wrap it in a root element and parse it with nokogiri
<apeiros>
sjums: stahp
<sjums>
Hammertime?!
<apeiros>
you're reinventing sax/pull parsing. just use nokogiri's
<apeiros>
can't touch this.
lipoqil has joined #ruby
<apeiros>
(or oga's or whatever other xml library you want to use)
<sjums>
my terms are a bit rusty here. Pull parsing is pulling a bit of file and parsing it?
<apeiros>
essentially. a sax parser will invoke a callback whenever a tag opens or closes.
<sjums>
does nokogiri (my library of choise) support that kind of magic?
<apeiros>
so you don't have to read the full file at once, you never have a full object tree.
<apeiros>
so I guess the sax parser I once wrote was really a pull parser. at least I don't remember maintaining any state (well, I *did* maintain the stack, but that was for analytic purposes and purely optional)
<bougyman>
apeiros: sax and pull both scan it incrementally.
xcesariox has joined #ruby
<bougyman>
I was thinking sax vs dom
<bougyman>
dom parser has to read the whole doc.
<bougyman>
pull parser is non-validating.
<apeiros>
I didn't even know sax parsers where validating :D
<desmondhume>
I didn't even know about sax/pull parsing
<apeiros>
and I didn't expect you to confuse dom/pull as that's from where the discussion came ;-)
ibouvousaime has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
<sjums>
I too just learned something new and very useful!
<apeiros>
bougyman: though IMO in that answer, the "[SAX] Once it starts parsing, it parses from starting node to ending node." is not really a property of it being a sax parser, but the property of one particular implementation.
<bougyman>
apeiros: true that.
dhjondoh has joined #ruby
stan has joined #ruby
marr has joined #ruby
mooru has quit [Ping timeout: 260 seconds]
exadeci has joined #ruby
<desmondhume>
anyone has resources on configuring watchdog + systemd with rails (frameworks/libs)? I'd like to have some sort of daily report (maybe an html) on the health status of the rails app and the services like sidekiq and redis...
andikr has joined #ruby
stamina has quit [Ping timeout: 240 seconds]
<desmondhume>
watchdog + systemd are just fine for restarting and managing crashes
<j416>
Ox0dea:
moeabdol1 has quit [Ping timeout: 244 seconds]
agent_white is now known as agent_poop
<FailBit>
good morning
agent_poop is now known as agent_white
<desmondhume>
nobody? :(
moeabdol1 has joined #ruby
* apeiros
not in devops
<apeiros>
or just ops
trosborn has joined #ruby
<desmondhume>
right :D
trosborn has quit [Client Quit]
Xeago has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
platzhirsch has joined #ruby
astrobunny has quit [Remote host closed the connection]
agent_white is now known as agent_poop
agent_poop is now known as agent_white
subscope has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
trosborn has joined #ruby
Arkon has quit [Remote host closed the connection]
ibouvousaime has quit [Ping timeout: 240 seconds]
trosborn has quit [Client Quit]
ibouvousaime has joined #ruby
Xeago_ has quit [Remote host closed the connection]
dhjondoh has joined #ruby
leafybas_ has joined #ruby
bonemind has joined #ruby
platzhirsch has quit [Ping timeout: 260 seconds]
yaw has joined #ruby
yaw has quit [Client Quit]
Xeago has joined #ruby
vigintas has joined #ruby
leafybas_ has quit [Ping timeout: 255 seconds]
trosborn has joined #ruby
aganov has joined #ruby
Tempesta has joined #ruby
tomphp has joined #ruby
* mus
sleeps, wide-awake.
trosborn has quit [Ping timeout: 250 seconds]
weckl has joined #ruby
lukaszes has joined #ruby
yes`r has joined #ruby
linocisco has quit [Ping timeout: 255 seconds]
platzhirsch has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
araujo_ has joined #ruby
araujo_ has quit [Max SendQ exceeded]
RegulationD has joined #ruby
araujo_ has joined #ruby
araujo_ has quit [Max SendQ exceeded]
araujo has quit [Ping timeout: 260 seconds]
araujo_ has joined #ruby
araujo_ has quit [Max SendQ exceeded]
araujo_ has joined #ruby
linocisco has joined #ruby
araujo_ has quit [Max SendQ exceeded]
RegulationD has quit [Ping timeout: 272 seconds]
araujo_ has joined #ruby
Musashi007 has joined #ruby
bruno- has joined #ruby
araujo_ has quit [Max SendQ exceeded]
bruno- is now known as Guest45583
araujo_ has joined #ruby
Peg-leg has joined #ruby
vigintas has quit [Remote host closed the connection]
vigintas has joined #ruby
chriscoffee has joined #ruby
chriscoffee has quit [Client Quit]
chriscoffee has joined #ruby
tvw has quit [Remote host closed the connection]
<yorickpeterse>
morning
<desmondhume>
yo
Guest45583 has quit [Ping timeout: 250 seconds]
krz has quit [Read error: Connection reset by peer]
<apeiros>
yorickpeterse: that'll drop the time part :)
<apeiros>
DateTime
<yorickpeterse>
errr yeah
<yorickpeterse>
I hate how there's both Time and DateTime
ldnunes_ has joined #ruby
devoldmx has quit [Ping timeout: 250 seconds]
<apeiros>
indeed. nowdays they could merge. the difference from older days has mostly gone (performance vs. valid range)
last_staff has joined #ruby
rgrmatt has joined #ruby
ldnunes_ has quit [Client Quit]
dionysus69 has joined #ruby
rgrmatt has quit [Ping timeout: 264 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
d0lph1n98 has joined #ruby
Pupp3tm4st3r has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
senayar has joined #ruby
agent_white has joined #ruby
stamina has joined #ruby
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
araujo has joined #ruby
araujo has joined #ruby
arne_ has joined #ruby
<arne_>
howdy, is parsing parsing json of users considered unsafe?
shredding has joined #ruby
axsuul has quit [Ping timeout: 250 seconds]
<yorickpeterse>
arne_: possibly, depends on the method you'd use
<yorickpeterse>
Though I think JSON.load already limits the amount of nested objects
subscope has joined #ruby
User has joined #ruby
User is now known as Guest95369
bubbys has quit [Ping timeout: 252 seconds]
JanPeter has quit [Ping timeout: 250 seconds]
bubbys has joined #ruby
Ox0dea has quit [Ping timeout: 260 seconds]
Rovanion has joined #ruby
<arne_>
JSOn.parse is what i use
<arne_>
> parsing parsing im stuttering while chatting :O
bruno- has joined #ruby
<yorickpeterse>
IIRC just JSON.parse behaves a bit different from JSON.ooad
<yorickpeterse>
* load
<yorickpeterse>
e.g. JSON.load('10') gives back 10
<yorickpeterse>
but JSON.parse('10') raises an error
bruno- is now known as Guest77083
<yorickpeterse>
also JSON.load uses JSON.parse under the hood, so I _think_ it should be OK
araujo has quit [Quit: Leaving]
<yorickpeterse>
though the rdoc states to not use it for untrusted input for some reason
<Rovanion>
Hi, does anyone recognise this error, probably related to bundler or rake: "Error: Could not parse application options: can't activate json_pure-1.8.2, already activated json_pure-1.8.3". I get it when I run puppet module generate which executes some sort of ruby procram.
skade has quit [Quit: Computer has gone to sleep.]
<arne_>
yeah i never came to my mind, i just discovered some old security issues of rails, where parsing user-json was a problem
<arne_>
not using rails, though.
gambl0re has quit [Ping timeout: 255 seconds]
sinkensa_ has quit [Remote host closed the connection]
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
desmondhume has quit [Read error: Connection reset by peer]
d0lph1n98 has quit [Quit: leaving]
desmondhume has joined #ruby
last_staff has quit [Quit: last_staff]
lubarch has quit [Ping timeout: 265 seconds]
DEA7TH has joined #ruby
lubarch has joined #ruby
step1step2 has quit [Quit: Leaving]
guest9000 has joined #ruby
lipoqil has quit [Quit: Connection closed for inactivity]
jeffreylevesque_ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<atmosx>
Rovanion: that's a dependency problem. Try removing 'json_pure-1.8.3' from your gems and see if that works.
Scymex has quit [Ping timeout: 250 seconds]
jeffreylevesque has quit [Ping timeout: 246 seconds]
<atmosx>
e.g. gem uninstall json_pure-1.8.3
Outlastsheep has joined #ruby
prestorium has joined #ruby
adac has quit [Ping timeout: 250 seconds]
leafyba__ has joined #ruby
leafybas_ has quit [Read error: Connection reset by peer]
guest9000 has left #ruby ["Leaving"]
jeffreylevesque_ has quit [Ping timeout: 250 seconds]
al2o3-cr has quit [Ping timeout: 264 seconds]
devbug_ has quit [Read error: Connection reset by peer]
drizzle has quit [Quit: WeeChat 1.3]
Rickmasta has joined #ruby
al2o3-cr has joined #ruby
akem has quit [Quit: Bye]
bMalum has joined #ruby
lubarch has quit [Quit: leaving]
yashinbasement has quit [Quit: Leaving]
CloCkWeRX has joined #ruby
mooru has quit [Ping timeout: 265 seconds]
_blizzy_ has joined #ruby
Guest95369 has quit [Read error: Connection reset by peer]
<tsunamie>
Hi guys, trying to learn troubleshoorting and debugging - require 'rubygems'
<tsunamie>
sorry - I put the script and error into that link
<tsunamie>
for some reason it did'nt actaully ctr+c
<tsunamie>
does anyone know how I can debug this or walk me throught how to troubleshoot it?
<gregf_>
o_O
shredding has quit [Remote host closed the connection]
<gregf_>
for a moment i felt as though i was struck by a tsunamies
<tsunamie>
gregf, hehe yea sorry my bad
<gregf_>
tsunamie: please use gist ;)
<tsunamie>
gregf_, ahh yes sorry again
trosborn has joined #ruby
trosborn has quit [Client Quit]
<gregf>
gregf_: mortal enemies?
<FailBit>
:%
<tsunamie>
:(
trosborn has joined #ruby
<gregf_>
heh
Pupeno has quit [Remote host closed the connection]
bMalum has quit [Quit: bMalum]
devgiant has joined #ruby
trosborn has quit [Client Quit]
weihan has joined #ruby
<gregf>
gregf_: sorry i'm always stealing your highlights
vigintas has quit [Quit: vigintas]
devgiant has quit [Client Quit]
desmondhume has quit [Remote host closed the connection]
desmondhume has joined #ruby
voodo has quit [Quit: Leaving...]
shredding has joined #ruby
Kelzier has joined #ruby
sinkensabe has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tsunamie>
gregf, gregf_ I think I ahve a solution as the issue was the fact I use cigwin
vigintas has joined #ruby
JohnBat26 has joined #ruby
tvw has joined #ruby
bMalum has joined #ruby
<gregf_>
tsunamie: presumably you;re on windows, so, try and download virtualbox and use a ubuntu image with it. its better than cygwin
moeabdol1 has joined #ruby
desmondhume has quit [Ping timeout: 252 seconds]
karapetyan has joined #ruby
anisha has quit [Quit: Leaving]
zenguy_pc has joined #ruby
zenguy_pc has quit [Max SendQ exceeded]
Xeago has quit [Remote host closed the connection]
scmx has joined #ruby
Mon_Ouie has joined #ruby
acke_ has joined #ruby
karapetyan has quit [Ping timeout: 250 seconds]
kp666_ has quit [Remote host closed the connection]
kp666_ has joined #ruby
htmldrum has joined #ruby
CloCkWeRX has quit [Ping timeout: 250 seconds]
agent_white has quit [Read error: Connection reset by peer]
sameerynho has quit [Quit: Leaving]
sdothum has joined #ruby
<sjums>
gregf_, IIRC nokogiri doesn't run on windows
rapidjammer has quit [Ping timeout: 265 seconds]
millerti has joined #ruby
agent_white has joined #ruby
rapidjammer has joined #ruby
millerti has quit [Client Quit]
<shevy>
too many gregs
bMalum has quit [Quit: bMalum]
Mia has quit [Read error: Connection reset by peer]
build22_ has quit [Remote host closed the connection]
subscope has joined #ruby
<gregf_>
>> Array.new(10) { "shevy! " }
<ruboto>
gregf_ # => ["shevy! ", "shevy! ", "shevy! ", "shevy! ", "shevy! ", "shevy! ", "shevy! ", "shevy! ", "shevy! ", ...check link for more (https://eval.in/465503)
rapidjammer is now known as show
show is now known as rapidjammer
shredding has quit [Ping timeout: 260 seconds]
kp666_ has quit [Quit: Leaving]
adac has joined #ruby
kp666_ has joined #ruby
TvL2386 has quit [Quit: Ex-Chat]
<norc>
se
<norc>
shevy!#
bMalum has joined #ruby
<rapidjammer>
on channel
mattwildig has joined #ruby
suchness has joined #ruby
<rapidjammer>
can anyone give me some info on learning mirc.... more than tuts
kp666_ has quit [Read error: Connection reset by peer]
<suchness>
Has anyone here used the elasticsearch model gem and mapped one model to multiple indexes or types?
<FailBit>
chebyshev, gregf_
<FailBit>
:D
<FailBit>
suchness: um
<FailBit>
uh
<FailBit>
I don't think that's supported
<suchness>
FailBit: I don't either.
millerti has joined #ruby
<suchness>
:/
<FailBit>
my question is
leafyba__ has quit [Read error: Connection reset by peer]
<FailBit>
why would you
<FailBit>
it's a complete waste of index space
<suchness>
Well, funny you should ask, I have been asking myself that question as well.
leafybas_ has joined #ruby
<suchness>
But it basically comes down to context of where these models are used
<suchness>
So I have a people index, that's mainly for autocompletes and the like.
<suchness>
I have a screener index, which is basically an in depth search that considers a lot more things.
<FailBit>
why not do both on the same index?
mattwildig has quit [Ping timeout: 255 seconds]
<suchness>
And then there is the situation where I need to have multiple parents, which elasticsearch doesn't support, so I need two indexes.
millerti has quit [Client Quit]
hanmac has quit [Ping timeout: 246 seconds]
<suchness>
FailBit: That will work for the first situation, not the last I said, that I know of.
<suchness>
When it comes to a child having multiple parents, elasticsearch just fails me.
<FailBit>
so then I guess your best option
<FailBit>
if you need to have everything available to search
<FailBit>
is to aggressively denormalize
<suchness>
How do you mean?
CloCkWeRX has joined #ruby
JanPeter has joined #ruby
JanPeter is now known as TPBallbag
<suchness>
Actually, I think I know what you mean.
kp666_ has joined #ruby
<suchness>
Basically get the app model relationships out of the equation.
<FailBit>
exactly
<suchness>
So here is the thing, and why I am struggling to do that.
<FailBit>
in your as_json method, include a copy of both parents.
<suchness>
Won't that lead to a hell of a lot of duplication?
<FailBit>
yes, but it's not a bad option
<FailBit>
we do it for 1 million 'parent' docs, that often have 500-1000 'children'
build22_ has joined #ruby
<suchness>
Unfortunately I have about 3 million new documents a week, at that rate things would grow much too much.
<FailBit>
all fits in 5GB
craigp has joined #ruby
<FailBit>
okay, maybe not then
<FailBit>
your architecture diagram is fucked, basically
<suchness>
Yeah, I am getting that feeling. It's external data that's coming in though, so not a hell of a lot I can do about it. Well, I could reorganize it...
<suchness>
Well.
<suchness>
That at least gives me some things to think about.
<suchness>
Just to be clear, you are talking one big index with different types, each type relating to a model?
<suchness>
I just don't see how I could get document.children if the parents are just right on the child.
devoldmx has joined #ruby
<FailBit>
I would only assume you have a parent/child relationship because you need to query on fields on both, right?
kerunaru has joined #ruby
build22_ has quit [Ping timeout: 250 seconds]
<suchness>
correct
<suchness>
well
<suchness>
not exactly
<suchness>
I need my search results to be parent containers with children
tk__ has joined #ruby
otiasogirdor has joined #ruby
<suchness>
And I can't have the top level parents duplicated
<suchness>
For my specific app:
<suchness>
I am searching for users, each user belongs to a company
<suchness>
The search results display companies that can be expanded to show all the users
<suchness>
But there can never be a duplicate company row.
mooru has joined #ruby
<suchness>
If I had no parent child, I would have duplicates everywhere, as some documents would get left out of the pagination and found later.
calleerlandsson has left #ruby ["WeeChat 1.0.1"]
otiasogirdor has quit [Remote host closed the connection]
* FailBit
looks to see if elastic has something like SQL distinct
devoldmx has quit [Ping timeout: 250 seconds]
ciampix has quit [Ping timeout: 250 seconds]
hanmac has joined #ruby
<FailBit>
so if you used a terms aggregation you could get away with storing ids
<FailBit>
as long as you don't need to query on specifically _nested_ fields
kp666_ has quit [Remote host closed the connection]
Xzanron has joined #ruby
<suchness>
FailBit: Unfortunately, it's essential we search the nested fields. I think though, that ultimately I could get away with one parent, I am just worried about needing another parent in the future.
millerti has joined #ruby
<apeiros>
wonder how it's implemented
* apeiros
assumes it'll just call [] iteratively
craigp has quit []
CloCkWeRX has quit [Quit: Leaving.]
craigp has joined #ruby
<FailBit>
suchness: which ones?
craigp has quit [Client Quit]
<FailBit>
you can just trim it down to very specific fields
<FailBit>
and store that as a hash
karapetyan has joined #ruby
darklight03 has joined #ruby
karapetyan has quit [Remote host closed the connection]
dhjondoh has quit [Quit: dhjondoh]
Icey has joined #ruby
dorei has joined #ruby
<FailBit>
for us (images <=> tags), we have images map tags like this: [{name: "safe", id: 1}, {name: "vulgar", id: 2}, ...]
yqt has joined #ruby
rapidjammer has quit []
tkuchiki has joined #ruby
karapetyan has joined #ruby
_blizzy_ has quit [Quit: Leaving]
teclator has joined #ruby
<FailBit>
then we can search on "tags.name" or "tags.id"
karapetyan has quit [Remote host closed the connection]
craigp has joined #ruby
Jardayn has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
sanjayu has quit [Ping timeout: 244 seconds]
agent_white has joined #ruby
p0wn3d__ has joined #ruby
howdoicomputer has quit [Ping timeout: 264 seconds]
leat has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 265 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leat has joined #ruby
weihan has quit [Ping timeout: 244 seconds]
subscope has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest77083 has quit [Ping timeout: 272 seconds]
tkuchiki has quit [Remote host closed the connection]
s00pcan has joined #ruby
dhjondoh has joined #ruby
HayesHimself has joined #ruby
chriscoffee has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
joonty has quit [Quit: joonty]
moeabdol1 has quit [Quit: WeeChat 1.3]
gagrio_ has quit [Ping timeout: 250 seconds]
roxtrongo has quit [Remote host closed the connection]
<suchness>
Hmm
<shevy>
somehow I seem to end up rewriting ruby code a lot :(
<suchness>
But what if you had 100,000 tags
<suchness>
You would get duplicates in pagination
Scymex has joined #ruby
gagrio has joined #ruby
desmondhume has joined #ruby
karapetyan has joined #ruby
scmx has quit [Ping timeout: 255 seconds]
TheNet has quit [Remote host closed the connection]
<dorei>
shevy: overengineering?
Coldblackice_ has quit [Ping timeout: 240 seconds]
k3asd` has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
agent_white has quit [Read error: Connection reset by peer]
subscope has joined #ruby
nateberkopec has joined #ruby
pglombardo has joined #ruby
pglombardo has quit [Client Quit]
moeabdol has joined #ruby
AxonetBE has quit [Quit: AxonetBE]
arne_ has quit [Ping timeout: 260 seconds]
<FailBit>
we have 200000 tags in fact
<FailBit>
but those are condensed for specifically queries related to images
<FailBit>
the tags themselves have many, many more fields and are also stored in a separate index
sankaber has quit [Remote host closed the connection]
Pupeno has joined #ruby
sankaber has joined #ruby
<suchness>
FailBit: I meant if you had 100,000 tags on one image.
<shevy>
dorei it very often is bad original ruby code that I wrote in the past :(
<suchness>
Which at that point I suppose they would be unique, but imagine they aren't. That would be my case with indexing two parents on each document.
<FailBit>
then use a terms aggregation
<FailBit>
that is the point :V
dhjondoh has joined #ruby
robbyoconnor has joined #ruby
<suchness>
Hmm, maybe I am just not familair enough with it, I'll check out the ocs.
<suchness>
docs
<FailBit>
terms aggregation is like SELECT DISTINCT
sankaber has quit [Client Quit]
chriscoffee has joined #ruby
adac has quit [Ping timeout: 240 seconds]
synthroid has joined #ruby
syath has joined #ruby
<suchness>
Ah, that makes sense then...
atomical has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
<agent_white>
Is Cinch a decent bot to look at for 'example code'? Writing a irc bot in ruby from scratch and shittin' the bed when it comes to design.
s00pcan has quit [Remote host closed the connection]
<agent_white>
(just looking at how to organize classes, what methods go where... etc.)
s00pcan has joined #ruby
<Papierkorb>
agent_white: Wrote a bot with it some months ago. I'd maybe put some things somewhere else, but overall, i think it has a solid architecture.
dhjondoh has quit [Quit: dhjondoh]
<Papierkorb>
agent_white: maybe a little too much with the plugin stuff.
<agent_white>
Papierkorb: Good deal. I'm avoiding using it entirely... just going "from scratch" for learning purposes.
Scymex has quit [Ping timeout: 246 seconds]
<agent_white>
Papierkorb: Yeah that's another thing I was looking into... writing a basic "factoid bot" right now, but I've been thinking about how to integrate plugins (for little things like games, user quotes, etc.)
[ddmp] has quit [Quit: WeeChat 1.3]
<Papierkorb>
agent_white: that's fine! Just keep this in mind: Architecture is hard. What is convenient is not always what others would consider 'good' architecture. Good code is testable, but testable code isn't necessarily good. And so on. But try yourself at it, it's the only way to learn that stuff :)
diegoaguilar has joined #ruby
[ddmp] has joined #ruby
cyberarm has joined #ruby
<zwdr>
agent_white: cinch is good, but really complicated
<zwdr>
I ended up building my own bot from scratch because it was too overengineered for my taste :s
dhjondoh has joined #ruby
mehakkahlon has quit [Remote host closed the connection]
<agent_white>
Papierkorb: Good deal! That's what I'm struggling with since I'm very new to coding, and don't have much practice besides scripts. https://github.com/jakenotjacob/vapebot -- that's what I have. Things just seem... very disorganized.
chriscoffee has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<agent_white>
zwdr: Ah! :P Yeah it definitely seems nice for fleshing out a nice bot! And maybe i'll kick myself later for not using it, but I'd rather learn and build myself, too :)
<zwdr>
yea, and it's pretty fun and easy to implement IRC
<zwdr>
(at least the subset you need for a bot right)
<Papierkorb>
and IRC is easy enough and overall a reasonable choice for learning network programming
adac has joined #ruby
nateberkopec has quit [Ping timeout: 260 seconds]
<Papierkorb>
agent_white: first things are stuff like the directory structure does not reflect the module::class structure of the files. constants, like in db.rb, should be in a module, and not in the 'global' scope of the file. config.rb wanted to use a CONSTANT too.
<Papierkorb>
or rather, i'd go with a self.config over a constant, also for easier testability
a-109-107 has joined #ruby
diegoaguilar has quit [Ping timeout: 272 seconds]
htmldrum has quit [Ping timeout: 272 seconds]
shock_one has quit [Remote host closed the connection]
exadeci has quit [Quit: Connection closed for inactivity]
joonty has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<agent_white>
Papierkorb: I was curious about that... I just saw that it seemed like a simple way to split the string how I wanted.
<Papierkorb>
agent_white: if you're looking for a SQL driver btw, check out the Sequel gem. Easy to set up, and even better than ActiveRecord to query stuff
Xeago has joined #ruby
<agent_white>
Papierkorb: Aye I was looking at that, too! Was using sdbm since I figured I just needed a simple key-value store but I think I need to move to a sql-esque db.
<Papierkorb>
agent_white: Yeah but its value may change unexpected to you. You can of initialize the splitter value with it if you prefer that as fallback. But really, I'd just say that the splitter is e.g. ',', and be done with it.
<Papierkorb>
At this point, I've no idea if the separator is , or ; or w/e
<agent_white>
Ah alrighty
<zwdr>
agent_white: and with plugins you'll want to have an interface on your bot where plugins can register commands
Xeago has quit [Remote host closed the connection]
<zwdr>
for my bot, for example, its pretty easy. a function that takes a regex and a callable
<zwdr>
then the callable gets called whenever the privmsg matches the regex
sinkensabe has joined #ruby
davedev24 has joined #ruby
<desmondhume>
also the telegram bot for ruby works the same way iirc
<desmondhume>
isn't it unsafe? Having just the regex?
<zwdr>
why's that?
<Papierkorb>
I OTOH would have something like a small parser, which looks for a command sign at the beginning of the message (exclamation mark or so), take the first word behind it and then have a Hash{String => Proc} and look it up that way without using regexes. Just an ide
<Papierkorb>
a
<desmondhume>
i don't know, maybe namespace collisions
<zwdr>
yea, true
<zwdr>
if you want every plugin to have a seperate namespace
<Papierkorb>
sounds overkill for an *IRC* bot though
<desmondhume>
a big issue i see with bots is keeping text commands short and expressive while avoiding name collisions
shock_one has joined #ruby
<agent_white>
zwdr: Hmmm... alrighty :D
The_Phoenix has joined #ruby
jas02 has quit [Quit: jas02]
arne has joined #ruby
[ddmp] has quit [Quit: WeeChat 1.3]
<desmondhume>
the text as interface is a strong idea, but it's hard to keep every command unique and predictable
[ddmp] has joined #ruby
<zwdr>
Papierkorb: Well, I have regexes with command sign and without command sign. for the ones with sign I build a regex from sign + regex
<agent_white>
Papierkorb: Ahhh I never thought to just use a hash instead of dickin' around with all these array indices.
goodcodeguy has joined #ruby
<agent_white>
Hm.
RegulationD has joined #ruby
<Papierkorb>
agent_white: well, with say a Struct.new(:command, ...) and an array out of those, it'd just be an commands.find{|cmd| cmd.command == the_command} to find an command. Depends on what you exactly want
a-109-107 has left #ruby ["WeeChat 1.3"]
<zwdr>
registering callbacks is on another layer of abstraction than the whole plugin logic and all that
The_Phoenix has quit [Client Quit]
shredding has joined #ruby
nibbo has quit [Ping timeout: 246 seconds]
mag42c has joined #ruby
Some-body_ has joined #ruby
<zwdr>
I got a minimal IRC bot lib and then built a "real" bot on top
Hounddog_ has joined #ruby
<bougyman>
why are you inventing this wheel again?
<zwdr>
me?
eggoez has quit [Ping timeout: 264 seconds]
<agent_white>
bougyman: For learning purposes :)
<agent_white>
Papierkorb: Ahhh I see... zwdr is that what you're talking about then?
<dorei>
i think the only way to actually learn is to reinvent the wheel
<Papierkorb>
^^^
<desmondhume>
dorei: tj holowaychuk agrees on that
<bougyman>
that attitude leads to shitty wheels.
<zwdr>
well I got the code online
<norc>
dorei: Hardly.
<zwdr>
sec
chriscoffee has joined #ruby
scmx has joined #ruby
yitsushi has joined #ruby
<norc>
I mean if you want, you can reinvent all the technology from the past 4,000 years if you think it makes you a better engineer.
leafybas_ has quit [Read error: Connection reset by peer]
leafyba__ has joined #ruby
<Papierkorb>
norc: you can't understand something until you built it yourself. you may be able to USE something without it, but not entirely understand it.
<norc>
Papierkorb: So what you are saying is that you cannot understand Ruby until you write your own lexer/parser/compiler/virtual machine implementation stack?
<agent_white>
bougyman: I'm learning so, all the wheels, pre-built or not, will be shitty. ;)
bruno-_ has joined #ruby
diegoaguilar has joined #ruby
<Papierkorb>
norc: you didn't read what I said. you're USING ruby, right? For that you don't have to build a lexer and so on.
arne has quit [Ping timeout: 240 seconds]
eggoez has joined #ruby
karapetyan has quit [Remote host closed the connection]
<norc>
Papierkorb: No Im in the process of understanding Ruby. But thanks for trying to correct me.
<Papierkorb>
norc: do you however understand why this GC is better than that GC for this specific load or constraints? Nope, not until you tried building that part of the solution. No one's saying to build everything yourself.
Hounddog_ has quit [Ping timeout: 240 seconds]
<shevy>
I still have difficulties believing norc really uses ruby :)
terlar has joined #ruby
<norc>
shevy: I just dissect Ruby.
stannard has joined #ruby
macdaddy has quit [Ping timeout: 264 seconds]
Hounddog has quit [*.net *.split]
DarthGandalf has quit [*.net *.split]
Some-body_ is now known as DarthGandalf
howdoicomputer has joined #ruby
macdaddy has joined #ruby
dmitch has joined #ruby
rgtk has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
BrunoSaboia has joined #ruby
<shevy>
I did that a lot when I was a tinkerer
ckrailo has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
<shevy>
these days I beat down complexity with a stick
<agent_white>
Thank you guys for the advice :) I appreciate it!
yitsushi is now known as Piredex
agent_white has quit [Client Quit]
Piredex is now known as Piredez
stannard has quit [Remote host closed the connection]
Piredez is now known as yitsushi
lokulin has quit [Ping timeout: 264 seconds]
Trieste has quit [Ping timeout: 264 seconds]
ckrailo has joined #ruby
diegoaguilar has quit [Ping timeout: 250 seconds]
BSaboia has quit [Ping timeout: 264 seconds]
howdoicomputer has quit [Ping timeout: 260 seconds]
The_Phoenix has quit [Read error: Connection reset by peer]
leafybas_ has quit [Ping timeout: 246 seconds]
nfk has joined #ruby
roxtrongo has quit [Remote host closed the connection]
craigp has joined #ruby
DEA7TH has quit [Quit: DEA7TH]
solocshaw has quit [Ping timeout: 265 seconds]
NeverDie has joined #ruby
<gregf_>
haha, that bot is funny ;)
<gregf_>
oh - well
bruno-_ has quit [Ping timeout: 252 seconds]
RobertBirnie has joined #ruby
DEA7TH has joined #ruby
<gregf_>
sjums: thanks. but that code took 4 1/2 minutes to run and load into mongo?
darklight03 has quit [Ping timeout: 240 seconds]
TomyWork has quit [Ping timeout: 260 seconds]
RegulationD has quit [Remote host closed the connection]
skweek has quit [Ping timeout: 240 seconds]
bonemind has quit [Quit: WeeChat 1.0]
maletor has joined #ruby
towski_ has joined #ruby
<purplexed->
Question: I'm writing some code right now to kill a process. I'm doing this on Linux. Can I expect it to work on Windows, or will I need another implementation of it for Windows?
craigp has quit [Remote host closed the connection]
<eam>
windows is fairly different
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Arkon has joined #ruby
voodo has quit [Quit: Leaving...]
stannard has joined #ruby
RobertBirnie has quit [Ping timeout: 250 seconds]
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pandaant has joined #ruby
RobertBirnie has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
desmondhume has quit [Remote host closed the connection]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
desmondhume has joined #ruby
craigp has joined #ruby
kerunaru has joined #ruby
wldcordeiro has joined #ruby
desmondhume has quit [Read error: Connection reset by peer]
desmondh_ has joined #ruby
TheNet has joined #ruby
<purplexed->
eam: so, yes ?
senayar has quit []
guillaume-rb has quit [Quit: guillaume-rb]
<purplexed->
it's not a big deal, just something to be aware of
<purplexed->
and certainly when testing
_kfpratt has joined #ruby
craigp has quit [Remote host closed the connection]
desmondh_ has quit [Remote host closed the connection]
<sjums>
gregf_, no no ! That's the fast code :)
<shevy>
purplexed- I think Process.kill also works on windows; you can try it perhaps, loop { Process.kill :QUIT, $PROCESS_ID } should instantly terminate I think
<shevy>
or perhaps :SIGKILL
craigp has joined #ruby
<purplexed->
oh well, time will tell I guess
kfpratt has quit [Ping timeout: 246 seconds]
kerunaru has quit [Client Quit]
<Ox0dea>
"Time" hear meaning ten seconds if you actually wanted your question answered.
benlieb has joined #ruby
<Ox0dea>
*here
<sjums>
shevy, on windows I have a vibe that there's "please close" and "JUST GO AWAY"
<Ox0dea>
sjums: Same for Unix.
<sjums>
all the different terms and kills linux has is not there
dhollinger has quit [Ping timeout: 244 seconds]
<Ox0dea>
Oh, I see how you meant.
TheNet has quit [Ping timeout: 265 seconds]
<shevy>
the last windows I seriously used was win xp; i have a win 7 machine downstairs but I don't really need windows
skweek has joined #ruby
<shevy>
ruby itself happily works on windows too though, even my ruby-gnome things run there
<shevy>
they became totally insane with win 10 though
<sjums>
gnomes are not to be trusted
<shevy>
hehe
<shevy>
back then qtruby did not have any real documentation :(
stan has quit [Ping timeout: 240 seconds]
<shevy>
the usual comment was "read the C++ API of qt and kde"
sanjayu has quit [Ping timeout: 240 seconds]
<Ox0dea>
shevy: Do you pronounce it "cute" or "cutie"?
<shevy>
I pronounce it chhuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuutttt(silent e)
<shevy>
I would not know why an "i" is there
Nick_ZWG has joined #ruby
_stu_ has quit [Quit: _stu_]
Xeago has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 250 seconds]
waxjar has joined #ruby
<Ox0dea>
Whoa! They accepted Hash#dig.
scmx has joined #ruby
ESpiney_ has joined #ruby
voodo has joined #ruby
Arkon has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
h99h9h88 has joined #ruby
jhowarth_ has joined #ruby
ESpiney has quit [Ping timeout: 260 seconds]
jhowarth_ is now known as jhowarth
h99h9h88 has quit [Remote host closed the connection]
howdoicomputer has joined #ruby
h99h9h88 has joined #ruby
<shevy>
did you suggest it?
rakm has joined #ruby
<waxjar>
what does it do?
charliesome has joined #ruby
Peg-leg has quit [Quit: Leaving.]
guillaume-rb has joined #ruby
<Ox0dea>
It went on Array too, and the current implementation supports mixed collections. That's not gonna bite anybody ever.
<apeiros>
desmondhume: #ruby-lang got merged into #ruby
<Ox0dea>
Guest40159: Are you going to show us some code, then?
<Guest40159>
past text and clic on create
<Ox0dea>
apeiros: So no 2.3 bot?
<Guest40159>
not for you
voodo has quit [Quit: Leaving...]
<apeiros>
Ox0dea: hu? what?
<Guest40159>
for another IRC
<Guest40159>
sorry for conveniance
<desmondhume>
pastie: hi!
<Ox0dea>
apeiros: Is it okay if my bot responds to ">>23"?
<Ox0dea>
*23>>
<Guest40159>
bye
<desmondhume>
nothing happens lol
<Guest40159>
thank you for your help
h99h9h88 has quit [Remote host closed the connection]
Guest40159 has quit [Quit: Page closed]
Mon_Ouie has joined #ruby
<apeiros>
Ox0dea: I'd prefer not. I'd rather you talk to charlie and let him add 23 to eval.in
pu22l3r has joined #ruby
<Ox0dea>
He's already said he'd rather not.
<Ox0dea>
It "moves too fast".
Uranio has joined #ruby
Uranio has quit [Client Quit]
sivoais has joined #ruby
howdoicomputer has joined #ruby
<apeiros>
Ox0dea: does your bot use an API to evaluate the code? i.e. one which you can make public?
skweek has joined #ruby
<Ox0dea>
Well, no, there are no public 2.3 evaluators I'm aware of.
blackmesa has joined #ruby
<adaedra>
Ox0dea: time for github-writes-a-ruby-evaluator ?
<apeiros>
Ox0dea: then I'm sorry. I'd prefer you don't. ruboto will soon restrict >> usage to registered people, with the ability to blacklist
<Ox0dea>
Oh, I see.
<Ox0dea>
adaedra: On it.
Xeago has quit [Remote host closed the connection]
<apeiros>
Ox0dea: if we can integrate it in that new version of ruboto, I'm willing to lend a hand. I've got a couple of tasks to clear before, though :D
<Ox0dea>
adaedra: We're, like, 99% of the way there, by the way: http://git.io/v8wfp
benlieb has joined #ruby
<adaedra>
Ox0dea: I'm so tempted throwing some emoji in it.
<shevy>
does ruboto already have unicode snowman support
<adaedra>
?snowman
<ruboto>
Here's a snowman for you: ☃
<adaedra>
magic!
<shevy>
ok
<adaedra>
You're not safe here, shevy
<shevy>
the snowman is fine
<shevy>
I can't see him :)
<Ox0dea>
What year is it?
<shevy>
2016
swgillespie has joined #ruby
<adaedra>
That's alright, Ox0dea, shevy is in UTC-87600.
SHyx0rmZ has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 276 seconds]
opensource_ninja has quit [Quit: opensource_ninja]
platzhirsch has left #ruby [#ruby]
SHyx0rmZ has joined #ruby
adac has joined #ruby
zeroDivisible has joined #ruby
solocshaw has joined #ruby
diegoaguilar has quit [Ping timeout: 252 seconds]
skweek has quit [Ping timeout: 246 seconds]
<desmondhume>
dying lol
sivoais has quit [Ping timeout: 276 seconds]
sankaber has quit [Remote host closed the connection]
sivoais has joined #ruby
sivoais has quit [Read error: Connection reset by peer]
sankaber has joined #ruby
Fire-Dragon-DoL has joined #ruby
sivoais has joined #ruby
TurbinGoatFuker has joined #ruby
<TurbinGoatFuker>
why are all the brown niggers in IT
kstuart has quit [Quit: WeeChat 1.3]
Spami has quit [Read error: Connection reset by peer]
Spami_ has joined #ruby
<adaedra>
!mute TurbinGoatFuker
<apeiros>
their achievement to discredit racists by being incredibly stupid was successful IMO
<apeiros>
uh, not achievement… I guess I shouldn't irc while doing other stuff…
<adaedra>
yeah, you should just irc.
iateadonut has quit [Quit: Leaving.]
TheNet has joined #ruby
DEA7TH has joined #ruby
djbkd has quit [Remote host closed the connection]
desmondhume has quit [Ping timeout: 244 seconds]
Pupp3tm4st3r has joined #ruby
<shevy>
if only you could idle to power in reallife as well
rakm has joined #ruby
cjbottaro has joined #ruby
h99h9h88 has joined #ruby
yosiat has joined #ruby
charany1 has joined #ruby
SleepySensei has joined #ruby
TurbinGoatFuker has quit [Remote host closed the connection]
Yzguy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<charany1>
hi I am getting undefined method `downcase' for nil:NilClass
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scmx has joined #ruby
Yzguy has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
simplyaubs has joined #ruby
symm- has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
<Croves>
Are simbols (:) like constants in Ruby?
ruby-lang713 has quit [Quit: Page closed]
decoponio has quit [Quit: Leaving...]
_luca_ has quit [Remote host closed the connection]
kirun has joined #ruby
arthurix has quit [Ping timeout: 264 seconds]
cfinley has joined #ruby
JDiPierro has quit [Remote host closed the connection]
<djellemah>
Croves: no. Constants start with [A-Z]. symbols are kinda immutable strings.
luca768 has joined #ruby
momomomomo has quit [Quit: momomomomo]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pkrueger has joined #ruby
<Croves>
djellemah So, what's the purpose of symbols?
<Ox0dea>
djellemah: Not always, on both counts. ^_^
<djellemah>
Ox0dea: No, but close enough for Croves ;-)
<Ox0dea>
Croves: They save time and space when it's only the "identity" of the string that matters, not so much its contents.
<Croves>
Besides for hash keys
<Ox0dea>
Croves: Well, why are they good as Hash keys?
<shevy>
Croves symbols are sort of like a static ruby way to give things a name that will always have the same object_id
<Croves>
Well, they're imutable
<desmondhume>
unique keys? :(
<Croves>
They are also uniques...
<shevy>
a constant in ruby can be changed, a symbol will always be what it is
hxegon_ has joined #ruby
<Ox0dea>
Unless I'm involved.
<shevy>
you should write your own language
<Ox0dea>
I've done so.
<shevy>
what is the name?
<Ox0dea>
It's just Forth with slightly nicer blocks, though.
<Ox0dea>
Stack languages are dead-simple.
<shevy>
and the name?
<Ox0dea>
I won't say.
<shevy>
remember, picking the name is the hardest part
luca768 has quit [Remote host closed the connection]
<shevy>
apeiros named it halsbe but I have noticed that in the last ~10 mentions or so here on #ruby, he has not used that name and instead referred to it as "toy language" :D
luca768 has joined #ruby
<shevy>
there was a crazy guy on #gobolinux who loved forth. I never understood why
<Ox0dea>
It's just very clean.
ekinmur has joined #ruby
hxegon has quit [Ping timeout: 272 seconds]
<Ox0dea>
Concatenation = composition is remarkably elegant.
<Ox0dea>
> do it(*everyone***must***participate***in***forbidden**s*e*x*).
<shevy>
damn lisp
NeverDie has joined #ruby
<Ox0dea>
That's Perl.
howdoicomputer has quit [Ping timeout: 250 seconds]
lazyatom has joined #ruby
RobertBirnie has quit [Ping timeout: 272 seconds]
<lazyatom>
Got a hopefully-quick question about lexical scope, if anyone is around: is the inside of a method body a new lexical scope nested within the class/module that method is defined, or does it share the same lexical scope as the surrounding class/module?
<Ox0dea>
lazyatom: The latter.
<Ox0dea>
But not for local variables.
yardenbar has quit [Ping timeout: 252 seconds]
<shevy>
I swear this exact question has been asked before some days ago
anisha has quit [Quit: Leaving]
RobertBirnie has joined #ruby
maletor_ has joined #ruby
ldnunes has quit [Quit: Leaving]
solocshaw has quit [Ping timeout: 240 seconds]
atomical_ has joined #ruby
<lazyatom>
Ox0dea: thanks!
synthroid has quit [Ping timeout: 244 seconds]
<lazyatom>
I wonder if there's a compelling way of demonstrating that via code examples
<lazyatom>
Ox0dea: right, but I'm not sure that actually concretely rules out that the method doesn't have its own, nested lexical scope
rgtk has joined #ruby
<Ox0dea>
lazyatom: Well, you can't define constants in methods.
<lazyatom>
Since if it did, the constant lookup algorithm would still be able to resolve `FOO`
maletor has quit [Ping timeout: 240 seconds]
infamos has quit [Ping timeout: 240 seconds]
simplyaubs has quit [Quit: simplyaubs]
atomical has quit [Ping timeout: 255 seconds]
<djellemah>
Ox0dea: Is it possible to create a constant without a value? Using normal ruby that is :-p
<Ox0dea>
lazyatom: It doesn't make sense to speak of method-local constants, since they cannot be defined therein, and a method's locals are entirely its own.
jessemcgilallen has joined #ruby
<Ox0dea>
djellemah: As in getting `defined?(FOO)` to return `nil`?
<lazyatom>
Ox0dea: agreed; lexical scope isn't just about constants though. I do appreciate that this is a somewhat abstract question though
<djellemah>
Ox0dea: OK, with that definition.
axsuul has quit [Remote host closed the connection]
<Ox0dea>
djellemah: Well, that's what they do if they've not been defined, otherwise they've got to have some value, even if it's just `nil`.
<lazyatom>
djellemah: I would serious doubt it (assuming you would consider even nil to be a value)
atomical has joined #ruby
<Ox0dea>
djellemah: #const_set can't be coerced into taking just one argument, so I suspect it can't be done from Ruby land.
alem0lars has quit [Remote host closed the connection]
Klumben has quit [Remote host closed the connection]
johnhamelink has quit [Remote host closed the connection]
symm- has joined #ruby
hardcampa has joined #ruby
<Ox0dea>
You could certainly stick `Qundef` in a constant from within a C extension, but that wouldn't go well for very long.
atomical_ has quit [Ping timeout: 255 seconds]
<djellemah>
Never thought about it like this before, but for questions like Croves' the difference is that a constant is lvalue and a symbol is rvalue. Although I'm probably using those terms loosely.
djbkd has joined #ruby
symbol has quit [Quit: WeeChat 1.1]
<Ox0dea>
No, that's about the size of it; I didn't know they'd asked about the difference.
<ruboto>
Ox0dea # => [#<NoMethodError: undefined method `compatible' for Complex:Class>, #<NameError: wrong constant name ...check link for more (https://eval.in/465764)
<Ox0dea>
I'm sure there's a way to get hold of it with Fiddle.
<shevy>
"A nice benefit of working on 10 concurrent projects is that when I feel that one has stagnated I can simply move on to another that motivates me more."
h99h9h88 has quit [Ping timeout: 240 seconds]
<lazyatom>
Ox0dea: are the $~ vars actually part of the lexical scope though, or are they stored in the environment along with local variables?
rbennacer has joined #ruby
<lazyatom>
(I realise that's a little bit of a fuzzy distinction)
<Ox0dea>
And indeed I can't see the line.
devoldmx has joined #ruby
maxz_ has joined #ruby
Croves has joined #ruby
vF3hNGxc47h8 has quit [Read error: Connection reset by peer]
Arkon has quit [Ping timeout: 244 seconds]
gard_ has joined #ruby
J4D has joined #ruby
<Ox0dea>
lazyatom: These are called "virtual" or "hooked" variables, but they're an implementation detail.
<Ox0dea>
For YARV, they're all stored in the same variable table, but they have little tags saying to which object they belong.
Arkon has joined #ruby
slash_part is now known as slash_nick
Coldblackice_ has joined #ruby
syath has quit [Quit: WeeChat 1.2]
devoldmx has quit [Ping timeout: 260 seconds]
Croves has quit [Client Quit]
johnhamelink has joined #ruby
adac has joined #ruby
RobertBirnie has quit [Ping timeout: 240 seconds]
mattwildig has quit [Remote host closed the connection]
<lazyatom>
Doesn't https://eval.in/465768 demonstrate that methods have their own lexical scope/environment then?
chouhoulis has quit [Remote host closed the connection]
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
RobertBirnie has joined #ruby
mikamika has quit [Quit: Page closed]
dikaio has joined #ruby
<lazyatom>
Ox0dea: I suppose what I find difficult about the example - and indeed maybe any example - is that it doesn't demonstrate any kind of lookup that would be using the lexical scope hierarchy. https://eval.in/465783 seems to indicate that there's effectively no relationship between $1 between the class and the method scopes
<Ox0dea>
lazyatom: Methods do have their own scopes; my initial answer was poorly worded.
yardenbar has joined #ruby
<Ox0dea>
Using $1 as an example is a bad idea, since that's a very magical variable.
TPBallbag has quit [Remote host closed the connection]
<Ox0dea>
Methods don't have *independent* scopes; they can't, for instance, define their own constants, and are instead subject to constant resolution starting from the starting class.
kirun has quit [Remote host closed the connection]
Guest53 has joined #ruby
bruno- has joined #ruby
bruno- is now known as Guest20167
jdawgaz has joined #ruby
<newdan>
mallu: Try doing something like stack_name ||= 'NO STACK NAME' before your call to raw_template.result?
<danneu>
mallu: if you `puts binding.local_variables.inspect` above raw_template.result(binding), do you see :stack_name?
<danneu>
this is some solid group effort guys
yfeldblum has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
CodingWolf has joined #ruby
* Dimik
np: The Prodigy - Breathe [05:34m/284kbps/44kHz]
swgillespie has joined #ruby
azure32 has quit [Quit: leaving]
<adaedra>
Dimik: that's not the place for that.
yardenbar has quit [Ping timeout: 250 seconds]
<danneu>
Dimik: doesn't even tell us the encoding?
pu22l3r has quit [Ping timeout: 255 seconds]
leafybas_ has quit [Remote host closed the connection]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Atr3Yu has quit [Quit: Saliendo]
freerobby has joined #ruby
shadoi has joined #ruby
rgb-one has joined #ruby
<rgb-one>
Hey
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mallu>
danneu: I'm getting <main>': private method `local_variables' called for #<Binding:0x00000001469ff0> (NoMethodError)
codeurge has joined #ruby
<Ox0dea>
mallu: Use #send to invoke private methods.
moeabdol has quit [Ping timeout: 244 seconds]
ekinmur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
there's no point
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
cicloid has joined #ruby
<apeiros>
it's irrelevant on which object you call local_variables
<Ox0dea>
But he has a Binding?
<apeiros>
the result will always be the same as it's lexically scoped
<apeiros>
doesn't matter
<rgb-one>
How can I reference the first argument for an application commandline. In this case the argument is an file. I would like to abort with a File not found message to the command line and I would like to mention the file name in the message.
<Ox0dea>
No, I suppose not.
<rgb-one>
How would I achieve this?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
rgb-one: The command line arguments are in ARGV.
rehat_ has quit [Read error: Connection reset by peer]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
oh, actually it seems Binding is an exception
DoubleMalt has quit [Remote host closed the connection]
<Ox0dea>
&ri File.exists? @rgb-one
<`derpy>
No results
<havenwood>
rgb-one: From your terminal try: ruby -e "p ARGV.first" hi there
snockerton has quit [Quit: Leaving.]
<apeiros>
and for binding, it's not private either
<Ox0dea>
adaedra: ?
<adaedra>
wut.
cicloid_ has quit [Ping timeout: 240 seconds]
<Ox0dea>
No results for `File.exists?`?
<havenwood>
&ri File#exist?
<`derpy>
No results
<havenwood>
&ri File.exist?
<`derpy>
No results
<havenwood>
Oh
<adaedra>
That's weird.
<havenwood>
Thought maybe because exists? plural is deprecated, but that doesn't really make sense anyways.
<havenwood>
eam: Object, do you exists? <- how Matz looks at it
<Ox0dea>
adaedra: Well, yeah, it's a core method?
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
Ox0dea: it was worth a try.
<eam>
it should just destructively set itself to nil
<adaedra>
I wonder why yard didn't pick it up.
<havenwood>
yardoc *.c
<rgb-one>
havenwood: The result is nil
EllisTAA has joined #ruby
<havenwood>
rgb-one: It is? :O
<havenwood>
rgb-one: You did verbatim?: ruby -e "p ARGV.first" hi there
<rgb-one>
havenwood: ah
<rgb-one>
havenwood: I left out the hi there
<adaedra>
havenwood: that's what I did.
<havenwood>
rgb-one: Those are the first and second args.
<havenwood>
adaedra: hem...
bb010g has quit [Quit: Connection closed for inactivity]
<rgb-one>
havenwood: Indeed. Thanks.
<adaedra>
havenwood: ?
markao has joined #ruby
<markao>
is there an auto indent script
<havenwood>
adaedra: And stdlib as well?: yardoc -b .yardoc-stdlib -o doc-stdlib
<markao>
i would like to press a key combo and have it indent according to standards
<havenwood>
adaedra: I dunno, my yardoc-fu isn't strong.
ss_much has joined #ruby
<adaedra>
havenwood: `yardoc -n 'ext/**/*.c' 'ext/**/*.rb' 'lib/**/*.rb' *.c`, according to my notes.
<markao>
if it's a js file it will auto indent to js standards, if it's a ruby file it will auto indent to ruby standards, and if it's html it will indent to html standards
<Ox0dea>
markao: Just use a decent editor?
<Ox0dea>
gg=G
<markao>
is there a plugin that does that and what would it be called?
<Ox0dea>
It's called Vim and it does it without a plugin.
<adaedra>
havenwood: but since rubydoc.info doesn't have it, it seems that it would be more a yard bug.
<havenwood>
adaedra: ahhh, interesting
<havenwood>
adaedra: oops!
<markao>
i mean you write some bad indented code and forget to put items in new lines it will scan your file and fix it :)
<haylon>
not getting much of a response to my qeustion in #chef
<havenwood>
markao: Sublime or Atom are newfangled alternatives you might be more comfortable with than the venerable emacs/vim.
<eam>
Ox0dea: oh, no doubts. Read tone as in "what else could it possibly be?"
<craysiii>
exited with error status 1
<Ox0dea>
eam: Oh, right. :P
<eam>
typical of its ilk, etc etc
<Ox0dea>
craysiii: Because eval.in doesn't have Sinatra installed.
<haylon>
Has anyone seen this error before? Chef::PolicyBuilder::Policyfile::UnsupportedFeature: Policyfile does not support override run lists. Use named run_lists instead. I run into it when using `chef-client -z -o cookbook_name -j cookbook_policy.json`.
<Ox0dea>
Note the LoadError.
diegoaguilar has quit [Ping timeout: 240 seconds]
gard_ has joined #ruby
fumk has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
newdan has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
<craysiii>
thats obvious
<craysiii>
i wanted to see the result of it though
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruboto>
craysiii # => /tmp/execpad-fdb9c3a42b87/source-fdb9c3a42b87:2: unterminated string meets end of file ...check link for more (https://eval.in/465849)
<shevy>
I managed to madness myself... I have one .cgi where I somehow end up with: (1) US-ASCII (2) ISO-8859-1 and (3) UTF-8
<adaedra>
I can't evan.
hkumar has joined #ruby
imperator has quit [Quit: Leaving]
rgb-one has quit [Ping timeout: 240 seconds]
<adaedra>
shevy: you mean input?
<craysiii>
i madness myself often
htmldrum has joined #ruby
dhollinger has quit [Ping timeout: 252 seconds]
<adaedra>
They did good songs.
Azure has joined #ruby
<shevy>
adaedra hmm not sure yet ... I need to first find out where and how the other two encodings originate (the middle one is correct, the page itself has # Encoding: ISO-8859-1 so that part is fine)
<eam>
different filesystems can have different encodings
<adaedra>
Even if unicode is pretty standardized nowadays.
kies has quit [Ping timeout: 244 seconds]
<dorei>
Diabolik: maybe, since you're only interested in the count of such numbers and not finding which are these numbers
hkumar has quit [Quit: Leaving]
leafybas_ has joined #ruby
<shevy>
does one of you have an old school .cgi page and could show the output of puts Dir.pwd.encoding.to_s ?
<adaedra>
Ahahah, cgi.
<shevy>
the good old 1995s!
<Diabolik>
i can't think of a better way of doing it
<Diabolik>
dorei there must be a way of knowing that 101 is a palindrome therefore 1001 is and so on
snockerton has quit [Quit: Leaving.]
<eam>
shevy: I would, but /usr/bin/ruby on my system is 1.8.7 and doesn't have an "encoding" method ;-)
<dorei>
Diabolik: 0-9, all numbers are palindromes ie 10 palindromes, 10-99, only numbers like 11, 22, 33, etc are palindromes, ie 10 palindromes
cicloid has quit [Ping timeout: 260 seconds]
lemur has quit [Read error: Connection reset by peer]
<shevy>
eam lol
<dorei>
Diabolik: now we have to contemplate about 3 digit numbers
northfurr has joined #ruby
shock_one has quit [Ping timeout: 260 seconds]
<shevy>
I think it's US_ASCII by default... really weird
cfinley has quit [Remote host closed the connection]
<Ox0dea>
Diabolik: As dorei is hinting, you can do it recursively from the outside in, and memoization will help you avoid doing unnecessary computation.
<dorei>
Diabolik: 100-199 only 101, 111, 121, etc are palindromes, ie 10 palindromes
rgtk has quit [Remote host closed the connection]
Ropeney has joined #ruby
<Ox0dea>
Oh, right, you're only counting them.
<shevy>
weirdness such as
<dorei>
Ox0dea: i'm pretty sure mathematicians could come with something like O(1) :p
<shevy>
cgi/util.rb: case $1.encode(Encoding::US_ASCII)
rgtk has joined #ruby
<dorei>
come up
cicloid has joined #ruby
cicloid has quit [Read error: Connection reset by peer]
<Ox0dea>
molay: But I guess you only want to take them from the outside?
Xeago has quit [Remote host closed the connection]
<molay>
Ox0dea: no removing all is fine with me
<shevy>
eam thanks
<eam>
shevy: there's no reason running it under cgi ought to change its behavior
mary5030 has joined #ruby
* baweaver
cries in corner
<Diabolik>
Ox0dea what is your opinion on the functional solution?
<molay>
Ox0dea: thank you
rgb-one has joined #ruby
riotjones has quit [Ping timeout: 246 seconds]
Arkon has quit [Remote host closed the connection]
<shevy>
now I got rid of the US-ASCII encoding so now it's only UTF-8 versus ISO-8859-1, which I resolved before in the past :)
<adaedra>
by switching to full UTF-8, right?
monod has quit [Quit: Sto andando via]
Arkon has joined #ruby
<shevy>
nah
eminencehc has quit [Remote host closed the connection]
step1step2 has quit [Quit: Leaving]
<dorei>
is there some shortcut for self.class.new ?
guest9000 has joined #ruby
<shevy>
hmm
<shevy>
the hardcoded name :D
<Radar>
dorei: class.new?
mary5030 has quit [Ping timeout: 240 seconds]
cicloid has quit [Read error: Connection reset by peer]
<adaedra>
it takes class as the keyword in this case iirc.
<dorei>
does class.new work? :O
<Radar>
dorei: try
avahey has quit [Quit: Connection closed for inactivity]
<dorei>
it doesn't
guest9000 is now known as step1step2
<Radar>
magic
<dorei>
i get: SyntaxError: unexpected '.'
snockerton has joined #ruby
<Radar>
dorei: Can't reference the class name directly?
<Radar>
Why do you want a shorthand anyway? This reeks of XY
<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
<molay>
Ox0dea: '***molay***'.delete '*' didn't seem to work
Oatmeal has joined #ruby
h99h9h88 has joined #ruby
Alayde has joined #ruby
<dorei>
okie, let me rephrase, i have a class, and from a instance method i want to create a new object from this class, so i use self.class.new from that method, but i wonder if there's a shortcut for that
wldcordeiro has quit [Ping timeout: 246 seconds]
FernandoBasso has quit [Quit: WeeChat 1.3]
<Radar>
dorei: Yes yes we know the solution that you've already made yourself.
<Radar>
But why do you want to do this?
<dorei>
why not?
<shevy>
well self.class.new is quite short already
<dorei>
i dont want to mutate my object
<dorei>
but then OO is about object mutation :p
subscope has quit [Read error: Connection reset by peer]
sevin has quit [Max SendQ exceeded]
hardcampa has quit [Quit: WeeChat 1.3]
<shevy>
you have to call "new" anyway so that part will be invariant, unless you use some other initializor such as []
sevin has joined #ruby
tmtwd has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
Diabolik: You mostly just reorganized it; you didn't change the algorithm in any meaningful way.
<shevy>
he made it prettier!
<Ox0dea>
That he did.
charliesome has joined #ruby
<Ox0dea>
molay: How do you mean?
h99h9h88 has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<molay>
I'm trying to eliminate the asterisks from the item as I add it to the string
symm- has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
yqt has joined #ruby
northfurr has quit [Quit: northfurr]
EllisTAA has joined #ruby
Yzguy has quit [Client Quit]
<Ox0dea>
molay: Use #delete! to modify the string in-place.
<Ox0dea>
It only worked here because ruboto displays the result of the last evaluation.
user1138 has joined #ruby
user1138 has quit [Remote host closed the connection]
<molay>
Ox0dea: omg.. duh
Steve_Jobs has joined #ruby
<molay>
Ox0dea: perfect. thank you
<Ox0dea>
molay: Happy to help.
hxegon has quit [Read error: Connection reset by peer]
Dimik has quit [Ping timeout: 260 seconds]
<molay>
Ox0dea: I should have caught that.. i need some food!
<Ox0dea>
molay: Drink some water too.
SCHAAP137 has quit [Quit: Leaving]
<molay>
haha for sure
<missinghandle>
hi everyone - anyone here familiar with the mutant gem?
ni291187 has joined #ruby
<missinghandle>
Not sure how to interpret all the output
<missinghandle>
specifically the Killtime and Overhead fields, among other things.
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has quit [Remote host closed the connection]
hxegon has joined #ruby
djbkd has joined #ruby
karapetyan has joined #ruby
<molay>
Ox0dea: ok since you've been so helpful, here's one more question.. assuming a similar input, suppose I have a name like "Dharmendra "Dan" Prasad"... how would i replace "Dan" with \"Dan\" ?
raldu_ has joined #ruby
<molay>
Ox0dea: to add some context, i'm building this string to use in a sqlite3 INSERT parameter
cicloid_ has joined #ruby
<molay>
Ox0dea: so it's being very picky about my string
cicloid_ has quit [Read error: Connection reset by peer]
Rutix has quit []
charliesome has joined #ruby
<dorei>
molay: why not use an ORM ?
freerobby has quit [Quit: Leaving.]
cicloid has quit [Ping timeout: 240 seconds]
zeroDivisible has quit [Quit: WeeChat 1.3]
zeroDivisible has joined #ruby
Guest53 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]