« first day (3104 days earlier)      last day (1827 days later) » 

1:27 AM
@Puppy Well, Aerospace engineers have to solve that problem eventually anyways.
 
1:45 AM
@ratchetfreak But I have to get VPN first ...
 
I just finished refactoring a portion of my code, build times are up from 7:32 to 10:52! Do I get paid for this?
 
@Mikhail you made it slower? then of course you get paid
 
It builds more now, at least before LTO
 
what does 7:32 mean then
 
make make is a curious command.
 
1:53 AM
Before I made these changes my code took 7 minutes and 32 seconds to build. Now it takes 10 minutes and 52 seconds! I am the greatest.
 
Not 7 hours 32 minutes? We are disappointed at how small your project is.
 
yeah, what is this amateur hour? come back when it's over 5 hours
:P
 
A rumor I used to spread was that in the mid 2000s Photoshop took so long to build, they couldn't do daily builds because it more than a day to build.
 
I think I am going insane, I have some kind of problem with 4-5 things I am currently active or inactively doing at the moment.
But I can not slack either, it would only make things worse.
What if we use a catapult to send an UFO shaped spaceship into space?
 
2:09 AM
It burns up before making it.
 
I mean, using catapult can make the spaceship to go at great initial speed. Then use the air pressure difference between upper surface and lower surface to achieve even more uplifting.
@Joshua How so?
 
Photoshop was an interesting example of a code base with way too much history. For example, it implemented its own widget kit with adapters for target platforms. Kinda like firefox. But it was a port from the original pascal code.
 
The great speeds required for space are far above what can be sustained at sea level. We can kinda do it from 30,000 feet.
 
Why 30,000 feet?
K2 seems to be a good choice (28,251 ft).
 
Ah; that might be barely possible. Typically, this stunt was done by dropping something from a high altitude bomber for testing.
 
3:07 AM
I want an approximately equals operator to overload
 
 
2 hours later…
4:42 AM
Qt users discuss how to implement basic image scaling, after a decade, no "good" solution exists: stackoverflow.com/q/8211982/314290
 
 
1 hour later…
5:55 AM
Apr 10 at 6:08, by Mysticial
So I'm actually going to block him.
^^ So the guy used a different email and started hurling personal insults at me. Nice.
 
I respect people who puts effort into chasing things. Usually I try once, if no response, I move onto other things - too many amazing things in this world. Unless I own those things, then I have no choice other than taking care of them.
 
You need to invent a category of records that are less financially draining, like speed, or power consumption. Although probably somebody thought of this.
 
6:33 AM
@TelKitty They did solve it- they invented rockets.
 
To solve a static_cast problem when connecting signals and slots Qt adds qOverload instead of just renaming the function. stackoverflow.com/a/16795664/314290
 
nwp
7:27 AM
qOverload is actually pretty neat.
 
Like how it aliases with QOverload?
 
nwp
How it makes the static_cast less hideous.
 
the alternative is to have a different fucking name
 
nwp
Or allow passing templated and overloaded identifiers. That would actually be useful.
 
Basically, if their shit name convention was a girl you could fuck her. Its backwards compatibility, but this stuff is holding the framework back.
After 5 years, they still won't fix my GUI bug, for backwards compatibility reasons: bugreports.qt.io/browse/QTBUG-44056?attachmentViewMode=list
 
nwp
7:41 AM
What is holding Qt back is that it is older than std::string and has developed in a different incompatible direction.
 
What specific problems were you thinking about?
 
nwp
They have their own type traits for "memcpy-able" for example.
They can never get rid of QString.
They somehow love raw owning pointers.
 
Yeah, the owning shared pointers is pretty screwed up.
My bigger concerns is that even if you put up with all that stuff, it fails at basic rendering tasks...
Or it takes too damn long to code anything.
But I can't really figure out what would help those two problems. Replacing the rendering backend with something without legacy stuff would help. For example, there are 3 competing ways to style widgets.
 
nwp
I have never styled widgets.
Rendering bugs are somewhat common, but haven't been too bad for me.
 
nwp
7:51 AM
What annoyed me greatly is that there are no signals for tracking changes to a QPlainEdit because I actually really need that.
 
I'm finishing up this interface, it took around 20 hours of work. Code is neither functional nor elegant.
I also don't understand this one part. If you have a custom widget that holds a structure it's going to have a valueChanged(const my_struct&) signal. Now if your struct has many, many members each one is going to have a valueChanged() that ends with the parent structure. So, the data you pass in each message seems to "snowball". Is there an alternative, that doesn't result in a massive amount of data being passed through the message pipes?
 
