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.
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() { |
Simple analog clock.
WRAPPED implementation of Game of life. The project could be found in lifejs. The above pattern is known as Spaceship-Weekender.
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.
CXX=g++ | |
EXE=main | |
FLG=-std=c++11 -O2 -Wall | |
all : $(EXE) | |
$(EXE) : main.cpp | |
$(CXX) $(FLG) -o $@ $< | |
clean : |
#include <algorithm> | |
#include <cstdio> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <map> | |
#include <queue> | |
#include <vector> | |
#include <utility> |
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 |