Skip to content

Instantly share code, notes, and snippets.

View metametaclass's full-sized avatar

metametaclass metametaclass

View GitHub Profile
(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
(ns FBRest.registers.zhurnal_order
(:use FBRest.registers.account_sql)
(:use FBRest.registers.nalogreg)
(:use [clojure.tools.logging])
)
;;--------------------------------------------------
;;журнал-ордер
@metametaclass
metametaclass / gist:3266976
Created August 5, 2012 20:14
delphi codegen
(use 'codegen)
(use 'clojure.pprint)
(defDclass
TTree3Element
ID integer
;Position integer
Sort string
Number string
libusb-1.0.dll!usbi_log_v(libusb_context * ctx=0x00000000, usbi_log_level level=LOG_LEVEL_WARNING, const char * function=0x0cbccf50, const char * format=0x0cbccf5c, char * args=0x0c4eedd8) Line 1763 + 0x3 bytes C
libusb-1.0.dll!usbi_log(libusb_context * ctx=0x00000000, usbi_log_level level=LOG_LEVEL_WARNING, const char * function=0x0cbccf50, const char * format=0x0cbccf5c, ...) Line 1819 + 0x19 bytes C
libusb-1.0.dll!cancel_io(int _index=6) Line 117 + 0x13 bytes C
libusb-1.0.dll!_free_index(int _index=6) Line 397 + 0x9 bytes C
libusb-1.0.dll!usbi_free_fd(int fd=9) Line 430 + 0x9 bytes C
libusb-1.0.dll!windows_clear_transfer_priv(usbi_transfer * itransfer=0x0cbf86d8) Line 1750 + 0xb bytes C
libusb-1.0.dll!windows_transfer_callback(usbi_transfer * itransfer=0x0cbf86d8, unsigned int io_result=0, unsigned int io_size=16384) Line 1903 + 0x9 bytes C
libusb-1.0.dll!windows_handle_callback(usbi_transfer * itransfer=0x0cbf86d8, unsigned int io_result=0, unsigned int io_size=16384) Line 1916 + 0
let inline getName arg =
( ^a : (member Name : string) arg )
//function type:
//val inline getName :
// ^a -> string when ^a : (member get_Name : ^a -> string)
let inline dumpNamed<'T when 'T : (member Name : string)> (arg:seq<'T>) =
arg |> Seq.iter (getName >> printfn "%s")
@metametaclass
metametaclass / gist:3596947
Created September 2, 2012 11:07
clojure and math formulas
:Recalc [
;NB: 3 indexes for Cells array - SectionID,ColID,RowID
; Section var gets its value from :Section field
; no :Section field - default section 0
;TODO: support for default SectionID for expression (in client)
;-------------section1
{:Expr "Cell[Section,AllCol,114]:=Cell[Section,AllCol,115]-Cell[Section,AllCol,116]
" :Cycle "Cols" :Range cols-range :Section section-income-tax}
{:Expr "Cell[AllCol,119]:=Cell[AllCol,117]-Cell[AllCol,118]
генерация документа, последовательность вызовов:
Запрос /Generate/id-шаблона ; defroutes в FBRest.main
FBRest.document/generate-document ; просто транслятор вызова
FBRest.template/generate-document ; основная функция
FBRest.template/load-template ; загрузка шаблона и метаданных
FBRest.balans/tree3-template-get ; загрузка из БД записи шаблона
FBRest.balans/tree3-query-get ; три раза - строки, колонки, ячейки
FBRest.template/augment-metadata-db ;
FBRest.balans/calc-total-cells-and-elems ; итоговый документ - расчет суммарных ячеек
module TableThirdStage
open Utils
open ModelTypes
open ForeignKeyInfo
open LoadTableInfoIface
open TypesLoader
open TableLoader
open TableSecondStage
open Tekinsoft.meta
module Tekinsoft.agnks_fs
open Tekinsoft.Utils
open Tekinsoft.Types
open Tekinsoft.agnks
type TransactTypesVariant =
|OperSetCommonParam
|OperSetTaxRate
BOOST_FILESYSTEM_DECL
bool create_directories(const path& p, system::error_code* ec)
{
if (p.empty() || exists(p))
{
if (!p.empty() && !is_directory(p))
{
if (ec == 0)
BOOST_FILESYSTEM_THROW(filesystem_error(
"boost::filesystem::create_directories", p,