language-agnostic

How much is File I/O a performance factor in web development?

I know the mantra is that the database is always the long pole in the tent anytime a page is being generated server-side. But there's also a good bit of file i/o going on on a web server. Scripted code is replete with include/require statements. Moreover, its typically a practice to store templated html outside the application in files ...

Invert 4x4 matrix - Numerical most stable solution needed.

I want to invert a 4x4 matrix. My numbers are stored in fixed-point format (1.15.16 to be exact). With floating-point arithmetic I usually just build the adjoint matrix and divide by the determinant (e.g. brute force the solution). That worked for me so far, but when dealing with fixed point numbers I get an unacceptable precision loss ...

Best practices for internationalizing web applications?

Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems. I think it would be useful to get the SO community's input for a set of things that programmers should look out for w...

Does the last element in a loop deserve a separate treatment?

When reviewing, I sometimes encounter this kind of loop: i = begin while ( i != end ) { // ... do stuff if ( i == end-1 (the one-but-last element) ) { ... do other stuff } increment i } Then I ask the question: would you write this? i = begin mid = ( end - begin ) / 2 // (the middle element) while ( i != end ) {...

How can I support the support department better?

With the best will in the world, whatever software you (and me) write will have some kind of defect in it. What can I do, as a developer, to make things easier for the support department (first line, through to third line, and development) to diagnose, workaround and fix problems that the user encounters. Notes I'm expecting answers ...

Visiting the points in a triangle in a random order..

For a right triangle specified by an equation aX + bY <= c on integers I want to plot each pixel(*) in the triangle once and only once, in a pseudo-random order, and without storing a list of previously hit points. I know how to do this with a line segment between 0 and x pick a random point'o' along the line, pick 'p' that ...

Sorting sets of ordered linked lists

I'm looking for an elegant, high performance solution to the following problem. There are 256 linked lists. Each list contains the same types of object that among other things holds a whole number that is used to define a sort order. All numbers across all lists are unique Each individual list is sorted in ascending order by these ...

Iterating shuffled [0..n) without arrays

I know of a couple of routines that work as follows: Xn+1 = Routine(Xn, max) For example, something like a LCG generator: Xn+1 = (a*Xn + c) mod m There isn't enough parameterization in this generator to generate every sequence. Dream Function: Xn+1 = Routine(Xn, max, permutation number) This routine, para...

The value of hobby game development

Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time? I have pursued small personal game projects on and off throughout my programming career. I've found the (often) strict performance requirements and escalating design complexit...

What applications is Python optimal for?

I'm already a professional J2EE developer by day, and Rails developer by night. I'm planning on adding Python to my list of skills. I'm already convinced a language is just a tool, so I'm not interested in a religious war. I agree with the Pragmatic Programmers that learning one language/year is a good thing for your professional develop...

Extracting Autocomplete Emails from Outlook 2007

Hello, I need to extract all the emails that show up as autocomplete entries in Outlook 2007. I mostly need to create a list of all the email addresses which I have sent emails to in the past and dump them into excel. Should I be connecting to Outlook through COM somehow? Thanks. ...

Basic programming/algorithmic concepts

I'm about to start (with fellow programmers) a programming & algorithms club in my high school. The language of choice is C++ - sorry about that, I can't change this. We can assume students have little to no experience in the aforementioned topics. What do you think are the most basic concepts I should focus on? I know that teaching so...

registers vs stacks

What exactly are the advantages and disadvantages to using a register-based virtual machine versus using a stack-based virtual machine? To me, it would seem as though a register based machine would be more straight-forward to program and more efficient. So why is it that the JVM, the CLR, and the Python VM are all stack-based? ...

What do you do when changing languages

Hi This is a problem I constantly face. I know how to execute a certain task in one enviroment / framework / language but I am a complete stranger in another. What's more, sometimes the gap between languages / enviroments is really too big to be simply adapted (like porting a prolog application to C#) So, I guess the question is: how...

Redundancy vs dependencies: which is worse?

When working on developing new software i normally get stuck with the redundancy vs dependencies problem. That is, to either accept a 3rd party library that i have a huge dependencies to or code it myself duplicate all the effect but reduce the dependencies. Though I've recently been trying to come up with a metric way of weighing up ei...

Do programmers of other languages, besides C++, use, know or understand RAII?

I've noticed RAII has been getting lots of attention on Stackoverflow, but in my circles (mostly C++) RAII is so obvious its like asking what's a class or a destructor. So I'm really curious if that's because I'm surrounded daily, by hard-core C++ programmers, and RAII just isn't that well known in general (including C++), or if all thi...

For your complicated algorithms, how do you measure its performance?

Let's just assume for now that you have narrowed down where the typical bottlenecks in your app are. For all you know, it might be the batch process you run to reindex your tables; it could be the SQL queries that runs over your effective-dated trees; it could be the XML marshalling of a few hundred composite objects. In other words, you...

Can anyone recommend a free internet-based private Wiki?

I'm starting a programming project soon with a group of friends. We will all be working remotely most of the time. I'd like to start an online wiki that we can all access but it needs to be something that is free, private and accessible only to the team. Can anyone suggest a good host for this kind of wiki? Ideally it would have a fe...

Language agnostic skills

I am trying to diversify my programming knowledge. I learned Java in College and worked with it a little at work. Now I am working with ruby. I am finding that working with different languages can mean very big shifts in my mindset. I have probably spent more time changing my mind set then actually learning the new syntax. What I am w...

Where do you get your application sounds from?

Specifically for prompts, message boxes etc. Thanks ...