« first day (460 days earlier)      last day (4479 days later) » 

12:02 AM
cheers
 
12:25 AM
just read a news story about a guy who was arrested, and handcuffed, and then stole a police car and drove it away, whilst handcuffed
 
Xeo
12:41 AM
Mad skillz
 
1:12 AM
“C++ : Where friends have access to your private members.” (Gavin Russell Baker)
 
1:54 AM
that joke is very old
 
2:19 AM
Could anyone point me in the direction of a method to calculate the sum of bits? For instance, "6" is "0110", and sums up to "2". Preferably a bitwise thing rather than going through type conversions.
Or do I have to iterate with something such as for (i = 0; c; i++) c ^= c & -c;
 
there are assembler instructions (exposed as compiler intrinsics) which can do it in one instruction for x86
 
Unfortunately that's not an option for me.
However, that sounds interesting. Do you recall the name of the instruction?
 
no, all I remember is seeing them in the MSVC intrinsic listing
it will have the assembly instruction given in the list, I believe
 
Ah. I was hopeful to see the manual on how it works internally.
I'm actually not writing code for the cpu as much as I am looking for people who are more familiar with bitwise.
 
well, the only actual way to do it is going to be to check every bit
the only difference between using a hardware instruction is that, well, it's done in hardware for you
also, I'd prefer to see something like int total = 0; for(int i = 0; i < 32; i++) { total += c & (1 << i); }
std::bitset may have this functionalty
 
2:31 AM
Unfortunate. I was looking at this answer, but it looks like he's only hard-coded out the iterations, at a glance anyway.
1
A: Count the number of set bits in an integer

VooWarren has a whole chapter about counting bits, including one about Conting 1-bits. The problem can be solved in a divide and conquer manner, i.e. summing 32bits is solved as summing up 2 16bit numbers and so on. This means we just add the number of ones in two n bit Fields together into one 2n ...

 
@DeadMG You're likely to not like what the actual language I'm going to use this in is. :)
 
I'm going to guess C
or Java
but it doesn't really matter; all C-heritage languages have the same binary functionality, except that Java added rotate, I believe
and I had no idea wtf your original code did, whereas mine clearly iterates through each bit
 
I grabbed the old one from a random university page.
"Bitwise Tricks", I think it was meant to be less readable than anything else.
 
probably some old dude who hasn't written a program that performed any useful function since about 1960
 
2:35 AM
Copyright © 1999-2003
 
> any useful function
 
:)
 
my university course is so incredibly depressing
 
Why's that?
 
because
my lecturers appear to jerk off on drawing strange symbols on a blackboard
instead of speaking the same language as the students, i.e. English, and using them to actually perform a task
I had a module on Implementation of Programming Languages, in which we covered LR parsing
it involved hand-rolling a parser table for about 2 tokens and about 6 states
great, thanks, now I'm gonna go do that for my 100-token 400-state LR grammar
owait
so even though I covered LR parsing at university, what we actually did was worth absolutely jack shit when it came to actually making an LR parser and using it to parse an LR grammar
the whole course was like that
colossal waste of time and money and I want out
 
2:43 AM
That is far more interesting than what I went to school for.
 
admittedly, even the idea of LR parsing is greatly superior to studying many of the other things I have studied in the past
 
Should I put colossal waste of time and money and something I got out of into perspective?
 
however, it's still small potatoes compared to what I can do on my own
 
My "software" study was a total joke. A student was told he stole the implementation for a linked list because there's no way he could have figured it out so quickly. I was taught that MVC is a big global variable in PHP. I had a few weeks worth of one course dedicated to jQuery. We had a full course on using MS Access as a database. I got out, and have been learning from the internet and books as much as I can to compensate for a total waste of time and money.
 
we never studied data structures
 
2:47 AM
Linked list was the only structure I studied.
I'm learning about so much more through the internet. Bloom filters are so cool.
 
yes
the internets is superior to a proper education in so many ways
 
I've always thought mathematically, but I took very little out of my math courses all the way through life. Between Wikipedia, Kahn, and math.stackexchange.com I actually understand a lot of math now, and use it, and think it's really cool stuff.
 
for me, it's a means to an end
 
School required I was good at manually computing things, I'm awful at that, but I'm great at expressing logical statements.
 
and I respect mathematics and abstract theories and computer science; as a means
 
2:52 AM
I have a computer which keeps bluescreening with kernel-mode access violations in ntoskrnl.
 
but without an end, it's worth nothing
 
I'm wondering if this is a CPU error, or if the GPU could have something to do with it.
I'm thinking my CPU may have gone bad, but I'm not sure how to test it.
 
