ybian has quit [Remote host closed the connection]
haltEnigma has joined #ruby
oo_ has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
Aswebb_ has quit [Ping timeout: 264 seconds]
ybian has joined #ruby
oo_ has joined #ruby
jesterfraud has joined #ruby
laurentide has joined #ruby
mando has quit [Ping timeout: 248 seconds]
leonardoajim has quit [Quit: Be back later ...]
jeramyRR has joined #ruby
tubuliferous_ has quit [Ping timeout: 264 seconds]
mmasaki_ has quit [Quit: bye]
ivanskie has joined #ruby
sepp2k has quit [Quit: Leaving.]
cabreraM516 has joined #ruby
n1x has quit [Ping timeout: 252 seconds]
<haltEnigma>
Hey , I'm new to Ruby and I've built a simple action mailer , i successfully create the user and the server indicates the email has been sent , however the email goes through.Here is my code
towski_ has quit [Remote host closed the connection]
<Ox0dea>
Why does the code of conduct explicitly mention gender if it immediately goes on to include "gender identity and expression"? That's either redundant or exclusive.
psy_ has joined #ruby
jimmythehat has joined #ruby
<jimmythehat>
is there a way to programmatically do it ' array]
<jimmythehat>
sorry
<Ox0dea>
jimmythehat: Try again?
davedev24_ has joined #ruby
<jimmythehat>
array[3][6][6][2] = 42
RegulationD has quit [Ping timeout: 265 seconds]
mclee has joined #ruby
leonardoajim has joined #ruby
<Ox0dea>
jimmythehat: You want to be able to write that?
mary5030 has joined #ruby
<jimmythehat>
Ox0dea programmatically do that. So [3][6][6][2] can change to [2][4] or [1][2][3] or whatever. The most efficient way of updating a multidimensional array's entry. Just one of its entries.
davedev24_ has quit [Read error: Connection reset by peer]
chinmay_dd_ has joined #ruby
davedev24_ has joined #ruby
havenwood has joined #ruby
oo_ has quit [Remote host closed the connection]
hahuang65 has joined #ruby
oo_ has joined #ruby
<Ox0dea>
You can programmatically *access* an arbitrarily deep element using something like [3, 6, 6, 2].reduce(array, :[]).
kb3ien has joined #ruby
Xoro has joined #ruby
eggoez has quit [Ping timeout: 240 seconds]
chinmay_dd__ has joined #ruby
<Ox0dea>
But if you want to be able to cleanly update, you might consider using an autovivifying Hash:
<kb3ien>
My `rails generate` hangs forever, the open file handle that it's reading is AF_LOCAL "/tmp/spring/f7d7415c8e2a052c43f10695522d4a16" What's this about ?
<havenwood>
?rails kb3ien
<ruboto>
kb3ien, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<jimmythehat>
kb3lien actually forever? if you're in a jam just remove the sprinng gem and run bundle install, but if you want to keep spring im not sure :)
<notthekgb>
Ruby noob: how do I set a value to an array index? This is so I can cycle through the array sequentially each time the function is called, doing x++ and then arr.length = x and x = 0 to reset once all values have been called
<notthekgb>
Is there some way of setting x to the array index value defaulting to 0?
<Ox0dea>
You never expose the internal "non-functional" object.
<baweaver>
yeah, but still....
<baweaver>
I thought concat was pure for some reason
<Ox0dea>
You thought it was #push?
hotpancakes has joined #ruby
<Ox0dea>
Wait, what am I talking about?
<baweaver>
I suppose you can use +
<Ox0dea>
So much garbage to collect. :/
poguez_ has quit [Quit: Connection closed for inactivity]
gix has joined #ruby
hakunin has quit [Remote host closed the connection]
krasnus has quit [Remote host closed the connection]
alem0lars has quit [Remote host closed the connection]
mistermocha has quit [Read error: Connection reset by peer]
yosafbridge has joined #ruby
krasnus has joined #ruby
mistermocha has joined #ruby
alem0lars has joined #ruby
luriv_ has quit [Ping timeout: 256 seconds]
a346 has joined #ruby
mistermocha has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
olistik has joined #ruby
Xoro has joined #ruby
<Ox0dea>
notthekgb: Would you mind posting example code? It's quite likely there's a better way to do $thing than maintaining an index across calls.
danielpclark has joined #ruby
Aswebb_ has joined #ruby
<notthekgb>
I would but it uses an API so the language isn't proper Ruby
<notthekgb>
I literally started yesterday :P
<Ox0dea>
All right, then. You're probably looking for something like: @index ||= 0; code...; @index += 1
<Ox0dea>
But that's really not great.
riskish has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
olistik has quit [Ping timeout: 250 seconds]
tubuliferous_ has joined #ruby
Aswebb_ has quit [Ping timeout: 248 seconds]
iateadonut has joined #ruby
<Ox0dea>
baweaver: So, why the objection to an internal #concat, exactly?
xcesariox has joined #ruby
<Ox0dea>
Nobody can see the impurity.
sharpmachine has quit [Remote host closed the connection]
<baweaver>
I can O_O
sacarlson has joined #ruby
<baweaver>
Just that I thought it was a pure version for some off reason
<baweaver>
anyways, it doesn't really matter
<baweaver>
I just need to remember that one.
<baweaver>
either that or flip the order
<sacarlson>
I'm looking at this https://github.com/cowboyd/commonjs.rb is this the best method to run node.js inside of ruby? if so I need examples that include require in them
<baweaver>
what fresh hell inspired people to go and do that?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
surs4 has joined #ruby
surs3 has quit [Ping timeout: 252 seconds]
howdoicomputer has joined #ruby
<baweaver>
sacarlson: best advice is to ditch stellar, seems like a crappy system honestly.
<baweaver>
second piece of advice, learn ruby
<baweaver>
you have getter and setter methods, returns, and a whole lot of other stuff in there that reads like a java programmer
<sacarlson>
baweaver: so you didn't like my program? it work perfectly now on the present system of stellar
pengin has joined #ruby
<sacarlson>
it's the upgraded stellar system I'm preparing for
<eam>
I wish ruby RE supported (?{})
<sacarlson>
Stellar is the future of money tranfer
<baweaver>
it's the future of blowing hard
<sacarlson>
ha ha
<baweaver>
and a lot of hot air
<sacarlson>
it works that's all I need say
<sacarlson>
and it works today
<baweaver>
they don't actually say anything other than a lot of really fast buzzwords that makes apache documentation look readable
bigmac_ has joined #ruby
prettiestPony11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Musashi007 has joined #ruby
<Ox0dea>
> The exact rules for how often (??{}) and (?{}) are executed in a pattern are unspecified.
<Ox0dea>
eam: No thanks. :)
bigmac_ is now known as i8igmac
fgo has joined #ruby
<eam>
Ox0dea: what's wrong with that? just write good code without side effects :)
hotpancakes has joined #ruby
<eam>
it's totally reasonable not to specify the iterative internals of a RE engine
sigurding has joined #ruby
braincra- has joined #ruby
drewo has quit [Ping timeout: 264 seconds]
Ropeney has joined #ruby
i8igmac has quit [Ping timeout: 256 seconds]
fgo has quit [Ping timeout: 246 seconds]
<quazimodo>
is mri 2.2.0 limited to around 3000 threads at a time?
arescorpio has quit [Quit: Leaving.]
<quazimodo>
or is this a system setting/configuration
braincrash has quit [Ping timeout: 244 seconds]
<eam>
quazimodo: probably a system setting of yours
<eam>
you might be hitting a memory limit, depending on where you're running that
pengin has quit [Remote host closed the connection]
<quazimodo>
eam i'm guessing system setting
<quazimodo>
i'd imagine ruby should eb able to have hundreds of thousands of threads
<quazimodo>
they aren't that heavy :/
<sevenseacat>
unlikely
<eam>
they can be (and it's not necessarily ruby's fault
<eam>
you'll probably run into pid_max capping the max tid well before 100k
<eam>
a lot of systems limit that at 5 digits
<quazimodo>
that's my ubuntu setting
<quazimodo>
ok
<quazimodo>
so how do erlang et al get away with their hundreds of thousands of threads?
MasterPiece has quit [Quit: Leaving]
<eam>
and the underlying libc on some platforms can allocate a hell of a lot of address space for tls, like 64MB in some cases
<eam>
quazimodo: they're not really threads
bigmac_ has joined #ruby
<quazimodo>
oh?
<quazimodo>
i thought erlang threads were native threads
choke has joined #ruby
<eam>
anyone doing hundreds of thousands is using some kind of concurrency abstraction
Burgestrand has joined #ruby
<quazimodo>
well my machine's threads-max is ~63000
<eam>
which might at some point map onto a real thread pool, but it'd be an N:M relationship
* sevenseacat
spawned a billion processes in elixir for the fun of it once
<eam>
quazimodo: same deal for goroutines btw
<quazimodo>
eam hrm didn't know htat
surs has joined #ruby
<quazimodo>
cool to know
<quazimodo>
i guess that's why it's easy to make a lot of fibers
surs4 has quit [Ping timeout: 248 seconds]
<eam>
quazimodo: which value are you looking at for threads-max?
<eam>
if this is linux, check /proc/sys/kernel/pid_max
<quazimodo>
cat /proc/sys/kernel/threads-max
<quazimodo>
for my machines threads max
lkba_ has quit [Quit: Bye]
oo_ has joined #ruby
<eam>
is it 32k?
<quazimodo>
pid_max is process ids right?
lkba has joined #ruby
<eam>
yes, but it also limits thread ids
<quazimodo>
32768
<eam>
yeah so you're capped at 32k
<quazimodo>
32k threads overall?
<eam>
yes system limit
<eam>
threads + pids
<quazimodo>
so
<eam>
tid/pid
bruno- has joined #ruby
<quazimodo>
i have 30k full then?
<quazimodo>
surely not
<eam>
ps -eLf|wc -l
<quazimodo>
there's a process specific cap somewhere too
<quazimodo>
854
<eam>
quazimodo: if you're looking at max user processes, that one does not apply to threads
<eam>
(the rlimit)
<quazimodo>
eam: i'm not sure what' im looking at, first time i've explored this space
<eam>
oh 854 is how many total threads you had? from ps/wc?
oo_ has quit [Remote host closed the connection]
<eam>
ulimit -a will show you the rlimits, the per-user limits
oo_ has joined #ruby
a346 has quit [Quit: a346]
lucasr has quit [Quit: lucasr]
<eam>
(sorta per user, sorta per process)
<eam>
each thread needs a C stack (in addition to any ruby level resources) so the "stack size" you see -- well that's memory allocated per thread at the libc level. Ruby will use that, plus a bit more per thread
<quazimodo>
yep
<eam>
on my system that's 10MB/thread for the stack
AyeDubyew has joined #ruby
<quazimodo>
max user processes (-u) 31567
<eam>
so 100k threads would be around a Tb of RAM just for the C level call stack
<eam>
did I math that correctly?
<notthekgb>
Ox0dea: @index?
<Ox0dea>
eam: Looks properly mathed to me.
bruno- has quit [Ping timeout: 256 seconds]
<Ox0dea>
notthekgb: That's an instance variable. You'll have to use a $global instead if you're not using a class.
<quazimodo>
stack size (kbytes, -s) 8192
<quazimodo>
8000 odd kb per thread?
<quazimodo>
no way
<eam>
quazimodo: 8MB
tmtwd has quit [Remote host closed the connection]
<quazimodo>
8mb PER THREAD?
<quazimodo>
that's insane?
<eam>
quazimodo: well, think of it this way: how many functions can you call before you blow out the stack?
bungoman has quit [Remote host closed the connection]
<notthekgb>
hmmm. I'll try writing out the sort of thing I'm looking to achieve, albeit not in Ruby.
<eam>
so int foo(int a, int b, int c) is gonna take a minimum of 32 bytes
<eam>
to call
<eam>
(and a bit more because reasons
<sphex>
quazimodo: that's just virtual memory.. it's won't use any real memory until it is accessed.
<eam>
address space yeah
<eam>
when you put more stuff on the stack it'll fault and allocate real memory backing it
<eam>
quazimodo: you can use the pmap command to inspect the memory layout of a process
<sphex>
quazimodo: it reserves a lot of virtual memory just to guarantee that it can have enough that is consecutive (which is required for a thread stack)
<eam>
quazimodo: try this in your shell: pmap $$
<eam>
that'll show you the memory layout of (probably bash)
NeverDie_ has quit [Quit: I'm off to sleep. ZZZzzz…]
d3v has joined #ruby
<eam>
sphex: I don't think it maps the entire thing at once though
jamesaxl|2 has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<notthekgb>
This isn't ruby (or anything, really) but this is what I'm looking to achieve, Ox0dea: http://pastebin.com/f6fTTi7V
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<eam>
the stack grows downward so there's no need to reserve space
darkf_ has joined #ruby
<notthekgb>
oops, sorry about the pastebin link.
<quazimodo>
hrm
<quazimodo>
cool
<quazimodo>
so
<sphex>
eam: the mapping is known and reserved by the kernel, but yeah I think on most architecture, the CPU page table is updated lazily after page faults.
<quazimodo>
i had no idea that a thread would need 8mb reserved
<quazimodo>
i thought maybe kernel gives it more space as it needs it
Musashi007 has quit [Quit: Musashi007]
<eam>
quazimodo: it doesn't use 8M of real memory
<eam>
it does, at another level
sigurding has quit [Quit: sigurding]
<quazimodo>
right
<quazimodo>
so
neanderslob has quit [Ping timeout: 264 seconds]
<quazimodo>
an erlang box would use maybe a couple thousand threads in a pool to manage 100k+ fake threads eh?
frem has joined #ruby
neanderslob has joined #ruby
<quazimodo>
i guess that makes each fake thread much cheaper
<eam>
quazimodo: /proc/$$/smaps has the same data as pmap, but with more detail about what each region actually represents
ips|malc has joined #ruby
<eam>
quazimodo: I imagine probably only around N cpu worth of threads (but I don't know erlang all that well, so)
<eam>
you can't run more than one thread per cpu, so it doesn't make a whole lot of sense to have more threads than cpus -- unless you're doing it to be lazy around implementing your state machine
eggoez has quit [Ping timeout: 240 seconds]
darkf has quit [Ping timeout: 248 seconds]
chinmay_dd__ is now known as chinmay_dd
<eam>
or because you want the kernel to schedule for you
<eam>
eg a thread-per-connection
<eam>
quazimodo: this is essentially why the high performance servers are no longer thread-per-connection
zacstewart has quit [Remote host closed the connection]
<eam>
why no one uses apache prefork, etc
<eam>
cost per thread
zacstewart has joined #ruby
<eam>
(and in apache it's worse, because process)
theery has quit [Remote host closed the connection]
<quazimodo>
right
<quazimodo>
hence the reason actors can be nice
<quazimodo>
abstractions on lots of areas, messaging, deadlocking and also the concurrency model
<quazimodo>
hrm
<bnagy>
that was the highest density of wrong statements per foot I think I have ever seen on IRC
<quazimodo>
really?
ips|malc has quit [Ping timeout: 244 seconds]
<eam>
bnagy: which one
<quazimodo>
I'm new to concurrency, trying to organise my thoughts
<bnagy>
all the parts, that's what everything means
<bnagy>
12:35 < eam> when you put more stuff on the stack it'll fault and allocate real memory backing it
<sphex>
look! I'm sorry! I wanted to look smert!
<bnagy>
12:37 < eam> the stack grows downward so there's no need to reserve space
<eam>
you don't think the stack grows downward?
evanjs_ has quit [Remote host closed the connection]
<bnagy>
the stack grows downward
<eam>
ok so you were wrong about "everything?"
<eam>
what in particular do you disagree with?
<sacarlson>
I can make a stack go any way I want I just put my computer upside down
<sphex>
haha
<sacarlson>
sorry couldn't resist that one
zacstewart has quit [Ping timeout: 256 seconds]
<eam>
bnagy: do you disagree that the regions aren't backed by physical memory until a page fault occurs?
theery has joined #ruby
fgo has quit [Ping timeout: 244 seconds]
willywos has joined #ruby
<bnagy>
which has nothing to do with the stack
<bnagy>
that's just virtual memory
<ght>
Question: I have a series of parameters passed from an API where the params are seperated by the string "-_-_-", and the params are confirmed being passed correctly, but when I execute this line, any...
<eam>
bnagy: are you saying the stack is somehow outside of virtual memory?
<ght>
param with a space in, the data after the space is discarded: params_arr = ARGV[1].split("-_-_-")
<eam>
bnagy: are you saying that linux never page faults in the stack region?
<bnagy>
eam: please don't put words in my mouth, they're bad enough in yours
<toretore>
ght: ?gist your code
<ght>
I thought .split() only based on the data provided and didn't also include space?
<toretore>
?gist ght
<ruboto>
ght, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<ght>
toretore: This is the only relevant code.
<toretore>
ur codes
<ght>
That single line.
<toretore>
no
<eam>
bnagy: well I'm asking because you seemed very sure that everything I said was wrong, but now it seems you don't have any complaints at all
<sphex>
compilers will generate code to periodically perform "stack probes" (when a lot of space is going to be used in the current frame) so that the kernel can grow the stack mapping incrementally. but that's for "the" process stack.. I don't think this trick is used for the multiple thread stacks.
dellavg has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bnagy>
eam: the lines I actually pasted are both wrong
<bnagy>
as was a bunch of other wacky stuff being said
<ght>
Does .split() not only split strings based on the parameter provided, but also by spaces? I don't see that in the documentation.
<eam>
well you've agreed that not all of them are wrong, so what specifically do you think is in correct?
<ght>
Yes, that works toretore, of course. That's not the issue.
<eam>
if there wasn't, you couldn't be calling different functions in each thread
<ght>
The issue is there's a parameter with a space in it.
revath has joined #ruby
<ght>
And it's splitting on the space. For example, "My user" is a parameter.
<ght>
And it's splitting it but the array is only returning "My"
<eam>
and I believe that on linux, they must be the same size, which is why all of this is determined up front
<ght>
Despite me specifying -_-_- as the split() parameter.
<toretore>
let's see an example
Musashi007 has joined #ruby
<bnagy>
page faults just aren't relevant to what userland processes see as memory at all
timonv has joined #ruby
<bnagy>
if you access unmapped memory you will fault
<sphex>
eam: yeah. but "the" process stack and the thread stacks are not handled the same. the process stack has a fixed layout and is mapped lazily. not the thread stacks AFAIK. but they're still virtual memory.
<eam>
bnagy: that's correct, but if you think that contradicts anything I've said then you've misunderstood
chinmay_dd has quit [Quit: Leaving]
<bnagy>
you said there's no need to reserve space for the stack, that's wrong
<toretore>
ght: do you understand why i want to see the code now? what you're saying is provably wrong
<bnagy>
you said that "12:37 < eam> the stack grows downward so there's no need to reserve space" which is wrong
<eam>
bnagy: I'm using simplified terms because I'm talking to a newbie, I'm saying "memory" in a lot of cases where sometimes I mean address space and sometimes I mean real memory. Is that the point of confusion?
<bnagy>
because allocators know 0 about real memory
<Ox0dea>
bnagy: Why irssi?
<bnagy>
you're not simplifying, you just don't know what you're talking about
<eam>
I submit that you, perhaps, do not know what I'm talking about
<eam>
I think that's becoming clear the more I question you
<toretore>
how about, instead of just repeating "you're wrong", you enlighten us on how it actually works?
nveselinov has joined #ruby
<ght>
Well toretore, I realize you guys always say "dump all your code", but of course some of us work on proprietary applications where you can't dump entire methods or functions without heavy modification.
<ght>
So thanks just the same, I'll take care of it.
<eam>
toretore: +1
heyimwill has joined #ruby
<Ox0dea>
ght: -1
GriffinHeart has quit [Remote host closed the connection]
<toretore>
ght: you can still make an example to demonstrate your problem
chinmay_dd has joined #ruby
mike___1234 has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.2]
<eam>
bnagy: how about this, I'll continue to explain, but I'll ask you follow along with my examples ok?
<eam>
when I said "the stack grows downward so there's no need to reserve space" I am referring to address space
darkf_ is now known as darkf
<eam>
because the stack grows downward there is no concern about obtaining contiguous address space
fgo has joined #ruby
<bnagy>
why does the direction of the stack affect that?
<i8igmac>
has any one tried downloading pandora music?
<eam>
here is an example you can run on your own computer to verify. Start irb, enter $$; then run pmap $pid | grep stack
<eam>
then in irb run def f(); f(); end; f()
sacarlson has left #ruby [#ruby]
<eam>
then run pmap $pid | grep stack again
<bnagy>
eam: the stack is mapped, always
<eam>
you will see that the *address space* of the stack region has changed
<eam>
bnagy: please follow along with my example
<bnagy>
eam: no?
<eam>
ok, then everyone else can
<sphex>
that's just for "the" process stack which has a fixed layout (together with the old text, bss and brk regions, etc. the kernel maps it lazily and the compiler must issue "stack probes" to ensure it works. AFAIK, this is not the case for thread stacks.
lucasr has joined #ruby
eggoez has quit [Ping timeout: 248 seconds]
<eam>
sphex: I'm less certain of that, but are you sure? I believe they're implemented identically
<bnagy>
stack regions, thread or process, must be mapped. If you try to grow the stack past the limit you will stack overflow
<bnagy>
if you somehow modify $sp to be outside of a valid region you will segfault
<bnagy>
either way your stack space must "reserved" before you use it
hahuang65 has joined #ruby
<bnagy>
in virtual memory, because we're always talking about virtual memory because the whole diversion into page faults was silly
<eam>
it's not silly to diverge into page faults when the question is "why is it using that much real memory?"
CloCkWeRX has quit [Ping timeout: 250 seconds]
<eam>
(and the answer is: it isn't, addressing it will cause a fault)
<eam>
bnagy: you're right that it must be mapped though
snockerton has joined #ruby
charliesome has quit [Quit: zzz]
<sphex>
eam: no, not certain. but it still has to be completely reserved within the kernel of course. it could be lazily mapped too since compilers will issue stack probes all the same. I don't think it would be a worthwhile optimization nowadays though.
<bnagy>
you're again bringing things into virtual memory that shouldn't be there
<bnagy>
userland reserved vs committed memory is a different thing
<eam>
bnagy: when the question is "does it really use X memory per thread" I don't see why discussing page faults is irrelevant -- because that's how it doesn't actually use that memory
<bnagy>
that's why we have swap
<bnagy>
no, it's not
<eam>
we do not swap all address space
howdoicomputer has quit [Ping timeout: 265 seconds]
<eam>
dude, one one of my systems there's a 64MB/thread address space allocation -- and we have tens of thousands of threads
<bnagy>
yes, that's how virtual memory works
<eam>
there is neither enough swap nor physical ram for that
<sphex>
bnagy: there's a trick that is involved for stack memory only, and I think only for the main process stack. it is not mapped all at once.
<eam>
there's simply nothing backing those regions until they're used (and they never are)
<eam>
I agree it's not allocated via sbrk btw
<eam>
but really, try the demo
<eam>
I made it just for you, to head off any further misunderstanding =/
<eam>
also, I gotta go watch a tv show with my wife but I'll be back in a bit if anyone wants to chat about how this stuff works
Channel6 has quit [Quit: Leaving]
blue_deref has joined #ruby
eggoez has joined #ruby
jesterfraud has joined #ruby
<bnagy>
that will give me time to make popcorn
tkuchiki has joined #ruby
<bnagy>
"stack memory" o_0
mleung has joined #ruby
<bnagy>
ok I have to do actual work
hahuang65 has quit [Quit: WeeChat 1.2]
CloCkWeRX has joined #ruby
hahuang65 has joined #ruby
DanKnox has joined #ruby
dhjondoh has joined #ruby
GriffinHeart has joined #ruby
fantazo has joined #ruby
Limix has quit [Quit: Limix]
sigurding has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<noethics>
ya me 2 bnagy
<noethics>
what a coincidence
mrconfused has quit [Ping timeout: 244 seconds]
bluOxigen has joined #ruby
grey_beard has quit [Ping timeout: 246 seconds]
grey_beard has joined #ruby
Limix has joined #ruby
jesterfraud has joined #ruby
fabrice31 has joined #ruby
willywos has quit [Remote host closed the connection]
aryaching has joined #ruby
<eam>
bnagy: I hope you're not disagreeing that the stack is comprised of memory now :^)
hashrocket has quit [Quit: Connection closed for inactivity]
<baweaver>
also don't use . unless you _mean_ any character
<baweaver>
in this case you want \d which is digit
<lucasr>
so basically what the regex is saying in .{3} is only give us the things that come in increments of three, and .{1,3} is saying… just once every 3 characters?
<baweaver>
best way to learn ruby is to go through the documentation for Enumerable, String, Array, and Hash
howdoicomputer has joined #ruby
<lucasr>
is there a resource you like the most?
acke has joined #ruby
acke has quit [Remote host closed the connection]
hotpancakes has quit [Ping timeout: 264 seconds]
<baweaver>
standard ruby docs cover most of it
acke has joined #ruby
<baweaver>
past that, consider Eloquent Ruby (book)
aleshgo has quit [Remote host closed the connection]
GitGud has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
casadei_ has quit [Remote host closed the connection]
genpaku has quit [Ping timeout: 252 seconds]
genpaku has joined #ruby
roolo has joined #ruby
revath has joined #ruby
olistik has joined #ruby
konsolebox has joined #ruby
devbug has joined #ruby
andikr has joined #ruby
kies^ has quit [Ping timeout: 264 seconds]
ivanskie has joined #ruby
olistik has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 255 seconds]
grey_beard has quit [Ping timeout: 250 seconds]
grey_beard has joined #ruby
devbug_ has quit [Ping timeout: 244 seconds]
GitGud has quit [Quit: My name is your name]
<ght>
Question: Is there any way to force Ruby to take a parameter that has spaces in it and force it to be ARGV[1]?
<konsolebox>
Synchronization in threads is kind of different in concept from the actual meaning of being synchronized (simultaneous) isn't it? It confuses me every time. (Points out to Mutex#synchronize).
techietrash has joined #ruby
arup_r has joined #ruby
<eam>
ght: yes, but you're probably asking a shell question rather than a ruby question. As in your_script.rb "arg with spaces"
<eam>
the shell tokenizes the args before ruby starts up
hahuang65 has quit [Ping timeout: 246 seconds]
<konsolebox>
ght: The arguments passed to Ruby is a finite array of null-terminated strings. Try to realize that the concept of a shell's environment does not apply to the binaries it executes.
troulouliou_dev has quit [Quit: Leaving]
<eam>
konsolebox: I think the idea is that the lock contention is synchronous
<konsolebox>
eam: from https://en.wikipedia.org/wiki/Synchronization: Computer science (In computer science, especially parallel computing, synchronization refers to the coordination of simultaneous threads or processes to complete a task with correct runtime order and no unexpected race conditions.)
<konsolebox>
eam: this time it's about the "order". and probably most computer scientists think like that.
<eam>
konsolebox: yeah, so one thread is running the block and other threads interacting with the semaphore synchronize by blocking on it
dfockler has joined #ruby
<eam>
you could say they're "not doing anything" but you could also say the thing they're doing is contending on the semaphore
<eam>
(while the block is running, synchronously)
GriffinHeart has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
arturaz has joined #ruby
snockerton has quit [Quit: Leaving.]
lucasr has quit [Quit: lucasr]
<eam>
like, traffic at an intersection is synchronous because the north-south cars pause while the east-west cars drive and vice versa
eGGsha has joined #ruby
casadei_ has joined #ruby
dfockler has quit [Ping timeout: 265 seconds]
<toretore>
roundabouts are cooperatively scheduled
<konsolebox>
eam: i understand what you try to imply, however i think a mutex is not the best fit example for trying to execute things to become or appear simultaneous. time, or an atomic variable would be better. mutex actually allow things to go more asynchronous.
<eam>
konsolebox: I don't disagree with you :)
peter_paule has joined #ruby
devbug_ has joined #ruby
hahuang65 has joined #ruby
mleung has quit [Quit: mleung]
arturmartins has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
devbug has quit [Ping timeout: 256 seconds]
KnownSyntax has quit []
solars has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<baweaver>
the goal is to minimize critical sections as much as possible, and for the most part that's going to involve immutability until absolutely necessary to break it
t_ has joined #ruby
<toretore>
ght: it's not up to ruby, it's up to the shell. usually you use quotes, as in `ruby file.rb -a'foo bar' -bhello`
<baweaver>
The less you have to touch mutex the better
allomov has joined #ruby
jenrzzz has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
casadei_ has quit [Remote host closed the connection]
_ixti_ has quit [Ping timeout: 256 seconds]
hahuang65 has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
chouhoul_ has joined #ruby
luckyruby has joined #ruby
<konsolebox>
ok i think it's a little bit forgivable if we interpret or translate @mutex.synchronize{ code } as executing code in synchronization with @mutex. Although the concept of it is a little irritatingly not perfect. Well science allowed it anyway.
aryaching has quit [Ping timeout: 246 seconds]
<konsolebox>
the problem is i'm having a problem in choosing the proper term to call or refer to its "state".
Soda has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lucasr has joined #ruby
lucasr has quit [Client Quit]
oo_ has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roolo has quit [Remote host closed the connection]
allomov has quit [Read error: Connection reset by peer]
A205B064 has quit [Ping timeout: 246 seconds]
roolo has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
<sevenseacat>
I've never seen that set of docs before
Ox0dea has quit [Ping timeout: 244 seconds]
<RickHull>
heh
<sphex>
whoa. "()" means nil?
baweaver has quit [Remote host closed the connection]
<sevenseacat>
no.
<konsolebox>
apeiros: From yesterday's conversation: http://ruby-doc.org/core-2.2.2/Thread.html#method-i-raise: "Raises an exception from the given thread. The caller does not have to be thr." - What do you think "caller" is being referred to?
<sevenseacat>
"()" is a string with parentheses in it.
fabrice31 has quit [Remote host closed the connection]
<bnagy>
rrrrr rvm returns from the grave to screw me one last time
<RickHull>
konsolebox: the object which dispatches to #raise
<sphex>
sevenseacat: oookay. `()` then?
<RickHull>
?
fabrice31 has joined #ruby
<bnagy>
kind of hilarious bug. I imploded and removed it years ago, but it left rvm.sh in /etc/profile.d...
rbowlby has quit [Read error: Connection reset by peer]
<RickHull>
konsolebox: what is the problem?
tubuliferous_ has joined #ruby
<RickHull>
just understanding the docs? or do you have unexpected code behavior?
krz has joined #ruby
<konsolebox>
RickHull: apeiros: konsolebox: callers are objects. objects and threading are orthogonal concepts.
<RickHull>
is your problem with the behavior or with doc verbiage?
thiagovsk has quit [Quit: Connection closed for inactivity]
92AABMI76 has quit [Ping timeout: 246 seconds]
quazimodo has quit [Ping timeout: 256 seconds]
<konsolebox>
RickHull: no, it's about yesterday's conversation about how "callers" can _only_ be used or interpreted.
<RickHull>
oh
dhjondoh has quit [Ping timeout: 252 seconds]
GriffinHeart has quit [Remote host closed the connection]
<sphex>
sevenseacat: huh. well, it means the empty argument list when there's no space following the method name (which is what I was trying to do). very confusing.
arturmartins has quit [Quit: Leaving...]
GriffinHeart has joined #ruby
<sphex>
and it makes ruby look a bit like lisp yay
<sevenseacat>
well yes
<RickHull>
sphex: well it's good ruby caught the error early!
<sevenseacat>
you didnt provide any context for your question, I could have told you that parentheses also denote a method call
dhjondoh has joined #ruby
<sevenseacat>
but by themselves, they dont mean anything
<sphex>
RickHull: it doesn't.. it passes a nil argument instead. :/
<tuor>
hi, how can i get autocompletion like in the shell for irb? I'm very new in ruby and don't know so much stuff, so just "search" with <tab><tab> is very nice.
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
<RickHull>
tuor: try `pry` instead of irb
<RickHull>
if needed, `gem install pry # sudo as nec`
<tuor>
RickHull, ok thx.
polysics has joined #ruby
<RickHull>
pry is irb on steroids
<sphex>
RickHull: interesting.. lemme reread that a bit.
<RickHull>
both are REPLs. irb hasn't seen any meaningful features in like 10 years
<RickHull>
pry gives an amazing amount of introspection
fullofcaffeine has quit [Remote host closed the connection]
<RickHull>
you can show method definitions etc.
arturmartins has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 246 seconds]
<tuor>
ah ok. :)
<sphex>
RickHull: so it seems to interpret it as a method call whenever there are arguments, or directly followed by "()" right?
<RickHull>
sphex: yes
<RickHull>
ruby is very context sensitive in this respect
<RickHull>
it wants to be ambigous about object.property
<konsolebox>
What's the safest way to stop a thread that gets to long-wait access a semaphore from time to time? Using Thread#raise?
<RickHull>
is object.property an attr / ivar?
<RickHull>
or is it a method that returns a value?
<RickHull>
konsolebox: i hate to say this, but it sounds like a deeper problem
jaygen_ has joined #ruby
<RickHull>
that said, you can use Timeout.timeout, but there are blog posts that say you shouldn't
<sphex>
I was wondering about that... these method/local-variable situations can be disambiguated at parse-time (based on assignments seen thus far, etc)?
mkarnebeek has joined #ruby
<RickHull>
>> Timeout.timeout(5) { `sleep 6` }
<ruboto>
RickHull # => uninitialized constant Timeout (NameError) ...check link for more (https://eval.in/396040)
<Antiarc>
(I've been lurking in elixir-lang for a while :)
<RickHull>
apeiros: i suggest that this is desirable in many cases
<sevenseacat>
I haven't seen you there either :P
DoubleMalt has joined #ruby
<RickHull>
apeiros: SF bay area
<Antiarc>
RickHull: It's not because it can interrupt in places that you wouldn't want it to. Like in ensure blocks, which are designed to check resources back into resource pools.
<apeiros>
RickHull: cali or the middle between cali & ch?
edwinvdg_ has quit [Remote host closed the connection]
mkarnebeek has quit [Quit: Page closed]
<RickHull>
apeiros: ah, good point
exadeci has joined #ruby
<RickHull>
cape hatteras maybe
hololeap has joined #ruby
<RickHull>
bermuda?
tomphp has joined #ruby
<RickHull>
porto mallorca?
<Antiarc>
There was an issue in the mongodb driver where you could, if the stars aligned, have a timeout occur in the ensure block of a pool check-in, and that connection would then never get checked in and would leak
krz has quit [Read error: Connection reset by peer]
<Antiarc>
And the connection would be pinned to that thread
<apeiros>
ok, bermuda triangle at noon. it is settled. we shall duel :D
allomov has joined #ruby
<Antiarc>
So the connection could never be acquired again, and that thread could never talk to mongodb again for the duration of that process' lifetime
<RickHull>
Antiarc: i don't disagree. maybe avoid it in libs
<Antiarc>
That was a fun one.
<RickHull>
where you don't know who's calling in what context
<Antiarc>
RickHull: You don't have to use it in libs to break stuff though
<apeiros>
RickHull: your timeout block may span a single method
<RickHull>
"generally harmful" sure
<apeiros>
RickHull: but that single method is not a single line of code itself
djbkd has quit [Quit: My people need me...]
<Antiarc>
If you wrap a call in a Timeout block, and anything in that call - a library 26 calls down the stack maybe - is vulnerable to this kind of disruption, you can break it
<apeiros>
and unless you inspected and basically mentally inlined all code and considered *every single point* in that code, you can't be sure it's not harmful.
<RickHull>
hm, ok
lee-jon has joined #ruby
<Antiarc>
The insidious thing about timeout is that you can inject exceptions into the code in places that it has no way of knowing it should handle the exception
arturmartins has quit [Quit: Leaving...]
<apeiros>
you had File.open in your code? -> possible fh leak
<apeiros>
you had a DB connection open in your code? -> potentially broken session
<Antiarc>
So rather than the code saying "I know this exception can happen, and should handle it or pass it", you are injecting an exception from another thread at an arbitrary point into your "main" thread; it completely bypasses the normal stack-based guarantees
<apeiros>
you access some shared state -> potentially corrupt data
<Antiarc>
It's just...you're eventually going to break something with it. It's bad.
<sevenseacat>
class is now in session
<apeiros>
and there's so, sooo, sooooo many subtle ways it may break your stuff…
<RickHull>
sure but my processes are short lived... and it works for me...
<RickHull>
j/k j/k
<Antiarc>
And when something does break it'll be super weird and unobvious and you won't be able to reproduce it until it happens in production 3 weeks later at 4 AM
<sevenseacat>
this is much more interesting that trying to figure out this elixir scheduling thing
<Burgestrand>
I wonder if there's a way to break a Mutex using Timeout, or if the implementation details of MRI prevents that from happening.
<Antiarc>
(I have an irrationally strong hatred of timeout.rb)
<RickHull>
Burgestrand: i like that idea. how bad can we break shit?
<Burgestrand>
(Break as in cause it to be forever locked without anybody to unlock it)
<RickHull>
Antiarc: can you imagine a better impl?
<RickHull>
it sure seems useful
t_ has quit [Ping timeout: 265 seconds]
<Antiarc>
RickHull: Use IO.select for socket-based timeouts
zacstewart has joined #ruby
surs2 has joined #ruby
<Antiarc>
Use good old fashioned manual timings for CPU loops in a single thread
<Burgestrand>
The tricky part is that Ruby C methods might/might not be susceptible to these kind of raise timing issues.
<Antiarc>
I think Mutex should be safe if you're using the block form
<Burgestrand>
Antiarc: my thesis is that it's not necessarily so!
<Burgestrand>
Antiarc: granted, synchtonize is implemented in C, but maybe there's a point in the call stack where the mutex won't be unlocked. :)
<apeiros>
RickHull: anyway, bottom line is: timeout is always bad. there's situations you can get away with it. but that doesn't mean it's not bad :)
<Antiarc>
Burgestrand: The thing timeout does is that it can raise an exception during execution *any* line of your Ruby code (or any single bytecode op, to be more specific)
<RickHull>
i believe it now
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<RickHull>
i kind of believed it before
<apeiros>
examples of where you might get away with it: workers in separate processes which are built to restart any task, regardless of how broken the data is
<RickHull>
it still has remained useful and non-broken in my experience
<Burgestrand>
If Mutex#synchronize was implemented in Ruby using begin; mutex.lock; yield; ensure; mutex.unlock; end this would be easy to break with enough tries.
<Antiarc>
It won't be able to interrupt the Ruby VM while it's in C-land, AFAIK
<apeiros>
manual shell script which if it times out it'll terminate anyway
<apeiros>
Antiarc: C-land can yield
<Antiarc>
(If you want to read more about this, read up on Java's Thread.stop and why it was deprecated. Exact same stuff.)
<Burgestrand>
Antiarc: if I remember correctly Ruby will check the thread interrupt flag quite a few times even in C-land.
<apeiros>
as in: tell the scheduler to continue
xcesariox has quit [Max SendQ exceeded]
surs1 has quit [Ping timeout: 248 seconds]
<RickHull>
btw, confession: i can count the number ofensure blocks that have made it to production on one finger, maybe less
<apeiros>
also C land now afaik runs in a separate thread, so even if the C code blocks, ruby code can still be scheduled. not sure about that, though.
<apeiros>
RickHull: you have many many more hidden in methods you call
<RickHull>
yeah, that i very much believe
<Antiarc>
Right, it'll yield, but a thrown exception is going to pop the Ruby stack, right? Bah, I'm going to have to go look at the VM
<RickHull>
but i'm a minimalist
<Burgestrand>
apeiros: that is news to me, previously the API was very explicit to allow parallell execution during C functions.
<Burgestrand>
apeiros: at least for Ruby 2.0, not sure about 2.1 and 2.2
<apeiros>
Antiarc: no idea. I should probably one day expand my knowledge in that regard :)
<Antiarc>
(I've spent most of my time lately in the jruby source, which is really good for thinking about concurrency stuff!)
bronson has quit [Remote host closed the connection]
<Antiarc>
Things get really interesting when Ruby operations that are accidentally atomic because of the GVL are no longer so :)
<apeiros>
Burgestrand: hm, I thought "C in separate thread" had been introduced in 2.0. but I only skimmed those news. maybe I misunderstood something.
<RickHull>
Antiarc: oh, interesting
<RickHull>
Antiarc: i'm a ruby guy in a java shop, and i think there is a huge jruby opportunity
<apeiros>
Antiarc: yeah, assumed atomicity considered harmful
<Antiarc>
RickHull: JRuby is awesome and you should use it :D
zacstewart has quit [Ping timeout: 244 seconds]
<Burgestrand>
apeiros: there was an API in 1.9 that was "experimental, might go away" which allowed you to unlock the GVL during e.g. a blocking C call, but I believe it was considered "will stay" in 2.0
rbowlby has joined #ruby
<RickHull>
Antiarc: but I see very little in terms of Jruby for java guys, or jruby for ruby guys that want to integrate with java guys
<Antiarc>
If for no other reason than being able to call Java packages directly from Ruby is baller as hell
<RickHull>
Antiarc: like i literally have no idea how the integration works
<RickHull>
and i've googled a fair bit
<RickHull>
and I know headius etc
<RickHull>
and i'm sure i could ping him and he would tell me
<Antiarc>
RickHull: There are two ways to do it. The first is that you can run JRuby as a replacement for MRI, except you can load JARs and call Java code from JRuby
<Antiarc>
The second is that you can actually embed the JRuby runtime in a Java project and then call Ruby code from Java. But I've done much less of that.
<Burgestrand>
apeiros: it's kind of hard to use for very similar reasons, it's a ruby API function that you pass 1) a "blocking" function to call, 2) arguments to said function, 3) a function to unblock #1, 4) arguments to unblock function.
<Antiarc>
I find it really helpful to just use Ruby as a business logic driver on top of Java stuff.
<RickHull>
Antiarc: do you have any comprehensive, go-to blog posts or docs?
<RickHull>
i feel like there was a lot more 5 years ago
<RickHull>
i'd love to be all productive with jruby and integrate with my java bros
<Antiarc>
I'm more of a Ruby dev than a Java dev, but my current projecte required Actual Concurrency, so I built it on JRuby and have had a total blast with it
Musashi007 has quit [Quit: Musashi007]
<RickHull>
but the big picture is not clear
<Antiarc>
I've gotten to the point that I'm actually contributing stuff back to jruby, which is a ton of fun
<Antiarc>
Java's a lot easier to hack on than C, IMO
<Antiarc>
And the JRuby source is about four billion times more comprehensible than MRI's
<RickHull>
inneresting
<RickHull>
from when i've dived into MRI, i was surprised by ruby-like it "seemed"
<RickHull>
R_VALUE and such
<RickHull>
not sure how much of that is macros
<Antiarc>
It's macros all the way down :)
<RickHull>
and i'm not claiming to have understood it
<RickHull>
but it "looked familiar"
t_ has joined #ruby
<Antiarc>
But yeah, all you have to do to start integrating with your team's Java code is to load a jar or class file from Ruby and start calling Java objects as though they were Ruby objects
<Antiarc>
Java::OrgApacheHttp::NoHttpResponseException maps to org.apache.http.NoHttpResponseException
<Antiarc>
It's reeeeally easy.
CloCkWeRX has left #ruby [#ruby]
<RickHull>
Burgestrand: heh, yep, already linked
<Burgestrand>
RickHull: :)
rushed has quit [Quit: rushed]
<Antiarc>
You could also java_import that object, or include_package the package
<Antiarc>
so include_package "org.company.proprietary" would make that package visible in the current module scope
<Antiarc>
So then you could just foo = ProprietaryObject.new
sevin has joined #ruby
iateadonut has joined #ruby
fabrice31 has quit [Ping timeout: 255 seconds]
<konsolebox>
RickHull: i try to avoid Timeout as well, but i guess I'll just use Mutex#sleep and a thread flag to stop the thread.
<RickHull>
what if a feature request comes in to the java guys
<Antiarc>
Or java_import "org.company.proprietary.ProprietaryObject", if you don't want to include the whole package
<RickHull>
and i'm all "hey i can do that in jruby"
<RickHull>
can we get that functionality into the jar?
leonardoajim has quit [Quit: Be back later ...]
<Antiarc>
It depends on how the project is being deployed, really. To ship that you would have to ship the jruby-complete jar with your deliverable (as a POM dependency or whatever) and set up a Ruby VM that exposes your execution environment
<RickHull>
i'm sure the answer is yes, but this the other question i had trouble ansewring
<RickHull>
pasted before, yes. but i didn't click on it then :)
olistik has quit [Remote host closed the connection]
Rickmasta has joined #ruby
<Antiarc>
That would be more useful for adding Ruby scripting to an existing Java project
<RickHull>
konsolebox: are you waiting on socket comms?
<konsolebox>
RickHull: no..
<Antiarc>
But the Ruby-Java crosstalk still works. You can still call Java code from Ruby that's called from Java
<RickHull>
ok
sivoais has joined #ruby
<Antiarc>
RickHull: #jruby is super helpful if you're interested in dipping your toes in, FWIW
oo_ has quit [Remote host closed the connection]
<RickHull>
I'm sure. i got frustrated by the jruby web content (docs, tutorials)
oo_ has joined #ruby
<RickHull>
and #jruby was probably my next step, but i gave up
arturmartins has joined #ruby
<RickHull>
until you prompted me :)
<Antiarc>
TBH it may not be a bad idea to document the places you have issues, and then file those as a ticket. The JRuby leads have been wanting to improve its visibility and make it easier for Ruby devs to pick it up and experiment with it
<RickHull>
cool, i'm super happy to help out in that area
<Antiarc>
So noting the places where a newcomer has issues or concerns would be valuable!
<sphex>
hey. I'm trying to do something but I'm not sure I understand what it is... you know when you pass a block to :define_method, it does a thing to it which associates it with the class (and allows it to access instance variables, etc). can I get the same thing done to an anonymous proc (which I could then call with #call)?
yeticry has joined #ruby
<Antiarc>
You could just bind the proc as a block, no?
<Antiarc>
define_method :foo, &my_proc
olistik_ has joined #ruby
i8igmac has joined #ruby
olistik_ has quit [Remote host closed the connection]
Scroff has quit [Ping timeout: 256 seconds]
<sphex>
yeah, but then I don't have it as a first-class value (which I can put in data structures, etc). unless I get it back from #method I guess.
sevin has quit [Quit: byebye]
<Antiarc>
I guess I don't quite grok what you're doing
nahtnam has quit [Quit: Connection closed for inactivity]
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
Feyn has quit [Quit: Leaving]
chinmay_dd has joined #ruby
blackmesa has joined #ruby
sevin has quit [Quit: byebye]
<sphex>
Antiarc, Burgestrand: it works! not sure why, my brains are fried at this point. I guess it makes sense though. I was really searching for somekind of built-in wrapper just like that and forgot about instance_exec completely.
Scrofff has quit [Ping timeout: 246 seconds]
Scroff has joined #ruby
<sphex>
Burgestrand: thanks for the example!
hahuang65 has joined #ruby
krz has quit [Read error: Connection reset by peer]
<Antiarc>
That does the same thing, though it has to use send to call #define_method
dumdedum has quit [Ping timeout: 246 seconds]
quimrstorres has joined #ruby
<Burgestrand>
I'm not sure how thse things will behave regarding the ruby method caching.
lkba has quit [Ping timeout: 248 seconds]
quimrstorres has quit [Remote host closed the connection]
<Antiarc>
define_method will invalidate the cache
ruby-lang867 has joined #ruby
<Antiarc>
as should define_singleton_method
<Burgestrand>
Indeed, I'm just not sure of the repercussions.
hahuang65 has quit [Quit: WeeChat 1.2]
<Antiarc>
Well, if you're calling it in a loop in production code, Bad Things. :)
<Antiarc>
(though ostruct is really the only place where that tends to happen on any kind of regular basis, IME)
<Burgestrand>
Because the method cache is not just One Global Cache anymore, is it?
<Antiarc>
Right, I think it's per inheritance tree as of 2.2?
surs3 has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
<Burgestrand>
Found some claims that starting with 2.1, altering a class will only invalidate the caches for that class and its subclasses. Wonder how altering the singleton class pans out…
oo_ has quit [Remote host closed the connection]
<RickHull>
fuck, cache invalidation, naming things, and off by one errors
araujo has quit [Quit: Leaving]
<Antiarc>
Burgestrand: That's a good question, actually. instance.extend(ExtraFunctionalityModule) is something I used to see but generally got patched out because of method cache churn. I wonder if it's viable now.
<RickHull>
there are only 2 hard problems in programming: determining when to go bed, and doing so
surs2 has quit [Ping timeout: 255 seconds]
sevin has joined #ruby
<Burgestrand>
Antiarc: looks like accessing the singleton class does cause some kind of cache invalidation.
senayar has quit [Remote host closed the connection]
<sphex>
in my case, this would all be done only when defining the class. looks like the define_method/method/remove_method trick will do fine and I won't have any instance_exec either. but instance_exec isn't (as much of) a performance problem I guess?
<Burgestrand>
sphex: it's only a performance problem if you do a lot of my_proc.bind(object)
<Antiarc>
sphex: It's not particularly a performance problem, no.
<sphex>
okay
<Burgestrand>
sphex: and it's kind of isolated, so I would say don't mind it at all unless you run into performance problems
<Antiarc>
Rule of thumb is that you don't want to be extending objects or defining new methods at runtime after all your initial setup
<RickHull>
rule #2 is always be profilin
sevenseacat has quit [Ping timeout: 248 seconds]
<Burgestrand>
Rule #3 is you don't need performance until you need it
<RickHull>
and when you do, she is a fickle strumpet
ndrei has joined #ruby
<sphex>
Burgestrand: ok. I'll be doing those during class definition only (and then save the "bound" procs).
<Burgestrand>
:)
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
<Antiarc>
You probably shouldn't worry about method cache stuff too much right now. Just keep the term in mind so that when someone yells at you for cache thrash you'll know what to look at :)
<Burgestrand>
sphex: ^
tchebb has joined #ruby
MichaelGG_ has quit [Remote host closed the connection]
<RickHull>
rule #1 is don't worry about stuff too much right now
oo_ has joined #ruby
<Burgestrand>
Now that the method cache busting mostly isn't global I don't really care either way… and I didn't even before I knew there was a global method cache that could be busted either.
<RickHull>
konsolebox: yeah, ruby has its heart in unix
<konsolebox>
RickHull: it probably works well with UN*X, but it just made me wonder about Windows.. it's one of my target platforms after all.
<RickHull>
you'll generally do well to assume any non-unix impls approximate the unix impls
<konsolebox>
RickHull: i don't care about post-NT windows systems actually. starting Win2k (not really), XP would be fine
<RickHull>
and yeah, where you have to support those platforms
<RickHull>
it's loads of "fun"
<RickHull>
ruby does a good job, generally, imho, in being multi-platform
lee-jon has left #ruby [#ruby]
surs3 has quit [Ping timeout: 246 seconds]
surs4 has joined #ruby
<RickHull>
that said, every time i've dealt with ruby headaches on windows, the answer has always been "linux"
<redcue>
depends on how you define 'a good job' ^^
<RickHull>
redcue: relative to?
<konsolebox>
*pre-NT windows
<konsolebox>
RickHull: anyway i guess i just have to test. if mingw emulates it well, then it's fine.
<tuor>
hi, I have a string object with a xml in it (as a string). I want to write it in a file and make it readable (now it's all one string I want to have a nice readable xml file).
<RickHull>
konsolebox: i wish i had better advice
<redcue>
Don't get me wrong I think ruby actually does a good job in being multi-platform
<tuor>
how can I do it?
<RickHull>
konsolebox: but yes, it generally comes down to testing and workarounds for majorly different platforms
dgutierrez1287 has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
jk_scowling has quit [Ping timeout: 256 seconds]
lessless has joined #ruby
<Burgestrand>
raddy: how have you set it?
<jhass>
well, the PassengerAppEnv directive takes production only
<jhass>
and sets the correct variables
<Burgestrand>
raddy: by default, passenger will already have set those variables to production.
<raddy>
Then what for my app always starts in development ?
<Burgestrand>
raddy: maybe your app doesn't read environment?
<jhass>
or maybe you configured that somewhere without realizing
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdg_ has quit [Remote host closed the connection]
Scroff has quit []
<shevy>
the infamous ghost variables
blackmes1 has quit [Ping timeout: 256 seconds]
okdas has quit [Read error: Connection reset by peer]
okdas has joined #ruby
okdas has joined #ruby
kjkn has joined #ruby
dEPy has joined #ruby
<[k->
set_trace_func!
edwinvdgraaf has joined #ruby
Scroff has joined #ruby
<shevy>
set_snoop_[k-!
sdothum has joined #ruby
<[k->
0000 c_func return
<shevy>
[k- do you program in C?
<[k->
no
shadoi has quit [Quit: Leaving.]
chipotle has joined #ruby
Rollabunna has quit [Remote host closed the connection]
edwinvdgraaf has quit [Remote host closed the connection]
auzty has quit [Quit: Leaving]
edwinvdgraaf has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<MagePsycho>
how to seek confirmation in ruby? like are you sure you want to continue
urbanmonk has quit [Quit: urbanmonk]
skade has quit [Quit: Computer has gone to sleep.]
chipotle has quit [Ping timeout: 264 seconds]
<[k->
you ask the person
<[k->
you normally use a blocking method
diegoviola has joined #ruby
<[k->
gets, etc
<apeiros>
?context MagePsycho
<ruboto>
MagePsycho, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<apeiros>
hm, maybe that factoid goes slightly in the wrong direction for this case :)
<apeiros>
well: "Please add more context to your question". this.
ndrei has joined #ruby
urbanmonk has joined #ruby
El3ktra has quit [Ping timeout: 256 seconds]
urbanmonk has quit [Client Quit]
<MagePsycho>
actually before running the script i want to show the variable values and say are you sure you want to continue to run the script with these variables? just to make sure they are passing correct arguments
tkuchiki has quit [Remote host closed the connection]
<shevy>
MagePsycho user_input = gets.chomp
<adaedra>
Console script?
<shevy>
case user_input
<shevy>
when 'yes','y'
hotpancakes has joined #ruby
<shevy>
@continue = true
<adaedra>
?gist shevy
<ruboto>
shevy, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<shevy>
?spam adaedra
<ruboto>
adaedra, I don't know anything about spam
urbanmonk has joined #ruby
<MagePsycho>
yeah console script
<[k->
?roode adaedra
<ruboto>
adaedra, I don't know anything about roode
<adaedra>
look who's talking
<hanmac1>
shevy ⁹⁄₉ of all rwx users likes it ;P
<shevy>
hanmac1 I am rewriting all my old ruby-gnome scripts again!
<apeiros>
MagePsycho: take a look at highline gem
edwinvdgraaf has quit [Remote host closed the connection]
<apeiros>
makes user interaction easier
<shevy>
finished about 20% so far, doing like one .rb per day
howdoicomputer has joined #ruby
<MagePsycho>
it’s just a simple interaction
olistik has joined #ruby
<hanmac1>
shevy better help me and then you can rewrite them into rwx ones ;P
luzidco_ is now known as luzidco
<adaedra>
MagePsycho: if you don't want to add dependencies, just read a line (gets) and compare it. But yes, highline is good.
hotpancakes has quit [Remote host closed the connection]
<shevy>
hanmac1 one thing at a time... first I have to seriously learn C... it feels so boring compared to ruby though
skade has joined #ruby
<MagePsycho>
is there a way to pass argument in ruby console script like shell script: runDbRepairTool —url=url-goes-here —db=<db-name> —user=<username> —pass=<password>
edwinvdgraaf has joined #ruby
ldnunes has joined #ruby
<shevy>
MagePsycho all commandline arguments passed to a .rb file are available in ARGV
<adaedra>
I think it's getopt
<MagePsycho>
for now i am passing like: runDbRepairTool arg1 arg2 arg3 arg4 ..
<adaedra>
shevy: when you just pass ordered, non labelled elements, yes. Going through named options, with potentially optionnal or short options quickly becomes a mess.
<diegoviola>
I write my ruby code with vim
<diegoviola>
what about you
kjkn has quit [Ping timeout: 246 seconds]
<adaedra>
I use butterflies.
eGGsha has joined #ruby
<shevy>
adaedra yeah, the moment one wants to support all of -, --, and also =, handling ARGV 1:1 is too much work for the gain
<shevy>
ruby foobar.rb -v --help -fruit=bananas
<shevy>
if it would be a french script, one would use baguette instead :)
<adaedra>
also, optparse is stdlib, so everything is good in it.
<adaedra>
give me a break with that.
<shevy>
eh, stdlib isn't always perfect
<adaedra>
I meant it in the way "No need for external deps"
<shevy>
there is also GetoptLong in stdlib :)
pyro_ has quit [Remote host closed the connection]
<shevy>
strangely enough, I never actually used it
TheHodge has joined #ruby
n008f4g_ has joined #ruby
hanmac1 has left #ruby [#ruby]
<adaedra>
You never used stdlib? :o
<shevy>
I mean GetoptLong, I don't know when to preferrentially use it over optparse
<shevy>
*preferentially
matti has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
fabrice31_ has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
surs3 has joined #ruby
fantazo has joined #ruby
matti has joined #ruby
matti has quit [Changing host]
matti has joined #ruby
El3ktra has joined #ruby
<[k->
You never used stdlib? :o
surs2 has quit [Ping timeout: 265 seconds]
<shevy>
a parrot!
fabrice31 has quit [Ping timeout: 264 seconds]
<[k->
a non-answerer!
nfk has joined #ruby
<MagePsycho>
how to parse xml, i am planning to get the db details from .xml file
<diegoviola>
why do you guys torture yourself with xml?
<shevy>
I don't!
<adaedra>
why not?
<[k->
json or dea
<yorickpeterse>
I quite like HTML
<shevy>
why do you use windows diegoviola :)))
<yorickpeterse>
it's quite elegant
<adaedra>
Let's all do JSONx
<[k->
jsonx?
surs3 has quit [Quit: WeeChat 0.3.7]
<adaedra>
look it up
<diegoviola>
shevy: lol... blame my boss
* apeiros
prefers jsonb
livathinos has quit [Read error: Connection reset by peer]
<shevy>
oh good... there is also jsonc!
<adaedra>
JSON is sometimes not enough
<apeiros>
aaahaha, jsonx is *precisely* what I assumed it to be
<shevy>
we get the whole alphabet covered
<[k->
oh fuck you
<diegoviola>
shevy: but I have vbox in fullscreen, so I don't really "use" windows
<shevy>
"JSONx is an IBM standard format to represent JSON as XML."
<adaedra>
diegoviola: still windows.
<shevy>
diegoviola I know you like to say that :)
<yorickpeterse>
shevy: > IBM
<yorickpeterse>
not surprising
<diegoviola>
adaedra: I have Arch in fullscreen
<yorickpeterse>
They're crazy enough to even run Node.js on their mainframes
<yorickpeterse>
because that's totally going to use all those cores efficiently
<shevy>
diegoviola it's like a vegetarian buying dead animals for the cat at home :)
swills has quit [Quit: leaving]
<yorickpeterse>
No no no
<adaedra>
shevy: no
<diegoviola>
I know, I'll get a SATA to USB cable soon and I won't have to boot into windows anymore
<yorickpeterse>
For the cat it's natural so it's totally ok
<adaedra>
diegoviola: still windows under
<shevy>
well my cat can't go shopping yet...
<diegoviola>
adaedra: what?
<diegoviola>
adaedra: with a sata-over-usb cable I won't have to boot into windows anymore
<diegoviola>
adaedra: I will just plug to my SSD and boot arch
<shevy>
see adaedra? he is not using windows!!!
<MagePsycho>
how to print array in ruby
<adaedra>
you're filling my screen with highlights?
<shevy>
MagePsycho simplest way is: p array
<adaedra>
MagePsycho: for debugging, p or pp
<diegoviola>
shevy: I stopped using windows 15 years ago
<shevy>
if you wish to output or modify, you can use .each and output then
<shevy>
or rather .map for modify then
<MagePsycho>
diegoviola: shevy: which OS you guys use
ta has quit [Remote host closed the connection]
<shevy>
linux!
<shevy>
shevyx
<diegoviola>
shevy: write a shevyx in ruby
<shevy>
windows gets too much into the way
<shevy>
but in principle, ruby files should work just fine
rushed has joined #ruby
<diegoviola>
MagePsycho: Linux
<diegoviola>
MagePsycho: Arch
<yorickpeterse>
oh oh oh
<MagePsycho>
Mac OSX
<yorickpeterse>
?guys
<ruboto>
we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<shevy>
diegoviola I once wanted, but it's so much work. I think these kind of things can not really be done by a single person... unless he is crazy, like that TempleOS dude
<[k->
yorickpeterse isn't a male :o
howdoicomputer has joined #ruby
<diegoviola>
shevy: yeah I was kidding
<adaedra>
shevy: there's a lot of custom oses other there
jespada has quit [Ping timeout: 252 seconds]
rbowlby has joined #ruby
<yorickpeterse>
I identify as an airplane
<[k->
redstar os best os
surs has joined #ruby
<shevy>
redhat?
<[k->
lies, flughafen is the airport here!
<adaedra>
redhat != redstar os
<shevy>
flughafen is still downed
surs has quit [Changing host]
surs has joined #ruby
<adaedra>
shevy: osdev.org
<[k->
adaedra redstar os BEST OS
<shevy>
adaedra there is no redstar on that page! :(
<flughafen>
shevy: [k- the flughafen lives!!!!
<adaedra>
shevy: no, that's for building your own system
<MagePsycho>
which ruby editor you prefer everyone
senayar has quit [Remote host closed the connection]
<[k->
cough, Ruby ide...
senayar has joined #ruby
<MagePsycho>
ReSharper
<[k->
avdi just wrote something about Ruby tooling!
<MagePsycho>
which ide you use? i heard vim.. what else
joonty has quit [Client Quit]
<shevy>
I don't use an IDE in ruby
<shevy>
many people here use sublime editor
<shevy>
I use bluefish 1.0.7!
<diegoviola>
why would anyone use sublime
<[k->
sublime text*
<diegoviola>
it's a paid app
<apeiros>
because it's a good app, that's why
Toska has quit [Remote host closed the connection]
<diegoviola>
apeiros: the thing is that it's not a good app
joonty has joined #ruby
<apeiros>
diegoviola: the thing is - that's like your opinion.
<shevy>
:)
tens0r has joined #ruby
<[k->
oooooo buuuuuurrrrnnnnnnnn
<shevy>
he should stop to use windows!
<diegoviola>
shevy: I use arch
* [k-
pours apeiros a cup of cold tea
<shevy>
although, notepad++ is quite ok
<MagePsycho>
how to exit with message if there is any error
<maloik>
I didn't even read avdi's post as if it was about tooling, more about the fact that we still work with ruby "despite" what others might see as a reason not to
<MagePsycho>
nokogri seems great tool for parsing xml.. now i need to check if it doesn’t find xml to parse.. print error and exit
<[k->
but he wants a message
<maloik>
sort of in the same way many people flock to "manual" ways of making coffee, or use record players despite the fact that they're annoying as you have to turn around the record
<MagePsycho>
i only started ruby two days ago.. so veryvery new
<[k->
oh abort writes a message to stderr
krz has quit [Ping timeout: 244 seconds]
Muhannad has quit [Ping timeout: 265 seconds]
<[k->
MagePsycho do you want to terminate on error or just raise an error
<tuor>
hi, I have a String: import = "<xml>...</xml>" and I do it looking better: nice_imput = Document.new import
<shevy>
maloik when you write despite though, what alternatives were given to ruby?
jonathanwallace has joined #ruby
<tuor>
this works fine. But how can I do exactly the oposite? I need first to do it readable and then again back into one string (with out any unneeded withe space)
<diegoviola>
"Sometimes "pi = 3.14" is (a) infinitely faster than the "correct" answer and (b) the difference between the "correct" and the "wrong" answer is meaningless. And this is why I get upset when somebody dismisses performance issues based on "correctness". The thing is, some specious value of "correctness" is often irrelevant because it doesn't matter. While performance almost always matters. And I absolutely
<diegoviola>
detest the fact that people so often dismiss performance concerns so readily." -- Linus Torvalds
<diegoviola>
he seems to care more about performance than code readability, what are your thoughts on that?
olistik has joined #ruby
<apeiros>
?ot diegoviola
<ruboto>
diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<shevy>
linus does not use ruby :(
<diegoviola>
apeiros: ok sorry
<diegoviola>
shevy: you can't write the linux kernel in ruby, can you?
<shevy>
yeah
<shevy>
there is even assembler code in the kernel
uber has joined #ruby
krz has joined #ruby
<t_>
even?
<t_>
even?!?!
<t_>
ofc there is assembler in the the kernel
<t_>
lol
<t_>
and you dont want to write linux in ruby and ruby doesnt run natively on the hardware
<t_>
so no
<diegoviola>
there is also my typo patch merged in the linux kernel
hotpancakes has joined #ruby
<[k->
Linux in Ruby...
<t_>
talk about bad ideas lol
<t_>
programming is all about the right tool for the job
saintcajetan has quit [Ping timeout: 240 seconds]
<[k->
shevy uses Ruby for all the jobs
devbug has quit [Ping timeout: 244 seconds]
randiman has joined #ruby
saintcajetan has joined #ruby
<raddy>
Hello Everybody
zacstewart has quit [Ping timeout: 256 seconds]
<raddy>
I hope we can have multiple versions of ruby and passenger,
<raddy>
Am i correct ?
<bougyman>
we have tons of them
<bougyman>
you are correct.
<yorickpeterse>
bougyman: no longer running lighttpd?
<shevy>
[k- the only valid complaint is that ruby is slow
<shevy>
"Unlike in Ruby, using Python you can define instance variables or object attributes on the fly like this. This seems like a bit of interesting magic missing from Ruby."
<shevy>
:(
arup_r_ has joined #ruby
stamina has quit [Ping timeout: 256 seconds]
randiman has quit [Quit: (null)]
<diegoviola>
what terminal emulators do you guys use?
<shevy>
bash in kde konsole
<sevenseacat>
iterm
<shevy>
roxterm is quite nice too
<bnagy>
I am in <3 with iterm2
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<diegoviola>
I'm using termite right now
Aderium has joined #ruby
<jhass>
?ot diegoviola
<ruboto>
diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Limix has joined #ruby
<diegoviola>
move yourself to #ruby-offtopic to keep this channel free of spam, thanks
<shevy>
they just want to have more ruby questions!
arup_r has quit [Ping timeout: 265 seconds]
<diegoviola>
sorry about that
<diegoviola>
:)
<apeiros>
wow, that sorry was quite well timed
<apeiros>
I already had the !kick written diegoviola.
<sevenseacat>
I woulda done it anyway
<[k->
much was anticipated
<shevy>
lol
<shevy>
this cat is a killer
<apeiros>
sevenseacat: it's friday. I'm mellow.
erowlin has joined #ruby
rushed has quit [Quit: rushed]
tubuliferous_ has joined #ruby
<shevy>
mice, rabbits, birds and spammers all fall prey
<sevenseacat>
good call.
<erowlin>
Hi ! is someone good at RSpec here ? I have a very basic question I think since I ‘m new at testing .
<apeiros>
?ask erowlin
<ruboto>
erowlin, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<erowlin>
Ok Ruboto, will gist. Thx
lkba_ has quit [Remote host closed the connection]
klaas has quit [Read error: Connection reset by peer]
hashrocket has joined #ruby
<diegoviola>
apeiros: why is asking about a terminal emulator not tolerated? I bet I could say that in #python and they won't cry too much
musty has quit [Remote host closed the connection]
<apeiros>
diegoviola: if you want to have the discussion, have it in OT
<diegoviola>
or do we have to ask about the stdlib only here?
<ljarvis>
diegoviola: then go to python to discuss it
<shevy>
erowlin ruboto is a bot by the way, just in case you are about to say thank you :)
<sevenseacat>
cry? lol
<diegoviola>
ljarvis: you go there
<ljarvis>
those are the rules
<shevy>
huh
<shevy>
there is a rule to go to python?
<erowlin>
Code here : https://gist.github.com/Erowlin/dc427693374aa75a3d27, Line 34, I’m looking to keep the ID of the DefinedPushMessage just created to check if I can find it on the next block, and if I can delete it properly in the other « it » block
<tuor>
shevy, I have one. ;) Still don't know how to do it.
eGGsha has joined #ruby
<diegoviola>
ok sorry about that
<sevenseacat>
you keep saying that and you keep trolling anyway
<diegoviola>
crying as in complaining about offtopic
<diegoviola>
I'm not trolling
<apeiros>
!kick diegoviola I said if you want to discuss those things, go to OT, I meant it.
diegoviola was kicked from #ruby by ruboto [I said if you want to discuss those things, go to OT, I meant it.]
<apeiros>
enough.
<ljarvis>
You've apologised a couple of times but continued. If you want to stop..
diegoviola has joined #ruby
<ljarvis>
nevermind
<sevenseacat>
hear hear.
edwinvdgraaf has quit [Remote host closed the connection]
<diegoviola>
5 hours later someone else will come here and ask a bunch of offtopic questions and nobody will raise a word, you guys are hypocrites
<ljarvis>
?guys
<ruboto>
we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
tubuliferous_ has quit [Ping timeout: 256 seconds]
<erowlin>
Cmon, why don’t you go in PV, some people like me need some help ;)
<apeiros>
!ban diegoviola !T 1d permanently OT
diegoviola was banned on #ruby by ChanServ [diegoviola!*@*]
diegoviola was kicked from #ruby by ChanServ [Banned: permanently OT]
<ljarvis>
"ya'll are hypocrites" was what I think you wanted
<ljarvis>
erowlin: sorry, having a look
<erowlin>
Thanks Ijarvis !
<ljarvis>
it's an L, but no worries
<canton7>
one day 'guys' will be defined as gender-neutral and everything will be ok...
<erowlin>
I was wondering :)
<ljarvis>
erowlin: basically, you can't/shouldn't do that.
<Burgestrand>
erowlin: you are probably looking for a "before" block.
<ljarvis>
erowlin: you should either group them into a new before/context block
<ljarvis>
yeah that's a good start, I think you'll want to scope them with describe or context (whichever makes more sense for your usecase)
<erowlin>
Is it a good thing to check if I can .find(id) just after the .save ?
<erowlin>
I believe it’s useless no ?
<ljarvis>
if you knew the save didn't fail, then probably
<erowlin>
Ok
<ljarvis>
right it's save! so yes
<erowlin>
Except if I want to be sure that the find method is not overrided
<ljarvis>
(it'll blow up if it failed to save)
dgutierrez1287 has quit [Remote host closed the connection]
<ljarvis>
if the find method is overridden, you have the permission to find and kill whoever overrided it
<ljarvis>
overrided
<erowlin>
ahah
<ljarvis>
works for me
<erowlin>
true story
<Burgestrand>
erowlin: how detailed you are in your tests is determined by what kind of level of confidence you want.
<erowlin>
Yep
<Burgestrand>
erowlin: you can test every line, every method, most of the time that's not very useful though, so you test the things that are important and leave the rest.
<erowlin>
I just started with testing trying to do some TDD, but it’s hard. I think I take the worst case, I don’t trust other developpers and everything should be tested
<ljarvis>
fwiw I think you're tests are looking great for a start. Very succinct
<ljarvis>
your*
<ljarvis>
but yeah you don't need to overtest
<erowlin>
It’s a hard question I ask myself, what should I test and not ?
<erowlin>
Thank you ljarvis
howdoicomputer has quit [Ping timeout: 255 seconds]
MichaelGG_ has joined #ruby
<raddy>
Hello Everybody
troulouliou_dev has joined #ruby
bmurt has joined #ruby
lkba has joined #ruby
<tuor>
I think my question is forgotten (because of some ot), so I repeate it: I have a string with xml in it. I can make it readable with REXML::Document.new "string", but how can i do exactly the oposit? (remove all unececery withespace and linebreaks)
bmurt has quit [Client Quit]
<ljarvis>
erowlin: I think your spec would be a good unit test. I don't think it really needs to hit the database. Testing retrieval is probably overkill. Testing validity is good and you're already doing it. Testing delete/find directly is testing something your orm will already cover
a346 has joined #ruby
<ljarvis>
?code tuor
<ruboto>
tuor, We can't help you without your code, please post it to https://gist.github.com
<MagePsycho>
dbRepairUrl -> db_repair_url
<raddy>
PassengerRuby /usr/bin/ruby , But still ruby intrepret shows as /usr/local/rvm/wrappers/ruby-1.9.3-p448/ruby
<raddy>
Can anybody help me ?
<Burgestrand>
erowlin: personally I usually don't directly test code that isn't mine.
<erowlin>
Ok I understand
<ljarvis>
raddy: try #passenger
<raddy>
which ruby shows /usr/bin/ruby as well
<erowlin>
I will just remove find and all ORM related tests
<Burgestrand>
erowlin: I will indirectly exercise code that isn't mine, but I don't write explicit tests for them. For example I wouldn't have written the test for.delete.
<raddy>
Nobody is responding there
<erowlin>
you’re right
<ljarvis>
raddy: for a start, changing PassengerRuby isn't going to set the Ruby in your terminal session
<erowlin>
Thank you for your indications :).
<erowlin>
*all
<ljarvis>
raddy: it'll set the interpreter path for the passenger process
<Burgestrand>
erowlin: like ljarvis said though, you're doing good.
<erowlin>
Thank you !
<erowlin>
Want to hire me ?
<erowlin>
:P
<Burgestrand>
erowlin: just keep in mind that every test you write has a cost in 1) time to run and 2) time to maintain.
<raddy>
ljarvis : I know about the command.
<shevy>
tuor if you wanna remove all linebreaks you could always do a .gsub(/\n/,' ') or something like that
<erowlin>
Yep
<erowlin>
We have to setup CI
<Burgestrand>
erowlin: hehe, I'm about to start looking for a new place to work myself so no. ;)
<Burgestrand>
(changing cities)
<erowlin>
I have a good place in Paris if you’re looking for an awesome job
<tuor>
shevy, ok. I'll paste the code. One moment please. ;)
<[k->
dat disclosure
<Burgestrand>
erowlin: thanks, but not quite that far, I'm moving to Stockholm.
<erowlin>
Nice !
<erowlin>
BTW, thank you all, have a nice day
bmurt has joined #ruby
<Burgestrand>
erowlin: you too.
Rollabunna has joined #ruby
aryaching has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<white_bear_>
is it possible to reference variables indirectly, like ${!foo_*} in bash will match all foo_* variables?
<Burgestrand>
tuor: so you want to minify the XML?
<ljarvis>
$apeiros
* apeiros
sees nothing
<white_bear_>
bougyman: looping through all data types (Object, Module and Binding, as mentioned above) and using reflection?
rodfersou has quit [Quit: leaving]
lavros has joined #ruby
tens0r has quit [Quit: tens0r]
jespada has joined #ruby
mesamoo has quit [Ping timeout: 248 seconds]
chipotle has joined #ruby
bungoman has joined #ruby
<ljarvis>
D:
rbennacer has joined #ruby
<tuor>
Burgestrand, yes.
whippythellama has joined #ruby
<maloik>
"Can you just make sure that X can NEVER EVER happen? And then add a checkbox 'exception' on the form"
<maloik>
(tableflip)
rbennacer has quit [Remote host closed the connection]
Limix has quit [Quit: Limix]
zacstewart has joined #ruby
aryaching_ has joined #ruby
rippa has joined #ruby
<MagePsycho>
how to get current working directory in ruby
<MagePsycho>
mageDir = `$PWD`
<MagePsycho>
puts "#{mageDir}/app/etc/local.xml"
<MagePsycho>
doesn’t work
<white_bear_>
Dir.pwd
<MagePsycho>
i am working on ruby console script
riotjone_ has quit [Remote host closed the connection]
chipotle has quit [Ping timeout: 256 seconds]
decoponio has joined #ruby
<apeiros>
maloik: business as usual?
<apeiros>
I could fill a book which such cases.
<maloik>
so could I, that's exactly the problem
mesamoo has joined #ruby
<MagePsycho>
whippythellama: thats works :) thanks
<maloik>
no matter how much I push back that stuff keeps on coming and they never learn :(
<MagePsycho>
white_bear_: thats works thanks man
<apeiros>
should they learn?
chouhoulis has joined #ruby
<adaedra>
learn what?
<apeiros>
I've changed to just explaining the cost
aryaching has quit [Ping timeout: 255 seconds]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<white_bear_>
MagePsycho: np
<apeiros>
and if they're ready to pay the price, then well, they can have their edge cases
Toska has joined #ruby
Zinja has joined #ruby
<MagePsycho>
loving ruby really.. such a neat and clean compared to php
<apeiros>
while it annoys the purist in me - the rest is now "so what? I'm paid to solve their problems"
psy_ has quit [Ping timeout: 250 seconds]
<apeiros>
MagePsycho: `pwd` certainly works. but don't forget that it comes with a newline. but as white_bear_ already said, Dir.pwd (or .getwd) is better.
mjuszczak has joined #ruby
<Burgestrand>
tuor: I don't think REXML supports XML canonicalization, but Nokogiri does.
blackmes1 has joined #ruby
<Burgestrand>
s/supports/implements/
<adaedra>
I don't want to work v_v
olistik has quit [Remote host closed the connection]
<MagePsycho>
apeiros: yeah i noticed that
failshell has joined #ruby
Limix has joined #ruby
prettiestPony11 has joined #ruby
* [k-
gives adaedra a hug
<[k->
there there
<yorickpeterse>
REXML is shit
<adaedra>
oga is life, oga is love
<yorickpeterse>
it's ok
<[k->
so modest :p
mando has joined #ruby
<maloik>
apeiros: I dunno, I'm just really annoyed because it makes understanding the entire system so much harder
Rollabunna has joined #ruby
<apeiros>
maloik: I fully understand that. I feel the same. exceptions to rules are the death of understandability and maintainability
arup_r has joined #ruby
<apeiros>
so that's what I make sure to explain them. and I'm somewhat sure that despite my best efforts, they don't fully understand the cost of their wishes. but so be it.
rbennacer has joined #ruby
<[k->
you mean python?
arup_r_ has joined #ruby
hakunin has joined #ruby
<apeiros>
adaedra: it's friday. week-end is coming.
xkef_ has quit [Ping timeout: 265 seconds]
psy_ has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<ljarvis>
it's here!
* ljarvis
throws beer everywhere
<ljarvis>
I have achieved quite little today
<sevenseacat>
i've done the exercises from chapter 14 and most of 15 of programming elixir. progress.
<Aderium>
If someone can give me some pointers :) I have downloaded the ruby source 2.1.6 on Solaris 11.2
<adaedra>
void * p
<Toska>
Aderium: You won't need to worry about the pointers in ruby.
<shevy>
lol
mrconfused has joined #ruby
<Aderium>
yesterday when looking at RVM scripts we have discovered that the way RVM looks for the arch hardware is rather inapproriate for Solaris and was always giving back i386
bungoman has quit [Ping timeout: 246 seconds]
Timba-as has joined #ruby
mando has quit [Ping timeout: 256 seconds]
<Aderium>
tthat is it was looking at uname instead of isaifno
<shevy>
are you sure this is just related to RVM and not the ruby source directly?
xkef has quit [Ping timeout: 244 seconds]
xlogic has joined #ruby
<Aderium>
now I am discovering something wimilar with ruby during the configuration phase
fantazo has quit [Ping timeout: 256 seconds]
<Aderium>
checking build system type... i386-pc-solaris2.11
<Aderium>
checking host system type... i386-pc-solaris2.11
<Aderium>
checking target system type... i386-pc-solaris2.11
<[k->
?gist
<ruboto>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<Aderium>
one sec
<shevy>
who else is using solaris here!
<MagePsycho>
one question.. if function is defined below the caller
<MagePsycho>
what happens
<sevenseacat>
try it and see.
ta has joined #ruby
<[k->
it doesn't work
<sevenseacat>
pretty easy to test!
<shevy>
MagePsycho best way is to define everything upfront before calling anthing
<shevy>
not entirely sure, I hate those configure.ac* magic thingies :D
<MagePsycho>
dpeth is unknow.. so whenever a continue button is found i need to submit the form: form.submit(form.button_with(:id => "button-continue"))
charliesome has joined #ruby
<MagePsycho>
how to do this recursively or using some kinda loop
<shevy>
Aderium is the wrong "uname" entry in the Makefile?
mrconfused has quit [Ping timeout: 250 seconds]
<Aderium>
the issue is that in Solaris 11.2 it is incorrect to use uname to detect the system and the loaded kernel bits
<shevy>
aha
<Aderium>
isainfo -k should be used
<Aderium>
so I am looking in the where in the source I should ad hoc to use correct app
<shevy>
yeah let's see
<shevy>
I assume that perhaps it comes from: tool/config.guess:# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
jespada has joined #ruby
rbennacer has quit [Remote host closed the connection]
<Aderium>
btw how do you clean a previous configure ?
<shevy>
configure.in:AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
<shevy>
"make distclean" should work or "make clean", but perhaps you may have to re-run autoconf
<Aderium>
make: Fatal error: Don't know how to make target `distclean'
<shevy>
like sh autogen.sh ... or autoreconf something
<shevy>
tried make clean as well?
<Aderium>
same thing
<shevy>
huh
<shevy>
works for me, though I did not have any error during configure so perhaps it did not generate any important files since it broke early for you
<Aderium>
k cleaned :)
<MagePsycho>
:(
hanyn has joined #ruby
hanynowsky has quit [Read error: Connection reset by peer]
<Aderium>
alright so where do I nano ? tool/config.guess ?
<shevy>
"autoconf" also could be tried, but first you have to find that weird entry where uname is used rather than isainfo
haxrbyte has quit [Read error: Connection reset by peer]
enebo has quit [Client Quit]
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
poguez_ has joined #ruby
skyrocker has joined #ruby
j_mcnally has joined #ruby
skyrocker has left #ruby [#ruby]
<MagePsycho>
[k-: was that for me?
MatrixBridge has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
<[k->
yes
MatrixBridge has joined #ruby
tagrudev has quit [Remote host closed the connection]
Sehryn has joined #ruby
zacstewart has quit [Remote host closed the connection]
IrishGringo has joined #ruby
senayar has quit [Remote host closed the connection]
erowlin has joined #ruby
senayar has joined #ruby
lxsameer has quit [Quit: Leaving]
mesamoo has joined #ruby
<MagePsycho>
so rubby convention is to use snake case for both variable and function?
hinbody has joined #ruby
momomomomo has joined #ruby
<adaedra>
yes
but3k4 has joined #ruby
axl__ has joined #ruby
<adaedra>
and CamelCase for classes/modules names
haxrbyte_ has quit [Ping timeout: 256 seconds]
<adaedra>
and UPPERCASE for constants
jonathanwallace has joined #ruby
<MagePsycho>
good to know
<MagePsycho>
[k: can you explain when you say: Logger pls
yeticry has quit [Read error: Connection reset by peer]
quimrstorres has joined #ruby
j_mcnally has quit [Ping timeout: 248 seconds]
juanpablo_ has joined #ruby
<[k->
A logger is a dedicated object that will handle outputting messages (information, debug, warnings, errors) to a file/descriptor
<MagePsycho>
[k-: any example
but3k4 has quit [Client Quit]
but3k4 has joined #ruby
tkuchiki has joined #ruby
<konsolebox>
anyone using camel-case for functions, attributes and variables? (i don't of course)
<[k->
Logger.error "Unexpected value: -3"
quimrstorres has quit [Remote host closed the connection]
<yorickpeterse>
konsolebox: Ruby standard is snake_case for methods/variables/etc
quimrstorres has joined #ruby
<konsolebox>
yorickpeterse: yes i just wonder if anyone does
<yorickpeterse>
and PascalCase for constants
werelivinginthef has joined #ruby
edwinvdgraaf has joined #ruby
but3k4 has quit [Client Quit]
zacstewart has joined #ruby
evanjs has joined #ruby
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
j_mcnally has joined #ruby
duggiefresh has joined #ruby
bruno- has joined #ruby
zeeraw has joined #ruby
arturaz has quit [Ping timeout: 256 seconds]
<MagePsycho>
fp = File.new("#{mageDir}/var/dp-repair-tool-#{mageVersion}.html", "a+") -> why the new file is not being created
koos303 has joined #ruby
scripore has joined #ruby
<MagePsycho>
puts "#{mageDir}/var/dp-repair-tool-#{mageVersion}.html" -> shows correct value
gard has quit [Ping timeout: 248 seconds]
<[k->
does the file exist before the method call?
charliesome has quit [Quit: zzz]
c355E3B has joined #ruby
arup_r_ has quit []
bungoman has quit [Remote host closed the connection]
zeeraw has quit [Client Quit]
victortyau has joined #ruby
nathanstitt has joined #ruby
<MagePsycho>
nope
tkuchiki has quit [Remote host closed the connection]
Toska has quit []
<MagePsycho>
should it supposed to create on the fly
bungoman has joined #ruby
NeverDie has joined #ruby
charliesome has joined #ruby
Timba-as has quit [Quit: Be back later ...]
bffff_ has joined #ruby
<MagePsycho>
[k-: sorry that works but folder is not beiing created
<MagePsycho>
only file is created
edwinvdgraaf has quit [Remote host closed the connection]
<MagePsycho>
how to create folder as well if that doesn’t exist
<adaedra>
FileUtils.mkdir
surs1 has joined #ruby
edwinvdgraaf has joined #ruby
<[k->
adaedra to the rescue!
Aswebb_ has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
<shevy>
MagePsycho make sure to do require 'fileutils' on the top
surs has quit [Ping timeout: 246 seconds]
dopie has joined #ruby
ta has joined #ruby
blackmes1 has joined #ruby
chthon has joined #ruby
<MagePsycho>
does order matter? before require mechanize or after?
<[k->
it shouldn't matter
sshuff has joined #ruby
<MagePsycho>
didn’t work No such file or directory -
sigurding has quit [Quit: sigurding]
<[k->
(in this case)
<[k->
?context
<ruboto>
Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
Igorshp has quit [Remote host closed the connection]
<shevy>
sorry
<shevy>
wrong case
Burgestrand has quit [Quit: Burgestrand]
<shevy>
I hate shell scripts
<momomomomo>
I love them
<shevy>
I assume it must be this value:
<shevy>
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}"
jimmythehat has quit [Ping timeout: 248 seconds]
<shevy>
so I guess that, whatever it is returning for these, that case is not handled by that gigantic shell case menu
JMoir has joined #ruby
<shevy>
that spans around 1000 lines ...
abuzze has quit [Remote host closed the connection]
MichaelGG_ is now known as MichaelGG
momomomomo_ has joined #ruby
msnyon has joined #ruby
<Aderium>
Yeah I went thorugh them but I cant seem to see where for a solaris != sparc it uses the uname command which I need to substitute with isainfo
<shevy>
hmm
<Aderium>
or maybe can I in the ./configure just state it ?
<Aderium>
like -- somthing
<shevy>
you can try that
mando has quit [Ping timeout: 256 seconds]
<Aderium>
whats the correct command ? i dont know
<shevy>
nono, I think you can just edit "configure" perhaps
yihsiaol has joined #ruby
<shevy>
# Name of the host.
<shevy>
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
fantazo has joined #ruby
tubuliferous_ has joined #ruby
<shevy>
awww
<Aderium>
in configure ?
<shevy>
yeah
<MagePsycho>
shevy: why you hate shell scripts, this script is part of my shell script :)
<shevy>
MagePsycho I find them an unreadable and unbearable mess
neredsenvy has joined #ruby
<MagePsycho>
from shell script i will be calling ruby script for web form submisstion
senayar has quit [Remote host closed the connection]
<MagePsycho>
shevy: if you follow some boilerplate then it will be interesting
Igorshp has joined #ruby
momomomomo has quit [Ping timeout: 250 seconds]
momomomomo_ is now known as momomomomo
senayar has joined #ruby
pfish has joined #ruby
<shevy>
Aderium I think the more sustainable way would be to modify the part wherever that uname creeps into configure, and run autoreconf; it should be either configure.ac or configure.in
<Aderium>
already modified line 1393 with uname -m = `(isainfo -n) 2>/dev/null || echo unknown` so its somewhere else
chinmay_dd_ has joined #ruby
<MagePsycho>
of course ruby does much more than shell thats why chef cookbooks are there
chinmay_dd has quit [Read error: Connection reset by peer]
<shevy>
Aderium yeah there are several uname entries
theahindle is now known as THEahindle
chinmay_dd_ is now known as chinmay_dd
<neredsenvy>
I run my ruby/json parser script it throws an error in console but since it outputs the contents of json file as well (not by my request) it only shows last two lines of the exception. So I don't know exactly what went wrong.
<shevy>
keep good track of the errors you get Aderium
<shevy>
so that nobu can change the build system lateron
<havenwood>
nice, new error
ItSANg___ has quit [Read error: Connection reset by peer]
<Aderium>
Will do
ItSANgo_ has joined #ruby
<Aderium>
ok looks like now its a compiler thing
<Aderium>
not sure why its looking for C , should all go gcc
<shevy>
havenwood lol
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
erowlin has quit [Client Quit]
tjohnson has joined #ruby
sharpmachine has joined #ruby
hotpancakes has quit [Ping timeout: 248 seconds]
<havenwood>
shevy: New error is great here. Got past the socket problem from yesterday! :)
ta has joined #ruby
<shevy>
Aderium not sure whether autoreconf can work here, probably one has to modify configure.ac or something...
blaines has quit [Ping timeout: 255 seconds]
theery has joined #ruby
IrishGringo has joined #ruby
<shevy>
configure still has those hardcoded uname entries right? and you say that these are wrong so perhaps autoreconf it can not work because of that
<Aderium>
I think the issue now is that its looking for a C compiler and not a gcc ?
<shevy>
because if you could, you could put the proper command there
<tuor>
brotspinne, ok.. It works, but why do I need it?
olistik has quit [Remote host closed the connection]
<Aderium>
yeah via isainfo yes
casadei_ has joined #ruby
<brotspinne>
tuor: but it's better to use a block like File.open(...) do ... end because the end will close the file automatically
<shevy>
ok good
symm- has joined #ruby
<shevy>
so perhaps a new entry should be added to the case menu
<adaedra>
Aderium: you know, if your problem is just uname – write a small script that returns correct values, name it uname, and place it higher in $PATH
olistik has joined #ruby
<shevy>
and rather than UNAME, some isainfo thing should be used
<tuor>
brotspinne, ah ok.
<shevy>
aha that is also a solution from adaedra :)
revath has joined #ruby
<Aderium>
well except there are 3 times the uname is used that it is correct... I
<shevy>
hehe
<adaedra>
I'm still thinking there may be a configuration option for that though.
<brotspinne>
tuor: the writes will be buffered sometimes. depends on what you write and how much.. only when the file is closed or flushed, everthing will be written. it could also help to do file.puts which adds a line break
<tuor>
brotspinne, ah that's the reason.
malconis has joined #ruby
<shevy>
brotspinne and flughafen - the two coolest nicks here
<brotspinne>
uffjdn
Timba-as has joined #ruby
tkuchiki has joined #ruby
ta has quit [Remote host closed the connection]
dfockler has joined #ruby
<tuor>
so, when I close the file, I can't work anymore with this file-object? What do I do, when I want to work multiple times with the same file?
olistik has quit [Ping timeout: 246 seconds]
t0rrieri_ has joined #ruby
yeticry has joined #ruby
<Aderium>
I think whet I autoconf it brought everythning back ......
<brotspinne>
tuor: you use File.open ... do ... end and within the block you can write how often you like
dgutierrez1287 has quit [Ping timeout: 250 seconds]
russellw has quit []
xkef has quit [Ping timeout: 264 seconds]
<tuor>
brotspinne, ah right ::new is not exactly the same.
olistik has joined #ruby
<tuor>
OK thx for your help brotspinne & jhass :)
werelivinginthef has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
n008f4g_ has quit [Ping timeout: 264 seconds]
mrconfused has quit [Ping timeout: 240 seconds]
dojobo has joined #ruby
<dojobo>
hello
jhack has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dojobo>
i'm getting "no such file or directory" with open-uri (using a local path, not a url) even though i can cat the very same path just fine. ideas?
revath has quit [Ping timeout: 246 seconds]
<dojobo>
(also, the script worked fine in windows, now i am trying to run it in linux--with an appropriate filepath of course)
hmnhf has joined #ruby
theery has quit [Remote host closed the connection]
j_mcnally has joined #ruby
erowlin has quit [Quit: erowlin]
aganov has quit [Remote host closed the connection]
n4t3 has joined #ruby
Scroff has quit [Remote host closed the connection]
<adaedra>
using file:///... ?
dEPy has quit [Ping timeout: 256 seconds]
ddarkpassenger has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf has quit [Quit: gn]
<shevy>
dojobo and File.exist?(path_here) returns true?
<n4t3>
Hi, does anybody know if I can create a destructive method for a class of mine?
<shevy>
I don't think you can easily destroy objects
<shevy>
you could perhaps poke through ObjectSpace and grab the rogue object by its ankles :)
<n4t3>
Maybe I meant to say bang method. Can't really tell the difference.
<tuor>
it's working :).
revath has joined #ruby
<tuor>
good night.
zacstewart has quit [Remote host closed the connection]
erowlin has joined #ruby
<shevy>
actually I don't know how to remove an object from ObjectSpace... is that even possible?
tuor has left #ruby ["bye"]
<shevy>
well a bang method just has a trailing '!'
surs2 has joined #ruby
Scroff has joined #ruby
<shevy>
other than that, it is not special. you can have it do anything
<n4t3>
I know, but I want it to modify the object like chomp! or strip! does.
<shevy>
yeah ok so you want to modify it in place
<ljarvis>
n4t3: what do you want help doing exactly? just modify the object in place. Be sure to provide a non bang version too :)
<shevy>
.chomp! and .strip! have it easy, String objects have the replace() method so you can replace the object
<n4t3>
And if it's my own class, not a String?
jespada has quit [Quit: WeeChat 1.1.1]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit []
<ljarvis>
you just mutate the variables as you normally would
<Aderium>
and we are configuring .... !!!!!!!
<ljarvis>
maybe we could help if you provided some code, n4t3
<shevy>
Aderium really??? how did you manage
<shevy>
or rather what files did you have to modify
<Aderium>
ill post in a minute, only 4 lines
<Aderium>
I did not realize that /bin/arch needed to be /usr/bin/arch
surs1 has quit [Ping timeout: 256 seconds]
<Aderium>
that was one of them
<shevy>
aha
<n4t3>
shevy: I want to replace the entire object in place.
revath has quit [Ping timeout: 252 seconds]
JoshL has quit []
<shevy>
n4t3 yeah, if it's a String then it would be easy :)
<dojobo>
thanks shevy and adaedra, was afk for a few, will try those
chipotle has joined #ruby
<Aderium>
still need to see if it actualy compiles 64
<ruboto>
Ox0dea # => [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fiz ...check link for more (https://eval.in/396389)
<Ox0dea>
I do shit like that for giggles. :)
havenwood has quit [Ping timeout: 255 seconds]
<apeiros>
Ox0dea: I think most people asking about "non-alphanumeric" have little trouble to understand that it means "no letters or numbers". their problem usually is related to the context where you don't want letter or numbers ;-)
spider-mario has quit [Remote host closed the connection]
<eam>
I read that as asking about the data, not the name of the symbol referencing it
<apeiros>
eam: yeah, did so too when they asked a similar question and was rather confused as it didn't make sense in the case of that question :)
<Ox0dea>
Forgive my ambiguity, then. I had hoped explicitly mentioning $$ might have clarified the matter.
<eam>
makes sense with context :)
Rollabunna has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has quit [Quit: Quit]
<dfockler>
Ox0dea: I really liked the division to get 1
mleung has joined #ruby
<eam>
what's the context of 'random' here, what's it being used for?
<Ox0dea>
eam: Randomness.
<Ox0dea>
A linear congruential generator's seed, to be more precise.
<eam>
you could use the contents of $", they will vary between systems
<apeiros>
centrx: hard to use without writing alphanumeric chars in the code ;-)
<Ox0dea>
eam: But it'll always be the same.
<eam>
Ox0dea: within a system, yes
<Ox0dea>
That's not very random.
<eam>
well, nothing will be
<Ox0dea>
The PID will be "pseudo-random".
<eam>
well, kinda, it's just incrementally increasing
<eam>
you could use time
<Ox0dea>
But how to do so without alphanumerics?
bwilson has quit [Quit: bwilson]
<Ox0dea>
There are a few Time instances in ObjectSpace at program start, but they're always the same and I don't think I could get at them besides.
<eam>
what primitives have you built so far?
<Ox0dea>
Lots and lots.
<eam>
got a list?
bsdbofh has joined #ruby
shinnya has joined #ruby
duggiefresh has quit [Remote host closed the connection]
<eam>
ok, I know how to do it
krz has quit [Quit: WeeChat 1.0.1]
<eam>
you can construct arbitrary characters by using non-alphanumeric unicode literals, then indexing as bytes (you can index with whatever integers you have in non-alphanumeric globals)
krz has joined #ruby
<Ox0dea>
That skips over the problem of seeding, no?
rbowlby has joined #ruby
<eam>
given that, I think you should be able to build the string "send" and then call arbitrary methods
<eam>
never actually using an alnum character
chouhoulis has quit [Remote host closed the connection]
<Ox0dea>
CHARS CHR COMPOSE DROP EACH FILTER FLOOR INDEX INDEXED INVERT JOIN KEYS MAP MAP_BANG MAX MERGE MIN ORD PRIME PRINT PRODUCT PUTS RANGE REDUCE REVERSE RSORT SIZE SORT SORT_BY SQRT TAKE TO_I VALUES
Azulinho has joined #ruby
<Ox0dea>
It's quite easy to construct any string, but *actually* invoking #send is, I think, not currently possible.
scripore has quit [Quit: This computer has gone to sleep]
<Ox0dea>
Non-alphanumeric Ruby is still technically Turing-complete without it, but it would make it much easier to write interesting programs.
rbowlby_ has joined #ruby
mesamoo has quit [Quit: Konversation terminated!]
bungoman has quit [Remote host closed the connection]
<Ox0dea>
$$/$$ gets you the 1 from which all other numbers can be derived, and then String#<< is how you build up arbitrary strings, since shoveling actually appends the character at that codepoint.
<eam>
you can call map? which means you can pass a symbol: &:"#{$,}"
<eam>
assuming you set $, = "method name"
<Ox0dea>
No, I've implemented MAP without alphanumerics.
<eam>
oh, so not actually map then
JMoir has quit [Ping timeout: 244 seconds]
<Ox0dea>
Not Ruby's #map, but it takes a collection and a Proc and applies the latter to every element of the former, so there's no practical difference.
<eam>
a real proc?
<Ox0dea>
A real Proc.
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t_ has quit [Read error: Connection reset by peer]
axl__ has quit [Ping timeout: 250 seconds]
<allcentury>
hi all - I'm trying to understand when variables in a block in ruby need parens, I'm not sure I understand the convention. For example I'm having to do [1, 2, 3].each_with_object(0).with_index do |(num, obj), index| but I don't understand why I need the parens
bruno- has quit [Quit: Lost terminal]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Antiarc>
In the first case, the first parameter passed is the array [num, obj]. If you want to expand that into individual variables, you pass a paren-delineated list of variables to destructure the array into
<Mon_Ouie>
^ this is the collection seen by with_index, which calls its own block with one element from that collection and the index
thiagovsk has joined #ruby
chussenot has joined #ruby
<Ox0dea>
allcentury: This should help clarify things:
JMoir has quit [Remote host closed the connection]
Jackneill has joined #ruby
hotpancakes has quit [Remote host closed the connection]
gregf has quit [Quit: WeeChat 1.1.1]
<jhass>
yeah, you get the first level for free, do |x, y| -> do |(x, y)|
<shevy>
Ox0dea you write really strange code
fgo has joined #ruby
<Antiarc>
Well, the parens are required when the value passed to the block is an array containing an array. When it's just a 1-level array, the array can be destructured with multiple params and no parens
hahuang65 has quit [Quit: WeeChat 1.2]
Rollabunna has quit [Ping timeout: 248 seconds]
Torrieri has quit [Quit: Be back later ...]
tkuchiki has quit [Remote host closed the connection]
<shevy>
_,(_,_,((_,(foo,_)),_)) is almost like ASCII art... a spaceship
<Antiarc>
Each iterated entry contains an array containing an array, and we can destructure even the deep array via the parens in the block params
DoubleMalt has quit [Read error: Connection reset by peer]
<allcentury>
Got it, thank you Antiarc
howdoicomputer has quit [Ping timeout: 264 seconds]
Rodya_ has joined #ruby
hahuang61 has joined #ruby
<Mon_Ouie>
Also notice how x = 1, 2, 3 is different from x, = 1, 2, 3 and x, y = 1, 2, 3
td has joined #ruby
blackmes1 has quit [Ping timeout: 252 seconds]
eggoez has joined #ruby
balazs has quit [Remote host closed the connection]
postmodern has joined #ruby
fgo has quit [Ping timeout: 252 seconds]
fullofcaffeine has quit [Remote host closed the connection]
jtdoncas has quit [Ping timeout: 250 seconds]
<Ox0dea>
Mon_Ouie: Reckon there's a better way to get hold of Kernel than `send[send['', 'class'], 'ancestors'][-2]`?
towski_ has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
failshell has joined #ruby
<Ox0dea>
Or Object even, where that -2 would be a -3, but I suspect I'm missing some cleverer way of getting there.
jhn has quit [Read error: Connection reset by peer]
rbennacer has quit [Remote host closed the connection]
blackmes1 has joined #ruby
<Mon_Ouie>
Not sure (nor am I sure what constitutes "better" for your purposes :p), but when you have one of those you can start using const_get instead
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<eam>
` and { are the characters surrounding a-z range in ascii
<bricker>
:) It's obvious when it's broken down
<eam>
Ox0dea: didn't realize that splat works that way, that's much nicer than ().to_a
<Ox0dea>
Oui.
<eam>
I'm going to start using that in real code
<Ox0dea>
Yay!
a346 has joined #ruby
<Ox0dea>
It's not particularly uncommon.
mando has joined #ruby
<eam>
the precedence of .. is super frustrating
<eam>
Ox0dea: yeah I know *, I just didn't realize its precedence was correct for ..
<Ox0dea>
eam: Well, you probably shouldn't have terribly complex expressions on either side.
pothibo has quit [Quit: pothibo]
<eam>
I write 1..10.to_a all the time :(
<Ox0dea>
Oh, right.
theery has quit []
snockerton has quit [Quit: Leaving.]
<Senjai>
Ox0dea: That ? notation needs to go
<Senjai>
:(
<Senjai>
I remember reading up on that a longgg time ago
<Ox0dea>
It might go away for 3.0.
Zai00 has joined #ruby
<eam>
noooo
fullofcaffeine has quit [Remote host closed the connection]
<Ox0dea>
I'd also prefer it didn't.
jonathanwallace has joined #ruby
startupality has quit [Quit: startupality]
<Ox0dea>
>> ?????:?:
<ruboto>
Ox0dea # => /tmp/execpad-8e19d5c57214/source-8e19d5c57214:2: warning: string literal in condition ...check link for more (https://eval.in/396413)
<Antiarc>
bcrypt hashes are the form ${version}${rounds}${salt}{checksum}, so you always have all the information in the hash necessary to validate an input string against that hash
<Antiarc>
(since the rounds and salt are included)
dc has quit [Client Quit]
shadoi has quit [Quit: Leaving.]
<ytti>
i still want library which allows me to specify two hsahes and it'll give me xor of the hashes
monod has joined #ruby
<ytti>
just insurance against given hash being inherently broken
<ytti>
or implementation issues or sometihng
djbkd has joined #ruby
<ytti>
so even in worst case, i have plenty of time to change the combo
bronson has joined #ruby
tvw has quit [Ping timeout: 250 seconds]
Limix has quit [Ping timeout: 264 seconds]
<Senjai>
znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
pengin has joined #ruby
<Senjai>
And it's fairly secure
bungoman has joined #ruby
<JMoir>
Hello, probably a stupid question, I'm new to ruby (and sadly testing too!), but how would I test a form that created an entry in a database? I'm testing with Test::Unit and using Sinatra.
nofxx has joined #ruby
<Senjai>
JMoir: ?code
<Senjai>
?code JMoir
<ruboto>
JMoir, We can't help you without your code, please post it to https://gist.github.com
<Antiarc>
ytti: I'm not quite sure what you mean there; you can xor two strings pretty trivially though?
<dudedudeman>
JMoir: are you like... me? because i'm sitting here working on the same thing
<Senjai>
Bleh, this vs helpa
axl_ has quit [Quit: axl_]
<JMoir>
I dont have code for this yet, I don't know what to put, that's the problem. I've looked in all the docs I can and searched high and low but I can't find a method of testing for database additions
shadoi has joined #ruby
<ytti>
Antiarc, usuually differnet algos give ifferent otput length
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
multi_io has quit [Ping timeout: 265 seconds]
mujou has joined #ruby
quimrstorres has joined #ruby
<ytti>
Antiarc, it's probably ont hard, but with crypto, i'd really want someone clued to do it
<Antiarc>
JMoir: The way I think about it is - how would you test it manually?
<JMoir>
hah, really dudedudeman?
<dudedudeman>
JMoir: here's an example of how i'm testing some of my sinatra stuff right now
<Senjai>
JMoir: Write it first, then ask us. Gotta make an attempt for us to help you. A form is a concept that can mean many things
<ytti>
23:00 < Senjai> znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
<ytti>
as opppoesd to?
<dudedudeman>
no forms in that though, so it might not be helpful
<Antiarc>
ytti: Yeah, they give different lengths, but I don't quite understand the goal. What would xoring two hashes together accomplish for you, other than producing a third non-trivially-reversible string?
<ytti>
Antiarc, if one of the hashes i ssomehow broken, i don't have hurry to fix my software/platform
<Antiarc>
(or producing 0 if the strings are equal, but you can just test string equality in that case)
<Senjai>
ytti: Any kind of weak algorithm that allows you to unencrypt a string to get the original value
xkef_ has joined #ruby
multi_io has joined #ruby
<ytti>
Antiarc, i'm insuring against broken hash
<JMoir>
Antiarc: well if I were to manually test it, I'd take a look in the database and see if it was there... Ah I have an idea, I was heading at it from the wrong direction
djbkd has quit [Remote host closed the connection]
<Antiarc>
ytti: So basically just OTP-encrypting your hash?
<ytti>
Senjai, i think there is some kind of misunderstanding here
<Antiarc>
JMoir: :)
nathanstitt has joined #ruby
<Senjai>
ytti: possibly
peter_paule has joined #ruby
<ytti>
Senjai, being reversible and being hash does not mean weak and strong
<Antiarc>
That's how I generally think about testing - "how would I do this manually?", and then translate that into code
<ytti>
Senjai, all hashes are irreversible
<toretore>
Senjai: bcrypt is recommended over other hashing algorithms because it takes a longer time to run
<Senjai>
Yes, by definition.
<ytti>
Senjai, but that does not mean they are 'stronger' than reversible
<ytti>
it's just totally different use-case
bronson has quit [Ping timeout: 256 seconds]
<shevy>
irreversible is such a strong word
<JMoir>
Cheers Antiarc xD Sometimes it helps to have someone phrase the problem in a different way to realise how blind you are, haha
xkef has quit [Ping timeout: 244 seconds]
bungoman has quit [Ping timeout: 255 seconds]
<ytti>
Antiarc, otp-encryptiong your hash sounds contrieved, i just want xor of two hashes, to buy insurance :)
<ytti>
shevy, i disagree
<dudedudeman>
i'd also like to pose a question. I am running the follow test code, and I get a nomethoderror on line 66, where it tells me i have an undefined methods 'destroy!' for nilclass. What the bleep am i missing ? https://gist.github.com/anonymous/97695895483174a84b8d
<Antiarc>
JMoir: I find the best way to solve a problem is to ask a question in a public forum and then look foolish when asking the qeustion reveals the answer :D
<shevy>
ytti finnish is such a strong language!
howdoicomputer has joined #ruby
<Senjai>
dudedudeman: Todo.last is returning nil
<ytti>
shevy, if you take arbitrary amount of data and turn it to fixed size of data
<Senjai>
dudedudeman: @todo.save may have failed
<Ox0dea>
shevy: If I tell you I did some arithmetic and arrived at the number 3, could you tell me what I did to get there?
<Antiarc>
ytti: xor'ing one string with another string is effectively just a one-time pad encryption
<ytti>
shevy, it's very safe to say it's irreversible
<shevy>
i-r-r-e-v-e-r-s-i-b-l-e
<Antiarc>
(just make sure your crypttext length matches your plaintext length)
serivich has quit [Ping timeout: 244 seconds]
<shevy>
Ox0dea if you mean by code then I am unable to decipher your extremely advanced brainfuck code sorry
<shevy>
the _,(_,_,((_,(foo,_)),_)) monad
<ytti>
shevy, aah, sorry, i'm slow
<Senjai>
Ox0dea: I could tell you -a- solution :P
<ytti>
i blame the the rose
<shevy>
the the the rose!
<ytti>
Antiarc, that is entirely reasonable way to look at it
<JMoir>
Antiarc: Very true, unfortunately! haha
momomomomo_ has joined #ruby
<ytti>
Antiarc, bottom line is, i wantsies such library, written by people who understand something about crypto, which i a not
<shevy>
dudedudeman oops you asked a question... I missed that. lemme see...
<dudedudeman>
ok, well that makes sense. i Put a @todo = Todo.new in that mehtod, and it passes no issues. But, I have an entire setup method in the beginning of my test class that defines @todo. Shouldn't that mean that it shouldn't return nil?
<ytti>
Antiarc, to me it seems so obviously right way to store your user passwords, why take risk, when insurance costs ~nothing
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<Senjai>
ytti: Todo.last hits the database...
<Senjai>
sorry, dudedudeman ^
<Senjai>
not ytti
fantazo has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
<dudedudeman>
ayy. ok
<shevy>
ok so somewhere in your code, @todo becomes nil dudedudeman
<toretore>
dudedudeman: are you using ActiveRecord?
<dudedudeman>
toretore: yes. not rails
Scroff has quit [Remote host closed the connection]
<toretore>
dudedudeman: you should be using save! in your tests
lkba_ has joined #ruby
<dudedudeman>
and not just save
<dudedudeman>
?
segfalt has joined #ruby
<toretore>
now it will fail silently
<Antiarc>
ytti: Well, what does it get you? Can you rely on your crypttext not being compromised? This sounds a lot like the "pepper" argument, which AFAIK, is not really considered to be all that valuable a defnese defense these days
<toretore>
and that's why you're having the problem you are right now
<ytti>
Antiarc, lets say i do it for bcrypt and scrypt
AndChat-43764 has joined #ruby
<ytti>
Antiarc, or bcrpyt and pbkdf2
<ytti>
Antiarc, if it turns out one of them is inherently broken
lkba has quit [Read error: Connection reset by peer]
<ytti>
Antiarc, or my implementation of it
<Antiarc>
Oh, I see, you're hashing two different times then combining the hashes
<dudedudeman>
toretore: why's that? (not arguing, genuinely curious and learning)
<Antiarc>
ytti: The argument against that is that you're supposed to set the iterations for your hash function to the maximum level tolerable in your environment (ie, how long your users can wait)
<Antiarc>
If your user can wait 2 sec for password verification, then you set bcrypt to take roughly 2 seconds worth of rounds on your current hardware
<dojobo>
i'm failing to load nokogiri on a cron job
<Antiarc>
If you mix bcrypt + scrypt then you have to dilute each to do 1 second's worth of rounds
<dojobo>
i'm using rvm with 2.1 so it should work?
lkba_ has quit [Ping timeout: 256 seconds]
<toretore>
dudedudeman: setup is only for setting up what's common for all your test methods
<Antiarc>
It is a good idea to protect against catastrophic hash failure, but it comes with a pretty big tradeoff
<Antiarc>
(If validation speed isn't a substantial concern, then you could certainly have a very strong number of rounds for both hash functions, which would provide excellent insurance)
<havenwood>
dojobo: Using wrappers?
znn has quit [Ping timeout: 256 seconds]
surs4 has quit [Ping timeout: 264 seconds]
mjuszczak has quit []
<dojobo>
yeah, my rvm path seems to be ~/.rvm
<dojobo>
(in crontab i'm using the absolute path though, not ~)
codecop has quit [Remote host closed the connection]
<ytti>
Antiarc, i don't think that is fair argument
bsdbofh has quit [Quit: bsdbofh]
<Antiarc>
Plus, if someone knows that you're mixing the two hash functions, and they get your hashes DB, then they can literally parallelize the work necessary to break the hash - 1000 rounds of scrypt can run in one thread, while 1000 rounds of bcrypt can run in another thread, then you mix the two results. This would take half the time of running 2000 rounds of either, assuming roughly equal runtime.
<ytti>
Antiarc, if your margin is 50% of cpu time, you're fucked :)
<dojobo>
i'm gonna try 2.0 in case there's some funkiness with the 2.1/nokogiri install
christiandsg has quit [Read error: Connection reset by peer]
<ytti>
Antiarc, if they get my DB
<Antiarc>
I'm just regurgitating what I've read on the topic, I'm not a cryptologist :)
<centrx>
*gurgle*gurgle*gurgle*
baweaver has joined #ruby
<shevy>
lol
christiandsg has joined #ruby
<shevy>
thank you for the audio support centrx
<ytti>
Antiarc, they dont even know what the hash is for scrypt or bcrypt
jonathanwallace has quit [Quit: Leaving.]
Renich has joined #ruby
<dudedudeman>
toretore: ah, thank you. ok i cleaned that up and things aren't being slung around everywhere
<ytti>
Antiarc, because they'd need to know one of them, to recover the other
<ytti>
Antiarc, so before they can even start bruteforcing they have to know one of the
towski_ has quit [Remote host closed the connection]
kobain has joined #ruby
<Antiarc>
Assuming they know the input is scrypt(pw) ^ bcrypt(pw), you don't have to know one or the other - you can compute them in parallel for each attempt
<Antiarc>
(And you should never rely on your implementation being secret to ensure security)
aryaching has quit [Ping timeout: 248 seconds]
ta has joined #ruby
<Antiarc>
There's also a Huge Freakin Issue with that approach in that you can't progressively upgrade your rounds
eGGsha has joined #ruby
<Antiarc>
And I'm not even sure how you'd reverse that outside of storing the salts for each adjacent to the PW
<Antiarc>
So you'd have to store the salts and rounds for each hash adjacent to the hash itself if you wanted to validate and progressively upgrade
* dudedudeman
raises the roof
<ytti>
Antiarc, you raise rounds by asking customer to change password
kobain has quit [Max SendQ exceeded]
<ytti>
the margin of hash should be like 'oh it takes age of universe now'
blackmes1 has quit [Ping timeout: 250 seconds]
<ytti>
not '50% more cpu and we're dead'
<ytti>
i'm not worried of brute force attacks
<centrx>
The universe is a figment of your imagination
kobain has joined #ruby
<ytti>
i'm worried implementation or algo being inherently broken
frem has joined #ruby
<ytti>
i'll gladly make brute force 2x easier (i don't agree it does) to gain insurance for broken algo
_ht has quit [Quit: Konversation terminated!]
s2013 has joined #ruby
leonardoajim has joined #ruby
djbkd has joined #ruby
ta has quit [Remote host closed the connection]
MagePsycho has joined #ruby
<Antiarc>
ytti: You can't validate the PW if you don't know how many rounds were used to crypt the hash, and xoring destroys that information unless you store it adjacent
Scroff has quit [Ping timeout: 252 seconds]
Rodya_ has joined #ruby
<ytti>
Antiarc, don't worr yabout that
jaycee has joined #ruby
<ytti>
Antiarc, you'll add the meta information in the headers
<ytti>
Antiarc, $version$salt1$salt2$xor_result
<ytti>
from version you know your implementaiton
<ytti>
which algos, whihc algo parameters etc
mando has quit [Ping timeout: 255 seconds]
evanjs has quit [Remote host closed the connection]
blackmes1 has joined #ruby
evanjs has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
drewo has quit [Ping timeout: 256 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
revath has quit [Ping timeout: 256 seconds]
pdoherty has quit [Ping timeout: 256 seconds]
djbkd has quit [Remote host closed the connection]
drewo has joined #ruby
sharpmachine has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
hanmac has quit [Ping timeout: 256 seconds]
<Ox0dea>
Has it been mathematically verified that salt is the best condiment for hashes?
Rodya_ has quit [Quit: Leaving...]
Kully3xf has quit [Ping timeout: 255 seconds]
Limix has joined #ruby
Rodya_ has joined #ruby
Matadoer has joined #ruby
eggoez has joined #ruby
evanjs has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
momomomomo_ has joined #ruby
jonathanwallace has joined #ruby
<jhass>
no, that's trivial
momomomomo has quit [Ping timeout: 264 seconds]
momomomomo_ is now known as momomomomo
blackmes1 has quit [Ping timeout: 240 seconds]
CorySimmons has joined #ruby
mjuszczak has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gix has joined #ruby
<Ox0dea>
Is it? Some cursory research into the matter seems to indicate that cryptologists haven't even tried most of the other options.
aaeron has quit [Quit: Leaving.]
chipotle has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 1.0.1]
<jhass>
they haven't because it's trivial
yalue has quit [Quit: return 0;]
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mleung has joined #ruby
qhartman has joined #ruby
mary5030 has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
rwilcox has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mary5030 has joined #ruby
benlieb has joined #ruby
[Butch] has quit [Remote host closed the connection]
ItSAN____ has joined #ruby
benlieb has quit [Client Quit]
sharpmachine has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
ItSANgo_ has quit [Ping timeout: 246 seconds]
pothibo has joined #ruby
workmad3 has joined #ruby
startupality has joined #ruby
blackmes1 has joined #ruby
startupality has quit [Client Quit]
hanmac has joined #ruby
senayar has joined #ruby
hotpancakes has joined #ruby
sshuff has quit [Quit: Leaving]
bmurt has quit []
sharpmachine has joined #ruby
silkfox has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Ping timeout: 244 seconds]
mesamoo has quit [Quit: Konversation terminated!]
towski_ has joined #ruby
senayar has quit [Ping timeout: 256 seconds]
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
it's trivial because they haven't!
JakFrist has joined #ruby
hotpancakes has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
Exuma has joined #ruby
[Butch] has joined #ruby
Rollabun_ has joined #ruby
ndrei has joined #ruby
djbkd has joined #ruby
stantonnet has quit [Ping timeout: 248 seconds]
j_mcnally has joined #ruby
Rollabunna has quit [Ping timeout: 264 seconds]
leonardoajim has quit [Quit: Be back later ...]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Jackneill has quit [Remote host closed the connection]
x1337807x has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
fmcgeough has joined #ruby
CorySimmons has quit [Quit: Bye!]
benlieb has joined #ruby
brain_shim has quit [Ping timeout: 244 seconds]
Exuma has quit []
znn has joined #ruby
d10n-work has joined #ruby
silkfox has joined #ruby
mjuszczak has quit [Ping timeout: 244 seconds]
xkef_ has quit [Ping timeout: 244 seconds]
Nahra has joined #ruby
mjuszczak has joined #ruby
mase-chatter has joined #ruby
dagda1_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lucky___ has joined #ruby
dellavg has quit [Ping timeout: 264 seconds]
phutchins2 has joined #ruby
aaeron has joined #ruby
Zai00 has joined #ruby
dagda1 has joined #ruby
mando has joined #ruby
ldnunes has quit [Quit: Leaving]
dh64 has joined #ruby
christiandsg has quit [Remote host closed the connection]
casadei_ has quit [Remote host closed the connection]
bungoman has joined #ruby
mleung has quit [Quit: mleung]
OffTheRails has joined #ruby
znn has quit [Quit: Lost terminal]
c355E3B has quit [Quit: Connection closed for inactivity]
blackmesa has joined #ruby
xkef has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has quit [Ping timeout: 264 seconds]
JMoir has quit [Quit: Lost terminal]
bungoman has quit [Ping timeout: 255 seconds]
olistik has joined #ruby
FernandoBasso has joined #ruby
christiandsg has joined #ruby
beef-wellington has joined #ruby
mando has quit [Quit: “”]
havenwood has quit [Ping timeout: 246 seconds]
bungoman has joined #ruby
silkfox has quit [Ping timeout: 264 seconds]
blackmes1 has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
fmcgeough has quit [Quit: fmcgeough]
zanloy has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 255 seconds]
jonathanwallace has quit [Quit: Leaving.]
<shevy>
today is sleepy day
jonathanwallace has joined #ruby
willywos has joined #ruby
Limix has quit [Quit: Limix]
bruno- has joined #ruby
segfalt has quit [Quit: segfalt]
pothibo has quit [Quit: pothibo]
surs1 has joined #ruby
allcentury has joined #ruby
<shevy>
hmm .index() finds when the match is 100%
<shevy>
but is there a way to have it find the index for the most-likely match candidate? for instance, if an array has one entry called 'foobar', and my search term would be 'oba'
<adaedra>
yeah, maybe a bit too much advanced yet, not even sure I could do that in C :p
giuseppesolinas has joined #ruby
<ytti>
even in c it'll be terribad if you try to just open udp socket
<ytti>
and read/write there
<ytti>
you must pretty much bypass the OS
<dfockler>
That's why Wireshark is one of the few, it's pretty tough to get to that point
<ytti>
wireshark is for completley other case use than what ineed
<ytti>
ineed program, which i start in two ends
<ytti>
and it'll tell throughput between them
<ytti>
packet loss, jitter and lantecy
<ytti>
kinda like iperf or thrulay
<ytti>
but one which actually works
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
centrx has quit [Remote host closed the connection]
bodgix_wrk has left #ruby [#ruby]
davedev24_ has joined #ruby
<ex0ns>
Sounds to be an advanced topic
omegahm has joined #ruby
magical-imouto is now known as ninja-maid-robot
zacstewart has quit [Remote host closed the connection]
mjuszczak has joined #ruby
<adaedra>
there will surely be a latencyctl tool to cover that in systemd soon.
[k- has quit [Ping timeout: 256 seconds]
Pupeno has quit [Remote host closed the connection]
zacstewart has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<jhass>
adaedra: write cinch for rust ;P
<adaedra>
ahah
zacstewart has quit [Read error: Connection reset by peer]
brain_shim has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
hinbody has quit [Quit: leaving]
scripore has joined #ruby
t_ has quit [Ping timeout: 250 seconds]
lxsameer has quit [Quit: Leaving]
momomomomo has quit [Quit: momomomomo]
MagePsycho has joined #ruby
chipotle has joined #ruby
MagePsycho has quit [Client Quit]
bruno- has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
davedev2_ has joined #ruby
chipotle has quit [Ping timeout: 252 seconds]
davedev24_ has quit [Ping timeout: 248 seconds]
whippythellama has quit [Quit: WeeChat 1.2]
solars has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
OffTheRails has joined #ruby
zeeraw has quit [Read error: Connection reset by peer]
freerobby1 has joined #ruby
t_ has joined #ruby
jaycee has quit [Ping timeout: 256 seconds]
PlasmaStar has quit [Ping timeout: 256 seconds]
Thomas-0725 has joined #ruby
Lucky___ has joined #ruby
fgo has joined #ruby
chridal has quit [Ping timeout: 276 seconds]
freerobby has quit [Ping timeout: 264 seconds]
Azure has quit [Excess Flood]
sphex_ has quit [Ping timeout: 240 seconds]
sumark has quit [Ping timeout: 264 seconds]
pengin has quit [Remote host closed the connection]
hfp_work has quit [Ping timeout: 256 seconds]
Trynemjoel has quit [Ping timeout: 256 seconds]
Guest84916 has quit [Ping timeout: 256 seconds]
bankair has quit [Ping timeout: 256 seconds]
hotpancakes has joined #ruby
shaman42 has quit [Ping timeout: 252 seconds]
<Thomas-0725>
Hello! When using .reduce on an array that contains arrays as elements, is it necessary to use .flatten first? For example: [1, 2, 3, [4, 3, 2] ].flatten.reduce(:*)
Azure has joined #ruby
<Thomas-0725>
Do I need to flatten?
sdothum has quit [Ping timeout: 264 seconds]
armyriad has quit [Ping timeout: 264 seconds]
_5moufl has quit [Ping timeout: 264 seconds]
mduk has quit [Ping timeout: 276 seconds]
LiquidInsect has quit [Ping timeout: 256 seconds]
rikai has quit [Ping timeout: 256 seconds]
sphex has joined #ruby
s00pcan has quit [Ping timeout: 252 seconds]
TTilus has quit [Ping timeout: 252 seconds]
C0deMaver1ck has quit [Ping timeout: 252 seconds]
armyriad has joined #ruby
PlasmaStar has joined #ruby
bankair has joined #ruby
axl_ has quit [Quit: axl_]
mary5030 has quit [Ping timeout: 256 seconds]
ada2358 has quit [Ping timeout: 264 seconds]
Torrieri has quit [Quit: Be back later ...]
rikai has joined #ruby
lele has quit [Ping timeout: 276 seconds]
sts__ has quit [Ping timeout: 252 seconds]
anisha has quit [Ping timeout: 256 seconds]
brandon has joined #ruby
LiquidInsect has joined #ruby
sumark has joined #ruby
shaman42 has joined #ruby
sts_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
brandon is now known as Guest70962
sts_ is now known as Guest97074
<jhass>
it always depend on your usecase, but in this case you'd want to, yeah
TTilus has joined #ruby
jenrzzz has joined #ruby
zata has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
_5moufl has joined #ruby
s00pcan has joined #ruby
Sehryn has quit [Ping timeout: 248 seconds]
zata has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
Trynemjoel has joined #ruby
chridal has joined #ruby
C0deMaver1ck has joined #ruby
lele has joined #ruby
ItSANgo has joined #ruby
peter_paule has quit [Ping timeout: 246 seconds]
hotpancakes has quit [Ping timeout: 246 seconds]
C0deMaver1ck is now known as Guest63957
hfp_work has joined #ruby
mduk has joined #ruby
ItSAN____ has quit [Ping timeout: 265 seconds]
finisherr has quit [Quit: finisherr]
senayar has quit [Ping timeout: 256 seconds]
arooni-mobile has joined #ruby
arooni-mobile has quit [Max SendQ exceeded]
peter_paule has joined #ruby
ada2358 has joined #ruby
arooni-mobile has joined #ruby
xkef has quit [Ping timeout: 264 seconds]
whiteline has quit [Ping timeout: 256 seconds]
Pupeno has quit [Remote host closed the connection]
ItSANgo__ has joined #ruby
ItSANgo has quit [Ping timeout: 244 seconds]
tsvenson has joined #ruby
dgutierrez1287 has joined #ruby
[Keith] has quit [Ping timeout: 244 seconds]
nathanstitt has quit [Ping timeout: 246 seconds]
[Keith] has joined #ruby
pengin has joined #ruby
_blizzy_ has joined #ruby
dfockler has quit [Remote host closed the connection]
peter_paule has quit [Ping timeout: 256 seconds]
<nofxx>
Anyone using couchrest ? Can't find where pass some parameters to rest-client. ssl_cert_key or ssl_verify
dgutierrez1287 has quit [Ping timeout: 248 seconds]
arashb has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: zzz]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]