« first day (386 days earlier)      last day (4564 days later) » 

12:00 AM
@jalf I now quickly fixed it with a ScopedLock for correctness. But this is a lock over the most expensive operation.
The logging itself. So it would be nice to eliminate the waiting there somehow.
Rich Hickey suddenly comes to mind :)
 
@StackedCrooked pastebin.com/yEmJJg8G was what I was thinking
damnit, Firefox has started hiding the http:// in the address bar
they could at least re-insert it when copy/pasting
 
Getting rid of the race condition by creating a local copy of the log handler?
 
er, actually, missed a part :)
but yeah, I intended to make the class member a shared<LogHandler>, and inside the transaction, return mLogHandler.open_rw(tx) on the last line
so the class member is a shared object, so no race conditions on that, and when you want to use it, you grab a copy of it which can be used outside transactions
 
The loghandler is a function object that in my case appends the log text as a new line to a GUI text box. STM could have the downside here that log messages will be posted out of order (because of retried transactions).
 
hmm, I don't think so. Messages from a single thread will be posted in order, and messages from multiple different threads are going to appear in some nondeterministic order pretty much no matter what you do
 
12:09 AM
unique_ptr<Base> should be constructible from a unique_ptr<Derived>, right?
 
might be more nondeterministic, I guess, but hard to say if it's likely to actually be a problem
 
Anyway the logging is not where the real deal is happening. The STM may prove useful in the gameplay.
 
hehe
 
However, chances are if there is too much concurrent access that almost all transactions will be interrupted.
 
it hasn't really been a problem in my tests so far
I've run tests with 8+ threads all constantly repeating transactions, and I still get millions of them committed per second
but yeah, that's what I'm hoping to find out by seeing it used in more realistic code ;)
 
12:13 AM
My code is not so realistic.. :)
 
it's more realistic than my unit tests ;)
 
Add a unit test that does logging!
 
Why didn't we think of this?
 
:)
 
Now I'm thinking of writing a logging library.
 
12:15 AM
anyway, I'd better get some sleep
@CatPlusPlus if you can write one that doesn't suck you're doing better than most
 
Well, there will be no singletons, for starters.
 
I don't even get the point of logging libraries
how do they differ from "stream << message;"?
 
More details.
 
Some people just like to log.
 
as I see it, there are two kinds of logging libraries. The big enterprisey ones that are a pain to use, are slow, and does everything you ever need, and then the small ones you write yourself to fit your specific project
A reusable logging library only really makes sense if it's of the first kind
and then you only ever want to use it on big serious business apps
 
12:17 AM
But it doesn't have to be a pain to use, or slow.
 
@CatPlusPlus well, prove me wrong then. ;)
I'm just talking from my experience. The only libraries that were worth using at all fitted the former description. Yes, a pain to use, but also powerful and robust and feature-rich. Writing a lightweight more specialized logging library just means no one will use it, because it's not as specialized or lightweight as what people write themselves for their specific project
 
Challenge accepted! In the morning, though. And by morning I mean evening.
 
hehe
 
G'night.
 
anyway, good night
 
12:20 AM
night
so which of us are still here?
 
I have this, eh, "logging library".
 
hey, I finally came up with a use for throwing exceptions from destructors
 
Awesome.
 
it's actually kind of lame, but hey
 
To enforce a terminate?
 
12:23 AM
no
exception() << "..." << some_var << "etc";
then the exception object is destroyed, and throws a std::exception with the stream contents as the message
 
And this new exception is thrown from the destructor of the other one?
 
it's not an actual exception, just a handy helper for constructing more complex error messages
 
Ah I see.
 
how about supporting more explicit syntax instead:
throw exception( S() << "..." << some_var << "etc" );
then the machinery can also be used for other functions?
 
no
the whole point is because I'm too lazy to write throw exception( S() every time
 
12:30 AM
@DeadMG Actually I don't think this is a problematic throw from destructor. It doesn't really matter if it originates from inside or outside the destructor.
 