user406009
Boot off a disk.
 
I'm running a memory test now (intense), and it hasn't found any errors so far
 
@IDWMaster Did you try asking on superuser?
 
2:53 AM
By frequent, I mean every few weeks
 
@DeadMG Anyway, I'm off for the night. Cheers, and thanks for the tip on the bits.
 
bye
 
@Incognito No, but I figured the people here might be able to help in terms of kernel-mode debugging in Windows. I'd like to know what is causing the exception in the kernel.
 
@IDWMaster That's not very frequent at all. You might have just overheated it with too much dust or something like that, or got a loose cable.
 
How annoying do you think it would be if I used CamelCase in my URLs? e.g. syntaxcoloring.com/Projects/SomeProgram.
 
2:54 AM
take it to pieces, hoover out all the dust, put it back together nice and snug and secure, and preferably reinstall the operating system whilst you're at it
 
@DeadMG Doesn't seem to be overheating, it's running within its thermal specs as measured by SpeedFan. Even when idling it will sometimes bluescreen. I've ran a memtest before with no problems found.
 
user406009
@Maxpm URLs are not case sensitive ...
 
@IDWMaster Eery.
 
well, I would start with a little general-purpose maintenance
 
OK.
 
2:56 AM
Overheating is only one of about a billion things that could cause your machine to go unstable. And actually, I've seen (many times) 100% stable servers giving faults under a heavy load.
 
So there's not a definitive way to tell if it's a CPU problem, or something else?
 
first physically as above, then the software- make sure all the drivers etc are up to date, preferably reintall OS
 
@EthanSteinberg They are, actually, beyond the domain.com part. A lot of servers automatically convert everything to lowercase, but they don't have to.
 
no
 
OK. And I've tried running Ubuntu on it as well, and it froze after a few weeks of running continuously.
 
2:57 AM
that's no surprise at all
 
Freezing isn't that big of a deal.
 
lol at all the Java vs. C++ bullshit bashing going here:
7
Q: C++ vs Java? Simple loop shows frustrating results

thesaintThe following is a simple loop in C++. The timer is using QueryPerformanceCounter() and is quite accurate. I found Java to take 60% of the time C++ takes and this can't be?! What am I doing wrong here? Even strict aliasing (which is not included in the code here) doesn't help at all... long long...

 
I don't believe that the average server can go more than a week without a reboot
 
So I'm pretty sure it's some kind of hardware issue
 
not every few weeks, buddy
hardware errors are intrinsically random and because of the large number of ops any given piece performs, they manifest much more frequently than that
which generally results in frequent crashes
a CPU problem usually manifests in the system refusing to boot and such things because it's failed before the OS can even get to the desktop
 
2:58 AM
@DeadMG I used to leave this system on for months without issues, and recently after the heatsink fell off, it started bluescreening. I removed the previous thermal paste on the CPU, added some new stuff, and put the heatsink back on after cleaning. It still bluescreens.
What's concerning is the fact that it used to never bluescreen
and now it started bluescreening
 
main% uptime
20:58:50 up 103 days, 50 min, 24 users, load average: 0.42, 0.66, 0.60
 
@IDWMaster As I said, you probably simply failed to clean it properly or something like that.
 
@IDWMaster That could be that a temperature spike dealt it some permanent damage.
 
That was my last power outage.
 
what you've just said is only more evidence in favour of my assertion that it's a simple, small physical failure
take it apart, clean it out, put it back together, push all the cables in, stick on a new OS and see how things go from there
 
3:00 AM
The Server Fault people might have some good insight.
 
if it keeps failing, then think hardware error
 
OK.
And to be specific it's the 3.47 GHz i7
Everything so far seems to be pointing to a CPU-related error, and for sure it's a hardware problem, not software (happens on multiple OSs such as Ubuntu and Windows)
 
@IDWMaster When you start getting recurring errors like that, the best way to debug it is to start turning down the various clocks one-by-one and see when it gets stable again. (even it means underclocking)
 
@Mysticial I've tried that and it doesn't seem to make any difference.
 
@IDWMaster What do your bluescreens show?
 
3:05 AM
It's a "vista driver fault"
Even though it's Windows 7
I cannot consistently reproduce the error
 
Sounds like a software issue?
 
I've tried memtests and written programs that allocate huge amounts of RAM, write to it, and verify it
 
Or the device that the driver is for is failing.
 
@Mysticial Happens in both Ubuntu in Windows, but in Ubuntu the whole computer completely freezes
@Mysticial Which is why I was thinking it might be the GPU.
I have had bad luck with those
The last one I had kept "black-screening" where it would completely stop outputting to the display
And now this one "might" be causing the blue screens
 
