balazs has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
bf4 has joined #ruby
vasilakisfil_ has quit [Ping timeout: 256 seconds]
<sphex>
Ox0dea: seriously?
Pupeno has quit [Ping timeout: 246 seconds]
<Ox0dea>
sphex: For very reality.
mandarinkin has joined #ruby
<Ox0dea>
Pleasure to bescuse my phrases. English not my mother's tongue.
<Jeff__>
could someone tell me what's wrong with my puppet syntax, https://bpaste.net/show/287216d12676, specifically why the definition for the mysql::client is incorrect?
bkxd has joined #ruby
dgutierrez1287 has joined #ruby
mdw has joined #ruby
russt has quit [Quit: That's all, folks!]
Royalb15 has joined #ruby
<pontiki>
everything?? that would take some time at startup, i imagine
bf4 has quit [Ping timeout: 265 seconds]
<Ox0dea>
It would, but then it's all there close at hand.
<pontiki>
true, but it's hard to imagine one app would need to require *everything*
<Ox0dea>
This app is such a one.
datacatalyst has joined #ruby
<sphex>
Ox0dea: I don't want to tell you what to do.. but please don't do that? :p
<pontiki>
maybe i'm misunderstanding what "everything" means?
russt has joined #ruby
<Ox0dea>
Every require-able file in $LOAD_PATH.
findaway has quit [Ping timeout: 256 seconds]
<sphex>
there are "require_all" helpers, but looks like they need to be given at least one path component. you could always traverse $LOAD_PATH and require everything I guess. there are prolly some shenanigans for gem paths though.
<Ox0dea>
sphex: Aye, except that some files must be required before others.
<Ox0dea>
>> require 'remote-tk'
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruboto>
Ox0dea # => cannot load such file -- remote-tk (LoadError) ...check link for more (https://eval.in/388609)
<Ox0dea>
Well, that one relies on 'multi-tk' having already been required. Does Gem provide a way to resolve these sorts of dependencies?
<pontiki>
i'm not sure how that would work, exactly, for require; how does it check if it's already loaded something? just be path name?
<sphex>
Ox0dea: hrm. well, usually, each file should require the file it needs, and if you require them again it'll be ignored if they're already loaded, so it should be fine.
datanoise has joined #ruby
cashnguns has quit [Ping timeout: 248 seconds]
<pontiki>
any given package should require it's own dependencies
<Ox0dea>
pontiki: It checks $LOADED_FEATURES to determine whether or not something's already in.
vyorkin has quit [Ping timeout: 252 seconds]
<Ox0dea>
sphex: Alas, that is not the case, as demonstrated with 'remote-tk'. It fails upon require if 'multi-tk' hasn't yet been required.
<Ox0dea>
That directory listing is non-deterministic is the crux of the problem.
<Ox0dea>
Erm, not quite the crux, but definitely a hurdle.
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
datanoise has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 272 seconds]
<pontiki>
ah
<slash_nick>
>> class SwissArmyKnife;ObjectSpace.each_object(Module) do |mod|; include mod if !mod.is_a?(Class); end;end
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Agoldfish has quit [Quit: G'Bye]
Oka has quit [Remote host closed the connection]
<pontiki>
if you ran all the way through $LOAD_PATH, requiring every file below each of them, would it be possible to end up reloading something of a different version or mixing versions of things?
<Ox0dea>
pontiki: To be sure, collisions would abound, but I could use the two-argument form of Kernel.load to bring everything in under anonymous modules.
<pontiki>
yeah
TheHodge has quit [Quit: Connection closed for inactivity]
<Diabolik>
what up mi hombres
tkuchiki has joined #ruby
<Ox0dea>
s/s/s y mujeres/
tkuchiki has quit [Remote host closed the connection]
armyriad has quit [Quit: Leaving]
casadei has joined #ruby
fgo has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
Rollabunna has joined #ruby
Pupeno_ has quit [Remote host closed the connection]
Pupeno has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
<slash_nick>
s/mi/mis/
<slash_nick>
because plurality
Rollabunna has quit [Ping timeout: 248 seconds]
fgo has quit [Ping timeout: 246 seconds]
Pupeno_ has joined #ruby
slackbotgz has quit [Remote host closed the connection]
Pupeno has quit [Read error: Connection reset by peer]
simplyianm has joined #ruby
kahuna_ has quit [Quit: Lost terminal]
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jfarmer has joined #ruby
x1337807x has joined #ruby
blue_deref has joined #ruby
<nofxx>
is there some Thread.disable! or something that I can debug a code easily? Got some threads I'm commenting.. kinda boring need comment the end too heh
x1337807x has quit [Client Quit]
<nofxx>
disable all threads I mean, as if is wasn't there
<nofxx>
ok, ruby to the rescue, I've joined all the calls in a single one to comment or not. duplication gonne.
x1337807x has joined #ruby
x1337807x has quit [Client Quit]
bking39116 has left #ruby [#ruby]
<jfarmer>
nofxx Mind sharing the code? I don't really understand the idea of "disabling all threads."
<jfarmer>
The semantics of a program w/ threads is fundamentally different than one without.
<Ox0dea>
nofxx: ^ I think that does what you want.
yayfoxes_ has joined #ruby
shoutsid has quit []
meph has quit [Quit: Leaving.]
bigmac__ has quit [Ping timeout: 265 seconds]
towski_ has joined #ruby
chipotle has quit [Quit: cheerio]
freerobby has joined #ruby
bubbys has quit [Ping timeout: 265 seconds]
freerobby has quit [Client Quit]
balazs has joined #ruby
duncannz has quit [Ping timeout: 248 seconds]
<nofxx>
jfarmer, not in this case, it's a media export: from 1 svg or png icon I'm generating about 350 pngs
<nofxx>
the imagemagick/rsvg calls are, of course, 400% faster using threads, but annoying to test
<nofxx>
Ox0dea, ty, gonna try later
<jfarmer>
Are you using rmagick or mini_magick to interact with imagemagick?
balazs has quit [Ping timeout: 246 seconds]
simplyianm has quit [Remote host closed the connection]
<nofxx>
jfarmer, mini... was everything going fine so far, but now the last thing I need looks like mini doesnt do: create a new canvas hehe
havenwood has quit [Ping timeout: 276 seconds]
<jfarmer>
nofxx Threads are likely not getting you much benefit here; mini_magick works by forking a process running ImageMagick's `convert` command
<jfarmer>
So if you're doing the work in each thread, you're effectively creating a thread that then creates a fork
<nofxx>
jfarmer, hm, trying to understand but, what gives the 30s to 7s change ?
simplyianm has joined #ruby
Versality has joined #ruby
<jfarmer>
nofxx It's sort of a cheat because Ruby's threads aren't really threads, but a new thread will get scheduled if another thread starts doing I/O
<jfarmer>
In this case, the I/O is the work done by the external process.
casadei has quit [Remote host closed the connection]
<jfarmer>
You'd likely see a much bigger speed up if you were able to handle the forking yourself and not use threads at all
<jfarmer>
(I'm not familiar enough with mini_magick to say exactly how you'd do that.)
<nofxx>
btw, imagemagick support to SVG is really slow and you need to calculate a lot of stuff by hand. So in the SVG -> PNG case there's no imagemagick. Just calling rsvg-convert directly
<jfarmer>
That's fair and I'm not sure how rsvg-convert works. If it's CPU bound, your threads will block.
<nofxx>
it's very fast, even w/o threads. But the results (30s down to 7s) where PNG -> PNG with mini
Oka has joined #ruby
mcclurmc has joined #ruby
mcclurmc has quit [Remote host closed the connection]
<nofxx>
in the any case rsvg is a dependency of imagemagick for SVG, so I guess it's a feature not using IM for this job
<nofxx>
only need raster*
CowboyCoder has joined #ruby
Versality has quit [Ping timeout: 264 seconds]
datanoise has joined #ruby
<nofxx>
jfarmer, but forking is good idea
<nofxx>
is a*
Indian has quit [Ping timeout: 265 seconds]
<jfarmer>
nofxx My point was more that the forking is already happening and it'd be "best" if you could piggy-back off that.
<jfarmer>
And just forget about threads entirely
<jfarmer>
Looking through the minimagick docs, though,it's not immediately obvious if this is possible let alone officially supported in the API
Pupeno_ has quit [Remote host closed the connection]
<CowboyCoder>
can anybody suggest a way to list the classes/modules available in a gem from the cli?
freerobby has joined #ruby
<pontiki>
grep
finisherr has joined #ruby
<CowboyCoder>
;)
<jfarmer>
CowboyCoder gems are free to define any classes or modules they want, so this is a _little_ tricky
<Ox0dea>
CowboyCoder: cls = ->{ObjectSpace.each_object(Class).to_a}; had = cls[]; require 'thing'; have = cls[] - had
<jfarmer>
Yeah, you'd have to resort to a hack like that.
<Ox0dea>
Here, `have` will contain the classes which were introduced by requiring 'thing'.
<jfarmer>
CowboyCoder It's also not so black and white because classes and modules can be re-opened in Ruby.
Musashi007 has quit [Quit: Musashi007]
<CowboyCoder>
yea, why I'm stuggling w/ it...looking to explore gems at a high level
<CowboyCoder>
ty for the info!
<Ox0dea>
CowboyCoder: If you're just wanting to spelunk around in some gem, use Pry to `cd` into the "main" module, then `ls` to list all the things.
tubuliferous_ has joined #ruby
Rollabunna has joined #ruby
<Ox0dea>
You can, of course, `cd` into any of those things to deepen your dive.
<CowboyCoder>
Ox0dea: cool, I'll give it a shot!
bkxd has joined #ruby
freerobby has quit [Client Quit]
<nofxx>
jfarmer, that's a nice open3 shell.rb, no? heh give me the idea for a new gem: rsvg-mini
<nofxx>
mini_rsvg? Anyway, run rsvg-convert in a more sane way than my system(comm)
<jfarmer>
CowboyCoder Most gems come w/ auto-generated documentation that lists the available classes and modules
finisherr has quit [Client Quit]
<jfarmer>
(Not always with good commentary, but at least w/ the names of the classes and methods.)
<jfarmer>
nofxx Hah, yes.
<nofxx>
jfarmer, there's a ext one: rsvg2, from gnome2... scary
finisherr has joined #ruby
<CowboyCoder>
jfarmer: ri or something else?
karols has joined #ruby
tubuliferous_ has quit [Ping timeout: 244 seconds]
<jfarmer>
CowboyCoder Whether the docs are available on your computer depend on whether you installed them alongside the gem. If so, yes, ri is one tool to do that.
serivich has joined #ruby
<nofxx>
might give a try, not sure it's much os friendly... cairo, glib, gdb_pixbuf2....
Rollabunna has quit [Ping timeout: 248 seconds]
<jfarmer>
But there are also services like http://apidock.com/ that scan gems and do the auto-generation themselves
alotofnoodles has joined #ruby
Blaguvest has quit []
finisherr has quit [Client Quit]
_blizzy_ has joined #ruby
<CowboyCoder>
just looking for something offline and ideally cli to explore and reference
SpikeMaster has joined #ruby
<jfarmer>
Yep, then ri will work
fgo has joined #ruby
nfk has quit [Quit: yawn]
Musashi007 has joined #ruby
<CowboyCoder>
ok, i'll dig more on using ri, thanks again!
<jfarmer>
CowboyCoder Try it in irb: > ri Array#map
<jfarmer>
>> ri Array#map
<ruboto>
jfarmer # => undefined method `ri' for main:Object (NoMethodError) ...check link for more (https://eval.in/388623)
<jfarmer>
(was half expecting that to work)
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
<CowboyCoder>
jfarmer: how about something that shows per gem, not class?
dorei has quit []
<CowboyCoder>
so I do a "gem list" then what to view what's in the gem?
<jfarmer>
But seriously, I don't know. Not sure what you're looking for in a CLI version. Just a text dump?
<CowboyCoder>
jfarmer: :) sure!
<jfarmer>
You can probably tell rdoc to generate the docs in a format other than HTML.
fgo has quit [Ping timeout: 252 seconds]
<CowboyCoder>
will see what I can see :)
bkxd has quit [Ping timeout: 244 seconds]
alotofnoodles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jfarmer>
Also, looking at "ri --help" it appears you can tell ri to list the docs for a specific gem
rgb-one has joined #ruby
finisherr has joined #ruby
alotofnoodles has joined #ruby
<jfarmer>
> Usage: ri [options] [names...]
<jfarmer>
> Where name can be: ... gem_name: | gem_name:README | gem_name:History
<jfarmer>
> If the gem name is followed by a ':' all files in the gem will be shown.
<Ox0dea>
CowboyCoder: $EDITOR $(dirname `gem which foo`)
<jfarmer>
So, try something like ri rails:
<jfarmer>
and see what happens
<pontiki>
maybe not rails :D
<Ox0dea>
".rails not found"
finisherr has quit [Client Quit]
<jfarmer>
Ox0dea With a colon after rails?
<jfarmer>
"ri rails:
<jfarmer>
"
<Ox0dea>
Well, how about that.
<CowboyCoder>
hmm.... ri thor:
<Ox0dea>
jfarmer: It's just a pager, though.
<CowboyCoder>
blank...
<CowboyCoder>
maybe need to generate docs?
<jfarmer>
Ox0dea I can't see it myself because I don't install docs alongside gems.
<jfarmer>
CowboyCoder Maybe. They're installed by default.
RegulationD has joined #ruby
<jfarmer>
A lot of people disable it, though, because generating the docs is often the longest part of the gem installation process. Haha.
<jfarmer>
2 seconds to download + install Ruby files, 10 seconds to generate + install docs
j4cknewt has joined #ruby
<Ox0dea>
jfarmer: Do you impose some sort of arbitrary limit on the number of terminals you keep open?
<CowboyCoder>
ri -l .... that's handy :)
ledestin has joined #ruby
<Ox0dea>
CowboyCoder: That seems exactly the thing you were looking for. :)
SCHAAP137 has quit [Remote host closed the connection]
<CowboyCoder>
yup...with good tips along the way!
rgb-one has quit [Read error: Connection reset by peer]
finisherr has joined #ruby
<jfarmer>
ri -l doesn't associate each class w/ the gem it came from, at least not for me
<baweaver>
TMUX \o/
<CowboyCoder>
jfarmer: yea, don't know where it came from, but I can dig around in what's available...
<jfarmer>
Ox0dea Well, when I'm cloning someone else's project to help them debug it, I don't want "bundle install" to take 30-40 seconds longer than it has to.
<jfarmer>
While we just sit there looking at the screen, talking about the weather, whatever.
<jfarmer>
I literally never use the local docs; there's no good reason for me to add 30-50% to the install time of my gems.
<baweaver>
well, useful for any lurkers that didn't know that was a thing.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<baweaver>
for all other things you can just use Dash on it to auto-doc
<baweaver>
though it costs a bit.
SpikeMaster has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<baweaver>
well off I go, cheers
flughafe1 has quit [Remote host closed the connection]
<jfarmer>
cheers
eggoez has joined #ruby
CowboyCoder has quit [Quit: WeeChat 0.4.2]
baweaver has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 246 seconds]
fenjamin has quit [Ping timeout: 246 seconds]
fenjamin has joined #ruby
ashleyis has quit [Ping timeout: 252 seconds]
freerobby has joined #ruby
alotofnoodles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
troulouliou_dev has joined #ruby
mcclurmc has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Changing host]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
darkf has joined #ruby
troulouliou_dev has joined #ruby
neanderslob has joined #ruby
sevenseacat has joined #ruby
konsolebox has joined #ruby
charliesome has joined #ruby
JoshGlzBrk has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
bf4 has joined #ruby
chickenBox has joined #ruby
chickenBox has left #ruby [#ruby]
bf4 has quit [Ping timeout: 255 seconds]
[k- has joined #ruby
mcclurmc has quit [Remote host closed the connection]
jfarmer has quit []
balazs has joined #ruby
serivich has quit [Ping timeout: 255 seconds]
sankaber has joined #ruby
CloCkWeRX has quit [Ping timeout: 252 seconds]
Musashi007 has quit [Quit: Musashi007]
balazs has quit [Ping timeout: 252 seconds]
datanoise has joined #ruby
sankaber has quit [Ping timeout: 250 seconds]
scx has quit [Ping timeout: 246 seconds]
scx_ has joined #ruby
Rollabunna has joined #ruby
braincrash has quit [Quit: bye bye]
Rollabunna has quit [Ping timeout: 248 seconds]
aphprentice has joined #ruby
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
lkba has joined #ruby
Asher has quit [Quit: Leaving.]
datanoise has quit [Ping timeout: 256 seconds]
Scroff has joined #ruby
bigmac__ has joined #ruby
lkba_ has quit [Ping timeout: 250 seconds]
Asher has joined #ruby
Asher has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
Asher has joined #ruby
CloCkWeRX has joined #ruby
Rakunh0 has joined #ruby
linc01n has joined #ruby
kabukabu has quit [Quit: Leaving]
michael_mbp has joined #ruby
fgo has joined #ruby
Scrofff has joined #ruby
cb__ has joined #ruby
hagabaka has joined #ruby
braincrash has joined #ruby
drzel has quit [Ping timeout: 264 seconds]
<zacts>
was smalltalk the main inspiration for Ruby's OOPish way of coding?
charliesome has quit [Quit: zzz]
<zacts>
or what were the main influences on Ruby?
Scroff has quit [Ping timeout: 265 seconds]
<zacts>
I see smalltalk, perhaps Common Lisp's CLOS too?
<zacts>
I do see how Perl influenced the scripting / syntax of Ruby (either to be much different from perl, or to borrow ideas from the arguably expressive creative side of Perl syntax)
<sphex>
zacts: seems to be mostly smalltalk. CLOS was more "generic methods"-based. lisp packages were the primary way of organizing them, not classes.
gix has quit [Ping timeout: 252 seconds]
Scrofff has quit [Ping timeout: 244 seconds]
<sphex>
zacts: smalltalk had a "everything is done by sending messages to objects" approach. even conditionals were done by passing a block to an object just for that. ruby doesn't go as far.
yayfoxes_ has quit [Quit: WeeChat 1.0.1]
<zacts>
oh cool interesting
bigmac__ has quit [Ping timeout: 256 seconds]
iamninja has quit [Ping timeout: 246 seconds]
sarkyniin has joined #ruby
gix has joined #ruby
fenjamin has quit [Ping timeout: 248 seconds]
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
<Ox0dea>
sphex: But it can! :)
_blizzy_ has quit [Ping timeout: 248 seconds]
<Ox0dea>
zacts: I think you're right that Smalltalk + Perl + Lisp is a pretty good distillation of Ruby's ancestry.
fenjamin has joined #ruby
hagabaka has joined #ruby
fenjamin has quit [Remote host closed the connection]
towski_ has quit [Remote host closed the connection]
Scrofff has joined #ruby
sevvie has joined #ruby
cb__ has joined #ruby
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wldcordeiro has quit [Remote host closed the connection]
cb__ has quit [Read error: Connection reset by peer]
cb__ has joined #ruby
cb__ has quit [Changing host]
cb__ has joined #ruby
wldcordeiro has joined #ruby
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
Scrofff has quit [Ping timeout: 264 seconds]
fantazo has joined #ruby
RobertBirnie has quit [Ping timeout: 255 seconds]
<pontiki>
and Emacs :)
wldcordeiro has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
towski_ has quit [Remote host closed the connection]
TinkerTyper has quit [Ping timeout: 276 seconds]
TinkerTyper has joined #ruby
Scrofff has joined #ruby
baweaver has joined #ruby
Zamyatin has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkf_ is now known as darkf
renderfu_ has joined #ruby
<zenspider>
sphex: pretty much sums up why I don't like CLOS
tflat has quit []
Channel6 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
RegulationD has joined #ruby
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
NeverDie has joined #ruby
vdamewood has joined #ruby
icebourg has joined #ruby
icebourg has quit [Max SendQ exceeded]
hagabaka has joined #ruby
icebourg has joined #ruby
renderfu_ has quit [Ping timeout: 250 seconds]
cb_ has quit []
RegulationD has quit [Ping timeout: 248 seconds]
braincra- has joined #ruby
bigmac__ has joined #ruby
hagabaka has quit [Client Quit]
knite has quit [Read error: Connection reset by peer]
knite has joined #ruby
drzel has quit [Ping timeout: 248 seconds]
braincrash has quit [Ping timeout: 265 seconds]
tflat has joined #ruby
drzel has joined #ruby
AlexAltea has quit [Ping timeout: 265 seconds]
Yiota has joined #ruby
knite has quit [Read error: Connection reset by peer]
abderian has joined #ruby
eggoez has quit [Ping timeout: 272 seconds]
knite has joined #ruby
<abderian>
any experts on sinatra here? :)
<zenspider>
just ask, don't ask to ask
<[k->
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
hagabaka has joined #ruby
Yiota has quit [Client Quit]
<abderian>
got it. I'm a beginner when it comes to backend web development, and understand CRUD apps just fine. Recently I've been working on a simple project that scrapes data off of a website and enables users to search through that data
<abderian>
problem is, I don't know where to put the code that scrapes the data
bruno-_ has joined #ruby
<abderian>
say if I need it run once a week
<Ox0dea>
abderian: Are you on Windows?
<abderian>
so far code only gets executed when a user loads a page
<abderian>
no on a mac and deving in ubuntu
<Ox0dea>
Then a cron job is just what you need.
bruno- has quit [Read error: Connection reset by peer]
<zenspider>
so, really nothing to do with sinatra, more to do with "how do I run out-of-band jobs for my website"
<zenspider>
make a script that does what you want on the cmdline. it needs to run standalone. hook it up with cron to run at a specified time
<abderian>
oh my mistake then, I'm still trying to wrap my head around backend development in general > <
<abderian>
I see
<abderian>
This whole time I was trying to somehow link it with sinatra
<zenspider>
that "run standalone" part is important. cron runs in a very limited env
<zenspider>
it still prolly needs whatever ORM code you have for your app, so it still needs it, it just isn't related to an http request/response
<abderian>
That makes a lot of sense
hagabaka has quit [Client Quit]
kies has joined #ruby
<abderian>
Up until now I haven't programmed outside of that so I thought I was confined to writing all my code in there
<abderian>
Thanks a lot!
eggoez has joined #ruby
<Nilium>
Particularly important, for cron at least, is that you'll likely want to set some of the environment variables you normally always have
chinmay_dd has joined #ruby
hagabaka has joined #ruby
kies has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
<abderian>
hmm, I see
Zamyatin has quit [Ping timeout: 264 seconds]
baweaver has joined #ruby
arescorpio has quit [Quit: Leaving.]
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
chinmay_dd has quit [Ping timeout: 252 seconds]
hanmac has quit [Ping timeout: 246 seconds]
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Ping timeout: 246 seconds]
hagabaka has joined #ruby
j4cknewt has quit [Remote host closed the connection]
<Marisa>
anybody know of a good resource that explains how to parse a string so it can be split up via spaces and new lines? I'm finding the official documentation hard to follow
<Ox0dea>
There is the potential to do more harm than good.
linc01n has quit [Remote host closed the connection]
<nofxx>
Ox0dea, she wants new lines, easy to fix anyway
hagabaka has joined #ruby
<Marisa>
well i'm trying to split up a string by both new lines and spaces
linc01n has joined #ruby
<Marisa>
i'm at the point where i know more about how to solve my problem than the syntax to do it...
linc01n has quit [Client Quit]
<zenspider>
my general advice: think about your types, formulate your question, take the keywords and the types and try to look for it with ri
<Ox0dea>
All my objects are ducks.
<zenspider>
in your question, you mentioned Strings and split. boom: ri String.split
linc01n has joined #ruby
<nofxx>
but yeah, taught split's default was only for spaces... Marisa no need for the parameters. Me too, south america ;)
keen___________4 has joined #ruby
<zenspider>
taught -> thought ?
<nofxx>
zenspider, sorry, sleepy today
<Marisa>
zenspider: thanks for the tip, I appreciate it
<zenspider>
no prob
Rollabunna has quit [Ping timeout: 248 seconds]
<zenspider>
(both)
Rickmasta has joined #ruby
freerobby has quit [Quit: Leaving.]
hanmac has joined #ruby
keen___________3 has quit [Ping timeout: 252 seconds]
ducklobster has quit [Ping timeout: 246 seconds]
<Marisa>
nofxx: lol yeah, I forget that american can mean more than one continent
Sinami has joined #ruby
othernick has joined #ruby
balazs has joined #ruby
<Marisa>
so, any general recommendations on books/websites to learn Ruby comprehensively? I've been doing learn ruby the hard way but I'm about 2/3rds through and starting to realize it's not very good about teaching "the ruby way" of coding
<zenspider>
it's not very good imo
<zenspider>
I'm partial to the pickaxe book, but I'm biased
<Ox0dea>
"Zed's dead, baby. Zed's dead."
<mhb>
The Well Grounded Rubyist + Pick Axe + Eloquent Ruby
<Marisa>
lol
<Ox0dea>
Really can't go wrong with those.
<Marisa>
thanks :)
Sin90 has quit [Ping timeout: 246 seconds]
<Ox0dea>
Metaprogramming Ruby is pretty good once you've got the hang of things.
hotpancakes has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rubie has quit [Remote host closed the connection]
balazs has quit [Ping timeout: 248 seconds]
RickHull has left #ruby [#ruby]
mujou has joined #ruby
hotpancakes has joined #ruby
framling has joined #ruby
<Marisa>
hmm, this is being annoying...i'm using cloud 9 as my ide and when i run ri (which does work), it can't find anything about any function
michael_mbp has quit [Excess Flood]
hotpancakes has quit [Remote host closed the connection]
<Marisa>
just keep getting "nothing know about .foo"
alotofnoodles has joined #ruby
Yiota has joined #ruby
<zenspider>
I don't know anything about cloud 9... but it sounds like you installed ruby w/o rdoc/ri info
<zenspider>
if you used rvm (ugh) there should be a command to generate it
<konsolebox>
Readline.readline breaks completion on filenames that have spaces on them. Is there a common configuration for it? e.g. Readline.readline('abc: '), then enter a pathname with a space. Pressing the next would no longer yield anything.
<konsolebox>
*next tab
<framling>
zenspider: is rvm no good?
<Marisa>
i didn't install it myself, basically, they use a virtual machine (or something like it)
<al2o3-cr>
Marisa: they use ubuntu right?
michael_mbp has joined #ruby
<Marisa>
believe so
<Ox0dea>
konsolebox: Works fine here?
icebourg has quit []
<konsolebox>
Ox0dea: works on a directory with a space? tab yields filenames within?
<al2o3-cr>
Marisa: apt-get install ri
<Marisa>
i figured out how to get rvm to download the documentation
j4cknewt has joined #ruby
<Ox0dea>
konsolebox: Oui.
michael_mbp has quit [Excess Flood]
<[k->
^ he means yes
<konsolebox>
yes saw the translation quick :)
<Ox0dea>
konsolebox: Ah, scratch that. Space files in space directories = not good.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
<konsolebox>
Ox0dea: you mean other non-Ruby readlines?
<Ox0dea>
konsolebox: Bash's, to be precise.
<Ox0dea>
But they're both using GNU readline.
<Ox0dea>
So it must be that Bash is using its own rl_filename_completion_function.
<konsolebox>
Ox0dea: well, readline is bash's i think
bkxd has quit [Ping timeout: 265 seconds]
s2013 has joined #ruby
Xiti has quit [Quit: Xiti]
hotpancakes has joined #ruby
kies has joined #ruby
finisherr has joined #ruby
Pupeno has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
simplyianm has joined #ruby
finisherr has quit [Client Quit]
Versality has quit [Quit: Be back later ...]
simplyianm has quit [Remote host closed the connection]
lxsameer has joined #ruby
tubuliferous_ has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
dented42 has joined #ruby
Rollabunna has joined #ruby
Rakunh0 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 252 seconds]
hotpancakes has quit [Ping timeout: 264 seconds]
<Ox0dea>
konsolebox: Bash uses so thoroughly customized a readline that the file is called "bashline.c". :)
<Ox0dea>
$ stat -c '%s' Downloads/bash-4.3/bashline.c dev/ruby-trunk/ext/readline/readline.c
Rollabunna has quit [Ping timeout: 256 seconds]
IanV0rn has joined #ruby
<Ox0dea>
116288
<Ox0dea>
55277
<Ox0dea>
That doesn't tell anywhere near the whole story, of course, but handling space files in space directories is definitely not a stock readline feature.
j4cknewt has joined #ruby
mcclurmc has joined #ruby
Dopagod has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
IanV0rn has joined #ruby
simplyianm has joined #ruby
<konsolebox>
Ox0dea: wow, thank you for investigating. that's bad news :)
mcclurmc has quit [Ping timeout: 250 seconds]
<konsolebox>
Ox0dea: i think i'll try to hack it with a callback to a completion function
Rakunh0 has joined #ruby
simplyianm has quit [Remote host closed the connection]
<Ox0dea>
konsolebox: Happy to help. Be warned: it can get pretty gnarly.
<Ox0dea>
There's an /* XXX */ comment on a free() call right next to where I suspect the magic is happening.
abuzze_ has quit [Remote host closed the connection]
<Ox0dea>
How much would you hate shelling out to `read`?
abuzze has joined #ruby
abuzze has quit [Remote host closed the connection]
RegulationD has joined #ruby
fgo has joined #ruby
abuzze has joined #ruby
Pupeno has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rubie has joined #ruby
finisherr has joined #ruby
yayfoxes has quit [Disconnected by services]
RegulationD has quit [Ping timeout: 264 seconds]
finisherr has quit [Client Quit]
yayfoxes_ has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
Pupeno has quit [Ping timeout: 272 seconds]
swgillespie has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
Scroff has joined #ruby
Musashi007 has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kies has quit [Ping timeout: 256 seconds]
simplyianm has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Soda has quit [Remote host closed the connection]
BrianBoyko has quit [Quit: Leaving]
Xiti has joined #ruby
bkxd has joined #ruby
_blizzy_ has joined #ruby
Rollabunna has joined #ruby
fantasticsid has joined #ruby
_ht has joined #ruby
simplyianm has quit [Remote host closed the connection]
simplyianm has quit [Remote host closed the connection]
abuzze has quit [Ping timeout: 264 seconds]
simplyianm has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ashleyis has joined #ruby
fantasticsid has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
fantasticsid has joined #ruby
vdamewood has quit [Quit: Life beckons.]
davedev24_ has quit [Ping timeout: 246 seconds]
GPrime has joined #ruby
Oka has joined #ruby
yardenbar has joined #ruby
simplyianm has quit [Remote host closed the connection]
Rollabunna has joined #ruby
A205B064 has quit [Ping timeout: 250 seconds]
ndrei has quit [Ping timeout: 248 seconds]
bkxd has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ruby
baweaver has quit [Remote host closed the connection]
yardenbar has quit [Ping timeout: 256 seconds]
konsolebox has quit [Quit: Leaving]
konsolebox has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
User458764 has joined #ruby
peter_paule has joined #ruby
mcclurmc has quit [Ping timeout: 264 seconds]
sinkensabe has quit [Remote host closed the connection]
balazs has joined #ruby
wildroman2 has joined #ruby
Channel6 has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
celly has joined #ruby
fantazo has quit [Ping timeout: 256 seconds]
doodleha_ has joined #ruby
celly has quit [Client Quit]
wildroman2 has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
wildroman2 has joined #ruby
balazs has quit [Ping timeout: 244 seconds]
yardenbar has joined #ruby
doodleha_ has quit [Ping timeout: 246 seconds]
<Marisa>
have a question about variable scope...i have 3 variables that I want to use, and i am using a loop to parse their values from my input...would best practice to use a @instancevariable when I call them in the loop and then later in the program or should i just initialize them before the loop?
<shevy>
Marisa if you work within a class, I recommend to initialize all your variables right at creation-time (when you call .new; so in other words, within "def initialize"; I use a common method for that, which I then call "def reset")
doodleha_ has quit [Read error: Connection reset by peer]
<Marisa>
it's more like, since i'm initializing them inside a loop, i can't call them later (they're local to the loop), so should i make them instance variables (by using @name) or should i just initialize the variables before i assign them values
<Marisa>
not really a code question, more of a style question, if you dig
sameerynho has joined #ruby
<shevy>
if you require them to be persistent, then use @ivars; or initialize them outside the loop
<Marisa>
this is a pretty simple program, i'm not even using a class
<shevy>
sadly
<shevy>
:-)
<shevy>
actually you answered your own question there
<shevy>
you want to use local variables, which you initialize outside the loop
lxsameer has quit [Ping timeout: 246 seconds]
doodleha_ has joined #ruby
<shevy>
ruby is an OOP language though, the whole point of using a class is that you can re-use it neatly structured through a class
Scroff has quit [Read error: Connection reset by peer]
<Marisa>
totally, but it's not needed for what I'm doing
<[k->
I still have no clue about what she wants
Carnage\ has joined #ruby
<[k->
does that variable need to be global?
<[k->
or does it need to be local to a method only
doodleha_ has quit [Read error: Connection reset by peer]
<Marisa>
i think initializing the variables before the loop is the way to go for this
datanoise has quit [Ping timeout: 256 seconds]
<[k->
in general, choose the smallest scope possible
lavros has joined #ruby
doodleha_ has joined #ruby
vyorkin has joined #ruby
doodleha_ has quit [Read error: Connection reset by peer]
<shevy>
I sort of ended up using classes almost all the time; or at the least modules
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Ox0dea>
It just feels "cleaner" somehow.
khebbie has joined #ruby
al2o3-cr has quit [Ping timeout: 250 seconds]
vyorkin has quit [Ping timeout: 256 seconds]
doodleha_ has joined #ruby
Dopagod has quit [Ping timeout: 264 seconds]
doodleha_ has quit [Read error: Connection reset by peer]
bnizzle has quit [Read error: Connection reset by peer]
al2o3-cr has joined #ruby
Carnage\ has quit []
tubuliferous_ has joined #ruby
doodleha_ has joined #ruby
<Marisa>
woohoo, I got it to parse my data inputs and assign variables correctly. Thanks guys for your help :)
fgo has joined #ruby
<Ox0dea>
Marisa: May we see?
doodleha_ has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 256 seconds]
<Marisa>
the data is always formatted the same, on line 1 there are 3 numbers separated by spaces and on line 2 there are up to 10 numbers separated by spaces
<Marisa>
yeah, the loop is a bit overkill, no?
<[k->
yeah
fgo has quit [Ping timeout: 246 seconds]
khebbie_ has joined #ruby
<[k->
you could also break after 2, but the resources are already wasted
<Marisa>
any suggestions for cleaning it up? I was having trouble getting data using ARGF
<jfarmer>
Marisa You're only ever receiving 2 lines?
<Marisa>
yes
<[k->
as in the file is max 2 lines?
<Ox0dea>
Marisa: Splitting on ' ' is unnecessarily brittle; your code will malfunction in the presence of extraneous spaces.
<Ox0dea>
Never mind.
<Marisa>
I can just use split()?
peter_paule has quit [Ping timeout: 246 seconds]
<jfarmer>
[k- Seems like the assumption/guarantee is that there will only ever be two lines on STDIN
<Ox0dea>
Marisa: Oui, and even without the parentheses.
<jfarmer>
Marisa What does each line represent?
<Ox0dea>
jfarmer: The variable names make it reasonably clear, I should think.
bluOxigen has joined #ruby
khebbie has quit [Ping timeout: 244 seconds]
<jfarmer>
Ox0dea Marisa said that "on line 2 there are up to 10 numbers separated by spaces"
doodleha_ has joined #ruby
<[k->
let's over engineer the solution!
<jfarmer>
Unclear what each number there represents
<Marisa>
the hit points of each enemy
<jfarmer>
Ok, up to 10 enemies?
<[k->
ah, so this is the first step?
<Marisa>
this is for a code challenge so i'm not trying to get tooooo specific on what exactly i'm trying to do
<[k->
so u aren't finished?
quazimodo has joined #ruby
Versality has joined #ruby
<[k->
ah its a challenge
<[k->
no tips for you then
<[k->
:>
<Marisa>
no, this is just parsing the data, i still have to write the actual logic to give me the answer
datanoise has joined #ruby
mujou has quit [Read error: Connection reset by peer]
joshbamboo1 has quit [Read error: Connection reset by peer]
NeverDie has quit [Read error: Connection reset by peer]
doodleha_ has quit [Read error: Connection reset by peer]
<[k->
they are all the data you need?
doodleh__ has joined #ruby
<jfarmer>
How you structure this depends on how it'll be used, so it's hard (IMO) to give specific recommendations.
peter_paule has joined #ruby
joshbamboo1 has joined #ruby
mujou has joined #ruby
jschoolcraft has quit [Read error: Connection reset by peer]
<[k->
we should use json frankly
othernick has left #ruby ["Leaving"]
<jfarmer>
Marisa As a rule, you should have some concrete object of some kind that represents each entity you care about
<[k->
json > yml
<Ox0dea>
JSON
<Marisa>
but basically, line 1 has 3 numbers, the first is the number of enemies, second is amount of spell damage on first enemy, third is amount that the spell damage reduces for each subsequent enemy
NeverDie has joined #ruby
<[k->
JSON*
<Ox0dea>
[k-: Heh, no, sorry, I accidentally sent that.
<Ox0dea>
I was going to say that it's a strict subset of YAML.
khebbie_ has quit [Ping timeout: 264 seconds]
<zenspider>
Marisa: a, b, c, ... = string.split
<Marisa>
and then line 2 has the hit points of the enemies (and the number will vary)
<[k->
so you mean technically, json < yml
<zenspider>
so you don't have to keep using it like an array
ndrei has joined #ruby
<zenspider>
and use_snake_case notCamelCase in ruby
<Ox0dea>
[k-: That was the intended implication, yes.
doodleh__ has quit [Read error: Connection reset by peer]
<Marisa>
ah okay :)
<Marisa>
well, i wasn't sure how to get data using ARGF line by line and then split it up without using an array
<bnagy>
a,b,c = ARGF.readline.split
<Ox0dea>
Marisa: String#split gives you the array in question, but you don't need to index into it one-by-one.
<Marisa>
well i only want to split the first line, it will work better for line 2 to keep it in an array
duoi has quit [Ping timeout: 248 seconds]
<[k->
you can use _ for variables you don't need, as in a, b, _, c, d = array
<Marisa>
let me rephrase
yeticry has quit [Ping timeout: 244 seconds]
peter_paule has quit [Ping timeout: 248 seconds]
<zenspider>
you can use splat w/ masgn like so: first, *rest = ARGF.readlines
<bnagy>
I think it's only two lines
<jfarmer>
Marisa Do you have to handle invalid input?
<zenspider>
ah, then stop overthinking this
unshadow has joined #ruby
<Marisa>
i want the data from line 2 to be in an array (so I can manipulate it later) and but for line 1, i want each item to be assigned to a variable
yeticry has joined #ruby
<zenspider>
if you know that the first line has 3 numbers then just do that
<zenspider>
do the simplest thing that can possibly work. read a bunch of numbers, grab the first 3
<jfarmer>
Then you can ignore the first number on the first line
<[k->
it would be poor practice to keep numbers with special meanings in a areay
<Ox0dea>
Marisa: The two lines I pasted are essentially equivalent, but surely you see that one is much nicer than the other?
RegulationD has joined #ruby
<bnagy>
Marisa: zenspider's is arguably cleaner, but it will run on if there's more than two lines for some reason
<zenspider>
poor practice. bah. Marisa just needs to get shit done. not get shit done perfectly.
tesuji has joined #ruby
<zenspider>
bnagy: absolutely
<Marisa>
no, i'm trying to learn, i appreciate it
<[k->
that's what all programmers say ;-;
<zenspider>
assuming they have the same # of columns for lines 2-, then each_slice is king
<[k->
and we have to maintain those codebase ;-;
<bnagy>
imho if there are more than 10 numbers I don't want to name them individually
<zenspider>
[k-: nice way to set up a bullshit us vs them dichotomy
chishiki has left #ruby ["WeeChat 1.2"]
<zenspider>
bnagy: preferably, you wrap it up in a nice object/struct and pass them in to initialize into named fields.
<Ox0dea>
zenspider: Or #zip + #to_h.
<bnagy>
Marisa: using the readline approach you also don't need the loop, which means you also don't have the ugly variable initialisation
<zenspider>
Ox0dea: don't recommend that. I'd rather use purposeful methods
<bnagy>
same with the read.split approach
rubie has joined #ruby
<Ox0dea>
Pfft.
<Marisa>
Ox0dea: definitely nicer, i'm just too new at this to know all the syntax especially the pretty stuff ;)
<Ox0dea>
Marisa: All in good time.
datanoise has quit [Ping timeout: 256 seconds]
<Marisa>
thanks for all your help though...might need to refactor it tomorrow though, it's getting late here
joshbamboo2 has joined #ruby
<zenspider>
Marisa: what is this for?
joshbamboo2 has quit [Read error: Connection reset by peer]
<Ox0dea>
Knowledge acquisition.
frem has quit [Quit: Connection closed for inactivity]
mcclurmc has joined #ruby
<Marisa>
devdraft.com
joshbamboo2 has joined #ruby
doodleha_ has joined #ruby
RegulationD has quit [Ping timeout: 276 seconds]
Pupeno has joined #ruby
<Ox0dea>
Is that... a Big O joke?
<zenspider>
Marisa: interesting. thanks.
<Marisa>
i'm not sure i can get through all 3 programs though, this was supposed to be the easy one and it's taken me like 3 hours to just parse the data (to be fair, i've never done anything like that in my previous studies)
<zenspider>
Marisa: that's fine. failure is how we learn and improve
<Marisa>
because of the companies listed?
joshbamboo1 has quit [Ping timeout: 256 seconds]
doodleha_ has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Ping timeout: 246 seconds]
<Ox0dea>
Not to mention the tacky SEO grubbing in the footer.
<Marisa>
i'm not realistically trying to get a job out of this, i just thought it would be a good learning experience as a worst case scenario, and best case, you never know...
<zenspider>
just... not the way I like companies thinking about me, nor vice versa I guess.
rubie has quit [Ping timeout: 265 seconds]
<zenspider>
Marisa: *nod* might want to try exercism.io as well.
<zenspider>
and codecombat is fun and dorky
<Marisa>
i have both of those bookmarked
<zenspider>
good. they're fun. I do exercism once in a while. good stuff.
mcclurmc has quit [Ping timeout: 246 seconds]
doodleha_ has joined #ruby
<Marisa>
i've been going through the Odin Project, but I was getting bored with the HTML/CSS stuff (as I already know a fair bit about that), so I started going through learn ruby the hard way, but I feel like it's just a bad translation of learn perl the hard way and not really that useful
sinkensabe has joined #ruby
doodleha_ has quit [Read error: Connection reset by peer]
<zenspider>
I have a biased opinion about it, so... I'll just say that. :)
<Marisa>
really just trying to make steady progress on stuff, but i've done too many super simple programs and not enough "sink or swim" type challenges, which is where i tend to learn the most
<zenspider>
the nice thing about exercism is it has crowdsourced code reviews
<zenspider>
not the best in the world, but much more human
<zenspider>
*nod* you might prefer codecombat over exercism then
<Marisa>
i think the best thing i've done so far was make a simple calendar generating program...learned a lot from that
<Marisa>
like how much syntax i really don't know, for one....
<Marisa>
i'll definitely check them both out soon
<zenspider>
*nod* and there's a lot of syntax in ruby
<[k->
quick, write all these down
IanV0rn has joined #ruby
<[k->
all good testimonials!
sinkensabe has quit [Remote host closed the connection]
doodleha_ has joined #ruby
<Marisa>
out of curiosity, is anyone here in devops?
<Ox0dea>
I develop operators, but I've never operated on a developer.
doodleh__ has joined #ruby
doodleha_ has quit [Read error: Connection reset by peer]
<[k->
huehuehue
<Marisa>
lol
<zenspider>
I have. it was a bloody mess in the end.
CloCkWeRX has quit [Ping timeout: 256 seconds]
bf4 has quit [Ping timeout: 264 seconds]
<Marisa>
)xxxxx[;;;;;;;;;>
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Marisa>
;)
<Ox0dea>
"Stick 'em with the pointy end."
doodleh__ has quit [Read error: Connection reset by peer]
<ruby-lang590>
Hello. I'm new here, so sorry if this isn't a great question. Can anyone tell me how to insert a new row into a database using the 'pg' gem without having to interpolate the exec string?
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
legitler__ has quit [Quit: Lost terminal]
<Yiota>
hey folks, employer has asked me to learn ruby for the job. now this is because the website is built on rails. is the transition from python to ruby easier or harder than vice versa?
RegulationD has quit [Ping timeout: 244 seconds]
<[k-_>
the two languages are similar
<[k-_>
but you dont have decorators
<[k-_>
or those __cmp__ stuff
<apeiros>
Yiota: I think nobody has done a transition in both directions, so I doubt anybody can answer this ;-)
<[k-_>
we can define < immediately
<apeiros>
Yiota: but the two languages are quite similar. the transition should not be hard.
<[k-_>
we also do not have the ugly __init__
<[k-_>
we have def initialize!
<Yiota>
I see. would you say ruby is more or less abstracted?
<[k-_>
hehehehehehehehehe
<apeiros>
yeah, the OO is less bolted-on.
<apeiros>
otoh we don't have list comprehensions. we use methods for that.
<Yiota>
as in higher-leveled
<[k-_>
ruby would be less
<apeiros>
Yiota: entirely irrelevant ;-p
<Yiota>
cool
bf4 has joined #ruby
simplyianm has quit [Remote host closed the connection]
albatross1 has left #ruby [#ruby]
albatross1 has joined #ruby
TheHodge has joined #ruby
unshadow has quit [Quit: leaving]
rdark has joined #ruby
Scroff has joined #ruby
djellemah has joined #ruby
iamninja has joined #ruby
kubunto has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
<kubunto>
is there an easy way to convert julian to and from hebrew dates?
simplyianm has joined #ruby
Aryasam has joined #ruby
<[k-_>
i dont think the stdlib has anything for you
<[k-_>
the stdlib supports Julian but I cant find hebrew
<[k-_>
"Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa."
pothibo has joined #ruby
<[k-_>
keywords searched: ruby hebrew calender
<kubunto>
thank you, looks promising
sankaber has joined #ruby
phale has left #ruby ["Leaving"]
j4cknewt has quit [Remote host closed the connection]
datanoise has joined #ruby
<shevy>
does anyone of you know why descriptions such as at https://rubygems.org/gems/rack do not allow for <br> tags and thus newlines? for longer descriptions of a program, it makes it hard to read
BigRonnieRon has joined #ruby
lessless has joined #ruby
<[k-_>
what do you mean by do not allow
<[k-_>
there were no <br> tags found
datanoise has quit [Client Quit]
Pumukel has quit [Remote host closed the connection]
<shevy>
I am pretty sure you can add <br> tags but it won't be honoured
<apeiros>
kubunto: sure you want julian and not gregorian?
<[k-_>
why dont you try :>
<[k-_>
apeiros: i think the fact that a library exists means that it's pretty common :>
<apeiros>
(julian is not in use by any country atm)
idafyaid has joined #ruby
<shevy>
[k-_ nono we can skip ahead, I am absolutely sure
<[k-_>
but you have no proof that you cant
<kubunto>
apeiros: i do
<shevy>
[k-_ do you have?
<[k-_>
anyway, im sure apeiros is skilled in the arts of html and css and stuff
FernandoBasso has quit [Quit: WeeChat 1.2]
<kubunto>
if there is a direct conversion from hebrew to gregorian i woudl take it
<[k-_>
i also dont have proof that it can, but im not the one asking ^^
<shevy>
ok so you have no clue
<[k-_>
:(
sankaber has quit [Ping timeout: 276 seconds]
<shevy>
on github, their readmes are often much easier to read
unshadow has joined #ruby
hotpancakes has joined #ruby
micmus has joined #ruby
<kubunto>
apeiros: any ideas on how to get the julian number to a gregorian date
Versality has quit [Quit: Be back later ...]
konsolebox has joined #ruby
dcarmich has joined #ruby
<apeiros>
kubunto: Date might do that
<kubunto>
looks liike it would
<albatross1>
hello
Hien_ has quit [Quit: leaving]
simplyianm has quit [Remote host closed the connection]
hotpancakes has quit [Ping timeout: 252 seconds]
Hien has joined #ruby
albatross1 has left #ruby [#ruby]
<apeiros>
yeah, Date.new with proper 4th arg should
<[k-_>
ruby Date?
<kubunto>
Date.jd(julian_number)
<kubunto>
that does it
Hien has quit [Client Quit]
Aryasam has quit [Ping timeout: 246 seconds]
<apeiros>
funny, I was looking for that method, but missed it
<shevy>
5 and S look very similar here as well on "Monospace"
<sevenseacat>
the features on the elm homepage talk a big talk
<[k-_>
ah it is different from haskell in terms of type annotations
<[k-_>
you use : instead of ::
<[k-_>
shevy: you have not seen ELI5 before?
simplyianm has joined #ruby
<quazimodo>
Ox0dea: hrm . Monads are hard to explain without you knowing some category theory
<quazimodo>
long story short
<Ox0dea>
quazimodo: Why do monads get compared to burritos and spacesuits and monoids in the category of endofunctors?
<quazimodo>
heh
<quazimodo>
because they are just like both of that
<shevy>
never heard of ELI5
<Ox0dea>
How so?
<quazimodo>
all 3
<shevy>
isn't elm from the muppet show?
<[k-_>
lel shevy doesnt reddit
<Ox0dea>
English needs a "both" for three, I've always said.
<[k-_>
triboth
<shevy>
I read mostly a few articles linked from reddit, not everything
<quazimodo>
they are wrappers around interesting stuff, they protect you from outside world craziness (kinda) and they are monoids in the category of endofunctors - nfi how to describe that any better
<Ox0dea>
[k-_: Troth?
<[k-_>
:o
<quazimodo>
intuitively
<quazimodo>
think of them like a wrapper
<quazimodo>
or a box
<Ox0dea>
quazimodo: That doesn't sound mathematical or category-theoretical at all.
<quazimodo>
inside is 1 or more lovely things
<[k-_>
bi-oth, tri-oth, remove the i, get troth!
tubuliferous_ has joined #ruby
<Ox0dea>
Case closed.
<quazimodo>
Ox0dea: do you know category theory?
<Ox0dea>
quazimodo: Is it not the case that there are zero or more things inside?
<sevenseacat>
Ox0dea knows everything.
* Ox0dea
knows nothing, like Jon Targaryen.
<quazimodo>
Ox0dea: sure, but you already seem to know what they are
<Ox0dea>
quazimodo: Yes, I'm poking fun.
<quazimodo>
i wish I could explain them better
<quazimodo>
it's hard
<Ox0dea>
They're burritos, mate.
<quazimodo>
i dno who made that stupid analogy honestly
<quazimodo>
so useless to help someone understand
<Ox0dea>
You were totally for it a moment ago.
<sevenseacat>
i see what you did there.
<Ox0dea>
quazimodo: You should familiarize yourself with the monad laws.
<quazimodo>
Ox0dea: to me a monad is an endofunctor and 2 natural transformations. So i don't really get how Maybe is a monad. Perhaps Maybe + join + return == monad
<shevy>
[k-_ nono just load aaaaall the things. all of them. load all of them. all. :)
<quazimodo>
Maybe, fmap, join and return
<shevy>
Maybe this will work
<[k-_>
install all the gems, and load them all?
<shevy>
yeah!
<[k-_>
that will take forever
<shevy>
aww that talk is fun. "We believe it is time to bring Ruby and Robots together." he pronounced it in a funny way though, "Ruby and Rubots"
scruple has joined #ruby
fantazo has quit [Quit: Verlassend]
simplyianm has joined #ruby
<quazimodo>
does Volt use event machine or similar?
<quazimodo>
how does it keep all the webosckets connection alive?
hotpancakes has joined #ruby
rubie has joined #ruby
kobain has joined #ruby
pothibo has joined #ruby
freerobby has joined #ruby
simplyianm has quit [Ping timeout: 248 seconds]
pothibo has quit [Client Quit]
hotpancakes has quit [Ping timeout: 250 seconds]
Soda has joined #ruby
sevenseacat has quit [Quit: Me dun like you no more.]
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
<quazimodo>
seriousy
<quazimodo>
how does volt work
<quazimodo>
i can't find
<[k-_>
quazimodo: i think there are youtube videos
<athos_diddy>
ok so this tutorial is recommending three db's on the server, dev, prod and test. one for each enviroment. when saying enviroment they mean three seperate vm's or maybe three versions of the same app?
<Rutix>
athos_diddy: Depends on how many isolation you want but if it's only a server for db's then 3 db's on the server is fine.
<Rutix>
much*
<apeiros>
athos_diddy: if you can, then 3 servers
<apeiros>
the more separation the better. it's simple.
woodruffw has joined #ruby
<athos_diddy>
so then maybe i make one server just for db's?
<Rutix>
Well yes.
<Rutix>
3 enviorments for the app on the same server is useless
<athos_diddy>
that makes sense
<Rutix>
Especially prod
freerobby has quit [Quit: Leaving.]
<Rutix>
that one has to be played with as less as possible since well its production ;p
<apeiros>
Rutix: it's not useless. but it's less isolation than on different servers.
bf4 has quit [Ping timeout: 256 seconds]
<athos_diddy>
so i got cloud vm's with one unique ip
<athos_diddy>
i can do it with this right
pothibo has joined #ruby
freerobby has joined #ruby
<athos_diddy>
just setup another vm with ubuntu just for the db's
eggoez has quit [Ping timeout: 246 seconds]
<Rutix>
apeiros: Well yes. But I can't think of any situation where you want 3 enviroments AND have them run on the same server
<athos_diddy>
so one ip maybe 4 vm's, one for db's and three for test, dev, prod
diegoviola has joined #ruby
<apeiros>
Rutix: we have test, acceptance and staging for smaller apps on the same server
<apeiros>
that's 3 envs
<pothibo>
I’m trying to install gems on a docker container using a non-root user and I get this Errno::EACCES: Permission denied @ rb_sysopen - /usr/local/bundle/config I am not sure why it needs to look at config file, any idea?
<babykosh>
since rss feeds come in many variations is there such s thing as an rss feed service where you can enter multiple rss feeds and get a normalized rss output?
<apeiros>
don't steal it! :D
<[k-_>
it's better than Jacob XD
Yiota has quit [Client Quit]
peter_paule has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
FernandoBasso has joined #ruby
micmus has quit [Ping timeout: 252 seconds]
<Rutix>
[k-_: Wth does jacob stand for :P
Yiota has joined #ruby
psy_ has joined #ruby
<[k-_>
apeiros: ^
<apeiros>
Rutix: nothing anymore. it used to stand for something when it was a JS only framework. but lost its meaning.
Rickmasta has joined #ruby
<Rutix>
Oh
aspiers has quit [Ping timeout: 246 seconds]
sfarley has joined #ruby
<Rutix>
apeiros: Javascript Central Offline Bullshit ;3?
<babykosh>
since rss feeds come in many variations is there such s thing as an rss feed service where you can enter multiple rss feeds and get a normalized rss output?
<babykosh>
@rutix ah…yes, that 3 years ago last update seems troubling
Guest73614 has quit [Client Quit]
Guest73614 has joined #ruby
<Ox0dea>
How to XOR two arrays using only a single pass through each?
<Ox0dea>
I can't quite see how not to do a third pass of one kind or another.
bking39116 has joined #ruby
sfarley has quit [Remote host closed the connection]
MrJiks has joined #ruby
<Ox0dea>
Hash arrays a and b, and then check that each key either satisfies (a && !b) or (b && !a), but that's a third pass.
<apeiros>
have two hashes. result and already_seen
<apeiros>
check in all from a into result and already_seen
CustosLimen has quit [Ping timeout: 265 seconds]
tubuliferous_ has joined #ruby
<apeiros>
errr… wait
<apeiros>
sorry. BAC is too high.
<apeiros>
but I think the answer lies somewhere there :)
symm- has quit [Ping timeout: 252 seconds]
<Ox0dea>
I vaguely considered just doing (a | b) - (a & b), but that wouldn't look very good in a proposal.
<Ox0dea>
It's essentially three walks given how efficiently rb_ary_and and rb_ary_or are implemented, but it still feels cheap.
<apeiros>
let me see whether I can answer that question after a bottle of 25% vodka :)
<Ox0dea>
I like my odds.
<Ox0dea>
I'd like to fix my patch before Japan wakes up. :X
antgel has quit [Ping timeout: 276 seconds]
ashleyis has quit [Ping timeout: 256 seconds]
<Ox0dea>
It's broken for even counts of repeated elements in the second array. :(
rbennacer has quit [Remote host closed the connection]
etqqkoiflwhb has joined #ruby
pothibo has joined #ruby
Pupeno has joined #ruby
pothibo has quit [Client Quit]
<apeiros>
yupp, solution was somewhere there
rbennacer has joined #ruby
<apeiros>
but you have to translate it to C :)
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tubuliferous_ has quit [Ping timeout: 255 seconds]
<apeiros>
let me check whether what I did works. but it only .each'es a & b once each.
Muhannad has joined #ruby
<Ox0dea>
That certainly sounds like a solution. Of course, diffing the keys at the end would be a third pass.
<apeiros>
there's no diffing
<apeiros>
do you consider Hash#keys to be a pass?
<apeiros>
if so, that'd be a second
<Ox0dea>
a.each, b.each, result.keys is three passes.
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
(I conder a.each + b.each to be a single pass - one pass through all elements)
<Ox0dea>
It's not, though.
<apeiros>
then I doubt it can be done with less than 3 passes
<Ox0dea>
Yep, I think that might be the case.
<apeiros>
note that a | b alone is 3 passes per your def
<apeiros>
so (a | b) - (a & b) is 9 passes
<Ox0dea>
Eh, I guess #keys oughtn't really count as a pass.
<apeiros>
`TypeError: Enumerable is not a class` lelele
simplyianm has quit [Remote host closed the connection]
<Ox0dea>
Heh.
<apeiros>
Ox0dea: it might. depending on how Hash is implemented, it has to traverse to extract the keys.
KetaPan has joined #ruby
<Ox0dea>
Right, I just mean under the semantics I'm using to force myself to write this function as similarly to the existing set-likes as possible.
<apeiros>
hm, it works, but due to an optimization fails to keep order
<apeiros>
undoing opt.
<Ox0dea>
They all convert one of the arrays to a hash immediately, traverse the other, store the necessary info in a single hash, and then return that hash's keys at the end.
<Ox0dea>
It really feels like that contract can't be met for XOR, but it's hard to say exactly why.
<Ox0dea>
Something about the exclusivity of the thing.
<stanalanmcm>
I have two classes. I want each class to access the same array. I don't know how to do this. The goal is to have a method in each class which iterates through the same array. Does that make sense?
hotpancakes has joined #ruby
<apeiros>
stanalanmcm: just pass the same array to both classes in the constructor
<apeiros>
but it's hard to say what to do best without knowing what you ultimately try to achieve
<shevy>
you could actually put the array into a module; or you could use a constant in one class, and access to that content. or as apeiros wrote. lots of ways
<manveru>
anyone familiar with url templates? trying to figure out how to write a template that matches both http and https
sarkyniin has joined #ruby
<stanalanmcm>
hmm. What if the array is a list of objects made from one of the two classes?
xxneolithicxx has joined #ruby
<apeiros>
stanalanmcm: how about you don't feed us tiny bits?
<apeiros>
and instead show us what you want to do
<stanalanmcm>
I'm sorry.
bking39116 has joined #ruby
<stanalanmcm>
I'm not trying to feed you tiny bits. I don't really understand what I'm trying to do. I could show you my source and attempt to explain the goal. Would that help?
<apeiros>
yes. tremendously even :)
* havenwood
chants "Show the code! Show the code!"
rbennacer has quit [Remote host closed the connection]
<manveru>
code the show!
charliesome has joined #ruby
GitGud has quit [Ping timeout: 250 seconds]
<havenwood>
What do we want? Code! When do we want it? Time.now!
diegoviola has joined #ruby
<apeiros>
I get the feeling I'm not the only drunk. good.
<bougyman>
confused manveru. what does a template have to do with the uri scheme?
allomov has joined #ruby
<manveru>
fun fact: `puts zombies` is usually the same as `zombies.each{|zombie| puts zombie }`
ItSANgo_ has joined #ruby
<apeiros>
fun fact: I like p *zombies
<apeiros>
but nowadays it needs an additional ;0
<apeiros>
which is annoying as hell :(
lavros has joined #ruby
<manveru>
bougyman: well, i'm trying to avoid having to specify both interpolation format string and a matching regex
<shevy>
zombies ... hell ...
marr has joined #ruby
<stanalanmcm>
The part I'm stuck on is creating a following for each zombie. So, zombie bob wants to follow zombie joe. I have all zombies in an array of objects. I was thinking I could iterate through that array to get all of joe's tweets for bob. Makes sense?
<bougyman>
i guess I don't understand the problem space.
<manveru>
using a url template would allow me to do that... but looks like i'd have to write 3-4 versions for each url
<manveru>
well, easy: trying to provide users a way to give me urls for social networks
<bougyman>
ok
jas02 has quit [Ping timeout: 276 seconds]
jas02_ is now known as jas02
<manveru>
i'm classifying the url, allowing them to give me only the username, https/http/plain host, etd
<manveru>
*etc
<bougyman>
why don't you leverage URI for this?
<stanalanmcm>
It's ok if you want to make fun. :D I'm a student and this is my homework project. My instructor encourages us to seek help.
<bougyman>
we have similar inputs for integrations and i just let URI do the work.
<bougyman>
validation and formatting and such.
_blizzy_ has joined #ruby
<Ox0dea>
apeiros: Does Valaptors handle URIs out of the box?
<manveru>
i'm using Addressable::URI and Addressable::Template :)
<manveru>
but yeah, i can normalize them before parsing them
<apeiros>
Ox0dea: not in the first iteration.
ItSAN____ has quit [Ping timeout: 264 seconds]
<apeiros>
Ox0dea: there's a resolver for domain names in it already for email addresses, though.
AlphaAtom has joined #ruby
<apeiros>
and a domain name validator (for the same purpose)
<apeiros>
and I'll probably only ever add http/https uri validators
NomePadrao has joined #ruby
<Ox0dea>
apeiros: Validating the domain isn't sufficient for email addresses.
<apeiros>
Ox0dea: orly?
peter_paule has joined #ruby
<apeiros>
damn! now I have to throw away all of it!
<apeiros>
;-)
Axy has joined #ruby
Axy has joined #ruby
<Ox0dea>
I mean, don't you have to verify the MX record to actually ensure a mailbox can be delivered to?
NomePadrao has quit [Remote host closed the connection]
<apeiros>
you can't ensure you can deliver to a mailbox
Rollabunna has quit [Remote host closed the connection]
RegulationD has joined #ruby
<Ox0dea>
This I did not know.
<apeiros>
I verify the presence of an MX, A or AAAA record (those are used for delivery)
AlphaAtom has quit [Client Quit]
<apeiros>
and I verify that the email address is syntactically valid, but actually disallowing a couple of technically valid notations
zenguy_pc has quit [Read error: Connection reset by peer]
<Ox0dea>
I don't think the A and AAAA records have any bearing on mail delivery.
snsei has joined #ruby
<apeiros>
they do. MX record is not mandatory.
_blizzy_ has quit [Ping timeout: 248 seconds]
jas02_ has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
jas02_ has quit [Client Quit]
Mia has quit [Ping timeout: 248 seconds]
<Ox0dea>
A => Address, MX => Mail eXchange.
snsei has quit [Remote host closed the connection]
<Ox0dea>
TCP/IP is hard; let's go shopping.
<shevy>
lol
rbennacer has joined #ruby
<apeiros>
yes. still, the MTA is not resolved through MX alone. If an MX is present, it is used. but as said, it is not necessary.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<manveru>
while there may be some that bail on missing MX... i'm quite sure that's not required...
<jhass>
apeiros: you resolve CNAME chains prior I hope
MilleJamille has joined #ruby
jas02 has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ruby
peter_paule has quit [Ping timeout: 250 seconds]
Scroff has joined #ruby
rbennacer has quit [Remote host closed the connection]
<Ox0dea>
apeiros: You're not planning on disqualifying email addresses with comments in, are you?!
<Ox0dea>
That's, like, one of the best things CERN ever gave us.
<apeiros>
„Only resolvable, fully-qualified, domain names (FQDNs) are permitted when domain names are used in SMTP. In other words, names that can be resolved to MX RRs or A RRs“
<apeiros>
@ jhass
MilleJamille has quit [Remote host closed the connection]
<apeiros>
no CNAMEs
<apeiros>
somewhere that's updated to also include AAAA iirc
<apeiros>
don't make me look that shit up again :D
RegulationD has quit [Ping timeout: 256 seconds]
<apeiros>
I'm pretty sure end result was "domain must have MX, A or AAAA"
<jhass>
nah, CNAME is valid and then the target must have either of those
<jhass>
note a CNAME allows no other records besides it
<apeiros>
ah fuck me. make a pull request if you use valaptor and need that :-p
<apeiros>
or open a ticket and quote sources.
<jhass>
well, a good resolver should resolve the CNAME chain for you if you ask it for an A, AAAA, MX
konsolebox has quit [Quit: Leaving]
<apeiros>
is stdlib Resolv a good resolver?
IanV0rn has joined #ruby
<jhass>
I have no idea
s2013 has joined #ruby
MilleJamille has joined #ruby
<manveru>
is resolv anything more than a resolv.h wrapper?
<apeiros>
no idea
mcclurmc has quit [Ping timeout: 244 seconds]
<manveru>
can we talk about something more fun than mail?
rbennacer has quit [Remote host closed the connection]
Scroff has joined #ruby
wildroman2 has quit [Remote host closed the connection]
peter_paule has joined #ruby
charliesome has quit [Ping timeout: 252 seconds]
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Client Quit]
RobertBirnie has joined #ruby
pothibo has joined #ruby
troulouliou_dev has joined #ruby
hotpancakes has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pothibo>
In what circumstances does bundler needs to check for /usr/local/bundle/config ? I have an issue with Bundler in Docker and it looks at that file and I want it not to
yayfoxes_ has quit [Ping timeout: 252 seconds]
bf4 has quit [Ping timeout: 252 seconds]
WeZZard has joined #ruby
<apeiros>
oh dear, I should parametrize DNS resolving if I move it to utilities. atm it is hard-coded for MX, A and AAAA…
Yiota has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
<Ox0dea>
apeiros: For what it's worth, I was unable to find anything about AAAA being a valid fallback in the absence of an MX record.
<Ox0dea>
Do you happen to vaguely recall the source on that?
vyorkin has quit [Read error: Connection reset by peer]
lkba_ has joined #ruby
hotpancakes has joined #ruby
hotpancakes has quit [Remote host closed the connection]
Scroff has joined #ruby
<jhass>
Ox0dea: I could imagine it's somewhere in some RFC errata, but the fallback to A definitely exists and then the fallback to AAAA is implied for IPv6 capable systems
hotpancakes has joined #ruby
<apeiros>
Ox0dea: no idea. it might even be in some documents how actual MTAs behave.
<Ox0dea>
Makes perfect sense.
<apeiros>
because - sadly - not everything follows specs :(
<apeiros>
(cf IRC, huehuehue)
Scroff has quit [Remote host closed the connection]
Rollabunna has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
MilleJamille has quit [Remote host closed the connection]
rbennacer has joined #ruby
sfarley has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
simplyianm has quit [Remote host closed the connection]
diego1 has joined #ruby
djellemah has quit [Ping timeout: 250 seconds]
MasterPiece has joined #ruby
diegoviola has quit [Ping timeout: 256 seconds]
simplyianm has joined #ruby
fantazo has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diego1 has quit [Changing host]
diego1 has joined #ruby
craysiii has joined #ruby
mcclurmc has joined #ruby
memph1s has joined #ruby
simplyianm has quit [Remote host closed the connection]
diego2 has joined #ruby
foureight84 has joined #ruby
Scroff has joined #ruby
diego2 has quit [Client Quit]
jamesaxl has joined #ruby
<sphex>
Ox0dea: didn't follow the whole conversation, but nowadays it's a good idea to follow getaddrinfo()-like behavior (that is, try to connect to all the record types for the supported address families) for pretty much everything, including SMTP prolly. after resolving the MX, existing MTAs follow this behavior (and prolly do the same thing if there's no MX).
Scroff has quit [Read error: Connection reset by peer]
Scroff has joined #ruby
Yiota has joined #ruby
<zacts>
ruby my dear
<zacts>
you are so fabulous ruby, let me tell you. you rock
diego1 has quit [Ping timeout: 250 seconds]
mcclurmc has quit [Ping timeout: 244 seconds]
roolo has joined #ruby
<sphex>
zacts: I know I know, but.. let's not.. make this weird :p
NeverDie has joined #ruby
<Ox0dea>
sphex: Sure, "be liberal with what you accept" and all that. It still "feels" off, but I know it's these little bendings of the rules that're holding the madness together.
<Ox0dea>
zacts: Favorite Ruby feature, go!
bubbys has quit [Ping timeout: 264 seconds]
<zacts>
alright
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea>
Your answer should've been instinctual; you do not yet have a favorite Ruby feature, padawan.
bubbys has joined #ruby
Carnage\ has joined #ruby
* sphex
points at zacts and screeches
* zacts
cries
<zacts>
I was just trying to say ruby is cool
Rickmasta has joined #ruby
foureight84 has quit [Quit: Be back later ...]
antgel has quit [Remote host closed the connection]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tubuliferous_ has joined #ruby
AlphaAtom has joined #ruby
bubbys has quit [Ping timeout: 265 seconds]
Yiota has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
bubbys has joined #ruby
AlphaAtom has joined #ruby
stanalanmcm has quit [Quit: Leaving]
s2013 has joined #ruby
<shevy>
lol
sankaber has joined #ruby
<shevy>
what is with sundays
<shevy>
are people in general more drunk then?
<zacts>
shevy: I just woke up
<shevy>
ok so it's saturday night alcohol leftover :)
tubuliferous_ has quit [Ping timeout: 272 seconds]
yqt has joined #ruby
<wasamasa>
night fever!
<wasamasa>
that argumentation wouldn't work if you were a cat BTW
cashnguns has quit [Remote host closed the connection]
bubbys has quit [Ping timeout: 244 seconds]
bubbys has joined #ruby
Scroff has quit [Remote host closed the connection]
* wasamasa
has a very sleepy one between his legs
jcoe has joined #ruby
Al3ks has quit [Remote host closed the connection]
DLSteve has quit [Quit: Leaving]
Versality has quit [Quit: Be back later ...]
yqt has quit [Ping timeout: 276 seconds]
sarkyniin has quit [Ping timeout: 256 seconds]
<shevy>
well
<shevy>
yesterday was caturday
learath has left #ruby [#ruby]
yqt has joined #ruby
Scroff has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has joined #ruby
GitGud has joined #ruby
craysiii has quit [Ping timeout: 248 seconds]
stryek has quit [Quit: leaving]
phutchins has quit [Ping timeout: 250 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cache_Money has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
multi_io has quit [Ping timeout: 252 seconds]
renderful has joined #ruby
Yiota has joined #ruby
charliesome has joined #ruby
sarkyniin has joined #ruby
craysiii has joined #ruby
<zacts>
I don't drink alchohol
multi_io has joined #ruby
<zacts>
but I did wake up to my cat who pissed in my closet
AlphaAtom has joined #ruby
ruv has quit [Ping timeout: 256 seconds]
<shevy>
lol
<zacts>
anyway, got to eat so bbl
<shevy>
isn't that a happy way to wake up
<zacts>
shevy: not my cats, trust me
Muhannad has joined #ruby
<zacts>
but my mum has a wild ferral cat or whatever she got as a stray
AlphaAtom has quit [Max SendQ exceeded]
<zacts>
and no-one else will take them
Muhannad has quit [Remote host closed the connection]
<shevy>
teach it some ruby
<shevy>
to make it a better cat... one that won't piss into the closet
<Ox0dea>
Cats should learn LOLCODE.
varunwachaspati has quit [Remote host closed the connection]
<bougyman>
cats invented lolcode
<Ox0dea>
It follows naturally that dogs should be taught how to program in Dogescript.
AlphaAtom has joined #ruby
<Ox0dea>
bougyman: It is known.
Muhannad has joined #ruby
Muhannad has quit [Max SendQ exceeded]
renderful has quit [Ping timeout: 255 seconds]
Muhannad has joined #ruby
startupality has joined #ruby
craysiii has quit [Ping timeout: 248 seconds]
AlphaAtom has quit [Remote host closed the connection]
fantazo has quit [Ping timeout: 272 seconds]
Scroff has quit [Remote host closed the connection]
Muhannad has quit [Max SendQ exceeded]
Muhannad has joined #ruby
Omilun has joined #ruby
AlphaAtom has joined #ruby
wildroman2 has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
blue_deref has quit [Quit: bbn]
<Omilun>
hello i have a problem ... i can not use irb ... initialize
AlphaAtom has quit [Remote host closed the connection]
toretore has quit [Quit: This computer has gone to sleep]
lavros has quit [Quit: leaving]
sfarley has quit [Remote host closed the connection]
charliesome has joined #ruby
<SCHAAP137>
Omilun: it looks like you were already in irb
<SCHAAP137>
ah, nm
sfarley has joined #ruby
RegulationD has joined #ruby
knite has joined #ruby
hardye has joined #ruby
ubuntu_ has joined #ruby
<ubuntu_>
Hey guys, I'm getting a `step': UNIQUE constraint failed: words.word (SQLite3::ConstraintException) error even though all I am doing is a select statement
<ubuntu_>
Also, I'm running this through ruby-sqlite3 and when the exact same query is ran directly through sqlite3, it works
hotpancakes has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 264 seconds]
Channel6 has quit [Quit: Leaving]
nofxx has joined #ruby
kraljev11 has joined #ruby
Versality has joined #ruby
eggoez has quit [Ping timeout: 272 seconds]
drewo has quit [Ping timeout: 264 seconds]
Al3ks has joined #ruby
hardye is now known as subsonik
bf4 has joined #ruby
drewo has joined #ruby
pwnz0r has joined #ruby
havenwood has joined #ruby
peter_paule has joined #ruby
pwnz0r has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
Rollabunna has joined #ruby
eggoez has joined #ruby
mcclurmc has joined #ruby
<Ox0dea>
ubuntu_: The two operations are obviously not being run on the same data.
<Ox0dea>
ubuntu_: That error means you're trying to add a word to the words column that already exists there, thus breaking the uniqueness constraint, which I would assume you placed there on purpose.
<Ox0dea>
The words table, rather.
Omilun has left #ruby [#ruby]
dgutierrez1287 has quit [Remote host closed the connection]
allomov has joined #ruby
mrmargolis has joined #ruby
drewo has quit [Ping timeout: 256 seconds]
yqt has quit [Ping timeout: 264 seconds]
kraljev11 has quit [Read error: Connection reset by peer]
Rollabunna has quit [Ping timeout: 248 seconds]
j4cknewt has quit [Remote host closed the connection]
lavros has joined #ruby
mcclurmc has quit [Ping timeout: 265 seconds]
charliesome has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
dseitz has joined #ruby
kraljev11 has joined #ruby
hotpancakes has joined #ruby
IanV0rn has joined #ruby
peter_paule has quit [Ping timeout: 244 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GitGud has quit [Ping timeout: 256 seconds]
hotpancakes has quit [Ping timeout: 264 seconds]
blackmesa has joined #ruby
yqt has joined #ruby
hotpancakes has joined #ruby
Guest73614 has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
hololeap has joined #ruby
<hololeap>
is there a shorthand for `if obj.respond_to? :a_method and obj.a_method` ?
iamninja has joined #ruby
AlphaAtom has joined #ruby
Squarepy has quit [Quit: Leaving]
<Ox0dea>
hololeap: Nothing you should actually use.
<apeiros>
hololeap: you do know that `if obj.respond_to? :a_method and obj.a_method` does not do what you think it does?
<apeiros>
and no, there's no shorthand for it in plain ruby.
<hololeap>
apeiros: ok, but what do you mean about the first part?
<Ox0dea>
hololeap: `and` is not the same as `&&`.
Azure has joined #ruby
<Ox0dea>
It is, in fact, very different.
<hololeap>
i understand that
<Ox0dea>
Nuh-uh.
zenguy_pc has quit [Read error: Connection reset by peer]
<apeiros>
oh, actually it parses in the order you expected it
<apeiros>
ah right, in assignment it'll not.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spider-mario has joined #ruby
s2013 has joined #ruby
fantazo has joined #ruby
casadei has joined #ruby
<Ox0dea>
hololeap: Have you considered nicking Object#try from ActiveSupport?
armyriad has quit [Quit: Leaving]
<hololeap>
Ox0dea: that's kind of what i was looking for (and i am using that in my current project), but i need to check if the object responds to a method before calling it, but i in this line of code the i know with certainty that the object won't be nil
senayar has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 250 seconds]
<Ox0dea>
Famous last words. :)
<hololeap>
so i don't see how i would use .try in this case. it was silly of me to think there woiuld be a shorthand for it :)
snsei has joined #ruby
armyriad has joined #ruby
YamakasY has quit [Disconnected by services]
jcoe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
<nofxx>
Object#methods is not ruby core is it? Got so many debug gems
<Ox0dea>
Of course it is.
kraljev11 has quit [Ping timeout: 250 seconds]
CustosLimen has joined #ruby
<Ox0dea>
>> Object.methods.grep(/methods/)
<ruboto>
Ox0dea # => [:instance_methods, :public_instance_methods, :protected_instance_methods, :private_instance_methods ...check link for more (https://eval.in/388809)
<nofxx>
you could do obj.methods.include? ahh.. nevermind
<Ox0dea>
nofxx: Ctrl-A+K in future. ^_^
hectortrope is now known as noobQ
_ht has quit [Quit: Konversation terminated!]
<nofxx>
Ox0dea, what's that? erc ?
<Ox0dea>
nofxx: I was being unnecessarily mean. I apologize.
drewo has joined #ruby
<nofxx>
Ox0dea, no, ok, just curiosity of the K to clean
subsonik has left #ruby ["Leaving"]
<nofxx>
irc client
pwnz0r has joined #ruby
<Ox0dea>
Ctrl-A goes to the beginning of the line, Ctrl-K kills to the end.
<Ox0dea>
It was a poorly timed joke, though, as you seem to be at a very important stage of your Ruby learning.
sandstrom has joined #ruby
<nofxx>
Ox0dea, pardon my french... was just curiosity if you're using erc. I use emacs (and ctrl+a and k's every minute)
abderian has joined #ruby
<nofxx>
but I dont use erc
<Ox0dea>
Yes, you can ask objects all sorts of things about themselves, and they (tend to) give you the results in plain ol' Ruby objects, on which you can apply what you already know to deepen your understanding.
<Ox0dea>
nofxx: Ah, I use WeeChat, which does use a lot of Emacs' bindings by default.
Scroff has joined #ruby
idafyaid has quit [Remote host closed the connection]
Scroff has quit [Read error: Connection reset by peer]
<nofxx>
Ox0dea, hehe, thanks, sorry all the misunderstanding ;)
<ruboto>
Ox0dea # => [Process::Tms, RubyVM::InstructionSequence, Enumerator::Generator, Enumerator::Lazy, Enumerator, Obj ...check link for more (https://eval.in/388812)
sfarley has quit [Remote host closed the connection]
<abderian>
Anyone know why when you create an array like this a = Array.new(10, "#" * 10). Changing the first string's first character changes all of strings in the array? For example a[0][0] = "X" will modify all of the strings in the array
blackmesa has quit [Ping timeout: 256 seconds]
Scroff has quit [Read error: Connection reset by peer]
acke_ has joined #ruby
<Ox0dea>
abderian: Strings are mutable references in Ruby.
<Ox0dea>
abderian: Ruby uses references all over the place in order to avoid unnecessarily copying things around, which helps your program execute more quickly.
memph1s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
memph1s has joined #ruby
memph1s has quit [Client Quit]
gix has quit [Ping timeout: 248 seconds]
pwnz0r has joined #ruby
mcclurmc has quit [Ping timeout: 248 seconds]
revoohc has quit [Quit: revoohc]
unshadow has quit [Quit: leaving]
allomov has quit [Remote host closed the connection]
pwnz0r has quit [Remote host closed the connection]
sandelius has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
zacts has joined #ruby
gix has joined #ruby
Scroff has joined #ruby
zenguy_pc has quit [Read error: No route to host]
snsei has joined #ruby
j4cknewt has quit [Remote host closed the connection]
hotpancakes has quit [Remote host closed the connection]
Scroff has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 250 seconds]
__butch__ has joined #ruby
blackmesa has joined #ruby
j4cknewt has joined #ruby
Papierkorb has joined #ruby
<weaksauce>
crossposting from #vim anyone gotten macvim to work well with chruby? If I chruby to a version of ruby that vim was not compiled against it will crash the ruby interpreter every time the mouse hovers over an identifier. I aliased vi to chruby 2.1.5 && /path/to/macvim but that has the undesirable effect of changing the version of ruby for that terminal session too.
mrmargolis has quit [Remote host closed the connection]
Asher has joined #ruby
eggoez has joined #ruby
doertedev has quit [Quit: leaving]
Marisa has joined #ruby
yfeldblum has joined #ruby
<Marisa>
Happy Tau Day everyone
<havenwood>
weaksauce: If so: make install prefix="..." STRIP="/usr/bin/true"
<Marisa>
Ruby needs a tau constant in it's Math module
<Marisa>
*its
<havenwood>
Marisa: Happy Tau day!
bf4 has quit [Ping timeout: 264 seconds]
<weaksauce>
curious. I ran that command :ruby p RUBY_VERSION and it says "2.0.0" when I had chruby 2.1.5 selected. and it constantly crashes with chruby 2.2.2
<weaksauce>
havenwood actually it seems to always print out 2.0.0. the ruby interpreter works in the crashing version but it fails when I hover over an identifier in a ruby file. any idea how to shut off the popup definition thing?
* yorickpeterse
is learning Colemak
Cache_Money has joined #ruby
<Ox0dea>
yorickpeterse: What didn't you like about Dvorak?
<havenwood>
weaksauce: 2.0? Sounds like system Ruby.
<yorickpeterse>
jhass: I already have goto_if_undef/goto_if_def, cbf renaming those
Cache_Money has quit [Client Quit]
<yorickpeterse>
funny enough the VM does already have an object model, method dispatch and multi-threading
<yorickpeterse>
it just lacks everything else
<ljarvis>
so, the important stuff?
<yorickpeterse>
(e.g. a GC, kinda crucial)
mrmargolis has quit [Remote host closed the connection]
<ljarvis>
looking good though
<yorickpeterse>
Yeah it's coming along nicely
<ljarvis>
you're way ahead of my progress on my vm which was started at around the same time
<ljarvis>
(not in rust.. ft)
<yorickpeterse>
it took me about 2 years to get here
<Ox0dea>
_blizzy_: Brackets everywhere is often indicative of a failure to truly understand your data and how best to structure your program around it.
<ljarvis>
yorickpeterse: 5 and a half for me
<yorickpeterse>
heh
<yaw>
defining a private method in a subclass will override a similarly named private method in the parent class?
<ljarvis>
?try
<ruboto>
Why don't you try it and see for yourself?
<_blizzy_>
Ox0dea, oh. I disagree, but ok.
<Ox0dea>
_blizzy_: Please defend.
<yorickpeterse>
For me one of the most difficult parts was setting up the object model
vyorkin has joined #ruby
<_blizzy_>
Ox0dea, I'd rather not.
<yaw>
ljarvis I tried, and looks like that's the case
<yaw>
but Rails is making me think otherwise
<yorickpeterse>
e.g. the language is OO, so you need to represent a class and instance in the VM. But since a Class is also an instance this gets super confusing
<ljarvis>
yaw: yeah rails will do that
<_blizzy_>
rails is cool.
<ljarvis>
yorickpeterse: sounds complex
<yorickpeterse>
because you'll have a Class struct and an Object struct, and a Class is just the layout in the VM (methods, etc) and an Object can wrap it to represent a Class instance in the language and my brain explodes at this point
<yorickpeterse>
so I just made it prototype based
<yaw>
I'd go ahead and ask the question in #rubyonrails then
<yorickpeterse>
problem solved
<yaw>
thanks :)
bking39116 has left #ruby [#ruby]
sinkensabe has quit [Remote host closed the connection]
<yorickpeterse>
(the language is still class based)
<yorickpeterse>
Plus the bootstrapping of core types has been moved out of the VM
<ljarvis>
yorickpeterse: sounds like that's how javascript was built /s
<yorickpeterse>
e.g. there will be basically very little code for, say, String, written in Rust
<ljarvis>
yorickpeterse: you gonna boostrap this thing? :D
<ljarvis>
yeah I have a lot of notes but i wasn't very organised and it's a bit of a mess
<yorickpeterse>
I probably should've bookmarked more along the way
<ljarvis>
lua/luajit is one of my favourite projects
<havenwood>
yorickpeterse: enjoy Rust?
<yorickpeterse>
The biggest problem with VMs is that the core of it is not that hard
<yorickpeterse>
As in, not harder than usual projects
<yorickpeterse>
it's just that getting started requires reading a ton of academic shit
<yorickpeterse>
(because they're so abstract and such)
snsei has quit [Remote host closed the connection]
<yorickpeterse>
havenwood: it's ok so far
<yorickpeterse>
like most systems languages it's verbose as heck
<yorickpeterse>
but not as bad as Java
snsei has joined #ruby
<yorickpeterse>
if it wasn't for the Rust IRC channel I would've dropped it by now probably
urbanmonk has joined #ruby
mcclurmc has joined #ruby
<ljarvis>
that didn't stop me :(
<ljarvis>
i just don't have the patience anymore
allomov has joined #ruby
<yorickpeterse>
I'm single and no hobbies, I have plenty of time :P
<yorickpeterse>
* and have no
<ljarvis>
heh
Scroff has joined #ruby
<apeiros>
it seems to me you have a hobby
Scroff has quit [Read error: Connection reset by peer]
<yorickpeterse>
Also no plans for children, so that should cover it for the next 60 years
<yorickpeterse>
apeiros: No, that's my life
<yorickpeterse>
as odd as that may sound
<ljarvis>
no "plans"
<ljarvis>
heh
snsei has quit [Remote host closed the connection]
<yorickpeterse>
ljarvis: well yeah, accidents can happen, but I'm hoping it won't
Scroff has joined #ruby
<ljarvis>
:D
hotpancakes has quit [Remote host closed the connection]
<yorickpeterse>
Not looking forward to sacrificing 20 years of my life racing some ugly bag of water
<apeiros>
having life as a hobby sounds nice
<ljarvis>
i would get so much done
k3asd` has joined #ruby
<yorickpeterse>
and well I'm starting martial arts again, so I guess that counts as a hobby
<ljarvis>
all i do is work
<ljarvis>
fml
hotpancakes has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
<yorickpeterse>
honestly I wouldn't be surprised if I die behind my computer at age 95 or something
mcclurmc has quit [Remote host closed the connection]
<yorickpeterse>
"Yeah we found Yorick, he died while writing an angry bug report"
snsei has joined #ruby
Scroff has joined #ruby
<ljarvis>
95?
<ljarvis>
that's impressive
<yorickpeterse>
most of my family gets stupid old
<ljarvis>
ah
<ljarvis>
mine not so much
<yorickpeterse>
e.g. my father's parents are in their 90s (though his mother died a while back), from my mother's side they also turned pretty old IIRC
vasilakisfil_ has joined #ruby
<Ox0dea>
It's theorized that the first person who'll live to 150 has already been born.
AlexAltea has joined #ruby
<Ox0dea>
Also, you were once the youngest person in the world.
<ljarvis>
deep
<yorickpeterse>
I hope we invent cloning before then
<yorickpeterse>
so I can just clone myself, copy my brain, live on
snsei has quit [Remote host closed the connection]
<Ox0dea>
yorickpeterse: #clone or #dup?
Aryasam has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
<ljarvis>
deep clone
<yorickpeterse>
"Name and date of birth" "Yorick, 1992" "what, that's 300 years ago"
<yorickpeterse>
"u mad?"
uber has joined #ruby
<yorickpeterse>
also if you think of it, getting super old is probably super depressing
<yorickpeterse>
because everybody you know will be gone (assuming they're not cloned too)
<yorickpeterse>
Hm, I also wonder how long the brain would be able to remember things
<yorickpeterse>
e.g. would it just forget, say, your first 50 years after 300 years of living?
Marisa has quit [Ping timeout: 246 seconds]
<ljarvis>
na
<ljarvis>
i say that with absolutely no certaintly of this fictional scenario we're in
ytti has quit [Ping timeout: 258 seconds]
<Ox0dea>
I don't think recall follows any particular curve.
<Ox0dea>
Certain memories are just indelible.
Scroff has joined #ruby
<yorickpeterse>
that's the thing though, nobody has ever reached such an age so we can't really know
<yorickpeterse>
unless there's ways to test how much you can cram in the human brain
<ljarvis>
i hope i don't live that long
Scroff has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
<ljarvis>
c has been full of lots of noobs lately, i wonder where everyone is coming from
<Ox0dea>
Zed Shaw was in the news again.
<ljarvis>
has he been helping old ladies cross roads again?
<shevy>
was he involved in a gun fight
<Ox0dea>
He finally seceded the fight against K&R.
<ljarvis>
heh
charliesome has joined #ruby
<ljarvis>
the c code in his book is dogshit anyway imo
<Ox0dea>
weaksauce: You're gonna need a bigger shovel.
<yorickpeterse>
ljarvis: so ideally you'd "freeze" your body's age, or clone it at a young age
<weaksauce>
Ox0dea say what?
<yorickpeterse>
I can't imagine living in the body of an 80 year old for 100s of years
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
right yeah
<Ox0dea>
weaksauce: If you're fine with that result, you're liable to dig yourself into all sorts of other holes.
<ljarvis>
that'd suck
<weaksauce>
you have a suggestion on how to fix it?
<lundell>
Hello! I'm new to Ruby and just want to know if there is any way to iterate through an array without .each because I want to decide myself when it should iterate. Anyone who can point me in the right direction? Not too familiar with the syntax yet, but I really like it so far,
Scroff has quit [Read error: Connection reset by peer]
<Ox0dea>
weaksauce: Blow it all away and begin anew; it's often quite therapeutic.
<yorickpeterse>
lundell: you can use an Enumerator
<weaksauce>
Ox0dea got any actionable advice other than "throwing it all away"?
<weaksauce>
otherwise I have to assume you are a troll.
<ljarvis>
lundell: fwiw enumerable methods without blocks often return Enumator objects
<ljarvis>
Enumator
<ljarvis>
new class
mcclurmc has joined #ruby
<Ox0dea>
They're a little heavier, though.
<lundell>
sweet! Thanks! I'm learning Ruby and I set up my own project to merge two log files to one big log file based on the timestamps.
lfox has joined #ruby
<Ox0dea>
lundell: That sounds like a really good beginner project.
<ljarvis>
:)
kirun has quit [Quit: Client exiting]
<ljarvis>
glad to see you're caring about memory
<Ox0dea>
Ha.
SCHAAP137 has quit [Remote host closed the connection]
_ixti_ has joined #ruby
<yorickpeterse>
"memory is cheap!"
<lundell>
I want it linear and not exponential growth the bigger the logs are.
<Ox0dea>
lundell: So... insertion sort?
<Ox0dea>
Ah, never mind, you didn't specify that the logs are live.
<lundell>
Nah they are not up and running, it's for my own sake I'm doing this to make my job a little bit easier.
<ljarvis>
nice one
kraljev11 has quit [Quit: kraljev11]
kraljev11 has joined #ruby
snsei has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
bf4 has joined #ruby
iamninja has joined #ruby
<Ox0dea>
lundell: Are your timestamps uniform and at the beginnings of lines?
<lundell>
Yes I already got the regex down and I can parse the log to an output :)
<Ox0dea>
lundell: Do you know about lexicographical ordering?
<lundell>
It's just that I need to get two logs in to each array and make sure I put the earliest timestamp first and iterate in a way that it's not going to be exponential.
dgutierr_ has quit [Remote host closed the connection]
<Ox0dea>
I shall refrain from spoiling your fun.
<lundell>
Ox0dea no, my math is kinda basic and so is my programming skills. I'm trying to learn as best as I can :)
sinkensabe has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: zzz]
<lundell>
Please spoil if you want :) It's informative and thats a good thing.
<lundell>
oh, greater number the further up in the alphabet?
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kraljev11 has quit [Ping timeout: 276 seconds]
<Ox0dea>
Right, but the strings are being compared one character at a time.
<lundell>
ah ok. basicly like in C, where the strings are char arrays?
<Ox0dea>
As soon as Ruby has determined that one string is "less than" or "greater than" the other, it stops processing, because no later character can change its mind.
<Ox0dea>
lundell: Yes, mostly like that. In C, characters are really just integers, and we can expose that truth in Ruby as well.
hotpancakes has quit [Remote host closed the connection]
<Ox0dea>
Since all the hyphens and colons are in the same places, only the figures will matter in the sorting.
<Ox0dea>
And since Ruby stops bothering as soon as it has determined the "winner", the rest of the line doesn't matter.
<lundell>
ah ok, so I can basicly just parse out that time stamp? I don't have to make a date object for that? This is great!
niemcu has quit [Quit: Leaving]
<Ox0dea>
You needn't even do any parsing, my friend.
Xiti has quit [Quit: Xiti]
vickleton has quit [Quit: Ex-Chat]
<ljarvis>
this is what a project would boast as zero allocations
<ljarvis>
aka herp derp sizzurp
sinkensabe has joined #ruby
Xiti has joined #ruby
rbennacer has quit [Ping timeout: 248 seconds]
sinkensabe has quit [Read error: Connection reset by peer]
* ljarvis
back to pretending to code
<lundell>
doesn't ruby parse that string? Isn't parsing reading a specific part of a string?
sinkensabe has joined #ruby
<Ox0dea>
lundell: Parsing is breaking a string up into meaningful pieces.
<lundell>
So you say that I can just iterate through the whole line and if it differs on the time stamp it wont bother checking the text?
<Ox0dea>
What you've got are a bunch of lines that, by virtue of being properly timestamped, can all be compared naturally with each other, exactly as they are.
snsei has quit [Ping timeout: 248 seconds]
<lundell>
This is awesome. But is this only for ruby that it checks character for character?
<Ox0dea>
Many languages do lexicographical ordering.
<Ox0dea>
Python and JavaScript immediately spring to mind.
<Ox0dea>
But you didn't hear that.
<lundell>
:d
mcclurmc has quit [Remote host closed the connection]
Rollabunna has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
<lundell>
Amazing, thank you so much!
<Ox0dea>
I do advise you carry on with your line-by-line approach; if nothing else, it'll be much more educational.
<Ox0dea>
Truth be told, I've been spewing nonsense and none of that is actually valid Ruby.
nateberkopec has joined #ruby
Rollabun_ has joined #ruby
Rollabun_ has quit [Read error: Connection reset by peer]
<lundell>
I still need to do the line by line so the time it takes to merge is linear depending on how big the logs are.
hotpancakes has joined #ruby
renderful has quit [Remote host closed the connection]
micmus has quit [Quit: Leaving]
Rollabun_ has joined #ruby
allomov has quit [Remote host closed the connection]
<Ox0dea>
Ruby's #sort is essentially O(n), but it's certainly the case that a cleverer approach could save on both time and memory.
<lundell>
The thing is that in file1.log it can print 20 things in a min but in file2.log it might be empty so that iterator needs to remember it's place so I dont have to iterate through file2 everytime file1 goes to the next step.
startupality has quit [Quit: startupality]
Rollabu__ has joined #ruby
<lundell>
or not empty, but a hole in the log for 20 min*
<Ox0dea>
lundell: Are you passing these files in on the command line?
yaw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lundell>
Right now I just name them a special way isntead of going *-log.* so I just name it e.g. x.log and y.log
greenbagels has joined #ruby
Rollab___ has joined #ruby
<lundell>
and put them in the same folder.
Rollabunna has quit [Ping timeout: 248 seconds]
yaw has joined #ruby
Rollab___ has quit [Read error: Connection reset by peer]
yaw has quit [Max SendQ exceeded]
Rollabunna has joined #ruby
matp has quit [Excess Flood]
thebastl has joined #ruby
GPrime has joined #ruby
Rollab___ has joined #ruby
Rollabun_ has quit [Ping timeout: 248 seconds]
riotjone_ has joined #ruby
<Ox0dea>
$ ruby -e 'puts ARGF.sort' *.log
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
Rollab___ has quit [Read error: Connection reset by peer]
<Ox0dea>
lundell: I shit you not, that tiny little command would output your whole collection in timestamp-order.
Rollabun_ has joined #ruby
<Ox0dea>
But your box will explode if you actually run it!
Rollabu__ has quit [Ping timeout: 248 seconds]
<Ox0dea>
So do the line-by-line thing instead.
<lundell>
wtf, how?
<lundell>
oh ok
<Ox0dea>
I am so serious right now.
thebastl has quit [Client Quit]
<Ox0dea>
Do not run that command, mate.
<lundell>
I wont
<Ox0dea>
Phew.
<lundell>
And right now I don't sit on the 800mb logs either since I'm on my vacation. :)
Rollabu__ has joined #ruby
<Ox0dea>
Are megabytes those things people hand out to children during All Hallow's Eve?
riotjones has quit [Ping timeout: 250 seconds]
<Ox0dea>
Nah, I'm only poking fun.
<lundell>
But another thing, should I just open two file streams and go from there, or first just put all lines in one array per file? How would you do it?
Rollabu__ has quit [Read error: Connection reset by peer]
Rollabu__ has joined #ruby
<Ox0dea>
I'd use ARGF and shell globs.
<Ox0dea>
But that's only because I fire-proofed my machine!
Channel6 has quit [Quit: Leaving]
Rollabunna has quit [Ping timeout: 248 seconds]
<Ox0dea>
Really, though, if you want to build up a sorted array little by little, insertion sort is a good first brush.
Rollabunna has joined #ruby
<lundell>
Like right now when I was trying to get my regex to work I just opened one file and iterated through it.
GnuYawk has quit [Read error: No route to host]
<Ox0dea>
Well, it's been established that regular expressions are overkill for sorting timestamped data. Do you still feel you need to parse your lines?
jfarmer has joined #ruby
Rollabun_ has quit [Ping timeout: 248 seconds]
drewo has quit [Ping timeout: 248 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
snsei has joined #ruby
Azure has joined #ruby
Rollabun_ has joined #ruby
vasilakisfil_ has quit [Ping timeout: 256 seconds]
<lundell>
But is it faster to read the file to an array and then use the two arrays to write to the output file? Or should I just keep the files open and iterate through and copying the line I need to the output file?
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
baweaver has joined #ruby
Rollabun_ has quit [Read error: Connection reset by peer]
<Ox0dea>
It wouldn't make sense to write out to a file until you had a sorted collection, right?
Rollabun_ has joined #ruby
<Ox0dea>
What happens if you've been printing, only to discover that this line should go before one you've already printed.
<lundell>
Well I just remembered that sometimes info is printed on several rows so I do actually need the regex. If the next or isn't a timestamp it should put it in the file too.
<Ox0dea>
Oh, excellent! Then yes, you'll need to parse your input. ;)
kraljev11_ has quit [Quit: kraljev11_]
kraljev11 has joined #ruby
Rollab___ has joined #ruby
kraljev11 is now known as kraljev11_
Rollabu__ has quit [Ping timeout: 248 seconds]
<Ox0dea>
Note well that that doesn't mean you'll need to bother with converting it into an actual Date object.
Rollabu__ has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
<lundell>
True. But what I thought was if I have 20 rows in each file as an example. and the first 10 rows in file2 is earlier than file1, so fileone is still on row 0 but file2 is on row9. I'm just thinking that I could do if row 0 in file1 < row 9 in file2 then output.puts row 0 in file 1
Rollabunna has joined #ruby
<Ox0dea>
lundell: Insertion sort.
<Ox0dea>
Insertion sort is basically how you, as a human being, would put a deck of cards in order.
<Ox0dea>
You take each card, figure out where it should go, and drop it in.
<lundell>
But wouldn't that take longer? Alot longer?
<lundell>
the bigger deck the longer it takes to check if it's going in the last spot.
<weaksauce>
lundell your logs are all sorted individually by the nature of them being append only logs
Rollabun_ has joined #ruby
<weaksauce>
just read a line at a time from each and insert the lowest timestamp of the bunch into a new file.
Rollab___ has quit [Ping timeout: 248 seconds]
<baweaver>
if array.length < 1000 then selection_sort else quick_sort end
<baweaver>
insertion*
Rollab___ has joined #ruby
Rollabu__ has quit [Ping timeout: 248 seconds]
Rollab___ has quit [Read error: Connection reset by peer]
Rollabu__ has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
al2o3-cr has quit [Quit: WeeChat 1.2]
Rollabunna has joined #ruby
IanV0rn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<lundell>
weaksauce thats what I will do. But I had not figure out a way for me to tell the program to iterate :) But I learned about enumerator just now
quazimodo has quit [Ping timeout: 246 seconds]
k3asd` has quit [Ping timeout: 246 seconds]
Rolla____ has quit [Ping timeout: 248 seconds]
quazimodo has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
Rollab___ has joined #ruby
Rollabun_ has quit [Ping timeout: 248 seconds]
Rollab___ has quit [Read error: Connection reset by peer]
ruv has joined #ruby
Rollabun_ has joined #ruby
Rollabun_ has quit [Read error: Connection reset by peer]
Rollabun_ has joined #ruby
Rollabu__ has quit [Ping timeout: 248 seconds]
EasyCo has joined #ruby
humd1ng3r has joined #ruby
Rollabun_ has quit [Read error: Connection reset by peer]
Rollabun_ has joined #ruby
snsei has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 248 seconds]
al2o3-cr has joined #ruby
Rollabunna has joined #ruby
towski_ has joined #ruby
Rollabunna has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rollabu__ has joined #ruby
sinkensabe has quit [Remote host closed the connection]
mcclurmc has joined #ruby
millerti has joined #ruby
eggoez has joined #ruby
Rollab___ has joined #ruby
quazimodo has quit [Ping timeout: 252 seconds]
snsei has joined #ruby
pwnz0r has quit [Remote host closed the connection]
Rollabun_ has quit [Ping timeout: 248 seconds]
Pupeno has joined #ruby
Rollabun_ has joined #ruby
urbanmonk has quit [Quit: urbanmonk]
Rolla____ has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
Rollabunna has joined #ruby
Rollabu__ has quit [Ping timeout: 248 seconds]
RegulationD has joined #ruby
Rollabu__ has joined #ruby
Rollab___ has quit [Ping timeout: 248 seconds]
eggoez has quit [Ping timeout: 248 seconds]
Pupeno has quit [Ping timeout: 256 seconds]
cvtsx has joined #ruby
Rollab___ has joined #ruby
Rollabun_ has quit [Ping timeout: 248 seconds]
Rollab___ has quit [Read error: Connection reset by peer]
Rollabun_ has joined #ruby
Rolla____ has quit [Ping timeout: 248 seconds]
cvtsx1 has quit [Ping timeout: 248 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Rollab___ has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
Igorshp has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
Rollabunna has joined #ruby
Rickmasta has joined #ruby
Rollabu__ has quit [Ping timeout: 248 seconds]
Rollabu__ has joined #ruby
kraljev11_ has quit [Quit: kraljev11_]
kraljev11 has joined #ruby
kraljev11 is now known as kraljev11_
Muhannad has quit [Ping timeout: 276 seconds]
Rolla____ has joined #ruby
drewo has joined #ruby
Rollabun_ has quit [Ping timeout: 248 seconds]
Pupeno has joined #ruby
Rollab___ has quit [Ping timeout: 248 seconds]
Rollabun_ has joined #ruby
Rollab___ has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
casadei has quit [Remote host closed the connection]
kraljev11_ has quit [Ping timeout: 276 seconds]
mcclurmc has joined #ruby
othernick has joined #ruby
mcclurmc has quit [Remote host closed the connection]
pwnz0r has joined #ruby
Raboo has joined #ruby
urbanmonk has quit [Quit: urbanmonk]
mcclurmc has joined #ruby
mcclurmc has quit [Remote host closed the connection]
othernick has left #ruby [#ruby]
mcclurmc has joined #ruby
urbanmonk has joined #ruby
Jeff__ has quit [Ping timeout: 250 seconds]
Indian has joined #ruby
Marisa has joined #ruby
workmad3 has joined #ruby
dc_ has joined #ruby
rehat has joined #ruby
dc_ has quit [Client Quit]
nateberkopec has joined #ruby
<rehat>
I'm kinda new with web requests and I am trying to write a script that downloads a file from a site. The site requires a login and I think that is why I am getting a 'forbidden' message from net/http is there a way to add my cookie auth or get another auth added to the headers
workmad3 has quit [Ping timeout: 276 seconds]
mcclurmc has quit [Remote host closed the connection]
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
vasilakisfil_ has quit [Ping timeout: 256 seconds]
kobain has quit [Ping timeout: 256 seconds]
techietrash has joined #ruby
ooesili has quit [Client Quit]
<rehat>
so do I need to add auth before the http.get?
<fooooooooo>
hey, how come one can't `def some_method(foo?: true); foo?; end` #=> identifier foo? is not valid to set
<Ox0dea>
rehat: You shouldn't be able to log into something with a GET, but whatever. Do that, then get the response headers, pluck out whichever one contains your auth cookie, and then pass that along in subsequent requests.
<Ox0dea>
fooooooooo: Because.
ooesili has joined #ruby
snsei has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 256 seconds]
thalassa has quit [Ping timeout: 256 seconds]
nofxx has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Remote host closed the connection]
thalassa has joined #ruby
<rehat>
Ox0dea: thanks, I didn't realize I needed to login to get the auth cookie first. I will work on that
dgutierrez1287 has quit [Remote host closed the connection]
drewo has quit [Ping timeout: 250 seconds]
idafyaid has quit [Ping timeout: 272 seconds]
<Ox0dea>
rehat: It's possible that the site will set a few cookies as soon as you request the login page, so you may need to apply the steps outlined above at that stage.
coffee__cup has joined #ruby
michael_mbp has quit [Excess Flood]
tubuliferous_ has joined #ruby
kobain has joined #ruby
sp4rrow_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
snsei has joined #ruby
quazimodo has quit [Ping timeout: 248 seconds]
bruno-_ has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
ashleyis has joined #ruby
michael_mbp has joined #ruby
MatthewsFace has joined #ruby
tubuliferous_ has quit [Ping timeout: 246 seconds]
<fooooooooo>
Ox0dea :/ -- :foo? is a valid symbol.
<Ox0dea>
That it is.
<Ox0dea>
But it is not a valid identifier for anything but methods.
millerti has joined #ruby
<Ox0dea>
And that makes a good deal of sense too.
<Ox0dea>
It's often the case that we call a method to ask a question, but when should a variable represent such a thing?
balazs has joined #ruby
<fooooooooo>
ok makes sense thanks
Axy has joined #ruby
Axy has joined #ruby
bf4 has joined #ruby
quazimodo has joined #ruby
Mia has quit [Ping timeout: 255 seconds]
snsei has quit [Remote host closed the connection]
marr has quit []
mrmargolis has joined #ruby
bf4 has quit [Ping timeout: 256 seconds]
ooesili has quit [Quit: leaving]
Igorshp_ has quit [Remote host closed the connection]