<neachdainn>
Hey all. I'm trying to write a function that can take either a Hash or a Symbol. How do I detect if something is a symbol and, if it is, convert it to {:Symbol => nil}?
<nymous>
havenwood: you mean just borrow a piece of puma?
lxsameer has quit [Ping timeout: 255 seconds]
<nymous>
not a well programming practice though
<neachdainn>
nymous: Is that idiomatic Ruby?
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marr has quit [Ping timeout: 248 seconds]
<neachdainn>
I thought Ruby was more Duck typing than that.
<nymous>
neachdainn: a = :a; a.is_a?(Symbol)
MrBusiness has joined #ruby
<havenwood>
nymous: well, it's a battle-tested, general purpose thread pool: require 'puma/thread_pool'
cdg has joined #ruby
<havenwood>
I'd like it if there were one in the stdlib.
<nymous>
i don't feel like i want to have a dependency on http server for running a cli script
<havenwood>
sure
<havenwood>
nymous: you're running into all three issues? yikes
ap4y1 has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
cdg has quit [Ping timeout: 248 seconds]
CrazyEddy has joined #ruby
RickHull has joined #ruby
<havenwood>
nymous: well, it seems worth fixing those issues
<nymous>
i'd want to be able to control threads in the thread pool
<havenwood>
control them how?
<nymous>
not just killing them all
<havenwood>
how, other than killing the dead ones?
<havenwood>
what do you want to do?
<havenwood>
like stats on them or?
<nymous>
like with countdownlatch
<RickHull>
why do we call the dynamic region of address space "the heap"? how is it related to a heap data structure, as in heapsort?
<nymous>
i mean, if i pass 10 threads to a pool, 3 of them stuck
<RickHull>
i've been reviewing on wikipedia and google, and it's not quite apparent
jaruga has joined #ruby
down has joined #ruby
<nymous>
i'll get released from latch by timeout
kies has quit [Remote host closed the connection]
<nymous>
but but but
<nymous>
3 stuck threads would remain stuck
<nymous>
and i don't know any good option on how to kill them without killing the whole pool
PresidentBiscuit has joined #ruby
down has quit [Remote host closed the connection]
kies has joined #ruby
5EXAALCIP has quit [Quit: 5EXAALCIP]
<nymous>
RickHull: if you familiar with assembly language, that's easy. you have static memory, which is allocated on compile time, and dynamic - which is allocated by OS by request
down has joined #ruby
<RickHull>
right -- so how does that relate to a heap data structure?
<imode>
it doesn't.
__Yiota has joined #ruby
<imode>
kind of a confusing nomenclature.
<RickHull>
that's kind of what I've been leaning towards
<imode>
essentially, memory is leased out to a given program in blocks dependent on the allocation strategy that the OS uses.
<RickHull>
in program address space, the stack area is for the call stack, which clearly relates to the stack data structure
<imode>
intel's MMU makes this really easy. the heap datastructure is just used for sorting frequently used or least used elements. very different.
ap4y1 has quit [Quit: WeeChat 1.9.1]
orbyt_ has joined #ruby
<RickHull>
perhaps the heap data structure tracks the largest segment of memory in "the heap"
<RickHull>
that just takes you (back) to C#dynamic memory mgmt
<imode>
it does, and if you go down to heap-based and click on "heap", it refers to the link I just posted. :P
<RickHull>
it's an old/invalid anchor tag
alfiemax has joined #ruby
down has quit [Client Quit]
<RickHull>
yup, lovely self referential loop
<imode>
all memory allocation essentially just relies on having a gigantic slab of free memory, segmenting it however you'd like and flagging it as "in-use".
<imode>
I remember writing my first allocator. I had to store metadata about each block, but I could resize the blocks by tweaking a macro.
<imode>
slab allocation is what the linux kernel uses iirc.
<RickHull>
i could still imagine that some layer of the implementation might use a heap to track the largest regions not in use
<imode>
it doesn't. sorry.
<imode>
"the heap" and "a heap" are two different things.
ap4y1 has joined #ruby
<RickHull>
arghlebargh
<imode>
resign yourself to the idea that the standards folks (and the rest of us that follow K&R) like to use weird terms. :P
ap4y1 has quit [Client Quit]
ap4y1 has joined #ruby
jameser has joined #ruby
<RickHull>
how long should it take to insert 999 items in a heap in ruby? more than a minute?
enterprisey has joined #ruby
<nymous>
having a little bit knowledge of assembly language make you understand many concepts behind c/c++ easier
<nymous>
i guess the whole ruby program is residing and executing in a heap
<SeepingN>
"items"
<RickHull>
say rand(999) into a max-heap
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has quit [Remote host closed the connection]
<RickHull>
and I think I've determined it's likely just waiting on the #inspect string to display
<imode>
so time it.
<nymous>
add simple puts Time.now before and after #inspect and you'll see
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alnewkirk has quit [Ping timeout: 240 seconds]
oncall-pokemon has joined #ruby
<RickHull>
the stack overflow example shows timing; it doesn't look susceptible to the #inspect issue I ran into
<RickHull>
I am seeing similar results to stack overflow
<imode>
something something profiling.
ramfjord has quit [Ping timeout: 248 seconds]
nofxx has joined #ruby
<nymous>
havenwood: puma's reaper does a little bit different thing
nofxx has quit [Read error: No route to host]
kernelPaniq has quit [Ping timeout: 246 seconds]
<nymous>
damn, i need a simple thing - push a job and check it's status afterwards
__Yiota has joined #ruby
qualityaddict has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Luyt has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Remote host closed the connection]
<nymous>
future looks good, but can't kill it
cdg has joined #ruby
latemus has quit [Ping timeout: 246 seconds]
PresidentBiscuit has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 1.9.1]
pilne has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
eckhardt has joined #ruby
chouhoulis has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
cschneid_ has joined #ruby
latemus has joined #ruby
latemus is now known as Guest25738
<nymous>
i don't get it
<nymous>
you can't even cancel a running future
nofxx has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<neachdainn>
Why does `def foo(&block) { [].push(&block) }` always return an empty list?
<Radar>
does push take a block?
<neachdainn>
I'm trying to store the block to call later
<basket>
neachdainn: Try [].push(block)
<basket>
The ampersand means to give it as a block to push
<Radar>
^&
<neachdainn>
Oooh. Thanks!
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has joined #ruby
irated is now known as pryorda
John__ has joined #ruby
<neachdainn>
Another noob question: Why does `@foo = Hash.new([]); @foo[:key].concat([12])` never update @foo?
hanmac has joined #ruby
postmodern has joined #ruby
vee__ has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
<RickHull>
you generally do something like @foo[:key] = blahblah to update the hash
jordanm_ has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
<basket>
neachdainn: You are setting the default value for @foo to an empty array. Then, you're destructively adding 12 to that default value. After h = Hash.new([]), h[:key] returns the default value list
<basket>
You push 12 to it, so now the default value is [12], h[:key] and h[:foo] and h[:asdf] will all return the same instance
<neachdainn>
So if I want the values to be arrays and I want to concat to those arrays, what's the best way to do this?
<neachdainn>
Hash.fetch?
d^sh has joined #ruby
<neachdainn>
That does seem to work
Technodrome has joined #ruby
<basket>
neachdainn: Yes, I would use Hash#fetch
AndBobsYourUncle has quit [Quit: Textual IRC Client: www.textualapp.com]
<RickHull>
you may want instead Hash.new { |hsh, key| hsh[key] = [] }
<nymous>
looks like i'll end up re-implementing thread with a reaper
<nymous>
*thread pool
<Guest25738>
i have a login shell for a unix account set to run a ruby script. if i hit ctrl C, the user logs off when the script terminates. but ruby prints an error trace to stdout first, disclosing the full path of the script. how do i disable that error trace?
<nymous>
do a rescue?
<nymous>
a trap handler?
<Guest25738>
kthx
<RickHull>
Signal.trap("INT") { puts "goodbye" }
<Guest25738>
RickHull: awesoem, thank youk
<RickHull>
you can trap SIGTERM too maybe
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
vee__ has joined #ruby
kies has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
dc3 has quit [Ping timeout: 240 seconds]
<neachdainn>
How do I have a hash retain only the specified keys?
gizmore|2 has joined #ruby
mim1k has joined #ruby
<neachdainn>
Wait. `delete`. I was looking for `remove`, `retain`, or `filter`.
gizmore has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
ledestin has joined #ruby
cdg has joined #ruby
Luyt has joined #ruby
nymous has quit [Quit: RAGING AXE! RAGING AXE!]
cdg has quit [Ping timeout: 252 seconds]
uZiel has quit [Ping timeout: 248 seconds]
alexertech has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jordanm_ has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
ap4y1 has quit [Quit: WeeChat 1.9.1]
ap4y1 has joined #ruby
<Guest25738>
i guess i should read up on signals
<Guest25738>
the time has finally come
minimalism has joined #ruby
gusrub has joined #ruby
dviola has joined #ruby
Luyt has quit [Ping timeout: 248 seconds]
shinnya has quit [Ping timeout: 252 seconds]
Luyt has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
alfiemax has quit [Remote host closed the connection]
uZiel has joined #ruby
d^sh has joined #ruby
chrisgopher has joined #ruby
SeepingN has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
xco_ has joined #ruby
xco_ is now known as xco
<xco>
how do i check the truthiness or falsiness of 1 and 0 in ruby?
CrazyEddy has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
xco has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
PaulCapestany has joined #ruby
xco has joined #ruby
imode has quit [Ping timeout: 240 seconds]
tastytf has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mjolnird has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
whippythellama has quit [Quit: WeeChat 1.4]
cschneid_ has joined #ruby
erlend has quit [Ping timeout: 246 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
xco has quit [Ping timeout: 240 seconds]
erlend has joined #ruby
jrafanie has joined #ruby
chrisgopher has quit [Remote host closed the connection]
<Guest25738>
i cant get a repl to handle SIGWINCH or SIGQUIT
<RickHull>
is there any good/reasonable way to attempt to bench ruby code in terms of ops/instructions, invariant of wall clock time?
alfiemax has quit [Ping timeout: 258 seconds]
xco has quit [Ping timeout: 258 seconds]
<RickHull>
or invariant (within reason) of the underlying hardware capability (cpu, clock speed, etc)
gix- has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
elsevero has joined #ruby
gix has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 252 seconds]
elsevero has quit [Quit: elsevero]
oncall-pokemon has joined #ruby
xco has joined #ruby
elsevero has joined #ruby
fullstack has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
imode has joined #ruby
fullstack has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Ping timeout: 252 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
xco has joined #ruby
xuanrui has joined #ruby
elsevero has quit [Ping timeout: 248 seconds]
TheRock2 has joined #ruby
<TheRock2>
Is that true ?? People in NodeJs say Ruby is not better
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has quit [Ping timeout: 252 seconds]
cschneid_ has joined #ruby
chouhoul_ has joined #ruby
Cohedrin_ has joined #ruby
nicesignal has quit [Remote host closed the connection]
impermanence has joined #ruby
nicesignal has joined #ruby
<RickHull>
TheRock2: is what true?
chouhoulis has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
<TheRock2>
They said Ruby is not as good as NodeJS and you have forgotten to implement semicolon
mim1k has joined #ruby
bauruine has quit [Ping timeout: 240 seconds]
<basket>
TheRock2: I knew we were missing something
<TheRock2>
there you go
<RickHull>
we prefer symbolcolons
<RickHull>
away with hashrockets!
mim1k has quit [Ping timeout: 258 seconds]
pilne has quit [Quit: Quitting!]
xco has joined #ruby
bauruine has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cdg has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
cdg has quit [Ping timeout: 252 seconds]
xco has quit [Ping timeout: 248 seconds]
xco has joined #ruby
qualityaddict has quit [Quit: Leaving]
xco has quit [Ping timeout: 248 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chaos95>
the solution is to use the semicolon and then write a script to preprocess all your ruby and remove trailing semicolons prior to running it
xco has joined #ruby
Guest17172 has joined #ruby
<Guest17172>
hi
<Guest17172>
Python as first programming language,is it good ?or ruby is better as first language?anyone have any experience with this matter?
<imode>
python is commonly cited as a good introductory programming language, and I used to hold the opinion that it was.
<TheRock2>
they told me the best languag is nodejs
<imode>
but ruby won me over, mainly because of the flexibility in syntax and how much it actually resembles pseudocode.
<basket>
Guest17172: They're both fine, pick whatever your friends use, or you have a book that looks good for, or flip a coin
<imode>
it's fun to sketch out ideas in ruby rather than python, and you aren't punished as much in ruby.
<basket>
Just pick something and start making things
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<basket>
That's the best way to learn; learning other languages later will be easy
<RickHull>
give it a month, then switch or stay :)
<imode>
I'd say give it a week.
<imode>
programming languages are so opinionated. :P
<Guest17172>
thank you guys,for some one learning ruby,does this room helps in getting familiar with it?
<basket>
Guest17172: Yes, you can ask anything you're having trouble with and people will help.
<TheRock2>
but how do you know the end of a line without semicolon
jinie has quit [Ping timeout: 248 seconds]
xco has quit [Ping timeout: 240 seconds]
<RickHull>
there is a character called newline
<RickHull>
a shady character indeed
jinie has joined #ruby
<TheRock2>
but im used to write my code in a single line
<vstemen>
LoL
cschneid_ has joined #ruby
<RickHull>
you can use semicolons for that
<vstemen>
TheRock2, ruby allows that.
<TheRock2>
so, i can use a semicolon in that case
DTZUZU has quit [Ping timeout: 240 seconds]
troys_ is now known as troys
DTZUZU has joined #ruby
TheRock2 has quit []
xco has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
uZiel has quit [Remote host closed the connection]
alexertech_ has joined #ruby
eckhardt has joined #ruby
<Guest17172>
i did few exercises in LPTHW but in python related irc rooms here i couldnt type and no one is tying anything,i think its good to have iwhere pople talk about language you are learning,is that right?
alexertech has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
alexertech_ has quit [Ping timeout: 260 seconds]
<basket>
Guest17172: I think in #python you need to be registered with NickServ
<Guest17172>
basket:thats why i cant see if people are typing?
<basket>
Guest17172: I think it forwards you to an entirely different room if you're not registered
CrazyEddy has joined #ruby
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
<Guest17172>
basket:it does to #python-unregistered,but i only see''he have joined the room,,ve left the room''is this because of not registering,,or people are typing anything?
<Guest17172>
are not*
<Guest17172>
^
<basket>
Guest17172: Probably just no one talks in #python-unregistered very much, I don't know. People do talk in #python
alnewkirk has joined #ruby
<basket>
Guest17172: If you don't want to register then you might as well learn Ruby so that you'll have here :)
<Guest17172>
basket:you are right i guess,what is good book for a newbie?by zed shaw,,lrthw?
mim1k has joined #ruby
apeiros_ has joined #ruby
<basket>
Guest17172: I've never read it but I've heard from some people who liked it, you should give it a shot
<Guest17172>
ty
<Guest17172>
i think i should have some tea to recharge myself
<Guest17172>
and it is Diwali today
<basket>
What is Diwali?
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<Guest17172>
India's biggest festival,festival of lights
alnewkirk has quit [Ping timeout: 240 seconds]
ap4y1 has quit [Ping timeout: 248 seconds]
mim1k has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
AnoHito has quit [Ping timeout: 248 seconds]
Guest17172 has left #ruby [#ruby]
tastytf has quit [Ping timeout: 240 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nopolitica has joined #ruby
troys has quit [Quit: Bye]
jenrzzz has quit [Ping timeout: 258 seconds]
nopolitica has quit [Client Quit]
nopolitica has joined #ruby
CrazyEddy has quit [Ping timeout: 240 seconds]
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
CrazyEddy has joined #ruby
ur5us has quit [Remote host closed the connection]
xco has quit [Ping timeout: 255 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest25738>
i see on ruby-doc.org/core-1.9.3/Time.html that i can use Time.at() to convert epoch time to a time string, but how do i convent a UTC time string to epoch time?
alex`` has quit [Ping timeout: 252 seconds]
AnoHito has joined #ruby
<Guest25738>
nm, thanks
<Burgestrand>
Guest25738 stdlib has additional methods for time, including Time.parse and Time.strptime (more strict0
dc3 has joined #ruby
<Guest25738>
Burgestrand: cool. i just saw DateTime.parse, good to know that stdlib hase the same
<Burgestrand>
Guest25738 `require "time"` to get the additional methods
<Guest25738>
kk
<Guest25738>
perfect, thank you
cschneid_ has joined #ruby
alfiemax has joined #ruby
<Burgestrand>
Guest25738 small caveat, ruby's not very good in dealing with time zones, might need a ruby gem if you want to juggle those around and convert back and forth
<Cork>
anyone know of a ipv6 cidr validation lib for ruby?
<Guest25738>
Burgestrand: np, thanks for the heads up
Immune has quit [Ping timeout: 248 seconds]
marr has joined #ruby
cschnei__ has joined #ruby
John__ has quit [Ping timeout: 252 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
imode has quit [Ping timeout: 252 seconds]
cschnei__ has quit [Ping timeout: 252 seconds]
<dminuoso>
Cork: What kind of "validation" are you looking for?
genta has left #ruby ["Leaving..."]
<Cork>
dminuoso: just that the syntax is valid
bruno- has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
<Cork>
so not something like fe80:::/64 or thinks like that
<dminuoso>
Cork: IPAddr.new
<Cork>
hmm so with a rescue then, ya ok, thx
<dminuoso>
Cork: If you prefer something without an exception. just look at its implementation - it's written in pure ruby.
mim1k has joined #ruby
<Cork>
ya, been hunting for a good regex but haven't found one that doesn't reject valid cidrs
<dminuoso>
Cork: You can't sensibly parse this with a regex I think.
cgfbee has quit [Remote host closed the connection]
<apeiros>
I shall propose that an rfc MUST contain a BNF of some sorts, lest it'll be summarily rejected!
<matthewd>
I'm sure someone somewhere has written a real one, instead of me just throwing some characters together off the top of my head
<apeiros>
matthewd: [0-9a-f] -> \h
<matthewd>
apeiros: hah, I hesitated on whether such a thing existed, but then didn't want to bother to go check :P
<apeiros>
it hasn't existed all the time iirc
enterprisey has quit [Read error: Connection reset by peer]
<apeiros>
don't know when it was added, but I'm pretty sure I had looked for it years ago and it didn't exist back then. only learnt it now does exist a few months ago.
<dminuoso>
apeiros: %r{[0-9a-f:/]+} looks good.
alfiemax has quit [Ping timeout: 240 seconds]
<apeiros>
interesting negative lookaheads :D
<dminuoso>
matthewd: What's your take on Proc#* that we have been discussion before?
<dminuoso>
Do you think a feature request would be sensible?
cschneid_ has quit [Ping timeout: 252 seconds]
<apeiros>
weeeell, I should be fixing a bug
<apeiros>
after all, I don't get paid for interesting chatter about ipv6 regexen :( (I should be, though!)
<dminuoso>
apeiros: Just find a clint in need of ipv6 regular expressions!
<apeiros>
that's a too narrow type of work I fear :<
<matthewd>
dminuoso: I think I'm just not a fan of that style of composition in general
<apeiros>
I want to be paid for all kinds of explorative programming and interesting chatter
alfiemax has joined #ruby
cgfbee has joined #ruby
<matthewd>
dminuoso: To me it's neat, but in practice I find it more confusing to have the passed-through arguments unmentioned
<dminuoso>
matthewd: I suppose it does suffer when there's no static type checking enforcing that two procs are really compatible.
<dminuoso>
(Not an attempt to complain about Ruby, but I think your point is valid)
Beams has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
paranoicsan has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
alnewkirk has joined #ruby
mjolnird has quit [Quit: Leaving]
Heph_ has joined #ruby
Freshnuts has joined #ruby
alnewkirk has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
dhollin3 has joined #ruby
href has joined #ruby
<href>
hello!
<href>
I'm bundling some server as a gem, and I'd like to expose some rake tasks of it into its own binary. How can I achieve that ?
Serpent7776 has joined #ruby
<href>
pretty much in the same way rails did on rails 5. I'm not bundling the code so can't run "rake" in production
<dminuoso>
href: check out Rake::Task#[]
<dminuoso>
err
<dminuoso>
Rake::Task.[]
<dminuoso>
&ri Rake::Task.[]
<`derpy>
No results
shinnya has joined #ruby
dhollinger has quit [Ping timeout: 252 seconds]
Freshnuts has quit [Quit: Leaving]
<href>
dminuoso: yeah. Speaking of rails5 made me think at having a look at how they did that :) looks easy, thanks
guille-moe has joined #ruby
dc3 has quit [Read error: Connection reset by peer]
dc3 has joined #ruby
alfiemax has joined #ruby
ioggstream has joined #ruby
<ioggstream>
hi @all
aufi has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
neuraload has quit [Quit: Leaving]
alex`` has joined #ruby
Burgestrand has quit [Quit: Closing time!]
impermanence has joined #ruby
impermanence has quit [Client Quit]
zeitchef has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
nofxx has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
claudiuinberlin has joined #ruby
mjolnird has joined #ruby
<dminuoso>
I find that perl'ism of using @ to denote that all must be an array offensive.
ramfjord has quit [Ping timeout: 255 seconds]
<elomatreb>
Could just be an instance variable of this instance of IrcChannel
<dminuoso>
I forgot ruby had instance variables, sorry.
<dminuoso>
;)
ferr has joined #ruby
cschneid_ has joined #ruby
n13z has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
bruno- has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
dc3 has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elsevero has joined #ruby
claudiuinberlin has joined #ruby
lel has quit [Ping timeout: 248 seconds]
kassav_ has joined #ruby
cschneid_ has joined #ruby
lel has joined #ruby
cschneid_ has quit [Ping timeout: 258 seconds]
charliesome has joined #ruby
tmm88 has joined #ruby
tmm88 has joined #ruby
tmm88 has quit [Changing host]
tmm88_ has joined #ruby
tmm88 has quit [Remote host closed the connection]
tmm88_ has quit [Client Quit]
<dminuoso>
Okay rubyists. I want to scope a method to just a file.
rhyselsmore has joined #ruby
<dminuoso>
Without it leaking.
InfinityFye has joined #ruby
<dminuoso>
The only thing I can think of is wrapping that chunk of code inside Module.new { ... }
rhyselsmore has quit [Client Quit]
<elomatreb>
Don't use a method, but assign a proc to a local variable or something like that would be a quick and dirty way
<dminuoso>
Guess that works
<dminuoso>
My code is slowly starting to look like JS code :|
cdg has joined #ruby
<elomatreb>
Mh, refinement with a module assigned to a local variable?
<dminuoso>
elomatreb: Well I was just using a top level module that is effectively leaked.
tmm88 has joined #ruby
<dminuoso>
Well by *leaked* I actually mean..
<dminuoso>
dangling.
<dminuoso>
Refinements are so cumbersome.
<elomatreb>
Does a module leak if you assign it to a local variable instead of a constant?
<apeiros>
shouldn't, would be a bug if it did. no?
<dminuoso>
apeiros: I actually had to just try out :D
cschneid_ has joined #ruby
<dminuoso>
lvars with procs sounds like the cleanest way
<dminuoso>
or lambda even.
<apeiros>
the fuck happened to my sublime settings? font size 17px? what in the world?!?
<dminuoso>
apeiros: on retina that's still like invisile right?
<elomatreb>
Large sizes are healthy for the eyes
<apeiros>
no, my normal setting is around 11-12. I set it to 12 now.
<elomatreb>
Font size pixels aren't usually actual pixels, but 1/96 in
<apeiros>
I mean I don't use any tool to run the screen at its native size. I use the biggest commonly available one ("looks like 1920x1200")
<dminuoso>
elomatreb: Is that a scottish, american, US survey or continental inch?
<apeiros>
default being "looks like 1680x1050" and native resolution 2880x1800
cdg has quit [Ping timeout: 252 seconds]
<dminuoso>
You know, gotta ask - can never be sure with the imperial system.
<apeiros>
which measure has the most possible values again? knots? miles?
<elomatreb>
dminuoso: I don't know, and I'm not sure if e.g. the CSS spec does clarify that
<dminuoso>
:)
<dminuoso>
apeiros: The craziest Ive witnessed is gauge as a measure of metal thickness.
<elomatreb>
AWG?
<dminuoso>
The meaning of x gauge depends on the metal.
<Bish>
does anyone have an idea how i get really minified html from nokogiri?
<apeiros>
oh, nice
<dminuoso>
So you cant even compare two sheets of different metals.
<apeiros>
Bish: you mean whitespace removed?
cschneid_ has quit [Ping timeout: 252 seconds]
<Bish>
apeiros: yes.
<Bish>
or rather whitespace and \n
<apeiros>
iirc there were some options you could set in to_s or when reading…
paranoicsan has quit [Quit: paranoicsan]
* apeiros
looking for whether he can find it again…
John__ has joined #ruby
<Bish>
apeiros: that would be nice
<Bish>
nokigiri "destroys" my email template, that was optimized for every f*in email client there is
<Bish>
i cant change much there, and it seems to add newlines after comments
<elomatreb>
Oh, email HTML. Fun
<Bish>
fun as putting an umbrella into your a and open it up
<apeiros>
or use a pineapple
* apeiros
afk for an hour or two
<Bish>
so i remove blanks while parsing?
<Bish>
not my to_html?
<Bish>
but i think nokogiri ADDS those
charliesome has quit [Ping timeout: 258 seconds]
ldnunes has joined #ruby
workmad3_ has joined #ruby
<Bish>
apeiros: the input to nokogiri is correct, the output is wrong
<Bish>
well technicially the nokogiri is also correc.t. but adds whitespaces that make something bigger than it should be and hell breaks loose
workmad3 has quit [Ping timeout: 248 seconds]
darix has quit [Quit: brb]
<Bish>
i should be able to remove all \n in a mail, shouldn't i?
darix has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
cdg has joined #ruby
bruno- has quit [Ping timeout: 252 seconds]
cdg has quit [Ping timeout: 246 seconds]
bruno- has joined #ruby
charliesome has joined #ruby
sepp2k has joined #ruby
zeitchef has quit [Quit: Leaving]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
apparition has joined #ruby
Heph_ has quit [Quit: Leaving]
MrBusiness3 has joined #ruby
alexertech_ has joined #ruby
alexertech_ has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n13z has quit [Remote host closed the connection]
MrBismuth has quit [Ping timeout: 255 seconds]
MrBusiness has quit [Ping timeout: 255 seconds]
MrBusiness has joined #ruby
cschneid_ has joined #ruby
erlend has quit [Ping timeout: 260 seconds]
nofxx has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Ping timeout: 248 seconds]
badrsahla has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
ShekharReddy has joined #ruby
Beams_ has joined #ruby
erlend has joined #ruby
Beams_ has quit [Client Quit]
Beams has quit [Ping timeout: 248 seconds]
mjolnird has quit [Quit: Leaving]
cdg has joined #ruby
erlend has quit [Ping timeout: 260 seconds]
Beams has joined #ruby
Hexafox[I] has joined #ruby
charliesome has joined #ruby
<Hexafox[I]>
What would be the best way to interact with a DB for a small ruby script? I'm used to using ActiveRecord in rails but rails seems overkill for something small.
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
cdg has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
jeffreylevesque has quit [Ping timeout: 248 seconds]
<surrounder>
Hexafox[I]: sequel maybe? http://sequel.jeremyevans.net/ - don't have much experience with it myself but I've heard some positive stories about it
sameerynho has joined #ruby
sameerynho is now known as Guest89374
<apeiros>
Hexafox[I]: you can use AR without rails. but IMO sequel as suggested by surrounder is a very good way to interact with a DB. I especially like it when I don't want to use an ORM
nofxx has joined #ruby
<apeiros>
(sequel can be used with and without its ORM part)
<apeiros>
Bish: yeah, seems weird. I guess it's about the DOM it constructs while parsing.
<Hexafox[I]>
I do like rails models quite a lot.
ramfjord has quit [Ping timeout: 240 seconds]
<apeiros>
Bish: and no, you can't just indiscriminately delete all \n in HTML/XML. you can however replace \s+ with a single whitespace of your choice and delete many even completely
erlend has joined #ruby
badrsahla has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
badrsahla has joined #ruby
<matthewd>
Hexafox[I]: I'd just use Active Record if you're already familiar with it.. but I'm a bit biased
<matthewd>
apeiros: You can't indiscriminately do that either, though an email might be fairly unlikely to contain anything that would care
<Bish>
apeiros: why cant i just remove all \n?
<Bish>
i mean i tried it right now, and it doesnt seem to be a huge problem AND it fixes my problem
<elomatreb>
E.g. in pre tags they are respected
<Bish>
surely theyre corner-cases
<Bish>
yes.. pre tag is the only thing i can think of
<Bish>
but who uses those should be burnt alive either way </opinion>
<elomatreb>
XHTML has a bunch of rules about this IIRC, but you're probably not using that :)
* Bish
once had a similiar problem and did .delete('\n')
<Bish>
while not knowing where the difference between "" and '' is
<Bish>
man that hurt.
badrsahla has quit [Ping timeout: 252 seconds]
<matthewd>
Bish: If your question is "If I delete \n for the email I'm looking at, will it be okay?", then that's a question you're best positioned to answer for yourself. If your question is "Is it a safe operation to delete \n on all well-formed emails?" then the answer is no, precisely because of corner cases.
ap4y has quit [Quit: WeeChat 1.9.1]
<Bish>
hm, okay, then, how would i tell nokogiri to never add new lines
<Bish>
since it seems to do that in some cases.. for example comments which include [if IE] shit
jeffreylevesque has quit [Ping timeout: 258 seconds]
aufi has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
jaruga has quit [Quit: jaruga]
kassav_ has quit [Read error: No route to host]
kassav__ has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
Hexafox[I] has quit [Ping timeout: 255 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
jamesaxl has quit [Read error: Connection reset by peer]
oleo has joined #ruby
oleo has quit [Client Quit]
oleo has joined #ruby
cpruitt has joined #ruby
mjuszczak has joined #ruby
<marahin>
Hello!
uZiel has joined #ruby
<marahin>
let's assume that I have an array of values, for instance [1,2,3]. I'd like to assign 'a' and 'b' variables accordingly first and last value from the array. How can I do that in a single line?
mjuszczak has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Remote host closed the connection]
jamesaxl has joined #ruby
jrafanie has joined #ruby
mjuszczak has joined #ruby
<matthewd>
marahin: Have you already tried something?
<marahin>
matthewd: I tried tinkering with [-1..0], [0..-1] :)
ShekharReddy has quit [Quit: Connection closed for inactivity]
<matthewd>
Personally, I think I'd just use .first and .last, despite the boring verbosity
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
mark_66 has quit [Remote host closed the connection]
guacamole has joined #ruby
swirlsMD has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[Butch] has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
ams__ has joined #ruby
hahuang65 has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
swirlsMD has quit [Ping timeout: 258 seconds]
swirlsMD has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
PaulCapestany has joined #ruby
nokia3210 has quit [Ping timeout: 260 seconds]
gusrub has quit [Remote host closed the connection]
marxarelli|afk is now known as marxarelli
Serpent7776 has quit [Quit: Leaving]
nopolitica has joined #ruby
MyMind has quit [Ping timeout: 252 seconds]
Pisuke has joined #ruby
Azure has quit [Ping timeout: 248 seconds]
DTZUZO has joined #ruby
someuser_ has quit [Quit: Lost terminal]
PaulCapestany has quit [Read error: Connection reset by peer]
wolakkk has joined #ruby
wolakkk has quit [Max SendQ exceeded]
PaulCapestany has joined #ruby
<havenwood>
pabs: You can just put a png inside a gem and add it to your Gem::Specification#files= in your gemspec. Or say more about what you mean?
<havenwood>
Oops, they left.
gusrub has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
Sembei has joined #ruby
Pisuke has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Beams has quit [Quit: .]
jamesaxl has joined #ruby
swirlsMD has quit [Ping timeout: 248 seconds]
dnoda has joined #ruby
kassav__ has quit [Quit: kassav__]
swirlsMD has joined #ruby
alfiemax has quit [Remote host closed the connection]
thinkpad has quit [Ping timeout: 252 seconds]
synthroid has quit [Remote host closed the connection]
aphprentice has joined #ruby
orbyt_ has joined #ruby
Technodrome has joined #ruby
dviola has joined #ruby
Guest16040 has quit [Ping timeout: 258 seconds]
GodFather has joined #ruby
kies has quit [Ping timeout: 252 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stevednd has joined #ruby
<stevednd>
hey all, what's the correct pattern to use to be able to pass a method to some other method without actually calling it until it's called? I have an expensive operation that I want to be available to some other code, but not run. I thought about just passing it as a lambda `context = {expensive: ->() { do_expensive_thing }}` but this requires the caller to at the very least do `context[:expensive].()`
cpruitt has quit [Quit: cpruitt]
cpruitt has joined #ruby
<stevednd>
is there any way to be able to get the calling code to only have to access `context[:expensive]` and have the method execute?
cpruitt has quit [Client Quit]
<elomatreb>
If you use the Hash.new constructor with a block you can implement something like that
<matthewd>
stevednd: Seems too abstract to suggest much
<matthewd>
e.g. why is context a hash and not a "proper" object?
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
guille-moe has quit [Ping timeout: 258 seconds]
oleo has quit [Ping timeout: 258 seconds]
mim1k has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
conta has quit [Ping timeout: 246 seconds]
chouhou__ has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
<dminuoso>
stevednd, this is an honest question, why is .() such a problem?
chouho___ has joined #ruby
uZiel has joined #ruby
<dminuoso>
It makes it obvious that you have something resembling a first-class function in your hand.
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
mjuszczak has quit []
oleo has joined #ruby
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 252 seconds]
Ltem has joined #ruby
chouhoul_ has joined #ruby
guacamole has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 248 seconds]
guille-moe has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
hahuang65 has quit [Quit: WeeChat 1.9.1]
alfiemax has joined #ruby
hahuang65 has joined #ruby
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 248 seconds]
megamos has joined #ruby
TvL2386 has joined #ruby
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
chouhou__ has joined #ruby
TvL2386_ has quit [Ping timeout: 240 seconds]
chouho___ has quit [Ping timeout: 240 seconds]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
chouhoul_ has quit [Ping timeout: 248 seconds]
chouhou__ has quit [Ping timeout: 240 seconds]
guille-moe has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
mjuszczak has joined #ruby
oz has quit [Ping timeout: 264 seconds]
chouho___ has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
chouh____ has quit [Ping timeout: 240 seconds]
oz has joined #ruby
jrafanie has joined #ruby
sspreitz has joined #ruby
synthroid has joined #ruby
mjuszczak has quit []
Heph_ has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
megamos has joined #ruby
eckhardt has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
megamos has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
mjuszczak has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mjuszczak has quit [Max SendQ exceeded]
mim1k has joined #ruby
mjuszczak has joined #ruby
chouhoulis has quit [Remote host closed the connection]
torarne has quit [Ping timeout: 240 seconds]
<stevednd>
dminuoso: mostly because it just breaks the semantics of accessing similar items in the context. Also because it's not really that special, it's just a wrapper to delay execution. If it's not possible, that's fine
haylon has quit [Ping timeout: 240 seconds]
yana[m] has quit [Ping timeout: 240 seconds]
Hanma[m] has quit [Ping timeout: 240 seconds]
watzon has quit [Ping timeout: 240 seconds]
lasenna[m] has quit [Ping timeout: 240 seconds]
Matt[m]2 has quit [Ping timeout: 246 seconds]
M107262[m] has quit [Ping timeout: 246 seconds]
velu_aon[m] has quit [Ping timeout: 246 seconds]
Tagami[m] has quit [Ping timeout: 246 seconds]
chouhoulis has joined #ruby
dtcristo has quit [Ping timeout: 246 seconds]
Giphy[m] has quit [Ping timeout: 246 seconds]
Orbixx[m] has quit [Ping timeout: 246 seconds]
aviraldg has quit [Ping timeout: 246 seconds]
kua[m] has quit [Ping timeout: 252 seconds]
dman[m] has quit [Ping timeout: 252 seconds]
itmerc[m] has quit [Ping timeout: 252 seconds]
KevinMGranger has quit [Ping timeout: 252 seconds]
astronavt[m] has quit [Ping timeout: 252 seconds]
turt2live has quit [Ping timeout: 240 seconds]
gokul_mr[m] has quit [Ping timeout: 264 seconds]
jonjits[m] has quit [Ping timeout: 264 seconds]
aagdbl[m] has quit [Ping timeout: 276 seconds]
__Yiota has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 258 seconds]
mim1k has quit [Ping timeout: 248 seconds]
slackR has quit [Quit: Leaving]
cagomez has joined #ruby
ioggstream has quit [Ping timeout: 252 seconds]
dnoda has quit []
Xeago has quit [Ping timeout: 260 seconds]
bigkevmcd has quit [Ping timeout: 240 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigkevmcd has joined #ruby
Xeago has joined #ruby
yokel has joined #ruby
guacamole has joined #ruby
megamos has joined #ruby
orbyt_ has joined #ruby
alnewkirk has quit [Ping timeout: 248 seconds]
<apeiros>
stevednd: you can always create a custom class which provides [] access to calculated (and potentially memoized) attributes
alnewkirk has joined #ruby
raynold has joined #ruby
kies has joined #ruby
<apeiros>
class MemoHash; def initialize(memos); @memos = memos; @calculated = {}; end; def [](key); if @calculated.has_key?(key) then @calculated[key] else @calculated[key] = @memos[key].call end; end; end
<stevednd>
apeiros: yes, I could, but I do not control the full lifecycle of hash that I'm passing. So I am not eager to attempt to simulate a hash, nor sub-class Hash as I do not want to deal with the potential whacky debugging down the line.
<apeiros>
you shouldn't subclass Hash anyway. subclassing classes you don't own is generally a bad idea.
<stevednd>
yes, exactly why I don't plan on doing it
kimtoms has quit []
knight33 has joined #ruby
kies has quit [Read error: Connection reset by peer]
dc4 has joined #ruby
dc3 has quit [Ping timeout: 240 seconds]
rajno has quit [Quit: Leaving]
nopolitica has quit [Quit: WeeChat 1.9]
eckhardt has joined #ruby
jordanm_ has quit [Ping timeout: 258 seconds]
swirlsMD has quit [Ping timeout: 248 seconds]
smelnicki has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
dionysus70 has joined #ruby
<apeiros>
is there a good crypto channel on freenode?
<apeiros>
or alternatively: anybody know of a file format or similar which would allow to decrypt its content with multiple keys?
<apeiros>
multiple keys as in: multiple keys exist and any of them can decrypt the contents. bonus points if editing and re-encrypting is possible
dionysus70 is now known as dionysus69
<apeiros>
(I do have an idea on how to do with AES or any other encryption standard, but don't want to reinvent the wheel - especially not in crypto where I might accidentally introduce backdoors/sidechannels)
workmad3_ has quit [Ping timeout: 255 seconds]
alfiemax has quit [Remote host closed the connection]
<elomatreb>
Do you want to reimplement it? Because I know LUKS disk encryption supports that and I think eCryptFS as well (which can be a regular file)
cagomez has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
ramfjord has joined #ruby
<apeiros>
if I can have it in as plain ruby with as little dependencies as possible - great. if not, I'll still give it a try.
<apeiros>
eCryptFS - ok, taking a look at that
<apeiros>
any limit on the number of allowed keys with that?
cagomez has joined #ruby
<elomatreb>
From what I'm reading it does not allow multiple keys (passphrases at least), mh. Sorry then
<apeiros>
also doesn't exist for mac :-/
alfiemax has quit [Ping timeout: 246 seconds]
Yxhuvud has quit [Remote host closed the connection]
<elomatreb>
Just storing a single key multiple times encrypted with the user keys is probably too simple?
<apeiros>
the idea I have is to basically en-/decrypt the data with a master key and store the masterkey for each added password encrypted with that password. potentially using a kind of hash to not have to try all buckets.
<apeiros>
^
<apeiros>
:)
mathys has joined #ruby
<elomatreb>
If you have passwords you could just use a KDF like scrypt
<apeiros>
but I'm worried that this in some way introduces a sidechannel
<apeiros>
yeah, the hashing function to find the bucket would probably fit well to perform KDF
<elomatreb>
Assuming ideal primitives I don't think you have any "sidechannels", and I don't notice any immediate implementation sidechannels
<apeiros>
the obvious weaking is probably through the inevitable "more keys = more chances to guess right"
<apeiros>
but I doubt that can be avoided
<apeiros>
*weakening (if that's a word?)
<apeiros>
well, I guess AES256 + bcrypt with ruby it is.
<apeiros>
what was the name of the pure ruby crypto lib again?
uZiel has joined #ruby
<elomatreb>
Unless you have huge numbers of users I don't think the added chance for guessing in the keyspace is significant
<apeiros>
s/users/keys/ ;-) (whyever one user would have multiple keys)
A124 has joined #ruby
<apeiros>
yeah, as long as there's rules for the pw's
badrsahla has quit [Remote host closed the connection]
<elomatreb>
Yeah, I was assuming 1 user = 1 key
badrsahla has joined #ruby
<elomatreb>
Somehow pure-ruby crypto leaves a sour taste in my mouth, if we were talking about sidechannels earlier
<apeiros>
until a couple of years ago I'd have concurred
<apeiros>
but the number of C related bugs in libs like openssl made me reconsider
<elomatreb>
Btw, just as a precaution, remember to authenticate your stuff
<apeiros>
how do you mean?
<elomatreb>
Not just AES-CBC
<apeiros>
I have to reread that stuff, been a while. wasn't cbc the one which was weak to attacks?
LocaMocha has quit [Ping timeout: 252 seconds]
<elomatreb>
You can flip bits in CBC ciphertext (and if you know some plaintext you can reliably flip certain bits), and you won't notice when decrypting
badrsahla has quit [Ping timeout: 240 seconds]
SuperLag has joined #ruby
<elomatreb>
And in certain circumstances (disclaimer: I don't fully understand this) when you can get the system to encrypt attacker supplied data it can lead to key oracles IIRC
<apeiros>
I see
<apeiros>
so you'd have to somehow munge user data
<elomatreb>
A simple HMAC of the ciphertext prevents this entirely
<apeiros>
ah, I think I remember. yes
<apeiros>
fun fact: I think I implemented that ~2y ago…
<apeiros>
I guess I'll have to reread my old code.
<havenwood>
GCM \o/
<apeiros>
GCM?
<havenwood>
Galois/Counter Mode
<apeiros>
Grand Central Mismatch?
<elomatreb>
GCM requires nonces which is difficult with static systems like this
<apeiros>
Galois… I only remember that guy from Galois fields…
<elomatreb>
GCM is a mode like CBC that automatically does this authentication step
<elomatreb>
Precisely that guy
<apeiros>
well, I guess I'll implement my shit, put it on github and ask on the ML whether anybody is up to proofread it
cdg has joined #ruby
<havenwood>
apeiros: There is a crypto channel, oh yeah, #crypto
<havenwood>
##crytpo
<havenwood>
uhg, can't type >.>
<elomatreb>
In all seriousness, I'd recommend using a prebuilt crypto library (I think there is a libsodium binding, which has a crypto box implementation that does all this in one stop for you, developed by experts)
<apeiros>
kk, will ask there too
<apeiros>
elomatreb: only if I can reproduce without it
<apeiros>
I really don't want to end up with a dead extension, unable to decrypt stuff
<elomatreb>
Apropos: Another problem of CBC is that you have to pad your plaintext, which can also leak information about the last encrypted block in certain situations
cdg_ has quit [Ping timeout: 264 seconds]
doctorspektor has joined #ruby
enterprisey has joined #ruby
apeiros has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 246 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<geigerCounter>
It seems like the ruby headers do in fact live in /usr/lib/ now.
<geigerCounter>
So this might be outside of y'all's wheelhouse.
<geigerCounter>
Unfortunately for me, that means it's probably way out of my abilitiy level
<matthewd>
> MRI-Binding: pkg-config will look for ruby-2.1.pc, but you can override the version with MRIVERSION=2.2 ('2.2' being an example)
<matthewd>
geigerCounter: Maybe relevant?
mathys has quit [Quit: Leaving]
cagomez has quit [Remote host closed the connection]
<geigerCounter>
That should be fine. The README.md for the program I'm trying to compile wants 2.1 anyway
cagomez has joined #ruby
mjuszczak has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<geigerCounter>
Well wait...
<geigerCounter>
2.3 is the only version installed right now, afaik.
<Guest25738>
the sparkr gem claims to output ascii but really outputs unicode. anyone know of a sparklines gem which really uses ascii / doesnt require unicode in my cli
<matthewd>
geigerCounter: Right. That was a quote from the readme.
cagomez has quit [Ping timeout: 252 seconds]
harai has quit [Quit: harai]
jrafanie has joined #ruby
synthroid has quit []
mjuszczak has joined #ruby
guacamole has joined #ruby
rhyselsmore has joined #ruby
jordanm_ has quit [Quit: Konversation terminated!]
duderonomy has joined #ruby
Guest16040 has joined #ruby
kies has joined #ruby
<geigerCounter>
matthewd: I set the MRIVERSION to 2.3, still no dice.
<matthewd>
Hmm.. best I can suggest at that point is that if it's trying to detect the files, you should be able to find a log file somewhere that describes everything it's tried (and the specific reason each failed), which might hold some clue
<geigerCounter>
I'm not sure where to find that.
voxxit has joined #ruby
<geigerCounter>
I looked at the error output for make and all it's telling me is that it's not finding it.
snapcase has quit [Remote host closed the connection]
postmodern has joined #ruby
snapcase has joined #ruby
cagomez has joined #ruby
alfiemax has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
vee__ has quit [Ping timeout: 246 seconds]
[Butch] has quit [Quit: I'm out . . .]
jeffreylevesque_ has quit [Ping timeout: 264 seconds]
jrafanie has quit [Ping timeout: 252 seconds]
roonsauce has quit [Remote host closed the connection]
mjuszczak has quit []
roonsauce has joined #ruby
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
vee__ has joined #ruby
mjuszczak has joined #ruby
biberu has quit []
mjuszczak has quit [Max SendQ exceeded]
oleo has joined #ruby
roonsauce has quit [Ping timeout: 246 seconds]
mjuszczak has joined #ruby
<geigerCounter>
I fixed it.
<geigerCounter>
Thanks for your help matthewd!
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has quit [Client Quit]
thomasv314 has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
SeepingN has joined #ruby
Ltem has quit [Quit: Leaving]
alfiemax has joined #ruby
ap4y has joined #ruby
ap4y1 has joined #ruby
dc4 has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
John__ has quit [Ping timeout: 248 seconds]
shinnya has joined #ruby
apeiros has quit [Remote host closed the connection]
mson has quit [Quit: Connection closed for inactivity]
ramfjord has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
PaulCapestany has joined #ruby
mikecmpbll has joined #ruby
ramfjord has joined #ruby
<mikecmpbll>
anyone know of any projects using DRb? :)
<havenwood>
mikecmpbll: pry-remote does
tmm88 has quit [Quit: Lost terminal]
<matthewd>
minitest-server
PaulCapestany has quit [Quit: .]
<mikecmpbll>
cool! thanks!
<matthewd>
If you want something huge, I know ManageIQ uses it for some stuff, but that's unlikely to be a good example if you want something to read
yokel has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 246 seconds]
<havenwood>
spork does too
vee__ has quit [Ping timeout: 264 seconds]
<mikecmpbll>
something to read was what i was after. thinking of using it to distribute some process-heavy tasks across machines
<mikecmpbll>
but haven't touched it before
dtcristo has joined #ruby
<matthewd>
Personally, I'd try pretty hard to convince sidekiq to solve my problem before bringing that much intimacy to bear
mjuszczak has quit []
jphase has quit [Remote host closed the connection]
yokel has joined #ruby
<mikecmpbll>
hmm.
swirlsMD has quit [Ping timeout: 255 seconds]
<mikecmpbll>
definitely worth considering, thanks
<mikecmpbll>
slight problem i'd have with sidekiq is all the data required for the tasks which isn't easily passed to a sidekiq job
vee__ has joined #ruby
<matthewd>
If you're going to pass it through DRb, you can just marshal it to sidekiq instead. If you want to leave it to call back to the original process, then DRb is certainly the right tool... but it's going to interfere with your distributed-ness pretty quickly.
workmad3 has joined #ruby
<mikecmpbll>
ah yeh, of course i can good point.
swirlsMD has joined #ruby
Ropeney has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
<darix>
zeromq comes to mind.
jphase has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jonjits[m] has joined #ruby
turt2live has joined #ruby
Giphy[m] has joined #ruby
Hanma[m] has joined #ruby
Tagami[m] has joined #ruby
M107262[m] has joined #ruby
lasenna[m] has joined #ruby
haylon has joined #ruby
yana[m] has joined #ruby
velu_aon[m] has joined #ruby
aviraldg has joined #ruby
Orbixx[m] has joined #ruby
torarne has joined #ruby
watzon has joined #ruby
astronavt[m] has joined #ruby
KevinMGranger has joined #ruby
dman[m] has joined #ruby
itmerc[m] has joined #ruby
kua[m] has joined #ruby
gokul_mr[m] has joined #ruby
aagdbl[m] has joined #ruby
Matt[m]2 has joined #ruby
orbyt_ has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
gusrub has quit [Remote host closed the connection]
jphase has quit [Remote host closed the connection]
^mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
blackmesa has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hexafox[I] has joined #ruby
enterprisey has quit [Ping timeout: 240 seconds]
megamos has quit [Ping timeout: 255 seconds]
goyox86_ has joined #ruby
govg_ has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
polishdub has quit [Quit: leaving]
SenpaiSilver has joined #ruby
ta has quit [Remote host closed the connection]
lektrik has quit [Ping timeout: 258 seconds]
ta has joined #ruby
SenpaiSilver has quit [Remote host closed the connection]
rhyselsmore has quit [Read error: Connection reset by peer]
goyox86_ has quit [Ping timeout: 240 seconds]
goyox86_ has joined #ruby
goyox86_ is now known as goyox86
blackmesa has quit [Ping timeout: 240 seconds]
goyox86 has quit [Client Quit]
goyox86 has joined #ruby
jeffreylevesque has joined #ruby
sepp2k has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
lektrik has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
blackmesa has joined #ruby
marcux has joined #ruby
Technodrome has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
cschneid_ has joined #ruby
enterprisey has joined #ruby
thinkpad has joined #ruby
cschneid_ has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
cagomez has quit [Remote host closed the connection]
alfiemax has joined #ruby
cagomez has joined #ruby
badrsahla has quit []
cagomez has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
pilne has joined #ruby
marr has quit [Remote host closed the connection]
cagomez has joined #ruby
troys has joined #ruby
naprimer2 has joined #ruby
g4ntz has joined #ruby
sepp2k1 has joined #ruby
naprimer3 has quit [Ping timeout: 248 seconds]
sepp2k has quit [Ping timeout: 260 seconds]
g4ntz has left #ruby [#ruby]
swirlsMD has quit [Ping timeout: 248 seconds]
alveric2 has joined #ruby
sepp2k has joined #ruby
sepp2k1 has quit [Ping timeout: 258 seconds]
alveric1 has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
ta has quit [Remote host closed the connection]
<Guest25738>
i have a ruby script running which keeps terminating with the message 'Killed'. it is creating thousands of large hashes in memory, does the os kill it or can ruby hit a memory limit? its running on linux