« first day (449 days earlier)      last day (4497 days later) » 

12:00 AM
@unNaturhal dang, one can't reply to another message while editing the reply to an existing one. but anyway, yes that could be helpful in helping you
 
@kidwon Java is the latest revision of C++
 
@sehe, your failed attempt to be sarcastic..
 
note, though, that there is an abundance of pictures of parse trees on the net
 
@AlfPSteinbach not too mention the ones on wikipedia
 
We never stop to be funny.
 
At night we only shift towards insanity.
Well, it's an ongoing process, in any case.
 
@unNaturhal Than we need a new one
 
@kidwon Yes.
 
@CatPlusPlus Was the stylistic error on purpose?
 
Possibly.
 
12:03 AM
It adds a nice touch. You see, I'm always serious.
Dead serious, I might add.
 
I thought only Dog is dead
 
About parse trees — each terminal is a leaf, each non-terminal branches out. Not really a rocket science.
 
hey guys
I have a hilarious story
I was playing World of Warcraft a while ago, and then quit the game
and in the meantime, my account was hacked
and some Chinese goldfarmer used it to farm money
but since I just started playing again, I interrupted him in usage, and found my bags full of valuable stuff
that he farmed
way more than I had when I quit
 
cool story
 
@AlfPSteinbach You mean like so:
 
12:08 AM
wow
 
And you were paying subscription for that whole time?
 
sehe@natty:/tmp$ mkdir -pv AST/{Factor1,+,Factor2} AST/Factor{1,2}/{Term1,+,Term2}
sehe@natty:/tmp$ touch AST/Factor1/Term1/42 AST/Factor1/Term2/3.1415926 AST/Factor2/Term1/x AST/Factor2/Term2/y
sehe@natty:/tmp$ tree AST/
AST/
├── +
├── Factor1
│   ├── +
│   ├── Term1
│   │   └── 42
│   └── Term2
│       └── 3.1415926
└── Factor2
    ├── +
    ├── Term1
    │   └── x
    └── Term2
        └── y
 
nol
they must have just used what I had previously until it ran out
 
Also, you've got really weak password or funny software running in the background.
I'd check that out.
 
nah, I know what it was
dodgy software on the university library computers
I shared a password between my email account, which I logged on to there, and my bnet account
 
12:10 AM
Oh, right, using your passwords in a foreign environment.
 
@sehe possibly. i think i'd have Factor1 and Factor2 as subdirs of +. ?
 
I thought I'd changed them all but obviously not
 
Good job, genius.
 
@AlfPSteinbach, This is the parse tree of the istruction:
x = (a + b) * c
https://docs.google.com/drawings/pub?id=1T8f5tVqjNso3fX04SDchMZMrQ6EldoibA7IHYGM07f8&w=960&h=720
 
12:10 AM
lol
well, I think I'll be moving to a password database from now on
 
@DeadMG because then you can query for compromised accounts by password / free text search? Gasp
 
@unNaturhal oh it is technically a tree, but a parse tree is a rooted tree: there is (should be) one obvious root
 
Two-factor auth where it's available is a nice thing, too.
 
@sehe Uh, what?
 
@AlfPSteinbach, My book sucks..
So, where I can found a real example of parse tree? Just to have an idea...
 
12:13 AM
What does having a database gain you? It's like having a lock on your wallet or Keeping an inventory of your school locker.
 
Above.
On wiki.
 
a database gains you because you have 1billion separate passwords for every site you use
 
@DeadMG Aha. So a database, or any other valid scheme that gives you unpredictable, random passwords without having to remember more than a (few) master password(s)
 
Try to remember 200 passwords.
 
12:13 AM
so if one is compromised, you don't lose the others
also, it allows you to use impractical passwords that are e.g. 200 characters long
which quite increases their strength
which are usually password databases
 
Scheme by definition doesn't give you unpredictable results.
It wouldn't be a scheme if it did, now would it.
"What was the password for that site, ummm, I know — I have a scheme! It was completely random! Yeah, that narrows it down!"
 
