« first day (438 days earlier)      last day (4517 days later) » 
00:00 - 18:0018:00 - 00:00

6:00 PM
@AlfPSteinbach out of country? , enjoy :)
 
well it's the same country but some 8000 km north i think
it's a long country
oh sorry, only about 1002 km. but it's long anyway
 
@AlfPSteinbach cool , Did you do something very awesome (unpredicted) so far in your journey?
 
Does any country span 8000 km north-south?
 
well no :-) not yet
 
@Potatoswatter Russia I guess?
 
6:05 PM
Ah, the United States does if you count Alaska to Hawaii
 
well i
ve written a fourth installment of my learning windows api programming series
but the feeds guy has already posted that
 
@MrAnubis Nope, only 5400 km from southernmost point in Russia to the pole… and they don't claim the pole.
 
seems that ' is broken
 
i think a quarter circumference of the earth is 10 000 km
by definition?
 
Not by definition
That was once a definition but it's too variable.
 
6:11 PM
@AlfPSteinbach you've been writing tutorial series during the holidays? 0_o
 
I don't think that GUI on pure WinAPI is a good idea
 
@AlfPSteinbach that is windows api? or windows 7 api? ( I don't know nothing about them)
 
also there is C++ without classes
 
it's not windows 7 specific yet. i think the code would work nicely with window xp
 
6:14 PM
ops, even the US doesn't span that far, only 6300km+ even including Samoa
 
or even windows 2000
 
@AlfPSteinbach but the icons you add to preview app (Windows task switcher) looks like got support in windows 7 only?
 
i think the 256x256 size was introduced in Windows Vista. but you don't need that
:-)
 
@AlfPSteinbach aah
@AlfPSteinbach you forgot to edit this page : learnwinapi.wordpress.com/about
 
user406009
6:47 PM
Lol, someone just posted this on freenode ideone.com/kjlHv
4
 
user406009
Talk about the daily wtf.
 
7:07 PM
gist: Accessing Private Data c.f. http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html, 2011-12-28 17:50:37Z
#include <iostream>

// Generate a static data member of type Tag::type in which to store
// the address of a private member.  It is crucial that Tag does not
// depend on the /value/ of the the stored address in any way so that
// we can access it from ordinary code without directly touching
// private data.
template <class Tag>
struct stowed
{
     static typename Tag::type value;
}; 
template <class Tag> 
typename Tag::type stowed<Tag>::value;

// Generate a static data member whose constructor initializes
// stowed<Tag>::value.  This type will only be named in an explicit
// instantiation, where it is legal to pass the address of a private
// member.
template <class Tag, typename Tag::type x>
struct stow_private
{
     stow_private() { stowed<Tag>::value = x; }
     static stow_private instance;
};
template <class Tag, typename Tag::type x> 
stow_private<Tag,x> stow_private<Tag,x>::instance;

// ------- Usage -------

// Demonstration type with private data
struct A
{
     A() : x("proof!") {}
private:
     char const* x;
};

// A tag type for A::x.  Each distinct private member should have its
// own tag.  Each tag should contain a nested ::type that is the
// corresponding pointer-to-member type.
struct A_x { typedef char const*(A::*type); };

// Explicit instantiation; the only place where it is legal to pass
// the address of a private member.  Generates the static ::instance
// that in turn initializes stowed<Tag>::value.
template class stow_private<A_x,&A::x>;

int main()
{
        A a;

        // Use the stowed private member pointer
        std::cout << a.*stowed<A_x>::value << std::endl;
};
I wonder about Dave's claim "the only place where it is legal to pass the address of a private member" -- where does std say it is allowed?
 
Xeo
Hm, I thought access check happens as part of template argument checking?
Yep, thought so.
> (§14.3/3) The name of a template-argument shall be accessible at the point where it is used as a template-argument.
template<class T> class X {
    static T t;
};

class Y {
private:
    struct S { /* ... */ };
    X<S> x;    // OK: S is accessible
               // X<Y::S> has a static member of type Y::S
               // OK: even though Y::S is private
};

