standard

Is there a common blog API in the works?

I've used the Blogger Data API and I know WordPress has an API of their own, but is there any standard in the works? Hypothetically, if you were starting your own blog-style CMS that you wanted to make available via a web service, what API would you choose? ...

C++ source in unicode

What is the standard encoding of C++ source code, and does standard even say something about it? For example, can I write C++ source in UNICODE? Like, use non-ASCII characters in comments? Can I use chinese characters in comments (is full UNICODE allowed or just that 16-bit first page or whatever it's called). Further more, can I use...

Which compiler is correct for the following overloading/specialization behavior?

Consider the following code: #include <stdio.h> namespace Foo { template <typename T> void foo(T *, int) { puts("T"); } template <typename T> struct foo_fun { static void fun() { foo((T *)0, 0); }; }; } namespace Foo { void foo(int *, int) { puts("int"); } } using namespace Foo; int main() { foo_fun<int> fun; fu...

Are constant C expressions evaluated at compile time or at runtime?

If I write a #define that performs an operation using other preprocessor constants, is the final value computed each time the macro appears at runtime? Does this depend on optimizations in the compiler, or is it covered under a standard? Example: #define EXTERNAL_CLOCK_FREQUENCY 32768 #define TIMER_1_S EXTERNAL_CLO...

XHTML or HTML 4.01 ?

What is your preferred format for html content? Why do you choose one over the other? ...

Problems with const set&. Compiler/STL bug or non-portable usage?

Are there any language lawyers in the house? Should the following code compile? include <set> bool fn( const std::set<int>& rSet ) { if ( rSet.find( 42 ) != rSet.end() ) return true; return false; } On one of the platforms (Sun Workshop) this does not compile. It reports that the find function returned an iterator and the end fu...

Which is the best, standard (and hopefully free) C++ compiler?

Saludos a todos en stackoverflow.com!! So... I'm a C++ newbie currently taking the subject of Data Structures, and I want to consult something with you guys: Since I started studying Systems Engineering, I've been using the last version of Dev-C++ for all my programming projects. It has done it's job well so far, but it has a FATAL fla...

How to detect Render Mode of browser for current page?

I know that modern browsers generally have two render mode: standard mode and quirk mode. The browser detects the heading DocType. The question is how to detect render mode of current page at runtime. Is there any Firebug tool to do that? ...

Partially read standard output of another process created from c# application

I have a GUI application within which i'm spawning a console application using Process class. Process p1 = new Process(); p1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p1.StartInfo.CreateNoWindow = true; p1.StartInfo.UseShellExecute = false; p1.StartInfo.FileName = Path.Combine(basepath, "abc.exe"); p1.StartInfo.Arguments = "/pn...

std::allocator construct/destroy vs. placement new/p->~T()

For a project of mine, I am writing some STL containers from scratch (I have my reasons). Since I am mimicking the functionality and interfaces of the STL so closely I am doing my best to keep with the policy "if it has the same name as a standard construct, it will conform to the standard as much as possible." So, of course my containe...

Why is std::for_each a non-modifying sequence operation?

I just read in the C++ standard that std::for_each is a non-modifying sequence operation, along with find, search and so on. Does that mean that the function applied to each element should not modify them? Why is that? What could possibly go wrong? Here is a sample code, where the sequence is modified. Can you see anything wrong with it...

process has exited but the buffer is still being printed, c#

hi i created a process in C# to execute an external program, i used the asynchronous methods to read on the standardoutput and all is working fine. However i have an issue, i'm printing a line indicating the process has finished. The problem is that, some times it may so happen when the data in the buffer is huge that, the process may ex...

C++ empty-paren member initialization - zeroes out memory?

I originally wrote some code like this: class Foo { public: Foo() : m_buffer() {} private: char m_buffer[1024]; }; Someone who is smarter than me said that having the m_buffer() initializer would zero out the memory. My intention was to leave the memory uninitialized. I didn't have time to discuss it further, but it piqued ...

Compliance test for OpenID providers

What automated standards-conformance tests are there for OpenID providers? I'm making changes to the implementation of an OpenID provider, to bring it from version 1.1 of the standard to version 2.0. Before releasing the code, I want to be sure that it conforms to the specifications of the standard. For testing web standards compliance...

<input type='hidden'> above html dtd

Hi, I know that I should put all the html elements in body tag, but I need to put two hidden input above html dtd. I guess it does not make my html file as standard, but is it that bad? I have following code. <input type='hidden' id='current_controller'> <input type='hidden' id='current_module'> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...

C++ (Really) Safe Standard String Search?

Buffer overrun problems are well known. Thus we were blessed with standard library functions such as wcscat_s(). And the kind folks at Microsoft have created similar safe string functions such as as StringCbCat(). But I have a problem where I need to search a bit of memory for a string. The Standard library function: wcsstr( wchar_t* ...

Images for .NET buttons

I have an application which will support several standard operations play stop pause undo I'd like to have images for those buttons. I've been searching through vs2005 image library but the images there are non consistent. For example the play button (playhs.bmp) is green while stop (stophs.bmp) is blue. Also I haven't found an und...

Digital copy of the C++ standard?

Does anyone know where I can get an digital copy of the C++ standard for download? My google-fu does not appear to be strong enough. ...

is size_t always unsigned?

As title: is size_t always unsigned, i.e. for size_t x, is x always >= 0 ? ...

Why default return value of main is 0 and not EXIT_SUCCESS ?

Hello, the iso 1998 c++ standard specifies that not explicitly using a return statement in the main is equivalent to use "return 0". But what if an implementation has a different standard "no error" code, for example "-1" ? Why not use the standard macro "EXIT_SUCCESS" that would be replaced either by "0" or "-1" or any other value de...