« first day (2649 days earlier)      last day (2300 days later) » 

12:00 AM
 
12:32 AM
383
A: A Moose, Some Silly Putty ... And A Desperate Plea For Help

Alexander O'MaraLEGO Stack Overflow Hat Basically I made a life-size and wearable LEGO ball cap with Stack Overflow logo. (Yes, it's 100% LEGO; I'm a purist. Angles achieved mainly by SNOT building via hinged plates.) Possible task to get the hat: Pick-up-the-pieces: Edit a negatively scored question, t...

 
1:03 AM
@sehe That's amazing
 
1:58 AM
So there was something terribly wrong with` std::string`'s constructor that takes a char* and an int right? Like it takes ownership of the pointer or something else?
 
huh. Do you ever write c++ code? Perhaps you should not :)
 
I got a case of the UB, but because its IPC through another language nothing is quite crashing. Where are the memory protection gods when you need them?
 
It's just confusing. std::string(size_t, char) vs std::string(char const*, size_t) prolly
@Mikhail That's makes surprisingly little sense
 
Idk, stack smashed but nobody gave a fuck
 
@Mikhail Where are the unit tests if you need them?
 
2:05 AM
@sehe Its failing the validation tests, its actually passed the unit tests :-)
But I don't get paid to write tests :-)
 
:)
Half point awarded.
 
Can I get the other point when you learn that I'm a solo software developer?
Problem is that the units are in C++ but the validation is in VB .net
I've been debug this crap for like 4 hours and I'm kinda freaking out because I have no clue why what I believe are the equivalent function arguments in C++ and VB .net are doing something different :-/
 
@whitequark Good on you. Debuggers are for the weak. Just read the raw mangled name until you realize the bug, fix it and resume meditation.
@Mikhail On the contrary. That means you forfait the game. You're to blame.
@Mikhail Trace more. ("what I believe are the equiv. args" and "doing something different" sound too feeble). How do you achieve interop? P/Invoke, en.wikipedia.org/wiki/COM_Interop or C++/CLI (managed extensions, maybe even)?
Oh wait. COM (ATL or MFC? raw midl + interface implementing?)
 
Whatever <DllImport("compute_engine.dll")> does
Actually its not IPC, I re-did it without IPC...
 
P/Invoke
@Mikhail Then why did you mention it. I take it, now, you're doing shared library invokes
I believe I've seen generators translating headers to equivalent Declare statements. Keep in mind that compiler flags can ruin things (things like framepointers, calling conventions)
 
2:16 AM
RC car arrived, now I can start modifying it and putting raspberry pi in it
 
I also assume the actual interop calls are extern "C" {}?
 
Kinda the interface is strict C so no classes, also has__declspec(dllexport) per dll
 
To be safe from some of these ABI issues, I think you actually need to extern "C" the stuff
 
Is that compatible with the C programing language?
 
That's the point
Because declspec(dllexport) is not C-specific.
 
2:20 AM
Probably an well placed #define would maintain compatibility with C
 
Have you been using P/Invoke (this) before, with success?
@Mikhail Why? There's only going to be one binary, so having different "reading" of the header is not going to help
 
Yeah, all other functions of the validation test seem to be working. Basically this shit won't write a file and I'm not sure why. Nothing is crashing, but no file either.
 
Have you tried tracing (I know the irony if tracing needs to be done to a file... ::OutputDebugMessage could help)
@Mikhail Permissions? Working directory?
 
Actually I'm invoke the Windows popup dialog on the C++ side, but everything seems correct... but nothing is produced. So then I ran some disk monitor to see if the file was ending up somewhere else, but it looks like its never written - anywhere.
 
If the C++ code is MSVC I'm pretty sure you can mixed-mode debug (maybe you need to "attach" the debugger to a running process and select "Native" as well as "Managed"). So you can actually step through
@Mikhail Leaves permissions open. Anyhoops, it's more likely that the interface is incompatible, yes
 
