« first day (533 days earlier)      last day (4405 days later) » 

12:09 AM
    template< class CharT, int n >
    struct Literal;

    template< int n >
    struct Literal< char, n >
    {
        static char const (&str( char const (&ns)[n], wchar_t const (&)[n] ))[n]
        { return ns; }
    };

    template< int n >
    struct Literal< wchar_t, n >
    {
        static wchar_t const (&str( char const (&)[n], wchar_t const (&ws)[n] ))[n]
        { return ws; }
    };

    #define CPP_S( charT, literal )     \
        cpp::Literal< charT, sizeof( literal ) >::str( literal, L##literal )
^ I think I did this many years ago, but I can't remember what the problem with it was (that caused me to stop doing it / using it)?
 
You needed more than the basic source (character?) set and/or ASCII?
 
@CheersandhthAlf what this code for?
 
> *WTF* is this code for?
FTFY :)
 
It lets you write a string literal once in code templated on char/wchar_t
 
Perhaps array initialization?
 
12:15 AM
Sorry about the edits :-)
 
@CheersandhthAlf could you show an example?
 
@CheersandhthAlf That's a worthy cause.
 
    template< class CharT, class XReason >
    bool CPP_NORETURN throwX( wstring const& s, XReason const& xr )
    {
        throwX( s + CPP_S( CharT, "\n!Because: " ) + messageOf( xr ) );
    }
I'm just writing that, need to change the wstring
As they say, "work in progress" :)
It is sad fact, that the C++11 nested exception thing is not implemented in Visual C++ 10.0
But it does have exception pointer support
To some degree -- comparing exception pointers to zero is broken, but fixed for VC 11
 
I can't remember when I used template<class CharT> with string literals last time
 
@je4d Sorry the code was already changed for that before I uploaded, I just never edited the other function I posted in my question. Is there really nothing else that could be wrong with my code?
 
