Skip to content

Instantly share code, notes, and snippets.

@naraga
naraga / LinearStreamProccessingWithParallelForeach.cs
Created September 20, 2012 19:48
Linear stream proccessing with Parallel.Foreach
class Program
{
private const int RecordsCount = 3000;
private static int _recordsLoaded;
private static bool _finishedLoading;
private static int _recordsProccessed;
private static bool _wasError;
private static readonly Stopwatch Stopwatch = new Stopwatch();
private const string InputDataFile =
@naraga
naraga / LinearStreamProccessingWithTplDataflow.cs
Created September 20, 2012 20:06
Linear stream proccessing with TPL Dataflow
class Flow
{
private readonly TransformBlock<string, string> _controlAndConvertBlock;
private readonly ActionBlock<string> _acquisitionBlock;
public Flow()
{
_controlAndConvertBlock = new TransformBlock<string, string>(rec =>
{
@naraga
naraga / SvgOnAngular.js
Last active December 30, 2015 20:29
AngularJS+SVG. Simple vs scope inheritance.
<!-- SVG starter: http://www.w3schools.com/svg/tryit.asp?filename=trysvg_line -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" ng-app>
<head>
<title>AngularJS is more than boring datagrids - bouncing line</title>
</head>
<body>
<svg height="{{config.height}}" width="{{config.width}}" ng-controller='LineController'>
<line x1="{{line.x1}}" y1="{{line.y1}}" x2="{{line.x2}}" y2="{{line.y2}}" style="stroke:rgb(255,0,0);stroke-width:2" />
Sorry, your browser does not support inline SVG.

test gist

  1. how are you?
  2. hellow world