« first day (844 days earlier)      last day (4090 days later) » 

4:00 AM
@JerryCoffin doesn't do what
 
@doug65536 Doesn't start to fetch and execute both paths at a branch.
 
@JerryCoffin oh, agreed
 
0
A: How can I use arithmetic right shifting with an unsigned int?

Debobroto DasYou need a proper 32 bit mask. and than set the right most 8 bit of the mask as your 8 bit unsigned int. This will give you the result. At first yuo should try some code yourself and then try to seek for help.

^^ wut?
 
Another thing it does is (in many cases) figure up flags separately from results. E.g., it has parallel hardware to figure out whether a multiplication or division will give a positive, zero, or negative result, well before it's figured up the result itself. That way, if the next instruction depends on negative/positive/zero, it will know how to branch before it has the actual result. This is fairly easy, because for mul/div negative/zero/positive only requires xor of one bit from each operand.
 
@Mysticial What's IB?
 
4:04 AM
@JerryCoffin On what? ARM? I don't think any x86 processor can execute down both paths.
@Rapptz Implementation Defined Behavior
 
There's no B there..
Just admit it. It was a typo.
 
@Mysticial On Itanic.
 
@JerryCoffin ah
 
must have been another processor, I just looked it up in the ia64 optimization guide
 
Yeah, I won't swim at the bottom of the ocean.
 
4:06 AM
@Rapptz B comes from "Behavior". I think "IDB" is more common though.
 
probably better to type it all out
 
@JerryCoffin Oh man, IDB to me stands for In-Depth Battlepedia...
reminds me those old days...
When I still played that game...
 
@doug65536 I believe a few DSPs that do it, but you need quite a bit of "spare" bandwidth to memory for it to make sense.
 
harvard architecture could do it pretty easily I suppose
 
@Mysticial Showing my age, I have no clue what game it would even be.
 
4:08 AM
@JerryCoffin neopets.com
 
@Mysticial Ah...
 
I had (and still have) a pretty impressive account on that game.
I just don't play it anymore.
 
0
Q: expected initializer before ‘*’ token

Stephen RaskuI am trying to implement the code in the Design Patterns book. I am getting the following error: expected initializer before ‘*’ token for this line: static Singleton *Singleton::itsInstance = 0; Here's the complete code. I am using g++ 4.2.1 to try and compile this. class Singleton { pu...

 
@Rapptz Wow. We're already up to, like, week three into the new semester. Shouldn't these be down to only one every couple of days or so by now?
 
Does anyone have any recommendations for a C++ stream library to read binary char array, including null terminated strings?
 
4:15 AM
@Nican elaborate more, would you?
 
@Rapptz let's hope every syntax error won't be an SO question
 
They already are.
I wouldn't be surprised if "lack of semicolon after class definition" has been asked at least 1000 times.
 
I haven't seen a "wtf is this" with a mess of template compile errors question yet.
 
@adamk33n3r As it is right now, this answer does in fact make little to no sense. So you're right to be confused. Because I am too... — Mysticial 4 mins ago
 
@AndréPuel I have a class project in multiple people; My part of the project is parsing some binary data "packets" from the other layer; And for example, I might have to read a 4-byte int, a float, and the string "hello" all in a 14-byte char[].
4 bytes for the int, 4 bytes for the float, and 6 bytes for the null terminated "hello"
 
4:21 AM
@Nican The best library around github.com/Andrepuel/BinaryStream
 
How shameless of you.
 
lol
Nah, the Robot pulls off better shameless acts.
 
@AndréPuel I will take a look; Thanks!
 
I tried to help the guy understand sign-extension, instead of just blindly using the answer given. next guy says shifts are implementation defined. really?
 
@doug65536 Shifts are in fact IB.
But non-arithmetic signed right-shifts are pretty much extinct. (or never existed)
 
4:25 AM
yeah in language lawyer land. can you cite a machine that doesn't sign extend?
 
nope
 
I don't like language lawyer land
 
I'd have to make one myself if I wanted to prove that statement wrong.
 
I know, in that plane of existence, everything that is allowed to not work, doesn't
 
00
 
4:27 AM
I'd say show people how real machines really work so they can learn C in peace, then terrorize them with all the horrors
 
Is shift IB? I always though it was defined as a multiplication/division by 2
 
like letting people understand how to do hacky aliasing and reinterpret casting etc... so they have full control. then tell them they're not allowed to do that
 