12:23 AM
    bool CPP_NORETURN throwX( wstring const& s ) { throw WideStringException( s ); }

    bool CPP_NORETURN throwX( string const& s ) { throwX( widened( s.c_str() ) ); }

    template< class CharT, class XReason >
    bool CPP_NORETURN throwX( std::basic_string<CharT> const& s, XReason const& xr )
    {
        throwX( s + CPP_S( CharT, "\n!Because: " ) + messageOf( xr ) );
    }

    template< class XReason >
    bool CPP_NORETURN throwX( string const& s, XReason const& xr )
    {
        throwX<char, XReason>( s, xr );
^ Usage example that compiles & apparently works OK.
 
@CheersandhthAlf Can you take a quick look at my question?
 
huh, where?
 
I'm having a really hard time with it
2
Q: Circular collision rebound not working properly

vorbis5I'm writing a little physics simulation in C++ that basically moves circles across the screen and when two circles collide, they should ricochet in the same manner as billiard balls would. When the circles do collide with each other, most of the time they will practically slow down infinitely/the...

 
Hi.
 
12:27 AM
@vorbis5 write unit-tests, or just cut it to minimal code which reproduces that issue
 
I got a job offer.
For doing Android development.
 
@RMartinhoFernandes java?
 
(I apologize for saying the J-word here)
 
@abyx my program is practically as minimum as it gets. i literally have nothing else going on :\
 
12:30 AM
@vorbis5 I think, don't move back a frame. Avoid new collision detection in some other way.
Also, the updating seems a bit one-sided. What about the other ball?
Finally, think about single responsibility. This method appears to do too much, both detection and updating. Try to split it.
 
@CheersandhthAlf The other ball should update itself in the same manner once the the loop comes to it. I'm definitely saying that something in my method is wrong, I'm just trying to figure out how to fix it
 
Finally I got part of my program to work!!!!!! After 20 hours of spamming this chat room. Part of my program works!
 
it's... scary
 
Well that's why extreme programming makes use of pair programming and not safe programming.
 
12:44 AM
I'm still not sure what the video is about.
 
Unfortunately there's no relevant Wikipedia article on spooning. I was expecting one with pictures and everything :(
 
12:57 AM
I guess this is this year's April Fools on SO.
A unicornified Clippy.
 
1:12 AM
yo
 
1:24 AM
@RMartinhoFernandes How did you get that?
 
No idea.
It just showed up.
@Potatoswatter George Edison is reverse engineering it here:
7
A: How can I get the April Fool's joke to appear?

George EdisonThis is indeed very mysterious. Jeremy Banks pointed out the following little snippet in http://meta.stackoverflow.com/content/js/full-a.js: $.post("/clippy/get?id="+ So I decided to try /clippy/get?id=1 and received: "It looks like you're trying to reverse-engineer the clippycorn. You're...

 
1:53 AM
My two cents on RIM. Not well written IMHO, but a conglomerate of random thoughts over the past few days.
 
I feel bad for the guys developing a whole tablet platform just because the vultures investors would be unhappy if it weren't "worked on."
 
Yup.
 
@FrankComputer you should meet our FlippantRobot
 
who's that?
 
@RMartinhoFernandes
 
1:58 AM
What did I do now?
 
You're a vampire!
 
@RMartinhoFernandes fuzz the clippycorn
 
Oh hey, comments are updated real-time, too.
 
anyone here know the art of fuzzing for reverse-engineering?
 
2:01 AM
What.
 
Fuzz testing or fuzzing is a software testing technique, often automated or semi-automated, that involves providing invalid, unexpected, or random data to the inputs of a computer program. The program is then monitored for exceptions such as crashes, or failing built-in code assertions or for finding potential memory leaks. Fuzzing is commonly used to test for security problems in software or computer systems. The field of fuzz testing originates with Barton Miller at the University of Wisconsin 1988. This early work includes not only the use of random unstructured testing, but also a sy...
 
What do you call words like "how", "what", "where", "why", that you use to introduce questions?
 
interrogative words
 
@jalf I updated my code with the latest revision on your stm repository. I don't know if it should be stable, but it fails this unit test. FYI :)
 
can anyone help me look at some numbers and try to derive a relationship?
 
2:03 AM
@WhatsInAName Thanks.
 
i am having a hell of a time with it
 
@WhatsInAName provide the numbers
 
the c=1 case is easy to see the pattern for
but c=2 onward is just gibberish to me
 
Is it an iq test or something?
 
no, part of a very large, ongoing problem i am trying to solve
for fun
 
2:09 AM
@WhatsInAName "Active Elementary Number Theory"
 
And you want to create an algorithm that can find the pattern?
 
Number theory is a branch of pure mathematics devoted primarily to the study of the integers. Number theorists study prime numbers (which, when multiplied, give all the integers) as well as the properties of objects made out of integers (such as rational numbers) or defined as generalizations of the integers (such as, for example, algebraic integers). Integers can be considered either in themselves or as solutions to equations (diophantine geometry). Questions in number theory are often best understood through the study of analytical objects (e.g., the Riemann zeta function) that encode ...
 
i am just trying to figure out how these numbers can be derived
the c=1 case is easy enough
the algorithm for everything else i don't know
the first numbers of the c=2 case follow oeis.org/… but the rest of the numbers idk
 
does anyone know what a "perfect number" is?
 
Google?
 
2:12 AM
6,28,496..
are perfect numbers
 
perfect numbers just mean the additive and multiplicative breakdowns lead to the same number
 
@FrankComputer Numbers equal to the sum of their divisors (not including themselves, obviously)
 
6 = 3 + 2 + 1 = 3 * 2 * 1
 
@WhatsInAName Not true for 28.
 
2:15 AM
1 + 2 + 4 + 7 + 14
 
yes, a number where the sum of its whole-number divisors are equal to that number.
anyone know the next perfect number after 496?
 
It's 8128.
 
The following is a list of the known perfect numbers, including the Mersenne prime exponent p which generates them with the expression 2p−1× (2p − 1) where 2p − 1 is a Mersenne prime. All even perfect numbers are of this form. It is not known whether there are any odd perfect numbers. there are 47 known perfect numbers in total. {| class="wikitable" ! Rank ! p ! Perfect number ! Digits ! Year ! Discoverer |- | 1||align="right"|2||align="right"|6||align="right"|1||Known to the Greeks|| |- | 2||align="right"|3||align="right"|28||align="right"|2||Known to the Greeks|| |- | 3||align="right"|5...
 
this was my first computer class assignment back in 1972 on a GE Mark II Timesharing teletype
.. at the incredibly fast communications speed of 300 baud :)
 
anyone have any thoughts on the pattern pic
 
2:25 AM
.. talk about a basic program to calculate perfect numbers from 1 to 10,000.. it ate up CPU resources like you could not believe!
@WhatsInAName is it a "number theory" puzzle?
 
Hi. I know this question is an Android one, but the problem is mainly in the Javascript. Could you guys please take a look if you have a moment? stackoverflow.com/questions/9960934/…
 
Erm, this is the C++ room.
The problem being in the JavaScript and not Android-related does not help much.

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
Whoops. Sorry, don't know how I clicked C++
 
JavaScript usually goes up in flames in this room :)
 
@MarkLyons No problem. At least this time it was an accident :) Often it isn't :(
 
2:36 AM
I could see people going in every room posting their question :P
 
@RMartinhoFernandes portugues o brazileiro?
 
Me? I'm Portuguese.
 
@RMartinhoFernandes have you ever worked with INFORMIX-SQL?
 
2:40 AM
I don't even know what that one is.
 
Visual Fox Pro
 
Oh that.
I saw it once.
But I never really used it.
 
dont do much DB stuff?
 
Haha, we've gone from JavaScript to FoxPro?? Is it possible to go further downhill?
 
2:41 AM
assembler?
 
@Potatoswatter VB6 ...
 
My AppleScript client is constructing a query to a VB6 middleware frontend on a FoxPro database…
 
@FrankComputer FTR, I'm still a student. I had a job last year, and I'll be probably be starting a new one next week, so I don't have a lot of experience.
 
congrats, best wishes!
 
My previous job involved test automation tools, so no, not much database work.
 
2:43 AM
@Potatoswatter SQL?
ODBC
 
Some of the mods in the network are really missing something. It is one thing to ban the word "fuck", but to ban interrogative words from questions is just downright bananas.
-8
Q: How to do my job? Or, ban the word “how” in questions

GillesWe've observed a particular pattern of questions emerging on several Stack Exchange sites. How do you test if something is hidden with jQuery? How to “add existing frameworks” in Xcode 4? How do you search for backdoors from the previous IT person? How do you find what process is holdin...

 
That's absurd.
 
i upvoted it :)
 
@StackedCrooked No, it makes perfect sense. You can't ask questions with proper English, that doesn't make the Internet a better place.
 
its now at -7
 
2:55 AM
That is an absurd post
 
Of course. It's natural way to ask certain questions in English.
 
I use "What is the right way.."
 
Maybe it's an April Fools joke.
 
Hauw can I fix my code?
 
2:58 AM
Not a very funny joke
 
@RMartinhoFernandes Thanks for the warning. I have to be on the lookout today.
 
I heard an april fools virus is on the loose
 
It's ok to infect the world with a virus if it's for an April fools joke.
Adblock is showing cats now.
 
.. like making you think your computer is infected?
 
@FrankComputer Which requires a virus.. :D
 
3:02 AM
i remember seeing my first virus called "stoned" on a CP/M machine
an Altos 8000 non-DMA computer with 8" floppies
 
year, 1982
 
tickle a unicorn?
 
They should implement "subtext or innuendo for:" as a real feature.
 
3:09 AM
.. search by odor?
.. implement sarchasm too
 
Ok, I'm going to sleep. Need to wake up during daylight tomorrow.
Good night.
 
Night.
@daknok_t Real programmers are the right tool for the job. :p
 
3:35 AM
@FrankComputer Into the sarchasm.
 
1st of April, the day we remember what we are the rest of the year.
now, to think of a safety-measure before those lebanese kids in the neighbourhood start pulling april-fool pranks on me. maybe I should stay at home for today?
 
4:22 AM
@RMartinhoFernandes wtf?!? seriously?
Is that a failed April Fools joke?
 
