language-agnostic

Date/Time stored as floating point, which algorithm is used?

I'm have access to a 3rd party application's database, and I see a field called "date" which stores date/time values as floating point numbers, but I'm not sure how this floating point number is mapped to a date/time. There is no documentation for this database. Here is some sample data: date-field actual-date-time 253507382.168...

What programming language would something like this be coded in?

I need to have something coded for back-end functions of one of my websites. The only knowledge I have is of front-end programming, mostly PHP and MySQL. I know nothing about other languages. I basically need to have a program continuously running on my Linux server that accesses the MySQL table and checks the validity of certain files ...

What is the most standards compliant way to send a fax from an application?

From what I understand fax over VoIP is very unreliable due to the real-time requirements of the fax protocol. Simply using VoIP to send fax message to POTS-connected fax machines is hence not possible. Besides from proprietary fax API:s (such as sending fax messages via a company specific SOAP API), what standards based protocols are t...

Recommended references on GUI ergonomy

Hi mates, I have not very much experience in creating GUIs. Maybe one of the more experienced programmers/GUI-designers has some tips or references for me how to design ergonomic user interfaces. I've heard, Microsoft has a very big book on this issue for designing GUIs in Access (I assume most ergonomic issues can be used in other plat...

Multiple levels of parallelism using OpenMP - Possible? Smart? Practical?

I am currently working on a C++ sparse matrix/math/iterative solver library, for a simulation tool I manage. I would have preferred to use an existing package, however, after extensive investigation, none were found that were appropriate for our simulator (we looked at flens, it++, PetSC, eigen, and several others). The good news is my...

What's a good naming convention for methods that take conditional action?

Let's say I have a method, Foo(). There are only certain times when Foo() is appropriate, as determined by the method ShouldFooNow(). However, there are many times when the program must consider if Foo() is appropriate at this time. So instead of writing: if ShouldFooNow(): Foo() everywhere, I just make that into one function: def...

How do I detect irregular borders in an image?

Given the image below, what algorithm might I use to detect whether regions one and two (identified by color) have a border? http://img823.imageshack.us/img823/4477/borders.png If there's a C# example out there, that would be awesome, but I'm really just looking for any example code. Edit: Using Jaro's advice, I came up with the follo...

Different ways of observing data changes

In my application I have many classes. Most of these classes store quite some data, and it is important that other modules in my application are also 'updated' if the content of one of the data classes changes. The typical way to do this is like this: void MyDataClass::setMember(double d) { m_member = d; notifyAllObservers(); } This...

Does anyone know what "Quantum Computing" is?

In physics, its the ability for particles to exist in multiple/parallel dynamic states at a particular point in time. In computing, would it be the ability of a data bit to equal 1 or 0 at the same time, a third value like NULL[unknown] or multiple values?.. How can this technology be applied to: computer processors, programming, securit...

Diverse resource of problems to show merits of different languages

I'd like to learn a few more languages to "expand my mind" a bit, and I find working through problems the best way to learn. I have been doing most of my programming in C, sometimes C++, and perl. With these tools, I seem to be able to solve the problems I encounter, but you know the expression "when you have a hammer, everything looks l...

programming 101, select VS if block

I'm not sure I understand the difference between an if block and switch/select block. I mean I use them all the time. But It's not clear to me when the switch block should be applied and when no to. Since, a select block can be expanded into if block. So the only real advantage I can think of for using the select block is for human read...

Most Effective Public Key Encryption Method

There seems to be a lot of hype about asymmetric Public Key encryption. RSA, PGP... etc. You have a set of two keys and distribute one, so that either only you can encrypt the message or only you can decrypt the message. One method provides a way to verify the sender, while the other provides a way to secure the message. (Feel free to co...

Code golf: Word frequency chart

The challenge: Build an ASCII chart of the most commonly used words in a given text. The rules: Only accept a-z and A-Z (alphabetic characters) as part of a word. Ignore casing (She == she for our purpose). Ignore the following words (quite arbitary, I know): the, and, of, to, a, i, it, in, or, is Clarification: considering don't: ...

How to store unicode data in a format that doesn't support utf-8

Okay, here's yet another character encoding question, demonstrating my ignorance of all things Unicode. I am reading data out of Microsoft Excel .xls files, and storing it in ESRI shapefiles .shp. For versions of Excel > 5.0, text in excel files is stored as Unicode. However, Unicode (and specifically UTF-8 support for shapefiles is i...

Code golf: "Color highlighting" of repeated text

(Thanks to greg0ire below for helping with key concepts) The challenge: Build a program that finds all substrings and "tags" them with color attributes (effectively highlighting them in XML). The rules: This should only be done for substrings of length 2 or more. Substrings are just strings of consecutive characters, which may inc...

Valid Permutation of Parenthesis

Possible Duplicate: Solution to a recursive problem (code kata) give an algorithm to find all valid permutation of parenthesis for given n for eg : for n=3, O/P should be {}{}{} {{{}}} {{}}{} {}{{}} {{}{}} ...

what are design patterns and how can it benefit one's programming productivity ?

I've been reading various programming styles like XP (writing the test first), and came across a Java book that just has design patterns, what seems to be like pseudocodes. What are these design patterns used for ? what does design apttern in the context of programming refer to and what are it's applications ? Is it like blue prints for...

Code Golf: 2D Platformer

The Challenge Reach the end of the level! Bonus points if you hit each of the (C)oin blocks exactly 2 times. Disallowed Hard coding the command sequence in any way. Your favorite "One character language" that happens to do exactly one thing, which is solving this golf. How To Your program receives the level below(without lin...

Difference Between Parameter And Argument?

is there a difference between a parameter and an argument, or are they simply synonyms? ...

BNF / EBNF for Turbo Pascal (preferably 5.5 or later, because of OOP)?

Does anyone of you know if the BNF or EBNF of Turbo Pascal is available somewhere (LEGALLY!!)? ...