miskatonic has quit [Remote host closed the connection]
<Tuor>
manveru: how does your second version work? I men it's nice (yes I don't mind some spaces at the end). The first is nice and still shorter then mine^^
<manveru>
Tuor: you can find it in the manpage of ruby :)
<manveru>
the -n flag
<manveru>
the benefit is that it doesn't have to fit all input in memory like my first version or yours
<manveru>
but also means you won't know what the last item will be, so you get the additional space
jenrzzz has joined #ruby
Tempesta_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
<leitz>
Figured out part of it, I forgot that the input was a string, even if it's a number.
<Tuor>
the -n is clear. but the part at the end I don't know what it is: `, " "` I google this topic befor and found your second solution but only without the last part.
gregf_ has quit [Remote host closed the connection]
conta has quit [Quit: conta]
dbugger has joined #ruby
queip has joined #ruby
jefffrails35 has joined #ruby
drnerdius has joined #ruby
drnerdius has quit [Client Quit]
nerdius has joined #ruby
Bounga has quit [Ping timeout: 252 seconds]
jcalla has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
chalkmon1 has joined #ruby
chalkmonster has quit [Ping timeout: 246 seconds]
absolutejam4 has joined #ruby
mint has quit [Ping timeout: 245 seconds]
conta1 has joined #ruby
barg has joined #ruby
absolutejam4 has quit [Ping timeout: 268 seconds]
sylario has joined #ruby
Tempesta_ has left #ruby ["Closing Channel, bye."]
Tempesta has joined #ruby
esrse has quit [Ping timeout: 245 seconds]
catphish has joined #ruby
<catphish>
i'm running a TLS server in ruby using OpenSSL, it's come to my attention that i need to use better DH keys, but i can't work out how to specify a DH key in an ssl context, is anyone familiar with this?
tdy has joined #ruby
<catphish>
looks like i can use ssl_context.tmp_dh_callback
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
fphilipe_ has quit [Ping timeout: 258 seconds]
fphilipe_ has joined #ruby
<Bish>
catphish: why not put nginx in front, or aren't we talking http?
yalue has joined #ruby
queip has quit [Ping timeout: 244 seconds]
absolutejam4 has joined #ruby
jenrzzz has joined #ruby
involans has joined #ruby
queip has joined #ruby
absolutejam4 has quit [Ping timeout: 246 seconds]
<catphish>
not http
lucasb has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
donofrio has joined #ruby
jcalla has joined #ruby
aphprentice__ has quit [Quit: Connection closed for inactivity]
jcalla has quit [Remote host closed the connection]
jcalla has joined #ruby
catphish has left #ruby ["Leaving"]
alem0lars has joined #ruby
reber has joined #ruby
absolutejam4 has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
Rapture has joined #ruby
tf2ftw has quit [Quit: This computer has gone to sleep]
tf2ftw has joined #ruby
akem-lnvo has joined #ruby
tdy has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
Inline has joined #ruby
tdy has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
conta1 has quit [Quit: conta1]
cjohnson_ has joined #ruby
cjohnson has quit [Disconnected by services]
cjohnson_ is now known as cjohnson
Swyper has quit [Remote host closed the connection]
schne1der has joined #ruby
tf2ftw has quit [Quit: This computer has gone to sleep]
akem-lnvo has quit [Remote host closed the connection]
unreal has joined #ruby
unreal_ has quit [Ping timeout: 272 seconds]
<leitz>
Our company competes for contracts so there's always a need to keep your CV updated. No real surprise there, just the mentioning of it. :)
<leitz>
My biggest challenge is that I just moved to "programmer" from "linux guy", so my coding chops aren't in line with my years of career experience.
<ytti>
seems like a good career move, congratulations
<ytti>
having some subject matter expertise in any domain makes you much better programmer in that domain
snk has joined #ruby
unreal has quit [Read error: Connection reset by peer]
<leitz>
ytti, I've been working on the move for a long time. Mostly because I like to create solutions before the problems blow things up.
agent_white has quit [Remote host closed the connection]
unreal has joined #ruby
agent_white has joined #ruby
andikr has quit [Remote host closed the connection]
nerdius has quit [Ping timeout: 268 seconds]
bitwinery has joined #ruby
tf2ftw has quit [Quit: This computer has gone to sleep]
<ytti>
leitz, aye, and ceiling is pretty low for sysadmin without development skills
tf2ftw has joined #ruby
absolutejam4 has quit [Ping timeout: 272 seconds]
Swyper has joined #ruby
Guest58212 has quit [Quit: WeeChat 2.3]
<leitz>
ytti, yup. Over time the SA has become a commodity. In some ways, programmers (Java) are doing the same, but seem better at holding off management's low opinion of their value. The small business market seems to be helping.
zacts has joined #ruby
<ytti>
yeah you need programming and you need subject matter expertise to be really marketable
<ytti>
much like in many other domains
<ytti>
like if you're good lawyer, you specialise in specific area where you are also expert in the domain, not just legal
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<leitz>
Agreed. Of course, that's one issue I'm trying to figure out how to overcome; Ruby isn't the language of choice for my domains. Ruby is the language I prefer, though.
<ytti>
i love ruby, but i think market now strongly prefers statically typed languages
<ytti>
and facts don't matter
tdy has joined #ruby
<ytti>
demand is what it is
DaRock has quit [Ping timeout: 268 seconds]
davor_ has joined #ruby
davor has quit [Ping timeout: 245 seconds]
davor_ is now known as davor
agent_white has quit [Remote host closed the connection]
agent_white has joined #ruby
<leitz>
Jay McGavren (author of Head First Ruby and Head First Go) did a webinar and I asked if a skilled Go programmer could prototype an application as fast as a skilled Ruby programmer. His comment was that no language was faster than Ruby for rapid prototyping. Makes me wonder if that's a good angle to exploit.
tdy has quit [Ping timeout: 245 seconds]
Cthulu201 has quit [Ping timeout: 244 seconds]
Snowy has joined #ruby
TomyWork has quit [Remote host closed the connection]
claudiuinberlin has quit [Read error: Connection reset by peer]
s2013 has joined #ruby
pygmypuppy has joined #ruby
Swyper has quit [Remote host closed the connection]
chalkmonster has quit [Quit: WeeChat 2.5]
orbyt_ has joined #ruby
<havenwood>
ngw: You could process nth lines in parallel. The parallel gem or parallel command should both work. You could do your own threaded version without too much fuss.
<havenwood>
ngw: Or you could even try async-io, for a more modern, fiber-backed solution.
<havenwood>
ngw: What you have is reasonably quick for a single-threaded solution with fairly low memory use.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ngw>
havenwood: actually I'm an idiot, I was trying the code in irb and didn't realize that 99% of the problem was outputting the results...
<ngw>
the file is around 400k lines, takes less than 3s
* leitz
is glad someone else makes those kinds if mistakes...
<ngw>
totally acceptable
gix has joined #ruby
<havenwood>
ngw: nice
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gregoryloscombe_ has joined #ruby
akem-lnvo has joined #ruby
gregoryloscombe_ is now known as gwloscombe
orbyt_ has joined #ruby
fphilipe_ has quit [Ping timeout: 250 seconds]
Skaterhaym has joined #ruby
Skaterhaym has quit [Read error: Connection reset by peer]
Skaterhaym has joined #ruby
bitwinery has quit [Read error: Connection reset by peer]
<havenwood>
Dunno why I even used an IO stream. I guess just multitasking fail. Anyways, seems several times faster on my machine. ¯\_(ツ)_/¯
GodFather has quit [Remote host closed the connection]
za1b1tsu has quit [Remote host closed the connection]
fphilipe_ has quit [Ping timeout: 250 seconds]
<leitz>
havenwood, unless the processing took a long time or the file was in memory, it seems like the read would be the choke-point.
<leitz>
I, of course, don't know a heck of a lot so I could be wrong. :)
<havenwood>
leitz: I guess that's why I used an async stream
<havenwood>
leitz: Seems a good bit faster on my machine for whatever reason. I barely had time to write it and do a single benchmark, so no attempts to tune
<havenwood>
I may have got it wrong
<leitz>
havenwood, hmm...I may be stuck in the spinning platter days, too. With smaller IO buffers.
<leitz>
If you have an SSD drive with a decent buffer, it should be really zippy.
queip has quit [Ping timeout: 244 seconds]
psilly0 has joined #ruby
queip has joined #ruby
codefriar has joined #ruby
<Eiam>
you are reading a single line from a file, spinning off a new fiber to process it and continuing on with the read?
<Eiam>
that SOUNDS like the overhead alone would create astounding perf impact
<Eiam>
that you are saying its faster is making me dig deeper into my mental model =)
unreal has quit [Ping timeout: 246 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
absolutejam4 has joined #ruby
<leitz>
Eiam, the fiber overhead should be minimal, compared to the IO load. However, with solid state drives and lots of disk cache, the difference won't be as great. Still, greater.
<leitz>
You'd have to use a file size that saturated disk cache and RAM before seeing a significant slow down.
Swyper has quit [Ping timeout: 244 seconds]
suukim has quit [Quit: Konversation terminated!]
<havenwood>
Eiam: i'm skeptical of my own results too ;P just have to wait until this evening to get some free time to poke at it.
sauvin has quit [Read error: Connection reset by peer]
<Eiam>
wonder if ruby ever took advantage of the new allocator in macOS
<havenwood>
Eiam: ioquatix keeps implementing fibers in assembly :)
irdr has quit [Ping timeout: 245 seconds]
conta1 has joined #ruby
<havenwood>
Eiam: i haven't looked at OS-specific tweaks
<Eiam>
havenwood: 10.14.5 has a new allocator for 32 GB and higher configurations to take advantage of the crazy ram people want to use with data processing etc
<havenwood>
Eiam: in 2.6: Native implementations (arm32, arm64, ppc64le, win32, win64, x86, amd64) of
<havenwood>
coroutines to improve performance of Fiber significantly. [Feature #14739]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #ruby
guipan has joined #ruby
guipan has left #ruby [#ruby]
involans has quit [Remote host closed the connection]
conta1 has joined #ruby
fphilipe_ has joined #ruby
conta1 has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<havenwood>
ytti: Here's an interesting thread with folk serving tens of millions of files per day experimenting with Falcon (libcoro under the hood since backed by fibers): https://github.com/socketry/falcon/issues/40
queip has quit [Ping timeout: 246 seconds]
troulouliou_div2 has quit [Read error: Connection reset by peer]
cd has joined #ruby
cellmaker has joined #ruby
cellmaker has left #ruby [#ruby]
queip has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
greengriminal has quit [Quit: Leaving]
_whitelogger has joined #ruby
absolutejam has joined #ruby
fphilipe_ has quit [Ping timeout: 276 seconds]
absolutejam4 has quit [Ping timeout: 244 seconds]
yalue has quit [Quit: Leaving]
jenrzzz has joined #ruby
Thenekofell has joined #ruby
Cthulu201 has joined #ruby
fphilipe_ has joined #ruby
queip has quit [Ping timeout: 245 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
hiroaki has quit [Ping timeout: 245 seconds]
Skaterhaym has joined #ruby
queip has joined #ruby
pygmypuppy has quit [Ping timeout: 246 seconds]
bitwinery has quit [Ping timeout: 268 seconds]
pygmypuppy has joined #ruby
Thenekofell has quit [Ping timeout: 252 seconds]
amrx has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
amrx has quit [Ping timeout: 258 seconds]
ellcs has joined #ruby
BrianWGray has quit [Quit: Give a man a phish, you might get his credentials. Teach a man to phish, he'll get someone elses.]
schne1der has quit [Ping timeout: 248 seconds]
Inline has quit [Quit: Leaving]
Thenekofell has joined #ruby
alem0lars has quit [Ping timeout: 268 seconds]
sameerynho has quit [Ping timeout: 245 seconds]
tdy has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Ping timeout: 264 seconds]
Thenekofell has quit [Ping timeout: 250 seconds]
s2013 has joined #ruby
fphilipe_ has joined #ruby
tf2ftw has quit [Read error: Connection reset by peer]
GodFather has quit [Ping timeout: 246 seconds]
tf2ftw has joined #ruby
GodFather has joined #ruby
Fernando-Basso has joined #ruby
fphilipe_ has quit [Ping timeout: 264 seconds]
fphilipe_ has joined #ruby
cammellos has quit [Ping timeout: 268 seconds]
tf2ftw has quit [Ping timeout: 244 seconds]
tf2ftw has joined #ruby
leitz has joined #ruby
absolutejam has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Ping timeout: 250 seconds]
fuzzface has quit [Quit: Leaving]
Scriptonaut has left #ruby [#ruby]
Dr_MDMA_MD has joined #ruby
fphilipe_ has joined #ruby
ramfjord has joined #ruby
duderonomy has joined #ruby
Skaterhaym has quit [Quit: Leaving]
bitwinery has joined #ruby
tdy has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<codiecypha>
Hello I just wanted to know if any of you are very familiar with active record models
sylario has quit [Quit: Connection closed for inactivity]
codiecypha has left #ruby [#ruby]
queip has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 244 seconds]
vethis has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
queip has joined #ruby
Thenekofell has joined #ruby
fphilipe_ has quit [Ping timeout: 276 seconds]
p3ps1 has joined #ruby
infernix has joined #ruby
orbyt_ has joined #ruby
agent_white has joined #ruby
MuffinPimp has quit [Quit: Goodbye.]
psilly0 has quit [Remote host closed the connection]
<havenwood>
codefriar: Yes, some of us are very familiar with active record models.
<havenwood>
oops, codie* left - sorry codefriar
<vethis>
anyone familiar the tty gems? :P
<havenwood>
vethis: Having a tty gem problem?
<vethis>
just wishing i could get 256 colors to work properly
<vethis>
using the paint gem alongside it, sometimes it just breaks tty. like, trying to var.ask(Paint["Prompt:","#somehex"]) just kills the prompt functionality. it prints the string in the right color but doesn't take input
<vethis>
in fact any gem that colorizes terminal output in 256 mode doesn't work. lol i guess that's how tty is designed, which sucks because i've learned to love it. i just want my pretty colors :( if i knew more ruby i could probably hack it into the gem but that's beyond my skillset right now