language-agnostic

What are ways of improving build/compile time?

I am using Visual Studio, and it seems that getting rid of unused references and using statements speeds up my build time on larger projects. Are there other known ways of speeding up build time. What about for other languages and build environments? What is typically the bottleneck during build/compile? Disk, CPU, Memory? What is a li...

What are some good use cases for the CALLBACK pattern/idiom?

I don't use this pattern, maybe there are some places where it would have been appropriate and I used something else. Have you used it in your daily coding? Feel free to give samples, in your language of choice, along with your explanation. ...

Code Golf: Beehive

The challenge The shortest code by character count that will generate a beehive from user input. A beehive is defined a a grid of hexagons in a size inputted by the user as two positive numbers greater than zero (no need to validate input). The first number (W) represents the width of the beehive - or - how many hexagons are on each ro...

Bubble Breaker Game Solver better than greedy?

For a mental exercise I decided to try and solve the bubble breaker game found on many cell phones as well as an example here:Bubble Break Game The random (N,M,C) board consists N rows x M columns with C colors The goal is to get the highest score by picking the sequence of bubble groups that ultimately leads to the highest score A bu...

How can I name Tuples?

Is there a language agnostic algorithm to name tuples? Specifically, I want the following function: 1 => Single 2 => Double 3 => Triple 4 => Quadruple ... 10 => Decuple ... 100 => Centuple First of all, is this human-language independent? For example, will that be understood in Spain and Russia? Secondly, what is t...

Generalization functions for Q-Learning

I have to do some work with Q Learning, about a guy that has to move furniture around a house (it's basically that). If the house is small enough, I can just have a matrix that represents actions/rewards, but as the house size grows bigger that will not be enough. So I have to use some kind of generalization function for it, instead. My ...

Is it better to store telephone numbers in some canonical format or "as entered"?

Storing a telehone number in some kind of canonical format has several advantages from a programmers point of view, but it might confuse the user, if suddenly his entered numbers look a lot different. What's the way to go? ...

Should software be designed with performance in mind?

Is it advisable to zero-in on design of a component or architecture of a software with performance in mind? What I mean is, how ready should the design/architecture be to used in a performance-intensive environment? While designing components, should we just follow good OO principles and just ensure that the component is 'extendable'. T...

Data structure for storing recurring events?

I'm looking for a data structure pattern for storing recurring events, but everything I came up with would result in a high number of special case handling or user input and data retrieval are overly complex. (I get the distinct feeling, that I haven't understand the problem domain well enough to do this.) How can I store Outlook-style ...

When should I use/examples of nested classes?

Please retag this question to include languages to which it is relevant So my java book had a whole chapter on nested classes, but ended on the note that you should only really use them when it comes to "modeling composition relationships and implementing internals of a class you want to hide". So lets discuss when you would want to use...

Scale numbers to be <= 255?

I have cells for whom the numeric value can be anything between 0 and Integer.MAX_VALUE. I would like to color code these cells correspondingly. If the value = 0, then r = 0. If the value is Integer.MAX_VALUE, then r = 255. But what about the values in between? I'm thinking I need a function whose limit as x => Integer.MAX_VALUE is 25...

Creating code for displaying school day cycles

My school wants me (the school's webmaster) to put in some sort of display that would show the proper day in our 4-day school cycle on the home page. It doesn't have to be anything fancy; just a simple script that shows "Today is Day 1", etc. Our school operates on a 4-day school cycle. What this means is that on the first day of schoo...

Have you ever been the victim of a bug in a programming language or technology?

Bugs can be difficult enough to resolve when they're your (or a coworker's) fault. However, we all know that the technology we use to implement our programs is written by infallible people such as ourselves. So it stands to reason that some people have been affected by bugs in the implementation of the tools they used. So, have you fo...

How to verify regexp patterns ?

What are the common ways to verify the given regex pattern works well of the given scenario and check the results ? I would like to know in general , not in the particular programming language and what is the best way to learn about writing regular expression ? ...

When designing a new CMS database, what would be the most important features to add?

While this question asked something similar too, I'm interested in this from another angle. I'm not interested in the GUI part but in the database/domain part. (My preference is SQL Server with C#/ASP.NET but this Q should be language agnostic.) When designing a CMS system, data needs to be stored in tables and a business layer needs t...

Programatically generate high quality PDFs

Note: I realize this question has already been asked (with a ruby slant) here: http://stackoverflow.com/questions/786670/creating-on-demand-print-quality-pdfs-preferably-in-ruby-if-feasible. BUT there was no decent answer IMHO. So as you may have guessed, I am looking to find the best approach to producing HIGH QUALITY, print ready PDF ...

Default int type: Signed or Unsigned?

When programming in a C-like language should one's "default" integer type be int or uint/unsigned int? By default, I mean when you don't need negative numbers but either one should be easily big enough for the data you're holding. I can think of good arguments for both: signed: Better-behaved mathematically, less possibility of weird...

Biological Taxonomy Data Model

Looking for industry/standard data model for biological classification. Wikipedia ...

What problems have you solved using artificial neural networks?

I'd like to know about specific problems you - the SO reader - have solved using artificial neural network techniques and what libraries/frameworks you used if you didn't roll your own. Questions: What problems have you used artificial neural networks to solve? What libraries/frameworks did you use? I'm looking for first-hand exper...

Wherein newbie disassembly queries are made.

I'm relatively(read: stupid newbie) familiar with disassembly but this bit stumped me: I have a set of save files compressed with zlib and a game that loads them. Their structure is known and once loaded, the structs in memory are identical to their corresponding save files. The issue is that the game was written in an ass-backwards, scr...