« first day (136 days earlier)      last day (4828 days later) » 
06:00 - 22:0022:00 - 23:00

6:01 AM
Guys, you need to save me. When I say int num=5; isn't 5 being copied to num.
Is writing 5 to num, doesn't mean that it being copied ?
A comment posted on my post said it and downvoted. Though downvoting isn't the concern, just wanted to clarify. stackoverflow.com/questions/5150685/…
 
 
1 hour later…
7:05 AM
Pre Madrid mailing available: open-std.org/JTC1/SC22/WG21
 
7:25 AM
RaiiClass theClass;
longjmp(retbuf);
How can i confirm or deny that theClass will, or won't clean up?
 
n3242 (Current C++0X draft, I've no reason to think that this has changed since C++98 but I didn't check) 18.10/4 The function signature longjmp(jmp_buf jbuf, int val) has more restricted behavior in this International Standard. A setjmp/longjmp call pair has undefined behavior if replacing the setjmp and longjmp by catch and throw would invoke any non-trivial destructors for any automatic objects.
So: UB
 
sbi
8:29 AM
Uh oh, he's asked a question again. Let's see whether @Charles will get bashed for answering sincerely...
 
It's more important to be right than appreciated in one's own time.
I just love questions of the form: "in my opinion it should do X".
 
sbi
@CharlesBailey It's not so much about being appreciated, but not being attacked by the guy for answering. He has a bad reputation for that, and I have actually stopped answering him.
 
Another 'in my opinion' question: stackoverflow.com/questions/5128208/…
 
good morning!
 
@sbi I tend to ignore the poster and treat each question on merit. Is there a particular example that you were thinking of?
 
sbi
8:38 AM
@CharlesBailey He has a long record of acting like an idiot. I don't feel like he is worth my time digging through it to find an example.
 
@sbi OK, fair enough. I think he may be responsible for a couple of questions that talk about the VS and gcc 'teams' being 'right' or 'wrong' which seems a strange way of viewing things.
 
@CharlesBailey, there are two types of "in my opinion" questions, those where the poster doesn't understand why something happen, and those where the understanding of the applicable rules isn't the subject but their existence is.
 
sbi
@CharlesBailey Actually, I just remembered which discussion with him made me stop answering him: stackoverflow.com/questions/2879555/…. Note a few of his comments were removed after being flagged.
 
9:28 AM
Goood morning
 
@CharlesBailey I tend to agree, and I do agree that the current question seems to be clear and well stated. It is just that he has a tendency of actively hiding information from the questions so that he can come back saying that answers are mistaken.
I remember a particular case where he just posted something like: Why does decltype(a) x; /*plus other stuff*/ fail? --without any extra information or error message. Then when some potential errors came he was just commenting: nice answer but you are wrong
I requested clarification of how a was defined, and after not getting any for a couple of hours I voted to close the question (not enough information to help anyone). Only then he decided to add the definition with a comment: If I had written this in the beginning everyone would have known from the start (a was a type argument to the template)
The question is: http://stackoverflow.com/questions/5070352/decltype-in-static-assert
And the concrete comment that I have just looked up was: *@David I specifically didn't provide info on what low and high are for the reason that this construct doesn't (or seems to) work on any type. But updated my answer*
I try to avoid answering questions from people that specifically don't provide information --but you are right that todays question does seem as a real question rather than a practical joke
 
 
1 hour later…
10:59 AM
GPUParcel.C:33: error: redefinition of ‘void Foam::GPUParcel<ParcelType>::setCellValues(TrackData&, Foam::scalar, Foam::label)’
GPUParcel.C:33: error: ‘void Foam::GPUParcel<ParcelType>::setCellValues(TrackData&, Foam::scalar, Foam::label)’ previously declared here
wtf
IMO, good C++ code is better than good C code, but bad C++ can be much, much worse than bad C code.
 
@Nils That is quite simple... you are defining the same function twice in the same translation unit, something like: void foo() {}; void foo();. Now, since the compiler points to the exact same definition, this seems to indicate that you might be including the .C file twice from another translation unit (you should NOT include files that are not headers)
 
But I don't see where
 
Just grep/find in all files something like #include "GPUParcel.C"
Another option would be running the preprocessor and reading the output, you will see that the function is defined twice, and the preprocessor will probably leave traces as to what include path lead to the output
 
