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

12:01 AM
@MartinhoFernandes It wasn't working because I had reached EOF, so the bad bit was set. I had to clear() then seekg()
seekg() fails if the badbit is set, apparently
 
 
4 hours later…
Als
4:05 AM
Hey guys, was planning to tag a Q as C++ Faq and need your sugestions
8
A: Does vector::erase() destroy the removed object?

Alsvector::erase Removes from the vector container and calls its destructor but If the contained object is a pointer it doesnt take ownership of destroying it. You will have to explicitly call delete on each contained pointer to delete the content it is pointing to, for example: void clearVector...

Star this if you feel the Q should be added to C++ Faq
Star this if you feel the Q should not be added to C++ Faq
 
4:45 AM
hi all.
 
Als
5:28 AM
@sbi: Hey Uncle Faq :), do voice out your suggestion about tagging the q..
 
 
2 hours later…
6:59 AM
Hi everybody!
Was there a change in rules that accepting your own answer is -2 rep? I just did that and it shows up in the feed menu as zero (as usual) but I also suspiciously got an inexplicable -2 added to the daily total.
 
> Please avoid extended discussions in comments. Would you like to automatically move this discussion to chat?
That's something new.
 
Clicking it posts a new comment -- I did not find that very useful.
 
7:17 AM
Very automatic.
 
Xeo
7:35 AM
room topic changed to Lounge<C++>: We really needed to change the topic.
 
Als
7:50 AM
Hmm no opinions..
 
8:12 AM
for every type T, there is only one empty std::vector<T>, so it should be a singleton, right?
 
@StackedCrooked How about some context?
 
Xeo
@StackedCrooked If you start thinking about using singletons, think again.
2
 
8:28 AM
@LucDanton I thought I'd start the day with some trolling.
To liven things up a bit.
 
Good morning
 
8:54 AM
@StackedCrooked Okay, I'll bite. A singleton is a type of which only one instance can exist. The question, then, is whether an empty vector is a different type from any other vector, or is it the same type as a vector<T> with non-zero size? Or, since it doesn't contain any items anyway, might the "T" be irrelevant, so it's a different type in another way?
 
And such a singleton would need to be const.
 
Anyone knows a reasonable example where singleton should be used ?
In C++
 
No.
Okay, maybe a logger.
But seriously, no. In any language.
 
"No" as in "I don't know" or "No" as in "There is not" ?
 
There is not.
 
9:00 AM
Ok.
 
If you think you need a singleton, a global will do the job better.
And it's way easier to write.
 
Mornin
 
I see.
What's funny is that I had an interview some weeks ago when I've been asked if I knew design patterns.
But then the interviewer only asked me about singleton.
 
Sigh.
A singleton introduces the unnecessary constraint of only one instance, which is pointlessly restrictive.
@ÓlafurWaage Morning.
 
I think the greatest downside is that it introduces global state and strong coupling.
 
9:04 AM
But a global will do that as well.
That's why singletons are so evil. They have the defects of globals, and then some.
 
Yes, but people are though to be careful with globals, though singletons are considered "good practice". Hey, it's in the GoF book.
 
Have you read Steve Yegge's "rant" on singletons?
 
I don't know, maybe. Do you have a link ?
 
> Here's what most people got out of Design Patterns: "blah blah blah blah SINGLETON blah blah blah blah".
 
Yeah, I remember
This is really true, but I found this article quite incomplete.
I can't recall why though. I guess I'll read it again.
 
9:21 AM
I'll go on record as saying that most people who are strongly against Singleton 1) have missed the point, and 2) probably haven't ever seen it applied even halfway reasonably. It does get used a lot of times/places that it's not suitable, but that doesn't mean there's no use for it.
 
@JerryCoffin can you give an example?
 
The main reason to use a singleton is to give up a bit of flexibility in favor of assuring correct behavior with multi-threading with minimal complexity or loss of efficiency. In particular, if you assure there's only one object, you can centralize the serialization of access to whatever data that object works with. Instead of spreading locks on that data all over everywhere, you centralize it into a single object.
 
But you need a special case where all instances use the same data.
 
