source-code

sentimental code

I've came across an article that discusses the issue of "code admiration". Basically, the author talks about how developers should be more skeptic about code they write. How we may "admire" too much our code, attach our-self to it, making us more vulnerable to bugs and other mishaps that may be lien in from of us. How do you feel about ...

Source code hierarchies and header files (C++)

What’s the preferred way to reference header files from cpp files that are in different sub-directories in a project? For example, bear.cpp in the forest directory needs to include lion.h in jungle. Is there a better way than using `#include “../jungle/lion.h”? I would prefer to set an include path and simply use #include <lion>, but ...

Naming convention for fields and accessors in C++

What naming convention should I follow for class members? Right now, I’m prefixing all fields with an underscore, and using the regular name for the accessor method, e.g.: int _age and int age() { return _age; } Any preferred approaches? ...

Exemplary server side code

Hi It's all well and good talking about best practices and so on, but if you're anything like me there is so much to be learned from looking at great code. I regularly examine HMTL, CSS, Javascript using firebug, or when coding in C++ I can call upon any of the vast number of high quality open source projects, like boost. However, I d...

Display Django Code from a Django template

Hi, I am trying to display Django source code from a Django template.. However, I cannot find a tag similar to HTML's pre or xmp. Can someone point me to the right direction. Thanks EDIT Heres the code Also, I have a block with the same name.. which springs the error ...

Where can I find the source code for Java's HttpURLConnection.getOutputStream()

Where can I find the actual code (be it java or native) that's executed by: new URL("http://google.com").openConnection().getOutputStream() Bonus: how I can debug it from IntelliJ IDEA ? ...

Can a PHP script execute common code before exit() ?

How can something like the following be done in a PHP script? code{ $result1 = task1() or break; $result2 = task2() or break; } common_code(); exit(); ...

Do you rename code/modules with "old" names to their new names?

Here's the scenario. A long while back, the Powers That Be decided that a particular module should be called Widget Authorizations. As such, a whole lot of stuff was named after that: Database tables - AuthorizationTypes, AuthorizationFlows, etc. Database columns - Authorization_Id, Authorized_User, etc. Classes - AuthorizationBroker,...

FFmpeg LGPL distribution

Hi I'm making an LGPL distribution of FFmpeg. I'm going to distribute the executable with a zip containing the full source code of FFmpeg that I used when compiling the executable. some files in the FFmpeg source code are under a GPL license, can and/or should I include these files in the zip? (just to be clear, my executable is not co...

Appropriate Source Control solution

I have started a new job, where one of my first responsibilites is to import an ASP codebase previously maintained by an agency and now being taken in house. This codebase is currently stored in a Perforce repo. My new company has a single Subversion server running on a Windows XP desktop machine. This is used by some of their internal ...

Is reading library implementations a wasted or well spent time ?

I'm reading STL and Qt implementation now. The bits I need. And I ask question about things I don't understand. And I get some negative comments about that. I consider it a well spent time. In both cases I'm learning usable idioms. If some code seems to be overcomplicated (very often the case) I learn the reasons of it. I learn how to ...

How do you make sure your code does not get lost?

So, you're on to a new project and have already invested quite some time in it. Suddenly your hard disk breaks and you have lost all your hard work. Or not? Did you make sure that the code can be recovered in some way? Do you backup frequently, manually or automatically? How do you do this? Personally, I am trying to remind myself to m...

What am I able to do legally when I'm unpaid for a project as a freelancer?

A company has me developing software on a contract basis. The software is for a client of the company. The project had been split into phases, with the client paying a portion of the total after the satisfactory completion of each phase. The software will be hosted by the company for the client (as a service) after the completion of the ...

Is there a way to view .NET Framework library source code online?

...or do I need Studio to view it? ...

What is the best tool for a team of programmers to collaborate on a project?

Me and some friends are starting a programming group as a hobby and we're looking for a way to easily collaborate. Meaning, someone start working on the file, everyone on the team can see that he worked on the file, etc. We need something that's fast, free and not necesarilly full of features, we are doing this as a hobby and not as a ...

Represent script source code in XML

Are there any resources on how to represent (script) code in XML? Libraries, XML schema definitions for this? What I want to try is to generate a XML representation of (at first) simple script code (such as Bash shell scripts). So I would need support for variables, if/else, loops. Later on I want to be able to write language-independen...

Pre-Compiled websites code security

How far pre-compiling a website or project in VWD is safe ? I know that Reflector can retrieve the whole thing again (as it will be IL at the end of the day), and I heard that obfuscation won't go so far (not sure) there is tools to deal with obfuscation. Is there a good solution to guarantee that clients don't get to the underlying So...

Is TortoiseGit ready for prime time yet?

I'm a big fan of the simplicity of TortoiseSVN. I also am interested in digging into git, and think it would make a good fit for an upcoming project. However, a strictly command-line based app can be a little intimidating. I've followed the TortoiseGit project for a little while, and it looks like they are past 1.0. Is there anyone usin...

Good IM/Chat solution for pasting code

We've got several distributed developers working together on a couple of projects. We've been using Skype to host chats with all the developers, and it works okay except for one thing: It REALLY mangles any code we copy and paste into the chats -- especially the whitespace in Python. This question has tons of opinions about chat client...

How to generate a Java class which implements Serializable interface from xsd using JAXB?

I would like to introduce caching into an existing Spring project which uses JAXB to expose WebServices. Caching will be done on the level of end points. In order to do that classes generated from XSD using JAXB need to implement Serializable interface and override Object's toString() method How to instruct the xjc tool using XSD to gen...