« first day (537 days earlier)      last day (4409 days later) » 

12:08 AM
@sehe thx!
this one was fun:
 
I'm so close to 10k it's painful :(
especially since I have to go now, and I'm booked all night :/
There's always tomorrow. Later all!
 
10k is overrated.
 
@CatPlusPlus I get more buttons!
 
@MooingDuck does a a break in while(TRUE) {if (true) {break;}}; break out of the while loop or just the if loop?
 
if is not a loop.
 
12:20 AM
@CatPlusPlus True. So I'm guessing it will break out of the while.
 
@LearningC you can break out of loops and out of a switch. it's always the innermost such construct you break out of.
 
@CheersandhthAlf Cool thanks.
 
12:56 AM
I keep telling you to move on but you never do
why is that?
 
 
1 hour later…
2:02 AM
how bad is UI programming in C++
?
 
2:13 AM
any suggestions..?
 
Don't do UI programming
 
haha sadly thats not really an option in this case... I've done it in python and java
my boss would just love it if i came in and declared that i shall not do as he say
 
2:32 AM
oh its that bad...?
 
call your headhunter :P
 
oh damn... but with Qt? or MSVC++?
 
woof woof
 
MSVC is a compiler, it doesn't do UIs.
 
@jozefg it's no problem
 
2:46 AM
Best bet is to use a DSL anyway.
 
DSL?
 
Domain-specific language.
 
The most annoying thing is that you can't do &memberFunc but must write &Class::memberFunc. It's plain stupid syntax.
 
Really, that's the most annoying thing about member function pointers?
 
@CatPlusPlus so ditch c++ go something better for GUI
 
2:47 AM
About C++ for GUI programming. For me.
 
Rapid prototyping is important for UI design. C++ compile times make that painful and annoying.
 
c++ compile time makes anything annoying and painful
 
3:04 AM
argh, y am I still awake
noob mstake
 
 
2 hours later…
5:24 AM
hoo
 
> lto1: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:595
 
LTO never works :| Well, with my bleeding edge snapshots anyway.
 
5:45 AM
lol, generated executable has an average of 426 characters per symbol entry as returned by nm -C.
 
6:01 AM
Man, test program with simple binary visitations takes 1.5s to build with Boost.Variant, 4.2s with my variant :(
1.1s vs 3.4s just to handle the headers, with no semantics in the program.
 
6:19 AM
Ah, my own headers are shorter than the Boost ones but the final preprocessed source for the test program ends up with double the number of lines with my stuff as compared to Boost.
Is there a tool to tell (and sort) where those lines comes from?
 
6:32 AM
Oh yeah, GCC does analysis dependency with -M and friends.
 
@StackedCrooked > WTF is a bookstore?!
 
I didn't know WTF was a bookstore either.
 
Heh, gcc ---usual details go here--- header.hpp -H -fsyntax-only 2>tree looks cute. Not sure how useful though.
 
@DeadMG Erm.. You're too slow? The guy actually had an answer and conducted an orderly, polite conversation.
@DeadMG You may want to pick your battles/review your stance? AFAIR it is not forbidden for certain individuals to enter this room (unless banned, I guess)
 
6:47 AM
Scrolling through a tree of all my header dependencies makes it look like a big towering serpent monster or something.
 
@CheersandhthAlf Lol'ed at
> terrible mistake at 3:15!
 
> Multiple include guards may be useful for:
It's trying to be helpful!
 
@LucDanton I usually do gcc -E and the #line pragmas tell you exactly what source file each line comes from
 
@sehe Preprocessed source is 80k+ lines for the final program. I'm trying to get an idea of the cost of the includes, not where it's from (my library is somewhat sane on that front I think).
Anyone knows Vim magic that can help me?
 
Hmm. I didn't get you quite right then:
31 mins ago, by Luc Danton
Ah, my own headers are shorter than the Boost ones but the final preprocessed source for the test program ends up with double the number of lines with my stuff as compared to Boost.
 
6:52 AM
Well, my own variant.hpp depends on e.g. tuple.hpp and type_traits.hpp. Which one costs 'more' here?
 
I thought you were saying that all those lines magically came from something other than boost? It should be pretty easily grepped (no need to read the whole lot)?
 
Ignore Boost for the time being. I'm gauging my own code.
 
Tuple costs more, because it will definitely use type_traits, is my gut feeling
Aha, I was mistakenly assuming you were mixing your own code and boost. You're actually side-by-side comparing?
 
Oh yeah bad example. type_traits.hpp is everywhere. Still, I'd like to know how much it costs (since it's in fact everywhere).
 
Lemme check
 
@sehe Indeedy. A no-op programs ends up with 80k+ lines and takes 3.4s to compile with just variant.hpp compared to 40k+ lines and 1.5s with the (somewhat) equivalent Boost.Variant headers.
What are the :g/foo/bar/ incantations and the like called in Vim? That I may google/look for help.
Oh, :help :g is what I'm looking for I think.
 
@shiplumokaddim I don't think we do closevote requests in this room. Never seen one. We will moderate all questions related to C++ (sometimes Haskell, C, C# too)
@LucDanton Yes
(@shiplumokaddim well, we do request assistance, but on relevant questions)
@LucDanton well, just type_traits.hpp on boost 1_49 takes 36234 lines for a noop program here
@LucDanton Are you sure the difference is not mainly that Boost is staying C++03 compatible, and as such doesn't include the stdlib <type_traits>, etc?
 
@sehe I dont think I did anything wrong. Its just a request. You are not bound to do that.
 
@sehe Yow, my own brings 3k.
@sehe I have no idea about anything right now. I'm investigating. Well, I will be investigating after some groceries.
 
@shiplumokaddim You barge into a room where you never even said Hi, and start posting tags that we just don't use.
@shiplumokaddim To me it looks like a very cheap scam to get attention.. This is usually referred to as spamming. Thank you very much
@LucDanton Cheers
 
7:02 AM
@sehe Yes, I know. In that case just flag the message.
 
@shiplumokaddim Really? I think it is polite, and hopefully just as effective to talk about it as grown-ups do :) Cheers
 
