language-agnostic

iTunes COM interface - obtain song added to library?

This isn't about a specific language, since it is more about the iTunes COM interface. I have managed to add a file to the library with .AddFile(), but now that the file is there I'd like to read some details about it such as the artist, song, and album. Since the song doesn't automatically play, I can't really use CurrentTrack() to re...

Maximize data, minimize code - what are the limits and problems?

I would like to design very high availability(never take server down, roll out features without restart etc) application with both client(probably C# gui) and server components(Java,C++,Perl). I got some advice from (minimize-code-maximize-data.html and Yegge), and I would like to make most logic dynamically readable from database so t...

What should I tell kids about how great it is to be a programmer?

I am putting a presentation together. I thought about illustrating with websites like Facebook, and MySpace. Does anyone have children around that age that could tell me what they are into? How to hold their attention? Ways to illustrate what we do? Get them interested? Your ideas are greatly appreciated, I really want to be able to c...

What is a minimal path in a graph?

In graph theory, what is the distinction between minimal distance (which Dijkstra's algorithm finds), and minimal path (which I'm not sure what it is)? ...

Running Time of Random Sort

How would you describe the running time of this sort, given a function sorted which returns True if the list is sorted that runs in O(n): def sort(l): while not sorted(l): random.shuffle(l) Assume shuffling is perfectly random. Would this be written in big-O notation? Or is there some other way of categorizing algorithms with ra...

What Does "Overloaded"/"Overload"/"Overloading" Mean?

What does "Overloaded"/"Overload" mean in regards to programming? ...

Calculating SOAP Content-Length

How do you calculate the Content-Length is a soap message? Is it the number of chars in the whole soap message? ...

Programming language questions

To assist with a project I'm working on, I request your input to the following questions. I'm looking for your thoughts regarding programming language syntax and built-in capabilities, NOT about available frameworks and libraries. (1) In the different programming languages you use, what langauge features do you think are lacking? (2) ...

Language Agnostic Build Management System

Several times in my career, I have worked in a software group that determined that a) We needed a build/test system b) We should write our own c) We can have a developer spend a week, get it done and they shouldn't have to touch it again Every time, this has resulted in a system that only seems to work for the person that wrote it and ...

What is an Existential Type?

I read through the wikipedia entry on this. I gathered that they're called existential types because of the existential operator (∃). I'm not sure what the point of it is, though. What's the difference between T = ∃X { X a; int f(X); } and T = ∀x { X a; int f(X); } ...

Best practices for developers in dealing with clients

Personally, I've found that when good developers deal with clients, they often get sucked into the after-sales support process and this process has been difficult to reverse, so was just interested to hear the various strategies that developers employ in maintaining a healthy, useful relationship that keeps clients using the right person...

How do you plan an application's architecture before writing any code?

One thing I struggle with is planning an application's architecture before writing any code. I don't mean gathering requirements to narrow in on what the application needs to do, but rather effectively thinking about a good way to lay out the overall class, data and flow structures, and iterating those thoughts so that I have a credible...

How to save and load different types of objects?

During coding I frequently encounter this situation: I have several objects (ConcreteType1, ConcreteType2, ...) with the same base type AbstractType, which has abstract methods save and load . Each object can (and has to) save some specific kind of data, by overriding the save method. I have a list of AbstractType objects which contai...

Fluent Interfaces - Method Chaining

Method chaining is the only way i know to build fluent interfaces. Here's an example in C#: John = new JohnBuilder().AddSmartCode("c#").WithfluentInterface("Please").ButHow("Dunno"); Assert.IsNotNull(john); [Test] public void Should_Assign_Due_Date_With_7DayTermsVia_Invoice_Builder() { DateTime now = DateTime.Now; ...

Best way to move a data row to another shard?

The question says it all. Example: I'm planning to shard a database table. The table contains customer orders which are flagged as "active", "done" and "deleted". I also have three shards, one for each flag. As far as I understand a row has to be moved to the right shard, when the flag is changed. Am I right? What's the best way to ...

Algorithm to match preferred partners into groups of three

What's a good algorithm to solve this problem? I have three groups of people - group A, group B, and group C. There are the same number of people in each group. They each have a list of people in the other groups that they're willing to work with. I want to group all these people together in groups of 3 (one from A, one from B, and one ...

How does the Presentation-/ViewModel for a Task or Dialog look like?

I'm trying to move to a Model/ViewModel/View architecture and got stuck when trying to push selection dialogs to this pattern. I'd like to separate retrieving a list of choices (business/presentation logic) and the actual displaying/choosing mechanism (view) to re-use the former with different views (e.g. ComboBox vs. modal dialog). How...

Methodology for Documenting Existing Code Base

I work as part of a team on an existing application that has no inline documentation, nor does it have technical documentation. As I've been working on various bug reports on the application, I've written a sort of breadcrumb trail for myself - bug numbers in various places so that the next developer can refer to that bug number to see ...

List ranking algorithm

Given a list of numbers, which can be in any order, such as 3, -5, -1, 2, 7, 12, -8 I would like to produce a list which represents their rank, which in this case would be 4, 1, 2, 3, 5, 6, 0 The numbers are actually some member of an ordered list of classes. Note that the order of the list does not change, they just get counted a...

Algorithms for spacing objects visually

Hi, I am wondering if there are any well-known algorithms that I should be aware of for spacing objects visually. For instance, a LINQ to SQL diagram has many tables but automatically spaces them for readability. Is this pretty much a "place randomly and move if too close/overlap" type algorithm or is there more to this? Thanks for a...