« first day (685 days earlier)      last day (4264 days later) » 

11:00 AM
is little endianness unusual ? or I used to have unusual flavor before ?
 
Xeo
both little and big endian are common
 
@Xeo I love the use of 'cooked' as the variable name
 
Xeo
opposite of raw for me :)
It's also used for textures and stuff, atleast by the unreal engine
 
or may be I remember I parsed char* to structs before but never faced problem like this. shouldn't I face the same problem before ?
 
Xeo
and for user-defined literals
 
11:02 AM
@Xeo Now the question to me is why didn't I face this problem before ?
 
Xeo
@datenwolf: This is a common misconception - there can not be any cyclic ownership problems between data structures. Sure, you may own your pen, but how does the pen own you? It just doesn't make sense if you ever encounter such a situation. weak_ptr is not there to break cycles, it's there to allow observation of an external resource. — Xeo 2 mins ago
I really don't like this misconception about weak_ptr :/
@NeelBasu No idea! :)
 
@Xeo Thanks Man. I was having an war with that raw
 
Xeo
no prob
 
@Xeo But This is just one integer I parsed. But there is string literals. that are not written in reverse order.
I see in hex viewer its Some Integer then u.b.u.n.t.u
So If I convert this raw to reverse order the entire thing will be wrng
 
Xeo
read up on little / big endian, they don't matter for characters
since characters are by definition only a single byte
so there is no order :)
 
11:06 AM
Oh! I see. So Do I need to parse it in left to right order and extract 2 or 4 or 8 bytes when required. just while converting them to int types I need to copy it in reverse order
right ?
 
Xeo
Basically, this little endian / big endian thing is only of interest for multi-byte objects
 
@Xeo Hmm so multibyte characters will also cause problems
 
Xeo
@NeelBasu yep, since they're really just integers
char is also an integral type
 
there is so many strings how will I parse them ?
 
Xeo
they're just treated specially by convention
 
11:09 AM
Do I need to do do the same reverse_copy for each character ?
and then copy them in wchar_t storage ?
 
Xeo
You'll likely need information in the packet what kind of string it is
and parse it depending on that
 
Big endian is as stupid as the imperial system.
 
say there is a string h.o.s.t.n.a.m.e. it was sent from some windows application possibly with TCHAR. and . are 0 as shown in hex editor. and here I've TCHAR free setup I need to parse them back to wchar_t
 
I don't recall that either of them had any massive advantagers
 
Big endian is confusing as fuck.
 
Xeo
11:12 AM
@daknøk 00 00 00 06 is 6 in big endian
I see no confusion
 
So My system is running on little endian . and packet data is int little endian . right ?
 
Xeo
@NeelBasu yeah, that's a big endian display, they're ordered as {VAL_FOR_H, 00, VAL_FOR_O, 00, ...}
@NeelBasu the packet data is big endian
 
But in the same packet chars looks like small endians
 
Network byte order is big endian.
 
Xeo
@NeelBasu no, in small endian they'd look like .h.o.s.t.n.a.m.e aka [00 'h' 00 'o' 00 s' ...]
 
11:15 AM
I see 41 00 which is A
and in that same packet I see 00 00 00 06 which is 6
 
Xeo
in big endian, the 2 byte wide wchar_ts are reversed, so it's ['h' 00 'o' 00 's' 00 ...]
 
Is [[packed]] standard?
 
Xeo
ah, I see
 
@daknøk I don't think. and cannot ask the author of that packet
 
Xeo
@NeelBasu It may be that I'm confused about how wchar_t is stored :)
 
11:17 AM
@Xeo It looks like wchar is little endian and int's are big endian
@Xeo I am getting confused. How its possible. rather how did he sent such a packet ?
 
Xeo
yeah
no idea, I'm no networking pro xD
 
@Xeo as far I know when you write some data in packet the entire packet data are in same endian ness. am I wrong ?
 
@NeelBasu If you don't send your data over the internet in big-endian, you are an idiot (apart from sending files, of course).
Network byte order is big endian.
> Many IETF RFCs use the term network order; it simply describes the order of transmission for bits and bytes over the wire in network protocols. Among others the historic RFC 1700 (also known as Internet standard STD 2) explains this is big endian order.
 
@daknøk Oh! Man !!!!! I am not the coder of server application. my job is to eat the response from server. now what would I do if its endian ness is wrong
@daknøk The packet I shown is big endian. right ?
 
@NeelBasu shoot the guy who wrote the server.
 
11:20 AM
00 00 00 06 is big endian right ?
 
Depends on what value it represents.
 
@daknøk it represents 6
@daknøk So its big endian. right ?
 
yup, 6 is 00 00 00 06 in big, 06 00 00 00 in little endian
 