no, of course not- the entire purpose of the object is to throw an exception
it's not like you wouldn't expect it
also, my code comments are terrible
            // If it's a namespace
            if (new_namespace = dynamic_cast<NamespaceAST>(ptr->contents[begin->Codepoints].get())) {
                // awesum, we're good
            } else {
                // oshit
 
evening
 
Evening.
 
how is things?
 
12:46 AM
I'mma working on my parser
totally forgot that I fixed the error in my lexer that was totally Visual Studio's fault, so I've been sitting here with a perfectly good lexer for some time and not working more
 
Perhaps it was a boost bug after all.
 
interesting
 
Installing boost 1.47 right now to see.
Why does wgetting a "direct link" from sourceforge lead to file names like: boost_1_47_0.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fb‌​oost%2F1.47.0%2F ?
 
lol
what's %2F?
slash?
 
I think.
 
12:57 AM
it escaped.
there is a direct function in vbscript for unescaping
d:\dev\test> echo msgbox unescape( "boost_1_47_0.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fb‌​oos
t%2F1.47.0%2F" ) >x.vbs

d:\dev\test> x.vbs

d:\dev\test> _
 
well that was an interesting output
somehow I doubt that's a valid link
 
I don't know what the question marks mean
probably just garbage from my command line
 
yeah, strange
 
1:49 AM
A senior Indian police officer was on Friday night forcibly dumped into an insane asylum after claiming the cheif minister was corrupt.
Lol.
Somehow this does not lend credibility to the chief.
 
2:30 AM
that sounds like an excellent way to conduct police enquiries
 
reminds me of slumdog millionaire where the police zapped the guy with a car battery
 
Deputy Inspector General of Police (DIG), fire services, DD Mishra
Mayawati () (born 15 January 1956) is the Chief Minister of Uttar Pradesh, India. She heads the Bahujan Samaj Party, which represents the Bahujans or Dalits, the weakest strata of Indian society. This is her fourth term as Chief Minister of Uttar Pradesh. An icon for millions of India's Dalits, who were oppressed by the Hindu upper castes for centuries, she is often referred to as Behen-ji, which means sister. Mayawati's rise from humble beginnings has been called a "miracle of democracy" by P. V. Narasimha Rao, former Prime Minister of India. In 1993 she formed a coalitio...
 
2:48 AM
TIL void(), C++98 §5.2.3/2
 
3:16 AM
TIL
?
 
Til may refer to: *Til (novel), a book by José de Alencar *Times Internet Limited, a company focusing on Online Publishing, part of The Times Group *Til Defence Systems(company), develops war games and simulation systems for commanders at all levels *the sesame plant (Sesamum indicum) *the tree Ocotea foetens *Transparent Intensional Logic, a logical system aimed at an analysis of natural language *Tromsø IL, a Norwegian professional football team based in Tromsø *'til is used as an abbreviation of "until", not to be confused with "till", which predates "until" *TIL is also an abbreviation...
 
Today I learned
 
3:35 AM
I don't think Java would be anywhere near as popular if it were compiled. People bought into "write-once, run anywhere" thing, and the OO aspects of the language made it memorable enough to have staying power.
That's my baseless theory, anyway.
 
it was relatively easy to use and statically typed
 
3:46 AM
I answered yet another question
0
A: Dynamically changing the virtual pointer on runtime

Alf P. SteinbachOne young colleague at Andersen Consulting (now Accenture) in Norway once approached me with a serious problem. Their applications, developed in Visual Basic, took a heck of a long time to load. He suspected that this might be because they put each class in its own DLL? Fearing the worst, I inqu...

 
3:58 AM
@AlfPSteinbach Good answer. ++ from me.
 
4:15 AM
Wooo, birthday.
 
 
1 hour later…
5:57 AM
cong rats!
 
 
2 hours later…
7:51 AM
@Maxpm If Java isn't compiled, what does the Java compiler do, and why do we have compile time errors in Java? ;)
 
8:13 AM
@FredOverflow vbscript and jscript in Windows have compile time errors. any language can be compiled, and these are. still, i agree that @maxpm is wrong in the assessment.
(disagreeing with everyone makes me popular)
 
Java is compiled into bytecode for the JVM, it's as simple as that.
 
@FredOverflow or it's compiled directly into machine code, but perhaps less popular now with JIT compilation
 
@AlfPSteinbach Right, GCC can do that, I believe...
> Here is an extended foreword to Japanese translation of "The Design and Evolution of C++" from January 2005: C++ in 2005
Just to be clear, the PDF is actually written in English :)
 
8:32 AM
gcc's aot compilation sucked horribly last time i tried it (which, admittedly, was a couple of years ago)
 
> This extended foreword presents a perspective on “The Design and Evolution of C++” and on C++ itself. In particular, it reflects on the use of C++ over the last decade and presents plausible directions for the next revision of the ISO C++ standard, C++0x.
> The central parts tell the success story of the STL (“Standard Template Library”), of the near disaster of the separate compilation of templates (“export”) discussion, and of the definition of “exception safety”.
This should be an interesting read!
 
Yet another RTFM question:
0
A: Visual Studio (C++)- what is the best practice regarding directories configurations?

Alf P. SteinbachLet's consider first only include paths. The Microsoft documentation states that the compiler searches for directories in the following order: Directories containing the source file. Directories specified with the /I option, in the order that CL encounters them. Directories specified in the ...

 
8:56 AM
 
9:14 AM
is the ... ? .. : .. syntax availible in C?
 
@bamboon Yes, C has the conditional operator.
 
Man, I must really annoy the VS dev team
 
@jalf y?
 
Visual C++ 2010 came out 18 months ago. I still see daily intellisense and mt.exe crashes, and can cause internal compiler errors at will
@rasharm_msft sorry if this sounds too negative, but I'd have to spend time boiling it down to small reproducible examples. What for?
@rasharm_msft it's my impression that Visual Studio Does Not Get Patched as a matter of policy. Except perhaps for critical security holes
@rasharm_msft if you tell me there's a reasonable chance it'll get fixed, then I'll do it. (And "we'll fix it for VS11" doesnt' count)
and a few more
he asked me to file Connect bugs on it, btw
 
@jalf oh, i just been trough that rigmarole. it was not easy, and at one point their server process crashed. but it was possible at the end (just my username f**cked up).
 
9:20 AM
@FredOverflow thanks, works.
 
@bamboon Did it somehow not work before you asked? ;-)
Also, could you post your code? Most uses of ?: are rather cute :)
 
