Hello, here are some random bits and pieces

Contents [automatic]

Javascript Projects

(this page - auto generated contents and links from header elements)
Spoilers
Noughts & Crosses (Tic-Tac-Toe)
Graph eg (WoT guns)
Pie Chart eg
Sorting speed curiosity
merge-sorting
quicksort
Rolling demo
Rolling example - Web Typography (Web Book)
Map Reduce (Web Book)
css compiling + applied example
Horizontal scrolling
Gradients on 'borders' and text
datePicker
highlighter
piegress
b�zier curve & cascading html creation
mandelbrot rendering
Math.pow optimising
js file editing/saving
similarity detail
util
util tests

Web Design

Resources

Regular Expressions
jQuery plugins : alerts, checkbox, uploader, datepicker, dropdown, etc

All sensible stuff is above this line ... below is a mishmash of bits and pieces


- Only misc testing stuff from here on in ... -

Sliding left-right

hello there, said bob
see also v3 - final version and v1 - a preliminary attempt and v2

Pie Chart +example heading item

Key

Overlay Progress Effect +example heading item with it's own id

Math(working)

k=1 vs \(k=1\)
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\)
also : \(\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\)
more : \(\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}\)

Border collapse

hiya some stuffand then?
ah, tables only :-/ hacked -ve margin above

Progress Bars

100%
95%
50%
20%
10%
5%
0%
0%

fake link

link

.js GET request

Hammer & wrench

Hammer & wrench

Hammer + wrenCh
more like pliers, unfortunately :
wrenCh

unit tests

empty

Chart.js

stacking

table

Today's Opinion Poll QuestionPolitical Party
DemocratRepublicalIndependant
"Do you favour or
oppose increasing
the minimum wage?"
Favour70%35%55%
Oppose25%60%30%
Unsure5%5%15%

set cascade generator (v3)

function set(o,v){for(var n in v) o[n]=v[n];return o}
(v1 was function set(o,s){s=function(a,v){o[a]=v;return s};s.o=o;return s} eg: set(acat)('sound','purrrr')('legs',4) )
(v2 was function set(o){return function s(a,v){o[a]=v;return s}} eg: set(acat)('sound','purrrr')('legs',4) )

mutate

fake yield

empty

FizzBuzz

Symbols to words tricks

var s = ([]+![])[+!+[]+!+[]+!+[]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]](([]+!![])[+!+[]]+([]+[][+[]])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]+!+[]]+([]+!![])[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+(+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+...

Standardized DateTime formatting

var id = function(){
  var id=0;
  function getNextId() { return id++; };
  return function(){ return getNextId(); }; }();

optimised from :
get_time = function() {
	var date_part, local_time, now, time_part;
	local_time = new Date();
	now = new Date(local_time.getTime() + (local_time.getTimezoneOffset() * 60000));
	date_part = "" + (this.zero_pad(now.getFullYear(), 2)) + "-" + (this.zero_pad(now.getMonth() + 1, 2)) + "-" + (this.zero_pad(now.getDate(), 2));
	time_part = "" + (this.zero_pad(now.getHours(), 2)) + ":" + (this.zero_pad(now.getMinutes(), 2)) + ":" + (this.zero_pad(now.getSeconds(), 2));
	return "" + date_part + " " + time_part; };
zero_pad = function(number, length) {
	var str;
	str = "" + number;
	while (str.length < length) str = "0" + str;
	return str; };

to :
Date.prototype.ymd = function getYMD() {
	function p2(s) { return ("0" + s).slice(-2) }
	function p4(s) { return ("000" + s).slice(-4) }
	return [p4(this.getFullYear()), p2(this.getMonth()+1), p2(this.getDate())].join("-") + 
		" " + 
		[p2(this.getHours()),p2(this.getMinutes()),p2(this.getSeconds())].join(":"); };

to :
Date.prototype.ymd = function getYMD(d) {
	var d = d || this;
	function p2(s) { return ("0"+s).slice(-2) }
	return [d.getFullYear(),p2(d.getMonth()+1),p2(d.getDate())].join("-") +
		" "+[p2(d.getHours()),p2(d.getMinutes()),p2(d.getSeconds())].join(":") };
compacted:
Date.prototype.ymd=function ymd(d){d=d||this;function p(s){return("0"+s).slice(-2)}
	return[d.getFullYear(),p(d.getMonth()+1),p(d.getDate())].join("-")+" "+
	[d.getHours(),d.getMinutes(),d.getSeconds()].map(p).join(":")};
most efficient, but less fun:
Date.prototype.ymd=function ymd(d){d=d||this;function p(s){return('0'+s).slice(-2)}
	return d.getFullYear()+'-'+p(d.getMonth()+1)+'-'+p(d.getDate())+' '+
	p(d.getHours())+':'+p(d.getMinutes())+':'+p(d.getSeconds())};

messagebox

Are you sure you want to answer this question?
cancel yes, Yes i do