This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$st = debug_backtrace(); | |
$lineNo = ''; | |
$stackTrace = ''; | |
foreach ($st as $line) | |
{ | |
if (isset($line['class'])) $stackTrace .= $line['class'].$line['type'].$line['function'].' at line '.$lineNo . "\n"; | |
else $stackTrace .= $line['function'].' in '.$line['file'].' line '.$lineNo . "\n"; | |
$lineNo = $line['line']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a.lecture-link').each(function(){ | |
var $lectureLink = $(this); | |
var lectureId = $lectureLink.data('lecture-id'); | |
var title = $lectureLink.text().trim().replace(/ *\([0-9]+:[0-9]+\)/, ''); | |
console.log('* ' + title + ' [[Scigast:Subtitles:Lecture' + lectureId + ':en|English]] | [[Scigast:Subtitles:Lecture' + lectureId + ':es|Español]]'); | |
}),null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.akshor.pjt33.math; | |
import java.util.*; | |
public class PracticalNumbers | |
{ | |
public static void main(String[] args) { | |
Generator gen = new Generator(); | |
// Print all practical numbers up to 30000 | |
for (int pr = gen.next(); pr <= 30000; pr = gen.next()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
public class GolfScriptGolfer { | |
public static void main(String[] args) throws Exception { | |
if (args.length == 1) { | |
String src = readFully(args[0]); | |
String golfed = golf(src); | |
String outputFile = (args[0].endsWith(".gs") ? args[0].substring(0, args[0].length() - 3) : args[0]) + ".min.gs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
0:DBGID; | |
{['"#{$stderr.puts Garray.new($stack).ginspect.to_s.slice(1..-2)#'DBGID):DBGID' | |
}"']''*~;}:DEBUG; | |
## | |
#[5:C,]{{.{[~@]}:>~.{-1%}:<~}%.&}8*({[.<><.<><]}:&~-{99rand}$~5,{.<[.>.>]{&~}%.3{$?~!!}:Q~"You smell a wumpus.\n"{*print}:,~.4Q"You feel a breeze.\n",'"#{'C):C';STDIN.gets()}"'++~~.10/3%@3%=\5%{&2Q"You killed the wumpus."{\<{>}3rand*\1"Your arrow didn't hit anything.\n",0}if}{\;.&3Q"You fell into the pit."*}if 1$&3Q{;"You were killed by the wumpus."}*:n!}do]; | |
#[5:C,]{{.{[~@]}:>~.{-1%}:<~}%.&}8*({[.<><.<><]}:&~-{99rand}$~5,{.<[.>.>].{&3{$?~!!}:Q~'You smell a wumpus.\n'{*print}:,~}/.{&4Q'You feel a breeze.\n',}/'"#{'C):C';STDIN.gets()}"'++~~.10/3%@=\5%{&2Q'You killed the wumpus.'{\<{>}3rand*\1"Your arrow didn't hit anything.\n",0}if}{\;.&3Q'You fell into the pit.'*}if 1$&3Q{;'You were killed by the wumpus.'}*:n!}do]; | |
#[5:C,]{{.{[~@]}:>~.{-1%}:<~}%.&}8*({[.<><.<><]}:&~-{99rand}$~5,{.<[.>.>].{3{$\&\?~!!}:Q~'You smell a wumpus.\n'{*print}:,~}/.{4Q'You feel a breeze.\n',}/'"#{'C):C';STDIN.gets()}"'++~~. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint regexp: true, maxerr: 50, indent: 2 */ | |
(function (global) { | |
"use strict"; | |
function URLUtils(url, baseURL) { | |
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@]*)(?::([^:@]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); | |
if (!m) { | |
throw new RangeError(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!PS-Adobe-2.0 | |
%%Creator: Peter Taylor | |
% Force A4 portrait. | |
<</PageSize [595 842]>> setpagedevice | |
/hex { | |
currentpoint | |
8 14 rlineto | |
6 0 rlineto | |
8 -14 rlineto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Point; | |
import java.util.*; | |
public abstract class AbstractLattice implements Tiling<AbstractLattice.LatticeCell> { | |
// Use the idea of expansion and vertex mapping from my earlier aperiod tiling implementation. | |
private Map<Point, Set<LatticeCell>> vertexNeighbourhood = new HashMap<Point, Set<LatticeCell>>(); | |
private int scale = -1; | |
// Geometry | |
private final int dx0, dy0, dx1, dy1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
import java.util.*; | |
public class QuoridorCounter { | |
public static void main(String[] args) { | |
List<String> rows = new ArrayList<String>(); | |
char[] chs = new char[8]; | |
for (int i = 0; i < 6561 /* 3^8 */; i++) { | |
int r = i; | |
for (int j = 0; j < 8; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Sandbox { | |
// NB This is not really "production-quality" code | |
class Program { | |
static void Main(string[] args) { | |
for (int m = 2; m < 7; m++) { | |
for (int n = 2; n <= m; n++) { |
OlderNewer