challenge

Twitter image encoding challenge

If a picture's worth 1000 words, how much of a picture can you fit in 140 characters? Note: That's it folks! Bounty deadline is here, and after some tough deliberation, I have decided that Boojum's entry just barely edged out Sam Hocevar's. I will post more detailed notes once I've had a chance to write them up. Of course, everyone shou...

Challenge: Getting Linq-to-Entities to generate decent SQL without unnecessary joins

I recently came across a question in the Entity Framework forum on msdn: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/bb72fae4-0709-48f2-8f85-31d0b6a85f68 The person who asked the question tried to do a relatively simple query, involving two tables, a grouping, order by, and an aggregation using Linq-to-...

Using a Script to automate data entry to an OpenOffice Calc Spreadsheet

I would like to be able to automate creating spreadsheets and adding data to an OpenOffice spreadsheet using a script (any scripting language is acceptable - PowerShell, Python, or even JavaScript). What is a suitable library or tutorial? ...

How to CSS a two column list of items?

I need to display a two column list of items according to the following rules: Container for the columns has fluid width Width of both columns needs to be equal Items are dynamically rendered and at least one will be displayed Item ordering needs to flow down the left column first, then the right Items need to line up evenly across the...

Twitter text compression challenge

Rules Your program must have two modes: encoding and decoding. When encoding: Your program must take as input some human readable Latin1 text, presumably English. It doesn't matter if you ignore punctuation marks. You only need to worry about actual English words, not L337. Any accented letters may be converted to simple ASCII. You m...

Write a C program to find the smallest of three integers, without using any of the comparison operators.

I found this question online and have been struggling to come up with an answer to it on my own. Bonus question I found. Write hello world in C without using a semicolon. ...

The Skyline Problem.

I just came across this little problem on UVA's Online Judge and thought, that it may be a good candidate for a little code-golf. The problem: You are to design a program to assist an architect in drawing the skyline of a city given the locations of the buildings in the city. To make the problem tractable, all buildings are rectangular...

When have you been put on a new project that was far more challenging than anything you'd worked on before?

I work for a small trading company. It's a very small team of four developers, two of whom -- myself and another guy -- do the coding for the actual algorithms and develop the main application used by the traders. To be honest, the work we do here is generally very simple from a programming standpoint. The traders come up with a relativ...

Array Searching code challenge

Here's my (code golf) challenge: Take two arrays of bytes and determine if the second array is a substring of the first. If it is, output the index at which the contents of the second array appear in the first. If you do not find the second array in the first, then output -1. Example Input: { 63, 101, 245, 215, 0 } { 245, 215 } Expecte...

CodeChef and Challenge-style programming in the context of (my) career growth

I've recently stumbled upon a site called CodeChef; I must admit that it has peaked my interest. I'm wondering if spending time doing these puzzles (after all, that is what they are), are worth the time for a professional software developer? I'm defining software developer in the context of my current career track. Right now, I develop...

How to turn a very long column into multiple shorter ones?

This is a challenge question / problem. Hope you find it interesing. Scenario: You have a very long list (unreasonably long) in a single column. It would be much better displayed in multiple shorter columns. Using jQuery or another tool, what do you do? The format of the list is as follows: <div class="toc"> <dl> <dt>item 1</dt> ...

Algorithm challenge: Generate color scheme from an image

Background So, I'm working on a fresh iteration of a web app. And, we've found that our users are obsessed with being lazy. Really lazy. In fact, the more work we do for them, the more they love the service. A portion of the existing app requires the user to select a color scheme to use. However, we have an image (a screenshot of t...

Challenge - HTML Table to Text

Not sure if this is an original idea but it seems like a fun idea either way. Lets see who can convert something like this... <table> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> To this... +-----+--...

Triangle numbers problem....show within 4 seconds

The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,2,3,6 10: 1,2,5,...

How to do matrix conversions by row and columns toggles?

I have got a square matrix consisting of elements either 1 or 0. An ith row toggle toggles all the ith row elements (1 becomes 0 and vice versa) and jth column toggle toggles all the jth column elements. I have got another square matrix of similar size. I want to change the initial matrix to the final matrix using the minimum number of t...

Selecting, Grouping on child list -> Single statement requested.

Example: I have an in-memory list of customers. Every customer has a list of orders. Every order has a list of items. Every item has an item-code. I need to get a list of items grouped by the itemcode, with beneath it the customers who have ordered this item. If a customer ordered an item twice or more, he should still be shown as a sin...

Code Golf: Solve a Maze

Here's an interesting problem to solve in minimal amounts of code. I expect the recursive solutions will be most popular. We have a maze that's defined as a map of characters, where '=' is a wall, a space is a path, '+' is your starting point, and '#' is your ending point. An incredibly simple example is like so: ==== + = = == = # =...

Coding brain teaser to update an array (language agnostic)

All, I need a clever way to implement this algorithm (for work) as quickly and cleanly as possible: I think I've removed all the language specific issues and boiled it down to this: I have two arrays: A and B. A has a list of names in it {Apple, Apple, Banana, Banana, Banana, Carrot, ...} each i-th value has no upper limit on the num...

JavaScript method chaining challenge

(This question is not really restricted to the language so please feel free to submit solution in other languages too.) I was just wondering if it would be possible to write something like this in JavaScript: // Wait 3 seconds and then say our message in an alert box wait(3).then(function(){alert("Hello World!");}); Where the traditi...

Transforming a NxN binary matrix to a zero matrix using minimum row and column toggles.

Hello, This is about the question i posted regarding converting one NxN binary matrix to another . The question i asked is a code-challenge problem . However, a similar question was asked at http://stackoverflow.com/questions/1310590/matrix-conversion. I went through that thread,and have gained some idea about how to go about solving th...