language-agnostic

Is it better to use an XML data structure or a custom data structure that can be converted to XML?

I'm going to be writing a program which has some web services in it that use XML to pass data back and forth. The format of the XML is predefined - I can't change it to suit my needs - but in code I can handle the data any way I want. My question: Is it better for me to handle the data structure in code as an XML tree, or to write an e...

Most helpful aspects of Intellisense

What do you consider the most important aspects of Intellisense (in any IDE)? Reduced effort remembering and typing class/method/property names being the most obvious, but what are some less obvious forms of assistance that help you with your job? ...

Your opinion - GPRS Internet - Mobile

Is 8megabytes are a large load if they are transfered via GPRS every day? How large in terms of size (bytes/kbytes) a get request + response is? (eg 200OK) ...

Benefits of cross-platform development?

Are there benefits to developing an application on two or more different platforms? Does using a different compiler on even the same platform have benefits? ...

Deciding what programming language to use for the next project

I have been programming in Java Platform and J2ee environment for more than 4 years .As a technical person who loves to try out many languages, libraries, frameworks, etc. for my daily tasks, one question keeps annoying mewe have so many options available. The challenge lies in picking up the right tool for the right task. So what shou...

When adding CSS to a CMS dynamically should I write it to the DB or to file

I a working on a CMS and I want to be able to add CSS via the administrative control panel. When I add css should I just append it to the bottom of the stylesheet I have or is it best to add the data to a DB and then get it using a handler. The way I see it they both seem to have advantages. writing to file: It is simple and requires ...

Best Schema to represent NCAA Basketball Bracket

What is the best database schema to represent an NCAA mens basketball bracket? Here is a link if you aren't familiar: http://www.cbssports.com/collegebasketball/mayhem/brackets/viewable_men I can see several different ways you could model this data, with a single table, many tables, hard-coded columns, somewhat dynamic ways, etc. You n...

What is the limit N of maximum methods you allow in your classes?

While filling in The Object Oriented Concepts Survey (To provide some academic researchers with real-life data on software design), I came upon this question: What is the limit N of maximum methods you allow in your classes? The survey then goes on asking if you refactor your classes once you reach this limit N. I've honestly never th...

Permutations of a binary tree.

Consider a binary tree: n is a node, if n is an integer (+ a b) is a node, if a and b are nodes. We have the following three operations: (+ a b) -> (+ b a) (+ (+ a b) c) -> (+ a (+ b c)) (+ a (+ b c)) -> (+ (+ a b) c) -- (2. in reverse) I need an algorithm for giving all the possible permutations of a given tree using these opera...

Finding neighbours in a two-dimensional array

Is there an easy way of finding of finding the neighbours (that is, the eight elements around an element) of an element in a two-dimensional array? Short of just subtracting and adding to the index in different combinations, like this: array[i-1][i] array[i-1][i-1] array[i][i-1] array[i+1][i] ... And so on. ...

Algorithms and data structures that are not mainstream?

There are a subset of algorithms and data structures that are very common, well-studied and very helpful. Examples of these are Topological sort, quicksort, depth-first search; on the other hand, dictionaries, trees, linked-lists and to a lesser extent red-black trees, and tries, are examples of the latter. However, there are other alg...

Where Do I Store Hash Table or Dictionary Key Names

When I'm working with Hash Tables/Dictionaries I sometimes struggle with how to specify keys. For example: if I create a simple Dictionary (using Python for this example), foo = {'bar': 'baz', 'foobar': 'foobaz' } I can access values (in other modules) with the key values: (foo['bar']) and get baz back. In the words of Dr. Evil, "pr...

Dealing with morally and legally objectionable requests from management

This question was originally posted with a similar title to this but was changed as the subject was not a moral issue. However it was a good topic for a wiki question. There are times when you are asked to implement features which you are not comfortable with, perhaps some mass emailing program, or something which access data on a PC w...

What's a good way to structure variable nested loops?

Suppose you're working in a language with variable length arrays (e.g. with A[i] for all i in 1..A.length) and have to write a routine that takes n (n : 1..8) variable length arrays of items in a variable length array of length n, and needs to call a procedure with every possible length n array of items where the first is chosen from the...

Testing When Correctness is Poorly Defined?

I generally try to use unit tests for any code that has easily defined correct behavior given some reasonably small, well-defined set of inputs. This works quite well for catching bugs, and I do it all the time in my personal library of generic functions. However, a lot of the code I write is data mining code that basically looks for...

Programming challenge: can you code a hello world program as a Palindrome?

So the puzzle is to write a hello world program in your language of choice, where the program's source file as a string has to be a palindrome. To be clear, the output has to be exactly "Hello, World". Edit: Well, with comments it seems trivial (not that I thought of it myself of course [sigh].. hat tip to cobbal). So new rule: no...

Where is the dividing line between complete lack of planning and analysis paralysis?

In my very short time working in the programming field, I've seen two extremes: Projects where little to no planning was done and thus become maintenence nightmares. Projects that are perpetually in the planning stages and don't move from there. It seems like the latter oftentimes happen as a reaction to the former. Where is the hap...

Theory, examples of reversible parsers?

Does anyone out there know about examples and the theory behind parsers that will take (maybe) an abstract syntax tree and produce code, instead of vice-versa. Mathematically, at least intuitively, I believe the function of code->AST is reversible, but I'm trying to find work/examples of this... besides the usual resources like the Drago...

Refactoring of very combine code

I now have to refactor some code, it's basically one method(its around 1000 lines of code) that does a lot of calculations and have a lot of variables. I'm not sure how to refactor it. Does code like ... calculateSth(param1,param2,param3,param4,param5, params6); calculateSthElse(param1,param2,param3); ... look good? I could introduc...

What well-architectured weblog package(s) do you recommend?

I'm looking for some weblog software to use/extend, but all the ones I've looked at so far are terribly written - attempting to work with them is far too effortful and depressing. I'm looking for something that is well architectured and easy to change - modular code, distinct Model-View-Controller layers, sensible data structure, and so...