« first day (279 days earlier)      last day (4678 days later) » 

1:03 PM
@sbi Yes I guess that's what he did.
 
something funny happened to me earlier
i wondered why my loop from 0 to 1000000 was so slowly printing the values
until i figured that the printing code in addition printed some random bytes, including byte 0x07, causing the terminal to beep silently everytime :)
 
@JohannesSchaublitb I used to work on a POS system where randomly the terminal would beep at the cashier when the fee was displayed to the customer. Minor annoyance that took me months to find in the code.
 
sbi
@JohannesSchaublitb How does one make the terminal beep silently?
 
@0A0D Sounds like fun. Who doesn't like things beeping at them?
 
@Collecter Angry parking operators :)
 
1:15 PM
@0A0D They just had to keep up appearances.
 
@sbi having "rmmod pcspkr" in your scripts:)
 
-1
Q: `cat "asdf"` to a C program using pipes

EamorrBasically, I'm trying to implement the following: cat "asdf" | ./a.out where ./a.out simply prints out "asdf" I know this is probably noob C stuff, but as I'm only a novice C programmer, I thought I'd ask the community. Many thanks in advance

man, people are thick today....
 
@0A0D It's friday after all.
 
sbi
@JohannesSchaublitb "rmmod pcspkr"? Your cat's been on the keyboard?
 
@EtiennedeMartel It's Friday everyday on SO, it would seem.
 
1:23 PM
Afternoon all
 
sbi
@CatPlusPlus Is that the famous Eternal Friday?
 
@sbi And it's even got its own theme song!
 
It's Friday, Friday, time to get down on Fridaaay
 
TGIF
:)
 
@0A0D Only continue if it is Brock's dub version.
 
1:32 PM
 
That is the one
 
0
Q: Cannot read input file ifstream

WillI'm trying to read an input file formatted with two numbers on a line and store the first number in the line in one vector and the second number in another vector. Every part of my code works fine except for the actual reading of the file. I have put couts all over the place and it looks like ...

 
I wonder when people will learn to stop looping on eof().
 
sbi
Maybe it's time someone wrote an FAQ entry for that?
 
not perfect, but it does explain it
 
1:47 PM
@0A0D Hm, that's in C. A C++ version would be better.
 
+1 for FAQ. Candidate here :
11
Q: eof() bad practice?

SamSo I've been using the eof() function in a lot of my programs that require file input, and my professor said that it is fine to use but a few people on SO have said that I shouldn't use it without really specifying the reason. So I was wondering, is there a good reason? Thanks, Sam

 
2:05 PM
sleepy
 
sbi
@kbok I went and made this an FAQ entry. (The @Feed guy will be here in a minute^Wday.) @all: Feel free to improve upon this.
 
@sbi What is this ^W ?
 
sbi
@ÓlafurWaage <delete one word to the left>
 
could use strikethrough
 
sbi
2:11 PM
@ÓlafurWaage I thought it was vi? But I haven't used vi in a decade, so...
 
I'm not to familiar with VI/VIM but it could be, 1 sec
You using ^ as Ctrl?
 
sbi
@DeadMG I've been using ^W for 15 years. That was before Tim's toy got popular.
@ÓlafurWaage I think many terminals, if required to print a Ctrl key, used ^ for that. ICBWT.
 
Aye, Ctrl + W deletes the last word behind you in Insert mode.
 
@kbok Answers are confusing though
From what I can understand, a better explanation is that a previous read failed because the position of the read was outside the file.
 
2:38 PM
Yes, we need to federate all answers into one clear and complete one.
 
I don't understand why there's not a nexteof() method then.
 
I think it's due to the underlying API
 
Something that looks to see if the last portion you read included the last byte of the file.
There....
That's a clear explanation.
 
Also, I think the title can be improved. Edit rights anyone ?
 
eof() does not look to see if the last portion you read included the last byte of the file. It does not look to see if the next byte is after the end of the file. eof() reports whether the last read included bytes past the end of the file.
0
A: eof() bad practice?

XaadeIn case the above answers are confusing: What people thinks it does is wrong: eof() does not look to see if the last portion you read included the last byte of the file. It does not look to see if the next byte is after the end of the file. What it actually does: eof() reports whether the...

 
2:45 PM
aaaahaha
8
Q: Goto prior to a variable definition - what happens with its value?

