Skip to content

Instantly share code, notes, and snippets.

@hodzanassredin
hodzanassredin / simpleListWithPaging.xsl
Created December 17, 2013 10:56
simple render xsl for XsltListViewWebPart with paging
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:sharepoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"
xmlns:o="urn:schemas-microsoft-com:office:office" ddwrt:ghost="show_all">
<xsl:include href="/_layouts/xsl/main.xsl" />
<xsl:include href="/_layouts/xsl/internal.xsl" />
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
@hodzanassredin
hodzanassredin / tasks.cs
Created November 28, 2013 15:06
trying to understand difference between channel and push and pull
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AsyncTest
{
public class Program
{
@hodzanassredin
hodzanassredin / install.txt
Last active December 28, 2015 09:49
fresh ubuntu vm for django git and porstgrsql with heroku and venv
git config --global color.ui true
git config --global user.name "Hodza Nassredin"
git config --global user.email "[email protected]"
ssh-keygen -t rsa -C "[email protected]"
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common -t saucy
sudo apt-get install postgresql-9.2 libpq-dev
@hodzanassredin
hodzanassredin / incrDawgImmutable.fs
Last active December 25, 2015 14:39
incrDawgImmutable
namespace Utils
open System
open System.Collections.Generic
open System.IO
open System.Linq
module IncrementalDawg =
type StateKey = string
type State<'a when 'a : comparison> =
{ id : uint32; final : bool; edges : Map<'a, State<'a>>; key : StateKey }
@hodzanassredin
hodzanassredin / BlockCopy .fs
Last active December 24, 2015 15:49
Buffer.BlockCopy vs unions
//Results on my machine
//U1 Elapsed Time: 2285 Consumed memory: 81313268
//U2 Elapsed Time: 5729 Consumed memory: 60775624
//U1 Elapsed Time: 2141 Consumed memory: 80048624
//U2 Elapsed Time: 6011 Consumed memory: 57525248
//U1 Elapsed Time: 2208 Consumed memory: 81011948
//U2 Elapsed Time: 5653 Consumed memory: 58437492
open System
type U1 =
| F of float32
@hodzanassredin
hodzanassredin / unionvsbits.fs
Created October 4, 2013 09:09
Checking perf and memory usage disc unions vs custom struct with tag and bitconverter
//Results on my machine
//U1 Elapsed Time: 2541 Consumed memory: 81313836
//U2 Elapsed Time: 1835 Consumed memory: 58804716
//U1 Elapsed Time: 2144 Consumed memory: 80130316
//U2 Elapsed Time: 1682 Consumed memory: 57352372
//U1 Elapsed Time: 2109 Consumed memory: 81020952
//U2 Elapsed Time: 1672 Consumed memory: 58831224
open System
type U1 =
| F of float32
@hodzanassredin
hodzanassredin / incrDawg.fs
Last active December 24, 2015 09:49
naive incremental(unsorted) dawg in fsharp
namespace Utils
open System
open System.Collections.Generic
open System.IO
open System.Linq
module IncrementalDawg =
type StateKey = string
@hodzanassredin
hodzanassredin / liblinear.fs
Created September 24, 2013 10:10
liblinear fsharp usage more info in original java port https://github.com/bwaldvogel/liblinear-java
// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.
open de.bwaldvogel.liblinear
open java.io
open System
[<EntryPoint>]
let main argv =
let problem = new Problem()
problem.l <- 2 // number of training examples
@hodzanassredin
hodzanassredin / main.go
Created August 14, 2013 07:58
boolean trap solve in golang
package main
import(
"painter"
"fmt"
)
func main(){
res := painter.Repaint(painter.RepaintImmediate(false))
fmt.Println(res)
}
package main
import(
"painter"
"fmt"
)
func main(){
res := painter.Repaint(painter.Deferred)
fmt.Println(res)
}