If that's a template, then he has to include the implementation.
 
11:15 AM
hrmm I start to hate this project already
00550 #ifdef NoRepository
00551 #include "KinematicParcel.C"
00552 #endif
what could be the purpose of this?
 
When you use templates, compiler must see all definitions before it can generate concrete instantiation.
This is either done by sticking everything into relevant headers, or in an ugly way, by including the implementation file.
There was a question about this on SO a day or two ago.
Unrelated note: using case-sensitive .C extension will bring the world of pain on Windows.
 
Meow
Well that wasn't my idea
 
what header is std::max in? I'm trying to use it, but my compiler seems to think I want to use the macro max...
 
max is, as you say, a macro, so it doesn't matter which header std::max is in.
you need to disable the max macro
 
algorithm
 
11:23 AM
either by not using windows.h at all
 
Macros are expanded before function lookup, so you need to get rid of the macro anyway. std::max is in algorithm AFAIR.
That one from windows.h can be disabled with NOMINMAX.
 
or, (ironically) be defining some symbol along the lines of "DONT_DEFINE_MAX" before #include <windows.h>
 
@PiotrLegnica It seems that the people in that project have gone a long way into making it hard to use in Windows --and they are proud of it
 
What's the purpose of putting all inline methods in a file called blahI.H and include it in blah.H
should't that be in blah.c
 
11:24 AM
@Nils - then they wouldnt be inline would the?
they
 
@DavidRodríguezdribeas Reminds me of every project that insists on using those damned autotools as the only build system.
 
inlines have to be defined in #included files, so that multiple compilation unit thingies can see the definitions
 
@Nils That is kind of common in some header files, where the interface is defined in a "public" header and then implemented in a "private" header, where public/private means that one of them is the one that the docs tell you to include, and the other is not even documented
 
ok
is that related to templates too?
 
@Nils pretty much, templates, as inlined have to be visible when they are instantiated, which in most cases implies that they have to be defined in a file that is included.
 
11:30 AM
humm
 