7:25 AM
morning all
@sbi A robot would not 'have the urge' to do anything. It would simply do what it had been programmed to do
 
@thecoshman How are humans different?
 
@StackedCrooked (With in reason) humans can't be programmed to do things completely unconditionally. Even with the must inhuman mental conditioning, a person is still has the (possibly apparent, but lets no go there) free will to break with the 'training'
 
@shiplumokaddim FYI
 
7:40 AM
Or where you getting more that fact we have evolved to act in a certain way?
> Total €18.36
living in Euro zone sucks :(
 
@thecoshman Even more basic: causality.
But I don't want to start a lengthy discussion about this :)
 
@StackedCrooked not sure how that relates, or perhaps I am not remembering causality correctly. The notion that every thing you do will results in you having to do something else?
roughly speaking
 
@thecoshman Yep, "action and reaction" is how some refer to it.
 
@StackedCrooked yeah, not sure how that relates though. Though it is odd that we have this perception of free will. I like think we really do have free will, that are actions are not predetermined, but as long as I can continue with out any real reason to doubt this, I see no reason to worry about it
 
7:56 AM
hi all!
 
so just read about notch's plan to put a virtual 16 bit cpu in his new game
I wonder how low level he will leave people. Would we start of with just assembly and have to implement everything from there. such as C++ compiler
 
8:24 AM
@StackedCrooked Do you think we have imprinted the idea of 'room-full-of-pedants' enough to scare the PHP kiddie away?
@StackedCrooked suggesting a causility right there
 
@sehe ahhh PHP, my first steps in programming, if your going with the notion that HTML is not programming
damn, I need sort out all these reminders. For each meeting, I get reminded by Outlook, SameTime, my phone and Google Calender joins in half time as well
 
8:41 AM
Why terminate() is calling with this:

http://ideone.com/lpsXJ

?
thanks!
 
you are throwing an exception but nothing is trying to catch it
any code that can throw should be in a try block with a catch block to handle any thown exceptions
also, the this-> is implied and you do not need to use it, unless it is to resolve ambiguity
 
Ell
hi guys
 
@thecoshman thanks a lot!
@Ell hi!
 
@thecoshman depends on what you want to happen. If you want the program to std::terminate, you don't have to handle exceptions
Also, you must be talking to our invisible friend again :) All I see is you talking in this room.
 
8:58 AM
@sehe Why am I invisible?
 
Ell
did someone just say something? I swear someone said something. Meh. Nevermind.
 
@user1131997 probably a reference to that fact you ask a question and then seem to run away for a while, it's no a problem to me. I don't expect people to report there every move
> Private class variables should have underscore suffix.
yay or nay?
 
@thecoshman whatever floats your boat
 
@sehe I was after your (the room in general) input on it... or is that all you have to say on it :P
 
@thecoshman I use it in some projects. I don't in some other projects.
 
