Skip to content

Instantly share code, notes, and snippets.

View tufanbarisyildirim's full-sized avatar
🎯
Focusing

Tufan Barış Yıldırım tufanbarisyildirim

🎯
Focusing
View GitHub Profile

Before Inlining

BenchmarkNextHash-16                    12962270                83.4 ns/op            20 B/op          2 allocs/op

After Inlining

BenchmarkNextHash-16                    32723619                33.9 ns/op             0 B/op          0 allocs/op
@tufanbarisyildirim
tufanbarisyildirim / hash.go
Last active April 29, 2020 13:37
zero allication fnv hashing of #golang
// https://github.com/golang/go/blob/master/src/hash/fnv/fnv.go#L100 the code we previously used
// has some allocations
// we need minimum footprint per deciding
func findIndex(s string, poolSize uint32) uint32 {
var h32a uint32 = 2166136261
for _, c := range []byte(s) {
h32a *= 16777619
h32a ^= uint32(c)
}
Verifying that +tfnyldrm is my blockchain ID. https://onename.com/tfnyldrm
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@tufanbarisyildirim
tufanbarisyildirim / SqlClassGenerator.tt
Created November 20, 2013 14:02
Basic Model Class Generator
<#@ assembly name ="System.Data" #>
<#@ assembly name ="System.Xml" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.Data" #>
<#@ import namespace="System.Text" #>
<#+
class SQLClassGenerator
{
Dictionary<Type, string> _alias = new Dictionary<Type, string>();
@tufanbarisyildirim
tufanbarisyildirim / ServiceJsonAdapter.cs
Last active December 24, 2015 07:28
an http module example to publish .net asmx webservices as a restful service.
using System;
using System.Web;
using System.Reflection;
using System.Linq;
using System.Collections.Specialized;
using System.Collections.Generic;
namespace ServiceTest
{
public class ServiceJsonAdapter : IHttpHandler
@tufanbarisyildirim
tufanbarisyildirim / Kefukar.Dotnet.cs
Last active December 17, 2015 02:38
php DOTNET sınıfına bir örnerk
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Kefukar
{
public class Dotnet
{
@tufanbarisyildirim
tufanbarisyildirim / GenericExtensions.cs
Last active December 16, 2015 10:49
select list items by using print page like string
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// TODO: check out of page ranges.
public static class GenericExtensions
{
public static List<T> PrintPagesFilter<T>(this List<T> list, string pattern)
{
@tufanbarisyildirim
tufanbarisyildirim / ImageExtensions.cs
Created April 10, 2013 13:58
OCR Extension metod for System.Drawing.Image using MODI
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
namespace Extensions
{
public static class ImageExtensions
public string DataTableToWorkBook(DataTable dt, string postfix)
{
object oMissing = Missing.Value;
Microsoft.Office.Interop.Excel.Application app;
Microsoft.Office.Interop.Excel.Workbooks wkBks;
Microsoft.Office.Interop.Excel.Workbook wkBk;
Microsoft.Office.Interop.Excel.Sheets wkShts;
Microsoft.Office.Interop.Excel.Worksheet wkSht;