This file contains 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
package stanza | |
import ( | |
"encoding/xml" | |
"testing" | |
"github.com/ThomsonReutersEikon/etree" | |
) | |
type Email struct { |
This file contains 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
package queue | |
type Element struct { | |
value interface{} | |
next chan *Element | |
} | |
type Queue struct{ | |
elements <-chan *Element | |
appender chan<- interface{} |
This file contains 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
public class A { | |
public A() { | |
} | |
} | |
public class B : A { | |
public B(string param1){ | |
} |
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var t = new Test(); | |
t.Daemon(); | |
Console.WriteLine("end main"); | |
string input = Console.ReadLine(); | |
while (input != "x") |
This file contains 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
public static class Ext | |
{ | |
private class ComparableToComparer<T> : Comparer<T> where T : IComparable<T> | |
{ | |
public override int Compare(T x, T y) | |
{ | |
return x.CompareTo(y); | |
} | |
} |
This file contains 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
static void msort(int[] arr) | |
{ | |
if (arr.Length == 1) | |
return; | |
//get a half point | |
int mid = arr.Length/2; | |
int[] left = new int[mid]; | |
int[] right = new int[arr.Length - mid]; //reason for length - mid is due to halfpoint of an odd length array |
This file contains 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
public class StupidDictionary<T> | |
{ | |
private readonly int _numOfBuckets = 3; | |
private readonly bool _quiet; | |
private readonly int _capacity; | |
private int _totalCollisions; | |
private int[] _buckets; | |
private Slot[] _slots; | |
private int _lastIndex; | |
private decimal _count; |
This file contains 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
public string ReverseWords(string text) | |
{ | |
var tarr = text.ToCharArray(); | |
//reverse the whole string first | |
reverse(tarr, 0, tarr.Length-1); | |
//reverse parts of the string | |
int start = 0; | |
for(int i = 0; i<tarr.Length; i++) | |
{ |
This file contains 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.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
This file contains 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
public static class TaskExtentions | |
{ | |
public static async Task<T> WithTimeout<T>(this Task<T> task, int timeout) | |
{ | |
if (await Task.WhenAny(task, Task.Delay(timeout)) == task) | |
return await task; | |
return default(T); | |
} | |
} |
NewerOlder