nwp
Has not been a problem for me. Also a reference doesn't count as massive, not even when passed through 10s of widgets.
Also I don't do marshalling like that. Just connect the signal to the lambda that needs the data.
 
QObject::connect(ui_.wdg_hardware_settings, &fixed_hardware_settings_selector::fixed_hardware_settings_changed, this, &slm_control::update_settings_file);
Ah, but you need to "gather" the structure from the widget? Where update_settings_file() grabs a fairly large structure and emits it
 
Well Qt "solves" that for itself by just reference counting and CoWing everything
 
nwp
I think I have not used proper slots in a long time.
 
8:06 AM
@Mikhail don't have a valueChanged for each field?
 
Then, just a void changed(void)? signal? Obviously, you have to propagate the change up the widget hierarchy (which mirrors the struct hierarchy)...
 
nwp
8:35 AM
Why do you need to propagate change?
 
change in the widget triggers an action on the hardware side
 
nwp
Let me rephrase: If changing 1 widget causes all parent widgets to produce a change signal then I can see that you drown in signals. You could instead not do that and require whoever needs to know about the change to find the right widget.
 
Then the GUI wouldn't be interactive? Aka, if you change a QSpinBox I want something to happen...
 
nwp
You still have that. You connect the signal of the spinbox with a lambda that does the thing.
But no default "notify parent of change" signals.
 