2:24 AM
FF is using 6GB of ram and VS is using 5GB. WTF...
 
File feedback on MS code (they should optimize for machine utilization!)
 
@sehe If I call an external C function from a .net language, that just performs a standard function call right? So the permissions are the same as the running process, and shouldn't be an issue, right?
 
Normally, I run a 24GB ram drive. And that idles me at about 30GB of ram. That leaves me with 34 GB which is enough to do a full compile without too much swapping. But I'm idling with 16GB + 24GB ram drive = 40GB.
 
@Mikhail Depends on whether the user running it has the permissions. But I was assuming you were creating the file in .NET (in which case stuff like code-access-security etc. might apply).
@Mysticial Shakes hand. I run a (max) 20GiB RAM drive - on a 32GiB box
Current status: i.imgur.com/akBofD8.png
 
up-time is unreasonably high
 
2:37 AM
@sehe what do you use that drive for?
 
Everything really. --build-dir=/tmp/boost, all the SO answering goes there (so I cleanup everything including git clones, third party things, test data etc.)
@Mikhail It's in standby ~50% of the time.
Do you reckon I should have had a kernel update? Usually ubuntu mentions this
 
@sehe huh, no SSD or not performant enough?
 
It's a habit from before SSD, really
And back when SSD's were precious and came in 30GB sizes I made it a point to prevent unnecesary wear (lol, yeah)
@LucDanton (courtesy plink)
 
I let that go when I started needing all my RAM for the compilation :)
 
It's obviously a conspiracy. Make everyone use more ram when ram is so fucking expensive.
 
2:51 AM
if the people who make libraries also sell rams, that would make sense
 
@LucDanton On linux, RAM is only claimed for tmpfs when needed, so I don't have to think about ot
it*
 
3:17 AM
what does argc and argv do in main
they look like they are undefined and uninitialized
 
you need to pass them into main
they are parameters to main function
 
I have
but how can they do anything
there is no mention of them in the function block
 
3:50 AM
You have to put them in the parameters if you want to use them
 
@Mysticial I got 2 tabs in FF, 670 MB
Although its pretty fucking hilarious that consumer memory is approaching server RAM. We should get rid of consumer grade hardware. Any desktop without two sockets isn't a real computer.
 
4:24 AM
@Mikhail Any computer that's not RGB'ed from top to bottom isn't a real computer.
 
@Borgleader
user image
3
 
what the hell has your rep done now
it's gotten too large and started overlapping your notifications?
...
have you posted the bug to meta :D?
 
4:44 AM
rep 101
 
user406009
5:05 AM
Red, green and blue fans are overrated.
 
user406009
All the hype is in yellow
 
user406009
 
user406009
When you see that, you can't think of anything except "power"
 
5:26 AM
@Lalaland My immediate reaction is more like: "they talk about when the shit hits the fan, but apparently somebody peed on this one."
 
5:38 AM
@Lalaland Pretty bad ass i must say
 
@Lalaland i used to sleep in the same room as colored fans, so i just think of > well now i cant look that direction
 
@Lalaland a nice purple seems good, like Mace Windu's lightsaber
 
5:58 AM
@sehe Name? You should be able to detect the error from a raw octal (or hex, if you insist) dump on (on fanfold paper, of course).
 
6:18 AM
So, is there some way to check that a given .pdb file matches a given .dll?
 
@Mikhail Yes.
Oh, now I suppose you want to know how too?
 
No, I already figured it out
Now I just gotta figure out what the heck vb .net's String type is actually passing into my functions. Was supposed to be a wachar_t, but looks like fucking Japanese and is terminated by the sequence afxoldw :-)
 
why the hell are people so obsessed with LEDs
on compugers
gamers live in an alternate world to reality
 
@CoderCat Reality is a cheap crutch for people who can't handle drugs.
 
