language-agnostic

Whats a good name for a base class for Movie and Episode?

I've been refactoring Media Browser and have started to define a proper inheritance model for our domain objects so I have BaseItem -> Video --> <Need a name for this> ---> Episode ---> Movie -> Folder --> Season Essentially tv show episodes and movies have some attributes in common (like actor or director listings) so I need a name...

Is it possible to sell an idea for software without actually developing it?

I have my moments of inspiration like many others -- most of them bad, with a few diamonds in the rough. Is it possible to monetize those diamonds with stakeholders or entrepreneurs without actually being the person to handle development and technical? Any avenues that you can recommend would be appreciated. ...

what is your code review format/ good code review webcasts?

Just watching a great video on a code review of the unit tests of an ASP.MVC project and it I found it fascinating in how his approach is different to mine. Are there any other good video resources on this? and what format does your code review take? ...

multiple scrums code integration

The company where I work has been trialling scrum on a project and is now looking to roll scum out to three or four different project teams. We are envisaging that these teams will work in separate feature branches (we are using SVN). We are not sure if the different teams’ sprints should end simultaneously or if we should stagger the ...

What's wrong with this algorithm?

This is an abstracted form of the bug that led me into the code that formed the basis of my prior question. It's obvious once you see it, but several professional programmers familiar with the original problem and original language looked over the code and overlooked the bug before we caught it (admittedly, in its native environment it ...

What are some famous abstractions in programming languages?

For my computing languages class, we've been assigned to read On the Design of Programming Languages by Niklaus Wirth. One of Wirth's main points is that programming languages should choose a few abstractions and stick with them. I'm trying to brainstorm some more modern examples than the ones that Wirth gives (although they don't nece...

Avoiding timing issues in a processor

I'm writing a simulation of a (very slow and primitive) processor. For example: let's say the clock speed is a constant 1 hz. I assume this means that 1 instruction can/will be processed every second. Some instructions take longer than others. Adding 1 + 0 takes less time than 1 + 7. (The latter causes a ripple of carry bits which takes...

Is OO design's strength in semantics or encapsulation?

Object-oriented design (OOD) combines data and its methods. This, as far as I can see, achieves two great things: it provides encapsulation (so I don't care what data there is, only how I get values I want) and semantics (it relates the data together with names, and its methods consistently use the data as originally intended). So where...

How does a programmer be creative?

Right now, I have a deadline for a video game and they are asking me an idea for a storyline. Back in college, I used to breeze through this tasks and for me this is very very easy. Now that I'm been programming for many years now, I would like to return to that state. How do programmers like you go to into a creative state? Thanks. ...

Swap key and array value pair

I have a text file layed out like this: 1 a, b, c 2 c, b, c 2.5 a, c I would like to reverse the keys (the number) and values (CSV) (they are separated by a tab character) to produce this: a 1, 2.5 b 1, 2 c 1, 2, 2.5 (Notice how 2 isn't duplicated for c.) I do not need this exact output. The numbers in the input are ord...

When to use template method Vs. Strategy?

The template method pattern and the strategy pattern do roughly the same thing. I understand the basic differences between them (template method is inheritance based, strategy is composition based), but are there any decent guidelines on when to choose one over the other? It seems like they do basically the same thing. ...

What are some hints that an algorithm should parallelized?

My experience thus far has shown me that even with multi-core processors, parallelizing an algorithm won't always speed it up noticably. In fact, sometimes it can slow things down. What are some good hints that an algorithm can be sped up significantly by being parallelized? (Of course given the caveats with premature optimization...

When is it okay to check if a file exists?

File systems are volatile. This means that you can't trust the result of one operation to still be valid for the next one, even if it's the next line of code. You can't just say if (some file exists and I have permissions for it) open the file, and you can't say if (some file does not exist) create the file. There is always the possib...

How to get a good specification from client? Or how can I _BE_ the perfect client?

I've just had a new project land on my desk which is more than a little bit beyond me, so I'll be delegating it to a colleague. However, I don't want to be the nightmare user with the forever changing specs; so what is my best way to plan and spec out the application that needs to be developed? Are there template spec documents out ther...

What's a good data structure for building equivalence classes on nodes of a tree?

I'm looking for a good data structure to build equivalence classes on nodes of a tree. In an ideal structure, the following operations should be fast (O(1)/O(n) as appropriate) and easy (no paragraphs of mystery code): (A) Walk the tree from the root; on each node --> child transition enumerate all the equivalent versions of the child...

Corner Stitching Datastructure, Any Open Source Implementations?

I recall learning about the corner-stitched data structure a number of years ago and have been fascinated with it ever since. It originated with a paper by Ousterhout. I've searched and not been able to find a free/open implementations. I'd prefer a C++ implementation, but at this point would accept any pointers people might have. No...

software/languages for online structured data collection from (human) clients

I need to develop a web interface to collect and validate a range of data from many of my organization's clients. This isn't a single form, but a collection of forms with interdependencies (i.e., field X on form Y is needed if field A was equal to C on form B), and variable length lists (please provide the details for all Xs in your pos...

When storing Images in the File System, Use relative paths or absolute paths?

I am working on a web app and I decided (after reading many post on SO) to store the actual images in the file system and to store the metadata in the DB. Should I store a relative path or an absolute path. I can think of some advantages for each of the choices. Absolute: Pros: It is obvious where the file is even to other apps read...

How do you read a file line by line in your language of choice?

I got inspired to try out Haskell again based on a recent answer. My big block is that reading a file line by line (a task made simple in languages such as Perl) seems complicated in a functional language. How do you read a file line by line in your favorite language? So that we are comparing apples to other types of apples, please ...

Where can I find small but fun challenges? (Project Euler for the weak)

Duplicates: What are your programming exercises? Where can you find fun/educational programming challenges? Algorithm Questions Website Web site for Some Good Programming Puzzles? Sometimes I like programming a self-contained, "small" problem just for leisure and fun. Project Euler's problems in this regard are to big and need to ...