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
/* ------------------------------------------------------------------------------------ | |
author information: | |
caspar kleijne | |
cekleijne@gmail.com | |
http://twitter.com/caspar_kleijne | |
desc; use the jQuery in a pattern, Good for readability. | |
------------------------------------------------------------------------------------- */ | |
"use strict"; | |
/* declare the "namespace" */ |
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
/*global | |
$, | |
window, | |
document | |
*/ |
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
/** toggles between classes Normal & Hover on any element that has one of those classes | |
it is a replacement for the :hover pseudo-class (so quite useless nowadays ;) **/ | |
$(".Normal, .Hover").bind("mouseenter mouseleave", function () | |
$(this).toggleClass("Hover Normal"); | |
}); |
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
<#@ template language="C#" #> | |
<#@ output extension=".css" #> | |
/* | |
Variable Grid System Generated Stylesheet | |
v.0.1 alpha | |
Author: Caspar Kleijne | |
Contact: twitter.com/caspar_kleijne | |
Converted for TT from 960 Grid System - http://960.gs/ | |
Via ~ http://www.spry-soft.com/grids/ |
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
/** som reregexes */ | |
var simple_dutch_postcode: ^[1-9][0-9]{3}\s?[a-zA-Z]|[S]{2}$ |
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
...........................// | |
geschattebesparing : function () { | |
var p, l, j, v, t, result; | |
/* using single char vars to keep the calculation short */ | |
p = config.jaarlijkseprijsstijgingelektriciteit; | |
l = config.levensduurpanelen; | |
j = helpers.jaarlijkseopbrengst(); | |
v = helpers.vermogenpanelen(); | |
t = config.prijsperkWh; | |
result = ((Math.pow((1 + p), l) - 1) / p) * (t * 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
/** call it like **/ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
Uri uri = new Uri("http://gmcdn.goldmail.com/robin/gmtiming.xml"); | |
Presentation presentation = Rdn.Bll.PresentationController.LoadFromXML(uri); | |
} | |
using System; | |
using Rdn.Bll.Bo; |
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
// string xml = "<presentation />"; //<----- string that is your xml | |
public T Deserialize(string xml) | |
{ | |
T obj = default(T); | |
using (TextReader textreader = new StringReader(xml)) | |
{ | |
using (XmlReader reader = XmlReader.Create(textreader)) | |
{ | |
XmlSerializer serialzier = new XmlSerializer(typeof(T)); | |
obj = (T)serialzier.Deserialize(reader); |
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
Response.Clear(); | |
Response.ContentType = "image/jpeg"; | |
string raw = File.ReadAllText("e:\\cybersecuritychallenge.txt"); | |
byte[] imageBytes = Convert.FromBase64String(raw); | |
Response.BinaryWrite(imageBytes); | |
Response.End(); |
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
class Program | |
{ | |
private static Random r = new Random(DateTime.Now.Millisecond); | |
// names of the "moves" | |
private static string[] rps = { "PAPER", "ROCK", "SCISSORS"}; | |
// result feedback string to be formatted | |
private static string[] feedback = { "{1} Beats {0}, You Loose!","{0} Equals {1}, Draw!", "{0} Beats {1}, You Win!" }; | |
// solution matrix ( 0 = loose ; 1 = draw ; 2 = win // array1: for paper; array2: for rock; array3: for scissors; ) | |
private static int[,] solution = {{1, 2, 0},{0, 1, 2},{2, 0, 1}}; |
OlderNewer