challenge

Generate all possible combinations of several columns in .NET

I have like 4 columns in a file, each column contains a number of values, more or less. I need to get all possible combinations, while order of columns and number of sections in resulting strings should remain the same. E.g. first column contains numbers ranging 1-100, second: letters a-z, and the third one is also numeric, I would get ...

Yii framework "meta db model" creation + postgres inheritance

I have few DB tables, witch are build using inheritance from one table witch is an sort of "template" for creation of new tables, and now i have set of businesses logic methods witch work on columns inherit from template, additional columns are used only as params for presentation of models, they're have no meaning for logic. The goal i...

Code Golf: Calculate Orthodox Easter date

The Challenge Calculate the Date of the Greek Orthodox Easter (http://www.timeanddate.com/holidays/us/orthodox-easter-day) Sunday in a given Year (1900-2100) using the least amount of characters. Input is just a year in the form '2010'. It's not relevant where you get it (Input, CommandLineArgs etc.) but it must be dynamic! Output sho...

Help needed with math/bignum challenge

I'm struggling with the following bit of code(/challenge) and I was wondering what would be the best way to solve it. Pseudo(-like) code If I understand the code correctly it does: var val = 1 foreach (char in firstargument): val = val * ((ascii)char + 27137) if (val == 9215629587130840783880821452128359619700556749382698126651526...

what is wrong with my 3n+1 solution?

I get wrong answer from both online judges. #include <stdio.h> int main(int argc, char * argv[]) { long long i=0; long long j=0; long long p=0; long long q=0; long long larger; long long smaller; long long cycle_length=1; long long max_cycle_length=1; while (scanf("%lld %lld",&p,&q) !=EOF) { /*check validity of input*/ i...

How can I reproduce a scribbly pattern like this in code?

I made this graph in wolfram alpha by accident: Can you write code to produce a larger version of this pattern? Can you make similar looking patterns? Readable code in any language is good, but something that can be run in a browser would be best (i.e. JavaScript / Canvas). If you write code in other languages, please include a scr...

listing all interesting sections of a tetrahedron

An interesting 2d section is plane that goes through the center of a regular 3d simplex and 2 other points each of which is a centroid of some non-empty subset of vertices. It is defined by two subsets of vertices. For instance {{1},{1,2}} gives a plane defined by 3 points -- center of the tetrahedron, first vertex, and average of first ...

What's the easiest way to write a please wait screen with Delphi?

I just want a quick and dirty non-modal, non-closable screen that pops up and goes away to make 2 seconds seem more like... 1 second. Using 3-5 lines of code. Is this too much to ask? ...

Conway's Game of Life, reversed

The challenge: Write a program which implements John Conway's Game of Life cellular automaton - in reverse! The rules of life are explained on the Wiki page, in this question from last month, and will probably be familiar to any person crazy enough to take the challenge. In this week's challenge, the goal is not to apply the rules of ...

Greplin Programming Challenge - Level 1

It would be interesting to see some solutions to this challenge in a variety of languages! It's fairly simple but I think there's lots of different approaches that could be taken and I look forward to seeing what the community comes up with! Embedded in the below block of text is the password for level 2. The password is the ...

Find the least number of coins required that can make any change from 1 to 99 cents

Recently I challenged my co-worker to write an algorithm to solve this problem: Find the least number of coins required that can make any change from 1 to 99 cents. The coins can only be pennies (1), nickels (5), dimes (10), and quarters (25), and you must be able to make every value from 1 to 99 (in 1-cent increments) using those co...

Difference of sums

I take no credit for this challenge at all. It's Project Euler problem 6: The sum of the squares of the first ten natural numbers is, 1^(2) + 2^(2) + ... + 10^(2) = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^(2) = 55^(2) = 3025 Hence the difference between the sum of the squares of the first ten ...

Web dev equivalent of Project Euler

Project Euler is a site with general algorithmic challenges that can be a part of just about any software but is there any challenges that focus on the overall end result of web apps? It should be compatible with just about any web framework in a similar way that project Euler can be done in any language. ...

ASP - Biometric Authentication

Cheers, We started implementing biometrics authentication in our web system and came to a doubt. We're going to use a third-party solution for performing it which is going to be called via a web service. There are going to be four kinds of authentication: Regular one: username/password Challenge Fingerprint Cellphone All users will...

What's the most complex/powerful code you can write that's valid in a maximum number of languages?

What's the most complex/powerful code you can write that's valid in a maximum number of languages? So, for example, the following code is valid in both PHP and JavaScript. function foo($bar) { $var = 0; for($i=0;$i<100;$i++) { $var += ($bar + 2)/(1+$i); } return $var; } Why is this a useful challenge? I think its a useful way to t...