<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Compiled Thoughts by John Ciacia &#187; Tutorial</title>
	<atom:link href="http://www.johnciacia.com/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnciacia.com</link>
	<description>Science, Technology, and Beyond</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:46:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using the UIButton in Xcode</title>
		<link>http://www.johnciacia.com/2011/07/03/using-the-uibutton-in-xcode/</link>
		<comments>http://www.johnciacia.com/2011/07/03/using-the-uibutton-in-xcode/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 05:05:50 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[uibutton]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=1266</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="560" height="349" src="http://www.youtube.com/embed/TAMM6mszYf4" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2011/07/03/using-the-uibutton-in-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Speech Input</title>
		<link>http://www.johnciacia.com/2011/06/04/html5-speech-input/</link>
		<comments>http://www.johnciacia.com/2011/06/04/html5-speech-input/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 06:12:27 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[speech input]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=1025</guid>
		<description><![CDATA[The new features being introduced by the HTML5 standard are simply astounding. Just as the awe of one feature starts to wear off, I discover another that is even more awesome than the last. The current jaw dropping discovery is largely due to the Speech Input API Specification. Thats right, speech input. You can add [...]]]></description>
			<content:encoded><![CDATA[<p>The new features being introduced by the HTML5 standard are simply astounding. Just as the awe of one feature starts to wear off, I discover another that is even more awesome than the last. The current jaw dropping discovery is largely due to the <a href="http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html">Speech Input API Specification</a>. Thats right, speech input.</p>
<p>You can add speech input to any input element by simply using the <code>x-webkit-speech</code> attribute.</p>
<p>The following code<br />
[code]<br />
<input type="text" x-webkit-speech />[/code]<br />
Will yield this<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2011/06/Screen-shot-2011-06-04-at-2.03.16-AM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/06/Screen-shot-2011-06-04-at-2.03.16-AM.png" alt="" title="Screen shot 2011-06-04 at 2.03.16 AM" width="442" height="176" class="aligncenter size-full wp-image-1026" /></a></p>
<p>You can do other exciting actions language translations, or the famous voice search for android:<br />
[code]    <script type="text/javascript">
      function startSearch(event) {
        event.target.form.submit();
      }
    </script></p>
<form action="http://www.google.com/search">
<input type="search" name="q" speech required onspeechchange="startSearch">
    </form>
<p>[/code]</p>
<p>Although this currently only works in Chrome 11 and relies on Google&#8217;s voice API, it is anticipated that more browsers will adopt the technology, and users will have the ability to choose which voice API they want to use.</p>
<p>*does the happy dance*</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2011/06/04/html5-speech-input/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello World in Xcode 4.0</title>
		<link>http://www.johnciacia.com/2011/05/17/hello-world-in-xcode-4/</link>
		<comments>http://www.johnciacia.com/2011/05/17/hello-world-in-xcode-4/#comments</comments>
		<pubDate>Tue, 17 May 2011 21:07:15 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[hello world in xcode 4]]></category>
		<category><![CDATA[objective]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[xcode 4]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=988</guid>
		<description><![CDATA[We will start off by creating a new project and selecting a Window-based Application. And naming it HelloWorld Next we want to create a view controller. Go to File &#62; New &#62; New File&#8230; and select UIViewController subclass. A UIViewController subclass works by overriding functions in its base class. The function of particular interest to [...]]]></description>
			<content:encoded><![CDATA[<p>We will start off by creating a new project and selecting a Window-based Application.</p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.52.37-PM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.52.37-PM.png" alt="" title="Screen shot 2011-05-17 at 3.52.37 PM" width="742" height="505" class="aligncenter size-full wp-image-989" /></a></p>
<p>And naming it HelloWorld</p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.52.55-PM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.52.55-PM.png" alt="" title="Screen shot 2011-05-17 at 3.52.55 PM" width="742" height="505" class="aligncenter size-full wp-image-990" /></a></p>
<p>Next we want to create a view controller. Go to <em>File &gt; New &gt; New File&#8230;</em> and select <strong>UIViewController subclass</strong>. </p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.55.49-PM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.55.49-PM.png" alt="" title="Screen shot 2011-05-17 at 3.55.49 PM" width="742" height="505" class="aligncenter size-full wp-image-991" /></a></p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.56.10-PM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.56.10-PM.png" alt="" title="Screen shot 2011-05-17 at 3.56.10 PM" width="742" height="505" class="aligncenter size-full wp-image-992" /></a></p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.56.24-PM.png"><img src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-3.56.24-PM.png" alt="" title="Screen shot 2011-05-17 at 3.56.24 PM" width="441" height="329" class="aligncenter size-full wp-image-993" /></a></p>
<p>A UIViewController subclass works by overriding functions in its base class. The function of particular interest to us is the <strong>loadView</strong>. This is where we will add controls to our view.</p>
<p>[code lang=cpp]- (void)viewDidLoad<br />
{<br />
    //Create a frame<br />
    CGRect frame = CGRectMake(0, 0, 320, 480);</p>
<p>    //Initialize the view with our frame<br />
    self.view = [[UIView alloc] initWithFrame:frame];</p>
<p>    //Set the background color of the view to be white<br />
    self.view.backgroundColor = [UIColor whiteColor];</p>
<p>    [super viewDidLoad];<br />
}[/code]</p>
<p>But before we add controles to the view, we need to create a frame which will hold the view.  <code>CGRect frame = CGRectMake(0, 0, 320, 480);</code> creates a frame starting at point (0, 0) (the upper left corner) with a width of 320 pixels by 480 pixels (the size of an iPhone screen). We then allocate and initialize the <code>view</code> with the frame we just created. Now that we have a view, we can add our label.</p>
<p>[code lang=cpp]- (void)viewDidLoad<br />
{<br />
    CGRect frame = CGRectMake(0, 0, 320, 480);<br />
    self.view = [[UIView alloc] initWithFrame:frame];<br />
    self.view.backgroundColor = [UIColor whiteColor];</p>
<p>    //Create a frame to hold the label<br />
    frame = CGRectMake(50, 50, 100, 50);</p>
<p>    //Create and initialize the label<br />
    UILabel *label = [[UILabel alloc] initWithFrame:frame];</p>
<p>    //Set the labels text to Hello, World!<br />
    label.text = @"Hello, World!";</p>
<p>    //Add the label to the view<br />
    [self.view addSubview:label];</p>
<p>    //Release the reference<br />
    [label release];</p>
<p>    [super viewDidLoad];<br />
}[/code]</p>
<p>Like before, we start by creating a frame to hold the label. Once the frame is created, we can allocate a UILabel, initialize it, set its text, and add it to the view. Lastly, since Objective-C uses reference counting, it is a good idea to release the label to avoid any memory leaks &#8211; as a general rule of thumb, if you use a * make sure you release it.</p>
<p>Now that we have a view controller with a label, we need to add the view controller to the window. In your <strong>HelloWorldAppDelegate.h</strong> start by forward declaring the <code>HelloWorldViewController</code> class &#8211; this will tell the app delegate the HelloWorldViewController class exists. Then create an instance variable of type <code>HelloWorldViewController</code>, and finally make it a property.</p>
<p>[code lang=cpp]#import <UIKit/UIKit.h><br />
//Forward declare the class<br />
@class HelloWorldViewController;</p>
<p>@interface HelloWorldAppDelegate : NSObject  {<br />
    //Create an instance variable (don't forget to release this)<br />
    HelloWorldViewController *viewController;<br />
}</p>
<p>@property (nonatomic, retain) IBOutlet UIWindow *window;</p>
<p>//Create a property<br />
@property (nonatomic, retain) HelloWorldViewController *viewController;</p>
<p>@end[/code]</p>
<p>Finally, in <strong>HelloWorldAppDelegate.m</strong> import the HelloWorldViewController.h file.<br />
[code lang=cpp]#import "HelloWorldAppDelegate.h"</p>
<p>#import "HelloWorldViewController.h"[/code]</p>
<p>Synthesize the viewController instance variable</p>
<p>[code lang=cpp]@synthesize window=_window;<br />
@synthesize viewController;[/code]</p>
<p>Then finally, allocate a HelloWorldViewController and add to the window viewController.view as a subview.
<p>
[code lang=cpp]- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions<br />
{<br />
    self.viewController = [HelloWorldViewController alloc];<br />
    [self.window addSubview:self.viewController.view];</p>
<p>    // Override point for customization after application launch.<br />
    [self.window makeKeyAndVisible];<br />
    return YES;<br />
}[/code]</p>
<p>Be sure to release viewController when you are done with it!</p>
<p>[code lang=cpp]- (void)dealloc<br />
{<br />
    [viewController release];<br />
    [_window release];<br />
    [super dealloc];<br />
}[/code]</p>
<p>Build and Go!</p>
<p><a href="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-4.51.11-PM.png"><img class="aligncenter size-full wp-image-1002" title="Screen shot 2011-05-17 at 4.51.11 PM" src="http://www.johnciacia.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-4.51.11-PM.png" alt="" width="396" height="744" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2011/05/17/hello-world-in-xcode-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No require with autoload</title>
		<link>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/</link>
		<comments>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 21:57:27 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[autoload]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[php6]]></category>
		<category><![CDATA[require]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=734</guid>
		<description><![CDATA[If you have ever worked with a PHP framework you probably have noticed some features that allow you to develop code more rapidly. In this blog, I am going to address autoloading. Traditionally, in object oriented PHP, we create a new source file for each class. If we want to create an object of a [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever worked with a PHP framework you probably have noticed some features that allow you to develop code more rapidly. In this blog, I am going to address autoloading.</p>
<p>Traditionally, in object oriented PHP, we create a new source file for each class. If we want to create an object of a class, we have to include the php file using require_once (or using a similar function). If we do not include the source file, we will be issued a fatal error.</p>
<p>
<pre><strong>Fatal error</strong>: Class 'User' not found in ...</pre>
</p>
<p>Lets say we have a User class defined as follows in a User.php file</p>
<p>[code lang="PHP"]<?php</p>
<p>class User {<br />
    function __construct() {<br />
        echo "Hello, World!";<br />
    }<br />
}<br />
?>[/code]</p>
<p>If we want to create a new User object we would include user.php and use the new keyword to instantiate the class.</p>
<p>[code lang="PHP"]<?php<br />
require_once('user.php');<br />
$user = new User();[/code]</p>
<p>This is method reasonable for a small number of classes. However, large frameworks can span hundreds of classes, and having to write require_once for each class becomes a huge annoyance. PHP5 introduced an autoload <a href="http://php.net/manual/en/language.oop5.magic.php">magic method</a> which is automatically called if the class source file cannot be found. The __autoload function takes a single parameter - the class being instantiated. If our class name corresponds to its file name we can do something as simple as:</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    require_once($class . ".php");<br />
}[/code]</p>
<p>Now, each time you instantiate a class, the autoload function will be automatically ran and it will automagically require your class. This is great, however all classes have to be in the same directory as the callee, and any decent framework uses a class hierarchy and spreads classes out into different directories. When I was writing my framework a few years ago, I stumbled upon a pretty awesome use of the autoload function. I think the idea was borrowed from the Zend framework. In a nutshell, the class names would correspond to their location on the file system. For example, the Zend framework has a class named Zend_Controller_Action_HelperBroker, and the class path Zend/Controller/Action/HelperBroker.php. What does this mean? With some additional code in our autoload function, we can convert the class name into its respective path allowing use to create a class hierarchy on our file system.</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    $file = str_replace("_", "/", $class);<br />
    require_once($file . ".php");<br />
}[/code]</p>
<p>Now, with the onset of PHP5.3 and the introduction of namespaces, this method has been kind of depreciated for a more pragmatic method. Instead of naming our classes with really long names that correspond to their path, we can use a namespace instead. Thus our autoload function would look like:</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    $file = str_replace("\\", "/", $class);<br />
    require_once($file . ".php");<br />
}[/code]</p>
<p>In my next blog, I will talk more about namespaces and give a better demo on how this is used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Text Messages in PHP</title>
		<link>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/</link>
		<comments>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 17:15:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=648</guid>
		<description><![CDATA[Recently I&#8217;ve had to implement an alert system in PHP were the alerts are sent via a text message. The concept is very simple &#8211; use an email to SMS gateway. Essentially, you send an email to a phone companies gateway server, that server then relays the email to the phone number specified via a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had to implement an alert system in PHP were the alerts are sent via a text message. The concept is very simple &#8211; use an email to SMS gateway. Essentially, you send an email to a phone companies gateway server, that server then relays the email to the phone number specified via a SMS. Since PHP has the ability to send emails, the whole process is quite easy.</p>
<p>1. First you need to acquire a list of SMS gateways you are going to support. For an extensive list, check out Wikipedias <a href="http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit">List of SMS Gateways</a>. For this tutorial, I will only be using AT&#038;T Wireless (number@txt.att.net) and Verison (number@vtext.com).</p>
<p>2. Create a simple HTML form.<br />
[code lang="html"]<!DOCTYPE html><br />
<html><br />
<head><br />
	<meta charset="utf-8"></meta></p>
<p></head></p>
<p><body></p>
<form action="POST">
<p>		<label for="provider">Provider: </label></p>
<select>
<option value="txt.att.net">AT&#038;T Wireless</option>
<option value="vtext.com">Verizon</option>
</select>
<p></p>
<p>		<label for="number">Number: </label></p>
<input type="number" /></p>
<p>		<label for="subject">Subject: </label></p>
<input type="subject" /></p>
<p>		<label for="message">Message: </label></p>
<input type="message" /></p>
<input type="submit" /></form>
<p></body></p>
<p></html><br />
[/code]</p>
<p>3. Add the necessary PHP code to send the email<br />
[code lang="PHP"]<!DOCTYPE html><br />
<html><br />
<head><br />
	<meta charset="utf-8"></meta></p>
<p></head></p>
<p><body><br />
	<?php<br />
		if(!empty($_POST['number'])) {<br />
			mail($_POST['number'] . $_POST['provider'], $_POST['subject'], $_POST['message']);<br />
        }<br />
	?></p>
<form action="POST">
<p>		<label for="provider">Provider: </label></p>
<select>
<option value="@txt.att.net">AT&#038;T Wireless</option>
<option value="@vtext.com">Verizon</option>
</select>
<p></p>
<p>		<label for="number">Number: </label></p>
<input type="number" /></p>
<p>		<label for="subject">Subject: </label></p>
<input type="subject" /></p>
<p>		<label for="message">Message: </label></p>
<input type="message" /></p>
<input type="submit" /></form>
<p></body></p>
<p></html><br />
[/code]</p>
<p>You will want to do some better error checking and validation, but thats it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML5 Input</title>
		<link>http://www.johnciacia.com/2010/08/01/html5-input/</link>
		<comments>http://www.johnciacia.com/2010/08/01/html5-input/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 17:53:12 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[date picker]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 date]]></category>
		<category><![CDATA[html5 email]]></category>
		<category><![CDATA[html5 input]]></category>
		<category><![CDATA[html5 number]]></category>
		<category><![CDATA[html5 search]]></category>
		<category><![CDATA[html5 time]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=610</guid>
		<description><![CDATA[Lets be honest, HTML5 is the new buzz word. Every blog, tutorial, tweet, article, or post I read contains some reference to HTML5. It&#8217;s almost as bad as presidential campaigns during election year (well&#8230; maybe not that bad, but you get the idea!) However, unlike the latter, I am fully confident HTML5 will live up [...]]]></description>
			<content:encoded><![CDATA[<p>Lets be honest, HTML5 is the new buzz word. Every blog, tutorial, tweet, article, or post I read contains some reference to HTML5. It&#8217;s almost as bad as presidential campaigns during election year (well&#8230; maybe not that bad, but you get the idea!) However, unlike the latter, I am fully confident HTML5 will live up its expectations. Why is HTML5 so special? Well, you know all those hoops you&#8217;ve had to jump through and JavaScript libraries you&#8217;ve had to include? Kiss them goodbye! Let us take a look at some of the new features HTML5 provides with regard to input types.</p>
<h2>Placeholder</h2>
<p>[code lang="html"]<br />
<input name="first" placeholder="First Name" />[/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/placeholder.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/placeholder.png" alt="" title="placeholder" width="166" height="30" class="alignnone size-full wp-image-614" /></a></p>
<h2>Range</h2>
<p>[code lang="html"]<br />
<input name="range" type="range" value="50" min="0" max="100" />[/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/range.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/range.png" alt="" title="range" width="152" height="30" class="alignnone size-full wp-image-616" /></a></p>
<h2>Number</h2>
<p>[code lang="html"]<br />
<input type="number" min="0" max="12" step="3" value="6" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/numbers.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/numbers.png" alt="" title="numbers" width="117" height="35" class="alignnone size-full wp-image-619" /></a></p>
<h2>Search</h2>
<p>[code lang="html"]<br />
<input type="search" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/search.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/search.png" alt="" title="search" width="162" height="31" class="alignnone size-full wp-image-629" /></a></p>
<h2>Date</h2>
<p>[code lang="html"]<br />
<input type="date" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/date.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/date.png" alt="" title="date" width="222" height="201" class="alignnone size-full wp-image-620" /></a></p>
<h2>Month</h2>
<p>[code lang="html"]<br />
<input type="month" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/month.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/month.png" alt="" title="month" width="222" height="201" class="alignnone size-full wp-image-623" /></a></p>
<h2>Week</h2>
<p>[code lang="html"]<br />
<input type="week" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/week.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/week.png" alt="" title="week" width="222" height="201" class="alignnone size-full wp-image-624" /></a></p>
<h2>Time</h2>
<p>[code lang="html"]<br />
<input type="time" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/time.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/time.png" alt="" title="time" width="75" height="32" class="alignnone size-full wp-image-625" /></a></p>
<h2>Datetime</h2>
<p>[code lang="html"]<br />
<input type="datetime" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/datetime.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/datetime.png" alt="" title="datetime" width="222" height="201" class="alignnone size-full wp-image-626" /></a></p>
<h2>Datetime-Local</h2>
<p>[code lang="html"]<br />
<input type="datetime-local" /> [/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/datetime-local.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/datetime-local.png" alt="" title="datetime-local" width="222" height="201" class="alignnone size-full wp-image-627" /></a></p>
<p>Currently, desktop browsers treat the following types as plain text. However, Safari on my iPhone optimizes the keyboard layout.</p>
<h2>Email</h2>
<p>[code lang="html"]<br />
<input type="email" />[/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0076.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0076-150x150.png" alt="" title="IMG_0076" width="150" height="150" class="alignnone size-thumbnail wp-image-630" /></a></p>
<h2>URL</h2>
<p>[code lang="html"]<br />
<input type="url" />[/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0077.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0077-150x150.png" alt="" title="IMG_0077" width="150" height="150" class="alignnone size-thumbnail wp-image-631" /></a></p>
<h2>Tel</h2>
<p>[code lang="html"]<br />
<input type="tel" />[/code]<br />
<a href="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0079.png"><img src="http://www.johnciacia.com/wp-content/uploads/2010/08/IMG_0079-150x150.png" alt="" title="IMG_0079" width="150" height="150" class="alignnone size-thumbnail wp-image-634" /></a></p>
<p>The next type is built into the HTML5 specification, but I could not find any browser that takes advantage of it.</p>
<h2>Color</h2>
<p>[code lang="html"]<br />
<input type="color" />[/code]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/08/01/html5-input/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interacting with the Arduino with C#</title>
		<link>http://www.johnciacia.com/2010/06/03/interacting-with-the-arduino-with-c/</link>
		<comments>http://www.johnciacia.com/2010/06/03/interacting-with-the-arduino-with-c/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 02:44:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[RS232]]></category>
		<category><![CDATA[serial port]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=517</guid>
		<description><![CDATA[There are times where you may want to build a nice user interface for your Arduino program to monitor input/output. In this tutorial, I will show you how to use C# to send data to and receive data from the Arduino. This tutorial assumes basic knowledge of Arduino programming and C#. For testing purposes, we [...]]]></description>
			<content:encoded><![CDATA[<p>There are times where you may want to build a nice user interface for your Arduino program to monitor input/output. In this tutorial, I will show you how to use C# to send data to and receive data from the Arduino. This tutorial assumes basic knowledge of Arduino programming and C#. For testing purposes, we will create a vary basic &#8220;echo&#8221; program that takes an input and outputs the input.</p>
<p>[code lang="cpp"]void setup()<br />
{<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
  while(Serial.available()) {<br />
      Serial.write(Serial.read());<br />
  }<br />
}[/code]</p>
<p>While there is data available, we read it, then write it to the output. Now open Visual Studio and create a new Windows Forms Application. I will name it ArduinoSerial.</p>
<p>From your toolbox, add two Label&#8217;s, two ComboBox&#8217;s, and a SerialPort. I have named them lblCOM, lblBaud, cboPorts, cboBaud, and serialPort1 respectively. ComboBox&#8217;s cboPorts and cboBaud which will allow the user to select which COM port the Arduino is using and the correct Baud rate to use.</p>
<p>To get the available serial ports, use the GetPortNames() method from System.IO.Ports.SerialPort. You can then add this array to cboPorts.</p>
<p>[code lang="cpp"]string[] serialPorts = System.IO.Ports.SerialPort.GetPortNames();<br />
cboPorts.Items.AddRange(serialPorts);[/code]</p>
<p>For the Baud rate ComboBox I am simply going to enumerate the values.<br />
[code lang="cpp"]cboBaud.Items.Add(2400);<br />
cboBaud.Items.Add(4800);<br />
cboBaud.Items.Add(9600);<br />
cboBaud.Items.Add(14400);<br />
cboBaud.Items.Add(19200);<br />
cboBaud.Items.Add(28800);<br />
cboBaud.Items.Add(38400);<br />
cboBaud.Items.Add(57600);<br />
cboBaud.Items.Add(115200);[/code]<br />
The final constructor takes the following form:<br />
[code lang="cpp"]public ArduinoSerial()<br />
{<br />
    InitializeComponent();</p>
<p>    string[] serialPorts = System.IO.Ports.SerialPort.GetPortNames();<br />
    cboPorts.Items.AddRange(serialPorts);</p>
<p>    cboBaud.Items.Add(2400);<br />
    cboBaud.Items.Add(4800);<br />
    cboBaud.Items.Add(9600);<br />
    cboBaud.Items.Add(14400);<br />
    cboBaud.Items.Add(19200);<br />
    cboBaud.Items.Add(28800);<br />
    cboBaud.Items.Add(38400);<br />
    cboBaud.Items.Add(57600);<br />
    cboBaud.Items.Add(115200);</p>
<p>    cboPorts.SelectedIndex = 0;<br />
    cboBaud.SelectedIndex = 2;<br />
}[/code]</p>
<p>Next we are going to create a button called btnStart. This button will initiate the connection to the Arduino. In the code for the buttons click event, we first need to get the port from cboPorts. Then are are going to assign this value to the PortName attribute of the SerialPort object.<br />
[code lang="cpp"]serialPort1.PortName = cboPorts.SelectedItem.ToString();[/code]<br />
We are going to do the same for the BaudRate attribute.<br />
[code lang="cpp"]serialPort1.BaudRate = Convert.ToInt32(cboBaud.SelectedItem.ToString());[/code]<br />
Then we are going to open the connection (and toggle the Start/Stop buttons)<br />
[code lang="cpp"]if (!serialPort1.IsOpen)<br />
{<br />
    btnStart.Enabled = false;<br />
    btnStop.Enabled = true;<br />
    serialPort1.Open();<br />
}[/code]<br />
In the btnStop click event is very similar to the above.<br />
[code lang="cpp"]private void btnStop_Click(object sender, EventArgs e)<br />
{<br />
    if (serialPort1.IsOpen)<br />
    {<br />
        btnStart.Enabled = true;<br />
        btnStop.Enabled = false;<br />
        serialPort1.Close();<br />
    }<br />
}[/code]<br />
Now we can create a TextBox and a Button called txtInput and btnSend. These two controls will be responsible for sending data to the Arduino. In the btnSend click event add the following code.<br />
[code lang="cpp"]if (!serialPort1.IsOpen) return;<br />
serialPort1.Write(txtInput.Text + "\n");[/code]<br />
The rest of the magic takes place in the SerialPorts DataReceived event. To get the data from the serial port we simply call the ReadExisting() function on the SerialPort object. Then we just need to append that text to a text box. However, we must make this thread safe to prevent any dead locks.</p>
<p>[code lang="cpp"]/**<br />
 * http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx<br />
 */<br />
delegate void SetTextCallback(string text);<br />
private void SetText(string text)<br />
{<br />
    if (this.txtOutput.InvokeRequired)<br />
    {<br />
        SetTextCallback d = new SetTextCallback(SetText);<br />
        this.BeginInvoke(d, new object[] { text });<br />
    }<br />
    else<br />
    {<br />
        txtOutput.AppendText(text);<br />
    }<br />
}</p>
<p>private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)<br />
{<br />
    try<br />
    {<br />
        SetText(serialPort1.ReadExisting());<br />
    }</p>
<p>    catch (Exception ex)<br />
    {<br />
        SetText(ex.ToString());<br />
    }</p>
<p>}[/code]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/06/03/interacting-with-the-arduino-with-c/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Grayscale Images with GD</title>
		<link>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/</link>
		<comments>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:38:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=679</guid>
		<description><![CDATA[In computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that is, it carries the full (and only) information about its intensity. Images of this sort are composed exclusively of shades of neutral gray, varying from black at the weakest intensity to white [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>In computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that is, it carries the full (and only) information about its intensity. Images of this sort are composed exclusively of shades of neutral gray, varying from black at the weakest intensity to white at the strongest.</p></blockquote>
<p>In PHP, it is easy enough to do. First we want to create two image resources. First we need our original image so we can map its color. Second we need to create an image which will become our grayscale image.</p>
<p>[code lang="php"]<?php<br />
//change this to your image location<br />
$original = @imagecreatefrompng("/home/john/Documents/colorized.png")<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>$im = @imagecreate(imagesx($original), imagesy($original))<br />
    or die("Cannot Initialize new GD image stream");<br />
[/code]</p>
<p>Next we want to create our color pallet. Since we our goal is a gray image,we will only use shades of black and white. Colorized images are generally within the RGB color space. Meaning each pixel is composed of red, green, and blue light which allows you to reproduce a broad array of colors. White is represented as 255,255,255 and black is represented as 0,0,0. Therefore, all gray shades are represented as x,x,x. So we thus create our pallet:<br />
[code lang="php"]<?php<br />
for ($i = 0; $i <= 255; $i++) {<br />
    $palette[$i] = imagecolorallocate($im, $i, $i, $i);<br />
}[/code]</p>
<p>Next we want to create a function to convert from the RGB color space to some color space that only represents the pixels intensity. The <a href="http://en.wikipedia.org/wiki/YIQ">YIQ</a> is the best color space for this since the Y represents the luma of the pixel. The numbers I use in the function below comes from the Y component: <a href="http://en.wikipedia.org/wiki/YIQ#Formulas">YIQ - Wikipedia, the free encyclopedia</a><br />
[code lang="php"]<?php<br />
function grayscale($r, $g, $b) {<br />
    return 0.299*$r + 0.587*$g + 0.114*$b;<br />
}[/code]</p>
<p>Now we actually need to get the RGB values of each pixel so we can convert if. To do this, we iterate over the entire image (so large images will take some time), and place the transformed pixel onto the new image we wish to create.</p>
<p>[code lang="php"]<?php<br />
for($x = 0; $x < imagesx($original); $x++) {<br />
    for($y = 0; $y < imagesy($original); $y++) {<br />
        $rgb = imagecolorat($original, $x, $y);<br />
        $r = ($rgb >> 16) &#038; 0xFF;<br />
        $g = ($rgb >> <img src='http://www.johnciacia.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &#038; 0xFF;<br />
        $b = $rgb &#038; 0xFF;<br />
        imagesetpixel($im, $x, $y, $palette[grayscale($r, $g, $b)]);<br />
    }<br />
}[/code]</p>
<p>Now all that is left is to set the header and create the image. The final code is below.</p>
<p>[code lang="php"]<?php<br />
header("Content-type: image/png");</p>
<p>$original = @imagecreatefrompng("/home/john/Documents/colorized.png")<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>$im = @imagecreate(imagesx($original), imagesy($original))<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>for ($i = 0; $i <= 255; $i++) {<br />
    $palette[$i] = imagecolorallocate($im, $i, $i, $i);<br />
}</p>
<p>function grayscale($r, $g, $b) {<br />
    return 0.299*$r + 0.587*$g + 0.114*$b;<br />
}</p>
<p>for($x = 0; $x < imagesx($original); $x++) {<br />
    for($y = 0; $y < imagesy($original); $y++) {<br />
        $rgb = imagecolorat($original, $x, $y);<br />
        $r = ($rgb >> 16) &#038; 0xFF;<br />
        $g = ($rgb >> <img src='http://www.johnciacia.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &#038; 0xFF;<br />
        $b = $rgb &#038; 0xFF;<br />
        imagesetpixel($im, $x, $y, $palette[grayscale($r, $g, $b)]);<br />
    }<br />
}</p>
<p>imagepng($im);<br />
imagedestroy($im);<br />
?>[/code]</p>
<p>Attached is an example of a colorized image (left) and the same image using the above code (right)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting to know GD</title>
		<link>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/</link>
		<comments>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 22:50:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=434</guid>
		<description><![CDATA[Create dynamic userbars with GD Introduction: Have you ever been on aim and received a message from one of your friends with a big long URL followed by something like &#8220;John%20Is%20Stupid.&#8221; You know what ever it is, wont be worth your time, but you click on it anyway to find someone goofy looking holding a [...]]]></description>
			<content:encoded><![CDATA[<h2>Create dynamic userbars with GD</h2>
<p><strong>Introduction:</strong><br />
Have you ever been on aim and received a message from one of your friends with a big long URL followed by something like &#8220;John%20Is%20Stupid.&#8221; You know what ever it is, wont be worth your time, but you click on it anyway to find someone goofy looking holding a sign and on it printed in big bold letters &#8220;John Is Stupid.&#8221; Ever wonder how they work? Chances are, the script takes advantage of the GD functions. In this tutorial you will learn many GD functions that you can use to generate images. The goal for this tutorial is for you to generate a dynamic user bar.</p>
<p>Here is a list of the functions used in this tutorial:</p>
<ol>
<li><a href="http://us3.php.net/manual/en/function.header.php">header()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagecolorallocate.php">imagecolorallocate()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagettfbbox.php">imagettfbbox()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagesx.php">imagesx()</a></li>
<li><a href="http://us3.php.net/manual/en/function.abs.php">abs()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagettftext.php">imagettftext()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagepng.php">imagepng()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagedestroy.php">imagedestroy()</a></li>
</ol>
<p>The first thing you want to do is create the header type using the header function. Next you use the GD tools to create an image from a png file. In my case, I have userbar.png in the same directory as this script is in. The function imagecolorallocate creates a color using RGB (red-green-blue) format. The next three lines just set some basic information which isn’t that hard to understand. The last three lines to must of the work creating the image. The most important function here to pay attention to is imagettftext. The imagettftext requires 8 arguments which are the resource image, font size, the angle, x location, y location, font color, the actual font, and the string to be printed.</p>
<p>[code lang="php"]<?php<br />
    header('Content-type: image/png');<br />
    $im = imagecreatefrompng ("userbar.png");<br />
    $color = imagecolorallocate($im, 0, 0, 0);<br />
    $text = "test";<br />
    $font = 'font.ttf';<br />
    $size = 8;<br />
    imagettftext($im, $size, 0, 15, 12, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?>[/code]</p>
<p>Now that we have GD generating an image, lets make it a little more complex. We&#8217;ve added the<br />
[code lang="php"]$text = $_GET['text'];[/code]<br />
line to allow the user to enter a random string, and we have also added the<br />
[code lang="php"]$size = imagettfbbox($fontsize, 0, $font, $text);<br />
$dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20;<br />
[/code]<br />
Which calculate where to start printing the string on the image. The function imagettfbbox generates the length of the font string in pixels. If you were to use something like strlen($text) that would just return the number of characters in the string, which isn’t very usefull in this case. Next, we use the imagesx() function to determine the width of the image, we take that value and subtract the string length in pixels and subtract an extra 20 pixels to leave some room toward the end of the image.<br />
[code lang="php"]<?php<br />
    header('Content-type: image/png');<br />
    $text = $_GET['text'];<br />
    $im = imagecreatefrompng ("userbar.png");<br />
    $color = imagecolorallocate($im, 0, 0, 0);<br />
    $font = 'font.ttf';<br />
    $fontsize = 6;<br />
    $size = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string<br />
    $dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20; //calculate the location to start the text<br />
    imagettftext($im, $fontsize, 0, $dx, 13, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?><br />
[/code]</p>
<p>At this point you could call yourself done. However you could add some extra features such as make the font color vary with the user input. Adding a simple if statement will accomplish this.</p>
<p>[code lang="PHP"]<?php<br />
    header('Content-type: image/png');<br />
    $text = $_GET['text'];</p>
<p>    $im = imagecreatefrompng ("userbar.png");</p>
<p>    if($text == "ADMINISTRATOR"){ //if administrator<br />
        $color = imagecolorallocate($im, 255, 0, 0); //red<br />
    }<br />
    else if($text == "MODERATOR"){ //if moderator<br />
        $color = imagecolorallocate($im, 0, 0, 255); //blue<br />
    }<br />
    else if($text == "JUNKIE"){ //if junkie<br />
        $color = imagecolorallocate($im, 0, 0, 0); //black<br />
    }<br />
    else { //something else...<br />
        $color = imagecolorallocate($im, 0, 128, 0); //green<br />
    }</p>
<p>    $font = 'font.ttf'; //font file<br />
    $fontsize = 6; //font size<br />
    $stringsize = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string<br />
    $dx = (imagesx($im)) - (abs($stringsize[2]-$stringsize[0])) - 20; //calculate the location to start the text<br />
    imagettftext($im, $fontsize, 0, $dx, 13, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?><br />
[/code]</p>
<p>Finally you can save this script as generator.php and display it in forums by using the html tags.</p>
<div class="quote">&lt;img src=&quot;http://www.yourdomain.com/generator.php?text=JUNKIE&quot; /&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NAND and NOR</title>
		<link>http://www.johnciacia.com/2009/08/13/nand-and-nor/</link>
		<comments>http://www.johnciacia.com/2009/08/13/nand-and-nor/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 13:45:39 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[nand]]></category>
		<category><![CDATA[nor]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=351</guid>
		<description><![CDATA[In addition to the logical operations defined here &#8211; computer scientists have defined two other operations (which are merely abstractions of operations defined in my previous article) since they are used so often. They are NAND and NOR, symbolically ↑ (&#124;) and ↓ (⊥). I say they are abstractions because they are simply the negation [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to the logical operations defined <a href="http://www.johnciacia.com/2009/08/basic-logic/">here</a> &#8211; computer scientists have defined two other operations (which are merely abstractions of operations defined in my previous article) since they are used so often. They are NAND and NOR, symbolically ↑ (|) and ↓ (⊥). I say they are abstractions because they are simply the negation of AND and OR operations</p>
<h3>NAND</h3>
<table style="border:1px solid #666;border-collapse:collapse;text-align:center;" border="1" width="300">
<tbody>
<tr>
<td><strong>A</strong></td>
<td><strong>B</strong></td>
<td><strong>A AND B</strong></td>
<td><strong>NOT (A AND B)</strong></td>
<td><strong>A NAND B</strong></td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<p></p>
<h3>NOR</h3>
<table style="border:1px solid #666;border-collapse:collapse;text-align:center;" border="1" width="300">
<tbody>
<tr>
<td><strong>A</strong></td>
<td><strong>B</strong></td>
<td><strong>A OR B</strong></td>
<td><strong>NOT (A OR B)</strong></td>
<td><strong>A NOR B</strong></td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2009/08/13/nand-and-nor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.johnciacia.com @ 2012-02-05 11:10:12 -->