@AndréPuel right-shift on signed integer is IB
all other shifts are defined.
But left-shifts that overflow a signed integer are actually UB.
 
x86 has an (old) 1-byte instruction INTO that throws an exception if OF is set - a compiler could emit it and make overflows bad
 
multiplication? oh right 2^n
 
4:35 AM
Can someone explain me why the expected result is not 0000 0000 0000 0000 0000 0000 1111 1010? I am felling dumb...
 
Ah found it. The Robot's epic shameless beg for upvotes:
Jul 23 '12 at 15:25, by R. Martinho Fernandes
I wasted half an hour on this. I want rep.
 
@Mysticial Wow I upvoted it.
 
same here
I didn't even read the answer.
I don't think anyone did.
 
lol
 
@AndréPuel en.wikipedia.org/wiki/Signed_number_representations <- see two's complement
 
4:36 AM
myopenid.com is not working apparently. :-(
 
@doug65536 But it was a positive number before the "casting" to int32!
 
@AndréPuel what would happen if you subtract 1 from 0
 
Fortunately I have an email address attached to my account and thus when I used it to make a Stack Exchange OpenID they were smart enough to log me back in
 
if anyone looked at my tree-based-vector (which I assume is nobody), I've just updated it. Bug fixes in balancing operations, it can now successfully insert in the front 100000 times without error so that seems solid.
 
I looked at it
 
4:38 AM
@MooingDuck hey!
 
@AndréPuel to change the sign you flip every bit and increment
 
@doug65536 I know how to do two's complement...
 
negative numbers will have highest bit set
right shifting it preserves sign
look at it this way: unsigned right shifts do what you expect
 
@R.MartinhoFernandes perforce does that too!
 
signed right shifts act like the high bit is stuck - and imagine it shifting one bit at a time. it's called "sign-extension"
 
4:42 AM
@Mysticial More accurately, on negative integer is IB. Just being signed doesn't cause a problem, as long as it starts out non-negative.
 
@JerryCoffin Oh right, I forgot to mention that part.
 
@Mysticial x86 has both LSR (logical shift right) and ASR (arithmetic shift right) instructions. So no, you wouldn't have to implement it to find it. Now, if you meant something that didn't have an ASR at all, that would be a different story.
 
@JerryCoffin Well yeah, since x86 (and pretty much everything) doesn't distinguish signed from unsigned integers.
 
@AndréPuel if the high bit is 1, it will "shift in" 1's as it shifts. if the high bit is 0, it will shift in 0's
 
@JerryCoffin I was referring the existence of a C/C++ environment that didn't have arithmetic shift behavior for signed integers.
 
4:47 AM
@JerryCoffin there are special shift instructions for signed, as mentioned by mystical, and conditional branch instructions specialized for signed comparisons
 
@Mysticial I think it's safe to say that's only likely to happen when/if that's all the hardware supports.
 
ja for unsigned, jg for signed, for example (a=above/unsigned) (g=greater)
 
@doug65536 Really? I'd never have guessed. :-)
 
@Mysticial It was a good answer :|
 
@JerryCoffin well ok then!
 
4:49 AM
@R.MartinhoFernandes :)
 
oh wrong person, shoulda said it to mystical
 
@doug65536 The problem is that they don't really have full control (that is the point of UB) and they will not be understanding anything useful. You will only waste their time teaching them things that they won't use when you could be teaching useful stuff.
 
@doug65536 Actually, treating a result as unsigned also allows a cool trick or two.
 
@MooingDuck you have a few seconds?
 
4:52 AM
@R.MartinhoFernandes lol
 
@R.MartinhoFernandes Oh hey! I've started playing with Boost.Coro now that it's been properly released. What are the things I should watch out for? Namely, limits in expressive power (and nevermind that forced_unwind crud)?
 
I like that teacher
 
@R.MartinhoFernandes Should've answered "The Force", of course.
 
The strong nuclear force, of course
 
Jan 17 at 9:49, by R. Martinho Fernandes
@Luc (Namely, I am interested in the interactions between early returns, loops, exceptions, try-catch, and the coroutine glue).
And recursion, but I know that is explicitly forbidden.
 
4:59 AM
Loops that use coroutines right?
 
I think early returns are okay. I.e., the control flow is really high level.
 
Yeah, I can see that working easily.
 