@MartinhoFernandes It may be open to question how special that case is, but when you do run into that case (and I certainly have) it's an effective way to manage it. Not every system is or needs to be built around the idea of expansion. The systems I've encountered with it were embedded, so it was quite reasonable to say (for example) "a copying machine has a single scanner and a single printer". Yes, there are exceptions, but that's common enough to justify a design specifically for it.
 
Ok, I can agree it's not a completely useless pattern in certain scenarios.
What I don't like about it is mostly how quickly neophytes will learn it and try to apply it everywhere.
 
9:47 AM
C++ AMP, anything interesting? (the c9 videos)
 
Hi.. alll
Is here any one who use MFC with Opencv for image processing?
 
10:26 AM
1
Q: Issue facing with ctor and constructor together

kingsmasher1Before the actual implementation, i wrote a small prototype code, and put a class constructor and ctor constructor in the same file, to see if the ctor would execute first, which is my actual implementation. However, i am facing an error. Here is the code: #include <stdlib.h> #include <...

Hmm..
 
11:07 AM
0
Q: Is std::shared_ptr guaranteed to be initialized to 0 by default?

asdIf I use std::shared_ptr's default constructor, is the pointer initialized to 0 automatically?

Because reading documentation is too hard.
 
When asked for a call stack, someone posted this: pastebin.com/tzkUpAN2
 
11:32 AM
whew
I finally go my internets back
 
Someone stole your internets?
Who would commit such a horrible crime?
 
I don't know
but it's been a whole thirteen hours since I was online
shakes and stuff
 
Good morning
 
Is there time-of-day-agnostic greeting in English similar to "Good X"?
 
how about just hi?
 
11:47 AM
"Hello" I think
 
HI GUISE
 
btw, is "hello" usable in a formal context ?
 
@kbok I don't know, but if u upvote my answer ill upvote yours
 
yes, but me and formal most definitely do not mix
hello is the formal, hi is the informal
 
what about "greetings"?
 
11:51 AM
nobody says that
 
Is it out of use, or is it wrong?
 
it's not technically inaccurate, but it's not in use
 
@hexa deal :)
@hexa Anyway it's kind of a weird question, like asking which of steak and beer is better
 
Yes I guess
 
Although beer is obviously better
 
12:01 PM
Meat is awesome.
 
beer+meat = win
err
 
Bear meat ? yum !
 
damn im at 1339 rep, im gonna downvote 2 answers really quick
 
Make that 12.
evil grin
 
:P
 
12:13 PM
Hmm, if I implement the assignment operator with a parameter by value, and have both copy and move ctors, I get both copy and move assignment at once.
Am I right?
 
I know nothing of your arcane arts dear sr (yet)
 
@Martinho: Yes
 
12:36 PM
"Why is that. How can I do that." Dear lord, questions ends with question marks.
 
hi all!
I am facing problems solving problems with recursion...please suggest some good sources
 
If you want a good source about recursion, I suggest the Stackoverflow chat.
2
 
thanks a lot !
 
@kbok ¬¬
 
@AseemDua It was a recursion joke.
I take it you must be really new on this subject, so I would advise to start by reading wikipedia.
 
12:49 PM
@AseemDua Study the classic factorial problem, using recursion. If you understand that its a very good start.
Must, go, deeper
 
or you could just Google recursio
 
Hey what do you guys have on your "Ignore tags"?
iphone android java ios django json, so far
 
why would I ignore entire tags?
 
so SO can present you with interesting quesitons?
 
seems to work ok for me.
 
12:56 PM
it's easier to just give as favourites the tags you're interested in
 
What programming language are you guys arguing about today?
 
most of the questions I see are in my preferred tags, and having a bit of randomness just means I might risk learning something new too
 
SO highlights and prioritizes them
 
I do that too
I just know nothing about java, and i couldn't care less about mobile dev atm
 
@ÓlafurWaage Today we're arguing about which of bear meat or beer is better.
 
12:59 PM
then you'd better ignore those, eh? ;)
I try to give most subjects a chance. Interesting problems exist in mobile dev too
 
Bears, Beets, Battlestar Gallactica!
 
