« first day (386 days earlier)      last day (4554 days later) » 

11:00 AM
@FredOverflow by the time i am gonna win the bet, 1000 euro wont be worth anything anymore, so I have to decline
 
But seriously, don't ask for a reason. German is just one special rule after another after another.
 
Can anyone suggest me some easy to use GUI library for C++ , which I can learn in less time? ( I've never had any experience in windows programming , so no knowledge of events handling process or message pumping etc:( )
 
QT
 
WxWidgets is meant to be good too although I've only really used Qt and Gtk of which Qt wins any day
 
11:01 AM
seriously ? , QT is very big library , and learning it shall take long time :(
 
You don't have to learn an entirely library before you can start using it.
 
Qt has a nice GUI designer tool that makes UI design quite easy and the signals/slots mechanism is fairly straightforward
 
There are parts of the STL that I've never touched, yet I'm happily sorting and searching my vectors.
 
yeah, i am quite new to programming and used Qt for a small experiment and it really went quite well
 
sbi
@FredOverflow That's a good idea. Would you do this?
 
11:05 AM
@sbi I wouldn't know how, but I could certainly try :)
 
@awoodland GUI designing is easy task but handling events and doing actions according to it hard, isn't it? , what wins in easy to use? Gtk or WxWidgets ?
 
sbi
@FredOverflow And Björn, who's here sometimes.
@FredOverflow You wouldn't know how what?
 
how to add another wiki entry, but that can't be too hard :)
I'll get to it later, after eating.
 
sbi
@FredOverflow The welcome page has a "new page" button right under an edit box for the page's name. That seems pretty obvious.
If you lack the rights to do this, you need to ping the @Cat.
 
"C++ is a language that inspires passion." - Kate Gregory
100 % true
 
11:08 AM
passion for hatred amongst many ;)
 
@sbi Can I call you "oldman" ?
 
User& grumpy_old_man = sbi;
 
QT library size -> 1.6 GB , greater than MS Visual studio even :D
 
sbi
@Mahesh You can always try.
 
11:10 AM
@sbi Btw, thanks for the blog post on videos link. @FredOverflow helped in finding it :)
 
I just googled it.
 
sbi
@FredOverflow Hey, I ought to be const, I'm not that flexible anymore.
 
lol
 
sbi
@Mahesh Actually, this was @Fred's doing, I just put it up there because the question got closed.
 
Immutable old man
yeah, I see it in your description.
 
sbi
11:12 AM
@Mahesh Well, one could argue whether "grumpy" is a synonym to "immutable"...
 
@sbi At least for what you said - " ... not flexible any more"
 
@Mahesh you can call him pa too (if he agrees) :D
 
sbi
@user411102 I doubt he would. He has way too many kids already.
 
@sbi "pa" is nothing unofficial. Just a synonym to "Dad", if you don't know it
 
sbi
@Mahesh Why do you think I mentioned "kids"?
 
11:16 AM
@sbi A second late in the chat.
Btw, I am a bachelor
 
@Mahesh atleast it made sense to you , why behaving like C++ std guy like you need everything standard written
 
waiting to marry a beautiful girl
 
sbi
@Mahesh A second is an eon to a C++ programmer. :)
3
 
@Mahesh was joking , i think it offended you
 
sbi
@Mahesh Don't master students also want to marry beautiful girls? :)
 
11:18 AM
@user411102 - the event handling and doing stuff once you've designed it is made quite easy by a) great documentation and b) signals/slots mechanism which is simple and universal in Qt.
 
@sbi Yeah. I definitely want a beautiful girl but the problem is I amn't sure I will get what I want ;)
 
@awoodland Thanks , i'll look into QT then
 
is GMan's answer to stackoverflow.com/questions/8026170/… the intention of the standard? Or would the retFun4() example also be a plausible way for a compiler to synthesize the things it needs to for a lambda?
 
sbi
@Mahesh I'd rather worry whether what you want would be good. Having been married more than once (plus having many kids), I can assure you:
There are way more important features in a girl than the makeup of her outer shell.
5
 
@sbi Even though I just registered and logged in, I get the following error:
> Sorry, you can not create a new page in this category. Only members of this site, site administrators and perhaps selected moderators are allowed to do it.
 
