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

6:01 AM
@Mysticial: For instance, to find a rather interesting answer (with 3239 upvotes!), you have to search for "branch prediction" :-D
There you go 3240!
 
Last time I checked, googling "Branch prediction" didn't turn up that question until page 2 or 3. Is it higher now?
@VinayakGarg huh still 3239?
 
hmm
apparently, Clang can only describe it's semantics types in terms of it's AST
not helpful for someone who doesn't have an AST.
 
@Mysticial Strange, SO didn't show orange upvote on it. So I upvoted it.
 
Woah, that question is now #3 when google, "branch prediction"...
Below two wiki pages.
@VinayakGarg If you really just upvoted it, it's not registering.
 
@Mysticial Sometimes SO acts funny. If I am refreshing it, it isn't showing up properly :(
You know as if JS is not working.
 
6:10 AM
@DeadMG what? do you "have an AST"? what's that mean?
 
@VinayakGarg I've been having some extreme lag problems with Firefox on SO recently. There was one time I accidentally tried to downvote my own answer, because the scrolling lagged and my click didn't register until after I scrolled.
 
And it is happening in Chromium but not in FF.
It is appearing as simple text file, without any layouting, or fancy upvote buttons etc.
 
@Cheersandhth.-Alf I have astma. Does that count?
 
I've only seen that problem when the connection was too slow
@Cheersandhth.-Alf An AST is a representation of a C++ source file.
 
Isn't AST something more general than that?
 
6:13 AM
@DeadMG Any sort of code actually.
It's a compiler internal representation.
 
Abstract Syntax Tree?
 
correct
 
If the AST after instantiation of templates?
I guess.
 
Also called Parse Tree?
 
AST before instantiation would be require a multiple dimension space. Or something.
Instantiation is like the collapsing of the wave function.
 
6:16 AM
Ah, now it looks like it registered an upvote. :)
 
Really?
 
@Mysticial In Clang's codebase, it's C, Objective-C, or C++.
 
In FF it is 3239
 
but it's unhelpful when I want to tie it to Wide code and all Clang can ask me for is the C++ AST.
and the documentation is the epitome of unhelpful
 
Yeah now it is showing. But let me check if it is really mine ;)
 
6:19 AM
@VinayakGarg That'd be a huge delay?
 
After up vote, I refreshed broswer multiple times, and it is showing like this.
 
@VinayakGarg eww, is css broken?
 
Maybe
I will say JS, because I guess JS is manipulating it dynamically.
 
You can go here to check if your vote registered: stackoverflow.com/users/922184/…
substitute with your account stuff
that vote tab in your profile
 
Nope!, but that page is also displayed like this.
 
6:24 AM
meh... you might wanna try clearing all your settings. I've borked my layouts before and I had to do a reset.
 
So I can make it 3241! If only this damn thing would work.
 
:)
 
Thankfully this room is properly loaded. But if i refresh it....oh
This is what happens if you rely to much on JS and shiny stuff for your website.
 
It's kinda funny though. That post is 3000+ now - well ahead everything else except that regex answer. And yet I still get excited at like every upvote I get on it.
 
Regex answer?
 
6:27 AM
4432
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

It's locked though.
 
Ohhhh
 
The official reason is "because it keeps getting vandalized". (which has only happened twice)
I think the real reason is because of run-away voting.
I can only hope that the branch predictor question doesn't suffer the same fate and get locked.
 
You mentioned "clearing all your settings", so how do I do it?
 
what browser is this? I'm only familiar with FF.
 
Chromium
Clear cache?
 
6:31 AM
meh... there's probably an option somewhere in there that will let you reset all custom settings.
 
But refresh does that.
 
Try clearing the cache first.
 
I have no custom setting.
 
@VinayakGarg I don't know how I borked mine because I don't have custom settings either. Apparently it's there, and somehow it got corrupted.
 
And there is problem with SO pages only.
Oh refreshing FF also made it lose the JS. I think SE team is up to something.
 
6:39 AM
It's actually fine here. Are you sure you don't have anything that's suppressing JS?
 
Have you refreshed any page?
 
yes
I just did
If it really was that broken, it'd be all over meta already.
 