Ell
9:09 AM
@thecoshman I tend to prefix private class members with a lowercase m, then use pascal case for the name
int mLength;
 
The thing is, it is a good idea to be consistent. Underscores are just fine except on global or namespace level names (there they are reserved for the standard library implementations)
 
Ell
I just find underscored ugly :L
 
I like to use m_someMember
 
Ell
oohh thats the worst of both worlds haha
 
@Abyx I'd not do that, since it combines the cost of both naming schemes
 
Ell
9:12 AM
and how can you live with someMember? why is the first letter so special! aghhh SomeMember is much better for me :P
 
Honestly, when I'm to decide, I usually do _member
 
It's really useful when you are trying to find all usages of that member
 
I can see the logic in having some sort of suffix or prefix to indicate private variables, but I personally try to avoid needing to. so I would aim for something like setLength(int value){length = value;}
 
Ell
@thecoshman or just don't use a setter/getter ?
 
@Ell simplified example :P
 
Ell
9:12 AM
thats the thing actually, I still can't decide wether to use getters/setters
I know its bad to use getters/setters when its just going to change the private member, I just hate the inconsistency when I need a getter/setter to do something#
 
if you need to put some sort of constraint on variable, such as making sure length is never less then width, you need a setter
 
@Ell Why would the lowercase first character suggest it is special? Rather, it makes it unspecial, since it confirms that there is no need to mark the word boundary since it isn't inside an identifier. That leaves you more room to encode information (such as: UpperCase for public members, lowerCase for privates etc.)
 
I used to use someMember for a long time, but if it's a name like size, you find a lot of local variables, argument names and other stuff, so m_size allows to filter'em out
 
@Abyx ?! That doesn't depend on the particular convention. It depends on consistency and tools used for searching
@Abyx Fair point. Doesn't work as well for public members, though
 
Ell
@sehe fair enough actually, but I would rather use m for member, sv for static variable etc.
 
9:15 AM
@sehe I often use plain old "Find" window
(VisualAssistX is great, but in complex cases it often miss some of usages)
 
@Abyx plain old.... 'window' :) I use vim and sometimes ctags with that
Oh and in new codebases, I might jump into eclipse CDT sometimes to browse around
 
hang on a sec... am I missing something here, but is not 0x1 not the same as 0x01
 
@thecoshman it's same
 
@thecoshman they're the same
 
that's what I thought...
 
9:20 AM
01 is the same as 1, 07 == 7, but 010 == 8
 
perhaps by 0x1 they mean 0x10...
 
Then they should go back to first grade and learn about numbers
 
oh wait, I see what the doc means
 
Ell
why do we need the leading 0?
 
@Ell In 0x... you don't, in the numbers sehe posted, a leading zero actually means octal notation
 
Ell
9:23 AM
ohh I see
 
yeah, as in 0x5 + 0x5 = 0xA or in decimal numbers 5 + 5 = 10
 
or in octal 05+05=012
 
@KillianDS actually, 0x mean hex, just a single 0 means octal
wait, never mind
I was looking at my own post rather then sehe's :P
 
@thecoshman of course
 
Ell
or 101 + 101 = 1010
:L
is that right?
 
9:28 AM
101+101 is just 202, you can't express binary in c++ I think
 
@Ell technically, no. 101+101=202. Though I get the feeling you mean binary, I forget the conventional prefix for that, but as a binary add you are correct
 
Ell
yeah I meant binary :)
I tried to get quick at hexadecimal arithmetic but I couldn't :L
 
it usually easier to think of the numbers in decimal, or don't do it in your head
 
Ell
and I get confused about the most significant bit in binary
and big/little endian >.<
 
@thecoshman Imho, it depends, when bitmasking or when working with byte-aligned numbers hexadecimal is much easier. But for general arithmetic, yeah, go with what you're used to
 
9:33 AM
@Ell normally, the left most bit. Though it gets confusing when numbers are moved around
 
Ell
yeah. I don't generally deal with that much though anyway so its all good:D
brb
 
big/litle edian is just one of those things you need to be aware of, else it will byte you in the arse
 
@thecoshman And then you decide to leave serialization up to a library that handles that for you and you don't worry about it anymore
 
Ell
back :)
haha byte you :L and I still don't really get it >.<
 
@thecoshman Figuratively speaking.
 
9:58 AM
normally, you would right a numbers from the biggest digit to the smallest, such as Hundreds, Tens, Units. It ends in the smallest 'unit' so is little endian
big endian is sort of the opposite
if we have a (binary) numbers 1101 0010 and converted it from little to big endian we would get 0010 1101, at least that is what I understand to be the normal convention
 
