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
asd |
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
set nocompatible | |
"Включаем распознавание типов файлов и типо-специфичные плагины: | |
filetype on | |
filetype plugin on | |
filetype plugin indent on | |
"Настройки табов для Python, согласно рекоммендациям | |
set tabstop=4 | |
set shiftwidth=4 |
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
set prefix C-a | |
unbind-key C-b | |
bind-key C-a send-prefix |
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
set incsearch | |
set hlsearch | |
autocmd CursorMoved * exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'')) |
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 types | |
classobj = types.ClassType | |
def check_base_type(arg, nested=False): | |
msgs = [] | |
if isinstance(arg, tuple) and not nested: | |
[check_base_type(a, True) for a in arg] |
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 <string> | |
#include <sstream> | |
#include <assert.h> | |
class Time { | |
public: | |
std::string whatTime(int seconds); | |
}; |
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
(package-initialize) | |
(require 'whitespace) | |
;; (setq whitespace-style '(face empty tabs lines-tail trailing)) | |
(setq whitespace-style '(face empty tabs trailing)) | |
(global-whitespace-mode t) | |
(setq whitespace-line-column 300) | |
(setq org-directory "~/Dropbox/org/") | |
(setq next-line-add-newlines nil) |
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 random | |
import MySQLdb | |
db=MySQLdb.connect(db="task", user='root') | |
def get_query(): | |
def get_date(): | |
year = str(random.randint(2011, 2012)) | |
month = str(random.randint(1, 12)) |
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
# What's wrong in the code? | |
# A: No call to parent __init__. To call, uncomment the code | |
class A: | |
def __init__(self): | |
self._greeting = 'hello' | |
def greet(self): | |
print self._greeting | |
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 A: | |
def __init__(self): | |
# self = B instance, when mangled, __value is replaced | |
# by _CurrentClass__value , so self.__dict__['_A__value'] = 1 | |
self.__value = 1 | |
self.__a = 123 | |
def getvalue(self): | |
print self.__a # OK | |
return self.__value # Error - because of assignment in B.__init__ |
NewerOlder