« first day (36 days earlier)      last day (4906 days later) » 
00:00 - 22:0022:00 - 00:00

12:00 AM
:132779 Who says it doesn't work? I said it doesn't work with one equals sign, you have posted two just now.
That's why I'd prefer !inp to inp==NULL, btw.
 
ya... I just realized that :)
 
Every sane compiler will spit out a warning to assignments in comparisons if you let him (that's why you should crank up the warning level as high as possible).
 
@FredOverflow I'm using a remote compiler on the school's computer...
not exactly sure how to crank up the warnings
I am a noob at this...
 
@KronoS Your format string is wrong. %d%s%s%d%f should be %d%s%s%lf%f because you want to read a double (%lf), not a decimal integer (%d). Again, any sane compiler will tell you that there's something wrong.
Note that when you output stuff via printf, the format string %f means double, and there is no format string for float. Very confusing, I know :)
Does that help?
 
@FredOverflow Ya it does very much....
thank you...
 
12:08 AM
@KronoS Also, you are missing one & on the last parameter. It should be &cities[i].PercentChange instead of cities[i].PercentChange.
Here is the entire correct line:
fscanf(inp, "%d%s%s%lf%f", &cities[i].Ranking, cities[i].CityName, cities[i].State, &cities[i].Population, &cities[i].PercentChange);
 
That was where I was getting the seg fault...
 
Of course. The compiler was trying to interpret a float as an address.
So does it work now?
 
yep...
kinda lol
no it just spits out a bunch of garbage as it runs... I'm trying to figure it out before i bother you some more ;)
 
does printcities work without the bubblesort? Try commenting out line 82 and see what happens.
Also, why is there a 10 hardcoded in the call? Doesn't the length depend on the input file?
Your printf format string in line 166 is wrong, it should be "%d %s %s %f %f"
As I already mentioned, float and double are both printed via %f.
 
12:24 AM
no it doesn't correctly print WITHOUT bubblesort
:< @FredOverflow
 
so did you correct the format string in printf?
 