@CatPlusPlus Depends on the scheme and the definition of unpredictable. I mean, the database is a scheme (it is entirely predictable: just look it up, and the password comes out)
@CatPlusPlus Don't bash things that you don't know. There are a fair number of high-quality simple password gen engines that combine a simple salted hash of url + masterpassword (in various travesties). The gain is that nothing has to be carried with you, except the algorithm
 
@AlfPSteinbach many of them are too complex for me. But maybe it's just because it's too late.
Thank you for the help!
 
Well, I prefer to not remember anything, because I have bad memory.
 
Usually those services lend themselves into a bookmarklet (i.e. a oneliner javascript fake url that runs client side without any storage)
 
12:18 AM
Few critical passwords is enough.
 
@CatPlusPlus That doesn't bode too well then. You'll opt to have no master password on that database, if you're going to be consistent about that
 
transaction(database&&) = default;  // error: ... cannot be defaulted
why?
 
You could have the key on an USB stick, or a smartcard.
You don't necessarily have to use a passphrase.
 
because you can only default transaction(transaction&&);
 
I use keepassx, by the way. Mostly for reasons of (a) legacy (used it for over a decade) and (b) lazyness. I know I'd rather switch to a 'generating principle' by now, but I have all these sites to 'fix up' if I wanted to change...
 
12:20 AM
You can't default anything a compiler wouldn't.
See, I'm lazy too, and I'm perfectly fine with KeePass.
 
k
allowing transaction& operator=(transaction) = default; would be so very nice. :(
 
I remember only critical stuff like bank password or password database password, and life is good.
stackoverflow.com/posts/8774232/revisions Hands up who hates posts like this.
Revision 1: "Oh, I did EVERYTHING RIGHT and it still doesn't work!" Revision 2: "Oops, here's actual, relevant code, that's by the way broken."
 
umm. no. sorry. wrong link.
lol
 
@wilhelmtell That looked a bit heavyweight
 
there are lots of ways of doing passwords "right", but their problem is they're impractical. you have to find a balance between a strong password and an ease in entering it 20 times a day.
i don't think databases OR generating are good solutions. unless the database is magically tightly integrated with the tools i use where i need the password. the various browsers, the handheld, switching among random machines (home, office, cafes, friends') and so on. there is no solution as far as i know.
the best compromise i found so far is diceware.
 
12:36 AM
Of you can have a zillion browser/non browser extensions helping you with that. I personally prefer a simple shell script on top of openssl or similar. By sticking to standard encryption algos, you are guaranteed to be able to implement it trivially on all platforms/toolsets
diceware?
 
look it up.
i don't have access to a unix shell everywhere i log on. cafes' for instance.
airports.
handheld du jour
the diceware page is a bit of a read. in essence it boils down to using random sentences as your passphrase, instead of random (if a word is a sequence of characters and a sentence a sequence of words).
there are only a hundred or so characters, but there are arbitrarily many words, limited only by the size of your dictionary. and, humans are better at remember words than characters.
 
@wilhelmtell Copy-paste.
 
that's what it boils down to. so you take a wordlist (they offer a dictionary of about 7776 words), roll 6 dice seven times, and each roll gives you a word. seven words, 7776^7, that should give you a strong passphrase that you can remember as a sentence.
 
I would never use any of my passwords on a machine that I don't completely control.
 
@CatPlusPlus yeah right.
 
12:41 AM
That's just one big security failure.
It's true. That's the reason I carry a laptop around.
And that's the reason I never let anyone else touch it.
 
@CatPlusPlus this is not a solution.
 
I'm weary of even using password on networks I don't control.
Well, or trust already.
 
like the internet?
 
Sniffing from non-local network is non-trivial.
 
buying a wrench at the local store is. :p
 
12:44 AM
(Also I use HTTPS Everywhere.)
See, but that'd require physical contact and is much greater risk for the attacker.
Besides, if I were really cautious, I'd use hidden volumes.
(Not that it's really related to what we were originally talking about.)
 
KeePass ispretty great
generated me a nice 132-bit password
and Blizzard kindly restored my items and gold, apparently
and what's better is that I think I'll get to keep the gold-farmed gold
so now I'm feeling rather rich
 
12:59 AM
@DeadMG what games can do for you :)
 