11:23 AM
@sbi True. Even my mother says, it's difficult now a days to find a girl who is good at heart and nature.
@FredOverflow How the marriage works in Germany ? Does the parents look a girl for the boy or the boy is on his own ?
 
I just cleared the caches and tried again. Same error message. Isn't it great when you want to be creative, but technology doesn't let you? ...
@Mahesh People fall in love and then marry. Parents have no saying.
@sbi I just sent an application to you ;)
 
@FredOverflow At olden times, in India, parents take care of finding a match for his child. Slowly the custom is changing though.
 
And what would you prefer?
 
I still go with my parents. And it's what happening to my brother. His marriage is coming and is the reason I am flying to India.
hi
 
11:28 AM
Well, it certainly sounds easier :) What happens if your brother doesn't like the girl? Has he met her yet?
 
I dread to think who the wife my mother would have picked for me would have been
 
@FredOverflow Yes. They meet during the family talks during the engagement.
 
@awoodland quick question please :) When do I use ntohs and htons?
Am I right in thinking the server uses ntohs?
And the client uses htons?
 
@FredOverflow It's bit complicate to understand. How can you just a girl just once or twice and decide she is your life parter, is what many ask. And they are correct but that's how it works. Though if we find a girl, not many parents agree for that because of caste and religion problems.
 
man that sounds so scary to my western brain
 
11:31 AM
@LewsTherin always use ntohs when receiving data. (n=network, h=host, s=short). always use htons for sending
then everyone gets things in the order they expect
on some systems they will be a noop if the host byte order is the same as the network byte order
 
Does that mean the server and client can use both functions whenever necessary?
 
@FredOverflow And if parents dont agree, they elope.
 
@Mahesh it really must be hard for you coming from the USA and seeing the exact opposite
 
@Mahesh We don't have the concept of "caste" in Germany, and religion isn't quite as important as well.
 
@LewsTherin yup - they're for RX/TX operations, not client/server, since any one or more of client/server could be little/big endian
(they're probably macros, not functions though)
 
11:33 AM
@bamboon I have been here just for 3 years. So I don't think I expect any strange things
@FredOverflow Well said.
 
I have to go out soon.. so if I don't reply back that's why :(
Em, htons is used to convert port numbers for a socket structure to use. Why would I need to use ntohs on a client program? :S
 
@lews - it's used to convert port numbers because they happen to be a short on those systems.
you use it anywhere you want to send a short across a network and have it make sense at the other end regardless of the endianness of the two hosts
port number just happens to be the first place you care about getting it right
 
No sorry, I know the reason for htons. But I don't know the reason for ntohs...
htons refers to the client..
so ntohs refers to the server?
 
@sbi Do you read me? I need permission for the Wiki :)
 
htons is host to network byte order conversion
 
sbi
11:38 AM
@FredOverflow I was working at the model train of one of my sons. Will do now.
 
ntohs is network to host
there is no client/server in there in general
 
I have to go now... I will be back later. Sorry
 
@LewsTherin ditto, probably not before 3 GMT
 
sbi
@FredOverflow Apparently I'm not an admin: loungecpp.wikidot.com/system:members
I'm not sure I can do anything for you.
 
@CatPlusPlus I want to be a member of the Wiki :)
 
11:40 AM
good day fellas
 
sbi
@FredOverflow Yep.
> This tool is for use by the administrators of this site
Sorry, can't help you there.
 
what's the subject of conversation today?
 
marriage and network protocols
 
sbi
Apparently, the @Cat's still asleep. You need to wait for the evening, cat's are creatures of the night.
 
Well, I can already prepare the content. The [[[ link | text ]]] syntax is really weird :)
 
sbi
11:42 AM
 
@sbi oh damn, hope he's ok
 
sbi
@TonyTheLion He's fine, staying with friends. He's just a bit pissed that he had to leave his house even though the wall they're afraid of is one or two kilometers away. A grumpy old man, as they say. :)
 
any one gonna marry a network protocol then?
2
@sbi good to hear he's ok
oh wow
I guess grumpiness is part of the family?
 
sbi
@TonyTheLion :)
 
