What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying.
I'm interested in seeing the answers using any and all programming languages. Let's try to keep one answer per ...
One song per answer please!
We have discussed music you listen to while coding, but I looking for music related to coding and coders. It can be eclectic or mainstream, and even a bit of a stretch (just explain the connection).
Vote for your favorite song or add it if it isn't already here.
Link to lyrics, band, music, video, etc., ...
Some programmers enjoy optimizing code to make the implementation as fast as humanly possible; or golfing to make code as compact as possible. Others enjoy metaprogramming to make code generic, or designing algorithms to be asymptotically efficient.
What do you find most interesting and challenging as a programmer?
...
I'm unemployed and I don't have that much programming experience. So I need to get experience and I figure the best way of doing so is programming my own projects. Now there are a few problems with this:
1) I have a hard time thinking of practical/fun projects that are within my ability to program.
2) I have a strong aversion to gett...
I learned a lot about various languages last time I did one of these, so I figured I'd submit another. Community Wiki of course...
All programming languages are acceptable. The goal is to create the program in a language with the least amount of characters. New lines and indenting should be left in for clarity, but not counted. Try ...
I found a very funny list on a blog post: If programming languages were religions. It's funny, tongue-in-cheek, and not to be taken seriously. But they left off my language, Object Pascal. And I can't really think of a religion that fits. Anyone have any ideas?
(NOTE: This is a purely subjective question, just for humorous purposes ...
Print all 12 verses of the popular holiday song.
By 12 verses I mean the repetition of each line as is sung in the song, ie
Verse One:
On the first day of Christmas my true love gave to me
a partridge in a pear tree.
Verse Two
On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.
...
...
As the BigCo I worked for got serious about software development, they encouraged more formal terminology. Instead of bugs, which might randomly just happen, they preferred the term defect which could be prevented. Tongue firmly in cheek, I developed the following guideline:
Levels of Unexpected Software Events (USE)
An Unverified Fe...
What was the weirdest (or most awkward) time and place that you've found yourself thinking about a programming problem?
...
A few years ago, I wrote this in c#:
private string InternOrNot(string v)
{
if (v == "EUREX");
return "EUREX";
else
return v;
}
This method may look useless, but it's not. In fact, it dramatically decreased the memory usage of one of our servers.
This server acted as a data cache for financial data received on...
Given a number N, how can I print out a Christmas tree of height N using the least number of code characters? N is assumed constrained to a min val of 3, and a max val of 30 (bounds and error checking are not necessary). N is given as the one and only command line argument to your program or script.
All languages appreciated, if you s...
I have assembled almost all the parts needed to build a working Turing machine, but a strip of infinite tape is nowhere to be found!
How did you find/make the infinite tape? Can i have half of yours?
...
Write a program that take a single command line argument N and prints out the corresponding Roman Numeral.
Eg N = 2009 should print MMIX.
Let's say this should work for 0 < N < 3000.
(Had fun playing my first ever round of code golf with the Christmas edition, and thought this could fit for New Year. Googled to see if this has come up...
For fun when I have time, I like to code games to see how hard it is or just because I want to see how it works from the inside or just for personal challenge. I just like coding. For now, I made these ones.
So I made a Sudoku board. First it was the normal 3x3x3 board but then someone asked me to do a 4x4x4 board. I was successful but ...
I was thinking about a name for a new blog and wanted to name it after a computer error of some description (partly inspired by this site). So I want to know some people favorites.
I remember at a job I had "Catastrophic failure" was used a lot as an error message, to the users as well!
Please give me some inspiration. There is a 99% ...
I'm not talking about huge project but short little pieces of code you'd be willing to post. I'm just interested to see what quick little things other people come up with. For me, my favorite is this one. It is in C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE* getFile(char* prompt, char* fileType)
{
char* nam...
This should be a simple question, but I haven't been able to find a way to make it work.
Essentially, I have a silly localhost page that I use in my webdevelopment. When I am surfing between our development server and my local version of the C# code (redirected from the dev url via host file) I have been known to sometimes forget what ...
My first experience with a game that got me interested in computers (still programming):
Leisure Suit Larry
After "Ken sent me", I was hooked.
Leisure Suit Larry creator's site: Al Lowe
...
I'm interested in stories (factual, preferably on well-known systems) about funny or interesting ways in which certain design or implementation decisions constrained the software as it was experienced by users.
For example, in the funny comment threads someone mentioned that in the original Doom game, doors opened vertically because the...
So I got asked today what was the best way to find the closes match within a collection.
For example, you've got an array like this:
1, 3, 8, 10, 13, ...
What number is closest to 4?
Collection is numerical, unordered and can be anything. Same with the number to match.
Lets see what we can come up with, from the various languages o...