Skip to content

Instantly share code, notes, and snippets.

from itertools import permutations
n = 8
cols = range(n)
for vec in permutations(cols):
if n == len(set(vec[i]+i for i in cols)) \
== len(set(vec[i]-i for i in cols)):
print ( vec )
def board(vec):
@serdardalgic
serdardalgic / gist:4418009
Created December 31, 2012 07:05
My env output
AUTOJUMP_DATA_DIR=/home/serdar/.local/share/autojump
COMPIZ_CONFIG_PROFILE=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-mul4ItXjOX,guid=5155d28c2440137414256bc250e1350f
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_AUTOSTART_ID=10eaa167fb65712578135693646428093900000021100002
DESKTOP_SESSION=ubuntu
DISPLAY=:0
GDMSESSION=ubuntu
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_CONTROL=/run/user/serdar/keyring-ldgfV8
-- Turkce isimler sozlugu twitter : http://twitter.com/tserpico
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------
This file has been truncated, but you can view the full file.
/*
Türkiye'nin il, ilçe , semt, mahalle, posta kodu veritabanı
GÜNCEL : 19.04.2013
Kaynak : PTT
Oluşturan : http://www.twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk`;
CREATE TABLE `pk` (
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
/*
Guncel BIN LISTESI
twitter : http://twitter.com/tserpico
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `binlist`
-- ----------------------------
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
PRIMARY KEY (`il_id`),
KEY `il_adi` (`il_adi`) USING BTREE
) ENGINE=MyISAM;
-- ----------------------------
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@serdardalgic
serdardalgic / fourier_part1_rewrite.py
Created September 19, 2014 08:50
Haypat Fourier Transformation Rewrite
#!/usr/bin/python
import sys
import cmath
from math import pi
N = 100
c01 = [0.0] * N
cN1 = [0.0] * N
c02 = [0.0] * N
def number_shuffle(number)
number.to_s.split("").permutation.to_a.inject([]) {|arr, el| arr << el.join.to_i}
end