Is there standard verbiage that indicates whether low- or high-endianness applies to bits or bytes?
For example, take this description of a byte array which contains a uint32. "The first byte is 7:0, the fourth byte is 31:24."
Is there a better way to word this description of an array, which is low-endian for bytes and high-endian for bits?
 
6:33 AM
what about explicitly saying "the byte order is low endian"?
 
@JerryCoffin ... and drugs are a cheap crutch for people who can't handle C++.
 
@NickAlexeev Nobody can handle C++.
 
HWND
 
@Mikhail Yup, some people can handle windows.
Others were taught to keep their fingers off the glass.
 
@login_not_failed Sounds about right. I'll go with that.
 
6:36 AM
@NickAlexeev s/low endian/little endian/
 
lol I didn't notice that it was "low" instead of "little" even when I was typing
 
@login_not_failed Swift would be so disappointed.
 
he's fine, pretty sure he works at Intel
 
:/s/Intel/Apple
 
yea<CR>
 
6:39 AM
@login_not_failed Microchip, actually. But I don't know which side the company is in the Endianness Religious War. I'm new.
 
@NickAlexeev If memory serves, PICs are little endian.
 
@JerryCoffin AVRs and ARMs are a part of the family too, as of late. I'm not with any of the groups who develops microcontrollers or compilers, though. I'm with analog and power people.
 
@NickAlexeev I think it's fair to guess most of those are neutral in the great Lilliput/Blefescu war.
 
7:09 AM
Fuck, I figure out the issue you need to specify the CharSet manually. But only one function was failing, because I had a bunch of zeros in my strings and those conversions were correct no matter what garbage I passed in.
 
7:27 AM
Are you using the infamous StrConv functions
 
8:03 AM
On the C++ side, no. But part of my API passes the size of the string so that no memory faulting happened when I converted wchar_t* to std::wstring for some reason, other templated libraries correctly handled the std::wstring despite the std::wstring having junk data... Or rather having good data + junk
Basically had to do <DllImport("fml.dll", CharSet:=CharSet.Unicode)>
 
8:50 AM
@ArkadiuszKoćma afin de me fondre avec les autochtones cette année j’ai acheté une couronne des rois
 
9:03 AM
Note that if I can make up self-contained examples from the hints you're dropping, surely you could have made a SSCCE (sscce.org) — sehe 7 mins ago
In which I make up several versions of 100-LoC SSCCE, as you do.
 
@JerryCoffin Somewhere deep inside my unconscious mind this translates to "big indian" and "little indian".
 
@Mikhail TIL, cheers for sharing
@StackedCrooked Hiawatta?
 
Never heard of that.
 
Ven
9:15 AM
Hi
 
@sehe Looks fun.
 
9:32 AM
@LucDanton comment ça
 
after the meltdown patch my computer sounds like an airplane since my code building is in a docker container - which is all syscalls
 
9:50 AM
@Mysticial lol wth
 
 
3 hours later…
12:42 PM
@ArkadiuszKoćma jsuis plus frangipane habituellement
 
1:06 PM
char cout[80];
some people I swear
 
@BartekBanachewicz Kill it with fire!
 
Ven
first off it's namespace std { char cout[80]; }
 
1:21 PM
lol
 
1:42 PM
We've just enabled C++14 on our builds
> There's no real reason to avoid variadic templates
> You should almost always prefer to use enum class over just enum.
> Always use nullptr if you need a null pointer constant. Do not use NULL or 0 anymore. Feel free to update existing code as well.
> There's no general reason to not make something constexpr if it can be.
pretty solid guidelines I'd say
 
nwp
I don't agree with the enum class. You will find that it just makes people use casts everywhere and not add any type safety. Use a regular enum inside a namespace instead.
 
@nwp a what
the "you will find" part is extremely peculiar and subjective
 
For bitfields it's not very good.
 
cue "you will find that a lot of people overuse" and then pick anything like "auto", "templates", etc.
I mean it's still a) old C++ standard w/o optional b) not Haskell so the situation isn't ideal anyway
it's not like using or not using enum class will change that much
 