there are singletons to be weeded out there as well!
@ÓlafurWaage huh?
 
Haven't watched the office then
 
@ÓlafurWaage nope
@ÓlafurWaage I'm not good at watching tv shows :p
 
1:03 PM
I'm really proud that I managed to watch all of BSG
 
What the frack do you mean!
 
first one in over a decade that I've actually watched
 
the ending was such a massive disappointment
 
@ÓlafurWaage exactly what I'm saying. I hardly ever watch tv, so actually finishing an entire show was a pretty big event for me ;)
 
1:05 PM
@ÓlafurWaage not saying I didn't enjoy it
 
I haven't had time to watch stuff recently as well :S
 
although the New Caprica bit did drag out too long
 
I played the BSG board game a few weekends ago, was pretty fun. Slow though.
AND YES @CatPlusPlus BOARD GAMES HAVE SPEED!
 
@ÓlafurWaage it's a brilliant game imo
 
The amount of backstabbing opportunities is pretty high if your are a cylon
 
1:08 PM
at least when you play it with the right crowd. Need to be someone who's willing to scream accusations at each others at the slightest provocation :D
 
my type of game, what's it called?
 
@hexa Battlestar Galactica :p
 
Aye, same with the werewolf game.
 
maybe there's a ": the board game" subtitle, can't remember
 
Xeo
Seriously, we need a C++ FAQ for questions like this - "Why can't I #include .cpp files?"
 
1:10 PM
btw, if you're going to play it again, I really recommend the Exodus expansion
 
Xeo
They pop up about once a day
 
@Xeo floating point issues pop three times a day
 
If your code looks like this and you are having problems, then we are allowed to slap you! float x = someint/someotherint;
 
Any MQSeries fanboys here ?
 
Xeo
> I WILL DERIVE!
 
1:16 PM
I will derive is great.
 
@Xeo There isn't one about declarations, definitions, the ODR, inline, and stuff?
 
1:34 PM
@ÓlafurWaage O..kay?
 
I guess we were talking about board games a little while ago? Settlers of Catan is awesome, and Dominion (while technically a card game) is pretty fun.
 
Also if you like coop games, pandemy is awesome
 
@Collecter Dominion is fun. Catan always bored me to tears, for some reason
 
@jalf Really? did you play with at least 4 people? I think half the fun of the game though is who you play with for Catan.
 
@Collecter yeah, I did. I've played it a ton of times over the years. I guess I jsut got tired of it
doesn't have a lot of replay value imo
 
1:43 PM
@jalf the expansions help with that
@jalf ever hear of Cosmic Encounters? We play that fairly regularly.
 
Hi all./././
 
So, even board games have DLCs now, eh?
 
They have for a while.
 
@Collecter haven't tried it yet, but I've heard it was good, and I think we almost played it once or twice
 
IS here any one who work with MFC ?
 
1:45 PM
And hello @Miss
 
but then BSG or some other game dragged out a bit too long, so we had to skip it
 
@jalf you should try it sometime. It pretty fun. If you like to piss people off get the shadow power.
 
@collecter: Hi... your display name is too good .. I like that..:)
IS here any one who work with MFC ?
 
@miss it is too good? And sorry i do not work with MFC
 
@Collecter yeah, definitely will try it when we get the chance. Right now, most of our time is split between BSG, Descent and Dominion though.
 
1:47 PM
@collector, your display name is good .
 
well, and RoboRally
 
@jalf i actually saw roborally at the game store i go to. What is it exactly
 
the perfect programmers game ;)
 
Explain a bit? And is Descent basically a mini DND game?
 
each player has to reach certain flags placed around the game board. At teh start of each turn you put down a number of cards, face-down, which represents the movement your robot takes. Then you turn them over one at a time, and carry out the movement specified simultaneously with the other players
 
Xeo
1:50 PM
@Collecter Descent is lol. Can't say more
 
so you end up bouncing around madly, pushing each others into pits or lasers
and yeah, Descent is like DnD without the roleplaying, or Hero Quest on steroids
 
That sounds fun. Maybe I should pick it up.
 
DnD, where the DM is out to kill you, rather than tell a story ;)
 
How does it compare to Talisman?
 