X<Y::S> y; // error: S not accessible
 
@Xeo §14.7.2/12: "The usual access checking rules do not apply to names used to specify explicit instantiations."
 
Xeo
@Potatoswatter oh my gosh...
I can certainly see why they'd allow that though, hmm...
 
7:27 PM
Meh. The parameters in the template-id aren't inside the scope of the definition so don't benefit from being friended by the owner of the private member, but I don't see right now why they couldn't just extend friendship there rather than cancel all access checking.
 
Actually following the links it's @Johannes at work again...
 
Xeo
Yeah
 
Yeah, I used this just over a year ago for a hack to extend GCC's codecvt support.
 
Xeo
Anyone with GCC 4.6 here?
 
huh, i didn't know about until now
 
7:29 PM
Didn't want to go the copy-paste route… took a few tries to get it to work!
 
saw it on boost mail list
 
pastie.org/1188625, encapsulated the principle into class_violator toward the bottom.
 
Xeo
@Alf, you had access to GCC 4.6, right?
 
@Xeo yes i have that in ubuntu
you can also install mingw 4.6 for windows
 
Xeo
Would you mind doing a quick test compilation with this code and -std=c++0x option?
 
@Xeo it compiles
 
Xeo
Hm. Anyone with a mingw distro of 4.6 that could test the same code?
0
A: generate_n using lambda and back_inserter in C++

XeoSounds like you are missing an #include <algorithm>, since GCC 4.5.1 aswell as MSVC10 compile the following code without error: #include <vector> #include <algorithm> #include <iterator> using namespace std; void _generateRandomIndices(vector<unsigned int> & in...

Sounds like that guys stdlib is broken
 
your code don't use _generateRandomIndices
 
Xeo
That's unimportant as it's not a template.
It will get parsed
 
it depends..
 
7:41 PM
@Xeo it compiles cleanly with 4.6.1
 
ok, it compiles even if _generateRandomIndices is used
 
Xeo
@AlfPSteinbach k, thanks
@Abyx It only depends if _generateRandomIndices was a template
Ah, he uses mingw32.
Sounds like indeed his stdlib and/or stdlib path are broken
 
Ah, extended friendship in explicit specialization declarations wouldn't allow for an explicit specialization on private members of two different classes, because each class would need to declare the other's member within its friend declaration. Both classes would have to be complete within both their definitions. Deadlock!
 
@Potatoswatter i saw this on a couple of blogs (including Sutter's Mill) before
@Potatoswatter The Netherlands are the biggest country then. If I start where I live, and travel 40,008 km east-bound, the end-point of the journey will be in the Netherlands.
 
@sehe The question was specifically north-south.
 
7:54 PM
nice, Dave uses by private hack code xD
 
@Potatoswatter Same deal, give or take a few hundred kilometers :)
 
8:29 PM
@Xeo Hey, there's an Area 51 proposal for Anime/Manga... hmmm.....
 
Xeo
@Mysticial Nice! :)
 
@Xeo If we join, we'll be #1 and #3 highest rep committers
 
Xeo
Why do they need my full name for a commitment. :(
 
@Xeo Is that a deal-breaker? It doesn't look like it's gonna be displayed.
 
Xeo
No, I'm just wondering
 
8:36 PM
*maybe we have to log-in first
that's why it's asking for that
 
Xeo
I'm already logged in
> Commit! When a proposal enters the "Commitment" phase, we will present a petition for the site's creation. Interested users are asked to digitally "sign" the proposal with their full name to help assure that site will have an active community in those critical early days.
From the FAQ
Hm
Maybe we should have a Japanese Culture, because Touhou doesn't fit in Anime & Manga. :/
 
There is a Japanese Culture proposal, but it hasn't gotten anywhere yet
"While your full name is never shown, you may add an optional comment which is displayed alongside your username in the list of committers." Fair enough, though I'm not trying to be anonymous anyway.
 
Xeo
Hm, too bad it's already in commitment phase. If it was still in define phase, it could've been changed to Anime, Manga & Doujin
Which would include Touhou, since it's a doujin project
 
how does the "total rep" work on Area51? Clearly I have more than 151
 
Xeo
rep on all SE sites
 
8:49 PM
or is it just a caching issue to wait on until the SE network updates itself
 
9:05 PM
Where would one discuss online identity issues? Any SE site?
 
hey guys
 
As in what should be done to remove personal information (used to be government owned and heavily regulated) from the corporate Google, Facebook etc.
@DeadMG Hey M, I'm starting out heavy here =)
 
lol
I appear to have somehow blocked my bath
I didn't even know that was possible
 
A bath can only be blocked by sub-zero temperatures in my experience
And even then it's only often temporary.
 
wel
I waited a little bit and it seemed to have gone down slowly
 
9:10 PM
Your bath drain? =)
 