Sounds reasonable, you have another GPU you can swap out temporary to see if it's stable again?
 
3:07 AM
But I'm not sure
 
If it's not the GPU, it could also be the any component between the CPU and the GPU. Especially the north-bridge.
 
@Mysticial I should probably purchase another GPU to see if that will solve it.. Think they've gone up in price though
 
Those things are fragile... I have active cooling on mine.
 
Hmmm. I think memtest just froze
Is it normal to stay at 21% for 15 minutes?
I'm using the Windows version of it (the Windows Memory Diagnostics Tool)
I'm running the memory test in extended mode
 
In that case... then it might be some sort of I/O issue on the CPU. (memory contoller, or NB bus)
 
3:10 AM
Usually I've just ran in in basic
Could be the NB bus
 
what chip is this?
 
Would the NB bus freeze when doing lots of communication between GPU and CPU?
I've noticed it seems to have a higher chance of failure when reading data between system/GPU memory as well
but this problem hasn't happened until the CPU overheated that one time
 
Which generation machine is this? Core 2, Nehalem, Sandy Bridge, K10?
 
The Sandy Bridge
It's a 3.47 GHz i7 CPU
8 cores
 
Hmm, I'm not sure if the memory bus and the NB go through the same controller...
 
3:13 AM
Thought Wikipedia was supposed to be down today....
It's not.
 
It should be back up by now?
 
depends
it's the English-language only section
 
mobile site is still up, along with all the non-english
 
and I believe that "today" is defined as the US "today"
 
Yeah. I'm on the English encyclopedia.
 
3:14 AM
It goes up on 5:00 UTC I think
Although Wikipedia has never really been shut down. If you disable the Javascript it works fine.
 
That's maybe why
I have JavaScript disabled for Wikipedia
 
There you go.
 
I only enable it on sites that don't display without it (such as this chat)
 
The blackout message is a Javascript implementation.
 
Why not do it server-side?
Did they want it to be easily bypassed?
 
3:16 AM
Well, they want to make it so that people can still use it
*can still use Wikipedia
 
I don't think they're actually trying to prevent people to accessing the site. They're just making a statement along with the rest of the world.
 
They want to make it as visible as possible, of course, to get the message out
Since the big media (who of course supports the bills) won't cover it.
 
uh, as far as I know, virtually all of the media is covering it
 
Because Google actually made a fuss about it
 
I'd think it would be more visible if they made their site completely unavailable
That's what I did with my site today
Although now my down page is down while the server is running the memtest...
 
3:18 AM
It's pretty hard not to cover it at this point... You'd get yelled at for withholding front-page news...
 
But there was virtually no coverage of SOPA nor PIPA before sites starting getting up in arms about it
 
well, I guess that in the UK, our media is less biased
 
@IDWMaster: Wow.
Why am I not surprised?
 
sevenforums.com/crashes-debugging/… -- Apparently it quite frequently hangs at 21% and doesn't progress further.
Maybe Ubuntu memtest will work better???
Or is this a sign of bad RAM?
 
3:22 AM
Perhaps you can swap memory sticks from a known working machine?
 
I wouldn't know since I've never used memtest. You could try other memory benchmarks.
 
At least to test out the bad RAM hypothesis?
 
Or you could take out half the modules and test, and then swap, and test again.
 
I'll try that now
See if tests work
 
That's how I had to debug my dual 771 when it went down...
take one out. Test. Swap. Test. switch to other socket. Test. Swap again. Test... record everything
 
3:25 AM
It's these kinds of things that make you wonder why computers work at all.
 
user406009
@Insilico http://www.classicradio.com/images/farside_clean1.jpg
We all know that's how computers really work.
 
have you seen The Daily WTF?
 
@EthanSteinberg: I knew it!
@DeadMG: Yeah I've seen it. Which only makes me wonder even more why computers work at all.
 
no, I meant today
 
@DeadMG: Ah, yeah
<sarcasm> Clearly they support SOPA and PIPA </sarcasm>
 
3:28 AM
lol
no, rly?
 
YES REALLY!!! TRWTF IS TDWTF!!! </troll>
 
WTF
you forgot the opening <troll> tag
 
Do you think a troll is going to know what valid HTML markup is going to look like?
:-P
 
lol
TechnoTroll does!
 
The Stack Overflow Ad with the <p> </p> thing is missing the rest of the html document
Forgot <html>, <head>, <title>, and <body>
I expected more from a programming website.
 
3:38 AM
<troll>lololol</troll>
 
posted on January 18, 2012

