standards

README 80 character limit or just let the users editor handle it?

I am sure a lot of people will argue both ways and unfortunately there seems to be no 'official answer'. Part of my just wants to write and not pay any attention to this seemingly insignificant detail but I am curious how does the SO community feel about one option over the other? If you have an opinion state it and give supporting rea...

Company standards: C#.NET vs VB.NET vs. whatever.NET

Just a question that came up from time to time at my old job when we were considering fleshing out our development staff with additional bodies. Does it really matter, if you are a .NET development house, if your developers all code in one language vs another. I probably started out like alot of the 4million other folks there with Visu...

In C++, when can two variables of the same name be visible in the same scope?

This code illustrates something that I think should be treated as bad practice, and elicit warnings from a compiler about redefining or masking a variable: #include <iostream> int *a; int* f() { int *a = new int; return a; } int main() { std::cout << a << std::endl << f() << std::endl; return 0; } Its output (compiled with ...

Difference between 'global' and 'static global'

A global variable's scope is in all the files.. while a static global variable's scope is just the file where it is declared.. why so ? where are global or static global variables stored in memory ? ...

What are some of your most useful database standards?

I have some ideas, but I really want to know what makes things go smoothly for you when modeling database: Table name matches Primary Key name and description key Schemas are by functional area Avoid composite primary keys where possible (use unique constraints) Camel Case table names and field names Do not prefix tables with tbl_, or...

How useful is PHP CodeSniffer? Code Standards Enforcement in General?

I'm dabbling with the idea of setting up PHP CodeSniffer on our continuous integration server in an effort to improve the quality of our code-base. After reading the documentation I'm very excited about the idea of normalizing and enforcing our coding standards. However, I'm left wondering about the actual improvement to our product. I'm...

Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not?

I have seen it asserted several times now that the following code is not allowed by the C++ Standard: int array[5]; int *array_begin = &array[0]; int *array_end = &array[5]; Is &array[5] legal C++ code in this context? I would like an answer with a reference to the Standard if possible. It would also be interesting to know if it mee...

Standards for queries over SOAP

Is there a standards-sanctioned XML format for describing entity queries? Background: I plan to build a library for writing queries over WCF services. On the client I want to be able to write (C#): var customers = from c in service.Customers where c.Name.StartsWith("P") order by c.Name ...

How much flexibility do you allow users creating uids?

After having to register at one more website, and hitting stupid restrictions on the Username (no spaces or special characters), I'm wondering why we still have programmers restricting things like that. Is there a concensus on the methodology of allowable usernames? ...

Why are HTML character entities necessary?

Why are HTML character entities necessary? What good are they? I don't see the point. ...

Will HTML 5 specify a way to get the client's location and culture info?

I have this web service... It serves up HTML in response to an AJAX request, and the web service needs to be aware of: the user's specific language the user's timezone or location I understand that this is currently quite infeasible. BUT... It seems that HTML 5 will have a Geolocation API! Awesome. This should take care of my timez...

Reading vCalendar and vCard using .NET?

I want to be able to read vCard and vCalendar data using .NET, I have something which does this, and have looked at the specification. For those not familar with the format here is some test data from my current application: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft Corporation//Windows Calendar 1.0//EN CALSCALE:GREGORIAN METHOD...

How to use Fortran compilers to parse-check or pretty print source files?

Is there a way to tell ifort or gfortran to just try to parse a source file (no include following, no compilation, no linking, etc) to tell us whether they find the syntax of the file acceptable / valid for a given Fortran version (77, 90, 95, ...) or at least valid at all? I'm working on a piece of software that will parse and analyze ...

When is a C++ terminate handler the Right Thing(TM)?

The C++ standard provides the std::set_terminate function which lets you specify what function std::terminate should actually call. std::terminate should only get called in dire circumstances, and sure enough the situations the standard describes for when it's called are dire (e.g. an uncaught exception). When std::terminate does get cal...

What's the best way to write a standards compliant popup window with XHTML and Javascript?

I'm writing standards compliant XHTML Strict 1.0, so including the HTML "target" attribute on anchor elements will not do. I've read 2 fundamentally different ways using Javascript: Upon document load, find all links with rel='external' and append the target='_blank' attribute. Use the HTML onClick attribute that fires a Javascript po...

Coding for IE vs Coding for W3C Standards

Another chapter from the "arguments between myself and the other senior developer" series :P My position is that when doing web development, browser code should be written first and foremost to adhere to the W3C web standards, even though Internet Exploder has the greater market share (anywhere between 51% and 79% depending on who is do...

What is the breakdown of all of the layers required/recommended for an Asp.Net Mvc Application following best programming practices?

The more I read into Asp.Net MVC the more layers and components I find out are required in order to make my application follow all of the standards and best programming practices. It's starting to get a bit confusing because some of the new layers don't seem to fit in as easily as the others I learnt. So I just wanted someone to go over...

Why does strlen() return a 64-bit integer? Am i missing something?

When compiling a 64bit application, why does strlen() return a 64-bit integer? Am i missing somthing? I understand that strlen() returns a size_t type, and by definition this shouldn’t change, but... Why would strlen need to return a 64-bit integer? The function is designed to be used with strings. With that said: Do programmers commo...

How to extract frame timing information from animated GIF?

This is brought on by a previous question. Apparently ImageList doesn't support animated GIFs, so I'm stuck animating it myself. I know how to extract the frames, but does anyone know how to extract the frame timing information from an animated GIF? ...

Developing for constant change in a corporate environment?

I work for a large company currently going through a merger. We are working on several projects involving and not involving the merger. One problem I'm noticing is that many of the groups of developers are very fragmented, even though they mostly support many different projects within their own realm of the business, and the databases ...