lol
anyone doing anything exciting today?
 
sbi
11:46 AM
I'm constantly watching earthquake-report.com/2011/09/25/…, though, being afraid I'd miss something. That's an island. If a really bad quake strikes them, it's likely that communication will be cut off and I won't be able to hear anything from him for a while.
Anyway, I need to get back to my son and his trains.
A promiss is a promiss.
 
@TonyTheLion I'm moving the C++ video list to our Wiki :)
 
@FredOverflow oh yea that's a good idea
I've never looked at the wiki, I did just now and there seems not much to be found there
most people here are probably not aware of it's existence
I actually forgot it was there
 
Em, right back again...
@awoodland I think I understand how inet_pton/ntop works. It is to convert from human readable ip format to what a computer understands and vice versa yeah? Is that what htons and htons do as well
 
@LewsTherin - it's not about human readable or not with ntohs and htons
it's about answering the question "in a heterogeneous network environment there will be hosts with little endian and hosts with big endian byte order, how can these reliably talk to each other?"
 
Ok, so computers store data differently big/little endian. I get that. We use htons to solve that problem.
But when do we use ntohs?
 
11:55 AM
to which the answer is: "if we define a single byte order for data on the network then it's up to the individual hosts to ensure they only send in this network byte order and when they receive network byte order data they convert it to host byte order if needed"
say I have struct foo { short s; };
and I want to send that across the network from host a to host b
and I'm running my software
but I don't want to worry with "is each host the same byte order?"
you would do htons(foo.s); before sending to ensure you send in network byte order
and ntohs(foo.s) on the receiver to ensure that what you receive is in the right byte order for that host
that way you don't need to care if a and b are already the same endianness or different
because you have a standard byte order for everything on the network
and everybody can assume that all they need to do is send and receive in that byte order
which for sending is htons (host to network)
and receiving is ntohs (network to host)
but the act of sending and receiving is not the same as being a client or a server
clients send requests to servers and servers send responses to clients
 
So why do we use s_addr = htonl(INADDR_ANY)
Are we sending the ip address?
 
yes
the IP address (of both ends) is sent in every packet
 
Oh, the ip address are in the datagrams?
Ugh.. I see
inet_pton/ntop are not for sending and receiving though..
 
inet_pton does the char* -> address conversion, but it always returns the result in network byteorder too
 
Wait one more question.. how come we aren't using htons htonl for every data we send?
Actually one of many more questions lmao
 
12:02 PM
You only need it for multi-byte data types.
 
if you just send a char you don't need it.
you should use it for anything you send other than char
gotta run
 
don't forget to compile first!
 
Ok thanks, bye! Take care :)
@FredOverflow what does that mean?
 
@LewsTherin It means you don't need it for a char, but you need it for short, int, long, long long etc.
 
Yes, but why? A char isn't automatically in NBO is it?
What about a string? Would I need it?
 
12:10 PM
@LewsTherin How can a single byte not be in the correct byte order?
And strings are always stored first character first.
 
@FredOverflow Um, won't a char be stored in the endianness of the machine? So it isn't always in big endian format?
 
@LewsTherin Endianness concerns the byte layout of multi-byte types.
If you only have a single byte, the question of endianness simply does not arise.
Imagine you are very rich, so you buy several adjacent houses on Evergreen Terrace 1-7. Is the most valuable house on Evergreen Terrace 1, or on Evergreen Terrace 7? That's a reasonable question. Now what about the Simpsons, they live on Evergreen Terrace 742. Where is their most valuable house located? The question doesn't even make sense. There is only one house!
 
@FredOverflow I see...
 
> The most common cases refer to how bytes are ordered within a single 16-, 32-, or 64-bit word, and endianness is then the same as byte order. The usual contrast is whether the most significant or least significant byte is ordered first — i.e. at the lowest byte address — within the larger data item. A big-endian machine stores the most significant byte first, and a little-endian machine stores the least significant byte first.
 
So 4 is a byte format, while 42 is a multibyte format
@FredOverflow What did you mean by this?
 
12:22 PM
@LewsTherin If you send the string "hello" over the network, nobody in their right mind would send the 'o' first.
@LewsTherin What? No, bytes range from 0 to 255 on our everyday machines.
 