Yes.
 
Xeo
@Neel, for all I know, a wchar_t(L'h') might be stored as ['h' 00] in big endian. I never bothered with wide chars before :/
 
11:23 AM
Now my question is If the packet data is big endian then why wchar's are stored like little endian ? e.g. here 41 00 represents 41 or A in case of wchar_t and 00 00 00 06 is 6
 
Xeo
@NeelBasu gimme a sec
 
@Xeo So Its looks okay. its fault of wchar that doesn't store the most significant last in case of big endian. can you confirm ?
 
Xeo
Trying to test that right now
 
@Xeo k. thanks
@Xeo But how are you testing ?
 
I've been reading through some SSE documentation, but I don't understand what this means:
The selector n must be an immediate
which is documentation on a function taking an argument int n.
 
11:34 AM
those people who suggest using virtualbox instead of vmware? They can fuck right off...
 
Xeo
@jalf why?
 
@nightcracker an immediate is a constant that's encoded directly into the instruction
@Xeo it's slooooooooooow
 
@jalf: so it basically means the integer must be known during compile-time?
 
a coworker just set up a VM running Windows, and it builds so much slower than everything else
 
Xeo
@jalf did you try with both vbox and vmware?
Did your coworker properly assign the RAM and CPU to the virtual machine?
 
11:36 AM
@nightcracker yes, and there might be some special range/size requirements on the operand
@Xeo yes and yes
well, we haven't tried vmware on his machine yet, but on others
his machine is beefier hardware-wise, but wow, compile performance is terrible
at the moment, the vm is given 8 cores and 8gb ram (half of what's physically available)
 
Xeo
hm
wtf
 
don't really notice it otherwise, when just messing around in Windows or such
 
Xeo
Can anybody try to compile and run this
 
but for anything that's cpu or disk intensive, it looks pretty terrible
 
Xeo
LWS is not giving any output unless the call to std::copy is commented out
 
11:40 AM
@Xeo on any particular compiler?
 
@Xeo You need &w, peasant.
 
Xeo
GCC 4.7, pref. But anything works, really
 
you just cast the value 'A' to an address.
 
Xeo
@DeadMG ...
derp
 
Xeo
11:41 AM
And that's a nice case of UB reaching into the past and not even showing the "test" output
@Neel: So, 4byte wchar_t(L'A') (linux) stored on little endian is formatted as [65, 00, 00, 00], which means in big endian it should be reversed.
 
man
where's Domagoj?
 
Xeo
dead
@Neel: which makes sense, really. So no idea why your wide text is incoming in little endian format
somebody screwed up I guess
or they wanted you to be able to do std::wstring(raw+hostname_begin_offset, raw+hostname_end_offset)
of course, you're fucked if the data comes from an OS where wchar_t is 4 byte and your wchar_t is 2 byte, and vice versa, but that's a different problem
 
@DeadMG not seen him for a while now, and even then it was only short bursts here and there
 
same
 
@Xeo I think windows does it in wrong way
 
Xeo
11:52 AM
Sadly, can't test how wchar_t is stored on windows right now
 
but that packet come from Linux machine.
 
Xeo
but you can just take the snippet from @DeadMG's link and compile yourself
 
cause you're ugly
@Xeo LE 16bit
 
@Xeo What you tested is how its stored. but when it transfers it in netowrk is it the same ?
 
Xeo
@DeadMG right, we know Windows is little endian and 2byte, but the question is, is it stored as [65, 00] aka like linux, or [00, 65] which would explain t he order in the packet
@NeelBasu depends if the one who sent the packet converted to network byte order :P
 
11:54 AM
@Xeo It's like linux, just shorter.
[00, 65] would be BE.
 
wuick boxee review please, yay or nay?
 
@Xeo I am getting very much confused with it.
 
> It is possible to compile Haskell programs so that they will count lots and lots of interesting things, e.g., number of updates, number of data constructors entered, etc., etc. We call this “ticky-ticky” profiling, because that's the sound a CPU makes when it is running up all those counters (slowly).
 
Xeo
@DeadMG not if 00 is the LSB ;) which would be counter-intuitive, but yeah, Windows...
 
Endianness is not a property of the OS.
 
11:56 AM
@Xeo No, because that would be 65 * 256, which is not 65.
 
And neither is wchar_t.
 
Xeo
@NeelBasu My guess is that the person who sent the packet didn't convert to network byte order to allow std::wstring(raw+offset_begin, raw+offset_end) stuff
 
@Xeo I want to know how did he convert ?
 
Xeo
@NeelBasu Like I said, I guess he did not
so parse integers one way and strings another
 
@Xeo Is it possible that he is innocent but when the packet reaches network it gets that format ?
 
