Skip to content

Instantly share code, notes, and snippets.

View hxdyxd's full-sized avatar
🎯
Focusing

hxdyxd hxdyxd

🎯
Focusing
  • Hangzhou, China
View GitHub Profile
void floyd(void *map, const int node)
{
int (*e)[node][node] = (int (*)[node][node])map;
for(int k=0; k<node; k++)
for(int i=0; i<node; i++)
for(int j=0; j<node; j++)
if( (*e)[i][j] > (*e)[i][k] + (*e)[k][j] )
(*e)[i][j] = (*e)[i][k] + (*e)[k][j];
}
#include <stdint.h>
#include <stdio.h>
__uint128_t fibonacci(int n)
{
__uint128_t llast = 0;
__uint128_t last = 1;
__uint128_t sum = 0;
for(int i=0; i<n; i++) {
sum = llast + last;

how to compile kernel:

1.install tools:

sudo apt-get install libncurses-dev flex bison bc
sudo apt-get install gcc-arm-linux-gnueabi

2.make:

make ARCH=arm armemulator_defconfig
make O=./build ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
make O=./build ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
<?php
//simple network player
const PLAYER_URL = "http://ip.sococos.com:8080/playerdayhot.php";
while(1) {
sleep(1);
$data = file_get_contents(PLAYER_URL);
if(false === $data) {
#include <stdio.h>
int main(int argc, char **argv) {
char *cmd = "arecord -D plughw:0 -f S16_LE -c 1 -r 16000 -t raw -q -";
char buf[256];
FILE *fp = popen(cmd, "r");
for (int i=0; i<16; i++) {
int result = fread(buf, 1, sizeof(buf), fp);
printf("read %d bytes\n", result);
AT+SAPBR=3,0,"Contype","GPRS"\0a
AT+SAPBR=3,1,"APN","3GNET"\0a
AT+SAPBR=1,1\0a
AT+CNTPCID=1\0a
AT+CNTP="ntp1.aliyun.com",32\0a
AT+CNTP="120.25.115.20",32\0a
AT+CNTP\0a