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 <cmath> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <iostream> | |
#include <algorithm> | |
#define ll long long | |
#define N 100000+10 | |
using namespace std; | |
int n,a[N],cnt,k,fst,maxi; |
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 <cmath> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#define ll long long | |
#define N 100000+10 | |
using namespace std; |
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 <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
long long cas,n,node,k,sum; | |
int main() { | |
scanf("%lld",&cas); |
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
/* | |
* main.cpp | |
* | |
* Author: Peter | |
* Copyright (c) 2014-2015 HKUST SmartCar Team | |
* Refer to LICENSE for details | |
*/ | |
#include <cassert> | |
#include <cstring> |
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
* | |
* main.cpp | |
* | |
* Author: Peter | |
* Copyright (c) 2014-2015 HKUST SmartCar Team | |
* Refer to LICENSE for details | |
*/ | |
#include <cassert> | |
#include <cstring> |
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
import processing.serial.*; | |
import java.util.*; | |
Serial myPort; | |
int globalWidth = 80; | |
int globalHeight = 60; | |
int globalSpeed = 0; | |
int displaySpeed; |
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
'use strict'; | |
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN; | |
const APIAI_TOKEN = process.env.APIAI_TOKEN; | |
const WEATHER_API_KEY = process.env.WEATHER_API_KEY; | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const request = require('request'); | |
const apiai = require('apiai'); |
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
import processing.serial.*; | |
import java.util.*; | |
Serial myPort; | |
int globalWidth = 80; | |
int globalHeight = 60; | |
int globalSpeed = 0; | |
int displaySpeed; |
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
/* | |
* main.cpp | |
* | |
* Author: Peter | |
* Copyright (c) 2014-2015 HKUST SmartCar Team | |
* Refer to LICENSE for details | |
*/ | |
#include <cassert> | |
#include <cstring> |
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
void in_round_turn(){ | |
if(!inAuto) return; | |
if(!in_round) { | |
if(center[1]>40 && center[2]>40) setServoDegree(-30), in_round = 1; // turn right if top center line is on the right side | |
else setServoDegree(30), in_round = 2; // else turn left | |
} else{ // if in round && center line points to black img | |
switch(in_round){ | |
case 1: | |
setServoDegree(-30); | |
break; |