Btw there's a range interface, but it's Boost.Range specific -- in particular it doesn't work with a range-for out of the box. AFAICT that's only because of a lack of ADL, if you spice the associated namespace up then it works!
Interestingly coroutines are also available as input ranges and it has occured to me I've never tried range-for with those.
 
@LucDanton Oh, awesome. I want to give it a spin for sentence break iterators (since I will be writing an FSM, not having to twist around the logic to fit an iterator is awesome). And if the range interface exists I don't need to write it :)
Do coroutines have value or reference semantics?
 
5:04 AM
Fairly sure it's the former. For one, they're move-only.
 
Ah, right, value semantics without copies.
 
First interesting example I got to work was auto up_to = [](int N) { return coro { [N](coro::caller_type& yield) { for(int i = 0; i != N; ++i) yield(i); } }; }; for(auto&& i: up_to(15)) std::cout << i << '\t'; to work, given using coro = boost::coroutines::coroutine<int()>;.
 
Though coroutine-backed iterators won't do for my future plans :(
 
@R.MartinhoFernandes Not promiscuous enough?
 
@LucDanton Won't work for bidirectional iterators.
I want iterators to be as powerful as possible depending on the algorithm and the underlying iterators. E.g. it isn't complicated to iterate grapheme clusters backwards, if the underlying range can be iterated backwards.
You can't rewind coroutines, though.
Oh wait a moment.
Maybe you can.
Passing a direction argument might do.
 
5:10 AM
As much as I've found my coro::caller_type& yield hack funny, I have to admit that auto&& arg = yield(foo).get() doesn't look that nice.
Um, what kind of recursion were you interested in?
 
@LucDanton Tree iterators!
 
@LucDanton is this a little bit like IEnumerable<T> in C#?
or a lua closure
 
yes that is a nice architecture - permits infinite sized input
so the coroutine feature you're using is returning early, then resuming after that part next time?
 
@LucDanton JFTR C# supports recursion, but not yielding from try-catch (for reasons of practicality, not feasibility).
@doug65536 Yes.
 
5:27 AM
so, after compiling boost for 64 bit, I compiled it for 32 bit...and it didn't need to do any compiling, just copied stuff....should I be worried
 
@melak47 no idea what you're using to build
 
@doug65536 boost's thingy
b2.exe
 
if you built the whole thing it should have had to compile some of the libraries
 
Dammit.
 
yet another build system. why boost why
 
5:33 AM
@StackedCrooked just what is it you're doing there?
 
I was replying to a message posted hours ago but I thought it was recent because of a server hang.
 
does anyone know what difference it makes whether you have python installed when building boost?
 
Poco has its own build system as well.
 
messages say you don't "need" python
 
Without python you have -2 luck during build.
 
5:36 AM
@StackedCrooked that's what I thought it meant. thanks!
 
I don't think I have python installed right now
it built just fine. (I think)
 
@R.MartinhoFernandes if you can get an rough ienumerable equivalent working, linq is only a thin layer on top
 
oh you bastards
> The release today of an HTML5 web based store for the Amazon Music Store to be accessed from an iOS device is aggressive and a win/win situation for the web giant.
Er, I dunno. It's not like they just invented fire. Calm the fuck down..?
I mean, aside from the media, does anyone actually care?
 
5:41 AM
This is the problem with the media nowadays. They've found a new thing to sensationalise (read: everything ever described as "new" on the web, even if it's not) and they will not relent.
 
It's not really an aggressive move. It's more like the next logical thing to do.
 
btw, if you cast a dupe vote now, it instantly adds the dupe banner to the top of the question.
 
@R.MartinhoFernandes function style linq, like: mycollection.Select((x) => x * 2).Where((x) => (x & 4) != 0)
 
Yeah it was the logical thing to do three years ago, and it happened. And it wasn't newsworthy then.
@Mysticial orly
 
That seems like a kit if potential for abuse since you could cast a dummy dupe vote and stick a banner onto any question.
 
5:42 AM
meta url plz
 
@LightnessRacesinOrbit I haven't made it yet, but I noticed it on this question:
-1
Q: What are these questions with Yellow Highlighted box

TechExchangeOn refresh of new questions some questions are highlighted with Yellow Background Box. i dont so any significance in those question and questions which are highlighted are random. any one please explain what this means ? very curious..

 
-1
Q: how to merge register.php to html

squid267I'm trying to create a user system for my website. So I successfully made a register.php. <?php // dbConfig.php is a file that contains your // database connection information. This // tutorial assumes a connection is made from // this existing file. include ("dbConfig.php"); //Input vaildati...