Johannes Schaub - litbHere is some question I wondered about. Given the following code, can we be certain about its output? void f() { int i = 0; z: if(i == 1) goto x; else goto u; int a; x: if(a == 10) goto y; u: a = 10; i = 1; goto z; y: std::cout << "finished: " << a; } Is this guar...

 
@JohannesSchaublitb Comment added: Seriously..... you want to know about goto?
 
Oh my eyes. :)
 
@Xaade this is just a quiz question! I already found the answer I wondered about. But now let's see what folks come up with!
lol
 
Anyone here in Norway?
 
@JohannesSchaublitb Vote to move: Does not belong on SO. Move to Programmers SE.
 
I have a couple of friends there, but none in Oslo
 
in fact both C++ and C require it to print 10, quite clearly
 
well, one was supposed to go there today, but was sick, so stayed home
 
@ÓlafurWaage Very sad... anyone claiming responsibility?
 
Nope. Also no deaths reported yet.
 
2:52 PM
oh, his family was on their way to that area when it happened
says they're trying to get back to the airport now, while avoiding falling glass from broken windows
 
Hope they get there safe.
 
they're reporting at least one dead now
oof, and police saying there might be two more bombs they haven't located yet
 
Ok, this has gotten ridiculous..... when are people going to start hunting down these rats, with flamethrowers.
 
the flamethrower would explode the bomb possibly
 
We need an iron man, someone who doesn't give a shit about PC nonsense and will exterminate these idiots.
 
2:57 PM
al qaeda?
 
I don't care who
 
@0A0D no clue
 
If you make a car bomb, I don't care what your reasons are....
There's no such thing as freedom fighters that blow up hospitals.
 
norway is participating in the libyan activities.. i wonder if it is related.
They were hit with a cyber attack in May
 
"PC nonsense": What does "PC" means ?
 
2:59 PM
political correctness?
 
Ok.
 
libyan is a lose lose situation. We either kick out a dictator and are left with a bunch of anarchist warlords, or we keep a dictator.
Rebels my ass.
 
ah, norwegian media are a bit more informative
 
@Xaade I agree
Libya is going to be screwed up for a long time
 
This is simply an instance of a dictator who doesn't want to pay to play.... so we let anarchy and roll the dice with fingers crossed that the next looney will.
Playing inept god is what we are.
Same thing Iraq was, but at least there they have a structure in place that we can support. In Libya, there's no government left. No one to paint green.
I'm tired of this nonsense.... every time we try to play sides another 100 people die to a carbomb.
 
3:04 PM
@Xaade Iraq didn't have one until we made them create it :) they still have their infighting but have came a long way. I was there, it was frustrating dealing with the military and government. No sense of responsibility
 
But I'm saying there was a foundation and a willingness to support stability.
 
looks like they might have been targeting the oil and energy department
 
Libya, there's nothing but a bunch of west-side/east-siders gangbanging a dictator hoping they get American weed when it's over.
 
@Xaade Libya is similar in that they too have class warfare. The best thing we can do is not put troops on the ground and get in the middle of their petty fighting. Very similar to the Sunni/Shiite
 
The best thing we can do is take out anyone who so much as looks at a weapon.
Left-side, right-side, sunny-side she-aight side..... don't care.
Tired of this mess, and tired of watching good people die, to "stabilize" a bunch of inbred haters.
Build the matrix and stick them in it. They can keep respawning and killing each other.....
 
3:08 PM
@Xaade I'd like to get out of nation building. But I suppose that the cold war never really ended. If we don't exert (US) influence, then the presumption is that other countries will (Russia, Iran, China). It's a never ending cycle.
 
They already do.
Russia is practically prodding Hamas and Iran to hate America.
 
@Xaade Exactly. So it's the whole US vs Commies all over again, just more subtle
 
With a bunch of Muslim pawns in the middle.
Once again, America sucks at winning the popularity contest.
 
@Xaade True, many weapons from Iran found their way into Iraq
 
I'm just waiting for all the CNN/Fox-bait to realize that all the wars is a big chess game. Hell, they almost got it right, they came up with the War Inc. slogan, but they pinned it on commercialized war, and missed the big picture.
 
3:11 PM
@Xaade "War is a Racket"
I know several of my Soldiers that work overseas as contractors because it is lucrative (at least $100K per year). Many more Soldiers volunteer to go for multiple deployments because the money is so good.
 
