Skip to content

Instantly share code, notes, and snippets.

View zelark's full-sized avatar

Aleksandr Zhuravlёv zelark

View GitHub Profile
@zelark
zelark / sort_epd.py
Last active December 25, 2015 13:59
Разносит файлы типа *_NN_* по директориям типа epdNN
#!/usr/bin/python3
import os
import re
from shutil import copyfile
# пути задаёшь как r'c:\path\path'
# хотя можно и так r'c:/path/path'
# путь к каталогам
@zelark
zelark / gist:7138549
Created October 24, 2013 14:44
mac book air
time dd if=/dev/zero bs=1024k of=tstfile count=1024
#Если LSN то Samsung, LP — LG.
ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
class Factorial:
def __init__(self):
self.cache = {}
def __call__(self, n):
if n not in self.cache:
if n == 0:
self.cache[n] = 1
else:
self.cache[n] = n * self.__call__(n - 1)
with tab
as (select 'aa' as p1, 'bb' as p2 from dual union all
select 'cc' as p1, 'dd' as p2 from dual union all
select 'ee' as p1, 'ff' as p2 from dual union all
select 'gg' as p1, 'hh' as p2 from dual)
select max(case when rownum = 1 then p1 || p2 end) as r1,
max(case when rownum = 2 then p1 || p2 end) as r2,
max(case when rownum = 3 then p1 || p2 end) as r3,
max(case when rownum = 4 then p1 || p2 end) as r4
create or replace procedure api(p1 out number,
p2 out number,
p3 out number)
as
begin
p1 := 1;
p2 := 2;
p3 := 3;
end api;
declare
l_number_i_am_interested_in number;
l_p2_dummy number;
l_p3_dummy number;
begin
api(p1 => l_number_i_am_interested_in,
p2 => l_p2_dummy,
p3 => l_p3_dummy);
end;
declare
l_number_i_am_interested_in number;
l_dummy number;
begin
api(p1 => l_number_i_am_interested_in,
p2 => l_dummy,
p3 => l_dummy);
end;
declare
l_number_i_am_interested_in number;
l_dummy number;
begin
api(p1 => l_number_i_am_interested_in,
p2 => l_dummy,
p3 => l_dummy);
dbms_output.put_line(l_dummy);
end;
create or replace procedure api(p1 out number,
p2 out number,
p3 out number,
p4 out number,
p5 out number,
p6 out number,
p7 out number,
p8 out number,
p9 out number)
as
declare
l_number_i_am_interested_in number;
l_dummy number;
begin
api(p1 => l_number_i_am_interested_in,
p2 => l_dummy,
p3 => l_dummy,
p7 => l_dummy,
p8 => l_dummy,
p9 => l_dummy,