Saturday, May 3, 2008
Blog has moved to softwareramblings.com
Tuesday, April 29, 2008
Thread Affinity on OS X
SetThreadAffinityMask()
on Windows and sched_setaffinity()
on Linux. However, I was very surprised to find that it does not appear to be possible to do this on OS X! Tuesday, April 22, 2008
Coding The Architecture
Friday, April 18, 2008
ToDo Lists
After trying 20+ different applications over the past 10 or so years, I constantly return to Abstract Spoon's ToDoList application. This is without doubt one of the most flexible ToDo list managers out there and it acquires new features at a fast pace. This application really defines the meaning of feature rich. I have used it successfully for managing simple lists, project scheduling, time tracking, and SCRUM backlogs, burndown charts and even for online SCRUM boards. It is difficult to describe its feature list in a simple blog post so I encourage you to download it and give it a twirl.
Tuesday, April 8, 2008
Visual C++ 2008 Feature Pack Released
Saturday, April 5, 2008
C++ Lambda Functions
vector v(10);
generate(v.begin(), v.end(), rand);
for_each(v.begin(), v.end(),
[](int& x){ cout << x << " ";});
OK, so the syntax looks a bit strange at first, but it does add a powerful construct to the language.
Lambdas have only just been added to the C++0x standard and support for lambdas are not included in the beta version of the Visual Studio 2008 TR1 feature pack.
For more details and examples of lambda functions, check out Herb Sutter's recent trip report from the February/March ISO C++ standards meeting.
Wednesday, March 19, 2008
C++ TR1: stdint.h still missing from Visual Studio
Since the C++ standard was finalized in 1998, it missed this standard header by a year. In the latest update to the C++ standard (namely those extensions covered in TR1), support for this header has been added in the form of the cstdint header.
It is astonishing to find that a header that was standardized 9 years ago has still not made its way into Visual Studio 2008. Not even the recent feature pack beta which included support for most of the TR1 extensions, contained stdint.h! The lack of support for this header was logged as a bug with Microsoft way back in 2005 but is still in the "postponed" bucket.
Thankfully, there are a number of implementations of stdint.h available, the most notable being Paul Hsieh's cross-platform free implementation and also a Microsoft compiler specific implementation. Simply place one of these implementations into the Visual Studio standard include paths and stdint.h support magically appears ... now why can't Microsoft do something like that!
Saturday, March 15, 2008
C++ TR1: array VS 2008 Bug
The TR1 array container template provides functionality for implementing a fixed size array. This is a halfway point between plain old C style arrays and C++ STL vectors. The defining property of the array container is that its size is fixed. Consider and example of an array of 4 integers:
array = { 0, 1, 2, 3 };
Since it adheres to the STL container rules, it must implement methods such as size(), and max_size(). For the array container, both of these should return the size of the array, which is fixed. In the above example, both should return 4. However, when using the VS 2008 TR1 implementation of array, a bug appears. The code:Produces the output:#include <iostream>
#include <array>
using namespace std;
using namespace std::tr1;
int main()
{
array<int, 4> arr = {1, 2, 3, 4};
cout << "size: " << arr.size() << endl;
cout << "max_size: " << arr.max_size()
<< endl;
return 0;
}
instead of:size: 4
max_size: 1073741823
If we take a look at the implementation of max_size() we can see the problemsize: 4
max_size: 4
Instead of simply retuning N (the size of the array), it performs the same computation as if this was a vector.size_type max_size() const
{ // return maximum possible length of sequence
size_type _Count = (size_type)(-1) / sizeof(_Ty);
return (0 < _Count ? _Count : 1);
}
This issue has been logged as a bug with Microsoft and will hopefully be fixed before the "Gold" release of the feature pack.
C++ TR1
TR1 ("Technical Report 1") is a specification for new functionality being added to C++'s standard library. This functionality takes the form of new class and function templates for things like hash tables, reference-counting smart pointers, regular expressions, and more. TR1 itself is just a document.
The TR1 draft does not contain any background information on the functionality it provides and doesn't contain any examples for how it should be used. For this sort of information refer to the proposal documents which were used to define the TR1 functionality. The relevant proposal documents are nicely catalogued by Scott Myers.
Microsoft have recently released a Beta version of the Visual Studio 2008 Feature Pack which includes support for most of the C++ standard library extensions described in TR1.
GCC v4.x also provides support for most of the extensions.
Over the next few weeks (more likely months) I plan on playing with the new TR1 features and I will add thoughts, learnings and code snippets to this blog.
Friday, February 22, 2008
Effective Concurrency ... so far
The Pillars of Concurrency
How Much Scalability Do You Have or Need?
Use Critical Sections (Preferably Locks) to Eliminate Races
Apply Critical Sections Consistently Avoid Calling Unknown Code While Inside a Critical Section
Use Lock Hierarchies to Avoid Deadlock
Break Amdahl's Law!
Going Superlinear
These are an excellent set of articles on the subject of concurrency and programming for multi-core that analyzes the many facets of the subject - from background theory, to locking and on to achieving scalability and performance.
Saturday, February 16, 2008
Hiring Good Programmers
The company that I work for is currently embarking on a hiring spree. So I thought it would be a good idea to refresh my interviewing skills before I launch myself into the hiring process.
A recent Coding Horror entry highlights "The Years of experience myth" which is the inadequacy of trying to "match-- exactly and to the letter-- some highly specific laundry list of skills". Unfortunately when dealing with some recruitment agencies, I find this an all too common practice. Instead it is vital to remember that "... what software developers do best is learn. Employers should be loooking for passionate, driven, flexible self-educators who have a proven ability to code in whatever language -- and serving them up interesting projects they can engage with."
Joel Spolsky sums up the characteristics that employers should be looking for in future employees as "Smart and Gets Things Done".
So, now that we've figured out what to look for in a candidate, lets look at some resources that give tips for screening CVs, conducting phone screens or face to face interviews.
- The Guerilla Guide To Interviewing - Joel Spolsky gives practical and pragmatic advice on the whole process.
- Getting the Interview Phone Screen Right - because its very expensive to get it wrong.
- The Five Essential Phone-Screen Questions
And finally since the phone screen is probably the most important stage, it's worth highlighting the two common critical mistakes that an interviewer could make in the phone screen:
- Don't let the candidate drive the interview. The interviewer should do most of the talking, guiding the conversation along until they're satisfied the candidate knows the answers to the questions (or has given up).
- Watch out for one-trick ponies. Candidates who only know one particular language or programming environment, and protest complete ignorance of everything else, are a giant red warning flag.
Friday, January 4, 2008
» 10 techniques for gathering requirements | 10 Things | TechRepublic.com
» 10 techniques for gathering requirements 10 Things TechRepublic.com
When doing interviews of JAD sessions for the purposes of gathering requirements, try to ensure that you are in the same meeting room as the participants. This helps to build up a raport with the participants which generally leads to a more open dicussion which helps to produce better requirements.
Don't forget the 5 whys approach when gathering requirements. Often what a customer says he wants is different to what he needs. Dig into each requirement to fully understand why this is valuable to the customer and then ensure that the requirement is aimed at solving the root cause of the customers problem.