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 ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" | |
"os" |
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
var FleetTest = struct { | |
FleetName string | |
Trackers []string | |
}{ | |
"202", | |
[]string{"106206", "107749", "107699"}, | |
} | |
var testFleet Fleet = Fleet{ | |
Id: "202", | |
Update: map[string]Pos{ |
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
some field on the sql rows scan can be always equal to null or 0 or "" if it is string, due to previes fields that are not mapped to sql NULLABLE types. |
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
vector<pair<int, int> > G[N]; | |
int d[N]; | |
bool visited[N]; | |
//read G | |
for(int i = 1; i <= n; i++){ | |
d[i] = INF; |
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" | |
"math/rand" | |
"runtime" | |
"time" | |
) | |
func makeBuffer() []byte { |
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
int used[N]; | |
bool cycle; | |
vector<int> order; | |
vector<int> comp[N]; | |
vector<int> G[N], G2[N]; | |
void dfs(int v){ | |
used[v] = 1; | |
for(int i = 0; i < (int) G[v].size(); i++){ | |
int to = G[v][i]; |
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 ( | |
"flag" | |
"log" | |
"net/http" | |
"time" | |
"github.com/gorilla/websocket" | |
) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
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 ( | |
"strings" | |
) | |
func match(pattern, text string) bool { | |
patterns := strings.Split(pattern, "") | |
words := strings.Split(text, " ") | |
// if the length of patterns and words does not the same the mapping is wrong |
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
//from int to char | |
while(n>0){ | |
ch[i]=(n%10)+'0'; | |
n=n/10; | |
i++; | |
} | |
while(i>0){ | |
putchar(ch[i-1]); | |
i-- | |
} |