from django.http import HttpResponse
import re
# Generate color themes for your favorite text editor
class MyClass(object):
def __init__(self, *args, **kwargs):
self.x = 10
def open(self, x, y):
return open('filename%d_%d' % (x, y))
# Currently supports TextMate, Vim and Emacs
@decorator(x="Test")
def article(request, url):
try:
article = Article.objects.get(url=url)
except:
raise Http404
# This example demonstrates how Python code will look
context = {
'article': article,
'title': article.title,
}
return render_to_response('codeapp/article.html', context)
#! /usr/bin/env ruby
class MyClass
def initialize(x, y)
@x = x
@y = y
end
# Generate color themes for your favorite text editor
attr_reader :x, :y
end
string = <<BLOCK
<< My Ruby program >>
BLOCK
test = string ~ /Ruby/
# Currently supports TextMate, Vim and Emacs
y = (1..1000)
numbers = ["ein", "zwei", "drei"]
# This example demonstrates how Ruby code will look
for s in numbers
puts ": " + s
end
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!-- Generate color themes for your favorite text editor -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/media/css/main.css" type="text/css" charset="utf-8" />
<!-- Currently supports TextMate, Vim and Emacs -->
<title>Sweyla - Color Theme Generator</title>
<script type="text/javascript" charset="utf-8">
function cmp(x, y) {
time = new Date().getTime();
alert(time);
return x < y;
}
</script>
</head>
<!-- This example demonstrates how HTML code with some Javascript will look -->
<body>
<p>Syntax highlighted HTML here.</p>
</body>
</html>
#include <iostream>
// Generate color themes for your favorite text editor
template <typename T>
class Piece
{
public:
Piece() : top(NULL), left(NULL) {}
private:
const static char a='a', b='c';
int picture[25][25];
T top, left;
};
// Currently supports TextMate, Vim and Emacs
int num_pieces = sizeof(int[10]);
Piece<int> pieces[0x100];
bool check = true && false;
// This example demonstrates how C++ code will look
int cmp(int x, int y)
{
printf("Entering cmp(%d, %d)\n", x, y);
return x < y;
}