SELECT Authors.*, Books.*
FROM Authors INNER JOIN Books USING (ID);
# | ID | AuthorName | ID | BookName
curl https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore > .gitignore | |
curl https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore >> .gitignore | |
echo "db.sqlite3" >> .gitignore |
word = input('Enter a word:') | |
fp = open('/Users/deliseev/Downloads/litf-win.txt', 'r', encoding='cp1251') | |
words = (w.split()[0] for w in fp.readlines()) | |
nw = ''.join(sorted(word.upper())) | |
print(nw) | |
print([w for w in words if nw == ''.join(sorted(w.upper()))]) |
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Current File (Integrated Terminal)", | |
"type": "python", | |
"request": "launch", |
// Download archive .dbf files | |
const Fs = require('fs'); | |
const Path = require('path'); | |
const Axios = require('axios'); | |
async function download() { | |
const url = 'https://www.gnivc.ru/html/gnivcsoft/KLADR/Base.7z'; | |
const path = Path.resolve(__dirname, 'data', 'base.7z'); | |
if (Fs.existsSync(path)) { |
/** | |
* Heap's method | |
* https://stackoverflow.com/questions/9960908/permutations-in-javascript/37580979#37580979 | |
* @param permutation - array of numbers for permutation | |
*/ | |
function* permute(permutation: number[]): IterableIterator<number[]> { | |
const length = permutation.length; | |
let result = [...permutation]; | |
let i = 1; | |
let c = new Array<number>(length).fill(0); |
// drop leading zeroes from array | |
// TODO: make as polyfill | |
// e.g. https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/filter#Polyfill | |
const dropWhile = arr => arr.reduce( | |
(state, v) => (v === 0 && state.drop | |
? ({ arr: [...state.arr], drop: true }) | |
: ({ arr: [...state.arr, v], drop: false })), { arr: [], drop: true }, | |
).arr; |
ctx.fillStyle = | |
"#" + | |
( | |
((Math.cos(r) * 127 + 128) << 16) | | |
((Math.cos(r + pi2 / 3) * 127 + 128) << 8) | | |
(Math.cos(r + (pi2 / 3) * 2) * 127 + 128) | |
).toString(16); |
yarn create react-app ... | |
yarn add -D eslint-config-prettier eslint-plugin-prettier husky lint-staged prettier pretty-quick |
[ | |
{ | |
"model": "persons.person", | |
"pk": 1, | |
"fields": { | |
"last_name": "Гагарин", | |
"first_name": "Юрий", | |
"middle_name": "Алексеевич", | |
"dob": "1934-03-09" | |
} |