fun

Group games to teach computer programming (either functional or imperative)

(See end for summary of updated question.) I want to convey to groups of people (kids or adults) how a computer program written in a high-level language works, and what the relationship is of that program to the computer as a consumer device as they know it (a TV-like box that "does" typing and "internet"). I want to do it without comp...

Fun project -- can you hook flash?

So my wife is hooked on playing bejeweled on FaceBook. Whenever I watch her play (and she's pretty good) I think man I bet I could write a pretty sweet algorithm that would put up a really good score. So more than anything, I guess I need to know, if there is anyway to observe the UI hooks in Flash from either in the browser with JavaS...

Can you write a simple weekly reminder using a (ba)?sh script quine?

I need to set myself a reminder to attend a weekly meeting. The trouble with my company's standard reminder tool is that when it runs under wine, it pops up on an off-screen virtual desktop. I thought it would be interesting to see if I could come up with an "at" command that pops up a reminder window and then resubmits itself for the ...

Did you ever get into trouble because of using or creating odd-named software?

I've noticed that some software names occasionally raise an eyebrow. I'm thinking of: libpr0n (semi-official synonym of libimg2) mutt (Mail client) BullZip (Freudian slip waiting) GSpot (codec identification software) Did you ever get into trouble for using software or creating software with an odd name like these? ...

Compilers targeting .pyc files?

Out of curiosity, are there many compilers out there which target .pyc files? After a bit of Googling, the only two I can find are: unholy: why_'s Ruby-to-pyc compiler Python: The PSF's Python to pyc compiler So… Are there any more? (as a side note, I got thinking about this because I want to write a Scheme-to-pyc compiler) (as a ...

Visual Studio 2010 beta 2 fonts & colors dialog

Do the characters in the preview box mean anything? Have wracked my brains and probably missed the obvious, or I'm a bit daft and its something I should already know! ...

Which metaphor would you use to describe programming?

One colleague compared programming to the clay molding process - first you define rough shape of the mass, then carve smaller and smaller details. What's Your take on programming, which metaphor would you use to describe programmer's work? ...

What is the name of this operator: "-->"?

After reading this post on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both VS 2008 and G++ 4.4. The code: #include <stdio.h> int main() { int x = 10; while( x --> 0 ) // x goes to 0 { printf("%d ", x); } } Where in the standard is this defined, and where did it come ...

Features needed when building a ORM with PHP?

I have never really appreciated ORM's so I think that the only way to remedy this is to build a basic one myself so I can see what all the hubbub is. So with that in mind, what are the basic features I would need to include to make a semi-usable ORM? As far as I can tell, it would basically need to work like this for the end programmer:...

Funniest code names for software projects

Developers are creative. Not as they create wonderfull GUIs or proof their sense for art with good color combinations, but with code names. Every project has a code name, sometimes official, sometimes private (with a good reason!). Here are my favourites: Android: 1.6 = Donut 2.0 = Eclaire (picture of Google's eclaire) grml (Live dis...

Longest keyword chain?

As I was typing some constants in Java I noticed I had used 4 keywords in a row, which Eclipse highlighted for me: public static final int. I then took a break from my regular coding and asked myself (and google with no relevant results) what the longest chain of keywords I can use and still have valid code. After a while, the best I cou...

Simple proof that GUID is not unique

I'd like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it's not working. How can I make it work? BigInteger begin = new BigInteger((long)0); BigInteger end = new BigInteger("340282366920938463463374607431768211456",10); //2^128 for(begin; begin<end; begin++) Console.W...

A Regex that will never be matched by anything

This might sound like a stupid question, but I had a long talk with some of my fellow developers and it sounded like a fun thing to think of. So; what's your thought - what does a Regex look like, that will never be matched by any string, ever! Edit: Why I want this? Well, firstly because I find it interesting to think of such an expre...

Convert clause to a Fun

How to represent this clause in one line using Fun. perms([]) -> [[]]; perms(L) -> [[H|T] || H <- L, T <- perms(L--[H])]. ...

If you had the time and inclination to create a programming language, what characteristics would it have?

Just curious. If you had the time and inclination to create a programming language, what characteristics would it have? One language I would like to see would borrow as much from the syntax of Python as possible but compile to machine code that runs as fast as C or C++. ...

How would you make this switch statement as fast as possible?

2009-12-04 UPDATE: For profiling results on a number of the suggestions posted here, see below! The Question Consider the following very harmless, very straightforward method, which uses a switch statement to return a defined enum value: public static MarketDataExchange GetMarketDataExchange(string ActivCode) { if (ActivCode == ...

How will you explain a database in three sentences to an eight-year-old kid?

This question was asked in a google interview for the job 'Product manager', according to www.businessinsider.com. They have also answered it but, I think, it is not pretty satisfactory. The answer they gave is: A database is a machine that remembers lots of information about lots of things. People use them to help remember that info...

Powershell challenge

I've been challenged by a friend to do the following: "Find the quickest and easiest way of sorting a directory listing by the LAST character of the filenames." He's done it on Linux using the following: ls | rev | sort | rev I'd like to show him the powershell alternative, but I'm only just starting to learn powershell and I can't ...

What does "my other car is a cdr" mean?

Can anyone well versed in lisp explain this joke to me? I've done some reading on functional programming languages and know that CAR/CDR mean Contents of Address/Decrement Register but I still don't really understand the humour. ...

CSS positioning challenge

This is a problem I have encountered several times over the years, and I always give up and use JavaScript to do the calculations on the page resize event. Can it be done with pure CSS? I need to fashion a CSS layout like this: +--------------------------- header --> +--------------------------- menu | scrollable content | --...