scottschecter has quit [Ping timeout: 260 seconds]
baweaver has joined #ruby
iateadonut has joined #ruby
baweaver has quit [Remote host closed the connection]
joneshf-laptop has quit [Ping timeout: 245 seconds]
<alex88>
and locally also that .utc.to_f result is correct
wolffles has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
ebbflowgo has joined #ruby
hannelita has joined #ruby
<wolffles>
hey guys im back with a new problem :[
workmad3 has joined #ruby
ympeg_ has quit [Ping timeout: 250 seconds]
ss_much has quit [Quit: Connection closed for inactivity]
<wolffles>
i have a list of numbers 20 x 20 and im trying to make an array of arrays 20 numbers in each one,
ympeg has quit [Ping timeout: 264 seconds]
yfeldblum has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
<wolffles>
the problem is instead of just listing all 400 numbers in one single line its already nicely layed out
<eam>
alex88: I assume it has something to do with the def_delegators?
SaintAardvark has joined #ruby
<Ox0dea>
wolffles: File.read('euler11').split
spider-mario has quit [Remote host closed the connection]
<alex88>
eam: but those delegates to the @time variable, which you're calling those methods on the main class instance isn't it? here I'm dealing just with the internal variables
<kirillzh>
wolffles how are the numbers represented?
<Ox0dea>
wolffles: It's actually a lot easier if you don't split it into 20 sub-arrays, mind.
<wolffles>
oh really?
<Ox0dea>
Oui.
<alex88>
Ox0dea: https://gist.github.com/alex88/deec53d2da99d3b5cf7f I've added "time.utc.to_f.to_s" so it does that on ".utc" even on the argument... anyway, let me check, I haven't installed it on my system but I'm not sure if logstash has it bundled or something like that
<wolffles>
i was thinking of using position numbers if you can enlighten me
<Ox0dea>
Position numbers?
<wolffles>
in arrays to find out if its diagonal or ajacent
<Darmani>
Ox0dea: You're working hard today =p
coyo has joined #ruby
<Ox0dea>
Am I?
<alex88>
btw, from another log line, when instead of a bigdecimal it passes a float, it works fine
drocsid has joined #ruby
chouhoulis has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Ox0dea>
Each is for *doing* something. A Hash doesn't *do* something; it just exists.
<Darmani>
I want to grok it though
<Darmani>
it just exists.....
<Darmani>
o.O??
<Ox0dea>
Your block is just yielding a Hash, which is then thrown away.
minimalism has joined #ruby
<Darmani>
I have to map it? :O
<Ox0dea>
If you want to?
* Darmani
sighs
binaryplease1 has quit [Ping timeout: 250 seconds]
<wolffles>
im getting (Errno::ENOENT) even tho the file path is correct
atomical_ has joined #ruby
atomica__ has quit [Ping timeout: 256 seconds]
<Ox0dea>
You "re-implemented" a solid chunk of Enumerable last week, and today you're futzing with guessing which method to use. Something's not right.
<Ox0dea>
You're not trying to learn.
<Darmani>
I'm experimenting D:
<Ox0dea>
It's not working.
<Darmani>
Well yeah... But I just wanted to see if it would work...
tvw has quit [Remote host closed the connection]
<Ox0dea>
Guessing is for suckers.
<Darmani>
-,-
dwfait has joined #ruby
<Ox0dea>
wolffles: Computers can't lie.
<Radar>
wolffles: hint: the file path is not correct
<wolffles>
i did puts Dir.pwd
<wolffles>
your right
<Radar>
wolffles: code plz
<Radar>
you're*
<Darmani>
Ox0dea - I mean at least I have the right idea though right? I'm not like... Struggling to understand what hashes are and arrays and what not... It's just making them and transforming them now.
<Darmani>
That's not progress? Q.Q
<wolffles>
oh radar you would hate texting me
<Radar>
wolffles: c
n_blownapart has joined #ruby
<Ox0dea>
Darmani: It is progress, but it's gonna be slow going if you don't stop to internalize what you're learning.
dcunit3d has joined #ruby
ebbflowgo has joined #ruby
* Darmani
sighs
<Darmani>
Ox0dea - rite..
atomical has quit [Ping timeout: 256 seconds]
<volty>
>> "Ciao miao hao hi ciao".split.inject(Hash.new(0)) { |h, w| h[w.downcase] += 1; h }
<Darmani>
>> "why does programming suck so much".each_with_object(Hash.new(0)){|e, v| v[e] += 1}
<Ox0dea>
Denied.
<Radar>
Ah the Eternal Question is asked again.
dwfait has quit [Ping timeout: 240 seconds]
<Darmani>
Ox0dea - Shutuppp at least I got it right xP
mfb2 has joined #ruby
<Radar>
>> "why does programming suck so much".each_with_object(Hash.new(0)){|e, v| v[e] += 1}
<Radar>
>> "why does programming suck so much".each_with_object(Hash.new(0)){|e, v| v[e] += 1}
<ruby[bot]>
Radar: # => undefined method `each_with_object' for "why does programming suck so much":String (NoMethodError) ...check link for more (https://eval.in/507803)
<Radar>
Darmani: Did you? ;)
<Darmani>
Radar - Lol......
<Darmani>
Oh shit
musicnode has joined #ruby
<Darmani>
I forgot to split the string.
<baweaver>
thems the breaks
<Darmani>
>> "How come I can't use the bot. It's not fair.".split.each_with_object(Hash.new(0)){|e,v| v[e] += 1}
hannelita has quit [Remote host closed the connection]
<Radar>
Consider splitting the words only once.
<Ox0dea>
Nice Array of Hashes; that'll come in handy, surely.
Ebok has joined #ruby
<Darmani>
Why can't everyone just be happy for me
<Darmani>
Q.Q
<Radar>
Ox0dea: Beat me to it.
<Radar>
Darmani: We are happy.
<Radar>
Darmani: Like Russian Gymnastics coach happy.
ebbflowgo has quit [Quit: ebbflowgo]
<Radar>
9.5/10 is not 10.
<Ox0dea>
^
<Radar>
:D :D
<Ox0dea>
<3 <3
<Darmani>
Russian Gymnastics coach
x77686d has quit [Quit: x77686d]
<Darmani>
Sounds like you've had a terrible past Radar lol
<Ox0dea>
It's a synonym for High Expectations Asian Father.
joneshf-laptop has joined #ruby
<Darmani>
Was that your experience Ox0dea? =P
<Ox0dea>
Darmani: 9.5/10 was a paddlin'.
<Radar>
Ox0dea: "B? You Asian, not Bsian"
<Darmani>
Ox0dea - Lmaoooo
<volty>
enough to count if you want to realize who's doped, all the rest is propaganda
<Radar>
Darmani: I just tried being better than the kids in the ghetto where I grew up and so I still have a massive "I must compete at everything and be the best" streak.
<volty>
count medals
<volty>
I mean the share of medals
<Ox0dea>
Straya has ghettos?
devlitzi has quit [Quit: devlitzi]
<Radar>
Ox0dea: Better believe it.
<Radar>
(or else)
<Darmani>
Radar - damn son. Never would have thought.
<Ox0dea>
Ha.
gix has joined #ruby
<Ox0dea>
I do, of course; I just like saying Straya.
mrsolo_ has quit [Quit: This computer has gone to sleep]
<Ox0dea>
Straya, Murica, and Yurop.
yfeldblum has joined #ruby
<Radar>
Canadia.
<Darmani>
Straya = Australia...?
<Radar>
Darmani: Yes.
kirillzh has joined #ruby
kirillzh has quit [Client Quit]
<Darmani>
It took me way too long to figure that out lol
<Ox0dea>
this.guy
underplank has quit [Quit: underplank]
<Radar>
Ox0dea: You were noob once too.
<Darmani>
Radar: HE WAS??
<Ox0dea>
We're all evernoobs in one way or another.
kirillzh has joined #ruby
<Radar>
Oh yeah he was. They had to invent a new measurement of time because he wasn't noob for very long.
<Ox0dea>
Planck time long time.
<Darmani>
riiiight
<volty>
experience with sequel ? (in the chan there are mainly zombies)
<Ox0dea>
volty: I realize you're going for unique by attribute rather than record in the code, but maybe unique by record is what you actually want?
<Ox0dea>
Ah, never mind, then.
<volty>
Ox0dea: already unique by attribute
<Radar>
Darmani: You will want to look at using .each_with_object instead of .each on line 3.
<volty>
don't want exception, don't want to check. My question was if already there was something like that - for not reinventing the wheel. I'm quite new to sequel (few days)
<Darmani>
Radar - yeah I know... I could just use that. I really thought I could get it to work like this though...
<Radar>
Darmani: No, it won't do what you want it to do with the .each.
blackgoat has quit [Ping timeout: 260 seconds]
<Darmani>
Oh shit that's right. Ox0dea told me not to use that.
<volty>
I mean I don't want to check all the time in the main code. (when appropriate, of course)
<Darmani>
Alright... Well I guess I got it to work. I suppose it's not practical though cause the hash is within an array.
guacamol_ has joined #ruby
<Darmani>
Whatever. I'm glad I got it to work. I just had to see if it was possible like this lol
<volty>
ah ah ah
<Ox0dea>
volty: I think you'll want to combine #exists and #invert.
<Ox0dea>
EXISTS doesn't have to do any record enumeration.
guacamole has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
ramfjord_ has quit [Ping timeout: 240 seconds]
<Ox0dea>
Still seems like you want to make the table UNIQUE on url, though.
<volty>
Ox0dea: I must have missed something. I was listing instance_methods, saw exists, tried it, and saw it wants no parameters. I'll check again
davedev24 has quit [Ping timeout: 250 seconds]
nbdy has quit [Ping timeout: 256 seconds]
wilbert has quit [Ping timeout: 260 seconds]
frog0909 has quit [Ping timeout: 276 seconds]
<volty>
Ox0dea: The table is already unique on URL. So, if you try to insert duplicate it throws exception - so you have to check if it's already there, and it's so annoying for certain tables.
mjuszczak has joined #ruby
arlek has joined #ruby
underplank has joined #ruby
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ebok has joined #ruby
mfb2 has joined #ruby
mfb2 has quit [Remote host closed the connection]
toretore has joined #ruby
mfb2 has joined #ruby
underplank has quit [Client Quit]
<Ox0dea>
volty: Just trying to avoid using exceptions as control flow, then?
mjuszczak has quit [Ping timeout: 265 seconds]
trabulmonkee has joined #ruby
<volty>
Yes, exceptions or checking. Just like insert into the array if not present, and return index. . I have to add a return of id (primary, auto) of that row.
moeabdol has joined #ruby
<Ox0dea>
volty: How about #insert_ignore?
<volty>
next thing that I miss is a hook for modify & insert (notify of). I saw that sqlite has it, but sequel has not implemented it. And the author of sequel told me (in the rel. chan) that he isn't going to implement it at that level (though notifiers exist at activerecord-like level)
<volty>
Ox0dea: to name it that way?
<Ox0dea>
volty: It's a method you should be able to call.
<Darmani>
So... This is a really stupid question. But when is it appropriate to use each & map?
zambini has quit [Quit: Leaving.]
<Ox0dea>
#each for iteration, #map for transformation.
<volty>
yes, I was thinking half an hour how to name it :)
<Ox0dea>
!next
<Ox0dea>
volty: No, I mean, instead of #insert, you can use #insert_ignore.
<Ox0dea>
For SQLite, MySQL, and Postgres, anyway.
itscalleddaytwah has joined #ruby
<volty>
Ox0dea: I don't see it in Sequel::Dataset.instance_methods. You say I should go with injecting a literal SQL INSERT_IGNORE?
<Ox0dea>
#select and #reduce and #map and all the other Enumerable methods *have* to visit every element, and that's why #each exists.
<Darmani>
:O they all use each??
<Ox0dea>
You could theoretically use any Enumerable method to implement any other, since #each just yields every element to a block, and a block is just a place to "do something".
mfb2 has quit [Ping timeout: 264 seconds]
<Ox0dea>
We should strive to have our "do something"s be The Right Thing.
usershell has joined #ruby
<Ox0dea>
All of these methods seem so similar because, well, they are; they receive every element and "do something".
<Darmani>
Right....
craigp has quit [Ping timeout: 240 seconds]
<Darmani>
But "each" would be like the base method or foundation that all the others follow?
<Darmani>
They just do "extra" things too?
<Ox0dea>
It couldn't be any other way.
guacamole has joined #ruby
<Darmani>
But so.. map could be considered each_with_array?
<Darmani>
I mean if that was a thing.
atomical_ has joined #ruby
guacamol_ has quit [Ping timeout: 260 seconds]
<Ox0dea>
each_with_transformation.
<Darmani>
so what would you call select?
<Ox0dea>
each_with_choice
<Darmani>
:O
* Darmani
mind blown
<Ox0dea>
My work here is done.
Ox0dea has left #ruby ["WeeChat 1.5-dev"]
<Darmani>
LOL
<Darmani>
What the hell??? How come none of the tutorials ever say that shit??
<Darmani>
That seems SO goddamn important and no one felt the need to tell me.....
<Darmani>
wttttffff
<baweaver>
you weren't ready for it yet
<Darmani>
baweaver - lies.
jaequery has joined #ruby
<eam>
well, each isn't quite a base method for all of these
pdoherty has joined #ruby
<eam>
some of them may not iterate through every element, for example
framling has quit [Remote host closed the connection]
<norc>
Ox0dea: Im guessing it essentially takes a gvar, calls the lambda with the gvar as arg, yields the result to the block, and writes the result back into the gvar - every time the gvar is referenced?
<norc>
The lack of sleep has deprived me of my deductive skills.
ccaffeini has joined #ruby
ur5us has joined #ruby
<norc>
Ox0dea: Remove the comments and then open a bug for discussion?
<norc>
;-)
nbdy has joined #ruby
<Ox0dea>
Ah, well, there's no getting around $-10 and under being syntax errors.
<Ox0dea>
It's essentially an accident of history that $-9 to $-1 are valid.
bronson has joined #ruby
nbdy has quit [Max SendQ exceeded]
<Ox0dea>
$-<foo> is valid because they exist to contain command-line arguments, and better to preempt the addition of a new one than have a whitelist.
jgpawletko has joined #ruby
<norc>
What the heck is rb_define_virtual_variable
<Ox0dea>
There's a README. :P
<norc>
Is that some magic for some $ vars?
<Ox0dea>
Indeed.
<norc>
One does not simply read documentation when dealing with Ruby C code.
<Ox0dea>
Ah, well, fair enough.
user_ has quit [Ping timeout: 250 seconds]
claw has quit [Ping timeout: 245 seconds]
<Ox0dea>
All globals are actually "hooked" variables, which take a default value, and a C function for the getter and setter.
<Ox0dea>
All of these can be zero values.
user has joined #ruby
musicnode has joined #ruby
<norc>
I simply assumed the match would be setting them, but I guess a simple scope test would then invalidate that?
<norc>
(For regex matches I mean)
<Ox0dea>
I'm still not sure how exactly $~ works.
musicnode has quit [Client Quit]
<Ox0dea>
I can't figure out how to scope Viva-defined variables. :/
<Ox0dea>
What with Ruby closures being closures, I'm not sure it's possible without hax.
PedramT has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cheerio]
solars has joined #ruby
<Ox0dea>
Mm, yeah, match_setter() is crazy.
noyb has joined #ruby
noyb has quit [Client Quit]
<norc>
Ox0dea: Oh!
<Ox0dea>
Very quickly gets into CFP land.
barajasfab has quit [Ping timeout: 250 seconds]
<norc>
So that is why you kept nagging me about the hash tables Ruby uses for lvars?
<Ox0dea>
Hm?
PedramT has joined #ruby
<norc>
I remember you asking me a few times about vtables
<Ox0dea>
The only issue I had with Viva was that I spent an inordinate amount of time trying to decide how best to dynamically define C functions at runtime.
<Ox0dea>
I was trying to use delayed macro expansion and GCC's __COUNTER__ magic.
<Ox0dea>
And then I thought about using dlopen().
<Ox0dea>
And then I realized that, duh, of course the relevant ID gets passed to the accessor function.
hannelita has joined #ruby
user has quit [Ping timeout: 265 seconds]
<Ox0dea>
I found out that there are such things as "junk" IDs and that the empty identifier is not considered one, which might be a bug.
noyb has joined #ruby
noyb has quit [Client Quit]
<shevy>
you two remind me of Statler and Waldorf
jcdesimp has joined #ruby
user has joined #ruby
karapetyan has joined #ruby
<Ox0dea>
Curmudgeonly, or--?
noyb has joined #ruby
noyb has quit [Client Quit]
<norc>
Ox0dea: Okay I get it now. You just give generic access to virtual variables, allowing custom getters/setters.
<norc>
"just"
<Ox0dea>
norc: Aye, pretty straightforward in the end.
<norc>
Ox0dea: Just for giggles, can you override the behaviour of the already implemented vvars?
<Ox0dea>
norc: Well, of course.
<Ox0dea>
Alas, you can't undo it and give them their magic back. :(
<Ox0dea>
Same as for `unset RANDOM` in modern shells.
<Ox0dea>
I could just use Process.pid for $$, but it's hardly that simple for most of the others.
hannelita has quit [Ping timeout: 240 seconds]
claw has joined #ruby
<norc>
Aside from short scripts, I do not see much use for all these weird variables anyhow.
<Ox0dea>
Even just hardcoding the map to default C functions wouldn't do, since most of them aren't exported.
ohaibbq has joined #ruby
<Ox0dea>
Ah, well, $~ and its descendants are quite nice sometimes.
Pathfinder_ has quit [Ping timeout: 264 seconds]
wolffles has quit [Quit: wolffles]
jcdesimp has quit [Ping timeout: 276 seconds]
zast has quit [Remote host closed the connection]
ympeg_ has joined #ruby
ympeg has joined #ruby
<norc>
Mostly I try to use ìf md = "b".match(/b/); puts md; end´ for any kind of regular expression matching.
<norc>
Maybe its just me, but I try to stay clear of this Perl syntax.
<ruby[bot]>
Ox0dea: # => /tmp/execpad-6e8b4ff761a8/source-6e8b4ff761a8:2: warning: `$999999999999999999999999999' is too big ...check link for more (https://eval.in/507923)
TomyLobo has joined #ruby
<Ox0dea>
Fixed-width identifiers. :P
<norc>
Ox0dea: Wow!
<norc>
I found a bug.
<norc>
>> $2147483647
<Ox0dea>
Oh?
<ruby[bot]>
norc: # => /tmp/execpad-19e7280eef47/source-19e7280eef47:2: warning: `$2147483647' is too big for a number vari ...check link for more (https://eval.in/507924)
<norc>
Mmm.
<norc>
On my shell that crashed pry.
<Ox0dea>
Huh.
<norc>
Try it out.
<Ox0dea>
Same.
konsolebox has joined #ruby
solars has quit [Ping timeout: 272 seconds]
<norc>
The error message is rather bizarre.
<Ox0dea>
It's doubling it.
<norc>
Not exactly.
jottr_ has quit [Ping timeout: 272 seconds]
ympeg_ has quit [Read error: Connection reset by peer]
ympeg has quit [Read error: Connection reset by peer]
<norc>
Ox0dea: I dont understand what its doing, but its not doubling it.
<Ox0dea>
It's definitely doubling it here.
<Ox0dea>
`eval': integer 4000000000 too big to convert to `int' (RangeError)
<Ox0dea>
That for $2000000000.
devbug_ has joined #ruby
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<norc>
Oh you are right. I suck at math it seems.
ur5us has quit [Remote host closed the connection]
<Ox0dea>
Never mind that these variables can't ever be set or got; this is definitely a bug. :P
<shevy>
you could file a bug report and have nobu comment :)))
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<Ox0dea>
Please nobody tell nobu we can hook into the virtual variable API.
<Ox0dea>
He'll give it the FrozenCore treatment in a heartbeat.
<shevy>
I will have forgotten the above in a few minutes anyway
devbug has quit [Ping timeout: 260 seconds]
PedramT has quit [Remote host closed the connection]
<norc>
Ox0dea: It would be pretty awesome if we could tap into the getters/setters from Rubyland entirely.
craysiii has joined #ruby
bigkevmcd has joined #ruby
<Ox0dea>
norc: I mean, it's all just data in memory in the end.
PedramT has joined #ruby
<Ox0dea>
Forgive me if I explore that concept no further just now.
<norc>
Oh that is fine. A while ago I was the one advocating fiddling to manage every single bit and byte.
Pupp3tm4st3r has joined #ruby
yardenbar has joined #ruby
<Ox0dea>
Oh, I certainly advocate for it; I just don't wanna be the one that has to determine if a function pointer is a vvar setter.
<norc>
Any chance there is an exported function that we can Fiddle::Handle#sym to define a new virtual variable?
<Ox0dea>
Er, rb_define_virtual_variable() is exported.
<norc>
Oh. Sweet.
<Ox0dea>
I might be retarded.
<Ox0dea>
It was still fun, though.
tyrbo has joined #ruby
<norc>
I do not think there is anything retarded about it.
hnagamin has joined #ruby
mdw has joined #ruby
<Ox0dea>
I was referring to writing it as a C extension instead of with Fiddle.
craysiii has quit [Quit: Leaving.]
<norc>
I understand, I still do not think it was retarded. After all this is just experimentation.
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<norc>
Retarded is what you might call the process scheduler this team I once met came up with.
<norc>
They called it "The revolver" - that should already give you an impression of what it did.
<Ox0dea>
Aye, I think I see what they were going for.
<Ox0dea>
Process carousel.
<norc>
Specification just said: "The CSCI shall support and make use of multiple CPU cores".
<norc>
Everybody was happy, because the spec was met.
karapetyan has quit [Remote host closed the connection]
craysiii has joined #ruby
karapetyan has joined #ruby
th_ has joined #ruby
th_ is now known as th__
sandstrom has joined #ruby
last_staff has joined #ruby
tyrbo has quit [Ping timeout: 256 seconds]
dwfait has joined #ruby
yardenbar has quit [Ping timeout: 245 seconds]
TomyLobo has quit [Ping timeout: 264 seconds]
dwfait has quit [Ping timeout: 265 seconds]
sigurding has quit [Quit: sigurding]
mdw_ has joined #ruby
dcunit3d has quit [Read error: Connection reset by peer]
scripore has quit [Quit: This computer has gone to sleep]
firstdayonthejob has joined #ruby
sperant has joined #ruby
andikr has joined #ruby
mdw has quit [Ping timeout: 256 seconds]
agit0 has quit [Quit: zzzZZZ….]
sperant has quit [Client Quit]
craigp_ has joined #ruby
craigp has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
dcunit3d has joined #ruby
elaptics`away is now known as elaptics
flaguy48 has quit [Ping timeout: 265 seconds]
gagrio has joined #ruby
arup_r has quit [Remote host closed the connection]
<Bloomer>
hi all
Xeago has quit [Ping timeout: 240 seconds]
* baweaver
crickets
craigp_ has left #ruby [#ruby]
hannelita has joined #ruby
scripore has joined #ruby
crickets has joined #ruby
<crickets>
you rang?
<baweaver>
...
<baweaver>
huh
ascarter has joined #ruby
yardenbar has joined #ruby
<baweaver>
well go figure
joonty has joined #ruby
h99h9h88 has joined #ruby
dionysus69 has joined #ruby
arup_r has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
mdw_ has quit [Quit: Sleeping Zzzzz]
devbug has joined #ruby
mfb2 has joined #ruby
PedramT has quit [Remote host closed the connection]
joonty has quit [Ping timeout: 240 seconds]
<crickets>
Ox0dea: no you don't
<Ox0dea>
I so do, though.
rkazak has joined #ruby
<baweaver>
Ox0dea: lies
<crickets>
and slander
<Ox0dea>
Amusement.
<Ox0dea>
And consternation.
<baweaver>
naturally
<crickets>
I aim to please
flaguy48 has joined #ruby
<crickets>
were you
<baweaver>
expecting something
<crickets>
different?
<Ox0dea>
My initial reaction was that it was somebody else in here.
<baweaver>
I have
<crickets>
way too much
<baweaver>
free time on
<crickets>
my hands
crickets has left #ruby [#ruby]
<Ox0dea>
There should be a script to do that.
<baweaver>
My script is called CMD + Tab
devbug_ has quit [Ping timeout: 250 seconds]
PedramT has joined #ruby
mark2 has joined #ruby
ta has joined #ruby
mfb2 has quit [Ping timeout: 250 seconds]
<Ox0dea>
Mine are Mod4Key+j/k.
<Ox0dea>
I can go in both directions just as easily; you've got to do some kinda crazy chording to go backwards.
baweaver has quit [Remote host closed the connection]
flaguy48 has quit [Ping timeout: 250 seconds]
dseitz has joined #ruby
darkf_ has joined #ruby
wonk has quit [Ping timeout: 250 seconds]
sigurding has joined #ruby
rsc___ has quit [Quit: rsc___]
darkf has quit [Ping timeout: 265 seconds]
agit0 has joined #ruby
jbrhbr has joined #ruby
DoubleMalt has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
elaptics is now known as elaptics`away
queden has joined #ruby
darkf_ is now known as darkf
karapetyan has quit [Remote host closed the connection]
<queden>
hi. I have a quick question as I am a newbie with rails webrick: into what folder can I upload a file that is than publicly available through an url? I understand that the url logic is not just the folder structure (as opposed to apache)
sftrabbit has joined #ruby
h99h9h88 has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Burgestrand has joined #ruby
karapetyan has joined #ruby
<Ox0dea>
queden: public/
blur3d has quit [Quit: blur3d]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<queden>
Ox0dea: thanks
<Ox0dea>
queden: Sure thing.
mdw has joined #ruby
antgel has joined #ruby
arup_r has quit []
flaguy48 has joined #ruby
solars has joined #ruby
ohaibbq has quit [Quit: Leaving...]
benoror has quit [Quit: Connection closed for inactivity]
kirillzh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
x77686d has quit [Quit: x77686d]
tvw has joined #ruby
platzhirsch has joined #ruby
user has quit [Ping timeout: 265 seconds]
sepp2k has joined #ruby
tomphp has joined #ruby
Kryptonical has quit [Ping timeout: 240 seconds]
rkazak has quit [Quit: Sleep.....ing....]
PaulCapestany has quit [Read error: Connection reset by peer]
dwfait has joined #ruby
PaulCapestany has joined #ruby
Kryptonical has joined #ruby
hnagamin has quit [Quit: さようなら]
hnagamin has joined #ruby
firstdayonthejob has quit [Ping timeout: 240 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
rodfersou has joined #ruby
sandstrom has joined #ruby
sandstrom has quit [Client Quit]
Abrin has quit [Ping timeout: 240 seconds]
dwfait has quit [Ping timeout: 240 seconds]
juddey has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
hnagamin has quit [Ping timeout: 240 seconds]
romero has joined #ruby
devbug has quit [Read error: Connection reset by peer]
devbug has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
pawnbox has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
hnagamin has joined #ruby
pawnbox has joined #ruby
blaxter has joined #ruby
PedramT has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
chipotle has joined #ruby
lindistock has joined #ruby
PedramT has joined #ruby
hnagamin has quit [Max SendQ exceeded]
hnagamin has joined #ruby
aufi has joined #ruby
hannelita has joined #ruby
jcdesimp has joined #ruby
platzhirsch has left #ruby [#ruby]
karapetyan has quit [Ping timeout: 245 seconds]
elaptics`away is now known as elaptics
astrofog has joined #ruby
mdw has joined #ruby
hannelita has quit [Ping timeout: 264 seconds]
jcdesimp has quit [Ping timeout: 250 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
user_ has joined #ruby
sandstrom has joined #ruby
drptbl has joined #ruby
scepticulous has quit [Ping timeout: 272 seconds]
blaxter has quit [Ping timeout: 240 seconds]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
toretore has quit [Ping timeout: 256 seconds]
queden has quit [Quit: Page closed]
einarj has joined #ruby
chipotle has quit [Ping timeout: 264 seconds]
jottr_ has joined #ruby
relix has joined #ruby
SCHAAP137 has joined #ruby
baweaver has joined #ruby
bweston92 has quit [Remote host closed the connection]
mfb2 has joined #ruby
jottr_ has quit [Ping timeout: 240 seconds]
scripore has quit [Quit: This computer has gone to sleep]
jas02 has joined #ruby
skade has joined #ruby
rsc___ has joined #ruby
mfb2 has quit [Ping timeout: 276 seconds]
baweaver has quit [Ping timeout: 260 seconds]
scripore has joined #ruby
sigurding has quit [Quit: sigurding]
sigurding has joined #ruby
sigurding has quit [Client Quit]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sigurding has joined #ruby
jaequery has joined #ruby
astrofog has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
blaxter has joined #ruby
<SebastianThorn>
I'd like some input, Im generating methods from xsd-files. There is one file that is 7.7k lines, this creates a class that is 6k lines, would you keep it like this? or does it not matter?
dlitvak has joined #ruby
mondok has joined #ruby
platzhirsch has joined #ruby
<ddv>
SebastianThorn: why are you doing this?
<SebastianThorn>
to create ruby-classes from the xsd's
<ddv>
SebastianThorn: yeah but why so many methods?
chouhoulis has joined #ruby
<SebastianThorn>
not sure i understad, they all exist in the API, so i just thought i generate them all. I'm I thinking "wrong"?
k13nox has joined #ruby
dlitvak has quit [Ping timeout: 250 seconds]
<ddv>
SebastianThorn: your API requires 6000 line classes?
Snowy has joined #ruby
Hunter_ has joined #ruby
k13nox has quit [Client Quit]
k13nox has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<SebastianThorn>
they deliver all the datatypes in 1 file, this file is this long
<ddv>
SebastianThorn: we know too little about your environment to give any advice
scripore has joined #ruby
scripore has quit [Remote host closed the connection]
<SebastianThorn>
the API has about 2k functions/commands i think
<SebastianThorn>
well, ill dig more into it later
CloCkWeRX has quit [Remote host closed the connection]
<SebastianThorn>
ddv: thanks for the thoughts :=
<SebastianThorn>
:)
chouhoulis has quit [Ping timeout: 276 seconds]
Pumukel has joined #ruby
Snowy is now known as Snowjob
dwfait has joined #ruby
Wizek has joined #ruby
saneax_AFK is now known as saneax
saneax is now known as Guest23168
BSaboia has quit [Ping timeout: 265 seconds]
mfb2 has joined #ruby
blackmesa has joined #ruby
lipoqil has joined #ruby
dwfait has quit [Ping timeout: 256 seconds]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
binaryplease1 has joined #ruby
chipotle has joined #ruby
mfb2 has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
UtkarshRay has quit [Ping timeout: 240 seconds]
rsc___ has quit [Quit: rsc___]
sigurding has quit [Quit: sigurding]
devlitzi has quit [Quit: devlitzi]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sftrabbit has quit [Quit: sftrabbit]
scepticulous has joined #ruby
dwfait has joined #ruby
UtkarshRay has joined #ruby
mikecmpbll has joined #ruby
<mikecmpbll>
anyone familiar with the behaviour of net/ssh's channels, specifically the on_data callback?
<mikecmpbll>
i thought initially it would return each line of data as it came in, but noticed just now i got two lines (data with \n)
skade has quit [Quit: Computer has gone to sleep.]
sigurding has quit [Quit: sigurding]
astrobun_ has quit [Remote host closed the connection]
Guest18755 has quit [Max SendQ exceeded]
Burgestrand has quit [Ping timeout: 245 seconds]
Guest18755 has joined #ruby
dlitvak has joined #ruby
skade has joined #ruby
user___ has joined #ruby
Guest18755 has quit [Max SendQ exceeded]
Burgestrand has joined #ruby
kobain has joined #ruby
Guest18755 has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
Guest44358 has quit [Read error: Connection reset by peer]
Burgestrand has quit [Client Quit]
gagrio has joined #ruby
Guest18755 has quit [Max SendQ exceeded]
yonatankoren has quit [Ping timeout: 256 seconds]
zzz_ has joined #ruby
jottr has joined #ruby
Guest18755 has joined #ruby
drptbl has joined #ruby
jottr_ has quit [Ping timeout: 265 seconds]
slackbotgz has quit [Remote host closed the connection]
Guest18755 has quit [Max SendQ exceeded]
bweston92 has joined #ruby
Guest18755 has joined #ruby
astrobun_ has joined #ruby
mark2 has quit [Read error: Connection reset by peer]
mark2 has joined #ruby
evidex has joined #ruby
chipotle has quit [Quit: cheerio]
zzz_ has quit [Quit: Leaving...]
pawnbox has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 276 seconds]
Xeago has quit [Remote host closed the connection]
zenlot1 is now known as zenlot
pawnbox has joined #ruby
tyrbo has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
PedramT has quit [Remote host closed the connection]
skade has joined #ruby
PedramT has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
colegatron has quit [Ping timeout: 260 seconds]
nchambers is now known as nnttcc
astrobun_ has quit [Remote host closed the connection]
Guest18755 has quit [Quit: Leaving]
jottr_ has joined #ruby
dlitvak has joined #ruby
dlitvak has quit [Remote host closed the connection]
dlitvak has joined #ruby
nnttcc is now known as nchambers
CloCkWeRX has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
ebbflowgo has joined #ruby
jottr_ has quit [Client Quit]
shadeslayer has quit [Ping timeout: 240 seconds]
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti>
Hi
arup_r has joined #ruby
krz has quit [Ping timeout: 250 seconds]
tyrbo has quit [Ping timeout: 256 seconds]
shadeslayer has joined #ruby
CloCkWeRX has quit [Ping timeout: 264 seconds]
colegatron has joined #ruby
<GeorgesLeYeti>
I have an array of number and a number (For example A= [1,5,7] n=2) and i want to return the minum value of n-A[i] not negative. I thought about A.min_by{|i| n-i}
<Abrin>
hiya
karapetyan has joined #ruby
<Abrin>
I am not sure if everyone other than me is asleep or not. :)
blackmesa has quit [Ping timeout: 260 seconds]
<GeorgesLeYeti>
but of course it returns a negative 7
<GeorgesLeYeti>
Sorry make a little mistake in my request, I want to return the value of A where n-A[i] is minimum
<mondok>
select{ |el| n -el >0}.min
joonty has joined #ruby
PedramT has quit [Remote host closed the connection]
<apeiros>
Abrin: you are asleep. you're just dreaming.
diegoviola has joined #ruby
<Abrin>
Oh good. Thank you apeiros.
<apeiros>
yw
FAMAS has joined #ruby
<FAMAS>
greetings to all
puria has joined #ruby
<apeiros>
hi FAMAS
Jamo has quit [Ping timeout: 265 seconds]
<mondok>
консу возьмешь на седьмой день
<mondok>
ползи в низ
<Abrin>
Wait a second, I dream about code? Hmmm....I was warned about that. :)
Jamo has joined #ruby
<FAMAS>
this user sends out gratitudes towards the founder and the arbitrators of the ruby community
<apeiros>
mondok: this channel is english. please use another channel for other languages. thank you.
<FAMAS>
for the strong opposition and refusal towards the PC+SJW invasion of the ruby community
<apeiros>
?ot FAMAS
<ruby[bot]>
FAMAS: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<olspookishmagus>
atmosx: years and zamans!
<atmosx>
:-)
<atmosx>
zamans indeed!! :-)
jameser has joined #ruby
<olspookishmagus>
I think I will finally settle for the "pickaxe" book
CloCkWeRX has joined #ruby
karapetyan has quit [Remote host closed the connection]
vondruch has quit [Quit: Ex-Chat]
<olspookishmagus>
oh wait, there'a a ".* the hard way" book ^^
vondruch has joined #ruby
jameser` has joined #ruby
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
jam_ has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
<zotherstupidguy>
olspookishmagus you want a book coz you are new to ruby?
<olspookishmagus>
no glasgow smiles were carved in that video?
karapetyan has joined #ruby
<olspookishmagus>
zotherstupidguy: thanks, noted!
peteyg has quit [Read error: Connection reset by peer]
__main__ has quit [Read error: Connection reset by peer]
peteyg has joined #ruby
karapetyan has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby
jam_ has quit [Ping timeout: 265 seconds]
Xeago has quit [Remote host closed the connection]
<zotherstupidguy>
olspookishmagus De nada :))
jameser` has quit [Ping timeout: 240 seconds]
ZerGabriel has quit []
<Abrin>
I've been reading 'Computer Science Programming with Ruby' but it is probably way to basic for most people. I was working on 'Beginning Ruby' but got frusterated and eventually gave up on it.
shredding has joined #ruby
__main__ has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
sftrabbit has quit [Quit: sftrabbit]
karapetyan has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 256 seconds]
dlitvak_ has joined #ruby
<Abrin>
My laptop battery is almost dead...I should stop fighting with code and sleep. Sweet dreams #ruby
chipotle has joined #ruby
gbgdev has joined #ruby
gbgdev has quit [Remote host closed the connection]
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
ebbflowgo has quit [Quit: ebbflowgo]
drptbl has joined #ruby
scripore has joined #ruby
ferr has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
k13nox has quit [Remote host closed the connection]
iateadonut has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
shevy has quit [Ping timeout: 240 seconds]
k13nox has joined #ruby
dwfait has joined #ruby
DexterLB has quit [Read error: Connection reset by peer]
avenj has joined #ruby
avenj has quit [Changing host]
avenj has joined #ruby
Bloomer has joined #ruby
blur3d has quit [Quit: blur3d]
kerunaru_ has joined #ruby
jcdesimp has joined #ruby
kerunaru has quit [Read error: Connection reset by peer]
blaxter has quit [Ping timeout: 264 seconds]
rafadc has joined #ruby
Xeago has joined #ruby
rafadc has quit [Client Quit]
sandstrom has quit [Quit: My computer has gone to sleep.]
jcdesimp_ has joined #ruby
DexterLB has joined #ruby
ebbflowgo has joined #ruby
shanemcd has quit [Remote host closed the connection]
themsay2 has quit [Read error: Connection reset by peer]
themsay has joined #ruby
chipotle has quit [Quit: cheerio]
jcdesimp has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
blackmesa has quit [Read error: Connection reset by peer]
shanemcd has joined #ruby
blackmesa has joined #ruby
kerunaru_ has quit [Read error: Connection reset by peer]
shevy has joined #ruby
gagrio has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
krz has joined #ruby
psy_ has quit [Read error: Connection reset by peer]
ItSANgo has joined #ruby
zenlot has quit [Quit: WeeChat 1.1.1]
shanemcd has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 245 seconds]
joonty has quit [Ping timeout: 250 seconds]
zenlot has joined #ruby
dlitvak_ has quit [Ping timeout: 240 seconds]
dlitvak has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
russt has quit [Ping timeout: 272 seconds]
djellemah has quit [Ping timeout: 264 seconds]
Pip has joined #ruby
blaxter has joined #ruby
<Pip>
What happened to Ruby Conference?
joonty has joined #ruby
<Pip>
Is there something wrong?
svkurowski has quit [Remote host closed the connection]
svkurowski has joined #ruby
sonOfRa is now known as snfr
synthroid has joined #ruby
PedramT has quit [Remote host closed the connection]
PedramT has joined #ruby
skade has joined #ruby
DirtyFinn has quit [Remote host closed the connection]
oz has quit [Quit: EOF]
jaiks has joined #ruby
mdw has joined #ruby
oz has joined #ruby
sdothum has joined #ruby
sandstrom has joined #ruby
jaiks has quit [Remote host closed the connection]
jaiks has joined #ruby
<kbni>
Can I overload calling a class as a method?
workmad3 has joined #ruby
bweston92 has quit [Read error: Connection reset by peer]
burbus has joined #ruby
ta_ has joined #ruby
<lucasb>
for class Foo, you want to call it like Foo(...) or Foo[...] ?
PedramT has quit [Ping timeout: 256 seconds]
aufi has quit [Ping timeout: 240 seconds]
<kbni>
where f is an instance of Foo, I want to be able to do f(...)
<lucasb>
ah, I don't know if that's possible
<lucasb>
but you can call it like f.() or f.call()
<kbni>
sure, but that doesn't look as neat
<lucasb>
just define a 'call' method, and the f.() syntax will work
bweston92 has joined #ruby
<Mon_Ouie>
f() will always call the method f, it will never look at the local variable f
Or1on has joined #ruby
<Mon_Ouie>
You can do f[x] though
mondok has quit [Ping timeout: 276 seconds]
ta has quit [Ping timeout: 245 seconds]
<kbni>
[] could look okay
<kbni>
how does one overload []?
jaiks has quit [Remote host closed the connection]
jaiks has joined #ruby
<lucasb>
def [](args) ...
shredding has quit [Ping timeout: 245 seconds]
PedramT has joined #ruby
<kbni>
haha yeah I just realised
Ebok has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
tyrbo has joined #ruby
araujo has quit [Max SendQ exceeded]
mfb2 has joined #ruby
hxegon has joined #ruby
arup_r has quit []
gigetoo has quit [Ping timeout: 272 seconds]
gigetoo has joined #ruby
pdoherty has joined #ruby
mfb2 has quit [Ping timeout: 240 seconds]
jespada has joined #ruby
Lildirt has joined #ruby
PedramT has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
PedramT has joined #ruby
nfk|laptop has joined #ruby
solars has quit [Ping timeout: 256 seconds]
Azure has quit [Excess Flood]
Azure has joined #ruby
<mikecmpbll>
ugh, i'm sure this is possible but I always forget gsub intricacies
<mikecmpbll>
i'd like to exclude part of my regex expression from being replaced
<mikecmpbll>
e.g. "foo bar. foo".gsub(/ foo/, "baz") only replaces foo with baz if it's after a space
<mikecmpbll>
oops, nevermind answered my own question
* mikecmpbll
slips out unnoticed.
ldnunes_ has joined #ruby
dlitvak has quit [Ping timeout: 245 seconds]
flujan has joined #ruby
<flujan>
Hi There, I created a tcpserver using ruby. Now I am reaching the limit of 1024-1028 connections and the server start to refuse the connections.
<Ox0dea>
kbni: You *can* make a class look like a method call, though, if that's what you're actually trying to do.
<kbni>
Ox0dea, well, yeah.
<flujan>
I already increase the limit using linux ulimit. But it is still limiting it to 1024-1028 connections. Is there a way to increase the number of connections?
[ace]_ has quit [Ping timeout: 264 seconds]
dlitvak has joined #ruby
HisShadow has joined #ruby
govg has quit [Ping timeout: 240 seconds]
<Ox0dea>
lucasb: Remember yesterday learning that stdin can be written to?
<HisShadow>
hello. I'm using IO.popen to read spawned process' output like this IO.popen({"ss"=>"aa"}, "/bin/bash /home/wedge/1.sh", :err=>[:child, :out], :out=>["test","w"]) do |io| Process.wait(io.pid) end, but ruby throws error fd 1 specified twice, I can't google that, isn't mentioned anywhere
govg has joined #ruby
sftrabbit has joined #ruby
<Ox0dea>
Writing to stdin is how "modern" terminals give you mouse event data.
<Ox0dea>
And it makes plenty of sense; you wouldn't want them written to your output streams, but the data's gotta get to you somehow.
last_staff has quit [Quit: last_staff]
jottr has joined #ruby
bronson has joined #ruby
fl_ has joined #ruby
sftrabbit has quit [Client Quit]
<mikecmpbll>
can anyone help me with this regexp? I'm trying to get it to only replace jim if it's got a non-word character either side or at the start or end of string
<mikecmpbll>
>> "Jim jimbarjim it jim. jim jim".gsub(/(^|[^\w])Jim($|[^\w])/i, "\\1***\\2")
<mikecmpbll>
however, if you look at the end, it's not replacing that "jim"
<HisShadow>
what is the right way to do it with popen? I was stderr redirected to stdout and the whole thing written to a file
<lucasb>
Ox0dea: that is interesting. the other day I was running '$ somecmd &> /dev/null' and was amazed that it was still producing output. now I know it must have been writing to stdin or something. thanks for the snippet.
<mikecmpbll>
because it proceeds another replacement immediately (and the regexp is overlapping, i guess)
gagrio has quit [Ping timeout: 245 seconds]
<Ox0dea>
lucasb: It was producing input. :P
howdoicomputer has joined #ruby
krz has quit [Ping timeout: 256 seconds]
norc has quit [Ping timeout: 252 seconds]
shredding has joined #ruby
gnudon has joined #ruby
kerunaru has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
<Ox0dea>
mikecmpbll: The word you're looking for is "boundary".
<Ox0dea>
>> "Jim jimbarjim it jim. jim jim".gsub /\bjim\b/i, ?x
<Ox0dea>
I will be the last person that still uses it to represent a character literal.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mikecmpbll>
ugh, gotcha.
<mikecmpbll>
still had my mind in regexp mode.
<shevy>
in the changelog to ruby, there was some japanese dev who got rid of it in some .rb file, saying something along the lines of "don't use magic" or like that
gbgdev_ has quit [Remote host closed the connection]
<Ox0dea>
It's still in there all over the place, though. ^_^
<Ox0dea>
They'll neve get all of 'em!
zotherstupidguy has quit [Quit: WeeChat 1.3]
ramortegui has joined #ruby
sftrabbit has joined #ruby
<diegoviola>
how do I format a number in ruby, let's say I pass 1000 to a method and I want to return a string like "10,000"
<diegoviola>
or 100_000 and return "100,000"
fl_ has quit [Quit: Leaving]
VeryBewitching has joined #ruby
krz has joined #ruby
jam_ has quit [Ping timeout: 265 seconds]
<VeryBewitching>
Morning.
shanemcd has joined #ruby
hnagamin has joined #ruby
shanemcd has quit [Remote host closed the connection]
<shevy>
diegoviola can you decide on (a) input and (b) output
shanemcd has joined #ruby
<shevy>
your multiple requirements make my head dizzy!
* VeryBewitching
gives shevy some solid ground to stand on
<diegoviola>
I've just used a case statement and returned a string based on the input
<shevy>
VeryBewitching thanks :D
<diegoviola>
but I'm trying to make it dynamic
<shevy>
well
<shevy>
100_000 becomes 100000 if it is a number
UtkarshRay has joined #ruby
shanemcd has quit [Remote host closed the connection]
sgambino has joined #ruby
<shevy>
using ',' is probably custom
<shevy>
may be best to use a method that will reformat it to the target format you want, in this case, add the ',' (to your string)
dlitvak has quit [Remote host closed the connection]
devlitzi has joined #ruby
andersh has joined #ruby
segmond has quit [Ping timeout: 260 seconds]
c355e3b has joined #ruby
snfr is now known as sonOfRa
<kbni>
I agree in that context it does
<kbni>
but obj1.foo(asdasd)\nobj2.foo(asdasd)\obj3.foo(somearg)\obj4.foo
arup_r has quit [Remote host closed the connection]
nettoweb has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
<newdan>
kbni: Imo coming from Java and Python I *love* that zero-arg methods don't use parens in Ruby :D
arup_r has joined #ruby
<kbni>
I think it's great when you are chaining them
B1n4r10 has quit [Ping timeout: 272 seconds]
<kbni>
oh well, my first piece of ruby~
<shevy>
yay kbni!
<shevy>
let the revolution proceed
<kbni>
rubocop didn't even complain all that much in the end
nettoweb has joined #ruby
<shevy>
newdan I sorta thought python users love the () :D
HisShadow has left #ruby [#ruby]
<kbni>
shevy, I think in times where you may want to avoid them there are perfectly decent ways to get around them
<newdan>
shevy: As a Python user... not all of us lol. I don't love the () and I don't love explicit self (or the super awkward super)
<kbni>
I think explicitness is great
<kbni>
makes things easier to follow
<kbni>
I'd like to know who thought of @/@@/$ nonsense
<newdan>
kbni: I agree, but the method is explicitly in a class. I don't see how passing self as first arg all the time helps anything, really
<shevy>
yeah, explicit self annoyed me. it feels as if I need to hold python hands to tell it where self is
<aegis3121>
kbni: i believe that comes from roots in Perl
<aegis3121>
kbni at least $ does. @ and @@ are simply ways to immediately signify what kind of variable you're dealing with. It's apparent in the name, so you should immediately have a good idea of its scope.
<newdan>
shevy: The things about Python I like compared to Ruby are the modules/namespacing, and also I find Ruby's method scoping a litle surprising
<shevy>
oh I want something more powerful than plain require too
aryaching has joined #ruby
<kbni>
newdan, you don't pass self as an arg, only when it's called - you can have a class method without that construct work in some weird circumstances
<shevy>
I want to reshuffle namespaces at require-time! I want to attach modules to classes at require-time!
<kspencer>
What's best gem/program to make ruby scripts into self-contained programs, needing no libraries on the executing end, this would be my first time trying to package an app
<newdan>
kbni: Sorry, I meant declaring self as the first arg
gbgdev has joined #ruby
<shevy>
unfortunately I think require will stay as it is because it is very simple... but perhaps there be a new mechanism for more control
<kbni>
well, as someoone who mostly uses python
<newdan>
shevy: Yes. This probably sounds trivial but it would almost be fine if Ruby modules didn't require everything in the module to be wrapped in the module block. Something like e.g. the package statement in Java that says "Everything in this file belongs to this module" would be nice imo
<kbni>
well actually I completely agree with newdan
rippa has joined #ruby
tubulife- has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<aegis3121>
newdan: that does in fact sound trivial heh
<newdan>
aegis3121: Flat is better than nested :) I just find it ugly to have to indent everything in my .rb file in order to not pollute the global namespace
segmond has joined #ruby
<newdan>
kbni: I like that tbh. Better than __neq__ or __iadd__ imo
<kbni>
additionally, I want my four-spaced tabs back
<aegis3121>
o_O but that's so much wasted space lol
<newdan>
I also like two-space tabs
<newdan>
Well, two space indents
<havenwood>
kbni: Two space soft tabs. Two. Space. Soft. Tabs!
solars has joined #ruby
MrSamuel has quit [Ping timeout: 240 seconds]
devlitzi has quit [Quit: devlitzi]
<ljarvis>
^
<kbni>
why does it even matter
<kbni>
I should be able to do what I want
<havenwood>
kbni: No!
<ljarvis>
of course it matters
<kbni>
tabs are superior because it allows the editor to have it their way
devlitzi has joined #ruby
<havenwood>
kbni: Incorrect. You must comply.
<ljarvis>
*must*
pwnd_nsfw has quit [Read error: Connection reset by peer]
<kbni>
To what?
<ljarvis>
to the thing
<ljarvis>
the space thing
<ljarvis>
Space Jam.
<kbni>
some unwritten hipster rule?
<ljarvis>
Precisely.
pwnd_nsfw has joined #ruby
<newdan>
kbni: Comply to Rubocop
<kbni>
I feel like ruby does things just to be contrarian
<kbni>
just like that guy at the party that nobody likes
<ljarvis>
2 space indent is contrarian?
<ljarvis>
I mean I know I'm joking and having fun, but that's ridiculous
<kbni>
that's because those operators are treating them as ints
<Ox0dea>
Danke. <3
Hammy_Work has quit [Read error: Connection reset by peer]
<shevy>
two is true?
<Ox0dea>
Too true.
<kbni>
True is 1
<kbni>
int(True)*int(True)+int(True)
<ljarvis>
!kick Ox0dea "The next person"
Ox0dea was kicked from #ruby by ruby[bot] ["The next person"]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
kbni: you too?
<platzhirsch>
ouch
evidex has quit [Ping timeout: 256 seconds]
stannard has joined #ruby
<kbni>
ljarvis, I was simply replying to him. For your information also the advertised rules page states "Excessive off-topic talk while Ruby related topics are discussed". Perhaps this could be changed to "Any off-topic talk" so as not to cause any further confusion
evidex has joined #ruby
zerowaitstate has joined #ruby
<arup_r>
^^ +1
<ljarvis>
I gave you a warning. That should have helped avoid confusion
<apeiros>
kbni: excessive is on the ops, ljarvis warned
<aegis3121>
kspencer: I'm not sure, but I imagine any running machine would have to have at the last Ruby.
<aegis3121>
at the least*
babblebre has joined #ruby
Bodah has joined #ruby
<kspencer>
aegis3121: Well I've looked at releasy and might try that, that way even dummies can run it with no ruby experience
duckpuppy has joined #ruby
<havenwood>
kspencer: Traveling Ruby is another option.
<kbni>
kspencer, What sort of app are you packaging and who is the package to be targeted for?
duckpuppy has quit [Client Quit]
duckpuppy has joined #ruby
IronD has quit [Ping timeout: 264 seconds]
<kspencer>
right now my projects are a gui that's going to turn into a helper for users on my network, with rss and services help things, and right now I'm working on porting a config generator from unrealircd&python script over to an inspircd&ruby script
<newdan>
kspencer: Have you tried Ocra?
<kspencer>
newdan: never packaged a script in my life
<kspencer>
so no lol
<newdan>
kspencer: Ocra is for packaging Windows stuff
<newdan>
Might help
<kspencer>
well releasey allows all three and runs on linux ruby, plus has the most options i've seen so far, haven't looked at Traveling Ruby yet
<kbni>
Isn't that Orca?
TomyWork has quit [Ping timeout: 248 seconds]
<kspencer>
kbni: no, looking at the gems page right now, its o c r a
IronD has joined #ruby
<diegoviola>
I need to learn some regular expressions, is the ruby regex engine the same as the perl regex engine for example?
<diegoviola>
or are they different
nertzy2 has joined #ruby
<kspencer>
diegoviola: basically the same
<diegoviola>
ok
aupadhye has quit [Ping timeout: 265 seconds]
dionysus69 has quit [Ping timeout: 265 seconds]
<kbni>
ah, you are correct
ZerGabriel has quit []
polishdub has joined #ruby
whippythellama has joined #ruby
<havenwood>
Onigmo!
solars has quit [Remote host closed the connection]
karmatr0n has quit []
aadam21 has joined #ruby
dhollinger has joined #ruby
Sourx has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
diegoviola: not the same. but similar.
tyrbo has quit [Ping timeout: 256 seconds]
Sourx has left #ruby [#ruby]
<ljarvis>
Ruby uses a custom version of Oniguruma (as havenwood mentions, Onigmo) but for initial learning purposes you can mostly assume they're the same
<apeiros>
for differences between to two you need to go to the more sophisticated features. so for learning regular expressions the differences in the *engine* will almost certainly not matter.
al2o3-cr has quit [Ping timeout: 264 seconds]
al2o3-cr has joined #ruby
<diegoviola>
ok
aufi has joined #ruby
<diegoviola>
so I can grab a book on regular expressions and they will work just fine in ruby?
freerobby has joined #ruby
last_staff has joined #ruby
<kspencer>
Also, I was wondering with highline, if when doing 'a.ask("Question? ", Type) ' instead of just {} are you able to do a do block or do I have to do something extra to allow that?
<newdan>
diegoviola: What book? I like Ruby, but if the book's not written for Ruby, why not use the language it is written for?
<newdan>
diegoviola: You should be mostly fine either way but there's always the chance for some small difference in the regex engines to give you a minor headache while you're trying to learn
chouhoulis has joined #ruby
Jardayn has joined #ruby
rodfersou has quit [Quit: leaving]
<diegoviola>
not sure about the book, what is a good way to learn regex from a ruby perspective?
<kspencer>
practically, just google for ruby regex
<diegoviola>
ok
<diegoviola>
ty
<kspencer>
np
FLeiXiuS has joined #ruby
jespada has joined #ruby
kmckelvin has joined #ruby
TomyWork has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
underplank has joined #ruby
IronD has quit [Ping timeout: 276 seconds]
GeorgesLeYeti has quit [Quit: Quitte]
synthroid has quit [Remote host closed the connection]
Sucks has joined #ruby
Pip_ has joined #ruby
Pip has quit [Disconnected by services]
Pip_ is now known as Pip
kalopsian has quit [Quit: Lost terminal]
Pip has quit [Changing host]
Pip has joined #ruby
Pip has left #ruby [#ruby]
elaptics is now known as elaptics`away
agit0 has quit [Quit: zzzZZZ….]
graffix222 is now known as graffix
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
tvw has quit []
mjuszczak has joined #ruby
kmckelvi1 has joined #ruby
shinnya has joined #ruby
kmckelvin has quit [Read error: Connection reset by peer]
IronD has joined #ruby
russt has joined #ruby
alexherbo2 has joined #ruby
darkxploit has joined #ruby
PedramT has quit [Read error: Connection reset by peer]
B1n4r10 has joined #ruby
PedramT has joined #ruby
RedNifre has joined #ruby
asccigcc has joined #ruby
<RedNifre>
Hey there. What's the most elegant way to get the current time as UTC in the form "2016012614"? (year, month, day, hour)
<RedNifre>
Ah, wait, Time.now.strftime seems to use local time.
<ljarvis>
yeah, you can change it if you want
<ljarvis>
but the idea is that you have a Time object
ljames has joined #ruby
<ljarvis>
that you can call strftime on
<apeiros>
RedNifre: .utc
<apeiros>
before .strftime
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
C0L0R has joined #ruby
sgambino has joined #ruby
<RedNifre>
I see, makes sense. Works, thank you very much!
bronson has joined #ruby
underplank has quit [Quit: underplank]
PedramT has quit [Ping timeout: 260 seconds]
davedev2_ has joined #ruby
C0L0R has quit [Client Quit]
fsapo has joined #ruby
Bodah has quit [Quit: leaving]
aganov has quit [Remote host closed the connection]
PedramT_ has quit [Remote host closed the connection]
davedev24 has quit [Ping timeout: 250 seconds]
duckpuppy has quit [Ping timeout: 264 seconds]
PedramT has joined #ruby
Bodah has joined #ruby
kies^ has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
shanemcd has quit [Remote host closed the connection]
Bodah has left #ruby [#ruby]
arup_r has quit []
Bodah has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
shanemcd has joined #ruby
duckpuppy has joined #ruby
aupadhye has joined #ruby
jam_ has joined #ruby
solars has joined #ruby
sneakerhax has quit [Quit: Leaving]
fsapo_ has joined #ruby
PedramT has quit [Ping timeout: 240 seconds]
fsapo has quit [Ping timeout: 240 seconds]
dlitvak has joined #ruby
DexterLB has quit [Ping timeout: 250 seconds]
underplank has joined #ruby
jam_ has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
Azulinho has quit [Quit: Azulinho]
fsapo_ has quit [Ping timeout: 240 seconds]
the_drow has quit [Ping timeout: 252 seconds]
UtkarshRay has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
Azulinho has joined #ruby
FAMAS has joined #ruby
underplank has quit [Ping timeout: 276 seconds]
shanemcd has quit []
<hightower4>
Hey, why when I run ruby program as root it works, but when I run it as a regular user it says: "Ignoring curb-0.8.8 because its extensions are not built. Try: gem pristine curb --version 0.8.8"
x77686d has joined #ruby
<lucasb>
maybe it looks for the compiled code in root's home, not your user's home
pdoherty has joined #ruby
<hightower4>
I figured it out, I had leftovers of .rvm in shell's config files
<hightower4>
So it was overriding GEM_HOME and GEM_PATH with incorrect values
<hightower4>
thanks
lxsameer has quit [Quit: Leaving]
nettoweb has joined #ruby
workmad3 has joined #ruby
govg has quit [Ping timeout: 240 seconds]
<apeiros>
hightower4: glad to have been of help ;-D
<Burgestrand>
I check in once in a while, and it's been a very long time, it's nice that you're still here apeiros
<Burgestrand>
:)
<apeiros>
Burgestrand: even with new duties noawdays ;-) nice to see you too!
<apeiros>
*nowadays
govg has joined #ruby
<Burgestrand>
apeiros you've been operator quite a long time now though, or are you speaking of different duties?
<apeiros>
I now have founder status
<apeiros>
finally managed to get that whole problem with fflush resolved
<apeiros>
which also allowed us to finally merge with #ruby-lang :D
<Burgestrand>
apeiros nice :D
<Burgestrand>
apeiros yes I very much like the merge, feels nice to have
<apeiros>
last year we spent with getting some basics in place. this year I hope to make some advancements with regards to a more community driven channel. the new tools we got allow for that :)
<apeiros>
like we've now a proper channel bot, proper log recording, proper companion website.
B1n4r10 has quit [Ping timeout: 264 seconds]
rkazak has joined #ruby
<apeiros>
things are coming along slowly, but nicely
<Burgestrand>
?cookie
<ruby[bot]>
here's your cookie:
<Burgestrand>
indeed!
govg has quit [Client Quit]
terminalrecluse has joined #ruby
<apeiros>
oh, and last but not least: we've finally got proper staff :D
toretore has joined #ruby
<Burgestrand>
apeiros huh, for real? what do they do?
FernandoBasso has quit [Ping timeout: 240 seconds]
moei has quit [Ping timeout: 240 seconds]
gregf has quit [Ping timeout: 240 seconds]
whiteline has quit [Ping timeout: 240 seconds]
Or1on has quit [Ping timeout: 240 seconds]
shevy has quit [Ping timeout: 240 seconds]
Jamo has quit [Ping timeout: 240 seconds]
einarj has quit [Ping timeout: 240 seconds]
andikr has quit [Ping timeout: 240 seconds]
aegis3121 has quit [Ping timeout: 240 seconds]
codefo has quit [Ping timeout: 240 seconds]
[ace] has quit [Ping timeout: 240 seconds]
FLeiXiuS has quit [Ping timeout: 240 seconds]
poguez__ is now known as poguez_
astrobun_ has quit [Ping timeout: 240 seconds]
sigurding has quit [Ping timeout: 240 seconds]
shevy has joined #ruby
hobodave has joined #ruby
whiteline has joined #ruby
Guest56913 has quit [Ping timeout: 240 seconds]
BTRE has quit [Quit: Leaving]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
treehug88 has joined #ruby
theslow1 has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
wanderer has joined #ruby
andikr has joined #ruby
zotherstupidguy has joined #ruby
solars has quit [Ping timeout: 260 seconds]
tubulife- has quit [Ping timeout: 250 seconds]
zambini has joined #ruby
wanderer is now known as Guest34283
thiagomarcal is now known as crunk_br
underplank has joined #ruby
rakm has joined #ruby
hobodave has quit [Max SendQ exceeded]
Pumukel has quit [Ping timeout: 260 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hobodave has joined #ruby
devlitzi has quit [Read error: Connection reset by peer]
FooMunki has quit [Quit: FooMunki]
PedramT has quit [Ping timeout: 260 seconds]
tomphp has quit [Ping timeout: 256 seconds]
PedramT has joined #ruby
Xeago has joined #ruby
devlitzi has joined #ruby
<centrx>
?damn
<ruby[bot]>
centrx: I don't know anything about damn
_ht has joined #ruby
hlegius has joined #ruby
rkazak has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
BTRE has joined #ruby
govg has quit [Ping timeout: 265 seconds]
Xeago has quit [Remote host closed the connection]
govg has joined #ruby
sftrabbit has joined #ruby
x77686d has quit [Quit: x77686d]
finisherr has quit [Quit: finisherr]
gregf1 is now known as gregf
baweaver has joined #ruby
sgambino has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
krobzaur has joined #ruby
einarj_ has quit [Remote host closed the connection]
AlexJakeGreen has quit [Remote host closed the connection]
hobodave_ has joined #ruby
whiteline_ has joined #ruby
blt_ has joined #ruby
<theslow1>
Hey everyone, I need some help debuging why rake db:migrate does not work on my system: I am not quite familiar with ruby: https://dpaste.de/rtJR#L
rkazak has quit [Ping timeout: 272 seconds]
krandi has joined #ruby
snockerton has joined #ruby
whiteline has quit [Ping timeout: 240 seconds]
krobzaur_ has quit [Ping timeout: 240 seconds]
hxegon has quit [Ping timeout: 240 seconds]
hobodave has quit [Ping timeout: 240 seconds]
robh71 has quit [Ping timeout: 240 seconds]
blt has quit [Ping timeout: 240 seconds]
andikr has quit [Ping timeout: 240 seconds]
krandi has quit [Remote host closed the connection]
<xapak>
I’m starting to work on a script, I’m kind a new to Ruby, so I’m curious if this approach looks good for creating a command line tool with subcommands: http://pastebin.com/uguxjSrT
<ruby[bot]>
xapak: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
workmad3 has quit [Ping timeout: 245 seconds]
<centrx>
At least we can all agree not to use pastebin.com!
<theslow1>
what about dpaste.de?
<xapak>
Sorry, didn’t read topic. :(
joonty has quit [Ping timeout: 250 seconds]
baweaver has quit [Ping timeout: 250 seconds]
<newdan>
theslow1: That's fine
<centrx>
theslow1, Sounds like unable to load the Datashift file with require? Maybe missing?
kernelpanik has joined #ruby
<xapak>
I was going to use pastie.org, but it was down, and also I didn’t know I could have anonymous gists...
<centrx>
xapak, Thor is a good option (library) for command-line with subcommands
<kernelpanik>
Hi to all, why warbler does not consider jruby-jars9.0.4.0 but only old versions?
<theslow1>
centrx, I am not sure why datashift is installed (see line 111) at version 0.15.0
wilbert has joined #ruby
<newdan>
xapak: No worries, ruby[bot] took care of it, you're not in trouble lol
hxegon_ has joined #ruby
tomphp has joined #ruby
dwfait has joined #ruby
<xapak>
centrx, but in general, does mine look good enough? I think I’ll be limited to Ruby libraries only (policies), so I’m kinda restrictred to using Ruby-provided only. In any case, this is more of a helper than anything else, so I don’t want to get complicated with frameworks or anything either.
<centrx>
theslow1, does Gemfile.lock show it as depended on by another gem?
maletor has joined #ruby
tubuliferous_ has joined #ruby
aegis312_ has quit [Ping timeout: 240 seconds]
<centrx>
xapak, Looks solid, not clear what's going on with 'subcommands' though
e4xit has quit [Read error: Connection reset by peer]
<centrx>
xapak, Is the value of that what's returned by the OptionParser.new block?
e4xit has joined #ruby
<xapak>
Yes. That way I could have multiple subcommands. Let me update it.
karmatr0n has joined #ruby
maletor has quit [Read error: Connection reset by peer]
<centrx>
xapak, Personally I would use a class with different methods, more organized than putting a bunch of OptionParser blocks in a hash
nav_ has quit [Read error: Connection reset by peer]
<tarantul>
has_key() returns false
portiad has joined #ruby
<ljarvis>
this is why it's nil
nav_ has joined #ruby
<newdan>
ljarvis: But his variable is previously defined
kernelpanik has quit [Ping timeout: 252 seconds]
davedev24 has joined #ruby
<ljarvis>
where?
<ljarvis>
oh
<newdan>
ljarvis: The second line of his code is "p type_name"
<ljarvis>
ffs this code output is ridiculous
portiad has quit [Remote host closed the connection]
<newdan>
ljarvis: Haha, I agree
jespada has quit [Quit: WeeChat 1.5-dev]
<tarantul>
ljarvis: ok
pandaant has joined #ruby
<newdan>
tarantul: What is record.class
davedev2_ has quit [Ping timeout: 260 seconds]
<tarantul>
ruby strange
devlitzi has quit [Quit: devlitzi]
<newdan>
tarantul: I don't think Ruby is the thing that's strange here
TomPeed has joined #ruby
<ljarvis>
here's another approach, I don't believe this is the exact code you're showing us. You need to show us *everything* related. Otherwise we build code which looks like this: https://eval.in/508296
<ljarvis>
which works as it should
scottschecter has joined #ruby
scottschecter has quit [Max SendQ exceeded]
B1n4r10 has joined #ruby
<tarantul>
ljarvis: newdan big tnx!
<ljarvis>
:/
DexterLB has joined #ruby
nertzy2 has quit [Quit: This computer has gone to sleep]
<newdan>
tarantul: wat
fmcgeough has joined #ruby
<newdan>
tarantul: Uh... you're welcome I guess
IronD has joined #ruby
duckpuppy has joined #ruby
<tarantul>
hmhm...
<tarantul>
I wrote 'type_name = record.fetch("_type", type_name)', but have nil anyway
<ljarvis>
so, type_name *must* be nil
<ljarvis>
and your code is not exactly how you show it
<newdan>
tarantul: So something else is happening that you're not telling us or perhaps you're unaware of
bronson has quit [Ping timeout: 265 seconds]
jam_ has joined #ruby
Macaveli has joined #ruby
<tarantul>
newdan: I test my code in irb, all works fine. But if I run it on server, type_name sets to nil :(
<kspencer>
ljarvis: fixing the question, but the problem being if I try to var.answer_or_default outside, it says the var has no method named it, when used inside there is an argument error which the documentation says 'answer_string' which inside the block I don't know how to exactly get my 'answer_string' considering the var has the answer inside it, and as far as i know can't be used inside its own block
DexterLB has quit [Ping timeout: 250 seconds]
<newdan>
tarantul: So the code on the server is different from the code you're pasting us. Either record is different or the code as written is different (and perhaps contains a typo) or something else, I dunno. But it's not really possibly to help you since the code you're giving us doesn't lead to the output you're giving us
guacamole has joined #ruby
DexterLB has joined #ruby
tubuliferous_ has quit [Ping timeout: 272 seconds]
pawnbox has joined #ruby
aeontech has joined #ruby
DoubleMalt has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
mdw has quit [Ping timeout: 250 seconds]
jam_ has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
pareidolia has joined #ruby
firstdayonthejob has joined #ruby
PedramT has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
freerobby has quit [Quit: Leaving.]
araujo has quit [Quit: Leaving]
hahuang65 has quit [Ping timeout: 256 seconds]
freerobby has joined #ruby
<pareidolia>
Does anyone know why the default object string representation (e.g. #<Object:0x00000000937b00>) looks the way it does with the #< and > ?
<apeiros>
probably to provide a good delimiter
<newdan>
pareidolia: Probably so it doesn't cause an error when pasted into irb
<theslow1>
centrx, problem solved.. I downgraded datashift to 0.12.0 and everything worked fine
<newdan>
Other representations work as literals you can paste back into irb/Ruby source
<theslow1>
thanks for the support!
hahuang65 has joined #ruby
kriskropd has quit [Ping timeout: 264 seconds]
kirillzh has joined #ruby
<pareidolia>
newdan: I am curious because it looks exactly like the style of the method print-object of standard-object in Common Lisp
tildes has joined #ruby
benlovell has quit [Ping timeout: 250 seconds]
<newdan>
pareidolia: Oh, well maybe that's why then
<newdan>
<- not an expert
<apeiros>
easily possible that it was an influence
kalopsian has joined #ruby
<centrx>
theslow1, excellent!
<pareidolia>
It would be cool to read about this in "official history" but it's kinda hard to google :'(
dlitvak has quit [Ping timeout: 250 seconds]
<apeiros>
not just that, but tons of rationales for decisions are probably nowhere documented
camillo has joined #ruby
solars has quit [Remote host closed the connection]
sigurding has joined #ruby
jbrhbr has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r has quit []
framling has joined #ruby
araujo has quit [Max SendQ exceeded]
mfb2 has joined #ruby
chouhoulis has quit [Remote host closed the connection]
x77686d has joined #ruby
crime has joined #ruby
chouhoulis has joined #ruby
sgambino has joined #ruby
djellemah_ has quit [Ping timeout: 272 seconds]
sigurding has quit [Quit: sigurding]
jxs_ has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
zast has quit [Remote host closed the connection]
musicnode has joined #ruby
djellemah_ has joined #ruby
djellemah has quit [Ping timeout: 272 seconds]
sneakerhax has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
devbug has joined #ruby
<hxegon_>
found another use for &. : instead of log = options.delete(:logfile) ? log.write(stuff) : STDOUT.write(stuff), do options.delete(:logfile)&.write(stuff) || STDOUT.write(stuff)
aeontech has quit [Quit: aeontech]
FernandoBasso1 has quit [Quit: Leaving]
mdw has joined #ruby
DoubleMalt has joined #ruby
tyrbo has joined #ruby
skade has joined #ruby
jxs_ has quit [Remote host closed the connection]
nertzy2 has joined #ruby
frem has joined #ruby
aeontech has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
groteworld has left #ruby ["Bye!"]
gruz0 has joined #ruby
ur5us has joined #ruby
pawnbox has joined #ruby
<drbrain>
hxegon_: but write is duplicated, so why not log = options.delete(:logfile) || $stdout; log.write(stuff)
<drbrain>
hxegon_: also, use $stdout, not STDOUT because it's easier to write tests for the former
hlegius has joined #ruby
<hxegon_>
drbrain I like that better.
<drbrain>
(you can set $stdout to anything IO-like, but you can only reopen STDOUT to another file)
k13nox has quit [Remote host closed the connection]
<hxegon_>
drbrain didn't know that, thanks
ascarter has joined #ruby
baweaver has joined #ruby
arlek has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
hahuang65 has quit [Ping timeout: 264 seconds]
ascarter has quit [Remote host closed the connection]
ascarter has joined #ruby
tubuliferous_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
lektrik has joined #ruby
user has joined #ruby
ascarter has quit [Max SendQ exceeded]
baweaver has quit [Remote host closed the connection]
aadam21 has quit []
musicnode has quit [Quit: musicnode]
ascarter has joined #ruby
ramfjord_ has joined #ruby
musicnode has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
hobodave has joined #ruby
synthroid has quit [Remote host closed the connection]
freerobby has joined #ruby
gruz0 has quit [Quit: Leaving]
TomyWork has quit [Ping timeout: 248 seconds]
tubuliferous_ has quit [Ping timeout: 250 seconds]
IronD has joined #ruby
hxegon_ has quit [Quit: PEACE OUT]
hxegon has joined #ruby
user___ has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
Waheedi has joined #ruby
<Waheedi>
join #httpd
<Waheedi>
sorry!
usershell has quit [Remote host closed the connection]
<Waheedi>
i have done that for ruby channel before in httpd :)
hahuang65 has joined #ruby
baweaver has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
user has quit [Ping timeout: 250 seconds]
jxs_ has joined #ruby
freerobby has quit [Quit: Leaving.]
aegis3121 has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
[Butch] has joined #ruby
hlegius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkxploit has quit [Ping timeout: 245 seconds]
karmatr0n has joined #ruby
bronson has joined #ruby
kmckelvi1 has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lemur has joined #ruby
sgambino has joined #ruby
Ilyes512 has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
kalopsian has joined #ruby
rehat has joined #ruby
dlitvak has joined #ruby
juddey has joined #ruby
<shevy>
you don't like us so you wanna go somewhere else :(
<crime>
#ruby is pretty ok
<crime>
#lua has better banter sometimes
fantazo has joined #ruby
lemur has quit [Ping timeout: 260 seconds]
sdwrage has joined #ruby
Bloomer has quit [Remote host closed the connection]
okdas has quit [Remote host closed the connection]
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
<crime>
kspencer: Question.default is an accessor, you can change it to anything you want
TomyLobo has joined #ruby
graphettion has joined #ruby
ramfjord_ has quit [Ping timeout: 276 seconds]
<kspencer>
crime: I want to show it in the in question, but progmaticly as shown in the docs, I already have set the default via q.default
[Butch] has joined #ruby
moeabdol has joined #ruby
<crime>
im not sure what you mean, any instance of question should have the default accessor, append_default just sets that accessor. a method of your own could have identical functionality
<crime>
you can change default however you want in your own methods
guacamole has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
yardenbar has quit [Ping timeout: 245 seconds]
guacamole has joined #ruby
shadoi has joined #ruby
yqt has joined #ruby
pawnbox has joined #ruby
Brklyn has joined #ruby
cdg has quit [Remote host closed the connection]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gruz0 has joined #ruby
elaptics`away has quit [Ping timeout: 256 seconds]
crunk_br has quit [Ping timeout: 250 seconds]
<Brklyn>
hi guys, quick question from a non-rubyist.... I have a long line sh %(mysql --protocol=tcp -P3306 -e "some long SQL statement" -u root -pfoo) the entire statement spans for something like 105 characters and I'd like to split it to comply with rubocop.... any hints sd to how I should split that??
baweaver has quit [Remote host closed the connection]
duckpuppy has joined #ruby
zeroDivisible has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
Limix has joined #ruby
baweaver has joined #ruby
mostlybadfly has joined #ruby
ramfjord has joined #ruby
sandstrom has joined #ruby
<crime>
cant you split it with \?
<crime>
im no expert or anything
marr has quit [Ping timeout: 260 seconds]
themsay has quit [Quit: AtomicIRC: The nuclear option.]
guacamole has quit [Read error: Connection reset by peer]
guacamole has joined #ruby
Guest15913 is now known as saneax_AFK
mfb2 has quit [Remote host closed the connection]
TomPeed has joined #ruby
sneakerhax has quit [Ping timeout: 240 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wonk has quit [Ping timeout: 264 seconds]
benlovell has joined #ruby
baweaver has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 276 seconds]
dlitvak has joined #ruby
elaptics`away has joined #ruby
tvw has quit [Remote host closed the connection]
crunk_br has joined #ruby
mfb2 has joined #ruby
baweaver has joined #ruby
nettoweb has quit [Ping timeout: 245 seconds]
guacamole has quit [Read error: Connection reset by peer]
guacamole has joined #ruby
d10n-work has joined #ruby
dionysus69 has quit [Remote host closed the connection]
goodcodeguy has joined #ruby
dionysus69 has joined #ruby
Xeago has quit [Remote host closed the connection]
guacamole has quit [Read error: Connection reset by peer]
blackgoat has joined #ruby
baweaver has quit [Remote host closed the connection]
guacamole has joined #ruby
Xeago has joined #ruby
B1n4r10 has joined #ruby
nettoweb has joined #ruby
user___ has quit [Ping timeout: 272 seconds]
blaxter has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
hxegon has quit [Ping timeout: 240 seconds]
itscalleddaytwah has joined #ruby
nettoweb has quit [Max SendQ exceeded]
dlitvak has quit [Ping timeout: 240 seconds]
sasdasd has joined #ruby
sasdasd has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
jam_ has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
karapetyan has joined #ruby
pandaant has quit [Remote host closed the connection]
casadei has joined #ruby
Xeago has quit [Remote host closed the connection]
pawnbox has joined #ruby
Pupp3tm4st3r has joined #ruby
_djbkd has joined #ruby
blackgoat has quit [Quit: WeeChat 1.3]
tubuliferous_ has joined #ruby
jam_ has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
dlitvak has joined #ruby
valetudo has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 240 seconds]
Cohedrin has joined #ruby
stannard_ has joined #ruby
Xeago has quit [Remote host closed the connection]
saneax_AFK is now known as saneax
saneax is now known as Guest16327
usershell has joined #ruby
zotherstupidguy has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 245 seconds]
stannard has quit [Ping timeout: 276 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sandstrom has quit [Quit: My computer has gone to sleep.]
ByronJoh1son has quit [Ping timeout: 260 seconds]
stannard_ has quit [Ping timeout: 240 seconds]
FernandoBasso has joined #ruby
ldnunes_ has quit [Quit: Leaving]
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
stannard has joined #ruby
usershell has quit [Ping timeout: 256 seconds]
DoubleMalt has quit [Remote host closed the connection]
stannard has quit [Remote host closed the connection]
kirillzh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
benlovell has quit [Read error: Connection reset by peer]
crime has quit [Ping timeout: 252 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
last_staff has quit [Ping timeout: 276 seconds]
last_staff has joined #ruby
Guest16327 is now known as saneax_AFK
ur5us has quit []
arlek has quit [Ping timeout: 256 seconds]
tvw has joined #ruby
tyrbo has quit [Ping timeout: 256 seconds]
finisherr has quit [Quit: finisherr]
hannelita has quit [Remote host closed the connection]
x77686d has quit [Quit: x77686d]
<gruz0>
Brklyn, use HEREDOC, Luke! :-)
dlitvak_ has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
smileart has joined #ruby
ur5us has joined #ruby
Ebok has joined #ruby
arup_r has joined #ruby
kies^ has quit [Ping timeout: 264 seconds]
mdw has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
guacamole has quit [Ping timeout: 264 seconds]
freerobby has joined #ruby
baweaver has joined #ruby
skcin7 has joined #ruby
wonk has joined #ruby
jackjackdripper has joined #ruby
xz has joined #ruby
jbrhbr1 has joined #ruby
<zambini>
This may be too specific/off topic a question for #ruby (has to do with Mongoid), but if I've got multiple chains of Mongoid scopes in a method, what's the cleanest way to write specs for that?
yfeldblum has joined #ruby
xz has left #ruby [#ruby]
mdw has quit [Client Quit]
skade has joined #ruby
micalexander has joined #ruby
jbrhbr has quit [Ping timeout: 272 seconds]
<zambini>
Specifically around the expects and the mock responses
dome22xl has joined #ruby
betafive has quit [Ping timeout: 252 seconds]
skade has quit [Client Quit]
marr has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
fantazo has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 245 seconds]
last_staff1 has joined #ruby
last_staff has quit [Ping timeout: 276 seconds]
last_staff1 is now known as last_staff
B1n4r10 has quit [Ping timeout: 245 seconds]
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
yalue has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.3]
al2o3-cr has joined #ruby
atomical_ has joined #ruby
djellemah__ has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
atomical has quit [Ping timeout: 264 seconds]
e4xit has quit [Quit: Right I'm out!]
e4xit has joined #ruby
x77686d has joined #ruby
mdw has joined #ruby
djellemah_ has quit [Ping timeout: 264 seconds]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[Butch] has quit [Quit: I'm out . . .]
jbrhbr1 has quit [Quit: Leaving.]
symm- has joined #ruby
IronD has quit [Ping timeout: 272 seconds]
dome22xl has quit [Remote host closed the connection]
guacamole has joined #ruby
zotherstupidguy has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
fmcgeough has quit [Quit: fmcgeough]
pdoherty has joined #ruby
djellemah_ has joined #ruby
h99h9h88 has joined #ruby
Ox0dea has joined #ruby
pawnbox has joined #ruby
sandstrom has joined #ruby
djellemah__ has quit [Ping timeout: 256 seconds]
gruz0 has quit [Quit: Leaving]
workmad3 has joined #ruby
chilerails has joined #ruby
B1n4r10 has joined #ruby
ferr has joined #ruby
pwnd_nsfw has quit [Read error: Connection reset by peer]
baweaver has joined #ruby
pwnd_nsfw has joined #ruby
arup_r has quit []
pawnbox has quit [Ping timeout: 264 seconds]
zotherstupidguy has quit [Quit: WeeChat 1.3]
last_staff has quit [Quit: last_staff]
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
bithon has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
_djbkd has quit [Remote host closed the connection]
_djbkd has joined #ruby
h99h9h88 has quit [Remote host closed the connection]
<zacts>
I know you mention gist in the /topic, but is sprunge.us ok?
<Ox0dea>
*ridiculous
aeontech has joined #ruby
aegis3121 has joined #ruby
<gizmore>
i am quite a newbie still... for me sprunge.us seems ok
dcunit3d has quit [Ping timeout: 276 seconds]
<zacts>
heh Ox0dea I didn't realize this
<gizmore>
but excpect less people click that
<gizmore>
Ox0dea: you should contact codeacademy... seems like a rip off
mfb2 has quit [Remote host closed the connection]
<Ox0dea>
gizmore: Never heard of it. :P
<nymous>
i'm writing output to stdout redirecting it to a file. will explicit flushing or something like that make things faster?
<Papierkorb>
codæcademy ?
guacamole has joined #ruby
<gizmore>
nymous: file operations always ring my race condition bell :S
<Ox0dea>
Is there no EA ligature, then?
<gizmore>
try ltr it
<gizmore>
rtl
dlitvak_ has quit [Ping timeout: 245 seconds]
<gizmore>
else mirrorflip april first css rule
<Papierkorb>
nymous: No, if at all, slower. Flushing the data may make the HDD/SSD 'spin' and thus waste time for writing a few bytes. let the OS do its job and let it do its caching thing
haxrbyte has joined #ruby
baweaver has joined #ruby
<nymous>
Papierkorb: i meant ruby's output flushing
<Ox0dea>
nymous: Why are you redirecting instead of writing to the file directly?
gizmore has quit [Quit: n8yn8]
zoo-zed has quit [Ping timeout: 245 seconds]
<Papierkorb>
nymous: are you redirecting the output from the shell, or do you bend $stdout yourself?
<nymous>
Papierkorb: shell
<nymous>
Ox0dea: it's a filter script. json on stdin, csv on stdout
jam_ has joined #ruby
<Papierkorb>
sounds fine to me
<Papierkorb>
nymous: oh and for that stuff, if you're not using ARGF, then have a look at it
lektrik has quit [Quit: Leaving]
<nymous>
i'm using ARGF
<Papierkorb>
yay
<Ox0dea>
nymous: I'm not sure I follow. You're writing a tool that's explicitly intended to be redirected?
<nymous>
ARGF.each do |line| raw = JSON.parse(line) ...
<nymous>
Ox0dea: yes
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
binaryplease has joined #ruby
<Papierkorb>
Ox0dea: what's wrong with it? That's how tools following unix principles work
<lucasb>
hmm, you are parsing one line at a time?
binaryplease has quit [Client Quit]
<Papierkorb>
especially for filter tools like sed or grep
<nymous>
yes, line by line
guacamole has joined #ruby
<Ox0dea>
Papierkorb: Aye, the bit about nymous being the one doing the redirection threw me.
momomomomo has quit [Quit: momomomomo]
casadei has quit [Remote host closed the connection]
<Ox0dea>
nymous: Are you sure that works? JSON.parse doesn't have a memory.
<nymous>
it depends on 2 external dictionaries to get proper values and overall structure of input json is complicated
ta has joined #ruby
hannelita has joined #ruby
sigurding has quit [Quit: sigurding]
ElFerna has joined #ruby
pawnbox has joined #ruby
rkazak has quit [Ping timeout: 260 seconds]
newbie22 has quit [Quit: Leaving]
darkf has quit [Quit: Leaving]
blackgoat has joined #ruby
mdw has quit [Ping timeout: 240 seconds]
djdj has joined #ruby
<nymous>
hm, i'm piping from zcat, maybe it does slowdown
djdj has left #ruby [#ruby]
ebbflowgo has joined #ruby
mfb2 has joined #ruby
djdj has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
B1n4r10 has quit [Ping timeout: 240 seconds]
Liquid-- has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
ebbflowgo has quit [Client Quit]
zodoz has joined #ruby
<Ox0dea>
Sounds like you need `jz`.
asmodlol has quit [Quit: Leaving]
<Ox0dea>
I totally use that as the extension on gzipped JSON files.
mrsolo_ has quit [Quit: This computer has gone to sleep]
<sts>
hello folks. I'm looking for a way to compare path patterns in a more simple way than the standard ruby regex. are there any libraries to do this? eg. I want to compare strings against strings such as [ '/.config.yaml', '/dir/**', '/dir*' ]
jgpawletko has joined #ruby
<Ox0dea>
sts: Compare them how? Character-wise?
Rickmasta has joined #ruby
<sts>
I have a list of files, and I want to compare each item against a list of simple regex patterns.
<sts>
Usabillity wise, it shouldn't be full regexes.
x77686d has quit [Quit: x77686d]
<Ox0dea>
sts: I think you might want Regexp.union.
<sts>
More like file globbings
<Ox0dea>
So you want to touch the filesystem during string comparison?
mlohstroh has joined #ruby
wilbert has quit [Ping timeout: 265 seconds]
mlohstroh has left #ruby [#ruby]
<Darmani>
Is there a way to capture specific numbers within a Regex? Like if I only wanted to get numbers 1 - 12?
wonk has quit [Ping timeout: 240 seconds]
<sts>
Ox0dea: well, basically the construct looks like Find.find(path) { |file| next if exceptions.any? { |pattern| file =~ Regexp.new(pattern) }}
<Ox0dea>
sts: And that's not fine?
<Ox0dea>
As mentioned, that could just be `next if Regexp.union(exceptions).match(file)`.
<sts>
But i want to match paths in case I have exceptions like: [ '/.config.yaml', '/tmp/sess_*', '/pub/uploads' ]..etc
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tyrbo has joined #ruby
<sts>
I would like to avoid '\/tmp\/sess_.*$'
<Ox0dea>
Because masochism?
gbgdev has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
<Papierkorb>
sts: replace the 2 with a 3 in the regex ..
polishdub has quit [Quit: Leaving]
<sts>
damn, true :)
m8 has quit [Quit: Sto andando via]
<sts>
actually he was right, but not >9 :)
ceej has joined #ruby
pawnbox has joined #ruby
zodoz has quit [Quit: Ex-Chat]
scripore has quit [Quit: This computer has gone to sleep]
<Papierkorb>
sts: you were looking for [1-4] btw
<Papierkorb>
(well or similar, you get the idea)
bronson has joined #ruby
zenlot has quit [Ping timeout: 256 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenlot has joined #ruby
betafive has joined #ruby
victortyau has joined #ruby
<sts>
anyways there are better ways to dael with numbers
pawnbox has quit [Ping timeout: 240 seconds]
scripore has joined #ruby
tyrbo has quit [Ping timeout: 256 seconds]
sdwrage has quit [Quit: Leaving]
<Ox0dea>
Start by treating them as numbers ASAP.
Limix has quit [Read error: Connection reset by peer]
Limix has joined #ruby
aeontech has quit [Quit: aeontech]
graphettion has joined #ruby
tomphp has joined #ruby
scripore has quit [Client Quit]
davedev24 has quit [Ping timeout: 240 seconds]
hobodave has quit [Ping timeout: 245 seconds]
tlaxkit has joined #ruby
baweaver has joined #ruby
artX000 has quit [Ping timeout: 245 seconds]
patrick99e99 has joined #ruby
uri_ has quit [Ping timeout: 250 seconds]
<patrick99e99>
Hi everyone.. just curious, is there any easy way around this: CGI.escapeHTML '&' --> '&amp;' ?
<patrick99e99>
i suppose I can do CGI.escapeHTML(CGI.unescapeHTML('&'))
<patrick99e99>
seems awful though
FernandoBasso has quit [Quit: Leaving]
<Zarthus>
that's the way I'd do it, but why is there unescaped HTML in your string to begin with?
<Zarthus>
s/un//
<Zarthus>
seems like you forgot to decode a string earlier on, or that it doesn't need encoding to begin with
PedramT has joined #ruby
devbug has joined #ruby
<patrick99e99>
Zarthus: thats a good question.. yeah, its for allowing user to put html in emails that may or may not be escaped...
<patrick99e99>
*users
<sts>
Ox0dea: do you know if there is any research regarding the performance of doing multiple regexes vs Regexp.union? Does union lower complexity?
<Zarthus>
I don't trust my users to insert HTML.
<drbrain>
sts_: I think that would depend upon the regexp
<Ox0dea>
sts: ^, but doing it with a union means it only has to walk the string at most once.
ElFerna has quit [Ping timeout: 250 seconds]
<Zarthus>
patrick99e99, generally you want to store a string as-is, and then decode it later on. If they're inserting &, I'd say it should be stored as & - and if they want to insert &, they should insert &.
<Ox0dea>
sts: Consider the simpler case of counting the number of As, Bs, and Cs in "abracadabra".
<patrick99e99>
Zarthus: yes.... I am on the mailer side, trying to make all the encoding uniform.. right now < works but < is turning into &lt; which is not working... so I am trying to normalize everything
<Zarthus>
you could decode it twice on processing time; none of the solutions are very elegant, and generally implies an issue with design earlier on.
<Zarthus>
Ox0dea, he has users submitting &, and then encodes it again to become &amp;
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
musicnode has joined #ruby
<Ox0dea>
But... why?
<Zarthus>
Their users are allowed to input HTML.
<Zarthus>
¯\_(ツ)_/¯
<Ox0dea>
Fun fun.
bronson has quit [Remote host closed the connection]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ropeney has joined #ruby
_djbkd has quit [Remote host closed the connection]
aeontech has joined #ruby
davedev24 has joined #ruby
<sandstrom>
I have a global constant named `PIPELINE`, and I don't quite understand where its coming from. Is this a native ruby thing, or just some weirdness in my project or a gem?
<nymous>
damn, without rescue my script now performs during 53 minutes
<nymous>
8 minutes better than with rescue
<nymous>
still a lot of time
guacamole has quit [Read error: Connection reset by peer]
ziyadb has joined #ruby
guacamole has joined #ruby
oivoodoo has quit [Remote host closed the connection]
hlegius has joined #ruby
<baweaver>
what is it doing?
avat has joined #ruby
pdoherty has quit [Ping timeout: 240 seconds]
ebbflowgo has joined #ruby
avat has quit [Client Quit]
_djbkd has joined #ruby
pawnbox has joined #ruby
<pengus>
exit
pengus has quit [Quit: Bitchx: Better than peer]
guacamole has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
guacamole has joined #ruby
ByronJohnson has joined #ruby
<nymous>
baweaver: are you asking me?
tyrbo has joined #ruby
moeabdol has quit [Quit: WeeChat 1.4]
<baweaver>
yep. Forgot to tag names.
firstdayonthejob has quit [Quit: WeeChat 1.4-dev]
moeabdol has joined #ruby
whippythellama has quit [Ping timeout: 250 seconds]
Jackneill has quit [Ping timeout: 240 seconds]
kies^ has quit [Ping timeout: 265 seconds]
pawnbox has quit [Ping timeout: 272 seconds]
pengus has joined #ruby
<nymous>
it does conversion from json to csv
workmad3 has quit [Ping timeout: 260 seconds]
<nymous>
line by line
Scriptonaut has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
ellistaa has joined #ruby
<Scriptonaut>
Hey y'all. Could you guys recommend 1 or 2 of the best online ruby tutorials? I'm already proficient in ruby, but I'm convincing a friend to learn ruby and want to give them the best resources
<centrx>
Ruby Monk, Ruby Koans are two
<ellistaa>
i’m watching this video on pointers in c and it says if i were to write &arr[i] id get the pointer for element i … is there a way to do this in ruby?
<zerowaitstate>
Scriptonaut: get a safaribooksonline.com account and read the well-rounded rubyist
<Scriptonaut>
zerowaitstate: you mean the well grounded rubyist?
<Scriptonaut>
I have a copy :)
<centrx>
ellistaa, Ruby does not expose memory address or pointers. The Array class handles all of that for you
<zerowaitstate>
that, sorry
<Scriptonaut>
that book is amazing
<ellistaa>
centrx: oh ok
<Scriptonaut>
I've read it twice over
guacamole has quit [Read error: Connection reset by peer]
mfb2 has quit [Remote host closed the connection]
<Scriptonaut>
thanks centrx
<centrx>
ellistaa, It's important computer science fundamentals to know about though
davedev24 has quit [Remote host closed the connection]
despai has joined #ruby
guacamole has joined #ruby
davedev24 has joined #ruby
hobodave has joined #ruby
ceej has quit [Remote host closed the connection]
<ellistaa>
centrx: thanks
ascarter has joined #ruby
<zerowaitstate>
ellistaa: very few of the automatically-GC'ed languages support direct memory access
<ellistaa>
GC?
ICantCook has joined #ruby
<zerowaitstate>
ellistaa: garbage-collected.
<ellistaa>
oh
<eam>
well, I mean, you can
ceej has joined #ruby
<zerowaitstate>
ellistaa: when you create objects in Ruby, the VM actually allocates RAM for that object. It has to keep track of references to that object and when there are no more references to it the object's RAM is reclaimed
decoponio has quit [Quit: Leaving...]
<eam>
you need something like FFI though, it's not part of the language
<zerowaitstate>
ellistaa: in Ruby, this happens automatically, where in C it is a manual process
kirillzh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ellistaa>
sounds terrible
mfb2 has joined #ruby
<ellistaa>
manually creating space that is
<baweaver>
nymous: do you have the source?
<eam>
ellistaa: most memory in C is automatically managed just like ruby -- because it's allocated on the stack
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
<eam>
the manual allocations here are "heap allocations" and are for objects that need to persist beyond function scope
<ellistaa>
eam: mmm intersting
musicnode has quit [Quit: musicnode]
mprelude has joined #ruby
colegatron has quit [Ping timeout: 264 seconds]
<eam>
the tradeoff is between manually managing heap allocations and paying a rather high runtime cost to run the GC
<Scriptonaut>
does ruby use mark and sweep for it's GC?
<Scriptonaut>
or ref counts or what
<Scriptonaut>
its*
<zerowaitstate>
eam: are Ruby objects actually stack-allocated, or is merely the reference to the object stack allocated?
<eam>
in real world C you never manage every bit of memory by hand, you use tools that help you keep track of allocations
<eam>
zerowaitstate: I'm saying C is stack allocated. Ruby is entirely heap allocations
<eam>
(afaik)
<zerowaitstate>
that's true; C dev's usually use frameworks to handle malloc/free
whippythellama has joined #ruby
<nymous>
baweaver: i can't publish it, sorry, it's commercial stuff. not my script, but data i'm parsing
whippythellama has quit [Client Quit]
<zerowaitstate>
eam: even in C, if you are doing any kind of elaborate structure (anything involving a linked list for example) you are into heap allocations.
<eam>
certainly
<baweaver>
Look into OJ json ruby
<betafive>
besides, if you keep everything on the stack, you're just asking for someone to smash it
<baweaver>
it's faster.
<eam>
betafive: haha, no
hobodave has quit [Quit: Computer has gone to sleep.]
<baweaver>
eam: I C what you did there.
<zerowaitstate>
betafive: stack-smashing isn't as easy as it used to be.
scripore has joined #ruby
<betafive>
zerowaitstate: sure, if you've got the nx bit and aslr and runtime bounds-checking and whatever.
<betafive>
it's still possible though.
<nymous>
zerowaitstate: hm, i'll try it, thanks
tyrbo has quit [Ping timeout: 256 seconds]
davedev2_ has joined #ruby
kirillzh has joined #ruby
gruz0 has joined #ruby
<betafive>
presumably ruby does have a foreign function interface though?
malconis has quit [Read error: Connection reset by peer]
<eam>
yes, FFI is really slick
<zerowaitstate>
betafive: yeah, it does. Quite a few gem's actually have C modules as part of their package
k13nox has quit [Remote host closed the connection]
davedev24 has quit [Ping timeout: 250 seconds]
goodcodeguy has joined #ruby
<zerowaitstate>
I actually have a question, though. Let's say your Ruby calls into a C function and the C function segfaults. What happens?
<eam>
probably your entire process ends
<betafive>
if your process segfaults, it gets killed
<eam>
some runtimes use segv for memory allocations
<eam>
the jvm is probably the most common example
goodcodeguy has quit [Client Quit]
<eam>
take a look at a jvm, you'll see constant segfaults
<eam>
(they're handled)
dopamean_ has quit [Ping timeout: 250 seconds]
<nymous>
baweaver: oh, sorry, clicked wrong nick :) thanks goes to you
<betafive>
quoting man signal: "According to POSIX, the behavior of a process is undefined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(2) or raise(3)."
<zerowaitstate>
so, FFI loads code into the same OS process as the caller?
<eam>
after it ignores it, yes -- but handling != ignoring
<eam>
zerowaitstate: FFI uses dlopen() to map shared objects into the process space and dlsym() and so on to call them
<zerowaitstate>
k
<eam>
the same stuff your dynamic linker does but at runtime
k13nox has joined #ruby
<zerowaitstate>
yeah, i'm familiar with dlopen
dcunit3d has quit [Ping timeout: 245 seconds]
mlohstroh has joined #ruby
musicnode has joined #ruby
DarkElement has joined #ruby
zerowaitstate has quit [Quit: leaving]
aryaching has quit [Ping timeout: 240 seconds]
<DarkElement>
Trying to get ruby and more specifically nokogiri to work in my red hat server, however it keeps failing to build the gem native extension. Anyone willing to help?
shadoi has quit [Quit: Leaving.]
colegatron has joined #ruby
pawnbox has joined #ruby
shadoi has joined #ruby
<centrx>
?paste
<ruby[bot]>
centrx: I don't know anything about paste
<centrx>
DarkElement, need error message, past at gist.github.com
<centrx>
DarkElement, probably missing ruby header/dev files or build tools
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]