<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vert Studios Web Design Blog</title>
	<atom:link href="http://www.vertstudios.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vertstudios.com/blog</link>
	<description>Web design and development resources.</description>
	<lastBuildDate>Thu, 03 May 2012 22:57:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Markdown to PDF Utility</title>
		<link>http://www.vertstudios.com/blog/markdown-pdf-utility/</link>
		<comments>http://www.vertstudios.com/blog/markdown-pdf-utility/#comments</comments>
		<pubDate>Thu, 03 May 2012 22:57:16 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3954</guid>
		<description><![CDATA[I needed to get a Markdown document in PDF format. Unable to find a good solution, I set off to make a Markdown to PDF conversion utility. About 20 lines of Python later, here we are!]]></description>
			<content:encoded><![CDATA[<p>I needed to get a Markdown document in PDF format. Unable to find a good solution, I set off to make a Markdown to PDF conversion utility. About 20 lines of Python later, here we are!</p>
<h2>md2pdf: Markdown to PDF</h2>
<p>You can download <a href="https://github.com/joequery/md2pdf">md2pdf</a> on Github. Installation instructions can be found in the README. Usage is extremely simple:</p>
<pre class="brush: plain; title: ; notranslate">
$ md2pdf my-markdown-document.md
</pre>
<h2>How it was made</h2>
<p>This utility is actually pretty silly. It simply serves as a glue between<br />
<a href="http://code.google.com/p/python-markdown2/">markdown2</a>, which takes Markdown and produces HTML, and <a href="www.xhtml2pdf.com">xhtml2pdf</a>, which takes HTML and produces PDFs. The script uses a system call because the xhtml2pdf interface is non-trivial. Consequently, you&#8217;re probably better off not using this on a production server.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/pyquery-tutorial-basic-html-parsing-pyquery/' title='PyQuery Tutorial: Basic HTML Parsing with PyQuery'>PyQuery Tutorial: Basic HTML Parsing with PyQuery</a></li>
<li><a href='http://www.vertstudios.com/blog/daily-contact-form-tests-python-cron/' title='Daily Contact Form Tests with Python and Cron'>Daily Contact Form Tests with Python and Cron</a></li>
<li><a href='http://www.vertstudios.com/blog/install-pyquery-cygwin/' title='Install PyQuery under Cygwin'>Install PyQuery under Cygwin</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3954" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/markdown-pdf-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Screencast Software for 11.04+</title>
		<link>http://www.vertstudios.com/blog/ubuntu-screencast-software-11-04/</link>
		<comments>http://www.vertstudios.com/blog/ubuntu-screencast-software-11-04/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 05:07:10 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3946</guid>
		<description><![CDATA[I browsed Google for quite a while before I finally found a good product for recording screencasts on Ubuntu. Most software I found, no offense gtk-recordMyDesktop, was extremely outdated and hardly functional. Video quality was either terrible or video/audio was out of sync.]]></description>
			<content:encoded><![CDATA[<p>I browsed Google for quite a while before I finally found a good product for recording screencasts on Ubuntu. Most software I found, no offense gtk-recordMyDesktop, was extremely outdated and hardly functional. Video quality was either terrible or video/audio was out of sync.</p>
<h2>Enter Kazam!</h2>
<p>Thanks to some more strict queries on Google, I found <a href="http://www.twm-kd.com/linux/kazam/kazam-1-2-0-released-as-stable/">Kazam</a> on <a href="http://www.askubuntu.com">AskUbuntu.com</a>. </p>
<p>It has an extremely simple interface, as seen below.<br />
<img src="http://i.imgur.com/WhhVN.png" alt="Kazam Ubuntu Screencast Software" /></p>
<p>The quality is just fine for simple screencasts, and it allows you to record audio that actually syncs with the video! </p>
<h2>Installation</h2>
<p>First, we need some Python modules to be installed.</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo apt-get install --reinstall gir1.2-gtk-2.0 python-software-properties software-properties-gtk
</pre>
<p>Now we actually grab Kazam as instructed by their site.</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo add-apt-repository ppa:kazam-team/stable-series
$ sudo apt-get update
$ sudo apt-get install kazam
</pre>
<p>And you&#8217;re done! You can run kazam via the command line or your distro&#8217;s menu. </p>
<h2>Extras</h2>
<p>If you happen to have FFMpeg installed, here&#8217;s a nice 2-pass video/audio <a href="https://gist.github.com/2486369">encoder script</a> that encodes with H.264.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/dual-monitors-kubuntu-11-10-in-10-minutes/' title='Dual Monitors on Kubuntu 11.10 (In Under 10 Minutes)'>Dual Monitors on Kubuntu 11.10 (In Under 10 Minutes)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3946" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/ubuntu-screencast-software-11-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VI Keybindings in your Shell</title>
		<link>http://www.vertstudios.com/blog/vi-keybindings-shell/</link>
		<comments>http://www.vertstudios.com/blog/vi-keybindings-shell/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 03:52:26 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3934</guid>
		<description><![CDATA[There was once a very sad point in my development career where if I made a typo earlier in one of my bash statements, I would have to hold the left arrow to get my cursor over to the problem area and fix it. Then, one fateful day, I discovered VI keybindings in the shell!
]]></description>
			<content:encoded><![CDATA[<p>There was once a very sad point in my development career where if I made a typo earlier in one of my bash statements, I would have to hold the left arrow to get my cursor over to the problem area and fix it. Then, one fateful day, I discovered VI keybindings in the shell!</p>
<h2>Activating VI Keybindings</h2>
<p>To get VI keybindings working in your shell, simply execute</p>
<pre class="brush: plain; title: ; notranslate">
$ set -o vi
</pre>
<p>(If you decide you like vi keybindings in the shell and you want this mode enabled upon shell startup, append the command to your ~/.bash_profile for OS X and ~/.bashrc for linux ((<a href="http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html">Why the difference?</a>))</p>
<h2>Using the VI Keybindings</h2>
<p>The shell will have normal/insert mode as expected. Here are the commands I use frequently:</p>
<pre class="brush: plain; title: ; notranslate">
i - enter insert mode
esc - back to normal mode

* IN NORMAL MODE *
cc - clear the current line and enter insert mode
 C - clear from cursor until the end of the line and enter insert mode
dd - delete the current line
 D - delete from the cursor until the end of the line
 w - next word
 W - next white-space delimited word
 b - previous word
 B - previous white-space delimited word
dw - delete word
cw - change word
fx - find the next occurrence of the character 'x'
Fx - find the previous occurrence of the character 'x'
 $ - move the cursor to the end of the line
 0 - move the cursor to the beginning of the line
 ; - repeat last find command (preserves direction)
 l - move cursor right
 h - move cursor left
 k - scroll up through command history
 j - scroll down through command history
 A - move the cursor to the end of the line and enter insert mode
 I - move the cursor to the beginning of the line and enter insert mode

* Numeric modifier keys work as well! *
5W - move forward five white-space delimited words. 
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/git-workflow-crap-committed-master/' title='Git Workflow: Crap, I committed to master! '>Git Workflow: Crap, I committed to master! </a></li>
<li><a href='http://www.vertstudios.com/blog/productivity-tip-hosts-file/' title='Productivity Tip: Your Hosts file is Just Barely Annoying Enough'>Productivity Tip: Your Hosts file is Just Barely Annoying Enough</a></li>
<li><a href='http://www.vertstudios.com/blog/start-vim-file-navigation-mode/' title='Start VIM in File Navigation Mode'>Start VIM in File Navigation Mode</a></li>
<li><a href='http://www.vertstudios.com/blog/overcome-programming-apathy/' title='Overcome Programming Apathy'>Overcome Programming Apathy</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3934" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/vi-keybindings-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Recursion – Part 2</title>
		<link>http://www.vertstudios.com/blog/introduction-recursion-%e2%80%93-part-2/</link>
		<comments>http://www.vertstudios.com/blog/introduction-recursion-%e2%80%93-part-2/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 06:01:41 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[screencast]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3931</guid>
		<description><![CDATA[Part two of the <a href="http://www.vertstudios.com/blog/introduction-recursion-part-1">Introduction to Recursion series</a>! In this video, we discuss the Factorial function and its recursive properties in depth.]]></description>
			<content:encoded><![CDATA[<p>Part two of the <a href="http://www.vertstudios.com/blog/introduction-recursion-part-1">Introduction to Recursion series</a>! In this video, we discuss the Factorial function and its recursive properties in depth.</p>
<p>http://www.youtube.com/watch?v=CboUF7gtVSo<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/introduction-recursion-part-1/' title='Introduction to Recursion &#8211; Part 1'>Introduction to Recursion &#8211; Part 1</a></li>
<li><a href='http://www.vertstudios.com/blog/nginx-php-fpm-installation-guide-10-04/' title='Nginx, PHP-FPM Installation Guide on Ubuntu 10.04'>Nginx, PHP-FPM Installation Guide on Ubuntu 10.04</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3931" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/introduction-recursion-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Table Sort Plugin &#124; Stupidly simple jQuery table sort</title>
		<link>http://www.vertstudios.com/blog/jquery-table-sort-plugin-stupidly-simple-jquery-table-sort/</link>
		<comments>http://www.vertstudios.com/blog/jquery-table-sort-plugin-stupidly-simple-jquery-table-sort/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 21:16:44 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3926</guid>
		<description><![CDATA[I needed a simple jQuery plugin to let me sort table columns. Unfortunately, I couldn't find one that captured the simplicity I was looking for. I don't need 1000+ lines of code for a simple table sort!
]]></description>
			<content:encoded><![CDATA[<p>I needed a simple jQuery plugin to let me sort table columns. Unfortunately, I couldn&#8217;t find one that captured the simplicity I was looking for. I don&#8217;t need 1000+ lines of code for a simple table sort!</p>
<h2>The Stupid Table Sort!</h2>
<p>Consequently, I embarked on a journey to create a stupidly simple jQuery table sort plugin. Remaining true to that, I&#8217;ve named the plugin the <a href="http://joequery.github.com/Stupid-Table-Plugin/">Stupid jQuery Table Sort</a>. Flattering name, I know&#8230;this is why I&#8217;m not a marketer. </p>
<h2>Check out the demo!</h2>
<p><a href="http://joequery.github.com/Stupid-Table-Plugin/">View the demo</a>, and let me know what you think!<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/a-break-from-jquery/' title='A Break from jQuery'>A Break from jQuery</a></li>
<li><a href='http://www.vertstudios.com/blog/jquery-development-pattern/' title='A jQuery Development Pattern'>A jQuery Development Pattern</a></li>
<li><a href='http://www.vertstudios.com/blog/jquery-sticky-scroller-position-fixed-plugin/' title='jQuery Sticky Scroller / Position:Fixed Plugin'>jQuery Sticky Scroller / Position:Fixed Plugin</a></li>
<li><a href='http://www.vertstudios.com/blog/arrayshift-jquery-plugin/' title='.arrayShift() jQuery Plugin'>.arrayShift() jQuery Plugin</a></li>
<li><a href='http://www.vertstudios.com/blog/swap-jquery-plugin/' title='jQuery .swap() Plugin'>jQuery .swap() Plugin</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3926" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/jquery-table-sort-plugin-stupidly-simple-jquery-table-sort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Workflow: Crap, I committed to master!</title>
		<link>http://www.vertstudios.com/blog/git-workflow-crap-committed-master/</link>
		<comments>http://www.vertstudios.com/blog/git-workflow-crap-committed-master/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 05:08:21 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3911</guid>
		<description><![CDATA[So you know you should pretty much <a href="http://scottchacon.com/2011/08/31/github-flow.html">never hack directly on master</a> when working with git. Instead, you should create branches and merge them later.  Beyond best practices for their own sake, some github projects really want you creating pull requests from a certain branch.   

Sometimes, however, I get in <b>the zone</b> and forget to checkout a branch because I want to get this feature DONE! In my haste, I commit to master directly. I don't want my pull request to be rejected just because I hacked on master.]]></description>
			<content:encoded><![CDATA[<p>So you know you should pretty much <a href="http://scottchacon.com/2011/08/31/github-flow.html">never hack directly on master</a> when working with <a href="http://www.vertstudios.com/blog/stop-annoying-your-git-collaborators/">git</a>. Instead, you should create branches and merge them later.  Beyond best practices for their own sake, some github projects really want you creating pull requests from a certain branch.   </p>
<p>Sometimes, however, I get in <b>the zone</b> and forget to checkout a branch because I want to get this feature DONE! In my haste, I commit to master directly. I don&#8217;t want my pull request to be rejected just because I hacked on master.</p>
<h2>What do we do now?</h2>
<p>Luckily, recovery is extremely simple. We can fix the repo up to get back in line with branching best practices.</p>
<p>So say we&#8217;ve just committed to master and we&#8217;re currently on the master branch.</p>
<pre class="brush: plain; title: ; notranslate">
$ git log
commit 9huuh23tnhubazhuxbeeashebcdjis3hl2iidu
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 22:15:10 2012 -0500

        Refactor new feature X to be more awesome

commit xotnhnt234ub23st2b323hb23tu2bh32bu23uu
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 22:05:10 2012 -0500

        New feature X

commit b232udh24xub2394d249ud394ub34bu9348ub9
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 12:05:10 2012 -0500

        Some upstream master commit
</pre>
<p>The last two commits needed to be on their own branch, say <b>new_feature</b>. Your local master branch needs to be at &#8220;Some upstream master commit&#8221;. Here&#8217;s how we can accomplish this. </p>
<h3>Step 1) Create the new_feature branch</h3>
<p>Since master is currently in the state we want the new_feature branch to be in (since we&#8217;ve just added our new feature commit), we can just branch off of master.</p>
<pre class="brush: plain; title: ; notranslate">
$ git branch new_feature
</pre>
<p>So new_feature is just a direct copy of master at this point.</p>
<p>Right now, we&#8217;re still on the master branch. As stated above, we want the master branch to be at &#8220;Some upstream master commit&#8221;. We can accomplish this via <b>git reset &#8211;hard</b>. </p>
<h3>Step 2) Resetting the master branch</h3>
<p><b>A side note regarding git reset &#8211;hard</b>:</p>
<p>It&#8217;s important to note that git reset &#8211;hard is NOT a safe operation. You CAN lose work if you don&#8217;t use it carefully. Luckily, in this context, there&#8217;s nothing to worry about since I&#8217;m guiding you through the process&#8230;but just for your toolbelt, visit this <a href="http://stackoverflow.com/a/1109433">StackOverflow</a> answer thread if you ever accidentally lose work to git reset &#8211;hard.</p>
<p>Anyway, to get the master branch back to &#8220;Some upstream master commit&#8221;, we can copy the SHA of the commit from git log to our clipboard and execute</p>
<pre class="brush: plain; title: ; notranslate">
$ git checkout master
$ git reset --hard b232udh24xub2394d249ud394ub34bu9348ub9
HEAD is now at ... Some upstream master commit
</pre>
<p>Also, for convenience, we can use the HEAD alias. In this example, we wanted to reference the commit that was 2 commits behind the latest commit. We could have equally executed</p>
<pre class="brush: plain; title: ; notranslate">
$ git checkout master
$ git reset --hard HEAD~2
</pre>
<p>The git log should now look like the following:</p>
<pre class="brush: plain; title: ; notranslate">
$ git log
commit b232udh24xub2394d249ud394ub34bu9348ub9
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 12:05:10 2012 -0500

        Some upstream master commit
</pre>
<h3>Step 3) Verification</h3>
<p>We&#8217;ve verified the master branch is where it should be, so now we should checkout the new_feature branch and run a git log. </p>
<pre class="brush: plain; title: ; notranslate">
$ git checkout new_feature
Switched to branch 'new_feature'
$ git log
commit 9huuh23tnhubazhuxbeeashebcdjis3hl2iidu
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 22:15:10 2012 -0500

        Refactor new feature X to be more awesome

commit xotnhnt234ub23st2b323hb23tu2bh32bu23uu
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 22:05:10 2012 -0500

        New feature X

commit b232udh24xub2394d249ud394ub34bu9348ub9
Author: Joseph McCullough &lt;joseph@vertstudios.com&gt;
Date:   Wed Apr 11 12:05:10 2012 -0500

        Some upstream master commit
</pre>
<p>So we still have our work, but it&#8217;s on a feature branch, as it should be! We&#8217;re now free to send a pull request without any bickering from the project owner, or we can merge the new_feature branch later once it&#8217;s ready for production.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/vi-keybindings-shell/' title='VI Keybindings in your Shell'>VI Keybindings in your Shell</a></li>
<li><a href='http://www.vertstudios.com/blog/stop-annoying-your-git-collaborators/' title='Stop Annoying your Git Collaborators'>Stop Annoying your Git Collaborators</a></li>
<li><a href='http://www.vertstudios.com/blog/start-vim-file-navigation-mode/' title='Start VIM in File Navigation Mode'>Start VIM in File Navigation Mode</a></li>
<li><a href='http://www.vertstudios.com/blog/github-api-latest-commit-details-php/' title='GitHub API &#8211; Get Latest Commit Details (PHP)'>GitHub API &#8211; Get Latest Commit Details (PHP)</a></li>
<li><a href='http://www.vertstudios.com/blog/overcome-programming-apathy/' title='Overcome Programming Apathy'>Overcome Programming Apathy</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3911" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/git-workflow-crap-committed-master/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C: request for member in something not a structure or union</title>
		<link>http://www.vertstudios.com/blog/c-request-member-structure-union/</link>
		<comments>http://www.vertstudios.com/blog/c-request-member-structure-union/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 03:31:46 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[pointers]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3900</guid>
		<description><![CDATA[If you're trying to pass a pointer to a structure to a function, you may be getting the compiler error <b>request for member ‘SOME_PROPERTY’ in something not a structure or union</b>. If you  <em>swear</em> you're passing in a pointer to the proper structure, and you're <em>certain</em>, there are no typos for the member name you're trying to access, you may just be experiencing a bit of pointer ambiguity. ]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to pass a pointer to a structure to a function, you may be getting the compiler error <b>request for member ‘SOME_PROPERTY’ in something not a structure or union</b>. If you  <em>swear</em> you&#8217;re passing in a pointer to the proper structure, and you&#8217;re <em>certain</em>, there are no typos for the member name you&#8217;re trying to access, you may just be experiencing a bit of pointer ambiguity. </p>
<h2> The Problem! </h2>
<p>Consider a very simple example. </p>
<pre class="brush: cpp; title: ; notranslate">
// Example demonstrating C pointer ambiguity
#include&lt;stdio.h&gt;

typedef struct{
	char* job;
	int age;
} Person;

void give_bob_a_job(Person*);

int main(){
	Person bob;
	give_bob_a_job(&amp;bob);
	printf(&quot;The job of bob is %s\n&quot;, bob.job);
        return 0;
}

void give_bob_a_job(Person *bob){
	*bob.job = &quot;Sysadmin&quot;;
}
</pre>
<p>We compile the file</p>
<pre class="brush: plain; title: ; notranslate">
~$ gcc bob.c -o bob.o
bob.c: In function ‘give_bob_a_job’:
bob.c:18:6: error: request for member ‘job’ in something not a structure or union
</pre>
<p>So we receive the error <b>error: request for member ‘job’ in something not a structure or union</b>. </p>
<p>We run through a mental checklist:</p>
<ul>
<li>Did I pass a pointer to the right structure?</li>
<li>Does that structure really have a &#8216;job&#8217; member?</li>
<li>Did I make any typos in declaring the member or calling the member?</li>
</ul>
<p>If all these check out, then we move on.</p>
<p>Let&#8217;s look closer at the statement on line 18.</p>
<pre class="brush: cpp; title: ; notranslate">*bob.job = &quot;Sysadmin&quot;;</pre>
<p>This actually reads </p>
<blockquote><p>
&#8216;Assign the string &#8220;Sysadmin&#8221; to the pointer variable of bob.job&#8217;
</p></blockquote>
<p>In other words, the deference operator (<b>*</b>) is dereferencing all of <b>bob.job</b> instead of dereferencing bob and accessing its job member. In this context, <b>bob</b> is just a pointer to Person, so it&#8217;s a memory address. Thus the compiler error makes sense! </p>
<p>Luckily, the solution is super simple.</p>
<h2> The Solution! </h2>
<p>We can be explicit about our dereferencing by using parenthesis. </p>
<pre class="brush: cpp; title: ; notranslate">(*bob).job = &quot;Sysadmin&quot;;</pre>
<p>This reads</p>
<blockquote><p>
&#8216;Assign the string &#8220;Sysadmin&#8221; to the pointer variable of bob&#8217;s job member&#8217;
</p></blockquote>
<p>Replace line 18 with the correction, and the code should compile with the following output upon execution:</p>
<pre class="brush: plain; title: ; notranslate">
The job of bob is Sysadmin
</pre>
<h2>Syntax cleanup</h2>
<p>Dereferencing a pointer to a structure is so common, we have a shorthand for doing so.</p>
<pre class="brush: plain; title: ; notranslate">(*foo).bar</pre>
<p>is equal to</p>
<pre class="brush: plain; title: ; notranslate">foo-&gt;bar</pre>
<p>so </p>
<pre class="brush: plain; title: ; notranslate">bob-&gt;job = &quot;Sysadmin&quot;;</pre>
<p>would work as well.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/kr-error-conflicting-types-getline/' title='K&amp;R: Error: conflicting types for &#8216;getline&#8217;'>K&#038;R: Error: conflicting types for &#8216;getline&#8217;</a></li>
<li><a href='http://www.vertstudios.com/blog/introduction-pointers-c-tutorial/' title='Introduction to Pointers in C++ Tutorial'>Introduction to Pointers in C++ Tutorial</a></li>
<li><a href='http://www.vertstudios.com/blog/c-sentence-case-capitalize-word/' title='C++ Sentence Case (Capitalize First Word)'>C++ Sentence Case (Capitalize First Word)</a></li>
<li><a href='http://www.vertstudios.com/blog/removing-punctuation-spaces-string-c/' title='Removing punctuation and spaces from a String in C++'>Removing punctuation and spaces from a String in C++</a></li>
<li><a href='http://www.vertstudios.com/blog/c-capitalize-word-proper-case/' title='C++ Capitalize Each Word (Proper Case)'>C++ Capitalize Each Word (Proper Case)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3900" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/c-request-member-structure-union/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Recursion &#8211; Part 1</title>
		<link>http://www.vertstudios.com/blog/introduction-recursion-part-1/</link>
		<comments>http://www.vertstudios.com/blog/introduction-recursion-part-1/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 02:36:01 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[screencast]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3893</guid>
		<description><![CDATA[Part 1 of a multipart series covering the basics of recursion.]]></description>
			<content:encoded><![CDATA[<p>Part 1 of a multipart series covering the basics of recursion. I hope you enjoy!</p>
<p>http://www.youtube.com/watch?v=TA_qrRZ1cpI<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/nginx-php-fpm-installation-guide-10-04/' title='Nginx, PHP-FPM Installation Guide on Ubuntu 10.04'>Nginx, PHP-FPM Installation Guide on Ubuntu 10.04</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3893" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/introduction-recursion-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>K&amp;R: Error: conflicting types for &#8216;getline&#8217;</title>
		<link>http://www.vertstudios.com/blog/kr-error-conflicting-types-getline/</link>
		<comments>http://www.vertstudios.com/blog/kr-error-conflicting-types-getline/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 01:09:40 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3885</guid>
		<description><![CDATA[So you're reading through K&#038;R's <a href="http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/0131103628/ref=sr_1_1?ie=UTF8&#038;qid=1331341099&#038;sr=8-1">The C Programming Language</a>, and you're on page 29 or so, section 1.9 entitled <b>Character Arrays</b>.]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;re reading through K&#038;R&#8217;s <a href="http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/0131103628/ref=sr_1_1?ie=UTF8&#038;qid=1331341099&#038;sr=8-1">The C Programming Language</a>, and you&#8217;re on page 29 or so, section 1.9 entitled <b>Character Arrays</b>.</p>
<p>The beginning of the sample program is as follows:</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;
#define MAXLINE 1000   /* maximum input line size */

int getline(char line[], int maxline);
void copy(char to[], char from[]);

/* print longest input line */
main()
...
</pre>
<p>And, to your confusion, you receive the following error: <b>Error: conflicting types for &#8216;getline&#8217; </b></p>
<h2>The Solution!</h2>
<p>It turns out getline is included in stdio.h, similar to printf! You can complete the exercise by renaming the getline function to something different like &#8220;readline&#8221; or &#8220;get_the_line&#8221;.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/c-request-member-structure-union/' title='C: request for member in something not a structure or union'>C: request for member in something not a structure or union</a></li>
<li><a href='http://www.vertstudios.com/blog/introduction-pointers-c-tutorial/' title='Introduction to Pointers in C++ Tutorial'>Introduction to Pointers in C++ Tutorial</a></li>
<li><a href='http://www.vertstudios.com/blog/c-sentence-case-capitalize-word/' title='C++ Sentence Case (Capitalize First Word)'>C++ Sentence Case (Capitalize First Word)</a></li>
<li><a href='http://www.vertstudios.com/blog/removing-punctuation-spaces-string-c/' title='Removing punctuation and spaces from a String in C++'>Removing punctuation and spaces from a String in C++</a></li>
<li><a href='http://www.vertstudios.com/blog/c-capitalize-word-proper-case/' title='C++ Capitalize Each Word (Proper Case)'>C++ Capitalize Each Word (Proper Case)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3885" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/kr-error-conflicting-types-getline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual Monitors on Kubuntu 11.10 (In Under 10 Minutes)</title>
		<link>http://www.vertstudios.com/blog/dual-monitors-kubuntu-11-10-in-10-minutes/</link>
		<comments>http://www.vertstudios.com/blog/dual-monitors-kubuntu-11-10-in-10-minutes/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 02:32:48 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3874</guid>
		<description><![CDATA[If you're having trouble getting dual monitors to work on the latest version of Kubuntu (Currently 11.10), this guide will attempt to save your sanity!]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having trouble getting dual monitors to work on the latest version of Kubuntu (Currently 11.10), this guide will attempt to save your sanity!</p>
<h2>Installing Dual Monitors on Kubuntu 11.10</h2>
<p>Make sure you have the latest Nvidia drivers. To do this, Navigate to &#8220;Additional Drivers&#8221; via Applications => System => Additional Drivers. </p>
<p>Now execute the following commands in your terminal in order to get <a href="http://willem.engen.nl/projects/disper/">disper</a>, a nice utility that saves us from the headache of configuring via Nvidia-Settings. </p>
<pre class="brush: plain; title: ; notranslate">
$ sudo add-apt-repository ppa:disper-dev/ppa
$ sudo add-apt-repository ppa:nmellegard/disper-indicator-ppa
$ sudo apt-get update
$ sudo apt-get install disper disper-indicator
</pre>
<p>(Credit to  <a href="http://www.joeyconway.com/blog/2011/08/13/ubuntu-how-to-extend-display-with-two-monitors/">Joey Conway</a>)</p>
<p>Verify that disper works by executing the following in your terminal:</p>
<pre class="brush: plain; title: ; notranslate">
$ disper -e
</pre>
<p>This should extend your monitors, giving you the desired functionality. This is great, except for currently we&#8217;d have to do this every single time we boot up Kubuntu.</p>
<h2>Activate Disper on Startup</h2>
<p>My first instinct, being slightly familiar with Ubuntu, was to create a startup script in <b>/etc/init.d</b>. This, however, didn&#8217;t seem to work. Instead of creating a script in the init.d directory, we&#8217;ll create the script in a Kubuntu-specific directory called Autostart.</p>
<p>First, navigate to the Autostart directory:</p>
<pre class="brush: plain; title: ; notranslate">
$ cd ~/.kde/Autostart
</pre>
<p>Now using your favorite text editor, create a script called <b>dual-monitors</b></p>
<pre class="brush: plain; title: ; notranslate">
$ vim dual-monitors
</pre>
<p>Paste in the following:</p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/bash
/usr/bin/disper -e
</pre>
<p>Save the file and quit the text editor. We now need to make the file executable or it will just be ignored by Kubuntu on startup.</p>
<pre class="brush: plain; title: ; notranslate">
$ chmod +x dual-monitors
</pre>
<p>To verify the script works, we first need to get out of our current dual screen mode to make sure the script correctly puts us back in. Thus, we use disper to force only the primary display to appear.</p>
<pre class="brush: plain; title: ; notranslate">
$ disper -s
</pre>
<p>Your 2nd monitor should deactivate. Now, while we&#8217;re still in the ~/.kde/Autotest directory, execute the following:</p>
<pre class="brush: plain; title: ; notranslate">
$ ./dual-monitors
</pre>
<p>If this causes the monitors to go back to dual-screen mode, then the script works! T</p>
<h2>Now you have Dual Monitor Suuport!</h2>
<p>Go ahead and restart your computer, and you should find that Kubuntu starts with your dual monitors functioning correctly.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/ubuntu-screencast-software-11-04/' title='Ubuntu Screencast Software for 11.04+'>Ubuntu Screencast Software for 11.04+</a></li>
<li><a href='http://www.vertstudios.com/blog/nginx-php-fpm-installation-guide-10-04/' title='Nginx, PHP-FPM Installation Guide on Ubuntu 10.04'>Nginx, PHP-FPM Installation Guide on Ubuntu 10.04</a></li>
<li><a href='http://www.vertstudios.com/blog/multiple-screenrc-configurations-gnu-screen-tutorial/' title='Multiple .screenrc Configurations | GNU Screen Tutorial'>Multiple .screenrc Configurations | GNU Screen Tutorial</a></li>
<li><a href='http://www.vertstudios.com/blog/what-linux-distro-running/' title='Snippet: What Linux Distro is Running? '>Snippet: What Linux Distro is Running? </a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3874" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/dual-monitors-kubuntu-11-10-in-10-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

