This file contains 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
char *c[]={ | |
"ENTER", | |
"NEW", | |
"POINT", | |
"FIRST" | |
}; | |
char **cp[]={c+3,c+2,c+1,c}; | |
char ***cpp=cp; | |
main() | |
{ |
This file contains 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
(defun align-numbers (start end) | |
(interactive "r") | |
(let* ((reg (buffer-substring-no-properties start end)) | |
(parts (mapcar #'y:string-strip (split-string reg ","))) | |
(widest (apply #'max (mapcar #'length parts))) | |
(full (mapcar (lambda (s) | |
(concat (make-string (- widest (length s)) ? ) s)) | |
parts)) | |
(line (mapconcat #'identity full ", "))) | |
(delete-region start end) |
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
import random | |
import multiprocessing | |
def gen_case(): | |
return ['goat' if e else 'car' for e in random.sample(range(3), 3)] |
This file contains 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
;; http://forums.bgdev.org/index.php?showtopic=44083 | |
(defvar ace (/ 1 13)) | |
(defvar heart0 (/ 13 51)) | |
(defvar heart1 (/ 12 51)) | |
(defvar heart (/ (+ heart1 (* 3 heart0)) 4)) | |
(defvar probability (* ace heart)) | |
;; Our deck of cards: | |
;; 0-12 -- spades (2 3 4 5 6 7 8 9 10 jack queen king ace) |
This file contains 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
# -*- coding: utf-8 -*- | |
import importlib | |
import os | |
class ImproperlyConfigured(Exception): | |
pass | |
This file contains 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/env python2 | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from itertools import count | |
from math import sqrt | |
seqsum = lambda step, end: (step + end - (end % step)) * (end // step) // 2 |
This file contains 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/env python2 | |
# -*- coding: utf-8 -*- | |
import Queue | |
import functools | |
import itertools | |
import sys | |
import threading | |
import time |
This file contains 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
#!/bin/bash | |
# Usage: | |
# south2django17 PROJECT_ROOT_WHERE_ALL_THE_APPS_ARE | |
# This script will: | |
# 1. Backup all South migration files to /tmp | |
# 2. Delete these files | |
# 3. Run manage.py makemigrations | |
# 4. Run manage.py migrate | |
# http://is.gd/fbtuPF |
This file contains 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
local Proxy = {} | |
function Proxy:new(wrapped) | |
local instance = { __wrapped = wrapped } | |
setmetatable(instance, self) | |
return instance | |
end | |
function Proxy.__index(instance, attrname) | |
local attr = instance.__wrapped[attrname] |
This file contains 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 <cstdint> | |
#include <functional> | |
#include <iostream> | |
#include <map> | |
#include <string> | |
class Humanizator | |
{ | |
public: |
OlderNewer