« first day (294 days earlier)      last day (4647 days later) » 

1:19 AM
^ Send this to a girl :)
 
1:43 AM
lol
what you still doing up?
 
2:24 AM
I'm up, like a network.
 
2:37 AM
hey guys
quick question
I have an int that is 0xA242D711
I want to make it 0xA242D700
How can I do that using bit shift oeprator?
?
 
@user635064 You could right-shift 8 bits, and then left-shift 8 bits. You'd normally prefer something like input & ~x0ff though. If you do the right-shift, you'll want (need) to cast to unsigned before the right shift.
 
thanks jerry
whats the tilde?
is it 'not'
 
@user635064 Yes -- bitwise not. Looking at it, I also have a typo. It should be 0xff instead of x0ff.
 
would i do this: input &= ~0xff ?
 
user457812
Pizza is a gift from some god or other
 
2:50 AM
@user635064 Yes, that should work.
 
Jeryy
 
@nil Each of the four food groups (pizza, chips, sodas, alcohol) is a divine gift.
 
user457812
Truth.
 
@JerryCoffin One last question: I am looking at a programs memory, and I see the bits as: A2 42 D7 09 but when I %x this in C, I get: 0x9d742a2 , do you know why this happening?
in other words, why is it flipped?
 
@user635064 You're apparently using a little-endian processor (e.g., Intel), which means the first byte is treated as the least significant bits, the second byte as the next least significant, and so on. There are also big-endian processors (e.g., 68K, most RISCs) which would treat that sequence of bytes as 0xA242D709.
 
3:05 AM
ah i see. thanks for your help.
 
@user635064 Sure.
 
user457812
Endianness is so much fun
 
Rob
3:33 AM
@JerryCoffin It's worth noting that the byte order actually is flipped in memory because of CPU enddianness. I like to remember little endian as an inverse mapping of the bye order between processor and memory.
Although I'm a bit late to the party :(
 
4:25 AM
Hey how do i make forms with c++? It's really professional looking and im kinda tired of terminal apps lol.
 
@tanner On what system?
 
linux. (debian distro to be exact ;)
 
@tanner Probably want to look at something like Qt or gtkmm. You can write code directly for X, but unless you're quite masochistic, you probably don't want to.
 
Awesome! gt has its own ide too?
sorry qt
 
4:52 AM
@tanner Yes -- QtCreator. Quite a nice IDE at that.
 
@JerryCoffin Yeah, i checked it out and it handles great You guys are really good.
 
Rob
Qt is definitely very nice
 
Well, I have an early morning -- going whitewater rafting tomorrow. Good night all.
 
 
2 hours later…
Als
6:58 AM
@JerryCoffin: You rocked the entire yesterday(depending on where I am it was yesterday)...Have a good time.
 
 
3 hours later…
9:44 AM
hi
 
Als
Hello @DeadMG
 
10:14 AM
Hey man
 
