« first day (870 days earlier)      last day (4086 days later) » 

12:00 AM
well
 
@DeadMG Optomization was cutting out some work that I assumed GetDirectArray was doing: when I explicitly assigned the return of GetDirectArray to a variable and then accessed it, the 0xBAADF000 disappeared.
 
you need to retake the year even if you know you're going to fail it, because it buys you time.
 
Ell
Yeah
 
@ThePhD The compiler should not be able to optimize out function calls that it cannot prove have no other side effects.
 
Shrug. Then something else happened, and I don't know what the fuck it was.
 
12:02 AM
sorry again guys
 
Maybe it inlined it or something and fucked me over.
 
Ell
Hi george
 
In either case, I have a new 0xBAADF000 to deal with.
Thankfully, it's in my own library, so I can handle it! :D
 
Ell
You have a very baad Foo!
 
0xBAAADF00
worse :P
 
12:07 AM
@DeadMG this is what your attempt at linux was like
 
Seems quite accurate.
 
hey, it's not my fault their installer didn't work as it should do :P
 
@Borgleader See, it's not like that because at least the car actually ran for a while. :-P
 
12:20 AM
@Insilico That's my point, he tried for a while and went back to Windows
Windows > Linux anyway
 
Linux can't play Starcraft
 
QED
 
Xeo
@DeadMG Which installer?
 
Starcraft can't play Linux.
@Xeo Wubi or something like that. The one for muggles.
 
Ell
How is sc with.wine?
 
Xeo
12:26 AM
@R.MartinhoFernandes I have no clue what that is
 
@Xeo You haven't read Harry Potter!? o.O Remind me which rock you live under again? :P
 
Xeo
@R.MartinhoFernandes I meant the "wubi" part.
 
Wubi sucks.
 
Xeo
12:27 AM
Fucking hell, of course I know what a muggle is.
2
 
@Borgleader I haven't.
 
lol
 
lol
 
Xeo
Little girls can't help anyone.
 
you already have answers too
 
12:29 AM
good way to get some free downvotes
 
Xeo
Anyways, time to sleep.
Robot, shouldn't you also be nopping already?
 
@Xeo Good nite
 
cya
 
@Xeo Maybe. I won't be taking classes in March, so I can get to work at 11.
 
Xeo
Ooh, nice.
I plan on taking a shower early in the morning to get my hair under control, so I have to get up a bit earler. :|
 
12:31 AM
I'm pretty much bootstrapped now.
 
Xeo
Na dann, Glückwunsch würd ich sagen. :)
 
Ell
I have showers in the morning
But 3 Minutes is probably minimum time
 
Xeo
Alright, gute Nacht now.
 
Gute Nacht!
 
Ell
Gute nacht
And goodnight tome too. Later folks
 
1:02 AM
Join us in C# for a release party.
 
user1357851
 
Hahahahaha xD
 
You can get released from C#? Is there some spell/incantation, or is it the full exorcism?
 
I'm going to post a C answer to a C++ question. Bracing for downvotes.
;_;
 
1:18 AM
@Rapptz Why would you knowingly do that?
Masochism? :P
 
It's neater than the other answers.
 
If you don't link it, how can I get to it to downvote it?
 
0
A: Map of int and vector<int> in c++

RapptzI don't particularly like va_args but the solution is "neater" to a degree than most as long as you (the user) don't mess it up, i.e. mixing types. Another downside is that your vector cannot contain -1, but your example case doesn't show it. #include <vector> #include <cstdarg> #inc...

go nuts.
it was either that or a million push_backs.
 
I'm watching EGHuK playing the SC2 campaign :3
 
@Rapptz No downvote from me. I hate long lists of almost-identical gunge.
 
1:33 AM
Me too.
-1
Q: C++ Error c2512: No default constructor avaliable

EirikraI know that there are a lot of questions about this but I don't get it D: I'm sorry, I'm new at this and there's some stuff I still don't understand... This is for a homework, where I need to set an alarm for the timer, suddenly this error appeared (it wasn't there when I was working at the scho...

free rep?
or vote to close :D
 
if questions are supposed to be general faq questions to help everyone on the internet and not solving one persons particular problem, why does only the OP have say in he accepted answer? In fact, why have an accepted answer at all?
 
