這篇文章旨在作為快速參考與展示。要更多完整的資訊,請見 John Gruber 原本的規格與 Github 偏好的 Markdown(Github-flavored Markdown,簡寫為GFM)資訊頁。
如果你正在找 Markdown Here 的小抄(Cheatsheet),這裡也有一篇。你也可以看看更多 Markdown 的工具。
譯註:可以參考這份中文版文件,有更詳盡的 Markdown 語法說明;如果需要可以練習的線上編輯器,可以試試看HackMD。
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# GDC Vault videos can't be watched on mobile devices and this is a very sad thing indeed! | |
# (Note: this has changed for GDC2013, which lets you watch raw MP4 streams. Kudos!) | |
# This script is designed to circumvent this by downloading the lecture and slideshow | |
# videos which can then be re-encoded into whatever format you wish. Obviously, you | |
# won't be able to do this without access to the Vault. This is strictly for the | |
# convenience of legitimate Vault users! | |
# Note: this code is rather flimsy and was written as fast as possible for my own personal use. | |
# The code only works for the most recent GDC Vault videos, since they all use the same player | |
# format. If the XML format used to run the player is changed (as it has in the past), the code |
#! /usr/bin/env python | |
class Point(object): | |
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order | |
def calc(self, top, bottom, other_x): | |
l = (top * inverse_mod(bottom)) % p | |
x3 = (l * l - self.x - other_x) % p | |
return Point(x3, (l * (self.x - x3) - self.y) % p) |
#include <stdio.h> | |
// | |
// Nearly minimal CUDA example. | |
// Compile with: | |
// | |
// nvcc -o example example.cu | |
// | |
#define N 1000 |
這篇文章旨在作為快速參考與展示。要更多完整的資訊,請見 John Gruber 原本的規格與 Github 偏好的 Markdown(Github-flavored Markdown,簡寫為GFM)資訊頁。
如果你正在找 Markdown Here 的小抄(Cheatsheet),這裡也有一篇。你也可以看看更多 Markdown 的工具。
譯註:可以參考這份中文版文件,有更詳盡的 Markdown 語法說明;如果需要可以練習的線上編輯器,可以試試看HackMD。
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | |
# file Copyright.txt or https://cmake.org/licensing for details. | |
#.rst: | |
# FindOpenMP | |
# ---------- | |
# | |
# Finds OpenMP support | |
# | |
# This module can be used to detect OpenMP support in a compiler. If |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#define M 3 | |
#define K 2 | |
#define N 3 | |
#define NUM_THREADS M * N | |
/* Global variables for threads to share */ |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
#!/bin/bash | |
SOURCE="$1" | |
if [ "${SOURCE}" == "" ]; then | |
echo "Must specify a source url" | |
exit 1 | |
fi | |
DEST="$2" | |
#if [ "${DEST}" == "" ]; then |