Skip to content

Instantly share code, notes, and snippets.

View metametaclass's full-sized avatar

metametaclass metametaclass

  • Poland
View GitHub Profile
(ns codegen)
(def line "\r\n")
(def line2 "\r\n\r\n")
(def integer
{:delphiClass "integer" :valueType true
:read #(str %1 ":=so.I['" %1 "']")
:save #(str "so.I['" %1 "']:=" %1 )
(use 'codegen)
(use 'clojure.pprint)
(defDclass
TTree3Element
ID integer
;Position integer
Sort string
Number string
(ns main
(:use [clojure.string :only [trim split]])
(:import (java.io BufferedReader FileReader)))
(defn process-file-by-desc
"Process large file line-by-line with specified process functions"
([file-name process-list separator]
(let [zero (map first process-list)
module Main where
import Control.Monad(join)
table = [(1, "a", "b"),
(0, "c", "d"),
(2, "e", "f")]
[{ "service": "Firebird252" }
{ "service": "Firebird214" }
{ "service": "FirebirdServerDefaultInstance" }
{ "service": "PrometheusHWService" }
{ "service": "PrometheusRecalcService" }
{ "service": "PrometheusReplicationService" }
{ "file": "query.json" }
{ "database": {"name": "agnks"
"factory": "FirebirdSql.Data.FirebirdClient"
"connection": "database=agnks;User=cherv;Password=cherv;Dialect=3;Server=localhost;Charset=WIN1251"
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildProjectDirectory)\MSBuild.Community.tasks" />
<Target Name="Test">
<Message Text="Test build"/>
<ItemGroup>
<Frequencies Include="262;294;330;349;392;440;494;523"/>
<!--<Frequencies>262;294;330;349;392;440;494;523</Frequencies>-->
@metametaclass
metametaclass / gist:4292029
Created December 15, 2012 07:58
haskell hardware interaction pseudocode
main = do dataFromHW <- readSerialPort
dataFromUser <- readUIInput
(answerForDevice, answerForUser) <- goodProcessingFunction dataFromHW dataFromUser
writeSerialPort deviceAnswer
writeUIOutput answerForUser
case processResult answerForUser of
EOF -> return 0
Error i -> return i
Continue -> main
@metametaclass
metametaclass / gist:4294569
Created December 15, 2012 12:49
Environment.GetFolderPath
public static string GetFolderPath(Environment.SpecialFolder folder)
{
if (!Enum.IsDefined(typeof(Environment.SpecialFolder), folder))
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Arg_EnumIllegalVal"), new object[]
{
(int)folder
}));
}
StringBuilder stringBuilder = new StringBuilder(260);
[22:09] <cacodaemon> Why there is no exception information in frontend selection error in sdr#? Maybe catch(Exception e) and showing e.ToString() or e.Message would be better?
[22:10] <prog> have you tested your installation with rtl_test ?
[22:10] <cacodaemon> for example: RTL-SDR / USB is either not connected or its driver is not working properly.
[22:10] <cacodaemon> Unable to find an entry point named 'rtlsdr_set_offset_tuning' in DLL 'rtlsdr'.
[22:10] <cacodaemon> old version of rtlsdr :)
[22:11] <prog> that shouldn't happen if you followed the installation guide
[22:11] <cacodaemon> without exception information find out the reason for error somehow impossible :)
[22:11] <cacodaemon> no, i`m building from source
[22:11] <prog> there are only two cases
[22:11] <cacodaemon> and exception catching without logs or other means for user to fix it - not a good practice
procedure TTransactionProcess.OnAddChangeLog(Item:TChangeLog);
var td,tmp:TTableData;
chd:TChangeLogData;
begin
Log([' ',Item.Dump],LVL_DEBUG);
CheckIsInheritedFinished(Item.OPER);
chd:=nil;
td:=nil;
case Item.OPER of