« first day (2362 days earlier)      last day (2812 days later) » 
00:00 - 13:0013:00 - 00:00

user1804599
13:13
ugh, stringly typed
user1804599
"modern"
Ven
Ven
"We use <<, that's modern right?"
13:30
@sehe I heard about that one, but never tried to use it.
13:46
@Morwenn ditto
Why. Thank you. So much detail /cc @rightfold
This is Dutch weather forecasting done right: "Rainfall stops at 15:55, and starts again at 16:00"
4
user1804599
:)
and did the rain actually stop for 5 minutes?
user1804599
Can't tell, it's not 16:00 yet.
You folks heard of Teensy? pjrc.com/teensy /cc @Bartek @Ell @whoever
14:04
I’m quite happy with Qt, apart from the occasional: you can’t template O_OBJECT classes or use decltype in signal declarations because the moc can’t C++.
What issues do you have in mind?
@login_not_failed Nah. The sun is shining. It's a very local shower. I'm mused by the wording of that notification. I wonder precisely what statistical misjudgement of equilibrium and edge-triggering lead to that mishap
14:24
@R.MartinhoFernandes yes
they are popular in the circles that want to do the work done
people build gaming peripherals on those for example
but they're also really expensive for what they offer, IMHO
like for $20 you can get a STM32F4 which is much more functional (albeit larger)
hahhh
@EtiennedeMartel Thank you, I did read the rules after all.
@Mikhail I'm sorry about your flag there, I just came in and expected that all rooms are supposed to follow some sort of stackexchange etiquette
nwp
nwp
[something](https://chat.stackoverflow.com/transcript/message/33683305)
[something](https://chat.stackoverflow.com/transcript/message/32223804)
5
I give up
I'm surprised it looks fine in the star feed.
5
14:39
usual Qt magic
nwp
nwp
it's only magic when it works, when it doesn't it's just garbage
(╯°□°)╯︵ ┻━┻
with time i’ve come to get used to the limitations, it doesn’t impede my coding by that much
PyQt is a masterpiece of fun when it comes to understanding lifetime of objects.
the moc is only really a problem in the domain where it’s necessary i.e. signals and the meta object system (if you need to use that)
nwp
nwp
14:43
I hope I will never get used to the limitations and my coding doesn't become as bad. But then again the other thing I'm playing with is clang which uses the same "Leak raw owning pointers into functions" model.
One would think clang developers would know a thing or 2 about C++.
you seem to imply that my coding is bad …
i barely use new in my Qt programs
i have layouts and widgets as value members in my classes
which is bad for compile times, but looks better code wise
user784668
@Morwenn template <typename T> class id = T; and use id<int*> a, b;
user1804599
Stop writing bad code.
user1804599
It's not necessary to write bad code.
i also noticed that there is effort to use more std facilities and provide stdlike interfaces within Qt and i appreciate that (knowing that Qt is from a time before std)
user784668
14:48
@rightfold Yes I just stopped writing code, why?
but there are also some (redundant) functions which wouldn’t make into standard C++ but are handy API sugar
nwp
nwp
@rightfold y u do this?
user1804599
Because I like Fallout and I wanted a new avatar.
user784668
@rightfold BTW "bad code" is redundant.
user1804599
I have experienced that it is not.
15:03
@nwp Didn't Qt5 remove moc?
user784668
@sehe No.
they need moc to insert the implementation of the signals
I know
@sehe moc's maintainer wrote something that allows not to use moc, but still says that moc is the best solution.
I thought it got replaced by template magic. Maby that's optional
@Morwenn hehehe
15:05
Apparently moc is more efficient than templates because it understands fewer things.
Like proper scopes and shit.
nwp
nwp
@sehe there is moc-ng but I never tried it and I don't think it is "official"
Ah
and it only needs to run once instead of each time it gets included
Xeo
Xeo
Unreal's Header Tool is also just cobbled together without an actual parser, so it can parse the whole project quickly
can’t parse slowly if you don’t have a parser
15:06
@ratchetfreak well. Anytime you compile something that includes it
and the build system can understand the dependency
that changes the number of times the moc transform needs to happen from a few dozen per build per Qclass to once
derp. Because build systems clearly don't get C++ includes.
I get that Moc works. However the mentions benefits aren't the best selling points.
It's the reflection part that does the main job. It's the sole - rational - reason to use a preprocessing tool like that.
and even if you could replace it with template magic that would either require a designated cpp file to expand the templates or the compiler redoing the expansion every time the header gets included
@BartekBanachewicz Tininess is a big plus for me.
user784668
@ratchetfreak And if you're not careful with that, you could end up doubling your program size and tripling its startup time.
15:15
@ratchetfreak You make it seem as if "ubiquitous header inclusion" is somehow a civil or human right
I think it's a code smell.
Having to inherit from QObject to use signals is a bit bothersome when things such as Boost.Signals2 exist. Not sure what Qt signals offer in addition.
user784668
See CopperSpice.
GUI stuff should be GUI stuff, and usually has a lower rate of change (right along with the traditional untestability of the same).
@Morwenn Nuttin' if you ask me. The reflection again (named things, so things can be connected stringly typed)
also automatic dispatching to other threads
once you can wrap your head around the QT threading model
That's a no-brainer in C++ anyways, IYAM
user784668
15:17
@ratchetfreak It has a threading model?
Doesn't Boost.Signals2 correctly handle threads too?
But if you mean Qt signals can manage this declaratively
Each QObject belongs to a thread with an event loop, every signal it gets is handled inside that thread
@Morwenn It is thread safe and thread aware. It doesn't have an opinion on where things should run, and I think it will always invoke on the raising thread
@ratchetfreak So, it's the Active Object pattern. It's pretty simple to write active objects, and if you hook them up to the Boost signal you get exactly the same
@sehe Oh, ok :)
15:20
But again, all things become more easily automated with reflection. Can't be argued.
The problem is in intrusive frameworks that infect the rest of the code, for the perceived gain of automating some things.
The cost is only apparent much later.
If you can keep Qt separate from the meat of your program it's not so bad though
more work on the boundary layer but without the infection in the actual code
That's funny because it does largely defeat most of the arguments for Moc (re. speed and dependency checking)
@ratchetfreak It's always like that. You can always contain all intrusive libraries with that extra layer of indirection.
However, non-intrusive libraries are much nicer to work with, because you don't get that red-tape.
You get to integrate them however you see fit, and the hoop-jumping is on the side of the library, if at all.
user1804599
Integer overflow detection is so easy in JavaScript.
user1804599
var v2 = v0 + v1;
if (v2 < -2147483648 || v2 > 2147483647) {
  // ...
}
Also, sad fact of reality: nobody takes the extra effort to decouple.
Especially not enthusiasts (they sell the framework on the strong points only, see ... well who am I kidding, every popular framework ever.)
@rightfold I'd be very surprised if that worked. If it does, probably because the numbers get converted to strings or floats :)
user1804599
15:34
It works, because JavaScript only has floating point numbers.
user1804599
If you want wraparound, you append | 0 to each arithmetic operation. For example: var v2 = v0 + v1 | 0;.
So, you can't detect it at all. You can only suspect loss of data.
user784668
@sehe What loss of data?
@rightfold Who the hell wants wrap around
That's such a C-mindset thing.
user1804599
If you want to ensure that the result is also an integer.
15:36
And wrong
user1804599
a + b for two integers a and b isn't always an integer.
user1804599
It may be infinity, for example.
@sehe the only people who decouple are those that would have decoupled them anyway
@rightfold That makes about 0 sense
user1804599
@sehe C mindset is better than JS mindset so that's a plus.
15:37
@ratchetfreak You're making my point. There are developers that think it doesn't matter.
@rightfold o.O
@rightfold feels like a webasm thing...
@rightfold I'm afraid I'll have to agree.
@ratchetfreak yesh
user1804599
So I'm doing this in my code generator.
user1804599
  go iid (AddI o _ a b) = case o of
    OnOverflowWrap      -> var iid $ val a <> " + " <> val b <> " | 0"
    OnOverflowJump x    ->
      var iid (val a <> " + " <> val b) <>
      "if (" <> val iid <> " < -2147483648 || " <> val iid <> " > 2147483647) {\n" <>
      "b = " <> blk x <> ";\ncontinue;\n" <>
      "}\n"
    OnOverflowUndefined -> var iid $ val a <> " + " <> val b <> " | 0"
OnOverflowUndefined could be just + and then just don't care about the float that comes out...
15:39
@ratchetfreak It is exactly what you do in asm.js to declare ints.
user784668
@ratchetfreak And the JS engine JIT then has to emit useless conversions between floats and ints.
user1804599
PureScript uses | 0 for integer arithmetic because partial arithmetic operators would be incredibly annoying and bigints require a runtime library.
user1804599
Ideally (+) :: Int -> Int -> Maybe Int, or with dependent types (+) :: (i :: Int) -> (j :: Int) -> AdditionWouldNotOverflow i j -> Int.
tf haskell is doing here
@Fanael or make it evaluate to an object whose valueOf spams a alert box...
user1804599
15:44
@ratchetfreak Likely slower, but I planned to do that if -Os.
btw, hi people, would a union of struct and vector<struct> be effective?
user1804599
Also undefined overflow semantics can constant fold to poison values which can cause code elimination.
user784668
@RE60K wat
user1804599
@RE60K No, use boost::variant.
user1804599
Don't use union ever. It's so unsafe it could've come from C.
15:46
c++11 has variant maybe too?
@sehe Modular arithmetic does have real uses (though, admittedly, to be useful, you usually need to be able to specify the range).
I am making a goal stack planner, so I need a stack of goals which can be A and B and C (vector<struct goal>) or D (struct goal)
@RE60K No, but C++17 does.
you want a vector with small-space optimization
@ratchetfreak But note that the stored type needs to support (at least) non-throwing moves for such a thing to meet vector's requirements.
user784668
15:50
@JerryCoffin If you make throwing moves, I'm gonna find you and make Trump the president of your country.
user784668
Oh wait, that already happened.
Though, of course, moves should almost always have the no-throw guarantee, so that's not necessarily a huge problem, by any means.
thanks, I have another question..
If I create nodes on heap for backtracking the path for bfs, and I exit after printing the solution (I do not free those nodes, as valgrind also tells), what should I do?
should I leave it to the OS?
user1804599
;_;
user1804599
15:53
Untagged unions are great if you have dependent types.
user1804599
Or phantom types, even!
@RE60K for quick compute-print-and-exit programs leaving cleanup to the OS is fine
@Fanael I'm being punished, but I've committed no crime (of which you're aware, anyway).
@RE60K I see no reason to do this.
but be aware that as soon as you want to reuse the code you will need to start thinking about cleanup
user784668
15:55
@R.MartinhoFernandes But that's unsafe!
@RE60K It's trivial to create the nodes so that you can not care about freeing them and still have them freed.
It has the advantage that you can not shred the code after you run it once.
what?
sorry it's not clear
Example build script for code that you think is only going to be used once so you don't need to care about cleanup: make && rm -rf .
@RE60K Simply don't allocate nodes without using RAII.
Problem fixed.
If you really think your code is only going to be run once so you don't need to care about this, then right after you run it, do rm -rf on the source folder.
@RE60K Why create nodes on the heap? From the sound of things, a vector will will handle the situation perfectly well (i.e., you want a queue where you keep track of the 'head' position instead of actually removing items).
If you're not willing to do that, just do things right (std::vector, presto!)
15:58
node->prev to start from if(is_goal_node(node))
@R.MartinhoFernandes Phrases about "great minds" (or maybe echo chambers) spring to mind here...
Hi. Quick question. Can somebody explain to me what is going on in the last line of this struct definition? I've never seen this kind of syntax.
so if I create the nodes on stack I was getting the node->prev to some random local variable
struct protocol {
    int       id;
    char      *name;
    int       (*accept)(struct iperf_test *);
user784668
@David function pointer kthxbai
16:00
I really like this measure I just came up with: how to tell if your code will only be run once: the build script deletes the source code and all backups; otherwise it's not run-once.
isnt is pointer to function that accepts pointer to struct
Oh. Duh! Thanks!
if it's a full cyclic graph then you can allocate them in a vector still and have internal pointers be indices into the vector (or std::list and still use pointer)
@RE60K ...and returns an int, yes.
@ratchetfreak that's great
@JerryCoffin :)
16:01
@Fanael It also has mutable members and depends on its own address for some operations.
@R.MartinhoFernandes My dad once mentioned a book that he read--and as he read each page, he tore it out and burned it (but he still kept reading to the end).
user784668
@R.MartinhoFernandes Nice, gotta show it to rust fanatics
So basically I create nodes using new and push them onto vector and it will smartly free them... Also point to each other using indices maybe ?
@RE60K don't use new
malloc? variable on stack?
16:03
And honestly, I think it's pretty safe. All operations that depend on which half is active take a parameter that has that information (by inferrence; there are other reasons to pass that parameter, and there are reasons why it's not part of the struct)
let the vector keep them by value
user784668
@RE60K Automatic variables. If that fails, std::make_unique. If that fails, std::make_shared.
@RE60K Both new and malloc are the wrong tools. For most things.
vector to hold a several items with ownership
std::unique_ptr to hold a single item with single ownership
std::shared_ptr to hold a single item with shared ownership
@JerryCoffin Of course. Way beside the point of typed arith in javascript :)
@RE60K nice entry
@R.MartinhoFernandes hehe. We use separate build dirs and ccache, joke's on you :)
@JerryCoffin I have reason to believe your father is even weirder than you. Oooor that was rebellious propaganda in a time of war.
@ratchetfreak unique_ptr<T[]> exists
@ratchetfreak so does boost::shared_ptr<T[]> IIRC. Ah c++17 added it en.cppreference.com/w/cpp/memory/shared_ptr
Something is up with cppreference.com. Or down, for that matter. Up, down, merely sluggish.
16:36
> Yes, Ludlow was guilty — though not of what the university charged him with. His crime was thinking that women over the age of consent have sexual agency, which has lately become a heretical view on campus, despite once being a crucial feminist position. Of course the community had to expel him. That’s what you do with heretics. -- Source
Wow. Not over stretched logic at all.
Ven
Ven
Never
Whew, that's been a long but productive day..
Sounds good
Hey sehe'
Ohai!
16:48
So, you say you have warnings regarding the usage of segment managers vs shared memory. I'm not sure I follow, what od you mean?
@sehe I'm probably not in a good position to evaluate him objectively--but my weirdness probably resulted from his, to at least some degree. Honestly, I don't know any more about the book than what I just said--but he was a young man during WWII, so reading rebellious propaganda at the time wouldn't be out of the question.
@LouisDionne Nothing spectacular, but just one or two things I keep thinking of whenever I think about using BIP
Let's see.
@LouisDionne About BIP's segment managers, I have one basic gripe. The ODF (or memory layout if you will) is inherently architecture/toolchain dependent. No biggie.
user1804599
yummy crisps
However, there is no way to find out about this. You cannot safely 'probe' a file to see whether it is valid for consumption with the binary you're using.
@LouisDionne That's sad, because it implies you cannot actually use e.g. a managed_mapped_file to just persist data. A recompile or some other change could mean the program crashes while opening that file.
The only real workaround I have thought of is rather clumsy: it'd be to use a raw shared_memory_object or mapped_file_region that starts at some physical offset into the "real" shared/persistent thing, and put the detection checksums/fingerprint before that. Next up, you'd have to layer a basic_managed_external_buffer<> on top of that "raw" object to get a segment-manager working.
@LouisDionne So, the gripe, to me, is versionability and error-handling on corrupt/incompatible data (right now, there's just Undefined Behaviour).
That's very annoying.
Any way we could get the author to improve the behavior of the library? It seems like an insanely useful library, but this is a big limitation IMO.
16:57
Next up, the other thing I remember as being painful is: creating/opening shared memory/mapped files is racy. In order to actually do it safely you would need to synchronize access, so you need to use e.g. named mutexes. I don't remember the specifics but there might be platforms (Windows?) where even the use/creation of named mutexes itself was not easy to get right.
Gosh. I wish I had better memory. Does Boost Interprocess have that weird singleton class in its implementation? I believe it exists for this very purpose, and I'm not sure whether it's clearly documented what the limitations are, if there are any still left.
For now, let me say, at least most (all?) examples fail to include the necessary IPC synchronization.
OK. Opening mapped files is not a big deal for me, I do it once at the beginning and I can afford to use any expensive synchronization mechanism,
@LouisDionne Just check that the synchronization mechanism works on your system :) You might need madvice/flocks :)
@LouisDionne Yeah by all means. I've always been able to postpone/skirt the issue. But I'd be happy if the library removed that threshold :)
@LouisDionne It is insanely useful and I've used it for many many ad-hoc tasks. It just abstracts things away so nicely.
Regarding your answer to my question: I'm not sure I understand why it wouldn't work if the readers don't try to read beyond what's mapped in their own process.
17:02
It's much like Boost Multi-Index: a great productivity booster, but some rough edges for production use
(BMI is much more amenable; I'd not hesitate to use it in production. It's just that most often the performance equations favour a hand-built datastructure)
@LouisDionne The point is: they will. At the very least: you can't control that. The segment manager does. And it is expressly documented not to support this. So "it might read beyond the original size" should be "it probably does". To me, as a programmer that equates to "it does".
So basically, the issue is like: writer grows the map, readers don't. Then, I try to grow the map for the readers through the segment manager, but the segment manager sees that the map is larger than it really is (from the data stored at the beginning of the map, which has been updated by the reader), and things break. Is that the issue?
Ven
Ven
I finally understand DEFINE-METHOD-COMBINATION. CLOS is a strange, strange beast...
@LouisDionne Yes, except for the I try to grow the map for the readers through the segment manager step, which is unnecessary for the breakage
user1804599
@Ven Looks like COBOL.
@LouisDionne If the client still has the segment mapped, at all, and accesses it, it will see control structures referring to things beyond the extend extent mapped. Leading to, undefined behaviour since BIP doesn't need to check (it's clearly documented as unsupported)
17:09
@sehe But it's not like the segment manager will try to access those things that are out of bounds just for the sake of it, right?
I mean, if I try to access them because I think they're in bounds, then that's my problem, but the segment manager has no business going into the heap it's managing (which is full of my own objects). No?
Ven
Ven
@rightfold except it has a MOP
I don't think COBOL 2012 has generic methods.
(/ multimethods)
@LouisDionne You can't know how the heap is implemented. If it's some kind of list, it might address from the end backwards, for whatever reason. So a simple readonly operation (lookup of previously existing data e.g.) could go outside the old bounds.
Note, I'm speaking to the documented functionality, and explaining how it makes sense. If you want to know whether it's easy to "lift" these limitations (say to keep read-only access to the "old" data) that's a question to ask the maintainers, I think.
@sehe OK, thanks. Do you see any workarounds for what I'm trying to do?
I mean, this has to be a common use case, no?
@LouisDionne I also think you should be safe iff you avoid all use of the segment manager, at all. So, iff the "server"/"producer" doesn't touch the existing data and the client only indirects process-local pointers into the already mapped area, that it already had before the resize, then I agree that you should probably expect everything to work.
@LouisDionne The workaround I've used is to communicate a "please-remap-your-shared-realms" between processes.
Not much of a workaround. More like "acceptance" :)
@sehe So you actually call grow in the readers, then, or you kill the current map and remap completely?
The latter seems inefficient?
17:16
And: overdimension and never grow. It's good that virtual memory is "free" :)
@LouisDionne No, only one party can grow, as documented. Nobody else should even have the map open (otherwise at least, add synchronization). After reopening, all parties will automatically see the new size.
@LouisDionne Yeah. remap completely might be inefficient (however, grow in-place might not always be possible, if at all on certain arch; after all, what if the adjacent address space is not free)
I see. So the writer says "shit, I'm about to grow". It notifies the readers. The readers close their maps. The writer grows its segment and notifies the readers. The readers re-open their maps.
Yup. Like I said:
2 mins ago, by sehe
Not much of a workaround. More like "acceptance" :)
Yeah.. That's not great since it requires a downtime where all the readers have their stuff unmapped (so they can't do useful work).
@LouisDionne Consider simply overdimensioning. Since it's virtual memory, you might get away with just "allocating" a TB. If it's a mapped file, just make it a sparse one (I've done that. No problem creating multi-terabyte mappedfiles in tmpfs)
user1804599
@Ven mop is honey in dutch
17:21
Not where I live.
Honing is honey.
"mop" could be "schatje" or "liefste"
@rightfold Also. Whatever happened to orthography? Capitalize "the greatest language on earth" and end your sentences!
@sehe oh honey
@sehe So I just go like ipc::managed_mapped_file shmem(ipc::open_or_create, "foo.bin", 1 TERABYTE);?
user1804599
@sehe Yes, honey.
@LucDanton Yeah, I was confused too
that TERABYTE
looks like a shitty macro
17:23
placeholder
ok
carry on then
@LouisDionne Mmm. Let me think now, how I made sure the file was sparse. Damn. I don't remember how I did. Must have been pre-created (probably just ::seek(fd, ..., 1ul<<40) and write 0 bytes.
Maybe I've not done that for managed_segments, but just raw mapped_file. Sorry if I gave you false hope there.
You could do a two-step boostrap:
1. create managed_mapped_file as usual (small)
2. grow it as a sparse file (using DD, fallocate64 special flags,... ?)
3. `grow()` the managed mapped file (cross fingers)
4. ????
5. hope the file is still sparse
That's sketchy too
The main point was about virtual memory not being real. So you can get away with mapping large segments even if largely unused.
I have to run. Be back in a few hours.
Ok. Thanks a lot for the help anyway.
Cheers :)
Ven
Ven
@rightfold well here, MOP means Meta-object protocol.
we like metacircularity quite a bit.
user1804599
17:31
and here it means honey
user1804599
so there's that
Ven
Ven
honey usually isn't metacircular.
 
