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 |
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 | |
} |
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 | |
} |
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" | |
) |
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) { |
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) |
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) |
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" |
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 |
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 |
NewerOlder