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

<channel>
	<title>DrElmo, Code Monkey &#187; CogSci 121: HCI Programming</title>
	<atom:link href="http://www.drelmo.net/category/cogs121/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.drelmo.net</link>
	<description>A place for my ramblings</description>
	<lastBuildDate>Wed, 28 Sep 2011 21:57:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Final Impressions of COGS 121</title>
		<link>http://www.drelmo.net/2008/03/13/final-impressions-of-cogs-121/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=final-impressions-of-cogs-121</link>
		<comments>http://www.drelmo.net/2008/03/13/final-impressions-of-cogs-121/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 20:20:39 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[121]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/03/13/final-impressions-of-cogs-121/</guid>
		<description><![CDATA[After 10 weeks, I&#8217;ve now been able to watch all of the final presentations from the different groups. Considering that my group was the only &#8220;experienced programmer&#8221; team, I really didn&#8217;t know what to expect from the others. All in all, I&#8217;ve been incredibly impressed by the various projects they&#8217;ve managed to produce. Most importantly, [...]]]></description>
			<content:encoded><![CDATA[<p>After 10 weeks, I&#8217;ve now been able to watch all of the final presentations from the different groups.  Considering that my group was the only &#8220;experienced programmer&#8221; team, I really didn&#8217;t know what to expect from the others.  All in all, I&#8217;ve been incredibly impressed by the various projects they&#8217;ve managed to produce.  Most importantly, it&#8217;s clear that the quality of the project ideas has nothing to do with programming ability.  Implementation is another thing, but even groups of self-proclaimed &#8220;newbies&#8221; with only (prior to this class) basic HTML exposure came out with some very cool projects.</p>
<p>Something I hadn&#8217;t expected, but makes sense in retrospect, is the correlation between  prior experience and willingness to learn new things.  The class represented a huge cross section of prior-experience from student to student.  Overall, those who knew the least starting out were the ones most willing to embrace new ideas and technologies.  The eagerness with which the &#8220;beginners&#8221; jumped into their ideas was truly inspiring.</p>
<h2>Soapbox: Pro&#8217;s and Con&#8217;s</h2>
<p>I spent a decent amount of time in and outside of class evangelizing Rails since it was so appropriate for a lot of the project ideas out there.  This had different effects on different people.  One group actually ran with it and built their entire project with it.  A few people were probably bored to tears by my rambling.  The majority of the class now knows me as the &#8220;Ruby on Rails guy&#8221;.  I&#8217;m glad that I was able to expose more people to the framework, but I don&#8217;t think I was effective in conveying the core concept that I work by:</p>
<blockquote><p>If you&#8217;re going to tackle a problem, use the best tools available.</p></blockquote>
<p>Rails is a great tool for a wide variety of web apps.  It is <strong>not</strong> the be-all end-all solution to life&#8217;s endless problems.  I think I came across more as &#8220;Rails is the answer to everything&#8221; instead of what I was shooting for &#8220;Use new tools, not just what you already know.&#8221;  A large part of this problem stems from our own group using Rails for the backend; something I was actually trying to avoid.</p>
<p>The aim of the class is for each person to learn new technologies and develop something with them.  Our project, due to the nature of its complexity, was going to require a lot of coding.  Once it became clear that we were going to need our own backend DB, I wanted to avoid using PHP.  Not because it wouldn&#8217;t work just fine.  There&#8217;s nothing wrong with it, especially for a project this small.  The problem, as I saw it, was that 4 out of 5 people in our group had a medium to high level of experience with it.  That doesn&#8217;t allow for a lot of &#8220;new&#8221; learning.</p>
<p>My motivation for using Rails in our group was to introduce already-skilled programmers to something new, even if it meant limiting my own exposure to &#8220;new&#8221; things.  For my own learning, I made sure to take time outside of our group meetings to teach myself other pieces that I haven&#8217;t seen or used before.  The most visually interesting result of that is the drag-n-drop ordering of Categories.  Working out the SQL queries needed to find stores that are open at a given time definitely stretched my boundaries.  Obviously not as major as learning a whole new language, but it was a great way to push myself beyond what I already knew coming in.</p>
<h2>If You Could Go Back&#8230;</h2>
<p>Were I to do it all over again, I would have spent more time trying to preach the core philosophy of &#8220;use the best tool&#8221; instead of keeping the focus on Rails.  For example, I only realized last week that we, it appears, are the only group using any kind of version control.  Giving a talk on basic SVN usage, I think, would have been valuable to the class as a whole.</p>
<p>I had a lot of fun working on Open Past Midnight for this class.  After all, I&#8217;m a programmer.  But the neatest part of this class was getting to see what other people came up with, especially when they had to work with limited experience.  That constraint can be incredibly discouraging, but they pulled through beautifully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/03/13/final-impressions-of-cogs-121/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Past&#8230; what day?</title>
		<link>http://www.drelmo.net/2008/03/03/open-past-what-day/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-past-what-day</link>
		<comments>http://www.drelmo.net/2008/03/03/open-past-what-day/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 18:37:53 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/03/03/open-past-what-day/</guid>
		<description><![CDATA[It&#8217;s been too long since the last update, especially since we&#8217;ve overcome a lot of hurdles in building this system. I&#8217;ll talk about each in its own right. Hours of Operation The primary quandary we faced was in how to represent a store&#8217;s hours of operation in the database. The obvious implementation is to have [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been too long since the last update, especially since we&#8217;ve overcome a lot of hurdles in building this system.  I&#8217;ll talk about each in its own right.</p>
<h2>Hours of Operation</h2>
<p>The primary quandary we faced was in how to represent a store&#8217;s hours of operation in the database. The obvious implementation is to have separate columns for each day&#8217;s open and close times.  This gives us 14 columns added to the &#8216;store&#8217; table, named &#8216;monday_open&#8217;, &#8216;monday_close&#8217;, &#8216;tuesday_open&#8217;&#8230; and so on.  Since we have a different column for each day, it would make sense to have the column be of type &#8216;<em>time</em>&#8216; right?  <strong>No!</strong></p>
<p>Especially because we&#8217;re dealing with locations that are open late, we need to deal with cases like <strong>&#8220;On Monday, we&#8217;re open from 10am &#8211; 2am&#8221;</strong>.  If the columns only handle time, then we&#8217;ll have a store with <strong>monday_open = 10:00</strong> and <strong>monday_close = 2:00</strong>.  That means we need to do some serious condition checking to see if its open.  Better yet, how do we query for all stores that are open at a specific time? Not very efficient.</p>
<p>So how did we deal with this?  We want the columns to be able to know not just the time of day, but also the day of the week.  For the example above, we want the columns to read more like <strong>monday_open = Mon 10:00</strong> and <strong>monday_close = Tue 2:00</strong>. This would make queries a whole lot easier, as we can resort to a simple <strong>open &lt; right_now &lt; close</strong> test, without having to create extra logic. But SQL databases don&#8217;t have a type to represent time + day of week.  The options are <em>time</em> (hours, minutes, seconds only) or fullblown <em>datetime</em> (year, month, day, hour, etc). Since we&#8217;ve concluded that <em>time</em> is not enough on its own, we&#8217;re forced into using a full <em>datetime </em>field.</p>
<p>But wait! That means <strong>monday_close</strong> will look more like <strong>March 4, 2008 2:00 -0800</strong>. How are you going to deal with the comparisons when it&#8217;s now June? The condition will always fail, thinking the store closed months ago! And that&#8217;s where our solution comes in. The solution is, to some degree, in the question.  Our comparisons will involve the entire <em>datetime</em>, but we only care about day-of-week and time. Therefore, we just need to pick arbitrary values for the rest of the <em>datetime</em> fields and have the code enforce their usage. We ended up using the week of Jan 1, 2007 for our project, primarily because Jan 1 is a Monday, making it very easy to translate a number to day-of-week. Throw in a few helper functions to make the date translation seamless to the user, and we&#8217;re set!</p>
<h2>Website Hosting</h2>
<p>As I said in my previous <a href="http://www.drelmo.net/2007/09/11/my-top-2-web-hosting-companies/">post about web hosting companies</a>, DreamHost is a great cheap shared-hosting solution, but its Rails support leaves a bit to be desired. I was pleased to see that they&#8217;ve cleaned up their <a href="http://wiki.dreamhost.com/Rails" target="_blank">documentation</a>, and getting a Rails site running requires a lot fewer hacks now. But the speed issue is still a huge one. Big enough for me to still say that for a commercial Rails app, I would not use them. For a class project, they&#8217;re perfect.</p>
<h2>Introducing the Team to Rails</h2>
<p>We&#8217;ve transitioned the project to Rails completely, which has made, as usual, a lot of grunt work disappear into thin air. It&#8217;s working well for what we need from it, albeit a very simple site. The real issue with Rails is that, being so new, still very few people know about it, much less have used it before. Whenever introducing a group of people to a new technology, you&#8217;re going to have mixed results, and our team is no exception. Some have taken to it excitedly, some with reserve, and some are just not very interested. All this is fine, especially since there&#8217;s plenty of work to do outside of Rails. It&#8217;s interesting to have such a cross-section of reactions to it all working together.</p>
<h2>Interfacing with Google</h2>
<p>Since our project employs Google Maps to display store locations, we need to interface with their API. More importantly, we need to load latitude and longitude coordinates of the stores into our own database. Since we all quickly agreed that we didn&#8217;t want to do that by hand, we worked out an alternate solution.</p>
<p>The interface to add a new store to the database employs Google Local Search to find stores that are already in Google&#8217;s system, and therefore already have all of the information we need (except hours). From the search results we get back from Google, we can click a button that then pushes the data up to our own server. Then we go in and set the hours of operation and assign a category. It took a lot of tweaking to get it working right, but after a few hours of Rodolphe working on the client-side Javascript and me working on the server-side receiving end, we got it ironed out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/03/03/open-past-what-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delays to being Open (Past Midnight)</title>
		<link>http://www.drelmo.net/2008/02/19/delays-to-being-open-past-midnight/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=delays-to-being-open-past-midnight</link>
		<comments>http://www.drelmo.net/2008/02/19/delays-to-being-open-past-midnight/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 19:34:22 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[121]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/02/19/delays-to-being-open-past-midnight/</guid>
		<description><![CDATA[For those of you that have not heard, my grandfather is very ill and in the hospital.  I&#8217;ve been back and forth to LA several times this last week to try and help out the family as much as I can.  Even better, I picked up a really nasty cold somewhere along the way.  All [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you that have not heard, my grandfather is very ill and in the hospital.  I&#8217;ve been back and forth to LA several times this last week to try and help out the family as much as I can.  Even better, I picked up a really nasty cold somewhere along the way.  All in all, I&#8217;ve missed a bunch of classes, a few assignments, and a midterm.  I&#8217;m playing catchup, first and foremost on Open Past Midnight.  It&#8217;s one thing to get behind on my own work, but to set back my whole group is not acceptable.</p>
<p>That said, we&#8217;re transitioning the Open Past Midnight project to Rails since we&#8217;ll need to be dealing with our own database.  I&#8217;ve already got Evan set up with the dev environment.  Then again, he&#8217;s running Leopard, so it took all of 5 minutes.  The other teammates all use Winblows, so it might take some extra time.  Either way, I am eternally grateful that Rails 2.0 now uses SQLite as the default DB.  No longer will I need to take time to explain MySQL privilege tables to my classmates when all they want to do is some basic development.</p>
<p>More to come in later posts, but we&#8217;re still going to try and deploy this project on Dreamhost.  Since it&#8217;s hardly a commercial endeavor, I&#8217;m not as worried about DH&#8217;s poor Rails support.  It will be interesting though to see how far they have (or have not) come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/02/19/delays-to-being-open-past-midnight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Midnight Munchies is now Open Past Midnight</title>
		<link>http://www.drelmo.net/2008/02/03/midnight-munchies-is-now-open-past-midnight/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=midnight-munchies-is-now-open-past-midnight</link>
		<comments>http://www.drelmo.net/2008/02/03/midnight-munchies-is-now-open-past-midnight/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 02:19:54 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[121]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/02/03/midnight-munchies-is-now-open-past-midnight/</guid>
		<description><![CDATA[Due to some slight difficulties in acquiring the needed domain name, our COGS group has changed its name to Open Past Midnight.  We&#8217;ve been working on some paper-prototypes for the site layout.  Vivien found a very cool possible technology for generating heatmaps called gheat.  Given the implementation, I don&#8217;t think it will be directly usable [...]]]></description>
			<content:encoded><![CDATA[<p>Due to some slight difficulties in acquiring the needed domain name, our COGS group has changed its name to <strong>Open Past Midnight</strong>.  We&#8217;ve been working on some paper-prototypes for the site layout.  Vivien found a very cool possible technology for generating heatmaps called <a href="http://code.google.com/p/gheat/" target="_blank">gheat</a>.  Given the implementation, I don&#8217;t think it will be directly usable for our project, but it does lend some great ideas.  There might be parts that we can yank out and use.  We&#8217;ll see.</p>
<p>I&#8217;ve also been working a lot on the server-side systems we need to make this project run smoothly, both in development and production. Just as with Rails, <a href="http://www.capify.org/" target="_blank">Capistrano</a> is my friend.  I&#8217;ve almost got it working for this project, even though we&#8217;re likely to do any back-end code in PHP.</p>
<p>Also, it turns out that Google will pay you to submit verified listings of local businesses.  They call it their <a href="http://www.google.com/services/local-business-referrals/repfaq.html" target="_blank">Business Referral Representative</a> program.  If we&#8217;re lucky, we can get into the program and get paid for doing all the data gathering we would anyway.  More to come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/02/03/midnight-munchies-is-now-open-past-midnight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Midnight Munchies &#8211; Prologue</title>
		<link>http://www.drelmo.net/2008/01/27/midnight-munchies-prologue/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=midnight-munchies-prologue</link>
		<comments>http://www.drelmo.net/2008/01/27/midnight-munchies-prologue/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 20:28:45 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[121]]></category>
		<category><![CDATA[munchies]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/01/27/midnight-munchies-prologue/</guid>
		<description><![CDATA[So our COGS group has decided to do a Google-maps based site that allows the visitor to find nearby restaurants (maybe stores, etc) that are open at different times of the day.  We&#8217;ve set up some framework stuff (SVN, domain, etc) and need to start getting things together. By Thursday (1/31/08) we will have mapped [...]]]></description>
			<content:encoded><![CDATA[<p>So our COGS group has decided to do a Google-maps based site that allows the visitor to find nearby restaurants (maybe stores, etc) that are open at different times of the day.  We&#8217;ve set up some framework stuff (SVN, domain, etc) and need to start getting things together.</p>
<p>By Thursday (1/31/08) we will have mapped out the data for the following locations.  This means we need to go to those areas and grab all of the data about the various stores (name, phone, address, hours) and submit it to Google&#8217;s database (or verify that they already have it.)</p>
<ul>
<li>Chris: Costa Verde shopping center</li>
<li>Evan: Ralph&#8217;s shopping center</li>
<li>Rodolphe: Whole Foods shopping center</li>
<li>Marc: Einstein&#8217;s Bros shopping center</li>
<li>Vivien: Vons shopping center</li>
</ul>
<p>Our in-progress feature list:</p>
<p><strong>Must-Have Feature Set</strong></p>
<ul>
<li>Default time should approximate the user&#8217;s local time</li>
<li>An interface to allow the user to change the time displayed</li>
<li>Search for locations based on name and/or time</li>
</ul>
<p><strong>Would-Be-Nice Feature Set</strong></p>
<ul>
<li>Mobile-access compatible (iPhone, etc)</li>
<li>Heatmap of neighborhoods to display density of locations open at the given time</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/01/27/midnight-munchies-prologue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Practical Chinese for Nerds (hwk 1)</title>
		<link>http://www.drelmo.net/2008/01/22/practical-chinese-for-nerds-hwk-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=practical-chinese-for-nerds-hwk-1</link>
		<comments>http://www.drelmo.net/2008/01/22/practical-chinese-for-nerds-hwk-1/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 20:51:59 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[121]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/01/22/practical-chinese-for-nerds-hwk-1/</guid>
		<description><![CDATA[The first assignment for COGS 121 was due last week.  I worked up a simple site on Practical Chinese for Nerds.  The content leaves a lot to be desired, but that was essentially filler for me.  I was focusing on two things while I built this site. Building a completely image-free site by hand.  Something [...]]]></description>
			<content:encoded><![CDATA[<p>The first assignment for COGS 121 was due last week.  I worked up a simple site on <a href="http://thrashbarg.drelmo.net/~marc/cogs121/assignment_1/">Practical Chinese for Nerds</a>.  The content leaves a lot to be desired, but that was essentially filler for me.  I was focusing on two things while I built this site.</p>
<ol>
<li>Building a completely image-free site by hand.  Something I haven&#8217;t done in a while, considering all of my recent work with <a href="http://www.muirsurf.com">point-of-sale and e-commerce</a>.  <strong>The verdict:</strong> I&#8217;m in love with Rails, not HTML.</li>
<li>I wanted to really get a feel for the differences using <a href="http://www.scintilla.org/SciTE.html">SciTE</a> on my laptop versus <a href="http://macromates.com">Textmate</a> on my desktop for the same, small project.  <strong>The verdict:</strong> my next laptop will be a Mac, purely because I love using Textmate.  If you&#8217;ve got a mac, but haven&#8217;t tried it out, I sincerely urge you to.</li>
</ol>
<p>The thing I&#8217;m really looking forward to playing around with is <a href="http://www.openlaszlo.org/">OpenLaszlo</a>.  It looks very powerful, and I&#8217;ve got a few ideas for projects where I could implement it.  The most interesting would be to use Laszlo&#8217;s DHTML output to create an interface to a Rails app.  Muhahaha.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/01/22/practical-chinese-for-nerds-hwk-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>COGS 121: Human Computer Interaction Programming</title>
		<link>http://www.drelmo.net/2008/01/09/cogs-121-human-computer-interaction-programming/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cogs-121-human-computer-interaction-programming</link>
		<comments>http://www.drelmo.net/2008/01/09/cogs-121-human-computer-interaction-programming/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 18:49:49 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[CogSci 121: HCI Programming]]></category>
		<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[121]]></category>

		<guid isPermaLink="false">http://www.drelmo.net/2008/01/09/cogs-121-human-computer-interaction-programming/</guid>
		<description><![CDATA[So in my 5th and final year at UCSD, I&#8217;m finally getting to take a class that I&#8217;ve had my eye on for years: Human Computer Interaction Programming. Part of the class assignments are to maintain a blog of what we do in (or related to) class. Since I&#8217;m lazy and don&#8217;t want to set [...]]]></description>
			<content:encoded><![CDATA[<p>So in my 5th and final year at UCSD, I&#8217;m finally getting to take a class that I&#8217;ve had my eye on for years: Human Computer Interaction Programming.  Part of the class assignments are to maintain a blog of what we do in (or related to) class.  Since I&#8217;m lazy and don&#8217;t want to set up a whole new one, here we go!</p>
<p>This should also motivate me to continue my regular postings.  For those readers that have been patiently waiting for the printer driver I talked about <a href="http://www.drelmo.net/2007/09/17/installing-a-star-micronics-tsp600-receipt-printer-on-ubuntu-feisty-704/">here</a>, it will be posted this week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.drelmo.net/2008/01/09/cogs-121-human-computer-interaction-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