sorry about last night
my internets died :((
 
I figured something like that :L
Just wondering, but is there any way that you can use SSL without having a trusted certificate
 
don't even know what SSL is
 
Secure Socket Layer, HTTPS
 
11:03 AM
I ran visual studio last night to set it up and I'm considering doing a big Windows project
 
what kind of project?
 
:L Yeah
Anything, anything anyone suggests
 
Oh, you don't know what you're going to do yet.
By "Windows projects" I assume you mean something with a Windows GUI. Am I right?
 
Yeah, that's the only requirement
 
11:14 AM
Woo, got a shiny new badge.
 
you can build a front end for my parser if you would like
 
You can build a front end for my BitTorrent client if you would like.
:P
Ah, that was the only new badge around: "Proofreader".
I'm still hoping to get "Taxonomist" one day.
@DeadMG What does a GUI for a parser look like?
Something that displays the AST?
 
well, it looks like Visual Studio
although presumably not quite that much
 
You mean, an IDE?
A text editor with smarts?
How would IntelliSense work with DeadMG++?
Seems complicated.
 
yeah, you would have to background-compile
but that's not a big deal
 
11:19 AM
I downvoted all except sanchitsingh's answer on this question: stackoverflow.com/questions/6966299/…
and provided reasons!
 
You're a mean person.
(or maybe not, let me check.)
 
(in the case of Nawaz, no reason is needed. his wikipedia quote does it for me)
i don't like to have people confused
 
Why is Nawaz's answer wrong?
36
A: Origin and evolution of the word "hapless"

Alain Pannetier ΦThis is right; hap is a root that appears in many English words and its original meaning is indeed that of "good luck". It is traced back to Old Norse (the language spoken by the Viking invaders who entered the English scene during the 9th century. In Old Norse, you would have these two words: ...

Interesting.
 
11:35 AM
@RMartinhoFernandes he has now fixed it. and the subtle point of his fix-edit is that both parses generate a diagnostic, so both parses are valid in a way. but the other c++ parse is invalid because it won't generate a diagnostic
 
> Use tabs for indentation only. Don't align anything at all, even spaces are messed up for people using proportional fonts. [...] – ybungalobill 10 mins ago
Who the fuck uses proportional fonts for code?
lol, this is a very funny read: Generalizing Overloading for C++2000.
 
@JerryCoffin On Linux and Mac I've been using QtCreator for over year now. It's good and keeps improving.
@RMartinhoFernandes I suppose it's a joke article?
 
11:51 AM
Yeah, for sure.
 
Ah written by Bjarne himself, it's definitely a joke then.
 
Why? Bjarne writes these kinds of jokes often?
> Yes, of course the Generalizing Overloading for C++2000 that I wrote and published in the April 1998 issue of "Overload" is an April Fool's Joke. I hope you enjoyed it.
 
He wouldn't seriously write this.
 
Who would?
> In addition to the overloading of missing whitespace, etc., this distributed version includes overloading based on the color of identifiers.
 
Some wacko.
 
11:54 AM
> The lack of universal availability of color printers and problems of color blind programmers caused me to leave this feature out of the standard.
 
operator blue()
return Depressed(this);
How does the star ranking algorithm work?
 
Someone mentioned that sometime ago. It's based on the number of stars and the time. And there's some exponentiation in it.
 
Here's a minor code challenge: for a given interval return all sub-intervals
 
sbi
Be careful what you buy on ebay. It might be scrapped parts of a weapon from the future.
 
@StackedCrooked Huh, that's a very poor spec.
 
sbi
12:06 PM
@RMartinhoFernandes Ah, you found the whitespace paper. (And did you see who produced the PDF?)
 
@RMartinhoFernandes closed interval, smallest interval has length 1 ([a, a]), integral numbers (discrete)
so [0, 4] => [0, 0], [0, 1], [0, 2], [1, 2], ...
 
@sbi It's on the front page: Bjarne.
 
Oh my god :L
Glad to live in england
 
sbi
@RMartinhoFernandes He wrote the text, but he didn't type it into Acrobat. The version I had ten years ago, told who converted it to PDF in the PDF's meta data.
 
Hmm, let me check.
Who's "ark"?
Andrew R. Koenig?
 
12:09 PM
arkansas?
 
sbi
@RMartinhoFernandes Yep.
So the paper says Bjarne has written it, but the PDF says Andrew did. :)
Here's another interesting news: Should @DeadMG ever go astray, this invention from South Korea might help us finding him again.
 
think you have to do that kind of thing before birth
 
sbi
@DeadMG Time travel is something we have practiced here.
 
You know, I don't understand why there's coffee makers but no tea makers
It's crazy
 
Maybe this is the reason.
> When the 'Drink' button is pressed it makes an instant but highly detailed examination of the subject's taste buds, a spectroscopic analysis of the subject's metabolism, and then sends tiny experimental signals down the neural pathways to the taste centres of the subject's brain to see what is likely to be well received. However, no-one knows quite why it does this because it then invariably delivers a cupful of liquid that is almost, but not quite, entirely unlike tea.
 
12:23 PM
@KianMayne They're both horrific drinks :)
 
sbi
@KianMayne Actually, there's a quite simple two-step explanation: 1) Tea doesn't taste well when processed by such a machine. 2) If you don't care, tea bags are simple enough.
 
@sbi But coffee is even simpler
I considered making one once, then decided against it because the solutions i came up with like getting sugar into the mixing section, were quite rube goldberg solutions
@DeadMG When I got my girlfriend to try tea for the first time, she said it tasted like broccoli water :L
 
i dunno about coffee but tea is the simplest thing to make, no need for a machine
leaves -> teapot, hot water -> teapot, wait...done
 
sbi
12:34 PM
@RMartinhoFernandes #RefRef
Anyway, the sun is shining for a change. I need to buy some groceries, and then I'll spend the rest of the day outside, I guess. If the weather stays like this, I might even stay in the garden overnight. I guess using WWW-powered chat might not work over UMTS, so I'll probably be offline tonight.
Have a nice weekend everybody!
 
Sometimes it's a bit disheartening - you can answer C++ questions all day long and get one upvote per post, but if you answer one silly JavaScript question you get tons of votes... Only to be outdone by the question about 0 being octal, I suppose...
 
@sbi /me jealous
 
@Kometes Don't bruise the leaves :-)
 
@sbi Have a nice weekend (:
 
@sbi Try capping via UMTS :-)
 
12:40 PM
@KerrekSB JS is weird.
 
how do you bruise leaves?
 
@Kometes Black tea: just pour boiling water, straight off the boil, fine. Green tea: Water should be about 60-70 degree Celsius, otherwise you bruise.
 
I want a new challenge people
I'm bored of writing <input> tags for now
 
Hmm... a potential future employer will probably require me to use C#. Should I go for it or look for something else to right now?
 
@KerrekSB oh, yeah, I run my water boiler as an asynchronous task, it usually cools down a bit by the time I retrieve the future's result
 
12:55 PM
@KianMayne Write a script that writes <input> tags for you! Preferably in Lisp.
@Kometes A temperature semaphore is called for. Beware of tea/coffee deadlocks, too.
 
@KerrekSB Hahaha - I've heard of lisp
But never really looked at any of it
@KerrekSB Also, I really love C#, definitely one of my favourite language
 
Hey if i have to manage 300+ clients what storage system should i use?
 
I dislike C#
 
@KerrekSB duly noted
 
it's better than Java by some way, but still Badâ„¢
 
1:01 PM
At least Java is cross-platform (more or less).
 
so is C#
it runs on Windows, 360, Windows Phone, and there's Mono for Linux and even an implementation for iOS and PS3
 
The language probably is.
 
Two words: Gnome.
Mono is entrenched in it, and it's the default DE on lots of distros.
 
I'm not sure Mono is good.
 
not having it be good is very different to it not existing
 
1:03 PM
Philosophically speaking.
 
And Java does not run on iOS :P
 
True.
 
i wish MS dumped all that money into C++ dev instead of C#, what a waste
 
Languages like C# have their place.
2
Not a place where I want to be though.
I wouldn't code customer forms in C++.
Actually: I wouldn't code customer forms.
 
I've never used Java, but I just don't like the idea of having to load a huge runtime every time I want to run a tiny bit of code for the sake of being able to use it anywhere
 
1:12 PM
I thought you wanted to write something big, not a tiny bit of code.
 
customer forms, my first line would be std::life::abort()
 
@KianMayne Apparently it's great for code generation tasks -- a friend of mine wrote a webserver in Lisp which is super fast, and it also supports lispy code generation in a highly intuitive and expressive fashion. I guess that's what you call "domain specific language", and Lisp excels at creating those...
@KianMayne I'll probably go for it, because it's otherwise a very fine opportunity, but I got a bit nervous about C#'s casual conflation of references and values, and how you can cause a dynamic allocation without even noticing...
 
@KerrekSB Sounds pretty cool, is it like any other language
 
@KianMayne and yet you like C#? Am I missing some key piece of information here that'd make this make sense?
 
@KianMayne From my limited, unqualified opinion, I'd say it's unlike every other language, but I'm definitely not qualified to say that
 
1:17 PM
@jalf Come on, at least you don't see it and it doesn't ask you to install updates every week
 
@KianMayne Ever heard of Windows Update?
That's how the .NET Framework gets updated.
And having frequent updates is probably a good thing.
 
@RMartinhoFernandes But that's quieter, less obnoxious and isn't just for one small component
@RMartinhoFernandes Chrome also has frequent updates, but they run in the background with no user interruption
 
Whatever. That's not related to having "huge" runtimes.
 
@KianMayne But it still loads "a huge runtime every time you want to run a tiny bit of code"
Java's updater is absurd, but I don't see how that makes a difference to the argument you made, which was about loading huge runtimes
 
@KianMayne Oh, I don't have .NET 4.0 on my Windows, but when I looked into installing VSE10 it required 1.8GB, in large parts due to its need to install .NET 4.0. At that point I gave up...
 
1:23 PM
@KerrekSB That's wrong. The .NET4.0 installer is way smaller than 1.8GB.
It weights less than 100MB.
 
installer size != installed size
 
Oops.
Nevermind. I see that the 64-bit version is indeed HUGE.
 
@DeadMG But 18 times bigger?
 
The 64-bit version requires 1.5 GB of disk space.
 
doesn't have to be 18 times bigger to be a large part of 1.8GB
 
1:25 PM
D: OK, I understand your point
@DeadMG If the installer had the compressed files in it, and it was 100mb...18 times compression
 
@KianMayne The installer not only unpacks the things, but it also NGENs them.
 
no
he only said it was a large part of 1800MB
it could be as low as 4-500MB for that
 
Anyway, you don't have to load up 1.5GB to run a tiny bit of code.
But it sure loads a lot, if you are running only a tiny bit of code.
 
sheesh, a few nested lambdas and MSVC just gives up on inlining. Typical...
 
@RMartinhoFernandes No, but that was the unsurmountable entry barrier for me to the world of managed code, and VSE10 in particular :-(
 
1:34 PM
Btw, when I say I liked C# I was mainly talking about writing it :L and it's structures
 
But why do you care about the size of Java's runtime, and not of .NET's?
 
Why do you care about size of the runtime at all.
 
oh come on... It doesn't even inline a call to the deque iterator's operator+. That's just lazy
 
@KianMayne OK, do tell me how you can sleep at night knowing that x = y can cause a dynamic allocation.
 
@KerrekSB It can?
@jalf Did you forget to enable optimizations?
 
1:36 PM
in which language?
 
@KerrekSB Because I'm too busy thinking about things like what I'm going to do the next day ;)
 
@RMartinhoFernandes no, of course not ;)
 
