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
void Main() | |
{ | |
foreach(var t in typeof(test).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(test)))) | |
((test)(Activator.CreateInstance(t))).TestMethod(); | |
} | |
private abstract class test | |
{ | |
public abstract void TestMethod(); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace t1 | |
{ | |
static class Program | |
{ |
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
using System; | |
using System.Collections.Generic; | |
namespace t1 | |
{ | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
System.Reflection.Assembly.LoadWithPartialName("o.dll") | |
.GetTypes() | |
.SelectMany(x => x.GetConstructors()) | |
.Select(x => { try { return x.Invoke(null); } catch { return null; } }) | |
.Where(x => x != null) | |
.ToList() | |
.ForEach(x => { try { x.Dump(); } catch {} }); | |
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
#include <stdio.h> | |
void map(void (*fn)(void *, void *), size_t len, | |
void * in_vals, size_t in_len, | |
void * out_vals, size_t out_len) { | |
for (int i = 0; i < len; i++) | |
fn(in_vals + i * in_len, out_vals + i * out_len); | |
} | |
void reduce(void (*fn)(void *, void *), void * acc, |
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
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "jni.h" | |
int __system_property_get(const char* name, char* value) { strcpy(value, "8.0.0"); return 0; } |
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
open FParsec | |
open FParsec.Primitives | |
type Block = Lines of string list | |
type Method = Name of string * Block | |
type Class = Methods of Method list | |
type Namespace = Classes of Class list | |
type VbFile = Namespaces of Namespace list | |
type p<'t> = Parser<'t, unit> |
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
using System; | |
public class Program | |
{ | |
delegate T id<T>(T arg0); | |
static id<T> Y<T>(id<id<T>> f) | |
{ | |
//Y f = f ( Y f ) |
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
const edge = (a, b, c) => | |
((c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]) >= 0) | |
const test = v => p => | |
edge(v[0], v[1], p) & edge(v[1], v[2], p) & edge(v[2], v[0], p); | |
const point = (r, tst) => (p, i) => | |
tst([i / 2, r]) ? '*' : p |
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
loop@ for (info in infos) info.apply { | |
val startingCount = info.mCurrentBytes | |
//variables with mStatus are either from info or DownloaderService | |
if (mStatus != STATUS_SUCCESS) | |
DownloadThread(info, this@DownloaderService, mNotification!!).run | |
{ | |
cancelAlarms() | |
scheduleAlarm(Constants.ACTIVE_THREAD_WATCHDOG) | |
run() |