OK I just tested it
 
The banner was up there after just one close vote.
 
you're right
that's fucking retarded
 
That's very abuseable.
I mean like...
 
5:42 AM
what the hell is wrong with the devs nowadays
Since Jeff left they are just pissing all over common sense. Did he fail in entirety to hire anyone for his team that had even an iota of intelligence?
 
The next time a question gets on the multicollider or reddit, what will stop me from shamelessly casting a close vote to one of my questions for free publicity?
Not that I'm going to do that. But others might.
And it's not like vandalism edits that can be instantly reverted.
 
@Mysticial You're evil.
 
This banner sticks.
Should I make a formal meta post?
 
@Mysticial Really? Dupe banners used to be just text injected into the question, which you can edit by hand.
 
@R.MartinhoFernandes Not anymore.
 
5:48 AM
0
Q: How come a single duplicate vote can now have such a prominent and official-looking effect?

Lightness Races in OrbitI see that the "close as duplicate" feature continues to undergo changes. Unfortunately, I must report negatively on this newest one. This time, it's that a banner is added to a question as soon as the very first dup-vote is cast: This just seems: ripe for abuse: you can vote for absolutely...

fucking losers
 
ah you beat me to it.
 
yeah I have to admit when I saw that I was seriously wondering what they were on
 
I was gonna title it: "Automatic insertion of dupe-banner after just one close vote is vulnerable to abuse."
 
@Mysticial it's cos I'm awesome :D
@Mysticial by all means edit mine to that :D
@Mysticial cos that's good
btw I love how I tested this by dup-voting some arbitrary question I found in . It must say something that I actually don't give a moment's fuck whether or not that vote was accurate
 
no one cares about mysql
also I can close vote now so it's weird they added this just as I got the privilege.
 
5:53 AM
I seem to be all over these dup system changes
e.g.
-2
Q: Changes to "close as duplicate"

Shog9As you may have noticed, Jarrod's been hacking away at some design changes to the "close as duplicate" UI. These are the first fruits of some discussions we've been having internally regarding the "close" UI as a whole, with the goal being a smoother, easier-to-understand experience for all invol...

 
@StackedCrooked A CONVERT!!!!!!!!!!!!!!!!!!!!!
I am literally already listening to them
 
A convert? Me?
 
and just spent 5 hours trying to get my friends to listen to them too
@StackedCrooked ok, it's possible that you introduced me to them.
 
5:54 AM
If you did, just pretend that you didn't, so that my messages make sense. Ta.
 
I've discovered Yuki Kajiura with the .hack//sign anime and I've been listening almost exclusively to her music since then.
That was probably over two years ago.
So I understand :D
 
if i use fprintf to output to a file…i can't see contents of the file until fclose() is called?
 
@LightnessRacesinOrbit is it working out?
 
@StackedCrooked they weren't into it
@StackedCrooked but that's okay
@StackedCrooked I am enough for them all
 
It's always like that.
 
5:57 AM
@StackedCrooked I assume then that it was you who started me on this crazy journey, since I know it started in this room
 
If you try to get somebody to like something they eventually build up a barrier against it.
 
I have been quite obsessed with this lot over the last week or so. You can't see that as we are not FB friends, but it's true
 
@LightnessRacesinOrbit Yeah I remember even.
 
@StackedCrooked No it was a 0.15-minute barrier
@StackedCrooked I was quite disappointed in them
 
Alf is another convert btw.
 
6:00 AM
@StackedCrooked Nice for him
 
Would you agree with the claim that C++ is the most difficult (mainstream) programming language to learn?
 
3
A: C++ binary IO printing function name

Lightness Races in OrbitYou are invoking a massive amount of undefined behaviour. Enough to lift my car. A quantity capable of propping up a bar. Sufficient even to raise the dead! Reading data into a non-existent buffer through an uninitialised variable is just asking for the sort of trouble that you are currently exp...

 
> You are invoking a massive amount of undefined behaviour. Enough to lift my car.
lol
 
6:15 AM
./test: error while loading shared libraries: libboost_thread.so.1.53.0: cannot open shared object file: No such file or directory
^ Runtime error.
It's in /usr/local/lib How can I fix this without resorting to LD_LIBRARY_PATH?
 
@Rapptz lol
 
Ah. Found the answer here.
 
here
here
_here_
 