I was shown this example: Everything is an object. Value objects are values, reference objects are dynamic. Interfaces are reference objects...
 
Oh, boxing.
 
... so if you say int y = 5 you're automatic. But now you can say IComparable y = x
 
1:37 PM
@KerrekSB but x = y can cause plenty of dynamic allocations in C++ as well. ;)
but in a managed language, at least allocations are generally much cheaper
 
And whoops you've created a dynamic object? Without even saying new? And any two of those are references to the same thing?
 
Virtual machines preallocate.
 
@RMartinhoFernandes And because when C#s loads, it doesn't make a big fuss
 
@KianMayne does Java?
 
@jalf Hell yes! I don't want crap clogging up my tray
 
1:39 PM
Wait, what?
 
@KianMayne ...
 
Last time I checked, it didn't.
 
@KerrekSB It really doesn't matter.
 
@KianMayne Are we still talking about Java?
 
:L Yes
 
1:39 PM
@KerrekSB You need to recalibrate your giveadamn ;)
 
There is little difference between a stack and a manually managed heap with preallocation.
 
@jalf I've been puzzling ever since whether C++ and C# really have the same level of explicitness in their syntaxes... of course, in C++ you can have typedefs to references and converting constructors... but somehow I felt that in C# you can create references without "feeling" it in the syntax.
 
