<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>CogDogBlog &#187; nanowrimo</title>
	<atom:link href="http://cogdogblog.com/tag/nanowrimo/feed/" rel="self" type="application/rss+xml" />
	<link>http://cogdogblog.com</link>
	<description>Alan Levine&#039;s space for barking about and playing with technology</description>
	<lastBuildDate>Mon, 13 Feb 2012 03:36:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
		<item>
		<title>Dogging Out of NaNoWriMo</title>
		<link>http://cogdogblog.com/2010/11/12/dogging-out-of-nanowrimo/</link>
		<comments>http://cogdogblog.com/2010/11/12/dogging-out-of-nanowrimo/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 06:25:25 +0000</pubDate>
		<dc:creator>Alan Levine aka CogDog</dc:creator>
				<category><![CDATA[Blog Pile]]></category>
		<category><![CDATA[nanowrimo]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://cogdogblog.com/?p=5946</guid>
		<description><![CDATA[cc licensed flickr photo shared by RaGardner4 It was overly grand ambition (or stupid ass planning) that got me thinking I could do NaNoWriMo again this year. I&#8217;m bailing. And of course I do not need to apologize (especially as most likely no one will even notice). I&#8217;ve already got enough on the plate every day, with training for a half marathon, doing my photography dailyshoot and daily 365/2010 photos, where the heck was 1667 words per day gonna come from? Well, I could do it, but at this point I feel like I&#8217;d be just spraying words for the sake of it. While I had a few good writing spurts. my story of a dog&#8217;s eyed view of humanity was just not feeling like much of anything. I did reach my goal to tinker with WordPress and to try out Patrick&#8217;s nifty riff on Anthologize (I was publishing ePub [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Thanksgiving Day - I give thanks for..." href="http://flickr.com/photos/rachelrusinski/66838761/"><img src="http://farm1.static.flickr.com/25/66838761_c19330ff4e.jpg" /></a><br /><small><a title="Thanksgiving Day - I give thanks for..." href="http://flickr.com/photos/rachelrusinski/66838761/">cc licensed flickr photo</a> shared by <a href="http://flickr.com/people/rachelrusinski/">RaGardner4</a></small></p>
<p>It was overly grand ambition (or stupid ass planning) that <a href="http://cogdogblog.com/2010/11/02/nanowrimo-open/">got me thinking I could do NaNoWriMo again this year</a>. </p>
<p>I&#8217;m bailing. </p>
<p>And of course I do not need to apologize (especially as most likely no one will even notice). I&#8217;ve already got enough on the plate every day, with <a href="http://dommy.com/ihaterunning">training for a half marathon</a>, doing my photography <a href="http://www.flickr.com/photos/cogdog/sets/72157622779450205/">dailyshoot</a> and <a href="http://www.flickr.com/photos/cogdog/sets/72157622993176605/">daily 365/2010 photos</a>, where the heck was 1667 words per day gonna come from?<br />
<a href="http://www.nanowrimo.org/eng/user/583674"><img src="http://cogdogblog.com/wp-content/uploads/2010/11/nano-stats.jpg" alt="" title="nano-stats" width="481" height="345" class="aligncenter size-full wp-image-5947" /></a></p>
<p>Well, I could do it, but at this point I feel like I&#8217;d be just spraying words for the sake of it. While I had a few good writing spurts. my story of a <a href="http://nano.dommy.com/">dog&#8217;s eyed view of humanity</a> was just not feeling like much of anything.</p>
<p>I did reach my goal to tinker with WordPress and to try out <a href="http://www.patrickgmj.net/project/anthologize-nanowrimo">Patrick&#8217;s nifty riff on Anthologize</a> (I was publishing ePub updates, <a href="http://nano.dommy.com/wp-content/pub/i_am_a_dog.epub">last one is hanging in the breeze</a>).</p>
<p>That&#8217;s the way the blog bounces.</p>
<p>I&#8217;d rather be playing, so am leaving <a href="http://nano.dommy.com">http://nano.dommy.com</a> in the Grand Ideas/ Lousy Execution pile.</p>
<p><a title="KKKKKKKONGGGGG" href="http://flickr.com/photos/oakleyoriginals/3059800422/"><img src="http://farm4.static.flickr.com/3184/3059800422_015f4c45c4.jpg" /></a><br /><small><a title="KKKKKKKONGGGGG" href="http://flickr.com/photos/oakleyoriginals/3059800422/">cc licensed flickr photo</a> shared by <a href="http://flickr.com/people/oakleyoriginals/">OakleyOriginals</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://cogdogblog.com/2010/11/12/dogging-out-of-nanowrimo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>NaNoWriMo-ing In the Open</title>
		<link>http://cogdogblog.com/2010/11/02/nanowrimo-open/</link>
		<comments>http://cogdogblog.com/2010/11/02/nanowrimo-open/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 07:05:54 +0000</pubDate>
		<dc:creator>Alan Levine aka CogDog</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[nanowrimo]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://cogdogblog.com/?p=5889</guid>
		<description><![CDATA[cc licensed flickr photo shared by zenobia_joy Against every sane, rational, &#8220;I&#8217;m so over committed I&#8217;m gonna explode&#8221; thought, I have decided to plunge my hand again into National Novel Writing Month (NaNoWriMo), the challenge where aspiring, and maybe aspired, writers take on the goal of writing a 50,000 word novel over a one month time span. I have always liked writing, but had never done anything substantial or larger than a long blog post, so it was one of those items I listed long ago on 43 Things. I had heard of NaNoWriMo, and it seemed analogous to running a marathon &#8212; a goal you keep telling yourself you cannot do&#8211; until you try. Last year I made my 50,000 mark (I burned a lot of adjectives up in the process), finished, and got through about 1 1/2 rounds of later edits before hanging it out to dry (see [...]]]></description>
			<content:encoded><![CDATA[<p><a title="inspiration strikes" href="http://flickr.com/photos/zenobia_joy/5012210963/"><img src="http://farm5.static.flickr.com/4144/5012210963_81bd4c88b4.jpg" /></a><br /><small><a title="inspiration strikes" href="http://flickr.com/photos/zenobia_joy/5012210963/">cc licensed flickr photo</a> shared by <a href="http://flickr.com/people/zenobia_joy/">zenobia_joy</a></small></p>
<p>Against every sane, rational, &#8220;I&#8217;m so over committed I&#8217;m gonna explode&#8221; thought, I have decided to plunge my hand again into <a href="http://www.nanowrimo.org/">National Novel Writing Month (NaNoWriMo)</a>, the challenge where aspiring, and maybe aspired, writers take on the goal of writing a 50,000 word novel over a one month time span.</p>
<p>I have always liked writing, but had never done anything substantial or larger than a long blog post, so it was <a href="http://www.43things.com/things/view/686/write-a-novel">one of those items I listed long ago on 43 Things</a>. I had heard of NaNoWriMo, and it seemed <a href="http://dommy.com/ihaterunning/2008/01/13/did-it/">analogous to running a marathon</a> &#8212; a goal you keep telling yourself you cannot do&#8211; until you try.</p>
<p>Last year I made my 50,000 mark (I burned a lot of adjectives up in the process), finished, and got through about 1 1/2 rounds of later edits before hanging it out to dry (see <a href="http://cogdogblog.com/2010/04/25/done-pile/">reflections on 2009</a>). It never got discovered, I never got a book deal, and I still have a day job (none of these were primary aspirations, but heck, I&#8217;d not mind being surprised).</p>
<p>The typical way one does this is mostly solitary- you write and write and write in most commonly a word processor (I did), and you update your NaNoWriMo site with your word count. There&#8217;s really no vehicle (by design I think) where your novel goes; that one is up to you. Yes, they do offer a lot of tools to make friends and there are local discussion boards where there are options to meet up with other writers in your &#8216;hood. </p>
<p>I was fence sitting this year&#8211; if I follow my running my running analogy, I ran the marathon once, finished, and never will do THAT again. </p>
<p>But writing was a mental challenge that can be taken on, IMHO, easier than physical ones. IT&#8217;S IN YOUR HEAD.</p>
<p>So I decided to do it this year to play more with the How I write more than the Drivel I Do Write. I decided I would not use Word this year, but do the writing in a blog to see how it works as a composition platform. I got myself the idea I could use it as one more Opportunity to Monkey with WordPress, and add some code in to do word counts and progress. And since the <a href="http://anthologize.org/">Anthologize plugin</a> came out a few months ago, it would be a new experiment in publishing to ePub and/or HTML.</p>
<p>Even better, just last weak Patrick Murray-John offered up <a href="http://www.patrickgmj.net/project/anthologize-nanowrimo">his new extension of Anthologize</a> geared to publish NaNoWriMo content.</p>
<p>My writing site is now fluttering in the open breeze at <a href="http://nano.dommy.com/">http://nano.dommy.com/</a></p>
<p><a href="http://nano.dommy.com/"><img src="http://cogdogblog.com/wp-content/uploads/2010/11/nanowrimo-2010.jpg" alt="" title="nanowrimo 2010" width="500" height="355" class="alignnone size-full wp-image-5891" /></a></p>
<p>Like my running efforts, writing in the open becomes another impetus to finish as you don&#8217;t want to bee seen failing in public. Below I will outline some of the tinkering I have done in WordPress over the last 2 days to get myself set up. I&#8217;ll say my novel really is not novel and idea, <em>I am a Dog</em> is the working title and it purports to be the insider view to the Canine world fur Humans to get past their naive assumptions of the dog-verse. </p>
<p>I actually am so far hoping a plot emerges.</p>
<p>But this was less about trying to Write a Great Story but just to try and also run some technical experiments.</p>
<p>I did the automatic WordPress install on my Dreamhost-ed site, and pawed through the themes it provided, settling on the sparse <a href="http://lucianmarin.com/page/themes/">Journalist theme</a>.</p>
<p>The code bits I hacked first was finding a way to add a word count to each post, and a method of summing the total words written. It ought to be a few database queries. After consulting the GoogleVerse, I found that MySQL has no function to count words, but I did find <a href="http://www.marketingtechblog.com/wordpress/wordpress-mysql-word-count/">a blog that had a method for listing posts and word counts</a>, and as the author says:</p>
<blockquote><p>MySQL doesn’t have a built-in word count function for MySQL, but as with every other unanswered question, some smart guy on the blogosphere already answered <a href="http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/">how to use MySQL to get a Word Count</a>.</p></blockquote>
<p>It&#8217;s a little bit of a hack- a query that first sums the character length of a text column&#8217;s contents and subtracts from it the character length of the same text with blank spaces replaced by null characters &#8212; e.g. a word is defined by blank space.</p>
<p><pre><pre>
SELECT SUM( LENGTH(name) - LENGTH(REPLACE(name, &#039; &#039;, &#039;&#039;))+1) FROM table
</pre></pre></p>
<p>First I would need a function that would return the word count for a single post, so I could add to the meta content for each post:</p>
<p><img src="http://cogdogblog.com/wp-content/uploads/2010/11/post-count.png" alt="" title="post count" width="258" height="40" class="aligncenter size-full wp-image-5892" /></p>
<p>In my <strong>functions.php</strong> template, I added my new function- it merely takes an id as a parameter and runs the word count query on the database using the WordPress function to run a raw query,</p>
<pre class="brush: php">
function nano_get_post_word_count($id) {

	global $wpdb; 

	// get word count for a single post
	$word_count = $wpdb-&gt;get_results(&quot;
			SELECT
			SUM( LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`, &#039; &#039;, &#039;&#039;))+1) AS &#039;wordcount&#039;
			FROM $wpdb-&gt;posts
			where `post_type` = &#039;post&#039; and `ID`=&quot; . $id, ARRAY_A
	);
	return($word_count[0][&#039;wordcount&#039;]);
}
</pre>
<p>I then monkeyed the part of the templates that output the author and date/time of post publishing to be more on line with what I need (not referring to posts)&#8211; I lost the original part of template, but this is what produces the example above</p>
<pre class="brush: php">
printf(__(&quot;%d words written by %s on %s&quot;,&#039;journalist-13&#039;), nano_get_post_word_count(get_the_ID()), get_the_author(), get_the_time(&#039;F jS, Y g:i a&#039;));
</pre>
<p>I use my own custom function to generate the word count for an individual post.</p>
<p>The next part was to do something to create a running total of all words written across all published posts, put into my side bar. I could have done the calculation every time the sidebar loaded, but that seemed un-needed as the number would change only when a change was made, so I went for a cheap cache method.</p>
<p>Again, modding the <strong>functions.php</strong> template, I first add a hook that will be called when a post is  saved.  </p>
<pre class="brush: php">
// Use the save_post action to update word counts
add_action( &#039;save_post&#039;, &#039;nano_save_post&#039;, 5, 2 );
</pre>
<p>This will call my own private function <strong>nano_save_post</strong> whenever anything is published or updated. The database query is similar, but we run it across all published posts. The last part is a way to write to a text file on my server. I&#8217;ve obscured my own path, put it is a directory named YYYY inside <strong>wp-content</strong> that contains writable file named <strong>XXXXX</strong>. it would likely be more sensible to stuff it ins a meta field of the database, and maybe I will get around to that later.</p>
<pre class="brush: php">
function nano_save_post()
{

	global $wpdb; 

	// custom query to events whose end dates are greater than the current time stamp
	$total_word_count = $wpdb-&gt;get_results(&quot;
			SELECT
			SUM( LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`, &#039; &#039;, &#039;&#039;))+1) AS &#039;Totalcount&#039;
			FROM $wpdb-&gt;posts
			where `post_type` = &#039;post&#039; and `post_status` = &#039;publish&#039;&quot;, ARRAY_A
	);

	// update the file with the total word count
	$DATAFILE = fopen(TEMPLATEPATH . &#039;/../../YYY/XXXXX&#039;,&quot;w+&quot;);
	fwrite($DATAFILE, $total_word_count[0][&#039;Totalcount&#039;]) or die(&quot; failed writing $DATAFILE&quot;);
	fclose($DATAFILE);
}
</pre>
<p>And the last part is some code for the sidebar to put a count and display a percentage for progress value. I came across this <a href="http://blog.benogle.com/2009/06/16/simple-css-shiny-progress-bar-technique/">Simple CSS shiny progress bar technique</a> to add a fancy progress bar that will change as my word count increases:</p>
<p><img src="http://cogdogblog.com/wp-content/uploads/2010/11/nano-sidebar.png" alt="" title="nano sidebar" width="213" height="106" class="aligncenter size-full wp-image-5893" /></p>
<p>The progress bar calls for some CSS to be added to the style sheet, but the working parts are in the <strong>sidebar.php</strong> template. We simply get the contents of our cached wordcount file ($wordcount) convert it to a percent ($wordpercent), and use the values in the output:</p>
<pre class="brush: php">
&lt;?php
// get the wordcount
$wordcount = file_get_contents(TEMPLATEPATH . &#039;/../../YYY/XXXX&#039;);
// make percentage
$wordpercent = sprintf(&#039;%d&#039;,$wordcount / 50000 * 100);
?&gt;
&lt;h3&gt;&lt;?php _e(&#039;The Count&#039;,&#039;journalist-13&#039; ); ?&gt;&lt;/h3&gt;
&lt;p&gt;&lt;?php echo $wordcount?&gt; out of 50,000 words written (&lt;?php echo $wordpercent?&gt;% done)&lt;/p&gt;

&lt;div class=&quot;meter-wrap&quot;&gt;
    &lt;div class=&quot;meter-value&quot; style=&quot;background-color: #0a0; width: &lt;?php echo $wordpercent?&gt;%;&quot;&gt;
        &lt;div class=&quot;meter-text&quot;&gt;
            progress
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>The other thing that occurred to me is that the blog format puts the most recently written content first, and rolls back in time, while the way to read the story is the reverse order. I deployed this by using the same (default) category for my &#8220;posts&#8221;- the category is called <strong>writing</strong>. I then copied my basic <strong>index.php</strong> template into a new one <strong>category-writing.php</strong> which is what is used to generate the output for this single category.</p>
<p>To make the posts go in the order they were written (as opposed to the default reverse chronology), I simply added a modified query above &#8220;The Loop&#8221;</p>
<pre class="brush: php">
&lt;?php
// for category we will make posts go in date order
global $query_string;
query_posts($query_string . &quot;&amp;order=ASC&quot;);
?&gt;

&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
</pre>
<p>This trick just recasts the database call for the main loop to pull posts in the order they were written which you can access via the link for this category <a href="http://nano.dommy.com/category/writing">http://nano.dommy.com/category/writing</a>.</p>
<p>That&#8217;s where I site so far- I added some links to the sidebar widget to pount to a file that has the ePub version generated by Patrick&#8217;s Anthologize modification &#8212; <a href="http://nano.dommy.com/wp-content/pub/i_am_a_dog.epub">http://nano.dommy.com/wp-content/pub/i_am_a_dog.epub</a>, as long as I remember to redo the Anthologize export each time I write something.</p>
<p>And that&#8217;s mostly it (until I decided to tinker tomorrow). </p>
<p>Now, I better make sure I get my 1667words in tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://cogdogblog.com/2010/11/02/nanowrimo-open/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>It&#8217;s Kind of Like That</title>
		<link>http://cogdogblog.com/2009/11/14/its-kind-of-like-that/</link>
		<comments>http://cogdogblog.com/2009/11/14/its-kind-of-like-that/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 09:12:01 +0000</pubDate>
		<dc:creator>Alan Levine aka CogDog</dc:creator>
				<category><![CDATA[Blog Pile]]></category>
		<category><![CDATA[nanowrimo]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://cogdogblog.com/?p=4384</guid>
		<description><![CDATA[cc licensed flickr photo shared by Darren Larson I&#8217;m feeling many parallels between my current training to run a half marathon and trying to crank out 50,000 words for NaNoWriMo. Obviously a regimen is needed, the goals are both things I question (or have questioned) whether I can do, falling behind the schedule&#8211; puts you behind the schedule, sometimes in a spiral of self-criticism. I&#8217;m not saying I Hate Writing, but it is damn hard, especially when there is little time to be un-inpsired. Just when you think you&#8217;ve done a good run, the damn clock on a treadmill or the NaNoWriMo chart, sets you in a head down grunt up hill. I am not climbing the right hill! Tomorrow is mid-way in the month, and to be on pace, I should be at 25,000 words, and thus am about 7000 behind. It&#8217;s easy to get obsessed with the count, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Running" href="http://flickr.com/photos/darrenlarson/1155759290/"><img src="http://farm2.static.flickr.com/1350/1155759290_5e184a3060.jpg" /></a><br /><small><a title="Running" href="http://flickr.com/photos/darrenlarson/1155759290/">cc licensed flickr photo</a> shared by <a href="http://flickr.com/people/darrenlarson/">Darren Larson</a></small></p>
<p>I&#8217;m feeling many parallels between <a href="http://dommy.com/ihaterunning">my current training to run a half marathon</a> and <a href="http://www.nanowrimo.org/">trying to crank out 50,000 words for NaNoWriMo</a>. </p>
<p>Obviously a regimen is needed, the goals are both things I question (or have questioned) whether I can do, falling behind the schedule&#8211; puts you behind the schedule, sometimes in a spiral of self-criticism. I&#8217;m not saying I Hate Writing, but it is damn hard, especially when there is little time to be un-inpsired. Just when you think you&#8217;ve done a good run, the damn clock on a treadmill or the NaNoWriMo chart, sets you in a head down grunt up hill.</p>
<p><img src="http://cogdogblog.com/wp-content/uploads/2009/11/nanowrimo-graph.jpg" alt="nanowrimo-graph" title="nanowrimo-graph" width="418" height="270" class="alignnone size-full wp-image-4385" /></p>
<p>I am not climbing the right hill! Tomorrow is mid-way in the month, and to be on pace, I should be at 25,000 words, and thus am about 7000 behind. It&#8217;s easy to get obsessed with the count, as much as the details of a running program.</p>
<p>My novel is mostly charted out in structure, but I&#8217;m still feeling vague of sharing a lot of detail to I can at least get the next quarter done. I will say it is not about dogs, not about technology, not really too connected to anything I write here (well there is some bicycle elements to the story&#8211; and the germ for it was started by thoughts about 10 years ago when I biked to work).</p>
<p>It has somewhat of a formula to it, say some symmetry, in that there are 4 parts, and I know what characters and plots need to happen in each. At the same time, I wonder if it is too gimmicky, so am trying to mix up the edges of the patterns. I both like and am challenged by character development, in trying to shape it for the reader without being so explicit. Will my characters seem real or more like cardboard cartoons? Can they elicit a response from a reader or just a &#8220;ho-hum&#8221;?</p>
<p>Also, for fun, I play a bit part in every quarter story, not central at all to the story, kind of like a walk on actor part.</p>
<p>Tomorrow morning, I am headed out for a long ass plane flight, all the way to Doha Qatar for the <a href="http://www.wise-qatar.com/">World Innovation Summit for Education</a>, hoping that the 20+ hours in transit can provide the impetus to crank out maybe 10k more words.</p>
<p>I know I can do this, but I am thinking that perhaps writing a novel, now, seems harder than doing a full marathon.</p>
<p>And WTF, I am wasting words here when I can use them eslewhere!</p>
]]></content:encoded>
			<wfw:commentRss>http://cogdogblog.com/2009/11/14/its-kind-of-like-that/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
	</channel>
</rss>

