Skip to content

Instantly share code, notes, and snippets.

@tsukanov-as
tsukanov-as / truffle-material.md
Created June 2, 2019 17:00 — forked from smarr/truffle-material.md
Truffle: Languages and Material
@tsukanov-as
tsukanov-as / test.lua
Last active May 12, 2019 20:16
LuaJit 2.1 beta 3 vs Rust 1.34.1 https://habr.com/ru/post/450512/
local json = require('rapidjson')
local path = "C:/temp/1.json"
local file = io.open(path, 'r')
local debtors, debtorsMap, company, phones, phone, debt, debtor
debtors = {}
$report = Select-String -Path .\history.mxl -Pattern "{`"#`"," | select Line
$ver = ""
for ($i = 0; $i -lt $report.count; $i++) {
if ($report[$i].Line.StartsWith("{`"#`",`"Version:`"}")) {
$raw = $report[$i+1].Line
$ver = $raw.Substring(6, $raw.Length - 8) -replace ","
}
}
using namespace System.Collections.Generic
#region Runtime
Add-Type -AssemblyName System.speech
$Ирина = New-Object System.Speech.Synthesis.SpeechSynthesizer
cls
$lib = @{
@tsukanov-as
tsukanov-as / conv.py
Created November 20, 2018 13:42
Конвертация отчета об ошибках конфигуратора в группированный список
import collections
f = open("C:/temp/синтаксические ошибки.txt", mode="r", encoding="utf-8")
m = collections.defaultdict(list)
for line in f.readlines():
i = line.index(" ")
m[line[:i]].append(line[i+1:])
@tsukanov-as
tsukanov-as / parse_bin.bsl
Created October 5, 2018 19:05
Парсинг скобочника методами DataReader (в два раза медленнее чем в рукопашку)
Procedure RunAtServer()
Reader = New DataReader("C:\temp\20180713000000.lgp");
Start = CurrentUniversalDateInMilliseconds();
If Reader.SkipTo("{") >= 0 Then
Delimeters = New Array;
Delimeters.Add("""");
@tsukanov-as
tsukanov-as / readme.md
Created September 27, 2018 20:11 — forked from artbear/readme.md
Как регулярными выражениями искать в Visual Studio Code многострочные строки - в т.ч. и пустые строки

В окне модуля - Ctrl+F

  • ^Процедура\s+[a-zA-Z0-9А-Яа-яёЁ_]+\(\)\s+Экспорт\s*\n\s*КонецПроцедуры
    • используем \n

В окне поиска файлов - Ctrl+Shift+F

  • ^Процедура\s+[a-zA-Z0-9А-Яа-яёЁ_]+\(\)\s+Экспорт\s*$[^\n]*\s*КонецПроцедуры
    • не используем \n
@tsukanov-as
tsukanov-as / uia-sample.ps1
Created September 26, 2018 18:16 — forked from xiongjia/uia-sample.ps1
A simple sample for access the MS UIAutomation in PowerShell. #devsample #win
#REQUIRES -Version 3.0
# This is a simple sample for access the MS UIAutomation in PowerShell.
# In this sample:
# 1. Load the MS UIA via System.Reflection.Assembly
# 2. Launch the AUT ( calc.exe )
# 3. Find the AutomationElement via the AUT Process Id
# 4. Find buttons via 'ClassName' and 'Name' property
# 5. Click the '1', '+', '1', '=' buttons.
# At last, we will get '2' in the result of calc App.
Procedure ParseFiles(Path) Export
Files = FindFiles(Path, "*.bsl", True);
Total = Files.Count();
MaxJobs = 8;
JobList = New Array(MaxJobs);
JobArgs = New Array(1);
Function Parse(Src, Pos = 1)
List = New Array;
Pos = Pos + 1; Chr = Mid(Src, Pos, 1);
If Chr = Chars.LF Then Pos = Pos + 1; Chr = Mid(Src, Pos, 1); EndIf;
Beg = Pos;
While Chr <> "" Do
If Chr = "{" Then
List.Add(Parse(Src, Pos));
Pos = Pos + 1; Chr = Mid(Src, Pos, 1);
If Chr = Chars.LF Then Pos = Pos + 1; Chr = Mid(Src, Pos, 1); EndIf;