yeah
Okay I will try closing the browser, and see if it solves problem. Or... gulp...
Didn't help
 
Try clearing FF's cache.
 
FF is fine now. Although if i press F5 it becomes ugly. Then if I open any link from correct page, the new page is correctly displayed.
 
6:50 AM
@DeadMG it's a bit more general than that, but ... i just wondered what you meant by "have an ast"
 
I'm sure that the concept of having or not having information is not new to you#
 
7:29 AM
"This post has been locked while disputes about its content are being resolved. For more info visit meta." So, there are both single geniuses and crowds of idiots on SO. Just like in life.
US court: Apple is good guy, Samsung is bad guy.
South Korean court: both Apple and Samsung are both bad guys and good guys
Japanese court: Samsung is good guy, Apple is bad guy
^ it gives me a safe, comfy feeling to note that everything is as it has ever been, namely, just about everybody is corrupt, putting far more weight on who they want to support than on what's right or truth (including the courts all over the world)
 
@Cheersandhth.-Alf What is that supposed to mean? You just named every possible scenario for a court to conclude and imply none of them are right.. What is the right conclusion a court should make then?
You understand that's like saying, "There are those wankers who like cheese and wankers who don't.. Why does everyone have to be wankers?"
 
@Neil note the systematically different results depending on where the court is located
 
the right decision is "Fuck patents".
 
@Cheersandhth.-Alf I noticed, but I think it's premature to derive conclusions based on anecdotal evidence
 
7:44 AM
@Neil u know, that sounds retarded
like, you think that later on it would be ok to "derive conclusions based on anecdotal evidence"
but not right now
 
@Cheersandhth.-Alf No, I never implied it would ever be correct to derive conclusions based on anecdotal evidence
Or maybe I did, now that I think of it. Though what I meant by premature was "with as little evidence as there is now"
 
moaning
 
8:01 AM
h͚͔͕͍̣̙̞̃ͯt̖̗͎̩̳̻̆͑̈͐̉̐̚t͔͈̠̙̦̱͌̌͛́ͅͅp̱̞̓ͩͅ:̮̜̹̜͔̼͍ͪ̍̓ͨ͊̍ͥ/̖̮̘̰͕̯͈̱̺̓̎ͮ͐̈́/̿̍̓̑͌̔‌​‌​̭̥̙͓̱̤͙͙ḳ̺̬̭̗͌̔ͩ͊̔̚ͅn̳͉̪̰̿ͦ̆̆o̥͎̮̠͌͋w͇̬̫̗͈̰̯̎ͤ̈́̈́ͮ͐́y͔̗͎̖̲̜͖̟̽͊ͪ͒̆̈ͪ̚ŏ̥͚̦͂̀̐ͧ̂‌​̰͚‌​̞ù̠̩͖͓̦̆ͥ͂ͯr̜̣̝̘̬̖̲̓͛̓ͤ͛͗m͇̞̹̻̣̼͔̐̈e̖̻̲̺̩̟̙̮͑ͫ̋̇m͇̘̜̼̊ͤ̑̂e̲͉̦͉͉̓̉ͦ͂̋.ͯ͊ͪ̍̇͑̚‌​̪̮͋͊‌​͓̺c͉͎͚͚̳̙̘̱ͤ͊͗͒͗̀ǒ̭͕̼́̈́ͅm̠͓̜͒̉/̹̳͎̯̥̪̮͗͛m̖͓̫͓͉͉̙̹̀̾͐ͧͪ̽ͥͥě̤̜͈̽̋̽ͮ̓̏̂m͆̊̅̎‌​̻͂͆ͣ̍̾‌​͇̖̮͇̖̘̱͙e͙͍̻͕̤̾ͩ̄ͮ̈ͮͅs̘̺͕̳͂͑͒͆͐/͈͚̪̮ͨ͊ͨͯ̈́ͩ͌̚z̞͖̬͇̅ͨ̋̊ͬͩ̏ä̟͕͇͇̹̹ͤ̂̈́̂̌̒̆l͊‌​̹͓̬̮̰̑̌̾‌​g̘̘̟͇ͣ̍̿̊̆͑̑ͅo̯̺͉͖̭ͥ̃ͣ̊̐̽
^ I don't understand how he did that.
 