the bath water :P
 
A plunger is good to have if you live in an apartment with somewhat old pipes.
Anyways, good to have you clean and proper for the new year =)
 
rofl
proper? I doubt it
 
Xeo
Looks playable
 
Yes I've played it a few times.
 
9:17 PM
Nope. It says so right in bar 2 of the CODA: "This is actually unplayable"
(directly below "APPLY BROWN LIQUID NOW"). I'd be curious whether Sears actually carries violins :)
 
@sehe Its was the piano that was drinking, so it disregarded that instrunction.
 
| origin = Tucson, Arizona, United States | instrument = Vocals, guitar, percussion | genre = Rock, rock and roll, folk, country rock, jazz, Latin American, Cajun, big band, pop rock, art rock, operetta | occupation = Singer, songwriter, musician, record producer, actress | years_active = 1967–present | label = Capitol, Asylum, Verve | associated_acts = Stone Poneys, Neil Young, Swampwater, Free Creek, Eagles, Dolly Parton, Emmylou Harris, The Muppets, Aaron Neville, Rubén Fuentes, , Nelson Riddle, Ann Savoy, Jackson Bro...
"Linda Ronstadt is God"
@CaptainGiraffe Mmm. My grand's keyboard just came back after full revision, reweighting and stuff last week, so I'll just not try it out just now
 
@sehe :Sweet I hope for the best for you, those things can be tricky.
@sehe Did you get any say in the weighting?
 
@CaptainGiraffe Of course! I opted for a diet: it was really quite heavy - I thought that would be good for me when I bought the thing 8 years ago. I very much changed my mind, because I now strongly believe that a lightweight mechanism fosters good technique
So it is really much nicer now (phew) and I had the whole range re-intoned (?) so it all blends very well again. Lovely to be playing again. I'm not so sure the neighbours agreed when I stopped.
At 2:30 a.m.
 
lol =)
My neighbours complained at 22.40 on my spanish guitar:/
 
Xeo
9:28 PM
This is insane. Insanely epic.
 
oh noes. Luckily, although we have neighbours, we carefully picked the house for it's 'side-chamber'. The grand piano is really quite remote from the neighbours-side and thusly they don't have to suffer a lot. I'm sure, your neighbours would be complaining every day, though
@Xeo You stole 'DaveThePuppetGuy's' comment. Allthough, it is insanely 'appic' !
@Xeo I'm sure you can use 3d printers for this, these days :)
 
@sehe I no longer play the guitar, but a digital piano, I just had to learn the chopin that Victor Borge got owned by, in a very famous skit =)
On the Lounges topic all I can say is youtube.com/watch?v=HZRB-x5LNgw
The chopin piece is the one 1:00 in to youtube.com/watch?v=SfKqzN5MZYU
 
@CaptainGiraffe With gloves on as well :) Very nice clip - and the freaking flute :)
 
@sehe I wish to find the Victor of our time. And how I wish he didn't die.
 
@CaptainGiraffe: i must admit until now I only 'heard' about him, never saw him doing his act
 
9:38 PM
@sehe Yep the flute crapped me you too =) Must have been practising like crazy for those seconds.
 
Thanks for putting me on the youtube 'trail' :)
 
