<?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>danielsenhwong.com &#187; Web Dev</title>
	<atom:link href="http://blog.danielsenhwong.com/category/web-dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danielsenhwong.com</link>
	<description></description>
	<lastBuildDate>Tue, 22 Feb 2011 01:54:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Setting up Ruby on Rails in OS X</title>
		<link>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/</link>
		<comments>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 00:54:01 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=96</guid>
		<description><![CDATA[I consulted quite a few sources online to try and figure out how to do this, and ran into a few problems that took entirely too much time to solve. Now that I&#8217;ve figured them out, I&#8217;m writing the solutions here in the event I need them again. Hopefully they&#8217;ll be useful to a few [...]]]></description>
			<content:encoded><![CDATA[<p>I consulted quite a few sources online to try and figure out how to do this, and ran into a few problems that took entirely too much time to solve. Now that I&#8217;ve figured them out, I&#8217;m writing the solutions here in the event I need them again. Hopefully they&#8217;ll be useful to a few other people as well.</p>
<p><strong>Goals</strong></p>
<p>Create a Ruby on Rails development environment with Apache, MySQL, and PHP.</p>
<p>There are several possible ways of doing this, but since OS X is a Unix-based platform, I don&#8217;t see any reason to use pre-compiled packages like MacPorts and replacing the built-in software. Plus, this is supposed to be a learning experience.</p>
<p><strong>Sources</strong></p>
<p><a href="http://maestric.com/doc/mac/apache_php_mysql_snow_leopard">http://maestric.com/doc/mac/apache_php_mysql_snow_leopard</a></p>
<p><a href="http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/">http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/</a></p>
<p><span id="more-96"></span></p>
<p><strong>Basic Setup</strong></p>
<p>OS X comes with Apache, Ruby, Rails, and PHP pre-loaded; the specific versions of each are dependent upon the installed version of OS X. In my case, I am starting with a fresh installation of Snow Leopard (10.6), and beginning by downloading all available System Updates, which brings my system to version 10.6.5, with Apache version 2.2.15, Ruby 1.8.7, Rails 2.3.5 , and PHP 5.3.3.</p>
<p>In order to use the pre-loaded Apache installation, go to &#8220;System Preferences&#8221; &gt; &#8220;Sharing&#8221;  and check &#8220;Web Sharing&#8221;. This will enable the Apache web server. If you ever need to restart the server, either uncheck and re-check this box, or use the command &lt;code&gt;sudo apachectl restart&lt;/code&gt; from the command line.</p>
<p>Next, we need a compiler, so we&#8217;ll install Apple&#8217;s Xcode Developer Tools, which can be found on the OS X installation CD/DVD and also online directly from Apple (<a href="http://developer.apple.com/technologies/tools/xcode.html">http://developer.apple.com/technologies/tools/xcode.html</a>). I have version 3.2.3 installed. I&#8217;m writing this up after having performed all of the updates, so the initial version may have been different.</p>
<p><strong>MySQL</strong></p>
<p>MySQL doesn&#8217;t come installed as part of the normal OS X distribution; just OS X Server. No problem; just download an OS X *.dmg package for MySQL Community Server: <a href="http://www.mysql.com/downloads/mysql/#downloads">http://www.mysql.com/downloads/mysql/#downloads</a></p>
<p>Note: OS X Snow Leopard (10.6) and later compile in 64-bit C, so be sure to download the 64-bit version of MySQL (x86_64 suffix). This took me a while to figure out, as I had downloaded the 32-bit version for my 32-bit kernel. I thought it made sense. Version 5.1 should work just fine; I didn&#8217;t try 5.5.</p>
<p>Anyway, the MySQL *.dmg contains three files: the MySQL installer, the MySQL Startup Item installer, and the Preference Pane item. Install them in the order I have listed here. Once it&#8217;s installed, go ahead and try starting the server. The indicator in the Preference Pane item should turn green.</p>
<p>Edit /etc/profile and add &#8220;PATH=$PATH:/usr/local/mysql/bin&#8221;, otherwise you&#8217;ll have to type the full path to the mysql and mysqladmin executables in order to use them.</p>
<p><strong>PHP</strong></p>
<p>You&#8217;ll need to enable PHP by un-commenting a line beginning with &#8220;LoadModule php5_module&#8230;&#8221; in your Apache configuration file, typically found at /private/etc/apache2/apache2.conf.</p>
<p>Additionally, you&#8217;ll have to create a php.ini file in /etc/, which is most easily done by making a copy of &#8220;/etc/php.ini.default&#8221;. While you&#8217;re doing that, un-comment the line for your time zone, and enter a valid value. Additionally, change the three occurrences of &#8220;/var/mysql/mysql.sock&#8221; to &#8220;/tmp/mysql.sock&#8221; in order to point PHP at your MySQL installation.</p>
<p>I like using phpMyAdmin to manage my MySQL databases, so I&#8217;ll need to install this. The process is straightforward and well-documented. However, once you do this, you&#8217;ll notice that you&#8217;ll need PHP to have been compiled with the mcrypt extension, and the OS X distribution hasn&#8217;t been. Not to worry, Michael Gracie has a solution to that problem (<a href="http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/">http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/</a>).  Be sure to update the version numbers of the different software packages accordingly.</p>
<p>Restart the Apache server so these changes to php.ini take effect.</p>
<p><strong>Ruby on Rails</strong></p>
<p>I&#8217;m going to be using Rails 3.0, so I&#8217;ll need to update RubyGems with &#8220;sudo gem update &#8211;system&#8221; followed by &#8220;sudo gem update&#8221; to update all installed gems.</p>
<p>I&#8217;ll need to install a database adapter so that RoR can interface with MySQL. Rails 3 defaults to the mysql2 gem for MySQL databases, so we&#8217;ll install that with &#8220;sudo gem install mysql2 &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config&#8221;.</p>
<p>I want to use the devise plugin for user authentication, so I&#8217;ll install that and its dependent gem, warden.</p>
<p>Finally, I want to use passenger to deploy my Rails application just to make my life easier: &#8220;sudo gem install passenger&#8221; followed by &#8220;sudo passenger-install-apache2-module&#8221; and follow the directions.</p>
<p><strong>Done!</strong></p>
<p>I was going to write more about configuring virtual hosts, but this post languished with &#8220;draft&#8221; status for over a week already.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Counting records by category [RoR]</title>
		<link>http://blog.danielsenhwong.com/2010/10/counting-records-by-category-ror/</link>
		<comments>http://blog.danielsenhwong.com/2010/10/counting-records-by-category-ror/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 18:10:09 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=94</guid>
		<description><![CDATA[In my Rails application, I have an inventory of items described by three models: the items (cryovials), the place they&#8217;re stored (dewar), and the information about which vials is stored where (ln2_locations). The reason I used three models, rather than rolling the attributes of the third (ln2_locations) into the actual item was that in reality, [...]]]></description>
			<content:encoded><![CDATA[<p>In my Rails application, I have an inventory of items described by three models: the items (<strong>cryovials</strong>), the place they&#8217;re stored (<strong>dewar</strong>), and the information about which vials is stored where (<strong>ln2_locations</strong>).</p>
<p>The reason I used three models, rather than rolling the attributes of the third (<strong>ln2_locations</strong>) into the actual item was that in reality, we normally freeze down multiple vials with the same content at the same time.  I would like to implement this kind of mass assignment at a later time.</p>
<p>Anyway, it is often useful to be able to determine what we have stored, and how much of each different type of content is present. It&#8217;s one thing to know what the SQL code would be to retrieve these records; it&#8217;s another to convert that to an ActiveRecord query when you&#8217;re just learning.</p>
<p>What I would like to do is look at my items (<strong>cryovials</strong>), and pull out the unique content values (e.g. cell types), then go back and count how many vials I have with that content. It would be pretty easy to accomplish this as two separate statements, but that would involve iteration and two separate SQL queries. Best to leave it as one query where I count and select unique fields simultaneously:</p>
<p>Rails:</p>
<pre class="brush: ruby; title: ;">@summary = Ln2Location.select(&amp;quot;count(*) count, contents&amp;quot;).joins(:cryovial).where(:present =&gt; true).group(:contents)</pre>
<p>SQL:</p>
<pre class="brush: sql; title: ;">SELECT count(*) count, contents FROM `ln2_locations` INNER JOIN `cryovials` ON `cryovials`.`id` = `ln2_locations`.`cryovial_id` WHERE (`ln2_locations`.`present` = 1) GROUP BY contents</pre>
<p>I&#8217;m selecting on Ln2Locations because there&#8217;s a property, &#8220;present,&#8221; which I&#8217;m using to select only the vials which haven&#8217;t been physically removed from the collection. Additionally, the relationship between the models is as follows:</p>
<pre class="brush: ruby; title: ;">class Cryovial &lt; ActiveRecord::Base
# Relationships
belongs_to :user
has_many :dewars, :through =&gt; :ln2_location
has_many :ln2_locations
accepts_nested_attributes_for :ln2_locations
</pre>
<pre class="brush: ruby; title: ;">class Dewar &lt; ActiveRecord::Base
# Relationships
belongs_to :laboratory
belongs_to :location
has_many :cryovials, :through &lt; :ln2_locations</pre>
<pre class="brush: ruby; title: ;">class Ln2Location &lt; ActiveRecord::Base
# Relationships
belongs_to :dewar
belongs_to :cryovial</pre>
<p>So only the child model, Ln2Locations, contains the foreign key that would be used to generate the join table.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/10/counting-records-by-category-ror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: Integrating Devise</title>
		<link>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-integrating-devise/</link>
		<comments>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-integrating-devise/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 03:57:26 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/2010/10/ruby-on-rails-integrating-devise/</guid>
		<description><![CDATA[It is possible to integrate devise into your rails app as part of your user model in order to provide authentication support. - add desired attributes to migration file - make added attributes accessible in model file - either roll your own views or add fields to generated views That&#8217;s it. It really isn&#8217;t difficult [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible to integrate devise into your rails app as part of your user model in order to provide authentication support.</p>
<p>- add desired attributes to migration file<br />
- make added attributes accessible in model file<br />
- either roll your own views or add fields to generated views</p>
<p>That&#8217;s it. It really isn&#8217;t difficult or different than making any other model.</p>
<p>I was worried that it would be complicated, and spent a lot of time reading about devise to be sure. It&#8217;s so easy, no one writes about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-integrating-devise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Optimization: Indexing</title>
		<link>http://blog.danielsenhwong.com/2010/10/database-optimization-indexing/</link>
		<comments>http://blog.danielsenhwong.com/2010/10/database-optimization-indexing/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:26:38 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=92</guid>
		<description><![CDATA[After installing devise, I was looking through the migration file, and noticed a couple add_index commands. Reading up on what this actually does, I came across a couple interesting articles about database optimization: Optimizing your MySQL Application Indexing for DB performance details: http://www.railsbrain.com/api/rails-2.0.2/doc/index.html?a=M001468&#38;name=add_index I don&#8217;t plan to build a giant Rails application, but Rails is [...]]]></description>
			<content:encoded><![CDATA[<p>After installing devise, I was looking through the migration file, and noticed a couple add_index commands. Reading up on what this actually does, I came across a couple interesting articles about database optimization:</p>
<p><a href="http://articles.sitepoint.com/print/optimizing-mysql-application">Optimizing your MySQL Application</a></p>
<p><a href="http://weblog.jamisbuck.org/2006/10/23/indexing-for-db-performance">Indexing for DB performance</a></p>
<p>details: <a href="http://www.railsbrain.com/api/rails-2.0.2/doc/index.html?a=M001468&amp;name=add_index">http://www.railsbrain.com/api/rails-2.0.2/doc/index.html?a=M001468&amp;name=add_index</a></p>
<p>I don&#8217;t plan to build a giant Rails application, but Rails is known to have scalability issues. Still good to be aware of these points.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/10/database-optimization-indexing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: on shared hosting, user authentication</title>
		<link>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-on-shared-hosting-user-authentication/</link>
		<comments>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-on-shared-hosting-user-authentication/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 20:23:44 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[customer service]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[lithium hosting]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tech support]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=89</guid>
		<description><![CDATA[* As usual, this post on Ruby on Rails is more documentation of my development process to supplement my notebook and memory. I can try to answer questions, but please keep in mind that I&#8217;m learning too. I&#8217;ve bought the eBook version of the 4th edition of the Pragmatic Programmers&#8217; Agile Web Development with Rails. [...]]]></description>
			<content:encoded><![CDATA[<p><em>* As usual, this post on Ruby on Rails is more documentation of my development process to supplement my notebook and memory. I can try to answer questions, but please keep in mind that I&#8217;m learning too.</em></p>
<p>I&#8217;ve bought the eBook version of the 4th edition of the Pragmatic Programmers&#8217; <span style="text-decoration: underline;"><a href="http://pragprog.com/titles/rails4/agile-web-development-with-rails">Agile Web Development with Rails</a></span>. It&#8217;s still in beta, but my main goal is to see how things have changed between Rails 2.x and Rails 3. The book also covers some basic user authentication, but it&#8217;s very simplistic. In the interest of getting my project up and going quickly, I looked into <a href="http://github.com/binarylogic/authlogic">authlogic</a> and <a href="http://github.com/plataformatec/devise">devise/warden</a>.</p>
<p>Both authlogic and devise/warden were <a href="http://www.themomorohoax.com/2009/02/21/rails-2-3-authentication-comparison">highly recommended by mischa</a> after building an application that did some direct comparisons of several different RoR user authentication solutions. Good enough for me. devise appears to be more lightweight, so I&#8217;ll try that one first.</p>
<p>A little bit about my server setup: I&#8217;m hosted with <a href="https://www.lithiumhosting.com/billing/aff.php?aff=070">Lithium Hosting</a>, which is a great deal and has fantastic customer service. They&#8217;re not paying me to pitch the service, though clicking the link above and then signing up for a plan gives me referral credits or something. It&#8217;s a shared hosting service, so I manage my site with cPanel if I need/want to, and I&#8217;ve added on SSH access to my account so I don&#8217;t really need to use cPanel.</p>
<p>Once the server upgraded to Rails 3.0/Ruby 1.8.7, a couple things happened: my rails apps stopped starting automatically (cPanel feature), cPanel could no longer start my rails apps, and I couldn&#8217;t create a new Rails app with a MySQL database.</p>
<p>Solutions:</p>
<p>1) install the <a href="http://rubygems.org/gems/mysql2">mysql2 gem</a>, which is the new mysql database adapter used by Rails 3. The compilers are disabled on my host, so this was done via support ticket.</p>
<p>2) add mongrel to my Gemfile,</p>
<p><code lang="ruby">#project/Gemfile<br />
gem 'mongrel'</code></p>
<p>Mongrel isn&#8217;t automatically started in development mode. cPanel still won&#8217;t start my application, so starting the server is done via SSH with</p>
<p><code lang="rails">rails server --port=[port]</code></p>
<p>So now I can create a new project</p>
<p><code lang="rails">rails new project --database=mysql</code></p>
<p>and start the server. However, I don&#8217;t have a good way of authenticating users.</p>
<p>So, back to the support tickets to have both authlogic and devise installed. Once tech support has done that (seven minutes. really.), check if they&#8217;re installed for me:</p>
<p><code lang="ruby">gem server --port=[port]</code></p>
<p>and navigate to mysite.com:[port]. They&#8217;re not, run a couple commands from the command line:</p>
<p><code lang="rails">gem install devise<br />
gem install authlogic</code></p>
<p>Which should install the gems and make them available to me. Checking again as above, and both devise and authlogic are present. Add the appropriate lines to my Gemfile. Then, since I&#8217;m trying out devise first, install it:</p>
<p><code lang="rails">rails generate devise:install</code></p>
<p>That&#8217;s all for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-on-shared-hosting-user-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: Migrating data, too</title>
		<link>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-migrating-data-too/</link>
		<comments>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-migrating-data-too/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 15:50:40 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=86</guid>
		<description><![CDATA[Sometimes it makes sense to re-organize information in such a way that changing the database structure is necessary. It&#8217;s not terribly difficult to do this in Ruby on Rails. I&#8217;m writing this more to file this away somewhere I won&#8217;t accidentally delete it: class CreateLn2Locations &#60; ActiveRecord::Migration def self.up # create table create_table :ln2_locations do [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it makes sense to re-organize information in such a way that changing the database structure is necessary. It&#8217;s not terribly difficult to do this in Ruby on Rails.</p>
<p>I&#8217;m writing this more to file this away somewhere I won&#8217;t accidentally delete it:<br />
<span id="more-86"></span><br />
<code lang="ruby"><br />
class CreateLn2Locations &lt; ActiveRecord::Migration<br />
def self.up<br />
# create table<br />
create_table :ln2_locations do |t|<br />
t.integer :vial_id<br />
t.integer :dewar_id<br />
t.integer :canister<br />
t.integer :cane<br />
t.integer :position<br />
t.boolean :present, :default =&gt; 1<br />
t.date :date</code></p>
<p><code lang="ruby">t.timestamps<br />
end</p>
<p># reset column information so that the model can access the database<br />
Ln2Location.reset_column_information</p>
<p># take values previous held in columns by vial model, move to ln2_location<br />
Vial.find(:all).each do |vial|<br />
Ln2Location.create(:vial_id =&gt; vial.id,<br />
:dewar_id =&gt; vial.dewar_id,<br />
:canister =&gt; vial.canister,<br />
:cane =&gt; vial.cane,<br />
:position =&gt; vial.position,<br />
:date =&gt; vial.date)<br />
end</p>
<p># remove extra columns from vials table<br />
remove_column :vials, :dewar_id<br />
remove_column :vials, :canister<br />
remove_column :vials, :cane<br />
remove_column :vials, :position<br />
remove_column :vials, :depleted<br />
end</p>
<p>def self.down<br />
# undo changes; first, add columns back to vials table<br />
add_column :vials, :dewar_id, :integer<br />
add_column :vials, :canister, :integer<br />
add_column :vials, :cane, :integer<br />
add_column :vials, :position, :integer<br />
add_column :vials, :depleted, :boolean, :default =&gt; 0</p>
<p># reset column information so the model can access the re-created columns<br />
Vial.reset_column_information</p>
<p># copy data from ln2_location records to corresponding vial record<br />
Ln2Location.find(:all).each do |ln2|<br />
Vial.find(ln2.vial_id).update_attributes(<br />
:dewar_id =&gt; ln2.dewar_id,<br />
:canister =&gt; ln2.canister,<br />
:cane =&gt; ln2.cane,<br />
:position =&gt; ln2.position<br />
)<br />
end</p>
<p></code></p>
<p><code lang="ruby"> # remove table<br />
drop_table :ln2_locations<br />
end<br />
end<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/10/ruby-on-rails-migrating-data-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails IDE</title>
		<link>http://blog.danielsenhwong.com/2010/05/ruby-on-rails-ide/</link>
		<comments>http://blog.danielsenhwong.com/2010/05/ruby-on-rails-ide/#comments</comments>
		<pubDate>Wed, 19 May 2010 02:56:22 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[aptana]]></category>
		<category><![CDATA[radrails]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=78</guid>
		<description><![CDATA[I&#8217;ve been trying to get back into web development as a hobby; there are many reasons for this, but maybe the most relevant at the moment is that it has the potential to make my actual job easier. If I can develop a website as an online tool, maybe best described as a content management [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to get back into web development as a hobby; there are many reasons for this, but maybe the most relevant at the moment is that it has the potential to make my actual job easier. If I can develop a website as an online tool, maybe best described as a content management system on steroids and tailored to my needs in the lab, I can spend more time planning and performing experiments, and less time actually running the lab by doing it more efficiently.</p>
<p>Recently, I&#8217;ve been using puTTY, WinSCP, and a text editor to build this project in Ruby on Rails. The problem is, I need a lot of real estate on my screen to be able to do this effectively, and I wasn&#8217;t able to get WinSCP to open all of my script files in the same text editor window. Combine this with the fact that I had to &#8220;touch&#8221; every file from the command prompt using puTTY after making changes in the text editor, and saving the modified file to the site with WinSCP &#8212; it was really just the least efficient process for designing and building a system to make my life <em>more</em> efficient.</p>
<p>Anyway, a couple years ago, I had stumbled upon RadRails, which was then rolled into the Aptana IDE. Looked good. It had syntax highlighting, which was a big plus. However, SFTP support for remotely working on a RoR project was, at the time, only supported in the paid, &#8220;Pro&#8221; version of the Aptana Studio suite.</p>
<p>Fast forward to this afternoon, when I re-discovered the Aptana Studio and RadRails, and then found out that the &#8220;Pro&#8221; version had been scrapped, and now SFTP is available for free!</p>
<p>I&#8217;m playing around with it now, but I&#8217;m happy so far.</p>
<p><a href="http://aptana.org/">http://aptana.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2010/05/ruby-on-rails-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web design, and differences in browser rendering</title>
		<link>http://blog.danielsenhwong.com/2009/08/web-design-and-differences-in-browser-rendering/</link>
		<comments>http://blog.danielsenhwong.com/2009/08/web-design-and-differences-in-browser-rendering/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:10:56 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[facu]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[garfield messenger]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[iqueue]]></category>
		<category><![CDATA[lab]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=26</guid>
		<description><![CDATA[Admittedly, it has been a while since I last really truly developed a website. The FaCU site wasn&#8217;t so much of a site as it was a page, and really, I feel I could have done a better job if I weren&#8217;t so ridiculously busy Senior year, and if I were more up to speed [...]]]></description>
			<content:encoded><![CDATA[<p>Admittedly, it has been a while since I last really truly developed a website.</p>
<div id="attachment_27" class="wp-caption alignleft" style="width: 210px"><a href="http://facu.columbia.edu"><img class="size-full wp-image-27" title="20090827-facu" src="http://blog.danielsenhwong.com/wp-content/uploads/2009/08/20090827-facu.png" alt="Funding at Columbia University page screenshot, 27Aug2009" width="200" height="132" /></a><p class="wp-caption-text">Funding at Columbia University page screenshot, 27Aug2009</p></div>
<p>The <a href="http://facu.columbia.edu">FaCU</a> site wasn&#8217;t so much of a site as it was a page, and really, I feel I could have done a better job if I weren&#8217;t so ridiculously busy Senior year, and if I were more up to speed on using CSS to lay out websites.</p>
<p>Every time I&#8217;ve done this, beginning seven years ago, I&#8217;ve hit this block around how to manage the layout of a site.  The old way, working with browsers that didn&#8217;t correctly render CSS styling code, a lot of people dealt with the problem by using &lt;table&gt; hacks, using these tags to generate a website layout composed of &#8220;invisible boxes&#8221;.  All fine and good, except that it made changing even the smallest design element on the site was a huge undertaking, because every box was made to align and fit together like intricate pieces of a puzzle, and adjusting the thickness of one border or the geometry of one cell within the table, even by one pixel, required tweaking of every element around it, sometimes even going back and re-generating images or other graphics.</p>
<div id="attachment_28" class="wp-caption alignright" style="width: 210px"><a href="http://www.garfieldmessenger.com"><img class="size-full wp-image-28 " title="20090827-ghsmessenger" src="http://blog.danielsenhwong.com/wp-content/uploads/2009/08/20090827-ghsmessenger.png" alt="Current Garfield Messenger website screenshot" width="200" height="132" /></a><p class="wp-caption-text">Current Garfield Messenger website screenshot, 27Aug2009</p></div>
<p>My first effort at using CSS to lay out a website was in high school, when it became my project to design and build a website for the high school newspaper.  I used it to learn not only PHP and how to interact with a MySQL database, but really everything that would be involved in developing a website.  It never became as full-featured as I wanted it to be, and it was eventually wiped out in favor of something less complex, and then again more recently for a WordPress-backed system.</p>
<p>Long story short, I tried to learn CSS in high school, found it supported by the various browsers available at the time in a very inconsistent manner (between browsers), and ditched it because it was too confusing to figure out how do exactly what I wanted with it.</p>
<div id="attachment_29" class="wp-caption alignleft" style="width: 210px"><a href="http://www.bme.columbia.edu/senior_design/08/iqueue/index.htm"><img class="size-full wp-image-29" title="20090827-iqueue" src="http://blog.danielsenhwong.com/wp-content/uploads/2009/08/20090827-iqueue.png" alt="Capstone Industries - iQueue Dispenser System" width="200" height="176" /></a><p class="wp-caption-text">Capstone Industries - iQueue Dispenser System</p></div>
<p>I came back to CSS during my Senior year at Columbia while I was working on not only the FaCU website, but also the website for my Senior Design Project.  I tried to adhere to only the most widely available fonts, and the lowest common resolution for both sites.  The result: fairly ugly sites, but they get the job done.</p>
<p>Fast forward to today, when I&#8217;m now working on moving all of the lab&#8217;s most commonly used inventory books into a user-friendly digital form.  CSS has better support across every browser, and everything just makes more <em>sense</em> now.  No idea why.</p>
<p>Still, CSS is still rendered with quite a few annoying quirks.  Take, for instance, the following page layout:</p>
<div id="attachment_30" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-30" title="20090827-labsite" src="http://blog.danielsenhwong.com/wp-content/uploads/2009/08/20090827-labsite.png" alt="Lab inventory site" width="500" height="343" /><p class="wp-caption-text">Lab inventory site</p></div>
<p>Renders just fine in Chrome, Firefox, and IE8.  The left navigation panel and the main content to the left are spaced and positioned properly.  In IE7, the main content title renders where it should, but the table appears at the bottom, <em>under</em> the navigation block.  In Opera, the positioning offset I used to place the content area to the right of the navigation pane doesn&#8217;t appear to be necessary, so there&#8217;s a giant gap where there shouln&#8217;t be one.</p>
<p>A better situation than I was working with seven years ago, but still irritating.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2009/08/web-design-and-differences-in-browser-rendering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternate WordPress posting options</title>
		<link>http://blog.danielsenhwong.com/2009/07/alternate-wordpress-posting-options/</link>
		<comments>http://blog.danielsenhwong.com/2009/07/alternate-wordpress-posting-options/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 01:42:53 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod touch]]></category>
		<category><![CDATA[posting]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/2009/07/alternate-wordpress-posting-options/</guid>
		<description><![CDATA[As part of an effort to actually update this blog regularly instead o letting it slowly die like my old blogspot blog, I&#8217;ve been looking at a numer of different way of submitting new posts to this blog. E-mail is nice, but typically I&#8217;m only at a computer either at home or at work&#8230; The [...]]]></description>
			<content:encoded><![CDATA[<p>As part of an effort to actually update this blog regularly instead o letting it slowly die like my old blogspot blog, I&#8217;ve been looking at a numer of different way of submitting new posts to this blog.</p>
<p>E-mail is nice, but typically I&#8217;m only at a computer either at home or at work&#8230; The problem is, only one of those places is an appropriate environment to be writing blog post, at least for me.</p>
<p>I do, however, spend a lot of time commuting, even after having moved closer to work.  This presents a pretty good environment for writing blog posts, provided I don&#8217;t get motion sickness too quickly.  The only issue is, I would need to find some way of efficiently writing blog posts and saving them to be uploaded once I regained acces to an Internet connection.</p>
<p>Surprise, surprise, there&#8217;s an iPhone/iPod Touch app that does exactly this, and it&#8217;s free! I&#8217;m using it now just to test it out, an it&#8217;s actually not too bad, though this might be more of a critique of extended typing on the iPod Touch than it is of the WordPress application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2009/07/alternate-wordpress-posting-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Postie!</title>
		<link>http://blog.danielsenhwong.com/2009/07/postie/</link>
		<comments>http://blog.danielsenhwong.com/2009/07/postie/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 06:08:37 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[postie]]></category>
		<category><![CDATA[posting]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=13</guid>
		<description><![CDATA[The built-in WordPress PHP script to grab e-mails and generate blog posts from them wasn&#8217;t particularly good, so I&#8217;m now using Postie (http://wordpress.org/extend/plugins/postie/), which seems to at least offer more features, though this post is really an experiment to see how well it works. I keep having issues with the built-in WordPress installer, so I [...]]]></description>
			<content:encoded><![CDATA[<p>The built-in WordPress PHP script to grab e-mails and generate blog posts from them wasn&#8217;t particularly good, so I&#8217;m now using Postie (<a href="http://wordpress.org/extend/plugins/postie/">http://wordpress.org/extend/plugins/postie/</a>), which seems to at least offer more features, though this post is really an experiment to see how well it works.</p>
<p>I keep having issues with the built-in WordPress installer, so I think I&#8217;m just going to use the command line and grab everything via <strong>wget</strong>.</p>
<p><em>Edit: This worked perfectly, and I definitely like Postie more than the built-in wp-mail.php method.  Definite plus: being able to add tags to the post by e-mail, among other things.  I&#8217;m going to have fun with this.  Also, Postie supports POP3 with SSL without my ssl://server hack.  I think it ends up working the same way, but the additional layer of abstraction makes it dead simple for a first-time user.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2009/07/postie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

