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
| -module('percentile'). | |
| -export([percentile/2]). | |
| -export([percentile95/1,percentile98/1]). | |
| percentile95(L)-> percentile(L,0.95). | |
| percentile98(L)-> percentile(L,0.98). | |
| percentile(L, P)-> | |
| K=(length(L) - 1) * P, | |
| F=floor(K), |
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
| """ | |
| Basic httpserver usefull for testing | |
| """ | |
| import SimpleHTTPServer | |
| import SocketServer | |
| import threading | |
| class JsonHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| """ |
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
| # | |
| # views.py | |
| # | |
| class ResumeNew(ProtectedMixin, CreateView): | |
| model = Resume | |
| form_class = ResumeForm | |
| success_url = '/accounts/profile/' | |
| template_name = 'resume/new.html' | |
| def get_initial(self): |
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
| %% -*- coding: utf-8 -*- | |
| %% | |
| %% Copyright (c) 2014 Rodolphe Quiédeville <rodolphe@quiedeville.org> | |
| %% | |
| %% 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 | |
| %% the Free Software Foundation, either version 3 of the License, or | |
| %% (at your option) any later version. | |
| %% | |
| %% This program is distributed in the hope that it will be useful, |
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
| SELECT | |
| CAST( | |
| UNNEST(string_to_array( | |
| array_to_string(most_common_vals, ','), ',' | |
| )) AS integer | |
| ) AS most_common_vals, | |
| CAST( |
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
| CREATE OR REPLACE FUNCTION hex_to_int(hexval varchar) RETURNS integer AS $$ | |
| DECLARE | |
| result int; | |
| BEGIN | |
| EXECUTE 'SELECT x''' || hexval || '''::int' INTO result; | |
| RETURN result; | |
| END; | |
| $$ | |
| LANGUAGE 'plpgsql' IMMUTABLE STRICT; |
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
| -- | |
| -- Simple serialization with PostgreSQL 9.5 | |
| -- | |
| -- | |
| -- Sample tables | |
| -- | |
| CREATE TABLE parc ( | |
| id serial primary key, name text, | |
| ratio int default 10, |
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
| ~# CREATE TABLE pocuui (id serial, extid uuid); | |
| CREATE TABLE | |
| ~# drop table pocuui ; | |
| DROP TABLE | |
| ~# CREATE TABLE pocuui (id int, extid uuid); | |
| CREATE TABLE | |
| ~# insert into po | |
| pocuui poire | |
| ~# insert into pocuui (id) values (generate_series(1,12)); | |
| INSERT 0 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
| CREATE OR REPLACE FUNCTION doctype_extensions_migration() | |
| RETURNS TRIGGER AS $BODY$ | |
| BEGIN | |
| IF (TG_OP = 'INSERT') THEN | |
| IF (NEW.exten IS NOT NULL) THEN | |
| NEW.exten_array | |
| = array_agg(trim(x.e)) |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am rodo on github. | |
| * I am rodo (https://keybase.io/rodo) on keybase. | |
| * I have a public key whose fingerprint is D9DA 64FF 732B 3876 2766 7AE7 177B F809 0835 E50E | |
| To claim this, I am signing this object: |
OlderNewer