I considered subscribing several times, but I probably wouldn't play for more than a month before getting bored, anyway.
 
playing World of Warcraft is all about playing it with friends
if you have friends to play with, it's fun
else, it isn't
 
oh, you know, Anders Breivik, the Norwegian mass murderer, used to play WoW about six hours a day. perhaps he didn't have many friends there.
 
Games that don't require any commitments are better.
 
"G***s that don't require any commitments are better."
 
1:08 AM
I also have a suspicion that Anders might have, say, breathed, and shat in the toilet instead of on the carpet
but I'm not going to draw any conclusion from that
 
Well, you can tell he was trained properly.
 
here's the problem
I want to play with a blood relative on one server, but all my pre-existing characters are on another, and it would cost a bucket to move them over
 
1:35 AM
@CatPlusPlus Lol
 
Xeo
0
Q: C++ Code explanation?

Ds SsIs this correct for the following code while number is less than or equal to upperLimit, add sum to number if number divided by 2 is equal to 0 while (number <= upperLimit) { if (( number % 2 ) == 0) { sum = sum + number; }

WTF
Seriously, just how low can the questions on SO get..
 
> Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
Internet is acting weird.
 
1:56 AM
lool
 
My previous two messages are not related :)
 
Oh, wonderful. Third assignment for the CG class — described scene file format is different than what examples follow.
Why am I not surprised.
 
Because similar things have happened before?
 
Because this course is shit.
Meh, apparently last section is optional and elements don't really have to be newline separated.
I love how specification doesn't say that.
Oh, there are comments, too.
And none of the examples even have the last section, which is shading parameters. How the hell am I supposed to test it?
 
@CatPlusPlus This text would be hard to understand for an AI. The first sentence if figuratively. The second is literally. The third is sarcastic though negation. The forth is sarcastic without negation.
 
2:10 AM
This course is bullshit.
 
@CatPlusPlus bullshit is a strong hint towards figurative speaking :)
 
The specification even gets the fucking extension wrong.
 
There is work opportunity for prison guards in Belgium. There are currently 1000 vacancies.
@CatPlusPlus You could refuse to finish the assignment without a decent spec.
Not sure if you'll get away with it.
 
Yeah, right.
 
2:31 AM
@StackedCrooked I've never followed a class where you could get away with that
the golden rule is "if the requirements are unclear, just document how you choose to interpret them"
 
Or the interpretation that gives you the least work.
 
I'd be happy to at least have something to test against.
 
Test against the sample data you have, then
 
They don't have any shading parameters.
That's the issue.
I got an email.
> is this a real cat at the picture? i mean your cat?
I feel so famous.
 
2:49 AM
@StackedCrooked did you see my reply wrt STM and copying?
 
@jalf Yep. I have no complaints :)
 
One of the libs I used as inspiration actually worked much like you described. Was pretty interesting, and had some definite advantages (could keep multiple versions of an object alive for as long as anyone needed them, simplifying some synchronization)
anyway, talk to you later. Waaay past my bedtime :D
 
3:21 AM
I think I like the Youtube feature in Google plus.
 
I've earned the Java badge :(
 
@FredOverflow Are you going to wear it with pride?
 
Booo!
 
4:07 AM
Oh look, Java 7 has binary literals.
And allows underscores in numeric literals. Wonderful features.
 
I got weird errors with visual c++ 10.0 std::result_of
like
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxresult(28): error C2825: '_Fty': must be a class or namespace when followed by '::'
 
how are you calling it?
 
@CatPlusPlus I think it's good for readability.
 
Yeah, it's so much better than lambdas.
 
5:06 AM
posted on January 08, 2012 by Alf P. Steinbach

Lesson 5: Window message basics < This is the fifth posting in what might or might not be a series of tutorial-like lessons that introduce you to Windows API level GUI programming in C++. Doing things at the API level teaches you the fundamentals with most everything concrete and possible to understand. It also allows [...]

 
5:29 AM
@CatPlusPlus underscores were discussed in csc++ last year, and i think someone did write up a proposal/paper (but i'm not quite sure)
 
Right.
 
@Potatoswatter like std::result_of< decltype( f ) >::type
 
what's a proper way to install headers $(HEADERS) with GNU Make?
I've got
	$(foreach HEADER,$(HEADERS),$(shell install -D $(HEADER) $(PREFIX)/include/$(HEADER)))
but it expands to nothing, so running make install says "nothing to be done" even though it did install the headers.
 
@AlfPSteinbach And f is what? You need to specify an argument list
If f is a nullary function, typename std::result_of< decltype( f )() >::type
 
@Potatoswatter huh, if i need to specify an argument list than why should i use result_of?
i mean it can't be that primitive
 
5:41 AM
It resolves overloads.
 
I want this code to Just Work:
#include <functional>

void foo( int ) {}

int main()
{
    std::result_of< decltype( foo ) >::type();
}
that is, to compile cleanly
if I knew the arguments of foo then i could just use declval
 
You need decltype( foo )( 0 ) or the like. result_of is just a wrapper around decltype and declval.
@AlfPSteinbach Precisely.
 
no, it's not just a wrapper
the implementation goes to pains to resolve out the arguments
one definition per number of arguments
i mean that's the whole point, as I understand it
 
> The member typedef type shall name the type decltype(INVOKE(declval<Fn>(), declval<ArgTypes>()...))
 
yes with the magic INVOKE
that's the specification
we as programmers don't have the magic INVOKE
but i think both I and you have implemented result_of
at one time
 
5:49 AM
What's so magical about INVOKE? It handles various thinks like ptmf. It doesn't introduce any imaginary definitions.
 
if it doesn't then the whole thing is very sh*tty
 
You can easily define your own result_of which accepts a non-overloaded function name and fetches the result type…
 
well it seems that's what i have to do
or use the boost one
template <class> class result_of; // not defined
template <class F, class... ArgTypes> class result_of<F(ArgTypes...)>;
Not defined, huh.
What use is it then?
 
I'm contemplating making a library header-only. in fact, i just did. most of the code is trivial one-(or two)-liners. but there are two functions that aren't so trivial: 5 and 10 loc, respectively. Do you think these are good enough a reason not to inline them in a .tcc file?
 
If you have a functor with overloaded operator(), or if you want to support all kinds of Callable objects.
@wilhelmtell Don't make a new file for 15 lines
 
5:59 AM
I placed all declarations and class definitions in the headers, and the implementations in .tcc files the headers include. i just wonder if there's harm in those two slightly-larger-than-normal-for-inline functions.
 
^ no I misunderstood that spec
the primary result_of template does take a single type parameter, which should be a function type
 
… But only a bogus function type. This gave me conniptions when I finally came to understand it.
It's really a workaround for lack of variadic templates at the time it was written.
 
@Potatoswatter sounds like they really fu'ed this part of c++11
:-(
it's not practically useful if one has to specify the arg types
 
You might try typename std::function< decltype( name ) >::result_type
Saves you some typing, but might compile slowly
 
6:15 AM
The following works even with Visual C++ 10 (no variadic template):
#include <functional>
#include <typeinfo>
#include <iostream>

void foo( int ) {}

template< class Func >
struct ResultOf;

template< class R >
struct ResultOf< R() > { typedef R T; };

template< class R, class A1 >
struct ResultOf< R(A1) > { typedef R T; };

template< class R, class A1, class A2 >
struct ResultOf< R(A1, A2) > { typedef R T; };


int main()
{
    using namespace std;

    //typedef std::result_of< double(int) >::type R;

    typedef ResultOf< double() >::T R0;
    typedef ResultOf< double(int) >::T R1;
Why do I have to write such things, or how can I use std::result_of instead?
Or is std::result_of truly unusuable manure-thing?
 
I don't know why you're so upset. You can try my other suggestion with std::function, but it does what I described it doing. It resolves operator() overloads without requiring that an object even be a functor.
 
Uhm, I'm upset because I don't expect to find unusuable things in the new standard.
 
I use it whenever I need a result type, since I've never been in a situation where the argument types are unknown.
 
All that should have been rooted out much earlier.
Or perhaps it's just the implementations that are buggy.
I'd rather believe that!
 
No, the implementations are all derived from boost. The reason it's done this way is because the common ancestor predates variadic templates by a lot.
 
6:20 AM
But, my code does not use variadic templates.
It works.
Why can't the standard library's thing, which has access to additional magic, work?
I mean lack of variadic templates cannot be an excuse.
When I can cook up code that does not use them, and works, in a minute.
 
I guess you're upset about a different part than me. Anyway, plenty of folks including me find it useful, which is why they preserved the interface despite its odd syntax.
You declared a series of declarations for one, two, three function arguments. That's a reimplementation of variadic templates, like what Boost did internally.
 
Jeez.
@Potatoswatter Yes, for Visual C++ 10.0, and it demonstrates that variadic templates have nothing to do with it
They're completely irrelevant, except to simplify the implementation
Boost had to do things differently because of a lack of decltype, not a lack of variadic templatates.
So they did this thing with registration of possible result types.
But C++11 should have got that right!
.
 
Is what you want something other than std::function< decltype( f ) >::result_type?
 
Anyway, I can't see how the spec in the standard is wrong.
As I see it, it specifies exactly the same for result_of<F>::type as for function<F>::result_type
when F is decltype(f)
does it not?
 
No, result_of takes a bogus function type. function takes a real function type.
There's nothing wonky about function, only result_of.
When you pass F to function, it grabs the result type straightaway.
 
6:28 AM
I don't see the term "bogus function type" in N3290
 
When you pass F to result_of, it checks that the arguments match the signature before anything can happen.
"Bogus function type" is my term for f(args ...) where f is a Callable type, not a return type.
… which is a workaround for the far less confusing, but variadic result_of< F, args ... >
 
Well, I guess the standard should provide a little to everyone, including to academics.
But still it annoys to me to have such an unusable thing there.
Causing everyone plus their grandmothers to write workarounds.
Argh.
 
posted on January 08, 2012 by Alf P. Steinbach

Using std::result_of requires you to specify the function argument types. Which is not very practical when you don’t know the function signature. Happily @potatoswatter (David Krauss) over at Stack Overflow pointed out to me that std::function provides the desired functionality: … Continue reading →

 
 
1 hour later…
8:39 AM
Hello all , if anyone happens to log in , can you help me out with this question ? stackoverflow.com/questions/8776284/…
 
 
1 hour later…
9:46 AM
(Courtesy of Billy Baker)
 
10:18 AM
@AlfPSteinbach Kids these days...
 
heh
 
10:57 AM
how can I invite one to chat from his profile?
if I wanna talk on private
 
you can't
this isn't a dating site ;)
 
^^, so there is no way to contact someone?
 
write their name with an @ before it. Then they'll get notified that you mentioned them
 
that works in chat, too?
 
yes
 
11:04 AM
if they are outside i mean
 
it works just like it does on SO. It shows up in the persons inbox thingy in the top left
 
ok thanks
 
11:22 AM
Hello people , is it possible to change the open mode of an output stream on the fly ? i.e. , write some characters in one mode .. change it .. write some more characters .. change back write some more , then close the stream.
?
 
11:47 AM
I added some nerdy nonsense to the wikipedia "variadic template" article involving fancy lambdas
fun that both the PR and my comment happened on 8.1.{2011,2012} xD
 
i think it's an amazing coincidence that your slurping function is called slurp
as it happens i have a text file called slurp.xhtml open in an editor
perhaps slurp is a word whose time has come, gaining in popularity exponentially over the course of a day or so, before again sinking back into oblivion?
 
 
2 hours later…
2:04 PM
@JohannesSchaublitb I hadn't even noticed.
OT: In the interest of brevity, I'd suggest writing 8.1.201{1,2} though. I bet this could be implemented as userdefined literals (resulting in tuple<boost::gregorian_date, boost::gregorian_date> e.g.). Oh wait, no compiler actually implements both yet
 
2:27 PM
GCC trunk has UDLS..
 
3:03 PM
@JohannesSchaublitb hehe. I'll definitely try those out. I bet we'll be seeing some wonky questions involving those on SO over the following 2 years
 
hi
my eye hurts
 
3:18 PM
hi everyone
I am a C++ newbie
 
who isn't?
 
I would consider Bjarne to be at the intermediate level
 
what is C++11 ?
 
current standard
 
C++11, also formerly known as C++0x, is the name of the most recent iteration of the C++ programming language, approved by ISO as of 12 August 2011, replacing C++03. The name is derived from the tradition of naming language versions by the date of the specification's publication. C++11 includes several additions to the core language and extends the C++ standard library, incorporating most of the C++ Technical Report 1 (TR1) libraries — with the exception of the library of mathematical special functions. C++11 was published as "ISO/IEC 14882:2011" in September 2011 and is available for a fe...
 
3:26 PM
wow , the latest and greatest . So which compilers support it now ?
 
completely? none
 
GCC snapshots are farthest along
 
gee , then how can someone make it a standard with an implementation ?
 
what?
 
I have visual studio 2010 , is there any support for c++11 on vs2010 ?
 
3:29 PM
yes, for example rvalue references
 
rvalue refs, lambdas, decltype, and auto are the main ones in VC10
 
@dan_l The tag description for is quite ok stackoverflow.com/tags/c%2b%2b11/info
Highly informative
 
4:03 PM
So anyone know if there's any progress whatsoever with clang lambdas?
 
damn
I never figured that using { ... } for object literals would be so ambiguous :P
 
Dear Santa, all I want for christmas is thread_local and lambdas
in any compiler
 
lol
I'm experimenting with separator-less grammar atm
 
int a[] = {1 2 3};   // or what?
 
something like that
or I'd say, more like, func(1 2 3);
 
4:11 PM
How about func 1 2 3 just like in Haskell? ;)
 
I actually did strip a bunch of parenthesis from various other syntactic constructs
but that one has to stay
 
How does casting look in WideC?
 
atm I have static_cast(type, expression)
etc
besides, right now I'm still experimenting with having no separators
I'm sure I'll find a place where Bison will tell me that it's Hideously Ambiguous™
 
4:26 PM
why not just cast?
I hate having to type static_ in C++
 
because reinterpret, static, and dynamic casts are all different
and overloading and type logic isn't enough to differentiate them
 
lol, is that the target audience on the cover? :)
 
game programming for teens for teens?
now that's a surprise.
I'm looking forward to Visual C# Game Programming for Accountants (for Astronauts)
 
lol
 
Hello all .....my first time on chat and one thing is for sure that there are plenty of surprises waiting in stackoverflow ;)
 
