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
/** | |
* Parte do Projeto LUX, em desenvolvimento desde 12 de novembro de 2016. | |
* | |
* Contém implementação do "Cálculo da Páscoa" pelo método tabular para | |
* datas no calendário Gregoriano, descrito em "Computus": | |
* | |
* https://en.wikipedia.org/wiki/Computus#Gregorian_calendar | |
* | |
* com adequações para o SQLite 3.7.13 ou mais recente, privilegiando o | |
* uso de datas no padrão ISO-8601. |
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
<?php | |
/** | |
* Extensão da classe PDO para SQLite, provendo "workaround" para | |
* bug no método de criação de funções em algumas versões de PHP | |
* e métodos de conveniência da extinta classe SQLite3. | |
* Exemplo de uso: | |
* try { | |
* $pdo = new SQLitePDO(); | |
* $pdo.connect("path_to/db.sqlite"); | |
* } catch(PDOException $e) { |
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
with separators as ( values (' '), (','), ('-'), ('.') ), | |
source (s) as ( select " Will, thought and action." ), | |
bag (q) as ( -- POSITIONS OF ALL SEPARATORS | |
with dim (len) as ( select length(s) from source ), | |
ndx (n) as ( | |
select 1 union all select n+1 from ndx, dim where n < len | |
) select 0 --> PSEUDO SEPARATOR IN FRONT OF SOURCE STRING | |
union all select n from ndx, source where substr(s, n, 1) in separators | |
union all select len+1 from dim --> PSEUDO SEPARATOR AT BOTTOM | |
), |