views:

1880

answers:

19

One of the greatest joys (and hardest things to convey to non-programmers) is the feeling of exhilaration we often get when we finally get that "aha!" moment working on a tough problem - then we go implement it and it works magically. I've been thinking about some of my favorite challenges and how I eventually solved them - I think it would be interesting to hear what everyone else would classify as their hardest problem solved...

A: 

42 .

Stefan Mai
haha, the meaning of life? +1
alex
So meta....but technical? Hmm...
Christopher Lang
You do realize that due to a recent adjustment of fundamental constants by NIST, it's now 41.99999999496238, right?
DarenW
So long, and thanks for all the fish! :)
Mohit Nanda
Owned by the votes. Scrooges.
Stefan Mai
I have to -1, because the problem was requested, not the solution to the hardest problem ever solved.
Jimmy
@Jimmy lol, I'll have to gracefully accept my shame.
Stefan Mai
+2  A: 

Configuring remote debugging between VS 2003 on XP and W2K3 server.

IrishChieftain
+4  A: 

I had to efficiently implement a large scale protocol that was a sort of bidirectional SOAP-over-HTTP (that is, sometimes, the HTTP response was a SOAP request).

The part that was technically difficult was that it was a standard that was written and ratified by a standards body before any engineers ever tried to implement it. There were subtleties that didn't come out until implementation time.

Of course, off-the-shelf SOAP stacks wouldn't work because it was illegal to return a SOAP fault to a SOAP response (sent as an HTTP POST)... and every sensible SOAP stack wanted to report when completely invalid XML was received.

The technical challenge was really that I had to implement it regardless of its absurd 500 page specification and I had to make it interoperate with a score of other vendors all of whom read the spec differently.

I was simultaneously proud of my ability to come up with a clean and well-tested code base that worked as well as it did, and horrified at what came out of it.

Dustin
Industry-specific standards must be notorious for this sort of nonsense. I dodged a bullet, but one of my colleagues is in the midst of doing something just as crazy. The architects at http://www.opcfoundation.org/ couldn't code themselves out of a paper bag.
Greg D
ITSO! http://www.itso.org.uk/page49/Home/Itso-SpecificationDesign by committee FTW!
Quibblesome
Good one. Been there. In my case it was a protocol for manufacturing automation.
Mike Dunlavey
+12  A: 

Coming up with a new flatfield to calibrate images from a very expensive, very remote camera, for which it was impossible to send someone out there with a white card to hold in front, and for which the world would be scrutinizing the resulting images, and several internationally known researchers' careers would be depending on the accuracy of the results.

There were no textbook solutions for this problem!

Talk about being in the hotseat. Yet it's just image processing and number crunching. I came up with an algorithm to create this new flatfield using ordinary images of objects, and everyone is happy with it. I love this kind of work and these kinds of problems.

DarenW
Very remote? The Hubble Telescope?
christian studer
Good guess, but no. Cassini, roughly one billion miles away. If someone could please go there and hold up a white card and a MacBeth Color Checker card in front of the narrow angle camera...
DarenW
It was difficult just as an image processing problem. The computer sciency part of the difficulty was handling averaging and median filtering for a large number of 2D images - i really had to mind my O(N^2) and O(log(N)) algorithms.
DarenW
This is seriously awesome.
Wouter Lievens
I just gave a talk about this at a national lab in October. It seems to be of interest.
DarenW
+9  A: 

Generating a fibonacci series

I was 10 yrs old when i wrote a program to generate a fibonacci series, in BASIC. And till date i have never felt more challenged.

Since then, i have done things which are much bigger in proportion and deeper in concept but the effort required has never been more ;)

However, the 3 lines look so naive today...!

LET A = B

LET B = C

LET C = A + B

Mohit Nanda
If only you'd had Python: a, b = b, a + b :)
Skilldrick
The number of currently used computer languages that were around when I was 10 is depressingly small, unless you're going to count modern procedural languages as Algol descendants.
David Thornley
+14  A: 
muhuk
I never knew there were applications like that =D
Nailer
Whoa.. do paste the output snapshot as well, if possible. It'll be a good sight to look at :)
Mohit Nanda
This is NOT the craziest piece of software ever made. My mother's first website (she's a webdesigner) was for a self-proclaimed therapist who let his patients look at a sand timer for ten minutes. And yes, the website contained a pay-per-view anigif of said object.
Wouter Lievens
+8  A: 