@FredOverflow It worked in C++ like this a > 0 ? a : a = a*-1; then it didnt work in C, I changed it to a > 0 ? a : a*-1 and put it directly where it is needed and it works now.
 
@bamboon That's parsed by the compiler as (a > 0 ? a : a) = a *-1 which seems wrong. Here is why C refused to compile it:
If the 2nd and 3rd operand of the ?: operator are lvalues of the same type (or on one path in a subtype hierarchy), then the entire expression is also an lvalue in C++. In C, however, is is always an rvalue.
And since assignments to scalar rvalues are forbidden, the C compiler complained.
@bamboon What you probably want is a = (a < 0 ? -a : a).
Note that I had to look up the operator precedences of ?: and = to answer this.
In order to prevent having to look up the precedences it's probably a good idea to add defensive parenthesis, even if they're not necessary from a parsing perspective.
Also, doesn't C have a MIN macro or something?
 
9:38 AM
@FredOverflow thanks for the info. Isnt your second solution the same as mine?(beside some syntactical sugar). I dont know about the MIN macro, I just wanted a quick solution to get the absolute value of a number
 
@bamboon No, my solution modifies a, yours doesn't. Also, my solution does nothing if a is 0, whereas your solution will "negate" 0.
 
@FredOverflow oh yeah oversaw the a =
but actually dont need it modified as a is gonna be changed afterwards anyway
 
