<lucz>
Nilium: yeah it's the right path when I run which clang
<Nilium>
Also try running `xcode-select --install` and see if reinstalling commandline tools works.
<RickHull>
are you still missing xcrun ?
<RickHull>
I'd go top down and try to make sure all the normal osx dev tools are happy
<RickHull>
if you're still getting errors about missing tools, then try to figure out why your tools are missing ;)
alnewkirk has joined #ruby
<Nilium>
That's actually harder than it sounds
<RickHull>
i was going to suggest the Feynman Problem Solving Method next
<Nilium>
Usually just easier to force reinstallation of things.
<RickHull>
step 1. write the problem down step 2. think really hard step 3. solve it
<lucz>
Okay, it's downloading/installing command line tools. There doesn't seem to be a CommandLineTools directory under /Library/Developer
<lucz>
lol RickHull
<Nilium>
I like to subsitute #2 with "ask the fairies in the back yard"
<RickHull>
sometimes step 3 is formulated as: write down the solution
<RickHull>
if you're still not getting the CommandLineTools where expected, then you can search for: why is $X looking for my stuff there? or why isn't $Y putting my stuff there?
<RickHull>
but probably the top down / install / update approach will work
<Nilium>
In unrelated news, I've been trying to collect more programming / systems books and it turns out they're all really expensive because they're used as textbooks.
<RickHull>
i'd think you can get them used cheaply, particularly prior versions
<Nilium>
I might have to mug students for their books next.
<Nilium>
Latest book was $160 -- found it used for $33, though there aren't a lot of copies of it.
mson has quit [Quit: Connection closed for inactivity]
<lucz>
yayy
<Nilium>
Guessing it's working now?
<lucz>
This --> xcode-select --install fixed it
<lucz>
Thank youuu!
<Nilium>
Coolbeans.
<lucz>
:)
cdg has joined #ruby
alnewkirk has quit [Ping timeout: 268 seconds]
ap4y has quit [Quit: WeeChat 1.9.1]
sneep_ is now known as sneep
ap4y has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
lucz has quit [Remote host closed the connection]
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
c0ncealed has quit [Remote host closed the connection]
c0ncealed has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
eblip has joined #ruby
eb0t_ has joined #ruby
alnewkirk has joined #ruby
GodFather has quit [Ping timeout: 258 seconds]
eb0t has quit [Ping timeout: 248 seconds]
def_jam has quit [Ping timeout: 268 seconds]
lucz has joined #ruby
lxsameer has quit [Quit: WeeChat 1.9.1]
PaulCape_ has quit [Read error: Connection reset by peer]
marr has quit [Ping timeout: 260 seconds]
alnewkirk has quit [Ping timeout: 248 seconds]
shortdudey123 has quit [Ping timeout: 240 seconds]
lucz has quit [Remote host closed the connection]
shortdudey123 has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
cschneid_ has joined #ruby
hinbody has quit [Read error: Connection reset by peer]
hinbody has joined #ruby
PaulCapestany has joined #ruby
lucz has joined #ruby
ResidentBiscuit has quit []
jottr has joined #ruby
alfiemax has joined #ruby
sioux has joined #ruby
<sioux>
i i'm using Debian 9, Apache, MySQL(Mariadb) server, Redmine 3.4.3., ruby 2.3.3p22. When i try install a new pluging, download the plugin redmine_checklists, into /opt/redmine/plugins/, and try " bundle exec rake redmine:plugins:migrate RAILS_ENV=production" show this error: https://pastebin.com/vQz234Ya
<noizex>
is checking for respond_to? on every corner make sense?
creat has joined #ruby
tcopeland has joined #ruby
ta has joined #ruby
<mikecmpbll>
why are you trying to check?
hahuang65 has joined #ruby
r3QuiEm_cL has joined #ruby
<mikecmpbll>
it's not typical to check an object's capabilities if that method only handles one set of capabilities, if the object doesn't meet the expectations of the method you'll get an exception.
darkmorph has joined #ruby
mensvaga has quit [Remote host closed the connection]
mson has joined #ruby
dkam__ has joined #ruby
faces has joined #ruby
uZiel has quit [Ping timeout: 268 seconds]
<matthewd>
+1 the most rubyish way to do that is not to do that
r3QuiEm_cL has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sylario has joined #ruby
nofxx has joined #ruby
shinnya has joined #ruby
synthroid has joined #ruby
GodFather has joined #ruby
jphase has joined #ruby
<noizex>
ok
<noizex>
so we just push that weight on the caller
<noizex>
sounds fine to me, as it becomes madness if you start checking for these things
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
<dminuoso>
noizex: For what its worth, there's a library called `rdl` that gives you type inference based static typing.
ramfjord has joined #ruby
<noizex>
hehe didn't know about it, thanks
cschneid_ has joined #ruby
<noizex>
won't be using it but interesting to see this in Ruby
<dminuoso>
(Well its mixed dynamic and static even)
<dminuoso>
Yeah.
<dminuoso>
I had that exact same thought. ;-)
<noizex>
to be honest I liked Ruby 12 years ago for small apps, now I ended up working for 500k line of code project
<noizex>
and I'm just terrified
<noizex>
I can't reason about this code at all it would seem
eb0t has joined #ruby
eblip has joined #ruby
def_jam has quit [Ping timeout: 248 seconds]
eb0t_ has quit [Ping timeout: 260 seconds]
<dminuoso>
noizex: I've had a major ruby break that lasted for maybe 9 months, in which I started to learn JS with Flow and Haskell. It was very difficult to return to this dynamic and duck-typed environment. :(
alex`` has quit [Quit: WeeChat 1.9.1]
ramfjord has quit [Ping timeout: 240 seconds]
<matthewd>
dminuoso: We've noticed :trollface:
<noizex>
hehe
<dminuoso>
matthewd: What can I say. Have you seen my take on van Laarhoven lenses earlier? :P
<dminuoso>
I even changed all camelCase to snake_case because you made fun of me the last time.
milardovich has joined #ruby
<matthewd>
hahaha
<matthewd>
\o/ success
cabotto has joined #ruby
alfiemax has quit [Remote host closed the connection]
milardov_ has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
<matthewd>
dminuoso: class Module; def spicy_method(name, &body); define_method(name) {|*args| body.curry[*args] }; end; end
<dminuoso>
Mmmm, oh yeah. That one was too obvious. :P
<dminuoso>
I love the name.
<matthewd>
class Module; def spicy_method(name, &body); body = body.curry; define_method(name) {|*args| body[*args] }; end; end
c0ncealed has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Serpent7776 has quit [Quit: Leaving]
c0ncealed has joined #ruby
karapetyan has joined #ruby
chmurifree has quit [Ping timeout: 240 seconds]
troys_ is now known as troys
karapetyan has quit [Ping timeout: 264 seconds]
guardian has joined #ruby
conta1 has joined #ruby
<guardian>
hello, I'm looking for an elegant/idiomatic of converting an array of strings and hashes into another array, where flat strings are grouped. Since I'm not sure how to express it I created a paste: https://paste.debian.net/994433/
kies has quit [Ping timeout: 248 seconds]
chmurifree has joined #ruby
John___ has quit [Read error: Connection reset by peer]
chouhoul_ has quit [Remote host closed the connection]
aufi has quit [Quit: Leaving]
Silox| has quit [Quit: Connection closed for inactivity]
mark_66 has quit [Remote host closed the connection]
Beams has quit [Quit: .]
hahuang65 has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 268 seconds]
<dminuoso>
Oh oh!
orbyt_ has joined #ruby
<dminuoso>
This is the moment to bring in a rarely known ruby secret, guardian!
<baweaver>
If I look back far enough I'd replied to one of avdi's tweets showing you could use flip-flops to tokenize HTML :D
<RickHull>
dminuoso: can I get an honorable mention? ability: :holds_breath
Quentinius has joined #ruby
<dminuoso>
RickHull: Oh. Why are you still typing?
<dminuoso>
Shouldn't you be dead? :(
claudiuinberlin has joined #ruby
<RickHull>
i passed out and the limbic system took over :)
hays has quit [Quit: No Ping reply in 180 seconds.]
micalexander__ has joined #ruby
<dminuoso>
You need to meditate more often so that you can die when others require it of you.
malice` has joined #ruby
<RickHull>
we have all died a thousand deaths
<RickHull>
or something
<malice`>
Hi! Noob question here - in Ruby, everything's an object, and every function is a method, right?
<malice`>
On what object is puts called?
<malice`>
Or is it a static method of some object?
<Papierkorb>
`Kernel`
<elomatreb>
It's turtles all the way down
ramfjord has joined #ruby
<dminuoso>
malice`: On the main object
hays has joined #ruby
hays has quit [Changing host]
hays has joined #ruby
<dminuoso>
malice`: which itself (through ancestory) passes it on to the module Kernel
Quentinius has quit [Client Quit]
<RickHull>
Kernel is the default receiver, I believe
chouhoul_ has joined #ruby
<dminuoso>
RickHull: Nope.
<elomatreb>
Methods without an explicit receiver are called on self, which usually involves the Kernel module somewhere
<Papierkorb>
dminuoso: Nope, `#puts` in a method is called on implicit-self
<dminuoso>
RickHull: If that was the case, you would have to invoke it as Kernel.puts.
<malice`>
dminuoso: Can I somehow check this in Ruby? Like class_of(:puts)
<elomatreb>
method(:puts)
<RickHull>
malice`: I like to call $stdout.puts and $stderr.puts
<dminuoso>
asm>> puts "foo"
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894076
<dminuoso>
Papierkorb: ^-
<dminuoso>
Papierkorb: as you can see `self` is the receiver
<dminuoso>
which outside method scope defaults to the main object
<Papierkorb>
dminuoso: Of course, if you call it on the toplevel
<malice`>
Thanks!
<malice`>
That's useful
<dminuoso>
malice`: Also note, there's tiny bits and pieces that are not objects
<dminuoso>
Blocks and variables for examples
<elomatreb>
Even more useful when working with library code is that you can call .source_location on the result of that method(:something)
<dminuoso>
Though the former can trivially be turned into an object
<dminuoso>
(The fact that blocks are not an object is actually just an optimization for Proc)
mjolnird has quit [Quit: Leaving]
<dminuoso>
18:54 Papierkorb | dminuoso: Nope, `#puts` in a method is called on implicit-self
<dminuoso>
I just understood what you meant by that
<dminuoso>
My head was completely twisted.
<dminuoso>
baweaver: what useful optics would you like to see in ruby lenses?
<dminuoso>
First I mean
<dminuoso>
traversals? query adapters?
chouhoulis has quit [Ping timeout: 260 seconds]
<dminuoso>
*query? adapters?
mjolnird has joined #ruby
mjolnird has quit [Max SendQ exceeded]
<dminuoso>
Folds?
mikecmpbll has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
hays has quit [Quit: No Ping reply in 180 seconds.]
bmurt has quit [Ping timeout: 240 seconds]
<guardian>
I came up with .chunk { |e| e.is_a?(String) }.to_a.map { |e| e[0] ? { :nil => e[1] } : e[1] }.flatten
<guardian>
what do you think?
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr__ has quit [Ping timeout: 240 seconds]
hays has joined #ruby
hays has quit [Changing host]
hays has joined #ruby
kishmesh has joined #ruby
<dminuoso>
guardian: I'd say there's no chance you even tried this.
<dminuoso>
You'll see why if you try to.
ramfjord has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
jackjackdripper1 has joined #ruby
jackjackdripper1 has quit [Read error: Connection reset by peer]
jackjackdripper1 has joined #ruby
<kishmesh>
hi there. i'm looking for something like an "OrderedSetQueue", a FIFO Queue, that is threadsafe and does not accept duplicates. I couldn't find anything like this in standard Ruby libary nor on the net. So I'd have to self implement or what can you suggest?
<guardian>
dminuoso: it works
jackjackdripper has quit [Ping timeout: 248 seconds]
kies has joined #ruby
<dminuoso>
kishmesh: concurrent-ruby is kind of the de-facto library for multithreading containers, it brings a threadsafe Array that can be trivially used.
jackjackdripper1 has quit [Read error: Connection reset by peer]
<dminuoso>
This is how you write methods by the way.
<baweaver>
dminuoso: shoot him a link too
<dminuoso>
Autocurrying first-class methods.
karapetyan has joined #ruby
<cagomez>
if I create different procs a,b,c calling the same method foo, and foo memoizes @bar... will a,b,c each have a unique method foo, and thus a need to memoize @bar for every unique method foo?
<RickHull>
cagomez: show an example with actual behavior vs expected behavior
<RickHull>
it took forever to load and just has method definitions. no behavior
<RickHull>
unless you just updated it :)
enterprisey has joined #ruby
<dminuoso>
cagomez: Also your testcase is not self contained. The db_calls method is not defined.
jackjackdripper1 has quit [Ping timeout: 240 seconds]
<cagomez>
so I'm wondering if do_stuff maps over items, and each item should call a Proc which calls _bar, if @res will be computed for each item
<dminuoso>
And Im unsure why you have also shown foo and do_stuff. Are they related?
<dminuoso>
Is this supposed to be part in module (included into a class) or a class itself?
<dminuoso>
Please make a working testcase.
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
jrafanie has joined #ruby
crova has joined #ruby
<dminuoso>
Also *cry* that you cant do (++ '!!!') :(
hinbody has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
<crova>
Greetings everyone. Does anyone know a gem/app that can validate emails through a csv file?
kishmesh has left #ruby ["WeeChat 1.6"]
hinbody has joined #ruby
hackeron_ has quit [Read error: Connection reset by peer]
workmad3 has quit [Read error: Connection reset by peer]
RickHull has quit [Ping timeout: 260 seconds]
<dminuoso>
"validate emails through a csv file" ?
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
bmurt has quit [Ping timeout: 240 seconds]
<dminuoso>
How would that work?
workmad3 has joined #ruby
conta2 has joined #ruby
hackeron has joined #ruby
<SeepingN>
likely would not
conta1 has quit [Ping timeout: 250 seconds]
mjolnird has joined #ruby
<crova>
I got csv files that have multiple data (name, email and other info). Before accepting the whole data from a single row I want to validate the email
mjolnird has quit [Max SendQ exceeded]
<crova>
if it is a possible one (johndoe@gmal.com does not pass, johndoe@gmail.com passes)
bmurt has joined #ruby
<dminuoso>
crova: do a DNS lookup and check for MX record presence?
<dminuoso>
Im not an expert whether thats enough though.
ramfjord has joined #ruby
<baweaver>
make sure to cache if you do
<crova>
dminuoso, this would be the best of the options to be honest
<apeiros>
MX, A, AAAA
<crova>
I would settle for a valid format though
<apeiros>
that only tells you whether the domain exists and might accept emails
ur5us has quit [Ping timeout: 240 seconds]
<baweaver>
ooo, we're doing IPv6?
Diogo has quit [Quit: Connection closed for inactivity]
hackeron has quit [Read error: Connection reset by peer]
* dminuoso
hides
workmad3 has quit [Read error: Connection reset by peer]
hackeron has joined #ruby
<RickHull>
crova: my comment was somewhat in jest and I meant to follow it up more helpfully. but freenode disconnected me, and is still pretty messed up for me right now
Guest73_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ney has joined #ruby
<cr3>
when I "bundle exec rake test", for example, does it look for a Gemfile(.lock) in all the parent directories? bundle exec --help seems to have just one option, --keep-file-descriptors, so is there a way to see what it's actually doing?
<dminuoso>
cr3: This should be easy to test.
alfiemax has quit [Remote host closed the connection]
<dminuoso>
cr3: Also I could not reproduce your issue.
<dminuoso>
So I suggest you: create a fresh directory, clone the repo (do not copy, I dont trust your old repo), checkout the revision, bundle install, and run the testsuite
<dminuoso>
If you then still have the issue, then we can talk. :p
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta has joined #ruby
milardovich has quit [Remote host closed the connection]
<cr3>
dminuoso: I can't reproduce with pristine upstream so I'm still trying to troubleshoot my setup. if the only solution to troubleshooting this problem is delete everything and try again, that's a bit sad :(
<dminuoso>
cr3: diff pristine upstream against your directory.
<cr3>
dminuoso: it's something to do with the environment, like maybe the directory where it's running for example, hence my question about bundler maybe recursing up parent directories. is there no way to get any visibility into what bundler does?
<dminuoso>
Bundler does magic™
Ney has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
cr3: that answer is almost certainly documented or easily testable
^mtkd has quit [Ping timeout: 264 seconds]
<cr3>
RickHull: I tried bundler exec --help but maybe the source is the documentation :(
<RickHull>
at the risk of being uncharitable, I think the "l" is misplaced in "bundler"
dionysus69 has quit [Ping timeout: 246 seconds]
<RickHull>
it solves/solved some important problems, particularly for rails projects
<RickHull>
but I don't think it should be as ubiquitous as it is now
jrafanie has joined #ruby
mtkd has joined #ruby
<cr3>
I tried removing the Gemfile in ../../.. but now bundle exec rake test says the file is "not found", so bundle was recursing to the top-most directory with a Gemfile rather than first directory with a Gemfile, like ../Gemfile. interesting and confusing at the same time :)
<miah>
iirc, bundler only searches the local directory for a Gemfile.lock.
<miah>
right, the project-root
<cr3>
miah: my cwd doesn't have a Gemfile.lock but I had a ../Gemfile.lock and ../../../Gemfile.lock. after deleting the latter one, that's when I now get "not found". I'm getting somewhere, just a bit more digging :)
<miah>
weird
<miah>
good luck =)
<cr3>
miah: I'll share my findings as soon as I find something, this spelunking is intriguing :)
<RickHull>
it took 2 minutes to confirm `bundle exec` will look to the parent dir for a Gemfile
<RickHull>
relative to CWD
<miah>
ya
<miah>
if you're execing in a sub-directory of a project root that makes sense
<miah>
if your project is missing a Gemfile or a gemspec i can imagine bundler would be like 'whats my job here?'
<cr3>
Let's say I'm in the directory /app/tmp/rails-4-2-stable-mri-2.4.1/activejob, typing bundle env returns "No such file or directory @ rb_sysopen - /app/Gemfile", so how does bundle decide to look for the Gemfile all the way in /app? I tried running the command with strace -e trace=open but I can't figure this out :(
cagomez has joined #ruby
lucz has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<RickHull>
i think it just recurses upwards until /
<RickHull>
maybe it quits before / :)
orbyt_ has joined #ruby
<cr3>
RickHull: I do have /app/tmp/rails-4-2-stable-mri-2.4.1/Gemfile though
Technodrome has joined #ruby
<cr3>
RickHull: also, I find it weird that it recurses until one-directory-before-root :/
<RickHull>
that seems pretty weird then. see if you can replicate it as in my gist
<RickHull>
like with a toy example
<RickHull>
cr3: one plausible explanation is that / should not contain files, let alone user files
<cr3>
what the heck is the Gemfile doing hard-coded in a bin!
<RickHull>
that is almost certainly related
<cr3>
I've seen this before in python venvs so maybe /usr/local/bundle is a kind of venv, now I'm getting somewhere :/
<RickHull>
definitely a question for #bundler, you won't get a charitable answer from me
milardovich has quit [Remote host closed the connection]
<RickHull>
not to preempt anyone else here who can explain. don't all speak up at once :)
milardovich has joined #ruby
weaksauce has joined #ruby
DWSR has joined #ruby
cagomez has joined #ruby
nofxx has joined #ruby
cdg has joined #ruby
uZiel has quit [Ping timeout: 240 seconds]
<DWSR>
Hey all, I'm trying to rewrite the Dockerfile of my company's app to slim down the images from 1.75GB (>.<). I'm doing OK so far, but am running into an issue with trying to get json-1.8.3 into the image without install make, etc. Anyone have suggestions on an approach here? I'm basing off of the ruby Alpine image.
<dminuoso>
DWSR: What issue is that?
<dminuoso>
DWSR: And why dont you want to build json in the docker container?
karapetyan has quit [Remote host closed the connection]
<DWSR>
dminuoso: The issue is "Why the hell do I want build tools in my images?"
<nofxx>
DWSR, can help with the keywords to goog: 'precompiled linux gem' , or install and them remove devtools
cdg_ has quit [Ping timeout: 240 seconds]
<nofxx>
then*
<dminuoso>
DWSR: Because Ruby uses native extensions?
karapetyan has joined #ruby
cagomez has quit [Ping timeout: 246 seconds]
alex`` has quit [Ping timeout: 250 seconds]
cdg has quit [Ping timeout: 268 seconds]
<dminuoso>
I mean Im just trying to understand your reasoning.
dinfuehr has quit [Ping timeout: 255 seconds]
micalexander_ has quit []
micalexander_ has joined #ruby
<RickHull>
i think the basic idea is that the build can happen "offline" and that you don't build on the production target platform
<DWSR>
dminuoso: I'm not arguing against native extensions. I'm just kind of confused as to the fact that I'm building it from source as opposed to getting something like a Python wheel.
dinfuehr has joined #ruby
micalexander_ has quit [Client Quit]
troulouliou_div2 has joined #ruby
micalexander has joined #ruby
<dminuoso>
DWSR: Ruby comes with a different json version out of the box (2.1.0 I believe)
<dminuoso>
DWSR: So if you have something that specifically needs 1.8.3 for some reason, well then it has to be compiled.
<DWSR>
nofxx: So if I do `bundle install devtools` then install from the Gemfile then `bundle remove devtools`, this should work?
<dminuoso>
DWSR: You will still have those layers.
<dminuoso>
Or I guess if you do this in a single step, it could
<DWSR>
A single RUN, right?
<dminuoso>
Yeah
<DWSR>
Hrm.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nofxx>
DWSR, no, by 'devtools' I mean your OS package with gcc & friends
<dminuoso>
alpine-sdk would be a kind of equivalent
<nofxx>
package group*
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
fmcgeough has joined #ruby
<DWSR>
yeesh. 333MiB in packages. Luckily this should be slimmer though
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DWSR>
We'll see. Looks like compilation is going through.
<DWSR>
Hope I don't get burned by the differences in libc, but who knows?
tomphp has joined #ruby
chouhoulis has joined #ruby
impermanence has joined #ruby
s3nd1v0g1us has joined #ruby
nofxx has quit [Remote host closed the connection]
orbyt_ has joined #ruby
<RickHull>
what's the big picture for deploying ruby artifacts? can "binaries" possibly be shipped or is always inherently source code, particularly in the case of extensions which are built at install time?
<RickHull>
does mruby offer a different model?
nofxx has joined #ruby
eckhardt has joined #ruby
Devalo has joined #ruby
<RickHull>
BTW, by "binaries" I don't mean shipping the ruby interpreter + source code :)
<RickHull>
I would expect you ship the platform guts onto something like Alpine, then you ship your application artifact. like the java model or whatever
wald0 has quit [Quit: Lost terminal]
<RickHull>
building on the production runtime platform is icky
ap4y has joined #ruby
Devalo has quit [Ping timeout: 240 seconds]
blackmesa1 has quit [Ping timeout: 246 seconds]
weaksauce has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
yabbes has joined #ruby
darix has quit [Quit: brb]
jmusits has joined #ruby
cagomez has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
michael1 has quit [Ping timeout: 240 seconds]
troulouliou_div2 has quit [Read error: Connection reset by peer]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 268 seconds]
jmusits has quit [Quit: leaving]
arquebus has joined #ruby
DWSR has quit [Ping timeout: 260 seconds]
kozrar has joined #ruby
michael1 has joined #ruby
kozrar has quit [Remote host closed the connection]
kozrar has joined #ruby
michael1 has quit [Ping timeout: 250 seconds]
thuryn has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
_whitelogger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
synthroid has quit []
eb0t has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eblip has joined #ruby
eb0t_ has quit [Ping timeout: 240 seconds]
Tagami[m] has joined #ruby
reber has quit [Quit: Leaving]
def_jam has quit [Ping timeout: 268 seconds]
alan_w has joined #ruby
<thuryn>
ugh. okay i'm a long-term perl scripter, but still a novice with Ruby, and i need to do a DNS lookup
<thuryn>
and I can't quite figure it out
eclm has quit [Ping timeout: 264 seconds]
<thuryn>
i need to look up the SOA record for the zone that an address falls within. most of the time, you can just look up the SOA for the address itself, and you'll get the SOA record for the "deepest" reverse zone that it belongs to
<thuryn>
i don't see how i can confirm the name of the zone that it fell into.
<RickHull>
this is over my head as far as DNS goes. what methods are you looking at?
kozrar has quit [Quit: Leaving]
kozrar has joined #ruby
GodFather has quit [Read error: No route to host]
<RickHull>
can you write a quick example script with this lib, that shows basically what you want to do, against say a google IP address or something?
GodFather has joined #ruby
<RickHull>
something trivial that works as expected
orbyt_ has joined #ruby
<dminuoso>
RickHull: I lied.
<dminuoso>
RickHull: An unordered set is of course a proper Functor.
<dminuoso>
I might have been slightly drunk that evening.
<RickHull>
samesies
<RickHull>
i got a little lost in functors vs endofunctors vs monads
<dminuoso>
Just remember as far as programmers are concerned, endofunctors are functors.
<RickHull>
ah, ok
<RickHull>
my FP abilities (and abilities in general) wither quickly when not in use
<RickHull>
I'm sort of trying to reboot that :)
<RickHull>
as far as that goes, I have lots of tiny independent modules here: https://github.com/rickhull/compsci I'd be interested in a concrete example of translating to a more FP style
<dminuoso>
Well, basically ignoring more exotic cases, any type of container that you can map over (and get the same type back, yes Im looking at you Range) is a functor.
<RickHull>
lambdas etc
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
yabbes has quit [Quit: lu]
<dminuoso>
RickHull: Great stuff. You could turn Node into an (identity) functor, and those trees in proper functors. Quite trivially.
<dminuoso>
Just implement #map for each one of them. :)
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
darix has joined #ruby
<RickHull>
see also the refactor branch; i'm starting to get annoyed with inheritance handcuffs for various node semantics
<RickHull>
the names module is really simple, but it feels a little hacky
chouhoulis has quit [Remote host closed the connection]
cdg has joined #ruby
<dminuoso>
RickHull: [*'A'..'Z'] is probably better written as ('A'..'Z').to_a
<RickHull>
ok, yeah. i stole that from some stackoverflow code golf
<dminuoso>
Heh
<RickHull>
i imagined it wouldn't create as many objects
<dminuoso>
It's not a big deal. It just looks a bit cleaner thats all.
brent__ has joined #ruby
<baweaver>
It's slower as well iirc
<RickHull>
i'll take clarity of expression over trivial performance
<RickHull>
see Names::Greek -- that's where it gets a little hairy
<baweaver>
ok, so maybe little to no measurable difference
<dminuoso>
asm>> [*'A'..'Z']
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894164
<dminuoso>
asm>> ('A'..'Z').to_a
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/894165
<dminuoso>
Wow.
<dminuoso>
baweaver: That is optimized away at compile time.
<dminuoso>
That explains why.
<baweaver>
Looks like it
<RickHull>
are real and wall times meaningful there?
<baweaver>
that said, it's way different for array concats
<dminuoso>
baweaver: And since we just do this once, the splat will be faster since no method lookup has to be done (which would be uncached for the first)
<baweaver>
<< is faster than push is faster than concat is faster than splat
<dminuoso>
So this proves, [*a..b] is the way to go.
<RickHull>
noo, the darkside is winning
<baweaver>
I think + was vaguely around concat's time
<baweaver>
though this assumes single value addition
<dminuoso>
baweaver: I wish we had ++.
<dminuoso>
Buuut.. I guess I should accept that Ruby is not Haskell.
<baweaver>
which means that concat and + get an extra array init
* dminuoso
goes back writing lenses
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
arquebus has quit [Quit: konversation disconnects]
milardovich has joined #ruby
vee__ has quit [Ping timeout: 252 seconds]
<baweaver>
dminuoso: you could always join me and teach the masses programming with adorable coding Lemurs
Psybur has quit [Ping timeout: 250 seconds]
goyox86 has quit [Quit: goyox86]
goyox86 has joined #ruby
<thuryn>
RickHull, the problem is, i've never used it before, so i don't have anything that works yet. :P
mim1k has joined #ruby
<thuryn>
all i have to compare to is the output from the command-line utility 'dig'
<RickHull>
thuryn: start with something trivial before getting to the hard stuff
<RickHull>
e.g. use the Resolv lib to get an ip address for 'google.com'
<thuryn>
oh i know how to do THAT
<RickHull>
ok, so let's see a working example for something close to your problem
<RickHull>
but without getting into the deep zone stuff or whatever
<thuryn>
the problem is, with a normal DNS lookup, you know the thing you're looking up
<thuryn>
like "google.com"
<RickHull>
yeah, i'm unsure about SOA records
<RickHull>
and anything getting into recursive/authoritative/zone stuff is not intuitive to me
<RickHull>
aside from the very basics
<thuryn>
in this case, i'm looking up, say, 36.9.217.172.in-addr.arpa, but i'm going to get back 9.217.172.in-addr.arpa (missing the "36" in this case)
milardovich has quit []
vee__ has joined #ruby
<thuryn>
it's like this: imagine you did a lookup for the IP address of "www.google.com" but when the answer came back, it says "google.com is 8.8.8.8"
<thuryn>
(note that the "www" is missing in the answer)
<RickHull>
with you so far
<thuryn>
so the "google.com" is the "name" part of the record you get in return
goyox86 has quit [Remote host closed the connection]
<thuryn>
i need to see where that is in a Resolv::DNS::Resource object
goyox86 has joined #ruby
Technodrome has joined #ruby
<thuryn>
because the answer is highly likely to not exactly match the question
mim1k has quit [Ping timeout: 248 seconds]
<thuryn>
(when you query for SOAs, you basically get the "closest match")
<RickHull>
ok, makes more sense now
<RickHull>
I see the resource represents the query
<RickHull>
does it also represent the response?
tcopeland has quit [Quit: tcopeland]
<RickHull>
apologize if i'm misusing DNS-specific terms. I mean in the general sense, where your query would be 36.9 and the response would be 9.217
<thuryn>
well, i see it has attributes for the TTL (inherited) as well as MNAME and so on, all parts of the "right hand side" of the SOA record. so it has details from the response.
<RickHull>
ok
<thuryn>
i just don't see where it has the name of the record itself. it seems to be assumed that the name of the record is still the thing you asked for. or i'm not looking in the right place. :/
<RickHull>
I believe this ruby lib is going to be a thin wrapper around the standard C resolv lib
<RickHull>
one thing that can help for this is using pry as a REPL (irb is the default REPL)
goyox86 has quit [Remote host closed the connection]
<RickHull>
familiar with REPLs?
<thuryn>
with Perl, I could use "Data::Dumper" to have it spew out all of the different characteristics of an object like this.
<RickHull>
yes, pry will give you something similar but interactive
goyox86 has joined #ruby
<thuryn>
no, i'm afraid not. at least, not by that name. i've used irb before.
<RickHull>
though you don't need pry for Dumper functionality
<thuryn>
(it has been a while.)
<RickHull>
Read Eval Print Loop -- the interactive version of the interpreter
<RickHull>
anyway, pry is like irb on steroids with introspection and live debugging
<thuryn>
ah, okay. a "shell" for the interpreter. (using the term loosely)
<RickHull>
`ruby` wants a source file. `irb` waits for expressions and shows their evaluation result
enterprisey has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
i can't think what the most faithful version of a ruby dumper is. maybe 'pp' or 'awesome_print'
<RickHull>
'pp' is in stdlib (pretty print)
PaulCape_ has quit [Read error: Connection reset by peer]
aeaeaeae1 has joined #ruby
<thuryn>
i'm going to try 'pp' and see if i don't learn something,
<thuryn>
the built-in resolver doesn't work the same way as some others do. if there isn't an SOA record EXACTLY like what I asked for, it doesn't do "best match." it just returns zilch.
DTZUZU has quit [Ping timeout: 240 seconds]
<thuryn>
so i'll have to pop off the last element and try again until i get an answer (or I run into 'in-addr.arpa')
Psybur has joined #ruby
troys has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<thuryn>
okay stupid ruby question. this is one of the attributes of the object that is returned: @expire=604800
<thuryn>
how do i reference that so that i get "604800"?
vee__ has joined #ruby
<thuryn>
i tried soa_record.expire but that just gave me "undefined method"
<thuryn>
oh! it's a list!
<thuryn>
soa_record[0].expire <- ta da!
Tagami[m] has quit [Read error: Connection reset by peer]
goyox86 has quit [Remote host closed the connection]
jdawgaz has joined #ruby
<apeiros>
thuryn: note, @expire is an instance variable. you always need a method to access instance variables from outside.
<baweaver>
Also, for some completely unrelated reason you can normally find me around Lemur exhibits at the Oakland Zoo on weekends with a sketchpad
Psybur has quit [Ping timeout: 248 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
Coming up close on 7k words for the initial draft of "An Illustrated Guide to Ruby"
<baweaver>
Need to refine the ToC a bit and get at least three solid chapters out before it comes up live on Github
alan_w has quit [Ping timeout: 250 seconds]
jdawgaz has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
apeiros_ has joined #ruby
apeiros_ is now known as apeiros
sucks has joined #ruby
<RickHull>
baweaver: awesome. 7k words in 3 chapters?
<baweaver>
Across more than a few
<baweaver>
I basically started filling out sections as it occurred to me
jenrzzz has quit [Ping timeout: 264 seconds]
cr3 has quit [Quit: leaving]
<baweaver>
Need to refine in at least 3 and get that out first
<RickHull>
that's as good a way as any, I figure. strike while the iron's hot
<baweaver>
Reviewers welcome :)
<baweaver>
Naturally credit extended in the mentions. May well end up doing a LYAH type deal where I have it online for free and publish a paper version
__main__ has quit [Read error: Connection reset by peer]
aeaeaeae1 has quit [Ping timeout: 240 seconds]
_main_ has joined #ruby
impermanence has quit [Ping timeout: 240 seconds]
troys is now known as troys_
<RickHull>
the old pickaxe model worked pretty well I think
<RickHull>
the first version was free
<RickHull>
or write a 5 chapter core, published for free
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_main_ is now known as __main__
<RickHull>
(and updated for free)
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<RickHull>
published == online there
naprimer2 has joined #ruby
orbyt_ has joined #ruby
naprimer has quit [Ping timeout: 240 seconds]
troys_ is now known as troys
Tagami[m] has quit [Remote host closed the connection]
Xiti has quit [Read error: Connection reset by peer]
tcopeland has joined #ruby
sucks has quit [Remote host closed the connection]
jphase has joined #ruby
<zenspider>
UGH bundler ... just fucking kill me already
<zenspider>
RickHull: the free pickaxe edition was actually pretty problematic
cdg has quit [Remote host closed the connection]
<RickHull>
yeah, it was old and primitive and had some bad ideas in it IIRC
<RickHull>
but it really inspired me, turned on the lightbulb
cdg has joined #ruby
<RickHull>
and I was glad it was free
<zenspider>
aaaand it was free... which fucked up sales a measurable amount
jphase has quit [Ping timeout: 268 seconds]
<zenspider>
it caused problems between DT and addison
<RickHull>
I can imagine
bmurt has joined #ruby
<RickHull>
i think the freemium model is more accepted these days
<zenspider>
all subsequent editions weren't free as a result... but the free one stuck around and (almost) nobody updated
<RickHull>
though publishers are dinosaurs
jphase has joined #ruby
<RickHull>
using updates as paid DLC definitely has that downside
<RickHull>
but I think you could provide the equivalent of security updates twice a year
Tagami[m] has joined #ruby
<RickHull>
for free or w/e
<RickHull>
probably core/periphery is a better cleavage
<RickHull>
cleft?
^mtkd has quit [Ping timeout: 250 seconds]
swills has quit [Ping timeout: 240 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
I expect pragmatic press and oreilly have their models fairly well figured out by now. not sure if freemium fits in there
<RickHull>
for an author, I think there is something to be said for having an open portfolio to build a following
jphase has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Quit: inabit.]
mtkd has joined #ruby
<RickHull>
i guess blog posts does that. avdi chime in whenever :)