This file contains hidden or 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 ( | |
| "net" | |
| ) | |
| func main() { | |
| addr,_ := net.ResolveTCPAddr("tcp","jero.my:10234") | |
| con, err := net.DialTCP("tcp",nil,addr) | |
| if err != nil { |
This file contains hidden or 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
| typedef struct RWLock { | |
| int readers; | |
| bool writer; | |
| bool writeRequest; | |
| } | |
| void LockForRead(RWLock *l) { | |
| m.Lock(); | |
| while(l->writer || l->writeRequest) { | |
| m.Unlock(); |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <math.h> | |
| inline | |
| int isPrime(int check, int *primes) { | |
| for (; (*primes * *primes) < check; primes++) | |
| if (check % *primes == 0) return 0; | |
| return 1; | |
| } |
This file contains hidden or 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
| #include <utility> | |
| #define __NO_STD_VECTOR | |
| #include <CL/cl.hpp> | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <iostream> | |
| #include <string> | |
| #include <iterator> | |
| #include <fstream> |
This file contains hidden or 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 ( | |
| "net" | |
| "time" | |
| ) | |
| func main() { | |
| time.Sleep(time.Second) | |
| addr,err := net.ResolveUDPAddr("udp", "192.168.1.10:6112") |
This file contains hidden or 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 ( | |
| "net" | |
| "gob" | |
| "os" | |
| "bytes" | |
| ) | |
| const ( |
This file contains hidden or 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" | |
| "os" | |
| ) | |
| type FuzzMatch struct { | |
| str string | |
| val int |
This file contains hidden or 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" | |
| "runtime" | |
| "image" | |
| "image/color" | |
| "image/png" | |
| "math" | |
| "os" |
This file contains hidden or 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
| //In this example i assume that 'T' is an int | |
| func DoWhatever(toSay string, c chan int) { | |
| for { | |
| n := <-c | |
| fmt.Printf('%s %d\n', toSay, n) | |
| } | |
| } | |
| func main() { |
This file contains hidden or 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
| syn match goMember "\.\zs\w\+\ze\%((\@!\W\)" | |
| syn match goMethod "\.\zs\w\+\ze(" | |
| hi def link goMember Identifier | |
| hi def link goMethod Function |