@sehe Oh, I envy you.
@sehe The Liszt Liebstraum is my fav, in so many renditions.
 
I'm afraid the real sick talents can just play that. I remember practicing jazz with a blues harpist, and one day he asked, "Hey what's that you're playing? Sounds nice"
Next week he was playing my Violin Partita in B-minor (Bach) on the blues harp. No kidding.
Oh, and he didn't read notes ...
 
I understand exactly what you are saying; I have not met such a talent? myself, but many attest to it.
It's unfair to call them talent in my opinion. They are alread accomplished, with thousand of hours of practising.
 
Quite demotivating at times, too. It was part of the reason for me to drop out of conservatory (besides the fact that the market for Muscial Theorists is,... shall we say, a bit shallow)
@CaptainGiraffe Yeah, my choice of words is influenced by my mother language there. I'm dutch
Talent in dutch doesn't really imply 'promise' like it does in English, I feel
 
9:42 PM
@sehe I lament the fact that we don't regard Gould as a hero anymore.
 
Don't we? I do :) I have his full recordings on the shelf, and love his bach style.
 
@sehe I agree on your talent == promise, I'm swedish, but I disagree on calling established know-how as talent.
 
Anything he plays, really, is so crisp. I can even listen to the Schoenberg pieces when he plays them - which is quite a feat
Ok, what is your preferred term? Wonders? Masters?
 
@sehe For sure, but those values are yesteryear.
@sehe How about musicians?
 
Hehe. A bit of an understatement there
 
9:45 PM
@sehe Yes, It's a feeble attempt to rob the current tone deaf artists of their status =)
 
Oh my. It's almost year-end, I guess
 
No, its still a few days to go, assuming you are using the gregorian calendar.
 
Xeo
Hm. My resource management code now contains a static, singly-linked list of resource loader registration data.
 
@Xeo soundz a bit like a zingleto, there, maestro
 
@Xeo reading TAoCP Vol1* This is so 1954.
 
9:51 PM
Anyone else having problems with www.twitter.com?
 
Xeo
TAoCP?
 
@sehe what sort of problems?
 
@Xeo Knuth, The Art of Computer Programming. you should wiki it
 
@MooingDuck: just general non-workiness. Nevermind, I figured it out:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc1             9.4G  8.9G   20M 100% /
 
Xeo
lol
 
9:53 PM
@sehe might be related
 
That's what I get for working on a temporary installation of Linux Mint
 
lol =) there is an applet for that sehe
 
Which, btw is working quite nicely for me, and a lot better than the latest offerings from the Canonical camp
 
@sehe 9.4G ?? Are you running this on a phone?
 