there's a site for that IIRC
 
Good morning my fellow apes, dogs and homos :)
ouh and no to forget the cats
 
Morning boys
 
8:20 AM
@Nils hungover cats
 
The Qt 5 beta is out.. will I get a VS 2012 express edition to try it out?
How do I test if two XML/HTML documents are equal?
For example <td rowspan="1" colspan="4">asdfas</td> is equal to <td colspan="4">asdfas</td>
 
@R.MartinhoFernandes what you mean ¬_¬
 
8:49 AM
@thecoshman Grammar Ally, as opposed to Grammar Nazi
 
@DeadMG oh right... I guess that could be funny
 
9:04 AM
damn
why do the government want my flatmate's life story?
I don't know anything about her, nor do I care
 
Xeo
mornin
wtf
why is the user list on the right a single column?
nvm, IE problem...
 
9:19 AM
morning
how do you guys use Boost with Makefiles? Do you hard-code the path to the Boost libraries?
There’s no pkg-config support apparently …
 
Xeo
@KonradRudolph Boost itself needs BOOST_ROOT environment variable for bjam IIRC, so that may be an option.
 
@Xeo I don’t want to use bjam though
(and the existence of this environment variable is far from given)
 
Xeo
Yeah, but since it's used by boost to build their libs (unless you execute bjam in that root folder), you may aswell "rely" on that
 
well, like i said, the variable doesn’t exist on my systems, for instance (and I built Boost just fine without it)
 
Xeo
like, either specify a -DBOOST_ROOT=... at the call to make (note: I don't know make syntax!) or have it as an environment variable
 
9:22 AM
maybe it’s set during the Boos build process … but it’s not set in general
preferably I’d like something that works on other systems without the need for manual configuration
(this is where pkg-config normally comes in …)
 
Xeo
don't know what that is :P
 
it’s used to write Makefiles without hard-coded library paths
so essentially every Open Source software which relies on the GNU toolchain and libraries needs to use it …
FWIW there’s a 5 year old open bug report for this on the Boost Trac
 
-1
A: Detect if the processor is 64-bit under 32 bit OS

DeadMGEvery x86 processor shipped for about the last ten years has supported x64. bool DoesProcessorSupportX64OS() { return true; }

lol I wonder who downvoted
and voted to delete...?
 
haha I voted up
 
9:50 AM
apparently, everybody under the goddamn sun thinks that I said all processors support x64
 
0
Q: Find Boost libraries in Makefile

Konrad RudolphWhat’s the best practice for including Boost libraries in the built process? To illustrate, assume that our project makes use of Boost’s regular expressions and is compiled as follows: g++ -lboost_regex -o main main.cpp … which means that I could write a Makefile which contains just the follo...

@DeadMG Well, either your answer says that, or it’s bloody useless, to be honest. bool DoesProcessorSupportX64OS() { return true; } – how does that help?
 
@DeadMG I wonder what about smartphones and ARM chips?
 
Xeo
@Konrad, I said either have it set as an environment variable or require that it is passed on make invokation
 
@Xeo Okay, but the second one precludes an automated built process
 
@DeadMG it's pretty much what you said. "for the last decade CPUs have support 64bit, thus your CPU must be 64bit, no need to test if it is"
 
Xeo
9:54 AM
@KonradRudolph Yeah. :/
 
Though to be honest, so far it’s the best solution
if you want to write this as a very brief answer I’d vote it up, and if no other answer presents itself, accept it (with a heavy heart)
 
@thecoshman More accurately, if you're still running such an old CPU, you'd already know about it.
 
Xeo
@DeadMG Ouch, shot down by a moderator
 
if you distribute a general-purpose application, it's not something you have to concern yourself with
 
@DeadMG ¬_¬ since when where programs only run by the person who wrote it?
 
Xeo
9:57 AM
@KonradRudolph How do you pass a define to make? :)
 
@thecoshman The point is still perfectly valid.
 
@DeadMG his motives are irrelevant
 
@thecoshman Not really.
when you're asking "Does random CPU X support Feature Y?" and about 99.9999% of all CPUs do, then it's pretty meaningless to specially code for the rest.
 