he scores points for killing players
by spawning monsters and placing traps and whatnot
 
Xeo
1:51 PM
@jalf I love the introduction texts for the quests...
 
Wait so the overlord in descent wants to kill everyone? Sounds like my type of role.
 
@Collecter yup
except they're talking about the expansion, which is a huge continuous campaign. iv'e only played the base game which consists of isolated quests
 
Here I was thinking it was like Talisman. My friends and I have the first edition of that board game, and play it sometimes
 
hmm, I haven't played that
 
Everyone gets a different hero, with a base strength and magic power and special abilites, you roam the board, collecting items and killing monsters, until you can progress to the inner levels of the board (board is divided into three sections, outer, middle and inner, goal is to reach the inner). Last man standing wins. You have to make it to the inner section though. If you get to the tower in the middle you can use the artifact there to potentially damage everyone each turn until (cont)
they all die
not the best explanation, but an ok one
 
1:57 PM
is it fun?
 
@jalf so which is better RoboRally or Descent?
 
also, is there a significant difference between the different editions? Boardgamegeek throws up 1st-4th editions
 
I think it is fun, but it can take a bit too long sometimes. Remember we have the first edition, and they are on the fourth revision, so it is probably a bit better now
 
@Collecter depends on who you're playing with, and how much time you have and so on
 
I honestly do not know about the differences between editions
@well i normally have access to between 5 and 10 really geeky/nerdy friends for these board games
 
1:59 PM
Descent really takes ages to play (the first couple of times, we spent around 10-12 hours on a single quest. Last time, we managed to push it down to 6 or so)
RoboRally only takes an hour or two, so it's much easier to fit in
 
Some site I saw said Descent was four hours. You guys just slow going in games or are they wrong?
 
dunno, could be both ;)
I think with a lot of practice, 4 might just be realistic. But definitely not the first time you try it
 
Alright. Maybe I will convince my friend to buy descent and i willl get Robo Rally
 
a lot of it is down to your strategy though. You naturally have a tendency to take it slowly, and make sure to clear out every room, and loot every bit of treasure
even if it's more sensible to move on faster
 
I do indeed have that tendency
 
2:01 PM
also, Descent depends heavily on the number of players. You have to be 4 or 5, really (one overlord, and max 4 heroes)
 
I will just have to make sure one of our friends stays out of the game though. She takes 20 minutes to make a move in Catan....
 
we're 5, and in the base game, that skews the difficulty somewhat in the heroes favor. The expansion is supposed to be tailored for 5 specifically though
 
4 or 5 people is easy to get for me
 
with fewer players the overlord gets relatively stronger
anyway, roborally is great fun as a shorter "everyone pisses off everyone else and everything is chaos" kind of game
anyway, I'm heading home. Seeya
 
those are always fun
 
2:03 PM
yep
 
See ya
 
I'll have to look into Talisman
 
dont get turned into a frog
it lost me a game
i was in the tower too, duking it out with the person there
@jalf By the way i have a few more questions for you eventually
 
2:40 PM
@Collecter in descent you can get turned into a monkey'
insanely infuriating when it happens to you, hilarious when it happens to someone else
 
@jalf do you lose all your stuff if it happens?
in talisman your hitpoints are reduced temporarily, all your items drop on the square you are on, and your power and magic basically drops to nothing
 
@Collecter iirc, you just can't take any action other than moving, and you have zero armor
so you're pretty much just a walking snack for the overlord to devour ;)
 
alright
@jalf do you guys play with any of the descent expansions?
 
@Collecter not yet. We've played the base game for like 4 sessions by now, I think, so we're starting to get a good feel for it, but so far we've been reluctant to buy expansions because we wanted to be reasonably sure we wouldnt get bored with the game
we'll probably get road to legend soon though. Sounds like that's The expansion to get
 
Alright. By the wat how many players is best for roborally
 
2:47 PM
doesn't really matter. The more players you are, the more chaotic it gets, and the harder it gets to plan out your turns
with 8 players it starts feeling like your brain is turning to jelly and pouring out your ears, just from trying to keep track of everything
you can combine boards though to get a bigger playing area
 
