<?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>Sara Trice &#187; tech</title>
	<atom:link href="http://saratrice.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://saratrice.com</link>
	<description>Just a programmin&#039;, bellydancin&#039;, cake bakin&#039; kinda girl</description>
	<lastBuildDate>Tue, 17 Jan 2012 23:07:03 +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>Quickie: How to add a blank option to options_from_collection_for_select</title>
		<link>http://saratrice.com/2011/12/28/quickie-how-to-add-a-blank-option-to-options_from_collection_for_select/</link>
		<comments>http://saratrice.com/2011/12/28/quickie-how-to-add-a-blank-option-to-options_from_collection_for_select/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:52:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=259</guid>
		<description><![CDATA[&#60;%= select_tag "some_select", ("&#60;option&#62;&#60;/option&#62;" + options_from_collection_for_select(@foo, "id", "item")).html_safe %&#62;]]></description>
			<content:encoded><![CDATA[<pre>&lt;%= select_tag "some_select", ("&lt;option&gt;&lt;/option&gt;" + options_from_collection_for_select(@foo, "id", "item")).html_safe %&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/12/28/quickie-how-to-add-a-blank-option-to-options_from_collection_for_select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using javan/whenever on Engine Yard Cloud</title>
		<link>http://saratrice.com/2011/09/28/using-javanwhenever-on-engine-yard/</link>
		<comments>http://saratrice.com/2011/09/28/using-javanwhenever-on-engine-yard/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 19:31:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=252</guid>
		<description><![CDATA[Things I wish I&#8217;d have known: 1. It does not matter if whenever is in your gemfile, you have to SSH to your EY server and install whenever as such: sudo gem install whenever 2. It will probably complain that you don&#8217;t have i18n installed, so: sudo gem install i18n EDIT: You will have to [...]]]></description>
			<content:encoded><![CDATA[<p>Things I wish I&#8217;d have known:<br />
1. It does not matter if whenever is in your gemfile, you have to SSH to your EY server and install whenever as such: sudo gem install whenever<br />
2. It will probably complain that you don&#8217;t have i18n installed, so: sudo gem install i18n</p>
<p>EDIT: You will have to repeat the two steps above ANYTIME you restart your EY instance!</p>
<p>3. If you want your crontab updated on deploy, make a file named deploy/before_restart.rb and stick this in it (make sure you replace &#8216;yourAppNameHere&#8217;, derp):</p>
<pre>@rails_env = node[:environment][:framework_env]
run "cd #{release_path}; whenever --set environment=#{@rails_env}; whenever --update-crontab 'yourAppNameHere'"</pre>
<p>This is called a &#8216;deploy hook&#8217; and <a href="http://docs.engineyard.com/use-deploy-hooks-with-engine-yard-appcloud.html" target="_blank">here&#8217;s more info</a>.</p>
<p>I found the idea for this in <a href="http://webcache.googleusercontent.com/search?q=cache:ppp5Xh-9FocJ:community.engineyard.com/discussions/questions/786-gems-not-installing+%22%40rails_env+%3D+node%5B:environment%5D%5B:framework_env%5D%22&amp;cd=10&amp;hl=en&amp;ct=clnk&amp;gl=us" target="_blank">an old EY forum post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/09/28/using-javanwhenever-on-engine-yard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jsTree: adding Expand All and Collapse All buttons</title>
		<link>http://saratrice.com/2011/05/04/jstree-adding-expand-all-and-collapse-all-buttons/</link>
		<comments>http://saratrice.com/2011/05/04/jstree-adding-expand-all-and-collapse-all-buttons/#comments</comments>
		<pubDate>Wed, 04 May 2011 19:50:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=240</guid>
		<description><![CDATA[The documentation for jsTree is thorough, but not particularly easy to read. If you are looking for an easy way to add &#8220;Expand All&#8221; and &#8220;Collapse All&#8221; buttons, here&#8217;s one way: &#60;input type="button" value="Collapse All" onclick="$('#tree_container_id').jstree('close_all');"&#62; &#60;input type="button" value="Expand All" onclick="$('#tree_container_id').jstree('open_all');"&#62; where &#8216;#tree_container_id&#8217; is, of course, the ID of the container node for your tree.]]></description>
			<content:encoded><![CDATA[<p>The documentation for jsTree is thorough, but not particularly easy to read. If you are looking for an easy way to add &#8220;Expand All&#8221; and &#8220;Collapse All&#8221; buttons, here&#8217;s one way:</p>
<p><code>&lt;input type="button" value="Collapse All" onclick="$('#tree_container_id').jstree('close_all');"&gt;<br />
&lt;input type="button" value="Expand All" onclick="$('#tree_container_id').jstree('open_all');"&gt;<br />
</code></p>
<p>where &#8216;#tree_container_id&#8217; is, of course, the ID of the container node for your tree.</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/05/04/jstree-adding-expand-all-and-collapse-all-buttons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Uploadify: changing scriptData with dropdowns</title>
		<link>http://saratrice.com/2011/04/11/uploadify-changing-scriptdata-with-dropdowns/</link>
		<comments>http://saratrice.com/2011/04/11/uploadify-changing-scriptdata-with-dropdowns/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 20:26:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=227</guid>
		<description><![CDATA[Uploadify is a pretty awesome jQuery/flash uploader. It&#8217;s made even more awesome by the stuff you can do with it on the fly. For example, if you want to pass a variable chosen from a dropdown via the uploader, you can use uploadifySettings() to do so. Some people appear to have problems with this part, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.uploadify.com" target="_blank">Uploadify</a> is a pretty awesome jQuery/flash uploader. It&#8217;s made even more awesome by the stuff you can do with it on the fly.</p>
<p>For example, if you want to pass a variable chosen from a dropdown via the uploader, you can use <a href="http://www.uploadify.com/documentation/methods/uploadifysettings/" target="_blank">uploadifySettings()</a> to do so. Some people appear to have problems with this part, so here&#8217;s how I did it. (I&#8217;m not going to show you all the settings, since the <a href="http://www.uploadify.com/documentation/">docs</a> give you a pretty good idea how to set it up. )</p>
<p>Say you have a dropdown in your form with the id of &#8216;upload_type&#8217;:<br />
<code><br />
&lt;select id="upload_type" name="upload_type"&gt;<br />
&lt;option&gt;&lt;/option&gt;<br />
&lt;option value="1"&gt;First type&lt;/option&gt;<br />
&lt;option value="2"&gt;Second type&lt;/option&gt;<br />
&lt;/select&gt;<br />
</code></p>
<p>In your jQuery $(document).ready function (but outside the $(&#8216;#upload&#8217;).uploadify function), put something like this:<br />
<code><br />
$('#upload_type').change(function() {<br />
var type_val = $(this).val();<br />
$('#upload').uploadifySettings("scriptData", {"upload_type" : type_val});<br />
});<br />
</code><br />
Which means &#8220;Whenever the form field identified with &#8216;upload_type&#8217; changes, update the &#8216;upload_type&#8217; variable in scriptData if it exists; if it does not already exist in scriptData, add it.&#8221;</p>
<p>Note: I&#8217;ve only tried this in Uploadify 2.1.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/04/11/uploadify-changing-scriptdata-with-dropdowns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing CKEditor in Ruby on Rails with Cucumber/Capybara</title>
		<link>http://saratrice.com/2011/03/09/testing-ckeditor-in-ruby-on-rails-with-cucumbercapybara/</link>
		<comments>http://saratrice.com/2011/03/09/testing-ckeditor-in-ruby-on-rails-with-cucumbercapybara/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 00:25:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=215</guid>
		<description><![CDATA[I have a textarea with the id of &#8220;request_details&#8221;, made into a CKEditor instance by jQuery: $(&#8216;#request_details&#8217;).ckeditor(); (Check this page if you need some help getting CKEditor to work with jQuery, it&#8217;s dead simple) Feature looks like this:  And I fill in "Here are some details" in the CKEditor instance "request_details" Step looks like this: [...]]]></description>
			<content:encoded><![CDATA[<p>I have a textarea with the id of &#8220;request_details&#8221;, made into a CKEditor instance by jQuery: $(&#8216;#request_details&#8217;).ckeditor();</p>
<p>(Check <a href="http://ckeditor.com/blog/CKEditor_for_jQuery" target="_blank">this page</a> if you need some help getting CKEditor to work with jQuery, it&#8217;s dead simple)</p>
<p>Feature looks like this:  <code>And I fill in "Here are some details" in the CKEditor instance "request_details"</code></p>
<p>Step looks like this:</p>
<p style="padding-left: 30px;"><code>When /^I fill in "([^"]*)" in the CKEditor instance "([^"]*)"$/ do |value, input_id|<br />
browser = page.driver.browser<br />
browser.execute_script("CKEDITOR.instances['#{input_id}'].setData('#{value}');")<br />
end</code></p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/03/09/testing-ckeditor-in-ruby-on-rails-with-cucumbercapybara/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My least favorite phrase</title>
		<link>http://saratrice.com/2011/02/23/my-least-favorite-phrase/</link>
		<comments>http://saratrice.com/2011/02/23/my-least-favorite-phrase/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 21:52:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ramblings]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=213</guid>
		<description><![CDATA[I&#8217;ve decided on my least favorite phrase in the English language: &#8220;Can&#8217;t you just&#8230;?&#8221; Why is this my least favorite phrase? Because: It&#8217;s always in conjunction with a task that the questioner does not understand, but assumes should not be difficult at all; it is inherently second-guessing the person being asked, which is insulting; and, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided on my least favorite phrase in the English language:</p>
<p><strong>&#8220;Can&#8217;t you just&#8230;?&#8221;</strong></p>
<p>Why is this my least favorite phrase? Because:</p>
<ol>
<li>It&#8217;s always in conjunction with a task that the questioner does not understand, but assumes should not be difficult at all;</li>
<li>it is inherently second-guessing the person being asked, which is insulting;</li>
<li>and, rather than asking if something is possible, as in &#8220;Can you?&#8221; or &#8220;Could you?&#8221;, the speaker is really saying, &#8220;This must be possible, and if you can&#8217;t do it, you&#8217;re an idiot.&#8221;</li>
</ol>
<p>If you don&#8217;t understand how the system works, or what is involved with doing a task, please, ask if something is possible. Don&#8217;t demean the craftsman or browbeat them into doing whatever it is you want. A resentful craftsman is not on your side, and will not go out of his/her way to help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/02/23/my-least-favorite-phrase/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using mysql2 on Windows</title>
		<link>http://saratrice.com/2011/02/19/using-mysql2-on-windows/</link>
		<comments>http://saratrice.com/2011/02/19/using-mysql2-on-windows/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 04:25:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=211</guid>
		<description><![CDATA[Another edition of Sara uses Rails on Windows! *muppety fanfare* Trying to get mysql2 to run on Windows is a bit of a pain. I used the lovely installer from Railsinstaller.org and then created an app with : rails new testapp -d mysql and then bundled. By default this installs the mysql2 gem. There are [...]]]></description>
			<content:encoded><![CDATA[<p>Another edition of Sara uses Rails on Windows! *muppety fanfare*</p>
<p>Trying to get mysql2 to run on Windows is a bit of a pain. I used the lovely installer from <a href="http://railsinstaller.org/" target="_blank">Railsinstaller.org</a> and then created an app with :</p>
<blockquote><p>rails new testapp -d mysql</p></blockquote>
<p>and then bundled.</p>
<p>By default this installs the mysql2 gem. There are some gotchas, and hopefully this will help:</p>
<ol>
<li>You have to install mysql first (derp!). Go <a href="http://dev.mysql.com/downloads/mysql/" target="_blank">here</a> and pick either the 32 or 64 bit MSI installer, and use <a href="http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/" target="_blank">this guide</a> to pick your options during the install (section II). I know, it&#8217;s an old guide, but it works fine. And it has pictures!</li>
<li>You may get this error: &#8220;%1 is not a valid Win32 application.&#8221; This means you need to go <a href="http://www.mysql.com/downloads/connector/c" target="_blank">here</a> and get libmysql.dll, and copy it into <strong>c:\RailsInstaller\Ruby1.8.7\bin</strong>. Get the right version or your migrations will fail when you try to add indexes &#8211; the MySQL 5.5.9 64-bit version of libmysql.dll will NOT work! I got this version and it worked just fine: mysql-connector-c-noinstall-6.0.2-win32-vs2005.zip (you don&#8217;t need the MSI installer for this one, just grab a zippy file).</li>
<li>Next error you may get is &#8220;rbreadline.rb:4404: uninitialized constant RbReadline::Encoding (NameError)&#8221;. Thanks to <a href="http://tom.net.nz/2010/09/installing-diaspora-on-windows/" target="_blank">this blog post</a> I found the answer is to go into <strong>c:\RailsInstaller\Ruby1.8.7\lib\ruby\site_ruby\1.8\rbreadline.rb</strong>, and comment out line 4404.</li>
</ol>
<p>There you go! Rake away!</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/02/19/using-mysql2-on-windows/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Github, https, and you</title>
		<link>http://saratrice.com/2011/02/15/github-https-and-you/</link>
		<comments>http://saratrice.com/2011/02/15/github-https-and-you/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 01:25:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=209</guid>
		<description><![CDATA[Banged my head against this for a while. Starting a new rails project, trying to get rails.js from github, but it&#8217;s failing every time: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) So (after a lot of googling) I opened up gems/jquery-rails-0.2.7/lib/generators/jquery/install/install_generator.rb and added this just after the beginning of the [...]]]></description>
			<content:encoded><![CDATA[<p>Banged my head against this for a while. Starting a new rails project, trying to get rails.js from github, but it&#8217;s failing every time:</p>
<blockquote><p>SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)</p></blockquote>
<p>So (after a lot of googling) I opened up gems/jquery-rails-0.2.7/lib/generators/jquery/install/install_generator.rb and added this just after the beginning of the InstallGenerator class (&#8220;class InstallGenerator &lt; ::Rails::Generators::Base&#8221;) :</p>
<blockquote>
<div id="_mcePaste">require &#8216;openssl&#8217;</div>
<div id="_mcePaste">OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE</div>
</blockquote>
<div>All fixed! Pulled down the file with no hiccups.</div>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2011/02/15/github-https-and-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pik and Git Bash on Windows 7</title>
		<link>http://saratrice.com/2010/11/11/pik-and-git-bash-on-windows-7/</link>
		<comments>http://saratrice.com/2010/11/11/pik-and-git-bash-on-windows-7/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 04:27:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=204</guid>
		<description><![CDATA[Lately I&#8217;ve been installing Ruby on Rails on Windows 7, and have run into a few people trying to make my life easier. One is Sarah Mei, a wonderful member of devchix who has posted a guide for getting things running.  Hearts and bunnies and flowers for her. Pik is a neat project for Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been installing Ruby on Rails on Windows 7, and have run into a few people trying to make my life easier. One is <a href="http://www.sarahmei.com/blog/" target="_blank">Sarah Mei</a>, a wonderful member of devchix who has posted <a href="http://www.wiki.devchix.com/index.php?title=Server_2003" target="_blank">a guide for getting things running</a>.  Hearts and bunnies and flowers for her.</p>
<p><strong>Pik </strong>is a neat project for Windows that helps you switch between installed versions of ruby. I&#8217;m using the <strong>Git Bash</strong> shell (as mentioned in the guide above), so I had to do a bit of tweaking, and maybe you do too, so here goes:</p>
<p>For some reason the installer didn&#8217;t create my .pik/.pikrc file in my home directory, so if yours didn&#8217;t create either, this is how it should look:</p>
<blockquote>
<pre>#!/bin/sh
pik_path=C:\\pik

function pik {
$pik_path/pik_runner.exe pik.sh $@
[[ -s $USERPROFILE/.pik/pik.sh ]] &amp;&amp; source $USERPROFILE/.pik/pik.sh
unset GEM_HOME
unset GEM_PATH
}</pre>
</blockquote>
<p>Those last two lines within the pik function are because something isn&#8217;t working in the current version and the gems aren&#8217;t being loaded when you switch versions.</p>
<p>Once you have your .pikrc add this line to your .bash_profile (create one if you don&#8217;t have it in your home directory):</p>
<blockquote>
<pre>[[ -s $USERPROFILE/.pik/.pikrc ]] &amp;&amp; source $USERPROFILE/.pik/.pikrc
</pre>
</blockquote>
<p>Hooray!</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2010/11/11/pik-and-git-bash-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ImageMagick: &#8220;convert: color profile operates on another colorspace `icc&#8217;&#8221;</title>
		<link>http://saratrice.com/2010/11/03/imagemagick-convert-color-profile-operates-on-another-colorspace-icc/</link>
		<comments>http://saratrice.com/2010/11/03/imagemagick-convert-color-profile-operates-on-another-colorspace-icc/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 22:06:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://saratrice.com/?p=202</guid>
		<description><![CDATA[Another installment of Sara Beats Her Head Against Tech: When trying to convert images from RGB to CMYK with ImageMagick, the regular command to convert: convert original.jpg -colorspace CMYK new.jpg worked &#8211; but the converted image&#8217;s colors looked absolutely terrible. So I downloaded some color profiles, and tried to use them: convert original.jpg -colorspace CMYK [...]]]></description>
			<content:encoded><![CDATA[<p>Another installment of Sara Beats Her Head Against Tech:</p>
<p>When trying to convert images from RGB to CMYK with ImageMagick, the regular command to convert:</p>
<blockquote><p>convert original.jpg -colorspace CMYK new.jpg</p></blockquote>
<p>worked &#8211; but the converted image&#8217;s colors looked absolutely terrible. So I downloaded some color profiles, and tried to use them:</p>
<blockquote><p>convert original.jpg -colorspace CMYK -profile sRGB_v4_ICC_preference.icc -profile Photoshop5DefaultCMYK.icc new.jpg</p></blockquote>
<p>which just gave me the error:</p>
<blockquote><p>convert: color profile operates on another colorspace `icc&#8217;</p></blockquote>
<p>Searching the internet gave me absolutely no answers on any forum. Then I noticed in the docs, the example given for using profiles when the original has no profile embedded already was:</p>
<blockquote><p>convert rgb_image.jpg -profile sRGB.icc  -profile USCoat.icm cmyk_image.jpg</p></blockquote>
<p>Wait. Something&#8217;s missing&#8230; AHA! The -colorspace option was missing!</p>
<blockquote><p>convert original.jpg -profile sRGB_v4_ICC_preference.icc -profile Photoshop5DefaultCMYK.icc new.jpg</p></blockquote>
<p>Works like a champ. So, if you&#8217;re getting the error &#8220;convert: color profile operates on another colorspace `icc&#8217;,&#8221; try making sure you&#8217;re not specifying BOTH the colorspace and the profile(s).</p>
]]></content:encoded>
			<wfw:commentRss>http://saratrice.com/2010/11/03/imagemagick-convert-color-profile-operates-on-another-colorspace-icc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