I would hope so.
So you're one of the "How to do my job"-guys?
 
lol
 
4:32 AM
Seems like a disproportionally large amount of my answers are "Why" questions.
 
I JUST GOT A GIRLFRIEND! ........ April Fools. :'(
@StackedCrooked maybe he's dead?
 
@IntermediateHacker Probably, I fear.
 
4:48 AM
poor guy. He's awesome, though. I'm subscribing to him.
 
Cool :)
 
what's the guy's full name? can't be too hard to google to see if he's still here?
 
he's on twitter too.
by the way, am I the only one who thinks youtube with the special earth hour light-switch off theme looks better than the original theme?
@grumpyjiisan, Arizona
Retired
322 tweets, 237 followers, following 8 users
last tweet: 24 May, 2011
> Watched Taisho Baseball Girls thru 9, via Anime Network. So far, I like its earnestness.
^ Lol, seriously?
He watches Taisho Baseball Girls?
 
lol...
 
"Yokohama Kaidashi Kikou" (1998-2002 OVAs) turned out pleasant, relaxing. Sort of Aria with robots. Thx to theanimereview.com for idea.
okay seriously. this guy is my hero!
I mean, he's timeless .
 
4:59 AM
It's a good thing I don't tweet everything I watch...
Nice try... um no. I've never seen any hentai aside from a censorship panel at ACEN...
 
@Mysticial but your gravatar shouts "I watch hentai!".
 
lol, it does?
 
well yeah. a bit. you know, pic of a crying anime girl in the rain...
 
Were you there when someone asked where it's from?
 
no. where's it from?
 
5:06 AM
Bokurano
second to last episode
the girl is one of the main characters and is about to die
*and she knows it
ahhhhh!!! I just got hit by the meta April Fools popup
 
I see.
there's an April Fools popup on meta?
 
that was probably one of the more disturbing/depressing shows I've seen... lol
I've been using the same avatar for everything for like 3 or 4 years now...
I keep wanting to change it every now and then, but then I'm like... meh
I think I figured that one out... hehe
 
 
2 hours later…
7:14 AM
7
A: How to get the opposite value of a bool variable in C++

Cheers and hth. - AlfOPERATORS for logical Not You can choose whether you want to write !, or not, or some mixture. However, still as of version 10.0 Visual C++ does not have the reserved word not built-in. So for Visual C++, if you want to use not you have to include the [iso646.h] header, which is a header from ...

^ I liked my own answer best. :-)
 
+1, I didn't even notice it until now. lol
I just got the cloppy for the 3rd time. :D
@sbi Awesome...
Need to ask @sehe if C# and Db are always the same on all temperaments.
 
@Mysticial not quite. they can't be. it took a number of decades before i understood why an ordinary guitar can't be perfectly tuned... :-(
^ I think.
^ But thinking twice, I'm not sure...
 
7:45 AM
@StackedCrooked it's a known issue, yes. The problem is that open_rw creates a copy of the object, and open_r doesn't. It uses the most recent instance it can find (if a copy exists because of a prior open_rw call, it uses that, otherwise it uses the original object)
And since open_r just returns a reference, that reference keeps pointing to the original object if a copy is made afterwards
I can't really see a way to get around it, unfortunately. I guess I could write some kind of proxy reference wrapper, but I'm not sure how well that would work
 
why the heck did MS think it was necessary to invent yet another programming language?
 
because they don't own C/C++/Java and that makes them sad :)
 
@TonyTheLion looks fake to me
like, very fake
the domain is registered by "A Happy DreamHost Customer, 417 Associated Rd #324, Brea, CA 92821"
and the page doesn't look very microsofty
 
just saw an example snippet of the code.... it's definitely fake lol
 
@jalf meh, yea, looking again
 
7:56 AM
Guys , I have a design decision to make and would like some advice , is it ever healthy to have something point to something , that might indirectly point back ?
Naked pointers all the way
@ScottW Thats deliberate , all these pointers are managed by a map having shared pointers
 
@angryInsomniac No. Use Smart pointers or avoid pointers all together
Pointers are error prone
 
so everything stays in scope till I remove it from the map
 
@StackedCrooked hm, isn't that the same issue? You call open_r on b before open_rw, so the first call will use its old value
@TonyTheLion well, assuming the pointers imply some kind of ownership
 
@jalf I figured it would be an inherent issue. The problem is that it may lead to subtle bugs when using composition.
 
raw pointers are the proper tool if the relationship is non-owning
 
7:59 AM
naked pointers are not the decision :) that's something I am doing on purpose , what I am concerned about is the circular pointing
 