@KerrekSB true in a way. But in C++ you can create values without "feeling" it. ;)
 
@RMartinhoFernandes But those are not just low-level worries. If I say y = x and then modify y, I want to know whether that affects x or not. I got a strange feeling that in C# you might fall into some traps there.
 
TBH, I don't see a reason for supposedly OO languages to have non-object types at all.
 
1:41 PM
in the end, I don't really think one is worse than the other. But definitely different flavors, and it's kind of unfortunate that they look so similar on the surface
 
@KerrekSB Assignment never changes other variables.
 
@CatPlusPlus performance, is usually the reason
 
@jalf It's quite possible that the same pitfalls exist in C++ too, just that I'm so used to the usual constructions that I can tell immediately.
 
:)
 
But yes, you can find some rope for hanging yourself if you mess around with value types without knowing what you're doing.
 
1:42 PM
@RMartinhoFernandes In C++: int x; int & y = x; y = 5; That changes x.
@RMartinhoFernandes I wish I could use C++/CLI. I'm sort of curious about those managed gadgets, but I think C++/CLI is very neatly designed, so that everything would "feel" right.
 
@KerrekSB I was talking about C#. Assignment in C# doesn't change other variables (module unsafe code, but I think we can keep that out for now)
 
@RMartinhoFernandes So, even if I say int x; IComparable y = x; IComparable z = y; z = 5;, do I not change y?
 
Oh. So, copying references makes deep copies?
 
@KerrekSB No. Assigning a value type (int) to a reference type (IComparable) boxes it.
 
1:46 PM
How would I make a reference to y?
 
@RMartinhoFernandes and boxing creates a copy
 
Ahh, got it
 
so y is a reference to an object distinct from x
 
And... I forgot! There is one situation where you can change other variables with assignment! C# has pass-by-reference.
 
