Skip to content

Instantly share code, notes, and snippets.

@yogesh-desai
yogesh-desai / mp6.c
Last active January 3, 2019 18:27 — forked from wh5a/mp6.c
/*
* Title: 2D Image Convolution on GPU by using Shared Memory and Constant Memory.
*
* Image Size: 2048 X 2048
* Mask Size: 64 X 64
* TILE_WIDTH 32
*
*
* */
#include<stdio.h>
@yogesh-desai
yogesh-desai / README.md
Last active August 29, 2015 14:24 — forked from mtowers/README.md
@yogesh-desai
yogesh-desai / exercise.tour.go
Created October 23, 2015 10:44 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@yogesh-desai
yogesh-desai / date_loop.sh
Created June 25, 2016 13:54 — forked from chluehr/date_loop.sh
Bash: Loop over dates
#!/bin/bash
now=`date +"%Y-%m-%d" -d "05/06/2012"`
end=`date +"%Y-%m-%d" -d "05/23/2012"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 day"`;
echo $now
done
@yogesh-desai
yogesh-desai / readLines-writeLines.go
Created October 19, 2016 15:56 — forked from wofeiwo/readLines-writeLines.go
read lines write lines like python api in golang
package main
import (
"io"
"os"
"bufio"
"bytes"
"fmt"
"strings"
)
@yogesh-desai
yogesh-desai / struct_as_map_key.go
Created November 16, 2016 19:19 — forked from cevaris/struct_as_map_key.go
Golang: Using structs as key for Maps
package main
import "fmt"
type A struct {
a, b int
}
func MapStructValAsKey(){
// Notice: We are using value of `A`, not `*A`
@yogesh-desai
yogesh-desai / googlecdp.go
Created September 13, 2017 08:21
Chromdp to use iframes
package main
import (
"context"
"io/ioutil"
"log"
"time"
"fmt"
cdp "github.com/knq/chromedp"
package main
import (
"net/http"
"net/url"
"runtime"
"strings"
"context"
"bytes"
package main
import (
"golang.org/x/net/html"
"net/http"
"net/url"
"runtime"
"strings"
"context"
@yogesh-desai
yogesh-desai / cache-benchmarking.
Created May 30, 2019 18:55
This compares various caches.
package gocachebenchmarks
import (
"fmt"
"strconv"
"sync"
"testing"
"time"
"github.com/allegro/bigcache"