<?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>roncox.org</title>
	<atom:link href="http://roncox.org/feed" rel="self" type="application/rss+xml" />
	<link>http://roncox.org</link>
	<description>Ramblings on software development, business, and life in general</description>
	<lastBuildDate>Mon, 05 Mar 2012 05:13:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create a unique identifier (UUID) in objective-c</title>
		<link>http://roncox.org/98</link>
		<comments>http://roncox.org/98#comments</comments>
		<pubDate>Mon, 05 Mar 2012 05:03:20 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=98</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css"><!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.objc .de1, .objc .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;color: #000020;}
.objc  {font-family:monospace;color: #006; border: 1px solid #d0d0d0; background-color: #f0f0f0;}
.objc a:link {color: #000060;}
.objc a:hover {background-color: #f0f000;}
.objc .imp {font-weight: bold; color: red;}
.objc li, .objc .li1 {font-weight: normal; vertical-align:top;font: normal normal 130% 'Courier New', Courier, monospace; color: #003030;}
.objc .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.objc .li2 {font-weight: bold; vertical-align:top;font-weight: bold; color: #006060;}
.objc .kw1 {color: #a61390;}
.objc .kw2 {color: #a61390;}
.objc .kw3 {color: #a61390;}
.objc .kw4 {color: #a61390;}
.objc .kw5 {color: #400080;}
.objc .kw6 {color: #2a6f76;}
.objc .kw7 {color: #400080;}
.objc .kw8 {color: #2a6f76;}
.objc .kw9 {color: #400080;}
.objc .co1 {color: #6e371a;}
.objc .co2 {color: #11740a; font-style: italic;}
.objc .co3 {color: #bf1d1a;}
.objc .coMULTI {color: #11740a; font-style: italic;}
.objc .es0 {color: #2400d9;}
.objc .br0 {color: #002200;}
.objc .sy0 {color: #002200;}
.objc .st0 {color: #bf1d1a;}
.objc .nu0 {color: #2400d9;}
.objc span.xtra { display:block; }</p>
<p>--!></style>
<p>I&#8217;m working on an iPad project for a client and found myself needing to generate a unique identifier. I found some code from Erica Sudan <a href="http://www.tuaw.com/2011/08/21/dev-juice-help-me-generate-unique-identifiers/" title="here" target="_blank">here</a>. Works like a charm.</p>
<div class="objc">
<ol>
<li class="li1">
<div class="de1"><span class="sy0">+</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>uuid <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; CFUUIDRef theUUID <span class="sy0">=</span> CFUUIDCreate<span class="br0">&#40;</span><span class="kw2">NULL</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>uuidString <span class="sy0">=</span> <span class="br0">&#40;</span>__bridge_transfer <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span> CFUUIDCreateString<span class="br0">&#40;</span><span class="kw2">NULL</span>, theUUID<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; CFRelease<span class="br0">&#40;</span>theUUID<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> uuidString;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Note that this code is for when using ARC. If you&#8217;re not using ARC, you&#8217;ll need to autorelease the string: </p>
<div class="objc">
<ol>
<li class="li1">
<div class="de1"><span class="sy0">+</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>makeUUID <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; CFUUIDRef theUUID <span class="sy0">=</span> CFUUIDCreate<span class="br0">&#40;</span><span class="kw2">NULL</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>uuidString <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span> CFUUIDCreateString<span class="br0">&#40;</span><span class="kw2">NULL</span>, theUUID<span class="br0">&#41;</span> autorelease<span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; CFRelease<span class="br0">&#40;</span>theUUID<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> uuidString;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/98/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Someone else is fed up, too</title>
		<link>http://roncox.org/86</link>
		<comments>http://roncox.org/86#comments</comments>
		<pubDate>Tue, 03 Jan 2012 17:35:06 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Business as usual]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=86</guid>
		<description><![CDATA[I came across this great article on Business Insider: The Ten Most Annoying Management Terms Of 2011 &#8220;Reaching out&#8221; is the number one most annoying management term of 2011. Finally, someone else stating a strong dislike of the &#8220;reaching out&#8221; craze. 1 &#8211; Reaching out &#8211; TMM first came across 2011&#8242;s winning term in July [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this great article on Business Insider:</p>
<p><strong><a href="http://www.businessinsider.com/the-ten-most-annoying-management-terms-of-2011-2011-12?utm_source=%23frankguillen&#038;utm_medium=twitter&#038;utm_campaign=FrankGuillen+Buzz" target="_blank">The Ten Most Annoying Management Terms Of 2011</a><br />
</strong></p>
<p>&#8220;Reaching out&#8221; is the number one most annoying management term of 2011. Finally, someone else stating a strong dislike of the &#8220;reaching out&#8221; craze.</p>
<blockquote><p>1 &#8211; Reaching out &#8211; TMM first came across 2011&#8242;s winning term in July and since then it has spread like wildfire, which has us looking like Irish Riverdancers as we try to stamp it out as fast as we can. The origins and epidemiology of this disease has us suspecting it&#8217;s the product of some Class of 2011 Management School somewhere. It really is complete and utter rubbish. If you are about to call an investor for some documents you don&#8217;t &#8220;reach out to the client,&#8221; you phone or mail them. If you want to know why a trade hasn&#8217;t settled you don&#8217;t &#8220;Reach out to Bangalore&#8221; you &#8220;call back-office.&#8221; So let&#8217;s just kill that one right now before someone gets accused of molestation.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/86/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enough with the reaching out&#8230;</title>
		<link>http://roncox.org/68</link>
		<comments>http://roncox.org/68#comments</comments>
		<pubDate>Fri, 01 Jul 2011 00:40:27 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Business as usual]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=68</guid>
		<description><![CDATA[I don&#8217;t know how phrases get to be so common. I commented previously about my distaste for &#8220;no problem&#8221; being the nearly universal response to &#8220;thank you.&#8221; Unfortunately, &#8220;no problem&#8221; hasn&#8217;t lost any steam. I even see it in instant messaging &#8211; &#8220;np.&#8221; Ugh. The newest offender that is approaching universal usage is &#8220;reaching out&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how phrases get to be so common. I commented previously about my distaste for &#8220;no problem&#8221; being the nearly universal response to &#8220;thank you.&#8221; Unfortunately, &#8220;no problem&#8221; hasn&#8217;t lost any steam. I even see it in instant messaging &#8211; &#8220;np.&#8221; Ugh. </p>
<p>The newest offender that is approaching universal usage is &#8220;reaching out&#8221; as in &#8220;I just wanted to reach out to you&#8221; or &#8220;I&#8217;m gonna reach out to Fred.&#8221; Reach out? You mean you&#8217;re going to send Fred an email, right? There won&#8217;t be any actual reaching, will there? </p>
<p>I think there&#8217;s an appropriate time to use the &#8220;reaching out&#8221; lingo. &#8220;I try to reach out to my hermit neighbor, but she doesn&#8217;t want to have anything to do with me.&#8221; That&#8217;s acceptable. I think &#8220;reaching out&#8221; carries a certain weight with it. It&#8217;s for tough situations. So when someone says something like they&#8217;re going to reach out to Fred, I think they&#8217;re trying to make that sound like a much bigger deal than it is. It&#8217;s a way of inflating the value of the act.</p>
<p>Regardless, that&#8217;s enough with the reaching out already. Just say you&#8217;re going to send Fred an email.</p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/68/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to have the Finder show hidden directories and files</title>
		<link>http://roncox.org/70</link>
		<comments>http://roncox.org/70#comments</comments>
		<pubDate>Mon, 03 Jan 2011 01:43:55 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=70</guid>
		<description><![CDATA[I suppose a lot of the work I do could be called &#8220;low level&#8221; &#8211; tasks such as installing and configuring server applications and frameworks. It bugs me that the Finder doesn&#8217;t show ALL of the directories and files on a Mac. For example, lets say I want to work with the /usr/local/bin directory. I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I suppose a lot of the work I do could be called &#8220;low level&#8221; &#8211; tasks such as installing and configuring server applications and frameworks. It bugs me that the Finder doesn&#8217;t show ALL of the directories and files on a Mac. For example, lets say I want to work with the /usr/local/bin directory. I&#8217;m forced to use the Terminal because the Finder won&#8217;t display the /usr directory:</p>
<p><a href="http://roncox.org/wp-content/uploads/finder-hidden-files.png"><img src="http://roncox.org/wp-content/uploads/finder-hidden-files.png" alt="" title="finder-hidden-files" width="648" height="563" class="alignnone size-full wp-image-71" /></a></p>
<p>Well, it turns out there&#8217;s an easy fix for this. Open Terminal, enter the following command, and press Enter.</p>
<p><code>defaults write com.apple.Finder AppleShowAllFiles YES</code></p>
<p>The change will take effect after you restart Finder. The Windows way of doing such a thing would be to restart the computer. But we don&#8217;t do Windows, do we? Finder can be restarted like this:  hold down the option key, click and hold the Finder icon in the dock, and when the context menu pops up choose Relaunch. As you can see in the following screenshot, the Finder now shows all hidden files and directories, including the Unix directories such as /usr.</p>
<p><a href="http://roncox.org/wp-content/uploads/finder-hidden-files-shown.png"><img src="http://roncox.org/wp-content/uploads/finder-hidden-files-shown.png" alt="" title="finder-hidden-files-shown" width="648" height="563" class="alignnone size-full wp-image-76" /></a></p>
<p>If for whatever reason you find that you&#8217;d like to reverse the change, follow the same procedure except replace YES with NO.</p>
<p><code>defaults write com.apple.Finder AppleShowAllFiles NO</code></p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/70/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete .svn folders in OS X</title>
		<link>http://roncox.org/61</link>
		<comments>http://roncox.org/61#comments</comments>
		<pubDate>Mon, 27 Dec 2010 00:48:21 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=61</guid>
		<description><![CDATA[I was working on a project and had copied a directory. I ended up with a Subversion issue because the original directory (and its subdirectories) were under version control. To clean things up, I needed to delete the .svn directories in my new directory and its subdirectories. Here are the steps I took to do [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a project and had copied a directory. I ended up with a Subversion issue because the original directory (and its subdirectories) were under version control. To clean things up, I needed to delete the .svn directories in my new directory and its subdirectories. Here are the steps I took to do so:</p>
<p>Use the find command to locate the .svn directories in the current directory and its subdirectories.</p>
<div id="attachment_58" class="wp-caption alignnone" style="width: 329px"><img src="http://roncox.org/wp-content/uploads/20101226-2.png" alt="Find the .svn directories" title="20101226-2" width="319" height="158" class="size-full wp-image-58" /><p class="wp-caption-text">Find the .svn directories</p></div>
<p>Remove all of the .svn directories by piping the output of the find command to the rm command.</p>
<div id="attachment_59" class="wp-caption alignnone" style="width: 329px"><img src="http://roncox.org/wp-content/uploads/20101226-3.png" alt="Remove the .svn directories" title="20101226-3" width="319" height="18" class="size-full wp-image-59" /><p class="wp-caption-text">Remove the .svn directories</p></div>
<p>Use the find command once again to verify the .svn directories have indeed been removed.</p>
<div id="attachment_60" class="wp-caption alignnone" style="width: 329px"><img src="http://roncox.org/wp-content/uploads/20101226-4.png" alt="Confirm the .svn directories are gone" title="20101226-4" width="319" height="30" class="size-full wp-image-60" /><p class="wp-caption-text">Confirm the .svn directories are gone</p></div>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Yin to the Yang</title>
		<link>http://roncox.org/55</link>
		<comments>http://roncox.org/55#comments</comments>
		<pubDate>Sun, 10 Jan 2010 20:29:35 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Business as usual]]></category>
		<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=55</guid>
		<description><![CDATA[Some reading I was doing for a graduate course I&#8217;m taking got me to thinking about the evolution of electronic commerce. I remember all the hype around it in the late &#8217;90s. &#8220;Brick and mortar is dead.&#8221; That sort of thing. Oracle had an ad that said something like &#8220;The Internet. This changes everything.&#8221; Certainly [...]]]></description>
			<content:encoded><![CDATA[<p>Some reading I was doing for a graduate course I&#8217;m taking got me to thinking about the evolution of electronic commerce. I remember all the hype around it in the late &#8217;90s. &#8220;Brick and mortar is dead.&#8221; That sort of thing. Oracle had an ad that said something like &#8220;The Internet. This changes everything.&#8221; Certainly it was over hyped. But there&#8217;s no denying that the Internet has indeed had a significant impact on the world. For example, the globalization of the white collar workforce is what I consider to be one of the most significant changes brought about by the Internet.</p>
<p>What wasn&#8217;t discussed nearly enough at the time, and probably still isn&#8217;t today, is all of the other changes and innovations that come along with the good stuff (such as shopping on amazon.com). The Yin to the Yang, if you will. Part of the &#8220;everything&#8221; the Internet has changed has to do with crime, privacy, psychological afflictions, and more. SPAM, phishing, identity theft, cyber warfare, cyber terrorism&#8230; Those are some of the obvious downsides. I&#8217;m also sensitive to some of the more subtle issues. For example, hardcore iPhone and Blackberry users often have a constant assault of emails and instant messages which may result in the shortening of their attention spans and a severe negative impact on productivity &#8211; whether personal or at work. Here&#8217;s another subtle issue: bad information. Just because it&#8217;s published on the Web doesn&#8217;t mean it&#8217;s accurate. Wikipedia is a well-known example of this issue.</p>
<p>Anyway, just thinking out loud&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/55/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Segmentation and Paging in the Intel IA-32 Processors</title>
		<link>http://roncox.org/45</link>
		<comments>http://roncox.org/45#comments</comments>
		<pubDate>Thu, 05 Nov 2009 18:34:26 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=45</guid>
		<description><![CDATA[Note: I wrote this as a forum post for one of my graduate courses. I&#8217;m sharing it here just in case anyone else finds it interesting. &#8211;Ron 16-bit Processors and Segmentation (1978) The IA-32 architecture family was preceded by 16-bit processors, the 8086 and 8088. The 8086 has 16-bit registers and a 16-bit external data [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: I wrote this as a forum post for one of my graduate courses. I&#8217;m sharing it here just in case anyone else finds it interesting. &#8211;Ron</em></p>
<h3>16-bit Processors and Segmentation (1978)</h3>
<p>The IA-32 architecture family was preceded by 16-bit processors, the 8086 and 8088. The 8086 has 16-bit registers and a 16-bit external data bus, with 20-bit addressing giving a 1-MByte address space. The 8088 is similar to the 8086 except it has an 8-bit external data bus.</p>
<p>The 8086/8088 introduced segmentation to the IA-32 architecture. With segmentation, a 16-bit segment register contains a pointer to a memory segment of up to 64 KBytes. Using four segment registers at a time, 8086/8088 processors are able to address up to 256 KBytes without switching between segments. The 20-bit addresses that can be formed using a segment register and an additional 16-bit pointer provide a total address range of 1 MByte. </p>
<h3>The Intel 286 Processor (1982)</h3>
<p>The Intel 286 processor introduced protected mode operation into the IA-32 architecture. Protected mode uses the segment register content as selectors or pointers into descriptor tables. Descriptors provide 24-bit base addresses with a physical memory size of up to 16 MBytes, support for virtual memory management on a segment swapping basis, and a number of protection mechanisms.</p>
<h3>The Intel 386 Processor (1985)</h3>
<p>The Intel 386 processor has a 32-bit address bus that supports up to 4-GBytes of physical memory. It has a segmented-memory model and a flat memory model. The 386 introduced paging, with a fixed 4-KByte page size, providing a method for virtual memory management.</p>
<h3>The Intel Pentium Processor (1993)</h3>
<p>The pentium added extensions to make the virtual-8086 mode more efficient and allow for 4-MByte as well as 4-KByte pages. This feature is known as Page Size Extension (PSE). The PSE allows for page sizes of 4 MB to exist along with 4KB pages. </p>
<p><strong>The motivation for the larger page size</strong><br />
Assume that a task will be accessing a large buffer in memory and that it is the OS&#8217;s intention that the processor should follow the same rules of conduct when accessing any location(s) in this buffer. As an example, assume it is a 2MB video frame buffer in memory. Using 386-compatible paging, the OS would have to set up 512 PTE&#8217;s, each one associated with a 4KB page within the buffer and each one with identical attribute bit settings (i.e., the attribute bits that define the processor rules of conduct within the page). Setting up and maintaining 512 PTEs is a lot of housekeeping. </p>
<p><strong>Sources</strong></p>
<p>Intel (2009). Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 1: Basic Architecture</p>
<p>Shanley, Tom, &#038; Colwell, Bob (2004). The Unabridged Pentium 4 IA32 Processor Genealogy. Addison-Wesley Professional</p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/45/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem with &#8220;no problem&#8221;</title>
		<link>http://roncox.org/40</link>
		<comments>http://roncox.org/40#comments</comments>
		<pubDate>Wed, 27 May 2009 23:26:04 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Business as usual]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=40</guid>
		<description><![CDATA[When did &#8220;No problem&#8221; become the standard reply to &#8220;Thank you&#8221;? From what I can tell, &#8220;no problem&#8221; has just about become the universal response to &#8220;thank you&#8221; and it&#8217;s a trend I&#8217;m ready to have come to an end any time now. Why? It&#8217;s impolite. &#8220;No problem&#8221; infers that it could have been a [...]]]></description>
			<content:encoded><![CDATA[<p>When did &#8220;No problem&#8221; become the standard reply to &#8220;Thank you&#8221;? From what I can tell, &#8220;no problem&#8221; has just about become the universal response to &#8220;thank you&#8221; and it&#8217;s a trend I&#8217;m ready to have come to an end any time now. Why? It&#8217;s impolite. &#8220;No problem&#8221; infers that it could have been a problem but, as it turns out, it wasn&#8217;t. Or it wasn&#8217;t enough of a problem to make an issue out of it. Maybe it&#8217;s a way of distancing ones self &#8211; a less personal way of saying &#8220;you&#8217;re welcome.&#8221; Yeah, that&#8217;s just what we need &#8211; another way to be less personal. Maybe the next person I thank can just text message me &#8220;np.&#8221; </p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmatically scroll a JTextArea to the bottom</title>
		<link>http://roncox.org/33</link>
		<comments>http://roncox.org/33#comments</comments>
		<pubDate>Wed, 27 May 2009 23:00:05 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=33</guid>
		<description><![CDATA[I have an application that is sort of a networked console. It allows multiple clients to send messages to it, and displays those messages either in a console instance or in a JFrame with a JTextArea. I ran into the problem of the JTextArea not scrolling down when new text was appended. (FYI, the JTextArea [...]]]></description>
			<content:encoded><![CDATA[<p>I have an application that is sort of a networked console. It allows multiple clients to send messages to it, and displays those messages either in a console instance or in a JFrame with a JTextArea.</p>
<p>I ran into the problem of the JTextArea not scrolling down when new text was appended. (FYI, the JTextArea is in a JScrollPane.)  Once the JTextArea contained more lines of text than could be displayed, the new text being appended wasn&#8217;t visible unless I scrolled. What I wanted was automatic scrolling. That was accomplished with one line of code:</p>
<p>textArea.setCaretPosition(textArea.getDocument().getLength());</p>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/33/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the Java callstack anytime</title>
		<link>http://roncox.org/20</link>
		<comments>http://roncox.org/20#comments</comments>
		<pubDate>Tue, 24 Mar 2009 21:23:14 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://roncox.org/?p=20</guid>
		<description><![CDATA[I&#8217;m working on a somewhat complicated Java web application that has evolved over a number of years. As usual, evolution has resulted in the code getting a bit unwieldy. I needed to get the details of the call stack in various places so I could determine (at runtime) where a method was called from. To [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a somewhat complicated Java web application that has evolved over a number of years. As usual, evolution has resulted in the code getting a bit unwieldy. I needed to get the details of the call stack in various places so I could determine (at runtime) where a method was called from. To accomplish that, I developed this class:</p>
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
<tr>
  <!-- start source code --></p>
<td nowrap="nowrap" valign="top" align="left">
    <code><br />
<font color="#7f0055"><b>package&nbsp;</b></font><font color="#000000">com.purplewasp.util;</font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">java.util.ArrayList;</font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font><font color="#000000">CallStackUtil&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;synchronized&nbsp;static&nbsp;</b></font><font color="#000000">String&nbsp;getCallStackAsString</font><font color="#000000">()&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">StringBuilder&nbsp;sb&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">StringBuilder</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">StackTraceElement</font><font color="#000000">[]&nbsp;</font><font color="#000000">stackTraceElements&nbsp;=&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">Thread.currentThread</font><font color="#000000">()</font><font color="#000000">.getStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">array&nbsp;=&nbsp;getCallStackAsStringArray</font><font color="#000000">(</font><font color="#000000">stackTraceElements</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;array.length;&nbsp;i++</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">sb.append</font><font color="#000000">(</font><font color="#000000">array</font><font color="#000000">[</font><font color="#000000">i</font><font color="#000000">]&nbsp;</font><font color="#000000">+&nbsp;</font><font color="#2a00ff">&#34;\n&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>return&nbsp;</b></font><font color="#000000">sb.toString</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;synchronized&nbsp;static&nbsp;</b></font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">getCallStackAsStringArray</font><font color="#000000">()&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">StackTraceElement</font><font color="#000000">[]&nbsp;</font><font color="#000000">stackTraceElements&nbsp;=&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">Thread.currentThread</font><font color="#000000">()</font><font color="#000000">.getStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">array&nbsp;=&nbsp;getCallStackAsStringArray</font><font color="#000000">(</font><font color="#000000">stackTraceElements</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>return&nbsp;</b></font><font color="#000000">array;</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>private&nbsp;synchronized&nbsp;static&nbsp;</b></font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">getCallStackAsStringArray</font><font color="#000000">(</font><font color="#000000">StackTraceElement</font><font color="#000000">[]&nbsp;</font><font color="#000000">stackTraceElements</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">ArrayList&lt;String&gt;&nbsp;list&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">ArrayList&lt;String&gt;</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">array&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">String</font><font color="#000000">[</font><font color="#990000">1</font><font color="#000000">]</font><font color="#000000">;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;stackTraceElements.length;&nbsp;i++</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">StackTraceElement&nbsp;element&nbsp;=&nbsp;stackTraceElements</font><font color="#000000">[</font><font color="#000000">i</font><font color="#000000">]</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String&nbsp;classname&nbsp;=&nbsp;element.getClassName</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String&nbsp;methodName&nbsp;=&nbsp;element.getMethodName</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">lineNumber&nbsp;=&nbsp;element.getLineNumber</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">list.add</font><font color="#000000">(</font><font color="#000000">classname&nbsp;+&nbsp;</font><font color="#2a00ff">&#34;.&#34;&nbsp;</font><font color="#000000">+&nbsp;methodName&nbsp;+&nbsp;</font><font color="#2a00ff">&#34;:&#34;&nbsp;</font><font color="#000000">+&nbsp;lineNumber</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>return&nbsp;</b></font><font color="#000000">list.toArray</font><font color="#000000">(</font><font color="#000000">array</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#000000">}</font></code>
   </td>
</tr>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://roncox.org/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

