« first day (1229 days earlier)      last day (3733 days later) » 

4:04 AM
7.18.1.1 Exact-width integer types
1 The typedef name intN_t designates a signed integer type with width N, no padding
bits, and a two’s complement representation. Thus, int8_t denotes a signed integer
type with a width of exactly 8 bits.
2 The typedef name uintN_t designates an unsigned integer type with width N. Thus,
uint24_t denotes an unsigned integer type with a width of exactly 24 bits.
3 These types are optional. However, if an implementation provides integer types with
widths of 8, 16, 32, or 64 bits, it shall define the corresponding typedef names.
 
@JerryCoffin vielen dank
 
@Borgleader Don't try for a specific rep. At most try to answer a (fairly) specific number of questions. Unless there's something particularly interesting, I generally do no more than a half dozen answers/day (regardless of how many votes those might get).
 
@JerryCoffin half dozen a day? o.o i rarely find more than 2-3 i feel like answering and im usually not the first on them
but yeah i guess i shouldnt set myself a "rep quota"
 
@A.H. FWIW, there are also typedefs for int_least16_t and such that are guaranteed to be at least N bits.
 
cout<<setw(w)<<setprecision(2)<<fixed<<month<<setw(w)<<monthlyPay(principal,yir
<fixed<<monthlyInterest<<setw(w)<<setprecision(2)<<fixed<<principalPaid<<setw(w)
remainingBalance;
this guy doesnt know about whitespace
 
user3010322
4:11 AM
@JerryCoffin It's too bad you can't do things like check for typedefs.
 
@Borgleader He's using setw(w) and he doesn't know about whitespace. :P
 
@Mysticial @Borgleader whitespace makes the compiler slower!
 
@melak47 Reminds me of this:
29
A: Does auto in C++ 11 make compile time longer?

FredOverflowauto is one character longer than int, so the lexer definitely has to do more work. On the other hand, the compiler no longer has to check that the user provided an appropriate type, so my best guess is that auto will be slightly faster. In the end, you should probably not decide between type i...

 
@Borgleader Note "no more than"--last time I checked, I was averaging around 3/day.
 
@Mysticial Opinions on answers to this question?
11
Q: Pi Benchmarking in C

noobprohackerI wrote the following program to calculate n digits of Pi (where n could be anything, like 10M) in order to benchmark the CPU and it works perfectly (without OpenMP): /* * * Simple PI Benchmarking tool * Author: Suyash Srijan * Email: suyashsrijan@outlook.com * * This program calculates how much...

 
4:23 AM
@syb0rg Oh that. Too much code. Never really read it.
Not to mention that I'm not well versed with GMP.
 
@Mysticial shamelessly plug ycruncher :P
and your world record ;)
 
I've been using my own library for the past few years. So I never really learned GMP's.
 
@Mysticial Is your's more efficient than GMP's?
 
@Borgleader what is it
 
@Borgleader y-cruncher definitely falls into the "too much code" category. Last time I checked it was still over 200k lines.
 
4:25 AM
that's it?
 
@syb0rg Depends. For anything less than a few hundred decimal digits, GMP is still faster. But above that mine is faster.
 
@Rapptz The guy posted a 3000 word explanation on why "we need a PRNG thread" and why his question shouldn't get closed. and then DeadMG edited it to leave only the last line "What is the best way to generate a random number in C++?"
 
@Mysticial share it noob
 
@Rapptz I actually came pretty close to releasing a DLL for it. But then the interface changed so quickly that I realized it wouldn't be maintainable.
 
sharing DLLs is never a good idea
you can't export the source and release the library source?
is it too "y-cruncher"-y?
 
4:28 AM
The library is still closed source.
It's even hard now that I've transitioned to C++. The debug and release DLLs are not binary compatible.
Because of the debug padding that is added to the STL classes.
 
C++ has std::decimal::decimal128
 
@Mysticial cant you pragma it away?
^ this could be the dumbest statement in history =/
 
@Borgleader I'd have to modify the built-in headers to do that.
Maybe there's a compiler switch that I haven't discovered yet.
There was one point where (internally), I'd build the library as an optimized DLL. Then I work on the top layers of the program in debug.
That stopped working after I moved to C++.
But VS2012 has a parallelized linker. So it wasn't really necessary anymore.
 
o.o wut
I thought only @R.MartinhoFernandes could talk to databases
 
Please hold for our MySQL database ♫
 
4:47 AM
@Rapptz Yes. I say "still" because I've been trimming it down with C++ refactorings.
At one point it was over 270k lines.
 
do you use malloc instead of new and list it under "advantages"/"features"?
I always wanted to know why people do that
 
@Rapptz I have my own malloc that lets you specify which heap to use and the alignment. Passing in a null heap will use the C malloc().
In the C++ refactoring, I added a malloc_uptr() of the same function that returns a unique_ptr wrapping the original pointer.
 
you cast it right?
 
Tonight, I wear a hat, James wears a hat, and Richard is behind a low wall. XD
 
@Rapptz It's a templated method. So I do:
auto uptr = ym_heap::malloc_uptr<double>(nullptr,100 * sizeof(double), sizeof(__m128d));
I can't use it like an array though. It's just a pointer. And that's how I usually use it.
 
4:56 AM
you can use it as an array if you do double[]
 
The reason why I don't automatically multiply by the size of the type is because the vast majority of the use cases is actually malloc_uptr<void>.
That said, it was mostly a convenience method for writing unit tests and benchmarks. There are very few calls to this malloc inside the computation. It's mostly been eliminated.
One of the other big clean tasks I did was to re-implement my progress prints using RAII.
 
This image stays roughly in sync with the day (assuming the Earth continues spinning). Shortcut: xkcd.com/now
4
 
I think you guys explained this to me once, but why does this particular question get constantly re-asked?
0
Q: Is the C/C++ statement "k=i+++i;" safe?

Glenn Randers-PehrsonI would like to know if it is supposed to be safe (in fact, it's not safe) to use a C/C++ statement like this: k=i+++i; By precedence rules, clearly it's equivalent to k=i+(++i); but by left to right association it's equivalent to k=(i++)+i; There should not be a sequencing issue because...

 
@RobertHarvey Probably genuine curiosity. If you're new to programming and you just discovered that... It'll make you wonder.
 
@RobertHarvey popular assignment/question by teachers too
 
5:05 AM
I learned that the hardware when I was porting some code from Java to C.
 
I'm inclined to buy the teacher argument. Who would ever write code like this for real?
 
isn't that question the most duplicated one in SO?
or something like top 3
 
And I was confused as hell until a family friend majoring in CS pointed out to me that the order was not defined. (Turns out that it's actually UB - so it's worse that just undefined order.)
 
@RobertHarvey Its somewhat hard to search for, and it screws pretty much anyone who does C++ at least once in their lives.
 
@Rapptz It's definitely the most duplicated in C/C++.
 
5:06 AM
But why would you ever write that, other than as an example of UB?
 
@RobertHarvey When I first started with Java. I had a loop that did something like: T[c] = T[c++] * x;
Simply because it was concise.
It didn't work in C.
And that's how I learned it.
 
user3010322
@Mysticial I think you meant hard way. :P
 
@RobertHarvey it's not really in a i++ + ++i form, it's in a different one. I think he's just trying to say "sequence points screw people over"
 
user3010322
Your days with assembly blurring your mind a bit? :b
 
@ThePhD yes... when my brain gets out of sync with my typing muscle memory.
 
5:08 AM
I can't find that post by shog with the most duplicates
I found this ancient one though
8
A: Is there somehow a way to find the questions which are the most referred to when closing duplicates?

balphaThese only count those dupes where the "possible duplicate" link(s) where inserted automatically; this feature hasn't always been in the site. I just used a very simple matching algorithm, too, so take the numbers with a pinch of salt. Only shows the top twenty (for Server Fault only those with m...

 
Maybe I just have a feeble mind, but even in my early days of C# I was never tempted to put an increment of a variable on the same line as the rest of an equation. Instinctively, I knew I would never figure out WTF I did later.
And when Eric Lippert talks about the underlying mechanics of these things, it just makes my head hurt.
 
I've only done it once
 
@Rapptz Shog has a more updated version. I can't find it though.
 
yeah I know
that's the one I'm looking for
 
It's gotta be either the Parsing HTML with REGEX one, or some variant of "How do I use PDO to avoid SQL injection?"
 
5:11 AM
@Rapptz More than once actually... <sub>in a single statement</sub>
 
23
A: What is the most rampant duplicate on Stack Exchange sites?

Shog9Since Jarrod spent so much time and effort cleansing the data, I figured it'd be a shame not to have some fun with it. Here are the top 30 questions (by # of questions closed as duplicates of them) on SO: 572    How to fix "Headers already sent" error in PHP 525    mysql_...

 
ah, yes!
 
Oh, yeah. "Headers Already Sent."
Oh, well. Both questions I mentioned are in that list.
 
i+++++i is on there twice
121 + 306 lol
 
lol
 
5:14 AM
oh how nice
he even put it on explorer so we can have Real Time™ stats
 
damnit gl-spec-parser doesnt do what I need T_T
 
Also, the C++ book question is the only book question on the list. Probably because it is the only (open) book question.
 
@MarkGarcia The only one that isn't locked or deleted?
 
lol shog
wtf is with that output
dups               Q                                                Closed

------------------ ------------------------------------------------ ------

**594**            &nbsp;&nbsp; stackoverflow.com/q/8028957

**562**            &nbsp;&nbsp; stackoverflow.com/q/2973202

**456**            &nbsp;&nbsp; stackoverflow.com/q/513832

**328**            &nbsp;&nbsp; stackoverflow.com/q/949433
 
@Mysticial Haven't really seen those kinds of questions in other languages (or maybe I'm not that nosy for other tags).
 
5:16 AM
@MarkGarcia They're mostly deleted or locked and banished from the question pages.
 
String nullString1 = null;
String nullString2 = null;

// Evaluates to true
nullString1 == nullString2;

// Throws an Exception
nullString1.equals(nullString2);
wow
 
@Mysticial I wonder how much effort has been spent just to keep the question open. I've seen a couple of posts in meta, and they have really heated-up arguments.
 
A lot
 
it feels like a mistake
the C++ book question gets a lot of views doesn't it?
587k
 
Why are there suddenly a gazillion new answers on: meta.stackoverflow.com/questions/223009/…
9 in the last 40 minutes.
And the question is already 9 hours old.
And another one...
 
5:21 AM
they're just "congrats" stuff
 
But they just starting coming in a burst.
 
Heh, took me a while to figure this one out. I hate the fact that you can declare a variable of the type right after declaring the type. It always confuses me.
 
That xkcd actually shows the current time in my zone! mindblown
 
It's actually more useful than those online timezone converter.
> wikEd works under all web browsers except Internet Explorer and Opera.
Love that "all" then "except".
 
5:34 AM
e
yawwwwwwwn
 
D: D: D:
<3<3<3<3
 
Hi all. Well, for those who remember my mentioning looking for a job a while back, I have a bit of good news: I received an offer today. Still unofficial, but official letter supposed to arrive soon. Within a matter of hours, got a call from another company that wants to set up an interview.
 
:)
 
:-)
@JerryCoffin Good luck!
 
5:46 AM
@MarkGarcia Thanks. Does seem like things are running that direction.
 
@JerryCoffin I don't think luck would be a significant factor for you to be hired. :)
 
@MarkGarcia Given my...checkered background (lots of experience, but no degree) it takes a little luck for them to even bother letting me know they threw away my resume (over half I sent out have never been acknowledged at all).
 
o.o throw out your resume? what a dumb thing to do.
 
You don't have a degree? I'd think you have PhD at least (also why degrees are useless nonsense)
Also morning (it's actually morning this time WOAH)
 
Hai! :)
 
5:58 AM
@JerryCoffin I would have guessed that you went to university with the money you got from being in the military.
 
@CatPlusPlus No, no degree. At least one person has actually gone so far as to recommend that I find a college that has had a fire or flood (or whatever) so their records are no longer entirely accurate, and claim I got a PhD there.
 
:lol:
 
A structure with 50 ints in it? Rethink your design at once — Borgleader 2 mins ago
 
lolwut
@Borgleader And he names them? oh nvm, they're just placeholders.
I've had large structs. (50k+) But they're just large. Not a gazillion variables.
 
@Mysticial yeah its 50 int variables, not an array of ints =/
 
6:02 AM
@Borgleader They send me an email when I need to renew.
That's all there is to say :)
 
@Rapptz That was the idea, but I was in the military at a time that the college assistance program turned out pretty much useless. Seemed great until you read the fine print, then turned out nearly useless.
 
@StackedCrooked I mean uptime is good? Prices?
 
domain name uptime?
 
Also it gandi right? @sehe semed to think it was rackspace
@StackedCrooked oh you just get the domain name from them?
 
yep
rackspace is the VPS provider
 
6:04 AM
ah
 
rackspace has good uptime but is expensive
and mediocre performance
 
@Borgleader There's one struct in y-cruncher that has several 64-element arrays of __m256d. It's too big to put on the stack. lol
 
real men increase the stack size
 
That sounds like a spam email title: "Increase your stack size."
 
6:18 AM
morning
 
morning
 
@JerryCoffin Woah, I would never have thought you had no degree. Welcome to the no-degree club! :) :P
 
@TonyTheLion I'm a charter member... :-|
 
hehe
@Borgleader what's up?
 
nm, watching top gear before bed, you?
 
6:26 AM
I'm at work, early morning
I'm feeling rather optimistic today
maybe someone wants to smash my feelings into nothing so I come back to my pessimistic/cynical self? :P
 
@TonyTheLion Nope. Be a happy tiger for a while.
 
@JerryCoffin :)
 
0
Q: Programming Language used for Mars Curiosity

user3338770There was a news which mentioned that Mars Curiosity Adds Reverse Driving for Wheel Protection and there was a related promo video "7 minutes of terror" which informed their viewers about 500,000 lines of code. I do not doubt the complexity of the problem & requirement but 500,000 lines of code i...

 
@Borgleader lol, wrong site
 
@Mysticial thats why i linked it :P
 
6:39 AM
where does it belong?
 
not sure
I remember there was another Mars rover question some time ago.
Don't remember which site.
 
come on if it is one Mars, it has to be Java. Write once, run anywhere en.wikipedia.org/wiki/Write_once,_run_anywhereuser2310289 1 min ago
not sure if trolling
 
Until it runs out of memory trying to create a ThreadSafeSingletonFactoryBean on a billion dollar rover millions of miles away.
0
Q: Unexpected behaviour, sorting the data makes the code faster in C++

Ayyappa Boligalainclude include include int main() { // Generate data const unsigned arraySize = 32768; int data[arraySize]; for (unsigned c = 0; c < arraySize; ++c) data[c] = std::rand() % 256; // !!! With this, the next loop runs faster std::sort(data, data + arraySize); // Test clock_...

^^ ahahaha
 
@Mysticial And a dupe.
 
6:59 AM
damn i broke my 4 accepted answer streak
 
I had an 18 accepted answer streak broken a couple weeks ago because the OP kept asking for more and more - to the point that I couldn't answer anymore.
I should've noticed the OP has a history of doing that. And almost never accepts any answers since (s)he keeps extending his questions.
 
@Mysticial Is there a badge for that?
 
@bamboon Nope. It'd be too easy to game anyway by just deleting all the ones that aren't accepted.
My 18 accepted answer streak is genuine. No deleted answers in between.
At least not that I can remember. Would need a mod to confirm.
hi
 
Low (SCNR).
 
7:09 AM
hi
 
@melak47 when will you be there? It's a rathee lenghty topic
 
@ScottW I'll look at you
 
@BartekBanachewicz technically I'm here now, but I'm kind of sleepy :p
 
5
Q: Why are there so many bins amongst Stack Overflow chat rooms?

sudo rm -rf TelkittyI have been noticing for a long time the number of bins amongst Stack Overflow chat rooms. Here are a few: bin recycle bin then there are a few more ... pedantic bin trash can dust bin void /bin/gif There are a couple more if you type 'bin' in a chat room search. I understand the need f...

 
7:12 AM
@StackedCrooked I think there's a question asking about testing C++ code on multiple compilers.
 
@ScottW In case you missed the important part: a few finally have. One has made an unofficial offer (and seems to be a genuinely interesting job as well).
 
morning
 
I got the easiest obtainable degree. Applied informatics in a local school. Got me a bachelor in 3 years.
 
@Melak47 I have a hole in my schedule at 14, rest of the day is taken by uni. So either 14 or in the evening.
 
@ScottW The official line is: "developing software and hardware technologies that bridge neuroscience, engineering, and physics." Can't give any real details though--don't really know anything yet, and when I do it'll undoubtedly be under NDA.
 
7:16 AM
I hear all about this Anti-Gay Bill. I didn't know Bill was such homophobe.
 
dat pun
 
@ScottW Certainly does to me.
 
@JerryCoffin But I thought you had a job?
 
@TonyTheLion I've been doing consulting for the last ~5 years. My wife would really prefer a steadier source of income though.
 
ah I see.
 
7:19 AM
Trying to negotiate a contract with a building supplier, the other side is really inflexible, me R very angry. Will start a negotiate with another supplier ...
 
@JerryCoffin Surely your experience must weigh in quite a lot when attempting to find a job.
@ScottW what?
oh
 
cheaper ones might end up causing more $, so going to a reasonable, more expensive, but flexible supplier
 
@Mysticial spam spam spam spam
@ScottW what you doing?
 
Looks like porno spam.
 
7:21 AM
@Mysticial It's Vlad!
 
ah right
I did wonder where your interest in a 16 bit CPU came from
 
@MarkGarcia The vampire from Russia?
 
> Help me find erotic film not remember the name but I remember some episodes ( sm.vnutri ) ?
 
@TonyTheLion Only if somebody can/will look past the lack of degree to try to take experience into account.
 
WTF
 
7:22 AM
(found on reddit) :)
 
@JerryCoffin Not sure how it is in the US, but here in EU, I have had people look past the degree, and look at (the little bit) of experience I have. So that I do now have a job.
Even though I haven't got a degree.
@ScottW oh nice :) Hope you have fun :)
 
@GamesBrainiac From Moscow, specifically.
 
@ScottW nice
 
@TonyTheLion It's really a hybrid 8/16 bit CPU--or depending on your viewpoint, mostly an 8-bit CPU with some 16-bit extensions. Was also used in the Apple IIgs, for what it's worth.
 
oh ok
I'm not really an expert
 
7:26 AM
@BartekBanachewicz 14:00 sounds good
 
Dunno about you, but I think I prefer my "modern" processors.
 
The amount of people who try to implement templates in cpp files is too damn high
 
@Borgleader The number of people that don't understand templates is even higher
 
@Borgleader But you can do it now. Extern templates. Puppy taught me last week!
 
7:27 AM
@ScottW Yeah, disassembling and analyzing the code's a pain. Seems like I wrote a disassembler for it once, but I'm sure it's long gone now, on some long-since rotted Apple-format floppy disk.
 
@Mysticial that is not what extern templates are for
 
alright time for bed, maybe the accept fairy will visit me :3
 
night
 
46
A: using extern template (C++0x)

DaniYou should only use extern template to force the compiler to not instantiate a template when you know that it will be instantiated somewhere else, its used to reduce compile time and reduce object file size. For example: // header.h template<typename T> void ReallyBigFunction() { // Body } ...

 
7:29 AM
@Rapptz They aren't for forcing instantiation of a particular set of parameters?
Yeah I upvoted that last week.
 
@Mysticial extern templates are just there to say that an instantiation exists somewhere else
 
@ScottW Mine did pretty well, but it did take quite a bit of work to do it. Basically built a table of jump destinations and current state at each as it disassembled. Didn't work in one case though--a program that ran the same code in different modes to do entirely different things.
 
@Rapptz I used it like that in combination of forcing it to instantiate somewhere else.
 
@MarkGarcia Ahh :P
 
@ScottW A 6502 disassembler can be written in about 4 hours. If memory serves, it took me close to a week to get the 65816 working even reasonably well.
 
7:33 AM
@Mysticial the "templates in a header" thing is still true
in order to solve it back then you had to do an explicit instantiation and you still have to do that with extern templates, except this time it's a little bit cleaner.
 
@ScottW Around the same time, ran into some x86 code that did almost the same thing--had a jump that went to the middle of an instruction, so the same sequence was used for two entirely different things (and both had to be written very convoluted to make that work).
 
because reasons
 
@ScottW Well, essentially nothing is invalid as instructions so it has to be data, anyway (but I guess that's what you really meant).
@ScottW At the time, it was often to save memory. Some also wanted easily detectable sequences in case somebody stole pieces of their code. I never looked at it, bu I've heard that the first word processor (Electric Pencil) was almost amazingly indecipherable.
 
the joys of assembler
 
@ScottW Yup -- but it was sometimes wrong. The 6502 instruction set was regular enough that it was pretty easy to figure out what some undocumented op codes would do (and some people used them). A lot of that broke on 6502 descendants though (not just 65816, but also 65C02 and 8502).
In fact, there were a couple of undocumented op codes that were probably used more often than a few documented instructions such as the indirect jump (which had a bug so it didn't work correctly).
@ScottW Exactly. jmp (xxff) would get address from xxff and xx00 instead of xxff and (xx+1)00.
That was also fixed in most descendants, but by then avoiding it was so ingrained that I don't remember it getting used enough to notice anyway.
That reminds me: I should do some testing on undocumented op codes on x86. In theory, all undocumented instructions should generated an invalid opcode exception (at least in protected mode). I haven't tested recently, but quite a few still allowed at least a few. For example, AAD basically does division by 10, and its second byte is 0a (i.e., 10, in decimal). If you changed the second byte, it'd divide by that number, and at least some CPUs still allowed that in PM.
Or maybe that was AAM (or maybe both). They both have 0a as their second byte...
Anyway, about 0100 here, so I'd probably better go get some sleep.
 
7:59 AM
night
 

« first day (1229 days earlier)      last day (3733 days later) »