quobo has quit [Quit: Connection closed for inactivity]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
akaiiro has quit [Ping timeout: 244 seconds]
akaiiro has joined #ruby
s2013 has joined #ruby
mohsen_1 has quit [Quit: Connection closed for inactivity]
wilbert has quit [Ping timeout: 248 seconds]
blackmesa has quit [Ping timeout: 276 seconds]
r29v has quit [Quit: r29v]
cadillac_ has quit [Ping timeout: 240 seconds]
openstruct has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maiz has quit [Ping timeout: 260 seconds]
<openstruct>
Been debugging a stack level too deep error for the past few days and am out of debugging ideas. I've got a service object that works perfectly when run via the console, but raises the stack error when delayed with sidekiq. In particular, it works with #perform but not with #perform_async.
<openstruct>
AFAIK sidekiq uses a normal ruby process, but I can't determine why that process can't handle the work.
<openstruct>
Hmm might be related to celluloid.
karapetyan has quit [Remote host closed the connection]
jottr_ has joined #ruby
fmcgeough has joined #ruby
<mistergibson>
openstruct: do you use celluloid and fibers at the same time?
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<openstruct>
mistergibson: Not intentionally, but the sidekiq version I have does. Upgrading to the latest sidekiq again to see if that's the case.
<mistergibson>
openstruct: can you keep it from using fibers - the celluloid guide warns of using them.
s2013 has joined #ruby
s2013 has quit [Client Quit]
juiko has joined #ruby
<openstruct>
mistergibson: Just upgraded to the latest version that no longer users celluloid, but alas the error remains.
fmcgeough has quit [Client Quit]
<mistergibson>
openstruct: odd that - ok, I dunno then
<openstruct>
Thanks for the suggestion though!
jottr_ has quit [Ping timeout: 240 seconds]
<mistergibson>
openstruct: np
subr has quit [Quit: Leaving]
subroot has joined #ruby
AJA4350 has quit [Quit: AJA4350]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
jaequery has quit [Ping timeout: 240 seconds]
juiko has quit [Ping timeout: 244 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
bonhoeffer has quit [Quit: bonhoeffer]
Tempesta has joined #ruby
juiko has joined #ruby
zachk has quit [Quit: Leaving]
jottr_ has joined #ruby
SeepingN has joined #ruby
jottr_ has quit [Ping timeout: 260 seconds]
bonhoeffer has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
kapil___ has joined #ruby
jalcine is now known as Jacky
Jacky is now known as jalcine
wilbert has joined #ruby
cadillac_ has joined #ruby
nOgAnOo_ has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
bonhoeffer has joined #ruby
giraffe has joined #ruby
tpendragon has joined #ruby
bak1an has joined #ruby
jottr_ has joined #ruby
bak1an has quit [Client Quit]
juiko has quit [Ping timeout: 244 seconds]
bonhoeffer has quit [Quit: bonhoeffer]
jottr_ has quit [Ping timeout: 268 seconds]
juiko has joined #ruby
bmurt has joined #ruby
cadillac_ has quit [Quit: I quit]
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
braincrash has quit [Quit: bye bye]
c0ncealed2 has quit [Remote host closed the connection]
<ruby[bot]>
icantc: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<icantc>
bearing in mind that i have no idea myself, i would guess something like: https://paste.ee/p/gWZeY
jottr_ has joined #ruby
<potatoe>
that doesnt help sadly
<potatoe>
I'd contribtue if I knew ruby but why dont the dev just provide a bin wrapper or atleast mention hojw to do it in the tutorial :/
apeiros has quit [Remote host closed the connection]
yqrashawn has joined #ruby
maiz has joined #ruby
shinnya has quit [Ping timeout: 248 seconds]
biberu has joined #ruby
Guest75255 has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
Nicmavr is now known as Guest47743
SeepingN has quit [Quit: The system is going down for reboot NOW!]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
DTZUZO has joined #ruby
wilbert has quit [Ping timeout: 244 seconds]
RougeR has quit [Ping timeout: 265 seconds]
maiz has quit [Ping timeout: 268 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
yqrashawn has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
Caerus has quit [Quit: Leaving]
maiz has joined #ruby
schleppel has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
conta has joined #ruby
<badeball>
I have a lazy enumerator and want to partition it and do something / iterate over both partitions in a lazy way. is there a way to do this without invoking the base, lazy enumerator twice? (is my question at all making sense?)
<badeball>
while retaining the lazy property all the way
nic0x819 has joined #ruby
clemens3 has joined #ruby
<badeball>
I have a vague idea that I can achieve this using fibers
Guest39745 has joined #ruby
amar_ has joined #ruby
jottr_ has joined #ruby
samosaphile has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
anisha has quit [Quit: Leaving]
alem0lars has joined #ruby
jottr_ has quit [Ping timeout: 256 seconds]
schneider has joined #ruby
amar_ has quit [Remote host closed the connection]
dbugger_ has joined #ruby
yohji has joined #ruby
sysvalve has joined #ruby
suukim has joined #ruby
ged has quit [Read error: Connection reset by peer]
ged has joined #ruby
alex`` has joined #ruby
andikr has joined #ruby
mikecmpbll has joined #ruby
alex`` has quit [Client Quit]
Keltia_ is now known as Keltia
mikecmpbll has quit [Read error: Connection reset by peer]
Map has quit [Ping timeout: 256 seconds]
shoogz has quit [Ping timeout: 256 seconds]
jalcine has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
sphenxes has joined #ruby
sphenxes has quit [Max SendQ exceeded]
jalcine has joined #ruby
shoogz has joined #ruby
venmx has joined #ruby
Map has joined #ruby
amar_ has joined #ruby
subroot has joined #ruby
amar_ has quit [Remote host closed the connection]
amar_ has joined #ruby
guille-moe has joined #ruby
alex`` has joined #ruby
anisha has joined #ruby
shinnya has joined #ruby
<lucas_>
hi, with sinatra, is there a nice way to always ensure that there's a newline at the end of the server response? it's not there by default and makes things a bit ugly when debugging with curl
amar_ has quit [Ping timeout: 256 seconds]
NL3limin4t0r_afk has quit [Quit: WeeChat 1.9.1]
wkoszek_ has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
<phaul>
I expect & to use Object#eql? thus returning a Set with an instance rather than empty set
jraavis has quit [Max SendQ exceeded]
<canton7>
he didn't hang around for long...
_aeris_ has quit [Remote host closed the connection]
_phaul has joined #ruby
<canton7>
_phaul, objects which are equal MUST have equal hash codes
<_phaul>
sorry, my connection is very bad...
_aeris_ has joined #ruby
<_phaul>
canton7: am I right then that for instance 2 instances of a Struct at different memory locations with same attributes would have the same hashes? Ie, does Struct ovverride #hash?
<canton7>
and the doc: "Returns a hash value based on this struct's contents"
<_phaul>
ok, explains a lot :) thank you canton7
<canton7>
(things like Set and Hash start off using the object's hash code, and if two objects have the same hash code they check #eql? to see if they're actually equal
pistachio has quit [Quit: WeeChat 2.1]
pistachio has joined #ruby
<_phaul>
I am sure I had been in this same culprit in the past.. probably asking the same here.. few month off coding, and Im asking the same questions again :) what does that tell you about ruby .. ;)
<_phaul>
or about me :)
<_phaul>
anyways. thanks again I got to go
Alina-malina has quit [Ping timeout: 240 seconds]
_phaul has quit [Quit: WeeChat 2.1]
venmx has quit [Remote host closed the connection]
BaroMeter has quit [Remote host closed the connection]
maiz has quit [Ping timeout: 240 seconds]
venmx has joined #ruby
venmx has quit [Client Quit]
<pistachio>
.
<gray_-_wolf>
when I start ruby from C (ruby_init, ..., rb_funcall2), start new thread in the called function and return back to C, the new thread seems to stop (it does not do anything). My assumption is that that's GVL in action, correct?
Beams has quit [Quit: .]
jottr_ has joined #ruby
maiz has joined #ruby
TinkerT has quit [Read error: Connection reset by peer]
TinkerT has joined #ruby
jrm has quit [Quit: ciao]
jrm has joined #ruby
jottr_ has quit [Ping timeout: 256 seconds]
<badeball>
regarding lazy partition, I kind of got something working with http://ix.io/1hs5, however if one were to EG. accidentally not iterate over both partitions, nothing would happen and no warnings emitted
Beams has joined #ruby
yohji has quit [Remote host closed the connection]
yohji has joined #ruby
anisha has quit [Quit: Leaving]
mohsen_1 has quit [Quit: Connection closed for inactivity]
amar has joined #ruby
mohsen_1 has joined #ruby
venmx has joined #ruby
AnomalyXII has joined #ruby
aufi has joined #ruby
SanguineAnomaly has quit [Ping timeout: 240 seconds]
amar has quit [Remote host closed the connection]
ur5us has joined #ruby
amar has joined #ruby
schneider has quit [Ping timeout: 248 seconds]
k0mpa has quit [Ping timeout: 250 seconds]
redlegion has quit [Ping timeout: 250 seconds]
apeiros has joined #ruby
amar has quit [Ping timeout: 260 seconds]
redlegion has joined #ruby
SanguineAnomaly has joined #ruby
AnomalyXII has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
schneider has joined #ruby
karapety_ has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
karapety_ has quit [Remote host closed the connection]
suukim has quit [Quit: Konversation terminated!]
karapetyan has joined #ruby
arekushi has quit [Read error: Connection reset by peer]
ciscam has quit [Ping timeout: 240 seconds]
yohji has quit [Ping timeout: 268 seconds]
ciscam has joined #ruby
cyberg has joined #ruby
blackmesa1 has joined #ruby
alex`` has quit [Ping timeout: 268 seconds]
alem0lars has quit [Ping timeout: 240 seconds]
amar_ has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
amar__ has joined #ruby
amar__ has quit [Remote host closed the connection]
amar_ has quit [Read error: Connection reset by peer]
cyberg has left #ruby ["Leaving"]
gigetoo has joined #ruby
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 276 seconds]
maiz has quit [Ping timeout: 240 seconds]
arekushi has joined #ruby
jrafanie has joined #ruby
maiz has joined #ruby
AJA4350 has joined #ruby
lele has quit [Ping timeout: 265 seconds]
Zaab1t has joined #ruby
maiz has quit [Ping timeout: 244 seconds]
lele has joined #ruby
alex`` has joined #ruby
pistachio has quit [Quit: WeeChat 2.1]
pistachio has joined #ruby
agent_white has quit [Quit: night]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Read error: Connection reset by peer]
FsMauri21 has quit [Quit: Leaving]
alfiemax has joined #ruby
maiz has joined #ruby
andikr has quit [Ping timeout: 244 seconds]
andikr has joined #ruby
ur5us has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
alfiemax_ has joined #ruby
ldnunes has joined #ruby
jottr_ has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
nic0x819 has quit [Quit: Leaving]
andikr has quit [Ping timeout: 260 seconds]
jottr_ has quit [Ping timeout: 264 seconds]
maiz has quit [Ping timeout: 240 seconds]
hays has joined #ruby
hays_ has quit [Ping timeout: 248 seconds]
maiz has joined #ruby
andikr has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
venmx has quit [Remote host closed the connection]
schneider has joined #ruby
hays_ has joined #ruby
x0f_ has quit [Ping timeout: 260 seconds]
hays has quit [Ping timeout: 248 seconds]
x0f has joined #ruby
karapetyan has joined #ruby
cmandr has joined #ruby
tvw has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
cmandr has quit [Client Quit]
dionysus69 has joined #ruby
alfiemax_ has quit [Ping timeout: 268 seconds]
maiz has quit [Ping timeout: 256 seconds]
synthroid has joined #ruby
quobo has joined #ruby
bak1an has joined #ruby
InfinityFye has joined #ruby
schneider has quit [Ping timeout: 248 seconds]
wget has joined #ruby
wget has quit [Changing host]
wget has joined #ruby
wget has quit [Remote host closed the connection]
wget has joined #ruby
wget has quit [Changing host]
wget has joined #ruby
schneider has joined #ruby
maiz has joined #ruby
anisha has joined #ruby
alfiemax has joined #ruby
graphene has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 240 seconds]
graphene has joined #ruby
jtdowney has quit [Quit: Ping timeout (120 seconds)]
amar_ has quit [Remote host closed the connection]
crankharder has joined #ruby
crankhar1er has joined #ruby
aupadhye has quit [Ping timeout: 268 seconds]
maiz has quit [Ping timeout: 240 seconds]
vonfry has quit [Quit: WeeChat 2.1]
synthroi_ has joined #ruby
Mrgoose2 has quit [Ping timeout: 264 seconds]
maiz has joined #ruby
synthroid has quit [Ping timeout: 244 seconds]
Raybih has joined #ruby
Alina-malina has joined #ruby
kyle__ has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
crankhar1er has quit [Quit: leaving]
crankharder has quit [Quit: leaving]
crankharder has joined #ruby
graphene has joined #ruby
jottr_ has joined #ruby
andikr has quit [Read error: Connection reset by peer]
<crankharder>
Thunderbird regularly triggers OSX alerts for emails that came in yesterday up to a week ago. I would think notifications should be reserved for *new* emails. Can that be configured somehow?
rsh has joined #ruby
jottr_ has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
synthroid has joined #ruby
alfiemax_ has quit [Ping timeout: 244 seconds]
synthroi_ has quit [Ping timeout: 244 seconds]
bmurt has joined #ruby
alfiemax has joined #ruby
tuxillo has quit [Ping timeout: 268 seconds]
mohsen_1 has left #ruby [#ruby]
bmurt has quit [Ping timeout: 240 seconds]
<canton7>
crankharder, wrong channel?
t-richards has joined #ruby
alfiemax has quit [Remote host closed the connection]
<Alec>
canton7: hexchat clearly shows you the currently viewed channel
<Alec>
Check the title bar
<Alec>
If that fails
alfiemax has joined #ruby
alfiemax has quit [Client Quit]
augcesar has quit []
<canton7>
I'm sorry? I'm asking crankharder whether he posted in the wrong channel by mistake, as his message doesn't appear to have anything to do with ruby
<canton7>
I know I'm in #ruby :P
augcesar has joined #ruby
<Alec>
Now you do yes, you're welcome.
* canton7
is very confused
white_lilies has joined #ruby
amar_ has joined #ruby
quobo has quit []
quobo has joined #ruby
amar_ has quit [Read error: Connection reset by peer]
gnufied has quit [Quit: Leaving]
amar_ has joined #ruby
amar_ has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
<crankharder>
meh
<crankharder>
in my head, I'm wherever I need to be
<badeball>
topic
<badeball>
ops
yokel has quit [Remote host closed the connection]
white_lilies has quit [Ping timeout: 244 seconds]
Rapture has joined #ruby
blackmesa has joined #ruby
<Alec>
badeball: you seriously trying to summon ops to deal with a spaz who doesn't know notifications are generated when mail is detected for the first time (which may happen twice if thunderbird doesn't commit that it saw them) interrupting (briefly with one post half an hour ago) and someone else not knowing what channel it was?
bmurt has joined #ruby
yokel has joined #ruby
gnufied has joined #ruby
jrafanie has joined #ruby
<canton7>
and a third person who seems to be fixated on the idea that the person who pointed out what channel this is doesn't know which channel this is...
<Alec>
Right, and a third person that talks giberish in the third person, what he said!
gregf_ has quit [Ping timeout: 252 seconds]
GodFather has quit [Remote host closed the connection]
<gray_-_wolf>
when I think ticket is stalled for way too long (I understand all the Japanese devs are busy people) and would like at least quick clarification and docs update, what's the best place to raise the issue? comment on existing ticket, create new ticket, ruby-talk or ruby-core?
alex`` has quit [Quit: WeeChat 2.1]
InfinityFye has left #ruby ["Leaving"]
<badeball>
Alec: wat
<Alec>
gray_-_wolf: mailing list probs
<Alec>
badeball: topic
<Alec>
gray_-_wolf: if you have a suggestion or a handful of cases the answer could be say something like "it should say this: " or "this: "
<Alec>
Make it easy to help you
Raybih has quit []
shinnya has quit [Ping timeout: 248 seconds]
graphene has quit [Remote host closed the connection]
nic0x819 has joined #ruby
<gray_-_wolf>
will ping ruby-talk then, thx :)
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
conta has quit [Quit: conta]
User458764 has joined #ruby
<apeiros>
badeball: it's !ops. what's up?
karapetyan has joined #ruby
<badeball>
apeiros: I meant ops as in «whops, I accidentally topic when I wanted /topic»
biberu has quit []
<apeiros>
I see :)
<apeiros>
I think oops works as well
deadblackclover has joined #ruby
* Alec
gives badeball a nod of respect.
graphene has quit [Read error: Connection reset by peer]
_aeris_ has quit [Remote host closed the connection]
venmx has joined #ruby
_aeris_ has joined #ruby
graphene has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
mikecmpb_ has joined #ruby
mikecmpbll has quit [Ping timeout: 276 seconds]
t-richards_ has joined #ruby
Inline has joined #ruby
t-richards has quit [Ping timeout: 264 seconds]
za1b1tsu has joined #ruby
deadblackclover has left #ruby ["Konversation terminated!"]
dionysus69 has quit [Ping timeout: 264 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nic0x819 has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
<Bish>
anyone has a cool way to extract the domain out of a url
<Bish>
since there is no intrinsic way to get a TLD from a domain
<Alec>
Regex?
<Bish>
yah googling "list of tlds" and "regex all tlds" for 10 minutes now an i am lost
alfiemax has joined #ruby
<gray_-_wolf>
URI.parse(url).host.downcase
<Alec>
IIRC (<--- code for, no fucking idea where I found this out, good luck) - all new domains which are words (the majority, others will be clearly noted) will not be multipart
<Alec>
That is no more ".co.uk" TLDs
reber has joined #ruby
<gray_-_wolf>
\quit
gray_-_wolf has quit [Quit: WeeChat 2.2]
<Bish>
the lone wulf
Megatroyd has joined #ruby
alfiemax_ has joined #ruby
catphish has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
<catphish>
is there likely to be any way i can store an integer variable directly in a mmap'd file with ruby?
<catphish>
i guess i can make a wrapper that at least makes it look like that's what's happening but uses pack/unpack behind the scenes
kliq has quit [Ping timeout: 244 seconds]
alem0lars has joined #ruby
TomyLobo2 has joined #ruby
<konsolebox>
catphish: also check serialization formats like msgpack
t-richards__ has joined #ruby
t-richards_ has quit [Ping timeout: 240 seconds]
<catphish>
actually even mmap itself isn't marvellously implemented, i'll go back to normal file operations, will check out msgpack
<catphish>
all i want to do is keep a (constantly changing) number in a file
<Alec>
catphish: I can't see the benefits of mmap really working if you can't access memory via pointers (an array of bytes isn't really in the "spirit" of mmap)
<catphish>
everything is an array of bytes though!
<Alec>
Keep in mind that mmap is used by the runtime loader, it literally mmaps our executables and libraries in and links 'em all up - so they can run as the IP drifts onto them without issue
<Alec>
Deep stuff bro.
mikecmpb_ has quit [Ping timeout: 244 seconds]
synthroi_ has joined #ruby
troys has joined #ruby
<Alec>
catphish: do you care about durable writes?
<catphish>
yes
tcopeland has joined #ruby
<catphish>
that's kind of the point of using a file
<Alec>
That is (AT LEAST) say you do two writes A *then* B is your software okay with the chance of running later (after crash or whatever) and B being written but not A?
<Alec>
Not if you're mmapping
tcopeland has quit [Client Quit]
<catphish>
a later question i have is when i actually want to sync the data to disk
<Alec>
It can only tell if a page is dirty, not what was changed in what order.
<Alec>
write(2) gives you read-after-write consistency - but not durability.
<Alec>
even O_DIRECT and O_SYNC don't give you durability. It's the bane of my life.
* Alec
is alwayss chasing that D!
<catphish>
lol
<Alec>
What's funny?
<catphish>
"nothing"
synthroid has quit [Ping timeout: 256 seconds]
<Alec>
Got my eye on you.
<catphish>
the first question was really just how to constantly synchronize a number from ruby-land into a file
<catphish>
probably no harm in having a value=(n) method that does a pack, seek, write
jottr_ has joined #ruby
<catphish>
but i was trying to be cool
<elomatreb>
You could also look into something like pstore to get transactional security
r29v has joined #ruby
ellcs has quit [Remote host closed the connection]
<ule>
This channel is usually more active then Rails. If you don't mind asking here, do you know what's the difference between 5.0.7, 5.1.6, 5.2.0 in terms of stability? Is the Long Terms Support related with these numbers? I just upgraded from 4.2.10 to 5.0.7, so now I'm trying to figure out if it worth upgrading to 5.1 or 5.2. I'm not sure which version makes more sense though. Any thoughts?
<catphish>
the use case of this is to store a pointer to a location in another file, and i just realised it might not be necessary at all... i know where i am in the other file because i'm always at the end of it
<Alec>
Good luck
sonOfRa has quit [Read error: Connection reset by peer]
<ule>
sorry in advance, I know this is a #ruby channel, but anyways.. :)
<konsolebox>
rails used to be more active than this channel
jaequery has joined #ruby
<apeiros>
slack killed it, I guess
<Alec>
You also used to be able to buy people.
<catphish>
the UNHRC outlawed that
<havenwood>
ule: Personally, I'd prefer to be on 5.2 at the moment. I think it's absolutely worth updating to 5.1 immediately. It should be fairly painless and it's always easier to move forward incrementally rather than ossify and get stuck.
<havenwood>
ule: There's no semantic meaning to even or odd version numbers.
<ule>
that there is only security fixes to 5.2 and 5.1
<ule>
havenwood: ok, thank you very much
<Alec>
Hey havenwood
<havenwood>
catphish: You could use PStore in the stdlib. Is it a number you increment or an arbitrary number?
<havenwood>
Alec: hi
<Alec>
Oh I see! It could be that
<Alec>
catphish: use a pipe!
<Alec>
There's a guaranteed atomic operation with a pipe (provided you have it so it's non-blocking so it can fail) it's guaranteed to be AT LEAST 512 bytes - even in the presence of many writers.
<havenwood>
"a value of an Integer object is limited from -(2^63) upto (2^64)-1"
<Alec>
man 7 shm_overview
<catphish>
havenwood: mostly incremented by 1
<havenwood>
catphish: How big might it get?
<konsolebox>
and messagepack still has no bigint/dec support
<havenwood>
^
synthroi_ has quit [Ping timeout: 268 seconds]
<catphish>
havenwood: i was gonna go with 128 bit because why not, it's going to consume a whole disk block anyway :)
<havenwood>
Alec: No manual entry for shm_overview in section 7
<Alec>
The last caveat there might be btw is the write ordering, say program 1 writes some data then increments this number - there's no guarantee (unless both using read/write on the same fd) that another program will satisfy "if it sees the increment then it will see the data"
<apeiros>
havenwood: interesting range, is that upper bound no mistake?
<catphish>
but after some thought i'm worried about syncing the pointer file and the data at the same time
r29v has quit [Quit: r29v]
<Alec>
Dunno what to say, as usual with RTFMing I checked it was there first - pretty sure even the BSDs have that so wtf you using havenwood?
setient has joined #ruby
<catphish>
since i always write the end of the data file, its probably better to calculate the sequence number simply by seeking to the end of the data file
<havenwood>
apeiros: no mistake, but i haven't looked into the "why"
<Alec>
O_APPEND is slightly different to just writing at the end of the file
<Alec>
It gives a slightly stronger guarantee
<catphish>
interesting
<havenwood>
Alec: I was on Fedora, but same on macOS
<Alec>
havenwood: is it "embedded" or something silly like that?
<Alec>
try man -k shm
<catphish>
the goal here is to collect some data, simultaneously write it to a journal file, and sent it to network clients along with a location integer, if a client connection is lost, it can reconnect and resume from the last location it received
<Alec>
Also do you have /dev/shm (should be a directory)
<apeiros>
havenwood: separate types for signed / unsigned. I see.
tty has joined #ruby
<Alec>
Oh man catphish you have totally underestimated the state of the world.
<catphish>
so i think i can just open the file at startup with O_APPEND, check the seek location, divide it by my block size, and that's my sequence number
<apeiros>
I wonder why they didn't an arbitrarily sized int type.
<Alec>
I would love to bitch about this but I've really got to work sorry. apeiros probably because that can't be used in a structure and may not be a POD data-type
<Alec>
"POD"
<Alec>
You have uint64_t[] for really long values
<catphish>
64 is pretty long, but not as long as an ip address :(
Sammichmaker has quit [Ping timeout: 240 seconds]
<catphish>
we need 128 bit CPUs immediately :)
<catphish>
Alec: maybe i just don't like the state of the world, but what imply you?
<Alec>
That you're very unlikely to get a durable / consistent journal from this [it wont happen, but you may not notice due to reliability and luck]
<Alec>
If you actually care I'll show you my 6-fsync theorem and that depends on fsync doing its job (most FSs dont)
<catphish>
i had assumed that if i sync'd every write before i transmitted it i'd be good :(
<Alec>
I wish.
<Alec>
I'd kill for that.
<catphish>
but in all honesty, it doesn't matter, in the case of a crash, data's being lost constantly because it's not being collected at all, so a few missed items in the journal is meh
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Alec>
As long as you can guarantee your guarantees you can tell the users to fuck off :)
<catphish>
the aim is more to allow clients to come and go at will and catch up, when they come back
<Alec>
I leave the clients in your hands
<catphish>
if the server crashes, data is guarenteed lost
<catphish>
also, seriously, what's the point in having sync if it doesn't block until the data hits the physical disk?
<catphish>
or at least some hardware that acks the write like a BBWC
<Alec>
I was like you once.
SeepingN has joined #ruby
<Alec>
RTFM - it'll turn you into a cynical d-chasing bastard like me.
* catphish
cries
<catphish>
i'm not sure D means what you think it means
alfiemax has joined #ruby
karapetyan has joined #ruby
rsh has quit [Ping timeout: 256 seconds]
Zaab1t has quit [Quit: Zaab1t]
alfiemax_ has quit [Ping timeout: 244 seconds]
<catphish>
thanks Alec and all for being mighty fine rubber ducks <3
<Alec>
In Ruby if I have a class with two methods x and y (whatever arguments) and I'm writing a method z, how can I call x or y?
<Alec>
just x;
<Alec>
or do I have to use self.x or something?
AJA4350 has quit [Ping timeout: 248 seconds]
<apeiros>
just x. self.x will work too as long as the method isn't private.
<Alec>
is the dot a part of that?
<Alec>
x.
<Alec>
or just
<Alec>
x
<Alec>
?
bmurt has joined #ruby
<apeiros>
dot is end of phrase, not part of the syntax.
<Alec>
Thanks
<Alec>
Also wtf is <=>? I've seen = used for setters, are operators overloadable or is it something else
<apeiros>
and if you have a local variable that takes precedence, so to invoke a method of the same name you need to either x() or self.x
<Alec>
context: def <=>...
<apeiros>
<=> is order comparison (bigger/equal/smaller)
quobo has quit [Quit: Connection closed for inactivity]
yokel has quit [Ping timeout: 268 seconds]
<apeiros>
define <=>, include Comparable, get <, <=, ==, >, >=, between? for free.
<Alec>
Oh so it is operator overloading
<apeiros>
no, you can't overload in ruby. that'd require typed variables.
<Alec>
What operators can I have? Call? mathematical?
<Alec>
That's not what operator overloading is.
<apeiros>
but most things that are operators in other languages are just fancy methods in ruby.
<Alec>
That's signature overloading
<apeiros>
you may want to reread upon the definition of overloading.
<Alec>
operator overloading is exposing a way for arbitrary types to define meaning to say a*b
<Alec>
Trust me man I wrote one of the 4 main books in this area.
<apeiros>
sure.
<Alec>
See Python for example, no types, operator overloading
<Alec>
Proof by contradiction.
<apeiros>
whatever you say, pal.
<Alec>
__mul__ ect
yokel has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
garyserj has quit [Ping timeout: 244 seconds]
bsamorim has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
garyserj has joined #ruby
dviola has joined #ruby
<bsamorim>
Hi, folks! Does ruby have macros? I mean, can I code in ruby something like "assign(hash[:key], "val")" so that, before the expression is evaluated, it gets substituted for 'hash[:key] = "val"'?
r29v has joined #ruby
biberu has joined #ruby
dionysus69 has joined #ruby
<Zarthus>
not that I know of, though a method is essentially a macro without the substitution ;D
<maiz>
can one set the gem environment?
<maiz>
`gem environment gemdir/gempath'
<maiz>
are those settable somehow?
<Zarthus>
macros are only common in compiled languages afaik
rsh has joined #ruby
jcarl43 has joined #ruby
<Alec>
bsamorim: you could fake it maybe? file_in.r include file.r in your code, and swap out how you invoke it for a script that does "make; ./invoke "$@";"
<Alec>
the makefile something like:
<Alec>
file.r: file_in.r
<bsamorim>
Alec: yeah, sure, that'd be great...like C's preprocessor
<Alec>
do_macro_processing -o file.r file_in.r
aufi has quit [Quit: Leaving]
<bsamorim>
that's a great idea
<Alec>
bsamorim: the trick is now tht you swapped how you invoke the program! So you new way checks it's up to date first (make does, if it's not up to date it'll remake file.r) THEN does the invoker passing arguments
<Alec>
Otherwise you could have weird bugs where you're like "but it shoudn't be doing this!" because file.r hasn't been remade to account for changes in file_in.r
<Alec>
With the above that can't happen (without errors anyway)
<elomatreb>
I feel like we should report this as a crime against *something*
<bsamorim>
Yeah, of course, you can just let "make" manage that for u
<Alec>
elomatreb: sometimes it's REALLY worth it, but I agree the cost is high.
<elomatreb>
Honest advice: A preprocessor is most certainly not the solution you're looking for
Guest39745 has quit [Remote host closed the connection]
<Alec>
It depends really - I submit flex/bison for example
<Alec>
And other tools that generate code no human should lay his eyes upon.
<elomatreb>
Post the actual problem you want to solve, and we can help (now it seems like you decided on a solution and want to know how to realize it)
<elomatreb>
Alec: In the context of Ruby, I meant
al2o3-cr has quit [Quit: WeeChat 2.2]
<Alec>
bsamorim: I trust you to know what you want ;)
jmcgnh has quit [Read error: Connection reset by peer]
<Alec>
bsamorim: also +1 for knowing make! It's great! I use make to "do" all the papers and my thesis and stuff, like say a file generating graphics changes, it automatically remakes all that is needed :)
<Alec>
Undervalued software.
AJA4350 has joined #ruby
jmcgnh has joined #ruby
<bsamorim>
elomatreb: that use case is quite plausible, i think
<bsamorim>
Basically, side-stepping the lack of pointers in ruby
jasmith has quit [Ping timeout: 276 seconds]
<bsamorim>
I can't have a reference to hash[:key]
<Alec>
elomatreb: I do agree BTW that this should not be used lightly, but it works and is hard to fuck up - you could even add some code to check the modified time on file_in.r is before the modified time of file.r just to be safe.
Megatroyd has quit [Quit: Leaving]
jasmith has joined #ruby
Guest39745 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Beams has quit [Quit: .]
<Alec>
Also elomatreb I have seem some sexy uses of the C-preprocessor. I sometimes wonder why so few languages shun having one, it can't recurse which means it always halts (except recursion by inclusion)
Mrgoose has joined #ruby
<Alec>
And that does not mean "nasty brittle cludges" - I'm not a Perl guy, where obscurity earns prestige :P
<elomatreb>
If we're talking code generation a proper, safe macro system is the way to go IMO, e.g. like Rust has
* Alec
judges and shakes his head
<Alec>
I've found operator [] support!
Guest39745 has quit [Remote host closed the connection]
<Alec>
Coroutines is usually coroutine.resume() (OR SOMETHING) <--- it must voluntarily "yield" to allow something else to run.
<Alec>
You shouldn't be able to pause one unless it is actually running (but this would be a thread pause,as the thread would not have something else to execute)
<mistergibson>
I believe there is a call like current.fiber()
<mistergibson>
or some such
<mistergibson>
lets you grasp and manipulate the fiber you're running in
<Alec>
mistergibson: sorry for being very pedantic there - just coroutines are supposed to be able to represent a thread that can be run but also yield (unlike a thread, which can only yield in the OS-scheduler sense)
<mistergibson>
Alec: yeah, it is the closest thing to a co-routine ruby offers me thinks
<mistergibson>
Alec: I've found the combo of threads and fibers to be very powerful and flexible
<Alec>
eg x.doABit(); y(); x.doSomeMore(); <---in the same "execution context" - first x does something, yields or is forcibly removed, and control enters y then back to x. Allowing you to have code who's control flow is normal, but can be applied as needed
GodFather has joined #ruby
<Alec>
a good example is a state machine (or something with even more state) matching network commands, suppose a command is COMMAND and COM has come in, the coroutine runs on this then yields once it's done COM - when more comes in it can be run exactly where it was left off.
mikecmpbll has joined #ruby
<Alec>
The only other use case really is providing feedback on tasks (like updating progress bars and not blocking the ui) - if you count what I just said as covering "Parsers"
<mistergibson>
Alec: right, I wrote into my event management a scheme where you could pause(<seconds>) a fiber running
<Alec>
eg GLR (any "generalised" parser) needs it
<Alec>
Yeah
clemens3 has joined #ruby
<Alec>
Oh and generators/things-that-yield are a "kind" of coroutine - it's rare for a language to have one but not the other (unless the thing yielding values is a class, then the state is in the class and it's calling a method)
<Alec>
mistergibson: coroutines have a natural "isomorphism" with a form of recursion. Using the example above suppose we have GetByte, WouldBlock for network and DoOther - the "parser" could do for(;;) { if(WouldBlock()) { DoOther(); } else { GetByte() /*parsing here*/} }
<Alec>
DoOther would at some point see if there's any incomin data and call the parser, so you get a stack like: doOther() -> Parser() -> doOther() -> Parser() -> doOther() -> Parser() .... -> ....
<Alec>
Static analysis is basically useless in such "unbounded" situations because even in this simple example there's no easy way to group cases, streams could go on forever, but if you split it into coroutines and yield instead, it "flattens" the callstack and becomes managable.
GodFather has quit [Ping timeout: 276 seconds]
<Alec>
You've probably encountered something like this in your event system (something with a main loop) - especially if you allowed things to yield() (call an iteration of the event loop)
<Alec>
Not yield like coroutines
karapetyan has quit [Remote host closed the connection]
lomex has joined #ruby
Cthulu201 has quit [Ping timeout: 260 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneider has joined #ruby
alem0lars has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
gix has joined #ruby
sepp2k has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus70 is now known as dionysus69
alfiemax has quit [Remote host closed the connection]
samosaphile has joined #ruby
Cthulu201 has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has joined #ruby
lomex has quit [Client Quit]
bak1an has quit [Read error: Connection reset by peer]
bak1an has joined #ruby
nielsk has quit [Ping timeout: 256 seconds]
anisha has quit [Ping timeout: 240 seconds]
nielsk has joined #ruby
reber has quit [Remote host closed the connection]
maiz has joined #ruby
maiz has quit [Client Quit]
zachk has joined #ruby
alfiemax has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
tagnotfound has quit [Quit: Lost terminal]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
sameerynho has joined #ruby
quobo has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
tty has joined #ruby
SeepingN has quit [Ping timeout: 244 seconds]
bsamorim has quit [Ping timeout: 276 seconds]
jamesaxl has joined #ruby
jamesaxl has quit [Client Quit]
DTZUZO has joined #ruby
jamesaxl has joined #ruby
sphenxes has joined #ruby
anisha has joined #ruby
Guest39745 has quit [Remote host closed the connection]
pebble2016 has joined #ruby
Dbugger has quit [Ping timeout: 265 seconds]
sphenxes has quit [Quit: Leaving]
AJA4351 has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
Asher has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
GodFather has quit [Ping timeout: 276 seconds]
DTZUZO has joined #ruby
Guest39745 has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
Asher has quit [Ping timeout: 268 seconds]
deathwishdave has joined #ruby
agent_white has joined #ruby
grilix has joined #ruby
blackmesa has joined #ruby
claudiuinberlin has joined #ruby
karapetyan has joined #ruby
GodFather has joined #ruby
ferr has quit [Read error: Connection reset by peer]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
karapetyan has quit [Ping timeout: 264 seconds]
deathwishdave has joined #ruby
AJA4351 has joined #ruby
schneider has quit [Quit: WeeChat 2.0.1]
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
deathwishdave has quit [Client Quit]
Guest39745 has quit [Read error: Connection reset by peer]
whiteline has quit [Remote host closed the connection]
Guest39745 has joined #ruby
whiteline has joined #ruby
Asher has joined #ruby
deathwishdave has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
Asher has quit [Ping timeout: 260 seconds]
sepp2k has quit [Read error: Connection reset by peer]
rsh has quit [Ping timeout: 240 seconds]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest61993 has quit [Changing host]
Guest61993 has joined #ruby
Guest61993 is now known as Kestrel-029
GodFather has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
whiteline has quit [Ping timeout: 264 seconds]
ellcs has joined #ruby
wilbert has quit [Ping timeout: 244 seconds]
amar_ has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
DTZUZO has quit [Read error: Connection reset by peer]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]