Skip to content

Instantly share code, notes, and snippets.

View metametaclass's full-sized avatar

metametaclass metametaclass

  • Poland
View GitHub Profile
path get_known_folder_path(int nFolder)
{
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL, nFolder, NULL, SHGFP_TYPE_CURRENT, szPath)))
{
return path(szPath);
}
else
{
(println (str "<html>"))
(println (str "<body>"))
(println (str "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"))
(doseq [yr (range -20 20 )]
(let [[y dy] (if (< yr 0) [(- 0 yr) "n"] [(+ 1 yr) "s"])]
(println "<tr>")
(doseq [xr (range -35 50 )]
(let [[x dx] (if (< xr 0) [(- 0 xr) "w"] [(+ 1 xr) "e"])]
(println (str "<td><img src=\"" y dy x dx "_res.png\"></td>") )))
(doall (for [y (range 1 50)
x (range 1 50)
dy ["n" "s"]
dx ["e" "w"]
]
(println (str "http://imgs.xkcd.com/clickdrag/" y dy x dx ".png") )))
/**
* Check if the target SQL contains at least one of the escaped syntax
* commands. This method performs simple substring matching, so it may
* report that SQL contains escaped syntax when the <code>"{"</code>
* is followed by the escaped syntax command in regular string constants
* that are passed as parameters. In this case {@link #parse(String)} will
* perform complete SQL parsing.
*
* @param sql to test
* @return <code>true</code> if the <code>sql</code> is suspected to contain
(defn flatten-preprocessed-node
"convert preprocessed tree to linear sequence of items"
[[node-attrs children]]
(let [node-flags (:Flags node-attrs)
is-after (:after node-flags)
node-attrs-1 (update-in node-attrs [:Name] #(or % get-default-node-name))
;node-name (or (:Name node-attrs) get-default-node-name)
flatten-children (mapcat flatten-preprocessed-node children)]
(if is-after ;move node after children in output seq and in :Sort (index-path)
(vec (concat flatten-children [(update-in node-attrs-1 [:Path] conj 9999)]))
listEntity :: AppRoot -> String -> MyServerPartT Response
listEntity r w =
methodM [GET, POST] >> do
decodeBody reqPolicy
auth r w
AppState { dbCtx = ctx } <- ask
withData $ handle ctx w
where handle ctx t (TestGet p) =
do
(defn field
[name caption type]
{:Name name :Caption caption :FieldType type}
)
(defn param
([name caption type refer]
{:Name name :Caption caption :ParamType type :Reference refer})
([name caption type refer format default]
{:Name name :Caption caption :ParamType type :Reference refer :Format format :Default default})
public static Type GetIEnumerableOfTType<T>(IEnumerable<T> param) {
return typeof(T);
}
public Type GetAnonymousType() {
var data = from user in db.Users
where user.ID == 1
select new { ID=user.ID, UserName = user.Name};
return GetIEnumerableOfTType(data);
> kernel32.dll!_RaiseException@16() + 0x3c bytes
clr.dll!RaiseTheExceptionInternalOnly() + 0x172 bytes
clr.dll!IL_Throw() + 0xe3 bytes
mscorlib.ni.dll!7a0f05b4()
[Frames below may be incorrect and/or missing, no symbols loaded for mscorlib.ni.dll]
clr.dll!MethodTable::SetObjCreateDelegate() - 0x273400 bytes
clr.dll!MethodTable::CallFinalizer() + 0x75 bytes
clr.dll!WKS::CallFinalizer() + 0x80 bytes
clr.dll!WKS::GCHeap::TraceGCSegments() - 0x270b6b bytes
clr.dll!WKS::GCHeap::TraceGCSegments() - 0x270c2f bytes
#ifdef WANT_IP_FROM_PROXY
if( accesslist_isblessed( cookie->ip, OT_PERMISSION_MAY_PROXY ) ) {
ot_ip6 proxied_ip;
char *fwd = http_header( ws->request, ws->header_size, "x-forwarded-for" );
if( fwd && scan_ip6( fwd, proxied_ip ) ) {
syslog(LOG_DAEMON | LOG_DEBUG,"ip_from_proxy %s",fwd);
OT_SETIP( &ws->peer, proxied_ip );
} else
OT_SETIP( &ws->peer, cookie->ip );
} else