language-agnostic

What are the differences between pipes in Windows and Linux?

What are the differences between pipes in Windows and Linux? ...

What are the advantages of memory-mapped files?

I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: concurrency random access performance ease of use portability ...

Naming your projects: does it matter?

I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public. What gets me stuck is the christening. So, does it matter? Should I just choose something and stick with it? And if it does matter, what's better: a ...

What programming languages do you consider indispensable in your experience?

Each programming language comes with its concepts, best practices, libraries, tools, community, in one word: culture. Learning more than one programming language will make you a better programmer, for the more concepts you learn, the faster you will feel comfortable when the next language or technology will come. Mine, so far, are C, so...

implementing a compiler in "itself"

Hi, Intuitively, it would seems that a compiler for language Foo, cannot itself be written in Foo. More specifically, the first compiler for language Foo cannot be written in Foo, but any subsequent compiler could be written for Foo. But is this actually true? I have some very vague recollection of reading about a language whose first ...

Have you ever crashed the compiler?

Everyone (at least everyone who uses a compiled language) has faced compilation errors but how many times do you get to actually crash the compiler? I've had my fair share of "internal compiler errors" but most went away just by re-compiling. Do you have a (minimal) piece of code that crashes the compiler? ...

Class member organization

What is the best way to sort class members? I'm in conflict with a team member about this. He suggests that we should sort the members alphabetically. I think it's better to organize in a semantic manner: important attributes first, related methods together, etc. What do you think? ...

Is Javascript a proper platform for cryptography? Or, can it be?

I noticed a good while back that Wikipedia links to a Javascript implementation of different hash functions. Also found Clipperz Crypto. Even Mozilla implements a crypto object in Firefox. So, Is Javascript a proper platform for cryptography? Or, can it be? Or, I suppose.. Are there any purposes or benefits for hashing data before POST?...

Generating random number excluding range

How do you generate a random number within a range while excluding certain range(s). Eg. range 1-10 but not in 2-4 or 7. Solutions I've used so far: Generate a random an test if it is within the dis-allowed range. Based on result either output the number or try again. Map allowed ranges to a uniform range. Get a random between 1 and 6 ...

Unique random numbers in O(1)?

The problem is this: I'd like to generate unique random numbers between 0 and 1000 that never repeat (I.E. 6 doesn't come out twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible? ...

How best to decide on an MVC framework between developers with different backgrounds?

Let's say that Developer Alex has a strong background in Perl and is familiar with the Catalyst framework. Developer Bob, meanwhile, has a strong background in Ruby and is familiar with the Rails framework. Alex and Bob get together on a start-up. Of course, each will have very good arguments for their own specialty. Each will have a go...

Design question: How can I access an IPC mechanism transparently?

I want to do this (no particular language): print(foo.objects.bookdb.books[12].title); or this: book = foo.objects.bookdb.book.new(); book.title = 'RPC for Dummies'; book.save(); Where foo actually is a service connected to my program via some IPC, and to access its methods and objects, some layer actually sends and receives messag...

Generate User Specific 1 Time Coupon Code

So I need to generate a code that can be tied to a specific user/prospect with a dollar amount built into it. It needs to be reversible so that client application can confirm the validity of the code and apply the discount a manager intends. I'd like to make the code as short as possible but it needs to be well obfuscated so that the s...

What Pros & Cons would there be to saving code more granularly at the file level?

What do you think of this kind of code-to-files-mapping? ~/proj/MyClass.ext ~/proj/MyClass:constructors.ext ~/proj/MyClass:properties.ext ~/proj/MyClass:method-one.ext ~/proj/MyClass:method-two:int.ext ~/proj/MyClass:method-two:string.ext In a language which is more functional-oriented: ~/proj/definitions.ext ~/proj/functio...

Most Effective Way to Evaluate Talent

I'm a contractor that is often looking for subcontractors, but I feel like there is way too much trial and error in the process. How do you screen talent, and what are effective ways for discerning between those that talk the talk and walk the walk? Talent is hard to determine from just code samples and an interview - what innovative wa...

How do you get a co-worker to use 3rd party code?

There is a guy I work with who has been tasked with getting a grid hooked up to a database. There has been some problem with the performance of the built-in grid and we are looking for alternative solutions. I have suggested (and my manager has backed me up) that we try testing 3rd party grids such as Infragistics, XCeed, Telerik, or a...

Freeware Programmer Calculator

There have been lots of times in the past where a good programmer-oriented calculator would've saved me a lot of time. Lately, I've been doing quite a lot of bit manipulation, and having to do build/run to debug my calculations feels really slow. I've looked for something like this in the past, but found nothing that worked very well. ...

Non-deterministic finite state machines in software development?

Recently I've been thinking about finite state machines and how I would implement them in software (programming language doesn't matter). My understanding is that deterministic state machines are in widespread use (parses/lexers, compilers and so on). Okay, that's great. But what's the matter with non-deterministic state machines? I kn...

How do I check if a number is a palindrome?

Any language. Any algorithm (except making the number a string and then reversing the string). Also, I actually have to do this, and I'll be posting my solution too. ...

Most Influential CS Class You've Taken

What is the most influential CS class that you've taken? This could mean the one which made you a better programmer, the one which changed the way you think about CS... maybe even the one that made you decide not to major in CS, although I doubt we'll see many of those around here. I have two candidates: One was Computer Systems, where ...