<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>keeping track of what i’m learning</description><title>what i've learned</title><generator>Tumblr (3.0; @andrewtrusty)</generator><link>http://log.andrewtrusty.com/</link><item><title>csc309 webserver &amp; javascript cookies</title><description>&lt;p&gt;&lt;b&gt;Here is the pickling and cookie webserver example using &lt;a href="http://webpy.org"&gt;webpy&lt;/a&gt; that I presented in tutorial:&lt;/b&gt; &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre&gt;#!/usr/bin/env python

import os
import web
from pickle import load, dump

urls = (
    '/', 'Index'
)
app = web.application(urls, globals())

# global session store &amp;amp; session id 
SESSION_COUNT = 0
SESSIONS = {}


# methods to save &amp;amp; load data to files to persist
# session changes across restarts &amp;amp; crashes
data_fn = 'data.pkl'
def save_data():
    fp = open(data_fn, 'w')
    dump( (SESSIONS, SESSION_COUNT) , fp)
    fp.close()
def load_data():    
    if not os.path.isfile(data_fn): return
    global SESSIONS, SESSION_COUNT
    fp = open(data_fn, 'r')
    SESSIONS, SESSION_COUNT = load(fp)
    fp.close()

# restore our session data
load_data()

def parse_cookies():
    cookies_str = web.ctx.env['HTTP_COOKIE']&lt;br/&gt;    return dict([ c.strip().split('=')&lt;br/&gt;                  for c in cookies_str.split(';')])&lt;br/&gt;&lt;br/&gt;class Index(object):&lt;br/&gt;    def GET(self):&lt;br/&gt;        web.header('Content-Type','text/html')&lt;br/&gt;&lt;br/&gt;        session = {}&lt;br/&gt;&lt;br/&gt;        # see if the user has our cookie already&lt;br/&gt;        if 'HTTP_COOKIE' in web.ctx.env:&lt;br/&gt;            cookies = parse_cookies()&lt;br/&gt;            for name, val in cookies.items():&lt;br/&gt;                web.debug('got cookie: %s = %s' % (name, val))&lt;br/&gt;&lt;br/&gt;            # grab the session based on the user's cookie&lt;br/&gt;            if 'session_id' in cookies:&lt;br/&gt;                web.debug('got session id')&lt;br/&gt;                session = SESSIONS[cookies['session_id']]&lt;br/&gt;&lt;br/&gt;        # check if we got a session, if not create a new one&lt;br/&gt;        if not session:&lt;br/&gt;            web.debug('missing session, creating new session')&lt;br/&gt;            global SESSION_COUNT&lt;br/&gt;            expires_date = 'Fri, 11-Dec-2010 11:59:59 GMT'&lt;br/&gt;            web.header('Set-Cookie', 'session_id=%s;'&lt;br/&gt;                        ' expires=%s;'&lt;br/&gt;                        % (expires_date, SESSION_COUNT))&lt;br/&gt;            SESSIONS[str(SESSION_COUNT)] = session&lt;br/&gt;            SESSION_COUNT += 1&lt;br/&gt;&lt;br/&gt;        # update the session&lt;br/&gt;        session['visits'] = session.setdefault('visits', 0)+1&lt;br/&gt;        save_data()&lt;br/&gt;&lt;br/&gt;        return (str(web.ctx.env) + &lt;br/&gt;                " You've visited %s times!"&lt;br/&gt;                % session['visits'])&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;    def POST(self):&lt;br/&gt;        self.GET()&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;if __name__ == "__main__":&lt;br/&gt;    # run the webserver    &lt;br/&gt;    app.run()&lt;br/&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;And here is the example of using cookies in Javascript:&lt;/b&gt; &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre&gt;// Cookies in Javascript

// The manual (tedious) way to set a cookie
document.cookie = ‘ppkcookie1=testcookie;' +&lt;br/&gt;    ' expires=Thu, 2 Aug 2010 20:47:11 UTC; path=/’;

// The easy way
// from &lt;a href="http://www.quirksmode.org/js/cookies.html"&gt;http://www.quirksmode.org/js/cookies.html&lt;/a&gt;

// if days == 0, the cookie expires when&lt;br/&gt;// the user closes their browser
function createCookie(name,value,days) {
    if (days) {
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = “; expires=”+date.toGMTString();
    } else var expires = “”;
    document.cookie = name+”=”+value+expires+”; path=/”;
}

