<havenwood>
shevy: named 'un' so you can -run it :)
BigRonnieRon has joined #ruby
fryguy9 has joined #ruby
<havenwood>
ruby -run -ehelp
oki has joined #ruby
brb3 has joined #ruby
jonr22 has joined #ruby
<shevy>
havenwood lol
Aswebb_ has quit [Remote host closed the connection]
<GaryOak_>
hahaha
sivsushruth has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
<a5i>
Ruby
<a5i>
is that guy in Harry Potter
MatthewsFace has joined #ruby
<a5i>
teacher of Gryffindor
<ponga>
I want rubyprocess A to send string to rubyprocess B, then B sends back reply string to A, is IO class what i should use for such communication
<ponga>
jhass: what do you mean, its a loop run in terminal
<jhass>
so B is not forked from A?
<ponga>
they are two seperate
<jhass>
named pipe might be easiest thing then, unix socket is another way
_djbkd has quit [Remote host closed the connection]
<ponga>
A is twitter bot code receives mention, and B processes it and gives back A the reply to update
<ponga>
named pipe
<ponga>
ok i will google it
bruno- has joined #ruby
bricker has quit [Ping timeout: 244 seconds]
bruno- is now known as Guest30617
Guest7768 has quit [Ping timeout: 255 seconds]
tag has quit [Ping timeout: 252 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Kellin has quit [Disconnected by services]
brb3 has quit [Quit: ZZZzzz…]
<ponga>
uh.. damn it this is too complicated
fryguy9 has quit [Quit: Leaving.]
Guest30617 has quit [Ping timeout: 256 seconds]
sevvie has quit [Ping timeout: 240 seconds]
<ponga>
jhass: i should just fork it and write twitter class in the code
<ponga>
rather than IPC
<ponga>
;(
<jenrzzz>
does anyone know the best current practice for loading files in gems? not sure if I should keep require_relative'ing everything in the top level lib/gem_name.rb or use Kernel.autoload with all my constants instead
<jenrzzz>
i found a discussion from 2011 about autoload being deprecated after 2.x but i'm not sure how that ended
bruno-_ has joined #ruby
ponga has quit [Quit: Leaving...]
<Radar>
jenrzzz: Why require_relative? the lib dir of the gem should be in the load path, so you can just require things, no?
_djbkd has joined #ruby
<jhass>
jenrzzz: neither, do plain requires, take advantage of Rubygems setting the load path for you once the gem is installed
DadoCe has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
maximski has joined #ruby
<jenrzzz>
Radar, jhass: good point. i remember needing the relative requires before i moved this stuff into a gem but it's unnecessary now
<jenrzzz>
so is it a good idea to avoid autoload nowadays?
startupality has quit [Quit: startupality]
GaryOak_ has quit [Remote host closed the connection]
eat_multi has quit [Remote host closed the connection]
bruno-_ has quit [Ping timeout: 252 seconds]
bruno-_ has joined #ruby
Hijiri has joined #ruby
VBlizzard is now known as _blizzy_
justin_pdx has joined #ruby
g0bl1n has quit [Quit: g0bl1n]
jottr has joined #ruby
nii236 has joined #ruby
sevvie has joined #ruby
momomomomo has joined #ruby
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sevenseacat has joined #ruby
bricker_ is now known as bricker
Guest65 has joined #ruby
graydot has quit [Quit: graydot]
Takle has joined #ruby
bim has quit [Remote host closed the connection]
beneggett has joined #ruby
Guest65 has quit [Max SendQ exceeded]
plashchynski has joined #ruby
<shevy>
jenrzzz yes. matz deprecated it
<shevy>
if you use gem-structure layout then you can use require alone just fine. I never need require_relative
mistermocha has quit [Ping timeout: 244 seconds]
beneggett has quit [Ping timeout: 264 seconds]
<shevy>
autoload will remain in 2.x by the way jenrzzz
<shevy>
"[...] Ruby will keep autoload for a while, since 2.0 should keep compatibility to 1.9. But you don't expect it will survive further future, e.g. 3.0."
graydot has joined #ruby
<baweaver>
shevy: what's the word on 3.0 anyways?
<havenwood>
baweaver: much win
<baweaver>
I figured. ETA / details at all?
<baweaver>
or is it still in the aether?
sankaber has joined #ruby
Shazaum has quit [Quit: This computer has gone to sleep]
<baweaver>
I keep getting Rails 3.0 and that static typing bit.
<havenwood>
baweaver: LLVM JIT for some great speed improvements and removal of the GIL with a new concurrency model.
<shevy>
baweaver dunno. I think ruby 2.x will remain in 2015 and probably 2016
<baweaver>
throw in automatic tailcall optimizations and I'll be quite happy.
<baweaver>
I keep forgetting they're not in Ruby and using recursion for some things.
dfinninger has joined #ruby
<baweaver>
I switch about between Ruby, JS, Elixir, and Clojure
sdothum has joined #ruby
<havenwood>
baweaver: Enable it tail call optimization at compile time! But yeah, I'd usually have it rather have it than the trace you're trading off I suppose.
<baweaver>
then again JS doesn't have it either until ES6 clears it seems.
nettoweb has joined #ruby
Takle has quit [Remote host closed the connection]
marr has quit [Ping timeout: 272 seconds]
<baweaver>
You can, but at this point I think it should just be built in
<havenwood>
That would make it more practically useable. ;)
Takle has joined #ruby
<baweaver>
Admittedly I tend to think recursively for most things
<havenwood>
baweaver: but i'm excited for what's coming, some good stuff
<baweaver>
and trying to avoid state in ruby is treacherous without good recursion
<havenwood>
baweaver: it'll be interesting to see which way they go with removing the GVL
<baweaver>
I'll see if I can get some more details out of the Kaigi talk
<baweaver>
Angular 2.0 is going to be an odd beast after 1.x
werelivinginthef has joined #ruby
fandi has joined #ruby
DadoCe has joined #ruby
dfinninger has quit [Ping timeout: 265 seconds]
Soda has joined #ruby
brainfartist has joined #ruby
<havenwood>
baweaver: it's yet to be decided whether to go with an Actor model or one where Threads own the Objects they create, and they're seen as immutable by other Threads unless they gain possession.
nii236 has joined #ruby
<baweaver>
So effectively we're emulating parts of Go or Elixir/Erlang
tkuchiki has joined #ruby
<baweaver>
Actor models at least work well for Erlang.
Pupeno has joined #ruby
<baweaver>
and some Scala
xymbol has joined #ruby
Takle has quit [Ping timeout: 256 seconds]
<havenwood>
Matz said his first choice was Actor model but he's open to immutable-from-the-outside sharing as a possibility.
rbennacer has joined #ruby
werelivinginthef has quit [Ping timeout: 245 seconds]
<baweaver>
If Ruby were to take the concurrency of Elixir / Erlang, the contracts and static typing of Haskell, and pattern matching that'd be amazing.
<baweaver>
though case works vaguely like a pattern match to be fair
<havenwood>
baweaver: Matz keeps saying he's looking at other functional programming languages for further inspiration.
lesce has quit [Ping timeout: 265 seconds]
apeiros_ has quit [Remote host closed the connection]
<havenwood>
fingers crossed
<baweaver>
Which is why I still prefer Ruby to Python in most cases
<baweaver>
Python's anonymous functions are clunky
<baweaver>
though they do have list comprehensions to be fair.
<baweaver>
Still not much my cup of tea.
<havenwood>
agreed
<baweaver>
Heh, Ruby built on top of Haskell
<baweaver>
that'd be a trip
<shevy>
a beaver on a trip
<baweaver>
Might add that to my list of ridiculously esoteric projects to do when I get bored.
<baweaver>
Birch bark does it man, potent stuff.
chipotle has quit [Quit: cheerio]
Pupeno has quit [Ping timeout: 256 seconds]
rbennacer has quit [Remote host closed the connection]
<baweaver>
Right next to remaking RPG Maker in Clojure for giggles.
<shevy>
hmm didn't hanmac also redo RPG Maker but inr uby
<shevy>
*in ruby
<baweaver>
I really should finish writing my book first though....
<baweaver>
too many things
chipotle has joined #ruby
<shevy>
lol
rbennacer has joined #ruby
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
ghostpl_ has joined #ruby
tkuchiki has quit [Ping timeout: 256 seconds]
nii236 has quit [Ping timeout: 252 seconds]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
kaneda^ has joined #ruby
Sawbones has joined #ruby
CorySimmons has quit [Quit: Bye!]
duncannz has quit [Max SendQ exceeded]
roolo has joined #ruby
<kaneda^>
hey all, i'm running rbenv on two systems that are very close to identical, but on one system something is setting my gempath differently. the GEM_PATH and GEM_HOME variables are not set, where could it be being modified?
xymbol has quit [Quit: Be back later ...]
duncannz has joined #ruby
chipotle has quit [Quit: cheerio]
<baweaver>
I have the attention span of nil sometimes...
<baweaver>
.bashrc probably
<baweaver>
or some variant of it.
duncannz has quit [Max SendQ exceeded]
<kaneda^>
baweaver: already looked in the .bash*
<kaneda^>
they're identical on both machines
<baweaver>
Hm
<baweaver>
Have you tried purging / reinstalling it?
<kaneda^>
the system where it's not working appropriately is a hot standby, so it's not critical, but it's confusing
nii236 has joined #ruby
<kaneda^>
baweaver: that's one way of dealing with it, but i was hoping to pinpoint what was causing it and eliminate it
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
<baweaver>
load order potentially
<baweaver>
not sure
<kaneda^>
and my gem binary is being invoked from shims, so that's right
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Megtasti_ has quit []
fandi has quit [Ping timeout: 240 seconds]
duncannz has joined #ruby
fandi has joined #ruby
duncannz has quit [Max SendQ exceeded]
mjuszczak has quit []
justin_pdx has quit [Quit: justin_pdx]
_maes_ has quit [Ping timeout: 264 seconds]
<baweaver>
I'd just reinstall it honestly. Best chance of catching something is to just checksum the files and see what sticks out in RBENV and ~/.bash files
momomomomo has quit [Quit: momomomomo]
<kaneda^>
baweaver: but it's all identical ;_;
<kaneda^>
i checked /etc/profile and the stuff in /etc/profile.d too
<kaneda^>
all the same
<baweaver>
Are you sure though on rbenv's install?
maximski has quit []
adriancb has joined #ruby
* baweaver
isn't exactly familiar with RBENV, uses RVM
ghostpl_ has quit [Ping timeout: 250 seconds]
<kaneda^>
so i'm 99% sure it'sb ecause the last guy installed a version of ruby elsewhere
<kaneda^>
and i made sure that version was OFF the path
<kaneda^>
but i have no clue where it's being referenced from
<kaneda^>
it's very mysterious
<baweaver>
did you echo both the paths
<baweaver>
and do ruby -v?
<kaneda^>
yep
<kaneda^>
and which ruby/irb/gem yields the right one in shims
<kaneda^>
my instinct tells me SOMETHING is setting GEM_PATH and/or GEM_HOME
baroquebobcat has quit [Quit: baroquebobcat]
<baweaver>
Sorry to say that's about as far as I could guess.
<kaneda^>
there's also no ~/.gemrc
<baweaver>
rbenv probably just botched the install from some old files.
<bigmac>
kaneda^: maybe you can grep threw the files to what your looking for
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Guest98794 has quit [Changing host]
Guest98794 has joined #ruby
Guest98794 is now known as daynaskully
<havenwood>
mozzarella: not sure i'll ever use it but nice to have it consistent
kyb3r_ has joined #ruby
arescorpio has quit [Excess Flood]
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anaeem1 has joined #ruby
jonr22 has joined #ruby
dandaman has quit [Quit: Leaving.]
Aswebb_ has joined #ruby
mattjbarlow has joined #ruby
martianixor has quit [Quit: Leaving]
morenoh149 has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr22 has quit [Ping timeout: 265 seconds]
JoshGlzBrk has joined #ruby
Aswebb_ has quit [Ping timeout: 272 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
dandaman has joined #ruby
kyb3r_ has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
Musashi007 has joined #ruby
dandaman has quit [Client Quit]
Vile` has quit [Read error: Connection reset by peer]
kyb3r_ has quit [Read error: Connection reset by peer]
Vile` has joined #ruby
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
DavidDudson has joined #ruby
zachrab has joined #ruby
rhg135 has quit [Quit: ZNC - http://znc.in - making IRC 20% cooler]
rhg135 has joined #ruby
zachrab has quit [Ping timeout: 246 seconds]
drkyro has joined #ruby
_honning_ has quit [Ping timeout: 252 seconds]
phutchins has joined #ruby
commmmodo has quit [Quit: commmmodo]
drkyro has quit [Client Quit]
jenrzzz has joined #ruby
davedev24_ has quit [Ping timeout: 256 seconds]
dandaman has joined #ruby
jlast has quit [Remote host closed the connection]
davedev24_ has joined #ruby
JBreit has joined #ruby
bim has joined #ruby
boshhead has quit [Ping timeout: 264 seconds]
nii236 has quit [Ping timeout: 246 seconds]
bim has quit [Ping timeout: 264 seconds]
DavidDudson has quit [Quit: Goodbye all, and thankyou.]
Musashi007 has quit [Quit: Musashi007]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
RegulationD has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
nii236 has joined #ruby
dfinninger has quit [Remote host closed the connection]
swgillespie has joined #ruby
_maes_ has joined #ruby
skj3gg has joined #ruby
Renich has joined #ruby
_maes_ has quit [Read error: Connection reset by peer]
amystephen has quit [Quit: amystephen]
TheNet has quit [Remote host closed the connection]
David_Miller has quit [Ping timeout: 255 seconds]
adriancb has quit [Read error: Connection reset by peer]
<dopiee>
Hey all I have a question
TheNet has joined #ruby
jerematic has joined #ruby
adriancb has joined #ruby
<dopiee>
I'm viewing a gem on github and im quite not understanding something why in ASSETS the array has 2 fields... one for the file name and one for the file ?!??!
<hanmac1>
certainty: i usaly do that in module ABC; includes <>; extends <>; <code> end ... imo thats more orderd (also because extends are later in the chain than includes)
<febuiles>
godd2: thank you!
imanzarrabian has joined #ruby
<certainty>
hanmac1: but the result is the same, correct?
<flughafen>
bbiab
Aswebb_ has joined #ruby
adriancb has joined #ruby
<hanmac1>
certainty: thats why i said "if possible"
adriancb_ has quit [Read error: Connection reset by peer]
<certainty>
shevy: the reason i do them before include is because e goes before i. (Under the assumption that the order doesn't matter to ruby)
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lysw123 has quit [Ping timeout: 256 seconds]
Advocation has quit [Quit: Advocation]
<certainty>
hanmac1: alright
timonv has joined #ruby
<shevy>
certainty hehe
<shevy>
I am with hanmac1 here!
<certainty>
shevy: come on
<shevy>
you alphabet junkies you
<shevy>
see this is so cool in ruby
<shevy>
there is more than one way
<shevy>
there is also more than one community - look at our enemies at #ruby-lang
<shevy>
which other programming language has that?
zachrab has quit [Ping timeout: 244 seconds]
<hanmac1>
sometimes the order of the include and extends are important, thats why i said "if possible" ... sometimes you must do an extend before you can include the other stuff
jhass has quit [Quit: Bye]
<wasamasa>
shevy: scheme has lots of small communities
<certainty>
indeed
TheMoonMaster has quit [Quit: Later!]
<shevy>
scheme lacks one thing compared to ruby
<wasamasa>
there's a good amount of lisp-related channels on freenode
<certainty>
shevy: which is?
<shevy>
matz
<wasamasa>
lol
<wasamasa>
a benevolent dictator for life?
<shevy>
well ok perl has that and python has that too
<certainty>
we have felix
<shevy>
the cat?
<agent_white>
python, ew
<wasamasa>
the cat would have better web design skills
<shevy>
a programming language designed by a cat ...
mengu has quit [Remote host closed the connection]
<shevy>
lol wasamasa
<shevy>
designing isn't that easy!
<certainty>
we're not talking about software design here
adriancb has quit [Read error: Connection reset by peer]
<wasamasa>
"I had a plastic toy of Feathers McGraw on my desk, the evil penguin (disguised as a chicken!) from the Wallace and Gromit movie, “The Wrong Trousers.”"
Feyn has joined #ruby
<wasamasa>
felix sure likes the baddies in movies
Takle has quit [Remote host closed the connection]
SOLDIERz has joined #ruby
ghostpl_ has quit [Remote host closed the connection]
Deele has joined #ruby
juanpablo_ has quit [Ping timeout: 264 seconds]
adriancb has quit [Read error: Connection reset by peer]
<certainty>
felix is a genius. and probably not a human
<wasamasa>
I can confirm that he's a human
<certainty>
ok that he appears to be human
<certainty>
then
Pupeno has joined #ruby
adriancb has joined #ruby
<wasamasa>
I've talked with him about emacs a bit and found out that even felix has his gripes with it
Xeago_ has joined #ruby
<wasamasa>
"I don't want to install these new-fangled new releases!"
<Xeago_>
bah #python requires registration :|
codecop has quit [Remote host closed the connection]
<shevy>
Xeago_ haha!
ghostpl_ has joined #ruby
<Xeago_>
shevy: you do python right? can I use a with statement to automatically close my socket?
<shevy>
hey
<shevy>
I am a ruby guy by heart
<Xeago_>
ditto :|
<wasamasa>
lol
<Xeago_>
I don't know whether I'm invoking it incorrectly or it just doesn't work
<wasamasa>
what is it with python questions in here lately
kith has quit [Quit: kith]
digitalextremist has joined #ruby
kith has joined #ruby
DouweM has joined #ruby
jhass has joined #ruby
Deele has quit [Ping timeout: 256 seconds]
<agent_white>
They are jealous of how awesome we are.
<wasamasa>
they?
Pupeno has quit [Ping timeout: 265 seconds]
adriancb has quit [Read error: Connection reset by peer]
davedev2_ has quit [Remote host closed the connection]
<agent_white>
the python-questionistas coming in here
razieliyo has joined #ruby
razieliyo has joined #ruby
senayar has quit [Remote host closed the connection]
adriancb has joined #ruby
nii236 has quit [Quit: WeeChat 1.1.1]
elfuego has quit [Quit: elfuego]
rohitkashyap has joined #ruby
xrlabs has joined #ruby
<xrlabs>
join #ada
<xrlabs>
oops
<wasamasa>
lol
dEPy has joined #ruby
<wasamasa>
how dare you show interest in a better specified language than ruby!?
DouweM has quit [Ping timeout: 264 seconds]
rkgudboy has quit [Ping timeout: 246 seconds]
<xrlabs>
it's like my first love on junior high, how can I not
<agent_white>
A better specified language has yet to be created!
sankaber has joined #ruby
<agent_white>
;D
<xrlabs>
I didn't mean to upset you xD
adriancb_ has joined #ruby
Takle has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
<agent_white>
It's OK, I'm only furious.
<agent_white>
;)
<godd2>
That's your secret. You're always furious.
terlar has quit [Ping timeout: 264 seconds]
startupality has quit [Quit: startupality]
Advocation has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
adriancb_ has quit [Read error: Connection reset by peer]
spyderman4g63 has quit [Ping timeout: 264 seconds]
Zai00 has joined #ruby
<mib_mib>
hanmac1 - but split doesn't return an enumerator right? so its going to read in the entire array?
<hanmac1>
mib_mib: yes, thats why you need each_with_index
wald0 has quit [Ping timeout: 246 seconds]
<mib_mib>
hanmac1 - wait, if you do .split.each_with_index then it returns just an enumerator? doesnt it first split, and then return an enumerator on that object?
spyderma_ has quit [Read error: Connection reset by peer]
<mib_mib>
so its essentially doing .split
<mib_mib>
and then an enumerator over it
<mib_mib>
so you are iterating it twice?
lesce has quit [Ping timeout: 246 seconds]
adriancb has quit [Ping timeout: 244 seconds]
<mib_mib>
the real question is how to get .split to return an enumerator...
wald0 has joined #ruby
<hanmac1>
mib_mib: with split i think you cant
<mib_mib>
mmmm k
mostlybadfly has joined #ruby
tjohnson has joined #ruby
rbennacer has joined #ruby
nettoweb has joined #ruby
monod has quit [Quit: Sto andando via]
<phale>
what are triplets
<phale>
of red and green and blue colours
<mib_mib>
probably have to use string scanner or something
rbennacer has quit [Remote host closed the connection]
nii236 has quit [Quit: WeeChat 1.1.1]
<hanmac1>
mib_mib: what you can do is that:
<hanmac1>
>> 'my@string@is@cool'.to_enum(:scan,/[^@]+/).with_index {|word,i| p [word,i]}
<helpa>
Hi Qladstone. We in #ruby would really appreciate it if you did not use pastebin during your time with us.
<helpa>
Pastebin is not good because it loads slowly for most, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org) instead. Thanks!
sinkensabe has joined #ruby
<phale>
Qladstone: .each_with_index
<phale>
not sure how to use it with your code though
<shevy>
and what does article contain
<phale>
shevy: it's irrelevant
<phale>
the data that a variable contains is irrelevant to giving a better solution to syntax
lxsameer has quit [Ping timeout: 245 seconds]
<Qladstone>
article is a text document
<Qladstone>
Could you explain how .each_with_index helps?
<jhass>
Qladstone: try to avoid float for money, store in cents as integer or at least use a precise decimal type
sarkis has quit [Ping timeout: 272 seconds]
michael_mbp has joined #ruby
AlexRussia has quit [Ping timeout: 256 seconds]
serivich has quit [Ping timeout: 252 seconds]
SixiS has joined #ruby
AlexRussia has joined #ruby
<Qladstone>
omg.
rippa has joined #ruby
<Qladstone>
phale: using .each_with_index doubled the speed. but I have no idea why
<Qladstone>
I did not even use the index in the statement
sinkensabe has quit [Remote host closed the connection]
<phale>
Qladstone: oh that's cool
<phale>
i was just guessing
<shevy>
lol
<Qladstone>
this black box thing is driving me nuts
<shevy>
Qladstone it often helps if you can give a minimal example so others can reproduce what you have there
piotrj has quit [Remote host closed the connection]
<Qladstone>
minimal example?
<shevy>
you have a lot of options available - .select and .inject come to mind
<shevy>
yes
serivich has joined #ruby
<shevy>
how can people reproduce with the code snippet you showed?
bweston92 has quit [Remote host closed the connection]
<Qladstone>
article is a text file which will be interpreted as an array of strings
<Qladstone>
input*
<Qladstone>
output is just a float
<Qladstone>
task is to match all characters in article to the payment_rule
<Qladstone>
and add the value to a total
<Qladstone>
and return that total
<shevy>
now jhass can solve it
<jhass>
sample data would still help
scottstamp is now known as darkstar851
darkstar851 is now known as scottstamp
<waxjar>
ok. couldn't you just loop trough all characters in the file, without creating an Array of lines first?
mbreit has joined #ruby
Takle has joined #ruby
<Qladstone>
nope, the input is already in that format, an array of strings :S
B1n4r10 has joined #ruby
juanpablo_ has joined #ruby
selu has quit [Read error: Connection reset by peer]
roshanavand has quit [Ping timeout: 264 seconds]
anaeem1_ has quit [Remote host closed the connection]
<waxjar>
hmm, depending on the length of the article it could pay off to join them all together first, to avoid creating an enumerator for every single line
anaeem1 has joined #ruby
<Qladstone>
ok I'll try that
juanpablo_ has quit [Ping timeout: 265 seconds]
<waxjar>
and maybe instead of looking up the price and adding it to the total for every character, just count the occurences and look up the price in one go at the end
CAP5562 has joined #ruby
dtordable has quit [Ping timeout: 252 seconds]
<Qladstone>
I'll store the count in a hash?
<waxjar>
yea, that'd be easiest i think
<Qladstone>
hmm good idea
<Qladstone>
I'll try each
<Qladstone>
of them
<Qladstone>
I'll let you know how it goes (:
jerematic has joined #ruby
lxsameer_ has joined #ruby
danjordan has quit [Quit: danjordan]
<jhass>
yeah, that'll be interesting
<jhass>
I'd expect setting a value in the hash to be more expensive than looking it up
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
anaeem1 has quit [Ping timeout: 265 seconds]
tvw has joined #ruby
bweston92 has joined #ruby
<jhass>
so I wonder if .count reduces the number of lookups enough
<mcpierce>
Is there any way to pass a Ruby object to a C library via an extension and have C take sole ownership of the object; i.e., prevent it from reaped during GC?
<Qladstone>
waxjar: joining the arrays did the trick
dtordable has joined #ruby
hgl has quit [Ping timeout: 252 seconds]
<mcpierce>
The C library would just hold onto it as a void* and another integratoin piece would handle invoking a single method on it periodically.
riotjone_ has joined #ruby
sameerynho has quit [Ping timeout: 244 seconds]
bMalum has joined #ruby
<jhass>
Qladstone: how do you test which is faster btw? gotta micro bench setup?
CAP5562 has quit [Ping timeout: 265 seconds]
<jhass>
*got a
<Qladstone>
I have a test file given to me to test it with some sample data
senayar has quit [Remote host closed the connection]
<Qladstone>
the test tells me the returned result and time taken
<mcpierce>
hanmac1: Thank you! I'll check it out right away.
<mcpierce>
hanmac1: Ah, you used a hidden global var to hold references?
<jhass>
Qladstone: mmh, but if it's a huge file in the realms of a disk read on the first run to a read from the in memory cache on the second run
<hanmac1>
mcpierce: yes i use a hidden global hash so i can add and remove the objects later
roqo has quit [Ping timeout: 245 seconds]
<jhass>
that is if the test includes reading the file into the measurement
JDiPierro has joined #ruby
ducklobster has quit [Ping timeout: 255 seconds]
spyderman4g63 has quit [Read error: Connection reset by peer]
anaeem1 has quit [Remote host closed the connection]
joonty has joined #ruby
<mcpierce>
hanmac1: I had proposed something similar and someone said it would be too "brittle" to use global vars. What do you think of attaching something like the hash to the eigenclass of one of your library objects?
roqo has joined #ruby
<hanmac1>
mcpierce: that global var is hidden in the C code, so the ruby side is not affected (and the global hash isnt even visible from the outside)
mkaesz has joined #ruby
amystephen has joined #ruby
anaeem1 has joined #ruby
<Qladstone>
jhass: I'm retesting as well
<Qladstone>
seems to be producing similar results
<jhass>
mmh. weird
<mcpierce>
hanmac1: kk - thanks for the tip. I'll look it over and see how I can integrate that into my work. :D
<Qladstone>
I mean
<Qladstone>
with restesting, I reproduced the superior performance of using .join before runnning through the entire combined string
<hanmac1>
mcpierce: i use a c++ hash for refcounting, you might not need it, if you only want storeing without a chance to remove it again, use just: rb_hash_aset(global_holder,INT2NUM(object),object);
<Qladstone>
and testing in reverse order as well
<Qladstone>
so it worked
Macaveli has quit [Ping timeout: 256 seconds]
spider-mario has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
<Qladstone>
and thanks! (:
<jhass>
Qladstone: so this is an assignment for school or something btw?
amundj has quit [Ping timeout: 245 seconds]
<Qladstone>
jhass: yup it is, I managed to get the algorithm. But then again... with the same complexity so much difference in speed can occur due to the nature of the operations themselves
<mcpierce>
hanmac1: The tricky part for me may be the removal; i.e. I'm working on top of a C library with no true destructor per se.
<jhass>
Qladstone: give your teacher a slap from me from having you return money as a float then ;)
<jhass>
and yeah, I expected the join to be slower since it needs to do an extra allocation (or a few actually)
<phale>
what's better: filling a hash with results from parsing or something else
<phale>
i.e: info[:header] = "blablabla"...
<jhass>
vs. ?
<phale>
i don't know
<phale>
just asking if there's a better way of doing it
<jhass>
you can compare to specifics, not to "everything else"
anaeem1 has quit [Remote host closed the connection]
<phale>
what about structs?
<Qladstone>
jhass: LOL. yea I got some trailing decimals at first until I decided to perform the division operation only at the very end
<jhass>
Qladstone: for added precision don't use 0.0, keep intergers as long as you can
<Qladstone>
jhass: Oh yea, I did that, between the time I shared the link to the code and now I soon saw that and made that optimisation
<hanmac1>
mcpierce: depending on the c lib, do you have an interface / header files of that online? maybe you can store user data in the C objects (and i used that to put my Ruby objects into the C++ objects)
timonv has quit [Ping timeout: 252 seconds]
<Qladstone>
it did cut the time by a tiny bit
<phale>
workmad3:
<Qladstone>
and yea precision
trufflesnout has joined #ruby
<mcpierce>
hanmac1: Yeah, the project's name is Proton (AMQP messaging library) and my git repo is github.com/mcpierce/Proton
<Qladstone>
are operations with integers quicker than with floats?
spider-mario has joined #ruby
<mcpierce>
hanmac1: I'm working on the Ruby bindings for it. The branch I'm on it the PROTON-799-*, and all my current work is in the proton-c/bindings/ruby directory.
juanpablo_ has joined #ruby
triple_b_ has quit [Ping timeout: 252 seconds]
<jhass>
Qladstone: should be iirc
trufflesnout has quit [Client Quit]
tus has joined #ruby
dblessing has joined #ruby
triple_b has joined #ruby
jottr has joined #ruby
anaeem1 has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<jhass>
Qladstone: otoh for that level of optimization, Ruby might not be the best choice tbh ;)
<jhass>
iterations & allocations is where you can usually make a difference here
qiffp has joined #ruby
<Qladstone>
jhass: true that... Ruby is my first lang. I'm pretty much doing it because my course uses it. But since it's my first I'm trying to explore it in some detail before I start on another lang
<Qladstone>
funny thing is
ismaelga has joined #ruby
<hanmac1>
mcpierce: hm first a c++ api might be more interesting and maybe easier to port (also for the binding, i use templates for most of my stuff *g) ... second when you do the C/C++ part yourself you might add userdata attributes into your C structs, with that you can track the objects like i did
<Qladstone>
they made us use Ruby 1.8
<Qladstone>
which is 1/3 the speed of Ruby 1.9+
<jhass>
Qladstone: okay, deserves another slap from me, a bigger one
<mcpierce>
hanmac1: The library currently has reference counting; i.e., pn_incref, pn_decref and pn_refcount.
FooMunki_ has joined #ruby
ismaelga has quit [Remote host closed the connection]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<mcpierce>
hanmac1: C++ would be nice, but this is a C library so it's not really an option for me.
jottr has quit [Ping timeout: 240 seconds]
<jhass>
Qladstone: since even 1.9.3 is completely EOL by now
<hanmac1>
mcpierce: hm add userdata or something like that which is deleted by the finalize function or something similar
<phale>
how do I delete all occurences of ' ' in an array?
<phale>
i.e: [ " 255", " 33" ]
<phale>
should be [ "255", "33" ]
<jhass>
.map(&:strip)
<phale>
thanks
<Qladstone>
jhass: yea no idea why.. maybe it's just the materials and text they used were all standardised for the version of Ruby
<phale>
jhass: that also strips the newline
<phale>
I only want it to strip spaces though
<mcpierce>
hanmac1: I've been using the python bindings (the principal engineer writes both Python and C) as a guide. He has a decent example of things there, though Python uses reference counting so in that sense it didn't help.
andikr has quit [Remote host closed the connection]
<jhass>
Qladstone: shouldn't be that much to update them really, while there might better ways for some things, the old ways still mostly work. Sounds just lazy to me
maximski has joined #ruby
<mcpierce>
hanmac1: The main issue for me is tht Swig (how we generate the majority of the bindings) does not give us a way to hook into the lifecycles of its bindings on C structs.
<jhass>
phale: then combine Array#map and String#delete
<phale>
okay
lolmaus_ has joined #ruby
<hanmac1>
mcpierce: forgot swig! with that you cant protect yourself from segmentation faults, with writing bindings yourself you can
jenrzzz has joined #ruby
mbreit has quit [Read error: Connection reset by peer]
<Qladstone>
jhass: haha are you teaching too? I'm fine with the old version for the purposes of the course, since the course is mainly just to learn algorithms, and the code itself is just a tool
green-big-frog has joined #ruby
<phale>
.map(&:delete(' '))
<phale>
gives an error
<mcpierce>
hanmac1: Yeah, it's been a definite struggle. I've found some ways to work around issues, but the big one is the one I'm facing now.
mbreit has joined #ruby
adriancb has joined #ruby
<Qladstone>
jhass: well, algorithms and data structures. and about computational reasoning
<green-big-frog>
how can I program mobile apps with ruby? (I found out that ruboto exists)
<mcpierce>
hanmac1: I had attached my Ruby object to the Swig bindings for the C struct, and that worked great. Up until Swig deleted the wrapper and recreated it later. Then I got segfaults.
<jhass>
Qladstone: nah, only here on IRC ;) And while what you say might be true, students will take away the old practices and apply them in other contexts
<hanmac1>
mcpierce: have you heard of wxRuby? because of swig and its shitness, https://github.com/Hanmac/rwx was born
<Qladstone>
jhass: such as using .each_with_index when there really is no need to refer to the index?
<hanmac1>
phale: why are you trying to split an array when its already splitted?
<mcpierce>
hanmac1: I hadn't, no. But my project's kind of bound to Swig. I don't have the luxury of replacing it ATM.
<jhass>
Qladstone: and as said, I can't imagine porting that stuff to Ruby 2.2 would take much more than 8-10 hours of work, much less if you know your way around
SOLDIERz__ has quit [Quit: Be back later ...]
<phale>
hanmac1: oops,
<hanmac1>
mcpierce: checkout rwx, you might like it
<phale>
i was splitting a string in my program
<jhass>
Qladstone: such as your way to create the Hash instead of Hash#to_h
<phale>
should be: " 255, 39, 42\n"
<jhass>
* Array#to_h
jottr has joined #ruby
lolmaus__ has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
<mcpierce>
hanmac1: Will do, and thanks for the tips. :D
<phale>
jhass: how do I combine map and delete with an array?
kalusn has quit [Remote host closed the connection]
timonv has joined #ruby
<jhass>
Qladstone: using options hashes instead of keyword arguments and so on
<jhass>
phale: what did you try?
<phale>
array.map(&:delete ' ')
<jhass>
the shortcut doesn't work with arguments
FooMunki_ has quit [Quit: FooMunki_]
<phale>
so what do i do
<jhass>
pass the block explicitly
it0a has joined #ruby
<rom1504>
{|x| x.delete ' '}
mbreit has quit [Read error: Connection reset by peer]
<phale>
that works, thanks
Guest123 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dtordable has quit [Changing host]
dtordable has joined #ruby
lolmaus_ has quit [Ping timeout: 240 seconds]
Azure has quit [Excess Flood]
ych4k3r has joined #ruby
zenith_ has joined #ruby
<green-big-frog>
how can I program mobile apps with ruby? (I found out that ruboto exists)
<Qladstone>
oh yea true that
rbennacer has quit [Remote host closed the connection]
<DefV>
green-big-frog: rubymotion
kalusn has joined #ruby
zhan has joined #ruby
<green-big-frog>
anything else?
<zhan>
i installed nokogiri, how do i see what one its prompts opens?
rbennacer has joined #ruby
doodlehaus has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
HOrangeJewce has joined #ruby
sinkensabe has joined #ruby
Mia has left #ruby [#ruby]
zachrab has joined #ruby
rbennacer has quit [Remote host closed the connection]
Qladstone has quit [Remote host closed the connection]
<workmad3>
phale: wow, such a long time, I can see why you're so great at ruby and parsing really simple formats... :P
<phale>
:(
<phale>
i haven't even read a single ruby book
TheMoonMaster has joined #ruby
<phale>
i just started using it
rbennacer has quit [Remote host closed the connection]
rbennacer has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
boshhead has joined #ruby
<workmad3>
phale: btw, I was a bit tired last night... I should really have given you the simpler snippet of 'info[:raster].each_slice(info[:width].to_i * 3).to_a'
RegulationD has joined #ruby
startupality has quit [Ping timeout: 256 seconds]
<zhan>
jhass: so sublime worse then pry?
beneggett has joined #ruby
<jhass>
zhan: they're completely different things
<workmad3>
phale: that said, the other people who said there really should be more structure rather than just a simple hash holding your image info were also correct ;)
<zhan>
pry isn't a text editor?
fryguy9 has joined #ruby
<jhass>
no
<zhan>
installing it then
green-big-frog is now known as frog|OFF
<phale>
workmad3: now I have an array of arrays
<workmad3>
phale: correct
Aswebb_ has joined #ruby
<phale>
I have 4 arrays in the array
<workmad3>
phale: want to guess what each array inside the top array consists of?
<phale>
sure
<phale>
uh
kalusn has joined #ruby
<phale>
colors?
<phale>
no, pixels
<workmad3>
phale: wrong on both counts
FooMunki has joined #ruby
<phale>
don't know then
<workmad3>
phale: go and look up what 'each_slice' does, then look at what the value being passed to it is
<workmad3>
phale: and consider what it could be
<workmad3>
phale: i.e. don't give up with absolutely 0 effort put in... that's not the way to learn things, it actually takes some effort on your part
<phale>
"Iterates the given block for each slice of <n> elements. If no block is given, returns an enumerator."
<phale>
i see
_Andres has joined #ruby
zenith_ has joined #ruby
<workmad3>
phale: so each array consists of?
<phale>
each slice by width times 3, to an array
<phale>
each array consists of slices
frog|OFF is now known as green-big-frog
<workmad3>
phale: yeah... it slices up the raster into arrays of length width * 3
<workmad3>
phale: ok... so what does each of those slices of the original raster represent?
tagrudev has quit [Remote host closed the connection]
<phale>
a raster of height rows, in order from top to bottom
<phale>
each row consists of info[:width] pixels, in order from left to right
<workmad3>
phale: ok... so a slice is...
chthon has joined #ruby
jlebrech has joined #ruby
<phale>
[s1, s2]
User458764 has joined #ruby
SouL_ has joined #ruby
jonr22 has joined #ruby
zenith_ has quit [Remote host closed the connection]
iesoxk has joined #ruby
<phale>
basically a substring
<jlebrech>
anyone else suffer from "simpleitis", because you code in ruby you always need to find the simple way to do something, and complex code doesn't look right?
<phale>
jlebrech: yes
<centrx>
That's called simplegreatness
fryguy9 has quit [Read error: Connection reset by peer]
<jlebrech>
phale: must-find-one-liner
<workmad3>
phale: lets try this again... lets say I did 'info[:raster_grid] = info[:raster].each_slice(info[:width].to_i * 3).to_a' and then did 'x = info[:raster_grid][0]' what would be a good variable name for x?
fryguy9 has joined #ruby
adriancb_ has joined #ruby
<centrx>
y
<workmad3>
centrx: ssh :P
adriancb has quit [Read error: Connection reset by peer]
freerobby has quit [Read error: Connection reset by peer]
<zhan>
yey it stored the fucker, how do i actually open it to see it
freerobby1 has joined #ruby
<gr33n7007h>
waxjar, ah ok
<phale>
ok
<phale>
row
<phale>
good name ;)
<jhass>
zhan: "open"?
<workmad3>
phale: yeah... as in a row of the image
Cache_Money has quit [Quit: Cache_Money]
<zhan>
well i have run that
<zhan>
it gave me an adress
beneggett has joined #ruby
maximski has quit []
<phale>
workmad3: great
<phale>
i have the row
<phale>
what do i do now
<workmad3>
phale: well, more specifically, you have an array of rows, giving you a 2d array of the image data, which you can use to easily walk over the data and do what you want with it
last_staff has quit [Quit: last_staff]
<phale>
i want to string.colors
FooMunki has joined #ruby
<phale>
String.colors has a size of 17, that is 17 colours
<phale>
but the maxval for most ppm images is 255. what do I do then?
<zhan>
what is gitbash
rbennacer has joined #ruby
aryaching has quit []
<zhan>
just a command prompt, cuz it doesn't run ruby
<workmad3>
phale: i.e. you could do info[:raster_grid].each {|row| row.each_slice(3) {|red, green, blue| print"rgb(#{red},#{green},#{blue}" }; print "\n"} and have the image colours spat out in rgb(...) form
<workmad3>
phale: you could do similar, but on the inside you could look up a suitable colour in your pallette from the rgb components and print a pixel
<phale>
yes
<workmad3>
phale: the main thing is that your image data is now 2 dimensional, which generally makes it easier to work with ;)
<phale>
:D
<workmad3>
phale: if you wanted a step that might be easier again to work with, then 'info[:raster].each_slice(3).to_a.each_slice(info[:width].to_i)'
<zhan>
jhass: I'm still an lost as I can't get a temp file or return
bruno-_ has quit [Quit: Lost terminal]
<workmad3>
phale: which gives you an array of arrays of arrays
crueber has quit [Quit: Leaving.]
<phale>
:)
<workmad3>
phale: and now each row is organised as an array of '[[r,g,b],[r,g,b],...]' pixels
<jhass>
zhan: your only utter failure is to properly describe your goal
<zhan>
open a website in command prompt or editor to then see how it perceives the website
agarie has quit [Remote host closed the connection]
<phale>
workmad3: but how does one transform these into String.colors
<jhass>
zhan: open(url, &:read) at pry
<workmad3>
phale: that depends on your pallette and how you want to downscale your colours to it
<zhan>
all in same parenthesis
<jhass>
zhan: you can also open(url) {|f| f.read } if that's easier to read for you
<havenwood>
zhan: irb is the REPL that ships with Ruby. Pry is a REPL alternative to irb. REPL stands for Read Eval Print Loop.
febuiles has quit [Quit: febuiles]
hs366 has quit [Quit: Leaving]
drkush has quit [Ping timeout: 252 seconds]
<ponga>
havenwood: thank you
<ponga>
i didnt know that too
sinkensabe has quit [Ping timeout: 244 seconds]
riotjones has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
<zhan>
how do i use REPL
<zhan>
cuz im ussing command prompt with ruby config
<ponga>
get into terminal type in irb
<jhass>
zhan: using pry is already using a REPL because pry is a REPL
bruno- has quit [Ping timeout: 252 seconds]
<zhan>
the point is i dob't belief that pry is suppose to be cmd.exe
<hanmac1>
havenwood: isnt more Loop { Print(Eval(Read())) } ? ;P
AlexRussia has joined #ruby
<zhan>
so i don't think that im actualy using pry right now
<havenwood>
hanmac1: hehe
<jhass>
zhan: you do
mistermocha has joined #ruby
bruno- has joined #ruby
<zhan>
well irb didn't give me anything
hanmac1 has quit [Quit: Leaving.]
<jhass>
if it says pry(main)> inside it you do
<zhan>
right i am
<ponga>
is zhan in windows?
rbennacer has quit [Remote host closed the connection]
<havenwood>
zhan: Pry is a gem. It ships with an executable called `pry` like Ruby ships with an executable called `irb`. You run `pry` or `irb` from the command prompt to enter the loop.
<ponga>
if so i have no idea then
<jhass>
ponga: no he runs cmd.exe on linux
<zhan>
i hate it
<zhan>
so there's no way of seeing what happens in text editor
<zhan>
cuz programming courses let you see that
<havenwood>
zhan: Pry can jump back and forth from a text editor.
mistermo_ has joined #ruby
<zhan>
on web
<phale>
Anyone know a gem that converts RGB into visible terminal colours?
rbennacer has joined #ruby
drkush has joined #ruby
riotjones has quit [Ping timeout: 256 seconds]
DerisiveLogic has quit [Remote host closed the connection]
<havenwood>
zhan: Use the space key instead of the enter key to separate words. It's nicer not to have so much vertical scroll and keeps your text together for easier reading.
mengu has quit [Remote host closed the connection]
GaryOak__ has joined #ruby
<phale>
jhass: look
<zhan>
okay, so then im just looking for the perl, or what stuff in lessons is something else
<phale>
it stops reading after like the 15th row
<havenwood>
zhan: I'm sure you can find a tutorial on how to use Pry with a text editor.
<jhass>
phale: which line exactly does?
febuiles has joined #ruby
mloveless has joined #ruby
<phale>
32
<phale>
or counting from 0, 31
DouweM has joined #ruby
<zhan>
yea i looked at one that comes on the pry homepage, it terrible
<havenwood>
zhan: But you might prefer online interactive stuff at this point because it seems you don't have a ton of command line experience and online you can focus on the Ruby part. Your choice though, both are great skills to learn.
triple_b has joined #ruby
<jhass>
phale: line of code
<zhan>
not the training will i'm looking for like in codecademy
<jhass>
phale: there's no iteration in that line of code that could stop
piotrj has quit [Remote host closed the connection]
<phale>
then what's going on?
<phale>
why won't it complete the printing?
piotrj has joined #ruby
<jhass>
debug
<phale>
how
<jhass>
inspect all the immediate values, verify they are what you expect/assume
<phale>
okay
<havenwood>
zhan: Since you aren't already familiar with the Windows command line it'd probably be a good idea to switch to a *nix command line since those skills will be more portable and useful going forward. Unless you want to be a Win sysadmin or something.
<phale>
jhass: but why does it work on a 4x4 image
<phale>
and not a 99x99?
<jhass>
phale: you find out with debugging
<phale>
im not exactly sure how to debug data that is nonsensical
crueber has quit [Quit: Leaving.]
arclitgold has joined #ruby
jimms has quit []
DouweM has quit [Ping timeout: 252 seconds]
<jhass>
phale: you trace backwards from the point where you notice the error, looking at all the intermediate values whether they are what you expect/assume
<zhan>
havenwood: Unix, for ubuntu, no. I seriusly want immidiate feed back as I'm still learning the language, searching for rgb or wtv pry is will still use command prompt. what term do i use in google to find what codecademy uses
<phale>
ok
plashchynski has joined #ruby
zenith_ has joined #ruby
DouweM has joined #ruby
<jhass>
phale: don't assume your (or anybody else) code is just doing/producing the right thing, verify
<phale>
ok uh
<phale>
i've noticed that all the rows well
<phale>
aren't all the rows
<phale>
in the image
maletor has quit [Quit: Computer has gone to sleep.]
qiffp has quit [Remote host closed the connection]
ascarter has joined #ruby
programmerq has quit [Read error: Connection reset by peer]
Timgauthier has joined #ruby
skj3gg has quit [Quit: ZZZzzz…]
mistermo_ has quit [Ping timeout: 240 seconds]
dfinninger has joined #ruby
<havenwood>
zhan: You can have your text editor eval Ruby (if the editor supports an inline REPL) or you can use Pry alongside a text editor (see `help` from inside Pry).
pawlz has joined #ruby
Timgauthier is now known as timgauthier_away
<waxjar>
xmp-filter, ftw!
dfinninger has quit [Read error: Connection reset by peer]
<havenwood>
zhan: If you're having trouble setting it up on your current setup, maybe just paste from your editor into Pry until you get more comfortable with your tooling.
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfinninger has joined #ruby
Mives has joined #ruby
adriancb has quit [Read error: No route to host]
aclearman037 has joined #ruby
sarkis has joined #ruby
<havenwood>
zhan: For example, I can see the output of my Ruby code (with varying degrees of elegance) from the text editors TextMate 2, Atom, LightTable, Sublime and emacs. (Hrm, what's a good way in vim?)
Sou|cutter has quit [Quit: WeeChat 0.4.3]
<ericwood>
havenwood: you can use ! but most of us prefer to have a separate term for running and seeing results
<zhan>
i got sublime
marcoamorales has joined #ruby
<havenwood>
ericwood: rgr
<jlebrech>
is there a dsl like rabl I can use within a class not a controller?
<jlebrech>
model*
<havenwood>
zhan: So good for running Ruby in Sublime and get that setup.
<havenwood>
s/good/google
DouweM_ has joined #ruby
User458764 has joined #ruby
<jlebrech>
jbuilder?
mengu has joined #ruby
mengu has joined #ruby
<zhan>
havenwoood: do i need a plugin, or is there in-line evaluator hidden somewhere
programmerq has joined #ruby
maximski has joined #ruby
SOLDIERz__ has quit [Quit: Be back later ...]
sambao21 has joined #ruby
<havenwood>
zhan: I'm not a regular Sublime Text user but I recall it being either built-in or available by plugin. Ask in the Sublime chan or check the interwebs.
DouweM has quit [Ping timeout: 252 seconds]
SOLDIERz__ has joined #ruby
alex88 has quit []
fabrice31_ has quit [Remote host closed the connection]
zenith_ has quit [Ping timeout: 256 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cache_Money has joined #ruby
sn0wb1rd has quit [Ping timeout: 245 seconds]
Limix has quit [Quit: Limix]
terrellt has quit [Ping timeout: 250 seconds]
<havenwood>
zhan: ##sublimetext
Asher has joined #ruby
Limix has joined #ruby
sarkis has quit [Ping timeout: 256 seconds]
<zhan>
join @sublimetext
kblake has joined #ruby
<zhan>
join #sublimetext
<zhan>
join ##sublimetext
<zhan>
#join sublimetext
<jhass>
zhan: / in front
aganov has quit [Quit: Leaving]
<zhan>
the chanel is empty
<ponga>
it seems a long journey for him to go ;p
<jhass>
zhan: wrong name then
anarang has joined #ruby
sn0wb1rd has joined #ruby
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
juanpablo_ has quit [Read error: Connection reset by peer]
kaiZen- has joined #ruby
DerisiveLogic has joined #ruby
juanpablo_ has joined #ruby
sarkis has joined #ruby
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michael_mbp has quit [Excess Flood]
sinkensabe has joined #ruby
User458764 has joined #ruby
<workmad3>
phale: just updated the gist btw, it now has an ansii_24 method for Colour that generates a 24bit colour code, and the 8bit colour code is closer to being correct... ansii colour codes suck
oddraisin has joined #ruby
michael_mbp has joined #ruby
anaeem1 has quit [Remote host closed the connection]
xaxisx has joined #ruby
agarie has joined #ruby
beneggett has joined #ruby
beneggett has quit [Client Quit]
<jhass>
you're really bored :P
febuiles has quit [Quit: febuiles]
ych4k3r has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<phale>
im reading
<phale>
TRPL
<workmad3>
jhass: yup :P
5EXAAN260 has joined #ruby
senayar_ has joined #ruby
<jhass>
workmad3: how about contributing something nice to Crystal stdlib? lots of fun stuff still open :P
<workmad3>
jhass: suggestions welcome on cleaning up the header parsing btw :)
<phale>
now add plain PPM parsing
<workmad3>
jhass: I didn't fancy a parser that slurped the entire file into memory, so it's doing a byte at a time
<workmad3>
phale: well, the next obvious step would be to ignore # comment lines
<jhass>
workmad3: show some love for until :P
thumpba has joined #ruby
sinkensabe has quit [Ping timeout: 250 seconds]
<shevy>
phale I picture your future with python
<ponga>
i wish i could contribute to crystal stdlib
<apeiros_>
shadoi: the size is not the relevant part
febuiles has quit [Quit: febuiles]
centrx has quit [Remote host closed the connection]
lolmaus_ has quit [Quit: Konversation terminated!]
<shadoi>
seems like a bad place to worry about optimization is all
<phale>
I want it to do this:
<phale>
xxx will output c
<phale>
rrr should also output c
<apeiros_>
shadoi: you say that without knowing anything about where it's used
SouL_ has joined #ruby
<apeiros_>
or how it's used
mistermocha has quit [Ping timeout: 244 seconds]
<shadoi>
apeiros: true enough, I suppose it could be in a high speed trading algorithm. But I highly doubt it. :)
<phale>
apeiros_: please look at my program
sambao21 has joined #ruby
<phale>
it is terribly wrong :(
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros_>
shadoi: doesn't need to be such an exotic case to matter
<apeiros_>
if you're using it on a large enough dataset, it can be the difference between a minute and an hour running time.
<shadoi>
sure
<shadoi>
readability > optimization until it matters.
thumpba has joined #ruby
<apeiros_>
and given that it costs me *zero* additional time to write my variant, I think *not* worrying about performance makes no sense.
<phale>
apeiros_: pretty please?
<phale>
pp?
mistermocha has joined #ruby
<apeiros_>
phale: "not working" is not a helpful problem description
<phale>
here's what I want sample input and output: xxxx AA
<apeiros_>
helping: exceptions, expected output, actual output
<phale>
should output
<phale>
db
thumpba_ has joined #ruby
* IceDragon
waves claw
<phale>
but it doesn't
<IceDragon>
phale: whats your problem, I'd be glad to help?
<phale>
nvm
<phale>
i found out the problem
<apeiros_>
btw., re "readability": mine is in all places just `alpha[char]`, yours is `alpha.index(char) + 1` in all places.
<apeiros_>
so IMO yours loses out in readability quickly if it's used in more than one place
<phale>
yes but how do i make it work
mjuszczak has quit []
Limix has quit [Quit: Limix]
thumpba has quit [Ping timeout: 246 seconds]
<apeiros_>
as for performance, the difference is actually less than I expected (and I'm pretty sure that it's better today than in older ruby versions): avg 3.4x, min: 1.4x, max: 5.3x
odigity has quit [Ping timeout: 265 seconds]
Limix has joined #ruby
<shadoi>
apeiros: good point :)
<shadoi>
re alpha[char]
Advocation has quit [Quit: Advocation]
tvw has quit [Remote host closed the connection]
<phale>
nvm i found the problem
meschi has quit [Quit: Leaving]
<phale>
the problem is that i coded it improperly
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
meschi has joined #ruby
tunaCanBruh has quit [Ping timeout: 252 seconds]
<jhass>
who would've guessed
mjuszczak has joined #ruby
tubuliferous has joined #ruby
iceden has quit [Ping timeout: 264 seconds]
<phale>
damn this sucks i cant figure out how to do this:
<phale>
convert xxx to c, but in the same logic as others
<phale>
xxxx should be d
<phale>
etc
<apeiros_>
phale: code?
wallerdev has quit [Quit: wallerdev]
rdark has quit [Ping timeout: 264 seconds]
<apeiros_>
seems to me like you'd also want the opposite mapping. not 'a' -> 1, but 1 -> 'a'
<phale>
yes!
jottr has quit [Ping timeout: 244 seconds]
<apeiros_>
phale: and what about "xxx…xx".size # => 50
wallerdev has joined #ruby
<phale>
hm
<phale>
no
<phale>
i need the opposite mapping
cazrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros_>
well, for lengths 1-26, you can do `(string.size+96).chr`
x1337807x has joined #ruby
<apeiros_>
>> str = 'xxxx'; (string.size+96).chr
<eval-in_>
apeiros_ => undefined local variable or method `string' for main:Object (NameError) ... (https://eval.in/296838)
<phale>
gives me that it doesnt exist or something
cajone has quit [Ping timeout: 240 seconds]
<shadoi>
jmosco1: then launch vim via pry, works nicely
<jhass>
phale: because you're still on a EOL'd ruby
<phale>
give me an EOL'd directory checking method/variable then?
<jmosco1>
shadoi: ok, looking at that now
jmosco1 is now known as jmosco
DEA7TH has joined #ruby
<jhass>
phale: EOL means out of support, so no support there
jottr has joined #ruby
phale_ has joined #ruby
<shadoi>
jmosco: gem install pry; pry -r 'code'
User458764 has joined #ruby
RegulationD has joined #ruby
<phale_>
what happened?
<shadoi>
then 'ls <object>' shows nicely formated info about the methods & variables
xaxisx has quit [Ping timeout: 255 seconds]
<shadoi>
or: ? <object>
<shadoi>
shows docs
blazes816 is now known as tcrypt
<phale_>
shadoi:
<phale_>
the 1.9.3p4 dir?
<phale_>
ok found it
<phale_>
i Did Dir.pwd
jottr_ has joined #ruby
tunaCanBruh has quit [Ping timeout: 245 seconds]
<zhan>
how come openoffice doesn't open fucking .db
_ixti_ has joined #ruby
<shadoi>
phale_: I definitely recommend using Pathname, it has lots of useful behavior
drkush has joined #ruby
phale has quit [Ping timeout: 272 seconds]
<shadoi>
But yeah, that works
yfeldblum has joined #ruby
<shadoi>
Although that may be the wrong path when you're talking about relative to a file in a nested directory structure, which is why you want __dir__ or __FILE__
<zhan>
and how do i get fucking alive or in-line repl
<shadoi>
zhan: pry
ixti has quit [Ping timeout: 246 seconds]
<zhan>
thats stupid shit
<zhan>
neither alive or in-line
RegulationD has quit [Ping timeout: 264 seconds]
<shadoi>
require 'pry'; binding.pry
jottr has quit [Ping timeout: 256 seconds]
einarj has joined #ruby
<shadoi>
wherever you want it to stop in-line
<zhan>
"stop"?
<shadoi>
interactive debugger prompt
<shadoi>
with a full REPL
<zhan>
yes
<zhan>
how do i fucking get that
<shadoi>
like I just fucking told you
OrbitalKitten has joined #ruby
<zhan>
i don't fucking understand
workmad3 has quit [Ping timeout: 256 seconds]
rodfersou has quit [Quit: leaving]
<shadoi>
gem install pry
<zhan>
i have
<Beoran_>
zhan, iy's a ruby debugger
<shadoi>
then in your code: require 'pry'
Stooge has left #ruby [#ruby]
<shadoi>
and where you want it to stop add: binding.pry
<zhan>
nothing is fucking happening
<josiah14>
zhan: is your code executing inside of a class?
<shadoi>
it's probably not getting to where you think it is then, add it earlier.
<vhlfd>
"nothing is fucking happening"
<zhan>
its at the top
<josiah14>
pry won't give you the context if you are at the top level of the program (like in a script with no claasses)
<josiah14>
wrap your code in a class and then try
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<josiah14>
I bet you pry will print the context, then
<josiah14>
zhan^
ndrei has joined #ruby
<zhan>
nothing
<josiah14>
I ran into this problem before when writing scripts. It IS breaking, you just can't see where
PaulCapestany has quit [Quit: .]
<josiah14>
but you should have access to all the objects
anaeem1 has quit [Remote host closed the connection]
* jhass
complains that this uses up all his popcorn reserves
tunaCanBruh has joined #ruby
drkush has quit [Ping timeout: 265 seconds]
<zhan>
jhass didn't tell me shit about
<shadoi>
josiah14: it works fine with nothing except: require 'pry'; binding.pry
<jmosco>
shadoi: I got it working, just not sure how to get the available methods to show up on objects
RegulationD has joined #ruby
phale_ has quit [Quit: Lost terminal]
<josiah14>
shadoi: it works, but it won't give you your 10 lines of context if you aren't breaking inside of a class
<josiah14>
so, with most programs, you would never enounter this, but in scripts where I never create a class for the main execution, I see this sort of stuff happens. Yes, it still works, but I can't tell where I am
<josiah14>
anyway, it sounds like zhan has bigger problems
Crazy_Atheist has quit [Ping timeout: 240 seconds]
tunaCanBruh has quit [Client Quit]
werelivinginthef has quit [Remote host closed the connection]
<josiah14>
zhan, can you verify that pry is installed?
<josiah14>
you need to install in globally using RubyGems
<havenwood>
jhass: was wondering if it's worth proposing for crystal, or if #try suffices
cajone has joined #ruby
<jhass>
havenwood: asterite's around ;)
<josiah14>
zhan: you are free to ask questions here, but we expect that you be respectful and that you do the legwork (read the docs). We aren't held under any obligation to answer your questions
<havenwood>
maybe i'll propose
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Crazy_Atheist has joined #ruby
<zhan>
what am i suppose to do with the doc
marr has joined #ruby
<josiah14>
read it - it tells you how to use your tools, zhan
Zai00 has joined #ruby
<zhan>
yes it doesn't fucking convey anything to me
<josiah14>
gem which will tell you if you have a gem installed
OrbitalKitten has joined #ruby
<havenwood>
zhan: no more swearing for you.
<jhass>
havenwood: I wonder if it actually makes more sense with crystal's block shortcut, can't think of anything adhoc though
<josiah14>
zhan - then learn to read the doc
<zhan>
maybe telling the command for checking if i install pry correctly is easier
triple_b has quit [Ping timeout: 245 seconds]
<josiah14>
zhan: Find the location of a library file you can require <- that's not what that says to you?
<jhass>
havenwood: since you could &.itself { }
<josiah14>
what do you think happens if the location of the library you request can't be found?
<josiah14>
zhan: You might also consider learning how to use your computer, as well (learn the command line)
<zhan>
it gave me an adress
rbennacer has quit [Remote host closed the connection]
x1337807x has joined #ruby
<zhan>
ill fry my nerves before i do
<josiah14>
okay, which version of ruby is in the path you got?
<zhan>
2.1
rbennacer has joined #ruby
<zhan>
i updated it...
<waxjar>
zhan, you should get familiar with the command line, it'll make things a lot easier :)
<jhass>
josiah14: pry has the gem-install command and you can escalate to your shell by starting with .
<josiah14>
type ruby -v into bash
<zhan>
2.1.5
<josiah14>
jhass: I know, but zhan isn't ready for that level of complexity, yet
<josiah14>
okay, zhan, it looks to me like your ruby version and your pry version match
tier has joined #ruby
ismaelga has quit [Remote host closed the connection]
<josiah14>
the other thing I guess is you need to make sure you execute your program with the pry command instead of the ruby command
<josiah14>
so instead of $ ruby my_script.rb, you would type $ pry my_script.rb
<zhan>
i did that says false
<josiah14>
the $ represents the bash prompt, don't type that
<zhan>
if youre talking about require 'pry'
<josiah14>
no
<josiah14>
your script
drkush has quit [Ping timeout: 256 seconds]
<josiah14>
when you run it
<josiah14>
you normally run it with ruby <your script name>
<josiah14>
replace ruby with pry
amundj has joined #ruby
<josiah14>
you have to run your scripts inside of pry if you want to debug
<zhan>
i want to debug in editor
<josiah14>
zhan: I'm also going to suggest that if you don't have the patience to learn your Operating System, programming is probably not the career for you
<zhan>
ill fuck up my syntax and every other word and etc.
<josiah14>
zhan: give up the editor, the most common way to debug in Ruby is in the REPL, whether its IRB or PRY
<josiah14>
if you want a full blown IDE, I suggest Ruby Mine
sargas has quit [Quit: Leaving]
<zhan>
jessus christ
<zhan>
how did no1 thought of telling me about that
<zhan>
spend over a day looking for that
<josiah14>
because most established ruby developers prefer not to use an IDE
<josiah14>
we are very comfortable with the CLI
mjuszczak has joined #ruby
<josiah14>
it's just not the way we do things :) -> we know what we know, we are not omniscient
<josiah14>
I only know about RubyMine because I worked on a team where some people used that IDE. It was mostly former Java developers and .NET programmers who were moved into Ruby development who used RubyMine
<grrrr_>
testing should stop you from making bugs to debug also :)
PaulCapestany has quit [Quit: .]
wald0 has quit [Ping timeout: 240 seconds]
Asher has quit [Quit: Leaving.]
PaulCapestany has joined #ruby
<josiah14>
zhan: Another potential reason nobody told you about RubyMine is because your rude behavior caused people to ignore you
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<josiah14>
zhan: Don't feel right not listing that out as a possibility
<zhan>
i've been at it since yesterday
<zhan>
and i have a lot of free time
<josiah14>
zhan: is this your first language?
<zhan>
like some of the shit that I ask and post you could tell id need IDE
<zhan>
y
Kricir has quit [Remote host closed the connection]
<josiah14>
zhan: because it changes my response
<zhan>
?
replay has quit [Ping timeout: 246 seconds]
nahtnam has quit [Quit: Connection closed for inactivity]
<josiah14>
zhan: if this is your first language, then the response is, programming is hard
<havenwood>
zhan: stop swearing in the channel.
<havenwood>
zhan: your contributions to curses and insults ratio is getting lousy.
<josiah14>
zhan: if this isn't your first language, then the response is learning a new programming language with a different way of doing things is hard
<havenwood>
zhan: be patient, this is hard stuff.
<zhan>
ty
<josiah14>
zhan: expect to spend days troubleshooting your own problems, maybe weeks, until you get the hang of things. We all went through this process cursing under our breathe until we got comfortable in Ruby
<havenwood>
indeed
<josiah14>
zhan: our job is to teach you how to find what you need without our help (use google, read the docs, know your computer/Operating System are good starting places)
<bradland>
If you can't manage `ruby myscript.rb`, your chances of correctly configuring and using RubyMine are not good
<josiah14>
bradland: ++
<josiah14>
bradland: +1 *
<bradland>
even a good IDE requires you to learn how to use the IDE, and IMO, the command line tools are far simpler than RubyMine
<zhan>
googled it, it doesn't define it
drkush has joined #ruby
<bradland>
zhan: it sounds like your just getting started.
<bradland>
my recommendation for anyone getting started is to start with the basics, and try not to rush headlong in to bigger problems until you understand the basics.
<josiah14>
zhan: ^ implies, you will need a lot of patience and need to spend many hours before you 'get it' and using Ruby feels natural
mwlang has quit [Quit: mwlang]
<bradland>
start with learning how the command line works
<bradland>
this isn't the best place for that, because it's the ruby channel, but there are lots of places you can learn the command line
adriancb has quit [Read error: Connection reset by peer]
ZJvandeWeg1 has quit [Remote host closed the connection]
<bradland>
at a minimum, you need to understand how to move around, how to execute programs, and how to pass arguments to those programs
<zhan>
ill try my chances with getting away just by developing an app
<bradland>
ok, well, in that case, gl;hf
<josiah14>
zhan: suit yourself. typically, when I haven't listened to the established experts (like a lot of people here are), I end up putting myself through a lot of pain and then doing what they suggested to me anyway
<josiah14>
zhan: but seriously, best of luck and happy hacking
<zhan>
what is moving around?
<bradland>
moving around the filesystem
ych4k3r has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bradland>
from directory to directory
imanzarrabian has joined #ruby
<josiah14>
zhan: Google 'unix cd ls cp mv grep less cat'
<bradland>
zhan: what OS are you on?
<zhan>
windows
<bradland>
ok, so those google phrases won't help you a whole lot
<josiah14>
correct
<josiah14>
I'm not even really sure how to use Ruby effectively in Windows
<josiah14>
Windows seems like it was always kind of a second thought for the Ruby community
<josiah14>
zhan: yes, you do. To become a programmer, you have to be all-in
<zhan>
why do i need several directories
sinkensabe has joined #ruby
<bradland>
the dream of developing applications through a GUI goes back a long way, but virtually everyone who has tried it has failed
<jhass>
bradland: disapointed, I expected that to go through lmgtfy :(
hollywood has quit [Quit: Leaving]
<bradland>
there are GUI tools that can help you along the way, but you won't be able to use them effectively until you understand what's happening behind the scenes
godd2 has joined #ruby
<bradland>
jhass: considered it... lol
graydot has quit [Quit: graydot]
<bradland>
i can't emphasize that enough zhan
danman has quit [Quit: danman]
<bradland>
GUI tools *seem* like they'll be easier, but they aren't
<bradland>
not at all
<josiah14>
zhan: Even if you want to develop on Windows, if you want to deploy to something like Heroku, Heroku gives you a Linux shell, so you have to learn something Unix-like no matter what
<bradland>
they end up generating tons of code that you won't understand
Channel6 has joined #ruby
Advocation has quit [Quit: Advocation]
<zhan>
like on server side
<bradland>
josiah14: is correct that if you're going to develop in ruby, you'll probably want to learn some basic linux, because the vast majority of ruby hosts are linux based
<bradland>
you could use a service like heroku without knowing much linux though
<bradland>
and you need to manage how much you're learning
The_Phoenix has quit [Read error: Connection reset by peer]
<bradland>
so i would keep it simple
<josiah14>
bradland: IDE's have their place. I did appreciate when Visual Studio C++ would drop me into the disassembly - helped me solve some strange errors in my early days (Assembly was my second programming language)
zachrab has joined #ruby
<bradland>
certainly
<bradland>
i'm not saying IDEs are bad, i'm saying they don't make things easier for beginners
adriancb has joined #ruby
<josiah14>
bradland: this is true. You still have to know what's going on. I hated the process of learning all the configuration to get Visual Studio working well
<bradland>
exactly
<bradland>
not to mention, you end up asking yourself: is my IDE config broken, do I have a system issue, or is my app broken?
<bradland>
with the base set of tools, you eliminate one of those three
dfinninger has quit [Remote host closed the connection]
<josiah14>
bradland: +1
<zhan>
so if you just take the code and stick it in editor you won't have same problems?
sinkensabe has quit [Ping timeout: 250 seconds]
<bradland>
with an editor, you're only editing the text
Sou|cutter has joined #ruby
<bradland>
your toolchain for running your app would be run from the command line
<bradland>
all an IDE typically does is execute command line tools for you, but the environment for those commands is controlled by the IDE
<bradland>
so you have to have your IDE configured correct
<bradland>
*correctly
<zhan>
good to know
<bradland>
and if something isn't working, you have to look at what commands are being issued, and how to understand them
<bradland>
hence the rabbit hold we're down now: you should learn the commands first :)
<zhan>
im trying to get in touch with my old classmate
<zhan>
hopefully he bullies through that
zachrab has quit [Ping timeout: 255 seconds]
<zhan>
so the IDE does the debugging, how do i see what it returns
drkush has quit [Remote host closed the connection]
<josiah14>
zhan: the IDE way of doing things is to flag lines as breakpoints in the editor, execution will halt at that point when you run the program through the IDE's run command, and then the way it gives you environment information depends on the IDE
<bradland>
an IDE can do debugging, but it varies from tool to tool
<josiah14>
some IDE's change layout and provide panes with information about your stack history, objects, and variables
MasterPiece has quit [Quit: Leaving]
<bradland>
josiah14: +1 (that's how most -- including RubyMine -- do it)
<bradland>
the visual debugger in RubyMine is absolutely fantastic
<josiah14>
other IDE's might do it differently
sambao21 has quit [Quit: Computer has gone to sleep.]
<josiah14>
bradland: that's good to hear a positive like that. I've always just used Pry, Vim, and Tmux as my 'IDE'
elaptics_away is now known as elaptics
<josiah14>
using Guard and Spork in that mix is like heaven - Tmux notifications when something I wrote breaks a test, and then automatically bringing up the Pry REPL in heaven
<bradland>
pry is my go to tool. i'll fire up RubyMine only if i'm really losing my mind.
<josiah14>
hmm, I got my sentence mixed up, but I think the point is still recognizable
sambao21 has joined #ruby
<bradland>
TracePoint is friggin incredible for >2.0 apps as well
<josiah14>
this has been fun, but I have to get something done this afternoon
<bradland>
if you haven't used the RubyMine debugger, you should absolutely try it some time though
<bradland>
haha, good luck (TGIF)
drkush has joined #ruby
tier has quit [Remote host closed the connection]
skmp has joined #ruby
<josiah14>
bradland: I may try it out sometime
<josiah14>
right now, though, my job also requires me to know Scala, Spark, Hadoop, Node, Angular, and jQuery, all of which I have only really gotten exposed to in the past year
drkush has quit [Read error: Connection reset by peer]
zhan has quit [Quit: Page closed]
SixiS has quit [Quit: SixiS]
<dtordable>
[josiah14] you mean spark of Ada?
it0a has quit [Ping timeout: 250 seconds]
decoponio has quit [Quit: Leaving...]
GaryOak__ has quit [Remote host closed the connection]
<josiah14>
dtordable: Apache Spark for Streaming Big Data
<dtordable>
ah ah
<josiah14>
bradland: thanks for the luck :). off to work.
<dtordable>
though it was that variant of Ada Language
<dtordable>
secure programming
<dtordable>
code over a convention and so
GnuYawk has quit [Ping timeout: 256 seconds]
jcromartie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbennacer has quit [Remote host closed the connection]
PaulCapestany has quit [Quit: .]
PaulCapestany has joined #ruby
Takle has joined #ruby
Morkel has quit [Quit: Morkel]
plashchynski has quit [Quit: plashchynski]
ferr has joined #ruby
rbennacer has joined #ruby
riotjone_ has joined #ruby
plashchynski has joined #ruby
zachrab has joined #ruby
workmad3 has joined #ruby
IrishGringo has joined #ruby
ntln has joined #ruby
ldnunes has quit [Quit: Leaving]
vifino has quit [Quit: Who turned this off?! D:<]
riotjone_ has quit [Ping timeout: 256 seconds]
<Sou|cutter>
josiah14: That sounds a lot like something I'm embarking on
freerobby has quit [Quit: Leaving.]
wallerdev has quit [Quit: wallerdev]
<josiah14>
Sou|cutter: I love it
fryguy has joined #ruby
rdark has quit [Quit: leaving]
<josiah14>
Can't wait to get comfortable in Big Data with all the machine learning and data science
werelivinginthef has joined #ruby
jobewan has joined #ruby
GGMethos has quit [Quit: WeeChat 1.0.1]
<fryguy>
i'm trying to write a function to merge hashes putting duplicates into an array. ie [{key: true}, {key: false}] would become {key: [true, false]}. I've been fumbling with enumerator methods and can't find a clean way to do this. any suggestions?
xaxisx has joined #ruby
<fryguy9>
whoa...I thought *I* wrote this somehow o_O
rbennacer has quit [Remote host closed the connection]
x1337807x has quit [Read error: Connection reset by peer]
<fryguy>
workmad3: yah, you need to flatmap over something like that. it gets messy quickly
<workmad3>
fryguy: throw a .flatten on the end there if you want to merge more than 2 hashes together and flattep them all
<fryguy>
wondering if there is a simpler way
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
<fryguy>
currently working with:
<fryguy>
x.inject({}) {|memo, i| memo.merge(i) {|k, o, n| Array(o).push n}}
<fryguy>
but that is just unreadable bad code
werelivinginthef has quit [Ping timeout: 252 seconds]
Zai00 has quit [Quit: Zai00]
<josiah14>
you could do something like hash1.each_with_object({}) { |item, result| result[item.key] ? result[item.key] << hash2.value : [hash2.value] }
<josiah14>
^ untested fryguy
<fryguy>
again, way too long and unreadable
rbennacer has joined #ruby
<josiah14>
fryguy: that's long and complicated? Good luck finding something simpler
<workmad3>
fryguy: not sure you're gonna get better than with 'ary_of_hsh.inject{|hsh, merged| merged.merge(hsh){|v1, v2| [v1,v2].flatten}}'
<zeel>
does anyone know the regex gsub to escape a " in a CSV for ruby 2.2.0?
<workmad3>
fryguy: or your current Array(v1) << v2
<zeel>
gsub(/"/,'') is not the solution I want
<josiah14>
fryguy: if you want something shorter-looking, you might try out Haskell or Lisp...
morenoh149 has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby
<workmad3>
fryguy: if you want it clearer, you're gonna need to expand it out of a 1-liner
lxsameer_ has quit [Quit: Leaving]
GreenObsession has joined #ruby
IrishGringo has quit [Remote host closed the connection]
IrishGringo has joined #ruby
shevy has joined #ruby
AlexRussia has quit [Ping timeout: 255 seconds]
DEA7TH has quit [Ping timeout: 245 seconds]
jeff_laplante has joined #ruby
iliketurtles has joined #ruby
jmdade has joined #ruby
kapowaz_ is now known as kapowaz
Asher has joined #ruby
<jhass>
fryguy: another trick is [item, *items]
kaiZen has joined #ruby
xaxisx has quit [Quit: xaxisx]
cocotton_ has joined #ruby
<shadoi>
zeel: there are lots of corner-cases for parsing CSV, I think the parser has ways to deal with quotes.
xaxisx has joined #ruby
<apeiros_>
somebody wants to roll their own csv parser?
rbennacer has quit [Remote host closed the connection]
<apeiros_>
zeel: use the CSV class
<apeiros_>
zeel: if you do it yourself and ask questions like this, you *will* do it wrong.
iamjarvo has joined #ruby
Macaveli has joined #ruby
<ddv>
banging csv into submission like its 1999
reinaldob has quit [Remote host closed the connection]
Macaveli has quit [Max SendQ exceeded]
cocotton_ has quit [Read error: Connection reset by peer]
graydot has joined #ruby
cocotton has quit [Ping timeout: 256 seconds]
AxonetBE has joined #ruby
<AxonetBE>
Today I had a strange behavior on my server, suddenly all request resolves in 500 error, no matter which controller and I got this in my stacktrace. I can't find anything on google about it. Somebody has an idea what it can be? https://gist.github.com/DriesS/3f9536f11fe778dc34d1
wallerdev has joined #ruby
<zeel>
apeiros_: I am using the CSV class
Macaveli has joined #ruby
<apeiros_>
zeel: then you don't have to escape anything yourself
<apeiros_>
CSV does that for you
GreenObsession has left #ruby ["Leaving"]
cocotton has joined #ruby
<apeiros_>
ddv: csv, that "simple" thing that is being done wrong since like 1980
rbennacer has joined #ruby
<zeel>
unfortunately I work with data feeds that come into CSV that I have to parse as sane objects
<apeiros_>
(microsoft interpreting "comma" as ";" doesn't help either)
<apeiros_>
zeel: so?
<ddv>
apeiros, yep
<zeel>
the CSV feed doesn't have quote marks to delimit strings etc
<workmad3>
apeiros_: or seeing 'CSV' and thinking 'hey, you know what would make this bettor? tabs!!!!'
<bradland>
use the force, zeel. let it flow through you.
adriancb has joined #ruby
<zeel>
haha 1 sec still testing
<zeel>
csv.rb:1874:in `block (2 levels) in shift': Illegal quoting in line 1.
nfk has quit [Quit: #gentoo-hardened happy now?]
fryguy9 has quit [Quit: Leaving.]
<bradland>
ha! sounds like working with CSV to me.
<bradland>
problem with CSV is there is no such thing as standard CSV
seitensei has quit [Quit: No Ping reply in 180 seconds.]
dfinninger has quit [Remote host closed the connection]
havenwood has quit []
5EXAAM0AM has quit [Quit: Leaving...]
<apeiros_>
ok, the update does not change the ABNF. so only "
<apeiros_>
bradland: there's RFC CSV. and anything not following it can go and burn in hell.
* apeiros_
looks at M$ products
fryguy9 has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
seitensei has joined #ruby
seitensei has quit [Changing host]
seitensei has joined #ruby
eam has quit [Ping timeout: 264 seconds]
Sou|cutter has quit [Ping timeout: 256 seconds]
rcs has quit [Ping timeout: 264 seconds]
eam has joined #ruby
<zeel>
apeiros_: try and get vendors to supply standardized CSV's ....
* apeiros_
hands zeel a bat
<apeiros_>
have fun
<apeiros_>
beat sense into their heads.
maletor has joined #ruby
rcs has joined #ruby
<apeiros_>
also tell them that they should not call something CSV which is really "random blob of text interspersed with commas"
cpt_yossarian has quit [Ping timeout: 256 seconds]
xymbol has joined #ruby
<weaksauce>
so I have some ruby plugin for macvim that pops up some documentation when you hover over a symbol but it keeps erroring anytime I move the mouse that dyld: lazy symbol binding failed: symbol not found _rb_str_new_static Referenced from .../ruby/2.2.0/.../json-1.8.2/... expected in : flat namespace. any ideas?
red_horned_rihno has joined #ruby
<ddv>
weaksauce, ask the maintainer of that pluign
<workmad3>
weaksauce: sounds like the ruby you compiled macvim against isn't visible anymore
<weaksauce>
ddv I am not sure which plugin it is that is doing that tbh
adriancb has joined #ruby
<weaksauce>
workmad3 that could be
roolo has joined #ruby
<weaksauce>
though. I didn't compile this one
<workmad3>
weaksauce: when I get that sort of error I typically rebuild through homebrew :)
<ddv>
weaksauce, brew reinstall macvim?
<weaksauce>
I didn't compile it through brew actually. just downloaded it from the net
ismaelga has joined #ruby
<shevy>
recompile!
<ddv>
you don't have to shout in shevy
<weaksauce>
maybe one of the plugins is compiled... I'll blow out the plugin folder
<ddv>
-in
<shevy>
-out!
<ddv>
!!!
<shevy>
people need to embrace compiling thingies
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<weaksauce>
shevy I compile ycm fine.
<fryguy>
jhass, I think your trick helped. Not sure how I feel about this, but: x.inject({}) {|i, n| i.merge(n) {|k, *v| v}}
<weaksauce>
it's no big deal to compile things
<workmad3>
weaksauce: ah you're using YCM? yeah, that'll probably need rebuilding
<workmad3>
weaksauce: I stopped bothering with YCM because it was a PITA on that front :)
hgl has quit [Ping timeout: 246 seconds]
<weaksauce>
well I removed ycm a while ago because of python issues.
<weaksauce>
added it back in and got that resolved but somehow it borked my ruby.
<weaksauce>
oh wait! I removed a ruby thing from my path that I thought was not needed
mjuszczak has quit []
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<workmad3>
hehe
<workmad3>
could be it was important? :)
Hijiri has joined #ruby
paulfm has quit [Quit: Zzzzz...]
<weaksauce>
perhaps.
JDiPierro has quit [Remote host closed the connection]
hgl has joined #ruby
<zeel>
apeiros_: You sir are a genius, I figured out the solution
<zeel>
I had to read the file into an array
<zeel>
for it to parse properly by CSV, doesn't like it raw
rhllor has quit [Quit: rhllor]
<zeel>
Thank you sir
<bradland>
zeel: i've seen that before too
<bradland>
slurping in the file doesn't work, but going line by line does
<bradland>
you know, that's probably a bug in the CSV lib
<apeiros_>
zeel: that sounds odd…
<apeiros_>
zeel: can you provide example input where that will happen?
<bradland>
zeel, is this data that you could provide so taht we could try to replicate and open a ticket
<bradland>
echo... echo... echo :)
<weaksauce>
boom. dumb path issue
<apeiros_>
cho… cho… cho…
<apeiros_>
o… o… o…
ByronJohnson has quit [Quit: Restarting client.]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
majoh has quit [Quit: bam bam bam bam]
<zeel>
apeiros_, bradland sure thing, give me a moment to format it all
<bradland>
you know, i seem to recall my issues having something to do with line endings... so a gist might not do the trick
snockerton has quit [Quit: Leaving.]
<bradland>
in other words, we may not have issues with it because gist will reformat the line endings
<bradland>
that really jogged my memory
<bradland>
zeel, the issue isn't with the illegal quoting, it's that MS Excel generated CSV files are a shit show
<bradland>
CSV.open doesn't handle the line endings well
<bradland>
but File.readlines will
vifino has joined #ruby
<ragingcake_>
can I put a $ gem server behing 127.0.0.1/gems?
jamgood9_ has joined #ruby
dfinninger has joined #ruby
Takle has quit [Remote host closed the connection]
IrishGringo has joined #ruby
Takle has joined #ruby
Macaveli has quit [Ping timeout: 264 seconds]
werelivinginthef has joined #ruby
<shevy>
ragingcake_ I assume so, you have to run it locally
sarkis_ has quit [Quit: WeeChat 1.1.1]
<ragingcake_>
I’m tyring to use nginx to do it but
<apeiros_>
bradland: now that you say it - I remember having had issues with encodings. I could not use CSV.open, I had to use File.read to transcode and feed that to CSV.
<ragingcake_>
no lck
<ragingcake_>
only seems to work if its on the root context
<apeiros_>
but I didn't investigate time, I might well have used it wrongly.
jamgood96 has quit [Ping timeout: 256 seconds]
<apeiros_>
*invest
<shevy>
gem_server --dir=/gems --daemon
<shevy>
that should have worked in the old days
<ragingcake_>
nice thank you
<shevy>
or when it was webrick, one could mount servlets
thumpba has joined #ruby
<shevy>
does not work for me either haha
ItSANgo has joined #ruby
<ragingcake_>
hmm
<zeel>
bradland: you're correct in the fact that I was doing File.open('products.csv').read
<zeel>
that outputs it as a string where as readlines will output it as an array
dziegler_ has joined #ruby
thumpba_ has joined #ruby
<ragingcake_>
ah how do I remove the ssl verify when adding gem sources!
thumpba__ has joined #ruby
spyderman4g63 has quit []
RegulationD has quit [Remote host closed the connection]
ItSANgo has quit [Client Quit]
mjuszczak has joined #ruby
Sou|cutter has joined #ruby
RegulationD has joined #ruby
grrrr_ has quit [Read error: Connection reset by peer]
brb3 has quit [Quit: <.<]
thumpba has quit [Ping timeout: 264 seconds]
thumpba_ has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
mjuszczak has quit [Client Quit]
plashchynski has quit [Quit: plashchynski]
<ddv>
ragingcake_, fix your real problem
sivsushruth has quit [Ping timeout: 245 seconds]
imanzarrabian has joined #ruby
plashchynski has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
morenoh149 has joined #ruby
soulcake has quit [Quit: Quack.]
zorak8 has quit [Ping timeout: 265 seconds]
rbennacer has quit [Remote host closed the connection]
soulcake has joined #ruby
sivsushruth has joined #ruby
bMalum has quit [Quit: bMalum]
ItSANgo has joined #ruby
rbennacer has joined #ruby
centrx has quit [Remote host closed the connection]
canton7 has joined #ruby
canton7 has joined #ruby
rbennacer has quit [Remote host closed the connection]
bashusr has quit [Ping timeout: 246 seconds]
Asher has quit [Quit: Leaving.]
<apeiros_>
zeel: I didn't miss your gist, right?
Azure has quit [Excess Flood]
jonr22 has joined #ruby
Azure has joined #ruby
workmad3 has quit [Remote host closed the connection]
VBlizzard is now known as _blizzy_
Azure has quit [Read error: Connection reset by peer]
rbennacer has joined #ruby
sevvie has quit [Ping timeout: 245 seconds]
<arclitgold>
i'm having a tough time finding a good way to see if a system daemon is running in ruby
<arclitgold>
i must not have my google fu with me today
d10n-work has quit [Quit: Connection closed for inactivity]
GaryOak_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
<zeel>
apeiros_: nope still doing more testing, this is very weird
<bradland>
cfruby hasn't been updated in a long, long time, so no idea if it's still functional with supported versions of ruby
<bradland>
there are other libraries like ohai that might do what you want though
jonr22 has quit [Ping timeout: 256 seconds]
febuiles has quit [Ping timeout: 246 seconds]
lanemeyer has quit [Ping timeout: 246 seconds]
<apeiros_>
zeel: kk, might be afk in a bit
<zeel>
ok no problem
<bradland>
there are other libraries like ohai that might do what you want though
<bradland>
derp, sry
<arclitgold>
bradland: what about just using the standard lib?
rbennacer has joined #ruby
<bradland>
arclitgold: afaik, the only way to do that with stdlib would be to shell out and parse the output of something like ps
<bradland>
which wouldn't be horribly difficult
<bradland>
if you know the location of something like the pid file, that would be helpful too, becaus eyou can simply read the contents of that pid file and use it to filter ps output
<arclitgold>
ah i see
<arclitgold>
ok - that's the way i was going but wanted to find a way to do it in pure ruby
febuiles has joined #ruby
<arclitgold>
wonder why no one picks up cfruby anymore?
<arclitgold>
maintains in i mean
nateberkopec has quit [Remote host closed the connection]
n80 has quit [Quit: n80]
jamgood9_ has quit [Remote host closed the connection]
jamgood96 has joined #ruby
<bradland>
arclitgold: not sure, but you could probably learn a few tricks by digging around in the cfruby code
mistermocha has quit [Read error: Connection reset by peer]
<bradland>
gem fetch cfruby will get the gem file
<bradland>
which you can unpack and dig around in
mistermocha has joined #ruby
rbennacer has quit [Remote host closed the connection]
Pupeno has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
Guest123 has joined #ruby
Altonymous has quit [Quit: Altonymous]
<shevy>
just like you dig up a corpse at night and dig into
<bradland>
arclitgold: so... digging around a little in cfruby reveals lots and lots of `system command here`
<bradland>
aaaaaand here comes shevy to make it weird
<shevy>
hacks on top of hacks on top of hacks
<shevy>
yeah!
elfuego has quit [Quit: elfuego]
<bradland>
lol
leafybasil has joined #ruby
<bradland>
not even past Q1 and we've met our grave robbing reference quota for the year
<bradland>
so instead of changing a system, i replace it
tubuliferous has joined #ruby
<bradland>
meaning, for example, i don't migrate ruby versions, i just provision a new system, hit it with my build tool, then point everything at the new system
mistermocha has quit [Remote host closed the connection]
n80 has joined #ruby
<bradland>
i'm looking at ansible a lot more lately though
<jhass>
kind of where systemd is moving with read-only /usr and tmpfs /etc
<arclitgold>
intersting! never had heard of sprinkle before
<bradland>
idempotence is just too big of a pain in the ass for me
maximski has quit [Read error: Connection reset by peer]
<bradland>
well, i mean, that's not entirely true. i just focus on making build scripts that are complete end-to-end
febuiles_ has joined #ruby
maximski_ has joined #ruby
roshanavand has quit [Ping timeout: 255 seconds]
<bradland>
i *could* run them over and over, but technically they're not idempotent, because they'd be re-writing files and such
<bradland>
but the system would still work
<bradland>
sprinkle has some features that help with idempotence, but they're kind of limited
<bradland>
i'm a bit irked with a recent change in the way file transfers are handled though
<bradland>
all your "templates" have to go in a single folder
<bradland>
which annoys the hell out of me
<bradland>
i'm on an old version with a custom patch or two
febuiles has quit [Read error: Connection reset by peer]
<GaryOak_>
with minitest how do I keep a variable that can be accessed throughout the tests?
mistermocha has joined #ruby
<bradland>
awesome, thx zeel!
justin_pdx has joined #ruby
<zeel>
np
juanpablo_ has quit [Quit: (null)]
centrx has joined #ruby
juanpablo_ has joined #ruby
x1337807x has joined #ruby
<zeel>
bradland: fwiw, this is the minimum viable solution I can come up with, the method you talked about with readlines works, but that's because the string gets inserted into an array
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
werelivinginthef has quit [Remote host closed the connection]
hs366 has joined #ruby
<hs366>
hi
riotjone_ has joined #ruby
<bradland>
zeel: yep, this is similar to something i've run in to in the past. will dig around and see if i can arrive at a description suitable for a ticket.
werelivinginthef has joined #ruby
<zeel>
bradland: thanks for being involved, much appreciated :)
<bradland>
just hope it doesn't end up like the issue i filed on Net::SSH lol
<bradland>
May 2013... still open @_@
<zeel>
the other solution is manually reformatting the CSV using openoffice, but let's face it, that is not pragmatic enough for us devs :)
<bradland>
note that rubular shows you all matches for a regex
<bradland>
depending on the ruby regex method you're using, you might only get the first match, or you might only get a true/false based on whether a regex match is found at all
<hs366>
bradland, thats cool
mistermocha has joined #ruby
spicerack has quit [Changing host]
spicerack has joined #ruby
<jhass>
mmh, I know nil or or a number, nil or MatchData, nil or String, what's returning true false?
spicerack has quit [Changing host]
spicerack has joined #ruby
<bradland>
ok, ok. truthy/falsy :P
greenbagels has joined #ruby
<bradland>
i don't know of any that return True or False
<apeiros_>
so what you want to do is parse or sanitize invalid csv
<zeel>
apeiros_: I know, due to lack of ""
Guest123 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zeel>
apeiros_: any suggestions on how to parse or sanitize?
<apeiros_>
different situation than what I understood to be your situation
<shevy>
godd2 do you remember your github link of that javascript game?
bashusr has joined #ruby
serivich has joined #ruby
<godd2>
shevy you mean the demo or the code?
<zeel>
this is what I thought the gsub for file read string would work, but the CSV lib is not accepting the escape
AxonetBE has quit [Quit: AxonetBE]
<apeiros_>
zeel: how do you deal with invalid data? I'd seriously consider clubbing the party which emits this BLOB (it's NOT csv, and if they call it csv, ask them to fix or refund)
<shevy>
godd2 I don't remember; I only remember you gave me a link a while ago, this time I will save it locally so I don't forget
<apeiros_>
as for a work-around - depends on the total of your data
<shevy>
thanks!
<godd2>
:)
<apeiros_>
I'd probably build a custom parser using StringScanner
<zeel>
apeiros_: probably around 800 rows
<godd2>
shevy I should probably bring the deps up to date on that
<zeel>
to be honest, I prefer the readlines method as it keeps it more rubyistic
<apeiros_>
zeel: how often do you have to import the data?
sambao21 has joined #ruby
dtordable has quit [Ping timeout: 245 seconds]
<apeiros_>
I'm not quite sure how using readline helps you with this
<bradland>
apeiros_: it doesn't
<bradland>
not in my testing
codecop has quit [Remote host closed the connection]
<zeel>
apeiros_: this is not an on-going problem, this is purely for my own experimentation on getting to grips with ruby idioms, but I ran into a case where I was doing a data import and would thought it would be great to investigate
<shevy>
godd2 lol is the logo new?
<bradland>
i can't parse this "CSV" no matter what
<bradland>
zeel: what was the source of this CSV data?
<bradland>
hand built, or from an app?
<shevy>
dead chickens
adriancb has joined #ruby
<bradland>
no joke
<zeel>
bradland: I was supplied in an xls file
<shevy>
aha!
jbw_ has joined #ruby
mistermocha has quit [Remote host closed the connection]
<apeiros_>
zeel: it doesn't accept it because escaped quote is only valid in a quoted field
<zeel>
technically, I could just format it automatically using openoffice
<bradland>
just the other day, a chicken ran across the road in front of our car, and we were not in a rural area
<godd2>
shevy according to the commit log, I added it on Dec 10
<zeel>
apeiros_: Yes I'm gathering that so far from my experimentations
<apeiros_>
zeel: i.e. `foo,"bar""baz",quuz` # valid
<bradland>
zeel: so you did file, save as csv in Excel?
<apeiros_>
`foo,bar""baz,quuz` # invalid
<shevy>
bradland cool. here it's all concrete and stone... a few green/grass areas, or small parks, with perhaps some birds, the occasional cat without an owner and perhaps a few mice, rats or squirrels... but no free chickens
<apeiros_>
zeel: you can try plain split
<bradland>
couple days later.... dead chicken in the road
<apeiros_>
i.e. File.readlines(path).map { |line| line.chomp.split(/,/) }
<zeel>
bradland: imported in open office, but it gives you the option to wrap text fields in quotes, which parses fine
CAP5562 has quit [Client Quit]
cjim_ has joined #ruby
<shevy>
godd2 guess I did not see it yet! an artist is hiding in you!
<bradland>
apeiros_: is a regex required? can't you do split(',')
<bradland>
and save the overhead?
mjuszczak has joined #ruby
<apeiros_>
bradland: using a string is the overhead ;-)
<bradland>
hahaha, touche
<apeiros_>
string arg to split is iirc converted to regex
<bradland>
ha!
RegulationD has quit [Remote host closed the connection]
<bradland>
i thought it might be like gsub vs tr
<bradland>
where tr is faster
<bradland>
helps to know your ruby internals though
<apeiros_>
but the overhead is academic anyway
<shevy>
benchmark!
<bradland>
especially for 50 lines of csv lol
RegulationD has joined #ruby
iliketurtles has joined #ruby
<shevy>
oh I have one :)
<bradland>
i used to parse many, many geebees of CDR (call data records) once upon a time
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bradland>
wherein i learned much about shevy's buddy benchmark
<shevy>
unfortunately my tests will probably be skewed as my computer is like at max cpu...
<bradland>
at one point, strptime was slower than strftime
<bradland>
if you can believe that
mjuszczak has quit [Client Quit]
<shevy>
I don't think I have ever had a test using strftime
<bradland>
Benchmark::bm shouuld accept -1 to auto-size the label
<shevy>
oh wait...
<shevy>
I think this may be because of '' ...
<apeiros_>
it'd be nice if CSV had a try_parse/parse_broken/parse_invalid method, which accepts a couple of options to deal with the most common insanities
<bradland>
apeiros_: indeed it would.
starless has joined #ruby
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
claw has joined #ruby
fgo has quit [Ping timeout: 245 seconds]
<shevy>
Has anyone of you ever had this crazy idea to add all the ways how the R programming language displays and manages data, into Ruby?
jherbst has quit [Client Quit]
<shevy>
I'd rather want to write ruby than R :(
<claw>
Hey there why do i have to run ObjectSpace.garbage_collect to get my memory freed ? i thoug gc would run periodicaly ?
odigity has quit [Ping timeout: 265 seconds]
<shevy>
claw do you have to?
<apeiros_>
claw: you shouldn't have to
<apeiros_>
and yes, gc runs on its own. unless you disable it.
<claw>
shevy i was searching for memory leak
cpt_yossarian has joined #ruby
baweaver has quit [Remote host closed the connection]
<shevy>
cool
<claw>
now i run gc periodically somewhre and memory is noticeable better
serivich has quit [Ping timeout: 255 seconds]
<claw>
before i was growing and growing no its just fine
<godd2>
shevy can you give an example of how R would display some data?
zachrab has quit [Remote host closed the connection]
ghostpl_ has quit [Remote host closed the connection]
narcan has joined #ruby
zachrab has joined #ruby
<shevy>
godd2 hmm a moment
<shevy>
godd2 first you fill up some data, then you can draw a plot like: plot(cars, type="o", col="blue")
mistermocha has joined #ruby
<godd2>
kinda like excel?
<shevy>
godd2 then it may look like this shevegen.square7.ch/R_PICTURE_01.png
<shevy>
yeah kinda
sambao21 has quit [Quit: Computer has gone to sleep.]
<shevy>
the drawings/graphs are cool
<shevy>
but I don't like the R syntax
<godd2>
Oh I see
<shevy>
where it excels is in statistics
greenbagels has quit [Read error: Connection reset by peer]
<godd2>
surely there are graphing gems?
<shevy>
you have a function like summary() in interactive R that really gives you all you want or need from a dataset
<shevy>
> summary(array)
<shevy>
Min. 1st Qu. Median Mean 3rd Qu. Max.
<shevy>
1.0 1.5 2.0 2.0 2.5 3.0
mistermocha has quit [Read error: Connection reset by peer]
<shevy>
most of these things can be written in ruby just fine, the Math module should have most of the parts
<shevy>
but I am unsure what to do with the graphic component