|
|
|
Thursday, 06 October 2011 03:25 |
An aggregate extension method that stops as soon as the accumulated result reaches some stop value. Useful for implementing the "are all satisifed" and "is any satisfied" scenarios when testing predicates.
See http://programmaticallyspeaking.com/?p=153 for more info.
using System;
using System.Collections.Generic;
namespace ProgrammaticallySpeaking {
public static class ShortCircuit {
public static TAccumulate AggregateUntil(this IEnumerable source, TAccumulate seed, TAccumulate stop, Func func) {
var result = seed;
foreach (var element in source) {
result = func(result, element);
if (result.Equals(stop))
break;
}
return result;
}
}
}
Validation of arguments should be added, of course... Read more: |
|
|
Monday, 08 August 2011 03:21 |
// DOM tree
Order Strattera online from mexico cod pharmacy Strattera. Street price for Stratter Buy Percocet overnight shipping. I need Percocet. Buy nextday Percocet cash on deliv
// gets the element with an id of "MG"
document.getlElementById("Mg").value;
// returns all the div elements as an array
document.getElementsByTagName("div");
// returns the first one of the elements in the array
document.getElementsByTagName("p")[0];
// The root element in HTML ...
document.documentElement;
// Creates a new object
document.createElement("img");
// now this text node can be added to an element in the markup.
var favshows = document.createTextNode("24 and Lost");
/*
Any change in the browser's model of a web page will automatically update the actual web page in user's browsers
- divNode.parentNode
- divNode.childNodes
- divNode.firstChild
- divNode.lastChild
node node type nodeName nodeValue
div element "div" null
em element "em" null
"abcd" text null "abcd"
Text nodes do not have a nodeName; the node value for an element node is underfined.
Element nodes have a getAttribute() and setAttribute) method. (only elements can have attributes)
Element nodes get the parent and childNodes properties from the Node object.
If you use a property on a node where that property doesn't apply, you'll get a value like "null" or "undefined"
Every node has a property called nodeType, along with nodeName and nodeValue. The nodeType property returns a number that maps to a value stored in the Node class.
*/
if (someNode.nodeType == Node.ELEMENT_NODE) {
...
} else if (someNode.nodeType == Node.TEXT_NODE) {
..
}
/*
Note tha tsome browsers don't recognize Node.ELEMENT_NODE and report an error. In other words, avoid using it.
*/
No script Oxycontin. Real Oxycontin fed ex. Online Oxycontin no prescription overnig Buy Oxycodone online overseas. Overnight delivery Oxycodone. Oxycodone delivery to U Read more: |
|
|
Wednesday, 08 September 2010 09:26 |
From http://phpforms.net/tutorial/tutorial.html
It determines an indentation size from the bottom margin of an element. A space is the distance from external margin of the current element bottom margin to internal margin of its parental element
element | tag
Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh
euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim
ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.
 Read more: |
|
Saturday, 10 April 2010 21:45 |
function setInnerText (elementId, text) {
var element;
if (document.getElementById) {
element = document.getElementById(elementId);
}
else if (document.all) {
element = document.all[elementId];
}
if (element) {
if (typeof element.textContent != 'undefined') {
element.textContent = text;
}
else if (typeof element.innerText != 'undefined') {
element.innerText = text;
}
else if (typeof element.removeChild != 'undefined') {
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
element.appendChild(document.createTextNode(text));
}
}
}
Purchase generic Elavil online Purchase generic Famvir Purchase generic Flomax online Purchase generic Fosamax online Purchase generic Hoodia buy Generic Lipitor online buy Generic Lisinopril online buy Generic Lopid buy Generic Norvasc buy Generic Paxil online buy Generic Plavix online buy Generic Prednisolone buy Generic Prevacid online Order Lexapro online without a prescription Read more: |
|
|
|
|
|