« first day (81 days earlier)      last day (4850 days later) » 

sbi
12:56 AM
@TomalakGeretkal I'm sorry for getting this wrong, missing your wit, and being afk without a warning. (And did I mention I'm grumpy tonight?)
 
 
2 hours later…
2:36 AM
Arggh, it really gets to me when people say that `inline`is just a hint to the compiler.
 
2:49 AM
@CharlesBailey It's a hint that the function will be declared in every translation unit in which it is used :-D
Maybe that's a bit more than a "hint"
 
Grrrr...
I need to get more sleep; I've joined the grumpy gang.
 
There was a pretty good question with an answer explaining the function specifiers.
 
 
4 hours later…
6:38 AM
std::future<int> f = std::async([] { return 42; });
Is this correct? I get a compiler error (VC10, just::thread) because std::async is returning a std::future<void>. Is there a reason that a lambda return type would not be deduced here?
(This is not the right venue for this sort of question, I know. I can ask anyway :-D)
Oh. Nevermind. Apparently VC10 doesn't implement the C++0x result_of.
std::future<int> f(std::async(std::function<int()>([] { return 42; }))); works fine but is a bit... verbose.
Or maybe result_of doesn't work with lambdas?
 
 
3 hours later…
9:20 AM
@sbi I forgive you :)
@JamesMcNellis std::future<int> f = std::async([] -> int { return 42; }); won't do it?
 
 
1 hour later…
10:24 AM
why can I not do the following temp = "00" in the following construct:
	std::stringstream compose_date;
	std::string temp;
	if ((year==0) ? (temp = "00") : (year))
		compose_date << temp;
	else compose_date << year;
year is of type int
 
@Tony What type are you expecting the conditional expression to have and why ;) .
 
What is year?
:)
Ternary conditionals have one type and are designed to contain expressions rather than block logic; they are not "if X do Y, otherwise do Z which is completely different"
 
I need the type to be a string at the end
 
@Tony So you have a string in your if clause? Please don't.
 
I suggest: compose_date << (year == 0 ? "00" : year); which does the same thing, but compiles, and makes sense
 
10:28 AM
@TomalakGeretkal yes that looks like what I need
 
no wait
 
@TomalakGeretkal What !?
 
I messed that up too of course ;)
You will need to use a proper block conditional
 if (year > 0) compose_date << year;
 else compose_date << "00";
 
oh
 
@CharlesBailey shush :P
 
10:29 AM
so ternary needs only expressions that have all the same type
 
Correct
Your original code was difficult to parse [for a human] anyway; even had the types matched, I'd have recommended an alternative.
 
such as your if statement :)
 
@Tony Not exactly, but a conditional expression has a type determined at compile time and that type needs to be unambiguously determined by the second and third operands.
 
All types -- barring polymorphism, which isn't relevant here -- are compile-time concepts
 
@CharlesBailey ah, I see
 
10:32 AM
@Tony: Get yourself a good C++ book. It will really help.
 
@CharlesBailey I have one
haven't read the chapter on Ternary operators though
 
@Tony might be a good place to start if you're using them ;)
 
@TomalakGeretkal yea I will read up on them
its the first time I use them
never used them really, even in C#
 
they have their uses, but sometimes they're just obfuscatory
 
 
6 hours later…
sbi
4:44 PM
Ha!
Joel Spolsky

Have you ever noticed how certain questions come up again and again on Stack Overflow sites?

Oh look, my PC is freezing. Should I use SELECT *? Oh, and, how can I host a server from home?

Really, people, do you want to be answering these same questions ten years from now? How about when you’re 65? That doesn’t sound so appealing now, does it?

We predicted this problem, even before we launched Stack Overflow. Why? Because the same thing happened on Usenet, where:

What happened next depended on the newsgroup. …

Seems to be addressing this:
42
Q: Setting up a FAQ for the C++ tag

sbiA while ago Neil Butterworth, one of the most highly reputed people in the C++ tag (he has given so many good answers, that in the two months since he left, his defunct account has amassed >2000 rep from old answers), left here, obviously in frustration about Stack Overflow. I have since heard a ...

 
5:01 PM
Hm, interesting. Gotta buy Lord of the flies and watch it to see the future of SO :)
 
sbi
I'm assembling a meta posting with a list of obstacles in the way of creating such an FAQ for a specific subject, based on my experience with the C++ FAQ effort. Do you have anything to add to my list?
 
