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
var loki = require('lokijs'), | |
db = new loki('test.json'); | |
// var users = db.addCollection('users'); | |
// загрузить базу | |
db.loadDatabase({},()=>{ | |
let users = db.getCollection('users') | |
// записать | |
function insert (name_str,val_str) { | |
users.insert({name:name_str, val:val_str}) |
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
Do { | |
# всего памяти | |
$os = Get-Ciminstance Win32_OperatingSystem | |
# свободная память / всего | |
$pctFree = [math]::Round(($os.FreePhysicalMemory/$os.TotalVisibleMemorySize)*100,2) | |
$free = [math]::Round($os.FreePhysicalMemory/1024/1024) | |
# массив | |
$ProcArray = @() | |
# получить процессы с группировкой | |
$Processes = get-process | Group-Object -Property ProcessName |
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 package test_pkg is | |
cursor c_zaj(p#obj_id number ) is | |
select zaj.id | |
, zaj.id_cus | |
, zaj.sum_crd | |
, zaj.targ | |
from exp_zaj zaj | |
where zaj.id = p#obj_id; | |
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
<html> | |
<head> | |
<title>Maps of objects</title> | |
<script src="data.js"></script> | |
</head> | |
<body> | |
<div id="mapdiv"></div> | |
<script src="http://www.openlayers.org/api/OpenLayers.js"></script> | |
<script> |
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
def headerRow | |
def rowList = new ArrayList<ReportRow>(); | |
def dataXml = new XmlSlurper().parse("./employee.xml"); | |
def sb = new StringBuffer(); | |
def getKeyValue(obj, type) { | |
def String res | |
if (type == "key") { | |
res = obj.getProperties().findAll{name,value -> name != 'class'}.sort{(it.key.toString() =~ /\d+/)[0].toInteger()}.collect{it.key}.join(',') | |
} |
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
@Grab("org.apache.poi:poi:3.16") | |
@Grab("org.apache.poi:poi-ooxml:3.16") | |
import org.apache.poi.xssf.usermodel.*; | |
import org.apache.poi.ss.usermodel.*; | |
import org.apache.poi.xssf.streaming.*; | |
def csvToExelNotExists() { | |
try { | |
String csvFileAddress = "./test.csv"; | |
String xlsxFileAddress = "./autos.xlsx"; |
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
#parsing xml | |
ru.gpb.mule.util.Utils.makeString(payload) | |
def response = new XmlSlurper().parseText(payload) | |
def reestr = new XmlSlurper().parseText(response as String) | |
def code = reestr.CreditRequest.@Code | |
println(reestr.CreditRequest.@Code) | |
return response | |
#create json | |
def ob = [:]; |
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
#коллекция | |
allDocs = [:] | |
model.documents.each{ | |
allDocs.put(it.code, it.count) | |
} | |
params.add(new SimpleDateFormat("dd/MM/yyyy").format(new Date())) | |
def jms = new XmlSlurper().parseText(payload) |
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
// конверт даты приходит "yyyy-MM-dd" выходит "yyyy-MM-dd'T'HH:mm:ss.SSS" | |
def convertDate (date_str) { | |
if (date_str != "") { | |
date = Date.parse("yyyy-MM-dd",date_str) | |
return date.format("yyyy-MM-dd'T'HH:mm:ss.SSS") | |
} else { | |
return "1900-01-01" | |
} | |
} |
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
def main = [:] | |
main.myList = [] | |
def addToList(list,name,con1,con2,con3,res) { | |
name = [:] | |
name.con1 = con1 | |
name.con2 = con2 | |
name.con3 = con3 | |
name.res = res | |
list.push(name) |