<?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>Musings &#187; Google</title>
	<atom:link href="http://blog.fpmurphy.com/tag/google/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.fpmurphy.com</link>
	<description>of an OS plumber</description>
	<lastBuildDate>Wed, 11 Jan 2012 19:14:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google Page Translator</title>
		<link>http://blog.fpmurphy.com/2008/12/google-translator.html</link>
		<comments>http://blog.fpmurphy.com/2008/12/google-translator.html#comments</comments>
		<pubDate>Sat, 20 Dec 2008 11:46:00 +0000</pubDate>
		<dc:creator>fpmurphy</dc:creator>
				<category><![CDATA[GOOGLE TRANSLATE]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.fpmurphy.com/2008/12/google-page-translator.html</guid>
		<description><![CDATA[<p>Today, I added a gadget to my blog so that readers can easily translate my posts into any one of thirty five languages using the Google Translate webpage language translation engine.&#160;&#160;You will find it low on the left hand side of this webpage.&#160;&#160;From the drop down list, just pick the language you want to convert the current post to and after a short delay a new webpage will appear with the post displayed in the selected language.&#160;&#160;Note &#8211; you need to have scripts enabled in your browser for the Google gadget to display on this webpage.</p> <p>Adding this functionality was more challanging than I initially assumed since I wanted to ensure that my posts remained useful to a reader when displayed in a foreign language.&#160;&#160;This means that the translation engine needs to be told what words and sections to leave alone as is.&#160;&#160;The Google documentation and FAQ for this gadget are unclear about how to do this for things like my display boxes so a round of experimentation was required.&#160;&#160;It turns out that you can mark a entire webpage, a word or a section of a webpage as not to be translated using the follows tags. &#60;!-- use meta element to protect entire webpage --&#62; &#60;meta name='google' value='notranslate'&#62; &#60;!-- use span element to protect a word or two --&#62; &#60;span class='notranslate'&#62;Do not translate these words&#60;/span&#62; &#60;!-- use div element to protect display boxes such this --&#62; &#60;div class='notranslate'&#62;Do not translate entire section&#60;/div&#62; <p> Now that I have figured out how to protect specific text and code snippets from being translated by the Google translation engine, I plan to go back and modify my previous posts over a period of time to make them more robust for automated language translation.</p> <p>This will be quite a project as I typically include a number of programming langauge reserved words and code snippets in my posts.&#160;&#160;For example, it required over 100 edits to my previous post on Microsoft&#8217;s Powershell before I was happy that that particular post was suitable for automated language translation.</p> <p>UPDATE 7/1/2009 This post was written when I was using Blogspot. I have not yet decided how to implement machine translation of my posts on blog.fpmurphy.com. However I do plan to implement something soon.</p> ]]></description>
		<wfw:commentRss>http://blog.fpmurphy.com/2008/12/google-translator.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Globetrotting Woes</title>
		<link>http://blog.fpmurphy.com/2008/11/google-woes-when-globe-trotting.html</link>
		<comments>http://blog.fpmurphy.com/2008/11/google-woes-when-globe-trotting.html#comments</comments>
		<pubDate>Sun, 30 Nov 2008 04:13:00 +0000</pubDate>
		<dc:creator>fpmurphy</dc:creator>
				<category><![CDATA[FireFox]]></category>
		<category><![CDATA[Lenovo]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.fpmurphy.com/2008/11/google-globetrotting-woes.html</guid>
		<description><![CDATA[<p>I am currently on the beautiful island of Cebu in the Philippines visiting with my old friend and colleague Charles Richmond at IISC and giving some talks on OS internals.&#160; I use a Lenovo Thinkpad laptop running Windows Vista Ultimate when travelling with Mozilla Firefox 3 as my default browser.</p> <p>Firefox 3 comes with a default Search Bar on the top right hand corner containing a number of default search engines including Google. If I type a search term in the Google Search Bar option, Google figures out behind the scenes that I am located in the Philippines, redirects me to www.google.com.ph and displays the search results with the interface language set Filipino (also spelt as Pilipino) as shown here.</p> <p> This is not too much of a hindrance in the Philippines but becoming a total annoyance when in Japan, China, Vietman and many other countries. The standard workaround for this is to force Google to display its interface language in English by going to Google.com and setting your user preferences to English which results in Google.com creating a cookie on your machine to persist your preferences.</p> <p>Maybe it is a bit of overkill or paranoia but I have Firefox set up to delete all cookies when terminating a session for the purpose of personal privacy and security. Thus Google defaults back to whatever interface language Google defaults to for the country that Google thinks I am currently in the next time I fire up Firefox and go to Google.com.</p> <p>One way to overcome this problem is not to use the Firefox search bar but instead to browse to www.google.com/ncr where NCR stands for No Country Redirect before performing any searchs. Rather than going this route, I decided to write my own Search Engine plug-in so that I always get an English interface when I use the Firefox Google search toolbar. It turns out that this is quite easy to do once you understand what is required.</p> <p>Cut and paste the following code into a file called GoogleEN.xml and save the file.</p> &#60;SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"&#62; &#60;ShortName&#62;GoogleEN&#60;/ShortName&#62; &#60;Description&#62;Google Search (NCR English)&#60;/Description&#62; &#60;InputEncoding&#62;UTF-8&#60;/InputEncoding&#62; &#60;Image width="16" height="16"&#62;data:image/x-icon;base64, AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQA AAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAACZMwD/mTMA/5kzAP+ZMwD/mTMA/5k zAP+ZMwD/mTMA/5kzAP+ZMwD/mTMA/5kzAP+Z MwD/mTMA/5kzAP+ZMwD/mTMA///////////// ///////////////////////////////////// //////////////////////////mTMA/5kzAP/ ////////////////48u//0a2g/71vWP+hLgz/ pCUI/5xDG/+dRRz/pFIs/7ibk//q4+D////// 5kzAP+ZMwD////////////q0MX/pDIP/6gxC/ /kq5H//fj1//////////////////zezv+MHgf /r5SE//////+ZMwD/mTMA///////36+X/pjAL /6YwC//Wr5z////////////////////////// //97eX/jB4G/7ecjP//////mTMA/5kzAP//// //4ZJu/5o5DP/Hm4j//////////////////// ///bk2/+gUCv/mD4V/54rCP+vhm7//////5kz AP+ZMwD///7+/7xPHf+dLAn/+PXz/wAA///// ////////wAA/////fz/AAD///bRv//52Mf/AA D//wAA//+ZMwD/mTMA//77+f+uNAz/nzcZ/// ///8AAP///////wAA//8AAP///////wAA//// ////AAD//wAA////////mTMA/5kzAP/++/n/t FUo/5RAG///////AAD//wAA////////AAD/// ////8AAP//AAD//wAA/////////////5kzAP+ ZMwD////+/7xVLv+WPBf//////wAA//8AAP// /////wAA////////AAD/////////////AAD// /////+ZMwD/mTMA///////plHP/mDUR////// 8AAP////////////8AAP///////wAA//8AAP/ /AAD//wAA////////mTMA/5kzAP//////8cm8 /607FP+6jn//+Ojl///////////////////// ///////9+7q//b08v///////////5kzAP+ZMw D////////////yu6X/qD4Z/8eQgP/46OX//// /////////////7Luz/55IIf95JQj/9O3q//// //+ZMwD/mTMA//////////////////PFuP/Pa Uj/uDUO/7U0Cf+1NAr/tTQJ/6k2Ff/dqJH/8t DD//79/f//////mTMA/5kzAP///////////// ///////////////38+f/48uz/9e3m//bv6P/7 +PX//////////////////////5kzAP+ZMwD/m TMA/5kzAP+ZMwD/mTMA/5kzAP+ZMwD/mTMA/5 kzAP+ZMwD/mTMA/5kzAP+ZMwD/mTMA/5kzAP+ ZMwD/AACsQQAArEEAAKxBAACsQQAArEEAAKxB AACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQ QAArEEAAKxBAACsQQ== &#60;/Image&#62; &#60;Url type="text/html" method="GET" &#160;&#160;&#160;template="http://www.google.com/search"&#62; ]]></description>
		<wfw:commentRss>http://blog.fpmurphy.com/2008/11/google-woes-when-globe-trotting.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not your Grandfather&#8217;s dd Utility!</title>
		<link>http://blog.fpmurphy.com/2008/10/recent-article-on-red-hat-magazine-by.html</link>
		<comments>http://blog.fpmurphy.com/2008/10/recent-article-on-red-hat-magazine-by.html#comments</comments>
		<pubDate>Sat, 25 Oct 2008 16:34:00 +0000</pubDate>
		<dc:creator>fpmurphy</dc:creator>
				<category><![CDATA[dd]]></category>
		<category><![CDATA[Google Charts]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.fpmurphy.com/2008/11/not-your-grandfathers-dd-utility.html</guid>
		<description><![CDATA[<p>A recent article in Red Hat Magazine by Noah Gift and Grig Gheorghiu called &#8220;This isn&#8217;t your grandpappy&#8217;d dd command demonstrated how to use Python, the dd utility and the Google Chart API to produce a bar chart showing throughput at different block sizes. However the output from the Python script was not the actual graph but a URL which you then had to paste into a Web browser to view the resulting chart.</p> <p>I though this script would be useful but did not want to have to cut and paste a URL into a Web browser so I decided to eliminate that step.</p> <p>This Python script is loosely based on their script but uses the Python urllib libraries to connect to Google Charts to generate a PNG image file which is subsequently displayed using pyGTK+ routines. #!/usr/bin/env python import sys import os import commands import re from optparse import OptionParser import urllib import urllib2 import pygtk pygtk.require('2.0') import gtk class DisplayGraph: def delete_event(self, widget, event, data=None): &#160;&#160;&#160;return False def destroy(self, widget, data=None): &#160;&#160;&#160;gtk.main_quit() def __init__(self): &#160;&#160;&#160;self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) &#160;&#160;&#160;self.window.connect("delete_event", self.delete_event) &#160;&#160;&#160;self.window.connect("destroy", self.destroy) &#160;&#160;&#160;self.window.set_border_width(10) &#160;&#160;&#160;self.window.set_position(gtk.WIN_POS_CENTER) &#160;&#160;&#160;self.window.set_title("Disk Throughput") &#160;&#160;&#160;pixbuf = gtk.gdk.pixbuf_new_from_file("/tmp/dd.png") &#160;&#160;&#160;os.remove("/tmp/dd.png") &#160;&#160;&#160;self.image = gtk.Image() &#160;&#160;&#160;self.image.set_from_pixbuf(pixbuf) &#160;&#160;&#160;self.image.show() &#160;&#160;&#160;self.window.add(self.image) &#160;&#160;&#160;self.window.show() def main(self): &#160;&#160;&#160;gtk.main() class GoogleChart: def __init__(self): &#160;&#160;&#160;self.gchart_url = "http://chart.apis.google.com/chart?" &#160;&#160;&#160;self.gchart_type = "cht=bvs" &#160;&#160;&#160;self.gchart_title = "&#38;chtt=" &#160;&#160;&#160;self.gchart_data = "&#38;chd=t:" &#160;&#160;&#160;self.gchart_labels = "&#38;chxl=0:&#124;" &#160;&#160;&#160;self.gchart_size = "&#38;chs=400x250" &#160;&#160;&#160;self.gchart_axis_labels = "&#38;chxt=x,y,x,y" &#160;&#160;&#160;self.gchart_axis_position = "&#38;chxp=2,50&#124;3,50" &#160;&#160;&#160;self.gchart_bar_settings = "&#38;chbh=30,15" def title(self,title): &#160;&#160;&#160;self.gchart_title = self.gchart_title + title def write(self, data, labels, max_t): &#160;&#160;&#160;&#160;self.gchart_data = self.gchart_data + data.rstrip(',') &#160;&#160;&#160;&#160;self.gchart_labels = self.gchart_labels \ &#160;&#160;&#160;&#160;&#160;&#160;+ labels + "2:&#124;Block%20Size&#124;3:&#124;Mb/s" &#160;&#160;&#160;&#160;self.gchart_axis_range = "&#38;chxr=1,0," + str(max_t+10.0) &#160;&#160;&#160;&#160;self.gchart_scaling = "&#38;chds=0," + str(max_t+10.0) &#160;&#160;&#160;&#160;self.gchart_url += self.gchart_type \ &#160;&#160;&#160;&#160;&#160;&#160;+ self.gchart_title + self.gchart_size &#160;&#160;&#160;&#160;self.gchart_url += self.gchart_bar_settings \ &#160;&#160;&#160;&#160;&#160;&#160;+ self.gchart_data + self.gchart_labels &#160;&#160;&#160;&#160;self.gchart_url += self.gchart_axis_labels \ &#160;&#160;&#160;&#160;&#160;&#160;+ self.gchart_axis_position &#160;&#160;&#160;&#160;self.gchart_url += self.gchart_axis_range \ &#160;&#160;&#160;&#160;&#160;&#160;+ self.gchart_scaling &#160;&#160;&#160;opener = urllib2.urlopen(self.gchart_url) &#160;&#160;&#160;if opener.headers['content-type'] != 'image/png': &#160;&#160;&#160;&#160;&#160;&#160;raise BadContentTypeException('Server responded' \ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'with a content-type of %s' \ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;% opener.headers['content-type']) &#160;&#160;&#160;open("/tmp/dd.png", 'wb').write(opener.read()) def get_disk_throughput(device, blocksize): &#160;&#160;&#160;blocksize = str(blocksize) + 'k' &#160;&#160;&#160;cmd = "dd if=/dev/zero of=%s bs=%s" % (device,blocksize) &#160;&#160;&#160;output = commands.getoutput(cmd) &#160;&#160;&#160;throughput = 0 &#160;&#160;&#160;unit = "" &#160;&#160;&#160;for line in output.split('n'): &#160;&#160;&#160;&#160;&#160;&#160;s = re.search(' copied,.*, (\S+) (\S+)$', line) &#160;&#160;&#160;&#160;&#160;&#160;if s: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throughput = s.group(1) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unit = s.group(2) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break &#160;&#160;&#160;return (throughput, unit) if __name__ == "__main__": &#160;&#160;&#160;usage = "Usage: %prog options" &#160;&#160;&#160;parser = OptionParser(usage=usage) &#160;&#160;&#160;parser.add_option("-d", "--device", dest="device", \ &#160;&#160;&#160;&#160;&#160;&#160;help="Device to use. Disk data will be overwritten!") &#160;&#160;&#160;(options, args) = parser.parse_args() &#160;&#160;&#160;device = options.device &#160;&#160;&#160;if not device: &#160;&#160;&#160;&#160;&#160;&#160;parser.print_help() &#160;&#160;&#160;&#160;&#160;&#160;sys.exit(1) ]]></description>
		<wfw:commentRss>http://blog.fpmurphy.com/2008/10/recent-article-on-red-hat-magazine-by.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

