<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">

<channel>
<title>Hackszine: Web</title>
<link>http://www.hackszine.com/blog/archive/web/</link>
<description>O&apos;Reilly&apos;s Hacks Series reclaims the term &apos;hacking&apos; for the good guys--innovators who explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on their own</description>
<language>en-us</language>
<copyright>Copyright 2008, O'Reilly Media, Inc.</copyright>
<lastBuildDate>Sat, 23 Aug 2008 21:59:57 -0800</lastBuildDate>
<pubDate>Sun, 24 Aug 2008 22:53:32 -0800</pubDate>
<generator>http://www.movabletype.org/?v=4.1</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<itunes:author>O'Reilly Media, Inc.</itunes:author>
<itunes:subtitle>Clever solutions to interesting problems.</itunes:subtitle>
<itunes:summary>Hackszine Podcast</itunes:summary>
<itunes:owner>
<itunes:email>webmaster@makezine.com</itunes:email>
</itunes:owner>
<category>Technology</category>
<itunes:category text="Technology">
</itunes:category>
<itunes:category text="Technology">
  <itunes:category text="Gadgets" />
</itunes:category>
<itunes:category text="Games &amp; Hobbies" >
</itunes:category>
<itunes:category text="Science">
</itunes:category>
<itunes:image href="http://makezine.com/images/hackszine/rss_icon.jpg" />
<itunes:explicit>no</itunes:explicit>


<item>
<title>Pixlr: Flash photo editor</title>
<itunes:summary> Pixlr is a simplified photo editor that runs right in your web browser. The interface is similar to Photoshop, though its tools are still a bit rudimentary. It&apos;s the pet project of Swedish web developer Ola Sevandersson, and is...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="pixlr_20080823.jpg" src="http://www.hackszine.com/pixlr_20080823.jpg" width="600" height="355" class="mt-image-none" style="" /></span></p>

<p>Pixlr is a simplified photo editor that runs right in your web browser. The interface is similar to Photoshop, though its tools are still a bit rudimentary. It's the pet project of Swedish web developer Ola Sevandersson, and is still fairly beta, but there are some things I really like about it. For one, the File-&gt;Open and File-&gt;Save menus show off how seamless file interaction on the web can actually be. The other cool thing is that the application has layer support, which is one of the basic requirements of any photo editor (but often not seen in online experiments). Missing are selection rotation and transformation, among other things, but hopefully this will continue to be developed into a substitute for the 99% of what most folks use desktop photo editors for.</p>

<p><a href="http://www.pixlr.com/">Pixlr beta</a><br />
<a href="http://www.webmonkey.com/blog/One_Man_Photoshop%3A_Pixlr_is_Slick">One Man Photoshop: Pixlr is Slick</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/pixlr_flash_photo_editor.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/pixlr_flash_photo_editor.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/pixlr_flash_photo_editor.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/pixlr_flash_photo_editor.html?CMP=OTC-7G2N43923558</guid>
<category>Flash</category>
<pubDate>Sat, 23 Aug 2008 21:59:57 -0800</pubDate>

</item>

<item>
<title>Chain.js - data binding for jQuery</title>
<itunes:summary> Rizqi Ahmad, a high-school student in Germany, created a pretty useful data binding service for jQuery called Chain.js. It allows you to easily manipulate data driven content from javascript by directly manipulating the DOM, without resorting to templates or...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="chain_js_20080821.jpg" src="http://www.hackszine.com/chain_js_20080821.jpg" width="600" height="227" class="mt-image-none" style="" /></span></p>

<p>Rizqi Ahmad, a high-school student in Germany, created a pretty useful data binding service for jQuery called Chain.js. It allows you to easily manipulate data driven content from javascript by directly manipulating the DOM, without resorting to templates or a lot of complicated code. You create the markup the way you want the data to display, give class names to DOM elements that should have their content substituted, and pass an associative array containing the variable data to the chain() method.</p>

<p>There is also support for managing lists of elements, allowing you to add and remove elements dynamically inside the defined markup. Rizqi also created the Interaction library that works on top of the data binding library to provide drag, drop, and sort support for lists.</p>

<p>Make sure to check out his demos. They show off some of the flexibility of the library and they're easy to tweak for your own needs.</p>

<p><a href="http://rizqi.namaku.de/2008/08/data-binding-solution-for-jquery/">Data Binding Solution for jQuery</a><br />
<a href="http://github.com/raid-ox/chain.js/wikis">Chain.js - Data Binding Service for jQuery</a><br />
<a href="http://github.com/raid-ox/interaction.js/wikis">Interaction.js - drag/drop/sort support for Chain.js</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/chainjs_data_binding_for_jquer.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/chainjs_data_binding_for_jquer.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/chainjs_data_binding_for_jquer.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/chainjs_data_binding_for_jquer.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Thu, 21 Aug 2008 22:42:35 -0800</pubDate>

</item>

