<?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>CyberFOX Software Inc. &#187; Tips</title>
	<atom:link href="http://cyberfox.com/blog/category/tips/feed" rel="self" type="application/rss+xml" />
	<link>http://cyberfox.com/blog</link>
	<description>Coding, Connections, and Other Bloggy Bits of Goodness</description>
	<lastBuildDate>Sat, 25 Jul 2009 21:27:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The three kinds of Rails migrations</title>
		<link>http://cyberfox.com/blog/2009/05/22/54/the-three-kinds-of-rails-migrations</link>
		<comments>http://cyberfox.com/blog/2009/05/22/54/the-three-kinds-of-rails-migrations#comments</comments>
		<pubDate>Sat, 23 May 2009 01:21:56 +0000</pubDate>
		<dc:creator>Cyberfox</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[migrations]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.cyberfox.com/blog/?p=54</guid>
		<description><![CDATA[Greetings,
What alternative do you suggest for using models in migrations? I was in several situations where I had to not only change the underlying db structure but change the contained data, too.
Data changes, especially moving data around, are almost always rake task-worthy in my experience.
The other side of that, populating large amounts of seed data [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings,</p>
<p style="padding-left: 30px;"><em>What alternative do you suggest for using models in migrations? I was in several situations where I had to not only change the underlying db structure but change the contained data, too.</em></p>
<p>Data changes, especially moving data around, are almost always rake task-worthy in my experience.</p>
<p>The other side of that, populating large amounts of seed data into new databases, is a difficult task no matter the method; seed_fu attempted to deal with it, but it’s not an optimal solution and pretty old. I’m not even sure if it works anymore. It’s worse if you need the seed data to be from a legacy database in tests (e.g. a nutritional database). Reloading lots of data each time a clone_structure_to_test is done makes your tests very slow.</p>
<p>I break down migrations into three kinds; structural (tables, columns, indices, etc.), data (pre-populating tables, etc.) and procedural (moving data around, recalculating counts, etc.). The first is what I strive to limit migrations to. I feel like there should be a good answer for the second and Rails 3.0 has a &#8216;Simplest Thing That Can Work&#8217; feature in <span class="status-body"><span class="entry-content"> Rails <a title="This is also known as the &quot;Stop Putting Gawd Damn Seed Data In Your Migrations&quot; feature [DHH]" href="http://github.com/rails/rails/commit/4932f7b38f72104819022abca0c952ba6f9888cb">commit #4932f7b</a></span></span>. The third, I try to relegate to rake tasks that are usually run once, on deployment of the branch.</p>
<p>The procedural tasks don’t need to be run when building a fresh database, because there isn’t legacy data to correct. That’s why you can usually define the model in the migration to force it to work even if the real model is gone or renamed; there’s no data, so the operations often don’t matter. If they don’t NEED to be run when building a fresh database, I try not to put them in the migrations.</p>
<p>It’s not ‘hard and fast’, because I usually work in startups to small companies, where dogma doesn’t work so well. Imagine, though, a large and thin piece of foam. It’s flexible, and you can make it into all sorts of shapes, and yet it’s simple. Each time you add code that makes reasonable changes in the future painful, it’s like putting a thin glass rod into the foam. It’s still flexible, but there’s some bends you can’t do without breaking. Add too many and you’ve got an inflexible and brittle object, no matter how dynamic the base material is.</p>
<p>The fear of breaking things by changing the code is deeply demotivating for everyone.</p>
<p>I know I waterboarded that analogy, but hopefully it makes sense…</p>
<p>—  Morgan Schweers, Cyber<strong>FOX</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberfox.com/blog/2009/05/22/54/the-three-kinds-of-rails-migrations/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox2 + GMail == Memory Leak</title>
		<link>http://cyberfox.com/blog/2007/01/15/25/firefox-gmail-memory-leak</link>
		<comments>http://cyberfox.com/blog/2007/01/15/25/firefox-gmail-memory-leak#comments</comments>
		<pubDate>Mon, 15 Jan 2007 22:00:44 +0000</pubDate>
		<dc:creator>Cyberfox</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.vixen.com/blog/2007/01/15/25</guid>
		<description><![CDATA[Greetings,
Just noting that I closed my &#8216;gmail&#8217; window, and my Firefox process went from 883M to 585M.
I guarantee that 300M weren&#8217;t being used by the gmail page as it stood.  Perhaps Google&#8217;s Javascript foo is not as powerful as they&#8217;d like, and it&#8217;s holding onto old AJAX results?
I can guess a few other things [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings,</p>
<p>Just noting that I closed my &#8216;gmail&#8217; window, and my Firefox process went from 883M to 585M.<br />
I guarantee that 300M weren&#8217;t being used by the gmail page as it stood.  Perhaps Google&#8217;s Javascript foo is not as powerful as they&#8217;d like, and it&#8217;s holding onto old AJAX results?</p>
<p>I can guess a few other things about what might be going wrong (caching AJAX requests in the browser, for instance), but one way or another, if you have memory problems with Firefox 2 and you keep a gmail tab open, try closing your gmail tab now and then.</p>
<p>I have to wonder if it&#8217;s a general AJAXy problem with Firefox, or specific to gmail&#8230;</p>
<p>One way to test (which I&#8217;m going to try soon) is to try a &#8216;reload page&#8217; instead of a &#8216;close tab&#8217;, to see if it&#8217;s the browser/page-renderer/caching keeping the memory occupied, or the JavaScript on the page that is abusing memory.</p>
<p>There are limits to how much CPU we allow any given page of JavaScript to have; I&#8217;m surprised there aren&#8217;t any limits to how much memory it can have.</p>
<p>&#8211;  Morgan Schweers, Cyber<strong>FOX</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberfox.com/blog/2007/01/15/25/firefox-gmail-memory-leak/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox 2.0 tab usage and tips</title>
		<link>http://cyberfox.com/blog/2006/10/24/21/firefox-20-tab-usage-and-tips</link>
		<comments>http://cyberfox.com/blog/2006/10/24/21/firefox-20-tab-usage-and-tips#comments</comments>
		<pubDate>Tue, 24 Oct 2006 19:56:00 +0000</pubDate>
		<dc:creator>Cyberfox</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.vixen.com/blog/2006/10/24/21</guid>
		<description><![CDATA[Greetings,
I&#8217;m with Lorelle on tab usage.  I regularly have between 2-5 windows, each with 30+ tabs.  I do it because I&#8217;ll be reading an article on something I want to know more about, and I&#8217;ll run across an interesting link in the article, but not want to lose the flow of what I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings,<br />
I&#8217;m with <a title="Lorelle on Wordpress (on Tabs)" href="http://lorelle.wordpress.com/2006/10/22/firefox-2-versus-internet-explorer-versus-wordpress">Lorelle on tab usage</a>.  I regularly have between 2-5 windows, each with 30+ tabs.  I do it because I&#8217;ll be reading an article on something I want to know more about, and I&#8217;ll run across an interesting link in the article, but not want to lose the flow of what I&#8217;m reading.  I&#8217;ll middle-click, and continue reading.  Once I&#8217;m done with that article, I move on to the next link, and the next&#8230;  I also keep a baseline of about 20 tabs of personal and work stuff (gmail, financials, calendar, development reference, etc.) which never closes.</p>
<p>I used to do this with &#8216;new windows&#8217; in Netscape 4.x, and I got into a long discussion with a Netscape engineer about my usage patterns (having 40+ Netscape windows open tended to crash it badly eventually), and they acknowledged that the program was unstable under that kind of usage.  <img src='http://cyberfox.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   Worse, was that the email reader ran in the same process as the browser, so crashing the browser crashed my mail.  Tabs (and Firefox, as a lighter browser) saved my sanity.</p>
<p>I try to never close my browser, and I reboot my computer only every couple of weeks (and that&#8217;s only if it&#8217;s my Windows box).  Happily with Session Saver, I never had to worry about shutting down my browser, as it preserves my tabs and windows.  (I miss Session Saver in Safari&#8230;)</p>
<p>If you find that Firefox 1.5 is unstable under too many tabs (it worked pretty well for me), get a session saver.  It&#8217;s a life-saver when your browser crashes and you would otherwise lose 100+ tabs that you clicked to look at later, so you don&#8217;t know what the URLs were&#8230;</p>
<p>Firefox 2 ships with (x) on each tab.  Bleh.  Fix it by browsing to:<br />
<code style="display: inline">about:config</code><br />
Filter for:<br />
<code style="display: inline">browser.tabs.closeButtons</code><br />
double-click it, and set the value to:<br />
<code style="display: inline">3</code><br />
You can create it if it doesn&#8217;t already exist.)<br />
I recommend the FF2 extension &#8216;Restarter&#8217;, until they add the Restart option into the menu standard, in order to deal better with adding extensions.  For the IE7-ish &#8216;preview&#8217; mode, I&#8217;d suggest the extension Showcase, or Reveal if they update that plugin to 2.0.</p>
<p>I&#8217;d also suggest turning on session saving for all sessions, by adding configs:<br />
<code style="display: inline">browser.startup.page=3</code><br />
<code style="display: inline">browser.sessionstore.resume_session=true</code><br />
<span style="text-decoration: line-through">Now if only I could revert to the old &#8217;shrinking tab&#8217; behavior, at least down to a certain width.</span></p>
<p>Update: You can set this by changing your config options as follows:</p>
<p><code style="display: inline">browser.tabs.tabClipWidth=35</code><br />
<code style="display: inline">browser.tabs.tabMinWidth=25</code><br />
This will set your tab width to 25 pixels minimum, which will let you see a LOT more tabs than the old setting of 100.  I chose 35 for the clip width, based on having divided the minWidth by 4, I divided the clipWidth (default of 140) by 4 as well.  However, my tab usage often means that I need nothing more than the favicon in the tab to know where I&#8217;m going, or I never random-access the tabs, closing one to continue reading at another page.</p>
<p>Anyhow, these have been some power user tips from a dedicated Firefox user.</p>
<p>&#8211;  Morgan Schweers, CyberFOX!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberfox.com/blog/2006/10/24/21/firefox-20-tab-usage-and-tips/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