@sbi It's futile.
 
sbi
@CharlesBailey So?
 
@sbi I'm not sure what sort of response you're expecting? I don't have anything further to add ;) .
 
sbi
5:13 PM
@Charles What is futile? Why is it futile? Why are you throwing the monkey-wrench into my enthusiasm? :)
 
@sbi I just dropped the spanner into the works, it didn't seem worth the effort to actually throw a wrench.
 
sbi
Hey, the position of The Grumpy Old Man is already taken!
3
 
I get the idea that Joel (et al) like to say that they are concerned about losing the old-timers, but then actually enforce policies that we don't like, like encouraging duplication.
 
sbi
@John Spell it out.
 
Joel said that duplication is good. He said that 20 slightly different questions about the same thing is to be encouraged, not disuaded.
 
5:18 PM
It's a;ways more time consuming and less rewarding (unless you happen to have top answer to the duplicate) to hunt down that duplicate from last year than it is to fire off the correct answer in double quick time.
 
sbi
@CharlesBailey That doesn't always have to be that way. There are ideas floating around to change this.
 
It is quite annoying, and usually utterly fultile to track down dups.
 
sbi
@JohnDibling That's a good one, although it's already on my list.
@CharlesBailey That, too, BTW.
 
Hey everyone! :)
 
At the same time, Joel said, "Don’t answer questions that have already been answered elsewhere." But this isn't how SO actually operates. Not only do people enthusiastically answer dups, but the exact same answer is usually duped multiple times within a question.
I find it all very annoying.
 
5:37 PM
I find Joel very annoying.
Though, having said that, he did write one blog post once that I fervently agreed with, and in fact I lifted a paragraph from it for my Facebook profile 'quotes' field.
>>These things might be good architectures, they will certainly benefit the developers that use them, but they are not, I repeat, not, a good substitute for the messiah riding his white ass into Jerusalem, or world peace. No, Microsoft, computers are not suddenly going to start reading our minds and doing what we want automatically just because everyone in the world has to have a Passport account. No, Sun, we're not going to be able to analyze our corporate sales data "as simply as putting a DVD into your home theatre system."<<
teehee
 
sbi
0
Q: The Wikipedia of Long Tail Programming Questions

sbiSo I have just read the newest blog entry and it seems to be addressing something I had brought up here before, namely a way to deal with the constant stream of duplicated questions. It's interesting, and the way I read it it is encouraging what I wanted: Assembling a set of FAQs for a specific s...

 
 
2 hours later…
7:51 PM
That's what I call a well crafted web application!
 
sbi
@ZeroCool Huh?
 
8:37 PM
sometimes i answer a question and thenstart looking for dupes
that way another guy won't answer while i search for dupes and when i don't find the dupe i still have an answer
"For example, if a user asks, “What does the IP address 128.0.1.1/24 mean?” it’s OK to close that as a duplicate of a more general question like “What do IP addresses of the form a.b.c.d/e mean?” But it’s not OK to close it as a duplicate of a twenty-seven page guide to netmasks. " looks like a counter-argument to C++ FAQ
C++ FAQ being the twenty-seven page guide to netmasks in some cases :)
 
sbi
@JohannesSchaublitb That would be the C++FAQ Lite, no?
 
hehe, i think that too in some cases.
i suspect it depends on the topic. -.-
@JamesMcNellis oh i think result_of works on lambda types
 
sbi
@JohannesSchaublitb Now wait. Did you say that the SO C++ FAQ is a "twenty-seven page guide to netmasks"? How so?
 
@sbi I think he means that some items are (see stackoverflow.com/questions/4178175)
 
some FAQ entries are (necessarily) very elaborative. for someone that don't understand "::template" or don'T understand "foo()", linking to "what is the difference of value/default/zero initialization" or to "template/typename and dependent times" could make a difference like to a 27 pages netmask guide.
that's why I prefer not to close most questions but to rather answer it in a question specific way, if the question is sufficiently narrow. Of course if someone specifically wants to know all there is, I will refer them to the FAQ (and, of course, to the spec).
 
8:56 PM
@JohannesSchaublitb I agree with this. Sometimes it's obvious that the question asker doesn't have the necessary knowledge and experience to know how the answer to a question that someone more experience would recognize as an "exact" duplicate translates to their own question.
 
to be fair, I believe that anyone willing to read a multiple page long article on a specific topic would have google'd his question in the first place
 