Not modifying a seems the better solution then.
 
this is the whole expression: b = a%(b >= 0 ? b : -b);
now
 
@bamboon I would probably change that to b = a % abs(b); and #include <stdlib.h>.
@bamboon By the way, of course I meant abs and not min :)
 
9:45 AM
@FredOverflow ah ok, looks better yeah. was wondering too, why you said min. Thanks for the good help
 
probably too early in the morning for me :)
 
1
Q: Lifetime of lambda objects in relation to function pointer conversion

awoodlandFollowing this answer I'm now wondering what the rules are for the lifetime of lambdas and how the relate to the lifetime of function pointers which are created by automatic conversion. There are several questions about the lifetime of lambdas (e.g. here and here), in which case the answers are "...

is the second case UB? or is it a special case?
 
10:05 AM
anyone here use netbeans?
 
Hi all
@FredOverflow Your analogy of banana-fruit is good :)
Though it is Jon's.
I knew it from you .
 
Have you watched the linked video? It's pure gold. Even though Jon Skeet seems to have a cold or something :)
 
Are there are any such videos for C++ other than STL tutorial series on Channel 9?
 
@Mahesh sbi maintains a list of cool C++ videos, but I lost the link again :(
 
It is C#. Right? So, I didn't look at it
Does it have generic concepts applicable to C++ too ?
 
10:09 AM
@Mahesh Yes, it is C#. Why not watch it? Will broaden your horizon.
@Mahesh Ah, here is the C++ video list.
 
And the Grumpy Old Man is sbi
 
@sbi: Since we have a Wiki now, maybe the C++ video list should be transferred to the Wiki?
 
I agree
Bookmarked the videos link. Thanks Fred
 
You're welcome. Half of it is from Channel9, though :)
 
Ok. Does Google do something like Channel 9 ?
 
10:13 AM
@Mahesh They have GoogleTechTalks.
 
Yes, I see on YouTube
Most of them don't explain any particular language, if I amn't wrong
 
Well, you certainly won't find any "C++ tutorials" at GoogleTechTalks if that's what you're after.
 
@FredOverflow Have you ever used OpenSSL ?
 
not consciously
That doesn't mean I was passed out when I used it btw ;)
 
k
 
10:17 AM
Are you doing some security work?
 
No, I did my interviews for Cisco. There are further rounds. Interviewer asked earlier whether I used OpenSSL.
 
@FredOverflow does abs() only take integers? got it nvm
 
@bamboon I believe so, C has no overloading.
 
Careful, cstdlib is not the same as stdlib.h as you can see from that link:
int abs ( int n );
long abs ( long n );
 
10:25 AM
@FredOverflow Do you mind saying where are you from ? I believe from European countries !!
 
This is overloading, which is impossible in C.
@Mahesh You can find out by clicking on my stack overflow user profile ;)
 
C has no name mangling which is why it is impossible, just an extension to what @Fred said
@FredOverflow You are from Germany and that explains why you are good at programming :)
 
dann nochmal danke
 
@Mahesh Really? I thought Germans were only good at writing poems and music. Maybe there is a connection :)
@bamboon Are you German, too? :)
 
programming is art^^
yeah
 
10:28 AM
Und schon wieder ein Deutscher mehr im Chat :)
@sbi and @johannes are also German.
 
@FredOverflow My lab has two employees named Carsten, Ian Springer. They are just awesome C++ programmers
 
^^
 
They are from Germany.
 
Ian doesn't sound German. Do you mean Jan?
 
Yes.
 
10:30 AM
And they are brothers?
 
No.
 
But both are called Springer?
What a coincidence.
 
He is Carsten Neuman
 
Does he have a bottleneck? :)
 
yes
he is height & very thin
 
10:31 AM
:)
 
just the way programmers look like^^
 
Yeah, most of the body mass is concentrated in the brain :)
 
@FredOverflow Carsten Neuman
@FredOverflow Do u know him, by chance ?
 
