<ul class="ulMainNav">
<li><a {if #curnav# == 'feet'} class="current" {/if} href="/index.php">iwfeet</a></li>
<li><a {if #curnav# == 'care'} class="current" {/if} href="#">Care Advice</a></li>
<li><a {if #curnav# == 'treatment'} class="current" {/if} href="#">Treatment</a></li>
<li><a {if #curnav# == 'shoes'} class="current" {/if} href="http://iwshoes.co.uk/index.php">Shoes</a></li>
<li><a {if #curnav# == 'contact'} class="current" {/if} href="#">Contact</a></li>
</ul>
Tag Archive for test
Nav
testShell_div.js
alert('hi');
return false;
/*---------------------------------------------------------------------------*/
/* expandable generic node object */
function
Branch(N){var T=this;T.P='[object Tree]';T.N=T.I=T.P;if(N){T.N=N;T.I='window["'+T.N+'"]'}};
Branch.prototype.grow=function(N){
if(!N)return;var T=this;var Tt=T[N]=new Branch();
Tt.N=N; Tt.I=''+T.I+'["'+N+'"]'; Tt.P=T};
Branch.prototype.toString=function(){return this.I};
function /* a convenient preparation of a branch */
Tree(str){return window[str]=new Branch(str)}
Category: Uncategorized |
Tags: test
testShell_div.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- <link rel="search" type="application/opensearchdescription+xml" title="Snipplr" href="http://snipplr.com/snipplrsearch.xml" /> -->
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"></script>
<!--[if lte IE 6]><script src="http://www.savethedevelopers.org/say.no.to.ie.6.js"></script><![endif]-->
</head>
<body id="snippets">
<div id="viewsource">
<textarea rows="25" class="copysource">
alert('hi');
/*---------------------------------------------------------------------------*/
/* expandable generic node object */
function
Branch(N){var T=this;T.P='[object Tree]';T.N=T.I=T.P;if(N){T.N=N;T.I='window["'+T.N+'"]'}};
Branch.prototype.grow=function(N){
if(!N)return;var T=this;var Tt=T[N]=new Branch();
Tt.N=N; Tt.I=''+T.I+'["'+N+'"]'; Tt.P=T};
Branch.prototype.toString=function(){return this.I};
function /* a convenient preparation of a branch */
Tree(str){return window[str]=new Branch(str)}
/*---------------------------------------------------------------------------*/
</textarea>
</div>
</body>
</html>
Category: Uncategorized |
Tags: test
restest.php
<?php
$base = "http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService";
$query = "";
$params = Array(
'AWSAccessKeyId'=> '089TSKBGSRMRZAG5VF82',
'Operation' => "ItemSearch",
'SearchIndex' => 'Books',
'ResponseGroup' => 'SalesRank',
'Keywords' => "O'Reilly",
);
foreach ($params as $key => $value){
$query .= "&$key=" . urlencode($value);
}
$url = "$base$query";
echo '<pre>';
$xml = file_get_contents($url);
//$xml = preg_replace('/></', ">
<", $xml);
//$xml = domxml_xmltree($xml);
$xml = simplexml_load_string($xml);
echo '<style>td{border:1px solid red;}</style>';
echo '<table><tr><td>';
echo '<pre>';
ttn1( eko($xml) );
echo '</td><td>';
echo '<pre>';
ttn2( obv($xml) );
echo '</td></tr></table>';
function ttn1($res){
$reg = '/s+(/'; $rep = " ( ";
$res = preg_replace( $reg, $rep, $res);
$reg = '/s+)/'; $rep = " ) ";
$res = preg_replace( $reg, $rep, $res);
$reg = '/ {3}/'; $rep = " ";
$res = preg_replace( $reg, $rep, $res);
echo $res;
}
function ttn2($res){
$reg = '/=>s+/'; $rep = " => ";
$res = preg_replace( $reg, $rep, $res);
$reg = '/(
s+?})(
s+?})?(
s+?})?(
s+?})?/';
$rep = "$4$3$2$1";
$res = preg_replace( $reg, $rep, $res);
$reg = '/}
s+}/'; $rep = "} }";
$res = preg_replace( $reg, $rep, $res);
$res = preg_replace( $reg, $rep, $res);
echo $res;
}
function obv($x){ ob_start();var_dump($x);$s=ob_get_clean();ob_end_flush();return $s;}
function eko($x){ return htmlspecialchars(print_r($x, TRUE), ENT_QUOTES); }
?>
HTML Test Page for CSS Style Guide
<!-- Sample Content to Plugin to Template --> <h1>CSS Basic Elements</h1> <p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p> <hr /> <h1 id="headings">Headings</h1> <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> <small><a href="#wrapper">[top]</a></small> <hr /> <h1 id="paragraph">Paragraph</h1> <img style="width:250px;height:125px;float:right" src="images/css_gods_language.png" alt="CSS | God's Language" /> <p>Lorem ipsum dolor sit amet, <a href="#" title="test link">test link</a> adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.</p> <p>Lorem ipsum dolor sit amet, <em>emphasis</em> consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.</p> <small><a href="#wrapper">[top]</a></small> <hr /> <h1 id="list_types">List Types</h1> <h3>Definition List</h3> <dl> <dt>Definition List Title</dt> <dd>This is a definition list division.</dd> </dl> <h3>Ordered List</h3> <ol> <li>List Item 1</li> <li>List Item 2</li> <li>List Item 3</li> </ol> <h3>Unordered List</h3> <ul> <li>List Item 1</li> <li>List Item 2</li> <li>List Item 3</li> </ul> <small><a href="#wrapper">[top]</a></small> <hr /> <h1 id="form_elements">Fieldsets, Legends, and Form Elements</h1> <fieldset> <legend>Legend</legend> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus.</p> <form> <h2>Form Element</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui.</p> <p><label for="text_field">Text Field:</label><br /> <input type="text" id="text_field" /></p> <p><label for="text_area">Text Area:</label><br /> <textarea id="text_area"></textarea></p> <p><label for="select_element">Select Element:</label><br /> <select name="select_element"> <optgroup label="Option Group 1"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </optgroup> <optgroup label="Option Group 2"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </optgroup> </select></p> <p><label for="radio_buttons">Radio Buttons:</label><br /> <input type="radio" class="radio" name="radio_button" value="radio_1" /> Radio 1<br/> <input type="radio" class="radio" name="radio_button" value="radio_2" /> Radio 2<br/> <input type="radio" class="radio" name="radio_button" value="radio_3" /> Radio 3<br/> </p> <p><label for="checkboxes">Checkboxes:</label><br /> <input type="checkbox" class="checkbox" name="checkboxes" value="check_1" /> Radio 1<br/> <input type="checkbox" class="checkbox" name="checkboxes" value="check_2" /> Radio 2<br/> <input type="checkbox" class="checkbox" name="checkboxes" value="check_3" /> Radio 3<br/> </p> <p><label for="password">Password:</label><br /> <input type="password" class="password" name="password" /> </p> <p><label for="file">File Input:</label><br /> <input type="file" class="file" name="file" /> </p> <p><input class="button" type="reset" value="Clear" /> <input class="button" type="submit" value="Submit" /> </p> </form> </fieldset> <small><a href="#wrapper">[top]</a></small> <hr /> <h1 id="tables">Tables</h1> <table cellspacing="0" cellpadding="0"> <tr> <th>Table Header 1</th><th>Table Header 2</th><th>Table Header 3</th> </tr> <tr> <td>Division 1</td><td>Division 2</td><td>Division 3</td> </tr> <tr class="even"> <td>Division 1</td><td>Division 2</td><td>Division 3</td> </tr> <tr> <td>Division 1</td><td>Division 2</td><td>Division 3</td> </tr> </table> <small><a href="#wrapper">[top]</a></small> <hr /> <h1 id="misc">Misc Stuff - abbr, acronym, pre, code, sub, sup, etc.</h1> <p>Lorem <sup>superscript</sup> dolor <sub>subscript</sub> amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. <cite>cite</cite>. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. <abbr title="Avenue">AVE</abbr></p> <pre><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. <abbr title="Avenue">AVE</abbr></p></pre> <blockquote> "This stylesheet is going to help so freaking much." <br />-Blockquote </blockquote> <small><a href="#wrapper">[top]</a></small> <!-- End of Sample Content -->
Check for Cookie Acceptance
// on the master page or default page
protected void Page_Load(object sender, EventArgs e)
{
// check for a cookie indicating cookie acceptance
HttpCookie tokenCookie = Request.Cookies["AcceptsCookies"];
if (tokenCookie == null)
{
tokenCookie = new HttpCookie("AcceptsCookies", "true");
tokenCookie.Expires = DateTime.Now.AddYears(1000);
Response.Cookies.Add(tokenCookie);
Response.Redirect("~/CheckCookies.aspx");
}
}
// on the CheckCookies.aspx page
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie tokenCookie = Request.Cookies["AcceptsCookies"];
if (tokenCookie != null)
Response.Redirect("Default.aspx");
}
A Simple BDD (Behaviour Driven Development) library for JavaScript.
/*
* A Simple BDD (Behaviour Driven Development) library for JavaScript.
*
* Copyright (c) 2008 Takanori Ishikawa <takanori.ishikawa@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the authors nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* A Tiny JavaScript liberary for Behaviour-Driven Development (BDD).
*
* Author: Takanori Ishikawa <takanori.ishikawa@gmail.com>
* Copyright: Takanori Ishikawa 2008
* License: BSD License (see above)
*
* Supported Browsers:
* [Win] IE 6, Firefox 2
* [Mac] Safari 3, Firefox 2
*
* Usage:
* Spec.describe("Spec.should", function() {
* "simple values": function() {
* "should": function() {
* Spec.should(true);
* Spec.should(1);
* },
* ...
* },
* ...
* });
*
* See Also:
* Behavior Driven Development - Wikipedia, the free encyclopedia
* <a href="http://en.wikipedia.org/wiki/Behavior_driven_development" >http://en.wikipedia.org/wiki/Behavior_driven_development</a>
*
*/
/**
* Spec is the BDD style test utilities.
*/
var Spec = {
/** Replace the Spec.describe function with empty function if false. */
enabled: true,
/** Indicates whether object 'a' is "equal to" 'b'. */
equals: function(a, b) {
if (a instanceof Array && b instanceof Array) {
if (a.length != b.length) return false;
for (var i = 0; i < a.length; i++) if (!Spec.equals(a[i], b[i])) return false;
return true;
}
if ((a != null && b != null) && (typeof a == "object" && typeof b == "object")) {
for (var i in a) if (!Spec.equals(a[i], b[i])) return false;
return true;
}
return (a == b);
},
/** equivalent to xUint's assert */
should: function(expection, message) {
Spec.currentIndicator++;
if (!expection) {
var warning = [
"[Spec failed",
Spec.currentTitle ? " (" + Spec.currentTitle + ")] " : "] ",
(message || (Spec.currentMessage + " " + Spec.currentIndicator) || "")
].join("");
alert(warning);
throw warning;
}
return !!expection;
},
/** Write your specification by using describe method. */
describe: function(title, spec) {
Spec.currentTitle = title;
for (var name in spec) {
Spec.currentMessage = name;
Spec.currentIndicator = 0;
spec[name]();
Spec.currentIndicator = null;
}
Spec.currentMessage = Spec.currentTitle = null;
},
Version: "0.1"
};
// Other BDD style stuffs.
Spec.should.equal = function(a, b, message) { return Spec.should(Spec.equals(a, b), message); };
Spec.should.not = function(a, message) { return Spec.should(!a, message); };
Spec.should.not.equal = function(a, b, message) { return Spec.should(!Spec.equals(a, b), message); };
if (!Spec.enabled) Spec.describe = function(){};
// self test
Spec.describe("Spec object", {
"should": function() {
Spec.should(true);
Spec.should(1);
},
"should.not": function() {
Spec.should.not(false);
Spec.should.not(0);
},
"should.equal": function() {
Spec.should.equal(null, null);
Spec.should.equal("", "");
Spec.should.equal(12345, 12345);
Spec.should.equal([0,1,2], [0,1,2]);
Spec.should.equal([0,1,[0,1,2]], [0,1,[0,1,2]]);
Spec.should.equal({}, {});
Spec.should.equal({x:1}, {x:1});
Spec.should.equal({x:[1]}, {x:[1]});
},
"should.not.equal": function() {
Spec.should.not.equal([1,2,3], [1,2,3,4]);
Spec.should.not.equal({x:1}, [1,2,3,4]);
}
});
Tutorial)
<html> Sie sind der <b> <?php echo "$i"; ?> </b> te Besucher. </html>
Emulating a Slow Internet Link for HTTP
#!/bin/sh /sbin/ipfw add 100 pipe 1 ip from any 80 to any out /sbin/ipfw add 200 pipe 2 ip from any 80 to any in /sbin/ipfw pipe 1 config bw 128Kbit/s queue 64Kbytes delay 250ms /sbin/ipfw pipe 2 config bw 128Kbit/s queue 64Kbytes delay 250ms