Ell
ohh
hmm
meh
 
yeah, it's not nice
the reason you get it is things like sending data over a network
 
Ell
10:14 AM
yeah
are there reasons to use either one?
or are they just different?
 
they're just different and dependent on processor/architecture
 
there are probably pros/cons for both, but it's beyond me, all I know is you need to know it is out there waiting to fuck you over
 
@thecoshman endianness is usually significant on byte level these days, not on nibble level.
 
@KillianDS the same principle though
 
Ell
i dont understand why everyone doesn't just use the same?
 
10:25 AM
@Ell Historical mostly. If you look at big-endianness it makes sense because all bits are in the right order. When you want to add them all at once you have no problems. Hwever if you want to add byte by byte, you have to start with the last one, remember the carry, go one byte back, repeat. In little endian they're in the right order for this.
On modern hw I don't think there's any practical advantage for the one or the other. Everything will be mapped as efficiently as possible in the registers anyway.
 
Ell
yeah
 
In networking there might be preferences to get the least significant or most significant part first (e.g. to start routing as soon as the first byte is in). Usually it comes down to big endianness there, but exceptions exist
 
am I right in thinking that little endian is the order we rite the binary, so the left most bit is say the 512 and the right (last) bit is the 1
 
ehm, when it comes down to bit numbering most people use a little-endian scheme yes (we usually call the least significant bit "bit 0"). This is little endian because the bit is at the lowest "address". However this has not necessarily anything to do with internal representation.
 
Endianness is about byte order, not bit order.
 
Ell
10:35 AM
yeah
i was just about to say :L
 
Bit order can be handled transparently, because bits aren't addressable.
 
Ell
thats why it confuses me, because to me it makes no sense to re-order bytes. What is the equivalent of that in decimal?
 
next to that, in most architectures the left most position is usually the one with the lowest address, so your example is big endian, not little endian
 
Bytes are not decimal.
 
@CatPlusPlus Actually it is kinda an issue in many telecom protocols
 
Ell
10:37 AM
@CatPlusPlus I know but I mean is there an equivalent of it in decimal?
 
Whatever. It's low level.
@Ell No, why would there be?
You're comparing apples to oranges.
 
Ell
I don't know :O
thats why I asked :L
 
@Ell It has no equivalent in decimal. Actually there is not even an equivalent in binary
endianness has nothing to do with the number system, it's a data serialization thing
 
Ell
do you think I would ask if i knew the answer?
(trick question)
@KillianDS okay that makes sense
 
erm, what is the difference (if any) between writing struct word{char upper, lower); and writing struct { char upper, lower } word;
 
10:42 AM
the first defines a user-type word, the second a variable word.
 
Neither compiles.
Har har.
 
¬_¬ let's ignore minor typos
 
It's a definition, not just declaration.
 
@CatPlusPlus indeed it is, corrected.
 
The second defines both a type and a variable.
But the type is anonymous.
 
Ell
10:46 AM
can you do struct word{char upper, lower} my_word;?
 
yes you can
 
@Ell I was just about to ask this very thing :P
 
Ell
haha
 
For that matter you can do struct word { char upper, lower; } word;.
 
That's the reason for the semicolon after type definition.
 
10:48 AM
@LucDanton word that not have problems with 'word' being used as both a type and variable name?
 
@thecoshman I think you worded a word here.
 
word bird;
 
Ell
lol
 
o_0 I don't get it
 
@CatPlusPlus I dunno, I think it works better the other way around.
@thecoshman 'Would', not 'word'?
 
10:50 AM
@LucDanton ...in bed!
It's holiday, let's go full silly.
 
oh god damn it
now I see it
 
Of course, it's a holiday that'll be spent on not sleeping and database project.
And for what, a stupid three letters in front of the name.
 
And no, there's no problem. In general there's no ambiguity where a type is expected as opposed to an expression (which will make use of the name of the variable). For those cases where there is an ambiguity, then struct word distinguishes the type from the variable. You know, like in C.
 
what's an opaque pointer? something like a copyable unique_ptr?
 
void* and friends.
Or a pointer to an incomplete type.
Something you can pass around, but not dereference.
 
10:59 AM
oh void* you crazy little thing you
 
@CatPlusPlus hungarian notation is so outdated :) phdCatPlusPlus?
 
Right, because I'd have patience for a PhD. I'm barely alive on BSc.
We have "engineer" as a title for that level here, and the abbreviation is put before the name.
 
