<?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>Trevor Power &#187; Uncategorized</title>
	<atom:link href="http://blog.trevorpower.com/index.php/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.trevorpower.com</link>
	<description>Software development and other thoughts</description>
	<lastBuildDate>Fri, 20 Aug 2010 07:33:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MongoMapper callbacks/hooks</title>
		<link>http://blog.trevorpower.com/index.php/mongomapper-callbackshooks/</link>
		<comments>http://blog.trevorpower.com/index.php/mongomapper-callbackshooks/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 21:23:21 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[callbacks]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[MongoMapper]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.trevorpower.com/?p=310</guid>
		<description><![CDATA[It took me a while to find these, so I thought I would post them here. In the end I had to search the source code to find them.
:before_save,                        :after_save,
:before_create,   [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fmongomapper-callbackshooks%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fmongomapper-callbackshooks%2F" height="61" width="51" /></a></div><p>It took me a while to find these, so I thought I would post them here. In the end I had to search the <a href="http://github.com/jnunemaker/mongomapper">source code</a> to find them.</p>
<pre name="code" class="ruby:nocontrols:nogutter">:before_save,                        :after_save,
:before_create,                      :after_create,
:before_update,                      :after_update,
:before_validation,                  :after_validation,
:before_validation_on_create,        :after_validation_on_create,
:before_validation_on_update,        :after_validation_on_update,
:before_destroy,                     :after_destroy,
:validate_on_create,                 :validate_on_update,
:validate</pre>
<p>I was searching for these amongst MongoMapper doucmentation and blog posts when really they are an ActiveSupport concept as the following comment suggests:</p>
<blockquote><p>Almost all of this callback stuff is pulled directly from ActiveSupport . . .</p></blockquote>
<p>Being new to rails I wasn&#8217;t very familiar with the ActiveSupport stuff and so I didn&#8217;t know to look there. Anyway this is how I use them in my posts model:</p>
<pre name="code" class="ruby:nocontrols:nogutter">class Post
  include MongoMapper::Document

  many :comments

  key :title, String, :required => true
  key :slug, String
  key :body, String, :required => true
  key :published, Boolean
  key :published_on, Date, :default => Date.today

  after_save :update_comment_titles

  private

    def update_comment_titles
      comments.each do |comment|
        comment.post_title = self.title
        comment.save
      end
    end

end</pre>
<p>My comments live in a separate document collection and each Comment document contains the title of the Post that it belongs to. This allows me to list all comments (on the admin page for example) without having to query any of the Post documents.</p>
<p>This above after_save call back ensures that the post_title on each Comment is updated if I ever update the title of the post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/mongomapper-callbackshooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wickes 1 &#8211; 0 Maplin</title>
		<link>http://blog.trevorpower.com/index.php/wickes-1-0-maplin/</link>
		<comments>http://blog.trevorpower.com/index.php/wickes-1-0-maplin/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 21:40:57 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.trevorpower.com/?p=175</guid>
		<description><![CDATA[I was in a Maplin store yesterday returning a set of precision screw drivers that were of such poor quality that I asked to see the manager to complain. I showed the manager where it said &#8220;Quality Tools&#8221; on the box then I showed him how the tiny shafts just rotated in the handles and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fwickes-1-0-maplin%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fwickes-1-0-maplin%2F" height="61" width="51" /></a></div><p>I was in a Maplin store yesterday returning a set of precision screw drivers that were of such <a href="http://www.maplin.co.uk/Module.aspx?ModuleNo=3819">poor quality</a> that I asked to see the manager to complain. I showed the manager where it said &#8220;Quality Tools&#8221; on the box then I showed him how the tiny shafts just rotated in the handles and came off. I showed how the ones that didn&#8217;t fall apart weren&#8217;t even straight (so crooked that they couldn&#8217;t be used).</p>
<p>They were so bad that I was expecting a &#8220;wow, I&#8217;ll have to take them off the shelves straight away&#8221;. But what I got was: </p>
<blockquote><p>Yeah, they&#8217;re pretty bad but we didn&#8217;t make them.</p></blockquote>
<p>I was told that any complaints should be addressed at the manufacturer!</p>
<p>On a positive note I stopped in Wickes (recommended by a friend) on my way home and picked up a set of precision screw drivers for around the same price.</p>
<p>They were Wickes own brand so I wasn&#8217;t expecting much but the quality was far superior to what I got from Maplin. Even the plastic case they came in was sturdy and practical. So if you&#8217;re in the Limerick area and looking for <a href="http://www.wickes.ie/">good value tools</a> I can recommend Wickes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/wickes-1-0-maplin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have too much money?</title>
		<link>http://blog.trevorpower.com/index.php/have-too-much-money/</link>
		<comments>http://blog.trevorpower.com/index.php/have-too-much-money/#comments</comments>
		<pubDate>Thu, 19 Jan 2006 14:45:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Donate]]></category>
		<category><![CDATA[Money]]></category>
		<category><![CDATA[Paypal]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=14</guid>
		<description><![CDATA[Just give it to me!











You will be paying securely via PayPal.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fhave-too-much-money%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fhave-too-much-money%2F" height="61" width="51" /></a></div><p>Just give it to me!</p>
<p><center><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="trevor_power@yahoo.com">
<input type="hidden" name="item_name" value="Trevor Power">
<input type="hidden" name="item_number" value="TP">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"></form>
<p><i>You will be paying securely via PayPal.</i><br /></center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/have-too-much-money/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Currys &#8230;lots of worries</title>
		<link>http://blog.trevorpower.com/index.php/currys-lots-of-worries/</link>
		<comments>http://blog.trevorpower.com/index.php/currys-lots-of-worries/#comments</comments>
		<pubDate>Mon, 16 Jan 2006 09:14:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=13</guid>
		<description><![CDATA[I don&#8217;t want my blog to become somewhere that I complain about everything but I have to get this of my chest. Here is a currently ongoing story of me trying to get vouchers for a replacement camera that I am owed from Currys in Limerick.
Remember it&#8217;s a blog, so read form the bottom to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fcurrys-lots-of-worries%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fcurrys-lots-of-worries%2F" height="61" width="51" /></a></div><p>I don&#8217;t want my blog to become somewhere that I complain about everything but I have to get this of my chest. <a href="http://coverplan.blogspot.com">Here</a> is a <i>currently</i> ongoing story of me trying to get vouchers for a replacement camera that I am owed from Currys in Limerick.</p>
<p>Remember it&#8217;s a blog, so read form the bottom to get the full story.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/currys-lots-of-worries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blogger has let me down</title>
		<link>http://blog.trevorpower.com/index.php/blogger-has-let-me-down/</link>
		<comments>http://blog.trevorpower.com/index.php/blogger-has-let-me-down/#comments</comments>
		<pubDate>Mon, 19 Sep 2005 16:27:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=12</guid>
		<description><![CDATA[I was on holiday last week, in the north of the country. I was a way from internet access for most of the week but I decided to send some MMS pictures of the places I was at to this blog. I had sent about 6 or 7 photos, which is not free, and towards [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fblogger-has-let-me-down%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fblogger-has-let-me-down%2F" height="61" width="51" /></a></div><p>I was on holiday last week, in the north of the country. I was a way from internet access for most of the week but I decided to send some MMS pictures of the places I was at to this blog. I had sent about 6 or 7 photos, which is not free, and towards the end of the week I was looking forward to seen how my travels looked. I found an internet cafe but when I checked my blog I was very disappointed to see that it hadn&#8217;t changed.</p>
<p>I have posted MMS messages to my blog before and found it to be an excellent service, the best use of MMS I&#8217;ve seen to date.</p>
<p>I could of course add my entries now by sending the photo via bluetooth and trying to recall the date, time and place <b>but it just isn&#8217;t the same</b>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/blogger-has-let-me-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Currency conversion in Google</title>
		<link>http://blog.trevorpower.com/index.php/currency-conversion-in-google/</link>
		<comments>http://blog.trevorpower.com/index.php/currency-conversion-in-google/#comments</comments>
		<pubDate>Tue, 06 Sep 2005 16:31:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=11</guid>
		<description><![CDATA[When I first found out about using the google search as a calculator I was very impressed. I experimented with different units such as &#8220;one and a half parallax seconds a year in angstroms per second&#8220;. I was, however, immediately disappointed when I tried to use currencies in my calculations and they wouldn&#8217;t work.
But now [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fcurrency-conversion-in-google%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fcurrency-conversion-in-google%2F" height="61" width="51" /></a></div><p>When I first found out about using the google search as a calculator I was very impressed. I experimented with different units such as &#8220;<a href="http://www.google.com/search?q=one+and+a+half+parallax+seconds+a+year+in+angstroms+per+second">one and a half parallax seconds a year in angstroms per second</a>&#8220;. I was, however, immediately disappointed when I tried to use currencies in my calculations and they wouldn&#8217;t work.</p>
<p>But now Google have added a <a href="http://www.google.com/help/features.html#currency">currency converter</a> to their search so you can do things like &#8220;<a href="http://www.google.com/search?hl=en&#038;lr=lang_en&#038;c2coff=1&#038;q=50+pounds+a+mile+in+€%2Fkm&#038;btnG=Search">50 pounds a mile in €/km</a>&#8220;.</p>
<p>Now you can price some flooring you&#8217;re looking at in the north like this &#8220;<a href="http://www.google.com/search?hl=en&#038;lr=lang_en&#038;c2coff=1&#038;q=12+british+pounds+per+square+foot+*+nine+square+meters+in+euros">12 british pounds per square foot * nine square meters in euros</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/currency-conversion-in-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>amazon.co.uk scam Euro shoppers</title>
		<link>http://blog.trevorpower.com/index.php/amazon-co-uk-scam-euro-shoppers/</link>
		<comments>http://blog.trevorpower.com/index.php/amazon-co-uk-scam-euro-shoppers/#comments</comments>
		<pubDate>Tue, 06 Sep 2005 08:11:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=10</guid>
		<description><![CDATA[I have just discovered a scam used by amazon.co.uk to trick Euro shoppers into buying products from them.
I am an Irish user of the amazon website and as such I pay attention to the &#8216;approx&#8217; Euro price of products when shopping around for the best price. This Euro price I thought was an &#8216;approx&#8217; because [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Famazon-co-uk-scam-euro-shoppers%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Famazon-co-uk-scam-euro-shoppers%2F" height="61" width="51" /></a></div><p>I have just discovered a scam used by <a href="http://www.amazon.co.uk">amazon.co.uk</a> to trick Euro shoppers into buying products from them.</p>
<p>I am an Irish user of the amazon website and as such I pay attention to the &#8216;approx&#8217; Euro price of products when shopping around for the best price. This Euro price I thought was an &#8216;approx&#8217; because of the varying exchange rates, but I always assumed it was close enough to use. This is not the case!</p>
<p>The sterling price given for items contains VAT for the UK. The Euro price for items contains no VAT at all. It doesn&#8217;t say &#8216;ex. vat.&#8217; or any other indication that the price you see in Euros can be a lot less than the price you will pay. Even when I am logged in an they know what country I am from they still leave out VAT on the Euro price.</p>
<p>When I asked amazon about this they said, <i>&#8220;When VAT applies to an order, the relevant VAT charges for the country of destination will be clearly reflected on your e-mail confirmations and invoices.&#8221;</i></p>
<p><b>But it is too late!</b> You have shopped around and decided to buy the item from amazon and only then do they say anything about VAT.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/amazon-co-uk-scam-euro-shoppers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AuctionSniper.com</title>
		<link>http://blog.trevorpower.com/index.php/auctionsniper-com/</link>
		<comments>http://blog.trevorpower.com/index.php/auctionsniper-com/#comments</comments>
		<pubDate>Tue, 23 Aug 2005 10:05:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=9</guid>
		<description><![CDATA[I&#8217;ve started using AuctionSniper.com to do my ebay bidding. It didn&#8217;t work the first time I&#8217;ve tried it but I have since won auctions at bargain prices.
A nice feature is bidding groups. Here you can bid on a group of items until you have won enough. For example if you want a hard-drive, you would [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fauctionsniper-com%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fauctionsniper-com%2F" height="61" width="51" /></a></div><p>I&#8217;ve started using <a href='http://www.auctionsniper.com/?how=trev_power'>AuctionSniper.com</a> to do my ebay bidding. It didn&#8217;t work the first time I&#8217;ve tried it but I have since won auctions at bargain prices.</p>
<p>A nice feature is bidding groups. Here you can bid on a group of items until you have won enough. For example if you want a hard-drive, you would look on ebay for any hard-drives you would like, give a max bid for each and auctionsniper will keep last-minute bidding on each of the items until you have won one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/auctionsniper-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phone wallpapers</title>
		<link>http://blog.trevorpower.com/index.php/phone-wallpapers/</link>
		<comments>http://blog.trevorpower.com/index.php/phone-wallpapers/#comments</comments>
		<pubDate>Thu, 26 May 2005 10:30:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=7</guid>
		<description><![CDATA[I have uploaded some pictures that I use as wallpapers on my phone. You are free to download them from my website and use them on your own phone.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fphone-wallpapers%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fphone-wallpapers%2F" height="61" width="51" /></a></div><p>I have uploaded some pictures that I use as wallpapers on my phone. You are free to download them from my <a href="http://trevorpower.com/phonewallpaper.html">website</a> and use them on your own phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/phone-wallpapers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikipedia on my phone</title>
		<link>http://blog.trevorpower.com/index.php/wikipedia-on-my-phone/</link>
		<comments>http://blog.trevorpower.com/index.php/wikipedia-on-my-phone/#comments</comments>
		<pubDate>Wed, 25 May 2005 12:17:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=6</guid>
		<description><![CDATA[From time to time I would be browsing stuff on Wikipedia and come across an interesting article that I would like to read, but at a later time. Specifically I would like to be able to read it while away from the computer. I used to print off pages, but this proved to be a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fwikipedia-on-my-phone%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fwikipedia-on-my-phone%2F" height="61" width="51" /></a></div><p>From time to time I would be browsing stuff on <a href="http://www.wikipedia.org">Wikipedia</a> and come across an interesting article that I would like to read, but at a later time. Specifically I would like to be able to read it <em>while away from the computer</em>. I used to print off pages, but this proved to be a waste of paper (particularly when I end up not reading many printouts) and very messy (with lots of sheets of paper lying around).<br />I was thinking about buying an ebook reader but these are very expensive, so before spending a lot of money on a new device, I decided to try reading on my phone.<br />I had sent short notes to my phone before to read, so I tried this with a few wikipedia entries. I just cut &#038; pasted  the text from the web page to to a txt file and sent it to my phone. Later when I went to read them I realized that a note could only be 3000 characters long. This was way to short.</p>
<p>My next step was to download <a HREF="http://www.getjar.com/products/6/ReadManiacALibraryinthepocket">ReadManiac</a>. This is a very good reader that you can change font size and uses the screen to the maximum. Plus, it can read large files.</p>
<p>ReadManiac has a feature that lets you download eBooks by providing a url. I am now using this feature to download wikipedia entries as plain text via a script on my <a href="http://trevorpower.com/wikipedia.html">website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/wikipedia-on-my-phone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