1 hour later…
18:51
@sehe the goal was to delete the source, not the build output.
19:17
your collective faces
how dafuq do I handle events
Ven
Ven
get drunk
user784668
@Puppy discard them
that could work
ah fuck it
I'll just fire the events for everybody and let the library user worry about it
Xeo
Xeo
20:03
didn't we already talk about this
do proper capture / bubble propagation, man
20:55
that.. is not the problem
before you can do the whole capture/bubble thing, first you need an actual destination
not sure how to determine this
no.
ScY
ScY
I can't find good HD streams
thx
21:26
@ScY Not sure about the anime, but you can listen to the excellent soundtrack pretty much anywhere.
ScY
ScY
@Morwenn I want to watch the anime because of its soundtrack. It's really nice
I didn't know Nujabes produced anime music. IMO, it's one of his best albums
I guess I never listened to proper Nujabes albums, only mixes.
Older Anime can be really hard to find if it's not a very popular one.
For one, the torrents would be long dead. Those tend to only last a few months. DDLs are hard to find. And when you do, they tend to have a lot of strings attached.
So the only option left is to buy the DVD/BluRay if it happens to have official subs.
On the other hand, Samurai Champloo is popular :p
A lot of the Anime conventions that are big enough will have a bunch of dealers with racks and racks of old obscure shows.
ScY
ScY
21:40
... It seems to be on youtube
But it's english dubbed so... no
rip in pizza
People are strange.
And I'm way too tired.
Night :)
22:11
@jaredpar @jonskeet But NotMonoOnly isn't not the most unreadable one
lol
@Mysticial at my workplace that would be a normal question. However, we would not be asking around on SO
@R.MartinhoFernandes I got that! But in our setup, it would only delete the build output. I'm pre-innoculated against cynical instruction :)
@rightfold it still doesn't, snoesje
23:03
@R.MartinhoFernandes Hmmm...seems like the original Intercal compiler helped reduce bugs by deleting the input file if it detected an errors.
@JerryCoffin That might be a better way to deal with failing tests than to use a Volkswagen approach.
"What's the issue?"
"None at all. Can't repro because the car exploded."
@Mysticial That sounds more like the Pinto approach.
@Mysticial w...what?!
00:00 - 13:0013:00 - 00:00

« first day (2362 days earlier)      last day (2812 days later) »