@FredOverflow Really? There aren't many sane programmers out there...
@FredOverflow 4 and 256 then lol
 
@LewsTherin Yes, let's consider the number 256 which is 0x0100 in hex. It consists of two bytes, namely the high-order byte 0x01 and the low-order byte 0x00. Now, should we send the high-order byte first (big endian), or the low-order byte (little endian)?
As it turns out, networking order is big endian. So if your computer is not big endian (as is the case with x86), you must convert.
 
@FredOverflow I think I understand now, thanks -_-
 
And since you want to encapsulate that "Do I have to convert?" decision, you simply call htons before sending and ntohs after receiving, and the library will do the correct thing according to the underlying platform.
 
I hate network programming
 
cpx
12:27 PM
Do we have to check if we need to convert?
 
No, that is implicitly done in the htons and ntohs functions.
 
So when we receive a packet, it's port/ip is in network byte order. We use ntohs to read the port number of that packet
 
We use ntohs to convert from network order to host order.
And since the port number is probably a 2 byte number (right?), the conversion is necessary.
 
@FredOverflow Yeah it is
 
Otherwise, 256 (0x0100) may be end up being interpreted as 1 (0x0001) on x86.
 
12:30 PM
What? It thinks it is a byte?
:O
how does one think in binary?
 
256 does not fit in a single byte. Bytes only go from 0 to 255.
 
Yeah, but I would assume it would interpret 256 as something else instead of 1
 
By the way, these conversions are so important that x86 has dedicated hardware support for them: xchg al, ah for 2 byte numbers and bswap eax for 4 byte numbers.
@LewsTherin Why? If you swap the bytes in 01 00 you end up with 00 01.
This isn't binary, by the way, it's hex.
 
I really have to go now, ttyl. Thanks.
 
sbi
1:05 PM
@TonyTheLion Oops. Is there anything besides the newbie hints?
 
@sbi no, not that I can find
 
cpx
in spec it says we can't have a pointer to cv void if its member of class.
 
1:23 PM
@cpx that means void X::* is forbidden
 
@JohannesSchaublitb is that a pointer to void in class X?
 
cpx
but it has no cv qualifier?
 
syntax always confuses me
 
cpx
Hm, I was doubting if it is const void* X::
 
@cpx cv void means any combination of cv specifier, including none
 
1:26 PM
oh
 
cpx
oh i see
it is less cv qualified
 
sbi
@TonyTheLion Well, it was set up in order to have a place to put the FAQ, so I'm not surprised there's just the FAQ there. OTOH, it is a place to put information, and I'm not at all opposed to make good use of it, if you can come up with such a use.
 
1:42 PM
0
Q: Are there no specializations of std::hash for standard containers?

FredOverflowI just found myself a little bit surprised being unable to simply use a std::unordered_set<std::array<int, 16> > test; because there does not seem to be a std::hash specialization for std::arrays. Why is that? Or did I simply not find it? If there is indeed none, can the following ...

 
1:54 PM
@DeadMG Boost.Exception has that.
@FredOverflow Done.
 
@CatPlusPlus Can someone "sticky" this like the newbie hints?
 
What do you mean?
If you want it on the start page, or the top menu, just edit them. :P
 
Well, the newbie hints are stickied (with 7 stars) right here in the chat.
 
Oh, that.
 
I thought we could do the same with the video list, or is it simply not as important?
 
2:00 PM
You can do that, message menu > pin this message.
 
I can do that to my own message?
 
Indeed I can. Cool!
We can leave it up for a few days, and if people feel it's not important enough, we can take it down again. Let's see if anybody notices at all :)
 
hmm
the videos by that haskell/c++/multithread old guru guy are missing from that list
you know, the guy talking about monads at the boost meeting
 
Is he a celebrity, and is the video awesome? :)
Ah, you mean Bartosz?
 
2:07 PM
Bartosz Milewski ?
 
Yeah, I could add that. He also has a series for concurrency in C++11.
 
Good idea, I'll add him!
@JohannesSchaublitb I added three videos. I found two more, but they didn't seem to be C++ videos.
 