You should see my other installations :) (I'm running quite afew now).
I'm always conscious about disk space because I run on 2x30GB SSDs on my workstation
 
9:55 PM
Yes, Canonical seems to be shooting off target but Kubuntu a few months ago seemed to work fine for me.
 
However, I usually run on lvm2 so I can extend/move/etc at will
Mmm. I left KDE about 5+ years ago (?) when they decided to redo all their stuff.
I hated that experience, and found out I can do without all that 'stuff' anyway. The only thing missed about KDE3 is kdirstat
 
Unity was a dealbreaker for me.
 
I still have that installed using a PPA
@CaptainGiraffe precisely. It was easy enough to disable that for natty, but on oneiric, I didn't want to have to go through all the hassle. I'm still evaluating either Linux Mint or pure Debian
 
Debain seems at tad too slow on the repos for me.
 
I'm already gravitating to Linux Mint Debian Edition
@CaptainGiraffe: what do you mean? Their conservative updates or the actual bandw
 
9:58 PM
Who is doing the Mint?
I want Netbeans and Eclipse (bleeding edge) I want BIND9(security aware) and apache 2.3 version.
 
@CaptainGiraffe I don't really know. Here's a 'people involved' page on their site: linuxmint.com/teams.php
Oh, on debian there is only one sane way to have eclipse at all: manual installation in your home dir
The packaged will totally fuck up any installed updates/features from within Eclipse, in my experience
 
I guess thats the way for netbeans too. well nevermind.
 
so if I'm making a container, and in the container's destructor an element's destructor throws an exception, do I just let that fall through and leak all the data like microsoft seems to?
 
BIND9 seems like you'd like FreeBSD
 
@sehe If you studied at a conservatory, how did you end up doing c++ and computing?
 
10:02 PM
@MooingDuck 'like microsoft seems to' - care to elaborate?
 
@sehe I'm looking through std::vector::~vector, and it has no try/catch anywhere that I can find
 
@CaptainGiraffe How not? I've been doing music and programming for about equally long in my life (actually started a bit earlier with the violin)
 
@MooingDuck Also a destructor throws, car to elaborate?
 
@CaptainGiraffe allocator<>::destroy is not nothrow. There's nothing saying it can't throw exceptions.
 
@sehe But your first academic studies was with the violin?
2
 
10:04 PM
Academic? No, I studied maths for 1 year (doing a lot of informatics subjects on the side)
Then I switched to major Musical Theory (upon finding out that was a real possibility!)
 
@CaptainGiraffe struct A { ~A() {throw 7;} }; <-- how should a container's destructor handle this object? Dinkumware's vector appears to just leak all the vector's internal data.
 
But my 'career' as violinist/pianist at conservatory stemmed from before that: Midway during Highschool I had the exception to skip school for half a day each week to attend conservatory
 
@MooingDuck Johannes_litb would tell you it is a regulag stack unwinding. The destructor, not withstanding any resource deletions would be fulfilled.
 
I was also doing extracurricular subjects in highschool at the time, and involved in way too many ensembles, playing as a ballet pianist, a rehearsal pianist, in a string quartet - it was really quite insane. Oh, and I did some small programming jobs on the side.
 
@sehe I envy your extracurricular stuff
 
10:07 PM
@CaptainGiraffe So just let it leak? The only "better" option that comes to mind is exit(-1). Should I at least attempt to delete the rest of the contained elements? What if a second one throws?
 
However I did do some guitarplaying for a Flamenco class once =)
 
Yeah, well, I'm not so sure in hindsight :) It was quite insane, and I was really buried in all these nice things. I think partly because of that, I forgot to make any choices (I mean, who needs to choose?) and perhaps about a social life as well :)
 
@MooingDuck If you cant RAII it then yes exit(-1)
 
@CaptainGiraffe That seems like the better option. Can I simply mark my destructor as nothrow and the compiler will handle that for me?
 
@CaptainGiraffe Nice! I'm assuming you were playing and the rest were dancing, thought it could be all you playing of course
 
10:09 PM
@sehe Yes =) Me playing; the girls were dancing flamenco "First lesson" =)
I got a few buddies from that =)
Far away a long time ago =)
 
Yeah. I've seen some stuff that I though was anatomically impossible when 'working' (really 'volunteering') at the local ballet school
Sadly, I forgot to take phone numbers back then. Like I said, perhaps a bit too much to think of social life
 
Yes the piano isn't really suited for flamenco unless your partial to Albeniz.
Oh, no phone numbers were exchanged =)
 
I'm not partial to him, but his works are really quite nice, pianistically. I sometimes gloss over a few
 
I very much prefer him on guitar.
 
Of course.
 
10:13 PM
@sehe Good melodies, but nothing compared to Beethoven or Chopin / schubert or any of the greats.
 
I'm still on 38Mb free disk :) Try that on Windows. It would have refused service long time ago
 
I can shoe him in in the Tango maybe =)
 
Who?
 
Still sehe you need to delete that 3D porn!
 
can we get some migrate votes here:
http://stackoverflow.com/questions/8661826/poor-ssd-speed-result-from-visual-c-2008-x86-redistributable-on-windows-7-x64
 
10:15 PM
Albeniz
 
and maybe this one as well:
http://stackoverflow.com/questions/8661817/how-does-the-stackoverflow-suggestion-works
 