I know, but I find it amusing, that anti-war activists are so close to getting it, but too caught up in their capitalism-hate, that they blame money.
Money is a means, not a goal.
 
@Xaade Their message is not the right one IMHO. I am not against war, if it serves a legitimate, defined purpose.
 
None of it serves a legitimate purpose.
I mean.... if we really thought Saddam was about to hit us with a nuke. We could have blasted Iraq into a crater and said oops.
 
@Xaade Well, you don't have to go too far back to say that the War on the Axis was justified.
 
I mean, post WWII.
 
3:14 PM
@Xaade That's the problem, we didn't have leaders who would stand up and say "This data does not look right."
 
Since WWII, the entire thing has been a political battleground between Russia and America.
 
courageous, brave leaders. They saw what they wanted.
Colin Powell got used, and it ruined his career
 
Everyone says that America failed in Vietnam, saying that America was wrong that Vietnam would spread communism and it didn't. It could have, it's just that they didn't have much to go on, and everyone lost interest.
 
@Xaade Well, you are correct in that we were winning but America had enough
so there was no more resolve
but even Ho Chi Minh said he didn't hate America
 
3:21 PM
@0A0D Neither did Japan
 
Anyone (@sbi ?) know if Alf is based in Oslo?
 
The world is an economy, war is an investment strategy.
 
oh shit
parsing my language is actually really, really hard
 
no kidding.
 
lol
 
3:22 PM
At least you have x:= 10
 
actually, I cut that and went back to = for now
not the problem I'm trying to cope with right now
 
Yeah, having unique operators for unique operations makes it slightly easier to parse.
So @DeadMG how backwards compatible with C++ is it.
Could one plug in C++ code and make minor tweaks?
Or would you have to start over.
 
not a chance in hell?
I'd have to adopt the crappy, crappy template syntax
I mean, my grammar is hard to parse, but that would be much worse
 
Forget templates.
I mean, just plain algorithms and classes.
 
yeah, it shouldn't be too difficult
 
3:25 PM
Hmm.... looks like you have something pretty useful.
 
if I can ever write a parser for it
no wonder ANTLR was struggling :P
I think I'm really going to have to look ahead about a billion tokens
 
Yeah, even if you can parse it, if it's too hard, it will take unreasonable compile time.
 
nah
iterating through a token list is simple
and I've parallelised my parser- structurally, anyway, the actual concurrency code isn't written yet
 
not token list.... I mean parsing recursively through classes structs.... single pass, double pass, multipass.
 
oh, it only ever actually gets parsed once
iterated over a few times if you're deeply nested, maybe
but parsed just once
and in addition, I have some great ideas in mind as to how I'm going to avoid re-parsing
not to mention that parsing for me is still going to be way faster than C++ ever was
 
3:28 PM
I'm confusing parsing with whatever builds the compile objects so you can compile code.
 
that's parsing
lexing takes strings, makes tokens
 
Hmm... and you won't be doing a multipass?
 
parsing takes tokens, makes ASTs
semantic analyser takes ASTs, makes them make sense.. not sure how that quite works
code generator takes whatever goes out of analyser and outputs code
 
Sounds biological.... like eating digesting and crapping.
 
3:29 PM
lol
it's a pipeline, nothing more
you know what pissed me off?
the PPL, which offers a thread-safe vector class and shit, isn't move-aware
 
Question for the room - do you think StackOverflow is developing a bit of a monoculture?
 
so I can't use unique_ptrs and stuff
 
I ask because occasionally I see questions asking how to do things, some of them well written, and they will be shot to pieces because they aren't using "the right language" are they are using "bare pointers", etc.
 
that's not about shooting the questioner, that's about shooting the questioner's existing code
 
I just saw a qustion closed because the guy asked how to effectively created a web application in C/C++
 
3:31 PM
@Josh I think that's more of a result of experts forget they were noobs.
 
@Josh What do you mean by "monoculture"?
 
I think it's more programmer culture that is leaking onto SO
 
@Josh: That's probably because of the use of C/C++
 
@Josh I'm not sure I follow. What does "don't use raw pointers" have to do with SO specifically? And what do you mean by monoculture?
 
if he had just said C++, he'd probably get further
 
3:32 PM
@DeadMG Inexcusable.
 
there are web app frameworks for C++
 
