This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Restartable(object): | |
@classmethod | |
def __new__(cls, *args, **kwargs): | |
ret = super(Restartable, cls).__new__(*args, **kwargs) | |
ret.__initargs__ = (args[1:], kwargs) | |
return ret | |
# this is something like a clone with __getinitargs__ but let's not call | |
# it a clone because it's semantically different--i.e. explicitly discards | |
# any state other than the initial one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding: utf-8 | |
import socket | |
import time | |
s = socket.socket() | |
#host = '195.50.209.244' | |
host = '127.0.0.1' | |
#port = 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#define DEBUG | |
#include "smartasspointer.h" | |
struct spaceship_t { /* extends */ smartass_t _; | |
const char* name; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <cassert> | |
#include <string> | |
using std::vector; | |
using std::cout; | |
using std::endl; | |
using std::string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Fact { | |
static private int factorial(int n) { | |
int ret = 1; | |
for (int j = n; j > 0; j -= 1) { | |
ret *= j; | |
} | |
return ret; | |
} | |
static private void bench() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def selfdocumenting(f): | |
f.__doc__ = inspect.getsource(f) | |
return f | |
# well written method | |
@selfdocumenting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Selver</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<link rel="stylesheet" href="reset.css" type="text/css" media="screen, print, projection" /> | |
<link rel="stylesheet" href="style.css" type="text/css" media="screen, print, projection" /> | |
<script type="text/javascript" src="jquery-1.4.3.min.js"></script> | |
<link href="jquery.loadmask.css" rel="stylesheet" type="text/css" /> | |
<script type="text/javascript" src="jquery.loadmask.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>img</title> | |
<link rel="stylesheet" href="css/supersized.css" type="text/css" media="screen" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>img</title> | |
<link rel="stylesheet" href="css/supersized.css" type="text/css" media="screen" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<script type="text/javascript" src="js/supersized.3.1.3.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>Täheaabits</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |