language-agnostic

sorting algorithm where pairwise-comparison can return more information than -1, 0, +1

Most sort algorithms rely on a pairwise-comparison the determines whether A < B, A = B or A > B. I'm looking for algorithms (and for bonus points, code in Python) that take advantage of a pairwise-comparison function that can distinguish a lot less from a little less or a lot more from a little more. So perhaps instead of returning {-1,...

What is NOR logical operator?

Is nor: !(a or b) !a or !b !(a and b) something else? ...

which sorting algorithms give near / approximate sort sooner?

Which sorting algorithms produce intermediate orderings which are good approximations? By "good approximation" I mean according to metrics such as Kendall's tau and Spearman's footrule for determining how "far" an ordered list is from another (in this case, the exact sort) The particular application I have in mind is where humans are d...

What happens during Stand-By and Hibernation?

It just hit me the other day. What actually happens when I tell the computer to go into Stand-By or to Hibernate? More spesifically, what implications, if any, does it have on code that is running? For example if an application is compressing some files, encoding video files, checking email, running a database query, generating reports ...

Keeping of track of the states of object - SOS

Hi the wise folks at SO. This is an SOS. I'm in a deep trouble. In my web application there is an object (Say it is a request for something). User submits his/her request. After this it comes to the people who can approve/disapprove that request. During the period from submission to approval/disapproval many actions can be taken on the ...

Log every time an exception is handled

I have noticed a discrepancy in views on logging and wanted to provide a poll on this issue to the SO community. C.f. a similar question but not as a poll. Poll: Should exception handlers ALWAYS write to the log any time an exception is caught and handled? Note: This is not a question about how to handle the exception, or on how to r...

Consuming services that consume other services.

What is the best way to confirm that these consumed services are actually up and running before I actually try to invoke its operation contracts? I want to do this so that I can gracefully display some message to the customer to give him/her a more pleasant user experience. Thanks. ...

Position of a point relative to a Bezier curve

I have a Bezier curve specified by 4 points. I need to know if a point is on the left side or right side of the Bezier curve. Can you suggest me an algorithm? Edit: I'm sure that the way I generate the Bezier curve would not form loops. Later edit I realized that my initial problem could be solved without using relative position. When ...

Should a developer know perfectly one language or know fairly well multiple languages?

Possible Duplicate: Should developers be specialists or generalists? I recently graduated and I am now a web developer. During my personal projects and past professional experiences I got to learn a lot of web languages and frameworks, from PHP to ASP, from Rails to Java. Still, I do know that I don't have a perfect understandi...

Which tools do you use to analyze text?

I'm in need of some inspiration. For a hobby project I am playing with content analysis. I am basically trying to analyze input to match it to a topic map. For example: "The way on Iraq" > History, Middle East "Halloumni" > Food, Middle East "BMW" > Germany, Cars "Obama" > USA "Impala" > USA, Cars "The Berlin Wall" > History, Germany ...

What's a good temporal distance to no longer display relative dates?

Relative dates are great to display the temporal incidence of recent activity, but at what distance is it an inconvenience for the user to see a relative date rather than an absolute one? Let's assume the context is a forum. ...

Language Menagerie

Possible Duplicate: Should developers be specialists or generalists? I was wondering... With regard to pursuing and strengthening a career as a programmer (in the broadest sense) is it better to stick to 1 core set of languages (e.g javascript and c#) or always be on the lookout for "the best tool for the job". Personally I wan...

Parsing Source Code - Unique Identifiers for Different Languages?

Hello, I'm building an application that receives source code as input and analyzes several aspects of the code. It can accept code from many common languages, e.g. C/C++, C#, Java, Python, PHP, Pascal, SQL, and more (however many languages are unsupported, e.g. Ada, Cobol, Fortran). Once the language is known, my application knows what ...

Remote Locking

I am designing a remote threading primitive protocol. Currently we only needs mutexes (i.e. Monitors) and semaphores. The main idea is that there doesn't need to be a central authority - the primitives should be orchestrated amongst the peers that are interested in them. I have bashed a few ideas around on paper and in my head for a few...

Performance optimization strategies of last resort?

There are plenty of performance questions on this site already, but it occurs to me that almost all are very problem-specific and fairly narrow. And almost all repeat the advice to avoid premature optimization. Let's assume: the code already is working correctly the algorithms chosen are already optimal for the circumstances of the pr...

PostgreSQL vs. mySQL

I tried to Google this but it seems like most of the answers are terribly outdated. So, the question is simple: why would I choose one over the other? What are the benefits of each, and what drawbacks do they have? EDIT: Please close this. Apologies, I didn't see the other duplicates when I did a search earlier. ...

WPF: Any cool UI ideas i can look at?

Windows Presentation Foundation (WPF) was going to hopefully usher in a new era of cool applications and user interactions. Television shows and movies have always been good at coming up with cool prop (i.e. non-functional) user interfaces. CSI, Minority Report, Quantum of Solice, all show off cool things that people might wish compute...

How measure percent difference in codebase?

Task at hand — I have three versions of some code, developed by different coders, one “parent” and two “child”, and need to calculate, which one is closer to the parent one. Size of code at hand prohibits from manually counting diff's, and I failed to see any aggregate similarity stats in popular diffmerge tools I've tried. Hao shot we...

Can every recursion be converted into iteration?

A reddit thread brought up an apparently interesting question: Tail recursive functions can trivially be converted into iterative functions. Other ones, can be transformed by using an explicit stack. Can every recursion be transformed into iteration? The (counter?)example in the post is the pair: (define (num-ways x y) (case ((= x 0...

What data type is recommended for ID columns?

I realize this question is very likely to have been asked before, but I've searched around a little among questions on StackOverflow, and I didn't really find an answer to mine, so here goes. If you find a duplicate, please link to it. For some reason I prefer to use Guids (uniqueidentifier in MsSql) for my primary key fields, but I rea...