<item>
<title>Text-to-speech in PHP</title>
<itunes:summary>It&apos;s been a while since I&apos;ve played with the open source Festival TTS software, and I&apos;m pretty impressed with the quality of the speech output. Some of the voices that are available sound so much better than the old diphone-based...</itunes:summary>
<description>
<![CDATA[<p>It's been a while since I've played with the open source Festival TTS software, and I'm pretty impressed with the quality of the speech output. Some of the voices that are available sound so much better than the old diphone-based voices that evoke WOPR from War Games.</p>

<p>This got me thinking it'd be fun to integrate some of this functionality into a web application. A quick search and I discovered <a href="http://www.xenocafe.com/tutorials/php/festival_text_to_speech/index.php">Tony Bhimani's Linux Text-To-Speech Tutorial</a> which has a sample PHP application that uses the Festival text2wave utility and the lame mp3 encoder to produce mp3 files from user submitted text. </p>

<p>I mentioned that some of the voices are pretty outstanding. In particular, the "unit selection" voices, demonstrated on the Festival demo page, are able to synthesize a lot of sentences with few noticeable glitches. These voices sound so nice because they contain a much larger database of common sound units, only falling back on heavy processed output on less common utterances. There's a <a href="http://ubuntuforums.org/showthread.php?t=751169">howto and discussion</a> over on Ubuntu Forums that'll guide you through installing and using the more enhanced voices with Festival. With a decent voice file, Festival, and an adaptation of Tony's PHP text-to-speech demonstration, it wouldn't be too hard to add audio output to your blog or create a script that turns your RSS feeds into a podcast for the daily commute.</p>

<p>Have any of your own text-to-speech ideas or demos? Please share them in the comments!</p>

<p><a href="http://www.xenocafe.com/tutorials/php/festival_text_to_speech/index.php">Tony Bhimani - PHP Text-To-Speech Example</a><br />
<a href="http://www.cstr.ed.ac.uk/projects/festival/">The Festival Speech Synthesis System</a><br />
<a href="http://ubuntuforums.org/showthread.php?t=751169">HOWTO: Make Festival TTS Use Better Voices</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/texttospeech_in_php.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/texttospeech_in_php.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/texttospeech_in_php.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/texttospeech_in_php.html?CMP=OTC-7G2N43923558</guid>
<category>Linux</category>
<pubDate>Wed, 20 Aug 2008 21:57:11 -0800</pubDate>

</item>

<item>
<title>Cross-browser rounded vector corners</title>
<itunes:summary> As a web developer, I&apos;ve been patiently waiting for the designer community to finally decide that rounded corners and drop shadows are out of style. I&apos;ve been waiting since about 1999 so, uh, you know, any day now guys....</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="vectorcorners_20080819.jpg" src="http://www.hackszine.com/vectorcorners_20080819.jpg" width="600" height="190" class="mt-image-none" style="" /></span></p>

<p>As a web developer, I've been patiently waiting for the designer community to finally decide that rounded corners and drop shadows are out of style. I've been waiting since about 1999 so, uh, you know, any day now guys. I'll just be waiting here in web developer hell trying to construct a cubic igloo.</p>

<p>There are a number of tricks for creating roundtangles, from nesting a bunch of divs with background images, to jQuery scripts that will dynamically build successive 1-pixel-thick divs to render the corners. Today, I came across another method which simulates the CSS 3 border-radius vector corner effect in most browsers, using a little bit of conditional HTML and a bunch of browser-specific CSS properties.</p>

<p>You'll have to check the source on the linked page below to see how it's done, but basically VML is used for IE support, and the -moz-border-radius and -webkit-border-radius properties are applied for Firefox and Safari users.</p>

<p>It wouldn't be a difficult task to simplify this a bit with jQuery and roll all of the necessary markup and css tweaks inside a single class target.</p>

<p><a href="http://elv1s.ru/files/html+css/vector-corners.html">HTML/CSS Vector Corners</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/crossbrowser_rounded_vector_co.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/crossbrowser_rounded_vector_co.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/crossbrowser_rounded_vector_co.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/crossbrowser_rounded_vector_co.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Tue, 19 Aug 2008 21:06:28 -0800</pubDate>

</item>

<item>
<title>Olympic proxy - how to watch location restricted content</title>
<itunes:summary> It sounds like I&apos;m not the only one bummed out about the NBC/Microsoft/Silverlight version of the olympics. Hackszine reader No Dust writes: How do you view the Olympics on the Internet? NBCOLYMPICS.COM only shows popular games in the U.S.,...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="olympic_proxy_20080817.jpg" src="http://www.hackszine.com/olympic_proxy_20080817.jpg" width="600" height="398" class="mt-image-none" style="" /></span></p>

<p>It sounds like I'm not the only one bummed out about the NBC/Microsoft/Silverlight version of the olympics. Hackszine reader No Dust writes:</p>

<blockquote>How do you view the Olympics on the Internet?   NBCOLYMPICS.COM only shows popular games in the U.S., and missed many good games.    I went to other international web-sites in China and England (bbc).  All their video-streaming have been blocked for the U.S. region.   

<p>I heard about Proxy server stuffs... if there anything we can do to by pass their "region" check on our IP address and browser info?</blockquote></p>

<p>There are a number of sites that are distributing recorded or live olympics content online, but due to their licensing agreements, they only show content to a restricted location. The provider looks at your incoming IP address which can determine your country of origin and your permission to view the video they provide. To get around this restriction, you need to find a proxy server in an allowed location. Here's how to do it.</p>

<p><b>Choose A Site To Watch</b></p>

<p>China Central Television (CCTV) has a big list of rights holders, by country, that are officially licensed to broadcast olympic games content online. Go to the <a href="http://www.cctv.com/english/20080806/106217.shtml">CCTV Olympic Games internet rights holders list</a>, and select a URL that you want to view. Then, see which countries are associated with that URL.  You'll have to find a proxy in one of these countries to view the content.</p>

<p>Try and find a licensed country that is likely to have a decent internet backbone and infrastructure. When you look for a proxy server, you'll have better luck finding one with a speedy connection. For instance, YouTube has an Olympics channel at <a href="http://www.youtube.com/beijing2008">http://www.youtube.com/beijing2008</a>. To view anything at that URL, however, you need to be in one of the approved countries.  There's a big list to choose from, but you might want to go with South Korea instead of Afghanistan.</p>

<p><b>Find A Proxy</b></p>

<p>There are a bunch of proxy servers around the world that allow anyone to use them, typically called open proxies. You'll need to search a bit to find one that is currently online, but there's a decent, regularly updated database of open proxies at <a href="http://www.xroxy.com/proxylist.htm">xroxy.com</a> that does a decent job.</p>

<p>If you're searching for South Korea, just select it from the country list, and you'll find a number of open proxy servers, along with their latency and uptime information. Try to find one with really low latency, but keep in mind that if it has a low reliability measure, it's less likely that it'll be online.</p>

<p>Scribble down the IP address and port number for a couple proxies in the list. You'll need that information to configure Firefox.</p>

<p><b>Configure Firefox To Use A Proxy</b></p>

<p>In Firefox, go to preferences-&gt;advanced-&gt;network-&gt;settings. There's a radio button that specifies whether to use a proxy or not. Choose "Manual proxy configuration".</p>

<p>Most of the proxies in the list would have said "Transparent" in the proxy type column and use port 8080. Assuming that's the case, you want to type the IP address you saved in the "HTTP Proxy" input field, and "8080" in it's associated "Port" field. If it was a SOCKS proxy, do similar, but in the "SOCKS Host" field, and make sure to select v4 or v5, as appropriate.</p>

<p><b>See If It Worked</b></p>

<p>Once you've saved you settings, you should be able to go to the view content that wasn't previously available to you. You'll notice that your connection is a bit slower, since everything is being funneled through a server in another country, but in most cases, this will work out. If you can't connect through the proxy, or if your connection is really slow, just try another proxy from the list.</p>

<p>When you're done watching, make sure to go back to your settings and turn off the proxy by choosing the "Direct connection to the internet" option. If you leave the proxy settings in place, your connection will be slow and everything you browse will be funneled through the proxy server - probably not what you want.</p>

<p>That's really all there is to it. Good luck!<br />
</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/olympic_proxy_how_to_watch_loc.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/08/olympic_proxy_how_to_watch_loc.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/08/olympic_proxy_how_to_watch_loc.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/08/olympic_proxy_how_to_watch_loc.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Sun, 17 Aug 2008 19:59:38 -0800</pubDate>

</item>

<item>
<title>Web application hotkeys with Javascript</title>
<itunes:summary>It&apos;s unfortunate, but there are only a few sites that have done a good job of enhancing the user experience with hotkey support. In searching for the easiest way to do this in my own applications, I stumbled across the...</itunes:summary>
<description>
<![CDATA[<p>It's unfortunate, but there are only a few sites that have done a good job of enhancing the user experience with hotkey support. In searching for the easiest way to do this in my own applications, I stumbled across the Hotkeys plugin for jQuery. In typical jQuery form it lets you do something moderately complicated, like capturing keyboard events, with a single line of Javascript code. You use the hotkeys.add method to bind a keyboard event to a callback function and the hotkeys.remove method to remove the handler.</p>

<p>Here's an example that will create an alert box when you press control-c:</p>

<blockquote><code>$.hotkeys.add('Ctrl+c', function(){ alert('ctrl-c pressed');});</code></blockquote>

<p>You remove the handler like this:</p>

<blockquote><code>$.hotkeys.remove('Ctrl+c');</code></blockquote>

<p>hotkeys.add can also has a 3 parameter evocation: <code>hotkeys.add(key, options, handler)</code>. The options parameter is just an associative array which you can use to pass options such as the target DOM path or the type of key press event (keyup or keydown). The key parameter is a string representing the key combination. Instead of using scan codes, you send in the names of the key combination, such as "a", "Shift+b", "f9", or "pageup". It's really that easy.</p>

<p><a href="http://code.google.com/p/js-hotkeys/">Javascript jQuery Hotkeys Plugin</a><br />
<a href="http://code.google.com/p/js-hotkeys/wiki/about">Using jQuery Hotkeys</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/web_application_hotkeys_with_j.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/web_application_hotkeys_with_j.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/web_application_hotkeys_with_j.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/web_application_hotkeys_with_j.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Mon, 28 Jul 2008 21:28:52 -0800</pubDate>

</item>

<item>
<title>Crawling AJAX</title>
<itunes:summary>Traditionally, a web spider system is tasked with connecting to a server, pulling down the HTML document, scanning the document for anchor links to other HTTP URLs and repeating the same process on all of the discovered URLs. Each URL...</itunes:summary>
<description>
<![CDATA[<p>Traditionally, a web spider system is tasked with connecting to a server, pulling down the HTML document, scanning the document for anchor links to other HTTP URLs and repeating the same process on all of the discovered URLs. Each URL represents a different state of the traditional web site. In an AJAX application, much of the page content isn't contained in the HTML document, but is dynamically inserted by Javascript during page load. Furthermore, anchor links can trigger javascript events instead of pointing to other documents. The state of the application is defined by the series of Javascript events that were triggered after page load. The result is that the traditional spider is only able to see a small fraction of the site's content and is unable to index any of the application's state information. </p>

<p>So how do we go about fixing the problem?</p>

<p><strong>Crawl AJAX Like A Human Would</strong><br />
To crawl AJAX, the spider needs to understand more about a page than just its HTML. It needs to be able to understand the structure of the document as well as the Javascript that manipulates it. To be able to investigate the deeper state of an application, the crawling process also needs to be able to recognize and execute events within the document to simulate the paths that might be taken by a real user.</p>

<p>Shreeraj Shah's paper, Crawling Ajax-driven Web 2.0 Applications, does a nice job of describing the "event-driven" approach to web crawling. It's about creating a smarter class of web crawling software which is able to retrieve, execute, and parse dynamic, Javascript-driven DOM content, much like a human would operate a full-featured web browser.</p>

<blockquote>The "protocol-driven" approach does not work when the crawler comes across an Ajax embedded page. This is because all target resources are part of JavaScript code and are embedded in the DOM context. It is important to both understand and trigger this DOM-based activity. In the process, this has lead to another approach called "event-driven" crawling. It has following three key components 
 
<ol><li>Javascript analysis and interpretation with linking to Ajax </li><li>DOM event handling and dispatching </li><li>Dynamic DOM content extraction</li</ol>
</blockquote>

<p><strong>The Necessary Tools</strong><br />
The easiest way to implement an AJAX-enabled, event-driven crawler is to use a modern browser as the underlying platform. There are a couple of tools available, namely Watir and Crowbar, that will allow you to control Firefox or IE from code, allowing you to extract page data <em>after</em> it has processed any Javascript. </p>

<p>Watir is a library that enables browser automation using Ruby. It was originally built for IE, but it's been ported to both Firefox and Safari as well. The Watir API allows you to launch a browser process and then directly extract and click on anchor links from your Ruby application. This application alone makes me want to get more familiar with Ruby.</p>

<p>Crowbar is another interesting tool which uses a headless version of Firefox to render and parse web content. What's cool is that it provides a web server interface to the browser, so you can issue simple GET or POST requests from any language and then scrape the results as needed. This lets you interact with the browser from even simple command line scripts, using curl or wget.</p>

<p>Which tool you use depends on the needs of your crawler. Crowbar has the benefit of being language agnostic and simple to integrate into a traditional crawler design to extract page information that would only be present after a page has completed loading. Watir, on the other hand, gives you deeper, interactive access to the browser, allowing you to trigger subsequent Javascript events. The downside is that the logic behind a crawler that can dig deep into application state is quite a bit more complicated, and with Watir you are tied to Ruby which may or may not be your cup of tea.</p>

<p><br />
<a href="http://simile.mit.edu/wiki/Crowbar">Crowbar - server-side headless Firefox</a><br />
<a href="http://wtr.rubyforge.org/">Watir - browser remote control in Ruby</a><br />
<a href="http://www.infosecwriters.com/text_resources/pdf/Crawling_AJAX_SShah.pdf">Crawling Ajax-driven Web 2.0 Applications (PDF)</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/crawling_ajax.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/crawling_ajax.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/crawling_ajax.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/crawling_ajax.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Sat, 05 Jul 2008 12:57:11 -0800</pubDate>
<enclosure url="http://www.infosecwriters.com/text_resources/pdf/Crawling_AJAX_SShah.pdf" length="134246" type="application/pdf" />
</item>

<item>
<title>Algorithm Ink and ContextFree.js - generative art with Javascript</title>
<itunes:summary> Currently Firefox, Safari and Opera have reasonable support for the Canvas HTML element. With IE the only major remaining laggard, there are a lot of people starting to experiment with Javascript&apos;s new graphical capabilities. I mentioned John Resig&apos;s Processing.js...</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="380">	<param name="allowfullscreen" value="true" />	<param name="allowscriptaccess" value="always" />	<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1202830&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />	<embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1202830&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="380"></embed></object></p>

<p>Currently Firefox, Safari and Opera have reasonable support for the Canvas HTML element. With IE the only major remaining laggard, there are a lot of people starting to experiment with Javascript's new graphical capabilities. I mentioned John Resig's Processing.js library in May, and now Aza Raskin has released the ContextFree.js library, which brings another generative drawing language to web-standards software development.</p>

<blockquote>Besides being pretty, why is ContextFree.js interesting? Because it shows the power of Open web technologies for making graphically-enabled, compelling interaction. The true power of the web revolves around anyone being able to dive in, see what someone else has done, and expand upon it. Canvas lowers the cost of entry to creating graphical mashups and other dynamic, graphical content. It also shows the progress the web has made: a year ago, this demo would not have been possible. Canvas wasn't ready, and Javascript interpreters weren't fast enough. Looking at the qualitative difference in speed from Firefox 2 to Firefox 3 indicates the amazing and substantial progress made towards speeding up Javascript since the last major browser release cycle.</blockquote>

<p>ContextFree.js is a Javascript port of the Context Free open source generative art application by Chris Coyne. It basically defines an extremely simple grammar that is designed to generate rule-based artwork with very few lines of code.</p>

<p>Aza has also released the Algorithm Ink website, which uses ContextFree.js to create an open source art gallery. Using Algorithm Ink, you can load, tweak, and share generative art through a web interface. When you see something you like, you can view the source for the artwork and use it in your own creations. Very cool.</p>

<p><a href="http://azarask.in/blog/post/contextfreejs-algorithm-ink-making-art-with-javascript/">ContextFree.js &amp; Algorithm Ink: Making Art with Javascript</a><br />
<a href="http://code.google.com/p/contextfree/">ContextFree.js at Google Code</a><br />
<a href="http://azarask.in/projects/algorithm-ink/">Algorithm Ink</a><br />
<a href="http://www.contextfreeart.org/">The original Context Free by Chris Coyne</a><br />
<a href="http://developer.mozilla.org/en/docs/Drawing_Graphics_with_Canvas">Drawing Graphics with Canvas</a><br />
<a href="http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html">Processing.js - visualization library for Javascript</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/algorithm_ink_and_contextfreej.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/algorithm_ink_and_contextfreej.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/algorithm_ink_and_contextfreej.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/algorithm_ink_and_contextfreej.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Wed, 02 Jul 2008 20:59:11 -0800</pubDate>

</item>

<item>
<title>Swurl - scrapbook your digital life</title>
<itunes:summary> Ryan Sit sent in a link to Swurl, a Web 2.0 application/startup he&apos;s been working on that attempts to collect all of the artifacts of your digital life and assemble them into a sensible whole. You could call it...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="swurl_20080701.jpg" src="http://www.hackszine.com/swurl_20080701.jpg" width="500" height="415" class="mt-image-none" style="" /></span></p>

<p>Ryan Sit sent in a link to Swurl, a Web 2.0 application/startup he's been working on that attempts to collect all of the artifacts of your digital life and assemble them into a sensible whole. You could call it an aggregation tool&mdash;which, deep down, it is&mdash;but it does a little more than other things I've seen. Namely, it does a really nice job of taking in a wide range of relationship oriented services and turning the their inherent lock-in inside-out.</p>

<blockquote>You just do your normal stuff online, Digg stuff, Delicious stuff, favorite Youtube videos, Twitter, rent videos on Netflix, bookmark songs on Last.fm, post photos on Flickr, etc.  And Swurl brings it all together in a really deep way.  We also enhance data, adding trailers to movies you rent and Lyrics to songs you bookmark.
</blockquote>

<p>All of these services get pulled together into a blog format and discussion and commenting can take place around any item. I think the idea is to help centralize the conversation instead of having it scattered about your different networks. Depending how busy your various online activities are, this may help you or it may just add yet another place to track comments.</p>

<p>What I like most, and the real hack from a Web 2.0 startup perspective, is that they programmed this to encourage you to maintain friends and use features across a number of social networks and easily traverse the relationships and data in all of them from a single location. Flikr is good for storing photos. Del.icio.us is great for bookmarking. Facebook is awesome for tracking friends. Swurl aggregates the relationships from all of the networks you inform it about and it recognizes when those users are also Swurl members. This encourages network growth, but isn't so greedy that it forces you to work only inside the Swurl fence.</p>

<p><a href="http://www.swurl.com/">Swurl</a> [via <a href="http://ryansit.swurl.com/">Ryan</a>]</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/swurl_scrapbook_your_digital_l.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/07/swurl_scrapbook_your_digital_l.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/07/swurl_scrapbook_your_digital_l.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/07/swurl_scrapbook_your_digital_l.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Tue, 01 Jul 2008 20:46:24 -0800</pubDate>

</item>

<item>
<title>Objective-J and Cappuccino: Cocoa for the web</title>
<itunes:summary> There&apos;s a neat article over at Ars Technica that takes a look at 280 North&apos;s 3-person development team, their recent release of a keynote-like web application called 280 Slides, and the framework that they constructed to make the application....</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="objective-j_20080629.jpg" src="http://www.hackszine.com/objective-j_20080629.jpg" width="500" height="392" class="mt-image-none" style="" /></span></p>

<p>There's a neat article over at Ars Technica that takes a look at 280 North's 3-person development team, their recent release of a keynote-like web application called 280 Slides, and the framework that they constructed to make the application. Some time before 280 Slides was developed, the team created an Objective-C-like superset of the Javascript language called Objective-J which implements message passing and a Smalltalk-style syntax. Building on that, they re-implemented much of the Cocoa framework in Objective-J, allowing Cocoa-style applications to be developed that will run natively in the browser. </p>

<p>With Objective-J and Cappuccino, you don't create applications with a mixture of HTML, CSS and Javascript. Instead, apps are written entirely in Objective-J, following a development model that's similar to creating desktop applications for OS X. From the article:<br />
<blockquote>"Cappuccino is a re-implementation of Cocoa in Objective-J, which means we reimplemented AppKit, Foundation, CoreGraphics, and parts of CoreAnimation," Boucher told us. With it, developers familiar with desktop GUI applications can create a rich, desktop-like web app with the same relative ease Cocoa programmers can create a rich desktop app. "Coming from a background of desktop programming, and Cocoa in particular, we realized how much harder building a web application was. So we wanted to try to make things just a little bit easier."</blockquote></p>

<p>280 Slides stands on its own as a powerful web-based presentation tool. It's simplified when compared to its desktop cousins, but it does exactly what most people need in a presentation tool, and it can export to PPT for fine tuning and end-presentation use. The fact that its development inspired the creation of a new language as well as bringing a desktop application development framework to the web just blows my mind.</p>

<p>Objective-J will be released to the public soon as an open source project. On the one hand, I'm not sure if I'm comfortable moving away from the web development technologies I've grown accustomed to. On the other, it would be cool to work in a language that allows you to seamlessly port your applications between the desktop and the web. </p>

<p>If you have experience with both Cocoa and AJAX development, please share your thoughts in the comment area.</p>

<p><a href="http://arstechnica.com/journals/apple.ars/2008/06/26/cocoa-on-the-web-280-north-objective-j-and-cappuccino">Cocoa on the web: 280 North, Objective-J, and Cappuccino</a> [via <a href="http://developers.slashdot.org/developers/08/06/29/167232.shtml">Slashdot</a>]<br />
<a href="http://blog.280north.com/">280 North Blog</a><br />
<a href="http://280slides.com/">280 Slides</a><br />
<a href="http://objective-j.org/">Objective-J.org</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/06/objectivej_and_cappuccino_coco.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Sun, 29 Jun 2008 20:36:07 -0800</pubDate>

</item>

<item>
<title>JSVI - Javascript Vi for web forms</title>
<itunes:summary> There are so many WYSIWYG editors for html forms, it&apos;s about time someone put together a decent web version of the Vi editor. JSVI is written in Javascript and seems to be fairly cross-browser compatible. With a few tweaks...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="jsvi_20080628.jpg" src="http://www.hackszine.com/jsvi_20080628.jpg" width="500" height="353" class="mt-image-none" style="" /></span></p>

<p>There are so many WYSIWYG editors for html forms, it's about time someone put together a decent web version of the Vi editor. JSVI is written in Javascript and seems to be fairly cross-browser compatible.  With a few tweaks to your code, you can now make any textarea behave exactly like Vi. How cool is that?</p>

<p>To use it, download the GPLed vi.js file from the link below, include it in your html document, and then add an <b>onfocus="editor(this);"</b> to any textarea that you want vi enabled. If your textarea contains any preset information, the text will be loaded into the editor when the field is clicked. Saving the file with :wq will exit the editor and store the changes back in the input field.</p>

<p>Somewhere there must be a unix blog or forum that will adopt this for their submission and comment fields. Shame on them if they don't. That is, unless they are waiting for the emacs version.</p>

<p><a href="http://gpl.internetconnection.net/vi/">JSVI - VI in JavaScript (demo)</a><br />
<a href="http://gpl.internetconnection.net/vi/vi.js">Download vi.js</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/jsvi_javascript_vi_for_web_for.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/jsvi_javascript_vi_for_web_for.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/06/jsvi_javascript_vi_for_web_for.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/06/jsvi_javascript_vi_for_web_for.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Sat, 28 Jun 2008 20:39:33 -0800</pubDate>

</item>

<item>
<title>Parallax scrolling in jQuery</title>
<itunes:summary>Wynn Netherland wrote a plugin for jQuery that makes it easy to add a slick Parallax effect to a web site. For anyone who missed video games of the 80s, this is the old sidescroller technique that simulates depth by...</itunes:summary>
<description>
<![CDATA[<p>Wynn Netherland wrote a plugin for jQuery that makes it easy to add a slick Parallax effect to a web site. For anyone who missed video games of the 80s, this is the old sidescroller technique that simulates depth by making things in the foreground move faster than the background. The jQuery Parallax plugin does this by easing the background position across several div layers, all at different rates.</p>

<p>To make it work, you just make a horizontally tile-able background image, and a horizontally tile-able alpha-transparent PNG for each foreground layer. These are each set as the background image of a separate div with the repeat-x attribute. The divs are absolutely positioned right on top of each other, and then a single line of jQuery code is used to set the animation speed for each layer.</p>

<p>It's a subtle and bandwidth friendly way to add a bit of visual polish to your site. Netherland is using this effect for his blog's masthead, and it looks pretty cool.</p>

<p><a href="http://locomotivation.com/2008/06/18/jquery-parallax-scrolling-build-your-own-1980s-video-game">jQuery Parallax Scrolling</a> (<a href="http://locomotivation.com/javascripts/theme/jquery.parallax.js">download</a>)<br />
<a href="http://www.jquery.com/">jQuery</a><br />
<a href="http://plugins.jquery.com/project/Easing">jQuery Easing library</a> - you'll need this too</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/parallax_scrolling_in_jquery.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/06/parallax_scrolling_in_jquery.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/06/parallax_scrolling_in_jquery.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/06/parallax_scrolling_in_jquery.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Sun, 22 Jun 2008 18:10:02 -0800</pubDate>

</item>

<item>
<title>SafeHistory: protect your privacy from visited link analysis</title>
<itunes:summary>A couple of days ago I wrote about the visited link javascript hack that lets any website operator query a user&apos;s browser history to determine if they&apos;ve visited any other particular site. One possible use for this is to detect...</itunes:summary>
<description>
<![CDATA[<p>A couple of days ago I wrote about the visited link javascript hack that lets any website operator query a user's browser history to determine if they've visited any other particular site. One possible use for this is to detect which Web2.0 social applications a user visits so that you can display the appropriate link badges.</p>

<p>It's a creepy scenario, though, that a website operator can effectively bypass the browser's intended security model to invade your privacy by seeing if you've been visiting other sites. Hackszine reader Logical Extremes commented with a solution to this problem:</p>

<blockquote>This is a common phishing vector. Rather than encouraging broader use, we should be educating and protecting against it. There is a Firefox add-on that explicitly blocks this.</blockquote>

<p>Some hackers over at the Stanford Computer Science Department created SafeHistory, a Firefox plugin that protects against visited link tracking techniques. It works by only allowing the a:visited property to apply to off-site links that were previously visited from the current URL.</p>

<p>This seems to be a reasonable way to keep the functionality of visited links without leaking any additional information. I wonder how long it will be before this is adopted as a browser behavior standard.</p>

<p><a href="http://www.safehistory.com/">Stanford SafeHistory</a><br />
<a href="http://crypto.stanford.edu/sameorigin/sameorigin.pdf">Protecting Browser State Using Same Origin Policy (PDF)</a></p>

<p>Previously:<br />
<a href="http://www.hackszine.com/blog/archive/2008/05/detect_which_sites_a_web_user.html">Detect which sites a web user visits</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/safehistory_protect_your_priva.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/safehistory_protect_your_priva.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/safehistory_protect_your_priva.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/safehistory_protect_your_priva.html?CMP=OTC-7G2N43923558</guid>
<category>Network Security</category>
<pubDate>Fri, 30 May 2008 20:17:02 -0800</pubDate>
<enclosure url="http://crypto.stanford.edu/sameorigin/sameorigin.pdf" length="111602" type="application/pdf" />
</item>

<item>
<title>Wii Balance Board hacks</title>
<itunes:summary> A few days ago, this video appeared with Matthieu Deru and Simon Bergweiler showing off a hack that allows them to surf Google Earth using a Wii. Unfortunately, there weren&apos;t too many details about how it was accomplished and...</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/lKUDU9lE--E&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/lKUDU9lE--E&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="500" height="405"></embed></object></p>

<p>A few days ago, this video appeared with Matthieu Deru and Simon Bergweiler showing off a hack that allows them to surf Google Earth using a Wii. Unfortunately, there weren't too many details about how it was accomplished and I couldn't track down any source for the C# application that talks to the bluetooth device.</p>

<p>What I did find was this other clip from almost a month ago (?!?) in which Daniel Schneider demonstrates using the Wii Balance Board to navigate the web in Firefox. </p>

<p>That's right. You can actually surf the web:</p>

<p><object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/bqTB5AUDZzo&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/bqTB5AUDZzo&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="500" height="405"></embed></object></p>

<p>He's using the latest version of GlovePIE (v0.3) to accomplish this. As far as I can tell, it's still very alpha, and the WiiLi wiki claims it's buggy, but it does appear to work. Daniel has some pointers to how he's configured things, including the Greasemonkey script that allows you to surf without clicking.</p>

<p>For more information on coding GlovePIE scripts that use the Balance Board, peek at the documentation.rtf file that's packaged with the GlovePIE download. There's information around page 70 that describes how the board functions and how to pull the 4 sensor values from each of its feet.</p>

<p><a href="http://edutechwiki.unige.ch/en/Nintendo_Wii_balance_board">Using GlovePIE and Firefox with the Nintendo Wii Balance Board</a><br />
<a href="http://carl.kenner.googlepages.com/glovepie">GlovePIE</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/wii_balance_board_hacks.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/wii_balance_board_hacks.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/wii_balance_board_hacks.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/wii_balance_board_hacks.html?CMP=OTC-7G2N43923558</guid>
<category>Electronics</category>
<pubDate>Thu, 29 May 2008 21:04:21 -0800</pubDate>

</item>

<item>
<title>Detect which sites a web user visits</title>
<itunes:summary> Aza Raskin&apos;s SocialHistory Javascript library allows you to do something incredibly cool: detect which sites your web users have visited on a per-user basis. The javascript runtime isn&apos;t supposed to be privy to the information in a user&apos;s browser...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="socialdetect_20080528.jpg" src="http://www.hackszine.com/socialdetect_20080528.jpg" width="500" height="147" class="mt-image-none" style="" /></span></p>

<p>Aza Raskin's SocialHistory Javascript library allows you to do something incredibly cool: detect which sites your web users have visited on a per-user basis. The javascript runtime isn't supposed to be privy to the information in a user's browser history, but there's an information backchannel common to all major browsers which allows you to effectively interrogate the browsing history and determine if a particular URL has been visited before. </p>

<p>It works by creating an anchor link to the site in question and applying a CSS style to the link, specifying a different display property for "a:visited". By reading the computed style back from the anchor element, you can then determine the property's value, and consequently if the user had visited the URL or not.</p>

<p>This could probably be used for a number of devious purposes, but Aza's concept for the SocialHistory library is actually really useful. By querying the default URLs that belong to all the major social network sites, you can figure out which sites a particular user visits and custom tailor any social badges that you display. If they use del.icio.us, you show a del.icio.us link.  If they visit Digg, you show the Digg button. It's an awesome feature made possible by a pretty freaky security leak.</p>

<p>Now, it's not perfect. It requires that you query the exact URLs that a user may have visited. You can't figure out everywhere they've been, how frequently, or in what order, only whether a particular URL that you know about has been visited before. On the other hand, it's a pretty useful tool considering you aren't even supposed to be able to do this.</p>

<p><a href="http://azarask.in/blog/post/socialhistoryjs/">How to Detect the Social Sites Your Visitors Use</a><br />
<a href="http://code.google.com/p/aza/source/browse/trunk/SocialHistory/SocialHistory.js">SocialHistory.js</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/detect_which_sites_a_web_user.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/detect_which_sites_a_web_user.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/detect_which_sites_a_web_user.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/detect_which_sites_a_web_user.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Wed, 28 May 2008 19:44:20 -0800</pubDate>

</item>

<item>
<title>Cross browser session data with Javascript</title>
<itunes:summary>By storing data in the window.name property, you can store data between page loads and across domains without ever sending a cookie to a server. Thomas Frank created the sessvars.js library which makes use of this browser quirk, allowing you...</itunes:summary>
<description>
<![CDATA[<p>By storing data in the window.name property, you can store data between page loads and across domains without ever sending a cookie to a server. Thomas Frank created the sessvars.js library which makes use of this browser quirk, allowing you to store up to 2 MB of client-side session data.</p>

<p>This is really powerful for a few reasons:<br />
<ul><li>client-side, you can store way more data than allowed by traditional cookies</li><li>none of the data is transferred explicitly to the server, minimizing bandwidth used for each page request</li><li>allows you to talk between pages in different domains</li></ul></p>

<p>Keep in mind that anything you store via this mechanism will be visible to any other site that a person visits, so this is best for storing non-sensitive data that you want to retain between page loads. This would be great for caching returned AJAX data that you would otherwise have to refetch and reprocess.</p>

<p><a href="http://www.thomasfrank.se/sessionvars.html">Session variables without cookies</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/cross_browser_session_data_wit.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/cross_browser_session_data_wit.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/cross_browser_session_data_wit.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/cross_browser_session_data_wit.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Mon, 12 May 2008 19:26:32 -0800</pubDate>

</item>

<item>
<title>Processing.js - visualization library for Javascript</title>
<itunes:summary> John Resig, of jQuery fame, released a port of the Processing visualization language for Javascript. Seriously, John is on fire: The first portion of the project was writing a parser to dynamically convert code written in the Processing language,...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="jsprocessing_20080509.jpg" src="http://www.hackszine.com/jsprocessing_20080509.jpg" width="500" height="149" class="mt-image-none" style="" /></span></p>

<p>John Resig, of jQuery fame, released a port of the Processing visualization language for Javascript.  Seriously, John is on fire:</p>

<blockquote>The first portion of the project was writing a parser to dynamically convert code written in the Processing language, to JavaScript. This involves a lot of gnarly regular expressions chewing up the code, spitting it out in a format that the browser understands.

<p>It works "fairly well" (in that it's able to handle anything that the processing.org web site throws at it) but I'm sure its total scope is limited (until a proper parser is involved). I felt bad about tackling this using regular expressions until I found out that the original Processing code base did it in the same manner (they now use a real parser, naturally).</blockquote></p>

<p>The full 2D API is implemented, with the exclusion of some features here and there between browsers (Firefox 3 is pretty full featured). You can interact with the Processing API directly from standard Javascript. This lets you make use of these drawing features by simply instantiating a Processing object, and then calling its various drawing methods.</p>

<p>Another capability is to write code natively in the Processing language. This allows you to make use of extended language features such as method overloading and classic inheritance, though it looks like type information is pretty much ignored.</p>

<p>John has many of the demos from processing.org working. Most of them are going to peg your CPU, but this is some seriously cool stuff to see working in a first release. </p>

<p>Javascript just got a lot more interesting.</p>

<p><a href="http://dev.jquery.com/~john/processing.js/">Processing.js</a><br />
<a href="http://processing.org/">Processing: open source data visualization language</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/processingjs_visualization_lib.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Fri, 09 May 2008 21:36:09 -0800</pubDate>

</item>

<item>
<title>Server-side Google Analytics</title>
<itunes:summary>Peter van der Graaf did a little analysis of the URLs that are generated by the Google Analytics Javascript API and put together a very useful tutorial for building Analytics-enabled applications without the use of Javascript. When you look at...</itunes:summary>
<description>
<![CDATA[<p>Peter van der Graaf did a little analysis of the URLs that are generated by the Google Analytics Javascript API and put together a very useful tutorial for building Analytics-enabled applications without the use of Javascript.</p>

<blockquote>When you look at the analytics javascript code you see that it combines several sets of data into an image request. This image request sends the right data to Google (not the javascript). When you know what url you should use for the image, you can call the image directly and send the same data. Of course you need to be able to request the image url and that isn't easy from another image, rss feed or pdf. This is why we request it "server side".</blockquote>

<p>You can add the code to the PHP that drives a blog site, for instance, and generate page views when your RSS feed is hit.  You can even write a very simple script to proxy images and downloads, which will let you track hit data for all files on your site, not just the html pages viewed by a javascript enabled browser.</p>

<p>Taken a step further, you could even use this on the client side, triggering analytics views from standalone Flash apps or even desktop applications.</p>

<p>The one thing you need to keep in mind is that server-side analytics requests will appear to come from your server, not the client's machine. So while you can track page views and download events this way, you'll loose a lot of the information about your user base.  Because of this, it would probably make sense to use a separate tracking ID for the server side events.</p>

<p><a href="http://www.vdgraaf.info/google-analytics-without-javascript.html">Google Analytics Without Javascript</a> </p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/serverside_google_analytics.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/05/serverside_google_analytics.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/05/serverside_google_analytics.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/05/serverside_google_analytics.html?CMP=OTC-7G2N43923558</guid>
<category>Google</category>
<pubDate>Thu, 01 May 2008 20:27:10 -0800</pubDate>

</item>

<item>
<title>Stop XSS attacks with SafeHTML</title>
<itunes:summary>If you allow user-contributed content in your site, you run into the problem of dealing with user supplied HTML in a safe manner. The most secure way of dealing with things, of course, is to strip or escape all HTML...</itunes:summary>
<description>
<![CDATA[<p>If you allow user-contributed content in your site, you run into the problem of dealing with user supplied HTML in a safe manner.  The most secure way of dealing with things, of course, is to strip or escape all HTML from user input fields. Unfortunately, there are many situations where it would be nice to allow a large subset of HTML input, but block out anything potentially dangerous.</p>

<p>SafeHTML is a lightweight PHP user input sanitizer that does just that. Just run any input field through the SafeHTML filter and any javascript, object tags, or layout breaking tags will be stripped from the supplied text. It also does a reasonable job of correcting any gnarly, malformed code, which is also a common problem with user-contributed data.</p>

<p>Using it is easy. Just instantiate the SafeHTML object and call its parse method:</p>

<blockquote><code>
require_once('classes/safehtml.php');

<p>$safehtml =& new SafeHTML();</p>

<p>if ( isset( $_POST["inputfield"] ) ) <br />
{<br />
&nbsp;&nbsp;$inputfield=$_POST["inputfield"];<br />
&nbsp;&nbsp;$cleaninput = $safehtml-&gt;parse($inputfield);<br />
}<br />
</code></blockquote></p>

<p>This will take the posted "inputfield" parameter, strip any baddies, XHTMLify what's left, and the result will be stored in the $cleaninput variable. It's a simple addition to your code, and a lot more straightforward than trying to roll your own.</p>

<p>My only beef with the package is that it's written with a default allow policy, stripping out tags that are in its deleteTags array, but essentially allowing anything else through.  If you'd rather only let through tags that you specifically want to allow, I'd recommend adding an allowTags array and adjusting the _openHandler method, adding the following after the deleteTags check:</p>

<blockquote><code>

<p>if ( ! in_array($name, $this-&gt;allowTags)) {<br />
&nbsp;&nbsp;return true;<br />
}</p>

<p></code></blockquote></p>

<p>You'll need to fill allowTags with everything you know to be safe and welcome, and you may miss a few that people will end up wanting to legitimately use, but this is easily corrected and the default deny policy is much safer in the long run.</p>

<p><a href="http://pixel-apes.com/safehtml/">SafeHTML - an anti-XSS HTML parser, written in PHP</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/stop_xss_attacks_with_safehtml.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/stop_xss_attacks_with_safehtml.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/stop_xss_attacks_with_safehtml.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/stop_xss_attacks_with_safehtml.html?CMP=OTC-7G2N43923558</guid>
<category>Network Security</category>
<pubDate>Tue, 29 Apr 2008 20:49:15 -0800</pubDate>

</item>

<item>
<title>Encoding JPEGs client-side in AS3</title>
<itunes:summary>I&apos;ve been doing a bunch of Flash Actionscript 3 development lately at work, and one of my favorite features with the new drawing API is the ease and speed with which you can rasterize vector data and manipulate image bitmaps....</itunes:summary>
<description>
<![CDATA[<p>I've been doing a bunch of Flash Actionscript 3 development lately at work, and one of my favorite features with the new drawing API is the ease and speed with which you can rasterize vector data and manipulate image bitmaps. </p>

<p>What's killer is that Adobe's <a href="http://code.google.com/p/as3corelib/">as3corelib</a> addon library finally gives us some essential tools that have been sorely lacking, none the least of which is a client side JPEG encoder. With this, you can turn any drawable object like a sprite or a movieclip into a ByteArray holding the compressed JPEG data in just a few lines of code.  It's as simple as this:</p>

<blockquote><code>import com.adobe.images.JPGEncoder;

<p>var clipbmp:BitmapData = new BitmapData (aclip.width, aclip.height);<br />
clipbmp.draw(aclip);</p>

<p>var jpgEnc:JPGEncoder = new JPGEncoder(90);<br />
var jpgbytes:ByteArray = jpgEnc.encode(clipbmp);<br />
</code></blockquote></p>

<p>This turns the "aclip" sprite or movieclip into a rasterized, flattened, BitmapData object. The BitmapData is then run through the JPEG encoder with the quality setting of 90 and you're left with the raw JPEG-compressed image in a ByteArray object. The as3corelib also provides a PNG encoder, with which you can just use the static method <code>PNGEncoder.encode(clipbmp)</code>.</p>

<p>This is perfect for saving a capture of user-generated artwork to the server. Just set the data member of a URLRequest object to the ByteArray and post it. For more detailed information on how to put all the pieces together, <a href="http://henryjones.us/articles/using-the-as3-jpeg-encoder">Henry Jones</a> has a really thorough post of compressing JPEG data and pinging it off a server to force an image download. </p>

<p>Unfortunately, to trigger a JPEG download, you still need to post the image data up to a server script and have it echo it back to the browser. The difference now, though, is that you can do the compression on the client end, saving both server CPU time and the time to upload the image data. This means saving a large image is a few second process instead of taking a minute and a half.</p>

<p><a href="http://code.google.com/p/as3corelib/">Actionscript 3 Core Library (as3corelib)</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/encoding_jpegs_clientside_in_a.html?CMP=OTC-7G2N43923558</guid>
<category>Flash</category>
<pubDate>Tue, 22 Apr 2008 22:03:58 -0800</pubDate>

</item>

<item>
<title>Nice overview of the YouTube API</title>
<itunes:summary> I caught this self-referential tutorial on YouTube today which walks you through the basics of the YouTube API. It appears to be quite simple to develop Javascript or Flash applications that can control or interact with the YouTube player,...</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/I8xZBfVsMzs&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/I8xZBfVsMzs&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="500" height="400"></embed></object></p>

<p>I caught this self-referential tutorial on YouTube today which walks you through the basics of the YouTube API. It appears to be quite simple to develop Javascript or Flash applications that can control or interact with the YouTube player, or even completely reskin the interface.</p>

<p>What I didn't know until recently was that the API has provisions for allowing your application to upload videos and post comments.  You can even authenticate users and allow them to interact with the YouTube backend through your private application.  It looks like you can do just about everything programatically except remove the YouTube watermark on the video.</p>

<p><a href="http://code.google.com/apis/youtube/developers_guide_protocol.html">YouTube Developer's Guide</a><br />
<a href="http://apiblog.youtube.com/">Developer API Blog</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/nice_overview_of_the_youtube_a.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/nice_overview_of_the_youtube_a.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/nice_overview_of_the_youtube_a.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/nice_overview_of_the_youtube_a.html?CMP=OTC-7G2N43923558</guid>
<category>YouTube</category>
<pubDate>Sun, 13 Apr 2008 23:12:23 -0800</pubDate>

</item>

<item>
<title>Automatic outbound link analytics with jQuery</title>
<itunes:summary>I had the challenge of adding Google Analytics tracking code to all the outbound links on a site I&apos;ve been working on. There are hundreds of these links scattered around the site, so rather than try and edit a bunch...</itunes:summary>
<description>
<![CDATA[<p>I had the challenge of adding Google Analytics tracking code to all the outbound links on a site I've been working on.  There are hundreds of these links scattered around the site, so rather than try and edit a bunch of links, manually adding onclick handlers in an error-prone fashion, I decided to get lazy and write some code to handle it for me.</p>

<p>First I was thinking about doing some sort of regular expression search and replace throughout the site and database, but that reminded me of CSS3 selectors and their ability to do simple pattern matching. I've seen people apply a special style to outbound links this way, so after a few minutes of monkeying around with things, I now have a chunk of jQuery that will automatically track clicks on all outbound links.</p>

<p>Here it is, in a nutshell:</p>

<blockquote><code>
jQuery(function($){

<p>&nbsp;&nbsp;  // Match all anchor tags in the "maincontent" div with<br />
&nbsp;&nbsp;  // urls that begin with "http" but don't contain the<br />
&nbsp;&nbsp;  // string "yourwebsite.com"<br />
&nbsp;&nbsp;  $('#maincontent a[href^="http"]').not('a[href*="yourwebsite.com"]').click(function(){</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;     try {</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;        // Get the href url and toss out the "http://"<br />
&nbsp;&nbsp;&nbsp;&nbsp;        var href = $(this).attr('href');<br />
&nbsp;&nbsp;&nbsp;&nbsp;       if ( href.indexOf("://") &gt; 0 ) {</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             // Track the page in Google Analytics as <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             // "/tracking/outbound/www.somesite.com/foo"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             var outbound = '/tracking/outbound/' + href.split("://",2)[1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             pageTracker._trackPageview(outbound);</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        }<br />
&nbsp;&nbsp;&nbsp;&nbsp;     } catch( e ) {}<br />
&nbsp;&nbsp;  }<br />
}<br />
</code></blockquote></p>

<p>With this running, all of my internal pages get tracked as usual, and any external links will appear as pageviews that look like "/tracking/outbound/www.somesite.com/foo".</p>

<p>If you link out to many different pages on several sites, keeping the full site url in the tracking code and building these deep paths is particularly useful.  Google Analytics will allow you to drill down into the tree like it was normal content and quickly pull numbers on how many total outbound clicks you received (/tracking/outbound), how many went to www.somesite.com (/tracking/outbound/www.somesite.com), and how many people clicked out to a particular page on the site.</p>

<p>This saved me quite a bit of time and is immensely more flexible than any other outbound tracking method I've used.  I hope this helps someone else.  Drop me a line in the comments if this works out for you.</p>

<p><strong>Update:</strong> it looks like I wasn't the first to do this. <a href="http://blog.rebeccamurphey.com/2008/01/06/track-outbound-clicks-with-google-analytics-and-jquery/">An article by Rebecca Murphey</a> shows how to do something similar, while also adding the referring post title to the tracking code.  Pretty cool stuff, I must say.</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/automatic_outbound_link_analyt.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/automatic_outbound_link_analyt.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/automatic_outbound_link_analyt.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/automatic_outbound_link_analyt.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Fri, 11 Apr 2008 22:57:30 -0800</pubDate>

</item>

<item>
<title>Relational database using jQuery and HTML tables</title>
<itunes:summary><![CDATA[Here's a novel use for the HTML &lt;TABLE&gt; tag: storing client side database tables. Nick Kallen came up with a slick hack that uses the jQuery syntax to perform simple selects and joins on HTML tables. By using CSS3 selectors,...]]></itunes:summary>
<description>
<![CDATA[<p>Here's a novel use for the HTML &lt;TABLE&gt; tag: storing client side database tables. Nick Kallen came up with a slick hack that uses the jQuery syntax to perform simple selects and joins on HTML tables. By using CSS3 selectors, you can easily target fields which match or contain your search terms, and Nick's jQuery-based API provides a simple query language, similar to a rudimentary SQL:</p>

<blockquote>
Today I was thinking aloud about <a href="http://research.microsoft.com/Users/luca/Slides/2003-11-132s2n2g2s20&amp;#40;Lisbon&amp;#41;.pdf">Tree Regular Expressions</a> and how they might make a nice query language for document databases like CouchDB. Someone pointed out that CSS3 selectors might make a great concrete syntax for this. One thing lead to another and I thought, why not build a relational database in HTML? So I did. I even got <strong>inner joins</strong> working.

<p>Let's start with a few tables:</p>

<pre><code>&lt;table class="users"&gt;
  &lt;tr&gt;
    &lt;td class="id"&gt;1&lt;/td&gt;
    &lt;td class="first_name"&gt;amy&lt;/td&gt;
    &lt;td class="last_name"&gt;bobamy&lt;/td&gt;
  &lt;/tr&gt; 
  ...
&lt;/table&gt;
&lt;table class="photos"&gt;
  &lt;tr&gt;
    &lt;td class="id"&gt;1&lt;/td&gt;
    &lt;td class="user_id"&gt;1&lt;/td&gt;
    &lt;td class="url"&gt;http://www.example.com/foo.png&lt;/td&gt;
  &lt;/tr&gt; 
&lt;/table&gt;
</code></pre>

<p>Now we can express some queries:</p>

<pre><code>$&#40;'.users'&#41;
  .where&#40;'.id:eq&#40;1&#41;'&#41;
  .select&#40;'*'&#41;
</code></pre>

<p>This is equivalent to <code>SELECT * FROM users WHERE id = 1</code></p>

<pre><code>$&#40;'.users'&#41;
  .where&#40;'.id:eq&#40;1&#41;'&#41;
  .select&#40;'.id, .name'&#41;
</code></pre>

<p>This is equivalent to <code>SELECT id, name FROM users WHERE id = 1</code><br />
</blockquote></p>

<p>How cool is that? Check out Nick's blog post for an example of text search and an inner join. The API in his jquery.db.js is quite straightforward and only about 50 lines of code. Adding a sort function shouldn't be too difficult. </p>

<p>I'm pretty much convinced now that jQuery is black magic.</p>

<p><br />
<a href="http://pivots.pivotallabs.com/users/nick/blog/articles/434-now-i-understand-what-they-mean-by-tabular-data-or-building-a-relational-database-using-jquery-and-lt-table-gt-tags-">Building a relational database using jQuery and &lt;TABLE&gt; tags</a><br />
<a href="http://github.com/nkallen/jquery-database/tree/master">Download the jquery.db.js library</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/04/relational_database_using_jque.html?CMP=OTC-7G2N43923558</guid>
<category>Ajax</category>
<pubDate>Tue, 08 Apr 2008 22:02:21 -0800</pubDate>

</item>

<item>
<title>CSS ad blocking for Firefox and Safari</title>
<itunes:summary>Using Firefox&apos;s CSS-based chrome feature or Safari&apos;s advanced stylesheet preferences and a little clever CSS coding, you can disable most banner ads, making them invisible in your browser. This technique is considerably easier and more flexible than setting up a...</itunes:summary>
<description>
<![CDATA[<p>Using Firefox's CSS-based chrome feature or Safari's advanced stylesheet preferences and a little clever CSS coding, you can disable most banner ads, making them invisible in your browser. This technique is considerably easier and more flexible than setting up a private DNS server or proxy to filter out images from ad-serving domains.</p>

<p>The trick is setting up a number of CSS rules that use "*=" substring selection on an element's properties. For instance, matching an IFRAME tag with the SRC parameter containing doubleclick would look like <code>IFRAME[SRC*="doubleclick"]</code> and matching an anchor tag with an HREF containing a url with "ads." in it would look like <code>A:link[HREF*="ads."]</code>. Giving the style "display: none ! important" to all of the possible combinations and adding the stylesheet to your browser's chrome effectively turns off the ad-serving web. The site below has a comprehensive CSS file that's been tailored to assassinate ads from most networks.</p>

<p>To be honest, I didn't realize that you could do this type of parameter matching and subselection in CSS, so it's worth looking at the CSS source for that alone.  If you don't use it for this purpose, perhaps the technique will come in handy for something else you are working on.</p>

<p><a href="http://www.floppymoose.com/">Better Ad Blocking for Firefox, Mozilla, Camino, and Safari</a><br />
<a href="http://www.floppymoose.com/userContent.css">Ad Blocking userContent.css</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/css_ad_blocking_for_firefox_an.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/css_ad_blocking_for_firefox_an.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/css_ad_blocking_for_firefox_an.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/css_ad_blocking_for_firefox_an.html?CMP=OTC-7G2N43923558</guid>
<category>Firefox</category>
<pubDate>Fri, 28 Mar 2008 21:20:26 -0800</pubDate>

</item>

<item>
<title>Design Coding: web standards rap</title>
<itunes:summary> Next time you&apos;re trying to explain the importance of web standards in modern web design and development, just let this video do the talking for you. The Poetic Prophet (AKA The SEO Rapper) is back with another marketing rap....</itunes:summary>
<description>
<![CDATA[<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/a0qMe7Z3EYg&rel=0&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/a0qMe7Z3EYg&rel=0&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="500" height="400"></embed></object></p>

<p>Next time you're trying to explain the importance of web standards in modern web design and development, just let this video do the talking for you.</p>

<blockquote>The Poetic Prophet (AKA The SEO Rapper) is back with another marketing rap. This time he describes how web standards and proper design can affect the ranking and conversion of pages on your site.</blockquote>

<p>I know this isn't the usual fare here, but I feel I'd be remiss in my duties if I didn't include it in our compendium of all things hack.</p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/design_coding_web_standards_ra.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/design_coding_web_standards_ra.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/design_coding_web_standards_ra.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/design_coding_web_standards_ra.html?CMP=OTC-7G2N43923558</guid>
<category>YouTube</category>
<pubDate>Fri, 28 Mar 2008 20:00:00 -0800</pubDate>

</item>

<item>
<title>Easiest cross-browser CSS min-height</title>
<itunes:summary>Enforcing a minimum height for block elements in HTML is one of those few CSS tricks that you can&apos;t live without. There are still enough folks using IE6, unfortunately, and it doesn&apos;t support the min-height or min-width CSS parameters. This...</itunes:summary>
<description>
<![CDATA[<p>Enforcing a minimum height for block elements in HTML is one of those few CSS tricks that you can't live without.  There are still enough folks using IE6, unfortunately, and it doesn't support the min-height or min-width CSS parameters. This has caused the invention of a number of different hacks and browser-conditional style sheets to get the desired effect. </p>

<p>Many of the different methods work well, but after trying a number of them, I can say that the following method is the easiest to use and is compatable across all common versions of Firefox, Safari, and IE. Many of you are probably already using this method&mdash;it's not new&mdash;but for those of you who aren't, give it a try. It should save you a lot of headaches.</p>

<p><strong>Cross Browser min-height</strong><br />
<blockquote><code>.foo {<br />
   min-height:100px;<br />
   height: auto !important;<br />
   height: 100px;<br />
}</code></blockquote></p>

<p>This works because all of the more recent browsers will understand and respect the min-height setting as well as the !important designation. So in the example above, the block will be given the min-height setting you specify, and the height:auto will take precendence over the height:100px, even though it appears earlier in the code. With content shorter than 100px, the min-height setting is observed, and with content that is longer, the block is sized to fit the content.</p>

<p>In the case of older versions of IE, neight the min-height parameter nor the !important designation are supported. Instead, the browser essentially sees a height:auto, immediately followed by a height:100px, and the latter takes precendence. Lucky for us, height parameter in older versions of IE function exactly like the min-height parameter. When content expands past the size of the element, it grows to accommodate it. When content is shorter, the specified height is respected.</p>

<p>I don't find myself using it as much, but this also works with min-width:</p>

<p><strong>Cross Browser min-width</strong><br />
<blockquote><code>.bar {<br />
   min-width:100px;<br />
   width: auto !important;<br />
   width: 100px;<br />
}</code></blockquote></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/easiest_crossbrowser_css_minhe.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/03/easiest_crossbrowser_css_minhe.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/03/easiest_crossbrowser_css_minhe.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/03/easiest_crossbrowser_css_minhe.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Fri, 21 Mar 2008 20:31:39 -0800</pubDate>

</item>

<item>
<title>Botanicalls Twitter: flora tweets</title>
<itunes:summary> With Monday finally wrapping up, it&apos;s time to start thinking about next weekend. Why not spend it Twitter-enabling your house plants? Botanicalls Twitter answers the question: What&apos;s up with your plant? It offers a connection to your leafy pal...</itunes:summary>
<description>
<![CDATA[<p><img alt="botanicalls_20080225.jpg" src="http://www.hackszine.com/botanicalls_20080225.jpg" width="500" height="308" /></p>

<p>With Monday finally wrapping up, it's time to start thinking about next weekend. Why not spend it Twitter-enabling your house plants?</p>

<blockquote>Botanicalls Twitter answers the question: What's up with your plant? It offers a connection to your leafy pal via online Twitter status updates that reach you anywhere in the world. When your plant needs water, it will post to let you know, and send its thanks when you show it love.</blockquote>

<p>I've managed to make it through the winter with only two plant casualties so far. There isn't a whole lot I can do about the scarcity of light in Minneapolis, but with a little Arduino hacking I could at least remove watering issues from the equation.</p>

<p>Botanicalls Twitter - <a href="http://www.botanicalls.com/twitter/">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/botanicalls_twitter_flora_twee.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/botanicalls_twitter_flora_twee.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/02/botanicalls_twitter_flora_twee.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/02/botanicalls_twitter_flora_twee.html?CMP=OTC-7G2N43923558</guid>
<category>Electronics</category>
<pubDate>Mon, 25 Feb 2008 20:42:45 -0800</pubDate>

</item>

<item>
<title>Nifty Corners: roundtangles made simple</title>
<itunes:summary> Since the border-radius CSS parameter has been too slow in coming and rounded corners don&apos;t seem to be going out of style any time soon, everyone web developer I know has their own personal brand of CSS background-image and...</itunes:summary>
<description>
<![CDATA[<p><img alt="niftycorners_20080214.gif" src="http://www.hackszine.com/niftycorners_20080214.gif" width="500" height="445" /></p>

<p>Since the border-radius CSS parameter has been too slow in coming and rounded corners don't seem to be going out of style any time soon, everyone web developer I know has their own personal brand of CSS background-image and DIV gymnastics for creating smooth-cornered roundtangles. Besides the extra load time that's required to download all those corner images, it's just a lot of extra work. The general principle of unnecessary work is against my slacker sensibilities, which is why the Nifty Corners Cube javascript library caught my attention.</p>

<p>Nifty Corners uses Javascript to dynamically add rounded corners to HTML elements at runtime, without the use of images. You can choose a corner style and tell Nifty Corners what CSS id, class or element to apply it to. The javascript function will dynamically alter the specified elements, drawing 1px high DIV strips at the top and bottom of the element to give it the rounded corners. The effect can be used for everything from rounded content areas to tab-menus.</p>

<p>It won't solve every problem&mdash;rounded borders, in particular, are still a bit of a nuisance&mdash;but it'll make your work a lot easier for many design challenges and it's compatible with Firefox, Safari and IE 5.5-7.0.</p>

<p>Nifty Corners Cube - <a href="http://www.html.it/articoli/niftycube/index.html">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/nifty_corners_roundtangles_mad.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/nifty_corners_roundtangles_mad.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/02/nifty_corners_roundtangles_mad.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/02/nifty_corners_roundtangles_mad.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Thu, 14 Feb 2008 20:57:26 -0800</pubDate>

</item>

<item>
<title>HOWTO: cross-browser alpha PNGs</title>
<itunes:summary><![CDATA[ If you're a web designer, here's a tool that's going to make your life a lot better. Seriously, in no time you'll be dropping shadows like Galileo dropped the orange. Transparent GIFs only have a single bit of transparency&mdash;a...]]></itunes:summary>
<description>
<![CDATA[<p><img alt="bulb_png24-nq8.png" src="http://www.hackszine.com/bulb_png24-nq8.png" width="500" height="250" /></p>

<p>If you're a web designer, here's a tool that's going to make your life a lot better. Seriously, in no time you'll be dropping shadows like Galileo dropped the orange.</p>

<p>Transparent GIFs only have a single bit of transparency&mdash;a pixel is either totally transparent, or it's completely opaque. 24 bit PNG images, on the other hand, have a bona fide alpha channel, allowing your images to have a full range of transparency. Problem is, they have poor browser support in IE.</p>

<p>The indexed PNG 8 format is similar to the GIF format, and I had always thought that it only allowed boolean transparency. It turns out the PNG 8 format is a little more clever. You still have a 256 color index palette like the GIF format, but the format allows for each index to have its own transparency level, and that level can be set at any amount of opacity!</p>

<p>Here's the real kicker. Even old versions of IE support the PNG 8 format to some degree. So on Firefox, Safari, and IE 7 you can have full alpha support without using any of the quirky IE specific PNG hacks. Older versions of IE will still display your alpha PNGs, but they will revert to a GIF-like all or nothing transparency. Any portion of the image which is semi-transparent will be forced to fully transparent. </p>

<p>To sum it up, the PNG8 alpha format gives you complete cross browser alpha transparency for all modern browsers, and it degrades gracefully for older versions of IE that some people may still be using. As an example, the image above is a semi-transparent PNG8. Most of you will see the blue gradient fade around the edge of the light bulb. Those of you with older versions of IE will see a hard edge around the bulb, similar to what you'd get with a GIF.</p>

<p><b>Correction:</b> my example is a little goofed, as the blue in the image obtained a partial transparency during the quantization process. IE users will only see some of the bottom portion of the bulb, specifically colors that didn't match the transparent portion in the RGB space. For normal drop-shadow overlays, this does not usually pose a problem. Remember, though, that converting to PNG8 means bringing thousands of color and alpha values down to 256.  If your solid colors get mapped to a partially transparent index, they will disappear in older versions of IE.</p>

<p>A coworker introduced me to this today and showed me how Fireworks has an export option for PNG 8 that enables this full-alpha mode. I hadn't been aware of it, because Photoshop has no such feature, only allowing GIF-like transparency for 8 bit PNGs. Unfortunately, I really <strike>hate hate</strike> have a hard time with Fireworks, and I don't want to purchase it.</p>

<p>A little searching, though, and I found pngnq, a command line tool that will quantize a PNG24 image into a 256 color PNG8 image with alpha transparency. Here's how you use it:</p>

<ol><li>Export ("save for web" in Photoshop) your image in the RGBA PNG-24 format</li><li>At the command line, run "<code>pngnq filename.png</code>"</li><li>The image will be converted and the output named filename-nq8.png</li></ol>

<p>To install pngnq, just grab the binary from the link below and copy the pngnq executable to somewhere in your path. In OS X, you can put it in /usr/local/bin and add that to your PATH variable (or just toss it it /usr/bin). The program requires the libpng library in order to run. This isn't pre-installed on a Mac for some reason, so you'll have to build it from source, use Fink, or use the installer at the site conveniently listed below.</p>

<p>pngnq - <a href="http://pngnq.sourceforge.net/index.html">Link</a><br />
libpng installer for OS X - <a href="http://ethan.tira-thompson.com/Mac%20OS%20X%20Ports.html">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/howto_crossbrowser_alpha_pngs.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/02/howto_crossbrowser_alpha_pngs.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/02/howto_crossbrowser_alpha_pngs.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/02/howto_crossbrowser_alpha_pngs.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Fri, 08 Feb 2008 21:51:11 -0800</pubDate>

</item>

<item>
<title>ie7.js: Force Internet Explorer to behave</title>
<itunes:summary>IE7 is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6. This is great. By adding the ie7.js script...</itunes:summary>
<description>
<![CDATA[<blockquote>IE7 is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.</blockquote>

<p>This is great. By adding the ie7.js script to your site code, you effectively force all older browser versions to function as IE7 does.  Now that IE7 is out, there's a second script (you guessed it: ie8.js) that brings IE7 clients almost completely up to standards-spec. </p>

<p>If you're a web developer, you know how frustrating it can be to get things to display correctly in all browsers. Instead of resorting to trial-and-error methods and applying various random hacks to make things work, these javascript libraries have condensed all of the necessary hacks into a single library, so you can code normally and pretend they don't even exist. As MS releases product updates, you can get the latest javascript library and put it in place without too much worry about having to tweak your site to make it render properly in newer browser versions.</p>

<p>ie7-js: Make MSIE behave like a standards-compliant browser - <a href="http://code.google.com/p/ie7-js/">Link</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/01/ie7js_force_internet_explorer.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/01/ie7js_force_internet_explorer.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/01/ie7js_force_internet_explorer.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/01/ie7js_force_internet_explorer.html?CMP=OTC-7G2N43923558</guid>
<category>Web</category>
<pubDate>Sun, 20 Jan 2008 18:54:56 -0800</pubDate>

</item>


</channel>
</rss>