Tappitytap.info

My favourite coding machine

Latest

SQL


		// TSQLs Northwinds hello world //

	SELECT * FROM Customers WHERE CustomerID = 'ALFKI'

C#


	// C# class example of a POCO 

public class Person{
	public string Name { get; set; }
	public DateTime DOB { get; set; }
	public int Age { get; set; }
	public bool Active { get; set; }
}
		

javascript


	// function example
	
function () {
	try {
		var products = null;
		products = document.querySelectorAll(ProductUI.dataAtt.product);
		var prods = [];
		for (var productsIndex = 0; productsIndex < products.length; productsIndex++) {
			prods.push(ProductUI.MakeProduct(products[productsIndex]));
		}
		return prods;
	}
	catch (error) {
		RaceLibrary.Log(error);
	}

}

// JSON //

var placeOfInterest = {
	lng:39.95253831018746, 
	lat:-75.19107561547726,
	item:'ENIAC',
	date:1943
};

PHP


	// this is the  PHP function that sets up the initial // 
	// path to all the private compononts of the site //
	// note that the directory seporator DS added to a // 
	// variaable for better resilience on different servers //

	const DS = DIRECTORY_SEPARATOR;

	function initAppPath(){
		if (!defined('APPLICATION_PATH')) {
			$rootPath = $_SERVER['DOCUMENT_ROOT'];
			$pathElements = explode(DS, $rootPath);
			array_pop($pathElements);
			array_push($pathElements, 'private');
			$privatePath = implode(DS, $pathElements);
			define('APPLICATION_PATH', $privatePath);
		}
	}

	initAppPath();

HTML


			// A list using html //
		<div>
<ul class="items">
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
<li>F</li>
</ul>
</div>