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
Структура 1, нормализованная: | |
(см. так же https://gist.github.com/metametaclass/be35b1d3c5e8c94c9364 для запроса отчета по оборотам или корресподенции счетов в подобной структуре) | |
таблица "Проводки" | |
* ID | |
* Дата | |
* Сумма | |
* Подразделение | |
PK(ID) | |
Индекс(Подразделение, Дата) |
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
Дано: база данных, представляющая собой список именнованных таблиц в виде пар "метаданные", "данные". | |
При этом данные представляют собой последовательность хэшмапов. | |
В качестве имен полей и таблиц используются keywords. | |
Например: | |
(def table1-metadata | |
{:fields [{:name :f1 :type :integer} | |
{:name :f2 :type :string} |
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
(ns etl.service | |
(:require [clojure.tools.logging :as log]) | |
(:use com.tekinsoft.log4j) | |
(:require com.tekinsoft.settings) | |
(:require [clojure.java.io :as java-io]) | |
(:require clojure.stacktrace) | |
(:import [java.util.concurrent TimeUnit Executors]) | |
) |
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
(ns etl.main | |
(:use etl.service) | |
(:use etl.redmine) | |
(:gen-class | |
:name etl.main | |
:methods [ #^{:static true} [start ["[Ljava.lang.String;"] void] | |
#^{:static true} [stop ["[Ljava.lang.String;"] void] |
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
2014-12-01 17:32:49,400 20327390 [pool-1-thread-1] (logging.clj:270) ERROR com.tekinsoft.service - java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 6 to TIMESTAMP. | |
at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:1055) |
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
//[2:55:38 AM] Неродюк Александр: есть функиции типа sum(a,b) и mul(a,b), div(a,b)... и т.д. | |
//[2:56:48 AM] Неродюк Александр: необходимо написать такую функцию make, которая: | |
//[2:57:04 AM] Неродюк Александр: x = make(1)(2)(3); | |
//[2:57:52 AM] Неродюк Александр: y = x(4)(5); | |
//[2:58:15 AM] Неродюк Александр: x(sum) = 6 | |
//[2:58:26 AM] Неродюк Александр: y(sum) = 15 | |
//[2:58:47 AM] Неродюк Александр: обязательно через замыкания | |
//[2:59:15 AM] Неродюк Александр: это на собседовании задачка такая | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <net/if.h> | |
#include <linux/if_tun.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/ioctl.h> | |
#include <sys/stat.h> |
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
(ns FBRest.registers.flatten_tree | |
(:require [clojure.zip :as zip]) | |
(:require [clojure.string :as str]) | |
(:use [clojure.tools.logging]) | |
(:require [clojure.java.jdbc :as sql]) | |
(:use [FBRest.registers.common :only [add-zeroes]]) | |
) | |
(defn get-name-by-ref-id |
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
(ns FBRest.registers.zhurnal_order | |
(:use FBRest.registers.account_sql) | |
(:use FBRest.registers.nalogreg) | |
(:use [clojure.tools.logging]) | |
) | |
;;-------------------------------------------------- | |
;;журнал-ордер |
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
(use 'codegen) | |
(use 'clojure.pprint) | |
(defDclass | |
TTree3Element | |
ID integer | |
;Position integer | |
Sort string | |
Number string |
OlderNewer