« first day (838 days earlier)      last day (4109 days later) » 

5:00 PM
We can't have that
 
Oh wait, it's built into Microsoft(TM) Notepad. Save the pseudo code and Notepad will compile to a binary (with signature EF BB BF, FE FF or FE FF depending on target platform and architecture)
 
Xeo
Alright, time to get going. See y'all tomorrow.
 
@sehe "TM"?
 
@EtiennedeMartel ­™
 
I know, but why specifically mention it there?
It seems like one step away from "Micro$oft".
 
5:11 PM
gah, is there a way to tell windows explorer to regenerate the stupid thumbnails?
 
Xeo
Try deleting thumbs.db
(It's a hidden system file in the folder.)
 
it's not there
I know you used to have to disable that it keeps those around
but I didn't even do that
derp.
the thumbnail wasn't broken, the picture I downloaded was.
 
diskcleanup allows you to delete the thumbnail data
 
@Xeo You ever done indexing a tuple by tag type?
 
5:28 PM
k, last night I got everything set up so I can play zelda while using the treadmill
 
Nice cactus.
 
or theoretically any computer game, but mouse/keyboard are hard to use on a treadmill.
 
this might be a stupid question... but can you make an array of a size greater than the max of int?
 
@Crowz No.
 
@Crowz maybe: up to the max value of size_t
 
5:29 PM
Oh, right.
 
@Crowz but probably not
 
Damn.
 
Why would you want to?
 
6
Q: What's sizeof(size_t) on 32-bit vs the various 64-bit data models?

anonymousOn a 64-bit system, sizeof(unsigned long) depends on the data model implemented by the system, for example, it is 4 bytes on LLP64 (Windows), 8 bytes on LP64 (Linux, etc.). What's sizeof(size_t) supposed to be? Does it vary with data model like "long" does? If so, how? [1] en.wikipedia.org/wi...

 
I mean, such a large array would probably be too big for your address space anyway.
 
5:31 PM
@Crowz heh, 64 bit windows, no. 64 bit linux: yes
 
I'm trying to do this sieve majiggy and I need to make a pretty huge array
 
@EtiennedeMartel virtual address space is over 4 billion times bigger than the max int value on most systems.
 
Size: 600851475143
 
@Crowz holy.... what is the element type?
@Crowz you you have 560-2240GB of RAM to store that in?
 
@MooingDuck Not size, that's the number haha
 
5:34 PM
@MooingDuck Isn't it 8 TB on Win64? Assuming a 32 bit int, that would make it, what, 2000 times bigger?
 
@Crowz you need to rethink everything, you aren't going to find a computer able to do that
 
And on Win32, you get 2 GB, so size_t is likely to be bigger than the address space.
 
@JerryCoffin new returns regions of void*.
 
@EtiennedeMartel oh right
 
As for non-Windows OS, well, who gives a shit about them?
 
5:36 PM
@Rapptz No, just unzip both Clang-3.2 and GCC-dw2-4.6.3-2 to the same directory, and include mingw32-dw2\bin in PATH.
 
@EtiennedeMartel Yeah, 8TB
@EtiennedeMartel I'm pretty sure it's safe to assume a 32 bit int in Win64.
 
@rubenvb I'll try that when I get home.
Thanks :D
 
@EtiennedeMartel Though Windows Server 2012 tops out at 4TB physical memory.
 
@MooingDuck Sounds reasonable.
 
@EtiennedeMartel I don't understand why those limits are in place at all :/ I'm sure there's a reason, I just don't know what it is. (as opposed to allowing anything the hardware does up to 2^64)
 
5:39 PM
@rubenvb It returns a region pointed to by a void *, but the region itself is neither "void *" or "void".
 
@MooingDuck Market segmentation.
If you want higher limits, pay for the more expensive edition.
 
@EtiennedeMartel also looks like the most expensive edition each time has 2x the max physical memory, so you'd have to upgrade each release cycle as well as the most expensive edition. So it's about $$$
 
It's always about money.
Especially with Microsoft, because they love their damn segmentation.
 
@JerryCoffin It says, in §1.8/1, objects are created by new-expressions, and objects have a type, so yes, new returns objects of type void*. You don't have access to the raw regions of storage as far as I can see.
new might allocate a bit more raw memory that you as a programmer knows nothing about.
 
@rubenvb Can't you overload the new operator for types, or the generic new operator, to use a different allocation method or something?
Also, I know about the extra raw memory that new allocates. In addition to overhead optimized word-packing, it also typically prepends the size of the allocation block, and can include other things for memory verification.
I've done some sub-new-level hacking for custom allocation schemes, and I've seen stuff regarding pool and heap allocators that does this.
 
5:49 PM
@rubenvb ::operator new is not a new-expression.
 
@ShotgunNinja no, but you can overload the operator new for types.
32
Q: Difference between 'new operator' and 'operator new'?

SandeepWhat is difference between "new operator" and "operator new"? Thanks.

 
@MooingDuck OHHHH ok.
 
@ShotgunNinja sorry to be pedantic :D The spirit of your question was good, just had one word wrong
 
@MooingDuck No, it's fine. I'm sure that'll come in handy at some point in my profession.
 
@ShotgunNinja probably not
wait, I have an answer that explains it somewhere....
 
5:52 PM
Well, if I'm ever asked that by an interviewer at a game company that uses C++, I'll know it.
As one possible example of usage.
 
16
A: How to properly free the memory allocated by placement new?

Mooing DuckUsing the new operator does two things, it calls the function operator new which allocates memory, and then it uses placement new, to create the object in that memory. The delete operator calls the object's destructor, and then calls operator delete. Yeah, the names are confusing. //normal ver...

 
Does calling ->~SomeClass() calls all the inherited Destructors too?
 
I don't see why it wouldn't... destructors normally call through the entire inheritance chain automatically, do they not?
 
@Nican it will call base class destructors. It will only call derived destructors if one or more base classes (or this class) has a virtual destructor.
@ShotgunNinja you're new, welcome!
 
@MooingDuck Nah, it's just that I never really studied destructor usage in C++ properly, and that knowledge got overwritten by learning Java in school, because my school is dumb.
I taught myself C++, which is to say, I don't know it as well in some spots as in others.
 
5:59 PM
@ShotgunNinja Not really dumb per se.
Java is used a lot in the industry.
 
@EtiennedeMartel Unfortunately, yes.
 
@EtiennedeMartel ...by lots of stupid people.
 
@JerryCoffin That is just anywhere.
 
@JerryCoffin C++ as well.
 
@EtiennedeMartel That too.
 
6:02 PM
Java does a hell of a lot of detail hiding, though... the problem is that OO-languages have a lot of details that should be understood clearly.
 
@ShotgunNinja Eventually, yes. But at first? Meh.
 
some (Torvolds) argue that C coders tend to be more skilled than C++ because it's harder. Argument could also apply for C++ to Java.
 
That's like saying you need to learn assembly before C++ because you need to know how it works underneath.
 
@MooingDuck I would tentatively agree; learning one language gives you a different insight as to how all of them may work.
 
@MooingDuck Torvalds is a tool. Also, harder language means there's also more people using it the wrong way.
 
6:03 PM
I would not say it is harder, it just takes a different kind of attention and practice.
 
@EtiennedeMartel Hey, I learned assembly after C++, but it definitely improved my understanding of a lot of things in programming.
And having a C compiler generate "optimized" AVR assembly taught me even more.
 
@EtiennedeMartel I agree on the first point, and wouldn't be surprised at the second.
 
Discussions like this always remind me of an old line that goes something like: "Free verse is the most difficult form of poetry to write acceptably -- and therefore the one most often attempted by those who cannot write any form acceptably."
4
 
Using C++ or C or Java well is different from just picking and using any of the languages at all...
 
@MooingDuck Let's just say Torvalds' argument was "I'm better than you so I'm right".
 
6:06 PM
@EtiennedeMartel He makes a few points that are valid (ie worth considering, not necessarily "right"). The "C is harder" is one of them.
 
Anyway. Teaching Java is not a bad idea. Teaching only Java is.
 
I can pick C but still slap my keyboard like a retarded freshwater seal: just because it's C doesn't make it any less retarded.
2
 
Oh well, back to fixing a Java Struts web application T~T
 
@EtiennedeMartel I wish many universities understood thus. =[
 
It's funny; my school is offering an elective course in C# next quarter, and it's got my entire SE class excited...
 
6:08 PM
C# is cool. Very cool.
 
Perhaps they, too, are tired of the tedium of Java.
 
C# IS SO NIIICE
Q-Q I hate working in C++ sometimes just because C# does it nicer. =[
 
Fully agreed. Microsoft actually did something of significant value.
 
I think if I were to design a new language, I'd design it so you write the implementation, and the compiler (or another tool?) generates the "header" automatically. Still get the interface/implementation separation, but no longer have to match separate files.
 
@ShotgunNinja Oh, you hater.
 
6:09 PM
@ThePhD I'd be interested in specific traits that you find "nicer"
 
@MooingDuck SEE I WISH C++ WOULD DO THAT FOR ME
 
Microsoft has great engineers lead by crappy managers.
 
@MooingDuck What you just mentioned, of course.
 
@MooingDuck I think the header should be generated as documentation, or as a synchronizable UML diagram or something, that you can edit and suck back into the implementation.
 
@EtiennedeMartel Many of the managers do not know how to code. WHich is what bothers me the most.
 
6:10 PM
@EtiennedeMartel that is probably true for most companies
 
@ShotgunNinja Not just documentation, but also for other codes/coders to interface with.
 
@MooingDuck Why is that separation so important?
 
Bill Gates knew how to program. And would mark-up full pages of documentation about code and source code itself. He understood what was going on in the Hardware and Software.
Ballmer? I don't think Ballmer can code.
 
@EtiennedeMartel giving a header and a lib to customers but not sharing copywritten implementation details
 
6:11 PM
And as such he's surrounded himsefl with a legion of people who do not know how to code.
 
@MooingDuck Oh, right, "customers". Forgot about them.
 
@ThePhD Bill Gates could do those things, but he was a novice coder.
 
Or, you could simply share the lib itself.
 
user142019
@JohanLarsson hey. Can you add me to the collaborators of UnitCalculator? My username is daknok.
 
Why use headers? Headers are crap.
 
6:12 PM
Copywriting is the act of writing copy (text) for the purpose of advertising or marketing a product, business, person, opinion or idea. The addressee (reader, listener, etc.) of the copy is meant to be persuaded to buy the product advertised for, or subscribe to the viewpoint the text shares. Copywriters are used to help create direct mail pieces, taglines, jingle lyrics, web page content (although if the purpose is not ultimately promotional, its author might prefer to be called a content writer), online ads, e-mail and other Internet content, television or radio commercial scripts, pres...
 
@EtiennedeMartel C++ headers are, I'm talking about some vaguely-header-like "interface file". Like javadocs.
 
@MooingDuck Why?
C# doesn't have that.
 
@EtiennedeMartel because a lib with no public interface is useless.
 
@MooingDuck Share the lib, and generate usable UML/documentation signatures or something, that can be integrated into IDEs and used in the same way as headers.
 
@Zoidberg hey baby, I created a repo today. Then I though maybe you want to own the repo?
 
6:12 PM
And it works well.
 
@EtiennedeMartel How does C# do libraries? (not a challenge, an actual question)
 
user142019
"baby" :<
 
@MooingDuck An assembly.
 
user142019
@JohanLarsson oh also fine. I'll make it.
 
@EtiennedeMartel lol at oracle, I don't understand google really
 
6:13 PM
Which contains not only its code, but also the metadata.
 
@EtiennedeMartel and coders just use the docs to know what's in it and the signatures?
 
@MooingDuck Almost like Java does it.
 
@EtiennedeMartel enough for the linker yes, but not coders (to my knowledge)
 
@Zoidberg ok I'll remove my from github then
 
@MooingDuck C#'s library system is "assemblies", which are packages of precompiled source, light documentation, and usable signatures for code completion.
 
6:13 PM
@MooingDuck Most libs ship with a XML file containing the comments.
 
@Nican java has javadocs, which is similar enough to my "implementation file" idea.
@EtiennedeMartel that's... something. I prefer my way.
 
But without that XML file, IntelliSense still works.
 
@ShotgunNinja oh, didn't realize that was a special C# term, I get it now.
 
I just wish that C++ would have something similar. =/
 
The point is, the "interface definition" thing is embedded in the assembly itself.
You don't have to ship a separate set of headers or whatever.
 
6:15 PM
I still want UML integration with code...
 
@EtiennedeMartel I like that even better.
 
You just drop the DLL somewhere, add a reference to it, and voila, you can start coding.
 
@ShotgunNinja I hate UML. Everyone hates UML. Except managers
 
I don't understand why all the interfaces I write can't be inline, and the compiler just generate the header/interface file or definition for me.
It's a real pain, for C++.
 
@EtiennedeMartel The biggest problem with this in Java is the lack of Javadoc integration in half of the libraries that get exported.
 
6:16 PM
@ThePhD C++ was not designed to do that :(
 
@MooingDuck Which makes me sad. Very, very sad. =[
 
@ShotgunNinja that can't be solved in any language, that's a completely social problem for which there can be no technical solution
 
@MooingDuck Would that be considered a limitation of C++ as a language?
 
And makes me do things like make Header-Only DLLs.
 
@ShotgunNinja yes
 
user142019
6:17 PM
@JohanLarsson I'll create the VS solution. WPF, right?
 
@MooingDuck Because managers are in the UML :P
 
@EtiennedeMartel Pretty much like a COM object with an embedded TLB.
 
@MooingDuck Well, still, the fact that stuff like method argument names get lost is really obnoxious... combined with the fact that you don't get any useful description of what things do.
 
@JerryCoffin TLB?
 
@JerryCoffin You know, that is strangely similar.
 
6:17 PM
@Zoidberg a solution with one wpf project and one F#, maybe a C# test project also
 
It's almost like both .NET and COM were made by Microsoft.
 
user142019
So a C# WPF project and an F# library?
 
@ThePhD It'd be interesting to see a C++ extension that added public and private before functions/classes, and during compilation would first scan those and copy enough prototypes for the public ones to generate/update the header file, and then do the normal C++ compilation.
 
@Zoidberg I invited you to a separate room
 
@EtiennedeMartel Strange how that works isn't it?
 
6:19 PM
@MooingDuck, you've seen this, right? isocpp.org/blog/2012/12/…
 
@JerryCoffin Ah.
 
@JerryCoffin So weird.
 
@MooingDuck I'd write one of those myself if I had enough knowledge and time.
Maybe after this game project I'll write C+ .
Just one plus. To confuse the shit out of everyone.
 
@ThePhD I have yet to name the language I've been tweaking in my head. BUt it will be googlable.
@rici similar concepts, but no I haven't seen it yet
 
@MooingDuck Well, if you ever want some help with making it happen, just tell me it's sort of like C# and I'll be right there with you. :D
 
6:21 PM
@ThePhD It's sort of like C++. Important Feature #1: unambiguous simple non-whitespace-sensitive non-deliminated parsing, like lua.
 
If I make a language, it'll be called "Shit". Because that's what it'll be.
 
@EtiennedeMartel Then I'll make a compiler called Shitfuck, which will (hopefully) compile it into Brainfuck.
 
@ShotgunNinja And I'll write the runtime for it, called ShitfuckStack!
@MooingDuck I'm not sure what that means, but I want it! :D
 
@ThePhD Nice!
 
@MooingDuck: I think it's pretty cool, within the bounds of the "possible" in terms of c/c++ standards.
anyway, llvm has some sort of implementation, so it's almost not vapourware.
 
6:25 PM
@EtiennedeMartel Without a french twist?
 
Right.
I could call it "Grosse Marde".
 
//python pseudocode
var a=3; //SEMICOLON
if (a==3)
    print(a); //tabs needed to tell where the if is!
//LUA pseudocode
a = 3 //no semicolon
if a = 3 then
print a //indentation not needed
endif
@ThePhD ^
 
Lua doesn't do var a
 
@MooingDuck: local a if a == 3 then print a endif
 
I think he meant local
 
6:27 PM
How about:
if a .eq. 3 then
print *, a
endif
 
whatever, point is THE PARSING
 
oops, i meant print(a) end
 
@EtiennedeMartel Whoops, induction smelter has changed, rich slag now works with ores, not dust.
 
the parsing is simple. lua is a recursive descent parser
 
@rici exactly
 
6:29 PM
it's even context-free :)
 
@rici EXACTLY
 
@LucDanton Woa.
 
@EtiennedeMartel It's harder to make as well.
 
lol
 
@rapptz, yeah that slide really grabs your attention, doesn't it :)
 
6:34 PM
yep. Pretty impressive.
 
@Rapptz Include frenzy!
 
Long live the day you pass a cpp file through the preprocessor, and actually see what is going on.
 
@Nican every compiler has a flag for that
 
@Mohsin strings reserve space behind the scenes, much like a vector in order to make best use of contiguous space. he was wondering if you got the values mixed up which I doubt since you even stated that you printed out the length. — rfcoder89 1 hour ago
^ helpful guy is helpful
... answers comment from May 2011
 
I really really like the idea of the module system.
 
6:37 PM
@Rapptz srsly
 
Ell
I want to write a lua parser to teach me parsing
 
@Rapptz there is an actual proposal. open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf
Possibly it's been updated, I don't know.
 
Yeah I know.
I've been waiting for it to get standardised for a while.
 
@Rapptz Give it another 10 years
 
yeah. unfortunately standards processes make glaciars look agile.
 
6:39 PM
Hoping for C++14.
 
Oh you crazy optimist
 
@Rapptz If it happens, it's gonna be with C++17.
 
@Rapptz definitely not, the committee guys said that C++14 will be minor changes, bugfixes, and library additions only, like tr1 was. C++17 will have the big stuff.
 
@MooingDuck :(
Also I like the idea the commenter has.
 
On the bright side, if there is reasonable consensus then implementations may well exist well before c++17
 
6:43 PM
I'm surprised it doesn't.
Headers are a huge pain in the ass.
 
The companies which own huge code bases will definitely be pushing for it.
Gregor's description is pretty close to the experimental llvm code, i think.
but one implementation isn't enough. two, maybe.
 
@rici big companies pushing for change? you must be dreaming.
 
@bamboon, on the contrary, i used to work for one
 
@rici cool, which was it?
 
not the same one as gregor works for.
 
6:45 PM
I can't wait for C++17 to have modules ._.
 
@rici quite the opposite, companies with huge code bases fear change
 
Why do standards committees have to dedicate themselves to be slow?
 
I'm still unclear on certain aspects of modules though.
 
WELP
It's global variable time!
 
@MooingDuck: they fear change which they don't feel in control of.
 
6:48 PM
@MooingDuck Some companies still compiling with VS .NET 2003 and related compilers. :D
Pretty sweet, if you ask me.
 
How is that "pretty sweet"?
 
</sarcasm>
 
@ThePhD Most move as fast as they can -- but between the need to build consensus, meeting only 3 to 4 times annually, and representing lots of different interests, it's hard to get things done really quickly.
 
@JerryCoffin and not wanting to look like idiots when someone finds the big hole in the new idea
 
THEN IT'S UP TO US TO MAKE MOOOOVES!
 
6:50 PM
but almost nothing in IT is contingent on standards. standards almost always lag behind implementation.
 
@rici Undoubtedly some of that as well, but from what I've seen, even more determination to get it right simply because they want it to be right.
 
and an unimplemented standard might as well not exist
@JerryCoffin: sure, it was partly a joke
i'm not really critical of standards processes, mostly.
 
Hm.
I do believe I'm stuck.
Or, maybe not...
 
0
Q: How can I programatically determine if a program is in the user's PATH

steveo225I have an application that for debugging purposes launches an editor with a log file. The editor was set to kedit. After a RedHat release update, we no longer had kedit. We simply changed the default editor and added an environment variable to let the user choose what editor they preferred. The ...

 
I dunno. Let's find out..
 
6:51 PM
This is easy in C# :(
 
@Rapptz Welcome to C++, where easy is an afterthought.
 
@rici Depends on where you work, and on what sorts of things. Bigger projects tend to be more conservative and place higher value on stability. It's easy to ignore standards on a web page that will need replacement within a year anyway. It's not so easy when version 1.0 is expected to be at least 10 years out.
 
@JerryCoffin: my most recent job involved large-scale storage infrastructure including backup. There is probably nothing as conservative as that.
 
@ThePhD Oh hey. It is easy in C++ too.
std::getenv("PATH"); apparently.
 
6:55 PM
@rici Hmm....air traffic control.
 
@JerryCoffin: nuclear waste disposal?
 
@sehe I removed that question, my coworkers didn't like it.
 
however, it was clearly at the high end of the conservative scale. taught me a lot, too.
 
@Rapptz LIES.
 
6:57 PM
@FredOverflow You were wondering about constant functions in C++ yesterday, and I noticed an arg1, 0 in one of my unit tests today.
 
@ThePhD vs System.Environment.GetEnvironmentVariable()
 
@Rapptz For Windows, it looks like you want FindExecutable. To search specifically through PATH, you can use _searchenv.
 
@Rapptz using System
And guess what? IT WON'T POLLUTE THE REST OF YOUR PROGRAM WITH THE USING! :D
 
I bought an iPad stylus today and it's fucking epic
 
@rici That too, probably.
 
6:59 PM
@ThePhD There are a lot of cases of ambiguity though.
 
@ScottW I recommend women.
 

« first day (838 days earlier)      last day (4109 days later) »