Xeo
11:58 AM
don't think so, he packages the data so he's responsible for its format
 
@Xeo I see.
 
Xeo
12:33 PM
So, Ubisoft goes Steam-style
 
I can't say I blame them
They've lost a lot of money from hacked Assassin's creed games, it's not even funny
 
"but if they made good games, people would actually pay for them"
 
morning
 
@Neil: better that than Blizzard-style
 
12:39 PM
wow, Emacs people are way more arrogant than Vim people
I’d never have thought that
 
I think it's only a matter of time before all games are going to require internet to work
All the heavyweights meant to bring in money anyway
 
Nope.
 
@Xeo Your current browser settings indicate that cookies are disabled. Cookies are required to properly access our site. To enable cookies, please refer to your browser's documentation for instructions.
 
12:42 PM
> Unable to load site properly
> Your current browser settings indicate that cookies are disabled. Cookies are required to properly access our site. To enable cookies, please refer to your browser's documentation for instructions.
 
wut
 
@Xeo apparently coockies are disabled on my browser, thus the site will not work for me
 
Xeo
gah
 
what sort of scam you trying to pull?
 
Xeo
12:42 PM
try the new link
The old one had a session ID embedded
 
still fail
 
Xeo
:<
 
What the crap? Who would prevent viewing of a web site because it won't allow cookies?
I can understand if functionality is reduced, but that's just downright mean
 
408
A: What's the difference between JavaScript and Java?

Shog9One is essentially a toy, designed for writing small pieces of code, and traditionally used and abused by inexperienced programmers. The other is a scripting language for web browsers.

 
Xeo
Why can't they just expose a "share" link..
 
12:44 PM
it is a 'share' link
 
Xeo
@ViniyoShouta read the newbie hints, please. You can edit your messages with the up arrow
@ViniyoShouta I wasn't talking about your messages
 
And would help not to paste 4-year-old answers about Java that everyone saw 4 years ago.
 
it was also not that one
 
Xeo
does this one work? /cc @thecoshman, @KonradRudolph, @daknøk
 
it does, hurray :)
 
12:48 PM
huh... locked
 
> Particular interest in architecture, low-level libraries, and sustainable code.
Ahahaha low-level libraries and sustainable code.
 
indeed
 
@Xeo yez.
 
> Experience in object-oriented design (UML) and the TDD approach.
> Experience with assembly languages and template meta-programming a plus.
This is gold.
 
@Xeo sounds very tempting :P
 
12:50 PM
Sounds very templating.
 
Xeo
@CatPlusPlus Depends on what they define as "low-level", doesn't it? Asio is also defined as a low level by some
 
Doesn't matter. Low level does not go together with sustainable.
Because boilerplate boilerplate or goddamn pointers everywhere.
Asio is low-level because of boilerplate.
 
Suppose you had enough boilerplate to make "low-level" libraries manageable.. Sustainable now, right? Yes, but congrats, it's no longer low-level.
 
Low level should be wrappable by higher level abstractions. With the option to fall back to the low level if the need arises.
 
Low-level should be hidden, because it's boring.
 
12:56 PM
@StackedCrooked I think having the necessity to fall back to low level means somebody screwed up the higher level abstractions
It defeats the purpose if you have to deal with both
 
Attaching debugger to AsyncTask = no dice. Many thanks to Java and Android for wonderful development environment.
Eh, at least it's not Xcode.
 
@Neil I mean, for example that in Qt you can still get a HWND if you want. This is needed if you want to write a write video player based on GStreamer.
Bad example perhaps.
I mean more like MFC still allows access to HWND.
MFC is a bad abstraction though. Replace with WTL if you want.
Which is supposed to be better.
 
MFC is epic fail
 
All GUI toolkits are terrible.
 
I think you can't get any lower level than MFC for making a windows application
Though for the longest time, it was the only possibility
 
12:59 PM
You can use plain WinAPI.
 
WinAPI is fun if you have an obsession for wrapping things.
 
@CatPlusPlus You are terrible.
 
Nope.
 
@daknøk you ever seen a good one?
 
XULWin :p
 
1:11 PM
Qt gets the job done but mixing their C++ conventions with my own code is often a pain
 
if i do `ofstream binf ("h" , ios::binary);`

here does the ios::binary flag remove the default flag (ios::out)
 
@MohamedAhmedNabil nope
again, documentation helps!
 
@sehe i checkd first
 
@MohamedAhmedNabil Well, see your optician then:
> First, performs the same steps as the default constructor, then asssociate the stream with a file by calling rdbuf()->open(filename, mode | std::ios_base::out).. std::basic_ofstream::basic_ofstream cppreference
 