Although I have a idea for a new stackexchange site: SurrealOverflow.com. It's where someone asks "Is there a difference between new A and new A() and we link them to a 27 page FAQ entry on netmasks.
 
hahaha
 
sbi
9:17 PM
@JohannesSchaublitb Well, a way out would be to always give a short and a long answer to each FAQ. This works for surprisingly many questions.
 
@sbi And if you're not proud enough to put your name to either you can provide unsigned short and unsigned long answers.
2
I'm here all week...
 
sbi
@CharlesBailey You shouldn't work that much. :)
 
I hadn't noticed the "faq" button to sort questions by link count
 
sbi
@icecrime We had discussed this here when we came up with the whole FAQ idea.
 
it's nice, but I tend to use the homepage more than the tag page
I hate that question with activity don't get 'bumped' to the top on a tag page
 
sbi
9:27 PM
@JamesMcNellis Since you are so fond of that "getting startled" pun I made the other day, I should really give credit for it to the "C++ Virtual Library", which was a collection of links to C++ online resources that was maintained throughout much of the 90ies at (I think) the DESY in Hamburg and made it to Stroustrup's list of C++ online resources. They came up with it.
 
9:52 PM
@sbi: Ha! Yeah. I very much liked that pun.
 
10:15 PM
Ha... I love the title of this room.
 
@George: Do you pass? :)
 
Yup...
 
hi there
 
C++ is my primary language.
 
sorry to ask here but someone knows php?
 
10:20 PM
The Standard Template Library is not the same as the C Standard Library.
@Omegakenshin: Maybe... what's the question?
 
@JohannesSchaublitb Yeah, I confirmed this. The C++0x result_of does support lambdas; Visual C++ 2010 still uses the TR1 result_of, though, which (obviously) does not support lambdas.
 
@GeorgeEdison thanks, I need to load some data from a database, its an array, but only load the first result, and i got 3
this is my code

<?php
while($hoteles = mysql_fetch_array($hoteles)){
?> <option value="<?php echo $hoteles[0] ?>" ><?php echo $hoteles[0] ?></option> <?php
} ?>
 
Hmmm...
The first problem is that you're assigning a value to $hoteles and then using it as the MySQL resource.
I'm assuming there's more code than what you're showing me?
 
sure, the conection, and the query
the value works with 'title' or 0, but the function "while" is not working, show the first result, and then, nothing... do you need me to show you the rest of the code?
i can do a jsfiddle.net to show u
this is my query

$hoteles=mysql_query("SELECT `title` FROM `jos_content` WHERE `sectionid`=1");
 
10:37 PM
No, I know the problem.
 
What happened to the C++?
 
This line: while($hoteles = mysql_fetch_array($hoteles))
 
You're asking if the array fetch result is equal to the query?
 
You're using $hoteles as the MySQL resource that holds the results of the query.
...and then turning around and assigning one row to it.
Use a different variable name for the row, like $row.
 
straight up = is dangerous
 
10:38 PM
@GeorgeEdison lol you are right thanks
 
does php have an equivalency check?
 
@Xaade im a newbie ^^, i really apreciate your help ^^ it works now
 
Usually, I'd do something like (NULL != (row = fetch()) in C++.
not that it makes a difference, but it helps me not screw up.
 
11:17 PM
Huh. All of the sorting algorithms use operator< by default. I had always assumed they would use std::less.
 
@James you mean the ones that don't take a Predicate ? Yes, they are all defined in terms of expressions involving < .
 
@CharlesBailey: Yes, those.
I've learned something new today, so now I can stop trying to learn things.
 
I've just put a cryptic comment on your last answer ;) .
 
@CharlesBailey: Ha! It took me a minute to figure out what was wrong.
 
11:39 PM
Quiet group in here today.
 
11:54 PM
Someone come up with an interesting topic that doesn't involve stdlib vs STL.
OK, who thinks that iostreams from the standard library is an "ultimate mess"?
 
Formatting of data is unneccessarily difficult.
 
I have to say, I'd be pretty proud if I came up with the design as standardized (C++03) but some people seem to think it is rubbish with some vehemence.
 
I feel always a bit uncomfortable with iostreams.
The (so-called) STL is nice and clean, but iostreams has too many intricate relationships between its components
 
Well, I'd be proud if I came up with anything that made it into the Standard :-D
 

« first day (81 days earlier)      last day (4850 days later) »