@StackedCrooked yeah, agreed. Tbh I'm not sure what the best solution is
 
@jalf You mean the failing unit test? It did pass with the original stm code you gave me.
@jalf Just for experimentation I changed all open_r into open_rw. I noticed that one thread got into a infinite loop then. I can reproduce it in the original code, but I haven't yet been able to reproduce it in a simplified self-contained example.
 
hmm, ok.
 
No takers ? :(
 
sounds like something is wrong then :D
 
8:02 AM
:)
And now I should probably sleep soon :)
 
so what do you think I should do about the first problem?
 
@jalf Don't know yet. I'll think about it, after I slept :D
 
mawnin
 
Runtime assertion perhaps. But that's not so pretty.
 
Could have open_r return some kind of proxy object instead. That just seems kind of nasty, would slow down read access, and can still be worked around to break the code
Hmm, assertion if you open_rw after open_r, you mean?
 
8:04 AM
Yeah, something like that. Haven't thought it through though. Could be impossible to pull off.
 
that might work
 
@ScottW Nope, I'm dozing off.
 
will think about it :)
 
Alright.
I'm off to sleep then :)
 
maybe the solution would just be as simple as saying "don't let the open_r reference outlive the scope it's declared in"
 
8:05 AM
@ScottW Night.
@jalf I can't parse that right now :D
 
me either, not sure that fixes it
will think about it :)
 
are variadic templates template<typename... T> or template<typename T...>?
I always forget
 
damn, I linked this question on meta, and now it's got 3 delete votes on it. (and it only needs one more.) Anyone with me to undeleting it when it gets that last vote?
0
Q: How do I add two numbers without the + operator?

Viswanathan IyerHow do I calculate the sum of a and b without using the + operator? int a = 10; int b = 10; int sum = a + b;

 
@jalf Two possible options: (1) open_r() could return by value, making it obvious to the user that the value won't ever be updated automagically. (2) throw if the object returned by open_r() is dereferenced after a open_rw() (this way open_rw() is still allowed after open_r()).
And now I'm off to sleep :)
 
@Mysticial I'm not really seeing the reason it has to stay around.
it's a pointless question with no value to anybody
 
8:14 AM
Simple it may be, it was interesting to me at least. Guess not everyone agrees...
 
this is not the site of interesting pathetic and pointless hacks, it's the site of useful questions
 
You can say the same about half the questions on the site then...
 
I usually do for any such I come across
 
8:28 AM
I hate it that I can't see deleted questions
 
Now I feel very guilty for linking it... I don't see how it hurts to keep it around. At least it's more than 60 days old.
 
@StackedCrooked come to think of it, maybe the answer is that you're doing it wrong. ;)
I'll see what I can come up with
 
8:47 AM
btw
lol at the Clippy thing on SO
 
@DeadMG I've gotten it 4 times already, lol
 