@Josh That's not an answerable question though....
 
@Xaade Sure it is.
 
SO is allowing a lot of people who know C++ properly to call out abuse by those who know the language less well. I don't really see that as a problem
 
How would you answer it?
Let's say it can be done..... there'd be 50 million ways to do something like that.
 
3:33 PM
the web app thing sounds extreme though
 
Effective is subjective.
 
but I haven't seen the question
 
@Josh: Why don't you link to the question, uh, in question, so that we can all read it?
 
That's like asking..... How do I go about building the golden gate bridge. Do I use a screwdriver?
 
@Xaade I have written commercially viable web applications in C++, so that question in specific begin shot to pieces while I was answering did bug me.
 
3:34 PM
ok
that is most definitely NOT a real question
 
but in general, allowing people to share their experience and advice is going to eventually lead to some degree of consensus on what is good and what is bad. Again, I think this is a good thing. usually, the good advice will dominate
 
You're missing the point
 
the OP did not ask how he could use C++ to write a website, he asked for someone else to write him code of C++ interacting with his existing website
 
How do you build a skyscraper.... answer in less than 50 pages.
 
a real question would be more like, "How can I integrate C++ into a Python website?" or something like that
 
3:35 PM
@DeadMG He asked for a small example, presumably so he could build on it
-1
Q: How can i use c , c++ for small part of website .

user846405I want to experiment with new things learned and what big companies like Google , yahoo uses. It doesn't matter if i really need this but i want to learn. I have read many times that all big online companies uses c++. Suppose i have website build in Python and django. Can anyone suggest me a s...

 
examples are not on-topic
 
Yeah, teh way I read it, it's closed because it's a bad question, not because it's about C++ in a web context
 
you can provide them in your answer, but you are not allowed to ask for just examples
 
what a shitty question....
 
He spends the first few sentences apologizing for his question. That doesn't help when you want your question to be answered. It's screaming, "I already know this isn't a real question, but I posted it anyway."
 
3:36 PM
@Xaade So, you shoot the guy for being new?
 
No.
You look at if it can be edited into a good question first.
 
@Josh: Everyone behaves by the same rules, new or not.
3
 
@Josh we all were new once, but I never asked shitty questions like that
 
maybe this time, he'll read the FAQ and come back with a real question
if he doesn't, then no loss- his question is just noise
 
I usually try to be patient with newcomers, and help them improve their question. But many don't have the patience for that. At the end of the day, good questions survive, bad ones are at the mercy of the first people to read it
 
3:38 PM
plus, it's not even a Question with a concrete answer
 
exactly, there's any number of examples and they're all equally good answers
 
@jalf Yeah - I try to edit posts, I noticed times where someone has a good question but they don't have a strong grasp on english or whatnot so they get downvoted.
 
@Josh sometimes it is easier to downvote and leave a comment, then to edit
it can be exasperating doing editing every day on shitty questions
 
1. He says my existing site, but gives no references to how his site works. 2. He spends too much time talking about things not important to his question. 3. He asks for an example.
I can edit his question into a good one:
 
it's not just that he asks for an example, it's that that's the whole damn question
 
3:40 PM
@0A0D Most of my edits are formatting related. If I have to rewrite some sentences, then I probably won't bother and just downvote it instead.
 
How can C++ interface with a website?
Done.
Good question.
 
no, it isn't
big companies -> subjective -> bad
 
@EtiennedeMartel Same here. I have even edited questions for the OP when they screw up the meaning of their question, for example, using cat when the OP meant echo.. good lord
 
a good question would be, "How do I integrate C++ into my Python/Django website?"
that's a clear, clean, unambiguous question
 
@Xaade slightly better, but still ambiguous
 
3:42 PM
@DeadMG I think examples are very helpful. The current project you are working on now, did you not use the existing C language grammar as a base to work from? A pretty thorough example, if you ask me.
 
But an example isn't an answer.
 
It a very broad and complicated question. There's multiple things to take into account, and multiple equally good answers.
 
And what if you link to an example that doesn't exist later on.
 
@DeadMG You'll get no argument from me it was poorly worded.
 
@Josh: Examples are helpful. They are not, and can never be, mandatory.
 
3:43 PM
Does anyone have an opinion on tags?
 
@KerrekSB Can you be more vague?
 
The biggest problem is that no one knows what his website is.... how can you answer....?
 
