PHP is usually included in the top five or six most popular programming languages, as measured by various metrics implemented by e.g. [Tiobe][], [LangPop][], [PYPL][], [lang-index][]. Alongside it sit C, Java, Obj-C, C++, C#, Javascript, and Python. All of these have a formal semantics or at least a rigorous specification.
package trie | |
import ( | |
"container/vector" | |
"sort" | |
) | |
// A 'set' structure, that can hold []byte objects. | |
// For any one []byte instance, it is either in the set or not. | |
type Trie struct { |
package pearson | |
/* Get an initial hash value by passing in the length of the array. */ | |
func Init(length int) (hash byte) { return byte(length % 256) } | |
/* Given the hash of a string S0..SN and the character SN+1, | |
get the hash of the string S0..SN+1. | |
*/ | |
func FeedByte(oldhash byte, next byte) (newhash byte) { | |
/* The following table is the result of the pseudorandom order at |
james@bast:~$ cd /tmp/ | |
james@bast:/tmp$ tar -xvf rust-0.2.tar.gz | |
rust-0.2/ | |
rust-0.2/Makefile.in | |
rust-0.2/mk/ | |
rust-0.2/mk/snap.mk | |
rust-0.2/mk/llvm.mk | |
rust-0.2/mk/docs.mk | |
rust-0.2/mk/platform.mk | |
rust-0.2/mk/install.mk |
module NinetyNine where | |
import Data.List (foldl') | |
-- Problem 1: Find the last element of a list. | |
myLast :: [a] -> a | |
myLast [] = error "myLast []" | |
myLast (x:xs) = foldl' (flip const) x xs | |
-- Problem 2: Find the last but one element of a list. |
Having read a few proofs that the halting problem is undecidable, I found that they were quite inaccessible, or that they glossed over important details. To counter this, I've attempted to re-hash the proof using a familiar language, JavaScript, with numerous examples along the way.
This famous proof tells us that there is no general method to determine whether a program will finish running. To illustrate this, we can consider programs as JavaScript function calls, and ask whether it is possible to write a JavaScript function which will tell us
Javaland is notorious for its acronyms, inconsistent and redundant naming, bundling of multiple things into new definitions, circular definitions, and so on.
This file aims to reduce this incomprehensible mess into a set of succinct definitions. This should read like a dictionary, where all definitions only refer to prior definitions.
Java bytecode refers to two things:
Github provides no facility to do this via the UI. This is sad, because it would be extremely useful in order to draft something before publishing it. It would also be trivial for them to implement. Never mind; here's how to do it manually:
- Get the "Clone this Gist" text from the left-hand side of the private Gist, e.g.
https://gist.github.com/b9cc265982870c091a1e.git
, and extract the IDb9cc265982870c091a1e
. - Go to https://gist.github.com/ and create a dummy new public Gist.
- Get the "Clone this Gist" text from the left-hand side, e.g.
https://gist.github.com/8270253.git
, and extract the ID8270253
. git clone [email protected]:b9cc265982870c091a1e tmp-dir && cd tmp-dir && git push -f [email protected]:8270253.git
#!/bin/bash | |
# Usage: | |
# | |
# sudo ./restore-file-from-package.sh <filepath> | |
# | |
# Restore a file from the package that provides it. | |
# | |
# Source: http://askubuntu.com/a/67028/30482 |