In some circumstances, if you only want to allow a small subset of types to be used with that template, you can define the templates in a single translation unit and manually instantiate it there, but that is more often than not a pain
(I have done it to reduce compilation times, but you are trading limiting the template to a set of types in the process...)
// t.h
template <typename T> void foo( T ); // declare
// t.cpp
#include "t.h"
template <typename T> void foo( T ) {} // define
template void foo<int>(int); // instantiate
// main.cpp
#include "t.h"
int main() {
foo( 1 ); // ok
foo( 1.0 ); // compiles but fails to link: undefined foo<double>(double)
}
(I am not sure of the explicit instantiation syntax, it's been long since I last used it, but google for it if this does not compile)
 
thx for the explanation
GPUParcel.C:178: error: incomplete type ‘Foam::IntegrationScheme<Foam::Vector<double> >’ used in nested name specifier
 
Incomplete type means that you have a declaration (usually called forward declaration) but you have not defined the type, it is probably complaining about Foam::Vector<double>
namespace Foam { template <typename T> class Vector; }
Foam::Vector<double> v; // error: incomplete type
 
ok..
nah vector is also used some lines before, so I guess it's IntegrationScheme
Just added an #include "IntegrationScheme.H"
 
12:19 PM
why .H
whats wrong with a nice subtle, .h
 
Same reason as for .hpp, to tell C and C++ headers apart (except using .H/.C sucks).
 
@ChrisBecke openfoam.org not me
but anyways AFAIK openfoam is the only reasonable open source cfd software
 
what? so .H indicates the contents are plain C?
 
No, C++.
 
#include "somelib.h"
extern "C" {
#include "otherlib.H"
}
 
12:28 PM
yes
 
.h would be C, and .H/.hpp/.hh/.hxx (or no extension at all) C++.
 
@Nils, NoRepository makes me thing of Sun CC, which along with its queried instantiation model had a separated compilation model near of what CFront provided. Along with the use of capital C and H as extention, this makes me think that it is quite and old code base.
 
probably in the other direction?
// lib.H
extern "C" {
#include "lib.h"
}
???
But more like:
// lib.H
#include "lib.h" // already contains the extern "C" inside ifdef c++ guards
namespace wrapper {
class mylibwrapper {};
}
 
@AProgrammer never used the Sun CC stuff, but thx for the remark
 
@PPiotrLegnica, If you think that .H/.C sucks as C++ extension, what do you think of .c/.h (some very old C++ code base used this; one I had to touch was even mixed C and C++. )?
 
12:33 PM
The use of capital extensions seems to be an old practice anyhow
 
Also this openfoam uses a strange build system: openwatcom with some custom scrips, did anybody here ever use that?
 
so, historically, outside of this bizarre standard, more legacy C header files would be .H vs .h and more cpp header files are .h already
 
@ChrisBecke yes the software is also quite old
 
@ChrisBecke These people have different headers that differ only in capitalization just to mess with the windows filesystem defaults...
 
@ChrisBecke, yes. It was dropped when Windows started to be a platform of importance. 20 years ago or so.
 
12:34 PM
So any standard that tries to standardize .H to mean a cpp header has already failed.
 
@AProgrammer It sucks because it doesn't work on case-insensitive filesystems. Code using .c as C++ must be really old.
For headers, many (most?) people use .h even for C++. I prefer .hpp, myself, probably because I use Boost very much.
 
@PiotrLegnica, yes all the code base I've seen which use .c can be traced back to the 80's.
 
@David - im sorry, but any header file that guards itself with #ifdef __cplusplus guards and wraps stuff using extern "C" {} IS by definition a c++ header file.
 
@ChrisBecke I'd call it C++-aware header, not strictly C++ one.
 
@PiotrLegnica, I've a strong preference for having a different extention for C++ and C headers. I've worked on code base which are partly in C and partly in C++. Having the .hpp or .hh for things which can't be included in C is helpfull.
 
12:40 PM
@ChrisBecke Well... stdlib.h in gcc is sprinkled with #ifdef __cplusplus..., and that is surely a C header
but the point was that you could offer both a .h and a .H, with the .H including extra code (wrappers) around the pure C code. Then again, I am not in favor of using capitalization for this, I'd rather have the .hpp version of it
And at any rate, I more often than not use .h, and not .hpp even for C++ only headers
 
@DavidRodríguezdribeas, I'm currently using more often .h than .hpp because that's the convention used by my current code base and the advantages of breaking the convention are far less than the inconvience. But I mixed code base, I'm known to provide better C++ interface in .hpp file (use of RAII to ensure that cleanup functions are called, use of overloading instead of hinting at the types in function names, ...)
 
I always use .hpp - for some reason I don't understand - for header files with template classes.
So I either have a .cpp and .h pair, or just a .hpp file
I never personally mix .c and .cpp files in the same directory structure, so confusion there just isn't an issue.
good grief I posted that in 2008.
The edited title becomes more and more prophetic
 
1:05 PM
same here
 
I looked at part of the code base I'm working on. It has about 16000 .h, 10000 .hpp 8000 .cpp 4500 .c 1000 .cc 300 .hh a few .cxx .H and .hxx. And no .C (I'd not be surprised if some headers where counted twice, and for sure some headers are installed with the implementation only in compiled libraries)
 