Yeah I see what you mean, I used to do something like that, aka in the child QObject::connect(myspinbox,QSpinbox::valueChanged, [&]{auto settings= gather_settings_from_topmost_parent(); hardware->update(settings)}
 
8:42 AM
only propagate what people are interested in and only in the form that they would care about
 
Feels dirty tho, because every child needs to be able to "know" about the device, and the top most parent, which reduces the widgets re-usability.
 
nwp
Why did you go away from that? Didn't scale? Too hard to follow?
 
In my current code, I need to reuse the widgets.
 
the custom widget can expose the changed signals people care about and also manages the connection between the subwidgets to the signal it needs to send out
that way if you have several widgets controlling the camera you can expose a single cameraChanged signal
 
nwp
You can make the connection outside of the widget so that the widget itself stays reusable.
 
8:44 AM
Yeah, that would be something like connecting up a hierarchy of valueChanged(void) instead of valueChanged(struct) - which might not be a terrible idea.
 
nwp
9:35 AM
Opening 40 message boxes at once and it doesn't even crash. Very user-friendly by the way.
 
idk, i've been coding for too long. What does your statement imply?
 
nwp
Nothing relevant. The program tended to crash when someone tried to open a message box while another message box was open. Now it does not anymore. I feel like I accomplished something, despite the fact that the accomplishment is useless because multiple message boxes at a time are bad either way.
 
you need to write something that cascades them, for the ux
 
nwp
Totally cascaded.
Those should probably not be modal dialogs, but effort. QMessageBox::Warning is easy and making a proper dialog thing is not fun.
 
why not a error/message log window that the user gets redirected to if more than one error comes up?
 
nwp
9:50 AM
Some errors and warnings do that.
Interestingly it seems to be similar to return code vs exceptions.
 
cascade
 
nwp
This is a "should never ever happen" kind of situation that warrants an exception.
Oh yeah, I remember that from old Windows times. Apparently Qt doesn't do that.
 
nwp
10:15 AM
I love gdb.
Let's see how high it goes.
35GB and it just keeps going. Does Windows 7 have an OOM killer?
It actually stabilized at 48/16GB. I did not expect that.
I can confirm, Windows 7 does have an OOM killer. But it asks before killing which is nice.
 
 
3 hours later…
1:03 PM
Boost.Variant discussions in all their glory: lists.boost.org/Archives/boost/2019/04/245989.php
 
 
3 hours later…
nwp
3:49 PM
> virtual memory exhausted: Cannot allocate memory
Rip travis build.
 
4:03 PM
Why does Chrome stay at version 75 instead of version 34, when I do this?:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

export PATH="$PATH:${HOME}/depot_tools"
mkdir ~/chromium && cd ~/chromium
fetch chromium
cd src
./build/install-build-deps.sh
gclient runhooks

git checkout -b tags/34.0.1847.9
gclient sync --with_branch_heads --with_tags
cat chrome/VERSION
 
4:40 PM
When emplacing a POD into STL containers, it is guaranteed that they are zeroed?
IOW, do all STL containers do new (ptr) Object(...) instead of new (ptr) Object when no constructor operands are passed?
My tests seem to show this is the case. But I can't tell if this is required by the standard or just a compiler-specific thing.
 
4:52 PM
@Mysticial a.emplace(p, args) [...] Effects: Inserts an object of type T constructed with std::forward<Args>(args)...
 
@JerryCoffin that in turn rests on EmplaceConstructible, which leaves entirely up to the allocator it looks like
::new((void*)c)C(forward<Args>(args)...) is the default behaviour in std::allocator_traits, which will indeed perform value-init for an empty pack @Mysticial
 
@LucDanton Which is value-init? The one that does the zeroing for PODs.
 
it does do that yes
 
Admittedly, I'm not language lawyery enough to know. lol
Damn... thx
IOW, the standard does specify it.
 
the gist of it is that 'zero init' is a term meant for behind the scenes, 'value init' is what programmers normally want and perform
behind the scenes of making the spec for the C++ language, is what I meant
 
5:08 PM
Someone reported a perf bug to me today where they were putting a large POD into one of my data structures. The implicit zeroing was causing a 20% performance hit. He worked-around it by adding an empty constructor. But because of the performance hit, I was thinking about changing the behavior to not value-init on PODs and then blasting out a notification to announce the change.
But if it deviates from the STL behavior, then it's not a good idea.
 
broadly speaking, you should require the user to supply a value
it's not super great to depend on default construction of any kind
 
@Mysticial we’ve talked about it before, but there is room in way these things are designed for an allocator which performs default init
 
and should definitely not leave it uninitialized
 
Looks like it's not just PODs, it's any object without a default constructor.
 
5:27 PM
@Mysticial IIRC yes, this is actually one of the debates right now with the committee to provide a 'resize raw' method of some sort that just resizes and copies the existing as is but doesn't zero the rest.
 
@Mysticial Yeah--if you don't specify otherwise, it's going to value initialize (=zero) the new data. But as Luc implied, if you want to avoid that, the leading possibility would be to define a special Allocator.
 
5:59 PM
should I be using itoa to convert an int to a char*
 
std::to_string unless performance matters.
 
dont convert anything to a char* unless you really have a problem
 
I really just need to hash
seems like an easy way to create a hashing int from chars
while (c = *str++)hash = ((hash << 5) + hash) + c;
correction* unsigned long hash = 5381
 
eww
 
6:14 PM
that's what she said
 
@Rick unsigned hash = 5381; while (input) { hash = (hash << 5) + hash + (input % 10); input /= 10; }
 
@Mysticial I imagine it’s obvious to you, but ultimately the typical program invariant in these matters has these pieces: the slice of memory up to capacity (as given by the system), how much of it you're using for initialized purposes (i.e. actual values), how much of it you're using for uninitialized purposes (i.e. soon-to-be actual values)
std::vector can only keep track of system capacity and one other thing which gets labelled the size (i.e. normally initialized things), and there’s just no more room for extra information
 
@LucDanton My issue here is much simpler. It's just a performance problem. If I add an overload for emplace(...) that takes no operands and does new (ptr) Object, would it catch anybody by surprise.
 
@Mysticial I was just about to talk about that :)
 
lol
 
6:21 PM
@JerryCoffin I hate it because it's better than what I have
:)
 
@Rick It will give a different result than you were contemplating. If you want it it come out the same, you'd want input % 10 + '0'.
 
I'm fairly sure it’s not strictly by-the-books, but I suspect that it would work: allocating containers are really, really supposed to go through the allocators for that sort of things
make sure not to scribble the memory by going through the vector interface though, you’d use (cont.data(), cont.capacity()) of course
 
@Mysticial The primary surprise would be if somebody provided their own allocator, and your code basically ignored it. Given the number of times I've seen people define their own allocators, that would be quite rare though.
 
also what are you going to do when/if you need to resize?
 
@LucDanton The data structure doesn't resize.
2
It owns the memory that the object lives in.
 
6:26 PM
@LucDanton That's easy (as long as you only ever resize smaller).
 
But it's shallow though. If the object is std::string, that can still point elsewhere, but those indirect allocations are out-of-scope of the data structure.
 