@Xeo You can pass it variables somehow but I’d just set the environment variable before invocation, i.e. BOOST_ROOT=/foo/bar make
 
@DeadMG well, yes of course you should know if your own CPU is 32 or 64 bit, but he is not asking how he can find out if his own CPU is 32 or 64 bit is he.
 
9:58 AM
and if your customers are still using such ancient hardware, then you should already know about it
 
Xeo
@KonradRudolph that'd set it for the duration of the session, right?
 
@DeadMG He wants to know how to do something, and as obscure a thing as it may be, you answer was worthless
 
@Xeo No, just for that command
 
Xeo
oh, ok
 
@DeadMG but if you need to specifically handle that 0.0001% then you need to know how to test for it
 
9:59 AM
@thecoshman Not really, because you already know that you have to support those that don't have it.
@thecoshman Well, not really. In the general case, it's perfectly true.
 
@DeadMG if you are writing software for general release, then any one could have 64 bit hardware but 32 bit OS
 
in case you hadn't noticed, he didn't specify that he was running with special requirements
 
@DeadMG but if he wants to support it, he needs to know how to test for it
 
let me rephrase that
Stack Overflow is for general help, for the general case, not "I randomly have special requirement X I didn't state in the question"
 
@DeadMG then vote down on his question and comment saying you think it is too localised, but the question as it stands wants to know how to do something, and you simple stated "oh, but that is almost never going to happen, don't worry about it"
 
10:01 AM
and if he does have X but didn't state it, I don't give a shit.
my answer was perfectly accurate for the general case, and that's enough
 
there is no secret requirement, it was very clearly stated exactly what he wanted to do. Sure it was a very obscure thing, but it was very clearly stated
@DeadMG but your answer did not answer his question
 
Xeo
@KonradRudolph Is ENV_VARIABLE=value command really a working syntax?
Never saw that before
 
in the general case, the given test is quite sufficient.
 
Hi.
 
I agree that tacking on random requirements afterwards is something you should not concern your self with, but he did not do that
 
10:03 AM
@Xeo Yes
(try it)
 
@DeadMG but it fails to answer he question
 
Xeo
Can't here :/
 
in the general case, it does
it provides a test that answers, with an extremely high degree of accuracy, if the CPU supports 64bit.
 
@Xeo It works in bash and Z shell.
 
what general case? how does it detect if the CPU is actually 64 bit when your are running in a 32 bit OS? Your question is tantamount to int random(){ return 4; /* chosen by random roll of a die */ }
and clearly I am not the only one to think it failed to answer the question as other down voted it
 
10:06 AM
the general case of, say, running on a statistically representative sample of CPUs in active use today
@thecoshman Appeal to authority fallacy where authority is "other downvoters".
 
true, others could have down voted for reasons other than 'did not answer the question'
you answer is worthless, it is barley worth a comment saying 'almost all CPUs these days are 64bit anyway, so you may as well just assume'
 
Xeo
@Konrad just in case it wasn't clear, it was meant as a joke, since I know it's not feasible in any way. Not only the multiple Boost installation issue, but also simply the amount of time needed to search everything from / and below
 
@Xeo globbing through a hundreds-of-TB large file system isn’t fun ;)
:p too late
 
Xeo
:)
 
The OP clearly acknowledges that he is asking for edge case stuff, that does not mean you can simply ignore the fact he is asking for how to check for that edge case
by your logic bool isZero(int test){ return false; } is a proper solution as almost every number is not zero, yet it clearly fails to check for the one condition you care about
 
10:11 AM
@thecoshman Except the range is not uniformly distributed, and secondly, you're not talkin about every number for the last eight years, a near eternity in CPU terms.
 
@thecoshman in computing, 0 is a pretty common integer.
 
what difference does that make? is there still not a chance that you are actually running on a 32 bit CPU? as small as that chance may be?
@daknøk ¬_¬ moot point
 
:P
 
@thecoshman Possibly. But there is a point where that possibility is not the problem of the general population of Stack Overflow.
remember that the principle purpose of the site is to share useful questions and answers
that's what "too localized" is for
 
I have at work a picture of bacon as wallpaper.
And my color scheme is brown-red.
 
Xeo
10:14 AM
self-torture?
 
