Skip to content

Instantly share code, notes, and snippets.

View hackintoshrao's full-sized avatar
📚
Exploring AI agents on code search and understanding

Karthic Rao hackintoshrao

📚
Exploring AI agents on code search and understanding
View GitHub Profile
@hackintoshrao
hackintoshrao / leaky-server.go
Created February 24, 2017 03:12
Leaky server with the instrumentation for
package main
import (
"fmt"
"log"
"net/http"
"runtime"
"runtime/debug"
"runtime/pprof"
"strconv"
@hackintoshrao
hackintoshrao / leaky-server.go
Last active February 24, 2017 02:47
Server with leaky endpoint and instrumentation for getting the number of go routines in the system.
package main
import (
"fmt"
"log"
"net/http"
"runtime"
"strconv"
)
@hackintoshrao
hackintoshrao / count-instrument.go
Created February 23, 2017 04:11
Intrumentation to obtain the number of go routine alive in the sytem.
package main
import (
"fmt"
"log"
"net/http"
"runtime"
"strconv"
)
@hackintoshrao
hackintoshrao / sum_dont_read.go
Created February 23, 2017 03:05
Demo of writing into a channel without reading from it.
package main
import (
"fmt"
"log"
"net/http"
"strconv"
)
// function to add an array of numbers.
// +build ignore
/*
* Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015, 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@hackintoshrao
hackintoshrao / thumb.go
Created February 22, 2017 00:44
Thubnail generator for golang.
package main
import (
"image"
"image/color"
"github.com/disintegration/imaging"
)
func main() {
@hackintoshrao
hackintoshrao / notify.go
Last active February 21, 2017 16:56
Get object key from notification
package main
import (
"log"
"encoding/json"
"github.com/minio/minio-go"
)
@hackintoshrao
hackintoshrao / sum.go
Last active April 5, 2022 07:37
Simple program for concurrently summing up numbers.
package main
import "fmt"
// function to add an array of numbers.
func sum(s []int, c chan int) {
sum := 0
for _, v := range s {
sum += v
}
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
# Read in the image
image = mpimg.imread('test.jpg')
# Grab the x and y size and make a copy of the image
ysize = image.shape[0]
xsize = image.shape[1]
## Read the reviews first.
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()
from collections import Counter