<?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>Java-ScriptGate.com &#187; JS and App</title>
	<atom:link href="http://www.java-scriptgate.com/category/js-and-app/feed" rel="self" type="application/rss+xml" />
	<link>http://www.java-scriptgate.com</link>
	<description>Java Script Is Difficult</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:23:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ECMAScript 5&#8242;s Date Extensions</title>
		<link>http://www.java-scriptgate.com/ecmascript-5s-date-extensions</link>
		<comments>http://www.java-scriptgate.com/ecmascript-5s-date-extensions#comments</comments>
		<pubDate>Thu, 07 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/07/ecmascript5-date</guid>
		<description><![CDATA[One of the changes that ECMAScript 5 introduces is extensions to the Date class.  Some of these are very useful &#8212; Date.now and Date.UTC as well as ISO-8601 format support.
Michael J. Ryan has written support for these API changes in DateExtension...]]></description>
			<content:encoded><![CDATA[One of the changes that ECMAScript 5 introduces is extensions to the <code>Date</code> class.  Some of these are very useful — <code>Date.now</code> and <code>Date.UTC</code> as well as <span class="caps">ISO</span>-8601 format support.

Michael J. Ryan has written support for these <span class="caps">API</span> changes in <a href="http://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx">DateExtensions.js</a> so you can get started using them now.

<a href="http://www.basariyorum.com/">redesign website</a>

Basariyorum is a leading web solution company catering to all your

website design and development needs there by helping your business

grow.

Usage looks like this:
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">epoch1</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="s2">"1970-01-01T00:00:00.000Z"</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">epoch2</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>

<span class="k">if</span> <span class="p">(</span><span class="nx">epoch1</span><span class="p">.</span><span class="nx">getTime</span><span class="p">()</span> <span class="o">==</span> <span class="nx">epoch2</span><span class="p">.</span><span class="nx">getTime</span><span class="p">())</span>
    <span class="nx">alert</span><span class="p">(</span><span class="s2">"Epochs match!"</span><span class="p">);</span>

<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch1</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span> <span class="c">//localized date instance of the JS epoch</span>
<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch2</span><span class="p">.</span><span class="nx">toISOString</span><span class="p">());</span> <span class="c">// "1970-01-01T00:00:00.000Z"</span>
<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch1</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="p">);</span> <span class="c">// true</span>
<span class="nx">alert</span><span class="p">(</span><span class="nb">Date</span><span class="p">.</span><span class="nx">UTC</span><span class="p">(</span><span class="mi">1970</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">1</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="p">));</span> <span class="c">// 0</span></pre>
</div>
<h3>More on ECMAScript</h3>
Other ECMAScript 5 extensions to the base library include:
<ul>
	<li><code>bind()</code> that works like <a href="http://www.prototypejs.org/api/function/bind">Prototype’s bind</a></li>
	<li>A <span class="caps">JSON</span> object that supports parsing and generation</li>
	<li>New object/property extensions: <a href="http://ejohn.org/blog/ecmascript-5-objects-and-properties/">ECMAScript 5 Objects and Properties</a></li>
	<li>String now has a <code>trim()</code> method</li>
	<li><code>Array</code> gets useful methods like <code>filter()</code> and <code>map()</code></li>
</ul>
You can read a <span class="caps">PDF</span> of the spec here: <a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"><span class="caps">ECMA</span>-262.pdf</a>

<a href="http://www.designerevaluation.com/web-design/">Web Design</a> - Web Design offers custom web design, website development, flash website, portal development, search engine optimization and website designing services.

<a href="http://business.hughesnet.com/services/business-internet/business-internet-with-vpn">Business VPN</a> - HughesNet Business Solutions provides business VPN, virtual private network, business internet with vpn, setting up vpn, satellite vpn for small and medium businesses, affordable and flexible, available anywhere.
<a href="http://www.ultimatummedia.com/">Website Submissions</a>
<a href="http://www.numbertalk.co.uk/">0800 Numbers</a> - Providers of a wide range of business numbers starting from 0845, 0800, 0844, 0870, 0300, 0330, regional and international numbers.

<a href="http://bng.co.in/Transport.html">Transport Software</a>

Transport software has details of consignment, lorry hire, unloading or delivery. Transportation &amp; Logistics Software also related with retail software, manufacturing software, ERP software, retail management, POS retail software, retail business software, production planning control PPC, human resource and payroll, sales force automation, point of sale software company, point of sale software for small business, retail point of sale solutions.

<a href="https://www.improvemydata.com/pages/common/page.aspx?name=address-management">Best address management services</a> - Are you looking to hire best address management services. Your search ends here. Hire Improvemydata.com and get Consumer Data Cleansing &amp; Address Management Service. Call us at 0845 60 60 609 or visit Improvemydata.com now!

<a href="http://www.q3tech.com/">Offshore Product development</a> - Q3 Technologies is Offshore Product Development Company leading in Outsourced product development, Offshore Product Development India, Outsourced product development India, software development, Application Development and Enterprise Applications Development Services.

<a href="http://www.flashcoms.com"> cam chat </a> - Flashcoms is a reliable developer of flash-based interactive software designed to provide live communication support for websites and web-based communities.

<a href="http://www.iexpertsforum.com/top-seo-tools.html" target="_blank">SEO Tools</a> Read SEO Tools Reviews &amp; Compare SEO Softwares for IBP, Web CEO &amp; SEO Elite. SEO Software Reviews are rated by professional SEO Expert on the basis of customer reviews.

<a href="http://www.internetadvantage.com/servicios/seo-posicionamiento-buscadores/" target="_blank">posicionamiento paginas web</a> Aparece en los Primeros Resultados de los Buscadores a través del servicio de Posicionamiento SEO de Internet Advantage y aumenta la visibilidad de tu Web

<a href="http://www.e2solutions.net/website_design_company_india.htm" target="_blank">Web Design India</a> E2 Solutions, India's leading web design company offering top quality website designing services at affordable prices.

<a title="Hosting" href="http://www.webhostingbuzz.com" target="_blank">Hosting</a> - Web Hosting Buzz provides Reseller Web Hosting, cheap shared website hosting, virtual private server (VPS), managed dedicated servers and hosting on reliable high performance reseller hosting server, virtual hosting solutions, semi-dedicated and business hosting accounts home.php

<a href="http://justhostcouponreview.com/">Justhost reviews</a> - Best reviews of justhost hosting plan.

<a href="http://www.webpromotionerindia.com/link_building_service_india.htm">Link building company india</a> - cheapest SEO Company in India offers free SEO consultation and Search Engine Optimization.

<a href="http://www.thenerds.net"> Laser  Printers</a> -  Thenerds.net offers great pricing on all ink  cartridge, ink toner, laser printers, gps navigation, portable gps, office  furniture, notebooks, hard drives, laptops, networking, systems and  digital  cameras.

<span style="color: #888888;"> </span>

<a href="http://www.usatinc.com">Custom Software Applications</a>-  Custom software development, consulting and data  integration services. Should you buy or build a custom application?  Contact us for FREE professional IT expert advise.

<a href="http://www.pink-laptop.org.uk/">Pink Laptops</a>

<a href="http://www.seodepthcompany.com/link_building.html">Professional Link Building Company</a> - Link Building Company: Professional Link Building Company in India provides  Professional Link Building Service. A Link Building Company with fully  Professional Link Builders offering One Way, Reciprocal and Triangular Linking  Services at affordable  price

<a title="link building services" href="http://www.webs4soft.com/" target="_blank">link building services</a> - Award winning SEO Link Building Services. Vertical Measures is top rated Internet marketing company helping businesses. get more website traffic via higher search engine rankings, link building, social media, local search, and search engine optimization.

<a href="http://www.trustdeedscotland.net/">debt advice Scotland</a> - Scotlands No.1 Trust Deed website. Compare Trust Deeds online and save thousands. Scottish based business. Government backed Trust Deeds. 90% debt Write off.]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/ecmascript-5s-date-extensions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawter</title>
		<link>http://www.java-scriptgate.com/drawter</link>
		<comments>http://www.java-scriptgate.com/drawter#comments</comments>
		<pubDate>Wed, 06 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/06/drawter</guid>
		<description><![CDATA[Drawter by Damian Wielgosik is a simple tool for drawing HTML interfaces and exporting the results.  It uses jQuery and Damian&#8217;s own GUI code.
You can draw HTML tags using The Tagname to draw option and the mouse.  To switch between drawing and ...]]></description>
			<content:encoded><![CDATA[<img src="http://dailyjs.com/images/posts/drawter.png" alt="" />

<a href="http://drawter.com/">Drawter</a> by <a href="http://ferrante.pl">Damian Wielgosik</a> is a simple tool for drawing <span class="caps">HTML</span> interfaces and exporting the results.  It uses jQuery and Damian’s own <span class="caps">GUI</span> code.

You can draw <span class="caps">HTML</span> tags using The <em>Tagname to draw</em> option and the mouse.  To switch between drawing and editing content and <span class="caps">CSS</span>, use the <em>Draw Mode</em> and <em>Edit</em> buttons.  There are also menu items at the top of the page — click <em>Code</em> then <em>Generate code</em> to export your design.

Drawter is a great example of what can be done with JavaScript, but it’s also potentially a useful tool.  The author of <a href="http://konigi.com/notebook/drawter-drawable-markup-language">Konigi</a> was already blown away by it, and he’s something of a web prototyping tool enthusiast.

<a href="http://www.askpcexperts.ca">online computer support</a>

Best Remote Computer Repair Services with Ask PC Experts on

1-888-518-9191 begin_of_the_skype_highlighting              1-888-518-9191      end_of_the_skype_highlighting. Online Computer Support Specialists &amp; Remote PC Repair,

We fix computer problems remotely and provide Online PC troubleshooting

Help &amp; Online Computer Tech Support Help to USA, UK, Canada, Australia

and other English Speaking Countries.

<a href="http://www.askpcexperts.net"> computer support</a>

Computer Support Specialists &amp; Remote PC Repair in Australia. We

fix computer problems remotely and provide Online PC troubleshooting

Help &amp; Online Computer Tech Support.

<a href="http://www.intuitsolutions.net">ProStores Ecommerce Design, Customization &amp; SEO/a&gt;  from IntuitSolutions, the Ecommerce experts.</a>
<table style="height: 22px;" border="0" cellspacing="0" cellpadding="0" width="1"><col width="339"></col>
<tbody>
<tr height="20">
<td width="339" height="20"></td>
</tr>
</tbody>
</table>
<a href="http://www.ghacks.net/2009/06/04/pc-remote-access/" target="_blank">Remote Pc Access</a>

<a href="http://www.flashdevs.com/ ">flash game development</a>

<a href="http://www.visualsindia.com/">Web Design Company Chennai</a> - Visuals India - Web design and Development Company Chennai and SEO company. If you need our services then visit visualindia.com .

When it comes to finding a reliable marketing partner the printing company <a href="http://www.originalimpressions.com" target="_blank">http://www.originalimpressions.com</a>performs outstandingly as can be expected from a top tier supplier.

<a href="http://www.softsolutionsindia.net" target="_blank">Search Engine Optimization</a> - India SEO company providing search engine optimization,manual directory submission,search engine submission, internet marketing,custom website designing, affordable websites,website maintenance, software development.

<a href="http://www.idera.com/Products/SharePoint/SharePoint-migration-suite/">Sharepoint Migration</a> - Idera SharePoint migration suite is the most comprehensive solution available for SharePoint content migration.

<a href="http://www.indyadomains.com/">Domain Registration India</a> - Indyadomains.com - Cheap and professional support services on Domain Registration and Web Hosting Chennai, India.

<a href="http://www.broadconnect.ca/">IP Telephone Systems</a> - We provide reliable IP telephone systems and we are the leading provider of pure IP telephony solutions worldwide.

If you’re preparing for retirement in Ontario, OHIP may not be enough, since it does not cover some medications as well as extensive treatment. Consider individual <a href="http://www.kanetix.ca/health-insurance">health insurance Ontario</a> options which will help you medical expenses you may encounter.

<a href="http://www.askpcexperts.com/">Computer support</a> - Computer support services can troubleshoot networking issues, software programs, computer fixing and maintenance. Computer support services also provides you with expert consultation on technical isssues.

<a href="http://www.pcnames.com/">domain name search</a>

<a href="http://www.trakpro.com.au/real-time-vehicle-tracking.html">Real Time GPS Vehicle Tracking System</a> - TrakPro is the leading real time vehicle tracking system providing company. We provide comprehensive vehicle tracking and telematics to transportation industry to keep you one step ahead from your competitors.

<strong>Blue Delight Web Promotion Pvt. Ltd</strong> known as a <strong><a href="http://www.bluedelightconsultant.com/">
SEO Services Company</a></strong> and leading for organic, affordable &amp; ethical Search Engine Optimization.

B2B <strong><a href="http://www.b2binternetmarketingcompany.com/">Internet Marketing Company</a></strong> is known as bunch of various online services like web promotion, web designing, <strong>Search Engine Marketing</strong> services using some marketing strategies which include SEO, PPC and SEM for development of website.

Professional    SEO Services - Providing affordable organic <a href="http://www.seoonlineshop.com">SEO Services</a> - SEO consultancy    services and Directory Submission, <a href="http://www.seoonlineshop.com/link_building.html">Link Building</a>, Article Submission and    Search Engine Optimization.

<a href="http://www.valueuk.com/LTO.htm">LTO media</a>
<a href="http://www.visualwebripper.com/">Web Page Scraping</a> - web page scraping -Web page scraping is a computer software technique used to extract information from websites, available at visualwebripper.com. It is the unique technical parameters adopted by visual web ripper which can scrap anonymously on web.


<a href="http://www.soothingwalls.com/wall-fountains.html" alt="4.10.2010">Indoor Wall Fountains</a>

<p><a href="http://wobook.com">Free PDF EBooks</a> Digital Magazines, ebooks and virtual catalogues: transform automatically your PDF files into a wobook for free</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/drawter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSpec</title>
		<link>http://www.java-scriptgate.com/jspec</link>
		<comments>http://www.java-scriptgate.com/jspec#comments</comments>
		<pubDate>Tue, 05 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/05/jspec</guid>
		<description><![CDATA[We recently posted a unit test roundup, so I noticed that JSpec has been updated to version 3.  This version introduces several interesting updates (see the full change list):

	Rhino&#8217;s jar is included so console tests can work without installing...]]></description>
			<content:encoded><![CDATA[We recently posted a <a href="http://dailyjs.com/2009/12/30/unit-testing/">unit test roundup</a>, so I noticed that <a href="http://github.com/visionmedia/jspec">JSpec</a> has been updated to version 3.  This version introduces several interesting updates (see the full <a href="http://github.com/visionmedia/jspec/blob/master/History.md">change list</a>):
<ul>
	<li>Rhino’s jar is included so console tests can work without installing extra stuff</li>
	<li>Added a <code>jspec stats</code> command</li>
	<li>Subcommand hooks — checks for spec/commands/*_command.rb</li>
	<li>Ruby server is now a Sinatra app</li>
</ul>
JSpec is now version 3.0 and currently has over 200 followers on GitHub, so it’s worth checking out.
<h3>Syntax Examples</h3>
JSpec tests can be written using a custom <span class="caps">DSL</span> or a grammar-less JavaScript syntax.  When using the <span class="caps">DSL</span> in browser-based tests, be sure to use <code>JSpec.exec()</code> to run tests rather than including the code in script tags (more details are in the <span class="caps">README</span>).

Tests written with the <span class="caps">DSL</span> look like this:
<div class="highlight">
<pre><span class="nx">describe</span> <span class="s1">'ShoppingCart'</span>
  <span class="nx">before_each</span>
    <span class="nx">cart</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ShoppingCart</span>
  <span class="nx">end</span>

  <span class="nx">describe</span> <span class="s1">'addProducts'</span>
    <span class="nx">it</span> <span class="s1">'should add several products'</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProduct</span><span class="p">(</span><span class="s1">'cookie'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProduct</span><span class="p">(</span><span class="s1">'icecream'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">should</span><span class="p">.</span><span class="nx">have</span> <span class="mi">2</span><span class="o">,</span> <span class="s1">'products'</span>
    <span class="nx">end</span>
  <span class="nx">end</span>

  <span class="nx">describe</span> <span class="s1">'checkout'</span>
    <span class="nx">it</span> <span class="s1">'should throw an error when checking out with no products'</span>
      <span class="o">-</span><span class="p">{</span> <span class="nx">cart</span><span class="p">.</span><span class="nx">clear</span><span class="p">().</span><span class="nx">checkout</span><span class="p">()</span> <span class="p">}.</span><span class="nx">should</span><span class="p">.</span><span class="nx">throw_error</span> <span class="nx">EmptyCart</span>
    <span class="nx">end</span>
  <span class="nx">end</span>
<span class="nx">end</span></pre>
</div>
JavaScript equivalent:
<div class="highlight">
<pre><span class="nx">JSpec</span><span class="p">.</span><span class="nx">describe</span><span class="p">(</span><span class="s1">'ShoppingCart'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="nx">before_each</span><span class="p">(</span><span class="kd">function</span><span class="p">{</span>
    <span class="nx">cart</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ShoppingCart</span>
  <span class="p">})</span>

  <span class="nx">describe</span><span class="p">(</span><span class="s1">'addProducts'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="nx">it</span> <span class="p">(</span><span class="s1">'should add several products'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProducts</span><span class="p">(</span><span class="s1">'cookie'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProducts</span><span class="p">(</span><span class="s1">'icecream'</span><span class="p">)</span>
      <span class="nx">expect</span><span class="p">(</span><span class="nx">cart</span><span class="p">).</span><span class="nx">to</span><span class="p">(</span><span class="nx">have</span><span class="o">,</span> <span class="mi">2</span><span class="o">,</span> <span class="s1">'products'</span><span class="p">)</span>
    <span class="p">})</span>
  <span class="p">})</span>

  <span class="nx">describe</span><span class="p">(</span><span class="s1">'checkout'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="nx">it</span> <span class="p">(</span><span class="s1">'should throw an error when checking out with no products'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
      <span class="nx">expect</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> <span class="nx">cart</span><span class="p">.</span><span class="nx">clear</span><span class="p">().</span><span class="nx">checkout</span><span class="p">()</span> <span class="p">}).</span><span class="nx">to</span><span class="p">(</span><span class="nx">throw_error</span><span class="o">,</span> <span class="nx">EmptyCart</span><span class="p">)</span>
    <span class="p">})</span>
  <span class="p">})</span>
<span class="p">})</span></pre>
</div>
<h3>Custom Matchers</h3>
Custom matchers can be defined using <code>JSpec.addMatchers</code>.  It’s possible to control the error messages.  It’s also possible to create sets of macros with similar names:
<div class="highlight">
<pre><span class="nx">JSpec</span><span class="p">.</span><span class="nx">addMatchers</span><span class="p">({</span>
  <span class="s1">'be disabled selected checked'</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="s1">'jQuery(actual).attr("'</span> <span class="o">+</span> <span class="nx">attr</span> <span class="o">+</span> <span class="s1">'")'</span>
  <span class="p">}</span><span class="o">,</span>

  <span class="s1">'have type id title alt href src sel rev name target'</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="kd">function</span><span class="p">(</span><span class="nx">actual</span><span class="o">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
      <span class="k">return</span> <span class="nx">value</span> <span class="o">?</span> <span class="nx">jQuery</span><span class="p">(</span><span class="nx">actual</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="err">##</span> <span class="nx">value</span><span class="o">:</span>
                     <span class="nx">jQuery</span><span class="p">(</span><span class="nx">actual</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span>
    <span class="p">}</span>
  <span class="p">}</span>
<span class="p">})</span></pre>
</div>
<h3>Other Features</h3>
JSpec includes a command-line tool that can initialise project templates, as well as auto-testing when files are changed.  It can also work with Growl in Mac OS X.  It includes lots of familiar matchers and works well in a browser and console.
<h3>Installation</h3>
To try JSpec out, you can install it with <a href="http://docs.rubygems.org/">RubyGems</a> — <code>gem install jspec</code> and read the docs on <a href="http://github.com/visionmedia/jspec">github.com/visionmedia/jspec</a>.

The future telecommunication technology is video conference facilities   or <a href="http://www.eyenetwork.com/video-conference-solutions/">video conferencing solutions</a>. This communication facility allows several locations to interact with people  via audio and video simultaneously. <a href="http://www.mvision.co.uk/products/support-and-maintenance/">Video conference software</a> brings a cost effective video conferencing  system which is held over ISDN. This is very good video picture quality and  also much more reliable than the normal internet.
<div><a href="http://www.sportsbetting.com/">Online Betting</a></div>
<div>
<div><a href="http://sportsbetting.com/" target="_blank">SPORTSBETTING.COM</a> is the simplest and most popular destination  for sports betting on the Internet. Our many years of experience  guarantee you a  superior betting service. <a href="http://www.sportsbetting.com/join.html?WT.svl=j_r2c1id4" target="_blank">Join today</a> to take advantage of all our great  offers.</div>
</div>

<a href="http://www.intenseschool.com/boot_camp/microsoft/mcitp2008eaubcmp" alt="01.08.10">MCITP upgrade</a>Enroll to Intense School's highest rated MCITP Upgrade Boot Camp now. For more information, visit Intesneschool.com now!

<a href="http://www.xyone.co.uk/">Digital Marketing Agency</a> -Visit Xyone today, a UK Leading Digital Marketing Agency and see how we can help you within the Digital World.

<a href="http://www.netsimplicity.com/">Online Scheduling</a> - Online scheduling software by NetSimplicity.

<a href="http://www.iemployee.com/time-and-attendance/online-timesheets/">Timesheet Software</a> - Timesheet software by iEmployee.

<a href="http://hostingcouponz.com/vpslink-coupon/
" alt="25/10/2010">vpslink</a>-all about vpslink coupon.

<a href="http://www.ultrawebsitehosting.com/">LiteSpeed Hosting Provider</a>-LiteSpeed hosting with Ultra Website hosting .com. Increase the speed of your website with UltraWebsiteHosting.com’s LiteSpeed web services. Three times faster than Apache with the most competitive pricing. Live Support, price guarantee, 45-day money back guarantee… it’s tough to beat these guys!]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/jspec/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarks in JavaScript</title>
		<link>http://www.java-scriptgate.com/benchmarks-in-javascript</link>
		<comments>http://www.java-scriptgate.com/benchmarks-in-javascript#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/04/javascript-benchmarks</guid>
		<description><![CDATA[Speeding up page load times is a good way to decrease bounce rates and increase customer satisfaction.  And if you&#8217;re using JavaScript in your server-side architecture, speed will become increasingly important.  So you might be tempted to write y...]]></description>
			<content:encoded><![CDATA[Speeding up page load times is a good way to decrease bounce rates and increase customer satisfaction.  And if you’re using JavaScript in your server-side architecture, speed will become increasingly important.  So you might be tempted to write your own benchmarking code when puzzling over a tricky performance issue.  Fortunately there are quite a few JavaScript benchmarking libraries out there.
<h3>Unit Tests</h3>
If you’re writing <a href="http://dailyjs.com/2009/12/30/unit-testing/">unit tests</a> you should get some benchmark information.  Most libraries automatically benchmark tests — <a href="http://github.com/madrobby/scriptaculous/blob/master/src/unittest.js">unittest.js</a> includes a benchmark method.  You could use this outside of tests for some foresnic analysis.
<h3>JavaScript Benchmark</h3>
<a href="http://github.com/visionmedia/js-bm/">JavaScript Benchmark</a> is a nice little library that features:
<ul>
	<li><span class="caps">ASCII</span>-friendly output that’s great for server-side JavaScript</li>
	<li>A simple <span class="caps">API</span></li>
	<li>Test suite support</li>
</ul>
Each benchmark will be run once by default, or you can specify a value:
<div class="highlight">
<pre><span class="nx">suite</span><span class="p">(</span><span class="s1">'Iteration'</span><span class="o">,</span> <span class="mi">50000</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">array</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="o">,</span><span class="mi">2</span><span class="o">,</span><span class="mi">3</span><span class="o">,</span><span class="mi">4</span><span class="o">,</span><span class="mi">5</span><span class="o">,</span><span class="mi">6</span><span class="o">,</span><span class="mi">7</span><span class="o">,</span><span class="mi">8</span><span class="o">,</span><span class="mi">9</span><span class="p">];</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">array</span><span class="p">.</span><span class="nx">length</span><span class="o">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">);</span>
  <span class="p">});</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for cached'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">,</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">array</span><span class="p">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">);</span>
  <span class="p">});</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for in'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">array</span><span class="p">);</span>
  <span class="p">});</span>
<span class="p">});</span></pre>
</div>
This library won’t work in a browser due to the use of the <code>print()</code> function, but all you need to do is supply your own.  Something like this will do:
<div class="highlight">
<pre><span class="kd">function</span> <span class="nx">print</span><span class="p">(</span><span class="nx">message</span><span class="p">)</span> <span class="p">{</span>
  <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'log'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">+=</span> <span class="nx">message</span> <span class="o">+</span> <span class="s2">"\n"</span><span class="o">;</span>
<span class="p">}</span></pre>
</div>
I’ve put a full example up here: <a href="http://dailyjs.com/files/benchmarks.html">benchmarks.html</a>
<h3>BenchmarkBuddy</h3>
<a href="http://github.com/unwiredbrain/BenchmarkBuddy/">BenchmarkBuddy</a> is inspired by the <code>RunSingleBenchmark</code> from the V8 source.  Here’s one of the author’s examples:
<div class="highlight">
<pre><span class="nx">alert</span><span class="p">(</span><span class="nx">BenchmarkBuddy</span><span class="p">.</span><span class="nx">run</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">));</span></pre>
</div>
<h3>Benchmark.js</h3>
<a href="http://github.com/mnoble/Benchmark.js/">Benchmark.js</a> is based on Ruby’s benchmark library.  It’s still a work in progress and isn’t currently console-friendly, but when it works it will look like this:
<div class="highlight">
<pre><span class="nx">Benchmark</span><span class="p">.</span><span class="nx">benchmark</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="mi">10000000</span><span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
<span class="p">});</span></pre>
<pre><span class="p">
</span></pre>
<pre><span class="p"><a href="http://www.forumlinkbuilding.com/view/link_building_services" target="_blank">link building services</a> </span></pre>
<pre><span class="p"><a href="http://www.sdltridion.com/" target="_blank">web content management</a></span></pre>
<pre><span class="p">
</span></pre>
</div>


<a href="http://bestwatchwinders.com/">watch winder automatic</a>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/benchmarks-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Unit Testing</title>
		<link>http://www.java-scriptgate.com/javascript-unit-testing</link>
		<comments>http://www.java-scriptgate.com/javascript-unit-testing#comments</comments>
		<pubDate>Wed, 30 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/30/unit-testing</guid>
		<description><![CDATA[Our JavaScript Developer Survey results showed that a large percentage of readers don&#8217;t currently unit test their JavaScript.  I&#8217;ve been unit testing my own JavaScript projects for a few years, which resulted in the creation of riotjs &#821...]]></description>
			<content:encoded><![CDATA[<p>Our <a href="http://dailyjs.com/2009/12/02/survey-results/">JavaScript Developer Survey results</a> showed that a large percentage of readers don&#8217;t currently unit test their JavaScript.  I&#8217;ve been unit testing my own JavaScript projects for a few years, which resulted in the creation of <a href="http://gist.github.com/alexyoung/riotjs">riotjs</a> &#8212; for more on riotjs see my blog post: <a href="http://alexyoung.org/2009/11/04/riotjs/">Riotjs: A JavaScript Unit Testing Framework</a></p>
<p>There are lots of JavaScript test frameworks.  I&#8217;ve presented a summary below &#8212; there are both traditional unit testing libraries and behaviour-driven frameworks.</p>
<h3>unittest.js</h3>
<p><a href="http://github.com/madrobby/scriptaculous/blob/master/src/unittest.js">unittest.js</a> by Thomas Fuchs has been used by many JavaScript developers since <a href="http://script.aculo.us/">Scriptaculous</a> became popular in 2006.  It provides a test framework that is recognisable to Ruby developers, and the relationship between Rails and Scriptaculous further increased adoption in this group.</p>
<p>This library depends on <a href="http://prototypejs.org/">Prototype</a> and is usually run inside <span class="caps">HTML</span> templates rather than a JavaScript interpreter.</p>
<p>Tests look like this:</p>
<div class="highlight"><pre>  <span class="k">new</span> <span class="nx">Test</span><span class="p">.</span><span class="nx">Unit</span><span class="p">.</span><span class="nx">Runner</span><span class="p">({</span>
    <span class="nx">testExample</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="kd">with</span><span class="p">(</span><span class="k">this</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">exampleVar</span> <span class="o">=</span> <span class="s1">&#39;1234&#39;</span><span class="o">;</span>
      <span class="nx">assertEqual</span><span class="p">(</span><span class="s1">&#39;1234&#39;</span><span class="o">,</span> <span class="nx">exampleVar</span><span class="p">);</span>
      <span class="nx">assert</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
    <span class="p">}}</span>
    
  <span class="p">}</span><span class="o">,</span> <span class="s2">&quot;testlog&quot;</span><span class="p">);</span>
</pre>
</div><p>Fuchs uses <code>with(this)</code> to cut down unnecessary syntax &#8212; you don&#8217;t have to write tests this way though.</p>
<p>Setup and teardown methods are supported.  Shoulda-style assertion names have also been added.  This adds methods to the prototypes for common JavaScript objects, so it&#8217;s possible to write <code>'test'.shouldEqual('test')</code>.</p>
<p>unittest.js also includes a handy <code>benchmark</code> method, and the following assertions:</p>
<table>
	<tr>
		<td> <code>assertNotEqual(expected, actual)</code> </td>
		<td> Inverse of <code>assertEqual</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotVisible(element)</code> </td>
		<td> Checks if an element has display: none </td>
	</tr>
	<tr>
		<td> <code>assertVisible(element)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertInspect(expected, actual)</code> </td>
		<td> Checks if <code>expected</code> is the same as <code>actual.inspect()</code> </td>
	</tr>
	<tr>
		<td> <code>assertEnumEqual(expected, actual)</code> </td>
		<td> Ensured two enumerables are equal </td>
	</tr>
	<tr>
		<td> <code>assertIdentical(expected, actual)</code> </td>
		<td> Comparison using <code>===</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotIdentical(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertNull(obj)</code> </td>
		<td> Is <code>obj</code> null? </td>
	</tr>
	<tr>
		<td> <code>assertNotNull(obj)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertMatch(expected, actual) </td>
		<td> Performs a regex, where <code>expected</code> is the regex </td>
	</tr>
	<tr>
		<td> <code>assertType(expected, actual) </td>
		<td> Checks if <code>actual.constructor == expected</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotOfType(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertInstanceOf(expected, actual)</code> </td>
		<td> Checks if <code>actual</code> is <code>instanceof</code> <code>expected</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotInstanceOf(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertRespondsTo(method, obj)</code> </td>
		<td> Checks if <code>obj</code> has a method named <code>method</code> </td>
	</tr>
	<tr>
		<td> <code>assertReturnsTrue(method, obj)</code> </td>
		<td> Ensured that the method named <code>method</code> called on <code>obj</code> returns true </td>
	</tr>
	<tr>
		<td> <code>assertReturnsFalse</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertRaise(exceptionName, method)</code> </td>
		<td> Ensures calling <code>method</code> raises an exception named <code>exceptionName</code> </td>
	</tr>
	<tr>
		<td> <code>assertElementsMatch([elements], expression1, expression2, ...) </td>
		<td> Ensures the array of elements match the list of expressions </td>
	</tr>
	<tr>
		<td> <code>assertElementMatches(element, expression) </td>
		<td> A helper for the above assertion when supplying a single element </td>
	</tr>
</table>
<h3>JsUnitTest</h3>
<p><a href="http://github.com/drnic/jsunittest/">JsUnitTest</a> is a port of unittest.js without the Prototype dependency.</p>
<h3>JsUnit</h3>
<p>Development for <a href="http://www.jsunit.net/">JsUnit</a>  started in 2001, and is based on JUnit.  Like unittest.js, tests are designed to be run in a web browser.  By using the <code>build.xml</code> Ant file, tests can be run against multiple browsers on a local machine, or on multiple remote machines.</p>
<p>JsUnit tests are grouped within a <em>Test Page</em>.  Test pages contain your tests.  If a Test Page has <code>setUp</code> or <code>tearDown</code> functions, they will be run before and after each test function.  A function called <code>setUpPage</code> will be run once per Test Page.</p>
<p>Each test function is written prefixed with <code>test</code>:</p>
<div class="highlight"><pre><span class="kd">function</span> <span class="nx">testExample</span><span class="p">()</span> <span class="p">{</span>
    <span class="nx">assert</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
<span class="p">}</span>
</pre>
</div><p>The following assertions are available:</p>
<ul>
	<li><code>assert([comment], booleanValue)</code></li>
	<li><code>assertTrue([comment], booleanValue)</code></li>
	<li><code>assertFalse([comment], booleanValue)</code></li>
	<li><code>assertEquals([comment], value1, value2)</code></li>
	<li><code>assertNotEquals([comment], value1, value2)</code></li>
	<li><code>assertNull([comment], value)</code></li>
	<li><code>assertNotNull([comment], value)</code></li>
	<li><code>assertUndefined([comment], value)</code></li>
	<li><code>assertNotUndefined([comment], value)</code></li>
	<li><code>assertNaN([comment], value)</code></li>
	<li><code>assertNotNaN([comment], value)</code></li>
	<li><code>fail(comment)</code></li>
</ul>
<h3>QUnit</h3>
<p><a href="http://github.com/jquery/qunit/">QUnit</a> is used by jQuery for its unit tests.  To use QUnit, include qunit.js and qunit.css within a <span class="caps">HTML</span> file that can display the test results.</p>
<p>Tests look like this:</p>
<div class="highlight"><pre><span class="nx">test</span><span class="p">(</span><span class="s2">&quot;a basic test example&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">ok</span><span class="p">(</span><span class="kc">true</span><span class="o">,</span> <span class="s2">&quot;this test is fine&quot;</span><span class="p">);</span>
  <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s2">&quot;hello&quot;</span><span class="o">;</span>
  <span class="nx">equals</span><span class="p">(</span><span class="s2">&quot;hello&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">,</span> <span class="s2">&quot;We expect value to be hello&quot;</span><span class="p">);</span>
<span class="p">});</span>
</pre>
</div><p>The <a href="http://docs.jquery.com/QUnit">jQuery QUnit</a> documentation has full examples.</p>
<h3>jspec</h3>
<p><a href="http://github.com/wycats/jspec/">jspec</a> (by Yehuda Katz) is an <a href="http://rspec.info/">RSpec</a> inspired framework.  Rather than traditional unit tests, jspec attempts to provide a behaviour-driven development approach.</p>
<p>This is best illustrated with an example:</p>
<div class="highlight"><pre><span class="nx">jspec</span><span class="p">.</span><span class="nx">describe</span><span class="p">(</span><span class="s2">&quot;The browser environment&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">it</span><span class="p">(</span><span class="s2">&quot;should have Array.prototype.push&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">push</span><span class="p">.</span><span class="nx">should</span><span class="p">(</span><span class="s2">&quot;exist&quot;</span><span class="p">);</span>
  <span class="p">});</span>
 
  <span class="nx">it</span><span class="p">(</span><span class="s2">&quot;should have Function.prototype.apply&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nb">Function</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">apply</span><span class="p">.</span><span class="nx">should</span><span class="p">(</span><span class="s2">&quot;exist&quot;</span><span class="p">);</span>
  <span class="p">});</span>
<span class="p">})</span>
</pre>
</div><p>Tests are written with <code>it()</code> blocks and chained <code>should()</code> calls.</p>
<p>The GitHub repository is currently pretty spartan, with no documentation or <span class="caps">README</span>, but jspec is a good port for those of you who are familiar with RSpec or want a change from JUnit-style libraries.</p>
<h3>JSpec</h3>
<p><a href="http://github.com/visionmedia/jspec">JSpec</a> by visionmedia (who have cropped up frequently on DailyJS) is a much more fleshed out <span class="caps">BDD</span> library.  The author has tried to keep it minimal, but it has a unique and friendly <span class="caps">DSL</span>.  It&#8217;s possible to write &#8220;grammar-less&#8221; tests using plain JavaScript.</p>
<h3>Jasmine</h3>
<p><a href="http://github.com/pivotal/jasmine/">Jasmine</a> builds on the ideas of the previous libraries to provide a <span class="caps">BDD</span> library that supports asynchronous tests &#8212; Ajax-friendly testing.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/javascript-unit-testing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doodle.js</title>
		<link>http://www.java-scriptgate.com/doodle-js</link>
		<comments>http://www.java-scriptgate.com/doodle-js#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/29/doodle</guid>
		<description><![CDATA[
I&#8217;ve written a few posts about canvas-based animation and graphics libraries lately.  Before moving on to another topic I thought I&#8217;d mention Doodle.js, which is a sprite-based canvas library.  Doodle.js simplifies working with the canvas,...]]></description>
			<content:encoded><![CDATA[<p><img src="http://dailyjs.com/images/posts/heart01.jpg" alt="" /></p>
<p>I&#8217;ve written a few posts about canvas-based animation and graphics libraries lately.  Before moving on to another topic I thought I&#8217;d mention <a href="http://github.com/biilly/doodle.js">Doodle.js</a>, which is a sprite-based canvas library.  Doodle.js simplifies working with the canvas, and includes <a href="http://code.google.com/p/explorercanvas/">excanvas</a> for IE support.</p>
<p>Code using Doodle.js looks like this:</p>
<div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">oo</span><span class="p">)</span> <span class="p">{</span>
 <span class="nx">oo</span><span class="p">.</span><span class="nx">canvas</span><span class="p">(</span><span class="s1">&#39;#my_canvas&#39;</span><span class="p">);</span>
 <span class="kd">var</span> <span class="nx">box</span> <span class="o">=</span> <span class="nx">oo</span><span class="p">.</span><span class="nx">rect</span><span class="p">({</span><span class="nx">x</span><span class="o">:</span><span class="mi">25</span><span class="o">,</span> <span class="nx">y</span><span class="o">:</span><span class="mi">25</span><span class="o">,</span>
                    <span class="nx">width</span><span class="o">:</span><span class="mi">50</span><span class="o">,</span> <span class="nx">height</span><span class="o">:</span><span class="mi">50</span><span class="o">,</span> <span class="nx">fill</span><span class="o">:</span><span class="s2">&quot;#ff0000&quot;</span><span class="p">});</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">draw</span><span class="p">();</span> <span class="c">//draw a red box with initial parameters</span>
 
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;rgb(0,255,0)&#39;</span><span class="p">}).</span><span class="nx">translate</span><span class="p">(</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;purple&#39;</span><span class="p">}).</span><span class="nx">rotate</span><span class="p">(</span><span class="o">-</span><span class="mi">45</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;yellow&#39;</span><span class="p">}).</span><span class="nx">translate</span><span class="p">(</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">scale</span><span class="p">(</span><span class="mf">1.5</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;blue&#39;</span><span class="p">}).</span><span class="nx">transform</span><span class="p">(</span><span class="mf">1.5</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mf">1.5</span><span class="o">,</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 
<span class="p">})(</span><span class="nx">$doodle</span><span class="p">);</span>
</pre>
</div><p>As you can see, the <span class="caps">API</span> is fairly clean.  There isn&#8217;t currently much documentation, but the author has written a <a href="http://www.lamberta.org/blog/doodle/">length blog post</a> with examples.</p>
<p>While <a href="http://processingjs.org/">Processing.js</a> is a full drawing and animation system, and <a href="http://raphaeljs.com/">Raphael</a> is a vector graphics library, Doodle.js provides a simple way of working with sprites.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/doodle-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conway&#8217;s Game of Life</title>
		<link>http://www.java-scriptgate.com/conways-game-of-life</link>
		<comments>http://www.java-scriptgate.com/conways-game-of-life#comments</comments>
		<pubDate>Wed, 23 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/23/conway</guid>
		<description><![CDATA[
Our recent post about Processing.js made me think about Conway&#8217;s Game of Life.  If you haven&#8217;t come across it before, it&#8217;s a simulation that works like this:

1. Any live cell with fewer than two live neighbours dies, as if caused by...]]></description>
			<content:encoded><![CDATA[<p><img src="http://dailyjs.com/images/posts/conway.png" alt="" /></p>
<p>Our recent post about <a href="http://processingjs.org/">Processing.js</a> made me think about <a href="http://en.wikipedia.org/wiki/Conway%27s_game_of_life">Conway&#8217;s Game of Life</a>.  If you haven&#8217;t come across it before, it&#8217;s a simulation that works like this:</p>
<blockquote>
<p>1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.<br />
   2. Any live cell with more than three live neighbours dies, as if by overcrowding.<br />
   3. Any live cell with two or three live neighbours lives on to the next generation.<br />
   4. Any dead cell with exactly three live neighbours becomes a live cell.</p>
</blockquote>
<p>I like to use this algorithm to experiment with new graphics libraries, so I had my own Processing version from back in 2005.  I&#8217;ve ported it to Processing.js here <a href="http://github.com/alexyoung/conway-js">conway-js</a>.</p>
<p>I&#8217;ve also found lots of interesting pure JavaScript implementations.  <a href="http://github.com/joeyrobert/ConwayJS/">ConwayJS</a> by Joseph Robert is my favourite.  It&#8217;s pretty fast and allows you to draw cells with the mouse.</p>
<p>Another interesting one is <a href="http://github.com/sukhchander/game_of_life/">game_of_life</a> by <a href="http://sukhchander.com/">sukhchander</a>.</p>
<p>I&#8217;ve uploaded my Processing.js examples to DailyJS so you can see them without checking out the git repositories:</p>
<ul>
	<li><a href="http://dailyjs.com/files/firejs/">fire.js</a></li>
	<li><a href="http://dailyjs.com/files/conway-js/">conway-js</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/conways-game-of-life/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Particle System</title>
		<link>http://www.java-scriptgate.com/javascript-particle-system</link>
		<comments>http://www.java-scriptgate.com/javascript-particle-system#comments</comments>
		<pubDate>Tue, 22 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/22/particle-system</guid>
		<description><![CDATA[After yesterday&#8217;s Processing.js article I discovered this post about creating a particle system with JavaScript and a canvas: Parcycle: A Particle System with HTML5 canvas.
You can view the effect in action in this demo: Parcycle

I found the use...]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://dailyjs.com/2009/12/21/processingjs/">yesterday&#8217;s Processing.js article</a> I discovered this post about creating a particle system with JavaScript and a canvas: <a href="http://www.mrspeaker.net/2009/12/03/particle-system-with-html5-canvas/">Parcycle: A Particle System with HTML5 canvas</a>.</p>
<p>You can view the effect in action in this demo: <a href="http://www.mrspeaker.net/dev/parcycle/">Parcycle</a></p>
<p><img src="http://dailyjs.com/images/posts/parcycle.png" alt="" /></p>
<p>I found the use of <a href="https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html">globalCompositeOperation</a> very interesting in this code.  It allowed the author to make particles appear lighter when they overlap by using a drawing mode rather than detecting the colour on the canvas.</p>


<a href="http://f1plus.co.uk/Excel.aspx" alt="4.10.10">Excel Training Aberdeen</a> - F1plus offers face to face excel training on Microsoft software applications.  Training can be given in our office in Aberdeen city centre or in your own premises.]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/javascript-particle-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing.js</title>
		<link>http://www.java-scriptgate.com/processing-js</link>
		<comments>http://www.java-scriptgate.com/processing-js#comments</comments>
		<pubDate>Mon, 21 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/21/processingjs</guid>
		<description><![CDATA[
Processing.js is a JavaScript/HTML canvas port of Processing.  Processing provides a toolkit for programming images, animation and even games.  It&#8217;s hosted in Java and provides its own mini-IDE.  Processing.js can interpret Processing projects, ...]]></description>
			<content:encoded><![CDATA[<p style="float:right;"><img src="http://dailyjs.com/images/posts/processing-logo.png" alt="" /></p>
<p><a href="http://processingjs.org/">Processing.js</a> is a JavaScript/<span class="caps">HTML</span> canvas port of <a href="http://processing.org/">Processing</a>.  Processing provides a toolkit for programming images, animation and even games.  It&#8217;s hosted in Java and provides its own mini-<span class="caps">IDE</span>.  Processing.js can interpret Processing projects, but runs them in a browser that supports canvas.</p>
<p>If you&#8217;re familiar with Processing already you should be able to run some of your projects in Processing.js.  Just create a simple <span class="caps">HTML</span> page with a canvas and include <code>processing.js</code>.  The <code>examples/</code> folder in the source distribution demonstrates how to do this using a script called <a href="http://github.com/jeresig/processing-js/blob/master/examples/init.js">init.js</a> &#8212; this finds the canvas on the page and instantiates a processing object:</p>
<div class="highlight"><pre><span class="nx">Processing</span><span class="p">(</span><span class="nx">canvas</span><span class="o">,</span> <span class="nx">scripts</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">text</span><span class="p">);</span>
</pre>
</div><p>Processing.js allows you to embed Processing scripts into <span class="caps">HTML</span> like this:</p>
<div class="highlight"><pre><span class="nt">&lt;script </span><span class="na">type=</span><span class="s">&quot;application/processing&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;/script&gt;</span>
</pre>
</div><h3>Calling Processing from JavaScript</h3>
<p><img src="http://dailyjs.com/images/posts/fire.png" alt="" /></p>
<p>If you&#8217;re new to Processing but have a lot of JavaScript you want to reuse, you can safely call Processing from your JavaScript code.  I&#8217;ve prepared an example project, <a href="http://github.com/alexyoung/fire.js">fire.js</a> which demonstrates one way of mixing JavaScript and Processing.  You can pass the current Processing environment to a JavaScript class like this:</p>
<div class="highlight"><pre><span class="nx">void</span> <span class="nx">draw</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">fire</span><span class="p">.</span><span class="nx">update</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
<span class="p">}</span>
</pre>
</div><p>Keeping some level of separation between JavaScript code and &#8220;pure&#8221; Processing seems like a good way to avoid confusion if you ever port to another Processing platform.</p>
<h3>Processing Basics</h3>
<p>Every Processing project has <code>setup()</code> and <code>draw()</code> functions.  In this case I&#8217;ve instantiated a Fire object and I&#8217;m passing <code>this</code> which is the current Processing object.  Then I can access Processing&#8217;s functions from within my JavaScript class.</p>
<p>The <a href="http://processingjs.org/reference">Processing reference</a> gives example code for all of the Processing functions.  There&#8217;s a lot of drawing primitives like <code>rect()</code> and <code>ellipse()</code> &#8212; playing around with these is a good way to learn Processing.</p>
<h3>Related Projects</h3>
<p><a href="http://wiki.github.com/jashkenas/ruby-processing">ruby-processing</a> is a Ruby port.  It differs to Processing.js because it provides a Ruby-style version of the Processing <span class="caps">API</span>.  Even CamelCase method names have been changed to underscores.</p>
<p>Although Processing.js and Processing are awesome projects, if you just want to draw vector graphics you&#8217;d be better off with something like <a href="http://raphaeljs.com/">Raphael</a>.  Processing is more suited to animated visualisations or interactive projects.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/processing-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Node.js on IRC</title>
		<link>http://www.java-scriptgate.com/node-js-on-irc</link>
		<comments>http://www.java-scriptgate.com/node-js-on-irc#comments</comments>
		<pubDate>Wed, 16 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/16/node-irc</guid>
		<description><![CDATA[Node.js makes writing IRC-related programs straightforward and super-efficient, thanks to its evented networking. Therefore it isn’t surprising that a lot of projects have appeared already.
I’ve been looking around for reusable JavaScript IRC libra...]]></description>
			<content:encoded><![CDATA[<p><a href="http://nodejs.org/">Node.js</a> makes writing <span class="caps">IRC</span>-related programs straightforward and super-efficient, thanks to its evented networking. Therefore it isn’t surprising that a lot of projects have appeared already.</p>
<p>I’ve been looking around for reusable JavaScript <span class="caps">IRC</span> libraries, and discovered the following projects.</p>
<h3><span class="caps">IRC</span> Daemon Demo</h3>
<p><a href="https://gist.github.com/a3d0bbbff196af633995">This <span class="caps">IRC</span> daemon demo</a> presented at jsconf.eu/2009 demonstrates how to build a server. It has simple prototypal classes for channels and users, and parses <span class="caps">IRC</span> commands using a regex and a <code>switch</code>. It also uses node’s <span class="caps">TCP</span> library.</p>
<h3>nodelog</h3>
<p><a href="http://github.com/felixge/nodelog/">nodelog</a> is an <span class="caps">IRC</span> logger. This would be a good place to start if you’d like to build a JavaScript <span class="caps">IRC</span> bot. The client code is clear and reusable. The <code>log.js</code> file demonstrates how to use the <code>irc.js</code> library.</p>
<h3>irccat-nodejs</h3>
<p><a href="http://github.com/atmos/irccat-nodejs/">irccat-nodejs</a> is based on <a href="http://github.com/webs/irccat">irccat</a> which allows you to send messages to <span class="caps">IRC</span> using <span class="caps">HTTP</span> or a <span class="caps">TCP</span> socket. The client code is again fairly simple.</p>
<h3>egret</h3>
<p><a href="http://github.com/ionfish/egret/">egret</a> is a command-line <span class="caps">IRC</span> client. The base code uses node’s <span class="caps">TCP</span> sockets and a hash to interpret <span class="caps">IRC</span> commands into English.</p>
<h3>nodejs.irc</h3>
<p><a href="http://github.com/fwg/nodejs.irc/">nodejs.irc</a> is an <span class="caps">IRC</span> bot. It’s not finished yet, but the code is separated out and easy to follow.</p>
<h3>aoibot</h3>
<p><a href="http://github.com/sztanpet/aoibot/">aoibot</a> is similar to nodejs.irc, but it looks like the finished product will be less generic. Again, it’s unfinished, so I expect the author still has a lot of ideas and work to do.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/node-js-on-irc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