Not the most challenging problem I've ever solved, but for my age it was quite a good experience.

It was 7th or 8th grade if I recall, and I had made a program (in Delphi i believe it was) to do my math homework. I did this for a lot of the math classes in my early years. I figured that if I could tell the computer how to solve an equation step by step, I would know it inside and out myself, since I dissected it and wrote it backwards. Anyway, it was a very simple UI, it had some radio buttons to determine which type of equation you were solving and the input boxes would change accordingly. There was one "Solve!" button and a textarea which would output the full solution (back then if you didn't write out the full solution and only the answer, we got a zero).

My philosophy was to either:

A. Sit down and code for a few hours and make a tool to do my math questions for me in minutes

or

B. Do every question manually.

Sure, doing one nights homework would have been faster than coding the program. But in grade school, you are assigned questions on the same topic for weeks at a time, so in the long run I would save time. In my case it was a calculation tool for finding lengths and angles of triangles (using Pythagorean Theorem & SOHCAHTOA).

Anyway, one day I was using the program in class and a kid leaned over and asked me where I got it. I told him I made it, and he offered to buy the program for $20 or so. This is where the fun began. Eventually word spread around, and that year I think i made almost $500 off of various kids in math class while getting good practice in programming - decent cash for a 12/13 year old (now that I think back on it, the kids probably took the money from their poor old parents, so i feel sort of bad).

Who would of thought math class could be so profitable?

John T
This makes me wish I didn't have a TI-92 in 7th grade. :( All I wrote were adventure RPGS
Jimmy
Yeah, this was me on programmable calculators.
John Gietzen
"I figured that if I could tell the computer how to solve an equation step by step, I would know it inside and out myself, since I dissected it and wrote it backwards." -- haha, I did the exact same thing!
Jorge Israel Peña
+8  A: 

I had to once explain a manager why we cannot include c# libraries in java program. This took me a day to do so.. I till date rate it as one of my toughest technical problem.

Jokes apart: To put technical things in a layman term, is one of the bigger challenges programmers face, and need to work upon.

As Steve Yegge says programmers need to improve on their marketing quotient.

Satya
"Why can't you use directly a Ford V8 motor in a Prius?"
Adriano Varoli Piazza
This is so true. I still remember explaining why we couldn't disable garbage collection in Java to a manager.
wheaties
Java's metric and C# is SAE. As a Slashdot reader, I'm honed for car analogies.
David Thornley
+7  A: 

I had an old 8086 PC from circa 1985 with some data that I needed to transfer to something modern. This was in the early 2000s, so parts from that era were basically impossible to find. The hard drive used some proprietary communication protocol (I couldn't even figure out what kind), so I couldn't just pop it into a modern PC. The floppy controller was broken, so I couldn't just use floppy disks. Because the floppy controller was broken and I didn't already have any type of networking software installed, I had no obvious way of installing software onto the 8086 to enable me to move data via any type of network. I couldn't even reasonably replace the floppy controller because getting the new controller to mesh with the BIOS I had would have been near impossible.

Back in the 8086 days, people used a protocol called Kermit to send data between PCs on serial ports, but I had no obvious way to get such software onto my 8086. Through sheer luck, I found qBasic source code to a receive-only Kermit program by googling, typed it into the 8086 by hand, used it to transfer a full Kermit program to the 8086, and then used that to send the files to a modern computer via serial port.

dsimcha
"Bootstrapping problems" like this are always fun!
j_random_hacker
+1  A: 

Changing out the thermocouple on my hot water heater while being totally paranoid that I'm going to blow my house up. It's not programming, but it's technical! :)

Kon
A: 

something i'm still wokring on..so i'm not sure it qualifies as "solved"... a more theoretically i work project in my spare time.

Basically i had to "encode" a binary file to a sequence of checksums , and based on that sequance to recreate the original file. The thins is that starting with only a checksum for a buffer you get bilions of possible "right" results, and thoundds of bilions of "wrong" answers, and just looking(and checking) for those answers would take something in the matter of days. I eventually found a way(few months ago) , starting from the checksum, to directly create the possible combinations in a matter of seconds(actually less than that:) )

Now i'm trying to find a way to get the only correct original binary file in a matter of seconds (from my calculations it would again take a few days to get the right solution starting from the bilions of "right" checkums:) )

Quamis
Bear in mind that, if you've got a million-bit file, you've got two to the millionth possible distinct files. By the pigeonhole principle, any method to recreate it precisely must have two to the millionth possible inputs, which take a million bits to represent. To recreate it from checksums, you need either enough independent checksums to have the same number of bits as the file, or other ways to tell what the file might be.
David Thornley
I'm going for "other ways" to tell what the final file should be like. I stopped working on this anyway, not enough spare time, and dont have strong math skills to be sure on what i'm actually doing.
Quamis
+2  A: 

My best Aha! moment was discovering differential execution in '86.

I was working on a graphical project and there were user-defined pictures encoded as little painting procedures for a display processor, such as "put a button here", "draw a bar chart here", "if variable X > Y make sure the color of the chart is red", etc.

Then there was a need to incrementally update the image, without making the user add code to do that.

It was clear that if the procedures contained no conditional instructions, it would be easy. Just keep a linear history. Then I realized how it could work even if there were conditional instructions.

Differential execution was a way to do that for any procedure, no matter how simple or complex.

It took a long time before I was able to prove that it would always work, and even longer to find a good way to explain why anyone would want to use it.

wiki
sourceforge

Mike Dunlavey
+1  A: 

Installing SuSE Linux and getting the soundcard to work.

nes1983
+2  A: 

I wrote an editor for the Amiga once, and the challenge here was to keep the speed, even if one typed something at the beginning of a long text (something, Windows Notepad still hasn't solved). The trick I found in some book then is, to have a gap in your text buffer, right where the cursor is. So if you type, you don't have to shift all text after the cursor to get space for the newly entered text, but instead can directly write it into the gap. Doing the output is somewhat trickier as you have so skip the gap when doing it. When moving the cursor, you have to shift the gap, so the worst case is, to jump to the beginning or end of the text.

Ridcully
You could have used a balanced tree to implement a sequence with O(log n) reads, insertion and deletion.
Jonas Kölker
+3  A: 

Programming for an LED sign. Most software up until that point had been all software based. I decided to leap out of my comfort zone, and make something to talk to a led sign. Getting the hardware itself shipped was hard in the first place, and then the coding began.

Documentation was fairly poor, so I had to learn to debug and see what programs sent and received. This helped me for other programs as well, so I can see what packets are going out and be more aware of where all that data is going (and what it looks like!)

I went through many failed revisions, each one I learned a heap and doubt I could have done the final revision without those earlier ones. The time scale of the whole thing (about six months) made it important to take down notes so I could come back and not get lost as easily - this helped me work in teams much better too.

Challenging I guess comes with rewarding too - its the only one that's a fairly strong talking point about it when it's seen working.

I feel that any project that lets you learn a new technique at the time is a way to have a mini-challenge as well - for example, your first project involving a class, or moving to object oriented code.

SuperRoach
+1  A: 

I think developing an HDLC protocol Windows 3.1 device driver which I wrote in assembly.

After being immersed in it for the 4 weeks or so it took me to write the driver, my way of thinking changed and I couldn't help but think of real world objects as things I needed to mov, push and pop around.

Fortunately my brain changed back to thinking about the world as objects with inheritence, properties and methods. Phew!

Canoehead
A: 

Our teacher in college challenged us to make a Java Chat application, something like Yahoo and MSN Messenger. He challenged us because we just started learning Java Object Oriented, and we kept telling him it looks easy just like what we learned in ANSI C.

The guy was pissed and said if you make a Chat Messenger using Java during a week then i will give you full mark in this course.

The team group was 2 members max. The application will allow you to chat (not voice) with as many members you want. And he will test it between two labs in two different buildings.

Me and my partner made the application in 6 hours only. All we knew about Java that time was the word means coffee!!!

Although im a programmer for few years now (and that challenge seems trivial) but im still proud of it. I got 100% in Java :)

medopal
A: 
int ii1 = 1;
int ii2 = 2;

ii1 ^= ii2;
ii2 ^= ii1;
ii1 ^= ii2;

When I found this answer.

Woot4Moo
+1  A: 

Making my first asp.net mvc application with nhibernate was very challenging and it took me two weeks to see my application running..... My Team leader satya once told that nHibernate can be implemented in .net and i did it now...

Pandiya Chendur