*here
 
6:27 AM
*****here*****
 
oh cmon you piece of crap
 
What design do you really want??
 
you can't predict a simple escalametion?
 
6:28 AM
 
Cool, seems like I broke the link.
 
You did now.
:P
 
Excellent. :D I did that for a purpose.
 
6:32 AM
Does anyone know how I can get a direct link to the music-that-is-being-played-with-flash on a webpage?
 
Soundhound?
 
does boost filesystem need linking?
 
Yes, chain it with your libraries.
 
ah well fuck
don't feel like linking so I guess I won't use it
 
@Rapptz Yep.
And IIRC it needs to be put after the main.cpp in the build command line.
 
6:38 AM
too much work just to find out if a file exists =|
gonna stick with winAPI
 
SSH in the browser.
shit
I locked the root user with: sudo passwd -l root
 
My user account is not in the sudoers file.
I can't sudo.
And I can't login as root.
 
Wait, you have been using root all this time?
 
I have.
 
6:49 AM
Oh, you would sudo with root's password.
 
The webserver doesn't run as root though.
 
No SSH key for root?
 
Yes, but I can't login even from my local terminal which logs in without password (using private key).
Probably because the root user is locked.
 
-l only locks the password.
 
I'm prompted for a root password when I login.
And I get permission denied.
 
6:53 AM
You're fucked. :/
 
I seems so.
If it was a physical machine I could boot from a separate disk.
 
I'm leaving to work now. Good luck with that :S
 
what happened?
 
I created a new user and disabled root access.
 
Oh..
 
6:58 AM
However, I forgot to add this new user to the sudoers list.
Now I can't sudo and I can't login as root either.
I'm checking my options on the VPS webview.
> The incorrect configuration of SSH, sudo and/or iptables could cause you to be locked out of your system. If this occurs, please log into the The Rackspace Cloud Control Panel and use the Web Console or Rescue Mode to repair the configurations.
 
@StackedCrooked Looks like this isn't the first time this has happened...
 
I guess :)
 
The banner disappears as soon as there's a reopen vote, too?! i.stack.imgur.com/EyVbq.png That's...equitable, I guess, but even more stupid. — Josh Caswell 1 min ago
 
7:21 AM
I can't wait until I hit 100k rep so I can finally use the production version of Stack Overflow; having to use the test servers is a bit annoying. What I find strange is that this privilege isn't listed on the privileges page. — R. Martinho Fernandes 5 mins ago
massive respect for the semicolon <3 <3
 
I got my coroutine implementation down to 80 cycles per context switch (avg)
 
is there a way to get all the file names in a directory?
 
dir /b
 
I meant in code
 
platform dependent isn't it?
opendir / findfirst / FindFirstFile / etc?
 
7:26 AM
yes
 
@Rapptz find . -type f
Or just ls
 
I just want to walk a directory, I think that's what it's called
 
@Rapptz Boost filesystem has a directory_iterator. If you don't like that, perhaps a less portable version will do.
 
Ah, from C++.
I've used Poco::DirectoryIterator in the past. But today I'd prefer boost.
 
I can't get boost to link properly so I'm avoiding it
 
7:29 AM
That way you'll never learn how to link it :P
 
-3
Q: x86 assembly code convert to c

user2045371I have the following x86 assembly code: Loop: movl -24(%ebp), %eax movl -12(%ebp), %edx sall $2, %edx addl %edx, %eax movups (%eax), %xmm0 movl -32(%ebp), %eax movl -12(%ebp), %edx sall $2, %edx addl %edx...

^^ lol
 
Kids these days..
 
@StackedCrooked I know how to link, it's just boost isn't for some reason
I tried outputting ld errors verbosely but I couldn't find what was wrong
 
It sometimes helps to put the -lboost_system at the very end of the build command.
Order can matter sometimes.
 
@StackedCrooked oh that worked
^^
 
7:33 AM
:D
 
Ell
Why does the order matter?
 
Because it sucks.
 
Ell
Yeah
Would a module system fix that?
 
Honestly, I don't know either :)
 
@Ell I suspect that would fall under QoI (in other words: it could, but wouldn't necessarily).
 
7:40 AM
gcc links in left to right order, if a later library needs something it already went past, it wont be linked
you can repeat libraries though
 
7:55 AM
Aha
Suddenly everything becomes chrystal clear :)
 

« first day (844 days earlier)      last day (4090 days later) »