Yeah! "How would you?"
 
@Xaade Exactly, we're missing parameters here.
 
OK, in seriousness, I've started this discussion.
 
3:44 PM
@KerrekSB How?
 
Now I'm not sure if I have a point. Maybe I didn't make any sense to begin with.
 
I don't see volume of tags as a problem. I think the more synonyms, the better.
 
You prune bad tags. You don't prune desolate ones.
 
Creation of tags should of had a higher rep threshold in the beginning
 
It's better to have tags existing so people know where to put things
 
3:45 PM
if you didn't have the rep, you should have been able to suggest tags and they are approved.
 
I once saw a guy who, not content with downvoting questions, downvoted, voted to close, and tagged the question with the bad-question tag. All the while nearly insulting the asker in the comments.
 
But having design, and project design tags is redundant.... IE.
You vote to close questions that can't be edited into good questions if there is the slightest doubt that your edit would change the intended meaning of the OP.
 
I see. Fair enough.
 
You downvote questions when you think a bad question could be a good question and that the OP would be better at editing.
Sometimes, these overlap
 
@Xaade upvoting can get out of control too
I don't think my answer was a +150 pt answer, but OK - stackoverflow.com/questions/6791520/if-cin-x-as-a-condition/…
 
3:50 PM
Now it's a +160 pt answer.
 
@0A0D My highest upvoted answer is this one: stackoverflow.com/questions/6168717/…
And it's a pretty shitty one IMO.
 
David's answer was better formatted, but yours was easier to understand.
Honestly I think good answers deserve 10 votes at least.
 
@EtiennedeMartel Wow, no code and just a Wikipedia quote. That's a record :)
 
sbi
@jalf Yeah, he is. What's that picture from? Did this happen today?
 
@0A0D I think it's the fact that Jon Skeet commented on my answer that helped my case. People root for the underdog.
 
Als
3:53 PM
ehm...
huh..huh..
 
sbi
Oh, it is from today. WTF?
 
@EtiennedeMartel What a good sport :) He does not need the rep. Imagine how cut throat it would be if you both had 1k of rep
 
@sbi: The bomb that went off in the Norwegian capital
 
Als
@sbi: I saw you lurking down the SO main today, seems after long
 
Als
ohh bomb?!
 
sbi
@DeadMG Yeah, just saw it on a German news site.
 
@0A0D What do you mean by cut throat? Are you implying rep is more important that camaraderie?
 
@Josh Reputation is everything!
 
@Josh Yes, sometimes it is
 
3:56 PM
It's the fuel that keeps my soul running!
 
@EtiennedeMartel I know, it was a rhetorical question :)
 
There is no camaraderie unless you participate in chat :) It's not like you can message someone
 
That probably why so few people have the sportsmanship badge.
 
@Josh I do :)
 
Als
@Josh: What earns sportsmanship badge?
geez we dont know
 
sbi
3:57 PM
@Als I'm not sure you can see my activity page, but if you can, you'll see that I'm commenting on SO proper almost daily. I just don't answer that often anymore. But the average of the last months might still be one or two answers per week. (I don't know, though.)
 
Als
we just need rep! lol
 
@0A0D The only reason I upvote competing answer is because of that damn badge.
 
@Als Up voted 100 competing answers
 
@0A0D Good for you - I think that says a lot.
 
@EtiennedeMartel I wasn't even aware of it! Honestly.. had to just go look it up and realized I had it
 
3:57 PM
And even then I only upvote answers when their vote count is far lower than mine.
That way I stay frist.
 
@EtiennedeMartel oh jeez.. that word is all over the Daily WTF.
 
@EtiennedeMartel Pfft. My psych 101 teacher explained helping someone for yourself is the reason why people do anything altruistic, and then when on to explain why that isn't a bad thing.
 
Als
@sbi: oh yeah ofcourse i can see, but just probably our timings don't match
 
@0A0D Ha, I knew you would get the reference.
 
sbi
@0A0D I suppose I have that one since long.
 
Als
3:58 PM
@sbi: I saw you post an answer where i was posting since a loonng time...
 
@Josh I understand because of that why my Wife likes to give gifts to people.. makes her feel good
and she likes to spend my money ;) lol
 
sbi
@Als Sorry, but I have trouble parsing that.
 

« first day (279 days earlier)      last day (4678 days later) »