@LucDanton Ah ben oui c'est largement meilleur (dans les bonnes pâtisseries)
 
nwp
1:54 PM
@BartekBanachewicz That will always happen unless you just ban all the features completely. The enum problem, however, can be mitigated by a better guideline.
 
@BartekBanachewicz I find people blame auto or template for their own mistakes, that said some helpful warnings in cases where non-standard conventions could cause issues would be nice
 
@nwp I don't see the problem
 
@BartekBanachewicz Haskell all the things?
 
nwp
Have you used enum class extensively?
Or, at all.
 
@nwp yes
@Mgetz ofc
 
1:59 PM
@Mgetz he wishes as he writes 5 + (1 language extension per 100 lines of code) at the beginning of each project
 
3
Q: How to force pow(float, int) to return float

MichalThe overloaded function float pow(float base, int iexp ) was removed in C++11 and now pow returns a double. In my program, I am computing lots of these (in single precision) and I am interested in the most efficient way how to do it. Is there some special function (in standard libraries or any o...

just curious, was the return type change for performance reasons?
e.g. the result would have to be double anyway?
 
we all know that the only way to get ideal state of affairs is to use a dependently typed lanugage
4
 
Ven
well said!
 
@ScarletAmaranth 1 per 10
 
I was being generous out of respect to Haskell
 
2:10 PM
I'm gonna sit down to my interview task today I think
after python it's gonna feel so great
 
2:33 PM
@JerryCoffin I can corroborate this. At least configuration bits are expressed as little endian
 
 
4 hours later…
@Mgetz Removing that overload does seem a bit like a dick move.
 
@Mysticial with exponentiation it would need to be at the higher precision anyway as a result
so in many ways I would say it was the right move
 
@Mgetz If all you want is a float output, you can do the computation as a double and downcast the output.
The double<-> float conversion is cheap.
3-4 cycles each direction. Nothing compared to the powering itself.
 
@Mysticial then answer that on the question?
 
I left a comment on the guy with the manual powering answer.
 
6:43 PM
@Mysticial honestly if he needs to do pow at that level (GB of data) they should consider using either a vector library or a GPU library
 
6:56 PM
Have you measured this as a performance problem? Depending on target, you might find that the double version is fasterCaleth 7 hours ago
^ These people need to be shot
 
um, I think he might be right.
 
@Mikhail no people that don't profile should be shot, always always always profile
 
Code should be fast by default, having the return type right would give you that without any work
 
then profile some more for good measure
 
@Mikhail No, code should be easy to write by default.
 
6:58 PM
@Mikhail maybe it does and they are making an incorrect assumption
 
all code is written and most code is never profiled or optimised in the slightest
7
 
@Puppy 100% correct, but having the correct return type would make it fast and get the compiler to stop warning
 
@Mikhail You're assuming that having a float return type actually is more correct or faster in the first place.
that's the whole point of their comment.
 
@Mikhail except it might not, moreover it might cause unacceptable loss of precision
 
Indeed, but the guy is denying the basis for the question
 
6:59 PM
yes, but that's because the questioner doesn't show any basis
so he's perfectly correct to question an apparently nonexistent thing
 
@Mikhail if you read the questioner's edit, the question is actually based on MEMORY, not speed
 
You can't write code to work equally fast on different system
 
so speed while a concern is not the primary concern
 
Its true he doesn't give any experimental evidence, but the theoretical argument is sound. The retort says because there is no experimental evidence, he shouldn't even ask the question...
 
@Mikhail in computing theory and reality are two different things, always always always profile
 
7:01 PM
But its not a experimental question but being dismissed for lack of motivation.
 
@Mikhail when speaking about code performance you need to profile first
all other arguments are irrelevant
 
I thought we lived in a world where people understood whats going on :-(
 
@Mikhail we can only understand what is going on
 
7:22 PM
@Mgetz I used to follow that "rule". But after seeing the same things over and over again in familiar situations, it gets so predictable that I often skip the profiling and jump directly into (premature) optimization.
The profiler becomes useful in the cases where I get it wrong and the optimization (premature or not) turns out to not help.
That's my form of branch prediction.
 
Another reason I don't like everything defaulting to double is that on GPU architectures there is definitely a performance hit, either on the memory bounds, or with special transcendental functions often compute bound. With these changes we're moving away from the dream of sharing code between CPU and GPU.
 
TBH, I don't use any of the standard library stuff for anything that's really performance critical.
Other than perhaps, std::min and std::max. Both of which are trivial.
 
@Mysticial I've found the compiler's ability to optimize over <cmath> stuff is stupidly bad
 
Those are usually for metadata code. Anything compute-bound is generally hand-written.
 
@Mysticial you'd still think these would be trivial to inline
 
7:34 PM
you mean control logic
 
@Mikhail Yeah. That's what I meant.
Come to think of it, std::min/max is by far the most heavily used "math function" in my pi program. log is a distant second. sin/cos are only used during initialization.
 
@Mysticial min/max are templates
 
8:29 PM
you should never have to call the std::string_view constructor directly, you should just pass the strings to the method taking a std::string_view directly and it will automatically convert. — Mgetz 21 secs ago
 
 
2 hours later…
10:06 PM
@Mysticial precalculating the factors in the FFT?
I made a FFT "made-up" based on a description in a signal processing book (that was decidedly non-mathy but the only thing they had in our local library) and wrote that in 80286 assembly. Hardcoded the trig constants in fixed point precision manually :)
Must have been ~1992
I did have the 80387 but fixed point was either so much simpler or much faster (why not both). And my sampling hardware (homebrew) was 8bit anyway
@Mysticial This is sick
 
@sehe Yeah, spot on.
 
11:10 PM
Well, perhaps include a simple regex that demonstrates the problem for you (see SSCCE, or indeed: coliru.stacked-crooked.com/a/6a183bef8dea1f13 - [I never approach a SO question without actually working code. I didn't include it in the answer this time because it isn't relevant to my analysis.]sehe 1 min ago
Another chapter of "reasoning about UB".
 
11:28 PM
Guess I need to use valgrind more. I don't hardly ever use it because I use a lot of third party stuff and it just pukes warnings at me. For example, Boost barfs out all kinds of stuff at me when I use valgrind on anything that ties into Boost. — T Lytle 12 mins ago
I called it.
When you get so desensitized to address checker warnings that you "never use them, because they just puke warnings at me"
 
@sehe Isn't the OP implying that it's Boost that's tripping up Valgrind?
 
Yeah. Did you see my response?
His claims don't hold water.
 
Oh. I didn't didn't click through the onebox.
 
I know some libs (curl, libcrypto etc) sometime muddy things with copying indeterminate data in oversized buffers, but that's not common place in anything Boost.
Besides, Boost typically let's the use control the buffers so you're free to "cater to valgrind" and initialize any excess buffer capacity.
 
Where is the best place to bury dead body? The second page of Google because no one looks there! We have proven strategies to get your business on the 1st page of Google.
enchanting spam email from SEO firms
 
11:32 PM
Oh, and of course leak warnings (also openssl, or ... god ... protobuf)
Which is when you record/compile a nice suppressions file.
 
11:44 PM
looks like pi cam arrived at local post office too
but it might take up to 2 days for it to be delivered or I receiving a notification to pick it up
 
@TelautonomousKitty Spi cam? What do you think you're doing with a Spy cam?
 
install it on my self driving toy mini car of course
then it can follow people or things and spi on 'em
autonomous spying machine
 
@TelautonomousKitty In that case it's obviously a spin cam.
 
with IR detection ... that's the important part ... makes stalking your kids or samoyed dog so much easier ...
back to pi programming
 

« first day (2649 days earlier)      last day (2300 days later) »