Skip to content

Instantly share code, notes, and snippets.

test gist

  1. how are you?
  2. hellow world
@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.
@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 / 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 / LinearStreamProccessingWithPlinq.cs
Created September 20, 2012 19:31
Linear stream proccessing with PLINQ
class Program
{
private const int RecordsCount = 3000;
private static readonly Stopwatch Stopwatch = new Stopwatch();
private const string InputDataFile =
"C:\\Users\\Boris\\Documents\\Visual Studio 2012\\Projects\\LinearStreamProccessingWithPlinq\\PlinqTests\\DataFile1.txt";
static void Main(string[] args)
{
@naraga
naraga / ConnPoolOverflowDemo.cs
Created September 18, 2012 22:40
What happens when sql connections runs out? You are gonna wait
class Program
{
// connection pool "overflow" demo
private const int ConnSize = 150;
static void Main(string[] args)
{
var connections = new SqlConnection[ConnSize];
for (int i = 0; i < ConnSize; i++)
{
@naraga
naraga / ConnPoolOverflowDemo.cs
Created September 18, 2012 22:40
What happens when sql connections runs out? You are gonna wait
class Program
{
// connection pool "overflow" demo
private const int ConnSize = 150;
static void Main(string[] args)
{
var connections = new SqlConnection[ConnSize];
for (int i = 0; i < ConnSize; i++)
{
@naraga
naraga / BlockingCollectionDemo.cs
Created September 18, 2012 22:37
BlockingCollection demo
class Program
{
// BlockingCollection - demo (approaching Q3)
static void Main(string[] args)
{
var coll = new BlockingCollection<string>();
Task.Run(() =>
{
@naraga
naraga / Tasks - LongRunning.cs
Created September 18, 2012 22:33
Long running task effect on threads allocation
class Program
{
// TaskCreationOptions.LongRunning - demo
static void Main(string[] args)
{
Console.WriteLine("press any key when ready (run ProccessExplorer 's proccess Threads tab)");
Console.ReadLine();
for (int i = 0; i < 1000; i++)
{