I'm re-discovering my Schubert these days, entirely due the revised keyboard
@CaptainGiraffe: no porn. My disks is too expensive, as is my time. What.... 3D you said?
(runs off to get goggles)
 
I understand that, very good luck. I'm a Schubert fan.
@sehe We have a lot of leading edge 3D research in my department, and of course, pron is not an exception.
 
huh.
 
@sehe Mostly off office hours.
 
10:19 PM
but you work with 3d graphics professionally as well?
 
Yes I'm joking.
No not me personally, but we have very good 3D research in my department.
 
Xeo
-2
Q: How to call a specific character from a string in C++?

RedmastifHow would I recall, say, the fourth character and output it on the screen from this code? #include <iostream> #include <string> using namespace std; int main () { cout << "Enter word: "; char random[99]; cin >> random; \\right here is where I would like ...

Where is my "no research effort" close vote..
"too localized" just doesn't fit
 
@CaptainGiraffe So sad. But you get the best recommendation on what graphics card/monitors to buy :)
 
@Xeo Between us we would have a great textbook just based on answers. A meta step by step SO for programming =)
 
@CaptainGiraffe wasn't it like 1967 or thereabouts?
 
10:25 PM
@Xeo Oh WTF... maybe I shouldn't be so reserved with this rep-whoring game...
 
@AlfPSteinbach wat?
 
TAOP vol 1?
 
@AlfPSteinbach You might well be right, I was considering the reference he made.
 
As I recall the good Donald (Knuth) was at Norsk Regnesentral at the time, in Oslo, whiling away his time by writing this monster book. But he didn't do the math himself! And I never got clear on exactly who did the math...
 
@AlfPSteinbach lol, great!
@AlfPSteinbach (at least anecdotal) refs to that =)
 
10:30 PM
hm all i can find is that he wrote vol III while he was at University of Oslo in 1972-73
but I think this about Norsk Regnesentral had to be like five years earlier
 
it's a shame that he likely won't finish the series
 
@AlfPSteinbach Theres still the very impressive $2.56 to collect.
@Pubby No that would be by definition an impossible task.
@AlfPSteinbach Alf are you Norweigian?
 
It's also a shame that so few people will actually read through the entirety
 
huh, how did you guess?
? (he he)
 
:2226496 You said Norsk Regnesentral =)
Like Norveigan Regency house? =)
 
user406009
10:36 PM
Yet another: "How do I mix C callbacks and C++ member functions?" question
 
user406009
0
Q: Convert this helper class to use generic std::function callbacks

Mahmoud Al-QudsiI have this helper class that I use to call member methods for code that's expecting static C functions. This particular "version" is compatible with Windows LPTHREADROUTINE callbacks, taking a DWORD (class::method) (void *) function as a parameter, called like this: CreateThread(NULL, 0, runThr...

 
user406009
I really should have made that community wiki question/answer pair.
 
@CaptainGiraffe it's like Norwegian Computing Centre, nr.no
 
@AlfPSteinbach Nästan som där jag jobbar
 
Hehe. Removed latex* packages and online resized my root partition. Now 20Gb free. Now, where is that 3d porn again?
 
10:40 PM
removed the tex packages noooooooooooooooooo
 
Not from the repo!
They're bloated, confess it. And, I didn't have much luck compiling the standard draft anyway (see github.com/cplusplus/draft)
I was trying to see if I could make pasting quotes a lot more agreeable. The best thing I came up with now, is using evince and pasting into Vim for some light editing
 
You can even do heavy editing in vim =)
 
I mean, not a lot of editing required. I do all my editing in vim, so no need to tell me that :)
 
Nah, I just felt that was worth pointing out.
 
When copying from acroread, I find much less of text structure is preserved in plain text. Brainwave let me have a look at the output from pdf2txt and similar, though
 
10:45 PM
@sehe try sumatra pdf
 
ok you recommended that one before. will do
erm
"Sumatra PDF is a free PDF, XPS, DjVu, CHM, CBZ and CBR reader for Windows" - fail
 
sbi
@EthanSteinberg Basically, that's a dupe of this one and a few others I have already answered.
 