@DeadMG then utilise that, flag it as too localised. But crap answers are not a solution
 
@Xeo Why? Bacon is great.
 
Xeo
You but do you have any right now?
 
Nein.
 
@thecoshman The information I provided in that answer is perfectly useful to anyone curious about the prevalence of x64.
 
10:16 AM
@DeadMG not worthy of an answer though
 
Xeo
@daknøk see? You're making yourself want bacon, but you don't have any
 
It is a horrible answer.
@Xeo I'm not that sensitive.
 
still... on a some what similar 'y u no like answer' train of thought...
why did Bill the Lizard close this
It clear answers the question as stated, and even goes as far to help explain to the OP what he did wrong and offer advice. An exemplary answer IMO
 
I've a packet data which is a plain char*and I want to parse selected 4 bytes of it as an integer. and I don't want to do bit shifting
 
Xeo
@thecoshman erm.. isn't that basically the same problem as with @DeadMG's answer you just discussed here?
 
10:19 AM
@Xeo it's close I'll give you that
 
is there something like std::copy(data+4, data+8, something) that converts data which is char[4] to uint32_t
 
I just picked out exactly what was being asked and answered it very literately
 
Xeo
@NeelBasu std::istringstream!
 
@Xeo I don't need a lexical cast
 
@NeelBasu is endianness a problem?
 
Xeo
10:21 AM
ah, I see
 
@NeelBasu are the chars as a string? or just binary data?
 
@daknøk Nope
 
Xeo
Well, you could always just reinterpret_cast<uint32_t*>(your_bytes)
 
@thecoshman These are binary data that from socket I've kept in char*
@Xeo I am doing C Style cast which is not working
 
Ew C style cast.
 
10:22 AM
silly guys, union :P
 
Xeo
heh
 
exactly what this is for :P
 
std::copy(reinterpret_cast<char*>(&myint), reinterpret_cast<char*>(&myint) + sizeof(myint), bytez);
lolz :P
or plain old memcpy.
 
union PacketData{ char[]; int} or what ever the syntax is :P
 
char[4]
 
10:23 AM
yeah, char[4]
 
And uint32_t, for portability.
And static_assert(CHAR_BIT == 8, "Your target architecture suckz.");.
 
but yeah, the union lets you read an instance of it as either a single int, or as an array of four chars
 
@NeelBasu define "not working"
Error? Garbage output? Segfault?
 
@daknøk giving junk data
 
I think you need to give the members names like in a class... so union PacketData{ char[4] CHAR; int INT; }; again, syntax probably wrong
 
Xeo
10:25 AM
@daknøk wrong way around?
 
@NeelBasu maybe endianness is a problem. Do you get the data from a network?
@Xeo Probably. :P
 
Xeo
@thecoshman you know that's UB, right?
 
@Xeo :O
 
@daknøk No. because in hexeditor its not showing any problem with endianness. and its UDP Packet
 
No single program is complete without a little bit of UB.
 
10:26 AM
@Xeo where so?
 
Xeo
@thecoshman writing to one member, reading from the other
 
@NeelBasu network byte order is always big-endian (except maybe for a few protocols designed by morons). Try doing an endianness correction and check the output.
 
@daknøk I don't know how to do that :P
 
@Xeo is that so? so is it that you only use the one, read and write with either the int or the char[]
 
Xeo
@thecoshman You can't do PacketData pd; pd.CHAR = ...; return pd.INT;
Only the last set union member is active / actually exists
 
10:30 AM
    char hostNameSize_str[4];//uint32_t;
    std::copy(raw+40, raw+43, hostNameSize_str);
    quint32 hostNameSize;

    std::copy(hostNameSize_str, hostNameSize_str+4, std::ostream_iterator<int>(std::cout, " "));
    std::copy(reinterpret_cast<char*>(&hostNameSize), reinterpret_cast<char*>(&hostNameSize) + sizeof(hostNameSize), hostNameSize_str);
raw is the while char array
is this anyway wrong ?
std::copy with raw+40 to raw+43 takes 4 bytes right ?
 
I wonder which nation has the most words for the lady chest padding?
 
Xeo
@NeelBasu The second copy call copies the int bytes to the char array
@NeelBasu what do you think the first copy call does?
 
