Skip to content

Instantly share code, notes, and snippets.

@JulianR
JulianR / Program.cs
Last active December 30, 2015 02:39
Fast string replace
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Text;
using System.Collections.Concurrent;
using System.Linq;
namespace ConsoleApplication1
{
@JulianR
JulianR / transactions.cs
Created November 2, 2012 20:28
EF transactions
using System.Data.Entity;
using System.Data;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
using (var ctx = new DataContext())
@JulianR
JulianR / FastDoubleParse.cs
Created June 28, 2012 12:12
Fast Double Parse
public static bool TryParseDoubleFastStream(string s, int begin, int end, out double result)
{
result = 0;
char c = s[begin];
int sign = 0;
int start = begin;
if (c == '-')
{
sign = -1;
@JulianR
JulianR / BatchClient.cs
Created March 8, 2012 02:01
Generic compound service
public class BatchClient
{
private readonly CeyenneClient _client;
private List<object> _batch;
private CompoundResponse _response;
public BatchClient(CeyenneClient client)
{
_client = client;
_batch = new List<object>();