This file contains hidden or 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
ocamlc -I +ocamldoc -c tg.ml && ocamldoc -g tg.cmo test.ml |
This file contains hidden or 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
var Claim = function () { | |
// *********************************************************** | |
// REQUIRED CONSTANTS, DO NOT MODIFY | |
// *********************************************************** | |
var ASSIGNMENT_MARKING = 'Assignment Marking'; | |
var COURSE_MATERIAL_PREPARATION = 'Course Material Preparation'; | |
var TUTORIAL = 'Tutorial'; | |
var CONSULTATION = 'Consultation with students'; | |
var MIDTERM_MARKING = 'Midterm Marking'; | |
var PROJECT = 'Project Evaluation'; |
This file contains hidden or 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
# read line by line from file | |
while read p; do | |
echo $p | |
done <file | |
# change first letter from upper to lower | |
q="$(tr '[:upper:]' '[:lower:]' <<< ${p:0:1})${p:1}" | |
# sed variable substitution | |
sed "s/$var/r_str/g" file_name >new_file |
This file contains hidden or 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
var Claim = function () { | |
// *********************************************************** | |
// REQUIRED CONSTANTS, DO NOT MODIFY | |
// *********************************************************** | |
var ASSIGNMENT_MARKING = 'Assignment Marking'; | |
var COURSE_MATERIAL_PREPARATION = 'Course Material Preparation'; | |
var TUTORIAL = 'Tutorial'; | |
var CONSULTATION = 'Consultation with students'; | |
var MIDTERM_MARKING = 'Midterm Marking'; | |
var PROJECT = 'Project Evaluation'; |
This file contains hidden or 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
(** | |
* This file contains 3 ways to solve the problem of: | |
* | |
* converting a binary search tree into a sorted linked list in-place | |
* | |
* In place means that no extra memory should be used, no structures are copied | |
* | |
* 1. Using ref nodes | |
* 2. Using records with mutable fields | |
* 3. Using immutable Cons and Nil linked list |
This file contains hidden or 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
:%s/<Ctrl-V><Ctrl-M>/\r/g | |
http://stackoverflow.com/questions/811193/how-to-convert-the-m-linebreak-to-normal-linebreak-in-a-file-opened-in-vim |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Go to Google Bookmarks: https://www.google.com/bookmarks/ | |
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en | |
After downloading the html file, run this script on it to generate a KML. | |
Slight modification of regex to get lat/lng from web page from: https://gist.github.com/endolith/3896948= | |
""" |
This file contains hidden or 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
00:16:22 | |
00:49:05 | |
01:21:49 | |
01:54:33 | |
02:27:16 | |
03:00:00 | |
03:32:44 | |
04:05:27 | |
04:38:11 | |
05:10:55 |
This file contains hidden or 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
from __future__ import division | |
from datetime import datetime, time, timedelta | |
import unittest | |
ONE_SECOND = timedelta(seconds=1) | |
HOUR_HAND_DEG_PER_SECOND = 1/120 | |
HOUR_HAND_DEG_PER_MIN = 1/2 | |
HOUR_HAND_DEG_PER_HOUR = 30 |
This file contains hidden or 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
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ia+n in this}function c(n){return n=ia+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===oa&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===oa)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n, |
NewerOlder