@sbi btw, in VC++ you can use non-static member functions for callbacks =)
 
sbi
@Abyx You can do this everywhere using std::function and std::bind().
 
not with C-style callbacks (function pointers)
 
Xeo
10:53 PM
c++11 lambdas ftw
Too bad MSVC10 didn't get to implement the to-function-pointer conversion
 
no. C# lambdas ftw
 
functional language lambdas ftw
 
but not functional languages themselves
 
??
 
imperative languages ftw.
 
10:57 PM
functional languages are going to win in the language wars, no doubting that
 
@AlfPSteinbach Hehe. the opening screen is quite yellowish. It does work well with wine. And it seems rather snappy. About as snappy as evince :)
 
they can't. never. real world has state
and <s>your processor</s> processor of your PC has mutable state
 
it also has multiple cores
 
@AlfPSteinbach The copy paste result of Sumatra is slightly better in complicated cases. It is char-by-char identical, except that paragraph numbers sometimes appear after their first line when copied from evince. So Sumatra +1 at least
@AlfPSteinbach: but oh noes, I was comparing with whitespace ignored. Turns out that copying from SumatraPDF complete looses the whitespace. The nice thing when copying from evince is that code blocks, bullet lists etc. get properly indented - which is a huge time saver when formatting for SO!
So, Sumatra -1, Evince +1 there. Thanks anyway for giving me the hint, I might install it at work
 
11:14 PM
huh, apperently MSVC10's std::vector::insert only checks if the iterator is valid if _ITERATOR_DEBUG_LEVEL==2. Interesting.
 
Xeo
Well, of course. Why should it do the iterator debugging if you don't want iterator debugging?
 
well doing anything with an invalid iterator is Undefined Behaviour, so it doesn't have to care
 
UB is not safe thing. CRT should help to detect UB, and behavior for invalid iterator should be defined as an assertion failure or something like that
 
it is - if you ask for it
the performance-penalty-free version is default, which is fine
 
(hell++ is bad language)
usually bugs costs more than some performance loss
 
Xeo
11:21 PM
Guess why it is enabled in debug mode
You can also have an asserted, cut-down version in release mode if you #define _ITERATOR_DEBUG_LEVEL 1
 
@Xeo makes sense. On that note I'll change some of my exceptions into asserts
 
11:36 PM
How is abs(red - 0xFF) easier to understand than (0xFF - red)???
 
@Pubby: huh... context?
 
uh, they don't yield the same results
 
guy asked how to invert rgb colors
 
consider the possibility that red is more than 0xFF
oh
 
user406009
Wait, how does that even work in java? Java has no unsigned bytes, so how could you possible represent 0xFF in a signed byte?
 
11:41 PM
red may be int
 
0xFF isn't signed/unsiged
0xFF would simply mean -128 then
Strike that. Java does told me 'type mismatch' on byte q = 0xff;
 
Java is silly :(
 
So, yes it would appear that red would be int
However, a direct cast yields -1
So, byte q = (byte) 0xff; is equivalent to byte q = -1;
 
@Abyx so? Functional languages can deal with state too. And my processor has a lot of capabilities and feature which aren't mapped directly to imperative languages either. It's a strawman argument, it doesn't matter what the CPU looks like, as long as the compiler can translate from source code to machine code.
@Abyx the performance hit for that is nontrivial. VC8 and 9 enabled this by default for iterators, and Microsoft got howled down because it's so much slower. If you want a provably safe and well-defined environment, perhaps you should simply use another language. That's kind of the point in having more than one programming language. You can choose the one most suitable for your needs
@AlfPSteinbach and you survived The Great Butter Crisis(tm)? ;)
 
11:57 PM
Does anyone know how to programmatically change the current windows user account picture?
 
user406009
↑ Have fun digging through microsoft documentation ...
 
no clue. But I'd suspect it might be acessible through WMI
 
I know where they're stored, but they
 
00:00 - 18:0018:00 - 00:00

« first day (438 days earlier)      last day (4517 days later) »