language-agnostic

Is it worth it to look at a method that does exactly the opposite of what you want to do?

For example take this paper[PDF]. If I wanted to add Weather degradation into a clear photograph would it be worth it to look at that paper and try to reverse it? Also is there any specific approach to reversing an algorithm if it is at all possible? ...

Is Template Metaprogramming faster than the equivalent C code ?

Is Template Metaprogramming faster than the equivalent C code ? ( I'm talking about the runtime performance) :) ...

Examples of good UI for selecting multiple records

I'm currently revisiting an area of my Windows-based software and looking at changing the relationship from 1->M to M->M. As a result, I need to adjust the UI to accommodate selecting multiple related records. There are a lot of ways to handle this that are common, but usually pretty clunky. Examples include the two-pane list of all ite...

How much work should the constructor for an HTML parsing class do?

How much work is it reasonable for an object constructor to do? Should it simply initialize fields and not actually perform any operations on data, or is it okay to have it perform some analysis? Background: I was writing a class which is responsible for parsing an HTML page and returning various information based on the parsed informat...

How can standards guarantee a data structure uses contiguous memory?

I was just wondering how exactly memory works such that a language standard (such as C++'s ISO/ANSI standard) can guarantee that any data structure (even an array) will be contiguous. I don't even know how to write a data structure using continguous memory, but could you please give me a short example of how designers can do this? For...

Is there a repository of test input, with answers, for algorithms (especially graph algorithms)?

As a summer project, I have decided to practice basic algorithms and learn Haskell at the same time, by implementing large chunks of CLRS in Haskell. Things are going pretty swimmingly, so far, but since I started graph algorithms, I've noticed a lack: test input and output! For example, I've implemented Floyd-Warshall's algorithm, and ...

Hungarian Notation

Possible Duplicates: Why shouldnt I use Hungarian Notation? Are variable prefixes ( Hungarian ) really necessary anymore? Do people use the Hungarian Naming Conventions in the real world? I'm sure this subject has been discussed and argued countless times before, but I would like to see what the people here an StackOverflow...

I'm a university student who hopes to intern for a large company (msft, apple, rim, etc). What should I learn?

I'm currently in the third year of my comp sci undergrad degree. Before graduating, I'd like to experience a co-op term with a heavyweight in this field. What topics do you think are most pushed for when trying to get a co-op placement with these companies? ...

Can anyone recommend any UML tools with validation

Unfortunately I'm not familiar with UML (yet) and I don't know what validations are in place in the standard tools. But after reading this it seems validation is missing so I ask SO for advice. I want it to find stuff like logical inconsistencies disconnected parts (islands) unreachable parts (for example a state with only from transi...

What does the term "lasagna code" mean to you?

According to Wikipedia, the term was originally coined by a database expert Joe Celko in 1982 and here's a quote from his 1997 article revealing what he meant by it: "The standard [structured programming] solution was to replace the GOTOs with nested IF-THEN-ELSE statements and switches that were layered so deep and had so much redundanc...

Practical application of "Bananas, Lenses, Envelopes, and Barbed Wire"?

First of all, the goofy title is directly referencing this paper: http://eprints.eemcs.utwente.nl/7281/01/db-utwente-40501F46.pdf I understand the theoretical value of this, as it models most, if not all, programming semantics. What problems are most efficiently and practically solved with a programming paradigm based on this? What pr...

Strategies for writing expanding ordered files to disk

I an a graduate student of nuclear physics currently working on a data analysis program. The data consists of billions of multidimensional points. Anyways I am using space filling curves to map the multiple dimensions to a single dimension and I am using a B+ tree to index the pages of data. Each page will have some constant maximum num...

Best open source, extendable crawler to use for image crawling.

Hi- We are in the starting phase of a project, and we are currently wondering whether which crawler is the best choice for us. Our project: Basically, we're going to set up Hadoop and crawl the web for images. We will then run our own indexing software on the images stored in HDFS based on the Map/Reduce facility in Hadoop. We will not...

When do you decide to represent something as a vector?

In information retrieval, the words in the documents were represented as a "Term Vector", they did it primarily to check the angle between two vectors. When have you represented something as a vector in your work and what is the common heuristic that you use to represent an entity as a vector? ...

Level designer _first_?

This question is intended for someone who is in game development, possibly working in one of the major sweatshops .. :) I'm a programmer, not an artist. Up until recently, I had this notion that level design was something to be done in Maya, by an artist. The programmer would then load it up and "parse" that model and construct a BSP ...

Unit-testing a simple collection class

Consider the following class: public class MyIntSet { private List<int> _list = new List<int>(); public void Add(int num) { if (!_list.Contains(num)) _list.Add(num); } public bool Contains(int num) { return _list.Contains(num); } } Following the "only test one thing" principle,...

Dealing with the "double margin" problem between GUI elements

While creating GUIs I've come across the "double margin" problem several times, where two elements have the same margin defined and end up being spaced twice as far apart as I intended. One solution I use is to define the margin on only some sides of the element (for example, only on the top if I expect elements to be stacked vertically...

Do formal methods of program verfication have a place in industry?

I took a glimpse on Hoare Logic in college. What we did was really simple. Most of what I did was proving the correctness of simple programs consisting of while loops, if statements, and sequence of instructions, but nothing more. These methods seem very useful! Are formal methods used in industry widely? Are these methods used to prov...

Screen scraping gotchas

When screen-scraping, what are the "gotcha"s to look out for? The inspiration for this is: my spouse's co-worker asked me to scrape all the pages from a Blogger-hosted blog that her friend with cancer kept in her final months and this lady wanted to keep all of the posts in case the blog were ever deleted. I eventually found a free tool...

Are "65k" and "65KB" the same?

Are "65k" and "65KB" the same? ...