食譜

Examplets.org


Welcome to Examplet Center

Select the following Topics you are interested

  1. What is an "examplet"?
  2. What is an "example"?
  3. What is a "statement of goal"
  4. What is a "snippet"
  5. What is the "HowTo System"

Examples

Examples are regarded as "simplified" or "incompleted" version of "examplet" either the "snippet" is incompleted or without a statement of goal.

 

Example class

Example class here means the php code used in this website for generating the example pages. If you're interested in the coding used in this website, you can try the following code:

 

<?php
class Example{
	var $title;
	var $sideBar;
	var $extractFromUrl;
	var $extractFrom;
	var $extractFromSite;
	var $extractFromSiteUrl;
	var $date;
	var $note;
	var $source;
	var $tagName;
	function toString(){
		$title=$this->title;
		$tagName=$this->tagName;
		include ($_SERVER['DOCUMENT_ROOT']."/inc/header_inc.php");
?>
<h1><a href="/examplet/javascript/javascript.php">Javascript</a> <a href="/example/example.php">Example</a> - <?php echo($this->title);?></h1>
<p><a href="/examplet/javascript/javascript.php">Javascript</a> <a href="/example/example.php">Example</a> is extracted from article "<a href="<?php echo("".$this->extractFromUrl)?>"><?php 
echo("".$this->extractFrom)?></a>" from <a href="<?php echo("".$this->extractFromSiteUrl)?>"><?php echo("".$this->extractFromSite)?></a></p><br/>
<h1>Note for using this example:</h1>
<p><?php 
if ($this->note=="") echo('There is no detailed explanation for this example.');
else echo($this->note);
?></p><br/>
<h1>Source code for the example:</h1>
<pre class="brush: jscript;" style="z-index:10;"><?php
		$handle = fopen($this->source, "r");
		$contents = fread($handle, filesize($this->source));
		fclose($handle);
		echo preg_replace('/</i', '<', $contents);
?></pre>
Output:
<div id="output" style="border:1px solid #CCC">
<?php echo($contents)?>
</div>
<link type="text/css" rel="stylesheet" href="/css/shCore.css"/>
<link type="text/css" rel="stylesheet" href="/css/shThemeDefault.css"/>
<script type="text/javascript" src="/js/shCore.js"></script>
<script type="text/javascript" src="/js/shBrushJScript.js"></script>
<link type="text/css" rel="stylesheet" href="/css/shCore.css"/>
<link type="text/css" rel="stylesheet" href="/css/shThemeDefault.css"/>
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '/js/clipboard.swf';	
SyntaxHighlighter.all();
</script>
<?php include ($_SERVER['DOCUMENT_ROOT']."/inc/footer_inc.php");
	}
}
?>

6502 MPU and assembly


Latest Blog Articles from CloudGen wordpress blog!


Copyright 2008-2017

Cloud-Gen