@jalf so is there an upper limit of players? Because if everyone is there we could get 15 people in...
 
afk 2 mins
 
why does noone change the topic
 
we like board games
 
you know
I should actually get on and like, do something
 
Xeo
2:56 PM
You won't do that anyways.
 
lol
 
who does stuff?
 
Xeo
Not @DeadMG
 
Apperently
 
> "If we print the GL-DLG-ADM report on the fifth day of the month," he explained in an e-mail, "it will 'swap' the day and the month on our computer. So, if my computer says it's Oct. 5, then the report will change my computer date to May 10. But, this only will happen if the report is one page long."
> With no apparent root cause, Moe offered up a simple workaround: run single-page reports twice and, if that fails, reboot the computer.
 
3:04 PM
lol
 
Mind you, Moe was in the US and the problem only happened overseas in France.
Guess what it was.
Took them three years to figure it out.
 
Ok, but why printing a report updates the computer's clock ?
 
@Collecter 8 is max, officially speaking. But there's no fundamental reason why you couldn't just add more players if you want
 
@kbok Because the guy who wrote the code, wasn't aware that writing Date = .... would change it.
 
also hi
 
3:08 PM
@jalf alright.
 
probably won't even slow the game down much, since everyone take turns in parallel. But it might get too random to be much fun
 
@jalf risk is always fun.
 
but randomness isn't necessarily
 
i was talking Risk
 
oh
:D
 
3:11 PM
but yes to your statement
 
@MartinhoFernandes OMG... The VB devs are crazy
 
What I found the most amusing is that they took two years to even reproduce the problem.
 
@kbok well yes, why else would anyone design a language like that
 
When all they had to do was the obvious: change the locale to French and churn out a one-page report.
 
obviously
 
3:21 PM
Fun fact: in PHP, 0 == "php"
as well as "php" == TRUE
also, -1 == TRUE
 
PHP sucks- well known fact in this chat
 
1
Q: size_t: an operator? (and a way to use unordered_set)

Dante is not a GeekWhat is operator size_t () const Environment: Visual Studio 2010 Professional TL; DR Today I was searching for a way to use std::tr1::unordered_set. Because I asked for how to use std::map last time, I decided to find it out myself. I googled and most of the results told me to have a stru...

 
This is commonly accepted. But today, PHP sucks in a funny way.
 
This guy doesn't know what TL;DR means.
 
Maybe the question should be read bottom-up.
 
3:30 PM
so @kbok with all those php facts, does that make -1 == 0 or does that still evaluate normally?
 
@Collecter I hope it doesn't
Anyway that makes the == operator non-transitive
 
that it would
 
@Collecter It is already non-transitive. 0 == "php" == TRUE == -1.
 
Xeo
@MartinhoFernandes Wait, what?
 
@Xeo I'm assuming @kbok's "fun facts" above are correct.
 
3:43 PM
I tested them here : writecodeonline.com/php
In PHP, any non-zero integer == TRUE, including negatives
 
OH.... finally figured out what QFT means.
 
Any string not evaluable as an integer yields 0
 
I always figured it meant Quit Fucking Talking..... which didn't make much sense, because suddenly people were mad?
 
@kbok Same in C++.
@Xaade So, what does it mean?
 
3:47 PM
And any string evaluates as TRUE in a boolean context
@MartinhoFernandes Yes, these rules are not that stupid when you think about it. It's just that conversions are made silently.
The only difference is rule 2
 
right
British Gas are the most useless motherfuckers ever
if you can't be bothered to come out and read my damn meters, then you damn well accept what I say they say
apparently, if you use less gas than they estimate, you're a Problem Customerâ„¢ and have to phone them up repeatedly
 
Als
Hey guys, was planning to tag a Q as `C++ Faq` and need your suggestions
8
A: Does vector::erase() destroy the removed object?

Alsvector::erase Removes from the vector container and calls its destructor but If the contained object is a pointer it doesnt take ownership of destroying it. You will have to explicitly call delete on each contained pointer to delete the content it is pointing to, for example: void clearVector...

Need suggestions..
@DeadMG, @MartinhoFernandes: Your suggestion
 

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