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
func IsBalanced(text string) bool { | |
isBalanced := true | |
s := make([]rune, 0, len(text)) | |
for _, c := range text { | |
if c == '(' { | |
s = append(s, c) | |
} else if c == ')' { | |
if len(s) == 0 { | |
isBalanced = false |
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" | |
func main() { | |
fmt.Println(checkPalindrome("abba")) | |
fmt.Println(checkPalindrome("Superman")) | |
fmt.Println(checkPalindrome("racecar")) | |
fmt.Println(checkPalindrome("madam")) | |
} |
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" | |
func main() { | |
maxPrime := 10000 | |
fmt.Printf("Printing primes less than %v", maxPrime) | |
fmt.Println() | |
primes := getPrimes(maxPrime) | |
fmt.Println(primes) |
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
export default class FileToUpload { | |
static chunkSize = 1000000; | |
static uploadUrl = 'http://localhost:8080/api/v1/photo'; | |
readonly request: XMLHttpRequest; | |
readonly file: File; | |
currentChunkStartByte: number; | |
currentChunkFinalByte: number; | |
constructor(file: File, name: string) { | |
this.request = new XMLHttpRequest(); |
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 models | |
import ( | |
basketBallPlayer "basic-gRPC-proto" | |
"strconv" | |
) | |
type BasePersistenceModel struct { | |
ID uint64 `gorm:"type:int;primary_key"` | |
} |
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
syntax = "proto3"; | |
package basketBallPlayer; | |
message Player { | |
string id = 1; | |
string first_name = 2; | |
string last_name = 3; | |
int32 age = 4; | |
string photo_url = 5; | |
int32 points_per_game = 6; |
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 ( | |
"context" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"time" | |
) |