1:46 PM
So z is no longer a reference to y after the assignment?
 
@KerrekSB Exactly.
 
@jalf Yes, that I know, but I was talking about z and y
 
You guys might have completely shifted me back to C++ instead of C# :L
 
@KerrekSB right. It gets a reference to another boxed int with the value 5
 
Hm. OK. Well, I guess that's pretty logical.
 
1:48 PM
Having a reference doesn't mean you can change the original object. All names in Python are references, for example, but with x = 42; y = x; y = 69 you don't change x, you rebind the name to another object.
 
@KianMayne just wait until Fred starts talking about Haskell then.
 
Well, you're used to C++.
 
Or is it ... wait, if I wanted z to be a true reference to y and change y via the reference, how would I do that?
 
You can only do that if z is a ref parameter.
 
@KerrekSB in C# you can call a function with ref y
 
1:49 PM
@jalf I've heard the name, and that's it
 
@CatPlusPlus But then there's no semantic meaning in "all names are references", is there? That's just an implementation detail.
 
but ref can only be used in function parameters, not variable declarations at function or class scope
 
So ref IComparable y = z?
 
@KerrekSB No, only function parameters can be ref.
 
nah, can't do that ,but you can do foo(ref y) to pass a reference to y
 
1:50 PM
Though that's a language restriction. The runtime supports refs everywhere. Don't tell anyone.
 
which works like a C++ reference, where it's an alias of the original variable, so modifications are reflected
 
So what's the analogue of C++'s int & z = y; y = 5;?
 
@KerrekSB Er, no, it's language defined that after x = 42; y = x both names are bound to the same object.
 
@KerrekSB doesn't exist exactly
if you want to do something like that, you could wrap the int in your own reference type
 
@CatPlusPlus Ah. Is the rebinding an explicit act then?
@jalf Oh OK, I see.
 
1:51 PM
Assignment rebinds the name.
And you cannot have a name that's not bound to an object.
 
@KerrekSB There was a proposal to add a Box<T> type to the framework that would do that, but it didn't make it.
Johannes is up to no good. Again.
0
Q: What's a "recursive_init_error" exception?

Johannes Schaub - litbI decided to do a test with computed gotos and local statics void g() { std::cout << "init "; } void f() { int z = 0; y: z++; static int x = (g(), z == 1 ? ({ goto *&&y; 0; }) : 0); } int main() { f(); std::cout << "!"; f(); } I wanted to see whether the ou...

 
I wonder if there's a way to simplify this code enough for the compiler to inline it voluntarily
would prefer not messing with __forceinline and the like
 
But with C++ I find it hard to get my head around all the calls to the windows things (well I did about a year ago, haven't really looked back recently)
 
but pretty significant perf hit when it's not inlined
 
I heard that VC++ is not very aggressive at inlining.
Is it true?
 
1:55 PM
@RMartinhoFernandes not sure, tbh. I haven't heard that before
 
It's the same with Assembly I just have to work really hard trying to work out what it all **means**
I should probably learn it properly this days
 
I think every C++ compiler is pretty aggressive with inlining, because generic programming relies so heavily on it
 
AFAIK, it pays more attention to inline hints than GCC, dunno about aggressiveness.
 
and admittedly, this chunk of code is getting a bit bulky. A lambda to be called from a scope guard's destructor, which in turn calls 3 or 4 for_each instances each with its own lambda
and a few other bits and pieces
 
Sounds like you're pushing it.
 
1:57 PM
@RMartinhoFernandes Uggh. What does goto *&&y; do??
 
I know. But the old (simpler) version was inlined, and when I tried to optimize it a bit, I lost 20-40% performance in most of my benchmarks
as far as I can see because it is no longer being inlined
 
I can't make sense of this syntax static int x = (g(), z == 1 ? ({ goto *&&y; 0; }) : 0);. WTF is it?
 
isn't the && in that context some gcc extension?
 
@KerrekSB I think I know as much as you.
 
some fancy dynamic label syntax, I think?
basically "goto arbitrary address"
 
1:58 PM
I thought gotos aren't allowed to cross declarations.
 
I'm also baffled by the code block inside the conditional.
 
GCC extension.
Blocks as expressions or some such.
 
the braces are a compound expression or something like that I think, but I also thought that was a GCC extension
@LucDanton Yeah, indeed
 
i.e. int x = ({ statement; more statement; 0 }); initializes x to 0.
 
There's only one sane response to that kind of code
goto
2
 

« first day (294 days earlier)      last day (4647 days later) »