@sehe I didnt understand it clearly, thats why i asked :/
 
1:18 PM
I am sure that could be done with more TMP
 
the part where it says mode | std::ios_base::out spells: it uses your flags, OR-ed with the default flag
@thecoshman Everything can be done. It is still a pain
 
So when i add a flag to a filestream object it doesnt remove the default flag but adds to it

So here 'ofstream file("h", ios::binary)' both the ios::binary and ios::out are working ?
 
ding ding ding! we have a winner!
 
ofstream without out flag would be rather silly.
 
@CatPlusPlus even with fstream? If i add ios::binary to an fstream object i have 3 flags working?
 
1:23 PM
@MohamedAhmedNabil Yup
@MohamedAhmedNabil ?! what is the third?
 
I don't know, read the docs.
 
@sehe the two default ones, ios::out | ios::in and the one i would add ios::binary
 
@MohamedAhmedNabil You may have meant ifstream? In which case, yes you get in | out | binary
 
The only method name of ostream that I can remember is <<.
 
@MohamedAhmedNabil fstream doesn't have defaults... checking now
 
1:26 PM
class default mode parameter
ofstream ios::out
ifstream ios::in
fstream ios::in | ios::out
 
@MohamedAhmedNabil Yeah. But it clearly does not document it to override the usersupplied mode parameter en.cppreference.com/w/cpp/io/basic_fstream/basic_fstream
@MohamedAhmedNabil What did we tell you about cpluslus.com? Are you being stubborn on purpose?
16 hours ago, by Xeo
@MohamedAhmedNabil don't use cplusplus.com
 
@sehe Old link, old link
 
@sehe You are not his master.
 
Also stop caring about out/in flags.
 
@StackedCrooked Aren't all operator<<() versions implemented as a free functions most of the time ?
 
1:28 PM
Some variants are members.
 
@StackedCrooked I think you mean Xeo isn't. We are not his master.
 
@sehe in short that means that how many flags are working here? fstream binfil ("h",ios::binary);
 
@StackedCrooked However, if you continuously come here for advice, and require documentation to be read back at you on more than one occasion, then yes it seems silly to ignore the advice that you sollicit, IMO
 
@MohamedAhmedNabil: Here are all the flags I could find.
 
...
 
1:30 PM
@ereOn XD
 
Common, it's friday, leave me that one.
 
You already have it
 
Can I keep it ?
 
I'm certainly not buying it
 
Who said I was selling it ?
Guess my stupid joke killed the discussion.
Sorry for that.
 
1:33 PM
The discussion was well and truly over. About 4 days ago :)
 
Then I have nothing to apologize for. Good.
 
@ereOn poor, very poor
 
@thecoshman: Yeah, well... can't deny it.
 
For ifstream and ofstream classes, ios::in and ios::out are automatically and respectively assumed, even if a mode that does not include them is passed as second argument to the open() member function.

The default value is only applied if the function is called without specifying any value for the mode parameter. If the function is called with any value in that parameter the default mode is overridden, not combined.
Arent theese two saying the opposite?
 
@MohamedAhmedNabil Yeah they seem to. However, the standard (or any good documentation) doesn't say that.
You could just paraphrase it:
(1) std::ofstream always ensure a minimum of ios::out
(2) std::ifstream always ensure a minimum of ios::in
(3) std::fstream doesn't _ensure_ anything, but when left to defaults, will default to ios::in|ios::out
@MohamedAhmedNabil ^ that paraphrased from the docs, and makes oodles of sense
 
1:40 PM
@sehe ofstream and ifstream always have their default flags no matter what is added, While fstream doesnt
 
@MohamedAhmedNabil: you like repeating stuff he just said heh
 
@MohamedAhmedNabil Exactly
 
@netcoder im emphasizing
 
@netcoder Nope. This case, it is the first time he shows he got it. I'm glad he did, so I didn't waste my effort
 
@MohamedAhmedNabil reapeating
 
1:43 PM
@thecoshman reallea?
 
Thank you @sehe
 
@others paraphrasing what you understood is often a very good practice in communication/learning
 
@sehe fuck it, it can stay like that
 
@sehe: you're probably right, me no coffee got yet, patience have not with coffee no me
brb
 
mohammed is ugly
 
1:45 PM
@DeadMG ?
@DeadMG citation needed
 
citing that he's annoying
 
I need to get my self a chew toy of sorts before work start charging me for stationary
 
@thecoshman You're not a puppy. You're a pirate. Pirates don't need chew toys, they need swords and parrots.
And rum.
 
@Drise A pirate will chew as he pleases!
 
With fstream when i use ios::app do i have to use ios::out? because using ios::app alone seems to work
 

« first day (685 days earlier)      last day (4264 days later) »