no
> Although his studies had a slightly different focus he has been fascinated by computers and how to make them do interesting things since the day his dad showed him how to write a simple program in BASIC.
Yay, BASIC! That's how I started, too :)
 
@FredOverflow - Ok. Tell me about education system in Germany
Do students start programming from 14 itself ?
 
10:38 AM
haha I wish I had done that
 
Well, we have Kindergarten, an optional year of pre-school, 4 years of "Grundschule", and 8 years of "Gymnasium" (no, that's not the sports building). And then you can study whatever you want, provided your ratings are good enough.
Gymnasium used to be 9 years, and you used to have 1 mandatory year of military service or social service after that. Unless you had two older brothers who already did that.
If you start programming at University, you start at age 20 or something.
I started at around 10 years when I found a BASIC manual in my mom's room :)
 
Ok. Military service means do we have to participate in wars too, if situation demands :(
 
Of course I didn't know about "dialects" back then and constantly wondered why the code wouldn't work on my Commodore 8032.
 
10. Thats too early
Commodore == Computer ?
 
Well, nobody forced me to do it. In fact, my mother insisted that I should not spend so much time with the computer :)
Commodore = brand of Computer
ever seen this? :) That's a Commodore 64. It had 64K of ram, hence the name.
 
10:43 AM
BTW, I am leaving to my country on 8th. And I have a stop at Frankfurt.
 
Wasn't Frankfurt where Concepts were dropped from C++0x? :) Sort of like visiting ground zero, I suppose.
 
First time ever landing in Germany
Yes, I remember Sutter told that in one of his talks
 
Well, it's cold. Be prepared.
I assume you come from a warm Country? :)
 
I am from India doing my masters in USA
 
How can you afford it? Studying in the USA is extraordinarily expensive, isn't it?
 
10:45 AM
The weather at Texas has drifted. Temperatures dropped to minus degrees
Yeah. It's expensive. But I managed to get scholarship :)
 
Does that mean you have to pay less, or nothing at all?
 
If you wish to do Masters in Computer Graphics, then I can keep you in touch with my professor, Mrs. Carolina Cruz Neira, a legend in graphics field.
It depends on the type of scholarship.
 
Thanks for the offer, but I already have a Diploma in Computer Science :)
 
I got full waiver :)
 
congrats
 
10:47 AM
PHD ?
Thanks
 
no, just diploma
 
I mean if you wish to do PHD.
Is Diploma equivalent to Masters ?
 
I don't intend to, at least not at the moment. I have already spend way too much time at the University :)
@Mahesh roughly comparable, I guess
Our University switched from Diploma to Bachelor/Master system six years ago.
 
@FredOverflow For PHD's, they get a full tuition waiver + monthly stipend of nearly $1500
 
The thing is I cannot imagine to be interested enough in a single topic to spend several years working on it. If somebody had told me three years ago that C++ would become my focus of interest, I would have declared him crazy.
 
10:51 AM
Monthly stipend depends on the professor you work for
@FredOverflow My father always insist me to learn new foreign language, either German or French ? Is German easy to learn ?
 
nope
 
No, German is hard.
I suppose French is a lot easier.
 
to speak or to learn
 
learn chinese or spanish, that will get you connected
 
I never quite worked out why three genders seemed like a good idea
 
10:54 AM
more fun in the bedroom!
 
lol
 
haha^^
 
In French I pretty much end up guessing if it should be M or F. In German my odds of success are reduced somewhat.
 
The funny thing is, men are male (der Mann) and women are female (die Frau), whereas boys are male (der Junge) and girls are neutral (das Mädchen). Maybe because they have no boobs yet? ;)
 
surprisingly that this wasnt changed yet, i bet it will come
 
10:58 AM
I'd bet 1000 Euros against it.
"Die Mädchen" already has a different meaning (plural).
 
And what do boys have correctly at that age while girls don't have boobs ?
 
junks
 

« first day (386 days earlier)      last day (4564 days later) »