Skip to content

Instantly share code, notes, and snippets.

View IanBoyanZhang's full-sized avatar

Ian Zhang IanBoyanZhang

View GitHub Profile
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
import ctypes
import json
from functools import wraps
from typing import Any, Dict, List
from warnings import warn
# Constants from cuda.h
CUDA_SUCCESS = 0
CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39
/* Generated by Yosys 0.30+1 (git sha1 5813809ad, clang 10.0.0-4ubuntu1 -fPIC -Os) */
(* generator = "nMigen" *)
(* top = 1 *)
(* \nmigen.hierarchy = "top" *)
module top(clk);
(* src = "gray_code.py:25" *)
wire [3:0] async_gray_count;
(* src = "/home/turro/workspace/venv/lib/python3.8/site-packages/nmigen/hdl/ir.py:526" *)
input clk;
@IanBoyanZhang
IanBoyanZhang / newton.cpp
Last active February 23, 2019 07:57
Newton Raphson solving x + log2(x) = 0
#include <iostream>
#include <cmath>
// Newton Raphson solving x + log2(x) = 0
// https://en.wikipedia.org/wiki/Newton%27s_method
inline double func(double x) {
return x + log2(x);
}
inline double derv(double x) {
1
00:00:03,170 --> 00:00:08,039
the time is now at no other time<font color="#CCCCCC"> in</font>
2
00:00:08,039 --> 00:00:10,050
human<font color="#E5E5E5"> history have we had the technology</font>
3
00:00:10,050 --> 00:00:13,410
CPP_SHARED := -std=c++11 -O3 -I src -shared -fPIC src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp src/uUV.cpp
CPP_EXPERIMENTAL := -DUSE_MICRO_UV
CPP_OPENSSL_OSX := -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
CPP_OSX := -stdlib=libc++ -mmacosx-version-min=10.7 -undefined dynamic_lookup $(CPP_OPENSSL_OSX)
default:
make `(uname -s)`
Linux:
$(CXX) $(CPPFLAGS) $(CFLAGS) $(CPP_SHARED) -s -o libuWS.so
Darwin:
#include <stdlib.h>
#include <stdio.h>
typedef struct node_s
{
int value;
struct node_s* left;
struct node_s* right;
} *node;
#!/usr/bin/env python
"""
parse XML files containing tracklet info for kitti data base (raw data section)
(http://cvlibs.net/datasets/kitti/raw_data.php)
No guarantees that this code is correct, usage is at your own risk!
created by Christian Herdtweck, Max Planck Institute for Biological Cybernetics
(christian.herdtweck@tuebingen.mpg.de)
import time
import pickle
import tensorflow as tf
from sklearn.model_selection import train_test_split
from alexnet import AlexNet
from sklearn.utils import shuffle
nb_classes = 43
# Hyper params
rate = 1e-4
<!DOCTYPE html>
<html>
<head>
<script src='jquery.js'></script>
<script src="main.js"></script>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>