yep
here's the updated code. I realized that I really didn't need a double for the population... so I changed it to int
10 San_Jose CA 912332 14.400000
65684 -12885301 0.000000
0 92274690 0.000000
0 0 121847232.000000
0 Lèg¸ fs 0 0.000000
66706 ÿ?rÐÿ?~Ï ÿÿÿ 2 -NaN
-12707028 ¿ûXÿ;` -4195164 0.000000
0 66706 -254478687777989461621727806123344396288.000000
-12619056 Ï 2816 0.000000
0 ?I 0 0.000000
this is my output
1 New_York NY 8143197 9.4
2 Los_Angeles CA 3844829 6.0
3 Chicago IL 2842518 4.0
4 Houston TX 2016582 19.8
5 Philadelphia PA 1463281 -4.3
6 Phoenix AZ 1461575 34.3
7 San_Antonio TX 1256509 22.3
8 San_Diego CA 1255540 10.2
9 Dallas TX 1213825 18.0
10 San_Jose CA 912332 14.4
and this is the original data
oh i get it... I'm dumb...
 
12:54 AM
@FredOverflow I figured it all out... thank you so much for your help
 
 
2 hours later…
3:09 AM
@FredOverflow I posted a stub with the intent of expanding on it but then realized I didn't really have time to make it a decent answer so I removed it.
I delete a whole lot of my answers.
 
 
5 hours later…
7:48 AM
Hello!
 
 
2 hours later…
9:23 AM
Well, I just wasted two hours staring at the chat screen waiting for someone to come talk to me :'(
 
sbi
9:37 AM
@James sbi to the rescue! But I'm afraid I'm not talkative enough now, since I have to feed the kids.
:(
 
Ha ha. It's ok. I really should be sleeping. I got distracted again by this evil website.
 
sbi
@James <innocent_look> Which website? </innocent_look>
 
<rolls_eyes/>
 
@James if you want a FAQ-related challenge, i have one... (involves some programming)?
 
sbi
9:54 AM
@JamesMcNellis That's nothing. You should see my little girl do that! Beats you anytime.
In hindsight it seems this was an error:
16 hours ago, by sbi
@Carson Was denn, Du auch? Is anyone listening who does not speak German? Then us Germans could stop speaking English.
Chat dried up somewhat after that.
@JamesMcNellis James, it was me! I'm terribly sorry!
 
 
2 hours later…
11:46 AM
what's up guys?
@JamesMcNellis I like your main answer!
mods haven't answered me yet on the wish to make my question CW :/
web.de blocked all emails since 10. november until yesterday (when i looked for emails) because my account were full!
dammit. it's all kmails fault, since it always crashed when i tried to delete an email xD
 
sbi
12:03 PM
@JohannesSchaublitb web.de be damned. I used to maintain a mailing list, inhabited by dummies, and 80% of all issues were rejections from web.de, because some account was full. And you can't even inform those people, because the handle you have on them is a non-working email address...
 
oh
i wonder whether the email sender will get a "mail couldn't be sent" message back -.-
 
@JohannesSchaublitb most probably. although some mail servers are smart about it and keep retrying for a week or so. informing the sender that they're doing that.
i think it's impossible to do equivalence grouping (that is, deducing groups of equivalent items from individual equivalences) in pure SQL. right or wrong?
while i'm asking non-C++ questions, i wonder if anyone else recognizes an REM song in something of the "Lady Fantasy" by Camel?
:)
 
12:42 PM
:) Are you going offline (to sleep) or are you just coming online?
 
Alf me?
oh i see now
 
C++ sucks, Just kidding! if you spilled your coffee into your monitor I apologise....
 
12:59 PM
well, it so happens that the salutation "good night!" strongly implies a farewell. and although some long time ago "good day!" was just a greeting, nowadays it is strongly associated with a brusque brush-off, like, "bye, i've had enough of you!". many years ago norwegian prime minister Kåre Willoch did that in an interview on english television, he started with "good day!", looking very serious! :-)
so, we had a bit of fun with your "good morning!", bringing in timezones and whatnot. :-) very much in positive spirit.
 
Well not quite, it depends on the intonation of ones voice, is it "Good Night!" or "Good Night?" or "Good? Night" each one means something different
 
1:55 PM
@Alf: lol @ the curly braces discussion :)
 
 
1 hour later…
3:20 PM
In stackoverflow.com/questions/4238395/unique-word-count-in-c-help Brian says "A map is already sorted in ascending order by key, but you can sort it however you want with std::sort."
Is that true it's sorted in ascending order by key?
I guess it is.
 
@CiscoIPPhone, it is. It is not true, however, that you can resort it with std::sort. You have to copy the contents of the map elsewhere (i.e. into a vector) and then sort.
 
hi everyone
hi everyone
i need to improve my english grammer ! what book you offer to me
 
@maysam Did you mean C++ grammar?
 
no i'am a kernel developer i'am expert in programming my purpose is speaking
 
3:39 PM
what is your native language?
 
persian( i can read english ebook but cant speak fluent)
 
@maysam (assuming youtube is available in iran)
 
no youtube is forbidden site in iran and its filter
 
Perhaps title of this chat room should be amended to include also "and general oracle services"
@maysam well, it probably doesn't help to move to neighbouring turkey :-)
 
@AlfPSteinbach and how do you call that country in winter? "cold turkey", buahaha...
 
3:55 PM
@maysam it sort of angers me that so many countries, like iran and israel and the usa, are in the grip of right-wing religious lunatics or, in the case of southern america, left-wing communist fanatics. argh. that doesn't help you, i know, but, you have my sympathy
 
@Alf: Sir Rant-a-lot speaks again :)
 
@AlfPSteinbach what say?
 
@maysam i think best solution is to simply find some english-speaking folks near where you live. a lot of stores etc. in Teheran have english signs and so on. should not be difficult?
 
@maysam Is this site also blocked? channel9.msdn.com/Tags/c++
(english videos about C++)
 
4:02 PM
@AlfPSteinbach you are c++ developer ? what project you do it ?
@FredOverflow thank i watch Mark E. Russinovich and ... conference
 
lol @ the donkey reference :)
2
Q: Where can i download a free c++ ide with working code completion?

tomjenI was wondering where I can download a c++ compiler with code completion that doesn't suck like the back-end of a donkey. I have tried Eclipse, but that could not find code that had a space in the path (which means the entire concept is kinda unless), I tried codeblocks, which has a limited form ...

 
but its a technical video not general speaking
 
@maysam Yes, but it's also in english, right? ;) The content doesn't really matter. I learned English by watching the Simpsons and various other cartoons/sitcoms.
And by reading novels.
 
sbi
4:22 PM
@James You got up! Why?! :)
 
It's Sunday; time for church soon.
 
sbi
@James That just reinforces the questionability (if that's even a word) of the act. :)
 
@James: I inserted one character into your answer, hope you don't mind ;)
9
A: Are pointers bad?

James McNellisI'll start with one of my favorite Scott Meyers quotes: When I give talks on exception handling, I teach people two things: POINTERS ARE YOUR ENEMIES, because they lead to the kinds of problems that auto_ptr is designed to eliminate. POINTERS ARE YOUR FRIENDS, because operations on ...

 
@FredOverflow No! Those containers owe me resources and I'm going to make them pay!
 
4:27 PM
@sbi Questionability is a word. It's the adverbification (which is not a word) of the adjective questionable. :-P
 
@JamesMcNellis Are god's mysterious ways caused by UB?
 
@FredOverflow Thanks for the fix. Someone fixed another error yesterday where I forgot a "not" in my main FAQ answer that made a whole sentence completely totally wrong :-D
 
sbi
@JamesMcNellis My spillchucker failed on "questionability" .
 
Mine did too...
 
Damnit, I still want a donut!
 
4:36 PM
You said that yesterday!
 
@JamesMcNellis Hence the "still"...
I didn't eat one, and my craving didn't stop!
 
A doughnut or donut (, ) is a type of fried dough food popular in many countries and prepared in various forms as a sweet (or occasionally savory) snack that can be homemade or purchased in bakeries, supermarkets, food stalls, and franchised specialty outlets. They are usually sweet, deep-fried from a flour dough, and shaped in rings or flattened spheres that sometimes contain fillings. Other types of dough such as potato can also be used as well as other batters, and various toppings and flavorings are used for different types. The two most common types are the toroidal ring doughnut...
Mmmmmm, look at those yummy donuts in the picture
 
argh, you're killing me!
 
i still have the käsekuchen
 
@Johannes: which one of these?
 
4:50 PM
they all look yummy!
 
xD
it was a fried one, bought in the supermarket
doesn't taste as well as mom made ones :)
nice searching for "käsekuchen" seems to activate a different image search interface
 
sbi
@FredOverflow I dobut it.
 
5:09 PM
hello everybody
 
sbi
Hi Tony.
 
Heeeeellllllllllllloooooooooo
 
hey
how are you guys?
whats new on SO C++ chat?
 
Not much, just implementing an ObjC++ smart ptr =)
 
whats that one for?
 
5:22 PM
To manage retain and release for you on the iphone, just like regular c++ smart pointers fo refCounts.
 
I see the need for that, manual memory management sucks and autorelease is a bit scary.
 
5:40 PM
yup. =) i have a very simple implementation. i need to test the hell out of it, but it should be githubbed soon.
 
sbi
5:54 PM
@JamesMcNellis Um, I'm essentially an idiot when it comes to grammar, but wouldn't "questionably" be the adverb, while "questionability" would be a noun?
(In essence, I consider your grammar lesson questionable. That's an adjective. I know that much.)
 
 
2 hours later…
7:35 PM
Stack overflow just told me to "come back in 4 hours", quite rude don't you think? :)
 
Huh, where?
 
@AlfPSteinbach When I used my last vote for the day :)
And the "rep cap was reached via rep from upvotes only on n days" line is still hilarious :)
 
7:57 PM
Good afternoon ladies.
I don't know if I'm rude myself for rarely reaching my voting cap.
 
@wilhelmtell I think it says something deep about human nature that so few females are C++ programmers. But I'm not sure quite what.
 
Stable females don't like the feeling of being raped?
I can't believe I said what I just said.
 
@wilhelmtell LOL, but men do?
 
I think it could be interesting to have statistics of the relative proportion of males and females using various programming languages. E.g. C++ versus Python.
 
@FredOverflow men like to feel alpha. Also, men like living in a lie.
 
8:02 PM
@wilhelmtell Since when do alphas get raped?
 
I'm a man, I'm fucking in love with C++, and I don't approve any of what I said above.
 
@wilhelmtell Something tells me you've failed to recognize alpha females as such...
:-)
 
@AlfPSteinbach Wow, you just said "assmunch"! </Butthead>
 
@AlfPSteinbach when I see a girl hacking properly with C++ I instantly promote her to ALPHA, not regardless of how she looks.
 
@wilhelmtell "not"?
 
8:05 PM
Not.
 
But not to worry. I think bad-looking hacker girls a myth.
 
Is there even such a thing as an "alpha female"?
 
There is if you inject them with testosterone
 
Judging from the samples I've seen in conferences, girls are indeed a sub-minority -- less than 5% I'd say, but goodness they have the looks. They're all alpha for me. There are few things more satisfying than a chat with a girl about RAII, swaps, exception-safety and concurrency.
 
8:08 PM
 
Oh, and AI. I'm talking to you, @trinitiy.
 
@wilhelmtell Did you really do that? Chat about RAII?
What's there to chat about, couldn't you simply link to the faq? ;)
 
I'm better at socializing than that, my friend.
Today I saw Spolsky's comment on StackExchange Programmers, about SO users with 5-digit rep easily getting $100k job offers. Without an interview, he said.
I chuckled.
With or without an interview: no. I never heard of job offers based on stackoverflow rep. There are few people I know who get contacted for their online presence.
No, sorry. I know of no one who got contacted for their online presence.
 
@Alf I can read that... >.>
 
@wilhelmtell [Factoid] Actually recruiters for big firms like Microsoft, Google and Facebook do contact people based on online presence. But I'm guessing that SO rep doesn't count much.
 
8:18 PM
Srsly?
 
@wilhelmtell At the very least, it can't hurt
 
@wilhelmtell Yes.
 
@MichaelAngstadt Homepathy can't hurt either.
 
I was interviewing with someone and mentioned the fact that I was a committer for an open source project and they said that I should have that on my resume.
 
Actually I was contacted by a couple of obscure firms in Singapore. Or something to that extent. I didn't really count it because I didn't know what to make of it.
 
8:23 PM
I don't know...I just talk as much as I can at my interviews
 
LOL last interview I had I went completely overboard. I laughed at myself. :-p They asked me if I know what's the STL. I answered "Ah. It all started when a man named Alexander Stepanov was in born in 1952." and I carried on from there.
Never mind I just googled and I was off by a couple of years about his year of birth.
After a few minutes I stopped and say "I have a feeling I'm going overboard here".
 
They guys laughed and said no it's cool, carry on. So far it's already the most complete answer we've had so far.
:-S
Was fun though.
 
yeah i mean, that's what you gotta do
you have to show that you are a fountain of knowledge ;-)
 
lol hence my love-hate relationship with C++. you never get that feeling. It's like sex but without the orgasm at the end.
 
8:30 PM
I did that once
 
Do excuse my language, if I'm offensive today.
I blame the coffee. Don't what they put in this thing. Sugar, I suppose. Must be the sugar.
 
yeah, that's why i hate it when ppl ask you whether you are an expert in something
because it's one of these "the more you know, the more you know you don't know" sorts of things
 
@michael what you deleted was true
 
hehe, hit enter too early :)
 
@AlfPSteinbach what you edited is true.
 
8:32 PM
what did he delete?
 
@FredOverflow conspiracy revelation. :p
 
@FredOverflow just the meaning of life.. XD
 
I hope he didn't delete an array ;)
 
what is this "delete" you speak of? (Java guy here)
 
@MichaelAngstadt The thing that's buried deep inside the destructors of RAII classes and almost never invoked in user code.
 
8:44 PM
hehe i know, i'm just joking around
 
@MichaelAngstadt Okay so what's that GC thing that seems to be rather popular among Java programmers?
 
@FredOverflow it's only the best thing since sliced bread
 
@MichaelAngstadt I don't like sliced break, prefer to slice it myself according to my needs
 
you c++ people are stuck in the past maaan..
yeah and then you slice your finger off...
 
Doesn't GC stand for "Gee, see why my application is so unresponsive?" ;) </kidding>
 
8:47 PM
lol
 
Actually, doesn't C++0x define how a conformant GC must behave? Or was that proposal dropped?
 
no, it stands for "I don't have to waste half my time managing memory"
 
Neither do you have to in C++ if you are familiar with the concept of RAII.
Again, there are no more delete s in user code if you write modern C++.
 
What that?
 
Resource Acquisition Is Initialization, often referred to by the acronym RAII, is a programming idiom used in several object-oriented languages like C++, D and Ada. The technique was invented by Bjarne Stroustrup to deal with resource deallocation in C++. In this language, the only code that can be guaranteed to be executed after an exception is thrown are the destructors of objects residing on the stack. Resources therefore need to be tied to the lifespan of suitable objects in order to gain automatic reclamation. They are acquired during initialization, when there is no chance of them b...
 
8:50 PM
Wow there. Slow down. No.
 
sometimes ihate using shared_ptr for libraries so i use naked pointers
(wrapped in smart pointers for often used classes)
 
If you typedef your pointer you can use anything at all provided it feels like a pointer.
 
we need a !faq <topic> command
that will give a link to the proper SO C++-faq entry
 
@JohannesSchaublitb Naked pointers, that's a funny name. So smart pointers were invented to cover their shame, hm? :)
 
8:52 PM
What's with c++-faq tags?
 
@JohannesSchaublitb What question should we link to when someone asks "what is RAII?"?
 
@FredOverflow wow there are so many of them.
It's one of my favourite questions. :)
 
@wilhelmtell No need to start talking about RAII, this is not an interview ;-)
 
RAII is to C++ what pointers are to C.
Oy.
 
I would say RAII is to C++ what finally/dispose is to Java, only less error-prone :) Plus GC, only deterministic :)
 
8:55 PM
I think StackOverflow is a good dojo place exactly because of that: people ask, people answer. So fucking what if it has been asked countless times. That's the practice: to ask and to answer.
 
so RAII basically wraps pointers inside a class?
 
StackOverflow just needs better tools for old-timers to ignore the dupes, that's all.
 
This is too short for a FAQ, right?
2
Q: What is meant by Resource Acquisition is Initialization (RAiI)?

JohnWhat is meant by Resource Acquisition is Initialization (RAiI)? www.technical-interview.com

Oh this one is better:
22
Q: Please help us non-C++ developers understand what RAII is

Charlie FlowersAnother question I thought for sure would have been asked before, but I don't see it in the "Related Questions" list. Could you C++ developers please give us a good description of what RAII is, why it is important, and whether or not it might have any relevance to other languages? I do know a l...

FAQified
22
Q: Please help us non-C++ developers understand what RAII is

Charlie FlowersAnother question I thought for sure would have been asked before, but I don't see it in the "Related Questions" list. Could you C++ developers please give us a good description of what RAII is, why it is important, and whether or not it might have any relevance to other languages? I do know a l...

 
@FredOverflow Thanks! The links were helpful.
 
sbi
9:29 PM
Um, I guess I should learn to first read all the way to the end. I just wrote a treatment on what RAII is as an answer to the first question linked above, only to discover that you made the second one an FAQ...
 
@sbi Well, we should primarily tag existing questions as faq instead of writing new questions/answers, right?
 
sbi
@wilhelmtell Don't worry. I've already starred three messages of you today. They're all gorgeous, I think.
 
@Johannes: I noticed the same thing about closing the files too early. What should we do about it?
 
sbi
@FredOverflow Now, who the hell came up with that stupid idea?!
 
@sbi I seem to remember it was the anti-rep-whore league!
 
sbi
9:35 PM
@MichaelAngstadt Actually, GC stands for "stupid language helps me managing one resource, but fails for all other - and so do I".
2
 
@Johannes: We could provide a move constructor, but that is probably too much for the intended audience, right? So what else... reference counting? :) Or simply give another example that does not involve passing temporary objects?
 
sbi
@wilhelmtell Well, the problem with dupes getting answers is also that the quality of the answers vary widely. If every dupe links to one question, that that can acquire a really good answer on the topic.
 
@sbi: Do we have a better answer to what RAII is than the one I linked to?
 
sbi
@FredO No, I think Peterlein (yeah, I know, still, it's a silly name, so) made a pretty comprehensive one. Mine can't reach that. Not tonight, anyway.
 
@sbi There's just the problem with the default copy operations doing the wrong thing... :/
 
9:52 PM
i think it's far better to make new questions specifically intended to have faq answers
rep-whoring is an invalid reason to reject that idea
 
@JohannesSchaublitb Well, it's definitely more fun, but many people don't like it...
 
either the faq entry creator will get the rep, or the answerer/quesioner of the question you tag with c++-faq
 
why don't we get rid of reputation all together and live as equals? ;)
 
i still think CW is better for c++-faq entries
 
but questions can't start as CW anymore, right?
 
9:56 PM
@FredOverflow it's pretty easy to write the "move" ctor. just make the file handle mutable and nullify the pointer in the copy constructor.
@Fred only if mods think so
 
@JohannesSchaublitb I know. I'm just not sure if the intended audience of the question "gets it".
 
i flagged my question as CW but mods haven't answered yet
then i think the answer should point out that problem
now peterchen made the parameters const refs, but the problem still exists in c++03 of course. the compiler can still copy it
 
00:00 - 22:0022:00 - 00:00

« first day (36 days earlier)      last day (4906 days later) »