function readCookie(name) {
    var nameEQ = name + “=”;
    var ca = document.cookie.split(‘;’);
    for(var i=0;i &amp;lt; ca.length;i++) {
	var c = ca[i];
	while (c.charAt(0)==’ ‘) c = c.substring(1,c.length);
	if (c.indexOf(nameEQ) == 0) {&lt;br/&gt;            return c.substring(nameEQ.length,c.length);
        }&lt;br/&gt;    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,”“,-1);
}
&lt;/pre&gt;</description><link>http://log.andrewtrusty.com/post/386030498</link><guid>http://log.andrewtrusty.com/post/386030498</guid><pubDate>Fri, 12 Feb 2010 16:26:15 -0500</pubDate></item><item><title>find files in linux by modification time</title><description>&lt;a href="http://www.hcidata.info/find.htm"&gt;find files in linux by modification time&lt;/a&gt;</description><link>http://log.andrewtrusty.com/post/183079230</link><guid>http://log.andrewtrusty.com/post/183079230</guid><pubDate>Tue, 08 Sep 2009 16:55:36 -0400</pubDate></item><item><title>upgrading Ubuntu 8.04 to 8.10 to 9.04</title><description>&lt;p&gt;I finally upgraded Ubuntu on my IBM T43 laptop.  I was waiting for 9.04 because I heard lots of problems about the 8.04 to 8.10 upgrade process but then I found out I had to upgrade to 8.10 before I could get to 9.04 - so it goes.&lt;/p&gt;
&lt;p&gt;The upgrade went smoother than my previous one though.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Sound:&lt;/b&gt;&lt;br/&gt;sound stopped working but I was expecting this because PulseAudio caused this in the previous upgrade, luckily I found this tutorial on &lt;a href="http://idyllictux.wordpress.com/2009/04/21/ubuntu-904-jaunty-keeping-the-beast-pulseaudio-at-bay/"&gt;keeping the PulseAudio beast at bay&lt;/a&gt; which worked like a charm.  Sadly, I no longer have on screen volume indicators when I change the volume using the extra keyboard keys but apparently this is &lt;a href="https://bugs.launchpad.net/ubuntu/+source/hal/+bug/359478"&gt;a known issue&lt;/a&gt; and its a very minor annoyance.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Graphics:&lt;br/&gt;&lt;/b&gt;All my Compiz settings seem to have been reset but that should only take a minute to re-configure.  Also my text rendering settings were reset and everything looked too sharp and pixelated until I re-activated sub-pixel smoothing.  On the plus side, I&amp;#8217;m getting all the fancy effects without the proprietary ATI driver warning (I think they open-sourced their driver some time ago).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Networking:&lt;br/&gt;&lt;/b&gt;Wireless didn&amp;#8217;t work at first because apparently madwifi is a restricted driver now that I had to activate manually.  This took me a minute to figure out since there was not auto-notification of this.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Firefox:&lt;br/&gt;&lt;/b&gt;Firefox went from 3.0.8 to 3.0.10 and all my sessions and extensions seemed to survive perfectly except &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5447"&gt;Tabkit&lt;/a&gt; which now won&amp;#8217;t do its awesome hierarchical tab display or event the multi-row tab display.  This is by far the most annoying issue since I&amp;#8217;ve become addicted to hierarchical tabs.  I also had to re-install Flash player and I couldn&amp;#8217;t get the auto-prompted installer to work so I had to download the debian package direct from Adobe and run it.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Hibernation &amp;amp; Sleeping&lt;/b&gt; are finally working again.&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/101438372</link><guid>http://log.andrewtrusty.com/post/101438372</guid><pubDate>Wed, 29 Apr 2009 08:49:00 -0400</pubDate></item><item><title>electric bikes review</title><description>&lt;p&gt;&lt;img alt="Optibike 850XLi $10k" src="http://shop.optibike.com/images/stories/850XLi-145.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;there are lots of interesting electric bikes.  i found a good comparison at &lt;a href="http://www.electricvehiclesnw.com/main/ebike-comp.htm"&gt;http://www.electricvehiclesnw.com/main/ebike-comp.htm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;i like the following models:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Giant Twist DX &amp;amp; Twist Lite - $2,100 &amp;amp; $1,700&lt;/li&gt;
&lt;li&gt;eZee Forza - $2,200&lt;/li&gt;
&lt;li&gt;iZip - one of the cheaper ones at $600 because it uses SLA and not Lithium Ion batteries which are cheaper and shorter lasting and heavier&lt;/li&gt;
&lt;li&gt;Optibike - the 850XLi is a $10k monster although they have some lower end models (&lt;a href="http://shop.optibike.com/"&gt;http://shop.optibike.com/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;also an interesting folding bike, the &lt;a href="http://www.ecobike-usa.com/products/vatavio-folding-electric-bike.asp"&gt;EcoBike Vatavio&lt;/a&gt; at around $1,500&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;br/&gt;i prefer the Lithium Ion models that look like normal bikes&lt;br/&gt;&lt;br/&gt;also read that electric bike motors limited to 20mph by US regulations.. what a shame&lt;br/&gt;&lt;br/&gt;there are also a number of kits to turn your normal bikes into electric bikes&lt;br/&gt;one of the more innovative ones seems to be the StokeMonkey (&lt;a href="http://cleverchimp.com/products/stokemonkey/"&gt;http://cleverchimp.com/products/stokemonkey/&lt;/a&gt;)&lt;br/&gt;&lt;br/&gt;treehugger shows off some of the bigger, faster, more expensive electric scooters:&lt;br/&gt;&lt;a href="http://www.treehugger.com/files/2008/06/7-best-electric-scooters-prototypes-production-models.php"&gt;http://www.treehugger.com/files/2008/06/7-best-electric-scooters-prototypes-production-models.php&lt;/a&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/98187096</link><guid>http://log.andrewtrusty.com/post/98187096</guid><pubDate>Mon, 20 Apr 2009 12:45:00 -0400</pubDate></item><item><title>Basic XSL &amp; Ajax Tutorial</title><description>&lt;p&gt;Some simple programming examples of XSL &amp;amp; AJAX:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;XSL&lt;/b&gt; (eXtensible Stylesheet Language) (see &lt;a href="http://www.w3schools.com/xsl/"&gt;http://www.w3schools.com/xsl/&lt;/a&gt; )&lt;br/&gt;XSL is a style sheet language for XML documents.  It describes how to display an XML document of a given type, so in a way it is similar to CSS but it adds a transformation language for XML documents called XSLT which is most often used to transform XML data into HTML but can transform between any two XML representations.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Example XML Data:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version=&amp;#8221;1.0&amp;#8221; encoding=&amp;#8221;ISO-8859-1&amp;#8221;?&amp;gt;&lt;br/&gt;&amp;lt;?xml-stylesheet type=&amp;#8221;text/xsl&amp;#8221; href=&amp;#8221;cdcatalog.xsl&amp;#8221;?&amp;gt;&lt;br/&gt;&amp;lt;catalog&amp;gt;&lt;br/&gt; &amp;lt;cd&amp;gt;&lt;br/&gt; &amp;lt;title&amp;gt;Empire Burlesque&amp;lt;/title&amp;gt;&lt;br/&gt; &amp;lt;artist&amp;gt;Bob Dylan&amp;lt;/artist&amp;gt;&lt;br/&gt; &amp;lt;country&amp;gt;USA&amp;lt;/country&amp;gt;&lt;br/&gt; &amp;lt;company&amp;gt;Columbia&amp;lt;/company&amp;gt;&lt;br/&gt; &amp;lt;price&amp;gt;10.90&amp;lt;/price&amp;gt;&lt;br/&gt; &amp;lt;year&amp;gt;1985&amp;lt;/year&amp;gt;&lt;br/&gt; &amp;lt;/cd&amp;gt;&lt;br/&gt;.&lt;br/&gt;.&lt;br/&gt;&amp;lt;/catalog&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;b&gt;Example XSL Template (XSLT):&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;?xml version=&amp;#8221;1.0&amp;#8221; encoding=&amp;#8221;ISO-8859-1&amp;#8221;?&amp;gt;&lt;br/&gt;&amp;lt;xsl:stylesheet version=&amp;#8221;1.0&amp;#8221;&lt;br/&gt;xmlns:xsl=&amp;#8221;http://www.w3.org/1999/XSL/Transform&amp;#8221;&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xsl:template match=&amp;#8221;/&amp;#8221;&amp;gt;&lt;br/&gt; &amp;lt;html&amp;gt;&lt;br/&gt; &amp;lt;body&amp;gt;&lt;br/&gt; &amp;lt;h2&amp;gt;My CD Collection&amp;lt;/h2&amp;gt;&lt;br/&gt; &amp;lt;table border=&amp;#8221;1&amp;#8221;&amp;gt;&lt;br/&gt; &amp;lt;tr bgcolor=&amp;#8221;#9acd32&amp;#8221;&amp;gt;&lt;br/&gt; &amp;lt;th align=&amp;#8221;left&amp;#8221;&amp;gt;Title&amp;lt;/th&amp;gt;&lt;br/&gt; &amp;lt;th align=&amp;#8221;left&amp;#8221;&amp;gt;Artist&amp;lt;/th&amp;gt;&lt;br/&gt; &amp;lt;/tr&amp;gt;&lt;br/&gt; &amp;lt;xsl:for-each select=&amp;#8221;catalog/cd&amp;#8221;&amp;gt;&lt;br/&gt; &amp;lt;tr&amp;gt;&lt;br/&gt; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&amp;#8221;title&amp;#8221;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt; &amp;lt;td&amp;gt;&amp;lt;xsl:value-of select=&amp;#8221;artist&amp;#8221;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br/&gt; &amp;lt;/tr&amp;gt;&lt;br/&gt; &amp;lt;/xsl:for-each&amp;gt;&lt;br/&gt; &amp;lt;/table&amp;gt;&lt;br/&gt; &amp;lt;/body&amp;gt;&lt;br/&gt; &amp;lt;/html&amp;gt;&lt;br/&gt;&amp;lt;/xsl:template&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Example Output: &lt;/b&gt;&lt;a href="http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml"&gt;http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;(examples from  &lt;a href="http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml"&gt;http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;In the exapmle above, the browser automatically converts xml into html.  Typically, you would convert it yourself on the server side in Java or on the client side with Javascript.&lt;br/&gt; on client: &lt;a href="http://www.w3schools.com/xsl/xsl_client.asp"&gt;http://www.w3schools.com/xsl/xsl_client.asp&lt;/a&gt;&lt;br/&gt; on server: &lt;a href="http://www.w3schools.com/xsl/xsl_server.asp"&gt;http://www.w3schools.com/xsl/xsl_server.asp&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;AJAX&lt;/b&gt; (Asynchronous Javascript And Xml)  (see &lt;a href="http://www.w3schools.com/Ajax/default.asp"&gt;http://www.w3schools.com/Ajax/default.asp&lt;/a&gt; )&lt;br/&gt;AJAX allows you to get responses from the webserver without reloading the page.  It can be used asynchronously or synchronously (asynch is best, define a handler function).  Useful for form submission, live updates, changing page content on actions.  It is quicker than page reloads because you send less data over the wire, you only have to load some parts of the page once and the rest can be fetched via AJAX.  But be wary of breaking browser history and the back button which work by default with page reloads but require extra effort to work properly with AJAX.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;AJAX Example:&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;html&amp;gt;&lt;br/&gt;&amp;lt;body&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;script type=&amp;#8221;text/javascript&amp;#8221;&amp;gt;&lt;br/&gt;function ajaxFunction() {&lt;br/&gt; // cross browser compatible XMLHttpRequest creation&lt;br/&gt; var xmlHttp;&lt;br/&gt; try {&lt;br/&gt; // Firefox, Opera 8.0+, Safari&lt;br/&gt; xmlHttp=new XMLHttpRequest();&lt;br/&gt; } catch (e) {&lt;br/&gt; // Internet Explorer&lt;br/&gt; try {&lt;br/&gt; xmlHttp=new ActiveXObject(&amp;#8220;Msxml2.XMLHTTP&amp;#8221;);&lt;br/&gt; } catch (e) {&lt;br/&gt; try {&lt;br/&gt; xmlHttp=new ActiveXObject(&amp;#8220;Microsoft.XMLHTTP&amp;#8221;);&lt;br/&gt; } catch (e) {&lt;br/&gt; alert(&amp;#8220;Your browser does not support AJAX!&amp;#8221;);&lt;br/&gt; return false;&lt;br/&gt; }&lt;br/&gt; }&lt;br/&gt; }&lt;br/&gt; // setup handler on success&lt;br/&gt; xmlHttp.onreadystatechange = function() {&lt;br/&gt; if(xmlHttp.readyState == 4) {&lt;br/&gt; document.myForm.time.value = xmlHttp.responseText;&lt;br/&gt; }&lt;br/&gt; }&lt;br/&gt; // set request parameters (similar to form tag parameters)&lt;br/&gt; xmlHttp.open(&amp;#8220;GET&amp;#8221;,&amp;#8221;time.asp&amp;#8221;,true); // 3rd is asynch&lt;br/&gt; xmlHttp.send(null); // null because we aren&amp;#8217;t using POST data&lt;br/&gt;}&lt;br/&gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;form name=&amp;#8221;myForm&amp;#8221;&amp;gt;&lt;br/&gt;Name: &amp;lt;input type=&amp;#8221;text&amp;#8221;&lt;br/&gt;onkeyup=&amp;#8221;ajaxFunction();&amp;#8221; name=&amp;#8221;username&amp;#8221; /&amp;gt;&lt;br/&gt;Time: &amp;lt;input type=&amp;#8221;text&amp;#8221; name=&amp;#8221;time&amp;#8221; /&amp;gt;&lt;br/&gt;&amp;lt;/form&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;&amp;lt;/html&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Or if you use jQuery:  &lt;a href="http://docs.jquery.com/Ajax/jQuery.ajax"&gt;http://docs.jquery.com/Ajax/jQuery.ajax&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;function ajaxFunction() {&lt;br/&gt; $.ajax({&lt;br/&gt; type:&amp;#8217;GET&amp;#8217;, &lt;br/&gt; url:&amp;#8217;time.asp&amp;#8217;,&lt;br/&gt; success: function(responseText) {&lt;br/&gt; document.myForm.time.value = responseText;&lt;br/&gt; }&lt;br/&gt; });&lt;br/&gt;}&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/94672763</link><guid>http://log.andrewtrusty.com/post/94672763</guid><pubDate>Thu, 09 Apr 2009 19:24:29 -0400</pubDate></item><item><title>csc309 tomcat &amp; js cookies</title><description>&lt;p&gt;&lt;b&gt;# Using Tomcat&lt;br/&gt;&lt;/b&gt;&lt;i&gt;# the following are commands to run on cdf&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;# download Tomcat&lt;/i&gt;&lt;br/&gt;wget &lt;a href="http://apache.sunsite.ualberta.ca/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz"&gt;http://apache.sunsite.ualberta.ca/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz&lt;/a&gt;&lt;br/&gt;tar xzf apache-tomcat-6.0.18.tar.gz&lt;br/&gt;&lt;br/&gt;&lt;i&gt;# configure Tomcat&lt;/i&gt;&lt;br/&gt;cd apache-tomcat-6.0.18&lt;br/&gt;pico conf/server.xml&lt;br/&gt;# change 8080&amp;#8217;s to your assigned port number&lt;br/&gt;&lt;br/&gt;&lt;i&gt;# run Tomcat&lt;/i&gt;&lt;br/&gt;bash&lt;br/&gt;export JAVA_HOME=/local/packages/jdk1.6.0_07/&lt;br/&gt;bin/startup.sh&lt;br/&gt;&lt;i&gt;# view http://localhost:PORT_NUMBER/ in your browser on cdf to test that it works&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;i&gt;# get a sample application&lt;/i&gt;&lt;br/&gt;cd webapps&lt;br/&gt;wget &lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war"&gt;http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war&lt;/a&gt;&lt;br/&gt;&lt;i&gt;# view http://localhost:PORT_NUMBER/sample in your browser on cdf to test that the sample app works&lt;/i&gt;&lt;br/&gt;cd ../&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;i&gt;# stop Tomcat&lt;/i&gt;&lt;br/&gt;bin/shutdown.sh&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;// Cookies in Javascript&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;&lt;i&gt;// The manual (tedious) way to set a cookie&lt;/i&gt;&lt;br/&gt;document.cookie = &amp;#8216;ppkcookie1=testcookie; expires=Thu, 2 Aug 2010&amp;#160;20:47:11 UTC; path=/&amp;#8217;;&lt;br/&gt;&lt;br/&gt;&lt;i&gt;// The easy way&lt;br/&gt;// from &lt;a href="http://www.quirksmode.org/js/cookies.html"&gt;http://www.quirksmode.org/js/cookies.html&lt;/a&gt;&lt;br/&gt;&lt;/i&gt;&lt;br/&gt;// if days == 0, cookie expires when the user closes their browser&lt;br/&gt;function &lt;b&gt;createCookie(name,value,days)&lt;/b&gt; {&lt;br/&gt; if (days) {&lt;br/&gt; var date = new Date();&lt;br/&gt; date.setTime(date.getTime()+(days*24*60*60*1000));&lt;br/&gt; var expires = &amp;#8220;; expires=&amp;#8221;+date.toGMTString();&lt;br/&gt; } else var expires = &amp;#8220;&amp;#8221;;&lt;br/&gt; document.cookie = name+&amp;#8221;=&amp;#8221;+value+expires+&amp;#8221;; path=/&amp;#8221;;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;function &lt;b&gt;readCookie(name)&lt;/b&gt; {&lt;br/&gt; var nameEQ = name + &amp;#8220;=&amp;#8221;;&lt;br/&gt; var ca = document.cookie.split(&amp;#8216;;&amp;#8217;);&lt;br/&gt; for(var i=0;i &amp;lt; ca.length;i++) {&lt;br/&gt; var c = ca[i];&lt;br/&gt; while (c.charAt(0)==&amp;#8217; &amp;#8216;) c = c.substring(1,c.length);&lt;br/&gt; if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);&lt;br/&gt; }&lt;br/&gt; return null;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;function &lt;b&gt;eraseCookie(name)&lt;/b&gt; {&lt;br/&gt; createCookie(name,&amp;#8221;&amp;#8220;,-1);&lt;br/&gt;}&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Running Apache&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;see &lt;a href="http://log.andrewtrusty.com/post/76039364/csc309-apache-dhtmlx"&gt;my last tutorial post&lt;/a&gt; for instructions on running Apache&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/85978898</link><guid>http://log.andrewtrusty.com/post/85978898</guid><pubDate>Thu, 12 Mar 2009 19:52:00 -0400</pubDate></item><item><title>how to keep track of your (business) reputation</title><description>&lt;p&gt;&lt;a href="http://www.google.com/alerts"&gt;Google Alerts&lt;/a&gt; - get notified as Google updates its search index&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tweetbeep.com/"&gt;TweetBeep&lt;/a&gt; - get notified as people tweet about you&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.backtype.com/"&gt;BackType&lt;/a&gt; - get notified about comments on blogs and websites&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/85730516</link><guid>http://log.andrewtrusty.com/post/85730516</guid><pubDate>Thu, 12 Mar 2009 00:09:09 -0400</pubDate></item><item><title>django middleware</title><description>&lt;p&gt;might be useful for other wsgi projects&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.http"&gt;conditional GET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.contrib.csrf.middleware"&gt;CSRF protection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.djangoproject.com/en/dev/ref/middleware/#ref-middleware"&gt;others..&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;but are these Django specific..?&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/85213495</link><guid>http://log.andrewtrusty.com/post/85213495</guid><pubDate>Tue, 10 Mar 2009 10:39:55 -0400</pubDate></item><item><title>functional languages i need to check out</title><description>&lt;p&gt;went through the &lt;a href="http://en.wikipedia.org/wiki/Category:Functional_languages"&gt;Wikipedia Category on functional languages&lt;/a&gt; the other week and I found a bunch of interesting languages I want to check out&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Scala_(programming_language)"&gt;Scala&lt;/a&gt; JVM-based, java with less syntax + functional aspects&lt;a href="http://en.wikipedia.org/wiki/Scala_(programming_language)"&gt;&lt;br/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/F_Sharp_(programming_language)"&gt;F#&lt;/a&gt; Microsoft&amp;#8217;s .NET functional language (only interesting to me if the &lt;a href="http://en.wikipedia.org/wiki/Mono_(software)"&gt;Mono&lt;/a&gt; implementation is complete)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Clojure"&gt;Clojure&lt;/a&gt; JVM-based, may be good for concurrent programming&lt;/p&gt;
&lt;p&gt;&lt;a href="http://boo.codehaus.org/"&gt;Boo&lt;/a&gt; python-like .NET language with Mono support&lt;/p&gt;

&lt;p&gt;also stumbled upon some projects to build operating systems with functional languages: &lt;a href="http://www.ninj4.net/kinetic/"&gt;Kinetic&lt;/a&gt;, &lt;a href="http://programatica.cs.pdx.edu/House/"&gt;House&lt;/a&gt;, &lt;a href="http://research.microsoft.com/en-us/projects/singularity/"&gt;Singularity&lt;/a&gt; (found a Squeak one too: &lt;a href="http://wiki.squeak.org/squeak/1762"&gt;SqueakNOS&lt;/a&gt;)&lt;a href="http://wiki.squeak.org/squeak/1762"&gt;&lt;br/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;maybe someday we&amp;#8217;ll be running operating systems without side effects :P&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/85017914</link><guid>http://log.andrewtrusty.com/post/85017914</guid><pubDate>Mon, 09 Mar 2009 19:04:19 -0400</pubDate></item><item><title>continuation based web frameworks</title><description>&lt;p&gt;only the cool languages have them :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.seaside.st/"&gt;Seaside for Smalltalk / Squeak&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://docs.plt-scheme.org/continue/index.html"&gt;Continue for PLT Scheme&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://common-lisp.net/project/cl-weblocks/"&gt;Weblocks for Lisp&lt;br/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://common-lisp.net/project/ucw/"&gt;UnCommon Web for Common Lisp&lt;/a&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/85000457</link><guid>http://log.andrewtrusty.com/post/85000457</guid><pubDate>Mon, 09 Mar 2009 17:56:00 -0400</pubDate></item><item><title>some interesting parts of Python Paste</title><description>&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/debug.fsdiff.html"&gt;directory diffs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/urlmap.html"&gt;mapping urls to different wsgi apps&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/recursive.html"&gt;internal app requests via internal redirects &amp;amp; forwards&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/gzipper.html"&gt;gzipper middleware&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/translogger.html"&gt;log requests in apache log format&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/developer-features.html#authentication"&gt;authentication&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/evalexception.html"&gt;web app exception handling with interactive browser-based debugging&lt;/a&gt; (very cool)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/reloader.html"&gt;file monitor to restart server when code changes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/modules/util.multidict.html"&gt;dictionary that can hold multiple values at each key (multidict)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;framework for testing wsgi &amp;amp; web apps &lt;a href="http://pythonpaste.org/modules/fixture.html"&gt;1&lt;/a&gt; &lt;a href="http://pythonpaste.org/webtest/"&gt;2&lt;/a&gt; &lt;a href="http://pythonpaste.org/testing-applications.html"&gt;3&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/wsgifilter/"&gt;applying filters to wsgi app output&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/wphp/"&gt;run php via wsgi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/waitforit/"&gt;support for intermediate responses to long running requests&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pythonpaste.org/initools/"&gt;yet another ini parser/generator&lt;/a&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/78737895</link><guid>http://log.andrewtrusty.com/post/78737895</guid><pubDate>Mon, 16 Feb 2009 04:42:13 -0500</pubDate></item><item><title>fetching &amp; displaying favicons</title><description>&lt;p&gt;via Google:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.google.com/s2/favicons?domain=www.wired.com"&gt;http://www.google.com/s2/favicons?domain=www.wired.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;produces&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.google.com/s2/favicons?domain=www.wired.com"/&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/77543448</link><guid>http://log.andrewtrusty.com/post/77543448</guid><pubDate>Wed, 11 Feb 2009 15:25:12 -0500</pubDate></item><item><title>csc309 apache &amp; dhtmlx</title><description>&lt;p&gt;to setup apache on cdf:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;grab the apache.tar.gz file from the Student Guide on the course site (there is also an apache.htm page which has instructions similar to these)&lt;/li&gt;
&lt;li&gt;extract apache.tar.gz to your home directory on cdf which creates a folder called apache&lt;/li&gt;
&lt;li&gt;run the apache/bin/start.sh file to start apache (and apache/bin/stop.sh to stop apache before you logout of cdf)&lt;/li&gt;
&lt;li&gt;when prompted use the port you have been assigned, see the CSC309-ports.txt file in the Student Guide&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;and voila! your personal apache server should be running, you can view it in a browser running on cdf at the address:   http://localhost:[your port]/&lt;/p&gt;
&lt;p&gt;the start.sh file you ran set up your apache environment in your home directory, not to be confused with the directories in the apache folder&lt;/p&gt;
&lt;p&gt;so your html/css/js/xml/etc go in the htdocs folder in your home directory&lt;/p&gt;
&lt;p&gt;also, here is the &lt;a href="http://andrewtrusty.com/dhtmlx/example_common.html"&gt;DHTMLX example page&lt;/a&gt; i showed in tutorial for your reference&lt;/p&gt;
&lt;p&gt;(check out my &lt;a href="http://tinyurl.com/csc309-dom-js"&gt;DOM &amp;amp; Javascript post&lt;/a&gt; in case you missed that tutorial)&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/76039364</link><guid>http://log.andrewtrusty.com/post/76039364</guid><pubDate>Thu, 05 Feb 2009 22:25:00 -0500</pubDate></item><item><title>no famous CS blogs?</title><description>&lt;p&gt;thought i might try to expand my horizons by following what famous researchers/professors in CS are thinking and doing via their blogs.  you know Turing Award winners and such&lt;/p&gt;
&lt;p&gt;alas, i could find practically none of them blogging&amp;#8230; sad, the profession that creates the web isn&amp;#8217;t fully utilizing it&lt;/p&gt;
&lt;p&gt;in the end i&amp;#8217;ve subscribed to &lt;a href="http://www.amazon.com/gp/blog/A3W4CUXPE1WFNF"&gt;Mark Guzdial&amp;#8217;s Amazon blog&lt;/a&gt; and i found a number of natural language processing blogs but they didn&amp;#8217;t spark my interest&lt;/p&gt;
&lt;p&gt;anyone know of some blogs that i missed?&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/74830176</link><guid>http://log.andrewtrusty.com/post/74830176</guid><pubDate>Sun, 01 Feb 2009 14:30:59 -0500</pubDate></item><item><title>upgrading Ubuntu Server</title><description>&lt;a href="http://www.ubuntu.com/getubuntu/upgrading"&gt;upgrading Ubuntu Server&lt;/a&gt;: &lt;p&gt;see the section at the bottom of the page for upgrading without the update-manager gui&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/74593125</link><guid>http://log.andrewtrusty.com/post/74593125</guid><pubDate>Sat, 31 Jan 2009 13:10:09 -0500</pubDate></item><item><title>get linux IP address in a shell script</title><description>&lt;a href="http://www.cyberciti.biz/tips/read-unixlinux-system-ip-address-in-a-shell-script.html"&gt;get linux IP address in a shell script&lt;/a&gt;</description><link>http://log.andrewtrusty.com/post/74592740</link><guid>http://log.andrewtrusty.com/post/74592740</guid><pubDate>Sat, 31 Jan 2009 13:08:05 -0500</pubDate></item><item><title>port forwarding with a VirtualBox guest OS</title><description>&lt;a href="http://mydebian.blogdns.org/?p=148"&gt;port forwarding with a VirtualBox guest OS&lt;/a&gt;</description><link>http://log.andrewtrusty.com/post/74592537</link><guid>http://log.andrewtrusty.com/post/74592537</guid><pubDate>Sat, 31 Jan 2009 13:06:44 -0500</pubDate></item><item><title>using screen</title><description>&lt;p&gt;&lt;pre&gt;* screen&lt;br/&gt;  o Run a new screen session&lt;br/&gt;* screen -R&lt;br/&gt;  o Reattach to a previously detatched session&lt;br/&gt;* Ctrl-a c&lt;br/&gt;  o Create a new window.&lt;br/&gt;* Ctrl-a k&lt;br/&gt;  o Kill the current window - after confirmation&lt;br/&gt;* Ctrl-a Ctrl-a&lt;br/&gt;  o Switch to the other window&lt;br/&gt;* Ctrl-a S&lt;br/&gt;  o Split the current window in two.&lt;br/&gt;* Ctrl-a TAB&lt;br/&gt;  o Move between split sections of the screen.&lt;br/&gt;* Ctrl-a A&lt;br/&gt;  o Give the the current window a name.&lt;br/&gt;* Ctrl-a "&lt;br/&gt;  o List all windows - change the window with the arrow keys&lt;/pre&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/74591238</link><guid>http://log.andrewtrusty.com/post/74591238</guid><pubDate>Sat, 31 Jan 2009 13:00:46 -0500</pubDate></item><item><title>basic sed</title><description>&lt;p&gt;file global replace using regex (old_file should not be the same as new_file)&lt;/p&gt;
&lt;blockquote&gt;sed &amp;#8216;s/old/new/; s/old2/new2/&amp;#8217; old_file &amp;gt; new_file&lt;/blockquote&gt;
&lt;p&gt;from &lt;a href="http://www.oracle.com/technology/pub/articles/dulaney_sed.html"&gt;Oracle sed article&lt;/a&gt;&lt;/p&gt;</description><link>http://log.andrewtrusty.com/post/74590411</link><guid>http://log.andrewtrusty.com/post/74590411</guid><pubDate>Sat, 31 Jan 2009 12:54:00 -0500</pubDate></item><item><title>git &amp; github</title><description>&lt;p&gt;clone a repository to work on locally&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git clone git://github.com/user/project.git&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;add a repository for pushing &amp;amp; pulling&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git remote add &amp;lt;repo alias&amp;gt; git://github.com/user/project.git&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;see available repositories&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git remote&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;pull changes from another repository&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git pull &amp;lt;repo alias&amp;gt; &amp;lt;branch&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;commit changes, auto-adding changed files&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git commit -a -m &amp;#8220;comment&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;push changes to my repository&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git push &amp;lt;repo (defaults to origin)&amp;gt; &amp;lt;branch (defaults to master)&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;configure for github account&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;git config &amp;#8212;global user.email &amp;lt;email&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;other tidbits&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;don&amp;#8217;t need to set files to resolved once you resolve conflicts&lt;/li&gt;
&lt;/ul&gt;</description><link>http://log.andrewtrusty.com/post/74208003</link><guid>http://log.andrewtrusty.com/post/74208003</guid><pubDate>Thu, 29 Jan 2009 22:27:22 -0500</pubDate></item></channel></rss>

