language-agnostic

Project Euler Question 3 Help

I'm trying to work through Project Euler and I'm hitting a barrier on problem 03. I have an algorithm that works for smaller numbers, but problem 3 uses a very, very large number. Problem 03: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? Here is my solution in C# and it's b...

What are good programming skills to learn or focus on to future-proof my career over the next ten years?

What are some good programming skills to learn or focus on to future-proof my career over the next ten years? By this, I mean what do you see as being the popular languages, tools, and software technologies in widespread use over the next ten years that having experience with could make a person more highly employable. I pose this ques...

How to name variables.

What rules do you use to name your variables? Where are single letter vars allows? How much info do you put in the name? how about for example code? what are your preferred meaningless variable names? (after foo & bar) why are they spelled "foo" and "bar" rather than FUBAR ...

Seeking clarifications about structuring code to reduce cyclomatic complexity

Recently our company has started measuring the cyclomatic complexity (CC) of the functions in our code on a weekly basis, and reporting which functions have improved or worsened. So we have started paying a lot more attention to the CC of functions. I've read that CC could be informally calculated as 1 + the number of decision points i...

Calculate the digital root of a number

A digital root, according to Wikipedia, is "the number obtained by adding all the digits, then adding the digits of that number, and then continuing until a single-digit number is reached." For instance, the digital root of 99 is 9, because 9 + 9 = 18 and 1 + 8 = 9. My Haskell solution -- and I'm no expert -- is as follows. digitalRoo...

How does one go about starting a user group for the local community?

There are many user groups out there for different technologies/platforms/etc. These groups seem to be very prevalent in the bigger cities. For smaller cities, maybe where the technology companies are scarce, finding a local geek community can be hard to come by. These groups can be a good source for networking, continued learning, etc. ...

Random string that matches a regexp

How would you go about creating a random alpha-numeric string that matches a certain regular expression? This is specifically for creating initial passwords that fulfill regular password requirements. ...

What appear to be the more lucrative programming skills at the moment?

I've referenced many of the salary survey sites, but they all tend to categorize salaries based on generic job titles. Obviously, things like job title, years of professional experience, location, and the many important non-tech skills are closely associated with how much a position pays. What are currently some of the hot programming-...

Where should I put "ugliness"?

Scenario: I have a function that I need to tweak in some way (example; make it work slightly different in different places). For some reason I end up having to add something ugly to the code, either in the function or at existing call sites. Assume that the sum total "ugly" is the same in both cases. The question is which choice should ...

Algorithm for most recently/often contacts for auto-complete?

We have an auto-complete list that's populated when an you send an email to someone, which is all well and good until the list gets really big you need to type more and more of an address to get to the one you want, which goes against the purpose of auto-complete I was thinking that some logic should be added so that the auto-complete r...

Any Real-World Experience Using Software Transactional Memory?

It seems that there has been a recent rising interest in STM (software transactional memory) frameworks and language extensions. Clojure in particular has an excellent implementation which uses MVCC (multi-version concurrency control) rather than a rolling commit log. GHC Haskell also has an extremely elegant STM monad which also allow...

What's the difference between game development and business development?

Like most developers, I'm a business developer, which in essence consists of slapping a UI onto some back-end data store. (We all know there's a lot more to it than that, but that's usually what it boils down to.) I understand that game development is very different from business development, but I'm having a hard time explaining it to ...

PDF Libraries

Can you guys list available PDF libraries to manipulate PDF files? Is it freeware or open-source? What language(s) it is available for? What is it good for? ...

Try to describe polymorphism as easy as you can

we can find a lot of information about the subject on the internet and books http://en.wikipedia.org/wiki/Type_polymorphism but lets try to make it as simple as we can . ...

Ordering numbers that are stored as strings in the database

I have a bunch of records in several tables in a database that have a "process number" field, that's basically a number, but I have to store it as a string both because of some legacy data that has stuff like "89a" as a number and some numbering system that requires that process numbers be represented as number/year. The problem arises ...

What would be a globally accepted regular expression to match e-mail addresses

I have seen many examples, with many 'no, you missed something' comments. What is the right way to match an e-mail address? For Sanity sake, only fully-qualified domain names, no @localhost allowed. (or, both ways) Subdomains must be allowed ([email protected]) ...

Best Time of Day to Code

So far I've heard two answers to this question - early in the morning, after you shower and get to work, before you go to any mind-numbing meetings. You can actually get some work done now. Late at night, when everything is taken care of, and you can just spend one to three hours working on something that interests you personally. What...

What are the real challenges for a developer migrating between programming languages?

Many developers will claim that moving from one programming language to another is relatively simple especially if the languages are based on similar paradigms. However, in practice the effort comes not from learning the syntax of the language but in developing a deep understanding of the language nuances and more importantly knowing wha...

What are the developments going on in all languages in parallel programming area

As we are nearing the 8-Core and 16-Core CPUs, what are the various advances going on in parallel programming area in all the languages? I am aware of a parallel task library in .Net, and also of a language Erlang which I think is inherently parallel. But what is the state of various other mainstream languages. ...

What is the most common mistake you make while writing unit tests?

What is the one most common mistake you make while writing unit tests? Coupling? Lack of cohesion? Try to test too much functionality at once? Not testing enough functionality? Post some example code if you have an example of that mistake ...