You use engineer for what level?
 
BSc. Sort of.
And there's also non-engineer BSc, which has no special title AFAIR.
 
how it's better to make callback functions?

http://ideone.com/7dcRH - could you look at code, please?
 
11:09 AM
Yeah, we have something similar (only the title is linked to MSc). I used my title exactly once up until now and it didn't even have to do anything with my profession. For interviews they just looked at what I studied and did beyond that, not which letters are in front of my name
 
Ell
@user1131997 for callbacks use std::function maybe
 
@Ell I want to make a bicycle "own callback", not the ready one.
 
Ell
a bicycle?
 
@Ell yeah, it's an idiom for action , when you don't want to use ready-done stuff and do it again by yourself
 
Ell
oh :L never knew that
 
11:17 AM
for example, C don't have RTTI, but you can do it yourself
@Ell it meant, that bicycle has been already developed, and who want to repeat the devepoing process will ba named as bicycle-developer :)
 
@CatPlusPlus Same in Holland, then: Ing. or Ir. depending on the field of expertise (meaining engineer)
 
Ell
haha kk
 
@user1131997 the actual term for that is "reinventing the wheel". And except for some specific learning purposes it has no use whatsoever.
 
@KillianDS sorry :) in russian the translation of the idiome about wheel was converted to bicycle ( why? don't know :) )
it would be in russian: "you are trying to develop the bicycle again!"
 
@sehe Are they really used in Holland? We also have those in Belgium but I see them seldomly used.
 
11:27 AM
@KillianDS On business cards and CVs
 
@KillianDS Those letters are very important. Ask anyone with a doctorate.
 
Ell
@user1131997 ahhh reinventing the wheel, I understand now :)
@sehe am I right in saying in holland, being an engineer is a very high status?
 
In Holland, being high is a status.
(I'm probably mistaking some countries here, but whatever.)
(It's Friday.)
 
Ell
:L
 
@Ell not really. Half the people I know are Ing. or Ir.
 
Ell
11:33 AM
@sehe never mind :L
 
@CatPlusPlus haha
 
Ell
@sehe here in the uk we call "Garbage men" "refuse disposal engineers", so here engineer means practically nothing
 
@Ell tongue in cheek
 
No, I got that right.
Yay me.
 
Ell
anyway must dash bye bye
 
11:35 AM
@CatPlusPlus What?
 
The country.
 
@Ell they want to be called that :P
 
@CatPlusPlus Important for what? I know in some industries (mostly chemics) a phd is a prerequisite for certain jobs/career paths. But as far as I know that are more or less the exceptions.
 
Important for HOW DARE YOU NOT ADDRESS ME WITH A PROPER TITLE WHARRGARBL.
 
haha :)
 
11:40 AM
can I use an int in a switch, with enum values as cases? such as switch(myInt){case myEnum.valueA: break; }
 
With old weak enums, yes, and no scope for enumerators.
And no, don't do that.
 
erm... lets try asking this another way. I am getting a number, I want to be able work out what enum value that would be
 
Well, depends on what you're doing, I guess.
 
@thecoshman you should be able to static_cast if you're sure the integer is in the range of the underlying enum values.
especially if you make a strongly typed (not necessarily scoped) enum.
 
You can't have unscoped strongly typed enum.
 
11:43 AM
@rubenvb so myEnum option = static_cast<myEnum>(intRepresentingOption);
 
enum class is always scoped.
 
@CatPlusPlus can't you do enum bla : int{};?
ah, with strongly typed I meant specifying the underlying type.
 
@rubenvb That changes the underlying type, but doesn't change the semantics.
 
@thecoshman I would use that.
 
You can still convert implicitly back and forth.
 
11:44 AM
mawnin
 
I want to go to sleep. :.
 
so with out having to do anything special, I can just use int i = 1; myEnum option = i;
assuming myEnum has a value for '1'
 
@thecoshman not sure, might need a cast. Check ideone for that, or try it with -pedantic -Wextra -Wall and see.
 
it seems not. How can I do what I am trying to do here? ideone.com/j2ozu
I want to be able to use it for a switch statement
 
11:52 AM
ideone.com/onEDK huh, I guess I can do what I want to do after all
 
@thecoshman in this case you need a cast. C++'s strong typing kicks in here.
in the switch, there's an implicit conversion. That's why I said try what you want to do and stick with that. I don't try to get my head around all the rules here.
 
Heee heee, "C++'s strong typing".
 
stronger than plenty of others
 

« first day (537 days earlier)      last day (4409 days later) »