All Problems

Output a string to the console

Write the string "Hello World!" to STDOUT
ruby
puts "Hello World!"
$stdout<<"Hello World!"
cpp
std::cout << "Hello World" << std::endl;
std::printf("Hello World\n");
Console::WriteLine(L"Hello World");
fsharp
printfn "Hello World!"
erlang
io:format("Hello, World!~n").
csharp
System.Console.WriteLine("Hello World!")
haskell
main = putStrLn "Hello World!"

Retrieve a string containing ampersands from the variables in a url

My PHP script first does a query to obtain customer info for a form. The form has first name and last name fields among others. The customer has put entries such as "Ron & Jean" in the first name field in the database. Then the edit form script is called with variables such as

"http://myserver.com/custinfo/edit.php?mode=view&fname=Ron & Jean&lname=Smith".

The script variable for first name $_REQUEST['firstname'] never gets beyond the "Ron" value because of the ampersand in the data.

I have tried various functions like urldecode but all to no avail. I even tried encoding the url before the view screen is painted so that the url looks like "http://myserver/custinfo/edit.php?mode=view&fname="Ronxxnbsp;xxamp;xxnbsp;Jean"&lname=SMITH". (sorry I had to add the xx to replace the ampersand or it didn't display meaningful url contents the browser sees.)

Of course this fails for the same reasons. What is a better approach?
ruby
gem 'uri-query_params'
require 'uri/query_params'

url = URI("http://myserver.com/custinfo/edit.php?mode=view&fname=Ron%20&%20Jean&lname=Smith")
url.query_params['fname']
# => "Ron & Jean"
url = "http://myserver.com/custinfo/edit.php?mode=view&fname=Ron & Jean&lname=Smith"
url = URI.parse(URI.encode(url))
cpp
QUrl url("http://myserver.com/custinfo/edit.php");
url.addQueryItem("mode", "view");
url.addQueryItem("fname", "Ron & Jean");
url.addQueryItem("lname", "Smith");
QByteArray encodedUrl = url.toEncoded();
fsharp
//the problem arises due to the fact that you've attempted to apply HTML entities encoding rather than URL encoding to your data!
//in F#, for example, assuming you would call this function with fname and lname parameters, this would produce the desired output
let getProperUrl fname lname = sprintf "http://myserver.com/custinfo/edit.php?mode=view&fname=%s&lname=%s" (HttpUtility.UrlEncode fname) (HttpUtility.UrlEncode lname)
// Example that shows encoding and decoding:
let queryString =
let fname = HttpUtility.UrlEncode("Ron & James")
let lname = HttpUtility.UrlEncode("Smith & Jones")
sprintf "http://myserver.com/custinfo/edit.php?mode=view&fname=%s&lname=%s" fname lname
/// All parameters in the URL as a lookup map
let parameters =
let paramStart = queryString.IndexOf('?')
if paramStart < 0 then
Map.empty
else
let values =
queryString.Substring(paramStart + 1)
|> HttpUtility.ParseQueryString
values.AllKeys
|> Seq.map (fun key -> key, values.[key])
|> Map.ofSeq
let fname = parameters.TryFind("fname")
let lname = parameters.TryFind("lname")
erlang
% encode ampersand in your string using %XX where XX is hex code for ampersand
% optionally encode spaces for completeness sake to keep URL solid
URL = "http://myserver.com/custinfo/edit.php?mode=view&fname=Ron%20%26%20Jean&lname=Smith",
{_, Query} = string:tokens(URL, "?"),
KeyValuePairs = string:tokens(Query, "&"),...
haskell
import Network.CGI

query = "http://myserver.com/custinfo/edit.php?" ++ formEncode [("mode", "view"), ("fname", "Ron & Jan"), ("lname","Smith")]

string-wrap

Wrap the string "The quick brown fox jumps over the lazy dog. " repeated ten times to a max width of 78 chars, starting each line with "> "

Expected output:
> The quick brown fox jumps over the lazy dog. The quick brown fox jumps over t
> he lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox
> jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The qui
> ck brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy
> dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps o
> ver the lazy dog. The quick brown fox jumps over the lazy dog.
ruby
str = "The quick brown fox jumps over the lazy dog. " * 10
outarr = str.scan(/[^ ].{0,76}/)
outarr.each{ |line| puts "> %s" % line }
cpp
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

void rep(ostream &os, const string& str, int times)
{
while (times--)
os << str;
}

void wrap(ostream &os, const string& str, const string &prefix, int width)
{
for (int offset = 0; offset < str.size(); offset += width)
os << prefix << str.substr(offset, width) << endl;
}

int main()
{
stringstream input;

rep(input, "The quick brown fox jumps over the lazy dog. ", 10);
wrap(cout, input.str(), "> ", 78);
}
erlang
wrapper(String, Times, Length) ->
StrList = lists:reverse(formatter(string:copies(String, Times), Length, [])),
lists:foreach(fun(Str) -> io:format("~p~n", [Str]) end, StrList).

formatter([], _Length, Acc) -> Acc;
formatter(String, Length, Acc) when length(String) > Length - 1->
{Head, Tail} = lists:split(Length - 1, String),
formatter(string:strip(Tail), Length, [[$>, $ | Head] | Acc]);
formatter(String, Length, Acc) ->
formatter([], Length, [[$>, $ | String] | Acc]).
haskell
wrap str
| length str <= 77 = [str]
| otherwise = [take 77 str] ++ wrap (drop 77 str)

mapM_ putStrLn . map ("> " ++) . wrap . concat . replicate 10 $ "The quick brown fox jumps over the lazy dog. "

Define a string containing special characters

Define the literal string "\#{'}${"}/"
ruby
special = '\#{\'}${"}/'
cpp
std::string special = "\\#{'}${\"}/";
String^ special = L"\\#{'}${\"}/";
fsharp
let special = "\#{'}${\"}/"
erlang
Special = "\\#{'}\${\"}/",
csharp
string verbatim = @"\#{'}${""""}/";
string cStyle = "\\#{'}${\"\"}/";
haskell
putStrLn "\"\\#{'}${\"}/\""
let special = "\\#{'}${\"}/"

Define a multiline string

Define the string:
"This
Is
A
Multiline
String"
ruby
text = <<"HERE"
This
Is
A
Multiline
String
HERE
text = "This\nIs\nA\nMultiline\nString"
cpp
std::string text =
"This\n"
"Is\n"
"A\n"
"Multiline\n"
"String";
String^ text = L"This\nIs\nA\nMultiline\nString";
std::string text = "This\nIs\nA\nMultiline\nString";
fsharp
let multiline = "This\nIs\nA\nMultiline\nString"
let multiline = "This
Is
A
Multiline
String"
erlang
Text = "This\nIs\nA\nMultiline\nString",
csharp
string output = "This\nIs\nA\nMultiline\nString";
string output = @"This
Is
A
Multiline
String";
haskell
s = "This \
\Is \
\A \
\Multiline \
\String"

Define a string containing variables and expressions

Given variables a=3 and b=4 output "3+4=7"
ruby
puts "#{a}+#{b}=#{a+b}"
puts "#{a}+#{b}=%s" % (a + b)
cpp
Console::WriteLine(L"{0}+{1}={2}", a, b, a+b);
std::printf("%d+%d=%d\n", a, b, a+b);
std::cout << boost::format("%|1|+%|1|=%|1|") % a % b % (a+b) << std::endl;
fsharp
let a, b = 3, 4
let mystr = sprintf "%d+%d=%d" a b (a+b)
printfn "%s" mystr
erlang
A = 3, B = 4,
io:format("~B+~B=~B~n", [A, B, (A+B)]).
csharp
int a = 3;
int b = 4;
Console.WriteLine("{0}+{1}={2}", a,b,a+b);
haskell
import Text.Printf

main = do
let a = 3
let b = 4
printf "%d+%d=%d" a b (a + b)
a = 3
b = 4
s = show a ++ "+" ++ show b ++ "=" ++ show (a + b)
main = putStrLn s

Reverse the characters in a string

Given the string "reverse me", produce the string "em esrever"
ruby
puts "reverse me".reverse
cpp
String^ s = "reverse me";
array<Char>^ sa = s->ToCharArray();
Array::Reverse(sa);
String^ sr = gcnew String(sa);
std::string s = "reverse me";
std::reverse(s.begin(), s.end());
std::string s = "reverse me";
std::string sr(s.rbegin(), s.rend());
std::string s = "reverse me";
std::swap_ranges(s.begin(), (s.begin() + s.size() / 2), s.rbegin());
fsharp
let reversed = new String (Array.rev ("reverse me".ToCharArray()))
let word = "reverse me"
//reverse the word
let reversedword =
word.ToCharArray()
|> Array.fold(fun acc x -> x::acc) []
erlang
Reversed = lists:reverse("reverse me"),
Reversed = revchars("reverse me"),
csharp
var str = "reverse me";
Console.WriteLine(new String(str.Reverse().ToArray()));
haskell
reverse "reverse me"

Reverse the words in a string

Given the string "This is a end, my only friend!", produce the string "friend! only my end, the is This"
ruby
reversed = text.split.reverse.join(' ')
cpp
array<Char>^ sep = {L' '};
array<String^>^ words =
String(L"This is the end, my only friend!").Split(sep, StringSplitOptions::RemoveEmptyEntries);

Array::Reverse(words); String^ newwords = String::Join(L" ", words);
std::string words = "This is the end, my only friend!"; std::vector<std::string> swv;

boost::split(swv, words, boost::is_any_of(" ")); std::reverse(swv.begin(), swv.end());
std::string newwords = (std::for_each(swv.begin(), swv.end(), StringTAndJ())).value();
fsharp
let reversed = String.Join(" ", Array.rev("This is the end, my only friend!".Split [|' '|]))
erlang
Reversed = string:join(lists:reverse(string:tokens("This is the end, my only friend!", " ")), " "),
csharp
var str = "This is a end, my only friend!";
str = String.Join(" ", str.Split().Reverse().ToArray());
Console.WriteLine(str);
haskell
unwords (reverse (words "This is the end, my only friend!"))

Text wrapping

Wrap the string "The quick brown fox jumps over the lazy dog. " repeated ten times to a max width of 78 chars, starting each line with "> ", yielding this result:

> The quick brown fox jumps over the lazy dog. The quick brown fox jumps
> over the lazy dog. The quick brown fox jumps over the lazy dog. The
> quick brown fox jumps over the lazy dog. The quick brown fox jumps
> over the lazy dog. The quick brown fox jumps over the lazy dog. The
> quick brown fox jumps over the lazy dog. The quick brown fox jumps
> over the lazy dog. The quick brown fox jumps over the lazy dog. The
> quick brown fox jumps over the lazy dog.
ruby
prefix = "> "
string = "The quick brown fox jumps over the lazy dog. " * 10
width = 78
realwidth = width - prefix.length
print string.gsub(/(.{1,#{realwidth}})(?: +|$)\n?|(.{#{realwidth}})/, "#{prefix}\\1\\2\n")
cpp
String^ input = ::copies("The quick brown fox jumps over the lazy dog. ", 10);
String^ sep = " "; String^ prefix = "> ";

String^ wrapped = textwrap(input, 74 - prefix->Length, sep, prefix);
Console::WriteLine("{0}", wrapped);
void rep(ostream &os, const string& str, int times)
{
while (times--)
os << str;
}

void wrap(ostream &os, const string& str, const string &prefix, int width)
{
int line_len = width;
bool first_word = true;

width -= prefix.size();
BOOST_FOREACH(string word, tokenizer<char_separator<char>>(str, char_separator<char>(" ")))
{
line_len += word.size();
if (line_len++ < width)
os << ' ';
else {
if (first_word)
first_word = false;
else
os << endl;
os << prefix;
line_len = word.size();
}
os << word;
}
os << endl;
}

int main()
{
stringstream input;

rep(input, "The quick brown fox jumps over the lazy dog. ", 10);
wrap(cout, input.str(), "> ", 72);
}
fsharp
let prefix = "> "
let input = "The quick brown fox jumps over the lazy dog. "

(String.split ['\n'] (textwrap (copies input 10) (73 - prefix.Length))) |> List.iter (fun line -> printfn "%s%s" prefix line)
let output maxWidth (s: string) =
let rec wrap = function
| lineSoFar, ([| |]: string array)-> printfn "%s" lineSoFar
| ">" as lineSoFar, (words: string array) ->
// Handle this case separately, thus we can also deal with
// cases where a word is longer then the max width
wrap (lineSoFar + " " + words.[0], Array.sub words 1 (words.Length - 1))
| lineSoFar, words when words.[0].Length + lineSoFar.Length >= maxWidth ->
printfn "%s" lineSoFar
wrap (">", words)
| lineSoFar, words ->
wrap(lineSoFar + " " + words.[0], Array.sub words 1 (words.Length - 1))
wrap (">", s.Split([| ' ' |]))

[| for i in 1 .. 10 do yield "The quick brown fox jumps over the lazy dog." |]
|> String.concat " "
|> output 78
erlang
TextWrap = textwrap(string:copies(Input, 10), 73 - length(Prefix)),
lists:foreach(fun (Line) -> io:format("~s~n", [string:concat(Prefix, Line)]) end, string:tokens(TextWrap, "\n")).
csharp
using System;
using System.Text;
using System.Linq; // used for Array.ToList() extension

public class TextWrapper {

/// <summary>
/// Wrap the given text to a given width.
/// </summary>
/// <param name="text">The text to be wrapped</param>
/// <param name="width">The maximum width of each line</param>
/// <param name="prefix">Begin each line with this prefix</param>
/// <returns>The wrapped text</returns>
public string Wrap(string text, int width, string prefix) {

var words = text.Split(' ').ToList();
var result = new StringBuilder(prefix);

width = width - prefix.Length;
prefix = "\n" + prefix;

int lineSize = 0;
foreach (var word in words) {
int wordLen = word.Length;

// Do we need to start a new line?
if ((lineSize + wordLen) > width) {
result.Remove(result.Length - 1, 1); // remove trailing space
lineSize = 0;
result.Append( prefix );
}

result.Append(word).Append(' ');
lineSize += wordLen + 1;
}

return result.ToString();
}

public static void Main() {
var prefix = "> ";
var sentence = "The quick brown fox jumps over the lazy dog. ";

var text = "";
for (int i = 0; i < 10; i++)
text += sentence;

// The description said lines of length 78, but
// the example was 72...
Console.WriteLine(new TextWrapper().Wrap(text, 72, prefix));
}
}
haskell
import Data.List (intercalate)

-- our list of words ["The", "quick", "brown", ...]
dogs = concat$ replicate 10$ words "The quick brown fox jumps over the lazy dog."

-- ["The", "The quick", "The quick brown", ...]
concats = scanl1 (\s v -> s ++ " " ++ v)

-- takes list of words, returns list of lines
wordwrap :: Int -> [String] -> [String]
wordwrap maxwidth [] = []
wordwrap maxwidth ws = sentence : (wordwrap maxwidth restwords)
where
zipped = zip (concats ws) ws
(sentences, rest) = span (\(s,w) -> (length s) <= maxwidth) zipped
sentence = last (map fst sentences)
restwords = map snd rest

main = putStrLn ("> " ++ intercalate "\n> " (wordwrap 76 dogs))

Remove leading and trailing whitespace from a string

Given the string "  hello    " return the string "hello".
ruby
puts " hello ".strip
" hello ".strip!
cpp
String^ s = " hello "; String^ trimmed = s->Trim();
fsharp
let s = " hello "
let trimmed = s.Trim()
let trimmed = " hello ".Trim()
erlang
Trimmed = string:strip(S),
csharp
string str = " hello ";
str = str.Trim();
Console.WriteLine(str);
haskell
unwords (words " hello ")

Simple substitution cipher

Take a string and return the ROT13 and ROT47 (Check Wikipedia) version of the string.
For example:
String is: Hello World #123
ROT13 returns: Uryyb Jbeyq #123
ROT47 returns: w6==@ (@C=5 R`ab
ruby
rot13 = "Hello World #123".tr!("A-Za-z", "N-ZA-Mn-za-m")
rot47 = "Hello World #123".tr!("\x21-\x7e", "\x50-\x7e\x21-\x4f")
cpp
#include <algorithm>
#include <iostream>
#include <cctype>
using namespace std;

int rot13(int c) {
if (!isalpha(c)) {
return c;
} else {
char start = islower(c) ? 'a' : 'A';
return ((c - start) + 13) % 26 + start;
}
}

int rot47(int c) {
if (c < 33 || c > 126) {
return c;
} else {
return ((c - 33) + 47) % 94 + 33;
}
}

int main(int argc, char **argv) {
for (int i = 0; i < argc; ++i) {
string original = argv[i];

string rot13enc = original;
transform(original.begin(), original.end(), rot13enc.begin(), rot13);

string rot47enc = original;
transform(original.begin(), original.end(), rot47enc.begin(), rot47);

cout << "original: " << original << endl
<< "rot 13: " << rot13enc << endl
<< "rot 47: " << rot47enc << endl;
}
return 0;
}
fsharp
#light

let rotChar (s:int) (l:int) (h:int) (c:char) =
let charCode = int c
let letterCount = h - l + 1
let newCharCode = (charCode - l + s) % letterCount + l
char newCharCode

let rot13 (text:string) =
let rotChar13 = function
| (c:char) when 'A' <= c && c <= 'Z' -> rotChar 13 (int 'A') (int 'Z') c
| c when 'a' <= c && c <= 'z' -> rotChar 13 (int 'a') (int 'z') c
| c -> c
new string([| for c in text -> rotChar13 c|])

let rot47 (text:string) =
let rotChar47 = function
| ' ' as c -> c
| c -> rotChar 47 (int '!') (int '~') c
new string([| for c in text -> rotChar47 c |])
erlang
rot13(Str) ->
lists:map(fun(A) ->
if
A >= $A, A =< $Z -> ((A - $A + 13) rem 26) + $A;
A >= $a, A =< $z -> ((A - $a + 13) rem 26) + $a;
true -> A
end
end, Str).

rot47(Str) ->
lists:map(fun(A) ->
if
A >= $!, A =< $~ ->
((A - $! + 47) rem 94) + $!;
true -> A
end
end, Str).
haskell
import Char

ebg13 c | isAlpha c && toLower c <= 'm' = chr ((ord c) + 13)
| isAlpha c && toLower c > 'm' = chr ((ord c) - 13)
| otherwise = c
rot13 str = map ebg13 str

ebg47 c | c > ' ' && c <= 'N' = chr ((ord c) + 47)
| c > 'N' && c <= '~' = chr ((ord c) - 47)
| otherwise = c
rot47 str = map ebg47 str

Make a string uppercase

Transform "Space Monkey" into "SPACE MONKEY"
ruby
uppper = text.upcase
cpp
String(L"Space Monkey").ToUpper();
std::string s = "Space Monkey";
std::transform(s.begin(), s.end(), s.begin(), std::toupper);
std::string s = "Space Monkey";
boost::to_upper(s);
fsharp
printfn "%s" ("Space Monkey".ToUpper())
printfn "%s" (String.uppercase "Space Monkey")
erlang
io:format("~s~n", [string:to_upper("Space Monkey")]).
csharp
string output = "Space Monkey"

System.Console.WriteLine(output.ToUpper())
haskell
toUpperCase oldstring converted = if oldstring == ""
then converted
else toUpperCase (tail(oldstring)) (converted ++ [Char.toUpper(head(oldstring))])

toUpperCase "Space Monkey" ""
toUpperCase = map Char.toUpper

toUpperCase "Space Monkey"

Make a string lowercase

Transform "Caps ARE overRated" into "caps are overrated"
ruby
"Caps ARE overRated".downcase
cpp
std::string s = "Caps ARE overRated";
std::string sl(boost::to_lower_copy(s));
String(L"Caps ARE overRated").ToLower();
fsharp
printfn "%s" ("Caps ARE overRated".ToLower())
printfn "%s" (String.lowercase "Caps ARE overRated")
erlang
io:format("~s~n", [string:to_lower("Caps ARE overRated")]).
csharp
string str = "Caps ARE overRated";
str = str.ToLower() ;
Console.WriteLine(str);
haskell
import Char
str = map toLower "Caps ARE overRated"

Capitalise the first letter of each word

Transform "man OF stEEL" into "Man Of Steel"
ruby
caps = text.gsub(/\w+/) { $&.capitalize }
caps = text.split.each{|i| i.capitalize!}.join(' ')
text.split.map(&:capitalize) * ' '
cpp
std::string words = "mAn OF stEEL";
std::transform(words.begin(), words.end(), words.begin(), ToCaps<>());
StringBuilder^ sb = gcnew StringBuilder(L"man OF stEEL");

for (int i = 0, isFirst = 1; i < sb->Length; ++i)
{
sb[i] = Char::IsWhiteSpace(sb[i]) ? (isFirst = 1, sb[i]) : isFirst ? (isFirst = 0, Char::ToUpper(sb[i])) : Char::ToLower(sb[i]);
}
std::string words = "mAn OF stEEL";
std::vector<std::string> swv;

boost::split(swv, words, boost::is_any_of(" "));
std::string newwords = (std::for_each(swv.begin(), swv.end(), StringTAndJ(WordToCaps))).value();
fsharp
let words = String.Join(" ", Array.map (fun (s : String) -> (String.capitalize (s.ToLower()))) ("man OF stEEL".Split [|' '|]))
let wordlst = List.map (fun s -> (String.capitalize (String.lowercase s))) (String.split [' '] "man OF stEEL")
let words = new StringBuilder(List.hd wordlst)
for (s : String) in (List.tl wordlst) do (words.Append(" ").Append(s))
// Previous solutions used old library functions, here's something that works with F# 2.0
let s= "man OF stEEL"
let UpperFirst = function | "" -> "" | s -> s.Substring(0,1).ToUpper() + s.Substring(1).ToLower()
s.Split(' ') |> Array.map UpperFirst |> String.concat " "
let culture = System.Globalization.CultureInfo.GetCultureInfo("en-US")
let titleCase = culture.TextInfo.ToTitleCase "man oF sTeel"
erlang
Caps = string:join(lists:map(fun(S) -> to_caps(S) end, string:tokens("man OF stEEL", " ")), " "),
csharp
System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase("man OF stEEL".ToLowerInvariant());
haskell
import Data.Char

capitalizeWords = unwords . map capitalizeWord . words
where capitalizeWord [] = []
capitalizeWord (c:cs) = toUpper c : map toLower cs

Find the distance between two points

ruby
# the hypotenuse sqrt(x**2+y**2)
distance = Math.hypot(x2-x1,y2-y1)
cpp
Point p1 = {34, 78}, p2 = {67, -45};
double distance = ::distance(p1, p2);
Console::WriteLine("{0,3:F2}", distance);
fsharp
let distance' = distance (34, 78) (67, -45)
printfn "%3.2f" distance'
erlang
Distance = distance({point, 34, 78}, {point, 67, -45}),
io:format("~.2f~n", [Distance]).
Distance = distance(point:new(34, 78), point:new(67, -45)),
io:format("~.2f~n", [Distance]).
csharp
System.Drawing.Point p = new System.Drawing.Point(13, 14),
p1 = new System.Drawing.Point(10, 10);
double distance = Math.Sqrt(Math.Pow(p1.X - p.X, 2) + Math.Pow(p1.Y - p.Y, 2)));
haskell
data Floating n => Point2 n = Point2 n n

distance :: Floating n => Point2 n -> Point2 n -> n
distance (Point2 x1 y1) (Point2 x2 y2) = sqrt (x'*x' + y'*y')
where
x' = x1 - x2
y' = y1 - y2


-- > distance (Point2 5 10) (Point2 3 5)
-- 5.385...
-- > distance (Point2 1 1) (Point2 2 2)
-- 1.414...

Zero pad a number

Given the number 42, pad it to 8 characters like 00000042
ruby
42.to_s.rjust(8,"0")
"%08d" % 42
cpp
String^ formatted = Convert::ToString(42)->PadLeft(8, '0');
String^ formatted = String::Format("{0,8:D8}", 42);
std::printf("%08d", 42);
std::ostringstream os;
os << std::setw(8) << std::setfill('0') << 42 << std::ends;
std::cout << os.str() << std::endl;
std::cout << boost::format("%|08|") % 42 << std::endl;
fsharp
printfn "%08d" 42
let formatted = sprintf "%08d" 42
printfn "%s" formatted
let buffer = new StringBuilder()
Printf.bprintf buffer "%08d" 42
printfn "%s" (buffer.ToString())
let formatted = String.Format("{0,8:D8}", 42)
Console.WriteLine(formatted)
let formatted = Convert.ToString(42).PadLeft(8, '0')
Console.WriteLine(formatted)
erlang
Formatted = io_lib:format("~8..0B", [42]),
io:format("~8..0B~n", [42]).
csharp
string.Format("{0,8:D8}", 42);
haskell
import Text.Printf

printf "%08d" 42

Right Space pad a number

Given the number 1024 right pad it to 6 characters "1024  "
ruby
1024.to_s.ljust(6)
cpp
String^ formatted = Convert::ToString(1024)->PadRight(6);
String^ formatted = String::Format("{0,-6:D}", 1024);
std::printf("%-6d\n", 1024);
std::ostringstream os;
os << std::setw(6) << std::setfill(' ') << std::left << 1024 << std::ends;
std::cout << os.str() << std::endl;
std::cout << boost::format("%|-6|") % 1024 << std::endl;
fsharp
printfn "%-6d" 1024
let formatted = String.Format("{0,-6:D}", 1024)
Console.WriteLine(formatted)
let formatted = Convert.ToString(1024).PadRight(6)
Console.WriteLine(formatted)
erlang
Formatted = io_lib:format("~-6B", [1024]),
io:format("~-6B~n", [1024]).
csharp
public class NumberRightPadding {
public static void Main() {
string withStringDotFormat = string.Format("{0,-6}", 1024);
string withToStringDotPadRight = 1024.ToString().PadRight(6);
}
}
haskell
let s = show 1024
p = 6
in s ++ (replicate (p - length s) ' ')
import Text.Printf

main = do
putStrLn $ printf "%-6d" (1024::Int)

Format a decimal number

Format the number 7/8 as a decimal with 2 places: 0.88
ruby
(7.0/8.0*100).round/100.0
(7.0/8.0).round(2)
cpp
String^ formatted = String::Format("{0,3:F2}", result);
Console::WriteLine("{0,3:F2}", (7. / 8.));
std::printf("%3.2f\n", result);
std::ostringstream os;
os.width(3); os.fill('0'); os.setf(std::ios::fixed|std::ios::showpoint); os.precision(2);
os << result << std::ends;
std::cout << os.str() << std::endl;
std::cout << boost::format("%|3.2f|") % result << std::endl;
fsharp
printfn "%3.2f" (0.7 / 0.8)
let formatted = String.Format("{0,3:F2}", (0.7 / 0.8))
Console.WriteLine(formatted)
erlang
Formatted = io_lib:format("~.2f", [7/8]),
io:format("~.2f~n", [7/8]).
csharp
public class FormatDecimal {
public static void Main() {
decimal result = decimal.Round( 7 / 8m, 2);
System.Console.WriteLine(result);
}
}
haskell
import Text.Printf

printf "%3.2f" (7/8)
main = putStrLn $ Numeric.showFFloat (Just 2) (7/8) ""

Left Space pad a number

Given the number 73 left pad it to 10 characters "        73"
ruby
73.to_s.rjust(10)
cpp
String^ formatted = Convert::ToString(73)->PadLeft(10);
String^ formatted = String::Format("{0,10:D}", 73);
std::printf("%10d\n", 73);
std::ostringstream os;
os << std::setw(10) << std::setfill(' ') << 73 << std::ends;
std::cout << os.str() << std::endl;
std::cout << boost::format("%|10|") % 73 << std::endl;
fsharp
let formatted = sprintf "%10d" 73
printfn "%s" formatted
let formatted = String.Format("{0,10:D}", 73)
Console.WriteLine(formatted)
let formatted = Convert.ToString(73).PadLeft(10)
Console.WriteLine(formatted)
erlang
Formatted = io_lib:format("~10B", [73]),
io:format("~10B~n", [73]).
csharp
public class NumberLeftPadding {
public static void Main() {
string withStringDotFormat = string.Format("{0,10}", 73);
string withToStringDotPadLeft = 73.ToString().PadLeft(10);
}
}
haskell
import Text.Printf

formatted :: String
formatted = printf "%10d" 73

Generate a random integer in a given range

Produce a random integer between 100 and 200 inclusive
ruby
randomInt = rand(200-100+1)+100;
cpp
Random^ rnd = gcnew Random;
int rndInt = rnd->Next(100, 201);
std::srand(std::time(NULL));

unsigned lb = 100, ub = 200;
unsigned rnd = lb + (rand() % ((ub - lb) + 1));
typedef boost::uniform_int<> Distribution;
typedef boost::mt19937 RNG;

Distribution distribution(100, 200);
RNG rng; rng.seed(std::time(NULL));
boost::variate_generator<RNG&, Distribution> generator(rng, distribution);

unsigned rnd = generator();
fsharp
let rnd = new Random()
let rndInt = rnd.Next(100, 201)
erlang
RandomInt = gen_rand_integer(100, 200),
csharp
System.Random r = new System.Random();
int random = r.Next(100,201);
haskell
import System.Random

randInRange :: Int -> Int -> IO Int
randInRange a b = getStdRandom $ randomR (a, b)

main = randInRange 100 200 >>= print
import System.Random

main = randomRIO (1,100) >>= print

Generate a repeatable random number sequence

Initialise a random number generator with a seed and generate five decimal values. Reset the seed and produce the same values.
ruby
srand(12345)
first = (1..5).collect {rand}
srand(12345)
second = (1..5).collect {rand}
puts first == second
cpp
void printAction(int i) { Console::Write("{0} ", i); }

array<int>^ genFillRand(array<int>^ arr, Random^ rnd, int lb, int ub)
{
for (int i = 0; i < arr->Length; ++i) arr[i] = rnd->Next(lb, ub + 1); return arr;
}

int main()
{
array<int>^ arr1 = genFillRand(gcnew array<int>(5), gcnew Random(12345), 100, 200);
array<int>^ arr2 = genFillRand(gcnew array<int>(5), gcnew Random(12345), 100, 200);

Action<int>^ print = gcnew Action<int>(printAction);
Array::ForEach<int>(arr1, print); Console::WriteLine();
Array::ForEach<int>(arr2, print); Console::WriteLine();
}
typedef boost::uniform_int<> Distribution;
typedef boost::mt19937 RNG;

Distribution distribution(100, 200);
RNG rng;
boost::variate_generator<RNG&, Distribution> generator(rng, distribution);

rng.seed(42L);
std::generate_n(std::ostream_iterator<unsigned>(std::cout, " "), 5, generator);

rng.seed(42L);
std::cout << std::endl;
std::generate_n(std::ostream_iterator<unsigned>(std::cout, " "), 5, generator);
fsharp
let (seed, lb, ub) = (12345, 100, 200)

let mutable rnd = new Random(seed)
for i = 1 to 5 do printf "%d " (rnd.Next(lb, ub + 1)) done ; printfn ""

rnd <- new Random(seed)
for i = 1 to 5 do printf "%d " (rnd.Next(lb, ub + 1)) done ; printfn ""
erlang
setRNG(RNGState),
io:format("~w~n", [lists:map(fun (_) -> gen_rand_integer(100, 200) end, lists:seq(1, 5))]),

setRNG(RNGState),
io:format("~w~n", [lists:map(fun (_) -> gen_rand_integer(100, 200) end, lists:seq(1, 5))]).
csharp
using System;

public class RepeatableRandom {
public static void Main() {
var r = new Random(12); // seed is 12

for (int i = 0; i < 5; i++)
Console.WriteLine(r.Next());

r = new Random(12);

for (int i = 0; i < 5; i++)
Console.WriteLine(r.Next());
}
}

haskell
import System.Random
import Control.Monad (forM_)

main = do
printRands
printRands

where printRands = forM_ [1..5] (\i -> print (randInt i))
randInt i = fst $ randomR (100, 200) (mkStdGen i) :: Int
import System.Random

gen1 = mkStdGen 12345
gen2 = mkStdGen 12345

main = do
print $ take 5 (randoms gen1 :: [Float])
print $ take 5 (randoms gen2 :: [Float])

Check if a string matches a regular expression

Display "ok" if "Hello" matches /[A-Z][a-z]+/
ruby
puts "ok" if ("Hello"=~/^[A-Z][a-z]+$/)
cpp
if ((gcnew Regex("[A-Z][a-z]+"))->IsMatch("Hello")) Console::WriteLine("ok");
if (Regex::IsMatch("Hello", "[A-Z][a-z]+")) Console::WriteLine("ok");
Regex^ rx = gcnew Regex("[A-Z][a-z]+");
if (rx->IsMatch("Hello")) Console::WriteLine("ok");
cmatch what;
if (regex_match("Hello", what, regex("[A-Z][a-z]+")))
cout << "ok" << endl;
fsharp
if (Regex.IsMatch("Hello", "[A-Z][a-z]+")) then printfn "ok"
erlang
String = "Hello", Regexp = "[A-Z][a-z]+",
is_match(String, Regexp) andalso (begin io:format("ok~n"), true end).
case re:run("Hello", "[A-Z][a-z]+") of {match, _} -> ok end.
csharp
if (Regex.IsMatch("Hello", "[A-Z][a-z]+"))
{
Console.WriteLine("ok");
}
haskell
import Text.Regex.Posix
main = if "Hello" =~ "[A-Z][a-z]+" then putStrLn "OK" else return ()

Check if a string matches with groups

Display "two" if "one two three" matches /one (.*) three/
ruby
puts $1 if "one two three"=~/^one (.*) three$/
cpp
Match^ match = Regex::Match("one two three", "one (.*) three");
if (match->Success) Console::WriteLine("{0}", match->Groups[1]->Captures[0]);
cmatch what;
if (regex_match("one two three", what, regex("one (.*) three")))
cout << what[1] << endl;
fsharp
let regmatch = (Regex.Match("one two three", "one (.*) three"))
if regmatch.Success then (printfn "%s" (regmatch.Groups.[1].Captures.[0].ToString()))
erlang
case re:run("one two three", "one (.*) three", [{capture, [1], list}]) of {match, Res} -> hd(Res) end.
csharp
using System;
using System.Text.RegularExpressions;

public class RegexBackReference {
public static void Main() {
var oneTwoThree = "one two three";
var pattern = "one (.*) three";

Match match = Regex.Match(oneTwoThree, pattern);

// group 0 is the entire match. 1 is the first backreference
Console.WriteLine(match.Groups[1]);
}
}
haskell
import Text.Regex
main = case matchRegex (mkRegex "one (.*) three") "one two three" of
Nothing -> return ()
Just (x:_) -> putStrLn x

Check if a string contains a match to a regular expression

Display "ok" if "abc 123 @#$" matches /\d+/
ruby
puts "ok" if (text=~/\d+/)
cpp
if (Regex::IsMatch("abc 123 @#$", "\\d+")) Console::WriteLine("ok");
fsharp
if (Regex.IsMatch("abc 123 @#$", "\\d+")) then printfn "ok"
erlang
% Erlang uses 'egrep'-compatible regular expressions, so shortcuts like '\d' not supported
String = "abc 123 @#$", Regexp = "[0-9]+",
is_match(String, Regexp) andalso (begin io:format("ok~n"), true end).
case re:run("abc 123 @#$", "\\d+") of {match, _} -> ok end.
csharp
if(System.Text.RegularExpressions.Regex.IsMatch("abc 123 @#$",@"\d+")){
Console.WriteLine("ok");
}
haskell
import Text.Regex
main = case matchRegex (mkRegex "\d+") "abc 123 @#$" of
Nothing -> putStrLn "not ok"
Just _ -> putStrLn "ok"

Loop through a string matching a regex and performing an action for each match

Create a list [fish1,cow3,boat4] when matching "(fish):1 sausage (cow):3 tree (boat):4" with regex /\((\w+)\):(\d+)/
ruby
list = text.scan(/\((\w+)\):(\d+)/).collect{|x| x.join}
list=[]
text.scan(/\((\w+)\):(\d+)/) {
list << $1+$2
}
cpp
Match^ match = Regex::Match("(fish):1 sausage (cow):3 tree (boat):4", "\\((\\w+)\\):(\\d+)");

while (match->Success)
{
list->Add(match->Groups[1]->Captures[0]->ToString() + match->Groups[2]->Captures[0]->ToString());
match = match->NextMatch();
}
fsharp
let list = new ResizeArray<string>()
let mutable regmatch = (Regex.Match("(fish):1 sausage (cow):3 tree (boat):4", "\\((\\w+)\\):(\\d+)"))

while regmatch.Success do
list.Add(regmatch.Groups.[1].Captures.[0].ToString() ^ regmatch.Groups.[2].Captures.[0].ToString())
regmatch <- regmatch.NextMatch()
done

for word in list do printfn "%s" word done
// A solution without mutation:
let results =
Regex.Matches("(fish):1 sausage (cow):3 tree (boat):4", "\\((\\w+)\\):(\\d+)")
|> Seq.cast
|> Seq.map (fun (regmatch: Match) ->
regmatch.Groups.[1].Captures.[0].ToString() + regmatch.Groups.[2].Captures.[0].ToString()
)
|> List.ofSeq
erlang
solve(S) ->
R = "\\((\\w+?)\\):(\\d+)",
{match, M} = re:run(S,R, [global, {capture, all_but_first, list}]),
[ A++N || [A, N] <- M].
csharp
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

public static class extensions {
public static IList<string> Map(this string me, string pattern, Func<Match, string> action){
IList<string> matches = new List<string>();
foreach (Match match in Regex.Matches(me,pattern)){
matches.Add(action(match));
}
return matches;
}
}

class Test
{
static void Main()
{
IList<string> list = "(fish):1 sausage (cow):3 tree (boat):4".Map(@"\((\w+)\):(\d+)", (m) => {return m.Groups[1].Value + m.Groups[2].Value;});
}
}
haskell
import Text.Regex

getParenNum s = case matchRegexAll re s of
Nothing -> []
Just (_,_,after,[word,num]) -> (word ++ num):getParenNum after where
re = mkRegex "\\((\\w+)\\):([[:digit:]]+)"

main = putStrLn (show (getParenNum "(fish):1 sausage (cow):3 tree (boat):4"))

Replace the first regex match in a string with a static string

Transform "Red Green Blue" into "R*d Green Blue" by replacing /e/ with "*"
ruby
p "Red Green Blue".sub(/e/,'*')
cpp
String^ Replaced = (gcnew Regex("e"))->Replace("Red Green Blue", "*", 1);
fsharp
let replaced = ((new Regex("e")).Replace("Red Green Blue", "*", 1))
printfn "%s" replaced
erlang
{ok, Replaced, _} = regexp:sub("Red Green Blue", "e", "*"),
re:replace("Red Green Blue", "e", "*", [{return, list}]).

Replace all regex matches in a string with a static string

Transform "She sells sea shells" into "She X X shells" by replacing /se\w+/ with "X"
ruby
replaced = text.gsub(/se\w+/,"X")
cpp
String^ Replaced = (gcnew Regex("se\\w+"))->Replace("She sells sea shells", "X");
String^ Replaced = Regex::Replace("She sells sea shells", "se\\w+", "X");
fsharp
let replaced = ((new Regex("se\\w+")).Replace("She sells sea shells", "X"))
printfn "%s" replaced
erlang
% Erlang uses 'egrep'-compatible regular expressions, so shortcuts like '\w' not supported
{ok, Replaced, _} = regexp:gsub("She sells sea shells", "se[A-Za-z0-9_]+", "X"),
re:replace("She sells sea shells", "se\\w+", "X", [global, {return, list}]).
csharp
using System.Text.RegularExpressions;

class SolutionXX
{
static void Main()
{
string text = "She sells sea shells";
string result = Regex.Replace(text, @"se\w+", "X");
}
}

Replace all regex matches in a string with a dynamic string

Transform "The {Quick} Brown {Fox}" into "The kciuQ Brown xoF" by reversing words in braces using the regex /\{(\w+)\}/.
ruby
"The {Quick} Brown {Fox}".gsub(/\{(\w+)\}/) {|s| s[1..-2].reverse }
cpp
String^ Replaced = (gcnew Regex("{(\\w+)}"))->Replace("The {Quick} Brown {Fox}", gcnew MatchEvaluator(&RegRep::RepGroup));
String^ Replaced = Regex::Replace("The {Quick} Brown {Fox}", "{(\\w+)}", gcnew MatchEvaluator(&RegRep::RepGroup));
fsharp
open System
open System.Text.RegularExpressions
let reverseMatch (m:Match) =
String(m.Groups.[1].Value.ToCharArray() |> Array.rev)
let output = Regex.Replace("The {Quick} Brown {Fox}", @"\{(\w+)\}", reverseMatch)
erlang
% Erlang regular expressions lack both group capture and backreferences, thus this problem is not directly
% solvable. Presented solution is close, but not on-spec

String = "The {Quick} Brown {Fox}",
{match, FieldList} = regexp:matches(String, "\{([A-Za-z0-9_]+)\}"),

NewString = lists:foldl(fun ({Start, Length}, S) -> replstr(S, lists:reverse(string:substr(S, Start, Length)), Start) end, String, FieldList),

Define an empty list

Assign the variable "list" to a list with no elements
ruby
list = []
list = Array.new
cpp
Generic::List<String^>^ list = gcnew Generic::List<String^>();
std::list<std::string> list;
fsharp
let list = []
let list = List.empty
let list = new Generic.List<string>()
let list = new Generic.LinkedList<string>()
erlang
List = [],
csharp
var list = new List<object>();
haskell
let list = []

Define a static list

Define the list [One, Two, Three, Four, Five]
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
list = %w(One Two Three Four Five)
cpp
array<String^>^ input = {"One", "Two", "Three", "Four", "Five"};
Generic::List<String^>^ list = gcnew Generic::List<String^>((Generic::IEnumerable<String^>^) input);
Generic::List<String^>^ list = gcnew Generic::List<String^>();

list->Add("One");
list->Add("Two");
list->Add("Three");
list->Add("Four");
list->Add("Five");
std::string input[] = {"One", "Two", "Three", "Four", "Five"};
std::list<std::string> list(input, input + 5);
std::list<std::string> list;

list.push_back("One");
list.push_back("Two");
list.push_back("Three");
list.push_back("Four");
list.push_back("Five");
list<string> lst = { "One", "Two", "Three", "Four", "Five" };
list<string> lst;
lst += "One", "Two", "Three", "Four", "Five";
fsharp
let list = ["One"; "Two"; "Three"; "Four"; "Five"]
let list = (new Generic.LinkedList<string>([|"One"; "Two"; "Three"; "Four"; "Five"|]))
let list = (new Generic.LinkedList<string>())

list.AddFirst("One") ; list.AddLast("Five") ; list.AddBefore(list.Find("Five"), "Four")
list.AddAfter(list.Find("One"), "Two") ; list.AddAfter(list.Find("Two"), "Three")
let list = (new Generic.List<string>())

[|"One"; "Two"; "Three"; "Four"; "Five"|] |> Array.iter (fun x -> list.Add(x))
erlang
List = [one, two, three, four, five],
List = ['One', 'Two', 'Three', 'Four', 'Five'],
csharp
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
haskell
let a = ["One", "Two", "Three", "Four", "Five"]

Join the elements of a list, separated by commas

Given the list [Apple, Banana, Carrot] produce "Apple, Banana, Carrot"
ruby
string = fruit.join(', ')
cpp
String^ result = String::Join(L", ", fruit->ToArray());
string fruits[] = {"Apple", "Banana", "Carrot"};
string result = boost::algorithm::join(fruits, ", ");
fsharp
let result = String.Join(", ", [|"Apple"; "Banana"; "Carrot"|])
let result = (List.fold_left (fun acc item -> acc ^ (", " ^ item)) (List.hd fruit) (List.tl fruit))
let result = (List.fold_left (fun (acc : StringBuilder) (item : string) -> acc.Append(", ").Append(item)) (new StringBuilder(List.hd fruit)) (List.tl fruit)).ToString()
erlang
Result = string:join(Fruit, ", "),
Result = lists:foldl(fun (E, Acc) -> Acc ++ ", " ++ E end, hd(Fruit), tl(Fruit)),
Result = lists:flatten([ hd(Fruit) | [ ", " ++ X || X <- tl(Fruit)]]).
csharp
using System.Collections.Generic;
public class JoinEach {
public static void Main() {
var list = new List<string>() {"Apple", "Banana", "Carrot"};
System.Console.WriteLine( string.Join(", ", list.ToArray()) );
}
}
haskell
import Data.List

let join = intercalate ", " ["Apple", "Banana", "Carrot"]

Join the elements of a list, in correct english

Create a function join that takes a List and produces a string containing an english language concatenation of the list. It should work with the following examples:
join([Apple, Banana, Carrot]) = "Apple, Banana, and Carrot"
join([One, Two]) = "One and Two"
join([Lonely]) = "Lonely"
join([]) = ""
ruby
def join(arr)
return '' if not arr
case arr.size
when 0 then ''
when 1 then arr[0]
when 2 then arr.join(' and ')
else arr[0..-2].join(', ') + ', and ' + arr[-1]
end
end
cpp
Console::WriteLine(join(fruit));
string join(const vector<string> &s, int b=0)
{
switch (s.size() - b)
{
case 0: return "";
case 1: return s[b];
case 2: return s[b] + (s.size() > 2 ? "," : "") + " and " + s[b+1];
default: return s[b] + ", " + join(s, b+1);
}
}
fsharp
let join list =
let rec join' list' s =
match list' with
| [] -> s
| [w] -> join' [] (s ^ " and " ^ w)
| w :: ws -> join' ws (s ^ ", " ^ w)
match list with
| [] -> ""
| w :: ws -> join' ws w

// ------

printfn "%s" (join fruit)
erlang
io:format("~s~n", [join(Fruit)]).

% ------

join([]) -> "";
join([W|Ws]) -> join(Ws, W).

join([], S) -> S;
join([W], S) -> join([], S ++ " and " ++ W);
join([W|Ws], S) -> join(Ws, S ++ ", " ++ W).
%% According to the reference manual, "string is not a data type in Erlang."
%% Instead it has lists of integers. But I/O functions in general accept
%% IO lists, where an IO list is either a list of IO lists or an integer.
%% This gives you O(1) string concatenation.

-module(commalist).
-export([join/1]).

join([]) -> "";
join([W]) -> W;
join([W1, W2]) -> [W1, " and ", W2];
join([W1, W2, W3]) -> [W1, ", ", W2, ", and ", W3];
join([W1|Ws]) -> [W1, ", ", join(Ws)].

csharp
using System.Collections.Generic;
using System.Linq;

public class CSharpListToEnglishList {
public string JoinAsEnglishList (List<string> words) {
switch (words.Count) {
case 0: return "";
case 1: return words[0];
case 2: return string.Format("{0} and {1}", words.ToArray());
default:
return JoinAsEnglishList( new List<string>() {
string.Join(", ", words.Take(words.Count - 1).ToArray()) + ",",
words.Last()
});
}
}
// Driver...
public static void Main() {
var joiner = new CSharpListToEnglishList();
System.Console.WriteLine(
joiner.JoinAsEnglishList(new List<string>() { "Apple", "Banana", "Carrot", "Orange" }) );
System.Console.WriteLine(
joiner.JoinAsEnglishList(new List<string>() { "Apple", "Banana", "Carrot" }) );
System.Console.WriteLine(
joiner.JoinAsEnglishList(new List<string>() { "One", "Two" }) );
System.Console.WriteLine(
joiner.JoinAsEnglishList(new List<string>() { "Lonely" }) );
System.Console.WriteLine(
joiner.JoinAsEnglishList(new List<string>()) );
}
}
haskell
join [] = ""
join [x] = x
join [x,y] = x ++ " and " ++ y
join [x,y,z] = x ++ ", " ++ y ++ ", and " ++ z
join (x:xs) = x ++ ", " ++ join xs

Produce the combinations from two lists

Given two lists, produce the list of tuples formed by taking the combinations from the individual lists. E.g. given the letters ["a", "b", "c"] and the numbers [4, 5], produce the list: [["a", 4], ["b", 4], ["c", 4], ["a", 5], ["b", 5], ["c", 5]]
ruby
common = [] ; [4, 5].each {|n| ['a', 'b', 'c'].each {|l| common << [l, n]}}
cpp
Specialized::StringCollection^ combinations = gcnew Specialized::StringCollection;

for each(int number in numbers)
for each(String^ letter in letters)
combinations->Add(makeCombo(letter, number));
string letters[] = { "a", "b", "c" };
int numbers[] = { 4, 5 };
list<pair<string,int> > combo;

for (int n = 0; n < sizeof numbers / sizeof *numbers; n++)
for (int l = 0; l < sizeof letters / sizeof *letters; l++)
combo.push_back(make_pair(letters[l], numbers[n]));

cout << combo << endl;
fsharp
let combinations = (List.fold_left (fun acc number -> acc @ (List.map (fun letter -> (letter, number)) letters)) [] numbers)
let combinations aa bb =
aa
|> List.map (fun a -> bb |> List.map (fun b -> (a, b)))
|> List.concat
erlang
Combinations =
lists:foldl(fun (Number, Acc) -> Acc ++ lists:map(fun (Letter) -> {Letter, Number} end, Letters) end, [], Numbers),
Combinations = lists:keysort(2, sofs:to_external(sofs:product(sofs:set(Letters), sofs:set(Numbers))))
[[A, B] || A <- ["a", "b", "c"], B <- [4, 5]].

csharp
using System.Collections.Generic;
public class ListCombiner {
public static void Main() {
var letters = new List<char>() { 'a', 'b', 'c' };
var numbers = new List<int>() { 1, 2, 3 };

// result is a list that contaings lists of objects
var result = new List<List<object>>();
foreach (var l in letters) {
foreach (var n in numbers) {
result.Add(new List<object>() { l, n });
}
}
}
}
haskell
comb :: [(String, Int)]
comb = do
b <- [4,5]
a <- ["a","b","c"]
return (a,b)

main = mapM_ print comb
comb :: [(String, Int)]
comb = [(a, b) | b <- [4,5], a <- ["a","b","c"]]

main = print comb

From a List Produce a List of Duplicate Entries

Taking a list:
["andrew", "bob", "chris", "bob"]

Write the code to produce a list of duplicates in the list:
["bob"]
ruby
foo = ['andrew', 'bob', 'chris', 'bob']
foo.inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys
cpp
vector<string> lst = { "andrew", "bob", "chris", "bob" };
vector<string> lst_no_dups;
vector<string> tmp;
vector<string> dups;

sort(lst.begin(), lst.end());
unique_copy(lst.begin(), lst.end(), back_inserter(lst_no_dups));
set_difference(lst.begin(), lst.end(),
lst_no_dups.begin(), lst_no_dups.end(),
back_inserter(tmp));
unique_copy(tmp.begin(), tmp.end(), back_inserter(dups));

cout << dups << endl;
list<string> lst = { "andrew", "bob", "chris", "bob" };
map<string,int> num_identical;
list<string> dups;

for (auto &s: lst)
num_identical[s]++;
for (auto &n: num_identical)
if (n.second > 1)
dups.push_back(n.first);
cout << dups << endl;
fsharp
["andrew"; "bob"; "chris"; "bob"]
|> Seq.countBy id
|> Seq.filter (fun (k,n) -> n > 1)
|> Seq.map fst
|> Seq.toList
erlang
{_, Result} = lists:foldl(
fun(X, {Uniq, Dupl}) -> case lists:member(X, Uniq) of
true -> {Uniq,[X | Dupl]};
_ -> {[X | Uniq], Dupl}
end
end,
{[], []},
List),
Fun = fun
([X | Xs], F) -> case lists:member(X, Xs) of
true -> [X | F(Xs, F)];
_ -> F(Xs, F)
end;
([], _) -> []
end,
Result = Fun(List, Fun).
csharp
List<String> values = new List<string> {"andrew", "bob", "chris", "bob"};

var duplicates = values
.GroupBy(i => i)
.Where(j => j.Count() > 1)
.Select(s => s.Key);
foreach (var duplicate in duplicates)
{
Console.WriteLine(duplicate);
}
haskell
import Data.List

input = ["andrew", "bob", "chris", "bob"]
output = [ head l | l <- group (sort input), length l > 1]

Fetch an element of a list by index

Given the list [One, Two, Three, Four, Five], fetch the third element ('Three')
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
list[2]
['One', 'Two', 'Three', 'Four', 'Five'].fetch(2)
list = ['One', 'Two', 'Three', 'Four', 'Five']
list.at(2)
['One', 'Two', 'Three', 'Four', 'Five'][2] # <= note the [2] at end of array
cpp
String^ result = list[2];
fsharp
let result = List.nth ["One"; "Two"; "Three"; "Four"; "Five"] 2
erlang
Result = lists:nth(3, List),
Result = element(3, list_to_tuple(List)),
{Left, _} = lists:split(3, List), Result = lists:last(Left),
Result = nth0(2, List),
csharp
string[] items = new string[] { "One", "Two", "Three", "Four", "Five" };
List<string> list = new List<string>(items);
string third = list[2]; // "Three"
// Make sure you import the System.Linq namespace.
// This is not the preferred way of indexing if you are using Lists.
string[] items = new string[] { "One", "Two", "Three", "Four", "Five" };
IEnumerable<string> list = new List<string>(items);
string third = list.ElementAt(2); // Three
haskell
let a = [1..5]
let b = a !! 2
print b

Fetch the last element of a list

Given the list [Red, Green, Blue], access the last element ('Blue')
ruby
['Red', 'Green', 'Blue'][-1]
['Red', 'Green', 'Blue'].at(-1)
['Red', 'Green', 'Blue'].last
['Red', 'Green', 'Blue'].fetch(-1)
cpp
String^ result = list[list->Count - 1];
string last_elem = lst.back();
fsharp
let last list =
let rec last' list' =
match list' with
| [x] -> x
| x :: xs -> last' xs
if List.is_empty list then failwith "empty list" else last' list

// ------

let result = last list
let result = (List.nth list ((List.length list) - 1))
let result = (List.hd (List.rev list))
erlang
Result = lists:last(List),
Result = last(List),
Result = hd(lists:reverse(List)),
Result = lists:nth(length(List), List),
csharp
string[] items = new string[] { "Red", "Green", "Blue" };
List<string> list = new List<string>(items);
string last = list[list.Count - 1]; // "Blue"
// Make sure you import the System.Linq namespace.
// This is not the preferred way of finding the last element if you are using Lists.
string[] items = new string[] { "Red", "Green", "Blue" };
IEnumerable<string> list = new List<string>(items);
string last = list.Last(); // "Blue"
haskell
last ["Red", "Green", "Blue"]

Find the common items in two lists

Given two lists, find the common items. E.g. given beans = ['broad', 'mung', 'black', 'red', 'white'] and colors = ['black', 'red', 'blue', 'green'], what are the bean varieties that are also color names?
ruby
common = (beans.intersection(colors)).to_a
cpp
array<String^>^ inbeans = {"broad", "mung", "black", "red", "white"};
Generic::ICollection<String^>^ beans = makeSET<String^>(gcnew Generic::List<String^>((Generic::IEnumerable<String^>^) inbeans));

array<String^>^ incolors = {"black", "red", "blue", "green"};
Generic::ICollection<String^>^ colors = makeSET<String^>(gcnew Generic::List<String^>((Generic::IEnumerable<String^>^) incolors));

Generic::ICollection<String^>^ result = intersectSET<String^>(beans, colors);
fsharp
let beans = (Set.of_list ["broad"; "mung"; "black"; "red"; "white"])
let colors = (Set.of_list ["black"; "red"; "blue"; "green"])
let common = (Set.intersect beans colors)
let beans = Set ["broad"; "mung"; "black"; "red"; "white"]
let colors = Set ["black"; "red"; "blue"; "green"]
let common = Set.intersect beans colors
// Iterates elements of
// list1 across Elements of list2 returning a list of string options
// as generated by List.tryFind
let findCommon(list1 : 'a list, list2 : 'a list) : 'a list =
list1 |> List.map(fun y -> list2 |> List.tryFind(fun x -> y = x))
// Iterates elements of string option list generated above
// returning a string list containing common elements of List1 and List2
|> List.fold(fun acc x -> if x <> None then x.Value::acc else acc) []
// reverse order of list (can't seem to make List.foldBack work for this
|> List.rev

let beans = ["broad"; "mung"; "black"; "red"; "white"]
let colors = ["black"; "red"; "blue"; "green"]
printfn "%A" (findCommon(beans, colors)) ;;
erlang
Beans = sets:from_list([broad, mung, black, red, white]), Colors = sets:from_list([black, red, blue, green]),

Common = sets:to_list(sets:intersection(Beans, Colors)),
csharp
// Make sure you import the System.Linq namespace.
// This example uses arrays as the underlying implementation, but any IEnumerable type can be used - including List.
IEnumerable<string> beans = new string[] { "beans", "mung", "black", "red", "white" };
IEnumerable<string> colors = new string[] { "black", "red", "blue", "green" };
var intersect = beans.Intersect(colors); // ['red', 'black']
haskell
import Data.List

beans = ["broad", "mung", "black", "red", "white"]
colors = ["black", "red", "blue", "green"]

main = print (intersect beans colors)

Display the unique items in a list

Display the unique items in a list, e.g. given ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18], display the unique elements, i.e. with duplicates removed.
ruby
ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]
p ages.uniq
ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]
ages.uniq!
p ages
ages = (Set.new [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]).to_a
p ages
cpp
array<int>^ input = {18, 16, 17, 18, 16, 19, 14, 17, 19, 18};
Generic::List<int>^ ages = gcnew Generic::List<int>((Generic::IEnumerable<int>^) input);

Generic::ICollection<int>^ result = makeSET<int>(ages);
list<int> input;
input += 18, 16, 17, 18, 16, 19, 14, 17, 19, 18;
input.sort();
unique_copy(input.begin(), input.end(), ostream_iterator<int>(cout, "\n"));
fsharp
(Set.ofList [18; 16; 17; 18; 16; 19; 14; 17; 19; 18]) |> Set.iter (fun age -> printf "%d, " age)
erlang
Ages = sets:to_list(sets:from_list([18, 16, 17, 18, 16, 19, 14, 17, 19, 18])), io:format("~w~n", [Ages]).
lists:usort([18, 16, 17, 18, 16, 19, 14, 17, 19, 18]).
csharp
using System.Collections.Generic;
using System.Linq;
public class UniqueElements {
public static void Main() {
var list = new List<int>() { 18, 16, 17, 18, 16, 19, 14, 17, 19, 18 };
var uniques = list.Distinct();
}
}
haskell
import Data.List

ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]

uniqueAges = nub ages

Remove an element from a list by index

Given the list [Apple, Banana, Carrot], remove the first element to produce the list [Banana, Carrot]
ruby
['Apple', 'Banana', 'Carrot'].shift
fruit.delete_at(0)
cpp
fruit->RemoveAt(0);
fsharp
let split_at list n =
let rec split_at' list' n' left right =
match list' with
| [] -> (List.rev left, List.rev right)
| x :: xs -> if n' <= n then split_at' xs (n' + 1) (x :: left) right else split_at' xs (n' + 1) left (x :: right)
split_at' list 0 [] []

// ------

let (_, right) = split_at fruit 0
let drop list n =
if n <= 0 then
list
else
let (_, right) = split_at list (n - 1)
right

// ------

let result = (drop fruit 1)
erlang
Result = tl(List),
[_|Result] = List,
N = 1, {Left, Right} = lists:split(N - 1, List), Result = Left ++ tl(Right),
Result = drop(1, List),
csharp
class Solution1516
{
static void Main()
{
List<string> fruit = new List<string>() { "Apple", "Banana", "Carrot" };
fruit.RemoveAt(0);
}
}
haskell
deleteNth n xs | n > 0 = take (n-1) xs ++ drop n xs

main = print $ deleteNth 1 [1..3]
fruit :: [String]
fruit = ["Apple", "Banana", "Carrot"]

main :: IO ()
main = putStrLn $ show $ tail fruit

Remove the last element of a list

ruby
list = ['Apple', 'Banana', 'Carrot']
list.delete_at(-1)
list = ['Apple', 'Banana', 'Carrot']
list.pop
cpp
fruit->RemoveAt(fruit->Count - 1);
fsharp
let take list n =
if n <= 0 then
list
else
let (left, _) = split_at list (n - 1)
left

// ------

let result = (take fruit ((List.length fruit) - 1))
let but_last list =
let rec but_last' list' acc =
match list' with
| [x] -> List.rev acc
| x :: xs -> but_last' xs (x :: acc)
if List.is_empty list then [] else but_last' list []

// ------

let result = (but_last fruit)
erlang
Result = init(List),
Result = take(length(List) - 1, List),
Result = lists:reverse(tl(lists:reverse(List))),
csharp
List<string> fruits = new List() { "apple", "banana", "cherry" };
fruits.RemoveAt(fruits.Length - 1);
haskell
ages = [1,2,3,4]

init ages

Rotate a list

Given a list ["apple", "orange", "grapes", "bananas"], rotate it by removing the first item and placing it on the end to yield ["orange", "grapes", "bananas", "apple"]
ruby
items = ["apple", "orange", "grapes", "bananas"]
items << first = items.shift

# items is rotated
# first contains the first value in the list
cpp
fruit->Add(fruit[0]); fruit->RemoveAt(0);
rotate(fruit.begin(), fruit.begin()+1, fruit.end());
fsharp
let rotate list n =
if n <= 0 then
list
else
let (left, right) = split_at list (n - 1)
right @ left

// ------

let result = (rotate fruit 1)
erlang
N = 1, {Left, Right} = lists:split(N, List), Result = Right ++ Left,
N = 1, Result = rotate(N, List),
csharp
var lst = new LinkedList<String>(new String[] {"apple", "orange", "grapes", "banana"});
lst.AddLast(lst.First());
lst.DeleteFirst();
haskell
main = print $ rotate ["apple", "orange", "grapes", "bananas"]

rotate xs | length xs < 2 = xs
| otherwise = tail xs ++ [head xs]

Gather together corresponding elements from multiple lists

Given several lists, gather together the first element from every list, the second element from every list, and so on for all corresponding index values in the lists. E.g. for these three lists, first = ['Bruce', 'Tommy Lee', 'Bruce'], last = ['Willis', 'Jones', 'Lee'], years = [1955, 1946, 1940] the result should produce 3 actors. The middle actor should be Tommy Lee Jones.
ruby
first = ['Bruce', 'Tommy Lee', 'Bruce']; last = ['Willis', 'Jones', 'Lee']; years = [1955, 1946, 1940]

result = first.zip(last, years)
first = ['Bruce', 'Tommy Lee', 'Bruce']; last = ['Willis', 'Jones', 'Lee']; years = [1955, 1946, 1940]

result = [first, last, years].transpose
cpp
array<String^>^ first = {"Bruce", "Tommy Lee", "Bruce"}; array<String^>^ last = {"Willis", "Jones", "Lee"}; array<String^>^ years = {"1955", "1946", "1940"};

array<String^>^ result = zip<String^>(",", first, last, years);
list<string> first = { "Bruce", "Tommy Lee", "Bruce" };
list<string> last = {"Willis", "Jones", "Lee"};
list<int> years = {1955, 1946, 1940};
list<tuple<string,string,int> > actors;

for (firstIt = first.begin(), lastIt = last.begin(), yearIt = years.begin();
firstIt != first.end() && lastIt != last.end() && yearIt != years.end();
++firstIt, ++lastIt, ++yearIt)
actors.push_back(make_tuple(*firstIt, *lastIt, *yearIt));
fsharp
let result = (List.zip3 first last years)
erlang
First = ['Bruce', 'Tommy Lee', 'Bruce'], Last = ['Willis', 'Jones', 'Lee'], Years = [1955, 1946, 1940],

Result = lists:zip3(First, Last, Years),
csharp
String[] first = { "Bruce", "Tommy Lee", "Bruce" };
String[] last = { "Willis", "Jones", "Lee" };
int[] years = { 1955, 1946, 1940 };
var actors = first.Zip(last, (f, l) => Tuple.Create(f, l)).Zip(years, (t, y) => Tuple.Create(t.Item1, t.Item2, y)).ToArray();
Debug.Assert(actors[1].Equals(Tuple.Create("Tommy Lee", "Jones", 1946)));
haskell
import Prelude hiding (last)

first = ["Bruce", "Tommy Lee", "Bruce"]
last = ["Willis", "Jones", "Lee"]
years = [1955, 1946, 1940]

actors = zip3 first last years

List Combinations

Given two source lists (or sets), generate a list (or set) of all the pairs derived by combining elements from the individual lists (sets). E.g. given suites = ['H', 'D', 'C', 'S'] and faces = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'], generate the deck of 52 cards, confirm the deck size and check it contains an expected card, say 'Ace of Hearts'.
ruby
suites.each {|s| faces.each {|f| cards << [s, f]}}
puts "Deck %s \'Ace of Hearts\'" % if cards.include?(['h', 'A']) then "contains" else "does not contain" end
cpp
Specialized::StringCollection^ cards = gcnew Specialized::StringCollection;

for each(String^ suite in suites)
for each(String^ face in faces)
cards->Add(makeCard(suite, face));

Console::WriteLine("Deck has {0} cards", cards.Count);
if (cards->Contains(makeCard("h", "A"))) Console::WriteLine("Deck contains 'Ace of hearts'"); else Console::WriteLine("'Ace of hearts' not in deck");
auto suites = {"h", "d", "c", "s"};
auto faces = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"};
list<card> cards;

for (auto s: suites)
for (auto f: faces)
cards.push_back(make_pair(s,f));

cout << "Deck has " << cards.size() << " cards." << endl;

card ace_of_harts = make_pair("h", "A");
if (end(cards) != find_if(begin(cards), end(cards),
[&](const card& c) { return c == ace_of_harts; }))
cout << "Deck contain 'Ace of Harts'" << endl;
else
cout << "Deck lacks 'Ace of Harts'" << endl;
fsharp
let cards = (List.fold_left (fun acc suite -> acc @ (List.map (fun face -> (suite, face)) faces)) [] suites)

printfn "Deck has %d cards" (List.length cards)
printfn "%s" (if (List.exists (fun e -> e = ("h", "A")) cards) then "Deck contains 'Ace of Hearts'" ; else "'Ace of Hearts' not in deck")
let product (set1 : List<'a>) (set2 : List<'a>) : List<'a * 'a> =
let p = new ResizeArray<'a * 'a>()
for e1 in set1 do for e2 in set2 do p.Add(e1, e2) done done
Array.to_list (p.ToArray())

// ------

let cards = product suites faces

printfn "Deck has %d cards" (List.length cards)
printfn "%s" (if (List.exists (fun e -> e = ("h", "A")) cards) then "Deck contains 'Ace of Hearts'" ; else "'Ace of Hearts' not in deck")
let deck =
suites
|> List.map (fun s -> faces |> List.map (fun f -> (s, f)))
|> List.concat

printfn "Deck has %d cards" (List.length deck)
match deck |> List.exists (fun e -> e = ("h", "A")) with
| true -> printfn "Deck contains 'Ace of Hearts'"
| _ -> printfn "'Ace of Hearts' not in deck"
erlang
Cards = lists:foldl(fun (Suite, Acc) -> Acc ++ lists:flatmap(fun (Face) -> [{Suite, Face}] end, Faces) end, [], Suites),

io:format("Deck has ~B cards~n", [length(Cards)]),
IsMember = lists:member({h, 'A'}, Cards),
io:format("~s~n", [if IsMember -> "Deck contains 'Ace of Hearts'" ; true -> "'Ace of Hearts' not in deck" end]),
Cards = sofs:to_external(sofs:product(sofs:set(Suites), sofs:set(Faces))),

io:format("Deck has ~B cards~n", [length(Cards)]),
IsMember = lists:member({h, 'A'}, Cards),
io:format("~s~n", [if IsMember -> "Deck contains 'Ace of Hearts'" ; true -> "'Ace of Hearts' not in deck" end]),
Deck2 = [{S, V} || S <- [d, c, h, s], V <- [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A']],
52 = length(Deck2),
true = lists:member({h, 'A'}, Deck2).

csharp
using System;
using System.Collections.Generic;
using System.Linq;

namespace Combinations
{
class Program
{
public static void Main(string[] args)
{
// Define the given lists
// Since List`1 implements the interface IEnumerable`1, this can easily be redefined as List`1.
IEnumerable<string> suites = new string[] { "H", "D", "C", "S" };
IEnumerable<string> faces = new string[] { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };

// LINQ Query to perform a Cartesian product and create an anonymous type to hold the results.
// "var" is required to define this as an IEnumerable`1
var deck =
from suite in suites // For each suite in suites
from face in faces // Match it with a face in face.
select new
{
Suite = suite,
Face = face
};

// Verify the count (uses LINQ extension)
if (deck.Count() == 52)
{
Console.WriteLine("Count matches!");
}

// Verify that the Ace of Hearts is in the deck (uses LINQ extension)
if (deck.Contains(new {Suite = "H", Face = "A"}))
{
Console.WriteLine("Ace of Hearts found!");
}

// Example of how to iterate through the list.
// "var" here is required since we are using an anonymous type
foreach(var card in deck)
{
Console.WriteLine("Suite: {0} Face: {1}", card.Suite, card.Face);
}

// If you desire to work with a List`1, you can convert this to a normal list at any time:
Console.WriteLine("\nConverting to list!");
var list = deck.ToList();
Console.WriteLine("Suite: {0} Face: {1}", list[5].Suite, list[5].Face);
Console.WriteLine("List count: {0}", list.Count); // 52

Console.ReadLine();
}
}
}
haskell
import Data.List

suites = ["H", "D", "C", "S"]
faces = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"]

main = do
let cards = [(s,f) | s <- suites, f <- faces ]
print (length cards)
print $ hasCard ("H", "A") "Ace of Hearts" cards
where hasCard t name cards = (if elem t cards then "Contains "
else "Does not contain") ++ name

Perform an operation on every item of a list

Perform an operation on every item of a list, e.g.
for the list ["ox", "cat", "deer", "whale"] calculate
the list of sizes of the strings, e.g. [2, 3, 4, 5]
ruby
["ox", "cat", "deer", "whale"].map{|i| i.length}
cpp
list<string> words;

words.push_back("ox");
words.push_back("cat");
words.push_back("deer");
words.push_back("whale");

for (list<string>::iterator it = words.begin(); it != words.end(); ++it)
cout << it->size() << ' ';
cout << endl;
auto words = { "ox", "cat", "deer", "whale" };
list<size_t> word_sizes;

transform(begin(words),
end(words),
back_inserter(word_sizes),
[](const string& s) { return s.size(); });
fsharp
let lengths = List.map String.length ["ox"; "cat"; "deer"; "whale"]
erlang
lists:map(fun (X) ->length(X) end, List).
csharp
using System.Collections.Generic;
public class OperationOnEach {
public static void Main() {
var list = new List<string>() { "ox", "cat", "deer", "whale" };
list.ForEach( System.Console.WriteLine );
}
}
haskell
map length ["ox", "cat", "deer", "whale"]

Split a list of things into numbers and non-numbers

Given a list that might contain e.g. a string, an integer, a float and a date,
split the list into numbers and non-numbers.
ruby
now=Time.now
things=["hello", 25, 3.14, now]

numbers=things.select{|i| i.is_a? Numeric}
others=things-numbers
now=Time.now
things=["hello", 25, 3.14, now]

numbers, others=things.partition{|i| i.is_a? Numeric}
cpp
typedef variant<int,float,string,date> dynamic;

class is_number : public static_visitor<bool>
{
public:
bool operator()(int &) const {
return true;
}
bool operator()(float &) const {
return true;
}
bool operator()(string &) const {
return false;
}
bool operator()(date &) const {
return false;
}
};

int main()
{
list<dynamic> lst;
list<dynamic> numbers;
list<dynamic> non_numbers;

lst += "hello", 3.14f, 42, date(2011,Aug,23);

BOOST_FOREACH(dynamic v, lst)
if (apply_visitor(is_number(), v))
numbers += v;
else
non_numbers += v;
#include <iostream>
#include <list>

#include <boost/any.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/foreach.hpp>

using namespace boost;
using namespace boost::gregorian;
using namespace std;

int main()
{
list<any> lst;
list<any> numbers;
list<any> non_numbers;

lst.push_back(string("hello"));
lst.push_back(42);
lst.push_back(3.14f);
lst.push_back(date(day_clock::local_day()));

BOOST_FOREACH(const any &a, lst)
try
{
numbers.push_back(any_cast<int>(a));
}
catch (bad_any_cast &e)
{
try
{
numbers.push_back(any_cast<float>(a));
}
catch (bad_any_cast &e)
{
non_numbers.push_back(a);
}
}

// float and int are now in 'numbers' and the rest in 'non_numbers'
}
fsharp
let (things:obj list) = [ "hello"; 25; 3.14; System.DateTime.Now ]

let isNumber (x:obj) =
match x with
| :? int | :? float | :? byte | :? decimal | :? int16 | :? int64 -> true
| _ -> false

let numbers, nonNumbers = things |> List.partition isNumber
erlang
% Wrapped call to the auxiliary function
number_split(Xs) ->
number_split(Xs, [], []).

% The auxiliary function
number_split([], Num, NonNum) ->
{Num, NonNum};
number_split([X|Xs], Num, NonNum) ->
case is_number(X) of
true ->
number_split(Xs, [X|Num], NonNum);
false ->
number_split(Xs, Num, [X|NonNum])
end.
List = ["hello", 25, 3.14, calendar:local_time()],
{Numbers, NonNumbers} = lists:partition(fun(E) -> is_number(E) end, List)
csharp
using System;
using System.Collections.Generic;
using System.Linq;

// AFAIK, there just isn't a good way to do this in C#
public class ListSplitter {
public static bool IsNumeric(object o) {
var d = new Decimal();
return decimal.TryParse(o.ToString(), out d);
}
public static void Main() {
var list = new List<object>() { "foo", DateTime.Now, 1, "bar", 2.4 };

// the Where method does the work...
var numbers = list.Where( el => IsNumeric(el) );
var nonNumbers = list.Where( el => ! IsNumeric(el) );
}

}
haskell
import Data.List (partition)

type Date = String
data Things = TS String | TI Int | TD Date
deriving Show

main = do
let myList = [TI 1, TI 23, TS "Joe", TD "23/04/2009"]
print $ partition isNumber myList

where isNumber (TS _) = False
isNumber (TI _) = True
isNumber (TD _) = False

Test if a condition holds for all items of a list

Given a list, test if a certain logical condition (i.e. predicate) holds for all items of the list.
ruby
[2, 3, 4].all? { |x| x > 1 }
cpp
template <typename InputIterator, typename Predicate>
bool match_all(InputIterator first, InputIterator last, Predicate pred)
{
return find_if(first, last, !pred(_1)) == last;
}
fsharp
let rec IsAll predicate source =
let mutable acc = true
for e in source do
acc <- acc && (predicate e)
acc
erlang
Result = lists:all(Pred, List).
haskell

all (> 1) [2, 3, 4]

Test if a condition holds for any items of a list

Given a list, test if a certain logical condition (i.e. predicate) holds for any items of the list.
ruby
[2, 3, 4].any? { |x| x > 3 }
cpp
template <typename InputIterator, typename Predicate>
bool match_any(InputIterator first, InputIterator last, Predicate pred)
{
return find_if(first, last, pred) != last;
}
fsharp
let rec IsAny predicate source =
match source with
| [] -> false
| h::t ->
if (predicate h) then true
else (IsAny predicate t )
erlang
Result = lists:any(Pred, List).
haskell
any (> 1) [1, 2, 3]

Define an empty map

ruby
map = {}
cpp
Hashtable^ hash = gcnew Hashtable;
Generic::Dictionary<String^, String^>^ dict = gcnew Generic::Dictionary<String^, String^>();
std::map<int, std::string> m;
fsharp
let map = Map.empty
let map = new Generic.Dictionary<string, string>()
let map = new Hashtable()
erlang
Map = dict:new(),
Map = orddict:new(),
Map = gb_trees:empty(),
Map = ets:new(the_map_name, [set, private, {keypos, 1}]),
haskell
import qualified Data.Map as M

emptyMap = M.empty

Define an unmodifiable empty map

ruby
map = {}.freeze
cpp
const std::map<T1,T2> immutable_map_instance_of_type_t1_to_t2;
fsharp
// Most native fsharp data structures are immutable - updating a 'map' sees a modified copy created
let map = Map.empty
erlang

% Erlang data structures are immutable - updating a 'map' sees a modified copy created
Map = dict:new(),
haskell
import qualified Data.Map as Map

output :: Map.Map k v
output = Map.empty

Define an initial map

Define the map {circle:1, triangle:3, square:4}
ruby
shapes = {'circle'=>1, 'triangle'=>3, 'square'=>4}
shapes = Hash['circle', 1, 'triangle', 3, 'square', 4]
shapes = { :circle => 1, :triangle => 3, :square => 4 }
cpp
Hashtable^ shapes = gcnew Hashtable;

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
Generic::Dictionary<String^, int>^ shapes = gcnew Generic::Dictionary<String^, int>();

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
map<string, int> shapes;

shapes["circle"] = 1;
shapes["triangle"] = 3;
shapes["square"] = 4;
fsharp
let shapes = Map.ofList [("circle", 1); ("triangle", 3); ("square", 4)]
let shapes = Map.empty.Add("circle", 1).Add("triangle", 3).Add("square", 4)
let shapes = new Generic.Dictionary<string, int>()
shapes.Add("circle", 1)
shapes.Add("triangle", 3)
shapes.Add("square", 4)
let shapes = Map [("circle", 1); ("triangle", 3); ("square", 4)]
erlang
Map = dict:from_list([{circle, 1}, {triangle, 3}, {square, 4}]),
Map0 = dict:new(),

% Erlang variables are 'single-assignment' i.e. they cannot be reassigned
Map1 = dict:store(circle, 1, Map0),
Map2 = dict:store(triangle, 3, Map1),
Map3 = dict:store(square, 4, Map2),
Map0 = gb_trees:empty(),

Map1 = gb_trees:enter(circle, 1, Map0),
Map2 = gb_trees:enter(triangle, 3, Map1),
Map3 = gb_trees:enter(square, 4, Map2),
Map = gb_trees:from_orddict(lists:keysort(1, [{circle, 1}, {triangle, 3}, {square, 4}])),
Map = ets:new(the_map_name, [ordered_set, private, {keypos, 1}]),
ets:insert(Map, [{circle, 1}, {triangle, 3}, {square, 4}]),
haskell
import qualified Data.Map as M

initialMap = M.fromList [("circle", 1), ("triangle", 3), ("square", 4)]

Check if a key exists in a map

Given a map pets {joe:cat,mary:turtle,bill:canary} print "ok" if an pet exists for "mary"
ruby
puts "ok" if map.has_key?('mary')
puts "ok" if map['mary'] # Only works if map entry can't be nil or false
cpp
if (pets->ContainsKey("mary")) Console::WriteLine("ok");
if (pets.find("mary") != pets.end()){
std::cout << "ok" << std::endl;
}
if (pets.count("mary") > 0)
cout << "ok" << endl;
fsharp
if (Map.mem "mary" pets) then printfn "ok"
if pets.ContainsKey("mary") then printfn "ok"
erlang
dict:is_key(mary, Pets) andalso begin io:format("ok~n"), true end.
IsMember = ets:member(Pets, mary), if (IsMember) -> io:format("ok~n") ; true -> false end.
case gb_trees:lookup(mary, Pets) of none -> false ; _ -> io:format("ok~n") end.
haskell
import qualified Data.Map as M
import Control.Monad (when)

pets = M.fromList [("joe", "cat"), ("mary", "turtle"), ("bill", "canary")]

checkMary = when (M.member "mary" pets) (print "ok")

Retrieve a value from a map

Given a map pets {joe:cat,mary:turtle,bill:canary} print the pet for "joe" ("cat")
ruby
puts map['joe']
cpp
if (pets->ContainsKey("joe")) Console::WriteLine(pets["joe"]);
cout << pets["joe"] << endl;
fsharp
if (Map.mem "joe" pets) then printfn "%s" (Map.find "joe" pets)
if (pets |> Map.exists (fun key _ -> key = "joe")) then printfn "%s" (Map.find "joe" pets)
let key = "joe"
match (pets |> Map.tryfind key) with
| Some(value) -> printfn "%s" value
| None -> printfn "Key %s not found" key
if pets.ContainsKey("joe") then printfn "%s" pets.["joe"]
if pets.ContainsKey("joe") then printfn "%s" (pets.["joe"] :?> string)
erlang
dict:is_key(joe, Pets) andalso begin io:format("~w~n", [dict:fetch(joe, Pets)]), true end.
case dict:find(joe, Pets) of error -> false ; {ok, Pet} -> io:format("~w~n", [Pet]) end.
IsMember = ets:member(Pets, joe), if (IsMember) -> io:format("~w~n", [ets:lookup_element(Pets, joe, 2)]) ; true -> false end.
case ets:match(Pets, {joe, '$1'}) of [] -> false ; [[Pet]] -> io:format("~w~n", [Pet]) end.
case gb_trees:lookup(joe, Pets) of none -> false ; {value, Pet} -> io:format("~w~n", [Pet]) end.
haskell
import qualified Data.Map as M

pets = M.fromList [("joe", "cat"), ("mary", "turtle"), ("bill", "canary")]
retrieve = print $ M.findWithDefault "Not found" "joe" pets

Add an entry to a map

Given an empty pets map, add the mapping from "rob" to "dog"
ruby
pets['rob']='dog'
cpp
pets->Add("rob", "dog");
pets["rob"] = "dog";
fsharp
pets <- (Map.add "rob" "dog" pets)
pets.Add("rob", "dog")
erlang
Pets1 = dict:store(rob, dog, Pets0).
ets:insert(Pets, {rob, dog}).
Pets1 = gb_trees:enter(rob, dog, Pets0).
haskell
import qualified Data.Map as M

pets = M.insert "rob" "dog" M.empty

Remove an entry from a map

Given a map pets {joe:cat,mary:turtle,bill:canary} remove the mapping for "bill" and print "canary"
ruby
puts map.delete :bill
cpp
if (pets->ContainsKey("bill"))
{
String^ value = safe_cast<String^>(pets["bill"]); pets->Remove("bill");
Console::WriteLine("{0}", value);
}
fsharp
let key = "bill"
match (pets |> Map.tryFind key) with
| Some(value) -> pets <- (Map.remove key pets) ; printfn "%s : %s removed" key value
| None -> printfn "Key %s not found" key
let key = "bill"
let entry = if (pets.ContainsKey(key)) then Some(pets.[key]) ; else None
pets.Remove(key)

match entry with
| Some(value) -> printfn "%s" value
| None -> printfn "key not found"
erlang
Pet = dict:fetch(bill, Pets0), Pets1 = dict:erase(bill, Pets0), io:format("~w~n", [Pet]),
Pet = ets:lookup_element(Pets, bill, 2), ets:delete(Pets, bill), io:format("~w~n", [Pet]),
{value, Pet} = gb_trees:lookup(bill, Pets0), Pets1 = gb_trees:delete(bill, Pets0), io:format("~w~n", [Pet]),
haskell
import qualified Data.Map as M

main = do
let pets = M.fromList [("joe", "cat"), ("mary", "turtle"), ("bill", "canary")]
pets2 = M.delete "bill" pets
print $ maybe "" id (M.lookup "bill" pets)
print pets2

Create a histogram map from a list

Given the list [a,b,a,c,b,b], produce a map {a:2, b:3, c:1} which contains the count of each unique item in the list
ruby
histogram = {}
list.each { |item| histogram[item] = (histogram[item] || 0) +1 }
list = %w{a b a c b b}

histogram = list.each_with_object(Hash.new(0)) do |item, hash|
hash[item] += 1
end

p histogram # => {"a"=>2, "b"=>3, "c"=>1}
list.inject(Hash.new(0)) {|h, item| h[item] += 1; h}
cpp
for each(String^ entry in input) hash[entry] = hash->ContainsKey(entry)
? Convert::ToInt32(hash[entry]->ToString()) + 1 : 1;
for each(String^ entry in input) dict[entry] = dict->ContainsKey(entry) ? dict[entry] + 1 : 1;
map<string,int> hist;
for (auto e: { "a","b","a","c","b","b" })
++hist[e];
for (auto e: hist)
cout << e.first << " : " << e.second << endl;
fsharp
let histogram = (List.foldLeft (fun (acc : Map<char, int>) (e : char) -> if (Map.mem e acc) then (Map.add e ((Map.find e acc) + 1) acc) ; else (Map.add e 1 acc)) (Map.empty) list)
let histogram list =
let rec histogram' list' dict' =
match list' with
| [] -> dict'
| x :: xs ->
match Map.tryFind x dict' with
| Some(Value) -> histogram' xs (Map.add x (Value + 1) dict')
| None -> histogram' xs (Map.add x 1 dict')
histogram' list Map.empty

// ------

let histogram' = histogram list
let histogram = (List.foldLeft (fun (acc : Generic.Dictionary<char, int>) (e : char) -> (if acc.ContainsKey(e) then acc.[e] <- acc.[e] + 1 ; else acc.Add(e, 1)) ; acc) (new Generic.Dictionary<char, int>()) list)
let histogram =
list
|> Seq.groupBy (fun a -> a)
|> Seq.map(fun (key, elements) -> key, Seq.length elements)
|> Map.ofSeq
erlang
% Imperative Solution
Histogram = histogram(List),
% Functional (1) Solution
Histogram = histogram(List),
lists:foldl(fun(Elem, OldDict) ->
dict:update_counter(Elem, 1, OldDict)
end,
dict:new(),
[a,b,a,c,b,b])).
csharp
using System.Collections.Generic;
using System.Linq;

// This is a "functional" C# approach

// NOTE: In C# "maps" are of type Dictionary<Tkey, TValue>
// so our histogram map is of type Dictionary<object, int>
public class HistogramMap {
public Dictionary<object, int> FromList(List<object> list) {
// The "Aggregate" method works like "inject" in many other languages.
return list.Aggregate(
new Dictionary<object, int>(),
(map, obj) => {
// If this is the first time we've seen this obj, set the count to 0
if (!map.ContainsKey(obj)) map[obj] = 0;

// Increment the count
map[obj]++;

// Return the map for the next iteration.
// NOTE: This does NOT return from our "FromList" method
return map;
}
);
}

public static void Main() {
// Create our Histogram Map from a new list
var map = new HistogramMap().FromList(
new List<object>() { 'a', 'b', 'a', 'c', 'b', 'b' }
);

// This just prints the result
System.Console.WriteLine (
string.Join (", ",
// "Select" works like "map" or "collect" in many other languages
map.Select( kvp =>
string.Format("{0} : {1}", kvp.Key, kvp.Value)
).ToArray()
)
);
}
}
new[] {"a","b","a","c","b","b"}
.GroupBy(s => s)
.Select(s => new { Value = s.Key, Count = s.Count() })
.ToList()
.ForEach(e => Console.WriteLine("{0} : {1} ", e.Value, e.Count));
haskell
import Data.List
import qualified Data.Map as Map

histogram :: Ord a => [a] -> Map.Map a Int
histogram xs = Map.fromList [ (head l, length l) | l <- group (sort xs) ]

output :: Map.Map String Int
output = histogram ["a","b","a","c","b","b"]
import Control.Arrow
import Data.List
import qualified Data.Map as Map
import System.Random

histogram :: Ord a => [a] -> Map.Map a Int
histogram = Map.fromList . map (head &&& length) . group . sort

main = print . histogram . take 1000 . randomRs (1::Int, 100) =<< newStdGen

Categorise a list

Given the list [one, two, three, four, five] produce a map {3:[one, two], 4:[four, five], 5:[three]} which sorts elements into map entries based on their length
ruby
lengths = {}
list.each do |x|
len = x.size
lengths[len] = (lengths[len] || [])
lengths[len] << x
end
lengths = list.group_by {|x| x.size}
list.inject({}) { |h,x| (h[x.size]||=[]) << x; h }
cpp
for each(String^ entry in input)
{
key = entry->Length;
if (!hash->ContainsKey(key)) hash[key] = gcnew ArrayList;
safe_cast<ArrayList^>(hash[key])->Add(entry);
}
fsharp
let catmap = (List.foldLeft (fun (acc : Map<int, List<string> >) (e : string) -> if (Map.mem e.Length acc) then (Map.add e.Length ((Map.find e.Length acc) @ [e]) acc) ; else (Map.add e.Length [e] acc)) (Map.empty) list)
let lengthMap =
["one"; "two"; "three"; "four"; "five"]
|> Seq.groupBy (fun s -> s.Length)
|> Seq.map (fun (length, entries) -> (length, entries |> List.ofSeq))
|> Map.ofSeq
erlang
% Imperative Solution
CatList = categorise(List),
% Functional (1) Solution
CatList = categorise(List),
csharp
using System.Collections.Generic;
using System.Linq;
public class ListCategorizer {
public static void Main() {
var list = new List<string>() { "one", "two", "three", "four", "five" };
var categories = list.GroupBy(el => el.Length)
.ToDictionary( g => g.Key, // key
g => g.ToList() ); // value
}
}
haskell
import qualified Data.Map as Map

groupInMapBy :: Ord k => (a -> k) -> [a] -> Map.Map k [a]
groupInMapBy f = foldr (\a -> Map.insertWith (++) (f a) [a]) Map.empty

output :: Map.Map Int [String]
output = groupInMapBy length ["one", "two", "three", "four", "five"]
import Data.List (groupBy, sortBy)
import Data.Function (on)

groupInPairsBy :: Ord k => (a -> k) -> [a] -> [(k, [a])]
groupInPairsBy f = map (\xs -> (f (head xs), xs)) .
groupBy ((==) `on` f) . sortBy (compare `on` f)

output :: [(Int, [String])]
output = groupInPairsBy length ["one", "two", "three", "four", "five"]

Perform an action if a condition is true (IF .. THEN)

Given a variable name, if the value is "Bob", display the string "Hello, Bob!". Perform no action if the name is not equal.
ruby
if (name=='Bob')
puts "Hello, Bob!"
end
puts "Hello, Bob!" if name=='Bob'
cpp
if (name == "Bob") Console::WriteLine("Hello, {0}!", name);
if (name == "Bob") std::cout << "Hello, " << name << "!" << std::endl;
fsharp
if name = "Bob" then printfn "Hello, %s!" name
name = "Bob" && begin printfn "Hello, %s!" name ; true end
erlang
if (Name == "Bob") -> io:format("Hello, ~s!~n", [Name]) ; true -> false end.
case Name of "Bob" -> io:format("Hello, ~s!~n", [Name]) ; _ -> false end.
Name == "Bob" andalso (begin io:format("Hello, ~s!~n", [Name]), true end).
csharp
if (name == "Bob") Console.WriteLine("Hello, {0}!", name);
haskell
name = "Bob"
main = if name == "Bob" then putStrLn "Hello, Bob!" else return ()

Perform different actions depending on a boolean condition (IF .. THEN .. ELSE)

Given a variable age, if the value is greater than 42 display "You are old", otherwise display "You are young"
ruby
if (age > 42)
puts "You are old"
else
puts "You are young"
end
puts (age>42) ? "You are old" : "You are young"
puts "You are #{age > 42 ? "old" : "young"}"
cpp
if (age > 42) Console::WriteLine("You are old");
else Console::WriteLine("You are young");
Console::WriteLine("You are {0}", (age > 42 ? "old" : "young"));
std::printf("You are %s\n", (age > 42 ? "old" : "young"));
fsharp
if age > 42 then printfn "You are old" else printfn "You are young"
let message = if age > 42 then "old" else "young"
printfn "You are %s" message
erlang
if Age > 42 -> io:format("You are old~n") ; true -> io:format("You are young~n") end.
Message = if Age > 42 -> "old" ; true -> "young" end, io:format("You are ~s~n", [Message]).
case Age > 42 of true -> io:format("You are old~n") ; false -> io:format("You are young~n") end.
case Age of _ when Age > 42 -> io:format("You are old~n") ; _ -> io:format("You are young~n") end.
Message = case Age of _ when Age > 42 -> "old" ; _ -> "young" end, io:format("You are ~s~n", [Message]).
Age > 42 andalso (begin io:format("You are old~n"), true end) orelse (begin io:format("You are young~n"), true end).
(fun (X) when X > 42 -> io:format("You are old~n"); (_) -> io:format("You are young~n") end)(Age).
(fun () when Age > 42 -> io:format("You are old~n"); () -> io:format("You are young~n") end)().
io:format("You are ~s~n", [if Age > 42 -> "old" ; true -> "young" end]).
csharp
int age = 41;

if (age > 42)

System.Console.WriteLine("You are old");
else
System.Console.WriteLine("You are young");


haskell
putStrLn ("You are " ++ if age > 42 then "old" else "young")

Perform different actions depending on several boolean conditions (IF .. THEN .. ELSIF .. ELSE)

ruby
if age > 84
puts "You are really ancient"
elsif age > 30
puts "You are middle-aged"
else
puts "You are young"
end
case
when age > 84 then puts "You are really ancient"
when age > 30 then puts "You are middle-aged"
else puts "You are young"
end
cpp
if (age > 84) Console::WriteLine("You are really ancient");
else if (age > 30) Console::WriteLine("You are middle-aged");
else Console::WriteLine("You are young");
Console::WriteLine("You are {0}", (age > 84 ? "really ancient" : age > 30 ? "middle-aged" : "young"));
std::cout << "You are " << (age > 84 ? "really ancient" : age > 30 ? "middle-aged" : "young") << std::endl;
fsharp
if age > 84 then printfn "You are really ancient"
elif age > 30 then printfn "You are middle-aged"
else printfn "You are young"
let message = match age with
| _ when age > 84 -> "really ancient"
| _ when age > 30 -> "middle-aged"
| _ -> "young"
printfn "You are %s" message
erlang
if
Age > 84 -> io:format("You are really ancient~n");
Age > 30 -> io:format("You are middle-aged~n");
true -> io:format("You are young~n")
end.
case Age of
_ when Age > 84 -> io:format("You are really ancient~n");
_ when Age > 30 -> io:format("You are middle-aged~n");
true -> io:format("You are young~n")
end.
csharp
if (age > 84) Console.WriteLine("You are really ancient");
else if (age > 30) Console.WriteLine("You are middle-aged");
else Console.WriteLine("You are young");
Console.WriteLine("You are {0}", ((age > 84) ? "really ancient" : (age > 30) ? "middle-aged" : "young"));

Replacing a conditional with many branches with a switch/case statement

Many languages support more compact forms of branching than just if ... then ... else such as switch or case or match. Use such a form to add an appropriate placing suffix to the numbers 1..40, e.g. 1st, 2nd, 3rd, 4th, ..., 11th, 12th, ... 39th, 40th
ruby
def suffixed(number)
last_digit = number.to_s[-1..-1].to_i
suffix = case last_digit
when 1 then 'st'
when 2 then 'nd'
when 3 then 'rd'
else 'th'
end
suffix = 'th' if (11..13).include?(number)
"#{number}#{suffix}"
end

(1..40).each {|n| puts suffixed(n) }
cpp
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int num,i,x;
cout<<"Enter the range:";
cin>>num;
for(i=1;i<=num;i++)
{
x=i%10;
switch(i)
{
case 11:
case 12:
case 13:cout<<i<<"th ";
continue;
}
switch(x)
{
case 1: cout<<i<<"st ";break;
case 2: cout<<i<<"nd ";break;
case 3: cout<<i<<"rd ";break;
default: cout<<i<<"th ";
}
}
getch();
}
fsharp
let suffix = function
| n when n > 10 && n < 20 -> "th"
| n when n % 10 = 1 -> "st"
| n when n % 10 = 2 -> "nd"
| n when n % 10 = 3 -> "rd"
| _ -> "th"

seq { 1 .. 40 }
|> Seq.iter (fun n -> printfn "%i%s" n (suffix n))
erlang
Suffix = case Num of
N when N > 10, N < 20 -> "th";
N when N rem 10 =:= 1 -> "st";
N when N rem 10 =:= 2 -> "nd";
N when N rem 10 =:= 3 -> "rd";
_ -> "th"
end,
io_lib:format("~w~s", [Num, Suffix])
csharp
public static string GetOrdinal(int i)
{
if (i > 10 && i < 20) return i.ToString() + "th";
switch (i % 10)
{
case 1:
return i.ToString() + "st";
case 2:
return i.ToString() + "nd";
case 3:
return i.ToString() + "rd";
default:
return i.ToString() + "th";
}
}
public static string GetOrdinal(int i)
{
if (i > 10 && i < 20) return i.ToString() + "th";
switch (i % 10)
{
case 1:
return i.ToString() + "st";
break;
case 2:
return i.ToString() + "nd";
break;
case 3:
return i.ToString() + "rd";
break;
default:
return i.ToString() + "th";
break;
}
}
haskell
suffixed n = show n ++ suffix
where
suffix
| n `mod` 100 `div` 10 == 1 = "th"
| otherwise = case n `mod` 10 of
1 -> "st"
2 -> "nd"
3 -> "rd"
_ -> "th"


result = map suffixed [1..40]

Perform an action multiple times based on a boolean condition, checked before the first action (WHILE .. DO)

Starting with a variable x=1, Print the sequence "1,2,4,8,16,32,64,128," by doubling x and checking that x is less than 150.
ruby
x=1
while x < 150
puts x
x <<= 1
end
cpp
int x = 1;

while (x < 150) { x *= 2; Console::Write("{0},", x); }
Console::WriteLine();
for (int x = 1; x < 150; x *= 2) { std::cout << x << ","; }
std::cout << std::endl;
fsharp
let mutable x = 1
while x < 150 do printf "%d, " x ; (x <- x * 2) done
// The problem is clearly geared towards imperative languages ;-)
// No need to mutate any variable, here's how to do it loop-free functional:
let rec powers2 i = seq { if i < 150 then yield i; yield! powers2 (i*2) }
powers2 1 |> Seq.iter (fun i -> printf "%i, " i)
erlang
X = 1, print_while_X_less_150(X).
Pred = fun (X) -> X < 150 end,
Action = fun (X) -> io:format("~B,", [X]), X * 2 end,
X = 1,

while_do(Pred, Action, X).
csharp
int x = 1;

while (x < 150)
{
x *= 2;
Console.Write("{0},", x);
}
haskell
main :: IO ()
main = loop 1
where
loop x | x < 150 = do
putStr (show x ++ ",")
loop (x * 2)
loop _ = return ()
main = mapM_ print $ takeWhile (<150) $ iterate (* 2) 1

Perform an action multiple times based on a boolean condition, checked after the first action (DO .. WHILE)

Simulate rolling a die until you get a six. Produce random numbers, printing them until a six is rolled. An example output might be "4,2,1,2,6"
ruby
# Ruby has no DO..WHILE construct. Need to write it as a WHILE
rnd = 0
while (rnd != 6)
rnd = rand(6)+1
print rnd
print "," if (rnd!=6)
end
begin
rnd = rand(6)+1
print rnd
print "," if rnd!=6
end while rnd != 6
# This uses Enumerators, ad it becomes almost functional style...

games = Enumerator.new do |yielder|
yielder.yield rand(6) + 1 while true
end

puts games.take_while {|roll| roll != 6}.join(",")
cpp
Random^ rnd = gcnew Random;

int dice = rnd->Next(1, 7); Console::Write("{0}", dice);
do { Console::Write(",{0}", (dice = rnd->Next(1, 7))); } while (dice != 6);
Console::WriteLine();
fsharp
open System
let rand = Random()

Seq.initInfinite (fun _ -> rand.Next(1, 7))
|> Seq.takeWhile (fun x -> x < 6)
|> fun items -> String.Join(",", items)
|> function s when s = "" -> printfn "6" | s -> printfn "%s,6" s
erlang
Pred = fun (DiceRoll) -> DiceRoll =/= 6 end,
Action = fun (DiceRoll) -> io:format("~B,", [DiceRoll]), dice_roll() end,

do_while(Pred, Action, dice_roll()).
-module(dice).
-export([start/0]).

start() ->
roll(dice_roll()).

roll(6) ->
io:format("6~n", []);
roll(N) ->
io:format("~B,", [N]),
roll(dice_roll()).

dice_roll() -> random:uniform(6).
csharp
System.Random die = new System.Random();
int roll;

do
{
roll = die.Next(1, 6);
Console.Write(roll);
if (roll < 6) Console.Write(",");
}
while (roll != 6);
haskell
import System.Random

diceRolls = do
gen <- newStdGen
print $ takeWhile (/=(6::Int)) (randomRs (1,6) gen)

Perform an action a fixed number of times (FOR)

Display the string "Hello" five times like "HelloHelloHelloHelloHello"
ruby
puts "Hello"*5
5.times { print "Hello" }
cpp
for(int i = 0; i < 5; ++i) Console::Write("Hello");
for(int i = 5; i > 0; --i) Console::Write("Hello");
dotimes(5, hello);
fill_n(ostream_iterator<string>(cout), 5, "Hello");
fsharp
for i = 1 to 5 do printf "Hello" done
dotimes 5 (fun () -> printf "Hello")
// Repetition via ranging over a List type(index ignored)
for _ in list do printf "Hello" done
// Repetition via ranging over a Sequence type(index ignored)
for _ in sequence do printf "Hello" done
// Repetition via ranging over an Array type(index ignored)
for _ in array do printf "Hello" done
erlang
dotimes(5, fun () -> io:format("Hello") end).
lists:foreach(fun (_) -> io:format("Hello") end, lists:seq(1, 5)).
csharp
string text = "Hello";

for (int i = 0; i < 5; i++)
{
Console.Write(text);
}
haskell
import Control.Monad

hi5 = replicateM_ 5 $ putStr "Hello"

Perform an action a fixed number of times with a counter

Display the string "10 .. 9 .. 8 .. 7 .. 6 .. 5 .. 4 .. 3 .. 2 .. 1 .. Liftoff!"
ruby
10.downto(1) { |n| print n, " .. " }
puts "Liftoff!"
cpp
for(int i = 10; i != 0; --i) Console::Write("{0} .. ", i);
Console::WriteLine("Liftoff!");
fsharp
for i = 10 downto 1 do printf "%d .. " i done
printfn "Liftoff!"
// Repetition via ranging over a Sequence type
for i in {10 .. -1 .. 1} do printf "%d .. " i done ; printfn "Liftoff!"
erlang
fromto(10, 1, -1, fun (X) -> io:format("~B .. ", [X]) end), io:format("Liftoff!~n").
lists:foreach(fun (X) -> io:format("~B .. ", [X]) end, lists:seq(10, 1, -1)), io:format("Liftoff!~n").
csharp
for (int i = 10; i > 0; i--)
{
Console.Write("{0} .. ", i);
}

Console.WriteLine("Liftoff!");
haskell
countDown = mapM_ printN [10,9..1] >> putStr "Liftoff!"
where printN n = putStr $ show n ++ " .. "

Read the contents of a file into a string

ruby
file = File.new("Solution108.rb")
whole_file = file.read
cpp
IO::FileStream^ file; String^ buffer;

try
{
file = gcnew IO::FileStream("test.txt", IO::FileMode::Open);
buffer = gcnew String((gcnew IO::BinaryReader(file))->ReadChars(file->Length));
}
IO::StreamReader^ stream; String^ buffer;

try
{
stream = gcnew IO::StreamReader("test.txt");
buffer = stream->ReadToEnd();
}
String^ buffer = IO::File::ReadAllText("test.txt");
fsharp
let file = new FileStream("test.txt", FileMode.Open)
let buffer = new String((new BinaryReader(file)).ReadChars(Convert.ToInt32(file.Length)))
let stream = new StreamReader("test.txt")
let buffer = stream.ReadToEnd()
let buffer = File.ReadAllText("test.txt")
erlang
Text = readfile("Solution607.erl"),
Text = readfile("Solution608.erl"),
csharp
string contents = System.IO.File.ReadAllText("filename.txt");
haskell
readFile "c:/tmp/myFile.txt"

Process a file one line at a time

Open the source file to your solution and print each line in the file, prefixed by the line number, like:
1> First line of file
2> Second line of file
3> Third line of file
ruby
File.open("Solution103.rb").each_with_index { |line, count|
puts "#{count} > #{line}
}
cpp
IO::StreamReader^ stream; String^ ln; int i = 0;

try
{
stream = gcnew IO::StreamReader("test.txt");
while ((ln = stream->ReadLine())) Console::WriteLine("{0}> {1}", ++i, ln);
}
int i = 0;
for each(String^ line in IO::File::ReadAllLines("test.txt")) Console::WriteLine("{0}> {1}", ++i, line);
fsharp
let stream = new StreamReader("test.txt")
let mutable i = 1
let mutable line = stream.ReadLine()
while (line <> null) do printfn "%d> %s" i line ; line <- stream.ReadLine() ; i <- i + 1 done
stream.Close()
let proc_a_line (filename : string) proc =
let stream = new StreamReader(filename)
let rec proc_a_line' count line =
match line with
| null -> stream.Close()
| _ -> proc count line ; proc_a_line' (count + 1) (stream.ReadLine())
proc_a_line' 1 (stream.ReadLine())

// ------

let _ = proc_a_line "test.txt" (fun i line -> printfn "%d> %s" i line)
let reader(filename : string) = seq {
use sr = new StreamReader(filename)
while not sr.EndOfStream do
let line = sr.ReadLine()
yield line
done
}

// ------

reader("test.txt") |> Seq.iteri (fun i line -> printfn "%d> %s" (i + 1) line)
File.ReadAllLines("test.txt") |> Array.iteri (fun i line -> printfn "%d> %s" (i + 1) line)
// Unlike ReadAllLines, ReadLines (new in .NET 4) only reads the file
// one line at a time, rather than reading the entire file into an array first.

open System.IO
File.ReadLines("test.txt") |> Seq.iteri (fun i line -> printfn "%d> %s" (i + 1) line)
erlang
Reader = fun (IODevice) -> io:get_line(IODevice, "") end,
Worker = fun (Line, N) -> io:format("~B> ~s", [N, Line]), N + 1 end,

while_not_eof("Solution609.erl", Reader, Worker, 1).
Reader = fun (Filename) -> {ok, Contents} = file:read_file(Filename), Contents end,
Transformer = fun (Line, N) -> string:concat(string:concat(integer_to_list(N), "> "), Line) end,
Printer = fun (Line) -> io:format("~s~n", [Line]) end,

Lines = string:tokens(binary_to_list(Reader("Solution610.erl")), "\n"),
NewLines = lists:zipwith(Transformer, Lines, lists:seq(1, length(Lines))),
lists:foreach(Printer, NewLines).
csharp
int counter = 0;

// If the file is large, you would want to buffer this instead of reading everything at once
foreach (string line in System.IO.File.ReadAllLines("filename.txt"))
{
Console.WriteLine("{0}> {1}", ++counter, line);
}
haskell
import Data.List

prefixWithNumber str n = show n ++ "> " ++ str

numberStrings (x:xs) n = prefixWithNumber x n : (numberStrings xs (n+1))
numberStrings [] n = []

main = do
str <- readFile "prefix.hs"
putStrLn (intercalate "\n" (numberStrings (lines str) 1))
prefix n str = show n ++ "> " ++ str

main = readFile "prefix.hs" >>=
putStr . unlines . zipWith prefix [1..] . lines

Write a string to a file

ruby
File.new("a_file", "w") << "some text"
cpp
IO::StreamWriter^ stream;

try
{
stream = gcnew IO::StreamWriter("test.txt", false);
stream->WriteLine("This line overwites file contents!");
}
fsharp
let stream = new StreamWriter("test.txt", false)
stream.WriteLine("This line overwrites file contents!")
erlang
Line = "This line overwites file contents!\n",
{ok, IODevice} = file:open("test.txt", [write]), file:write(IODevice, Line), file:close(IODevice).
csharp
System.IO.File.WriteAllText("filename.txt", "Some text to write to the file");
haskell
writeFile "filename" "stringe"

Append to a file

ruby
file = File.new('/tmp/test.txt', 'a+') ; file.puts 'This line appended to file!!' ; file.close()
cpp
IO::StreamWriter^ stream;

try
{
stream = gcnew IO::StreamWriter("test.txt", true);
stream->WriteLine("This line appended to file!");
}
fsharp
let stream = new StreamWriter("test.txt", true)
stream.WriteLine("This line appended to file!")
erlang
Line = "This line appended to file!\n",
{ok, IODevice} = file:open("test.txt", [append]), file:write(IODevice, Line), file:close(IODevice).
csharp
System.IO.File.AppendAllText("filename.txt", "Some text to append to the file");
haskell
appendfile "filename" "string"

Process each file in a directory

ruby
directory = '/tmp' ; Dir.foreach(directory) {|file| puts "#{file}"}
cpp
for each(String^ filename in IO::Directory::GetFiles(dirname)) process(filename);
fsharp
let dirname = "c:\\"

let processFile filename = printfn "%s" filename
for filename in Directory.GetFiles(dirname) do processFile filename done
let dirname = "c:\\"

Directory.GetFiles(dirname) |> Array.iter (fun filename -> printfn "%s" filename)
erlang
% File basenames only - many tasks require absolute paths to work
lists:foreach(fun (FileOrDirPath) -> Worker(FileOrDirPath) end, file:list_dir(Directory)).
% Absolute paths provided - will accomodate most tasks
lists:foreach(fun (FileOrDirPath) -> Worker(FileOrDirPath) end, list_dir_path(Directory)).
csharp
foreach (string filename in System.IO.Directory.GetFiles(directory)) ProcessFile(filename);
haskell
import System.Directory
import Control.Monad

process filename = putStrLn filename

main = getDirectoryContents "." >>=
filterM doesFileExist >>=
mapM_ process

Process each file in a directory recursively

ruby
def procdir(dirname)
Dir.foreach(dirname) do |dir|
dirpath = dirname + '/' + dir
if File.directory?(dirpath) then
if dir != '.' && dir != '..' then
puts "DIRECTORY: #{dirpath}" ; procdir(dirpath)
end
else
puts "FILE: #{dirpath}"
end
end
end

# ------

procdir('/tmp')
cpp
void processFile(String^ filename) { Console::WriteLine("{0}", filename); }

void processDirectory(String^ dirname)
{
for each(String^ filename in IO::Directory::GetFiles(dirname)) processFile(filename);
for each(String^ subdirname in IO::Directory::GetDirectories(dirname)) processDirectory(subdirname);
}

int main()
{
processDirectory("c:\\");
}
fsharp
let processDirectory dirname proc =
let rec processDirectory' dirname' =
Directory.GetFiles(dirname') |> Array.iter proc
Directory.GetDirectories(dirname') |> Array.iter processDirectory'
processDirectory' dirname

// ------

let dirname = "c:\\"

processDirectory dirname (fun filename -> printfn "%s" filename)
erlang
filelib:fold_files(Directory, ".*", true, fun (FileOrDirPath, Acc) -> Worker(FileOrDirPath), Acc end, []).
process_dir(Directory, Worker).
haskell
import System.Directory (doesFileExist, getDirectoryContents)
import System.FilePath ((</>))

process :: FilePath -> IO ()
process filename = putStrLn filename

mapDir :: (FilePath -> IO ()) -> FilePath -> IO ()
mapDir proc fp = do
isFile <- doesFileExist fp -- is a file of fp
if isFile then proc fp -- process the file
else getDirectoryContents fp >>=
mapM_ (mapDir proc . (fp </>)) . filter (`notElem` [".", ".."])

main = mapDir process "."

Parse a date and time from a string

Given the string "2008-05-06 13:29", parse it as a date representing 6th March, 2008 1:29:00pm in the local time zone.
ruby
# With timezone info
puts Time.parse('2008-05-06 13:29')
cpp
DateTimeOffset^ dateTime = DateTimeOffset::Parse("2008-05-06 13:29");

// Use format specifiers to appropriately format string
// 1. Default culture
Console::WriteLine("{0}", dateTime->ToString("d MMMM, yyyy h:mm:sstt"));

// 2. Nominated culture
Console::WriteLine("{0}", dateTime->ToString("d MMMM, yyyy h:mm:sstt"), Globalization::CultureInfo::CreateSpecificCulture("en-us"));
DateTimeOffset^ dateTime = DateTimeOffset::Parse("2008-05-06 13:29");

// Customize date/time string
Text::StringBuilder^ dsb = gcnew Text::StringBuilder(40);
dsb->Append(dateTime->ToString("%d"))->Append("th ")->Append(dateTime->ToString("MMMM, yyyy h:mm:ss"))->Append(dateTime->ToString("tt")->ToLower());

Console::WriteLine("{0}", dsb);
fsharp
let dateTime = DateTimeOffset.Parse("2008-05-06 13:29")

// Use format specifiers to appropriately format string
// 1. Default culture
printfn "%s" (dateTime.ToString("d MMMM, yyyy h:mm:sstt"))

// 2. Nominated culture
Console.WriteLine("{0}", dateTime.ToString("d MMMM, yyyy h:mm:sstt"), Globalization.CultureInfo.CreateSpecificCulture("en-us"))
let dateTime = DateTimeOffset.Parse("2008-05-06 13:29")

// Customize date/time string
let dsb = ((new StringBuilder(40)).Append(dateTime.ToString("%d")).Append("th ").Append(dateTime.ToString("MMMM, yyyy h:mm:ss")).Append(dateTime.ToString("tt").ToLower()))

printfn "%s" (dsb.ToString())
erlang
% AFAIK, no datetime-parsing library exists; 'parse_to_datetime' is a simplistic, problem-specific hack
LocalDateTime = erlang:universaltime_to_localtime(parse_to_datetime("2008-05-06 13:29:34")),
csharp
DateTime parsedDate = DateTime.Parse("2008-05-06 13:29");
// Ideally, you would catch the potential FormatException or use DateTime.TryParse in production code.

Display information about a date

Display the day of month, day of year, month name and day name of the day 8 days from now.
ruby
require 'date'

next_week = Date.today + 8

puts next_week.day # day of month
puts next_week.yday # day of year
puts next_week.strftime('%B') # month name
puts next_week.strftime('%A') # day name
cpp
QDate dateEightDaysFromNow = QDate::currentDate().addDays(8);
fsharp
Using F# interactive

> let Then = DateTime.Now.AddDays(8.0)
- let dayNumber = Then.DayOfYear.ToString()
- let solution = Then.ToString("dd " + dayNumber + " MMMM dddd");;

val Then : DateTime = 08/08/2010 08:58:05
val dayNumber : string = "220"
val solution : string = "08 220 August Sunday"

>
csharp
DateTime date = DateTime.Today.AddDays(8);

Console.WriteLine("Day of month: " + date.Day);
Console.WriteLine("Day of year: " + date.DayOfYear);
Console.WriteLine("Month name: " + date.ToString("MMMM"));
Console.WriteLine("Day name: " + date.ToString("dddd"));

// The two ToString calls will use the current locale.
// To get localised month and day names, see http://msdn.microsoft.com/en-us/library/8tfzyc64.aspx

Display a date in different locales

Display a language/locale friendly version of New Year's Day for 2009 for several languages/locales. E.g. for languages English, French, German, Italian, Dutch the output might be something like:

Thursday, January 1, 2009
jeudi 1 janvier 2009
giovedì 1 gennaio 2009
Donnerstag, 1. Januar 2009
donderdag 1 januari 2009

(Indicate in comments where possible if any language specific or operating system configuration needs to be in place.)
cpp
QList<QLocale::Language> locales;
locales << QLocale::English
<< QLocale::French
<< QLocale::German
<< QLocale::Italian
<< QLocale::Dutch;

QDate date(2009, 1, 1);
foreach (QLocale::Language ll, locales)
{
QLocale::setDefault(ll);
qDebug() << date.toString(Qt::DefaultLocaleLongDate);
}
fsharp
open System
open System.Globalization

let jan1 = DateTime(2009, 1, 1)

[ "en-US"; "fr-FR"; "de-DE"; "it-IT"; "nl-NL" ]
|> List.map CultureInfo.CreateSpecificCulture
|> List.map (fun c -> jan1.ToString("D", c))
|> List.iter (printfn "%s")
csharp
using System.Globalization;

DateTime newYearsDay = new DateTime(2009, 1, 1);
CultureInfo[] locales = {
CultureInfo.CreateSpecificCulture("en-US"),
CultureInfo.CreateSpecificCulture("fr-FR"),
CultureInfo.CreateSpecificCulture("de-DE"),
CultureInfo.CreateSpecificCulture("it-IT"),
CultureInfo.CreateSpecificCulture("nl-NL")
};

foreach (CultureInfo locale in locales)
{
Console.WriteLine(newYearsDay.ToString("D", locale));
}

Display the current date and time

Create a Date object representing the current date and time. Print it out.
If you can also do this without creating a Date object you can show that too.
ruby
puts DateTime.now
cpp
QDate now = QDate::currentData();
qDebug() << now.toString();
time_t date = time(0);
cout << ctime(&date);
fsharp
printfn "%A" System.DateTime.Now
erlang
io:format("~p~n", [calendar:local_time()])
csharp
// Creating a variable first:
DateTime now = DateTime.Now;
Console.WriteLine(now);

// Without creating a variable:
Console.WriteLine(DateTime.Now);
haskell
import System.Time

main = do ct <- getClockTime
print ct
import Data.Time

main = do zt <- getZonedTime
print zt
OOP

Define a class

Declare a class named Greeter that takes a string on creation and greets using this string if you call the "greet" method.
ruby
class Greeter
def initialize(whom) @whom = whom end
def greet() puts "Hello, #{@whom}!" end
end

(Greeter.new("world")).greet()
cpp
class Greeter
{
public:
Greeter(const std::string& whom);
void greet() const;

private:
std::string whom;
};

int main()
{
Greeter* gp = new Greeter("world");
gp->greet();
delete gp;
}

Greeter::Greeter(const std::string& whom) : whom(whom) {}

void Greeter::greet() const
{
std::cout << "Hello, " << whom << std::endl;
}
public ref class Greeter
{
public:
Greeter(String^ whom);
void greet();

private:
initonly String^ whom;
};

int main()
{
(gcnew Greeter(L"world"))->greet();
}

Greeter::Greeter(String^ whom) : whom(whom) {}

void Greeter::greet()
{
Console::WriteLine(L"Hello, {0}", whom);
}
fsharp
type Greeter(whom' : string) =
member this.greet() = printfn "Hello, %s!" whom'

(new Greeter("world")).greet()
type Greeter(whom' : string) =
let whom : string = whom'
member this.greet() = printfn "Hello, %s!" whom

(new Greeter("world")).greet()
type Greeter =
class
val whom : string
new(whom') = { whom = whom' }
member this.greet() = printfn "Hello, %s!" this.whom
end

(new Greeter("world")).greet()
erlang
Greeter = make_greeter("world!"),
Greeter(greet).
csharp
using System;

class Greeter
{
private string name {get;set;}

public void Greet(){
Console.WriteLine("Hello, {0}",name);
}

public Greeter(string name){
this.name = name;
}
}

class Test
{
static void Main()
{
new Greeter("Dante").Greet();
}
}
haskell
data Greeter = Greeter String

class Greets a where
greet :: a -> IO ()

instance Greets Greeter where
greet (Greeter s) = print s

main = greet (Greeter "Hello")

Instantiate object with mutable state

Reimplement the Greeter class so that the 'whom' property or data member remains private but is mutable, and is provided with getter and setter methods. Invoke the setter to change the greetee, invoke 'greet', then use the getter in displaying the line, "I have just greeted {whom}.".

For example, if the greetee is changed to 'Tommy' using the setter, the 'greet' method would display:

Hello, Tommy!

The getter would then be used to display the line:

I have just greeted Tommy.
ruby
class Greeter
attr_accessor :whom
def initialize(whom) @whom = whom end
def greet() puts "Hello, #{@whom}!" end
end

greeter = Greeter.new("world") ; greeter.greet()

greeter.whom = 'Tommy' ; greeter.greet()
puts "I have just greeted %s" % greeter.whom
cpp
#include <iostream>

using namespace std;

class Greeter {
string whom_;

public:
Greeter(const string &whom) : whom_(whom) {}

string get_whom() const {
return whom_;
}

void set_whom(const string &whom) {
whom_ = whom;
}

void greet() const {
cout << "Hello " << whom_ << "!" << endl;
}
};

int main()
{
Greeter greeter("world");
greeter.greet();
greeter.set_whom("Tommy");
greeter.greet();
cout << "I have just greeted " + greeter.get_whom() << "." << endl;
}
fsharp
type Greeter(name:string) =
let mutable whom = name

member this.Whom
with get () = whom
and set v = whom <- v

member this.Greet() =
printfn "Hello, %s!" whom

let greeter = Greeter("World")
greeter.Greet()
greeter.Whom <- "Tommy"
greeter.Greet()
printfn "I have just greeted %s." greeter.Whom
csharp
class Greeter
{
public string Name {get;set;}

public void Greet(){
Console.WriteLine("Hello, {0}",Name);
}

public Greeter(string name){
this.Name = name;
}

// Driver
public static void Main()
{
var g = new Greeter("Dante");

g.Name = "Tommy";
g.Greet();
Console.Write("I have just greated {0}", g.Name);
}
}
haskell
data Greeter = G { greeting :: String, greetee :: String }

class Greets a where
greet :: a -> IO ()

instance Greets Greeter where
greet g = print (greeting g)

main = do
let g = G { greeting = "Hello", greetee = "{whom}" }
greet g
print $ "I have just greeted " ++ greetee g { greetee = "Tommy" }

Implement Inheritance Heirarchy

Implement a Shape abstract class which will form the base of an inheritance hierarchy that models 2D geometric shapes. It will have:

* A non-mutable 'name' property or data member set by derived or descendant classes at construction time
* A 'area' method intended to be overridden by derived or descendant classes ( double precision floating point return value)
* A 'print' method (also for overriding) will display the shape's name, area, and all shape-specific values

Two derived or descendant classes will be created:
* Circle    -> Constructor requires a '
radius' argument, and a 'circumference' method to be implemented  
* Rectangle -> Constructor requires '
length' and 'breadth' arguments, and a 'perimeter' method to be implemented 

Instantiate an object of each class, and invoke each objects '
print' method to show relevant details.
ruby
class Shape
def initialize(name="") @name = name end
end

class Circle < Shape
def initialize(radius) super("circle") ; @radius = radius end

def area() 3.14159 * @radius * @radius end
def circumference() 2 * 3.14159 * @radius end

def print()
puts "I am a #{@name} with ->"
puts "Radius: %.2f" % @radius
puts "Area: %.2f" % self.area()
puts "Circumference: %.2f\n" % self.circumference()
end

end

class Rectangle < Shape
def initialize(length, breadth) super("rectangle") ; @length = length ; @breadth = breadth end

def area() @length * @breadth end
def perimeter() 2 * @length + 2 * @breadth end

def print()
puts "I am a #{@name} with ->"
printf("Length, Width: %.2f, %.2f\n", @length, @breadth)
puts "Area: %.2f" % self.area()
puts "Perimeter: %.2f\n" % self.perimeter()
end
end

# ------

shapes = [Circle.new(4.2), Rectangle.new(2.7, 3.1), Rectangle.new(6.2, 2.6), Circle.new(17.3)]
shapes.each {|shape| shape.print}

cpp
#include <string>
#include <iostream>

using namespace std;

static const double PI = 3.141592;

class Shape {
protected:
string name_;
public:
Shape(const string& name) : name_(name) { }
virtual double area() const = 0;
virtual void print() const = 0;
};

class Circle : public Shape {
double radius_;
public:
Circle(double radius) : Shape("circle"), radius_(radius) { }
double area() const {
return PI * radius_ * radius_;
}
void print() const {
cout << "A " << name_ << " with radius " << radius_ << ", area "
<< area() << " and circumference " << circumference() << "."
<< endl;
}
double circumference() const {
return 2 * PI * radius_;
}
};

class Rectangle : public Shape {
double length_;
double breadth_;
public:
Rectangle(double length, double breadth) :
Shape("rectangle"), length_(length), breadth_(breadth) { }
double area() const {
return length_ * breadth_;
}
void print() const {
cout << "A " << name_ << " with length " << length_ << ", breadth "
<< breadth_ << ", area " << area() << " and perimeter "
<< perimeter() << "." << endl;
}
double perimeter() const {
return 2 * length_ + 2 * breadth_;
}
};

int main(int argc, char *argv[])
{
Circle circle(4);
circle.print();
Rectangle rectangle(2, 5.5);
rectangle.print();
}
fsharp
[<AbstractClass>]
type Shape(name:string) =
member this.Name = name
abstract Area : float
abstract Print : unit -> unit

type Circle(name, radius:float) =
inherit Shape(name)
member this.Radius = radius
member this.Circumference =
System.Math.PI * radius * 2.
override this.Area =
System.Math.PI * radius * radius
override this.Print() =
printfn "Circle: %s" this.Name
printfn "Area: %f" this.Area
printfn "Circumference: %f" this.Circumference
printfn "Radius: %f" this.Radius

type Rectangle(name, length:float, breadth:float) =
inherit Shape(name)
member this.Length = length
member this.Breadth = breadth
member this.Perimiter =
(length * 2.) + (breadth * 2.)
override this.Area =
length * breadth
override this.Print() =
printfn "Rectangle: %s" this.Name
printfn "Area: %f" this.Area
printfn "Perimiter: %f" this.Perimiter
printfn "Length: %f" this.Length
printfn "Breadth: %f" this.Breadth

let c = Circle("Foo", 2.1)
let r = Rectangle("Bar", 2.2, 3.3)

c.Print()
printfn ""
r.Print()
csharp
// While abstract classes do exist in C#, it is most common to use
// an interface in this type of situation.
// It is a common idiom to prefix interface names with an I
public interface IShape {
string Name { get; }
double Area { get; }
void Print();
}

public class Circle : IShape {

private double Radius { get; set; }
public Circle(double radius) {
Name = "Circle";
Radius = radius;
}

public string Name { get; private set; }
public double Area {
get {
return Math.PI * Radius * Radius;
}
}
public double Circumference {
get {
return Math.PI * (Radius + Radius);
}
}

public void Print() {
Console.WriteLine( " Name: {0}\n Area: {1}\n Circumference: {2}\n Radius: {3}",
this.Name,
this.Area,
this.Circumference,
this.Radius
);
}
}

public class Rectangle : IShape {

private double Length { get; set; }
private double Breadth { get; set; }
public Rectangle(double length, double breadth) {
Name = "Rectangle";
Length = length;
Breadth = breadth;
}

public string Name { get; private set; }
public double Area {
get {
return Length * Breadth;
}
}
public double Perimeter {
get {
return (Length * 2) + (Breadth * 2 );
}
}

public void Print() {
Console.WriteLine( " Name: {0}\n Area: {1}\n Perimeter: {2}\n Length: {3}\n Breadth: {4}",
this.Name,
this.Area,
this.Perimeter,
this.Length,
this.Breadth
);
}
}

// Driver
public class InheritanceHeirarchy {
public static void _Main() {
var c = new Circle(2.1);
c.Print();

Console.WriteLine();

var r = new Rectangle(2.2, 3.3);
r.Print();
}
}
haskell
data Circle = C { namec :: String, radius :: Float }
data Rectangle = R { namer :: String, len :: Float, breadth :: Float }

circumference (C _ r) = 2 * pi * r
perimeter (R _ l b) = 2 * (l + b)

class Shape a where
area :: a -> Float
name :: a -> String
println :: a -> IO ()

instance Shape Circle where
area (C _ r) = pi * r * r
println c = print $ namec c ++ " : area = " ++
show (area c) ++ ", radius = " ++
show (radius c)
name (C n _) = n

instance Shape Rectangle where
area (R _ l b) = l * b
println r = print $ namer r ++ " : area = " ++
show (area r) ++ ", length = " ++
show (len r) ++ ", breadth = " ++
show (breadth r)
name (R n _ _) = n

main = do
let c = C { namec = "Circle", radius = 2.34 }
r = R { namer = "Rectangle", len = 3.4, breadth = 2.456 }
println c
println r

Implement and use an Interface

Create a Serializable interface consisting of 'save' and 'restore' methods, each of which:

* Accept a stream or handle or descriptor argument for the source or destination
* Save to destination or restore from source the properties or data members of the implementing class (restrict yourself to the primitive types 'int' and 'string')

Next, create a Person class which has 'name' and 'age' properties or data members and implements this interface. Instantiate a Person object, save it to a serial stream, and instantiate a new Person object by restoring it from the serial stream.
ruby
class Person
def initialize(name, age)
@name, @age = name, age
end
end

tom = Person.new("Tom Bones", 23)

File.open('tommy.dump', 'w+') {|f| f.write(Marshal.dump(tommy)) }
toms_clone = Marshal.load(File.read('tommy.dump'))
cpp
struct person
{
person(){}
person(const string &name, int age) : name_(name), age_(age) {}

string name_;
int age_;

template<typename Archive>
void serialize(Archive &ar, const unsigned int version) {
ar & name_ & age_;
}
};


int main()
{
const char *fn = "filename.txt";

person k("Ken", 38);
{
ofstream ofs(fn);
archive::text_oarchive oa(ofs);
oa << k;
}

person restored_person;
{
ifstream ifs(fn);
archive::text_iarchive ia(ifs);
ia >> restored_person;
}

cout << "Name : " << restored_person.name_ << endl
<< "Age : " << restored_person.age_ << endl;
}
fsharp
// Since everyone else is using built-in functionality instead of
// defining an interface as required, I won't buck the trend.
// Maybe this problem should be named "Use serialization features" instead
// of "Implement and use an Interface"

open System
open System.IO
open System.Runtime.Serialization.Formatters.Binary

[<Serializable>]
type Person(name:string, age:int) =
member this.Name = name
member this.Age = age

let serialize x =
use ms = new MemoryStream()
let bf = new BinaryFormatter()
bf.Serialize(ms, x)
ms.ToArray()

let deserialize<'a> bytes =
use ms = new MemoryStream(bytes:byte[])
let bf = new BinaryFormatter()
bf.Deserialize(ms) :?> 'a

let before = Person("Joel", 35)
let bytes = serialize before
let after = deserialize<Person> bytes

printfn "Before: %s, %i" before.Name before.Age
printfn "After: %s, %i" after.Name after.Age
haskell
import Data.Binary
import Control.Monad (liftM2)

data People = People { name :: String, age :: Integer }
deriving (Eq, Show)

class Serializable a where
save :: FilePath -> a -> IO ()
restore :: FilePath -> IO a

instance Serializable People where
save = encodeFile
restore = decodeFile

instance Binary People where
put (People n a) = put n >> put a
get = liftM2 People get get

main = do let fp = "people.dat"
p = People { name = "Joe", age = 24 }
save fp p
p' <- restore fp
print (p' :: People)

Check your language appears on the langref.org site

Your language name should appear within the HTML found at the http://langreg.org main page.
ruby
Net::HTTP.start(URL, 80) do |http|
status = if http.get('/').body =~ /#{SRCHEXP}/ then "offers" else "does not offer" end
puts "http:\/\/#{URL} #{status} #{LANGUAGE}"
end
cpp
HttpWebRequest^ httpReq = safe_cast<HttpWebRequest^>(WebRequest::Create(url)); httpReq->KeepAlive = false;
StreamReader^ httpStream = gcnew StreamReader(httpReq->GetResponse()->GetResponseStream());
String^ htmlPage = httpStream->ReadToEnd(); httpStream->Close();

Console::WriteLine("{0} {1} {2}", url, (htmlPage->IndexOf(url + language) > 0 ? "offers" : "does not offer"), language);
fsharp
let httpReq = (WebRequest.Create(url) :?> HttpWebRequest)
httpReq.KeepAlive <- false
let httpStream = new StreamReader(httpReq.GetResponse().GetResponseStream())
let htmlPage = httpStream.ReadToEnd()
httpStream.Close()

let offerStatus = (if (htmlPage.IndexOf(url ^ language) > 0) then "offers" ; else "does not offer")
Console.WriteLine("{0} {1} {2}", url, offerStatus, language)
erlang
URL = "http://langref.org/", Language = "erlang", Regexp = ".*" ++ URL ++ Language ++ ".*",

case http:request(URL) of
{ok, {_, _, Body}} ->
case regexp:first_match(Body, Regexp) of
{match, _, _} -> io:format("Language ~s exists @ ~s~n", [Language, URL]);
_ -> false
end;
{error, ErrorInfo} -> throw("Error: " ++ http:format_error(ErrorInfo))
end,

Send an email

Use library functions, classes or objects to create a short email addressed to your own email address. The subject should be, "Greetings from langref.org", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
ruby
require 'net/smtp'
require 'webrick/utils'

body = <<END_OF_MESSAGE
This is a message from langref.org
END_OF_MESSAGE

SMTPSRV = 'smtp.somewhere.com'
USER = 'me' ; DOMAIN = 'somewhere.com' ; FROM = USER + '@' + DOMAIN
TO = 'dest@somewhereelse.com'
SUBJECT = 'Greetings from langref.org'
DATE = Time.now.rfc2822()
MSGID = '<' + WEBrick::Utils.random_string(21) + '.' + WEBrick::Utils.random_string(21) + '@' + SMTPSRV + '>'

Net::SMTP.start(SMTPSRV, 25) do |smtp|
smtp.open_message_stream(FROM, [TO]) do |msg|
msg.puts "From: #{FROM}"
msg.puts "To: #{TO}"
msg.puts "Subject: #{SUBJECT}"
msg.puts "Date: #{DATE}"
msg.puts "Message-ID: #{MSGID}"
msg.puts
msg.puts body
end
end
fsharp
open System
open System.Net
open System.Net.Mail
open System.Net.Mime

let subject = "Greetings from langref.org"
let from = "username@gmail.com"
let destination = "username@gmail.com"

printfn "Write mail body (press 'Enter' when finished):"
let mutable body = Console.ReadLine()
if body = null || body.Length = 0 then
body <- "Hello World"

let mail = new MailMessage(from, destination, subject, body)

let smtpHost = "smtp.gmail.com"
let clientCredentials = new NetworkCredential("username@gmail.com", "password")
let smtpClient = new SmtpClient(smtpHost,587)
smtpClient.EnableSsl <- true
smtpClient.UseDefaultCredentials <- false
smtpClient.Credentials <- clientCredentials

printfn "Send email? y/n"
match Console.ReadLine() with
| "y" -> smtpClient.Send(mail);mail.Dispose();printfn "email delivered"
| "n" -> smtpClient.Dispose()
| _ -> smtpClient.Dispose()
XML

Process an XML document

Given the XML Document:

<shopping>
  <item name="bread" quantity="3" price="2.50"/>
  <item name="milk" quantity="2" price="3.50"/>
</shopping>

Print out the total cost of the items, e.g. $14.50
ruby
#!/usr/bin/env ruby

# needed to parse xml
require 'rexml/document'

# grab the file
file = File.new('shop.xml')

# load it as an xml document
doc = REXML::Document.new(file)

# initialize the total to 0 as a float
total = 0.0

# cycle through the items
doc.elements.each('shopping/item') do |item|

# add the price to the total
total += item.attributes['price'].to_f
end

# round the total to the nearest 0.01
total = (total*100.0).round/100.0

# pad the output with the proper number of trailing 0's
printf "$%.2f\n", total
cpp
char input[] =
"<shopping>"
" <item name=\"bread\" quantity=\"3\" price=\"2.50\"/>"
" <item name=\"milk\" quantity=\"2\" price=\"3.50\"/>"
"</shopping>";

xml_document<> doc;
doc.parse<0>(input);
xml_node<> *shopping = doc.first_node();

float total_price = 0;
for (xml_node<> *item = shopping->first_node(); item != NULL; item = item->next_sibling())
{
float item_sum = 0;
float val;

if (string(item->name()) != "item")
continue;

for (xml_attribute<> *attr = item->first_attribute(); attr != NULL; attr = attr->next_attribute())
{
string name(attr->name());
if (name == "quantity" || name == "price")
{
stringstream v(attr->value());
v >> val;
if (item_sum)
item_sum *= val;
else
item_sum = val;
}
}
total_price += item_sum;
}

cout.setf(ios::fixed, ios::floatfield);
cout << "Total price is $" << setprecision(2) << total_price << endl;
fsharp
#r @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll"

open System
open System.Xml.Linq
//XElement Helper
let xname sname = XName.Get sname

let xmlsnippet =
let snippet = new XElement(xname "shopping")
//create bread
let bread = new XElement(xname "item")
bread.SetAttributeValue(xname "name","bread")
bread.SetAttributeValue(xname "quantity",3)
bread.SetAttributeValue(xname "price",2.50)
//add bread to snippet
snippet.Add(bread)
//create milk
let milk = new XElement(xname "item")
milk.SetAttributeValue(xname "name","milk")
milk.SetAttributeValue(xname "quantity",2)
milk.SetAttributeValue(xname "price",3.50)
//add milk to snippet
snippet.Add(milk)
snippet

let totalprice (xe: XElement) =
xe.Descendants(xname "item")
|> Seq.map(fun i -> Double.Parse(i.Attribute(xname "price").Value))
|> Seq.fold(fun acc x -> acc + x) 0.0


let xname sname = XName.Get sname
let xattr (elem: XElement) sname = elem.Attribute(xname sname).Value
let xml = XDocument.Load("xml.txt")

let shoppingCost =
xml.Descendants(xname "item")
|> Seq.map (fun i -> Double.Parse(xattr i "quantity"), Double.Parse(xattr i "price"))
|> Seq.sumBy (fun (quantity, price) -> quantity * price)
// Alternative solution that uses XML Navigation, and XPath expressions to ensure that
// the items have the required attributes
let xname sname = XName.Get sname
let xattr (elem: XElement) sname = elem.Attribute(xname sname).Value

let navigator = XPathDocument("xml.txt").CreateNavigator()
let path = XPathExpression.Compile("/shopping/item[@price][@quantity]")
let names = XmlNamespaceManager(navigator.NameTable)
path.SetContext(names)
let shoppingCost =
match path.ReturnType with
| XPathResultType.NodeSet ->
navigator.Select(path)
|> Seq.cast
|> Seq.map (fun (i: XPathNavigator) ->
if i.IsNode then
let elem = XElement.Parse(i.OuterXml)
Double.Parse(xattr elem "quantity"), Double.Parse(xattr elem "price")
else
failwith "Error in expression, expecting to see a node"
)
|> Seq.sumBy (fun (quantity, price) -> quantity * price)
| _ -> failwith "Error in expression, expecting to see a node set"
erlang
-include_lib("xmerl/include/xmerl.hrl").
-export([get_total/1]).

get_total(ShoppingList) ->
{XmlElt, _} = xmerl_scan:string(ShoppingList),
Items = xmerl_xpath:string("/shopping/item", XmlElt),
Total = lists:foldl(fun(Item, Tot) ->
[#xmlAttribute{value = PriceString}] = xmerl_xpath:string("/item/@price", Item),
{Price, _} = string:to_float(PriceString),
[#xmlAttribute{value = QuantityString}] = xmerl_xpath:string("/item/@quantity", Item),
{Quantity, _} = string:to_integer(QuantityString),
Tot + Price*Quantity
end,
0, Items),
io:format("$~.2f~n", [Total]).
csharp
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(
@"<shopping>
<item name='bread' quantity='3' price='2.50'/>
<item name='milk' quantity='2' price='3.50'/>
</shopping>");

string decimalSeparator= System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator;

double sum=0;

foreach(System.Xml.XmlNode nodo in doc.SelectNodes("/shopping/item")){
sum += int.Parse(nodo.Attributes["quantity"].InnerText) * double.Parse(nodo.Attributes["price"].InnerText.Replace(".",decimalSeparator));
}
Console.WriteLine("{0:#.00}",sum);
haskell
File Edit Options Buffers Tools Haskell Help
import Text.ParserCombinators.Parsec
import Control.Monad
import System ( getArgs )

data Item = Item { name :: String,
quantity :: Int,
price :: Int }
deriving Show

type Basket = [Item]

item :: Parser Item
item = do string "<item name=\""
name <- manyTill letter (char '\"')
string " quantity=\""
quantity <- liftM read $ many digit
string "\" price=\""
dollars <- liftM read $ many digit
cents <- option 0 (char '.' >> (liftM read $ many digit))
string "\"/>"
return $ Item name quantity (100 * dollars + cents)

basket :: Parser Basket
basket = do string "<shopping>"
items <- manyTill item (try $ string "</shopping>")
return items

parseBasket :: String -> Basket
parseBasket input = case parse basket "Shopping Basket" input of
Left _ -> []
Right val -> val

main = do args <- getArgs
putStrLn $ show . (/100) . fromIntegral . sum . map (\(Item _ q p) -> q * p) . parseBasket $ head args
import Text.XML.HXT.Core
import Text.Printf

main :: IO ()
main = do
prices <- runX (process "basket.xml")
printf "$%.2f\n" $ sum prices

process :: FilePath -> IOSArrow XmlTree Double
process filename =
readDocument [withValidate no] filename >>>
getChildren >>>
isElem >>> hasName "shopping" >>>
getChildren >>>
isElem >>> hasName "item" >>>
getQuantity &&& getPrice >>>
arr (uncurry (*))

getQuantity :: IOSArrow XmlTree Double
getQuantity =
getAttrl >>> hasName "quantity" >>> getChildren >>>
getText >>> arr read

getPrice :: IOSArrow XmlTree Double
getPrice =
getAttrl >>> hasName "price" >>> getChildren >>>
getText >>> arr read

create some XML programmatically

Given the following CSV:

bread,3,2.50
milk,2,3.50

Produce the equivalent information in XML, e.g.:

<shopping>
  <item name="bread" quantity="3" price="2.50" />
  <item name="milk" quantity="2" price="3.50" />
</shopping>
ruby
# gem install builder
require 'builder'

xml = Builder::XmlMarkup.new
xml.shopping do
xml.item(:name => "bread", :quantity => 3, :price => "2.50")
xml.item(:name => "milk", :quantity => 2, :price => "3.50")
end
xml
cpp
string input("bread,3,2.50\nmilk,2,3.50\n");

tokenizer<char_separator<char> > tokens(input, char_separator<char>(", \n"));
tokenizer<char_separator<char> >::iterator it = tokens.begin();

xml_document<> doc;
xml_node<> *shopping = doc.allocate_node(node_element, "shopping");
doc.append_node(shopping);

while (it != tokens.end()) {
xml_node<> *item = doc.allocate_node(node_element, "item");
shopping->append_node(item);

item->append_attribute(doc.allocate_attribute("name", doc.allocate_string((*it++).c_str())));
item->append_attribute(doc.allocate_attribute("quantity", doc.allocate_string((*it++).c_str())));
item->append_attribute(doc.allocate_attribute("price", doc.allocate_string((*it++).c_str())));
}

cout << doc << endl;
fsharp
#r "System.Xml.dll"
#r "System.Xml.Linq.dll"

open System
open System.Xml
open System.Xml.Linq

let data = "bread,3,2.50
milk,2,3.50"

let X name =
XName.Get(name)

let lines = data.Split( [|"\n" |], StringSplitOptions.RemoveEmptyEntries)

let document = new XDocument()
let element = new XElement(X "shopping")
document.Add(element)

lines
|> Seq.iter (fun line ->
let items = line.Split([|','|])
let item = new XElement(X "item",
new XAttribute(X "name", items.[0]),
new XAttribute(X "quantity", items.[1]),
new XAttribute(X "price", items.[2]))
element.Add(item))

let output = document.ToString();;
erlang
to_xml(ShoppingList) ->
Items = lists:map(fun(L) ->
[Name, Quantity, Price] = string:tokens(L, ","),
{item, [{name, Name}, {quantity, Quantity}, {price, Price}], []}
end, string:tokens(ShoppingList, "\n")),
xmerl:export_simple([{shopping, [], Items}], xmerl_xml).
csharp
string cvs ="bread,3,2.50\nmilk,2,3.50";
IList<string> rows = cvs.Split('\n');

System.Text.StringBuilder sb = new System.Text.StringBuilder("<shopping>");
foreach(string row in rows){
IList<string> data = row.Split(',');
sb.AppendFormat("<item name='{0}' quantity='{1}' price='{2}' />",data[0],data[1],data[2]);
}
sb.Append("</shopping>");

Find all Pythagorean triangles with length or height less than or equal to 20

Pythagorean triangles are right angle triangles whose sides comply with the following equation:

a * a + b * b = c * c

where c represents the length of the hypotenuse, and a and b represent the lengths of the other two sides. Find all such triangles where a, b and c are non-zero integers with a and b less than or equal to 20. Sort your results by the size of the hypotenuse. The expected answer is:

[3, 4, 5]
[6, 8, 10]
[5, 12, 13]
[9, 12, 15]
[8, 15, 17]
[12, 16, 20]
[15, 20, 25]
ruby
results=[]

1.upto(20) do |a|
1.upto(20) do |b|
c=Math.sqrt(a**2+b**2)
results<<[a, b, c.to_i] if c.to_i==c && !results.index([b, a, c.to_i])
end
end

results=results.sort_by{|r| r[2]}

puts results
def find_pythag( max=20 )
r = []
1.upto max do |n|
n.upto max do |m|
h = Math.sqrt( n**2 + m**2)
r << [n,m,h.to_i] if (h.round - h).zero?
end
end
r.sort_by { |a| a[2] }
end
cpp
vector<solution> solutions;

for (int a = 1; a <= 20; ++a)
for (int b = a + 1; b <= 20; ++b)
{
int c_squared = a*a + b*b;
int c = b + 1;
while (c * c < c_squared)
++c;
if (c * c == c_squared)
solutions.push_back(make_tuple(a, b, c));
}

sort(begin(solutions), end(solutions),
[](const solution& s1, const solution& s2) { return get<2>(s1) < get<2>(s2); });

for (const auto &s: solutions)
cout << '[' << get<0>(s) << ", " << get<1>(s) << ", " << get<2>(s) << ']' << endl;
fsharp
let getGoodTri (a,b) =
let h = int(System.Math.Sqrt(float(a*a + b*b)))
if a*a + b*b = h*h then Some(a,b,h)
else None

seq{ for i in 1..20 do yield! seq{for j in i..20 do yield i,j} } |> Seq.choose(getGoodTri) |> Seq.sortBy(fun (_,_,c) -> c);;
erlang
find_all_pythagorean_triangles(L) ->
lists:sort(fun({_, _, H1}, {_, _, H2}) -> H1 =< H2 end,
[ { X, Y, Z } ||
X <- lists:seq(1,L),
Y <- lists:seq(1,L),
Z <- lists:seq(1,2*L),
X*X + Y*Y =:= Z*Z,
Y > X,
Z > Y
]).

main(_) ->
List = find_all_pythagorean_triangles(20).
haskell
import Data.List
import Control.Monad

pythTriangles :: [(Int,Int,Int)]
pythTriangles = do
a <- [1..20]
b <- [a+1..20]
c <- [1..2*b]
guard (a*a + b*b == c*c)
return (a,b,c)

cmpThird (_,_,a) (_,_,b)
| a < b = LT
| a == b = EQ
| otherwise = GT

main = mapM_ print (sortBy cmpThird pythTriangles)
import Data.Function
import Data.List

pythTriangles =
[(a,b,c) | a <- [1..20], b <- [a+1..20], c <- [1..2*b], a*a + b*b == c*c]

main = mapM_ print $ sortBy (compare `on` third) pythTriangles where
third (_,_,x) = x

Greatest Common Divisor

Find the largest positive integer that divides two given numbers without a remainder. For example, the GCD of 8 and 12 is 4.

ruby
135.gcd(30)
# => 15
cpp
#include <iostream>
#include <cstdlib>
#include <algorithm>

using namespace std;

int gcd_recursive(int i, int j) {
if (min(i, j) == 0)
return max(i, j);
else
return gcd_recursive(min(i, j), abs(i - j));
}

int gcd_recursive2(int x, int y) {
if (y == 0)
return x;
else
return gcd_recursive2(y, (x % y));
}

int gcd_iterative(int i, int j) {
while (min(i, j) != 0) {
i = min(i, j);
j = abs(i - j);
}
return max(i, j);
}

int main() {
std::cout << gcd_recursive(8, 12) << std::endl;
std::cout << gcd_recursive2(8, 12) << std::endl;
std::cout << gcd_iterative(8, 12) << std::endl;
return 0;
}
fsharp
let rec gcd x y =
if y = 0 then x
else gcd y (x % y)
erlang
-module(gcd).
-export([gcd/2]).

gcd(A, 0) -> A;
gcd(A, B) -> gcd(B, A rem B).
csharp
public static int gcd(int a, int b)
{
if (b == 0)
return a;
else
return gcd(b, a % b);
}
haskell
8 `gcd` 12
Fun

produces a copy of its own source code

In computing, a quine is a computer program which produces a copy of its own source code as its only output.
ruby
eval s=%q(puts"eval s=%q(#{s})")
x="x=%p;puts x%%x";puts x%x
cpp
#include <cstdio>
#define B(x) x; printf("{ B(" #x ") }\n");
int main()
{ B(printf("#include <cstdio>\n#define B(x) x; printf(\"{ B(\" #x \") }\\n\");\nint main()\n")) }
fsharp
(fun s -> printf "%s %s" s s) "(fun s -> printf \"%s %s\" s s)"
haskell
main = putStr (s ++ [';',' ','s',' ','=',' '] ++ show s); s = "main = putStr (s ++ [';',' ','s',' ','=',' '] ++ show s)
main = (\s -> putStrLn (s ++ show s)) "main = (\\s -> putStrln (s ++ show s)) "

Subdivide A Problem To A Pool Of Workers (No Shared Data)

Take a hard to compute problem and split it up between multiple worker threads. In your solution, try to fully utilize available cores or processors. (I'm looking at you, Python!)

Note: In this question, there should be no need for shared state between worker threads while the problem is being solved. Only after every thread completes computation are the answers recombined into a single output.

Example:

-Input-

(In python syntax)

["ab", "we", "tfe", "aoj"]

In other words, a list of random strings.

-Output-

(In python syntax)

[ ["ab", "ba", "aa", "bb", "a", "b"], ["we", "ew", "ww", "ee", "w", "e"], ...

In other words, all possible permutations of each input string are computed.
ruby
array, threads, answers = ["ab", "we", "tfe", "aoj"], [], []
array.each { |word|
threads << Thread.new(word.split '' ) do |x|
answer = []
x.each { |a|
answer << a
x.each { |b| answer << [a, b].join }
}
answers << answer
end
}
threads.each {|thr| thr.join}
answers
cpp
vector<string> input;
input.push_back("ab");
input.push_back("we");
input.push_back("tfe");
input.push_back("aoj");

// Make the capacity for 'output' the same as 'input'
vector<set<string> > output(input.size());
#pragma omp parallel for
for (int i = 0; i < input.size(); ++i) {
set<string> perms;
generate_perms(input[i], perms);
#pragma omp critical
// Must use operator[]() and not push_back() since this line
// might be called in any order with respect to 'i'
output[i] = perms;
}

cout << output << endl;
fsharp
open System
let input = [| "ab"; "we"; "tfe"; "aoj" |]

/// Computes all permutations of an array
let rec permute = function
| [| |] -> [| [| |] |]
| a ->
a
|> Array.mapi (fun i ai ->
// Take all elements in the array apart from the i.th, compute
// their permutations, then attach element i at the front of each perm
Array.sub a 0 i
|> Array.append (Array.sub a (i + 1) (a.Length - i - 1))
|> permute
|> Array.map (fun perm -> Array.append [| ai |] perm)
)
|> Array.concat

/// Computes all permutations of a string
let permuteString (s: string) =
s.ToCharArray()
|> permute
|> Array.map (fun p -> new String(p))

let output =
input
|> Array.map (fun word -> async { return (permuteString word) })
|> Async.Parallel
|> Async.RunSynchronously
// like the Java and Groovy solutions, does not duplicate letters
open System
open System.Threading.Tasks

let input = [| "ab"; "we"; "tfe"; "aoj" |]

let factorial n =
seq { 1 .. n } |> Seq.reduce (*)

let swap (arr:'a[]) i j =
[| for k = 0 to arr.Length - 1 do
yield if k = i then arr.[j] elif k = j then arr.[i] else arr.[k] |]

let rec permutation (k:int,j:int) (r:'a[]) =
if j = (r.Length + 1) then r
else permutation (k/j+1, j+1) (swap r (j-1) (k%j))

let permutations (source:'a[]) = seq {
for k = 0 to (factorial source.Length) - 1 do
yield permutation (k,2) source
}

let permute (word:string) =
let letters = word.ToCharArray()
permutations letters
|> Seq.map (fun chars -> String(chars))
|> Array.ofSeq

let tasks =
input |> Array.map (fun word -> Task.Factory.StartNew(fun () -> permute word))

let taskResult (t:Task<_>) =
t.Result

let output = Task.Factory.ContinueWhenAll(tasks, fun ts -> Array.map taskResult ts).Result
haskell
import Control.Parallel
import Control.Parallel.Strategies

allPerms xs = do
x <- [1 .. length xs]
sequence (replicate x xs)

result = parMap rdeepseq allPerms ["ab", "we", "tfe", "aoj"]

main = print $ concat result

{-
Compile with -threaded
-}

Subdivide A Problem To A Pool Of Workers (Shared Data)

Take a hard to compute problem and split it up between multiple worker threads. In your solution, try to fully utilize available cores or processors. (I'm looking at you, Python!)

Note: In this question, there should be a need for shared state between worker threads while the problem is being solved.

Example:

-Conway Game of Life-

From Wikipedia:

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbors, which are the cells that are directly horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
2. Any live cell with more than three live neighbours dies, as if by overcrowding.
3. Any live cell with two or three live neighbours lives on to the next generation.
4. Any dead cell with exactly three live neighbours becomes a live cell.

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths happen simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the one before). The rules continue to be applied repeatedly to create further generations.


--However, for our purposes, we will assign a size to the game "board": 2^k * 2^k . That is, the board should be easy to subdivide.

Notice that in this problem, at each step or "tick", each thread/process will need to share data with its neighborhood.
fsharp
/// Represents a single cell, along with the basic transition rule
type State =
| Alive
| Dead
member this.Transition numLiveNeighbors =
match this with
| Alive when numLiveNeighbors < 2 -> Dead
| Alive when numLiveNeighbors > 3 -> Dead
| Alive -> Alive
| Dead when numLiveNeighbors = 3 -> Alive
| _ -> Dead
member this.ToChar() =
match this with
| Alive -> '*'
| Dead -> ' '
static member OfChar = function
| ' ' -> Dead
| _ -> Alive

type Board (board: State[,]) =
member this.Item
with get(i,j) = board.[i,j]
and set (i,j) v = board.[i,j] <- v
member this.Length1 = Array2D.length1 board
member this.Length2 = Array2D.length2 board
member this.CountLiveNeighbors(i, j) =
[| (-1,-1); (-1,0); (-1,1); (0,-1); (0,1); (1,-1); (1,0); (1,1) |]
|> Array.sumBy (fun (di,dj) ->
if (i + di) > 0 && (i + di) < this.Length1 && (j+dj) > 0 && (j+dj) < this.Length2 then
match board.[i+di,j+dj] with
| Alive -> 1
| _ -> 0
else
0
)
member this.Clone() = Board(Array2D.copy board)
override this.ToString() =
[|
for i in 0 .. this.Length1 - 1 do
let l = [| for j in 0 .. this.Length2 - 1 do yield board.[i,j].ToChar() |]
yield new String(l)
|]
|> String.concat ("\n")
static member OfString (s: string) =
let states =
s.Split('\n')
|> Array.map (fun line -> line.ToCharArray() |> Array.map State.OfChar)
Board (Array2D.init states.Length states.[0].Length (fun i j -> states.[i].[j]))
static member Update (inboard: Board) =
let outboard = inboard.Clone()
let Worker (i1,i2,j1,j2) =
for i in i1 .. i2 do
for j in j1 .. j2 do
outboard.[i,j] <-
inboard.CountLiveNeighbors(i, j)
|> inboard.[i,j].Transition
let N1 = inboard.Length1 / 2
let N2 = inboard.Length2 / 2
[| (0,N1,0,N2); (N1+1,inboard.Length1-1,0,N2); (0,N1,N2+1,inboard.Length2-1); (N1+1,inboard.Length1-1,N2+1,inboard.Length2-1) |]
|> Array.map (fun bounds -> async { Worker bounds})
|> Async.Parallel
|> Async.RunSynchronously
|> ignore
outboard

let blinker = " \n * \n * \n * \n " |> Board.OfString

do
let after1cycles =
blinker
|> Board.Update
let after3cycles =
after1cycles
|> Board.Update
|> Board.Update
printfn "%s" (after3cycles.ToString())

Create a multithreaded "Hello World"

Create a program which outputs the string "Hello World" to the console, multiple times, using separate threads or processes.

Example:

-Output-

Thread one says Hello World!
Thread two says Hello World!
Thread four says Hello World!
Thread three says Hello World!

-Notice that the threads can print in any order.
ruby
%w[one two three four].each do |number|
Thread.new(number) { |number|
puts "Thread #{number} says Hello World!"
}.join
end
cpp
#include <iostream>
#include <string>

using namespace std;

int main(){
int pid;
string text[4]={"one","two","three","four"};
for (int i=0;i<4;i++){
pid=fork();
if (pid>0){
//cout << "Process("<<pid<<") - " << "Thread " << text[i] << " says Hello World!" << endl;
cout << "Thread " << text[i] << " says Hello World!" << endl;
exit(0);
}
}
return 0;
}
#include <iostream>
#include <string>

#include <omp.h>

int main() {
unsigned int const num_threads = 4;

std::string const names[] = { "one", "two", "three", "four" };

# pragma omp parallel num_threads(num_threads)
{
unsigned const id = omp_get_thread_num();
// Stream concatenation isn't thread-safe so we use a critical section.
# pragma omp critical
std::cout << "Thread " << names[id] << " says Hello World!" << std::endl;
}
}
fsharp
let mappedString =
["Thread one says Hello World!";
"Thread two says Hello World!";
"Thread four says Hello World!";
"Thread three says Hello World!"]
|> Seq.map (fun str -> async { printfn "%s" str })

Async.RunSynchronously (Async.Parallel mappedString)
erlang
-module(spam).
-export([spam/1]).

spam(N) when N<5 ->
spawn(fun() -> io:format("Hello World from thread ~p~n",[N]) end),
spam(N+1);
spam(_) -> void.
haskell
mapM_ (\x -> forkIO (putStrLn ("Thread " ++ x ++ " says Hello World!"))) ["one", "two", "three", "four"]

Create read/write lock on a shared resource.

Create multiple threads or processes who are either readers or writers. There should be more readers then writers.

(From Wikipedia):

Multiple readers can read the data in parallel but an exclusive lock is needed while writing the data. When a writer is writing the data, readers will be blocked until the writer is finished writing.

Example:

-Output-

Thread one says that the value is 8.
Thread three says that the value is 8.
Thread two is taking the lock.
Thread four tried to read the value, but could not.
Thread five tried to write to the value, but could not.
Thread two is changing the value to 9.
Thread two is releasing the lock.
Thread four says that the value is 9.
...

--Notice that when a needed resource is locked, a thread can set a timer and try again in the future, or wait to be notified that the resource is no longer locked.
cpp
class reader
{
string name_;
public:
reader(const string& name) : name_(name) {}

void operator()() {
for (;;this_thread::sleep(posix_time::milliseconds(1)))
{
shared_lock<shared_mutex> lock(m, try_to_lock);
lock_guard<mutex> cout_lock(io_m);
cout << "Thread " << name_;
if (lock)
cout << " says that the value is " << shared_value << "." << endl;
else
cout << " tried to read the value, but could not." << endl;
}
}
};

class writer
{
string name_;
public:
writer(const string& name) : name_(name) {}
void operator()() {
for (;;this_thread::sleep(posix_time::milliseconds(1)))
{
unique_lock<shared_mutex> lock(m, try_to_lock);
lock_guard<mutex> cout_lock(io_m);
cout << "Thread " << name_;
if (lock)
{
cout << " is taking the lock." << endl;
shared_value = rand() % 10;
cout << "Thread " << name_ << " is changing the value to " << shared_value << endl;
cout << "Thread " << name_ << " is releasing the lock. " << endl;
}
else
cout << " tried to write to the value, but could not." << endl;
}
}
};

int main()
{
thread t1 = thread(reader("one"));
thread t2 = thread(reader("two"));
thread t3 = thread(reader("three"));
thread t4 = thread(writer("four"));
writer("five")();
}
fsharp
open System.Threading
let lock = new ReaderWriterLock()
let mutable value = 0
let lockTimeout = 1

let ReaderThread t =
let random = new System.Random()
for i in 0 .. 100 do
try
lock.AcquireReaderLock(lockTimeout)
try
printfn "Thread %i says that the value is %i" t value
finally
lock.ReleaseReaderLock()
with _ ->
printfn "Thread %i tried to read the value, but could not (timeout)." t
Thread.Sleep(random.Next(50))

let WriterThread t =
let random = new System.Random()
for i in 0 .. 100 do
try
lock.AcquireWriterLock(lockTimeout)
try
value <- random.Next(10)
printfn "Thread %i is changing the value to %i" t value
Thread.MemoryBarrier()
finally
lock.ReleaseWriterLock()
printfn "Thread %i is releasing the lock." t
with _ ->
printfn "Thread %i tried to write the value, but could not (timeout)." t
Thread.Sleep(random.Next(50))

[| 0 .. 20 |]
|> Array.iter (fun t ->
async {
if t % 3 = 0 then
WriterThread t
else
ReaderThread t
}
|> Async.Start
)

Separate user interaction and computation.

Allow your program to accept user interaction while conducting a long running computation.

Example:

Hello user! Please input a string to permute: (input thread)
abcdef
Passing on abcdef... (input thread)
Please input another string to permute: (input thread)
lol
Passing on lol... (input thread)
Done Work On abcdef! (worker thread)
["abcdef", "abcefd", ... ] (worker thread)
Please input another string to permute: (input thread)
EXIT
Quitting, I'll let my worker thread know... (input thread)
We'
re quitting! Alright! (worker thread)

--Notice, that this could be accomplished on the command line or within a GUI. The point is that computation and user interaction should take place on separate threads of control.
cpp
class bg_worker
{
mutex bg_mutex_;
condition_variable work_present_;
deque<string> work_queue_;

result calc_perm(string s) {
result perms = result(new list<string>());

// sleep to simulate lots of work...
this_thread::sleep(posix_time::seconds(3));
sort(s.begin(), s.end());
do {
perms->push_back(s);
} while (next_permutation(s.begin(), s.end()));
return perms;
}

public:
void submit_work(const string &s) {
lock_guard<mutex> lock(bg_mutex_);
work_queue_.push_back(s);
work_present_.notify_one();
}

void operator()() {
for (;;) {
unique_lock<mutex> lock(bg_mutex_);
while (work_queue_.empty())
work_present_.wait(lock);
string s = work_queue_.front();
work_queue_.pop_front();
lock.unlock();

if (s == "EXIT") {
lock_guard<mutex> cout_lock(cout_mutex);
cout << "We're quitting! Alright!" << endl;
break;
}

result perm = calc_perm(s);
lock_guard<mutex> cout_lock(cout_mutex);
cout << "Done Work On " << s << "!" << endl;
cout << perm << endl;
}
}
};

int main()
{
bg_worker worker;
thread bg_thr(boost::ref(worker));
bool done = false;

{
lock_guard<mutex> cout_lock(cout_mutex);
cout << "Hello user! Please input a string to permute:" << endl;
}

while (!done)
{
string input;
cin >> input;
{
lock_guard<mutex> cout_lock(cout_mutex);
if (input == "EXIT") {
cout << "Quitting, I'll let my worker thread know..." << endl;
done = true;
} else {
cout << "Passing on " << input << "..." << endl;
cout << "Please input another string to permute:" << endl;
}
}
worker.submit_work(input);
}

bg_thr.join();
}
fsharp
open System

/// Computes all permutations of an array
let rec permute = function
| [| |] -> [| [| |] |]
| a ->
a
|> Array.mapi (fun i ai ->
Array.sub a 0 i
|> Array.append (Array.sub a (i + 1) (a.Length - i - 1))
|> permute
|> Array.map (fun perm -> Array.append [| ai |] perm)
)
|> Array.concat

/// Computes all permutations of a string
let permuteString (s: string) =
s.ToCharArray()
|> permute
|> Array.map (fun p -> new String(p))


type PermuteMessage =
| PermuteString of string
| Cancel

let mailbox = new MailboxProcessor<PermuteMessage>(fun inbox ->
let rec loop() =
async {
let! msg = inbox.Receive()
match msg with
| PermuteString s ->
printfn "[Worker] Starting to work on %s" s
let p = permuteString s
printfn "[Worker] Done my work on %s" s
let firstElems =
if s.Length > 4 then
let first = p |> Seq.truncate 4 |> Seq.toArray
String.Join(", ", first) + ", ..."
else
String.Join(", ", p)
printfn "[Worker] Result is %s" firstElems
return! loop()
| Cancel ->
printfn "[Worker] Nuff done, I'm quitting!"
return ()
}
loop()
)

do
printfn "[Input] Setting up worker."
mailbox.Start()
let loop = ref true
while !loop do
printfn "[Input] Please enter a word, or EXIT to exit"
let s = Console.ReadLine()
match s with
| "EXIT" ->
printfn "[Input] Sending worker the cancellation notice."
mailbox.Post(Cancel)
loop := false
| _ ->
printfn "[Input] Sending task to the worker."
mailbox.Post(PermuteString s)
180
180

180


Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes <code>[Mall3411]</code> - $175.01 : <<code>/title> <br/><meta http-equiv="Content-Type" content="text/</code>html; charset=utf-8<code>" /> <br/><meta name="</code>keywords<code>" content="</code>Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes <code>[Mall3411]</code> Robes de Mariée Robes de mariée 2012 Robe de mariée sexy Robes de mariée robes Quinceanera Robes de bal Robes de soirée Robes de bal Robes de soirée Robes de cocktail <code>" /> <br/><meta name="</code>description<code>" content="</code> Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes <code>[Mall3411]</code> - Nom de l<code>'article: " /> <br/><meta http-equiv="imagetoolbar" content="no" /> <br/><meta name="author" content="Zen Cart China" /> <br/><meta name="generator" content="Zen Cart, http://www.zen-cart.cn" /> <br/> <br/> <br/><link rel="canonical" href="http://fr.weddingdressescompany.com/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" /> <br/> <br/><link rel="stylesheet" type="text/css" href="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/css/style_imagehover.css" /><br/><link rel="stylesheet" type="text/css" href="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/css/stylesheet.css" /><br/><link rel="stylesheet" type="text/css" href="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/css/stylesheet_css_buttons.css" /><br/><link rel="stylesheet" type="text/css" media="print" href="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/css/print_stylesheet.css" /><br/><br/><br/><br/> <br/><link type="text/css" href="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/css/magiczoomplus.css" rel="stylesheet" media="screen" /> <br/> <br/><br/><br/> <br/> <br/> <br/> <br/> <br/><div id="mainWrapper "> <br/> <br/> <br/> <br/><br/> <br/> <br/><div id="headerWrapper "><div id="lang_main_page" style="padding-top:10px; float:right; "><b>language:</b> <br/> <br/> <a href="http://de.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/gericon.gif" alt="Deutsch" title=" Deutsch " height="15" width="24 "></a>   <br/> <a href="http://fr.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/fricon.gif" alt="Français" title=" Français " height="15" width="24 "></a>   <br/> <a href="http://it.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/iticon.gif" alt="italiano" title=" italiano " height="15" width="24 "></a>   <br/> <a href="http://es.weddingdressescompany.com ">         <br/> <img src="http://fr.weddingdressescompany.com/langimg/esicon.gif" alt="Español" title=" Español " height="15" width="24 "></a>   <br/> <a href="http://pt.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/pticon.gif" alt="Português" title=" Português " height="15" width="24 "></a>   <br/> <a href="http://jp.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/jpicon.gif" alt="日本語" title=" æ—¥æœ¬èªž " height="14" width="24 "></a>   <br/> <a href="http://www.weddingdressescompany.com "> <br/> <img src="http://fr.weddingdressescompany.com/langimg/icon.gif" alt="English" title=" English " height="15" width="24 "></a>   <br/></div> <br/><br/> <br/><div class="topper-menu float-left" style="background:#333333; width:100%; text-align:right; padding:0px; "> <br/> <br/><div id="navEZPagesTop "> <br/> <ul style="list-style-image: none;list-style-type: none; padding:0px; height:28px; line-height:28px;margin-top: 0px; margin-bottom:0px;margin-left:55%; "> <br/> <li><a href="http://fr.weddingdressescompany.com/index.php?main_page=login "><font style="color:#FFFFFF ">My Account</font></a></li> <br/> <li><a href="http://fr.weddingdressescompany.com/index.php?main_page=shopping_cart "><font style="color:#FFFFFF ">View Cart</font></a></li> <br/> <li><a href="http://fr.weddingdressescompany.com/index.php?main_page=login "><font style="color:#FFFFFF ">Checkout</font></a></li> <br/> <br/>   <li> <a href="http://fr.weddingdressescompany.com/index.php?main_page=login "><font style="color:#FFFFFF ">Se connecter</font></a> <br/> <font style="color:#FFFFFF "> HEADER_OR </font> <br/>    <a href="http://fr.weddingdressescompany.com/index.php?main_page=create_account "><font style="color:#FFFFFF ">HEADER_TITLE_REGISTER</font></a></li> <br/> <br/> <br/> <br/> </ul> <br/></div> <br/></div> <br/><div class="clearBoth" /></div> <br/><br/> <br/> <br/> <br/><br/> <br/><br/> <br/> <br/><br/> <br/> <br/><div id="logoWrapper "> <br/><div id="logo"  style="margin-top:5px; margin-bottom:5px; "><a href="http://fr.weddingdressescompany.com/ "><img src="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/images/logo.gif" alt="" width="250" height="73" /></a></div> <br/><div class="td-search-header "> <br/><div class="search-header float-left "> <br/><form name="quick_find_header" action="http://fr.weddingdressescompany.com/index.php?main_page=advanced_search_result" method="get "><input type="hidden" name="main_page" value="advanced_search_result" /><input type="hidden" name="search_in_description" value="1" /><div class="search-header-input"  style="padding-top:10px;padding-bottom:0px; "><input type="text" name="keyword" size="6" maxlength="30" value="Entrez vos mots clefs ici" onfocus="if (this.value == '</code>Entrez vos mots clefs ici<code>') this.value = ';" onblur="if (this.value == ') this.value = '</code>Entrez vos mots clefs ici<code>';" /></div><div style="float:left "><input  style="float:left;width:47px; height:35px;"  type="image" src="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/images/search-bg_02.gif" value="Serch" /></div></form></div> <br/></div> <br/><div style=" float:left; margin-left:10px; height:58px; width:270px; "> <br/><br/> <br/><div style="float:left; padding-top:15px; "> <br/><img src="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/images/shipping.gif"/><a href="http://fr.weddingdressescompany.com/index.php?main_page=shopping_cart "><img src="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/images/cart.gif" style="border:0px;"/></a> <br/></div> <br/><br/> <br/><div style="height:10px; "></div> <br/><div style="padding-top:0px; "> <br/><div style="float:left; width:120px; "><font style=" font-size:0.96em; background:#FFFFFF; color:#000000; ">Choisissez votre devise</font></div> <br/><div style="float:left; width:100px; "> <br/><form name="currencies" action="http://fr.weddingdressescompany.com/" method="get "><select name="currency" onchange="this.form.submit();" style="width: 100% "><br/>  <option value="USD" selected="selected ">US Dollar</option><br/>  <option value="CNY ">CNY</option><br/>  <option value="EUR ">Euro</option><br/>  <option value="GBP ">GB Pound</option><br/>  <option value="CAD ">Canadian Dollar</option><br/>  <option value="AUD ">Australian Dollar</option><br/></select><br/><input type="hidden" name="main_page" value="product_info" /><input type="hidden" name="products_id" value="456" /></form></div> <br/></div> <br/><br/> <br/></div> <br/></div> <br/><div class="clearBoth" /></div> <br/><br/> <br/> <br/><br/> <br/> <br/><br/> <br/><br/> <br/> <br/> <br/><div id="top_nav "> <br/><div id="tab_nav "> <br/><br/> <br/><div class="top-nav-right "></div> <br/><div style=" float:left; "> <br/> <a href="http://fr.weddingdressescompany.com/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" ><img src="http://fr.weddingdressescompany.com/includes/templates/weddingdress-7/images/home.jpg"/></a> <br/></div> <br/><ul class="list-style-none "> <br/><li class="home-link "><a href="http://fr.weddingdressescompany.com/" >TOP_MENU_HOME</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/cocktail-dresses-c-28.html ">Robes de cocktail</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/evening-dresses-c-27.html ">Robes de soirée</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/wedding-dresses-c-1.html ">Robes de mariée</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/prom-dresses-c-24.html ">Robes de bal</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/index.php?main_page=contact_us ">Contactez-nous</a></li> <br/><li id="" ><a href="http://fr.weddingdressescompany.com/javascript:__Bookmark('</code>http:<code>//</code>fr.weddingdressescompany.com<code>/»,«http:/fr.weddingdressescompany.com/</code><code>' ) " > Marque page</a></li> <br/></ul> <br/></div> <br/></div> <br/><hr style="border:2px solid #666666;"/> <br/><br/> <br/><br/> <br/> <br/></div> <br/><br/> <br/><table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper "> <br/><tr> <br/> <br/><td id="navColumnOne" class="columnLeft" style="width:210px "> <br/><div id="navColumnOneWrapper" style="width: 220px" > <br/><div class="leftBoxContainer" id="categories" style="width: 220px "> <br/><div class="sidebox-header-left main-sidebox-header-left "><h3 class="leftBoxHeading main-sidebox-header-right" id="categoriesHeading ">Catégories</h3></div> <br/><div id="categoriesContent" class="sideBoxContent "><br/><div class="categories-top-list no-dots "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-mariée-c-1.html "><span class="category-subs-parent ">Robes de Mariée</span></a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-meilleures-robes-de-mariée-de-vente-c-1_19.html ">MEILLEURES robes de mariée de Vente</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-mini-robes-de-mariée-c-1_11.html ">Mini robes de mariée</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-petites-robes-noires-c-1_13.html ">Petites robes noires</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robe-de-mariée-amie-c-1_3.html ">Robe de mariée amie</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robe-de-mariée-sexy-c-1_30.html ">Robe de mariée sexy</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariage-de-plage-c-1_20.html ">Robes de mariage de plage</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariage-empire-c-1_15.html ">Robes de mariage Empire</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariage-gaine-c-1_6.html ">Robes de mariage gaine</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariage-robe-boule-c-1_21.html ">Robes de mariage robe boule</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-2012-c-1_29.html ">Robes de mariée 2012</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-a-ligne-c-1_22.html ">Robes de mariée A- ligne</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-bustier-c-1_4.html ">Robes de mariée bustier</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-colonne-c-1_17.html ">Robes de mariée Colonne</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-courtes-c-1_5.html ">Robes de Mariée courtes</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-de-couleur-c-1_18.html ">Robes de mariée de Couleur</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-de-princesse-c-1_8.html ">Robes de mariée de princesse</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-designer-c-1_16.html ">Robes de mariée Designer</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-en-dentelle-c-1_14.html ">Robes de mariée en dentelle</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-épaule-c-1_10.html ">Robes de mariée Ã©paule</a></div><br/><div class="subcategory "><a class="category-products" href="http://fr.weddingdressescompany.com/robes-de-mariée-robes-de-mariée-sirène-c-1_12.html ">Robes de Mariée Sirène</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robe-de-mariée-sexy-c-7.html ">Robe de mariée sexy</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-bal-c-26.html ">Robes de bal</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-bal-c-24.html ">Robes de bal</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-cocktail-c-28.html ">Robes de cocktail</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-mariée-c-9.html ">Robes de mariée</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-mariée-2012-c-2.html ">Robes de mariée 2012</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-soirée-c-25.html ">Robes de soirée</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-de-soirée-c-27.html ">Robes de soirée</a></div><br/><div class="categories-top-list  "><a class="category-top" href="http://fr.weddingdressescompany.com/robes-quinceanera-c-23.html ">robes Quinceanera</a></div><br/></div></div> <br/> <br/> <br/><div class="leftBoxContainer" id="whatsnew" style="width: 220px "> <br/><div class="sidebox-header-left  "><h3 class="leftBoxHeading " id="whatsnewHeading ">Nouveaux produits - <a href="http://fr.weddingdressescompany.com/products_new.html ">  [plus]</a></h3></div> <br/><div class="sideBoxContent centeredContent "><a href="http://fr.weddingdressescompany.com/asymétrique-sweetheart-siren-applique-ruché-de-mariage-sweep-longueur-de-robe-pwd110-p-498.html "><img src="http://fr.weddingdressescompany.com/images/weddingdress/princess_wedding_dresses_110.jpg" alt="Asymétrique sweetheart Siren Applique ruché de mariage Sweep Longueur de robe (PWD-110)" title=" Asymétrique sweetheart Siren Applique ruché de mariage Sweep Longueur de robe (PWD-110) " width="130" height="257" style="position:relative" onmouseover="showtrail('</code>images<code>/weddingdress/princess_wedding_dresses_110.jpg','Asymétrique sweetheart Siren Applique ruché de mariage Sweep Longueur de robe (PWD-110)',130,256,304,600,this,0,0,130,256);" onmouseout="hidetrail();"  /</code>><<code>/a><a class="sidebox-products" href="http:/fr.weddingdressescompany.com/</code>asymétrique-sweetheart-siren-applique-ruché-de-mariage-sweep-longueur-de-robe-pwd110-p-498.html <code>">Asymétrique sweetheart Siren Applique ruché de mariage Sweep Longueur de robe (PWD-110)</a><div><span class="</code>normalprice <code>">$339.99 </span> <span class="</code>productSpecialPrice <code>">$169.99</span><span class="</code>productPriceDiscount <code>"><br />Economie : 50%</span></div></div><div class="</code>sideBoxContent centeredContent <code>"><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/2012-chubby-à-encolure-en-v-à-taille-empire-applique-bretelles-robe-cour-train-pswd001-p-500.html "><img src="http:/fr.weddingdressescompany.com/</code>images<code>/weddingdress/</code>plus_size_wedding_dresses_001.jpg<code>" alt="</code>2012 Chubby à encolure en V à taille empire Applique bretelles Robe Cour Train (PSWD-001)<code>" title="</code> 2012 Chubby à encolure en V à taille empire Applique bretelles Robe Cour Train (PSWD-001) <code>" width="</code>130<code>" height="</code>173<code>" style="</code>position:relative<code>" onmouseover="</code>showtrail(<code>'images/weddingdress//plus_size_wedding_dresses_001.jpg'</code>,<code>'2012 Chubby Ã  encolure en V Ã  taille empire Applique bretelles Robe Cour Train (PSWD-001)'</code>,130,173,300,400,this,0,0,130,173);<code>" onmouseout="</code>hidetrail();<code>"  /></a><a class="</code>sidebox-products<code>" href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/2012-chubby-à-encolure-en-v-à-taille-empire-applique-bretelles-robe-cour-train-pswd001-p-500.html ">2012 Chubby Ã  encolure en V Ã  taille empire Applique bretelles Robe Cour Train (PSWD-001)</</code>a><div><span class=<code>"normalprice "</code>>$318.99 <<code>/span> <span class="productSpecialPrice ">$158.99</</code>span><span class=<code>"productPriceDiscount "</code>><br <code>/>Economie : 50%</</code>span><<code>/div></</code>div><div class=<code>"sideBoxContent centeredContent "</code>><a href=<code>"http://fr.weddingdressescompany.com/elégant-aligne-bretelles-plus-size-sash-avec-robe-applique-longueur-de-balayage-pswd003-p-501.html "</code>><img src=<code>"http://fr.weddingdressescompany.com/images/weddingdress/plus_size_wedding_dresses_003.jpg"</code> alt=<code>"Elégant A-ligne bretelles Plus Size Sash Avec Robe Applique Longueur de balayage (PSWD-003)"</code> title=<code>" Elégant A-ligne bretelles Plus Size Sash Avec Robe Applique Longueur de balayage (PSWD-003) "</code> width=<code>"130"</code> height=<code>"173"</code> style=<code>"position:relative"</code> onmouseover=<code>"showtrail('images/weddingdress//plus_size_wedding_dresses_003.jpg','Elégant A-ligne bretelles Plus Size Sash Avec Robe Applique Longueur de balayage (PSWD-003)',130,173,1000,1333,this,0,0,130,173);"</code> onmouseout=<code>"hidetrail();"</code> <code>/></</code>a><a class=<code>"sidebox-products"</code> href=<code>"http://fr.weddingdressescompany.com/elégant-aligne-bretelles-plus-size-sash-avec-robe-applique-longueur-de-balayage-pswd003-p-501.html "</code>>Elégant A-ligne bretelles Plus Size Sash Avec Robe Applique Longueur de balayage (PSWD-003)<<code>/a><div><span class="normalprice ">$348.99 </</code>span> <span class=<code>"productSpecialPrice "</code>>$166.99<<code>/span><span class="productPriceDiscount "><br /</code>>Economie : 52%<<code>/span></</code>div><<code>/div><div class="sideBoxContent centeredContent "><a href="http:/fr.weddingdressescompany.com/</code>2012-slinky-applique-charme-sweetheart-tribunal-train-plissé-princess-dress-pwd111-p-499.html <code>"><img src="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/images/</code>weddingdress<code>/princess_wedding_dresses_111.jpg" alt="2012 Slinky Applique Charme sweetheart tribunal train plissé Princess Dress (PWD-111)" title=" 2012 Slinky Applique Charme sweetheart tribunal train plissé Princess Dress (PWD-111) " width="130" height="259" style="position:relative" onmouseover="showtrail('images/</code>weddingdress<code>//</code>princess_wedding_dresses_111.jpg<code>','</code>2012 Slinky Applique Charme sweetheart tribunal train plissé Princess Dress (PWD-111)<code>',130,259,301,600,this,0,0,130,259);" onmouseout="hidetrail();"  /></a><a class="sidebox-products" href="http://fr.weddingdressescompany.com/2012-slinky-applique-charme-sweetheart-tribunal-train-plissé-princess-dress-pwd111-p-499.html ">2012 Slinky Applique Charme sweetheart tribunal train plissé Princess Dress (PWD-111)</a><div><span class="normalprice ">$326.99 </span> <span class="productSpecialPrice ">$165.99</span><span class="productPriceDiscount "><br />Economie : 49%</span></div></div></div> <br/> <br/></div></td> <br/><td id="columnCenter" valign="top "> <br/><br/> <br/><div id="navBreadCrumb ">  <a href="http://fr.weddingdressescompany.com/ ">Accueil</a> :: <br/>  <a href="http://fr.weddingdressescompany.com/robes-de-mariée-c-1.html ">Robes de Mariée</a> :: <br/>  <a href="http://fr.weddingdressescompany.com/robes-de-mariée-robe-de-mariée-sexy-c-1_30.html ">Robe de mariée sexy</a> :: <br/>Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes<br/></div> <br/><br/> <br/> <br/> <br/><br/> <br/><br/> <br/> <br/><div class="centerColumn" id="productGeneral "> <br/> <br/> <br/><h1 id="productName" class="productGeneral ">Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes</h1> <br/> <br/><form name="cart_quantity" action="http://fr.weddingdressescompany.com/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html?action=add_product&number_of_uploads=0" method="post" enctype="multipart/form-data "><br/> <br/><div style="float:left; "> <br/> <br/> <br/>  <br/><div id="productMainImage" class="centeredContent back "> <br/> <br/><noscript> <br/><a href="http://fr.weddingdressescompany.com/index.php?main_page=popup_image&pID=456" target="_blank "> <a href="http://fr.weddingdressescompany.com/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" ><img src="http://fr.weddingdressescompany.com/images/weddingdress/sxw0018.jpg" alt="Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes" title=" Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes " width="240" height="329" /></a><br /><span class="imgLink ">Agrandir l'</code>image<<code>/span></</code>a><<code>/noscript> <br/></</code>div> <br/> <br/> <div id=<code>"productAdditionalImages "</code>> <br/> <div id=<code>"dfse "</code>><<code>/div> <br/>  <div class="centerBoxContent "> <br/> <br/> <br/>    <div class="additionalImages centeredContent back" style="width:100%; "><br/>      <br/>      <noscript><a href="http:/fr.weddingdressescompany.com/</code>low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html<code>" target="</code>_blank <code>"> <a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" ><img src="http:/fr.weddingdressescompany.com/</code>images<code>/weddingdress/</code>sxw0018_01.jpg<code>" alt="</code>Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes<code>" title="</code> Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes <code>" width="</code>130<code>" height="</code>174<code>" style="</code>position:relative<code>" onmouseover="</code>showtrail(<code>'images/weddingdress//sxw0018_01.jpg'</code>,<code>'Low Cost Custom-Made bretelles sexy mariage mariée robe de mariée Robes'</code>,130,173,243,325,this,0,0,130,173);<code>" onmouseout="</code>hidetrail();<code>"  /></a><br /><span class="</code>imgLinkAdditional <code>">Agrandir l'image</span></a></noscript></div><br/><br class="</code>clearBoth<code>" /> <br/>  <br/></div></div> <br/> <br/></div> <br/> <br/><div style="</code>width:348px;float:right;<code>" id='pb-left-column'> <br/> <br/><span id="</code>productPrices<code>" class="</code>productGeneral <code>"> <br/>Price:  <br/><span class="</code>normalprice <code>">$218.77 </span> <span class="</code>productSpecialPrice <code>">$175.01</span><span class="</code>productPriceDiscount <code>"><br />Economie : 20%</span></span> <br/><div class="</code>model_number<code>" style="</code>height:14px;padding-top:7px <code>"><h4 style="</code>float: left;color:black; <code>"><label class="</code>class <code>">Modèle : </label></h4><div style="</code>float: left;margin-top:5px;margin-left:6px; <code>"><span style="</code>font-size:12px;height:20px;color:black; <code>">Mall3411</span></div><br/></div> <br/> <br/> <br/> <br/> <br/> <br/><div id="</code>productAttributes <code>"> <br/><h1 style='margin-bottom: 10px;'>Step 1 - Choose Options:</h1> <br/> <br/> <br/><div class="</code>wrapperAttribsOptions <code>"> <br/><h4 class="</code>optionName back <code>"><label>Colors</label></h4> <br/><div class="</code>back <code>"><br/><select name="</code>id<code>[8]</code><code>" id="</code>attrib-8 <code>"><br/>  <option value="</code>46 <code>">1</option><br/>  <option value="</code>52 <code>">10</option><br/>  <option value="</code>53 <code>">12</option><br/>  <option value="</code>54 <code>">16</option><br/>  <option value="</code>55 <code>">17</option><br/>  <option value="</code>56 <code>">18</option><br/>  <option value="</code>47 <code>">2</option><br/>  <option value="</code>57 <code>">20</option><br/>  <option value="</code>58 <code>">21</option><br/>  <option value="</code>59 <code>">23</option><br/>  <option value="</code>60 <code>">26</option><br/>  <option value="</code>61 <code>">27</option><br/>  <option value="</code>62 <code>">28</option><br/>  <option value="</code>63 <code>">29</option><br/>  <option value="</code>64 <code>">30</option><br/>  <option value="</code>65 <code>">31</option><br/>  <option value="</code>66 <code>">33</option><br/>  <option value="</code>67 <code>">35</option><br/>  <option value="</code>68 <code>">36</option><br/>  <option value="</code>69 <code>">37</option><br/>  <option value="</code>48 <code>">4</option><br/>  <option value="</code>70 <code>">41</option><br/>  <option value="</code>71 <code>">43</option><br/>  <option value="</code>72 <code>">44</option><br/>  <option value="</code>73 <code>">47</option><br/>  <option value="</code>74 <code>">48</option><br/>  <option value="</code>75 <code>">49</option><br/>  <option value="</code>49 <code>">5</option><br/>  <option value="</code>76 <code>">51</option><br/>  <option value="</code>77 <code>">54</option><br/>  <option value="</code>78 <code>">56</option><br/>  <option value="</code>79 <code>">60</option><br/>  <option value="</code>80 <code>">61</option><br/>  <option value="</code>81 <code>">66</option><br/>  <option value="</code>82 <code>">67</option><br/>  <option value="</code>83 <code>">69</option><br/>  <option value="</code>84 <code>">73</option><br/>  <option value="</code>85 <code>">77</option><br/>  <option value="</code>86 <code>">78</option><br/>  <option value="</code>87 <code>">79</option><br/>  <option value="</code>50 <code>">8</option><br/>  <option value="</code>51 <code>">9</option><br/>  <option value="</code>27 <code>">Ivory</option><br/>  <option value="</code>26 <code>">Same As Picture</option><br/>  <option value="</code>28 <code>">White</option><br/></select><br/><br/></div> <br/><br class="</code>clearBoth<code>" /> <br/></div> <br/> <br/> <br/> <br/> <br/><br/><br class="</code>clearBoth<code>" /> <br/> <br/><div class="</code>wrapperAttribsOptions <code>"> <br/><h4 class="</code>optionName back <code>"><label>Sizes</label></h4> <br/><div class="</code>back <code>"><br/><select name="</code>id<code>[9]</code><code>" id="</code>attrib-9 <code>"><br/>  <option value="</code>29 <code>">US 10 / UK 12 / EUR 40</option><br/>  <option value="</code>30 <code>">US 12 / UK 14 /EUR 42</option><br/>  <option value="</code>31 <code>">US 14 / UK 16 /EUR 44</option><br/>  <option value="</code>32 <code>">US 16 / UK 18 /EUR 46</option><br/>  <option value="</code>33 <code>">US 18 / UK 20 /EUR 48</option><br/>  <option value="</code>34 <code>">US 2 / UK 4 /EUR 32</option><br/>  <option value="</code>35 <code>">US 20 / UK 22 /EUR 50</option><br/>  <option value="</code>36 <code>">US 22 / UK 24 /EUR 52</option><br/>  <option value="</code>37 <code>">US 24 / UK 26 /EUR 54</option><br/>  <option value="</code>38 <code>">US 26 / UK 28 /EUR 56</option><br/>  <option value="</code>39 <code>">US 28 / UK 30 /EUR 58</option><br/>  <option value="</code>40 <code>">US 4 / UK 6 /EUR 34</option><br/>  <option value="</code>41 <code>">US 6 / UK 8 /EUR 36</option><br/>  <option value="</code>42 <code>">US 8 / UK 10 /EUR 38</option><br/></select><br/><br/></div> <br/><br class="</code>clearBoth<code>" /> <br/></div> <br/> <br/> <br/> <br/> <br/><br/><br class="</code>clearBoth<code>" /> <br/> <br/><div class="</code>wrapperAttribsOptions <code>"> <br/><h4 class="</code>optionName back <code>"><label>Back style</label></h4> <br/><div class="</code>back <code>"><br/><select name="</code>id<code>[10]</code><code>" id="</code>attrib-10 <code>"><br/>  <option value="</code>44 <code>">Lace Up</option><br/>  <option value="</code>43 <code>">Same As Picture</option><br/>  <option value="</code>45 <code>">Zip Up</option><br/></select><br/><br/></div> <br/><br class="</code>clearBoth<code>" /> <br/></div> <br/> <br/> <br/> <br/> <br/><br/><br class="</code>clearBoth<code>" /> <br/> <br/><div style="</code>padding-bottom:5px; <code>"><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/size.html" style="color:black;font-weight:bold;text-decoration:underline; color:#FF0000;" target="_blank ">Size Chart</</code>a> | <a href=<code>"http://fr.weddingdressescompany.com/color.html"</code> style=<code>"color:black;font-weight:bold;text-decoration:underline;color:#FF0000;"</code> target=<code>"_blank "</code>>Color Chart<<code>/a></</code>div> <br/> <br/> <br/><<code>/div> <br/><div id='quantity_cart'> <br/><h1>Step 2 - Choose Quantity:</</code>h1> <br/> <br/> <br/> <div class=<code>"wrapperAttribsOptions"</code> style=<code>"height:14px;padding-top:7px "</code>><h4 style=<code>"float:left; "</code>><label class=<code>"attribsInput "</code>>Quantity :<<code>/label></</code>h4><div style=<code>"float:left; "</code>><input type=<code>"text"</code> class=<code>"text"</code> id=<code>"quantity_wanted"</code> name=<code>"cart_quantity"</code> value=<code>"1"</code> maxlength=<code>"6"</code> size=<code>"4"</code> <code>/></</code>div><<code>/div> <br/>  <br class="clearBoth "> <br/>    <h1 style='margin-bottom: 10px;'>Step 3 - Add to cart:</</code>h1> <br/> <p id=<code>'add_to_cart'</code> class=<code>'buttons_bottom_block'</code>> <br/> <input type=<code>"hidden"</code> name=<code>"products_id"</code> value=<code>"456"</code> <code>/><input type="image" src="http:/fr.weddingdressescompany.com/</code>includes<code>/templates/</code>weddingdress-7<code>/buttons/</code>french<code>/button_in_cart.gif" alt="ajouter au panier" title=" ajouter au panier " /</code>> <<code>/p> <br/>   <br/></</code>div> <br/><div> <br/> <div class=<code>'safe_onlinechat'</code>> <br/> <div class=<code>'safe_ssl'</code>> <br/> <a target=<code>'_blank'</code> href=<code>'msnim:chat?contact=myonlineservice@msn.com'</code> style=<code>"float:left; "</code>><img src=<code>'http://fr.weddingdressescompany.com/banner/msn.jpg'</code>><<code>/a> <br/> <a target='_blank' href='callto:/meganfox59'><img border=0 align='absmiddle' src='http:/fr.weddingdressescompany.com/</code>banner<code>/skype.jpg' style="float:left; "></</code>a> <br/> <<code>/div> <br/> </</code>div> <br/> <br/><<code>/div> <br/> <br/></</code>div> <br/> <br/> <br/><br class=<code>"clearBoth"</code> <code>/> <br/><div id='descript_menu'> <br/><ul id='more_info_tabs' class='idTabs idTabsShort'> <br/> <li><a onclick='dissplay_descript(this);' style='cursor:pointer;'>Details</</code>span><<code>/a></</code>li> <br/> <li><a onclick=<code>'displaysize(this);'</code>style=<code>'cursor:pointer;'</code>>SIZE & COLOR CHART<<code>/a></</code>li> <br/> <li><a onclick=<code>'dissplay_return(this);'</code>style=<code>'cursor:pointer;'</code>>Shipping<<code>/a></</code>li> <br/> <li><a onclick=<code>'measure(this);'</code>style=<code>'cursor:pointer;'</code>>How to Measure<<code>/a></</code>li> <br/><<code>/ul> <br/><script> <br/> function displaysize(obj){ <br/> var measure = document.getElementById('idTabMeasure'); <br/> var idTabtwo = document.getElementById('idTabtwo'); <br/> var shipping_return = document.getElementById('tab_3'); <br/> var descript = document.getElementById('productDescription'); <br/> <br/> idTabtwo.setAttribute('class','block_hidden_only_for_screen'); <br/> descript.setAttribute('class','display'); <br/> shipping_return.setAttribute('class','display'); <br/> measure.setAttribute('class','display'); <br/> } <br/> function dissplay_descript(obj){ <br/> var measure = document.getElementById('idTabMeasure'); <br/> var descript = document.getElementById('productDescription'); <br/> var idTabtwo = document.getElementById('idTabtwo'); <br/> var shipping_return = document.getElementById('tab_3'); <br/> descript.setAttribute('class','block_hidden_only_for_screen'); <br/> idTabtwo.setAttribute('class','display'); <br/> shipping_return.setAttribute('class','display'); <br/> measure.setAttribute('class','display'); <br/> <br/> } <br/> function dissplay_return(obj){ <br/> var measure = document.getElementById('idTabMeasure'); <br/> var shipping_return = document.getElementById('tab_3'); <br/> var descript = document.getElementById('productDescription'); <br/> var idTabtwo = document.getElementById('idTabtwo'); <br/> shipping_return.setAttribute('class','block_hidden_only_for_screen'); <br/> idTabtwo.setAttribute('class','display'); <br/> descript.setAttribute('class','display'); <br/> measure.setAttribute('class','display'); <br/> <br/> } <br/> function measure(obj){ <br/> var measure = document.getElementById('idTabMeasure'); <br/> var shipping_return = document.getElementById('tab_3'); <br/> var descript = document.getElementById('productDescription'); <br/> var idTabtwo = document.getElementById('idTabtwo'); <br/> measure.setAttribute('class','block_hidden_only_for_screen'); <br/> idTabtwo.setAttribute('class','display'); <br/> descript.setAttribute('class','display'); <br/> shipping_return.setAttribute('class','display'); <br/> <br/> <br/> <br/> } <br/></</code>script> <br/><div id=<code>'more_info_sheets'</code> class=<code>'sheets align_justify'</code>> <br/> <br/><div id=<code>"productDescription"</code> class=<code>'displayblock'</code>>Nom de l<code>'article:</div> <br/> <br/><div id='</code>idTabtwo<code>' class='</code>display<code>'> <br/> <div class='</code>SizeKind<code>'> <br/> <div style='</code>background-attachment: scroll; background-image: none; background-position: 0pt 0pt; background-repeat: repeat; border-bottom: 1px solid rgb(238, 238, 238); margin-bottom: 10px; padding-bottom: 10px; padding-top: 10px; text-align: center;<code>'> <br/> <p style='</code>font-weight: bold; color: rgb(178, 30, 54); font-size: 14px;<code>'>Please choose your favorite color from the palette</p> <br/> <a id='</code>single_3<code>' href='</code>http:<code>//</code>fr.weddingdressescompany.com<code>/image/</code>img_ColorCard.jpg<code>'><img src='</code>http:<code>//</code>fr.weddingdressescompany.com<code>/image/</code>img_ColorCard.jpg<code>' alt='</code>wedding dress card palette<code>' width='</code>720<code>'></a> <br/> <p style='</code>text-align: left;<code>'><span style='</code>color: rgb(255, 0, 0);<code>'>Notice:</span>Since computer screens have chromatic aberration, especially between CRT screen and LCD screen, we can not guarantee the color of the dress you get will be 100% similar as the color chart. And also different fabrics will show different color degree on the same color. So we can not accept any returned dress for sake of color. Please kindly understand us.</p> <br/> </div> <br/> <div style='</code>background-attachment: scroll; background-image: none; background-position: 0pt 0pt; background-repeat: repeat; border-bottom: 1px solid rgb(238, 238, 238); margin-bottom: 20px; padding-bottom: 20px; padding-top: 10px; text-align: center;<code>'> <br/> <p style='</code>font-weight: bold; color: rgb(178, 30, 54); font-size: 14px;<code>'> Please choose your size</p> <br/> <table cellspacing="0" cellpadding="0 "> <br/>    <tbody> <br/>        <tr> <br/>            <th colspan="15 ">Standard size (in centimeter)</th> <br/>        </tr> <br/>        <tr> <br/> <br/>            <th>US size no</th> <br/>            <td>2</td> <br/>            <td>4</td> <br/>            <td>6</td> <br/>            <td>8</td> <br/>            <td>10</td> <br/> <br/>            <td>12</td> <br/>            <td>14</td> <br/>            <td>16</td> <br/>            <td>18</td> <br/>            <td>20</td> <br/>            <td>22</td> <br/> <br/>            <td>24</td> <br/>            <td>26</td> <br/>            <td>28</td> <br/>        </tr> <br/>        <tr> <br/>            <th>EUR size no</th> <br/>            <td>32</td> <br/> <br/>            <td>34</td> <br/>            <td>36</td> <br/>            <td>38</td> <br/>            <td>40</td> <br/>            <td>42</td> <br/>            <td>44</td> <br/> <br/>            <td>46</td> <br/>            <td>48</td> <br/>            <td>50</td> <br/>            <td>52</td> <br/>            <td>54</td> <br/>            <td>56</td> <br/> <br/>            <td>58</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Bust</th> <br/>            <td>84</td> <br/>            <td>86</td> <br/>            <td>89</td> <br/> <br/>            <td>91</td> <br/>            <td>94</td> <br/>            <td>98</td> <br/>            <td>102</td> <br/>            <td>105</td> <br/>            <td>109</td> <br/> <br/>            <td>114</td> <br/>            <td>119</td> <br/>            <td>124</td> <br/>            <td>132</td> <br/>            <td>142</td> <br/>        </tr> <br/> <br/>        <tr> <br/>            <th>Waist</th> <br/>            <td>66</td> <br/>            <td>69</td> <br/>            <td>71</td> <br/>            <td>74</td> <br/> <br/>            <td>76</td> <br/>            <td>80</td> <br/>            <td>84</td> <br/>            <td>88</td> <br/>            <td>91</td> <br/>            <td>96</td> <br/> <br/>            <td>102</td> <br/>            <td>107</td> <br/>            <td>114</td> <br/>            <td>124</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Hip</th> <br/> <br/>            <td>91</td> <br/>            <td>94</td> <br/>            <td>97</td> <br/>            <td>99</td> <br/>            <td>102</td> <br/>            <td>105</td> <br/> <br/>            <td>109</td> <br/>            <td>113</td> <br/>            <td>117</td> <br/>            <td>122</td> <br/>            <td>127</td> <br/>            <td>132</td> <br/> <br/>            <td>140</td> <br/>            <td>150</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Shoulder to floor</th> <br/>            <td>150</td> <br/>            <td>150</td> <br/> <br/>            <td>151</td> <br/>            <td>152</td> <br/>            <td>152</td> <br/>            <td>153</td> <br/>            <td>154</td> <br/>            <td>154</td> <br/> <br/>            <td>155</td> <br/>            <td>156</td> <br/>            <td>156</td> <br/>            <td>156</td> <br/>            <td>156</td> <br/>            <td>156</td> <br/> <br/>        </tr> <br/>    </tbody> <br/></table> <br/><p> </p> <br/><table cellspacing="0" cellpadding="0 "> <br/>    <tbody> <br/>        <tr> <br/>            <th colspan="15 ">Standard size (in inches)</th> <br/>        </tr> <br/> <br/>        <tr> <br/>            <th>US size no</th> <br/>            <td>2</td> <br/>            <td>4</td> <br/>            <td>6</td> <br/>            <td>8</td> <br/> <br/>            <td>10</td> <br/>            <td>12</td> <br/>            <td>14</td> <br/>            <td>16</td> <br/>            <td>18</td> <br/>            <td>20</td> <br/> <br/>            <td>22</td> <br/>            <td>24</td> <br/>            <td>26</td> <br/>            <td>28</td> <br/>        </tr> <br/>        <tr> <br/>            <th>EUR size no</th> <br/> <br/>            <td>32</td> <br/>            <td>34</td> <br/>            <td>36</td> <br/>            <td>38</td> <br/>            <td>40</td> <br/>            <td>42</td> <br/> <br/>            <td>44</td> <br/>            <td>46</td> <br/>            <td>48</td> <br/>            <td>50</td> <br/>            <td>52</td> <br/>            <td>54</td> <br/> <br/>            <td>56</td> <br/>            <td>58</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Bust</th> <br/>            <td>33</td> <br/>            <td>34</td> <br/> <br/>            <td>35</td> <br/>            <td>36</td> <br/>            <td>37</td> <br/>            <td>39</td> <br/>            <td>40</td> <br/>            <td>42</td> <br/> <br/>            <td>43</td> <br/>            <td>45</td> <br/>            <td>47</td> <br/>            <td>49</td> <br/>            <td>52</td> <br/>            <td>56</td> <br/> <br/>        </tr> <br/>        <tr> <br/>            <th>Waist</th> <br/>            <td>26</td> <br/>            <td>27</td> <br/>            <td>28</td> <br/>            <td>29</td> <br/> <br/>            <td>30</td> <br/>            <td>32</td> <br/>            <td>33</td> <br/>            <td>35</td> <br/>            <td>36</td> <br/>            <td>38</td> <br/> <br/>            <td>40</td> <br/>            <td>42</td> <br/>            <td>45</td> <br/>            <td>49</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Hip</th> <br/> <br/>            <td>36</td> <br/>            <td>37</td> <br/>            <td>38</td> <br/>            <td>39</td> <br/>            <td>40</td> <br/>            <td>42</td> <br/> <br/>            <td>43</td> <br/>            <td>45</td> <br/>            <td>46</td> <br/>            <td>48</td> <br/>            <td>50</td> <br/>            <td>52</td> <br/> <br/>            <td>55</td> <br/>            <td>59</td> <br/>        </tr> <br/>        <tr> <br/>            <th>Shoulder to floor</th> <br/>            <td>59</td> <br/>            <td>59</td> <br/> <br/>            <td>60</td> <br/>            <td>60</td> <br/>            <td>60</td> <br/>            <td>60</td> <br/>            <td>61</td> <br/>            <td>61</td> <br/> <br/>            <td>61</td> <br/>            <td>61</td> <br/>            <td>62</td> <br/>            <td>62</td> <br/>            <td>62</td> <br/>            <td>62</td> <br/> <br/>        </tr> <br/>    </tbody> <br/></table> <br/> <br/> </div> <br/> <br class='</code>clear<code>'> <br/> </div> <br/></div> <br/> <br/> <br/>          <div id="tab_3" class='</code>display<code>'> <br/> <br/>          <h3>Shipping Time</h3> <br/><p>Total Time=Operation Time + Shipping Time</p> <br/><p>Default operation time is 30 business days from the day you place an order.  <br/>We will rush your order within 20 business days and 15 business days if you  <br/>choose rush service from  the operation time option,and you will pay extra  <br/>cost for it.Shipping time varies as: UPS , TNT 2-4 business days, Air Mail(Express) 10  <br/>business days, Air Mail(Normal) 20 business days. Please calculate the total  <br/>time carefully before you place the order.</p> <br/><p><i>Note: You can also choose Air Mail(Normal) if package weight is under 2kg.</i></p> <br/> <br/><h3>Return Tips</h3> <br/><p>If any returns, please contact our customer support within 24 hours from the time you receive your gown and fill in the Application for Refund in email. Only products in their original condition will be accepted. We do not accept returns on any custom made order. ALL SALES ARE FINAL for custom made dresses. For mis-shipped items, once confirmation got with us, we will be responsible for item exchange and have full refund returned including shipping fee and handling fee.  In principle, any emergency order isnot subject to this return policy and will be denied. Also other merchandise, such as veil ect.</p></div> <br/> <br/><div id="idTabMeasure" style="height:510px;" class='</code>display<code>'> <br/> <div class="tempnr_box "> <br/> <br/> <div class="images_zuo "> <a href="http://fr.weddingdressescompany.com/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" ><img width="163" height="479" src="http://fr.weddingdressescompany.com/image/wedding_size.jpg"/></a></div> <br/> <br/> <div class="nr_right "> <br/> <p style="color:#b21e36;font-size:14px;font-style:italic;font-weight:bold; padding-left:0; ">How to Measure</p> <br/> <ul><li><span class="wzys ">A.Bust:</span>Measure Around The Fullest Part Of Your Bust.</li> <br/> <br/> <li><span class="wzys ">B.Waist:</span>Measure Around The Smallest Part Of Your Waistline.</li> <br/> <li><span class="wzys ">C.Hips:</span>Measure Around The Widest Part Of Your Hips.</li> <br/> <li><span class="wzys ">D.Length:</span> Measure From Top Of The Shoulder Through The Nipple To Floor,Including The Height Of <b>Wedding Shoes</b>.</li> <br/> <li><span class="wzys ">E.Under Bust:</span>Measure Around Under Your Bust.</li> <br/> <br/> <li><span class="wzys ">F.Nipple To Nipple:</span> The Measurement Between Your Two Nipples.</li> <br/> <li><span class="wzys ">G.Shoulder To NiPPLE:</span>Measure From Top Of The Shoulder To Nipple.</li> <br/> <li><span class="wzys ">H.Shoulder TO Waist:</span>Measure From Top Of The Shoulder Through The Nipple TO Waist.</li> <br/> <li><span class="wzys ">I.Shoulder To Hips:</span>Measure From Top Of The Shoulder Through The Nipple TO Hips.</li> <br/> <br/> <li><span class="wzys ">J.Shoulder To Shoulder:</span>Measure Your Shoulder Width From The Back.</li> <br/> <li><span class="wzys ">k.Neck:</span>Measure Around The Fullest Part Of Your Neck.</li> <br/> <li><span class="wzys ">L.Biceps:</span>Measure Around The Widest Part Of Your Arm.</li> <br/> <li class="wzys" style="color:#DD0000;font-size:14px;font-weight:bold;padding:5px;text-align:right;border:1px solid #eee; ">Please Measure With Bra and Underwear On.</li> <br/> <li class="wzys" style="font-size:11px;font-weight:bold;text-align:right; ">Remember To Keep The Measuring Tape Comfortably Loose.</li></ul> <br/> <br/>            <br class="clear" /> <br/> <div><span style="color:#DD0000; margin-top:10px; ">Notice:</span>1. Please also tell us your "Height with Shoes" on (measured from top head to your wedding shoes'</code> heel).<br> <br/>2. Please remember that wear your Wedding Underwear and your Wedding Shoes.<br> <br/>3.Inches and Centimetersare both available for size, and please tell us if you use inches or centimeters.<br> <br/>4. We suggest you measure yourself by a Professional Tailor. <br> <br/>5. It is very normal to have 3CM measurement error between the sizes you give and the sizes you will receive on your dress. This kind of error can not be accepted for any returns and exchanges. <<code>/div> <br/> <br/> </</code>div> <br/> <br/> <span class=<code>"clear "</code>><<code>/span> <br/> </</code>div> <br/> <<code>/div> <br/> <br/></</code>div> <br/><<code>/div> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/>  <br class="clear" /</code>> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/><<code>/form> <br/> <br/></</code>div> <br/><<code>/td> <br/> <br/> <br/></</code>tr> <br/><<code>/table> <br/><br/> <br/> <br/><div id="navSuppWrapper "> <br/> <br/><div id="navSupp "> <br/><ul><li><a href="http:/fr.weddingdressescompany.com/</code>index.php <code>">Accueil</a></li> <br/><li><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/index.php?main_page=shippinginfo ">Frais de port</</code>a><<code>/li> <br/><li><a href="http:/fr.weddingdressescompany.com/</code>index.php?main_page=Wholesale <code>">Vente en gros</a></li> <br/><li><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/index.php?main_page=privacy ">Confidentialité</</code>a><<code>/li> <br/><li><a href="http:/fr.weddingdressescompany.com/</code>index.php?main_page=Tracking <code>">Suivi de commande</a></li> <br/><li><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/index.php?main_page=Coupons ">Coupons</</code>a><<code>/li> <br/><li><a href="http:/fr.weddingdressescompany.com/</code>index.php?main_page=conditions <code>">Conditions d'utilisation</a></li> <br/><li><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/index.php?main_page=FAQ ">FAQ</</code>a><<code>/li> <br/><li><a href="http:/fr.weddingdressescompany.com/</code>index.php?main_page=Western_Union <code>">Western Union</a></li> <br/><li><a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/index.php?main_page=Payment_Methods ">Modes de paiement</</code>a><<code>/li> <br/><li><a href="http:/fr.weddingdressescompany.com/</code>index.php?main_page=contact_us <code>">Contactez-nous</a></li> <br/> <br/> <br/></ul> <br/> <br/></div> <br/><DIV  align="</code>center <code>"> <a href="</code>http:<code>//</code>fr.weddingdressescompany.com<code>/low-cost-custommade-bretelles-sexy-mariage-mariée-robe-de-mariée-robes-p-456.html" ><IMG src="http:/fr.weddingdressescompany.com/</code>includes<code>/templates/</code>weddingdress-7<code>/images/</code>payment.png<code>" width="</code>746<code>" height="</code>58 <code>"></a></DIV> <br/><div align="</code>center <code>">Copyright Â© 2012 Tous droits réservés .</div> <br/> <br/> <br/></div> <br/></div> <br/><br/> <br/><br/> <br/><br/> <br/><br/> <br/> <br/><br><br><a href="</code>http:<code>//</code>blog.ishirtsale.com<code>">  sexy  blog </a><br><br><a href="</code>http:<code>//</code>blog.surprisewatches.com<code>"> mariée  </a><br><br><a href="</code>http:<code>//</code>blog.bootsclubs.com"> About weddingdressescompany.com blog </a> </div> </div> </div> </div> <div class="category"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/nike-air-max">nike air max</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div id="category25"> <div class="subcategory"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/nike-air-max/180">180</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div style="clear:both"/> <div id="subcategory51"> <div class="problem"> <h3><a href="/ruby+cpp+fsharp+erlang+csharp+haskell/nike-air-max/180/180">180</a></h3> <div class="solutions" id="problem368"> <strong><a href=<code>"http://www.kissdrdrebeats.com/ "</code>>beats by dre headphones<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.beatsdrdrecompany.com/ "</code>>by dre tour<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.loginmonsterbeats.com/ "</code>>beats by dre tour<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.bigbeatsbydre.com/ "</code>>beats by dre solo<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.beatsdrdrecompany.com/ "</code>>monster beats by dre<<code>/a></</code>strong><br><br/><br><br/> <br/><title> 2011 Monster Beats Studio Transformers,Transformers Beats Sale,Dr Dre Transformers Online,Dr Dre Beats Outlet<<code>/title> <br/><meta http-equiv="Content-Type" content="text/</code>html; charset=UTF-8<code>" /> <br/><meta name="</code>keywords<code>" content="</code>2011 Monster Beats Studio Transformers,Transformers Beats Sale,Dr Dre Transformers Online,Dr Dre Beats Outlet <code>" /> <br/><meta name="</code>description<code>" content="</code>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones.Buy Monster Beats Studio Transformers Online at discounted beets prices <code>" /> <br/><meta http-equiv="</code>imagetoolbar<code>" content="</code>no<code>" /> <br/><meta name="</code>author<code>" content="</code>Zen Cart China<code>" /> <br/><meta name="</code>generator<code>" content="</code>Zen Cart, http:<code>//</code>www.zen-cart.cn<code>" /> <br/> <br/> <br/><link rel="</code>canonical<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-by-dr-dre-transformers-limited-edition-headphones-p-42.html" /</code>> <br/> <br/><link rel=<code>"stylesheet"</code> type=<code>"text/css"</code> href=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/css/style_imagehover.css"</code> <code>/><br/><link rel="stylesheet" type="text/</code>css<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/includes/</code>templates<code>/monsterbeats/</code>css<code>/styles_AJAX_image_swapper.css" /</code>><br/><link rel=<code>"stylesheet"</code> type=<code>"text/css"</code> href=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/css/stylesheet.css"</code> <code>/><br/><link rel="stylesheet" type="text/</code>css<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/includes/</code>templates<code>/monsterbeats/</code>css<code>/stylesheet_css_buttons.css" /</code>><br/><link rel=<code>"stylesheet"</code> type=<code>"text/css"</code> media=<code>"print"</code> href=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/css/print_stylesheet.css"</code> <code>/><br/><br/><br/><br/> <br/><link type="text/</code>css<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/includes/</code>templates<code>/monsterbeats/</code>css<code>/magiczoomplus.css" rel="stylesheet" media="screen" /</code>> <br/> <br/><br/><br/> <br/> <br/> <br/> <br/><div id=<code>"mainWrapper "</code>> <br/> <br/> <br/> <br/> <br/> <br/><div id=<code>"headerWrapper "</code>> <br/> <br/> <br/> <br/><div id=<code>"logoWrapper "</code>> <br/> <div id=<code>"logo "</code>><a href=<code>"http://www.kissdrdrebeats.com/ "</code>><img src=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/images/logo.gif"</code> alt=<code>"Powered by Zen Cart :: The Art of E-Commerce"</code> title=<code>" Powered by Zen Cart :: The Art of E-Commerce "</code> width=<code>"320"</code> height=<code>"72"</code> <code>/></</code>a><<code>/div> <br/> <br/><div class="list" style="float:right; "> <br/> <br/><div class="languages-wrapper "> <br/> <br/> <form name="currencies_form" action="http:/www.kissdrdrebeats.com/</code><code>" method="</code>get <code>"><select name="</code>currency<code>" onchange="</code>this.form.submit(); <code>"><br/>  <option value="</code>USD<code>" selected="</code>selected <code>">US Dollar</option><br/>  <option value="</code>CNY <code>">CNY</option><br/>  <option value="</code>EUR <code>">Euro</option><br/>  <option value="</code>GBP <code>">GB Pound</option><br/>  <option value="</code>CAD <code>">Canadian Dollar</option><br/>  <option value="</code>AUD <code>">Australian Dollar</option><br/></select><br/><input type="</code>hidden<code>" name="</code>main_page<code>" value="</code>product_info<code>" /><input type="</code>hidden<code>" name="</code>products_id<code>" value="</code>42<code>" /></form> <label class="</code>float-right<code>" style="</code>font-size:14px;font-weight:bold; <code>">  Currency:</label> <br/> <br/> <br/> <ul class="</code>list-style-none<code>" style="</code>float:left;<code>" id="</code>headlogin <code>"> <br/>    <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=login ">Log In</</code>a> <br/> or <a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=create_account "</code>>Register<<code>/a> <br/></</code>div> <br/> <br/><div style=<code>"float:right; margin-top:8px;"</code> > <br/> <form name=<code>"quick_find_header"</code> action=<code>"http://www.kissdrdrebeats.com/index.php?main_page=advanced_search_result"</code> method=<code>"get "</code>><input type=<code>"hidden"</code> name=<code>"main_page"</code> value=<code>"advanced_search_result"</code> <code>/><input type="hidden" name="search_in_description" value="1" /</code>><div class=<code>"search-header-input "</code>><input type=<code>"text"</code> name=<code>"keyword"</code> size=<code>"6"</code> maxlength=<code>"30"</code> style=<code>"width: 138px"</code> value=<code>"Search for..."</code> onfocus=<code>"if (this.value == 'Search for...') this.value = '';"</code> onblur=<code>"if (this.value == '') this.value = 'Search for...';"</code> <code>/></</code>div><input class=<code>"button-search-header"</code> type=<code>"image"</code> src=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/images/search_header_button.gif"</code> value=<code>"Serch"</code> <code>/></</code>form><<code>/div> <br/><div style="float:right; margin-top:8px;  "> <br/>                 <div id="cartBoxEmpty "><a href="http:/www.kissdrdrebeats.com/</code>index.php?main_page=shopping_cart <code>"><img class="</code>cart-icon empty float-left<code>" src="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/includes/</code>templates<code>/monsterbeats/</code>images<code>/spacer.gif" /</code>><<code>/a>Your cart is empty</</code>div> <br/> <br/><<code>/div> <br/></</code>div> <br/><div class=<code>"clearBoth"</code> <code>/></</code>div> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/><div id=<code>"menu "</code>> <br/> <br/><div id=<code>"navEZPagesTop "</code>> <br/><ul> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php "</code>>Home<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/ "</code>>All Products<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=shippinginfo "</code>>Shipping & Returns<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=Coupons "</code>>Coupons<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=Wholesale "</code>>Wholesale<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=FAQ "</code>>FAQ<<code>/a></</code>li> <br/> <li><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=contact_us "</code>>Contact Us<<code>/a></</code>li> <br/> <br/><<code>/ul> <br/></</code>div> <br/> <br/><<code>/div> <br/> <br/></</code>div> <br/> <br/><table width=<code>"100%"</code> border=<code>"0"</code> cellspacing=<code>"0"</code> cellpadding=<code>"0"</code> id=<code>"contentMainWrapper "</code>> <br/> <tr> <br/> <br/> <td id=<code>"navColumnOne"</code> class=<code>"columnLeft"</code> style=<code>"width: 190px "</code>> <br/><div id=<code>"navColumnOneWrapper"</code> style=<code>"width: 190px "</code>> <br/><div class=<code>"leftBoxContainer"</code> id=<code>"categories"</code> style=<code>"width: 190px "</code>> <br/><div class=<code>"sidebox-header-left main-sidebox-header-left "</code>><h3 class=<code>"leftBoxHeading main-sidebox-header-right"</code> id=<code>"categoriesHeading "</code>>Categories<<code>/h3></</code>div> <br/><div id=<code>"categoriesContent"</code> class=<code>"sideBoxContent "</code>><br/><div class=<code>"categories-top-list no-dots "</code>><a class=<code>"category-top"</code> href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>2011 New Dr Dre Studio For Christmas Gifts<<code>/a></</code>div><br/><div class=<code>"categories-top-list  "</code>><a class=<code>"category-top"</code> href=<code>"http://www.kissdrdrebeats.com/2011-dr-dre-studio-teams-logo-headphones-c-6.html "</code>>2011 Dr Dre Studio Teams Logo Headphones<<code>/a></</code>div><br/><div class=<code>"categories-top-list  "</code>><a class=<code>"category-top"</code> href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-nate-robinson-c-9.html "</code>>2011 Monster Beats Studio Nate Robinson<<code>/a></</code>div><br/><div class=<code>"categories-top-list  "</code>><a class=<code>"category-top"</code> href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html "</code>><span class=<code>"category-subs-selected "</code>>2011 Monster Beats Studio Transformers<<code>/span></</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-butterfly-c-13.html <code>">Monster Beats Butterfly</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-by-dr-dre-power-c-25.html ">Monster Beats By Dr Dre Power</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-by-dr-dre-tour-c-16.html <code>">Monster Beats By Dr Dre Tour</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-dr-dre-diddy-c-10.html ">Monster Beats Dr Dre Diddy</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-dr-dre-pro-c-5.html <code>">Monster Beats Dr Dre Pro</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-dr-dre-solo-c-12.html ">Monster Beats Dr Dre Solo</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-dr-dre-solo-hd-c-19.html <code>">Monster Beats Dr Dre Solo HD</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-dr-dre-wireless-bluetooth-c-24.html ">Monster Beats Dr Dre Wireless Bluetooth</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-miles-davis-tribute-c-20.html <code>">Monster Beats Miles Davis Tribute</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-studio-c-3.html ">Monster Beats Studio</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-studio-diamond-c-14.html <code>">Monster Beats Studio Diamond</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-studio-dr-dre-ferrari-c-7.html ">Monster Beats Studio Dr Dre Ferrari</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-studio-dr-dre-graffiti-c-17.html <code>">Monster Beats Studio Dr Dre Graffiti</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-studio-justin-bieber-c-1.html ">Monster Beats Studio Justin Bieber</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-studio-kobe-bryant-c-2.html <code>">Monster Beats Studio Kobe Bryant</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-studio-lamborghini-c-21.html ">Monster Beats Studio Lamborghini</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-studio-lebron-james-c-22.html <code>">Monster Beats Studio Lebron James</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-studio-michael-jackson-c-18.html ">Monster Beats Studio Michael Jackson</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-beats-studio-red-sox-c-15.html <code>">Monster Beats Studio Red Sox</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-beats-turbine-c-23.html ">Monster Beats Turbine</</code>a><<code>/div><br/><div class="categories-top-list  "><a class="category-top" href="http:/www.kissdrdrebeats.com/</code>monster-lady-gaga-heartbeats-c-11.html <code>">Monster Lady Gaga Heartbeats</a></div><br/><div class="</code>categories-top-list <code>"><a class="</code>category-top<code>" href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/monster-vmoda-crossfade-lp-c-26.html ">Monster V-MODA Crossfade LP</</code>a><<code>/div><br/></</code>div><<code>/div> <br/> <br/></</code>div><<code>/td> <br/>    <td id="columnCenter" valign="top "> <br/> <br/>    <div id="navBreadCrumb ">  <a href="http:/www.kissdrdrebeats.com/</code> <code>">Home</a> :: <br/>  <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-studio-transformers-c-8.html ">2011 Monster Beats Studio Transformers</</code>a> :: <br/>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones<br/><<code>/div> <br/> <br/> <br/> <br/> <br/> <br/><div class="centerColumn" id="productGeneral "> <br/> <br/> <br/><h1 id="productName" class="productGeneral ">2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones</</code>h1> <br/> <br/> <br/> <br/><form name=<code>"cart_quantity"</code> action=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-by-dr-dre-transformers-limited-edition-headphones-p-42.html?action=add_product"</code> method=<code>"post"</code> enctype=<code>"multipart/form-data "</code>><br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/><div id=<code>"productMainImage"</code> class=<code>"centeredContent back "</code>> <br/> <br/><noscript> <br/><a href=<code>"http://www.kissdrdrebeats.com/index.php?main_page=popup_image&pID=42"</code> target=<code>"_blank "</code>> <a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> ><img src=<code>"http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones.jpg"</code> alt=<code>"2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones"</code> title=<code>" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones "</code> width=<code>"300"</code> height=<code>"225"</code> <code>/></</code>a><br <code>/><span class="imgLink ">larger image</</code>span><<code>/a></</code>noscript> <br/><<code>/div> <br/> <br/> <br/><span id="productPrices" class="productGeneral "> <br/><span class="normalprice ">$479.00 </</code>span> <span class=<code>"productSpecialPrice "</code>>$209.90<<code>/span><span class="productPriceDiscount "><br /</code>>Save: 56% off<<code>/span></</code>span> <br/> <br/> <br/> <br/><ul id=<code>"productDetailsList"</code> class=<code>"floatingBox back "</code>> <br/> <li>Model: monster083<<code>/li><br/>  <br/>  <br/>  <br/></</code>ul> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <div id=<code>"cartAdd "</code>> <br/> Add to Cart: <input type=<code>"text"</code> name=<code>"cart_quantity"</code> value=<code>"1"</code> maxlength=<code>"6"</code> size=<code>"4"</code> <code>/><br /</code>><br <code>/><input type="hidden" name="products_id" value="42" /</code>><input type=<code>"image"</code> src=<code>"http://www.kissdrdrebeats.com/includes/templates/monsterbeats/buttons/english/button_in_cart.gif"</code> alt=<code>"Add to Cart"</code> title=<code>" Add to Cart "</code> <code>/>          </</code>div> <br/> <br/> <br/><br class=<code>"clearBoth"</code> <code>/> <br/> <br/> <br/> <br/> <br/> <div id="productAdditionalImages "> <br/>  <div id="dfse "></</code>div> <br/> <div class=<code>"centerBoxContent "</code>> <br/> <br/> <br/> <div class=<code>"additionalImages centeredContent back"</code> style=<code>"width:33%; "</code>><br/> <br/> <noscript><a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> target=<code>"_blank "</code>> <a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> ><img src=<code>"http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_001.jpg"</code> alt=<code>"2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones"</code> title=<code>" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones "</code> width=<code>"100"</code> height=<code>"75"</code> style=<code>"position:relative"</code> onmouseover=<code>"showtrail('images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_001.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);"</code> onmouseout=<code>"hidetrail();"</code> <code>/></</code>a><br <code>/><span class="imgLinkAdditional ">larger image</</code>span><<code>/a></</code>noscript><<code>/div><br/>    <div class="additionalImages centeredContent back" style="width:33%; "><br/>      <br/>      <noscript><a href="http:/www.kissdrdrebeats.com/</code>2011-monster-beats-studio-transformers-c-8.html<code>" target="</code>_blank <code>"> <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-studio-transformers-c-8.html" ><img src="http:/www.kissdrdrebeats.com/</code>images<code>/monsterbeats/</code>MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_002.jpg<code>" alt="</code>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones<code>" title="</code> 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones <code>" width="</code>100<code>" height="</code>75<code>" style="</code>position:relative<code>" onmouseover="</code>showtrail(<code>'images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_002.jpg'</code>,<code>'2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones'</code>,100,75,600,450,this,0,0,100,75);<code>" onmouseout="</code>hidetrail();<code>"  /></a><br /><span class="</code>imgLinkAdditional <code>">larger image</span></a></noscript></div><br/>    <div class="</code>additionalImages centeredContent back<code>" style="</code>width:33%; <code>"><br/>      <br/>      <noscript><a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-studio-transformers-c-8.html" target="_blank "> <a href="http:/www.kissdrdrebeats.com/</code>2011-monster-beats-studio-transformers-c-8.html<code>" ><img src="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/images/</code>monsterbeats<code>/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_003.jpg" alt="2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones" title=" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones " width="100" height="75" style="position:relative" onmouseover="showtrail('images/</code>monsterbeats<code>//</code>MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_003.jpg<code>','</code>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones<code>',100,75,600,450,this,0,0,100,75);" onmouseout="hidetrail();"  /></a><br /><span class="imgLinkAdditional ">larger image</span></a></noscript></div><br/><br class="clearBoth" /> <br/> <br/>    <div class="additionalImages centeredContent back" style="width:33%; "><br/>      <br/>      <noscript><a href="http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html" target="_blank "> <a href="http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html" ><img src="http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_004.jpg" alt="2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones" title=" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones " width="100" height="75" style="position:relative" onmouseover="showtrail('</code>images<code>/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_004.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);" onmouseout="hidetrail();"  /</code>><<code>/a><br /</code>><span class=<code>"imgLinkAdditional "</code>>larger image<<code>/span></</code>a><<code>/noscript></</code>div><br/> <div class=<code>"additionalImages centeredContent back"</code> style=<code>"width:33%; "</code>><br/> <br/> <noscript><a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> target=<code>"_blank "</code>> <a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> ><img src=<code>"http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_005.jpg"</code> alt=<code>"2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones"</code> title=<code>" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones "</code> width=<code>"100"</code> height=<code>"75"</code> style=<code>"position:relative"</code> onmouseover=<code>"showtrail('images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_005.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);"</code> onmouseout=<code>"hidetrail();"</code> <code>/></</code>a><br <code>/><span class="imgLinkAdditional ">larger image</</code>span><<code>/a></</code>noscript><<code>/div><br/>    <div class="additionalImages centeredContent back" style="width:33%; "><br/>      <br/>      <noscript><a href="http:/www.kissdrdrebeats.com/</code>2011-monster-beats-studio-transformers-c-8.html<code>" target="</code>_blank <code>"> <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-studio-transformers-c-8.html" ><img src="http:/www.kissdrdrebeats.com/</code>images<code>/monsterbeats/</code>MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_006.jpg<code>" alt="</code>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones<code>" title="</code> 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones <code>" width="</code>100<code>" height="</code>75<code>" style="</code>position:relative<code>" onmouseover="</code>showtrail(<code>'images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_006.jpg'</code>,<code>'2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones'</code>,100,75,600,450,this,0,0,100,75);<code>" onmouseout="</code>hidetrail();<code>"  /></a><br /><span class="</code>imgLinkAdditional <code>">larger image</span></a></noscript></div><br/><br class="</code>clearBoth<code>" /> <br/> <br/>    <div class="</code>additionalImages centeredContent back<code>" style="</code>width:33%; <code>"><br/>      <br/>      <noscript><a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/2011-monster-beats-studio-transformers-c-8.html" target="_blank "> <a href="http:/www.kissdrdrebeats.com/</code>2011-monster-beats-studio-transformers-c-8.html<code>" ><img src="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/images/</code>monsterbeats<code>/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_007.jpg" alt="2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones" title=" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones " width="100" height="75" style="position:relative" onmouseover="showtrail('images/</code>monsterbeats<code>//</code>MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_007.jpg<code>','</code>2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones<code>',100,75,600,450,this,0,0,100,75);" onmouseout="hidetrail();"  /></a><br /><span class="imgLinkAdditional ">larger image</span></a></noscript></div><br/>    <div class="additionalImages centeredContent back" style="width:33%; "><br/>      <br/>      <noscript><a href="http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html" target="_blank "> <a href="http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html" ><img src="http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_008.jpg" alt="2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones" title=" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones " width="100" height="75" style="position:relative" onmouseover="showtrail('</code>images<code>/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_008.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);" onmouseout="hidetrail();"  /</code>><<code>/a><br /</code>><span class=<code>"imgLinkAdditional "</code>>larger image<<code>/span></</code>a><<code>/noscript></</code>div><br/> <div class=<code>"additionalImages centeredContent back"</code> style=<code>"width:33%; "</code>><br/> <br/> <noscript><a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> target=<code>"_blank "</code>> <a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> ><img src=<code>"http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_009.jpg"</code> alt=<code>"2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones"</code> title=<code>" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones "</code> width=<code>"100"</code> height=<code>"75"</code> style=<code>"position:relative"</code> onmouseover=<code>"showtrail('images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_009.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);"</code> onmouseout=<code>"hidetrail();"</code> <code>/></</code>a><br <code>/><span class="imgLinkAdditional ">larger image</</code>span><<code>/a></</code>noscript><<code>/div><br/><br class="clearBoth" /</code>> <br/> <br/> <div class=<code>"additionalImages centeredContent back"</code> style=<code>"width:33%; "</code>><br/> <br/> <noscript><a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> target=<code>"_blank "</code>> <a href=<code>"http://www.kissdrdrebeats.com/2011-monster-beats-studio-transformers-c-8.html"</code> ><img src=<code>"http://www.kissdrdrebeats.com/images/monsterbeats/MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_010.jpg"</code> alt=<code>"2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones"</code> title=<code>" 2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones "</code> width=<code>"100"</code> height=<code>"75"</code> style=<code>"position:relative"</code> onmouseover=<code>"showtrail('images/monsterbeats//MonsterBeatsByDr.DreTransformersLimitedEditionHeadphones_010.jpg','2011 Monster Beats By Dr. Dre Transformers Limited Edition Headphones',100,75,600,450,this,0,0,100,75);"</code> onmouseout=<code>"hidetrail();"</code> <code>/></</code>a><br <code>/><span class="imgLinkAdditional ">larger image</</code>span><<code>/a></</code>noscript><<code>/div><br/><br class="clearBoth" /</code>> <br/> <br/><<code>/div></</code>div> <br/> <br/> <br/> <br/><div id=<code>"productDescription"</code> class=<code>"productGeneral biggerText "</code>><p>Advanced driver design for precise audio <br> Extra large speaker drivers for super deep bass<br> High powered digital amplifier plays hip hop, rock, R+B and more loud, without distortion<br> Monster headphone cable with Quadripole twisted pair construction for balanced sound and clarity<<code>/p><p><strong>What's In The Box</</code>strong><<code>/p><p>Beats Studio headphones<br>  Monster Cable headphone cable<br>  Rigid Tour case<br>  Anti-Microbial Cleaning cloth<br>  1/</code>8 to 1<code>/4" Adapter<br>  Monster iSoniTalk iPhone enabled headphone </</code>p><<code>/div> <br/> <br/> <br/><br class="clearBoth" /</code>> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/><<code>/form> <br/> <br/></</code>div> <br/><<code>/td> <br/> <br/> <br/>  </</code>tr> <br/><<code>/table> <br/> <br/> <br/><div id="navSuppWrapper "> <br/> <br/><div id="navSupp "> <br/><ul><li><a href="http:/www.kissdrdrebeats.com/</code>index.php <code>">Home</a></li> <br/><li>   <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=shippinginfo ">Shipping</</code>a><<code>/li> <br/><li>   <a href="http:/www.kissdrdrebeats.com/</code>index.php?main_page=Wholesale <code>">Wholesale</a></li> <br/><li>   <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=privacy ">Privacy</</code>a><<code>/li> <br/><li>   <a href="http:/www.kissdrdrebeats.com/</code>index.php?main_page=Tracking <code>">Order Tracking</a></li> <br/><li>   <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=Coupons ">Coupons</</code>a><<code>/li> <br/><li>   <a href="http:/www.kissdrdrebeats.com/</code>index.php?main_page=conditions <code>">Conditions of Use</a></li> <br/><li>   <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=FAQ ">FAQ</</code>a><<code>/li> <br/><li>   <a href="http:/www.kissdrdrebeats.com/</code>index.php?main_page=Payment_Methods <code>">Payment Methods</a></li> <br/><li>   <a href="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/index.php?main_page=contact_us ">Contact Us</</code>a><<code>/li> <br/> <br/> <br/></</code>ul> <br/> <br/><<code>/div> <br/><DIV  align="center "> <a href="http:/www.kissdrdrebeats.com/</code>2011-monster-beats-studio-transformers-c-8.html<code>" ><IMG src="</code>http:<code>//</code>www.kissdrdrebeats.com<code>/includes/</code>templates<code>/monsterbeats/</code>images<code>/paymentcart.jpg" width="473" height="37 "></</code>a> <<code>/DIV> <br/><div align="center ">Copyright Â© 2012 All Rights Reserved. </</code>div> <br/> <br/> <br/><<code>/div> <br/></</code>div> <br/> <br/> <br/> <br/> <br/><strong><a href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>2011 New Dr Dre Studio For Christmas Gifts<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>Cheap Dr Dre Studio<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>Monster Studio Diamond Beats<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>Dr Dre Diamond Sale<<code>/a></</code>strong><br><br/><strong><a href=<code>"http://www.kissdrdrebeats.com/2011-new-dr-dre-studio-for-christmas-gifts-c-4.html "</code>>Dr Dre Studio For Christmas<<code>/a></</code>strong><br><br/><br><br><a href=<code>"http://blog.acheapbagsale.com"</code>> headphones blog <<code>/a><br><br><a href="http:/blog.kissmbtboots.com"> headphones  </</code>a><br><br><a href=<code>"http://blog.ringsday.com"</code>> About kissdrdrebeats.com blog </a> </div> </div> </div> </div> <div class="category"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ugg">ugg</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div id="category26"> <div class="subcategory"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ugg/180">180</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div style="clear:both"/> <div id="subcategory52"> <div class="problem"> <h3><a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ugg/180/180">180</a></h3> <div class="solutions" id="problem362"> <strong><a href=<code>"http://www.freshmoncler.com/ "</code>>moncler<<code>/a></</code>strong><strong><a href=<code>"http://www.freshmoncler.com/ "</code>>moncler coat<<code>/a></</code>strong>The sorts of lighting found in a area can noticeably change exactly how that room in your home looks. Lighting generally is a complicated dilemma, so let<code>'s begin by defining various lighting words. <br /><br/><br /><br/>Incandescent signals. These lights supply a nice, golden glow into a room. <strong><a href="http://www.freshmoncler.com/ ">moncler vest</a></strong>There'</code>re much nicer to utilize than this cheaper on the lookout flourescent equipment. <br <code>/><br/><br /</code>><br/>Downlights usually are round or perhaps square cannisters, commonly metal, which might be recessed directly into or secured onto a ceiling. These lights may very well be used simply because spotlights, floodlights or maybe for basic lighting. <br <code>/><br/><br /</code>><br/>Table lamps can be employed as project lighting or perhaps for overall lighting. <br <code>/><br/><br /</code>><br/>Uplights are usually one-bulb lights which can be placed on to the ground behind pieces of furniture, glass shelving or plants to supply them some sort of dramatic accentuation. <strong><a href=<code>"http://www.freshmoncler.com/ "</code>>moncler jackets<<code>/a></</code>strong><br <code>/><br/><br /</code>><br/>Strip lighting can be employed behind drawers and about stairs together with platforms to get a dramatic direct result. The networks lit in this way can seems to be floating above the ground. <br <code>/><br/><br /</code>><br/>Trail Lighting. A track can help you use a single electrical outlet to provide electricity to numerous lights along side track<code>'s length of time. The track is usually surface affixed or recessed. <strong><a href="http://www.freshmoncler.com/ ">discount moncler jackets</a></strong>Track lighting is amongst the most adaptable lighting solutions available and will be changed around for you to accent different aspects of a bedroom. <br /><br/><br /><br/>Track lighting products and recessed lighting is usually set to make an benefit called retaining wall washing which unfortunately, as that sounds, washes a total wall by using light. <br /><br/><br /><br/>Dimmer clicks give the chance to provide an alternative level about light through turning any knob. Dimmers help save electricity and gives mood lighting products for exclusive occasions. <strong><a href="http://www.freshmoncler.com/moncler-accessories-sale-c-1.html ">Moncler accessories</a></strong><br /><br/><br /><br/>Different rooms in your own home need distinctive lighting. Halls and also stairs need to be well lit to stop accidents. Livingrooms need a number of lighting solutions:background, undertaking lights and also accent lighting products. The most effective lighting to get kitchens will be bright above your head lights and extra under-counter signals for endeavor lighting. <br /><br/><br /><br/>All forms of lighting fixtures can be located for whatever your expections may get. <strong><a href="http://www.freshmoncler.com/moncler-vest-women-sale-c-10.html ">cheap Moncler Vest</a></strong>They can easily run as a result of very low-priced to remarkably high price fixtures. <br /><br/><br /><br/>You will discover special considerations when working with lighting to get art or perhaps wall hangings. <br /><br/><br /><br/>For anyone who is lighting an individual picture and painting, try to position the light so that it does not really show a good reflection in the glass of your art bit. There happen to be special snapshot lights made specifically for lighting shots but most of these are a lot of effective simply because can mainly highlight the highest or bottom with the picture. Downlights undoubtedly are a good choice. <strong><a href="http://www.freshmoncler.com/moncler-womens-hoody-sale-c-12.html ">Moncler Womens Hoody</a></strong><br /><br/><br /><br/>When lighting a gaggle of pictures, it'</code>s easier to use man or women lights inside track lighting which might be positioned on the pictures. <br <code>/><br/><br /</code>><br/>Lighting sculptures is usually particularly complex. You are able to use uplights, downlights or perhaps strip lamps, depending with the sculpture and its particular placement. Experiment by using different devices and their particular placement to discover the best impact. <strong><a href=<code>"http://www.freshmoncler.com/moncler-men-jackets-sale-c-4.html "</code>>cheap moncler jacket on sale<<code>/a></</code>strong><br <code>/><br/><br /</code>><br/>Creative by using lighting really can enhance a person<code>'s decorating venture. Make use out of all the different different types of lighting to make your home a amazing showcase. So you might have gone released and bought yourself a furry friend that you are excited concerning teaching not to mention feeding but it really suddenly occurred to you you happen to be unsure about precisely how to feed the ferret and you may be wondering just what do ferrets try to eat. That is a wonderful question because like any living thing on earth, the eating habits plays a big factor while in the health as well as the quality about life that it will have. What do ferrets eat when they are young? What do ferrets eat when they are older? What do ferrets eat when they are babies? If these are among a person'</code>s questions, keep reading and we<code>'ll touch with those content. <strong><a href="http://www.freshmoncler.com/moncler-kids-sale-c-3.html "> Moncler Jackets on sale</a></strong><br /><br/><br /><br/>What Do Ferrets Eat as Little ones? <br /><br/><br /><br/>What undertake ferrets consume as babies is a great question simply because likely if you'</code>ve owned an old-fashioned pet such as a cat or a dog a person likely wanted to feed them puppy food or become supplemental milk with the pet retail store and ferrets are only not which usually hard so that you can feed due to that. Baby ferrets feed off the mother and tend to be weaned off by the breeder or perhaps pet store so that you can ever become one still, with that said, once you may have the the baby ferret he is already familiar with a diet consists of pellets. <br <code>/><br/><br /</code>><br/>What Do Ferrets Eat as Parents? <br <code>/><br/><br /</code>><br/>What complete ferrets eat as people is a different wonderful query however it is not complicated by using a ferret like some other species of animals. The simply thing ferrets usually do not fair certainly with in the way of pet meals are foods that incorporate fish mealtime and ferrets never like this in the least. Try to stay away from every fish centered food anytime purchasing any ferret cuisine pellets and as a make a difference of matter, ferrets like shaped food quite as good as pellets that look a little like rabbit foods. <br <code>/><br/><br /</code>><br/>An excellent quality snake food that could be extremely high in protein is often fed and also to a ferret but they really demand a high amount of protein and typically you ought to look just for food comprising at lowest 25-30% healthy proteins content. Always be sure to stay from the foods which might be easily attainable at a grocery retail store or food outlet as they quite simply are generally very cheaply made and do not provide the correct nutrition in a ferret. <br <code>/><br/><br /</code>><br/>What Do Ferrets Eat as Pleasures? <br <code>/><br/><br /</code>><br/>Ferrets thrive on a goody based method when assisting them matters but there are a few things to know before serving your dig up any goodies. Acceptable treats would be things just like fruits and vegetables but manufactured! What complete ferrets eat that are bad for them? Always stay away from chocolate, dog food, any type of raw steak and dairy. . <br><br><a href=<code>"http://blog.dressever.com"</code>> stroe blog <<code>/a><br><br><a href="http:/blog.bootsvillage.com"> stroe  </</code>a><br><br><a href=<code>"http://blog.superbootsonline.com"</code>> About freshmoncler.com blog </a> </div> </div> </div> </div> <div class="category"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ebel-watches">Ebel watches</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div id="category27"> <div class="subcategory"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ebel-watches/180">180</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div style="clear:both"/> <div id="subcategory53"> <div class="problem"> <h3><a href="/ruby+cpp+fsharp+erlang+csharp+haskell/ebel-watches/180/180">180</a></h3> <div class="solutions" id="problem369"> <br><strong><a href=<code>"http://www.watchcoltd.com/ "</code>>Hugo Boss Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/ "</code>>Hush Puppies Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/ "</code>>IWC Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/ "</code>>Jaeger-LeCoultre Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/a-lange-sohne-watches-c-567.html "</code>>A. Lange & Sohne watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/casio-watches-c-649.html "</code>>cheap Casio Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/breguet-watches-c-606.html "</code>>Breguet<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/hermes-watches-c-751.html "</code>>Hermes<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/casio-watches-c-649.html "</code>>Replica Casio Watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.watchcoltd.com/rolex-watches-c-923.html "</code>>replica Rolex Watches<<code>/a></</code>strong>. <br><br><a href=<code>"http://blog.linkpandora.com"</code>> watches blog <<code>/a><br><br><a href="http:/blog.biguggbootsoutlet.com"> watches  </</code>a><br><br><a href=<code>"http://blog.kindsofboots.com"</code>> About watchcoltd.com blog </a> </div> </div> </div> </div> <div class="category"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/rolex-online">rolex online</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div id="category28"> <div class="subcategory"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="/ruby+cpp+fsharp+erlang+csharp+haskell/rolex-online/180">180</a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> <div style="clear:both"/> <div id="subcategory54"> <div class="problem"> <h3><a href="/ruby+cpp+fsharp+erlang+csharp+haskell/rolex-online/180/180">180</a></h3> <div class="solutions" id="problem370"> <br><strong><a href=<code>"http://www.dressreplicawatches.com/a-lange-sohne-watches-c-567.html"</code>>A. Lange & Sohne watches<<code>/a></</code>strong><strong><a href=<code>"http://www.dressreplicawatches.com/a-lange-sohne-watches-c-567.html"</code>>Replica A. Lange & Sohne watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.dressreplicawatches.com/a-lange-sohne-watches-c-567.html"</code>>fake A. Lange & Sohne watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.dressreplicawatches.com/a-lange-sohne-watches-c-567.html"</code>>copy A. Lange & Sohne watches<<code>/a></</code>strong><br><strong><a href=<code>"http://www.dressreplicawatches.com/a-lange-sohne-watches-c-567.html"</code>>cheap A. Lange & Sohne watches<<code>/a></</code>strong><br><br><br><a href=<code>"http://blog.iamjewelers.com"</code>> online blog <<code>/a><br><br><a href="http:/blog.swarovskiuk.org"> online  </</code>a><br><br><a href=<code>"http://blog.allpandoracharms.com"</code>> About dressreplicawatches.com blog </a> </div> </div> </div> </div> <div id="footer"> <div class="box"> <b class="rtop"> <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b> </b> <div class="content"> <a href="http://langref.org/submit">submit problem</a> | <a href="mailto:rob@langref.org">contact</a> | sponsored by <a href="http://refactor.com.au/"><img alt="Refactor-small" border="0" src="/images/refactor-small.png?1233409755" style="vertical-align:middle; padding-bottom:5px" /></a> </div> <b class="rbottom"> <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b> </b> </div> </div> </div> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-4264032-1"; _udn = "langref.org"; urchinTracker(); </script> </body> </html>