<?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/"
	>

<channel>
	<title>Cory's Place</title>
	<atom:link href="http://hekimian-williams.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://hekimian-williams.com</link>
	<description></description>
	<pubDate>Sun, 07 Mar 2010 19:39:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Image Chopper</title>
		<link>http://hekimian-williams.com/?p=157</link>
		<comments>http://hekimian-williams.com/?p=157#comments</comments>
		<pubDate>Fri, 10 Apr 2009 08:03:18 +0000</pubDate>
		<dc:creator>Cory Hekimian-Williams</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Image Chopper]]></category>

		<guid isPermaLink="false">http://hekimian-williams.com/?p=157</guid>
		<description><![CDATA[While writing a vision application I needed to generate a bunch of images of a certain size. I wrote a program that takes a folder of input images, a folder for output images, and the size of images you want to generate. I figured I&#8217;d post the source and the binary in case anyone else [...]]]></description>
			<content:encoded><![CDATA[<p>While writing a vision application I needed to generate a bunch of images of a certain size. I wrote a program that takes a folder of input images, a folder for output images, and the size of images you want to generate. I figured I&#8217;d post the source and the binary in case anyone else ever needs to do some image chopping.</p>
<p><div id="attachment_159" class="wp-caption alignleft" style="width: 310px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/04/imgchopss.png"><img class="size-medium wp-image-159" title="imgchopss" src="http://hekimian-williams.com/wp-content/uploads/2009/04/imgchopss-300x261.png" alt="Image Chopper" width="300" height="261" /></a><p class="wp-caption-text">Image Chopper</p></div></p>
<p>The program is written in C#.</p>
<p>You can find the program source code here: <a href="http://hekimian-williams.com/wp-content/uploads/2009/04/imagechopper.rar">imagechoppersource.rar</a></p>
<p>You can download the program here: <a href="http://hekimian-williams.com/wp-content/uploads/2009/04/imagechopper.exe">imagechopper.exe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hekimian-williams.com/?feed=rss2&amp;p=157</wfw:commentRss>
		</item>
		<item>
		<title>LavaLamp With Submenus in WordPress</title>
		<link>http://hekimian-williams.com/?p=146</link>
		<comments>http://hekimian-williams.com/?p=146#comments</comments>
		<pubDate>Tue, 17 Mar 2009 05:18:14 +0000</pubDate>
		<dc:creator>Cory Hekimian-Williams</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Css]]></category>

		<category><![CDATA[LavaLamp]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://hekimian-williams.com/?p=146</guid>
		<description><![CDATA[Adding Submenus with the Correct Default Menu Item
I was playing around with LavaLamp while making this website and I found that there was an annoying bug where submenus would make the sliding image scroll all the way to the left. Reading the comments on Ganeshji Marwaha&#8217;s blog I found that you could make a small [...]]]></description>
			<content:encoded><![CDATA[<p id="name"><strong>Adding Submenus with the Correct Default Menu Item</strong></p>
<p style="padding-left: 30px;">I was playing around with LavaLamp while making this website and I found that there was an annoying bug where submenus would make the sliding image scroll all the way to the left. Reading the comments on<span class="fn n"><span class="given-name"> <a href="http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/">Ganeshji Marwaha&#8217;s blog</a> I found that you could make a small change to the jquery.lavalamp.min.js file to fix it. Another problem I found was that after clicking a link in the submenu the child page would load with the sliding image going to the first menu item instead of the parent of the current page.</span></span></p>
<p style="padding-left: 30px;"><span class="fn n"><span class="given-name">I&#8217;ll show the quick and easy way to fix this glitch, then later in the post I will go into some more detail about making it work with WordPress.</span></span></p>
<p style="padding-left: 30px;"><span class="fn n"><span class="given-name"><br />
</span></span></p>
<p><strong>Getting Rid of the Slide Glitch</strong></p>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">To fix the sliding glitch, open the </span></span><span class="fn n"><span class="family-name">jquery.lavalamp.min.js, then navigate to the line that says:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">$li.not(".back").hover(function(){move(this)},noop);</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">Change it so that it says:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">$li.not(".back").mouseover(function(){move(this)},noop);</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">Save this file and it should prevent the annoying glitch when you hover over sub menus.</span></span></p>
<p style="padding-left: 30px;">
<p><strong>Making it work in WordPress</strong></p>
<p style="padding-left: 30px;">This is all fine and dandy, but if you are in WordPress you have probably noticed that no matter what page you are on, the sliding image always defaults to the first menu entry. This is because the LavaLamp menu is looking for a menu item that has a class attribute of &#8220;current&#8221;, and none currently do. In WordPress you are most likely making a call to either  <strong>wp_list_pages() </strong>or <strong>wp_list_categories()</strong> to display the menu items.</p>
<p style="padding-left: 30px;">Wordpress tags the current page with the class attribute &#8220;<strong>current_page_item</strong>&#8220;, and the current category with the class attribute &#8220;<strong>current-cat</strong>&#8220;. You also might want to note that the parent of the current category gets the class attribute &#8220;<strong>current-cat-parent</strong>.&#8221;</p>
<p style="padding-left: 30px;">If you want the image to hover behind the current page&#8217;s menu item by default, you will need to choose one of those class attributes and make the following change to the <span class="fn n"><span class="family-name">jquery.lavalamp.min.js file:</span></span></p>
<p><span class="fn n"><span class="family-name"><strong>Setting the Default Menu Item</strong><br />
</span></span></p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">To fix the default menu item, open the </span></span><span class="fn n"><span class="family-name">jquery.lavalamp.min.js, then navigate to the line that says:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">curr=$("li.current", this)[0]||
$($li[0]).addClass("current")[0];
</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="given-name">You should replace both instances of current with the correct class attribute you are using. So if our menu was listing our static WordPress pages we would change the line to</span><span class="family-name">:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">curr=$("li.current_page_item", this)[0]||
$($li[0]).addClass("</span></span><span class="fn n"><span class="family-name">current_page_item</span></span><span class="fn n"><span class="family-name">")[0];</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">If our menu is listing the categories we would change the line to say:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">curr=$("li.current-cat", this)[0]||
$($li[0]).addClass("</span></span><span class="fn n"><span class="family-name">current-cat</span></span><span class="fn n"><span class="family-name">")[0];</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">We can even get fancier with this modification. Lets say you have a category menu with a drop down list. We can set this correctly by using the following line:</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">curr=($("li.current-cat", this)[0]||
</span></span><span class="fn n"><span class="family-name">$("li.current-cat-parent", this)[0]</span></span>)||
<span class="fn n"><span class="family-name">$($li[0]).addClass("</span></span><span class="fn n"><span class="family-name">current-cat</span></span><span class="fn n"><span class="family-name">")[0];
</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">And lastly, the way I use it on my website I have actually merged the menu so that both my WordPress pages, and my categories are all listed. I needed to add the following line to make it behave correctly.</span></span></p>
<pre style="padding-left: 30px;"><span class="fn n"><span class="family-name">curr=(($("li.current-cat-parent",this)[0]||
$("li.current-cat",this)[0])||
$("li.current_page_item",this)[0])||
$($li[0]).addClass("current_page_item")[0];
</span></span></pre>
<p style="padding-left: 30px;"><span class="fn n"><span class="family-name">This last line will set the default menu item to the current categories parent if it exists. If it doesn&#8217;t it will look for the current category&#8217;s menu item. Lastly if neither of those are found it must be on a static page so it looks for the current page&#8217;s menu item.</span></span></p>
<p style="padding-left: 30px;">Feel free to leave a comment with your feedback, suggestions, or requests etc. </p>
]]></content:encoded>
			<wfw:commentRss>http://hekimian-williams.com/?feed=rss2&amp;p=146</wfw:commentRss>
		</item>
		<item>
		<title>Some of my Origami</title>
		<link>http://hekimian-williams.com/?p=126</link>
		<comments>http://hekimian-williams.com/?p=126#comments</comments>
		<pubDate>Tue, 17 Mar 2009 01:35:22 +0000</pubDate>
		<dc:creator>Cory Hekimian-Williams</dc:creator>
		
		<category><![CDATA[Origami]]></category>

		<category><![CDATA[dollar bill origami]]></category>

		<category><![CDATA[origami chocobo]]></category>

		<category><![CDATA[origami dinosaur]]></category>

		<guid isPermaLink="false">http://hekimian-williams.com/?p=126</guid>
		<description><![CDATA[I decided to post a few of my pieces of origami that I have lying around the apartment. I don&#8217;t even remember why or when I  made half of these.
Oh yea, Earlier today I was eating dinner with some friends and one of them asked me to make something. I didn&#8217;t have any paper handy [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to post a few of my pieces of origami that I have lying around the apartment. I don&#8217;t even remember why or when I  made half of these.</p>
<p>Oh yea, Earlier today I was eating dinner with some friends and one of them asked me to make something. I didn&#8217;t have any paper handy so I asked her for a dollar bill. She had a lot of fun with her money <img src='http://hekimian-williams.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Sorry for the bad quality images, my phone doesn&#8217;t like taking good pictures close up.</p>
<p><div id="attachment_130" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/03160900132.jpg"><img class="size-thumbnail wp-image-130" title="03160900132" src="http://hekimian-williams.com/wp-content/uploads/2009/03/03160900132-150x150.jpg" alt="An origami T-Rex" width="150" height="150" /></a><p class="wp-caption-text">An origami T-Rex</p></div></p>
<p><div id="attachment_131" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090012.jpg"><img class="size-thumbnail wp-image-131" title="0316090012" src="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090012-150x150.jpg" alt="An origami raptor" width="150" height="150" /></a><p class="wp-caption-text">An origami raptor</p></div></p>
<p><div id="attachment_135" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090009.jpg"><img class="size-thumbnail wp-image-135" title="0316090009" src="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090009-150x150.jpg" alt="0316090009" width="150" height="150" /></a><p class="wp-caption-text">An origami chocobo</p></div></p>
<p><div id="attachment_133" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090010.jpg"><img class="size-thumbnail wp-image-133" title="0316090010" src="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090010-150x150.jpg" alt="An origami stingray" width="150" height="150" /></a><p class="wp-caption-text">An origami stingray</p></div></p>
<p><div id="attachment_137" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090006.jpg"><img class="size-thumbnail wp-image-137" title="0316090006" src="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090006-150x150.jpg" alt="An origami dollar shirt and hat" width="150" height="150" /></a><p class="wp-caption-text">An origami dollar shirt and hat</p></div></p>
<p><div id="attachment_138" class="wp-caption alignleft" style="width: 160px"><a href="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090008.jpg"><img class="size-thumbnail wp-image-138" title="0316090008" src="http://hekimian-williams.com/wp-content/uploads/2009/03/0316090008-150x150.jpg" alt="Another picture of the origami shirt and hat" width="150" height="150" /></a><p class="wp-caption-text">Another picture of the origami shirt and hat</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://hekimian-williams.com/?feed=rss2&amp;p=126</wfw:commentRss>
		</item>
		<item>
		<title>My Take on Origami</title>
		<link>http://hekimian-williams.com/?p=119</link>
		<comments>http://hekimian-williams.com/?p=119#comments</comments>
		<pubDate>Tue, 17 Mar 2009 00:53:40 +0000</pubDate>
		<dc:creator>Cory Hekimian-Williams</dc:creator>
		
		<category><![CDATA[Origami]]></category>

		<category><![CDATA[folding paper]]></category>

		<guid isPermaLink="false">http://hekimian-williams.com/?p=119</guid>
		<description><![CDATA[I think I like origami for a few different reasons.
It&#8217;s unique.
How many people do you know that know origami? Unless you have found an origami club, its not likely that you know that many people who can fold anything other than a flapping bird. I had a friend that drove me home one day when [...]]]></description>
			<content:encoded><![CDATA[<p>I think I like origami for a few different reasons.</p>
<p>It&#8217;s unique.</p>
<p>How many people do you know that know origami? Unless you have found an origami club, its not likely that you know that many people who can fold anything other than a flapping bird. I had a friend that drove me home one day when I was in high school. While we were driving I folded her a little bull dog. I then graduated and didn&#8217;t see her for 2 or 3 years.Then I got back in touch with her and ended up hanging out. Guess what? My little origami bull dog was still on her dash board.</p>
<p>It&#8217;s cheap.</p>
<p>As a poor college student I know how annoying it is to have expensive hobbies (musical instruments, fancy computers). However, all origami requires is paper, and even my really stingy friend has paper in his room. In fact, I can usually use other people&#8217;s paper if I tell them I am going to make something cool out of it!</p>
<p>It&#8217;s cool.</p>
<p>I mean, I just turned a boring piece of paper into a threatening T-Rex while waiting for a friend to finish going to the bathroom! You would be amazed at how many people think my little works of origami are awesome.</p>
<p>It&#8217;s easy.</p>
<p>This one can be a lie sometimes&#8230; There are some pretty tough origami models out there. However, if you are just getting started and are making some of the simpler models it isn&#8217;t that bad. I think the hardest part is figuring out how to read the origami diagrams.</p>
]]></content:encoded>
			<wfw:commentRss>http://hekimian-williams.com/?feed=rss2&amp;p=119</wfw:commentRss>
		</item>
		<item>
		<title>Adding A System Call To Linux (Fedora 9)</title>
		<link>http://hekimian-williams.com/?p=20</link>
		<comments>http://hekimian-williams.com/?p=20#comments</comments>
		<pubDate>Sat, 08 Nov 2008 23:59:09 +0000</pubDate>
		<dc:creator>Cory Hekimian-Williams</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Add a System Call]]></category>

		<category><![CDATA[Fedora Core]]></category>

		<guid isPermaLink="false">http://hekimian-williams.com/?p=20</guid>
		<description><![CDATA[Creating a System Call in Fedora 9 kernel 2.6.26 (i686)

The procedure to create a system call varies in different versions of Linux. I will provide a simple step by step guide on adding a system call to the Fedora 9 i686 kernel.]]></description>
			<content:encoded><![CDATA[<p style="padding-left: 30px;">
<p><strong>Getting Started</strong></p>
<p style="padding-left: 30px;">The procedure to create a system call varies in different versions of Linux. I will provide a simple step by step guide on adding a system call to the Fedora 9 kernel. The version I used to write this document was Fedora 9 kernel 2.6.26 (i686). I originally wrote this while I was a TA for an undergraduate Operating Systems course at FSU.</p>
<p style="padding-left: 30px;">When you add a system call you will have to recompile the Linux kernel, so you must have the Linux source tree installed on your system. Furthermore, compiling the kernel can take a good amount of time (depending on the system and kernel options to it can take hours), so give yourself time. There is a way to add system calls without recompiling the kernel using modules as a wrapper, but that is beyond the scope of this document.</p>
<p><strong>Notes</strong></p>
<p style="padding-left: 30px;">When folders are described with source/ at the start of the path, it represents the highest level of the Linux source tree. You should have folders such as arch, configs, include, and init in this folder.</p>
<p><strong>Creating the System Call Source</strong></p>
<p style="padding-left: 30px;">We will be creating a simple hello world system call. Create a file mysyscall.c and fill it with the following code.</p>
<p style="padding-left: 60px;"><code>#include &lt;linux/kernel.h&gt;<br />
#include &lt;linux/linkage.h&gt;</code></p>
<p style="padding-left: 60px;"><code>asmlinkage long mysyscall(int i){<br />
&nbsp;&nbsp;&nbsp;&nbsp;printk(KERN_DEBUG "Hello World! The number was %dn", i);<br />
&nbsp;&nbsp;&nbsp;&nbsp;return(1);<br />
}<br />
</code></p>
<p><strong>Adding the System Call</strong></p>
<p style="padding-left: 30px;">1. Firstly, navigate to the root directory of your Linux source. Create a folder source/mysyscall. Next, inside of your newly created folder, add a source file mysyscall.c that contains all of your system call source code.</p>
<p style="padding-left: 30px;">2. Next, create a make file within this directory. This make file only needs to contain one line that says what to compile.</p>
<p style="padding-left: 60px;">Create source/mysyscall/Makefile (keep the capital ‘M’)</p>
<p style="padding-left: 60px;"><code>obj-y := mysyscall.o</code></p>
<p style="padding-left: 30px;">3. Next we need to modify the kernel’s make file. This is located in the root folder of your kernel’s source. Find the line that adds a bunch of folders to the core-y variable and add the folder name that the system call source is in. (mysyscall in this example)</p>
<p style="padding-left: 60px;">In source/Makefile, the line to change looks something like this:</p>
<p style="padding-left: 60px;"><code>core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/</code></p>
<p style="padding-left: 60px;">It should be changed to something like this:</p>
<p style="padding-left: 60px;"><code>core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ mysyscall/</code></p>
<p style="padding-left: 30px;">4. Now, navigate to the source/arch/x86/kernel folder. You will need to add your system call to the system call table. This is done in the file syscall_table_32.S. At the end of the file you add an entry for the new system call. Make sure to prefix your entry with “sys_”.</p>
<p style="padding-left: 60px;">It should look something like this:</p>
<p style="padding-left: 60px;"><code>.long sys_mysyscall</code></p>
<p style="padding-left: 60px;">You should notice the numbers commented out to the right of some of the entries. They tell you what number the system call is. Keep track of which number your new system call is.</p>
<p style="padding-left: 30px;">5. Next navigate to the source/include/asm-x86 folder and edit unistd_32.h. Add a #define line for the new system call. Use the number that you noted in the last step.</p>
<p style="padding-left: 60px;">You should add a line similar to this:</p>
<p style="padding-left: 60px;"><code>#define __NR_mysyscall 327</code></p>
<p style="padding-left: 30px;">6. You are now ready to recompile your kernel.</p>
<p><strong>Using the System Call</strong></p>
<p style="padding-left: 30px;">1. Next to use the system call we need to create a header file that exposes the new call. Create a file, mysyscall.h which will be imported into any program that wants to use the new system call.</p>
<p style="padding-left: 60px;">This header file should contain the following:</p>
<p style="padding-left: 60px;"><code>#include "unistd.h"<br />
#define __NR_mysyscall 327</code></p>
<p style="padding-left: 60px;"><code>long mysyscall(int i){<br />
&nbsp;&nbsp;&nbsp;&nbsp;return syscall(__NR_mysyscall, i);<br />
}</code></p>
<p style="padding-left: 30px;">2. Write a program that includes your newly created header file, and then call the mysyscall (int i) function you have implemented.</p>
<p><strong>Adding a Variable Shared Between a System Call and a Kernel Module</strong></p>
<p style="padding-left: 30px;">1. Using External Variables</p>
<p style="padding-left: 60px;">In order to use a variable that has been declared in another file, the keyword extern must be used.</p>
<p style="padding-left: 60px;"><code>#include &lt;linux/kernel.h&gt;<br />
extern int myVar;</code></p>
<p style="padding-left: 60px;"><code>int MyModuleFunction(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;/* Has access to myVar which is defined in a different kernel file*/<br />
}</code></p>
<p style="padding-left: 30px;">2. Making Variables Externally Visible</p>
<p style="padding-left: 60px;">However, variables are not visible to other files by default. For a variable declared in a system call to be visible to a kernel module it must be exported. To export a variable you must use the macro EXPORT_SYMBOL. You can export functions as well using this same macro.</p>
<p style="padding-left: 60px;"><code>#include &lt;linux/kernel.h&gt;</code></p>
<p style="padding-left: 60px;"><code>int myVar;<br />
EXPORT_SYMBOL(myVar);</code></p>
<p style="padding-left: 60px;"><code>static int MySystemCall(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;/* Has access to myVar */<br />
}</code></p>
<p style="padding-left: 30px;">
<p>Adding a system call to Linux can sometimes be a daunting task, especially the first time. I hope this document was helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://hekimian-williams.com/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
	</channel>
</rss>
