Skip to content

Instantly share code, notes, and snippets.

View gongzhitaao's full-sized avatar
🐢
(๑•̀ㅂ•́)و✧

Zhitao Gong gongzhitaao

🐢
(๑•̀ㅂ•́)و✧
  • DeepMind
  • Montreal, CA
  • 05:17 (UTC -04:00)
View GitHub Profile
@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:00
I'm a demo

This is a demo gist to test my gist viewer. The Javascript may not be written by me :D

This is a test for update.

var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:02
Analog Clock

Simple analog clock.

@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:02
Game of life
@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:03
Maze DFS

A maze pattern is generated by Depth-First Search (DFS) algorithm. To create more interesting/skewed maze, the probability to search for each direction, i.e. top, right, down and left is randomized. As a result sometimes it's more likely to go upward, if available, than right. This generator could be found in mazejs.

@gongzhitaao
gongzhitaao / Makefile
Last active August 29, 2015 14:07
COMP 2710 Lab2
CXX=g++
EXE=main
FLG=-std=c++11 -O2 -Wall
all : $(EXE)
$(EXE) : main.cpp
$(CXX) $(FLG) -o $@ $<
clean :
@gongzhitaao
gongzhitaao / maze.cpp
Last active August 29, 2015 14:08
COMP 2710 Lab 3
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <queue>
#include <vector>
#include <utility>
@gongzhitaao
gongzhitaao / mnt.sh
Created September 27, 2012 06:33
Mount texlive
mount -t iso9660 -o ro,loop,noauto /your/texlive2012.iso /mnt
--- CGAL-3.4/include/CGAL/Interval_nt.h
+++ CGAL-3.4/include/CGAL/Interval_nt.h
@@ -149,11 +149,13 @@
// The macros CGAL_IA_MUL and CGAL_IA_DIV stop constant propagation only
// on the second argument, so if -fno-rounding-math, the compiler optimizes
// the 2 negations and we get wrong rounding.
+#if 0
typename Interval_nt<>::Internal_protector P;
CGAL_assertion_msg(-CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1),
"Wrong rounding: did you forget the -frounding-math option if you use GCC?");
<script type="text/javascript">// <![CDATA[
function callTheJsonp()
{
// the url of the script where we send the asynchronous call
var url = "http://localhost/utils/jsonp/ajax.php?callback=parseRequest";
// create a new script element
var script = document.createElement('script');
// set the src attribute to that url
script.setAttribute('src', url);
// insert the script in out page