Instantly share code, notes, and snippets.

👨‍💻

# Anish Bhusal anisbhsl

👨‍💻
Last active February 2, 2023 05:29
Guess The Number : Binary Search Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 """ Q1: Two friends, Elaine and Tom, are playing a guessing game with each other. Elaine thinks of an integer in her mind and Tom needs to guess the number. Tom can ask a question as follows: Is your number greater than or equal to 5 (or any other specified integer)? Then Elaine has to reply yes or no based on the comparison results of the two numbers. Design an algorithm, in pseudo-code to help Tom find that number quick. UAH CS 617 - Spring 2023
Last active November 20, 2022 19:44
Simple graph implementation (with BFS and DFS) in go using adj list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "fmt" ) type Graph struct{ Nodes []*Node }
Created November 17, 2022 15:56
Simple Stack Implementation in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "fmt" ) type Node struct{ data int next *Node }
Created May 30, 2020 16:00
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "fmt" "log" "github.com/bettercap/gatt" "github.com/bettercap/gatt/examples/option" "github.com/bettercap/gatt/examples/service" )
Created May 30, 2020 15:59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package service import "github.com/bettercap/gatt" func NewBatteryService() *gatt.Service { lv := byte(100) s := gatt.NewService(gatt.UUID16(0x180F)) c := s.AddCharacteristic(gatt.UUID16(0x2A19)) c.HandleReadFunc( func(rsp gatt.ResponseWriter, req *gatt.ReadRequest) {
Created May 30, 2020 15:58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package service import ( "log" "github.com/bettercap/gatt" ) var ( attrGATTUUID = gatt.UUID16(0x1801) attrServiceChangedUUID = gatt.UUID16(0x2A05)
Created May 30, 2020 15:41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package service import "github.com/bettercap/gatt" var ( attrGAPUUID = gatt.UUID16(0x1800) attrDeviceNameUUID = gatt.UUID16(0x2A00) attrAppearanceUUID = gatt.UUID16(0x2A01) attrPeripheralPrivacyUUID = gatt.UUID16(0x2A02)
Created March 20, 2020 08:22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 package main import ( "bufio" "gocv.io/x/gocv" "image" "image/color" "log" "os" "fmt"
Created January 28, 2020 07:23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 { package main import ( "encoding/json" "reflect" "learn-peg/parser/utils/postfix" ) type Query struct{ Collection string
Created January 23, 2020 11:29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 { package main import ( "encoding/json" "reflect" ) type Query struct{ Collection string Condition []string