4:35 PM
stick overflow?
 
like missing as?
 
I'm surprised they haven't added that site yet
 
lol ...thats a typo
 
What would it be about? Fitting stuff on usb sticks?
 
Could be a site about, uh, trees
 
4:36 PM
You can correct typos by pressing the "up" key several times until you're at the message you want to edit, and then edit it.
 
lol
 
thanks fred
 
How about stuck overflow, a site about stack overflow addiction?
 
or about getting stuck in places
 
done
 
4:37 PM
Do we have stock overflow for financial stuff?
 
Q: Help help I tried to crawl under the sofa and now I'm stuck
Someone should suggest this on A51
 
A: How did you post this question from under the sofa?
 
That should be a separate question or a comment
 
SteakOverflow would be promising too. Shame we already have Cooking
 
4:38 PM
lol
 
stock overflow would be a dangerous thing ...it might bring the company valuation down
 
StorkOverflow, for ornithologists!
 
why so ?
 
because a stork is a bird
could also be for people trying to get pregnant, I guess
 
oh... i never knew it
which country jalf?
 
4:41 PM
man, we're witty around here.
 
yeah i can sense that ;)
 
How about a gambling site called StakeOverflow?
 
and owner would be fredoverflow ;)
 
I don't gamble very much :)
 
we have a festival over here in India ...on that day people gamble a lot :)
 
4:51 PM
0
A: Employer appeal; OOP use in mainstream; solutions that blossom with OOP

DeadMGThere's no such thing as an elegant program in C, unless you count exceedingly trivial examples. The advantages of OO become inherently apparent as soon as you try to do even something basic, like strings. If you can't see why std::string is so much better than C strings in every possible way, th...

what do you think of my answer?
 
its nice and explanatory ....gr8 job
 

« first day (449 days earlier)      last day (4497 days later) »