Sry for asking again, but I don't understand some linking errors I get: Make/linux64GccDPOpt/basicGPUParcel.o: In function `Foam::basicGPUParcel::basicGPUParcel(Foam::basicGPUParcel const&)':
basicGPUParcel.C:(.text+0x45): undefined reference to `Foam::GPUParcel<Foam::basicGPUParcel>::GPUParcel(Foam::GPUParcel<Foam::basicGPUParcel> const&)'
Where should I start to look?
 
Compiler couldn't instantiate the template, most likely. Missing definition or something.
 
so actually a template problem
thx
 
1:32 PM
I did (last year or so) my own vector implementation in c++ just to learn it, but there I used *.hpp to workaround the template liking problem and now? Just append the C file to the H file I guess..
and then I just ensure that all the H-files are in the include path and then it's supposed to work?
 
Ensure that your configuration define NoRepository. That macro seems to be made to use the inclusion compilation model instead of the separated one.
 
 
1 hour later…
3:05 PM
It bugs me just a little that COM is easier to implement in C than C++
 
I found COM to be quite hard no matter what language, but that's possibly just me
does anybody know if you can force a boost variant to pick a certain type when doing a get?
I have a long that I need to extract, but because my variant also has int, it tries to take an int, since the value fits mostly into an int
but that throws a bad_get()
 
I looked at boost::variant too long ago, but I seem to recall that it would throw bad_get when trying to extract something of a type different to what it was initially assigned to
 
@DavidRodríguezdribeas yea that is what it is doing, it is assigned a long and it (for some reason) tries to get out an int
 
do you have the code? can you reproduce it in a simple snippet?
 
just a sec
ah, I think I know what the problem is
 
3:15 PM
I have made a quick test and it does what is expected, are you sure that you are passing a long?
 
the code that puts it into the variant, probably puts it in as int in the first place
I'm getting the values from an XML string, so I have to just do a try cast type thing, and I guess the first successfull cast is to an int, not a long
not sure how I'd force it to become a long....
if it is a small number
problem is it could be a big number, so my retrieval method would need overload or some way to determine its type, not sure if that is even possible
 
I am not sure on what problem you are trying to solve, but in the XML schema you probably have defined the types of the elements, and if not there, you know how the XML is being generated, so you know the types before serialization
why not use that same type when parsing the XML?
@Tony I mean, since you are trying to extract a long, it means that he element you are extracting from should contain a long, just pass that knowledge into the XML parser
I tend to prefer pure C++ object models and just a thin serialization/deserialization layer that converts from C++ types to XML (or whatever your format is)
 
@DavidRodríguezdribeas the XML is not being generated by me
I am just the receiving end of the XML
 
Nice... chat conversation links work in anti-causal scenarios... I have just linked your comment with my previous line!
 
Is that long long or just long int?
 
3:23 PM
long int
 
I'd check if it's not the same size as int first. :P
 
@PiotrLegnica :)
 

Gödel, Escher & Bach

Jan 15 at 21:49, 1 second total – 2 messages, 1 user, 0 stars

Bookmarked Jan 15 at 21:51 by Konrad Rudolph

lol :p
 
lol xD
 
Nice book. I've good memories of it. I wonder what it would be to read it now.
 
 
1 hour later…
4:38 PM
XML is way overrated
 
"XML is like violence. If it doesn't solve your problem, you're not using enough of it."
3
 
haha
 
Making people edit XML is sadistic.
4
 
it is
 
The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well. -- Phil Wadler, POPL 2003
 
4:51 PM
XML is like C++ std::string, not particular good in itself, but standard. Being standard is a great feature.
 
a great feature, indeed. unfortunately too often the only redeeming feature
 
I've been having to use it in a project and it has been nothing but misery
 
And worse, XML is far too often used to solve problems it wasn't be designed to solve. Considering the way it solves the problems it has been designed for, it isn't surprising how much desperation it generates.
 
its interesting to note that people complain about the scarceness of parenthesis when confronted with LISP, but will not notice how scarce <> can be when dealing with XML, one day we'll run out of <> and then...
 
scarcity? do you mean plethora?
 
5:04 PM
Both are bad. XML's verbosity for writing, LISP's parentheses overload for reading.
And I don't buy excuses from either. YAML did a pretty good job at replacing XML tags with significant whitespace (though, as Python programmer, I may be biased ;)).
 
@ThomasEdleson it was some short of reference to people dismissing LISP on the grounds that there are not enough parenthesis in the world to write a large LISP codebase. Scarce refers to the world, opposed to the huge amount of them required in the language.
 
oh, like the russian spy that discovered the last page of a top secret lisp program, back in the 70s?
it went: ))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))))))))) ))))))))))))))))))))) )))))))))))))))))))), and so on
 
5:38 PM
class MyCloud: public Cloud {};
We have a class MyCloud which extends Cloud. What is the meaning of public after the semicolon?
 
It means that public members of the base class will also be public in the inherited one.
 
@Nils It means that all access specifiers remain unchanged, and that MyCloud is a subtype of Cloud.
You can also inherit privately (the default for classes if you don't say public). Then there is no subtype relationship, and all inherited stuff is private.
 
ah and if I omit public?
ok
 
The public is not necessary if you inherit from a struct.
After all, a struct is just a class with default public access and default public inheritance.
 
@PiotrLegnica that is not correct. The meaning at that level is that code does not have access to the private parts of MyCloud will not be able to use MyCloud as a Cloud, that is
 
5:42 PM
thx
 
And a class is just a struct with default private access and default private inheritance.
Personally, I find it a bit strange that C++ has two type constructors with almost identical semantics.
 
struct is for C compatibility.
 
the inheritance relationship is not publicly seen, but only accessible for those that have access to the private parts (the class and its friends)
 
I prefer the default-public, actually, I tend to use struct more often than class.
2
 
hi all!
What data type best suited for byte strings? byte string is encoded SMPP PDU and can contain null bytes.
I am new to C++ and this will be my first try.
 
5:55 PM
@PiotrLegnica I have only used "inheritance" in the context of template-metaprogramming, lately.
Like here:
5
Q: Detecting basic_string instantiation

FredOverflowI wrote the following code to determine if a type is an instantiation of std::basic_string: template <typename T> struct is_string { enum { value = false }; }; template <typename charT, typename traits, typename Alloc> struct is_string<std::basic_string<charT, traits, Allo...

@Xerkus Maybe std::vector<unsigned char>?
I don't know what SMPP PDU means, though.
 
6:09 PM
@FredOverflow what about null bytes in string?
 
NUL is a valid char, std::vector will be happy to store it.
 
@PiotrLegnica as will std::string. C++ strings can contain NUL characters.
@FredOverflow PDU usually means protocol data unit (or the like: payload in the protocol)
 
@DavidRodríguezdribeas I know, but Fred proposed vector, so I assumed Xerkus is asking about it.
NUL-terminated strings are evil.
 
6:37 PM
evil?
 
7:30 PM
@PiotrLegnica I would not go as far as calling them evil, but they might not be the best design... note that there has been other different string designs that have failed ungracefully. In Pascal strings contained a first byte containing the length of the string and then an array of characters with the actual contents, the main problem as you might guess is that you cannot have string of more than 256 characters.
 
@DavidRodríguezdribeas but this limit can be extended.. i think this is a powerful implementation..
 
The same design mistake was done in the windows api, and up to Vista (have not really tested Vista/Win7 to this respect) some of the apis for file access would accept a pascal style string with its limitations. If you want to test your current windows version for this, just create a deep enough directory hierarchy and add a file to the deepest level. Then from a point where the relative path to the file (including filename) exceeds 256, copy and paste (Ctrl-C, Ctrl-V) the directory.
@BlackBear I am more fond of the C++ standard library / STL influenced implementations where instead of keeping pointer + length the string keeps two pointers: start and one beyond end of the string.
The idea of having a sentry element at the end of a container (from the iterator point of view, not adding a sentry value element) leads to nice simple code.
 
@DavidRodríguezdribeas i never tried c++, i didn't know that..
i have to admit, c++ style is better :)
 
@DavidRodríguezdribeas no, it was strings from Visual Basic, with 16-bit length. the limit on single-byte character path length is a bit more than 256. not very much more, but enough to invalidate the Pascal-string theory.
 
so how would you guys go about finding a HANDLE leak?
an app where I work leaks handle's to already destroyed threads, question is how does one go about finding where the leak is?
 
7:42 PM
@Tony what, are you saying that thread handle lifetime isn't neatly tucked into some abstraction?
 
no, not from what it looks like
 
@Tony uh oh, well, there's your culprit!
 
when the app has be running for a while we got some >100000 handles hanging around
 
@DavidRodríguezdribeas don't listen to the idiot tech writers at Microsoft. MAX_PATH is like 270 or thereabouts.
 
7:44 PM
@AlfPSteinbach the suspected handle is not even a pointer, it uses unsigned int to get a handle, then when the handle is needed it casts it to HANDLE...
 
I have found a reference where it states that it is 260, which is: "D:\" a 256 filename and "\0"
 
You can get past MAX_PATH with \\?\, though.
 
my machine is hanging otherwise i'd just tell you what it is, i mean it's 2 seconds to write the program. unfortunately, half an hour to compile it. i need to reboot.
 
There are different approaches, a full new (some 6-8 years ago) api that accepts longer path names...
 
yup, 260
 
7:52 PM
Some humorless twits downvoted me...
http://stackoverflow.com/questions/5159032/what-will-be-the-value-of-x-x-a-a-a
 
@ChrisBecke lol +1 from me
 
@ChrisBecke Don't worry, you'll get enough votes from humorful to compensate.
 
@ChrisBecke why not post a joke comment instead of a non-answer?
 
But it is correct answer, it's called undefined behaviour for a reason.
 
no, "undefined behavior" is the correct answer, as someone else posted
 
8:00 PM
It's all magic and ponies.
 
I really should write an overview of all the most vexing parse variants
1
Q: Strange compiler error when trying to create a temporary object.

StackedCrookedAfter I posting this question I tried to reproduce the problem of accidental rvalue creation when creating a scoped RAII object. Now it appears that I can't reproduce it without compiler errors! In the following code sample, in Test::foo() the second ScopedLock creation doesn't compile. The gcc ...

Obviously by most vexing parses I'm calling all the situation where something could be interpreted in two ways without being an ambiguity error.
 
that's a pretty broad definition
 
8:15 PM
All the cases I know in C++ have the same source: declarations/definitions mimics use, and thus some declarations and definitions may be mistaken as something else.
 
Or definitions mimic other declarations...
myclass x( std::string() ); // assuming myclass( std::string const &) is a valid constructor
 
@DavidRodríguezdribeas I'll not try to make the inventory here :)
 
@DavidRodríguezdribeas long paths have been there since NT 3.51. don't listen to the hype. don't listen to the tech-writers at MS.
 
The latest C++0x draft n3242 is available as of yesterday!
7
Does ScopedLock(mutex); define a local variable (by ignoring the parenthesis, yay C-declarator syntax) or create (and immediately destroy) a temporary object?
7
Q: Concerning RAII: How to prevent errors caused by accidentally creating a temporary?

StackedCrookedA while age a colleague told me he spent lot of time debugging a race condition. The culprit turned out to be something like this: void foo() { ScopedLock(mutex); // Oops, should have been a named object. // .... } In order to prevent situation from happening again he created the follo...

I asked myself that question while reading the above question :)
 
8:30 PM
@FredOverflow local variable by ignoring the parenthesis. int (i); compiles in C. It's the object of the question I linked just above.
 
@FredOverflow depends on the definition of mutex. if is a type, function definition. if it is value, temporary.
 
Whether something compiles in C is pretty much irrelevant in C++.
 
@FredOverflow General rule if it can be parsed as function declaration, it will be.
 
0
A: Concerning RAII: How to prevent errors caused by accidentally creating a temporary?

FredOverflow ScopedLock(mutex); // Oops, should have been a named object. Actually, it is a named object, as the following program demonstrates: #include <iostream> struct Foo { Foo() { std::cout << "constructor\n"; } ~Foo() { std::cout << "destruct...

@AlfPSteinbach What do you say to my test program?
Ah, is it because foo is unknown in my main?
 
@PiotrLegnica, there is a lot of special cases made to ensure that quite a bit of C compiles cleanly. My favorite is what allows stuct stat and the function stat in Unix.
 
8:33 PM
@FredOverflow Yes
 
@AlfPSteinbach Okay, I deleted my answer. Wow, another one of those strange syntactic C++ issues...
So depending on the argument, it could be one of three things: A function declaration, a local variable definition, a temporary object. Weird!
 
@FredOverflow it's not called the most vexing parse for nothing...
 
@AProgrammer Still, I try to keep C and C++ issues separate, and don't invoke C examples for C++ problems.
 
@PiotrLegnica Gasp... Are you saying there is no such thing as C/C++? ;)
 
Makes me kinda sad that C++ basics class I've been on last semester focused mostly on stuff from libc using C++ syntax, and didn't even try to teach C++ idioms (other than side-by-side comparing FILE* and iostream AFAIR).
@FredOverflow Yeah, I know. Blasphemy.
 
8:43 PM
@PiotrLegnica: programming courses have this weird idea that, if they teach you language syntax, it suddenly makes you a developer
5
I took several programming courses while getting degree, and every one of them focused on syntax syntax syntax. Had a java class where students struggled for 3 weeks to understand how to loop through an array
 
@Juliet for (int x : numbers) { ... }, how hard is that?
Apropos range-based for statement, who would have thought that it would turn out to be so complicated in C++0x?
 
Or ArrayIterator if you're going the enterprise way. ;)
 
@PiotrLegnica But it helps quite often to understand why things are as they are.
 
at the end of that course I sent a letter to the instructor that, if it takes 3 weeks to explain arrays, these kids are in the wrong career. I also complained at length that programming is syntax. Syntax is an afterthought
 
@Juliet s/programming is syntax/programming isn't syntax/ right?
 
8:48 PM
/me very unhappy with her choice to go to local university for her degree, felt like a waste of time and money, all she got was lousy bullet point to put on her resume
@FredOverflow: yes, typo :)
/me can't type
 
@Juliet You can correct it for two minutes
With the little triangle that appears when you hover next to your text.
Click it and then say "edit".
 
ack, too late
new to chat doodily-wutzit :)
 
My studies are free, so I don't complain much at quality. I knew some part of it will be boring and oh-I-knew-that-already anyway. ;)
 
@Juliet Welcome :) May I point you to the newbie hints? ;)
 
it ok :)
 
8:50 PM
I don't see free as much of an excuse. They're still taking up years of your life. You'd better get something reasonable in return
 
how are you
 
@PiotrLegnica We had a C++ course that covered SFINAE, that was quite interesting.
 
yeah, we had a course on generic programming and metaprogramming too, That was fun
 
@jalf Oh, there are interesting bits, too. Operating systems is one in this semester. I love operating systems.
 
I remembered looking at the first SFINAE code and thinking "WTF, what language is this supposed to be???"
 
8:54 PM
Templated C++, for all your headache needs.
 
@PiotrLegnica ah yeah, our OS course was awesome
had to write a simple kernel in a 4-week project. That was an... interesting challenge :D
not least because we'd had something like a two hour crash course in C and C++ beforehand.
 
Kernels require more patience than anything. Debugging is painful.
 
we found out!
;)
 
I actually started writing C++ kernel a year or two ago, never had the patience to finish. :P Intel manuals are great, though.
 
ah, ours had to target an Alpha CPU. So at least we had a sane asm language to target
 
8:59 PM
hai everyone
 
howdy
 
hai hai hai jalf
and deadmg
 
ugh
spent ten hours doing group coursework today
 
wow
 
ten hours? what sort of project are you working on?
 
9:11 PM
If I extend a templated class, can I directly specify the template argument?
 
@Nils, what do you mean by extend?
 
like
class MyHouse: public House<Villa> {};
@AProgrammer subclass
 
@Nils There is no problem with that. What did you fear?
 
GPUCloud.H:13: error: expected template-name before ‘<’ token
class GPUCloud:
public Cloud<KinematicParcel>
{};
 
Is Cloud declaration visible at that point?
 
9:13 PM
So Cloud isn't a template. Did you forgot the namespace?
 
uhh
wait
well I included both headers and both are in the same namespace
lol damnit a dumb typo
namespace starts with capital letter, which I missed
 
C++ rule: when error doesn't make sense, look somewhere else. ;)
 
heh
Everybody here seems to have either a cat or a dog! I want one too :D
 
Cats are awesome.
 
cats ARE awesome
+1 for cat avatars
 
9:19 PM
heh
meow :)
I now know why it doesn't find my type, because it's templated again, for whatever reason: foam.sourceforge.net/doc/Doxygen/html/…
"templated" is not even a proper English word..
 
sbi
@PiotrLegnica Loving operating systems? That's like loving cars. I use operating systems. And I#d love them to become better. But loving them for themselves? No way.
 
heh
 
@sbi: I love cars.
 
sbi
Wow, so many new names and avatars here! And 20 of 30 people in the chat are in the C++ room. Ha!, and they keep telling us C++ is dying...
 
I just here because the channel was active
 
sbi
9:27 PM
@JohnDibling Do you? I don't own a car. I don't even drive. And I'm glad I don't have to. Sitting in the tram/bus/underground/train reading is so much more relaxing.
 
I don't know C++, that's like one better than C+, right?
 
sbi
@Juliet No, it's a sibling to ++C.
 
+C+, sucks being a middle child
 
@sbi I don't know, I just like them for some reason. Same with parsers and compilers. Cars are boring. :P
 
@Juliet just like C# but a bit more complicated ;)
 
sbi
9:29 PM
@Juliet Yeah, those sandwich children never turn out any good...
@Nils A wee bit.
 
heh
 
sbi
Too bad. My typos again reveal my german keyboard mapping.
 
I'm wondering how much faster C++ still is nowadays, since I saw Unity 3D which is completely C#
@sbi lol I'm Swiss but insist in using an US keyboard
 
how much faster in a general case? not really sure can really say that
 
sbi
@Juliet Yeah, I see. Most of your answers seem to be C#. :)
 
9:32 PM
CLR langauges are JITed, which can theoretically make the code even faster than precompiled native one in some cases.
 
@sbi: and an inordinate amount of F# :)
 
But you can write slow code in every language.
 
sbi
@Juliet Yeah, saw that, too. Seems your "hobby programmer" is a bit of an understatement. :)
@Nils I've tried, but then typing German (with äöüß being common letters) becomes hard.
 
Customised mapping wins.
 
@Juliet Well for things which need to be fast ;), like computational science or computer graphics. I'm also wondering about memory consumption..
 
sbi
9:34 PM
@Nils Whenever you use a word like "faster", you need to immediately think "compared to what?" Otherwise it makes no sense.
 
Computational science uses FORTRAN, anyway. ;)
 
same algorithm implemented in C++ and C#
 
sbi
Of course, nobody would even think about writing a graphic card driver in C# or Java. But I bet there's scenarios (like many small dynamic allocations) where GC languages win hands down.
Anyway, I only wanted to pop in here before I go to bed. Time's up for me. See ya!
 
@sbi: I'm not sure about graphics drivers, but for what its worth, Microsoft XNA is a managed wrapper on top of DirectX, its used with C# for writing games. In my experience, its "fast enough" :)
Cody Brocious ("Daeken" on hackernews) wrote a purely managed operating system in .NET
I don't know if it ever got off the ground, but the concept is very cool
and he wrote it in Boo, which is the awesomes
 
cool
 
9:39 PM
There are few OSes in C#.
 
ooooooh
I don't follow the OS/kernel scene, so I haven't tried them out
 
MSR's Singularity is mostly in some sort of extended/modified C#.
 
yeah I read the paper about it some time ago, but I think they are not going to develop it further..?
 
Well, it was research project, they may use it for something in the future.
 
@sbi: Sitting on a train is not nearly as exciting as ripping around a corner @ 100 MPH
 
9:46 PM
In C++ you cannot have a class member variable and a method with the same name?
Now I know what the underscores after the names are for..
 
@Nils: No, and I doubt you'd want to.
@Nils: And if your member function is just returning the value in the member variable, just make the member variable public and be done with it.
 
@Nils You can't? I don't think I have ever tried to, it just doesn't make sense to me to do so.
 
Underscores are an old convention for denoting private stuff.
 
@JohnDibling except now you now longer control what it is
 
@Piotr: Underscores are commonly used to denote member variables, regardless of visibility. I do that.
 
9:50 PM
The notion of using Get*() and Set*() functions is just second nature to me
 
@thecosh: often you just don't care, and addidng more machinery to "control" an int is just creating more places where your code might break, for no benefit
 
I don't think I ever use public member variables
 
I use them constantly.
 
@JohnDibling I've seen m_ prefix used for that in most cases. It's a coding style, everybody and their cat has one. :P
 
@JohnDibling I would argue the exact reverse. only allowing access through Get and Set functions means that you can always ensure that the state of you function is ok and sensible
 
9:52 PM
Accessors/mutators only make sense when you really need to do something with the value (clamp or whatever), and don't want to use a custom type. IMHO.
 
You could argue that their is no point controlling this data as some one using your class shouldn't set the values badly
 
int get() { return x; } void set(int x) { x = x; } (pseudocode, shh) is just superfluous for me.
 
@PiotrLegnica But what happens when you decide that that you do need to do something to with in the set?
 
And what happens when you decide that this class should do completely different thing?
 
@PiotrLegnica A lot more twatting around then if you just need to change the internal mechanics
 
9:56 PM
And you can change that member's type to one with overloaded operators, making it a property.
I don't remember having to do this lately, it's mostly just setting/getting a value.
 
@PiotrLegnica you've confused me their. What do you mean making it a property
The notion of properties is a C# thing that C++ (last I checked) doesn't have
 
You can overload operator= and operator T() for a custom class.
But then again, it's a matter of what you need, every approach is good as long as it works properly. :P
 
06:00 - 22:0022:00 - 23:00

« first day (136 days earlier)      last day (4828 days later) »