@MooingDuck how would I know what boost has. I don't use it :|
:(
@MooingDuck Also, that's a good question.
 
1:50 AM
0
A: Map of int and vector<int> in c++

seheHave you considered std::multi_map? #include <map> int main() { std::multimap<int, int> map; for (int i=1; i < 6; i++) for (int j=1; j < i; j++) map.insert(std::make_pair(i, j)); }

 
@sehe Hm? Maybe I'm not getting it but he has 4 elements at some point.
 
@Rapptz -1 not enough boost
 
:( dang boost.
 
Xeo
int stuff[] = {0,1,2,3}; tree[4].assign(stuff, stuff + length_of(stuff))~
Basically doing what list-initialization would do, but manually
Maybe with a nice void assign(C& c, T (&arr)[N]) function template
@Rapptz @sehe Whever wants, grab ^ for the repz. :P
 
don't care much about rep.
 
Xeo
2:03 AM
But seriously, unfiltered has so much crap in it...
 
mhm.
0
Q: Why is Singleton a better choice than Global Objects

ModdedLifeHello Stack Overflow. I'm studying for a CS exam I have tomorrow and I'm looking over the review sheet that our professor provided for us. One of the points says to know why Singleton is a better choice than Global. I'm not exactly sure the reasoning, but I do remember him saying something abo...

 
@Xeo unfiltered?
 
Xeo
@Borgleader Looking just at questions/tagged/c++
 
Xeo
For example, I have questions/tagged/c++ templates or c++11
Which is " or "
 
2:11 AM
I don't like how you remove the c++11 or template tag though
 
Xeo
?
 
@Xeo dismissed that because there is no source iterator range
 
Xeo
Welp, those questions were not specifically about C++11, so I nuked the tag.
@sehe ?
 
std::regex is a C++11 thing.
C++11 doesn't just mean "must have some form of variadic template and/or language lawyering pertaining to C++11" does it?
 
2:15 AM
@Xeo insert(b,e) requires input iterators. We don't have them
 
iunno just my two cents.
@sehe assign not insert
 
@Rapptz same deal
 
Xeo
@sehe Huh. What are pointers if not input iterators? Also, .assign, but the same deal.
 
@Xeo i didn't see any pointers
 
Xeo
> int stuff[] = {0,1,2,3};
 
Xeo
decaying to pointers.
 
@Xeo Oh. That's nice. I completely overlooked he had input data sitting in arrays. Well.
 
@Rapptz Why not initialize the vector directly?
 
Xeo
@sehe Erm, I wasn't assuming that.
@Borgleader No C++11
 
Come on guys. What are you doing? Treating me like all noob. I missed the array :-| no need to teach me how to use arrays :)
 
Xeo
2:17 AM
lol
 
@Xeo Oh...
 
Xeo
@Rapptz I explained my tag reasoning before here. C++11 is now C++, fact. And I remove and from questions not specifically about a C++11 feature. A broken library implementation isn't C++11-specific, IMHO.
 
Yes but not everyone has a C++11 compiler or using C++11, in fact we just saw one right now.
 
Xeo
@sehe The OP has no array.
 
People gave a C++11 answer and the guy doesn't have it
 
Xeo
2:20 AM
@Rapptz There's for that.
 
likewise the question isn't tagged with C++11 because C++11 isn't the rampart dominating standard being used
Then why not merge C++11 with C++?
if c++11 is now in fact c++ then just merge the tags because they're the same thing
c++11 features are in turn just c++ right?
 
Xeo
@Rapptz Welp, I wouldn't particularly care, although it'd muddy my watched tags and include all the bad normal C++ questions. :(
@sehe The int stuff[] = {...}; part was just me doing manually what list-initialization would have done.
I was assuming compile-time knowledge of the input. though, I give you that.
But if you don't have compile-time knowledge of it, then it will be in some kind of container anyways.
Also, why the heck am I not sleeping yet. Damn.
 
You should go to bed now and thank yourself later
 
I just got up, what do I do now :/
 
2:33 AM
Nothing special. Parents talk, kids get bored
 
So, is an object considered initialed after it enters the constructor body, but before constructor returns?
 
Which object, Pubby
 
@sehe I'm trying to answer this mindfuck of a question
yeah. Good idea. But what happens next? Singleton<Type1>::Singleton() calls the execution of Singleton<Type2>::Singleton() which need static _instance variable of Singleton<Type1> which is in construction. — user14416 5 mins ago
 
Xeo
@Pubby It's initialized when any one constructor finishes successfully.
Where "successfully" means "no exception left the ctor".
 
2:39 AM
@Xeo Well, can you do this?
 
Xeo
Your idea does not fit me. I need these singleton initialization during the program start up. — user14416 1 min ago
Lawl
 
foo::foo() { reference_function(*this); }
 
Xeo
Sure, but *this is not fully constructed yet.
 
Well is that UB? :S
This stuff always confuses me
 
Xeo
It's not UB per-se.
Only when you use it in a way that requires a completely initialized object.
 
2:40 AM
What requires a completely initialized object?
 
Xeo
(Which usually means when you use it in a way that requires a complete class, like accessing members, or calling functions for which invariants must hold. Since the object is not constructed, there are no invariants holding yet.)
Don't be so sure. I need to know what happens in my original question? Do you know? — user14416 49 secs ago
What kind of idiot is that.
@Pubby Where this normally happens is passing a pointer into the base-class constructor.
 
The kind of idiot that uses singletons I guess
 
Xeo
As long as the base constructor only saves the pointer or reference, all is fine.
But calling member functions is bad.
It's like trying to call virtual functions
 
Hm, but you can call member functions inside the constructor body yourself :S
 
Xeo
@Pubby Sure, if those don't have any invariants, you're fine.
Or if you satisfied those invariants prior to calling the functions
 
2:43 AM
I still don't understand. What do you my by invariant?
 
Xeo
Say your class has a vector. If the function accesses vec.front(), the invariant is that there must always be atleast one element in the vector.
 
Arent invariants things that are true before the function is called and dont change all throught the function execution?
I think I saw that during my class on testing
 
Xeo
Wait, I think I might be mixing up invariants and pre-/postconditions
It's one of those.
I always confuse them. :(
 
I just don't understand how that relates to constructors :S
 
pre condition is something that must be true prior to calling.
post conditions well it must be true after the function is called.
iirc
1
A: Do preconditions usually overlap with invariants?

BorgleaderA precondition is simply something that must be true before but not necessarily during or after. An invariant, as the name suggests will not change at any point in time. For example, let us say that I want to normalize a vector. A precondition could be that it's current norm must not be 0 (becaus...

 
Xeo
2:46 AM
Oh, right, functions don't have invariants - classes do.
@Pubby It's a bit of a blurry matter, I admit.
 
@Xeo I think I prefer to stay ignorant on such matters
 
I'm still pissed that I only got 1 upvote for that answer
 
You could always buy a few extra
 
Xeo
@Pubby The take-away is, don't call functions that require invariants on *this to hold, while they don't hold. You're only setting yourself up for trouble. A simple rule might be to not pass *this to external functions that require a complete class (i.e., accessing any members), where "external" means it's not a member function of yours.
 
@Xeo The usual
 
2:52 AM
@Xeo Okay, I think I got it
 
Xeo
Craaap, 4am. I don't think going to sleep now will do much. T_T
@sehe It's truly sad, in a way.
 
3:11 AM
Why is everyone sad around here
Does being a programmer automatically imply sadness/depression?
 
user1357851
I am not sad/depressed
 
user1357851
I have this natural endorphin going
 
user1357851
It is not saying I am never sad, I do cry once a week at least. It is like doing my weekly check up on my crying system
 
user1357851
But when left alone, I can just entertain myself with absolutely anything - birds, games, programming, chatting, commenting on economic conditions, punting on shares, feast on food etc
 
user1357851
People say I am a loner, probably I am, but that's only because I am happy this way
 
3:17 AM
yay@tel
 
The running gag in my family is that if you could tan from LCD light, I would be black.
 
user1357851
:D
 
As for feeling down, I just watch this: blip.tv/day9tv/…
 
@Borgleader you changed your avatar! :o
 
Yeah yesterday or friday I cant remember
 
3:35 AM
well I slept all friday so I wouldn't have noticed :p
no, wait
today is monday? huh.
 
yep
 
well then I guess I slept all yesterday
 
my brother refers to any computer work as "playing on the computer"
 
user1357851
is he a plumber?
 
no
I could be debugging and all kinds of horribly technical shit on my screen. still "playing"
 
3:41 AM
@Telkitty It's a me Mario!
 
user1357851
@Borgleader speaking of which, have you never seen this:
 
user1357851
 
TITTIIIIIIIIIIIEEEESS I fell asleep. :c
 
@Telkitty Oh god wtf
 
user1357851
haha
 
3:45 AM
virtualbox released a massive fix update yesterday
 
@doug65536 Did they?
 
yeah, now it won't crash if you assign a lot of memory to a vm, which was a huge fix for me
and a few other crash fixes
I ran a RAM test in a VM that had 16GB assigned, worked great
that would crash in 5 seconds before, every time
 
Why do you need 16GB of RAM assigned to a VM?
 
I have 24GB of ram, why not?
make -j
 
Ok new question, why do you have 24GB of ram?
 
3:50 AM
it also doesn't run SLOWER with large number of CPUs enabled in the VM anymore. I ran beautiful with all 12 processors assigned to the vm
@Borgleader massively parallel builds, and crazy sized disk cache
and room for a RAM disk
 
Lulz.
24 GB of RAM.
 
RAM is cheap now. the real question is, why not max out your motherboard?
$300 or so for 24GB
 
Because I have better things to do with that extra 200$ than buy RAM I won't use
I have 8GB and rarely use more than 4
 
also, I'm running core I7 extreme, which has triple channel, so I need multiples of 3. 6x4GB = 10GB/sec RAM throughput
 
I see somebody here flashing their e-penis...
 
3:55 AM
I'm not. 24GB doesn't add much to the size of it anyway
 
user1357851
I spent that extra $200 on a diving certificate last week. I figured, just in case I get chased by FBI for hacking their system. Diving ability is going to be worth more than that 24GB ram :p
 
probably at least 20% of you have a $5000 TV anyway, why such a crap machine
developers in general I mean
 
$5000 TV? the fuck
 
@Telkitty Oh so you're part of Anonymous? Or those chinese hackers that keep going after american federal institutions?
 
o_O
What the holy blistering jesus christ
 
3:57 AM
I don't have a TV at all :p
 
user1357851
@Borgleader No, I am a wannabe, Anonymous wouldn't want me
 
hey, not implying I'm loaded. I'm commenting on how some very highly paid devs have modest computers
 
I know some people here have three monitors, a tricked out desktop and a laptop...
But a 5,000 dollar TV? o_O;
Holy shit, if I bought a 5K TV I would demand it beam entertainment directly into my brain for that price.
I should be able to chest-bump Captain Picard.
 
If it makes you feel any better:
Oct 19 '12 at 18:45, by Mysticial
user image
 
now that's a motherboard
all ECC memory too no doubt
 
3:59 AM
the RAM is giving me a mild case of OCD :p
 
Not that spectacular now. But it was amazing shit 4 years ago...
 
Anybody have good reading on the new reference type. T&&
 
user1357851
 
@LokiAstari Tongue-in-cheek:
2194
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

 
@LokiAstari lookup "rvalue reference". Once you have some understanding of that, lookup "perfect forwarding"
 
4:02 AM
@Mysticial lol
 
@LokiAstari If you haven't read it, I'd start with Scott Meyer's article on "universal references."
 
@Rapptz I've been waiting to pull that on a high-rep user. :P
 
@Telkitty Well I highly doubt a wannabe would (be able to) hack the FBI
 
Tee hee.
Lol
this is always null
no matter where in the Callstack I am.
I fucking hate Release.
 
hate the debug info
 
user1357851
4:10 AM
@Borgleader since when I was ever able to hack the FBI? :D
 
values being in registers has been an excuse for crappy debugging for too long now
 
15 mins ago, by Telkitty
I spent that extra $200 on a diving certificate last week. I figured, just in case I get chased by FBI for hacking their system. Diving ability is going to be worth more than that 24GB ram :p
 
user1357851
was joking
 
@ThePhD if you really have to see "this" look at the assembly and figure out what register 'this' is, then in the watch window, cast that register to a pointer to that type
luckily, the this pointer is an easy register to figure out from the assembly
sometimes you can cheat and just look at the register values. the heap and stack addresses are pretty recognizable
 
...
Okay
Now just after fixing the problem
the FBX SDK is erroring again
awdhajdhwahdwkhdj
I give up. I'm going to bed. I'll figure this out later.
On the bright side: we have brilliant cel-shading.
GOOD NIGHT, MOTHER FUCKEEEERS
 
4:27 AM
Have you considered the asset importer library? assimp.sourceforge.net It doesnt do FBX but it does a truckload of other formats
 
4:46 AM
@Xeo If you've watched this show, or even just the OP...
0
Q: What does the German say in the opening of ef - a tale of melodies?

Logan MThe OP sequences for ef - a tale of melodies have a lot of German text in the background. The text seems to be the same for all of the different versions. This version is from episode 6, and features the instrumental version of the song and the characters are not present, so it's the easiest to r...

 
@Borgleader I have to use FBX.
It's what my artists can export and the only format in 3D I know of that supports animation.
And weighting and skinning and etc.etc.
Also sleeping is for Mother Fuckers.
 
Hmm, I'm sure there are formats that support what you need that you can convert to, maybe one of them can be loaded using that library. Just throwing it out there :)
 
@Mysticial That intro is silly
What ever happened to sitting on hills watching the sky, and then running montages?
 
the fbx api seems so good on paper, but I've experienced weird issues with trying to make an importer
 
5:18 AM
Thanks everybody that replied to me earlier post.
 
:P
 
I wish std::regex worked :(
0
A: How can I match the \0 character in a regex in C++?

RapptzThis works pretty nicely with what I've tested ('a','b','\0'). If you don't have std::regex or boost::regex I guess what you can get out of it is the fact that the regex I used is ('.'|'\\0'). #include <boost/regex.hpp> #include <string> #include <iostream> #include <vector...

 
Hey guys, I just had a quick C question, if ya don't mind. When I pass a file ptr to a function, am I passing it by val (a copy) or are they automatically passed by ref? I ask because my prof made me rewind the filePtr at the end of a function, but I thought that was pointless because I assumed the function Ptr in main wouldn't have changed. Thanks in advance!
 
What kind of file pointer? FILE?
 
I don't think C has "pass by ref"
 
5:29 AM
the can be passed by value
if that's what you're asking, it will copy it to the stack typically.
unless it fits in a register and all that
 
what do you mean by "rewind the filePtr"?
 
Well C has a simulated call by ref using pointers. It is a FILE ptr sorry.
The function rewind() that sets a pointer back to the start of a file stream
 
The pointer itself will be passed by value. But obviously what it points to won't be duplicated.
The offset is internal the file handle object. So even if you pass the pointer by value and change it inside the function, the change will stick.
 
@mystical can you explain the first sentence in more depth, I'm not sure I understand.
 
130
Q: What explains the current shift from glossy UIs to matte UIs?

AdnanI've noticed an interesting phenomenon in the user interfaces of many famous applications, they're moving away from the glossy complex to a more dull and bare minimum design. Why the sudden change? It also appears that most of these companies have adopted this design around the same time, was th...

 
5:32 AM
Pretend the file handle is a house.
The pointer is the house address.
 
@vlad sorry, u said function pointer. that will always be a pointer (by reference as you say)
 
When you pass the FILE* into a function, you essentially copy that address into the function.
 
C++ has references, so we don't typically say "by reference" in C terminology
 
But it still points to the same house...
So you've duplicated the address. But not the house.
The file offset is an attribute of the house.
 
lmao, you said file pointer. time to sleep maybe
@vlad anything passed as an argument in a function call is by value. If you want to pass a pointer, then you're passing a pointer, (a pointer VALUE)
 
user1357851
5:35 AM
@Mysticial then delete is for the demolition of the property? memory overflow is to put your rubbish in your neighbour's property and let your dog roaming the neighbourhood?
 
@Vlad I'm still curious what do you mean by "rewind the filePtr", does your professor want you to change the value of "filePtr" back to something else at the end of your function (which won't have any effect) or does he want you to call some function using filePtr which does some operation on the file?
if it's the latter, then that makes sense, because as @Mystical said the pointer points to the same file and the file is not copied
 
@Rapptz that must be becoming one of the most duplicated questions lately
 
but if it's just changing the value of filePtr like filePtr = origFilePtr at the end, then that doesn't seem to accomplish anything
 
@stephenLin essentially I read in data from a text file in a function (that isn't main). That function received a copy of a FILE * as a parameter. Within the file, the FILE * is incremented in order to continue reading each line. At the end of the function I am to call the function rewind(FILE *); in order to reset the FILE * back to the beginning. What is confusing me is that I assumed I was passing the FILE * by
value, and therefore rewinding it would only affect the local copy (essentially doing nothing). I thought the FILE * in main would still point to the beginning of the FILE.
 
@Telkitty When did we go from C to playing The Sims?
 
5:39 AM
@Vlad does he want you to preserve the file pointer? (meaning, upon return the file pointer hasn't moved)
 
@doug. I assume so.
 
You know what a (memory) pointer really is right (on desktop machines). It's an address
 
Yes.... I know. Here is my problem
 
Oh god
You're directly reading out of the FILE* pointer?
Are you a madman?
fread, fwrite, fscanf, etc.
They're your friends.
 
He won't let us use fscanf
"To easy"
 
5:42 AM
Oh.
You have one of those fucking retarded professors.
Well, I don't know what to tell you. Good luck.
 
Thanks haha. Hasn't been much trouble, just confused about this one thing. I feel like I'm not explaining it well.
 
@vlad this is a really confusing thing to explain. because you never write to the FILE structure yourself if you are sane. When you pass the FILE *, the called function has the pointer
 
yeah man, the fuck. Way too easy.
 
can you pastebin the code
 
@vlad it's a handle
 
5:43 AM
Everyone knows real C programmers recreate the entire C library in the real world.
 
@Rapptz Yeah man, especially Linus.
 
pretend FILE * is an int (that is big enough to hold a pointer). that's how you should think about FILE *
 
user1357851
@Borgleader After I finally manage to forget the mental image our lecturer put in my head. He said iterating student on the list was like to put a spear through a student then check the person out before doing the same thing to the next student. I gathered he didn't like his students much
 
it isn't like a real pointer at all
 
i think it'd be clearest to see code, it all depends on what the signatures are
 
5:44 AM
@Telkitty Creepy...
 
user1357851
@Borgleader he said that in a 100+ people lecture
 
That doesn't make it any better
 
@doug. Ok. I'm assuming then I'm really not just sending the function an address, I'm sending the function some important "file" info that it is still changing even if the "pointer" was past by val?
 
i can't tell if FILE ** is being passed to his function or FILE * and what you actually mean by incrementing the pointer
 
the FILE * doesn't have any relationship with the "file pointer".
the file pointer is what offset into the file (on disk) that you will read/write. the FILE * is just an arbitrary implementation defined value that you use to identify an opened file
 
5:47 AM
 
@vlad fopen returns a FILE *, however, ftell returns the file pointer. how confusing is that? lol
fseek changes the "file pointer"
 
@Vlad I think what your professor is asking makes sense, in the open file there's an internal "file pointer" that keeps track of where you are in the file, and you the professor wants you to reset that back to the beginning
 
the FILE * never changes no matter what you do to the file
 
FILE *; I mean using fgets() until FILE * == NULL;
 
no, FILE * will never become null by itself
 
5:49 AM
@melak47 lol
 
even if you fclose the file, your copy of the FILE * won't change
 
fgets will equal null if there is nothing left to read though? Also, thanks @stephen Lin, I think that was the most helpful. The internal idea makes sense.
 
fgets doesn't return a FILE *, it returns a pointer to the first character that it read, or NULL at EOF.
 
@Vlad basically, the FILE * in main will not change, because it was passed to your function by value...but that's just a handle that the OS uses to keep track of a "file"...the "file pointer" is an internal thing that keeps track of where you are reading/writing from in the "file"
 
Thanks everyone, that makes a lot of sense.
 
5:54 AM
so that's why your prof wants you to call rewind(FILE * stream)
 
The stream idea makes sense, he never explained why, he just tells us to do things....
 

« first day (870 days earlier)      last day (4086 days later) »