@Xeo I put the first copy to display the char array
and second copy to copy that char* to quint32
 
Xeo
@NeelBasu Ah, ok
 
when I am printing hostNameSize_str with first std::copy I see last byte junk value
 
Xeo
10:39 AM
@NeelBasu std::copy(input_first, input_last, output) -- doesn't quite fit that description ;)
@NeelBasu how big is the array?
 
so I did std::copy(raw+40, raw+44, hostNameSize_str);
@Xeo raw is 512 byte
 
Xeo
@NeelBasu yes, +43 is wrong, that would be a 3-char sequence (remember, half-open ranges)
 
@Xeo and char hostNameSize_str[4]; is that 4 okay ?
 
Xeo
@NeelBasu sure, that just tells the array how big it is
 
If I copy till 44 i get correct value in char array which is 0 0 0 6
 
Xeo
10:42 AM
@NeelBasu Do you know the concept of half-open ranges?
 
So quint32 hostNameSize should also be 6 right ?
@Xeo no. but looks like I heard somewhere. in set theory ?
 
Xeo
@NeelBasu No, std::copy(reinterpret_cast<char*>(&hostNameSize), reinterpret_cast<char*>(&hostNameSize) + sizeof(hostNameSize), hostNameSize_str); doesn't copy into the quint32, it copies from it.
 
yes I changed that
std::copy(hostNameSize_str, hostNameSize_str+4, &hostNameSize);
 
Xeo
@NeelBasu A half-open range of the form [0,5) will contain 0,1,2,3,4
aka the last element is excluded
 
@Xeo Yaaaaaa I read that in set theory long ago.
 
Xeo
10:44 AM
@NeelBasu bad
 
@Xeo bad ? why ?
 
Xeo
@NeelBasu It's important in day-to-day C++ since all ranges are defined as half-open
 
@Xeo yes my bad
 
Bacon.
 
Xeo
@NeelBasu std::copy will internally do something like this:
for(; first != last; ++first)
  *output++ = *first; // assign a 'char'  to 'int', going to the next 'int' in the output sequence.
but you only have a single element sequence
 
10:45 AM
yep got that
@Xeo std::copy(hostNameSize_str, hostNameSize_str+4, &hostNameSize);
 
Xeo
std::copy(raw+40, raw+44, reinterpret_cast<char*>(&hostNameSize)) should work
 
is that okay ?
 
Xeo
@NeelBasu That's what I was talking about
 
@Xeo thats what is getting zero as uint
 
Xeo
@NeelBasu You only have a single quint32 as the output sequence, but std::copy tries to write to 4 quint32s
 
10:48 AM
@Xeo Oh! ya. then I need to reinterpret cast that to char* ?
 
Xeo
@NeelBasu like I wrote
 
std::copy(hostNameSize_str, hostNameSize_str+4, reinterpret_cast<char*>(&hostNameSize))
I am doing this
 
Xeo
should work
unless I overlooked something
 
getting junk
but I can confirm that hostNameSize_str is properly parsed which is 0 0 0 6
 
Xeo
@NeelBasu Try reversing that sequence, seems you have little endian architecture
Was 100663296 your "garbage" output?
 
10:52 AM
@Xeo yes overflow
@Xeo Yes that was it. overflow
 
Xeo
No, not overflow
it was simply little endian converted
 
I was thinking may be hostNameSize_str[4] can take only 3 char's so last bytes is getting garbage
 
Xeo
little endian means the least significant byte comes first, aka the most significant byte comes last, in this case 6, so the int then looked like 06 00 00 00
 
which is not valid actually.
 
Xeo
See also this
 
10:55 AM
So its little endian ?
 
Xeo
right
but the input is big endian
which is why you needed to reverse the byte order
 
But I cannot reverse all strings.
So is there anyway so that I can specify that It has to be parsed as little endian ?
or I do need to do std::copy in reverse ?
 
Xeo
yep
that's the same as reversing the sequence
there's also std::reverse_copy
btw, you don't actually need the hostNameSize_str, just use the raw buffer pointers
 
Oh! reverse_copy worked. thanks
but I never faced problem with endianness bfore.
 

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