Programmers who think about how — and whether — to try to optimize a piece of code should keep in mind the context of both the code and the optimization.

 
Finally; the correct way to troll.
Re-running RAM tests now with memtest86+ instead of Windows, for more consistent results.
 
3:59 AM
Removing RAM chips doesn't seem to fix the issue
It still freezes at 21% on Windows RAM test, and always tests perfectly on Linux (memtest86+) tests
Even with all RAM chips in, it passes memtest86+
 
4:11 AM
Windows is borked, then?
 
@JackyAlcine I'd say so too.
Try some other memory tests. If Windows Ram test is the only one failing. Then that says something.
 
What version of Windows are you using, IDWMaster?
 
Though BSODs usually do suggest something else...
 
4:31 AM
Hi
 
@JackyAlcine Windows 7
Just finished running a GPU OpenCL memtest
No errors there either
Doesn't appear to be GPU or RAM based on test results, but then again, that doesn't really say much for intermittent issues
Could be a lot of things, but I'm guessing it's the CPU, but before I go out and spend 900$ on a new CPU, I want to make sure it's not something else
Website is back online now by the way since tests are complete
Sort of
I'm doing the SOPA blackout thing on my site too
I wrote a website that listens for TCP connections on port 80 and will send the exact same blackout page to the client regardless of what URL is requested
 
I'd try a new motherboard first. CPUs tend to be very sturdy - unless you've been doing some dangerous overclocks on it.
 
@Mysticial It started having issues after the heat sink fell off of the CPU once, I quickly shut down the computer, applied thermal paste, re-attached the heat sink, waited a couple hours, and powered it back on.
The blue screens are very intermittent though
I'm trying to find a common pattern
I've been using windbg
With kernel symbols
 
Does it crash on any heavy-duty benchmarks?
 
Not usually
 
4:42 AM
How'd the heatsink fall off anyway?
 
I think the thermal paste melted or something, and it wasn't attached to the motherboard good, and came loose, it didn't fall completely off, but it was no longer making contact with the CPU
Each bluescreen has the same memory addresses for LAST_CONTROL_TRANSFER
Would that indicate anything useful?
 
Yeah, that sounds pretty bad... it probably is the CPU then... Though I've heard of people being able to RMA chips damaged like this - and even some from overclocks.
 
IT'S NOT GAY WHEN IT'S IN A THREE-WAY
LIKE A BAUS
 
Always is fffff80003953150 to fffff800038e3c40
Except on the last bluescreen, which I don't think had a relation to the other problem
 