3:11 PM
hi
@FredOverflow hiya, I'm back now... And I have some questions if you are interested lol
 
As long as it's not about byte order again...
 
@FredOverflow I'm afraid it is :( ... Why not? Bits and bytes appear to be your thing..
 
Well, what else is there to explain?
 
You said 256 0x0100 may be read as 1 in little endian
I don't understand why? Why would it read only the first byte..
if it was 0x0010 in little endian for example, in big endian without the conversion would it read only 0x00?
 
It wouldn't. It would read both. But the second one would be 0.
No, there are always two bytes. What is uncertain is only the order.
Take this non-portable program:
union
{
    unsigned char a[2];
    unsigned short s;
} u;
u.a[0] = 0;
u.a[1] = 1;
std::cout << u.s << std::endl;
What do you think it will print?
 
3:23 PM
I don't know what unions are.. but is u.s valid?
I mean it doesn't have data in it, well garbage
 
union means that a and s start at the same address in memory.
 
So you u.s should print 01?
 
Why 01? std::cout would never print leading zeros.
It prints 256 on my computer, because 0x0100 is 256.
But it would print 1 on a big endian computer, because 0x0001 is 1.
 
So it is how it is computed
 
short quesiton
 
3:29 PM
It's how a short is laid out in memory. Does the high order byte come first (big endian), or the low order byte (little endian). That's what endianness is about.
 
@FredOverflow But it is computed in the order in which it is laid out in memory. Hence the different results?
 
is assigning a char = 0 not wrong and it should be = '0'
 
@bamboon It is casted implicitly, no?
 
Assigning 0 to char is perfectly fine, it is the same as '\0'. Assigning '0', however, is the same as assigning 48. Assuming your computer uses ASCII.
 
ah ok thanks
yeha ascii stuff
what was the beep again?
7?
 
3:32 PM
Um, @FredOverflow I assume it is then?
 
@LewsTherin What?
 
"@FredOverflow But it is computed in the order in which it is laid out in memory. Hence the different results?"
 
It is computed depending on the byte order used.
If you see the following bytes in memory:
01 02 03 04
Assuming those 4 bytes represent an int, then what number is that, 0x01020304 or 0x04030201?
 
It depends, see your point.
 
right
 
3:37 PM
Thanks for your help. I need to work on my binary/hex
Can you unions have more than 2 fields?
 
As many as you want.
 
So do all fields point to the beginning of the union?
 
All fields start at the same address.
 
That sounds senseless to me. I don't get that.
How would it get the correct value of each fields?
 
Oh you only have one value at a time.
If you change one, all others change as well, probably to some binary crap.
Does your C++ book not teach unions?
 
3:41 PM
:S What's the point? Why would anyone use that? I didn't get that far :(
I have to learn Java now :)
 
In computer science, a union is a value that may have any of several representations or formats; or a data structure that consists of a variable which may hold such a value. Some programming languages support special data types, called (somewhat confusingly) union types, to describe such values and variables. In other words, a union type definition will specify which of a number of permitted primitive types may be stored in its instances, eg "float or long integer". Contrast with a record, which could be defined to contain a float and an integer; whereas, in a union, there is only one val...
 
@FredOverflow Thanks
@FredOverflow how many do CS in the year you teach? Roughly..
 
Hm, about 400 I guess.
 
@FredOverflow Jesus, wtf! 400? Are they doing pure CS, any dropouts?
 
We have 5 or 6 different study paths (?), and the dropout rate is about 20% in the first semester.
 
3:53 PM
@FredOverflow by CS you do mean Informatik?
 
Computer Science
 
@bamboon yes
 
400 is acutally not that much
 
Crazy, that's still a lot.
 
which uni is that?
 
3:54 PM
Hamburg
We have normal CS, economics/CS, software system development, computing in science, computer human interaction, and teaching. And all of them have to do the Java course in the first semester.
 
do you guys also have electrical engineering combined with CS?
 
Are those separate courses, or just one course with those modules?
 
@LewsTherin Those are "Studiengänge". It's what you study and what you graduate in.
 
@FredOverflow So the students choose only one of them, and focus on it?
 
Yes, you pick one and apply for it.
 

« first day (386 days earlier)      last day (4554 days later) »