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 system-is-linux() | |
(string-equal system-type "gnu/linux")) | |
(defun system-is-windows() | |
(string-equal system-type "windows-nt")) | |
;; | |
;; Информация о пользователе |
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 -*- | |
""" | |
python who_faster.py | |
step 1 | |
check_list 5.89978313446 | |
check_set 0.0123991966248 | |
check_dict 0.063777923584 | |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
Implement a console script that solves the standard Queens puzzle: | |
* Take an argument – size of the board (N). | |
* Place N chess queens on an N×N chessboard so that no two queens threaten each other. | |
* Print the number of possible solutions. | |
* Print the time that was required to solve the problem. |
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
#usage "<b>Snap silkscreen text on grid</b><hr/>\n" | |
"<author>Author: Ruslan Popov (ruslan.popov@gmail.com)</author>" | |
#require 6.05 | |
string VERSION = "1.0"; | |
int result = 0; // dialog result | |
string str; // temporary string | |
string cmd = "SET UNDO_LOG OFF;\n"; // script command to execute |
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 StringIO import StringIO | |
from cairo import ImageSurface, Context | |
from cairo import FORMAT_ARGB32, FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL | |
imagesize = (512,128) | |
surface = ImageSurface(FORMAT_ARGB32, *imagesize) | |
cr = Context(surface) | |
# paint background |
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
;;; monokai-theme.el --- REQUIRES EMACS 24: Monokai Color Theme for Emacs. | |
;; Copyright (C) 2012 Lorenzo Villani. | |
;; | |
;; Author: Lorenzo Villani <lorenzo@villani.me> | |
;; URL: https://github.com/lvillani/el-monokai-theme | |
;; Version: 0.0.10 | |
;; | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by |
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
#usage "<b>Generate name layers to panelize board</b>\n" | |
"<p>" | |
"Generates a command sequence which copies the name texts (support spin-flag) " | |
"of all elements of your layout into newly generated layers (125 and 126). " | |
"After running the ULP you can GROUP, CUT and PASTE your layout " | |
"to get an array of several boards. Make sure all layers are displayed before." | |
"<p>" | |
"The duplicated name texts in the new layers will not be changed. " | |
"Please notice that you have to deactivate layers 25 and 26 if you use " | |
"the CAM processor e.g. for generating gerber data. Instead, you have to activate " |
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
def days_count_for_date_range(index, begin, end): | |
""" | |
Метод для вычисления количества появлений определённого дня недели | |
внутри указанного диапазона дат, включительно. | |
@type index: integer | |
@param index: Индекс дня недели, понедельник=0. | |
@type begin: datetime.date | |
@param begin: Дата начала диапазона. | |
@type end: datetime.date |
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
def weekday_iterator(start=0): | |
""" This iterator generates the names | |
of week day starting from `start` day. """ | |
names = ('mo', 'tu', 'we', 'th', 'fr', 'sa', 'su',) | |
maximum = len(names) | |
i = 0 | |
while i < maximum: | |
index = (start + i) % maximum | |
value = names[index] | |
i += 1 |