Its strange that I changed vsnprintf to _snprintf_s. Now my program is crashing :(
 
4:46 AM
I think the most recent one was something related to the hard drive
But the other ones don't appear to be
Seems to crash a lot at nt!KeWaitForGate+45c
KeWaitForGate (an internal kernel function) seems to be where it bluescreens
So the issue could be:
* A bad CPU
* A bad northbridge
* A bad motherboard
* Probably not bad RAM, but that isn't ruled out completely
* Probably not a bad GPU, as it worked fine before the CPU overheated that one time
Trying to reproduce blue screen once again now using a test program I created myself.....
 
The I/O and memory controllers are on the edge of the chip. If the heatsink comes off, it will lose contact on the edges first. So that could potentially result in isolated damage to the edge that came off first.
Though I'm just I'm just guessing since I don't know how exactly the sink came off.
 
I'm transferring a lot of data between GPU memory and CPU memory now. If my hypothesis is correct, this will cause a bluescreen, because of a memory controller error.
 
If none of the CPU stress-tests (Linpack, Prime95 small FFTs) are failing, then that does strongly suggest the problem is on the I/O or memory busses.
 
I've been running scientific computing applications on the server and virtual machines for quite a while
And none of them consistently cause a crash
Seems to crash just as much as when idle as when its in use
 
And I'm guessing you don't have another compatible motherboard around to test it with...
 
5:02 AM
@Mysticial No. The motherboard was quite expensive as well.
At least motherboards have come down in price, but it's hard to find one that's compatible with this particular CPU model, as they've changed the socket design since.
I'm still thinking it is probably the CPU
That would make the most sense
 
Don't all Sandy E-series have the same socket?
 
@Mysticial Not sure; I'm more of a software expert than a hardware expert.
 
5:46 AM
Morning.
(And it's actually morning this time!)
 
6:25 AM
> error: expansion pattern '#'nontype_argument_pack' not supported by dump_expr#<expression error>' contains no argument packs
I got an error in my error message :(
 
> error: parameter packs not expanded with '...'
So there's no argument pack, and it's not expanded.
 
Personal advice: Answering to multiple questions at the same time may result in undefined behavior.
2
 
> Internal compiler error: Error reporting routines re-entered.
tableflip.jpg
 
6:42 AM
Can I ask a question? Or will that make me get shot? Is it too late now?
 
@StackedCrooked You can ask as many as you wish. But the service doesn't not guarantee any answers.
 
6:57 AM
 
7:29 AM
@jweyrich That is not entirely accurate, but it is the spirit of the community site yes
 
7:43 AM
@Insilico I liked this F-Up:
The forums link is amusingly broken:

forums.110.120/forums/thread/277156.aspx

TRWTF is how Alex generates that link?
 
8:08 AM
Are there good names for .* and ->*? The Standard calls them the pointer-to-member operators.
 
8:28 AM
@sehe what you mean?
@TonyTheLion we are friendly, now shut the fuck up about it :D
and on aide note, morning :D
@LucDanton well, if that's what the standard calls them
 
@thecoshman But what do you call the one to differentiate from the other? :)
 
I call them "unused the first" and "unused the second"
you can probably guess how often I use them
 
@jalf But, but, EDSLs!
 
well, feel free
 
"spot-splat" and "worm-right angle-splat"
> Where do I sign up to make JavaScript illegal?
 
8:45 AM
When my mom updates her status: 71 likes, 11 comments
When I update my status: 1 comment ~ "That's idiotic." or "Didn't get it" etc.
 
10
A: How to properly free the memory allocated by placement new?

Mooing Duck//normal version calls these two functions MyClass* pMemory = new MyClass; char* pMemory = new char[ sizeof(MyClass)]; MyClass* pMyClass = new( pMemory ) MyClass(); //normal version calls these two functions delete pMemory;...

char buffer[sizeof(MyClass)+sizeof(void*)];
> the size of the buffer is complex to verify that the buffer has enough space to properly align the data inside of itself
This is nonsense, right?
 
No, it's not.
Automatic buffers are only aligned for themselves.
 
F*ck Placement New. :(
 
You don't get the same guarantee you get with new char[N].
 
11 hours ago, by sbi
Really, This room is popular. Now it's users without a single upvote for a C++ answer coming here and asking for help with their French homework. We should get a collective Legendary badge.
 
8:47 AM
@RMartinhoFernandes I know, but then you would have to actually allocate with an offset inside the char buffer. But this doesn't happen when all you say is new (a.buffer) MyClass();.
 
@FredOverflow Oh, I didn't read that far.
 
Why fiddle with offsets when there's std::aligned_storage?
 
@FredOverflow certainly adding the size of a void pointer is nonsense.
 
@LucDanton I guess most people aren't familiar with it since it's new in C++11.
 
@LucDanton 'dot' and 'arrow' ¬_¬
 
8:50 AM
You have: std::maxalign_t + std::align if you want to cut yourself do it manually, alignas, and std::aligned_storage. So many choices.
 
@RMartinhoFernandes And they still can't implement proper support for alignment of SIMD types
 
@jalf Why not?
alignas(16)?
 
well, alignof(__mm128) > alignof(std::maxalign_t)
 
@RMartinhoFernandes took me a while to realise I shouldn't read that as "ah-lig-nas"
 
@jalf Well, if your compiler doesn't count __mm128 as a scalar type :(
 
8:53 AM
@RMartinhoFernandes yeah, you can hack it manually. But they don't actually require maxalign_t to be the maximum alignment, so you have to handle these types specially
 
Fuck compiler writers.
 
@RMartinhoFernandes Show me one that does. :)
GCC and MSVC just give you the finger if you try to rely on them for alignment in those cases
 
But why not?
 
Why not fuck compiler writers?
 
COMPILER Y U NO HELP?
 
8:54 AM
uhhh
@RMartinhoFernandes but yeah, my point exactly ;)
 
So, you need to write your own max_align_t with knowledge of the platform :(
 
the standard actually allows this too
 
Not the most space-efficient version, but at least it doesn't crash:
template<typename T>
union aligned_storage_for_dummies
{
    char buffer[sizeof(T)];
    double dummy;
};
 
says that some types can have "extended alignment", and that the implementation can basically do whatever it pleases with them
 
struct real_max_align_t { alignas(16) char hack; };
 
8:57 AM
Is alignas standard? Cool.
 
@RMartinhoFernandes Now add support for AVX. Doesn't that require 32 byte alignment? ;)
 
@jalf That's why I said "with knowledge of the platform :("
struct totally_silly_max_align_t { alignas(1 << (sizeof(intmax_t) * CHAR_BIT)) char hack; };
 

« first day (460 days earlier)      last day (4479 days later) »