<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.andrewheiss.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>AndrewHeiss.com</title>
	
	<link>http://www.andrewheiss.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 28 Feb 2010 13:38:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.andrewheiss.com/AndrewHeiss" /><feedburner:info uri="andrewheiss" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Queen Rania at AUC</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/GrnxGDGS9bU/</link>
		<comments>http://www.andrewheiss.com/blog/2010/02/28/queen-rania-at-auc/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 13:27:57 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[civic engagement]]></category>
		<category><![CDATA[egypt]]></category>
		<category><![CDATA[jordan]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[queen rania]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/?p=212</guid>
		<description><![CDATA[On February 28, 2010 at the American University in Cairo, Jordan's Queen Rania gave a speech on the importance of civic engagement in the Arab world. While her idea that regular citizens need to be more involved in government, the hardhanded policies of Arab governments make it almost impossible for that to happen.]]></description>
			<content:encoded><![CDATA[<p>This morning AUC&#8217;s <a href="http://www.aucegypt.edu/ResearchatAUC/rc/gerhartcenter/Pages/default.aspx" title="Gerhart Center">John D. Gerhart Center for Civic Engagement</a> hosted a lecture by <a href="http://www.queenrania.jo/">Queen Rania al-Abdullah</a> of Jordan. Queen Rania is famous for being intensely involved in the public sphere and, according to the venerable <a href="http://en.wikipedia.org/wiki/Queen_Rania_of_Jordan">Wikipedia</a>, is considered one of the <a href="http://www.forbes.com/lists/2009/11/power-women-09_Queen-Rania_VZPS.html">world&#8217;s most powerful women</a>. She&#8217;s involved with a ton of foundations and NGOs that cover a wide range of goals, from advocating for improvement in girls&#8217; education and employment, promoting dialogue between the US and the Arab world, and calling for what became the buzzword of today&#8217;s lecture: civic engagement. She uses technology to promote her agenda of social improvement and is active on <a href="http://www.youtube.com/user/QueenRania">YouTube</a>, <a href="http://twitter.com/QueenRania">Twitter</a>, and <a href="http://www.facebook.com/QueenRania">Facebook</a>. Basically a beautiful, famous, powerful world leader.</p>

<p>Queen Rania focused primarily on the need for native grassroots movements in the Arab world, stating that civic engagement is an essential element of societal reform—changes so desperately needed in this region, where poverty and corruption are rampant. She stated that it is the responsibility of all citizens to take an interest in developing and improving their own country. Calling on Arabs to &#8220;look up&#8221; and think of others, she cited the example of one of AUC&#8217;s homegrown NGOs, <a href="http://www.ayb-sd.org/#history">Alashanek Ya Balady</a>, which is heavily involved in promoting sustainable development in Egypt&#8217;s poorest neighborhoods. The efforts of AYB and dozens of other organizations constitute a laudable homegrown effort to reform Egyptian society, and they have had lots of success so far.</p>

<p>The queen then went on to decry the current state of civic laziness in the Arab world, saying that many Arabs confuse the responsibilities of &#8220;citizenship&#8221; with &#8220;sitizenship,&#8221; opting to sit still, sit back, and complain rather than take their own initiative to change society. This is not because Arabs are disconnected, emotionless people—far from it. &#8220;We&#8217;re all passionate about food, family, football, and <a href="http://en.wikipedia.org/wiki/Palestinian_territories">Filistin</a>,&#8221; she said, but those passions need to be refocused on bringing about change instead of complacently complaining about the backwardness of Arab governments and societies.</p>

<p>She developed this theme by responding to a series of preselected questions that followed her main motivational speech, declaring that universities and academia are responsible for remaining engaged with society and not remain isolated in academia. Too often the educated class remains cynically aloof from the rest of the world and fails to contribute real change or instill the culture of civic engagement in their pupils. She also noted the role of Islam in developing this culture of engagement, saying that Islam inherently advocates civic reform and grassroots movements. She called on the audience to &#8220;recapture those compassionate values of Islam&#8221; that have been hijacked by Western media and use the power of faith to help improve society.</p>

<p>Essentially, she concluded, if we want to see any reform and improvement in the region, the onus is on citizens. Change in the Middle East cannot come from governments, since they are inherently inefficient. Real change can only come about with a change in attitude and an increase in engagement. Regular citizens are the driving factor for this change.</p>

<p>In the end it was a pretty motivating and inspiring speech, and I agree with most of what she said. Real, lasting change in the Middle East will need to come from some type of bottom-up popular movement, especially when the reforms so desperately needed reduce the power of the ruling class. However, repressive governments throughout the Arab world (including Rania’s Jordan) severely limit what progressive movements can do, and Middle Eastern dictatorships last for decades.</p>

<p>For example, Egypt’s current president, <a href="http://en.wikipedia.org/wiki/Hosni_Mubarak">Hosni Mubarak</a>, has been in power for almost 30 years. He ran the country uncontestedly until 2005, when, after pressure from George W. Bush,  Mubarak amended the constitution to allow candidates from parties other than the ruling National Democratic Party (NDP) to run in presidential elections. The first “free and fair” elections were held that year. Despite a somewhat large grassroots political opposition movement, <a href="http://news.bbc.co.uk/2/hi/middle_east/4709011.stm">Kifaya</a>, Mubarak won handily and his opponent, <a href="http://en.wikipedia.org/wiki/Ayman_Nour">Ayman Nour</a>, was arrested and sentenced to prison for five years. Today Kifaya, a native grassroots movement, is detoothed and powerless. Good thing civic engagement worked…</p>

<p>The next Egyptian presidential elections are slated for 2011, but since Mubarak is getting on in years (he’s 81!), he’s probably not going to run. Instead, it seems that his son, Gamal Mubarak, will inherit his father’s place. Sure, he’ll go through the farce of the election process, but the NDP politicos and thugs will pretty much guarantee his victory.</p>

<p>Understandably, there is a growing anti-Gamal movement in Egypt, and it’s even homegrown and grassrooty. It got a huge boost last week when <a href="http://en.wikipedia.org/wiki/Mohamed_ElBaradei">Mohamed ElBaradei</a>, former head of the IAEA and winner of a Nobel Prize, returned to Cairo after a decades-long pseudo-exile. He has announced that he would consider running for president in 2011 if circumstances allowed for it. He already has a large base of support and even an official-ish <a href="http://www.elbaradei2011.com/">campaign website</a>. <a href="http://www.npr.org/templates/story/story.php?storyId=124087093&amp;ft=1&amp;f=1009">American media</a> is picking up on him, too. He has a lot of international clout and could present a real threat to the Mubarak dynasty. He might have the potential of becoming the Egyptian Obama—“Yes we can!”</p>

<p>But (and this is a pretty big but…), he can’t even legally run—he’s not constitutionally permitted to run for president. For him to become president, Mubarak would first have to amend the constitution to open the field for more opposition parities. Then ElBaradei would actually have to win in elections run by the NDP. Yeah. Good luck there.</p>

<p>While the possibility of an ElBaradei run <a href="http://baheyya.blogspot.com/2010/02/wildcard_25.html">has Mubarak somewhat scared</a>, the cards are really stacked against him. This growing popular movement faces the impossible task of forcing a constitutional amendment. It’s a native movement, just like Queen Rania wants, but it is severely limited. Egyptians remain <a href="http://egyptianchronicles.blogspot.com/2010/02/elbaradei-let-keep-him-hope.html">hopeful</a>, but sadly, Gamal will most likely take over in 2011.</p>

<p>While Jordan, as a monarchy, doesn’t face these issues of presidential elections, it has its own slew of problems with citizenship. Although Rania herself is a Palestinian, the Jordanian government <a href="http://www.hrw.org/en/news/2010/02/01/jordan-stop-withdrawing-nationality-palestinian-origin-citizens">regularly withdraws Jordanian nationality and rights from Palestinian refugees</a>. How can native, grassroots Jordanian organizations reform when the government makes them stateless?</p>

<p>In her speech Rania exhorted AUCians: “Don’t wait for governments to change and reform. <em>You</em> must be the change you want to see.” Um. She’s <em>in</em> the Jordanian government. She’s the queen! She surely has some influence on the Jordanian political scene. Can’t she help the <em>government</em> change so that these popular groups can actually do something? Arab governments tolerate, even embrace, NGOs like AYB or the queen’s water projects in Jordan—they love this type of civic engagement. But heaven forbid these civically engaged movements threaten their despotic power, though.</p>

<p>Can real governmental and societal change happen in the Middle East solely through “civic engagement.” No way. Arab governments must make changes if any popular movements want to make substantial change.</p>

<p>So, while Queen Rania’s speech <em>was</em> inspiring and motivational on the surface, it was full of <em>kalaam fadi</em>—empty words.</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/GrnxGDGS9bU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2010/02/28/queen-rania-at-auc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2010/02/28/queen-rania-at-auc/</feedburner:origLink></item>
		<item>
		<title>flashbakectl released</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/P_0SnrH2wZE/</link>
		<comments>http://www.andrewheiss.com/blog/2009/09/23/flashbakectl-released/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:46:19 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[flashbake]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/09/23/flashbakectl-released/</guid>
		<description><![CDATA[flashbakectl is a handy little script that starts and stops Flashbake by loading and unloading plist files.]]></description>
			<content:encoded><![CDATA[<p>Adding to my apparent <a href="http://www.andrewheiss.com/blog/2009/08/18/itunes-plugin-for-flashbake/" title="iTunes plugin for Flashbake  &#8211;   AndrewHeiss.com">series of Flashbake addons</a>, I&#8217;ve just released <a href="http://github.com/andrewheiss/flashbakectl" title="andrewheiss's flashbakectl at master - GitHub"><code>flashbakectl</code></a>.<span id="more-208"></span></p>

<p>Normally to run <a href="http://wiki.github.com/commandline/flashbake" title="Home - flashbake - GitHub">Flashbake</a> consistently you need to set up a cron job. While OS X is built on Unix and has cron, Apple recommends using <code>launchd</code> and property list (plist) files to run system agents and daemons. <code>flashbakectl</code> is a handy little script that loads and unloads a plist for you.</p>

<p>Before working on your project, run <code>flashbakectl -l</code> to load the plist and start the daemon, which will commit your unsaved changes every 15 minutes (or whatever you set it to). When you&#8217;re done for the day, run <code>flashbakectl -u</code> to stop the daemon, saving your computer from unnecessarily running Flashbake <em>ad infinitum</em>.</p>

<p><code>flashbakectl</code> only works on Mac OS X. <a href="http://github.com/andrewheiss/flashbakectl" title="andrewheiss's flashbakectl at master - GitHub">You can get it at GitHub</a>. Enjoy!</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/P_0SnrH2wZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/09/23/flashbakectl-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/09/23/flashbakectl-released/</feedburner:origLink></item>
		<item>
		<title>iTunes plugin for Flashbake</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/XANhDXneKuE/</link>
		<comments>http://www.andrewheiss.com/blog/2009/08/18/itunes-plugin-for-flashbake/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:47:18 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[flashbake]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/08/18/itunes-plugin-for-flashbake/</guid>
		<description><![CDATA[Flashbake-iTunes is a plugin for Flashbake that allows you to include information for the current track in the periodic git commit message.]]></description>
			<content:encoded><![CDATA[<p><a href="http://wiki.github.com/commandline/flashbake" title="Home - flashbake - GitHub">Flashbake</a> is a fantastic script <a href="http://lifehacker.com/5232049/flashbake-automates-version-control-for-nerdy-writers" title="Flashbake Automates Version Control for (Nerdy) Writers - Downloads - Lifehacker">for nerdy writers</a> (like me) that periodically commits changes to a Git repository and can optionally append various metadata to the commit message, allowing you to <a href="http://www.boingboing.net/2009/02/13/flashbake-free-versi.html" title="Flashbake: Free version-control for writers using git - Boing Boing">annotate the entire creative process</a>.<span id="more-204"></span></p>

<p>Flashbake includes several plugins for adding recent tweets, weather, the current time zone, and other random information. There&#8217;s even a plugin for the Banshee music player for Linux. There&#8217;s nothing for iTunes, however, which is unfortunate since I&#8217;m always listening to something when I write or code.</p>

<p>So I hacked together a little plugin for Flashbake that uses AppleScript to get the current track information from iTunes and add it to the commit message. It&#8217;s admittedly a &#8220;frankenscript&#8221; and only works on Mac OS X (since it relies on AppleScript), but it works great.</p>

<p><a href="http://github.com/andrewheiss/Flashbake-iTunes/" title="andrewheiss's Flashbake-iTunes at master - GitHub">You can get it at GitHub</a>. Enjoy!</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/XANhDXneKuE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/08/18/itunes-plugin-for-flashbake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/08/18/itunes-plugin-for-flashbake/</feedburner:origLink></item>
		<item>
		<title>Using Google Voice and Gizmo Project Together</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/htElGO4tpak/</link>
		<comments>http://www.andrewheiss.com/blog/2009/08/01/using-google-voice-and-gizmo-project-together-internationally/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 15:20:33 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ata]]></category>
		<category><![CDATA[gizmo]]></category>
		<category><![CDATA[google voice]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/08/01/using-google-voice-and-gizmo-project-together-internationally/</guid>
		<description><![CDATA[Description of how to make Google Voice and the Gizmo Project work together with an ATA so that you get a free phone number and almost free phone calls.]]></description>
			<content:encoded><![CDATA[<p class="confirmation question">See update below <a href="#update">(skip to update)</a></p>

<p><a href="http://www.google.com/voice" title="Google Voice">Google Voice</a>, the Google-ized incarnation of GrandCentral, is a fantastic service that aims to become your virtual phone switchboard. It gives you a free phone number that can receive regular phone calls and route them to any other actual phones you have connected to your account. Powerful stuff.</p>

<p>Unfortunately, though, its forwarding abilities are limited to US phones. Using some <abbr title="Voice over IP">VoIP</abbr> magic, though, you can create a semblance of international forwarding and get free (or nearly free) phone calls to the US while abroad. If you&#8217;re not in a foreign country, you can harness the same <abbr title="Voice over IP">VoIP</abbr> magic to get a nearly free phone service.<span id="more-193"></span></p>

<h3>The Gizmo Project&#8212;background</h3>

<p><a href="http://gizmo5.com/pc/" title="Gizmo5 - Make free internet calls from your mobile phone and computer - Home">Gizmo</a> is normally a <a href="http://en.wikipedia.org/wiki/Voip" title="Voice over Internet Protocol - Wikipedia, the free encyclopedia"><abbr title="Voice over IP">VoIP</abbr></a> provider that lets you make free (or super cheap&#8212;something like $0.019 a minute) phone calls. When you sign up for an account you get a special phone number in the 747 area code as your <abbr title="Voice over IP">VoIP</abbr>/Gizmo username. While any phone on the Gizmo network can call your 747 number for free, regular phones can&#8217;t connect to it.</p>

<p>Gizmo offers a Call In service that lets you buy a phone number in most US area codes (or one of dozens of countries), which then lets you receive phone calls from standard phones. Call In numbers start at $35 a year (or $12 a year for three months), but prices can be higher depending on demand.</p>

<p>Gizmo touts itself primarily as software&#8212;it provides a &#8220;soft phone&#8221; program that you run on your computer. As long as the program is open you can make and receive phone calls (much like an IM program or Skype) using a microphone and your computer&#8217;s speakers or headphones.</p>

<h3>Gizmo without a computer</h3>

<p>It&#8217;s impractical to keep your computer on all the time and it can be awkward to use your computer as a phone. You can get around this limitation by buying an <a href="http://en.wikipedia.org/wiki/Analog_telephony_adapter" title="Analog telephony adapter - Wikipedia, the free encyclopedia"><abbr title="Analog telephony adapter">ATA</abbr> adapter</a>&#8212;a little box that plugs into your network with the sole purpose of running phone services. It&#8217;s essentially a hardware version of the Gizmo soft phone.</p>

<p>Fancy corporate <abbr title="Voice over IP">VoIP</abbr> phones (<a href="http://en.wikipedia.org/wiki/File:Cisco_7960_IP_Phone.JPG" title="File:Cisco 7960 IP Phone.JPG - Wikipedia, the free encyclopedia">like the ubiquitous Cisco ones</a>) have ATAs built in (kind of. The real <abbr title="Analog telephony adapter">ATA</abbr> is somewhere on the network letting these computer-phones connect to it). You don&#8217;t need a fancy <abbr title="Voice over IP">VoIP</abbr> phone, though. Standard consumer ATAs let you plug regular phones directly into the adapter.</p>

<p>After configuring the <abbr title="Analog telephony adapter">ATA</abbr> with your Gizmo information you can make and receive calls using your Call In number. Rather than pay $40+ a month for regular phone service, you can have a fully featured phone that only costs $35 a year plus &lt;$0.02 a minute.</p>

<h3>Before Google Voice</h3>

<p>For the past three years we&#8217;ve been using Gizmo as our full-time phone. We bought a <a href="https://www.voipsupply.com/linksys-pap2t-na">Linksys/Sipura <abbr title="Analog telephony adapter">ATA</abbr></a> (our model, the SPA1000 is no longer manufactured), got a $10 phone from Target, and bought a Utah county 801 Call In number. The phone worked perfectly. I could plug the <abbr title="Analog telephony adapter">ATA</abbr> in to any internet connection and get cheap/free phone service.</p>

<p>Our system even works (mostly) in Egypt. I have two phones on my desk: the $10 Target phone plugged into the <abbr title="Analog telephony adapter">ATA</abbr> (which is plugged into the router) and a 20 EGP neon pink phone (plugged into our Egyptian phone line). Family, friends, and unsuspecting telemarketers can reach us at our Utah number and pay only what it costs them to call an 801 number.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/08/current_phone_set_up.jpg" alt="Current phone set up" /><br />
<em>Our current phone set up</em></p>

<p>The only problem with the system our system in Egypt is a bizarre limitation with Egyptian (or at least Link.net&#8217;s) internet infrastructure. We don&#8217;t have any bandwidth issues when someone calls us, but when we call out, the connection drops within the first ten seconds of the call 90% of the time. To get around this, we used some SkypeOut credits&#8212;we&#8217;d call someone in the States with Skype (using my computer), tell them to call us on our Utah number, hang up, and wait for their call.</p>

<p>This worked when we called actual people, but doesn&#8217;t work when calling banks, insurance companies, airline companies, or anything else with a phone tree&#8212;phone trees can&#8217;t call you back. SkypeOut works for those, but it&#8217;s more expensive than Gizmo.</p>

<p>Google Voice changes all this.</p>

<h3>Enter Gizmo Voice</h3>

<p>Google and Gizmo have joined up to let you hook Google Voice directly into your Gizmo account. Rather than buy a Gizmo Call In number, I can use my free Google Voice number with my Gizmo Account. After <a href="http://www.gizmovoice.com/" title="Introducing Gizmo Voice‎(GizmoVoice)‎">following Gizmo&#8217;s instructions on connecting the two accounts</a>, now when people call my Google Voice number, the call is routed to the normally inaccessible 747 Gizmo number, which is already associated with my <abbr title="Analog telephony adapter">ATA</abbr> box.</p>

<p>This means I can stop paying $35 a year for my Call In number. The only thing I pay for is the phone use itself. Gizmo just changed their phone rates for users using Google Voice&#8212;apparently all calls under three minutes are free, while longer phone calls follow their normal low rates.</p>

<p>Additionally, now that I can have my Gizmo phone connected to my Google Voice account, my bizarre issue with calling out on Egyptian internet can be solved. In order to call people and have your Google Voice phone number appear on their caller IDs, you need to use Google Voice as an intermediary. You type in the number you want to call on their website and they&#8217;ll call one of your linked phones. When you pick up, your phone will start dialing the outbound number. Since Google calls my Gizmo phone now to make outbound calls, Link.net considers it an inbound call and it doesn&#8217;t get cut off.</p>

<p>So now, Gizmo combined with Google Voice gives me free short calls and cheap long calls to the US and a free US number that can replace my Gizmo Call In number. Everything works both in the States and internationally. It&#8217;s a nearly perfect system.</p>

<h3><del datetime="2009-08-03T18:54:39+00:00">Still untested</del> Now tested&#8230;</h3>

<p>In theory, since I have my Gizmo and GV accounts linked, my Google Voice number should show up on the recipient&#8217;s caller ID when I call out with my US phone, circumventing the need to use the Google Voice web site as the middleman. <del datetime="2009-08-03T18:47:13+00:00">I can&#8217;t test it, though, since my internet connection won&#8217;t let me make any outbound calls with my <abbr title="Analog telephony adapter">ATA</abbr>. I&#8217;ll keep trying over the next week, since I can make like 10&ndash;15 second calls 10% of the time.</del></p>

<p>It works! My Google Voice number shows up, just like it should&#8230;</p>

<h4 id="update">Update</h4>

<p><a href="http://lifehacker.com/5400534/google-acquires-gizmo5-voip-service-voip-coming-to-google-voice">Google has acquired Gizmo5</a>, which hopefully means that the link between Gizmo and GV will be more permanent and more official. Awesome.</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/htElGO4tpak" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/08/01/using-google-voice-and-gizmo-project-together-internationally/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/08/01/using-google-voice-and-gizmo-project-together-internationally/</feedburner:origLink></item>
		<item>
		<title>Alexandria Train Crash</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/Wtg-xfDJmpI/</link>
		<comments>http://www.andrewheiss.com/blog/2009/07/30/alexandria-train-crash/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 21:14:48 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[alexandria]]></category>
		<category><![CDATA[egypt]]></category>
		<category><![CDATA[train wreck]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/07/30/alexandria-train-crash/</guid>
		<description><![CDATA[Pictures and details of a minor train wreck in Alexandria, Egypt on July 30, 2009.]]></description>
			<content:encoded><![CDATA[<p class="confirmation question">See update below <a href="#update">(skip to update)</a></p>

<p>After almost a year of being in Egypt, we finally decided to go up to Alexandria today. We took the 9:00 AM train from Cairo and the ride went smooth until we were just outside the final Mahatat Misr station, where we were delayed for over an hour until pulling up to a platform.<span id="more-182"></span></p>

<p>Immediately after we got off the train we saw the reason for the delay. A train had rammed into the station, apparently at full speed, derailing the first three cars&#8212;the engine, the generator, and the first actual cabin. Part of the station itself was damaged, as was, ironically enough, a parked fire truck.</p>

<p><a href="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/general_train_wreck_chaos.jpg"><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/general_train_wreck_chaos.jpg" alt="General train wreck chaos" width="600px" /></a><br />
<em>Click to enlarge</em></p>

<p>The train crashed at around 8 AM and was empty. By 12:30 (when we got there), Egyptian Railway repair crews were lifting the damaged cabin off the tracks.</p>

<p><a href="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/detail_of_fire_truck_train_station_damage.jpg"><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/detail_of_fire_truck_train_station_damage.jpg" alt="Detail of fire truck/train station damage" width="600px" /></a></p>

<p><a href="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/silhouette_of_repairs.jpg"><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/silhouette_of_repairs.jpg" alt="Silhouette of repairs" width="600px" /></a></p>

<p>By 6:00 PM, when we arrived back at the station to return to Cairo, the repairmen were working on lifting the engine and had apparently already extricated the generator car.</p>

<p><a href="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/detail_of_damaged_engine.jpg"><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/detail_of_damaged_engine.jpg" alt="Detail of damaged engine" width="600px" /></a></p>

<p>Since two platforms were out of commission, trains were shuffled around all day, causing major delays. Our train ride back to Cairo took over four hours instead of the usual two.</p>

<p>As far as I know, nobody was killed as the train was empty. I don&#8217;t know about injuries, since I arrived on the scene several hours after the actual accident.</p>

<p>Needless to say, it was exciting&#8212;in a macabre sort of way. I&#8217;ve read so much about Egyptian train crashes&#8212;I got to see the aftermath of one. <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><del datetime="2009-08-01T06:21:25+00:00">I&#8217;ll post the full set of pictures tomorrow on Flickr.</del></p>

<h4 id="update">Update</h4>

<p>I posted our photos of the accident at <a href="http://www.flickr.com/photos/andrewheiss/sets/72157621785548829/">Flickr</a>. They are licensed under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution license</a>, so you can use them however you want.</p>

<p>Nancy has also blogged about the accident at our <a href="http://www.heissatopia.com/2009/07/alexandria-train-wreck-30-july-2009.html">family blog</a>.</p>

<p>Additionally, the online Egyptian news site Youm7 has <a href="http://www.youm7.com/News.asp?NewsID=123211">posted an update</a> (in Arabic). According to their report, the accident was caused by a brake failure as the train travelled from the nearby Sidi Gaber train station. It was indeed empty, fortunately, and there were no fatalities. Two of the crew members were injured in addition to a vendor&#8212;since there are snack booths at the end of each platform, he must have gotten smashed. There are conflicting statements as to the cause of the accident. Some claim neglect and disrepair; others sabotage. I&#8217;m leaning towards neglect&#8212;those trains are ancient.</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/Wtg-xfDJmpI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/07/30/alexandria-train-crash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/07/30/alexandria-train-crash/</feedburner:origLink></item>
		<item>
		<title>Installing pdftk-php</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/24aq44NZFJo/</link>
		<comments>http://www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:00:04 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[pdftk]]></category>
		<category><![CDATA[pdftk-php]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/</guid>
		<description><![CDATA[A detailed, updated tutorial on how to install, use, and customize pdftk-php.php, which combines the power of pdftk and PHP, allowing you to serve dynamic PDF forms from the web.]]></description>
			<content:encoded><![CDATA[<p>Upon popular request, I&#8217;ve decided to update the original tutorial for populating a LiveCycle PDF with PHP to apply to the new release of pdftk-php. The installation instructions should be mostly clear in the readme and in the inline comments in the example included with the script; this post is merely supplemental.<span id="more-168"></span></p>

<h3>Basic usage</h3>

<h4>Initial set up</h4>

<p><a href="http://github.com/andrewheiss/pdftk-php/tree/master" title="andrewheiss's pdftk-php at master - GitHub">Download the most recent version of pdftk-php from GitHub</a> and <a href="http://www.accesspdf.com/pdftk/" title="pdftk - the pdf toolkit">download and install pdftk</a> on your server.</p>

<p>Unzip the download from GitHub and place the folder on your server. I&#8217;ve placed mine in a folder called <code>pdftk-php</code>.</p>

<p>Create a MySQL user and database and run the SQL found in <code>/example/database.sql</code> in a MySQL client (like phpMyAdmin) to create the sample database.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/example_query_in_phpmyadmin.png" alt="Example Query in phpMyAdmin" /><br />
<em>Example query in phpMyAdmin</em></p>

<p>Modify the information in <code>example/_dbConfig.php</code> so that the application can connect to your database.</p>

<pre class=sh_php><code>$host = "localhost"; 
$username = "pdftk-user"; 
$password = "supersecure"; 
$db_name = "pdftk-php";
</code></pre>

<p>Browse to the example site (in my case, <a href="http://localhost/pdftk-php/example/index.php" title="pdftk-php">http://localhost/pdftk-php/example/index.php</a>) and add some entries to populate the database a little.</p>

<h4>Set up the script</h4>

<p>Open <code>pdftk-php.php</code> and insert the full path to your working pdftk installation at the beginning part of the <code>passthru()</code> command near line 71. Here are some examples for different scenarios on server platforms:</p>

<pre class=sh_php><code>// On a typical Unix-based installation
passthru("/usr/local/bin/pdftk ...");

// On Windows, with an absolute path
passthru("c:\pdftk\pdftk.exe ...");

// On Windows, with a relative path (useful if you place pdftk.exe in the server folder structure)
passthru("../pdftk.exe ...");
</code></pre>

<p>If you&#8217;re on a Unix-based server and don&#8217;t know where pdftk is, type one of the following commands, which should result in the absolute path to the program:</p>

<pre class=sh_sh><code>which pdftk
# or
whereis pdftk
</code></pre>

<p>In <code>example/download.php</code> verify that the path to the required <code>pdftk-php.php</code> is correct, near line 18. In the example, <code>pdftk-php.php</code> is located a directory below the example directory. If you like to store your included files elsewhere, make sure that you modify the <code>require()</code> path here.</p>

<p><code>pdftk-php.php</code> needs to be able to write to a temporary directory on your server in order to create a temporary FDF file. This directory is specified near line 58, with the <code>tempnam()</code> function.</p>

<p>If you are on a Windows server you should already be able to write to pretty much any directory (I think&hellip; I&#8217;ve never worked with IIS permissions), so you should be good to go. If you are on a Unix-based server you&#8217;ll need to be more explicit with directory permissions. To make things easier, create a temporary folder on your server and give it write permissions:</p>

<pre class=sh_sh><code>cd pdftk-php
mkdir tmp
chmod 777 tmp
</code></pre>

<p>Then set the path in <code>tempnam()</code> to the new temporary folder.</p>

<pre class=sh_php><code>// If at the same level as download.php
$fdf_fn = tempnam("tmp", "fdf");

// If one directory behind download.php
$fdf_fn = tempnam("../tmp", "fdf");

// You can also use an absolute path
$fdf_fn = tempnam("/Library/WebServer/www/pdftk-php/tmp", "fdf");
</code></pre>

<h4>Set up the PDF</h4>

<p>Create a fillable form in either Acrobat Professional or LiveCycle Designer, or use the included example PDF form. Give each field a unique and significant name so that you can work with the form more easily later on. You can modify field attributes by double clicking on the field using the Forms toolbar in Acrobat; in LiveCycle, use the Object panel.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/acrobat_form_field_options.png" alt="Acrobat Form Field Options" /><br />
<em>Acrobat Form Field Options</em></p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/livecycle_form_field_options.png" alt="LiveCycle Form Field Options" /><br />
<em>LiveCycle Form Field Options</em></p>

<p>If you are using LiveCycle, you&#8217;ll need to save the final PDF as a <strong>static</strong> form compatible with Acrobat 7. pdftk doesn&#8217;t work with dynamic forms or PDFs from later versions of Acrobat.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/livecycle_save_options.png" alt="LiveCycle Save Options" /><br />
<em>LiveCycle Save Options</em></p>

<h4>Connect PDF to script</h4>

<p><code>example/download.php</code> connects to your database, retrieves a row based on a passed GET variable, saves the data from the fetched row into variables, finally calling <code>pdftk-php.php</code>, which does the heavy lifting of creating an FDF file and injecting it into the PDF.</p>

<p>Starting at around line 30 the script assigns the fetched values to variables. Each of those retrieved variables needs to be paired with a form field in your PDF (near line 39). In a basic Acrobat form this is simple:</p>

<pre class=sh_php><code>$fdf_data_strings= array('firstname' =&gt; $pdf_firstname,  'lastname' =&gt; $pdf_lastname, 'email' =&gt; $pdf_email);
</code></pre>

<p>LiveCycle tends to complicate the form names slightly. You can use pdftk from the command line to retrieve the official form field names. Run this command from the directory containing your PDF file:</p>

<pre class=sh_sh><code>pdftk form.pdf dump_data_fields &gt; form-fields.txt
</code></pre>

<p>When you open the resultant <code>.txt</code> file you should see a report of all the fields</p>

<pre class=sh_text><code>...
---
FieldType: Text
FieldName: form1[0].#subform[0].firstname[0]
FieldNameAlt: First name&amp;#9;
FieldFlags: 0
FieldJustification: Left
---
...
</code></pre>

<p>Use those long, hairy <code>FieldName</code>s in the <code>$fdf_data_strings</code> array, like so:</p>

<pre class=sh_php><code>$fdf_data_strings= array('form1[0].#subform[0].#area[0].FirstName[0]' =&gt; $pdf_firstname, 'form1[0].#subform[0].#area[0].LastName[0]' =&gt; $pdf_lastname, 'form1[0].#subform[0].#area[0].EMail[0]' =&gt; $pdf_email, );
</code></pre>

<p>Finally, check the values of <code>$pdf_filename</code> and <code>$pdf_original</code> near lines 62 and 65.</p>

<p>Go to <a href="http://localhost/pdftk-php/example/view.php" title="pdftk-php - List of submitted forms">http://localhost/pdftk-php/example/view.php</a> and click on the download links for one of entries. You should be prompted to download a PDF file, dynamically generated using <code>pdftk-php.php</code>. Success!</p>

<h3>Advanced customization</h3>

<h4>Using checkboxes or radio buttons</h4>

<p><code>$fdf_data_strings</code> works great for text fields, but can&#8217;t handle radio buttons or check boxes. For that you&#8217;ll need to use the <code>$fdf_data_names</code> array near line 49.</p>

<p><em>NB: The logic for manipulating the form data in PHP and MySQL might be a little convoluted and could easily be optimized, but it works for clear demonstration purposes.</em></p>

<p>To demonstrate this how to do this, we&#8217;ll add a checkbox to our form and extend the database. Run this query in a MySQL client to add a couple columns to our table:</p>

<pre class=sh_sql><code>ALTER TABLE `users` ADD `option1` TINYINT( 1 ) NOT NULL, ADD `option2` TINYINT( 1 ) NOT NULL ;
</code></pre>

<p>Open <code>/example/example.pdf</code> in Acrobat Professional and add two checkbox fields named <code>option1</code> and <code>option2</code>.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/ridiculously_huge_checkboxes_better.png" alt="Ridiculously Huge Checkboxes Better" /><br />
<em>Ridiculously huge checkboxes</em></p>

<p>We need to modify our web form and the table that displays the data, just to make sure everything is getting saved to the database correctly.</p>

<p>First, make a couple changes to <code>example/index.php</code> After the section near lines 104&ndash;107, add</p>

<pre class=sh_html><code>&lt;p&gt;
    &lt;label for="option1"&gt;Option 1&lt;/label&gt;
    &lt;input type="checkbox" name="option1" value="1" id="option1" /&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;label for="option2"&gt;Option 2&lt;/label&gt;
    &lt;input type="checkbox" name="option2" value="1" id="option2" /&gt;
&lt;/p&gt;
</code></pre>

<p>Then, up near the top of <code>example/index.php</code> after line 34, add this:</p>

<pre class=sh_php><code>if ($_POST['option1'] == 1) {
    $option1 = 1;
} else {
    $option1 = 0;
}

if ($_POST['option2'] == 1) {
    $option2 = 1;
} else {
    $option2 = 0;
}
</code></pre>

<p>This checks the value of the submitted checkboxes and sets the <code>$optionx</code> variables to either 1 or 0, which fit into the <code>TINYINT</code> columns in our table. You could use actual text as well and set the columns to <code>VARCHAR</code>.</p>

<p>Change the SQL query from</p>

<pre class=sh_php><code>$sql = "INSERT INTO users (firstname, lastname, email) VALUES ('$firstname', '$lastname', '$email')";
</code></pre>

<p>to</p>

<pre class=sh_php><code>$sql = "INSERT INTO users (firstname, lastname, email, option1, option2) VALUES ('$firstname', '$lastname', '$email', '$option1', '$option2')";
</code></pre>

<p>Go ahead and insert some dummy submissions with boxes checked and unchecked to make sure everything is working.</p>

<p>Optionally we need to modify <code>example/view.php</code> to show the stored values. Add the following table header cells after line 29:</p>

<pre class=sh_html><code>&lt;!-- Already here --&gt;&lt;th&gt;E-mail Address&lt;/th&gt;
&lt;th&gt;Option 1&lt;/th&gt;
&lt;th&gt;Option 2&lt;/th&gt;
&lt;!-- Already here --&gt;&lt;th&gt;Download PDF&lt;/th&gt;
</code></pre>

<p>In the <code>while</code> loop a few lines later, add this code:</p>

<pre class=sh_php><code>&lt;!-- Already here --&gt;&lt;td&gt;&lt;?php echo $user["email"]; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo ($user['option1'] == 1) ? "Yes" : "No"; ?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php echo ($user['option2'] == 1) ? "Yes" : "No"; ?&gt;&lt;/td&gt;
&lt;!-- Already here --&gt;&lt;td&gt;&lt;a href="download.php?id=&lt;?php echo $user['id']; // the rest of this...
</code></pre>

<p>This is just PHP ternary notation, which essentially says that if the value of <code>optionx</code> is equal to one, echo &#8220;Yes,&#8221; otherwise, echo &#8220;No&#8221;.</p>

<p>Finally we need to modify <code>example/download.php</code> to handle our checkboxes. Like I said above, the <code>$fdf_data_names</code> variable handles checkbox and radio button data. In PDF forms, the two allowed values for checkboxes are &#8220;Yes&#8221; and &#8220;Off&#8221; (not really opposites, but oh well), so you&#8217;ll need to set variables accordingly. Replace <code>$fdf_data_names = array();</code> near line 49, with this, which checks the values of <code>optionx</code> and sets <code>$pdf_optionx</code> to either &#8220;Yes&#8221; or &#8220;Off&#8221; and then defines the <code>$fdf_data_names</code> array appropriately:</p>

<pre class=sh_php><code>if ($data['option1'] == 1) {
    $pdf_option1 = "Yes";
} else {
    $pdf_option1 = "Off";
}

if ($data['option2'] == 1) {
    $pdf_option2 = "Yes";
} else {
    $pdf_option2 = "Off";
}

$fdf_data_names = array('option1' =&gt; $pdf_option1, 'option2' =&gt; $pdf_option2);
</code></pre>

<p>And that should do it! Visit <a href="http://localhost/pdftk-php/example/view.php" title="pdftk-php - List of submitted forms">http://localhost/pdftk-php/example/view.php</a> and download one of the forms. The checkboxes should populate perfectly.</p>

<h4>Other types of form fields</h4>

<p>Combo boxes and radio buttons act similarly to checkboxes. If you run the <code>dump_data_fields</code> command with pdftk again on a form with these more advanced options, you&#8217;ll see a few differences in the results.</p>

<pre class=sh_text><code>FieldType: Text
FieldName: email
FieldFlags: 0
FieldJustification: Left
---
FieldType: Button
FieldName: option1
FieldFlags: 0
FieldValue: Yes
FieldJustification: Left
FieldStateOption: Off
FieldStateOption: Yes
---
FieldType: Choice
FieldName: favoriteColor
FieldFlags: 131072
FieldValue: blue
FieldValueDefault: red
FieldJustification: Left
</code></pre>

<p>You can see the &#8220;Yes&#8221; vs. &#8220;Off&#8221; values in our checkbox (called &#8220;Button&#8221; in PDF lingo). Drop down lists (&#8220;Choice&#8221; in PDF-speak) have multiple values, specified by you when you create the field.</p>

<p><img src="http://www.andrewheiss.com/wp/wp-content/uploads/2009/07/combo_box_properties.png" alt="Combo box properties" /><br />
<em>Sample combo box properties in Acrobat</em></p>

<p>Radio buttons are hybrids. They are considered &#8220;Buttons,&#8221; like checkboxes, but can have custom values, like drop down lists.</p>

<p>Your final PHP script will need to take these different values into account and assign the correct values in the <code>$fdf_data_names</code> array.</p>

<h3>Conclusion</h3>

<p>You can do a ton with the <code>pdftk-php.php</code> class once you get it set up initially and get past the slight learning curve. If you have any questions, feel free to ask in the comments. If you find any problems, comment here or <a href="http://github.com/andrewheiss/pdftk-php/issues" title="Issues - andrewheiss/pdftk-php - GitHub">open an issue at the GitHub project page</a>. Additionally, you can <a href="http://github.com/andrewheiss/pdftk-php/tree/master" title="andrewheiss's pdftk-php at master - GitHub">fork the project</a> and contribute.</p>

<p>Good luck!</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/24aq44NZFJo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/</feedburner:origLink></item>
		<item>
		<title>On narrowing and redefining research</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/35WwH_K5weY/</link>
		<comments>http://www.andrewheiss.com/blog/2009/07/28/on-narrowing-and-redefining-research/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 10:11:00 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[bloggers]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[italians]]></category>
		<category><![CDATA[mutamasirun]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/07/28/on-narrowing-and-redefining-research/</guid>
		<description><![CDATA[After a year of deliberation, I may have finally decided what to write about for my thesis.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in Egypt for almost a year now, studiously working towards my MA in Middle East Studies. The supposed capstone of my time here at AUC&#8212;my thesis&#8212;now looms ahead somewhat menacingly. I get to spend the next several months researching and writing what will end up being my largest research project to date. It&#8217;ll also set the foundation for my (hopefully) future PhD plans.</p>

<p>There&#8217;s only one problem: I don&#8217;t quite know what I&#8217;m writing it on.<span id="more-126"></span></p>

<p>At BYU I double majored in Middle East Studies/Arabic (MESA) and Italian&#8212;an odd mix of modern history, political science, and renaissance poetry. Most of my research focused on finding literary and historic connections between the Middle East and Italy. I looked at the role of Sufism in the birth of Catholic mysticism, especially with Jacopone da Todi and St. Francis of Assisi. I looked at the Young Ottomans and their reliance on Mazzini&#8217;s <em>Giovine Italia</em> ideology. I even <a href="http://www.heissatopia.com/2007/03/symposium-humanitatum-2007.html" title="Heissatopia: Symposium Humanitatum 2007">presented a paper</a> at a conference about the role of Mohammed in <em>Inferno XXVIII</em> in Dante&#8217;s <em>Divine Comedy,</em> connecting it to proto-orientalism.</p>

<p>Fun times <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>At the same time, though, there was an inherent conflict in my research interests. I wrote my MESA capstone paper on the media coverage of the 2006 Israel/Lebanon war, where no Italian literature was involved <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I love media&#8212;I&#8217;m obsessed with the news, the internet, blogs, Twitter; anything shiny, new, and exciting.</p>

<p>I started my MA with the assumption that I&#8217;d have to choose one of these tracks&#8212;history or media. I dove headlong into the history track, writing a huge literature review on the history of the Italians in Egypt at the beginning of the 20th century. Large Italian communities in Cairo, Alexandria, and Ismailiyya sprang up after Napoleon&#8217;s 1798 invasion. Thousands of Italians were born and raised abroad in these cities, and many took part in the Egyptian nationalist movement, considering themselves more Egyptian than Italian, thus earning themselves the nickname <em>mutamasirun</em> (those who try to be Egyptian).</p>

<p>I was excited about this research until a new shiny thing took my attention away&#8212;Twitter. I started using Twitter more or less full time in January, which then introduced me to the large Egyptian Twitter community. Many of the Egyptian twitterers are also activist bloggers who have been arrested multiple times. I began to see the power and potential of the internet in political reform and change in the Middle East and switched research gears to focus on the Middle Eastern blogosphere. It was fascinating stuff, but I felt like I had turned my back on history <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Further complicating things, I had an amazing history seminar last semester that resulted in some awesomely fun archival research. I had a blast writing the paper. The primeval dichotomy of history vs. media reared its ugly head again.</p>

<p>Since I&#8217;m nearing the end of my MA, I&#8217;m looking at different PhD programs to go to once I&#8217;m done here. There are lots that look at bloggers and politics&#8212;even ones that look at bloggers and politics and the Middle East&#8212;but none do it with a historical approach (fancy that&#8230; blogs have been around for something like four years and it&#8217;s not history yet <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). I sent out dozens of e-mails to different professors asking about graduate programs and my potential research. Most responses were confused; history!= new media.</p>

<p>However, one professor at Cornell responded positively. He studies media in modern Egyptian history, specifically in the time period of my Italian <em>mutamasirun</em>.</p>

<p>I think I may have found a way to bridge the history/media studies gap. Now I just need to figure out exactly how to do it.</p>

<p>Awesome. <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>So, sorry bloggers&#8212;I&#8217;ll keep following you as a tangential fascination, but my heart lies in history.</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/35WwH_K5weY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/07/28/on-narrowing-and-redefining-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/07/28/on-narrowing-and-redefining-research/</feedburner:origLink></item>
		<item>
		<title>Converting a Blogger Blog to InDesign Tagged Text with Perl</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/pYffIc9HmLo/</link>
		<comments>http://www.andrewheiss.com/blog/2009/07/19/converting-a-blogger-blog-to-indesign-tagged-text/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 20:38:39 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[blogger xml]]></category>
		<category><![CDATA[indesign]]></category>
		<category><![CDATA[indesign tagged text]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/07/19/converting-a-blogger-blog-to-indesign-tagged-text/</guid>
		<description><![CDATA[This Perl script lets you take a backed-up Blogger XML file and convert it to an InDesign Tagged Text file for book layout.]]></description>
			<content:encoded><![CDATA[<p>Our family has a fairly sizable <a href="http://www.heissatopia.com" title="Heissatopia">blog</a> that we (actually, mostly my wife, Nancy) have kept updated for several years. Since it contains so much family history we wanted an easy way to preserve it in print form, just in case Blogger gets the boot from Google some day (not that that will ever really happen…).<span id="more-104"></span></p>

<p>Since we&#8217;re both hobbyist graphic designers—I taught a couple print layout and design classes as an undergrad at BYU and have made several books at <a href="http://www.lulu.com" title="Lulu.com">Lulu.com</a>—we decided to layout and print each year of our blog, to keep for posterity.</p>

<p>A couple years ago Nancy attempted this with our smaller <a href="http://andrewheiss.blogspot.com" title="Adventures in Jordan">Jordan blog</a> for a print publishing class she took at BYU. We spent the bulk of our time manually copying and pasting each post and the subsequent comments into a huge Word document. She then ran a long series of find/replaces to clean up the messy, inconsistent typography, and then finally placed it into Quark (that evil program). Through a series of unfortunate events, Quark crashed repeatedly and corrupted her file multiple times—she was lucky to get her first draft turned in for her final project (she got an A, though. Phew!).</p>

<p>I knew there had to be a faster, more efficient way to wrangle all the blog text, but this was back in 2006, before Blogger had an open API or options to backup a blog. Primitive, dark days indeed <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>

<p>However, last year, Blogger introduced a fantastic new option—the ability to backup and export your entire blog, comments and all. Blogger spits out an Atom-formatted XML file that you can use to recreate your blog later on (or possibly import onto other platforms, like WordPress, I think). This was the key to simplifying the daunting task of collecting the text for our blog books. All we needed was a way to mangle the text in the XML file to create an InDesign-ready file.</p>

<p>So, I whipped up a semi-complicated Perl script that can parse an Atom-formatted XML file from Blogger and create a text file using InDesign Tagged Text to preapply paragraph and character styles. It also cleans up the typographic elements of the text, adding em and en dashes, removing empty paragraphs, etc. Additionally, it can add hidden index entries for each tag, essentially creating a barebones index for your book. And it only takes 10ish seconds to run on a large blog. It&#8217;s not perfect and could stand some good optimization, but it works.</p>

<p>Additionally, since InDesign tagged text works with, well, text, it won&#8217;t place your images for you. Instead it will insert the location of the image (the <code>src=whatever.jpg</code> of the <code>img</code> tags) in between curly braces <code>{ }</code>. You&#8217;ll then need to manually place all the images later, deleting the braced text.</p>

<p>In the future, the script could be changed to output XML, which does let you include pictures, but you&#8217;d have to have all your images on your hard drive already. The script could go and download all the linked images, but it&#8217;s not really a good idea to place low resolution, web-optimized images in a print document. In our case we have high-res copies of all the pictures on the blog stored on an external hard drive, so we just have to go and find and place the images we want. It takes more time, but it makes better quality documents in the end.</p>

<p>Also, links are preserved as footnotes&#8212;all <code>href="whatever.html"</code>s show up as the footnote text.</p>

<h3>How to use the script</h3>

<p>First, download the script and its supporting files from <a href="http://github.com/andrewheiss/Blogger-XML-to-InDesign/tree/master" title="andrewheiss's Blogger-XML-to-InDesign at master - GitHub">Github</a>. If you&#8217;re using Mac OS or Linux, make sure the main script file, <code>format_for_id.pl</code> is executable—type <code>chmod +x format_for_id.pl</code> at the terminal.</p>

<p>Next, make sure you have Perl installed on your system. If you are using Linux or Mac OS X, you&#8217;re good to go. If you&#8217;re using Windows, download and install <a href="http://strawberryperl.com/" title="Strawberry Perl">Strawberry Perl for Windows</a>. You can also use <a href="http://www.activestate.com/activeperl/" title="ActivePerl">ActivePerl</a>, but installing modules is a little more difficult.</p>

<p>The script uses several additional <a href="http://en.wikipedia.org/wiki/Cpan" title="CPAN - Wikipedia, the free encyclopedia">CPAN modules</a> that you&#8217;ll need to install. You&#8217;ll need to use the CPAN shell to do so.</p>

<ul>
<li>On Windows with Strawberry Perl: open the packaged CPAN client in the Start Menu folder</li>
<li>On Windows with ActivePerl: Good luck. There is a large repository of specially compiled CPAN modules for ActiveState, and reportedly there is a kind of CPAN shell, but I haven&#8217;t gotten either to work too well. Stick with Strawberry Perl. It&#8217;s better <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>On Mac OS X: type <code>perl -MCPAN -e shell</code> at a terminal window</li>
<li>On Linux: type <code>sudo cpan</code> at a terminal window</li>
</ul>

<p>(If it&#8217;s your first time running the CPAN shell you&#8217;ll be asked to configure the installation environment. Choose the option to automatically configure everything.)</p>

<p>Once everything is set up and you see the <code>cpan</code>&gt; shell prompt, type <code>install Package::Name</code> (eg. <code>install Date::Format</code>) for each of the dependent CPAN packages listed at the beginning of <code>format_for_id.pl</code>.</p>

<p>Log in to your <a href="http://www.blogger.com/home" title="Blogger.com">Blogger Dashboard</a> and export your blog as an XML file by going to Settings &gt; Basic &gt; Export blog. Place the XML file in the script folder.</p>

<p>Open <code>config.cfg</code> with a text editor and change the settings as needed. Set the input file to your newly downloaded XML file, choose the year you want to extract, set an output file, and set the file header, either &lt;<code>UNICODE-MAC</code>&gt; or &lt;<code>UNICODE-WIN</code>&gt;, depending on what platform you use InDesign on.</p>

<p>For now, leave all the style tags as they are so you can place the text into the example InDesign file and see how everything works. You can change them later and rerun the script</p>

<p>Finally, using the terminal or command prompt, navigate to the folder with the script and and run it by typing <code>perl format_for_id.pl</code>. If everything goes well you should have an output file at the location you specified, full of InDesign tags.</p>

<p>Open up <code>Example.indd</code> in InDesign CS3 or above and place the generated text file. All the text should come in perfectly with all the needed paragraph and character styles applied. Bravo!</p>

<h3>Advanced usage</h3>

<p>Obviously you&#8217;ll want to make some changes to the format of the output text. You might not want the post URL right after the tag—you might want it at the end, or not want it at all. With a little knowledge of Perl, you can edit the main script directly, mostly the <code>combineSortClean()</code> sub near the end of the script, to change the order of the output elements.</p>

<p>You can also disable tag indexing and allow the tags to be output with a paragraph style. Just comment and uncomment the appropriate sections in the code. The same goes for the author-specific character styles—comment and uncomment the needed lines in the script.</p>

<p>You can rename the styles and use your own—just make sure the styles exist in your InDesign document before you place the output file. InDesign will throw away any tags that don&#8217;t already exist in the document.</p>

<p>I made the script for our specific blog, so it doesn&#8217;t take every possible paragraph or character style into account. If you want additional functionality, you&#8217;ll have to add it. Feel free to fork the project off of GitHub and add to/improve it. That&#8217;s why it&#8217;s open source <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>If you have any questions, ask in the comments. Report any issues at the <a href="http://github.com/andrewheiss/Blogger-XML-to-InDesign/issues" title="Issues - andrewheiss/Blogger-XML-to-InDesign - GitHub">project GitHub page</a>. I&#8217;ll try to respond quickly—I generally do, as evidenced by my <a href="http://www.andrewheiss.com/blog/2007/10/06/populating-a-livecycle-pdf-with-php-and-mysql/" title="Populating a LiveCycle PDF with PHP and MySQL  –   AndrewHeiss.com">pdftk-php project</a> <img src='http://www.andrewheiss.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>Good luck!</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/pYffIc9HmLo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/07/19/converting-a-blogger-blog-to-indesign-tagged-text/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/07/19/converting-a-blogger-blog-to-indesign-tagged-text/</feedburner:origLink></item>
		<item>
		<title>pdftk-php Officially Released</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/Uzlv_NIgoP8/</link>
		<comments>http://www.andrewheiss.com/blog/2009/06/19/pdftk-php-officially-released/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 21:29:59 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdftk]]></category>
		<category><![CDATA[pdftk-php]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/blog/2009/06/19/pdftk-php-officially-released/</guid>
		<description><![CDATA[After almost two years, I've officially developed and released pdftk-php--a script that lets you inject form data into a PDF with PHP.]]></description>
			<content:encoded><![CDATA[<p>Wow. It&#8217;s been almost two years since I wrote <a href="http://www.andrewheiss.com/blog/2007/10/06/populating-a-livecycle-pdf-with-php-and-mysql/" title="Populating a LiveCycle PDF with PHP and MySQL">a little tutorial</a> on how to use LiveCycle, PHP, and MySQL together to make a web application that served dynamic PDF forms. Since then it has become the number one page on this site. I still get a substantial number of comments a week here on the blog and via e-mail&#8212;many of those comments are stuck in my inbox, sent to me before I rebuilt my site on WordPress and enabled commenting.<span id="more-94"></span></p>

<p>Unfortunately, though, I wrote that tutorial as my first foray into the world of PHP/MySQL web development and had little idea of what I was really doing. Since then, however, I&#8217;ve done a fair amount of real-world web design and development, and even implemented this pdftk form system into a live, public-facing <a href="http://mmlab.lib.byu.edu" title="HBLL Multimedia Lab">application</a>.</p>

<p>In the interim, I&#8217;ve refined my system and released it as an open source PHP class, named <a href="http://github.com/andrewheiss/pdftk-php/" title="pdftk-php on GitHub"><code>pdftk-php</code></a>. The project is hosted at <a href="http://github.com" title="GitHub">GitHub</a>, a brilliant hosting service for collaborative projects, which uses Git, the best version control software I&#8217;ve ever used. Anyone can check out, or clone, the project, make any edits to the core set of classes, and merge those with the main project branch&#8212;it is now a true community project. If you don&#8217;t want to contribute, you can still <a href="http://github.com/andrewheiss/pdftk-php/downloads" title="Download pdftk-php at GitHub">download it from GitHub</a> as a <code>.zip</code> or <code>.tar</code> file.</p>

<p>Included in the project is a (hopefully) extensively documented example application that you can set up on your own server. You can try a live working example at <a href="http://pdftk-php.andrewheiss.com/" title="Working pdftk-php example">pdftk-php.andrewheiss.com</a>.</p>

<p>I&#8217;m working on writing a new step-by-step tutorial on how to set everything up, akin to the old one. In theory, the new <code>pdftk-php</code> should work with PDFs created in any program, not just LiveCycle. In the meantime, download <code>pdftk-php</code>, try it out, and report any bugs here on the blog or <a href="http://github.com/andrewheiss/pdftk-php/issues" title="Report an issue at GitHub">directly at GitHub</a> (where I hope to keep everything related to <code>pdftk-php</code> from now on). Fork the project and contribute if you feel like it, too!</p>

<p>Thanks and good luck!</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/Uzlv_NIgoP8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/06/19/pdftk-php-officially-released/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/06/19/pdftk-php-officially-released/</feedburner:origLink></item>
		<item>
		<title>A Tale of Three Taxis</title>
		<link>http://feeds.andrewheiss.com/~r/AndrewHeiss/~3/5PRTf6ZbRc8/</link>
		<comments>http://www.andrewheiss.com/blog/2009/05/14/a-tale-of-three-taxis/#comments</comments>
		<pubDate>Thu, 14 May 2009 17:44:56 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[chaos]]></category>
		<category><![CDATA[egypt]]></category>
		<category><![CDATA[life abroad]]></category>
		<category><![CDATA[taxis]]></category>

		<guid isPermaLink="false">http://www.andrewheiss.com/?p=81</guid>
		<description><![CDATA[Traffic in Cairo is horrible, especially when all the taxi drivers, the ubiquitous life-blood of the Egyptian streets, have a deathwish for you.]]></description>
			<content:encoded><![CDATA[<p>Traffic in Cairo is horrible, especially when all the taxi drivers, the ubiquitous life-blood of the Egyptian streets, have a deathwish for you.<span id="more-81"></span></p>

<p>Read about my recent near misses at my post at our family blog, <a href="http://www.heissatopia.com/2009/05/tale-of-three-taxis.html">Heissatopia</a>.</p>
<img src="http://feeds.feedburner.com/~r/AndrewHeiss/~4/5PRTf6ZbRc8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.andrewheiss.com/blog/2009/05/14/a-tale-of-three-taxis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.andrewheiss.com/blog/2009/05/14/a-tale-of-three-taxis/</feedburner:origLink></item>
	</channel>
</rss>