I turned it off and now I want to turn it back on :(
 
9:07 AM
@DeadMG template<typename... T>
 
meh, I just got fooled on this 1st of April
 
@TonyTheLion I got fooled already at 0:10 AM today. -_-
 
it susks
 
it's entirely pointless
 
what's not pointless in your view?
 
9:15 AM
writing awesome code
 
@daknok_t Where are the hidden monsters ? :D
 
@angryInsomniac How am I supposed to know? They are hidden!
 
@daknok_t apparently hidden too well !
 
@angryInsomniac Try coordinates 0,0
 
9:26 AM
lol try street view
 
No monster in loch ness :(
oops , there it is ! :D
 
@angryInsomniac hyperlink? I can't find it.
 
@daknok_t +57° 20' 0.37", -4° 25' 12.10"
there
 
thanks! :P
 
also a werewolf at : +35° 46' 56.94", -97° 25' 35.73"
 
9:46 AM
I like how SE now updates the post scores in real-time.
 
Oh hey... try googling for the weather...
 
I would make it snow 20 meters just to troll my neighbors.
 
Someone needs to ask on SuperUser: "Why doesn't Google's weather control work? I've waited 45 minutes and it isn't snowing yet."
nah, not fit for SuperUser... what's a better site for it?
 
skeptics?
 
Be sure to post a link here.
Or shall I ask it?
 
9:59 AM
@daknok_t Go for it. :)
 
@Mysticial Can you give a link to the search results page? It isn't working here, probably because I'm in the Netherlands.
 
Good grief, the forecast here next week has the weather climbing to 40 C with nonstop rain… what did I get myself into…
 
Try this? google.com/…
not sure though
I think it still checks your location.
might want someone with more rep on that site though. Don't wanna get you question banned.
But it'll be interesting so see how it's received. Can be either very good or very bad. lol
 
It doesn't work here.
 
damn...
 
10:03 AM
Can you give a screenshot where you set it to snow?
 
I think it only works in the US and A
 
Where I am not. :P
Oh never mind got it
 
Works in the Philippines
 
0
Q: Why doesn't Google's weather control work?

daknok_tI tried to control the weather using Google over 45 minutes ago, but it still isn't snowing yet. What did I do wrong? Should I try it again?

3
 
this is gonna be interesting...
 
10:09 AM
:P
I don't really care if it gets down voted.
As if I'll ever use that SE site. :P
 
It's like the C- on the report card that proves you're a badass.
 
I gotta go for half an hour. brb
 
Hmm, the first American city you thought of was Las Vegas :(
 
:P
 
Rps
it's time for holidays..
boost is messing with my head
 
10:19 AM
@Potatoswatter Well, Las Vegas is one of the last places in the US, that you'd expect to snow.
 
@Potatoswatter ................................................................
 
The altitude is high enough that it happens. I think Phoenix gets less snow…
Or San Diego, which gets much more precipitation but is moderated by the Pacific
 
damn I can't grasp the orderby keyword in C# LINQ Queries. :(
damn this LINQ shit. :'(
 
@IntermediateHacker Are you the workman blaming the tool?
 
10:29 AM
ah, been a while since we've seen spurious flagging... That feels so good
 
@IntermediateHacker It's a simple sort, afaik.
 
Back am I.
 
10:50 AM
you know, LINQ is awesome.
 
Hey, isn't std::allocator<T> required to use ::operator new?
So if I replace my global operator new, I should see the effect in every standard container?
 
If there is one language that's got class, it's C#. (except for those weak runtime generics, I hate their guts).
 
@KerrekSB yes. C++ really gives you the bluntest instrument you could want :vP
 
seriously though. Try translating this awesome piece of compact code to C++. You'll end up with something 4x larger...
	var letters = {'d','a','C','n','D','e','R','f'};
	(from l in letters orderby char.ToLower(l) select l).ToList()
		.ForEach(i => Console.WriteLine(i));
 
@IntermediateHacker Actually, with the appropriate support libraries, you can get something fairly identical.
 
10:56 AM
@DeadMG I doubt it. You'll still need at least one for loop. and braces.
 
@IntermediateHacker: It seems you can use lambdas to deal with that
 
@Potatoswatter I tried replacing the global function, but I don't see its effects in standard containers, using GCC 4.7.
 
char letters[] = {'d','a','C','n','D','e','R','f'};
std::sort( std::begin( letters ), std::end( letters ),
    []( char lhs, char rhs ){ return std::tolower( lhs ) < std::tolower( rhs ); } );
std::cout.write( letters, sizeof letters );
 
I wonder if there's some sort of bug in the library.
 
@KerrekSB did you #include <new>?
 
10:59 AM
@Potatoswatter It's still 1.8x larger.
 

« first day (533 days earlier)      last day (4405 days later) »