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
from random import * | |
from math import * | |
#GLOBAL VARIABLES | |
cards = range(0,52) | |
def randRange(in_lower, in_upper): | |
temp_range = in_upper - in_lower | |
return int(round((temp_range+0.5)*random() + (in_lower - 0.5))) |
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
# from py2.6 distr | |
# -*- coding: utf-8 -*- | |
""" | |
ast | |
~~~ | |
The `ast` module helps Python applications to process trees of the Python | |
abstract syntax grammar. The abstract syntax itself might change with | |
each Python release; this module helps to find out programmatically what |
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
class SendExceptionMiddleware(object): | |
def process_exception(self, request, exception): | |
""" | |
Load exceptions into CrashKit | |
Credits to wiz | |
http://djangosnippets.org/snippets/1483/ | |
""" | |
try: | |
env = {} |
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
<? | |
$domain = GetHostByName($REMOTE_ADDR); | |
if($_POST[submit1]) | |
{ | |
$f="INSERT INTO vote SET id_img='".$_POST['img1']."',rating='".$_POST['num']."',ipname='$domain'"; | |
$row=mysql_query($f); | |
} | |
else { echo "<b>click on vote!</b> or go back to <A HREF=http://agh.ge/form/vote/index.php>home page</A>";} |
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
from widgets.duration import DurationField as FDurationField | |
from widgets.duration import TimeDelta | |
from django.db.models.fields import Field | |
from django.core.exceptions import ValidationError | |
from django.db import connection | |
class DurationProxy(object): | |
def __init__(self, field): | |
self.field_name = field.name |
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
<!-- Sample usage: http://localhost/convert/gist.github.com/gists/128733 --> | |
<!-- Hardcoded charset bug to be sorted out yet --> | |
<?php $f = file("http://".$_SERVER['QUERY_STRING']); ?> | |
<?php header("Content-type: text/html; charset=cp1251"); ?> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> | |
<style> body { width: 320px !important; } nobr {white-space: normal !important; } dd { margin: 5px 10px;} </style> | |
<?php echo implode($f, "") ?> |
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
class BlogApp(Controller): | |
urls = { # will be deduced automatically | |
/ -> show list of users and blogs | |
/create/blog/ -> add a blog | |
/create/user/ -> add an user | |
/blog/:name/ -> connects to a blog page | |
/user/:name/ -> connects to an user page | |
} | |
ancestors = [ # these two controllers are subobjects |
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 | |
cd ~/.wine/drive_c/Program\ Files/2gis/3.0/ | |
LC_ALL=ru_RU.KOI8-R | |
LANG=ru_RU.UTF-8 | |
wine grym.exe |
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://docs.google.com/Doc?id=dfb6ztc2_87cmw6bpfx | |
Потому что хеши не решают проблемы, потому что не учитываются | |
Но обо всём поподробнее: | |
R1 В разных базах данных поддерживается разный набор свойств. | |
E: В базе postgresql есть имя sequence, а в mysql его нет. | |
E: В базе sqlite нет reference, а posgresql и mysql есть. | |
=> хеши будут специфичные для базы данных | |
=> подписывать миграции хешами нельзя. |
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://docs.google.com/Doc?id=dfb6ztc2_87cmw6bpfx | |
Потому что хеши не решают проблемы, потому что не учитываются | |
Но обо всём поподробнее: | |
R1 В разных базах данных поддерживается разный набор свойств. | |
E: В базе postgresql есть имя sequence, а в mysql его нет. | |
E: В базе sqlite нет reference, а posgresql и mysql есть. | |
=> хеши будут специфичные для базы данных | |
=> подписывать миграции хешами нельзя. |
OlderNewer