as long as you mind all these things
 
 
1 hour later…
7:51 PM
@Mysticial In the end, there's only one rule you must never break: never read from uninitialized memory.
You may think: "What's the big deal? It's just garbage data."
But that's not true. If you read from a page that was allocated but never written to, then a read from that page will trigger a switch to kernel mode. And the kernel knows that this memory is uninitialized, which means that it can return anything it wants. IIRC, on a Linux system the kernel will always return zero.
 
@StackedCrooked Windows does that as well.
And every modern OS. If they don't zero it, it becomes a security issue.
 
I vaguely recall that some library (libssl?) once used uninitialized memory as a source of entropy for their randomness generators. It was a big mistake.
 
lol
 
@StackedCrooked OpenSSL, the great key regening
 
8:02 PM
haha
 
8:17 PM
@StackedCrooked Given my understanding of their description, the optimization on not writing null terminator was indeed lost, but they could still have that "bogus null terminator" thing to check if someone isn't relying on actual null terminator
Have all the functions put in \xCC instead of null terminator, and have c_str() put in \0 conditionally like in their code
 
I don't understand.
 
IIUC, they are putting in special code handling in their fbstring to see if someone doesn't do s[i] != '\0' in a loop or similar
so instead of maintaining a invariant that s[s.size()] == '\0', they could maintain an invariant that s[s.size()] != '\0', until after s.c_str() is called
at which point you can rely on s[s.size()] == '\0'... until a non-const function gets called on s
 
So before c_str() is called the terminator is a non-null character. Once c_str is called the terminator must be zero?
 
(which would invalidate .c_str()'s return value by standard's rules)
yeah
 
Doesn't that mean c_str must write the terminator to zero every time?
(Which was their original solution?)
(I'm dumb so I'm probably missing something.)
 
8:32 PM
that was their original solution, so they made the change with the if(s[s.size()] == '\0')... which was broken because s[s.size()] was uninitialized
 
@StackedCrooked There's a long history of people using lousy sources of entropy for SSL keys.
 
so we just make it initialized... except to a different value. Of course, this is not an optimization anymore
...but it still ensures that people don't rely on null-terminator needlessly
 
@JerryCoffin Reminds me of a controversy I read about on the competitive Pokemon video game tournaments.
In the video game, each pokemon is "unique" in that it had randomly generated "stats". The probability of getting one with the highest possible stats in all categories was basically 1 in 2^30.
But the RNG for one of the games was reverse engineered.
And you could reliably manipulate it in a deterministic way.
 
@JerryCoffin also proof that valgrind can break bad code
 
So people were basically entering "legitimate" pokemon with the best possible stats for a competitive advantage.
 
8:36 PM
@Mysticial I tended to prefer games where they gave you overall maximum, and you got to choose how you divided it up--but everybody at least started with the same overall total.
 
@JerryCoffin RPG games, basically?
 
@JerryCoffin Pokemon has both. All other factors the same, stats are a combination of an IV "randomized individual value" + EV "experience value". The total EVs are limits across all the stats. You can choose to distribute them how you want.
 
@StackedCrooked Role playing game games? Yup, that's the ones. :-)
 
In the newer games, they finally put a time component into the RNG. So you can't reliably manipulate it anymore outside of an emulator that gave you cycle-accurate control of the game processing.
 
@Mysticial ...and, of course, it's impossible to simulate something as complex and sophisticated as a Gameboy with anything like that kind of accuracy! :-)
 
8:42 PM
haha. The rule being that you couldn't use "external tools" (like Game Shark or Action Replay) to hack the game. I assume that implies running through an emulator.
 
don't some processors have some sci-fi level shit that looks at some particle decay that's supposedly random and gives you some random value?
 
IOW, the RNG hack in the older games could be done on a handheld DS.
 
how much does performance drop when using globals in your class methods
 
@ScarletAmaranth A few people build true RNGs based on decay of Americurium. The ones built into a processor are normally based on thermal noise in a diode (also a true random source, but a lot easier to build in semiconductors).
 
yup, sci-fi-level shit just about sums it up! :)
 
8:45 PM
The funny part is that there's a "counter" application in the game that contributes to the RNG. But IIRC, most of the basic navigation wasn't. So once you got to the state where you're ready to battle the pokemon you want to catch, you figure out what the state of the RNG was (which was apparently possible), then open up the counter app and set it to the right value to tweak the RNG to the right position to give you what you wanted.
 
@Rick Someday I'll have to write some code with a global to find out.
 
I just noticed a near 50% drop in speed. from 28ms to 40ms on average. that seems ridiculous
 
@Mysticial The more things change, the more they stay the same. Back in the late '70s (or so) I used to explore Apple II disks with a hex editor and max out my stats. Sounds like things haven't really changed all that much since...
@Rick Unless your "globals" are actually stored on a disk so they're global to the entire system...
 
Okay, not as simple as what I remember: smogon.com/ingame/rng/dpphgss_rng_part1
But the fact that it's on that site means it's an approved method for acquiring pokemon for official tournaments.
 
@Mysticial Still looks simple enough that my six year-old son could manage to follow the directions and do it...
 
8:55 PM
@JerryCoffin Check page 2.
 
@Mysticial Ah, that does look like it might be just a bit beyond his level...
 
@JerryCoffin You lofty tree =) You can still be felled by hatchet, axe or saw.
 
@CaptainGiraffe I'd have thought you of all people would recognize that without tall trees, giraffes tend to go hungry.
 
@JerryCoffin I might go hungry, but It's a fight for equal rights =)
 
@CaptainGiraffe This is a writ to recognize your right to write global-free code.
 
9:07 PM
@CaptainGiraffe fight for the right to masticate.
 
@JerryCoffin I'm here to defend the right to write code using globals. Every system has them
@Rick That is the fight the of my lifetime.
 
@CaptainGiraffe Is somebody attacking this right?
 
@JerryCoffin Not in my natural habitat, no.
 
@Rick I've probably told you guys about it before, but when I was in high school I knew a girl (name Heather, in case you care) whose mother had that kind of sense of humor--her favorite was to walk into a fancy restaurant and in a fake-shocked stage whisper say something about: "Oh my goodness honey, there's a man masticating in the corner!"
 
So another curiosity; A student asked me. Captain, how many algorithms do you know?
 
9:13 PM
@CaptainGiraffe I'm a celebrity in the algorithms world, so even the ones I don't really know still try to act like my best friends.
 
@JerryCoffin sounds like my kind of women.
 
@JerryCoffin please tell.
 
@Rick Strange how memory works (or doesn't). I remember Heather's first name, and what she looked like, but can't remember her last name at all.
@CaptainGiraffe I just did.
 
@JerryCoffin Mind expanding? =)
@JerryCoffin We have this understanding of the basics, we can build an infinite amount of solutions to different problems. Still Knuth is the only one I know of to declare P = NP.
Y'all remember Johannes LitB he used to frequent here.
 
@CaptainGiraffe I don't think he's actually declared it--just said that he suspects that it may be true. Personally, I disagree with him on that point though. But yeah, once you get beyond the basics, it can get difficult to set boundaries where you can state unequivocally that it even qualifies as an algorithm. For a while last year I was working on code to build/validate/invalidate/update a distributed cache. Still not sure whether it qualified as a single algorithm or a half dozen related ones.
@CaptainGiraffe I distinctly remember forgetting Mr. Schaub.
 
9:24 PM
@JerryCoffin I was at a seminar/ Q&A of his titled "Ask anything" - His first statement was "I expect to find a complex solution in P".
@JerryCoffin Why do you say that, I remember Schaub fondly. I remember he said left because his colleagues taunted him because of his contributions here.
 
@JerryCoffin it's probably because the first name is more interesting than the last. It sounds like fether. It's synecdoche, a part for the whole. Soft, fun, and comfortably inappropriate. Heather was more than just heather, it was the heather experience.
 
@CaptainGiraffe That sounds stronger than anything I'd heard him say.
@CaptainGiraffe It's a joke. A leftover from the '80s ('90s?) when some politician was being questioned about his highly questionable activities, and couldn't quite settle for for saying "I don't remember", and more or less incriminated himself by saying (to the best of may recollection) what I quoted above.
 
@JerryCoffin This was spring 2017 in Stockholm, I'm pretty sure Knuth arranged this to be the first Question/Answer. It might be an old man be hip shot/controversial, he was talking about solutions N^100 with huge factors. ... Ah thanks.
 
@Rick Most guys wanted the Heather experience (but she remained a virgin).
 
9:43 PM
If I had a daughter I would never name her Heather. Heather seems like that daughter you are always worrying about. I'd name my dauther Hogarth.
Hogarth can take care of herself.
 
9:57 PM
*daughter
 
10:13 PM
I saw litb type something here a few days ago
 
11:04 PM
@JerryCoffin I really miss Heather. She made the green leafs look greener.
 

« first day (3104 days earlier)      last day (1827 days later) »