<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7643289</id><updated>2011-08-24T08:50:30.105-06:00</updated><title type='text'>Rblog</title><subtitle type='html'>When I started this blog (2004) it was to document Gentoo linux experiences and *nix adventures. Then it turned into posts regarding software development challenges and other findings. These days I mostly tweet (rollinsruss) and my posts are infrequent.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default?start-index=101&amp;max-results=100'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>236</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7643289.post-2975776949223171655</id><published>2011-03-07T13:38:00.001-07:00</published><updated>2011-03-07T14:45:15.248-07:00</updated><title type='text'>...so the Kindle just works out better for me</title><content type='html'>I can't believe how long this post turned out to be. Yikes. If you don't care about what shaped my evaluation criteria, feel free to skip to the &lt;a href="#kindle_won"&gt;conclusion&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;It's true, I owned a Casio PDA&lt;/h4&gt;I recently decided to jump into the ebook market. I've been following it for quite some time but could never justify being an early adopter with the Sony line and figured I'd just wait it out. I have many fond memories of getting involved with project Gutenberg back in 2002 and discovering the immense library of public domain texts. At the time I read exclusively on a &lt;a href="http://en.wikipedia.org/wiki/Casio_Cassiopeia#Cassiopeia_E-125"&gt;Cassiopeia E-125&lt;/a&gt; but my commitment to ebooks waned as I upgraded devices and became far more involved in pursuing my degree.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Then iOS happened and Apple introduced their bookstore&lt;/h4&gt;I was initially quite interested in the concept of reading on my iPhone, again harkening back to the Casio days when I was traveling often for work and reading quite a bit. I bought a book, on a whim and out of other reading material, when coming back from a business trip in Oct 2010. I &lt;a href="http://www.goodreads.com/review/show/120656069"&gt;loved the book&lt;/a&gt; I read and I loved the convenience of my iPhone. But, quite frankly, it took it's toll physically on my eyes as well as making me wish swipe was never invented. My lasting impression was how much a hassle it was just to turn the pages, over and over and over. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Eink contenders aplenty, turns out I want an ecosystem too&lt;/h4&gt;For a long time I followed what Sony was doing and watched various other Chinese manufacturers make eink-based device announcements. However, I was never motivated to purchase because I realized (over several years of following) that &lt;b&gt;the hardware was only half the solution&lt;/b&gt; for my ideal setup. While I loved reading on the Casio, it wasn't particularly enjoyable loading my ebooks from &lt;a href="http://www.gutenberg.org/"&gt;Project Gutenberg&lt;/a&gt; and it got messy managing things when my library became large (not to mention the lack of availability of new publications). &lt;br /&gt;Bottom line, I finally think the market is in a mature-enough place (though far from ideal maturity IMO) that I didn't considered anything other than the &lt;a href="http://www.amazon.com/kindle"&gt;Kindle 3&lt;/a&gt; or the &lt;a href="http://www.barnesandnoble.com/nook/index.asp?PID=34323&amp;amp;cds2Pid=35700#logo"&gt;Nook&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Grading criteria&lt;/h4&gt;I've been patient, for a long time, and have been mentally recording a healthy list of criteria that I wanted to measure. Yes, there are dozens of reviews on both of these devices, but I frankly wasn't satisfied with &lt;a href="http://goo.gl/Ds5cX"&gt;what I'd read&lt;/a&gt; because I wanted a hands-on, personal, thorough evaluation for just my list of requirements. Thus, the following opinion/analysis really only satisfies what I care about and, of course, YMMV. What I wanted to evaluate, in no particular order:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Feel&lt;br /&gt;The Kindle is lighter than the Nook, but that didn't make it an immediate winner. I liked the extra weight on the Nook that made it feel more &lt;a href="http://goo.gl/UZqU1"&gt;handleable&lt;/a&gt; (is that a word?). However, with the extra weight, the Nook felt slightly more fragile and I noticed  I was more careful when carrying it while walking and reading or doing other activities rather than just staying put and reading. The Kindle, though lighter, also seemed more robust and resilient. &lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://goo.gl/sxxgM"&gt;Affordance&lt;/a&gt; and Input&lt;br /&gt;(in terms of how intuitive it was to use the device both visually and non-visually and also how intuitive the initial experience was)&lt;br /&gt;Kindle: The page turning buttons are slimmer than the Nook but (again, IMO) more well defined both physically and visually. The keyboard and 5-way button provide immediate input and tactile response. The overall experience of getting to know, and get comfortable, with the device was very natural to me. &lt;br /&gt;Nook: The Nook navigation buttons have little visual separation other than the large arrows, but physically the user can feel the difference due to a raised bump. On more than one occasion I inadvertently navigated in the wrong direction. After a while I got used to it and I like how much wider the buttons were than the Kindle, though with the additional width the user loses grip area. I did not like the LCD navigation, and maybe that's because I tested the Kindle first, but I found the navigation slow (in response to gestures), slightly confusing (scrolling options) and generally less appealing. Plus, the backlight is a strong contrast to the placid eink display for my eyes (yes, the backlight dims very quickly, but the combination just didn't work for me) &lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Instapaper support&lt;br /&gt;I like &lt;a href="http://www.instapaper.com/"&gt;Instapaper&lt;/a&gt; a lot. It saves me time. It removes content distractions. It lets me collect stuff that's not important to read immediately, but important enough that I want to read it when I'm ready (meaning, when I have more time). It's convenient (works in all browsers), works on multiple devices (iOS, Android, Blackberry) and is simple to use (one click). So, if I want to read my Instapaper content on the Kindle or Nook, what are my options? Just Kindle.&lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;/b&gt; &lt;br /&gt;&lt;/li&gt;&lt;li&gt;File archiving&lt;br /&gt;Both B&amp;amp;N and Amazon have areas where the user can download previously purchased content. There was, at one time, legitimate concern about Amazon &lt;a href="http://en.wikipedia.org/wiki/Kindle#Remote_content_removal"&gt;exercising the remote kill switch&lt;/a&gt; (as it did once), but under terms of the &lt;a href="http://goo.gl/uxOyn"&gt;suit settlement&lt;/a&gt; they agreed that it will not happen in the future. &lt;br /&gt;&lt;b&gt;Winner: Tie&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Notes and highlights (I like to annotate, not all the time, but frequently)&lt;br /&gt;Kindle: Notes can be multi-lined and added to all content. User moves cursor and starts typing.&lt;br /&gt;Nook: Notes are limited to a single line and not available for PDF content. User awakens LCD, selects menu option, selects another menu option, move cursor with d-pad, selects menu option, moves cursor, selects menu option, begins typing note.&lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;/b&gt; &lt;br /&gt;&lt;/li&gt;&lt;li&gt;API (since I like to play with code)&lt;br /&gt;Kindle: KDK available &lt;a href="https://kdk.amazon.com/"&gt;here&lt;/a&gt;&lt;br /&gt;Nook: No API or development kit available (though rumor has it the color version will soon be unlocked for full the full Android Marketplace)&lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Performance&lt;br /&gt;Performance was pretty good in terms of rendering and input responsiveness. The only times I noticed a difference was when comparing menu navigation, but since the menu approach was unique to each device, I'm not going to compare the menu performance in conjunction with general use. The eink refresh was fast enough to never annoy me and they both seemed nearly identical in that regard.&lt;br /&gt;&lt;b&gt;Winner: Tie&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Lending&lt;br /&gt;From what I understand lending is currently subject to publisher overview, so I didn't notice a unique advantage comparing one device to the other. Both vendors allow a single-use, 14-day lend on publisher-approved books. &lt;br /&gt;&lt;b&gt;Winner: Tie (user is equally hosed regardless of vendor, sigh)&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;PDF Support&lt;br /&gt;Turns out this feature became more important to me the more I thought about it. There are many times I have technical PDFs open on my desktop that I just don't get around to reading in a timely manner. After testing two of the latest (&lt;a href="http://www.blogger.com/net.educause.edu/ir/library/pdf/ERM0951.pdf"&gt;this&lt;/a&gt; and &lt;a href="http://invensense.com/mems/gyro/documents/whitepapers/InvenSense-MEMSMotionProcessing-ConsumerProducts-3DUIWhitepaper-031210.pdf"&gt;this&lt;/a&gt;), I was sold on being able to not only read these but also annotate them.&lt;br /&gt;Kindle: Multiple rendering options to adjust zoom and device orientation. Five contrast settings. Supports notes and highlights. Graphics properly rendered, layout preserved. Overall, very readable and usable.&lt;br /&gt;Nook: Supports three different text fonts and six text sizes. Mangled embedded graphics in my evaluation. Subject to layout mishandling and text injections (first PDF was very difficult to follow). No annotation support or additional rendering options. One time I got an error indicating I needed to force close the Activity Reader when I was navigating a PDF.&lt;br /&gt;&lt;b&gt;Winner: Kindle&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Extensability&lt;br /&gt;Kindle: No user extendable memory or replaceable battery&lt;br /&gt;Nook: User replaceable battery and microSD slot located underneath rear cover (thanks Cary A. and Jeff J. on this!)&lt;br /&gt;&lt;b&gt;Winner: Nook&lt;/b&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Battery life&lt;br /&gt;I wasn't sure how I was going to accurately measure this. Turns out I didn't have to worry about it. I've had both of these devices for several weeks now (time of this post) and have been using the Kindle quite a bit more than the Nook at this point. I charged both devices before my evaluation. At no time during the past several weeks have I charged either device and only minimal time in syncing via USB. Thus, after finishing my first &lt;a href="http://www.goodreads.com/book/show/68427.Elantris"&gt;book&lt;/a&gt; on the Kindle I was ready to read something of equivalent length on the Nook to test it out. Unfortunately, the battery was nearly depleted. And that was after being powered-off, nearly every day, for more than a week. I finished up the lengthy user manual and settled on a book to try, then powered down the device. I turned it on the following day to be greeted with the message that it needed to be charged (which it is doing at this time). Maybe I have a defective battery? The Kindle, under much heavier comparative use, appears to be at slightly less than 50%. Scientific approach? No, I wussed out, this is good enough for me.&lt;br /&gt;&lt;b&gt;Winnner: Kindle&lt;/b&gt; &lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;&lt;a name="kindle_won"&gt;&lt;br /&gt;Everything said and done&lt;/a&gt;&lt;/h4&gt;I enjoyed comparing both devices and I can clearly see advantages for both. If I had a family member that was a book-a-week reader, aware and on top of recent releases, visited the bookstore often and was happy with an eink device, I'd recommend the Nook. But, overall, I found for me that the Kindle was the superior choice for my needs. Quite frankly, Whispernet became a selling point for me (after I had already purchased the Kindle). I had no idea how convenient it'd be to simply email stuff away (for free) and have it arrive on my Kindle ready to go. That's turned out to be very convenient and was icing on the cake. There were sprinkles too, like the immediate dictionary, being able to tweet/share passages, openlibrary.org integration and line-spacing options...so the Kindle just works out better for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2975776949223171655?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2975776949223171655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2975776949223171655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2975776949223171655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2975776949223171655'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2011/03/so-kindle-just-works-out-better-for-me.html' title='...so the Kindle just works out better for me'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-5470297720898923476</id><published>2011-02-15T16:55:00.000-07:00</published><updated>2011-02-15T16:55:27.520-07:00</updated><title type='text'>Git, Gerrit, Redmine, gitflow: An ideal software development and release management setup</title><content type='html'>I've been using Subversion for more than 5 years and have been following Git's development, adoption and maturation during that entire time. At work, each time we would create a new repo for a project, I cringed at the thought and questioned, "but, we could be doing this in Git..." However, given the development environment as well as business context (not a software shop), it just wasn't suitable to immediately jump into Git. So what did it take to make the jump? Some rather significant dissonant (and concurrent) development tasks, branch management issues and several deploys that cost more time (and thus, money) than they could have.&lt;br /&gt;&lt;br /&gt;Our primary requirements for the SCM migration included the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;1. Central repo to act as an on-site, internally maintained, redundant source authority with replication capabilities&lt;/li&gt;&lt;li&gt;2. Integration into Redmine&lt;/li&gt;&lt;li&gt;3. A well defined methodology for maintaining several projects through multiple concurrent phases&lt;/li&gt;&lt;li&gt;4. Mature CLI toolset&lt;/li&gt;&lt;li&gt;5. Hudson/Jenkins support&lt;/li&gt;&lt;li&gt;6. IntelliJ integration&lt;/li&gt;&lt;li&gt;7. SCM should be open source with a vibrant community&lt;/li&gt;&lt;/ol&gt;I knew most of these requirements &lt;i&gt;could&lt;/i&gt; be met with Git, but didn't want to make a blind choice and simply choose Git as the new internal de-facto standard. I've had some simple experience with Mercurial in the past and even spent some time doing some projects in Darcs several years ago. I have a good friend whose company (software shop) moved to Mercurial and he offered their arguments in support of choosing Mercurial. Frankly, I liked a lot about what I saw in Mercurial and I didn't ever have any negative experience when toying around with it. Though, truth be told, the projects I conjured up for trying it out were very simplistic and never moved outside of my local development environment. During my investigation I found stackoverflow.com to be immensely helpful in identifying specific differences and perceived strengths and weaknesses.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Git&lt;/h2&gt;In the end, after all the reading, playing, comparing--I found that Git just jived with me and it satisfied our requirements (4,5,6,7). Darcs just didn't fit, and Mercurial looks great, so I have nothing negative against those projects. Plus, they don't have &lt;a href="http://code.google.com/p/gerrit/"&gt;Gerrit&lt;/a&gt;. Kudos to the &lt;a href="http://javaposse.com/"&gt;Java Posse&lt;/a&gt; for a recent podcast in which Gerrit was discussed, timing happened to be critical as it was in the middle of my research, and it sounded like just what we needed to address a recent issue of lack of code review. Even though I was already heavily leaning toward Git at this point, Gerrit clearly brought additional benefit to the migration and methodology changes we were considering.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Gerrit&lt;/h2&gt;Gerrit is wonderfully simple to get setup and running. I very much appreciate that it's quite self-contained and offers OpenID support to avoid the grief of maintaining local user accounts. In fact, Gerrit will not only help facilitate code review and branch maintenance, it can act as our centralized repo while abstracting OS-level duties (specifically, user management) for utilizing SSH as our transport protocol. Gerrit's  permissions model is more than adequate for our needs on a per-project basis, but is simple enough to setup and get going. Thus, Gerrit easily satisfied requirement #1 and gave us the extra bang-for-the-buck with its inherent review functionality.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Redmine&lt;/h2&gt;Redmine (1.0.1) was easy to modify for our situation and it made the most sense to &lt;a href="http://www.redmine.org/projects/redmine/wiki/RedmineRepositories#Setting-up-a-mirror-repository-shortcut-tracking-branches"&gt;replicate the central repo as a read-only repository locally available to the Redmine instance.&lt;/a&gt; Once the clone completed, the only remaining task was setting up a periodic cronjob for updating (git fetch --all) the repo.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;gitflow&lt;/h2&gt;&lt;a href="https://github.com/nvie/gitflow"&gt;gitflow&lt;/a&gt; was the answer to requirement #3. One of the beauties of Git (and DVCS in general) is the fundamental capability of determining your own release cycle/phase/management process. In some cases when dealing with a DVCS setup it means there's a lot of rope to hang yourself. Our previous release practice was suffering, from time to time, with 100% consistency. I stumbled on gitflow only after deciding on Gerrit, and it made a lot of sense to embrace it not only for what it provides out of the box (helpful bash scripts) but also for the &lt;a href="http://nvie.com/posts/a-successful-git-branching-model/"&gt;well defined development convention&lt;/a&gt; that it helps to enforce. Actually, it's not that gitflow just helps to enforce process, rather, it eases process implementation. Turns out that its process definition matches, and enhances, what we've already (mostly) been doing. &lt;a href="http://nvie.com/about/"&gt;Vincent&lt;/a&gt; deserves a heap of credit and has our gratitude.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;CI&lt;/h2&gt;Hudson/Jenkins (Oracle is being a hoser about this, IMO) has two plugins options:&lt;br /&gt;               Gerrit: http://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Plugin&lt;br /&gt;               Git: http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin&lt;br /&gt;&lt;br /&gt;Really like the idea of pushing changes to Gerrit fires off CI tasks in Jenkins, then verifies/fails the changeset depending on the results. However, integrating that plugin during the initial migration turned out to be a lower priority. At the very least we simply swapped out the current setup of using Subversion with just the normal Git plugin.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;IntelliJ&lt;/h2&gt;While I'm in a shell nearly 100% of the time, on occasion it's convenient to have some SCM &lt;a href="http://blogs.jetbrains.com/idea/tag/git/"&gt;support in Intellij 10&lt;/a&gt;.  However, I did run into some issues with merging in IntelliJ and spent some time looking into various merge tools. My emacs blood revolted when I chose the Perforce merge tool over emerge (which I liked a lot better than opendiff, Meld or diffmerge). Thanks to &lt;a href="http://www.andymcintosh.com/?p=33"&gt;Andy Mcintosh for his tips&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;After walking through multiple discussions with several team members, it's been very clear to them the benefits and strengths this setup provides over our current process with Subversion. So as of this post, the first major project (72k LOC) has been migrated. This setup feels right, and it's good to see additional corroboration in the community (thanks, &lt;a href="http://alblue.bandlem.com/2011/02/someday.html"&gt;AlBlue&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-5470297720898923476?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/5470297720898923476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=5470297720898923476' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5470297720898923476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5470297720898923476'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2011/02/git-gerrit-redmine-gitflow-ideal.html' title='Git, Gerrit, Redmine, gitflow: An ideal software development and release management setup'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-8958951956653999791</id><published>2009-12-22T15:12:00.001-07:00</published><updated>2009-12-22T15:13:54.155-07:00</updated><title type='text'>Mule JMS message routing using an external ActiveMQ instance</title><content type='html'>I have a scenario where I'd like Mule to monitor an incoming queue, filter the messages and route to appropriate outgoing queue--using a separate ActiveMQ instance instead of the optional embedded  one. While perusing Google results I didn't find a source that&amp;nbsp;explicitly&amp;nbsp;showed how to accomplish this. So using what information I did find from indirect examples and other documentation, this is what I came up with.&lt;br /&gt;First, the connection factory Spring bean:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;spring:bean name="activeMQConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&amp;gt;  &lt;br /&gt;   &amp;lt;spring:property name="brokerURL" value="tcp://${esb.jms.endpoint}"/&amp;gt;  &lt;br /&gt;  &amp;lt;/spring:bean&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Since I have Maven filtering my resources, the actual tcp URI will be replaced with the appropriate environmental property--in my case, being in an active development environment, and using activeMQ 5.3.0, the filtered value would be "tcp://localhost:61616".&lt;br /&gt;&lt;br /&gt;Next is the connector definition:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt;  &amp;lt;jms:connector name="JMSConnector"  &lt;br /&gt;          specification="1.1"  &lt;br /&gt;          persistentDelivery="true"  &lt;br /&gt;          connectionFactory-ref="activeMQConnectionFactory" &amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;And finally, the endpoint:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;jms:endpoint name="asynchIn" queue="asynch.in"/&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The service definition for this simple case is:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;service name="Asynchronous processing"&amp;gt;  &lt;br /&gt;    &amp;lt;inbound&amp;gt;  &lt;br /&gt;     &amp;lt;inbound-endpoint ref="asynchIn" synchronous="false"/&amp;gt;  &lt;br /&gt;     &amp;lt;wire-tap-router&amp;gt;  &lt;br /&gt;      &amp;lt;stdio:outbound-endpoint system="OUT" name="debugTrace" connector-ref="SysOut"/&amp;gt;  &lt;br /&gt;     &amp;lt;/wire-tap-router&amp;gt;  &lt;br /&gt;    &amp;lt;/inbound&amp;gt;  &lt;br /&gt;    &amp;lt;outbound&amp;gt;  &lt;br /&gt;     &amp;lt;filtering-router&amp;gt;  &lt;br /&gt;      &amp;lt;jms:outbound-endpoint queue="test.out" /&amp;gt;  &lt;br /&gt;      &amp;lt;message-property-filter pattern="JMSType=test"/&amp;gt;  &lt;br /&gt;     &amp;lt;/filtering-router&amp;gt;  &lt;br /&gt;     &amp;lt;filtering-router&amp;gt;  &lt;br /&gt;      &amp;lt;jms:outbound-endpoint queue="test2.out" /&amp;gt;  &lt;br /&gt;      &amp;lt;message-property-filter pattern="JMSType=test2"/&amp;gt;  &lt;br /&gt;     &amp;lt;/filtering-router&amp;gt;  &lt;br /&gt;    &amp;lt;/outbound&amp;gt;  &lt;br /&gt;   &amp;lt;/service&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Notice that the inbound definition contains a wire-tap-router reference, this makes it much easier (IMO) to trace the message flow during development while defining the routing rules and generally tweaking things. Mule will send the message to sysout and also apply filter routing. &lt;br /&gt;&lt;br /&gt;The filters generally speak for themselves, in the cases above the filters are based on the type of message.&lt;br /&gt;&lt;br /&gt;To test the setup with a vanilla ActiveMQ install (stomp enabled and the stomp gem installed), this quick Ruby script works quite handily:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; require 'stomp'  &lt;br /&gt;  Stomp::Client.open("stomp://localhost:61612").send("/queue/asynch.in","\n\n\n!!!!!!!!!!!!!!\ntest message\n!!!!!!!!!!!!!!!",{:persistent =&amp;gt; true, :type =&amp;gt; 'test'})  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Mule's wire-tap-router should dump the message:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; system out:ActiveMQBytesMessage {commandId = 3, responseRequired = false, messageId = ID:vsbeta-45609-1261505977249-4:104:-1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:vsbeta-45609-1261505977249-4:104:-1:1, destination = queue://asynch.in, transactionId = null, expiration = 0, timestamp = 1261518816945, arrival = 0, brokerInTime = 1261518816946, brokerOutTime = 1261518816946, correlationId = null, replyTo = null, persistent = true, type = test, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@7c66f0, marshalledProperties = org.apache.activemq.util.ByteSequence@4a4890, dataStructure = null, redeliveryCounter = 0, size = 0, properties = {content-type=text/plain; charset=UTF-8}, readOnlyProperties = true, readOnlyBody = true, droppable = false} ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = null }INFO 2009-12-22 14:53:37,033 [JMSConnector.dispatcher.1] org.mule.transport.jms.JmsMessageDispatcher: Connected: endpoint.outbound.jms://test.out  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;ActiveMQ's admin screen should show pending messages inside of the test.out or test2.out queues. Messages could be consumed via Stomp:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; require 'stomp'  &lt;br /&gt; client = Stomp::Client.open("stomp://localhost:61612")  &lt;br /&gt; client.subscribe("/queue/test.out"){|message| puts "consuming #{message.body} with properties #{message.headers.inspect}"}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;producing output:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; consuming   &lt;br /&gt; !!!!!!!!!!!!!!  &lt;br /&gt; test message  &lt;br /&gt; !!!!!!!!!!!!!!! with properties {"MULE_ORIGINATING_ENDPOINT"=&amp;gt;"asynchIn", "content_type"=&amp;gt;"text/plain; charset=UTF-8", "MULE_CORRELATION_ID"=&amp;gt;"0f2295b0-ef45-11de-856a-538c667e24a7", "expires"=&amp;gt;"0", "timestamp"=&amp;gt;"1261519075346", "destination"=&amp;gt;"/queue/test.out", "message-id"=&amp;gt;"ID:Rohirrim.local-51739-1261518810672-0:0:7:1:1", "priority"=&amp;gt;"4", "MULE_SESSION"=&amp;gt;"SUQ9MGYyMjk1YjEtZWY0NS0xMWRlLTg1NmEtNTM4YzY2N2UyNGE3", "content-length"=&amp;gt;"46", "MULE_MESSAGE_ID"=&amp;gt;"ID:vsbeta-4  &lt;br /&gt; 5609-1261505977249-4:117:-1:1:1", "correlation-id"=&amp;gt;"0f2295b0-ef45-11de-856a-538c667e24a7", "MULE_ENCODING"=&amp;gt;"UTF-8", "MULE_ENDPOINT"=&amp;gt;"jms://test.out"}=&amp;gt; nil  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This approach enables a single queue to collect asynchronous message requests and leverage Mule's filtering-routers to decouple the producer and consumer. The requests go on the ESB, Mule defines where they should go, and the service components act and process the request independent of the requester.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-8958951956653999791?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/8958951956653999791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=8958951956653999791' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8958951956653999791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8958951956653999791'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2009/12/mule-jms-message-routing-using-external.html' title='Mule JMS message routing using an external ActiveMQ instance'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-3430718001553236273</id><published>2009-12-10T18:34:00.002-07:00</published><updated>2009-12-10T18:41:26.066-07:00</updated><title type='text'>We chose Mule for our ESB</title><content type='html'>After careful consideration of multiple open-source ESB products, &lt;a href="http://mulesoft.org/"&gt;Mule&lt;/a&gt; made the most sense for implementation into our data information infrastructure.  The other major competing providers were OpenESB(GlassFish v3), FUSE (Apache stack) as having an open-source solution was a very strict requirement. Mule is very component oriented and can be quickly setup for integration with existing services (of which we have several). Furthermore, it is Spring-based and supports Maven -- which fits right into our existing application development&lt;br /&gt;methodology.&lt;br /&gt;&lt;br /&gt;Mule has many strong points, the most relevant for our decision being:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;very mature, years of development and major deliveries&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a solid installation base across many significant enterprises&lt;/li&gt;&lt;br /&gt;&lt;li&gt; well-documented with excellent examples and diagrams&lt;/li&gt;&lt;br /&gt;&lt;li&gt; is open-source (CPAL 1.0)&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a commercial support model with additional tools (service registry,monitoring)&lt;/li&gt;&lt;br /&gt;&lt;li&gt; flexible configuration and instantiation options&lt;/li&gt;&lt;br /&gt;&lt;li&gt; wide-array of built-in and downloadable modules&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a top-choice in &lt;a href="http://tinyurl.com/yhfvq2w"&gt;DTS of Utah ESB comparison&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; excellent testing framework&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I read a lot on OpenESB, watched presentations and then checked out tutorials.  Simply put, OpenESB appears quite overkill for our specific needs. Furthermore, I'm not a fan of vendor lock-in and OpenESB appears to be very heavily biased towards NetBeans (which isn't really a surprise).&lt;br /&gt;&lt;br /&gt;As for the Apache side of things, I spent a fair amount of time reading comparisons on ServiceMix and Mule. The favor was typically weighted on Mule's behalf and the one major viable commercial support option for ServiceMix was through&lt;br /&gt;Fuse. Fuse appears to have some good documentation, but it wasn't nearly as in-depth as Mule. Also, going this route appeared to require more "gluing" using Camel and ServiceMix is also more specifically oriented to JBI--a shared trait among both OpenESB and ServiceMix.&lt;br /&gt;&lt;br /&gt;Mule made it very easy to get up and running quickly. Within minutes I had implemented a REST service component using an existing endpoint. After some time reading more documentation I recognized a good case for using the template URI pattern and exposed another two REST endpoints in a separate service. Finally, with a Maven archetype, it was very easy to generate a Mule project and tweak it to support multiple environment deployments (dev,test,beta,prod, etc). I created a  simple bootloader to start up the Mule context and register a shutdown hook with the JVM. This approach leverages Maven's capabilities in property filtering and distribution assembly. Thus, we can now create standalone distributions with full Maven dependency support (avoiding the hassle of updating MULE_HOME/lib/user), integrated testing, custom property filtering, and artifact assembly for multi-enviroment support.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-3430718001553236273?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/3430718001553236273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=3430718001553236273' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3430718001553236273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3430718001553236273'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2009/12/we-chose-mule-for-our-esb.html' title='We chose Mule for our ESB'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-4095070143571659591</id><published>2009-03-13T15:33:00.001-06:00</published><updated>2009-03-13T15:36:14.555-06:00</updated><title type='text'>calling dynamic domain finders in Grails</title><content type='html'>Had the need today for calling a Grails domain class finder method outside of the normal artifact setup. There's a singleton I wanted to write to cache certain hunks of data from the database. It'd be very convenient to have access to those domain classes to save me the pain of writing boilerplate Hibernate config and EJB classes. So, here's what ended up working.&lt;br /&gt;&lt;br /&gt;I injected a GrailsApplication reference into my bean and created a closure that I passed to a new &lt;a href="http://groovy.codehaus.org/groovy-jdk/java/util/Timer.html"&gt;Groovy Timer&lt;/a&gt; instance. Inside the closure I'm able to invoke the dynamic finders on the domain classes because I can fetch a new instance this way:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def person_class = grailsApplication.getArtefact("Domain","Person")&lt;br /&gt;def person_instance = person_class.newInstance()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's simple enough, to actually call the finders (in this case "list") the next step was:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def results = person_class.metaClass.invokeStaticMethod(person_instance,'list',null)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next plans are to create a generic way of exposing the ability to call the dynamic methods so that any Groovy class in the app has has access to them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-4095070143571659591?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/4095070143571659591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=4095070143571659591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/4095070143571659591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/4095070143571659591'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2009/03/calling-dynamic-domain-finders-in.html' title='calling dynamic domain finders in Grails'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6369815098873225590</id><published>2009-03-12T13:43:00.001-06:00</published><updated>2009-03-12T13:47:04.742-06:00</updated><title type='text'>Maven, Grails and Metro -- it works</title><content type='html'>I was really stoked about the maven-grails plugin when I had some time to start playing with Grails 1.1-SNAPSHOT last week. In fact, Grails has matured quite a bit since I first looked at it a little more than a year go. Almost two years ago I wrote about an integration of NetSuite's WebServices with Ruby's SOAP4r. We've been using this integration for nearly two years and have found ways to improve our original approach. In fact, usage has significantly increased, so much so that scalability is now becoming a concern. Don't get me wrong, SOAP4r has never actually croaked on us. But it makes sense to de-couple this element from the application and make a full-fledged service layer for additional in-house integrations. It's time to port the code to Java.&lt;br /&gt;&lt;br /&gt;So, back to Grails and Maven. With over five years of Maven experiences I'm completely sold on its many benefits. I've been watching Grails and hoping that the two would integrate to a point where it's completely usable to manage a Grails project in Maven. That day is here, and it's solid. I created a prototype (love how fast it was) with Axis using Grails 1.1-SNAPSHOT. I was sold. Then, just two days ago, Grails 1.1 was finalized and became GA. Funny thing, as soon as I upgraded my project I could no longer use my prototype because I would receive the dreaded:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That really made me sad, my prototype was hosed. I didn't want to start sleuthing the class dependency collision. &lt;a href="http://swamp.homelinux.net/blog/"&gt;Mike Heath&lt;/a&gt; suggested I check out Apache CXF and Sun's Metro, both of which appear to be more "cleanly" designed than Axis. I spent a while trying to get CXF to work, but apparently it has a bunch of jars that need to be excluded since it hosed grails:run-app (No such property: readable for class: org.springframework.core.io.Class).&lt;br /&gt;&lt;br /&gt;Finally, I had some success with Metro in Maven and Grails. I regenerated the NetSuite classes via wsimport, and only had to add jaxws-rt and  jaxws-tools to my dependencies (this was helpful, &lt;a href="https://metro.dev.java.net/guide/Using_JAX_WS_from_Maven.html"&gt;https://metro.dev.java.net/guide/Using_JAX_WS_from_Maven.html&lt;/a&gt;). For now, I'm up and running and looking forward to more Grails development.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6369815098873225590?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6369815098873225590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6369815098873225590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6369815098873225590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6369815098873225590'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2009/03/maven-grails-and-metro-it-works.html' title='Maven, Grails and Metro -- it works'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6956651428326220662</id><published>2008-11-20T10:14:00.004-07:00</published><updated>2008-11-20T10:26:35.571-07:00</updated><title type='text'>RESTlet with Portlet in Liferay</title><content type='html'>Liferay allows authentication plugins in order to flexibly accommodate implementations that need more than what comes out-of-the-box. Incidentally, a portlet we have been working on has some rules governing its render state. There are situations where it shouldn't be rendered due to a blacklisting strategy in our requirements. Unfortunately, Liferay's permissions are strictly based on whitelists.&lt;br /&gt;&lt;br /&gt;So, how to not render the portlet for a group of people and do render it for others using a whitelist? Logic for who should see it is purely internal to the portlet and it made sense (in simplicity and respecting separation of concerns) to expose a RESTlet for consumption of our authentication module. The authentication module in turn puts people in the proper groups for various community and portlet access. Setup was &lt;a href="http://temporary.name/java/index.php/spring/restlet-spring-integration"&gt;incredibly simple&lt;/a&gt; and it didn't take much more effort to enable JPA transaction support with this class:&lt;br /&gt;&lt;small&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Enables JPA transactional support for subclassed Restlets.&lt;br /&gt;*/&lt;br /&gt;public abstract class AbstractJpaRestlet extends Restlet {&lt;br /&gt; private static final Logger logger = Logger.getLogger(AbstractJpaRestlet.class);&lt;br /&gt;&lt;br /&gt;@Autowired&lt;br /&gt; private EntityManagerFactory emf;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Handler for Restlet requests and responses. Implementing this method&lt;br /&gt;  * will ensure db connectivity and transactions support with the DAOs&lt;br /&gt;  *&lt;br /&gt;  * @param req  incoming Request&lt;br /&gt;  * @param resp outgoing Response&lt;br /&gt;  */&lt;br /&gt; public abstract void doHandle(Request req, Response resp);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public void handle(Request request, Response response) {&lt;br /&gt;   EntityManager em = emf.createEntityManager();&lt;br /&gt;   TransactionSynchronizationManager.bindResource(emf, new EntityManagerHolder(em));&lt;br /&gt;&lt;br /&gt;   try {&lt;br /&gt;&lt;br /&gt;     doHandle(request, response);&lt;br /&gt;   } catch (Throwable t) {&lt;br /&gt;&lt;br /&gt;     logger.error(this, t);&lt;br /&gt;     TransactionSynchronizationManager.unbindResource(emf);&lt;br /&gt;&lt;br /&gt;     throw new RestletException(t.getMessage());&lt;br /&gt;   }&lt;br /&gt;   finally{&lt;br /&gt;     TransactionSynchronizationManager.unbindResource(emf);&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/small&gt;This is my first RESTlet and I'd be interested in any feedback or pointers in this approach. I'm quite happy with how fast it was to code up. There's only one implementation of this class at this point, but the pattern is very simple and allows for quick future expansion as we need to expose more data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6956651428326220662?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6956651428326220662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6956651428326220662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6956651428326220662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6956651428326220662'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2008/11/restlet-with-portlet-in-liferay.html' title='RESTlet with Portlet in Liferay'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-7060740360510193759</id><published>2008-11-19T14:51:00.003-07:00</published><updated>2008-11-19T14:59:39.540-07:00</updated><title type='text'>Revisited: Spring InvervalJobs and scheduling in Liferay 5</title><content type='html'>Update to a better way to go about Spring scheduling: I tried simply defining a destroy method on the scheduler bean instead of relying on the extended ContextLoaderListener. This never appeared to be invoked and subsequently didn't unschedule the jobs. This is quite problematic in the long-run. Not good to have duplicate jobs running at the same time, it's sloppy and bad things could happen. So simply having the destroy method was insufficient.&lt;br /&gt;&lt;br /&gt;Instead of extending Liferay's JobScheduler (as I suggested in the previous post), it made more sense to create a singleton POJO that then invokes com.liferay.portal.kernel.job.JobSchedulerUtil.getJobScheduler().schedule(). That way the dependency is relying on Liferay's Quartz integration altogether (not thinking any of this would ever live outside of Liferay, but in the event that it does should be able to propagate that dependency with minor adjustments). Everything said and done (and tested), this is the scheduler:&lt;br /&gt;&lt;small&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class JobScheduler   {&lt;br /&gt;  private static Log _log = LogFactory.getLog(JobScheduler.class);&lt;br /&gt;  public Set&lt;IntervalJob&gt; jobs = new HashSet&lt;IntervalJob&gt;();&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Set all of the scheduled jobs.&lt;br /&gt;   *&lt;br /&gt;   * @param jobs Set of jobs to schedule.&lt;br /&gt;   */&lt;br /&gt;  public void setJobs(Set&lt;IntervalJob&gt; jobs) {&lt;br /&gt;    this.jobs = jobs;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void init(){&lt;br /&gt;    com.liferay.portal.kernel.job.JobScheduler scheduler = JobSchedulerUtil.getJobScheduler();&lt;br /&gt;&lt;br /&gt;    for(IntervalJob job : jobs){&lt;br /&gt;      try {&lt;br /&gt;        _log.info("Initializating " + job);&lt;br /&gt;        scheduler.schedule(job);&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e) {&lt;br /&gt;        _log.error("Initialization error instantiating " +job);&lt;br /&gt;        _log.error(e);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void destroy()  {&lt;br /&gt;       com.liferay.portal.kernel.job.JobScheduler scheduler = JobSchedulerUtil.getJobScheduler();&lt;br /&gt;&lt;br /&gt;    for(IntervalJob job : jobs){&lt;br /&gt;      try {&lt;br /&gt;        _log.info("Unscheduling " + job);&lt;br /&gt;        scheduler.unschedule(job);&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e) {&lt;br /&gt;        _log.error("Unscheduling error with" +job);&lt;br /&gt;        _log.error(e);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/small&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-7060740360510193759?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/7060740360510193759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=7060740360510193759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7060740360510193759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7060740360510193759'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2008/11/revisited-spring-invervaljobs-and.html' title='Revisited: Spring InvervalJobs and scheduling in Liferay 5'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-3194839602335604315</id><published>2008-11-19T14:09:00.002-07:00</published><updated>2008-11-19T14:15:46.678-07:00</updated><title type='text'>Spring InvervalJobs and scheduling in Liferay 5</title><content type='html'>If you have a Liferay portlet that requires some scheduling you can easily use Liferay's built-in Scheduler to add an IntervalJob to the job list, &lt;a href="http://portaldevelopment.wordpress.com/2008/05/08/how-to-create-scheduler-in-portlet/"&gt;like this&lt;/a&gt;. However, what if your IntervalJob is a Spring bean and has dependencies on other Spring beans in the portlet? Unfortunately, at the time of this writing (Liferay 5.1.2), the hot deploy code invokes the Scheduler configuration and execution before the context is initialized--which means you're up a creek when Spring is setup to be initialized with the context (happens to be my case).&lt;br /&gt;&lt;br /&gt;An alternative approach is to extend com.liferay.portal.job.JobSchedulerImpl with a Spring singleton and configure the jobs via Spring. While this is very flexible, the singleton is now operating outside the Liferay Quartz realm and therefore will not be subject to the lifecycle of the portlet. That is to say, when you redeploy the portlet the jobs stay scheduled. A more annoying aspect to this is that if you try to shutdown Liferay it appears to hang. Sure the log says that Coyote is stopped, but that's not the case and the process appears to be waiting on a thread. This in turn requires manually killing every time. During development this is such a pain. My guess, without significant research into the bowels of the Liferay Quartz integration, is that the Spring singleton hasn't been properly disposed of.&lt;br /&gt;&lt;br /&gt;One solution to this situation is to extend org.springframework.web.context.ContextLoaderListener with something like this:&lt;br /&gt;&lt;small&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class SpringSchedulerContextLoaderListener extends org.springframework.web.context.ContextLoaderListener{&lt;br /&gt;  private static final Logger logger = Logger.getLogger(SpringSchedulerContextLoaderListener.class);&lt;br /&gt;  public void contextInitialized(ServletContextEvent event) {&lt;br /&gt;    super.contextInitialized(event);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void contextDestroyed(ServletContextEvent event) {&lt;br /&gt;&lt;br /&gt;    JobScheduler j = (JobScheduler) StaticApplicationContextHolder.getApplicationContext().getBean("jobScheduler");&lt;br /&gt;    j.shutdown();&lt;br /&gt;   &lt;br /&gt;    super.contextDestroyed(event);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;This will ensure that the Spring singleton JobScheduler will unschedule the registered IntervalJobs when the context is destroyed. You're good to go once this entry replaces org.springframework.web.context.ContextLoaderListener in web.xml. &lt;br /&gt;&lt;br /&gt;There may be a more efficient way to do this, but for now this works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-3194839602335604315?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/3194839602335604315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=3194839602335604315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3194839602335604315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3194839602335604315'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2008/11/spring-invervaljobs-and-scheduling-in.html' title='Spring InvervalJobs and scheduling in Liferay 5'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-609921404793082065</id><published>2008-03-31T10:32:00.004-06:00</published><updated>2008-03-31T10:58:55.363-06:00</updated><title type='text'>Alfresco content management with Liferay</title><content type='html'>At work we've been pondering a better long-term solution to our content management. A year ago we gave some thought to Liferay and in fact deployed it for one of our sites. Recently we've reconsidered our approach due to some new additional requirements  accompanied with a more thoughtful perspective on leveraging internal content management with future web projects. We spent last week looking at JSR-170 alternatives/companions to Liferay, which with all due respect, only provides the implementation in their Document Library. We wanted something all-encompassing, that is, a repository where we could manage both web, print and other electronic content. Alfresco seemed to be the best option for us. After all of us spending a week with it and having various meetings trying to define the roles of stakeholders and functionality requirements, this was my conclusive perspective with enumerated priorities:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; Versioning&lt;br /&gt;This is easily satisfied with Alfresco and I was specifically impressed with the various ways to update content. I'm particularly pleased with the multiple capabilities of creating/updating content given the built-in CIFS server, FTP server, Office plug-ins and web interface. This wide array of interfaces should enable our users to begin versioning content with a limited learning curve (especially in terms of the shared drive notion). The WebProject versioning feature is very worthwhile in that it provides us with the ability to view/rollback content at any given time for each release, very helpful for auditing and liability. Lastly, their implementation of sandboxing is especially beneficial in concurrent development as each user can submit their work to workflow after sufficient authoring and testing.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Document Management&lt;br /&gt;Alfresco was written primarily to manage documents, and given the aforementioned information on versioning, I think it's very capable for our needs.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Integration&lt;br /&gt;I'm very pleased and excited about the ease of creating REST endpoints using Alfresco's WebScript framework. We won't have to write any extra functionality (read: additional JARs) to work with existing APIs but can rely on implementing custom WebScripts for exposing what we want, how we want. This is particularly useful for rapid development for any of our potential integration points, this is specificall a boon for both integration with our Rails CRM and the custom Liferay content portlet Jeff Wilson is writing.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Workflow&lt;br /&gt;I think creating workflows specific to our needs will require the most work. Granted, the WCM component ships with a very basic approval workflow, we'll still need to create custom workflows once we decide how to hone our processes (and choose our deployment strategies). Depending on our needs, we may only need to define the rules in XML and forgo additional code (I believe our definitions will need to precede the investigation of additional functionality).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; User Experience&lt;br /&gt;Again, referencing the Versioning info above, I think this is covered. It'd be very helpful for the users to see that state/phase of workflow that a given item is in, but that appears to be a current enhancement request (per Jared).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Additional Benefits&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Search: all meta-data (including custom aspects) is indexed, with incredible ease users will be able to find content much faster than perusing through shared drives trying to remember the location of specific files.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; Task dashboard: users are able to see what tasks they have awaiting their action (be it approval, updates, reviews, etc.)&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; SSO options are plentiful for integrating with our ActiveDirectory: LDAP, NTLM, Kerberos&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; Simplified replication: there's already a pre-configured XML doc for repository replication&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt; Space Rules: Alfresco has a great rule-engine for manipulating content based on a set of Space rules. For example, specific meta-data (via custom aspects) can be applied to certain content as defined in the rules. Space rules have an inheritance model&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Roles are configured per Space (and thus also subject to inheritance) enabling a very flexible detailed system of privileges. Roles can be applied to users or groups of users, per Space.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Content transformations: Alfresco integrates with OpenOffice to provide instant content transformations(text to PDF, PowerPoint to Flash) and can be extended to provide custom transformations.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Send content to Alfresco via email: The next release of Alfresco will include the ability to add content to Alfresco via email attachment. This could be a very efficient way for sales people to put quotes,proposals,contracts, etc straight into Alfresco without leaving their email client.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Space Templates: we can setup a space and template it to create future spaces based on that template, thereby ensuring default layouts and content are appropriately propagated.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Alfresco deployable run-time enables us to deploy the repository to our environments w/o the overhead and deployment of the web client (a clear separation of concerns strategy that also avoids potential content tampering).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Stability and product maturation: Alfresco is clearly a player in the marketplace with 400+ enterprise clients and 20k deployed instances.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Speed: &lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=43282"&gt;Alfresco and RedHat created a JSR-170 benchmark&lt;/a&gt; with Optaros validating its results in a 10 million doc test exercising repository corruption avoidance and high-concurrency usage, 0.4s response time. &lt;a href="http://www.alfresco.com/media/releases/2008/01/unisys-benchmark/"&gt;Updated results&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Search: all meta-data (including custom aspects) is indexed, with incredible ease users will be able to find content much faster than perusing through shared drives trying to remember the location of specific files.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;I clearly believe that the Alfresco solution, coupled with our Liferay content-rendering portlet, is the best approach we could pursue in managing long-term corporate content. It enables all of our departments and users to create and manage content, whether print or web-related, in a variety of very intuitive and thoughtful interfaces. Furthermore, it satisfies multiple IT goals in terms of application integration, data replication, content authorization and workflow/process definition. To that end, and knowing more functional valued enhancements will be soon released, I strongly recommend it.&lt;br /&gt;&lt;br /&gt;Been a pleasure to muck with it, looking forward to future implementation (which I hope is approved).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-609921404793082065?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/609921404793082065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=609921404793082065' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/609921404793082065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/609921404793082065'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2008/03/alfresco-content-management-with.html' title='Alfresco content management with Liferay'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-9126819789195053664</id><published>2008-03-20T08:12:00.002-06:00</published><updated>2008-03-20T08:16:11.051-06:00</updated><title type='text'>Great look at virtualization</title><content type='html'>&lt;a href="http://www.anandtech.com/IT/showdoc.aspx?i=3263&amp;amp;p=1"&gt;Virtualization: Nuts and Bolts &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What I appreciated most about this article was the lack of fluff found in most of the VMWare or XEN docs comparing X or Y and why they're better than the other guy. Johan does a great job of providing a bit of history and background in virtualization (specifically binary translation then paravirtualization) and then explores the Intel VT-x and AMD SVM roles at the hardware level. He discusses memory and I/O challenges that can still be hindrances. It's a long article so if you're not interested in all the gory details, at least check out page 12 for a good look at benchmarking (and what's NOT being benchmarked) and page 13 for a well-summarized conclusion.&lt;br /&gt;&lt;br /&gt;Coming away from reading this leaves me anxious for the next article and future enhancements at the hardware level. I'd like to find more articles similar to this one for more information and academic research. Appears there are still great strides to be made to hone efficiency. Fun stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-9126819789195053664?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/9126819789195053664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=9126819789195053664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/9126819789195053664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/9126819789195053664'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2008/03/great-look-at-virtualization.html' title='Great look at virtualization'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6131615896833551745</id><published>2007-12-18T16:12:00.000-07:00</published><updated>2007-12-18T16:21:27.420-07:00</updated><title type='text'>JNI library testing on OSX 10.5</title><content type='html'>Refactoring a bunch of the JNI H-ITT code that I was working on last month caused me grief when I was nailed with the presence of UnsatisfiedLinkError during my maven build. My Mac prototype code was very simplistic and I had all the libraries (and Java test driver) in the same directory and it worked flawlessly. Sheesh, LD_LIBRARY_PATH in OSX 10.5 is not the right env variable, should be DYLD_LIBRARY_PATH. Once that was added to my pom I was good to go, tests passed as expected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6131615896833551745?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6131615896833551745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6131615896833551745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6131615896833551745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6131615896833551745'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/12/jni-library-testing-on-osx-105.html' title='JNI library testing on OSX 10.5'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-7896651250045667188</id><published>2007-12-13T21:52:00.000-07:00</published><updated>2007-12-13T21:59:40.879-07:00</updated><title type='text'>Madison Summit Oxfords, second pair</title><content type='html'>&lt;a href="http://rcrblog.blogspot.com/2004/12/walmart-earth-shoegarbage-footwear.html"&gt;Three years ago I wrote about a horrible experience with junk shoes from Wal-Mart &lt;/a&gt;. Tonight I bought my second pair of Timberland Madison Summit Oxfords. I love these shoes and forwarded my thoughts to Timberland:&lt;br /&gt;&lt;br /&gt;To Whom it May Concern,&lt;br /&gt;&lt;br /&gt;I just wanted to write a quick note and thank you for such fantastic shoes. Two years ago I was looking for a new pair of shoes that I could use for work (business-casual), for school (walking around college campus), for home (playing sports with my kids, shoveling the walk, and wearing around the house) and for anything else. I was talking with a fellow in my church congregation and he suggested Timberland. I headed over to a local sporting good store and the sales guy immediately showed me your Madison Summit Oxford. &lt;br /&gt;&lt;br /&gt;I purchased that pair of shoes 23.5 months ago and they has served me very, very well. I have worn them exclusively, for every activity. The best part about this shoe was how well it "restored" when I regularly applied my leather-weather cream. &lt;br /&gt;&lt;br /&gt;Tonight I purchased my new pair, the exact same size and model for $30 cheaper than two years ago. I commend you on a fine product and its outstanding endurance. I appreciate your company's values and commitment to the environment. I hope this next pair will last me another two years and that I can continue on with my Madison Summit Oxford addiction in the foreseeable future (2010, 2012, 2014...).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-7896651250045667188?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/7896651250045667188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=7896651250045667188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7896651250045667188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7896651250045667188'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/12/madison-summit-oxfords-second-pair.html' title='Madison Summit Oxfords, second pair'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-7892063516261018118</id><published>2007-12-12T15:00:00.001-07:00</published><updated>2007-12-12T15:10:23.173-07:00</updated><title type='text'>TextMate: Subversion Annotate command</title><content type='html'>I really like vc-annotate in emacs. Considering the other very easy command I created earlier, thought I'd give this one a shot too (since it's not in the default Subversion bundle). Again, extremely simple and minutes to complete. Here's the command (edited from the Info command):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require_cmd "${TM_SVN:=svn}" &lt;br /&gt;: ${TM_RUBY:=ruby}&lt;br /&gt;FORMAT_INFO="${TM_BUNDLE_SUPPORT}/format_annotate.rb"&lt;br /&gt;&lt;br /&gt;"$TM_SVN" annotate "$TM_FILEPATH" |"$TM_RUBY" -- "$FORMAT_INFO" &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here's the Ruby formatter:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require ENV['TM_BUNDLE_SUPPORT']+'/svn_helper.rb'&lt;br /&gt;include SVNHelper&lt;br /&gt;&lt;br /&gt;puts html_head(:window_title =&gt; "Info", :page_title =&gt; "SVN Annotation", :sub_title =&gt; 'Subversion')&lt;br /&gt;puts '&amp;lt;div class="subversion"&amp;gt;'&lt;br /&gt;STDOUT.flush&lt;br /&gt;@colors = ['BlanchedAlmond',&lt;br /&gt;'BlueViolet',&lt;br /&gt;'Brown',&lt;br /&gt;'BurlyWood',&lt;br /&gt;'CadetBlue',&lt;br /&gt;'Chartreuse',&lt;br /&gt;'Chocolate',&lt;br /&gt;'Coral',&lt;br /&gt;'CornflowerBlue',&lt;br /&gt;'Crimson',&lt;br /&gt;'Cyan',&lt;br /&gt;'DarkBlue',&lt;br /&gt;'DarkCyan',&lt;br /&gt;'DarkGoldenRod',&lt;br /&gt;'DarkGray',&lt;br /&gt;'DarkGreen',&lt;br /&gt;'DarkKhaki',&lt;br /&gt;'DarkMagenta',&lt;br /&gt;'DarkOliveGreen',&lt;br /&gt;'Darkorange',&lt;br /&gt;'DarkOrchid',&lt;br /&gt;'DarkRed',&lt;br /&gt;'DarkSalmon',&lt;br /&gt;'DarkSeaGreen'] #see http://www.w3schools.com/html/html_colornames.asp for more pretty colors &lt;br /&gt;&lt;br /&gt;@color_hash = Hash.new&lt;br /&gt;@color_ind_size = @colors.size() -1&lt;br /&gt;&lt;br /&gt;def color_for_rev(rev)&lt;br /&gt;  color = @color_hash[rev]&lt;br /&gt;  &lt;br /&gt;  unless (color)&lt;br /&gt;    color_index = rev % @color_ind_size&lt;br /&gt;    color =  @colors[color_index]&lt;br /&gt;    &lt;br /&gt;    @color_hash[rev] = color&lt;br /&gt;  end&lt;br /&gt;  &lt;br /&gt;  color&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;$stdin.each_line do |line|&lt;br /&gt;  rev = line.strip.split(" ").first.to_i&lt;br /&gt;  &lt;br /&gt;  color = color_for_rev(rev)&lt;br /&gt;  colored = "&amp;lt;div style='color:#{color}'&amp;gt;#{htmlize(line.strip)}&lt;/span&gt;"&lt;br /&gt;  &lt;br /&gt;  puts(colored)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts("&amp;lt;/div&amp;gt;")&lt;br /&gt;html_footer()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-7892063516261018118?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/7892063516261018118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=7892063516261018118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7892063516261018118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7892063516261018118'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/12/textmate-subversion-annotate-command.html' title='TextMate: Subversion Annotate command'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-2430555985418075164</id><published>2007-12-12T12:03:00.000-07:00</published><updated>2007-12-12T12:14:49.690-07:00</updated><title type='text'>TextMate command db query prompt</title><content type='html'>I decided to give TextMate another whirl last night. I thought since I gave NetBeans 6 some time recently I'd see how efficient a couple of days with TextMate would be (compared with my life-blood emacs). I was pleasantly surprised at its extendability, speed and myriad of bundle choices. While perusing the SQL bundle I noticed I couldn't see of a way of directly typing in a query. I really like sql-mysql in emacs, so I was hoping I could do something similar--the workaround being typing a query into a buffer, selecting it, then invoking the command to send it. After poking around in the TextMate manual I was shocked at how easy it appeared to be to add custom commands. In less than a minute I had this (edited straight from the manual example of showing a dialog for input):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;res=$(CocoaDialog inputbox --title "Send query" \&lt;br /&gt;   --informative-text "Enter query text:" \&lt;br /&gt;   --button1 "Submit" --button2 "Cancel")&lt;br /&gt;&lt;br /&gt;[[ $(head -n1 &lt;&lt;&lt;"$res") == "2" ]] &amp;amp;&amp;amp; exit_discard  res=$(tail -n1 &lt;&lt;&lt;"$res")  db_browser.rb --query="$(tr '\n' ' ' &lt;&lt;&lt; "$res")" &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If I can just get over my remaining habits (screen splitting, hippie-expand, and more), I may end up paying for this editor. Too bad it's not OSS :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2430555985418075164?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2430555985418075164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2430555985418075164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2430555985418075164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2430555985418075164'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/12/textmate-command-db-query-prompt.html' title='TextMate command db query prompt'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-8822551977646048562</id><published>2007-11-21T12:49:00.000-07:00</published><updated>2007-11-21T12:57:32.781-07:00</updated><title type='text'>Rxtx to MINA H-ITT Flash integration out of the park</title><content type='html'>That's a lame title, but it advertises all of the relevant (okay, short of Java's role, which is inherent since &lt;a href="http://mina.apache.org/"&gt;Apache MINA&lt;/a&gt; is written in Java) technologies in my latest project at work. We'll be using a  Flash based application for our next training platform. One of the goals of the platform is to integrate an audience response system with the training. We specifically chose &lt;a href="http://www.h-itt.com"&gt;H-ITT&lt;/a&gt; as &lt;a href="http://www.vitalsmarts.com/default.aspx?zid=7&amp;pg=22"&gt;our&lt;/a&gt; provider because the offer a simple &lt;a href="http://www.h-itt.com/developers.html"&gt;SDK&lt;/a&gt; (cross-platform translation library) and they appeared to have the most developed system  and provide solid support. &lt;br /&gt;&lt;br /&gt;Today I finished a proof of concept and made it available to them, here are the relevant sections of my email (heading home soon, this saves me time from repeating myself):&lt;br /&gt;--begin email chunk--&lt;br /&gt;I wanted to let you know that I have successfully completed a workable Windows H-ITT-Java-Flash prototype. I have some of the code operational in OSX but haven't pursued it in light of our goal of a single Windows deliverable (with embedded JRE) that _doesn't_ require an installation routine. I've used Java as the communication layer, natively interfacing through your SDK, and created a rudimentary TCP protocol for communication with the Flash application. I've heavily relied on the open-source Apache MINA project in conjunction with the Rxtx libraries (which will be included in a later stable release of MINA), Simple-Log and Launch4j. &lt;br /&gt;&lt;br /&gt;The prototype simply exhibits the ability to auto-detect the transceiver's serial port (baud can be manually configured via a properties file, defaults at 19200), sets up the appropriate serial connection, and then forwards the responses to the Flash app. Java logging is written to disk unless executed from a read-only medium. The Flash prototype provides an "Acquire" button that kicks off the auto-detect, a log console (scrolling is there, but not so visible, I'm not a Flash guru), and also virtual buttons related to the remote. Thus, when configuration is successfully complete, pressing the buttons on the remote invokes the related event in the Flash app to show which button was pressed. The whole setup serves as a basic proof-of-concept for what we're pursuing with our next-gen training platform.&lt;br /&gt;--end email chunk--&lt;br /&gt;&lt;br /&gt;Thanksgiving is tomorrow, I'm feeling grateful: So I've already plugged H-ITT in the beginning of the post, but I really gotta say they've been great to work with and very prompt in answering questions. Next plug goes to the MINA team. MINA intuitively and simply (relatively, I thought the docs and examples were sufficient) provided a great framework for custom socket communication with Flash. It's elegantly architected (IMHO) and easily integrated with what I had envisioned for the Java communication layer. Props to &lt;a href="http://swamp.homelinux.net/blog/"&gt;Mike Heath&lt;/a&gt; for recommending MINA and assisting my approach. &lt;a href="http://simple-log.dev.java.net/"&gt;Simple-log&lt;/a&gt; and &lt;a href="http://launch4j.sf.net"&gt;Launch4j&lt;/a&gt; simplified logging and customizing  a single Windows .exe file. Lastly, &lt;a href="http://rxtx.org"&gt;Rxtx&lt;/a&gt; provided the crux of the serial-communication and I applaud the development team in their cross-platform approach and deliverables. Finally, my thanks to Ross Asay for the JNI help, since I was intending a cross-platform delivery to correspond with H-ITT's libraries this proved to be a good challenge and learning experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-8822551977646048562?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/8822551977646048562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=8822551977646048562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8822551977646048562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8822551977646048562'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/11/rxtx-to-mina-h-itt-flash-integration.html' title='Rxtx to MINA H-ITT Flash integration out of the park'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-3621604019355900110</id><published>2007-09-12T18:18:00.000-06:00</published><updated>2007-09-12T18:51:45.359-06:00</updated><title type='text'>Failed to get IPC connection</title><content type='html'>This convenient message showed up tonight on a Windows 2003 Server VM under VMWare server. Restarting the service, no go. Restarting the VM, no go (same message). Remove devices and change the VM settings, no go. Restarting host (Suse), no go. &lt;br /&gt;&lt;br /&gt;A bit of looking around didn't help much, but someone mentioned a permissions issue. Here's the log entry:&lt;br /&gt;&lt;pre&gt;Sep 12 18:13:56: vmx| CnxAcceptConnection: Could not receive fd on 187: invalid control message&lt;br /&gt;Sep 12 18:13:56: vmx| Failed to get IPC connection&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Going out to the directory of the VM, and executing a "chown root:root -R ." did the job. Restarting the VM after that brought it up nice and happy. So the question remains as to what caused this to occur.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-3621604019355900110?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/3621604019355900110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=3621604019355900110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3621604019355900110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/3621604019355900110'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/09/failed-to-get-ipc-connection.html' title='Failed to get IPC connection'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6342028924156654004</id><published>2007-08-15T12:18:00.000-06:00</published><updated>2007-08-15T12:25:16.956-06:00</updated><title type='text'>Why I love Apache's Ldap Studio</title><content type='html'>I've gotta modify some attributes on people in our ActiveDirectory. The fun Microsoft way to do this is to download ADAM-adsi management console plugin, and then go from there. It's pretty basic and is usual MS ugliness. On the other hand, &lt;a href="http://directory.apache.org/studio/"&gt;Apache Ldap Studio&lt;/a&gt;  provides a much better user experience. Being built on top of Eclipse enables a slick interface and a very intuitive way of dealing with your directory (browsing, searching, editing). Kudos to the guys that wrote it, I can now enjoy mucking with AD from my Mac with ease and finesse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6342028924156654004?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6342028924156654004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6342028924156654004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6342028924156654004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6342028924156654004'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/08/why-i-love-apaches-ldap-studio.html' title='Why I love Apache&apos;s Ldap Studio'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-1927286710917677420</id><published>2007-08-09T10:20:00.001-06:00</published><updated>2007-08-09T10:29:27.378-06:00</updated><title type='text'>Remote files in Emacs</title><content type='html'>Today I decided I was sick of always SSHing everywhere only to open up a couple of files for editing and then saving them. It doesn't make sense to copy my .emacs everywhere either. I discovered &lt;a href="http://jeremy.zawodny.com/blog/archives/000983.html"&gt;Tramp&lt;/a&gt;, and it just makes me all the more happy with my Emacs zealotry.  Even better, my &lt;a href="http://porkrind.org/emacs/emacs-builds/Emacs-22.1-i386-10.4.9.dmg"&gt;current snapshot&lt;/a&gt; already includes it.&lt;br /&gt;&lt;br /&gt;Works great with dired too:&lt;br /&gt;/ssh:hoser@somebox:/whateverdirectory&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-1927286710917677420?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/1927286710917677420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=1927286710917677420' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/1927286710917677420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/1927286710917677420'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/08/remote-files-in-emacs.html' title='Remote files in Emacs'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6909715676043932164</id><published>2007-08-01T11:06:00.000-06:00</published><updated>2007-08-01T11:21:13.884-06:00</updated><title type='text'>installing the latest nginx on OS X</title><content type='html'>I've read a lot about &lt;a href="http://nginx.net/"&gt;nginx&lt;/a&gt; lately and wanted to test its performance for our up-and-coming Ruby on Rails CRM application. It looked very easy to setup and easily configurable (especially with &lt;a href="http://projects.require.errtheblog.com/browser/nginx_config_generator"&gt;this&lt;/a&gt;). My first attempt was installing it through MacPorts, but that didn't fly, as I received the unpleasant "dyld: Library not loaded: /usr/local/lib/libpcre.0.dylib". Turns out I had the same problem when trying to execute after building straight from source (which happened to be a newer version).&lt;br /&gt;&lt;br /&gt;So with MacPorts I installed pcre 7.2_0, deactivated 7.0_0, created the symlink as "sudo ln -s /opt/local/lib/libpcre.0.dylib /usr/local/lib/" and was then able to start up nginx from the source build. Unfortunately the generated configuration file I am using expected a user and group for "nginx". A quick work around for that was to just reference myself instead. Here's what I ended up with (awaiting tweaks and optimizations):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#user and group to run as&lt;br /&gt;user  russ russ;&lt;br /&gt;&lt;br /&gt;# number of nginx workers&lt;br /&gt;worker_processes  2;&lt;br /&gt;&lt;br /&gt;# pid of nginx master process&lt;br /&gt;pid        logs/nginx.pid;&lt;br /&gt;&lt;br /&gt;# Number of worker connections. 1024 is a good default&lt;br /&gt;events {&lt;br /&gt; worker_connections  1024;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# start the http module where we config http access.&lt;br /&gt;http {&lt;br /&gt; # pull in mime-types. You can break out your config&lt;br /&gt; # into as many include's as you want to make it cleaner&lt;br /&gt; include       conf/mime.types;&lt;br /&gt;&lt;br /&gt; # set a default type for the rare situation that&lt;br /&gt; # nothing matches from the mimie-type include&lt;br /&gt; default_type  application/octet-stream;&lt;br /&gt;&lt;br /&gt; # configure log format&lt;br /&gt; log_format  main  '$remote_addr - $remote_user [$time_local] $status '&lt;br /&gt;                 '"$request" $body_bytes_sent "$http_referer" '&lt;br /&gt;                 '"$http_user_agent" "http_x_forwarded_for"';&lt;br /&gt;&lt;br /&gt; # main access log&lt;br /&gt; access_log  logs/access.log  main;&lt;br /&gt;&lt;br /&gt; # main error log&lt;br /&gt; error_log  logs/error.log debug;&lt;br /&gt; #error_log logs/error.log debug_http;&lt;br /&gt;&lt;br /&gt; # no sendfile on OSX&lt;br /&gt; sendfile        on;&lt;br /&gt;&lt;br /&gt; # These are good default values.&lt;br /&gt; tcp_nopush        on;&lt;br /&gt; tcp_nodelay       off;&lt;br /&gt; # output compression saves bandwidth&lt;br /&gt; gzip            on;&lt;br /&gt; gzip_http_version 1.0;&lt;br /&gt; gzip_comp_level 2;&lt;br /&gt; gzip_proxied any;&lt;br /&gt; gzip_types      text/plain text/html text/css application/x-javascript text/xml application/xml&lt;br /&gt;                  application/xml+rss text/javascript;&lt;br /&gt;&lt;br /&gt; # this is where you define your mongrel clusters.&lt;br /&gt; # you need one of these blocks for each cluster&lt;br /&gt; # and each one needs its own name to refer to it later.&lt;br /&gt; upstream vscrm {&lt;br /&gt;   server 127.0.0.1:8000;&lt;br /&gt;   server 127.0.0.1:8001;&lt;br /&gt;   server 127.0.0.1:8002;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; # the server directive is nginx's virtual host directive.&lt;br /&gt; server {&lt;br /&gt;   # port to listen on. Can also be set to an IP:PORT&lt;br /&gt;   listen       80;&lt;br /&gt;&lt;br /&gt;   # sets the domain[s] that this vhost server requests for&lt;br /&gt;   server_name  vscrm;&lt;br /&gt;&lt;br /&gt;   # doc root&lt;br /&gt;   root /home/russ/forge/svn/vscrm/trunk/public;&lt;br /&gt;&lt;br /&gt;   # vhost specific access log&lt;br /&gt;   access_log  logs/vscrm.access.log  main;&lt;br /&gt;&lt;br /&gt;   #Set the max size for file uploads to 50Mb&lt;br /&gt;   client_max_body_size  50M;&lt;br /&gt;&lt;br /&gt;   # this rewrites all the requests to the maintenance.html&lt;br /&gt;   # page if it exists in the doc root. This is for capistrano's&lt;br /&gt;   # disable web task&lt;br /&gt;   if (-f $document_root/maintenance.html){&lt;br /&gt;     rewrite  ^(.*)$  /maintenance.html last;&lt;br /&gt;     break;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   if ($host ~* "www") {&lt;br /&gt;     rewrite ^(.*)$ http://vscrm$1 redirect;&lt;br /&gt;     break;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   location / {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     # needed to forward user's IP address to rails&lt;br /&gt;     proxy_set_header  X-Real-IP  $remote_addr;&lt;br /&gt;&lt;br /&gt;     # needed for HTTPS&lt;br /&gt;     proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;     proxy_set_header Host $http_host;&lt;br /&gt;     proxy_redirect false;&lt;br /&gt;     proxy_max_temp_file_size 0;&lt;br /&gt;&lt;br /&gt;     # check for index.html for directory index&lt;br /&gt;     # if its there on the filesystem then rewite&lt;br /&gt;     # the url to add /index.html to the end of it&lt;br /&gt;     # and then break to send it to the next config rules.&lt;br /&gt;     if (-f $request_filename/index.html) {&lt;br /&gt;       rewrite (.*) $1/index.html break;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     # this is the meat of the rails page caching config&lt;br /&gt;     # it adds .html to the end of the url and then checks&lt;br /&gt;     # the filesystem for that file. If it exists, then we&lt;br /&gt;     # rewite the url to have explicit .html on the end&lt;br /&gt;     # and then send it on its way to the next config rule.&lt;br /&gt;     # if there is no file on the fs then it sets all the&lt;br /&gt;     # necessary headers and proxies to our upstream mongrels&lt;br /&gt;     if (-f $request_filename.html) {&lt;br /&gt;       rewrite (.*) $1.html break;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     if (!-f $request_filename) {&lt;br /&gt;       proxy_pass http://vscrm;&lt;br /&gt;       break;&lt;br /&gt;     }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   error_page   500 502 503 504  /50x.html;&lt;br /&gt;   location = /50x.html {&lt;br /&gt;     root   html;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6909715676043932164?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6909715676043932164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6909715676043932164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6909715676043932164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6909715676043932164'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/08/installing-latest-nginx-on-os-x.html' title='installing the latest nginx on OS X'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-639893759367868697</id><published>2007-07-31T13:18:00.000-06:00</published><updated>2007-07-31T13:37:47.824-06:00</updated><title type='text'>sanitizing Rails input parameters</title><content type='html'>I really like how Tapestry automagically escapes HTML input when posted from a form. In fact, it was just great never having to worry about that when coding. I'd like to have the same functionality in Rails especially after reading about Rails XSS vulnerabilities and work-arounds. Since the webapp I'm writing has no requirements for allowing formatted user input, I just need something simple to clean/sanitize all the params. Here's the latest:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; #escapes all HTML from the given hash's values (recursively applied as needed)&lt;br /&gt; def sanitize(hash)&lt;br /&gt;   dirty_hash = hash&lt;br /&gt;&lt;br /&gt;   dirty_hash.keys.each do |key|&lt;br /&gt;     value = dirty_hash[key]&lt;br /&gt;    &lt;br /&gt;     if(value.kind_of?Hash)&lt;br /&gt;       dirty_hash[key] = sanitize(value)&lt;br /&gt;     else&lt;br /&gt;       if (value &amp;&amp;amp; value.kind_of?(String))&lt;br /&gt;         dirty_hash[key] = CGI.escapeHTML(value)&lt;br /&gt;       end&lt;br /&gt;     end&lt;br /&gt;   end&lt;br /&gt;  &lt;br /&gt;   hash = dirty_hash&lt;br /&gt; end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is then invoked by a before_filter. Seems to do the job, is there a better/cleaner/faster way of doing this? Let me know how it could be improved...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-639893759367868697?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/639893759367868697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=639893759367868697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/639893759367868697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/639893759367868697'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/07/sanitizing-rails-input-parameters.html' title='sanitizing Rails input parameters'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-5265082224731427647</id><published>2007-07-11T09:53:00.000-06:00</published><updated>2007-07-11T10:09:14.927-06:00</updated><title type='text'>Ruby: constant time for include?</title><content type='html'>Sure would be nice if the Ruby docs  (including &lt;a href="http://www.rubycentral.com/pickaxe/"&gt;this book&lt;/a&gt;) would provide more details to the implementation of the Set class.  According to &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/184879"&gt;this&lt;/a&gt;, Set implements its backing collection with a Hash, which would essentially mean that it's synonymous (to some degree) with Java's &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;HashSet&lt;/span&gt;. Thus providing a constant time &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;lookup&lt;/span&gt; when Set#include? is invoked. Just for grins I &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;benchmarked&lt;/span&gt; this in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;irb&lt;/span&gt; with a million &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Fixnums&lt;/span&gt; and was pleased with the 15 microsecond &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;lookups&lt;/span&gt;. I looked at the source of both and found a fair amount of similarity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-5265082224731427647?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/5265082224731427647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=5265082224731427647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5265082224731427647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5265082224731427647'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/07/ruby-constant-time-for-include.html' title='Ruby: constant time for include?'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-4268899385032100149</id><published>2007-06-22T22:01:00.001-06:00</published><updated>2007-06-22T22:38:40.774-06:00</updated><title type='text'>Sorting serialized objects from a YAML file, Ruby vs Java</title><content type='html'>I recently had a large dataset that I needed to sort, basically a bunch of objects with 9 string attributes. I dumped them to a YAML file so I could benchmark various aspects of sorting (Class#to_yaml really rocks, really). As it turns out Enumerable#sort_by was the more efficient way to go rather than Enumerable#sort (&lt;a href="http://www.ruby-doc.org/core/classes/Enumerable.html#M003151"&gt;check it&lt;/a&gt;). The dataset contained 5429 unique objects, here's the benchmarking I did in irb:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt; bm do |x|&lt;br /&gt;?&gt; x.report("all"){results.sort{|a,b|a.account_name &lt;=&gt; b.account_name}}&lt;br /&gt;&gt;&gt; end&lt;br /&gt;  user     system      total        real&lt;br /&gt;all  0.070000   0.000000   0.070000 (  0.073835)&lt;br /&gt;&gt;&gt; bm do |x|&lt;br /&gt;?&gt; x.report("all"){results.sort_by{|a|a.account_name}}&lt;br /&gt;&gt;&gt; end&lt;br /&gt;  user     system      total        real&lt;br /&gt;all  0.020000   0.000000   0.020000 (  0.020745)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Noticeable difference between the two methods, and quite pleasing to see how fast sort_by performed (Apple MBP 2.33GHZ 2GB RAM Ruby 1.85). Then the thought occurred to me, since I have this in a YAML file, I could write something really quick in Java and see how fast the sort would be by dumping it into a TreeSet.&lt;br /&gt;&lt;br /&gt;So I set off to find out how I could marshal the data into POJOs from the YAML file. &lt;a href="http://jyaml.sourceforge.net/"&gt;JYaml&lt;/a&gt; and &lt;a href="http://jvyaml.dev.java.net/"&gt;JvYaml&lt;/a&gt; are the only (insofar as I looked) open source Java YAML libraries. Both seem half-baked in their own right, likely containing just the functionality the respective author needed and not much more (at least that's how it appeared). I ended up using JvYaml and had to search-replace the yaml entry identifier("tag:yaml.org,2002:map") so that JvYaml would create HashMap instances for me instead of its completely worthless PrivateType class.&lt;br /&gt;&lt;br /&gt;From there I iterated through the maps to create the POJOs and shoved  them into a HashSet. Once that was completed I created the comparator for my POJO, passed it into the TreeSet constructor and then timed an addAll giving it the entire HashSet:&lt;br /&gt;#1: 55ms&lt;br /&gt;#2: 28ms&lt;br /&gt;#3: 27ms (pretty much constant thereafter)&lt;br /&gt;&lt;br /&gt;Interesting results eh? The dataset I used was from a randomized generator and now that I have these initial numbers ( Ruby appears to have won this round), I want to test a larger set. And to be really fair I should do more research on benchmarking best practices (in addition to still needing to take my stats class).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-4268899385032100149?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/4268899385032100149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=4268899385032100149' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/4268899385032100149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/4268899385032100149'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/06/sorting-serialized-objects-from-yaml.html' title='Sorting serialized objects from a YAML file, Ruby vs Java'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-262692474742600814</id><published>2007-04-17T16:18:00.000-06:00</published><updated>2007-04-17T16:20:37.570-06:00</updated><title type='text'>X11 tunneling via SSH in OSX</title><content type='html'>-X isn't enough for the ssh args in OSX according to &lt;a href="http://lists.apple.com/archives/x11-users/2006/Jun/msg00032.html"&gt;this post&lt;/a&gt;. So, "ssh -XY hoser@remotebox" worked just great when remoting in to a Suse server and firing executing fvwm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-262692474742600814?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/262692474742600814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=262692474742600814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/262692474742600814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/262692474742600814'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/04/x11-tunneling-via-ssh-in-osx.html' title='X11 tunneling via SSH in OSX'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-1995938977221184639</id><published>2007-04-12T16:34:00.000-06:00</published><updated>2007-04-12T16:57:32.554-06:00</updated><title type='text'>1024 vs 2048 RSA encryption/decryption fun in Ruby</title><content type='html'>Using &lt;a href="http://blog.leetsoft.com/2006/03/14/simple-encryption"&gt;Tobias's handy openssl wrapper&lt;/a&gt; I decided to run a couple timing tests to see how well Ruby's openssl implementation performed in encrypting/decrypting a set of 1000 identical messages, with 1024 bit and 2048 bit keys. Nothing scientific about this, just three runs of the script on my MacBook Pro (2.33 GHZ, 1G RAM). &lt;br /&gt;&lt;br /&gt;Encrypted text: "This is a much longer message since than what I intend to encrypt"&lt;br /&gt;&lt;br /&gt;Encryption results, avg time&lt;br /&gt;1024: 0.000300691s&lt;br /&gt;2048: 0.001010027s&lt;br /&gt;&lt;br /&gt;Decryption results, avg time&lt;br /&gt;1024: 0.005472064s&lt;br /&gt;2048: 0.035524023s&lt;br /&gt;&lt;br /&gt;Pick your poison.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-1995938977221184639?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/1995938977221184639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=1995938977221184639' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/1995938977221184639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/1995938977221184639'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/04/1024-vs-2048-rsa-encryptiondecryption.html' title='1024 vs 2048 RSA encryption/decryption fun in Ruby'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-6525655932732769068</id><published>2007-04-02T10:16:00.000-06:00</published><updated>2007-04-02T10:47:40.223-06:00</updated><title type='text'>One last hitch</title><content type='html'>According to &lt;a href="http://dev.ctor.org/soap4r/ticket/302"&gt;this&lt;/a&gt;, friendly errors such as&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/mapping.rb:520:in `class_schema_variable': undefined method `class_variables' for nil:NilClass (NoMethodError)&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/mapping.rb:353:in `schema_ns_definition'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/mapping.rb:380:in `schema_definition_classdef'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/registry.rb:198:in `schema_definition_from_class'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/literalregistry.rb:73:in `any2soap'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/literalregistry.rb:37:in `obj2soap'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/literalregistry.rb:127:in `stubobj2soap'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/literalregistry.rb:114:in `each'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/mapping/literalregistry.rb:114:in `stubobj2soap'&lt;br /&gt;       ... 15 levels...&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/rpc/proxy.rb:126:in `call'&lt;br /&gt;      from /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/lib/soap/rpc/driver.rb:179:in `call'&lt;br /&gt;      from (eval):6:in `search'&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;prohibit the following &lt;span style="font-style: italic;"&gt;default generated&lt;/span&gt; &lt;span style="font-style: italic;"&gt;objects&lt;/span&gt; from correctly mapping when invoking the NetSuite searches:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;OpportunitySearchBasic&lt;/li&gt;&lt;br /&gt;&lt;li&gt;EmployeeSearchBasic&lt;/li&gt;&lt;br /&gt;&lt;li&gt;PartnerSearchBasic&lt;/li&gt;&lt;br /&gt;&lt;li&gt;ItemSearchBasic&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TimeBillSearchBasic&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Each of which contain an entity named 'class', and while soap4r intelligently generates an attribute 'v_class', it also erroneously generates accessor methods that  override Object.class. Big woops. Extremely easy fix just by renaming those methods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-6525655932732769068?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/6525655932732769068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=6525655932732769068' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6525655932732769068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/6525655932732769068'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/04/one-last-hitch.html' title='One last hitch'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-2077201121647374720</id><published>2007-03-28T22:00:00.000-06:00</published><updated>2007-03-29T14:46:07.553-06:00</updated><title type='text'>NetSuite and Ruby, the final chapter</title><content type='html'>NetSuite requires a maintainable session for subsequent requests after the initial login by way of  several cookies they return upon successful authentication. The standard Net::HTTP library requires mucking with headers by hand in order to perpetuate cookie information. We were &lt;span style="font-weight: bold;"&gt;easily able to override SOAP::NetHttpClient::Response and SOAP::HTTPStreamHandler&lt;/span&gt; in the soap4r gem in order to provide the functionality for maintaining the NetSuite session. &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;However&lt;/span&gt;, NaHi's &lt;a href="http://dev.ctor.org/http-access2/"&gt;&lt;span style="font-weight: bold;"&gt;http-access2&lt;/span&gt;&lt;/a&gt; library already &lt;span style="font-weight: bold;"&gt;provides cookie management&lt;/span&gt; (even persistence if needed). After installing &lt;a href="http://visnup.com/2006/05/16/http-access2-as-a-gem/"&gt;visnu's gem&lt;/a&gt; it's simply a matter of turning off the SSLConfig#verify_mode and everything works flawlessly. The final test code:&lt;br /&gt;&lt;pre&gt;require 'rubygems'&lt;br /&gt;require_gem 'soap4r'&lt;br /&gt;require 'defaultDriver' #generated by soap4r&lt;br /&gt;require 'pp'&lt;br /&gt;&lt;br /&gt;driver = NetSuitePortType.new&lt;br /&gt;driver.wiredump_dev = STDOUT&lt;br /&gt;driver.proxy.streamhandler.client.ssl_config.verify_mode = nil&lt;br /&gt;&lt;br /&gt;passport = Passport.new&lt;br /&gt;passport.email = '123123123@123123123.com'&lt;br /&gt;passport.password = '123123123'&lt;br /&gt;passport.account ="123123"&lt;br /&gt;passport.role = RecordRef.new&lt;br /&gt;passport.role.xmlattr_internalId = '123123123'&lt;br /&gt;&lt;br /&gt;driver.login(LoginRequest.new(passport))&lt;br /&gt;&lt;br /&gt;record = RecordRef.new()&lt;br /&gt;record.xmlattr_internalId = '123123123'&lt;br /&gt;record.xmlattr_type = RecordType::Customer&lt;br /&gt;&lt;br /&gt;pp driver.get(GetRequest.new(record))&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Everything said and done, this has been a good learning experience. But more than anything it has exposed one of the Ruby community's greatest weaknesses: documentation. I've known this since the beginning of my Ruby days (2004) and have grown accustomed to reading code. Nevertheless, that takes time, and usually more time than scanning &lt;span style="font-weight: bold;"&gt;decently-documented APIs&lt;/span&gt;.  The other side of this story is that I understand the Japanese/English &lt;span style="font-weight: bold;"&gt;language barrier&lt;/span&gt; which may intimidate or otherwise prevent library maintainers from providing more documentation. In the end, Ruby is a community-driven language, which is not sponsored by massive corporate dollars (cough, Java, cough, .Net) &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; its beginnings have &lt;span style="font-weight: bold;"&gt;solid Japanese roots&lt;/span&gt;. Here's to hoping that documentation improves as more libraries become available and the language matures. In the mean time, thank goodness for Google, mailing lists, blogs and IRC. I believe that documentation practices exhibited by &lt;a href="http://www.37signals.com"&gt;37Signals&lt;/a&gt; and the &lt;a href="http://www.rubyonrails.org/community"&gt;Rails community&lt;/a&gt; are the guiding example, they're not perfect, but the situation continues to progress.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2077201121647374720?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2077201121647374720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2077201121647374720' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2077201121647374720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2077201121647374720'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/netsuite-and-ruby-final-chapter.html' title='NetSuite and Ruby, the final chapter'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-2569237105882800282</id><published>2007-03-28T10:38:00.000-06:00</published><updated>2007-03-28T10:51:42.500-06:00</updated><title type='text'>soap4r and NetSuite revisited</title><content type='html'>In the last post I mentioned that the generated file (default.rb) contained redundant object definitions. I also ended with the concern about the RecordRef element not appearing to be correct. That led me to look at the generator and as it turns out I was &lt;span style="font-weight: bold;"&gt;invoking the wrong one&lt;/span&gt;. Funny thing, the soap4r gem ships with wsdl2ruby.rb and places them in two different locations. The first (in OSX) was in /opt/local/bin where the second was in /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/bin/. Yesterday we explictly invoked the one in the gem, disregarding the the executable wrapper in /opt/local/bin. That was the mistake, as the results can be easily reproduced with executing&lt;br /&gt;&lt;pre&gt;ruby /opt/local/lib/ruby/gems/1.8/gems/soap4r-1.5.5.20061022/bin/wsdl2ruby.rb --wsdl https://webservices.netsuite.com/wsdl/v2_5_0/netsuite.wsdl --type client&lt;/pre&gt;The problem being that the wrapper adds the necessary "requires" for referencing the gem's code (correct results) and not the standard (incorrect results).  &lt;br /&gt;&lt;br /&gt;Using the correct wsdl2ruby the following test works without any modifications to the generated code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require 'rubygems'&lt;br /&gt;require_gem 'soap4r'&lt;br /&gt;require 'defaultDriver'&lt;br /&gt;&lt;br /&gt;driver = NetSuitePortType.new&lt;br /&gt;driver.wiredump_dev = STDOUT&lt;br /&gt;&lt;br /&gt;passport = Passport.new&lt;br /&gt;passport.email = 'test'&lt;br /&gt;passport.password = 'test'&lt;br /&gt;passport.account ="test"&lt;br /&gt;&lt;br /&gt;role = RecordRef.new&lt;br /&gt;role.xmlattr_internalId = '123123123'&lt;br /&gt;&lt;br /&gt;passport.role = role&lt;br /&gt;&lt;br /&gt;response = driver.login(LoginRequest.new(passport))&lt;br /&gt;&lt;br /&gt;pp "successful login: #{response.sessionResponse.status.xmlattr_isSuccess}"&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2569237105882800282?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2569237105882800282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2569237105882800282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2569237105882800282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2569237105882800282'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/soap4r-and-netsuite-revisited.html' title='soap4r and NetSuite revisited'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-2290996355307473359</id><published>2007-03-27T18:15:00.000-06:00</published><updated>2007-03-28T09:23:11.842-06:00</updated><title type='text'>adventures in soap4r and NetSuites webservices</title><content type='html'>Spent most of the day becoming familiar with soap4r in order to communicate with NetSuite. Turns out that the soap4r shipping with Ruby 1.8.5 is outdated and quite buggy compared to its gem counterpart. In fact, we would've saved a couple hours if we knew that was an option before we even started setting breakpoints.&lt;br /&gt;&lt;br /&gt;WSDL2Ruby worked decently enough with NetSuite's WSDL but the generated file containing the classes (default.rb) had redundant entries, like 35 definitions for the Passport object. Next, there was an issue with some of the classes being incomplete. For example, RecordRef was:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class RecordRef&lt;br /&gt;@@schema_type = "RecordRef"&lt;br /&gt;@@schema_ns = "urn:core_2_5.platform.webservices.netsuite.com"&lt;br /&gt;@@schema_element = []&lt;br /&gt;&lt;br /&gt;def initialize&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;which is incorrect as it is defined as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;complextype name="RecordRef"&amp;gt;&lt;br /&gt;&amp;lt;complexcontent&amp;gt;&lt;br /&gt;&amp;lt;extension base="platformCore:BaseRef"&amp;gt;&lt;br /&gt; &amp;lt;attribute name="internalId" type="xsd:string"&amp;gt;&lt;br /&gt; &amp;lt;attribute name="externalId" type="xsd:string"&amp;gt;&lt;br /&gt; &amp;lt;attribute name="type" type="platformCoreTyp:RecordType"&amp;gt;&lt;br /&gt; &amp;lt;!-- primary record internalId --&amp;gt;&lt;br /&gt; &amp;lt;!-- record type --&amp;gt;&lt;br /&gt;&amp;lt;/attribute&amp;gt;&lt;br /&gt;&amp;lt;/attribute&amp;gt;&lt;br /&gt;&amp;lt;/attribute&amp;gt;&lt;br /&gt;&amp;lt;/extension&amp;gt;&amp;lt;/complexcontent&amp;gt;&amp;lt;/complextype&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The object we created to get the request working correctly is&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class RecordRef&lt;br /&gt;@@schema_type = "RecordRef"&lt;br /&gt;@@schema_ns = "urn:core_2_5.platform.webservices.netsuite.com"&lt;br /&gt;&lt;br /&gt;attr_accessor :internalId&lt;br /&gt;attr_accessor :externalId&lt;br /&gt;attr_accessor :type&lt;br /&gt;&lt;br /&gt;def initialize(internalId = nil, externalId = nil, type = nil)&lt;br /&gt;@internalId = internalId&lt;br /&gt;@externalId = externalId&lt;br /&gt;@type = type&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally, calling&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;response = driver.login(LoginRequest.new(passport))&lt;br /&gt;&lt;/pre&gt; produced a successful response from NetSuite. However, something still seems awry with the request as the role element is not properly formed:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;n1:login xmlns:n1="urn:messages_2_5.platform.webservices.netsuite.com" xsi:type="n1:LoginRequest"&amp;gt;&lt;br /&gt; &amp;lt;n1:passport xmlns:n2="urn:core_2_5.platform.webservices.netsuite.com" xsi:type="n2:Passport"&amp;gt;&lt;br /&gt;   &amp;lt;n2:email&amp;gt;test &amp;lt;/n2:email&amp;gt;&lt;br /&gt;   &amp;lt;n2:password&amp;gt;test&amp;lt;/n2:password&amp;gt;&lt;br /&gt;   &amp;lt;n2:account&amp;gt;test&amp;lt;/n2:account&amp;gt;&lt;br /&gt;   &amp;lt;n2:role xsi:type="n2:RecordRef"&amp;gt;&lt;br /&gt;   &amp;lt;/n2:role&amp;gt;&lt;br /&gt; &amp;lt;/n1:passport&amp;gt;&lt;br /&gt;&amp;lt;/n1:login&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2290996355307473359?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2290996355307473359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2290996355307473359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2290996355307473359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2290996355307473359'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/adventures-in-soap4r-and-netsuites_28.html' title='adventures in soap4r and NetSuites webservices'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-5244841979777415370</id><published>2007-03-09T15:39:00.000-07:00</published><updated>2007-03-09T16:52:55.912-07:00</updated><title type='text'>Geocoding service findings and comparison</title><content type='html'>Google Maps:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt; requires an API key&lt;/li&gt;&lt;br /&gt; &lt;li&gt; http geocode service that'll return results in XML or JSON&lt;/li&gt;&lt;br /&gt; &lt;li&gt; lots of documentation on javascript implementation&lt;/li&gt;&lt;br /&gt; &lt;li&gt; issues in resolving bad addresses by suggesting alternatives and flagging them with the best accuracy-level&lt;/li&gt;&lt;br /&gt; &lt;li&gt; comma separated values on the query string&lt;/li&gt;&lt;br /&gt; &lt;li&gt; 50k per day limit&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Yahoo MapService:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt; http geocode service return results in XML or PHP&lt;/li&gt;&lt;br /&gt; &lt;li&gt; cleaner documentation&lt;/li&gt;&lt;br /&gt; &lt;li&gt; ApplicationID required&lt;/li&gt;&lt;br /&gt; &lt;li&gt; address suggestion behaves more as expected and accuracy seems better&lt;/li&gt;&lt;br /&gt; &lt;li&gt; query string attributes expected in request&lt;/li&gt;&lt;br /&gt; &lt;li&gt; 5k per day limit &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Note regarding accuracy statements above: I tested both services with variations on my home address which can be identified strictly by number coordinates or with the street name (Valley Sage Drive). Google's service did not find my address in any format I tried but continued to respond with varied suggestions none of which were applicable (though it stated they were the highest level of accuracy). As for yahoo, it found my address in every variation and for those that it suggested it clearly indicated a warning as an attribute of the ResultSet. Odd that Google Maps works for my address, but the geocoding service does not (and they're supposed to be integrated).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Both services provide city and state values when given a zip.&lt;br /&gt;&lt;br /&gt;Determining valid addresses may prove to be a bit difficult given that both services "suggest" what the closest match could be.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-5244841979777415370?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/5244841979777415370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=5244841979777415370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5244841979777415370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/5244841979777415370'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/geocoding-service-findings-and.html' title='Geocoding service findings and comparison'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-342132007636280105</id><published>2007-03-08T17:23:00.000-07:00</published><updated>2007-03-08T17:25:38.941-07:00</updated><title type='text'>a more efficient top for OS X</title><content type='html'>&lt;pre&gt;echo "alias top=\"top -d -o cpu\"" &gt;&gt; ~/.profile&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The "-d" bypasses the strain on Mach"-o cpu" and will sort by procs consuming the most CPU.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-342132007636280105?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/342132007636280105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=342132007636280105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/342132007636280105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/342132007636280105'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/more-efficient-top-for-os-x.html' title='a more efficient top for OS X'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-9186204872850413806</id><published>2007-03-07T06:40:00.000-07:00</published><updated>2007-03-07T06:45:32.099-07:00</updated><title type='text'>HttpUtility.UrlEncode, fails again</title><content type='html'>Bitten a couple months ago by the fact that System.Web.HttpUtility.UrlEncode does &lt;span style="font-weight:bold;"&gt;NOT&lt;/span&gt; encode ticks/single-quotes ('). How lovely. &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=252514"&gt;I filed a bug&lt;/a&gt;, someone at MS closed it out almost a month later with no explanation. It's current state is "won't fix".&lt;br /&gt;&lt;br /&gt;Bitten again by another bug in the same function. What a shocking surprise. UrlEncode does not escape/encode the plus (+). It should encode it as %2B, but no, it doesn't, it just leaves it in the string. &lt;br /&gt;&lt;br /&gt;Hosers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-9186204872850413806?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/9186204872850413806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=9186204872850413806' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/9186204872850413806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/9186204872850413806'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/03/httputilityurlencode-fails-again.html' title='HttpUtility.UrlEncode, fails again'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-2138225417578211289</id><published>2007-02-26T10:50:00.000-07:00</published><updated>2007-02-26T10:52:57.967-07:00</updated><title type='text'>Mike Heath stumbles upon pile of java JIT</title><content type='html'>Mike has had &lt;a href="http://swamp.homelinux.net/blog/?p=13"&gt;a great time with this&lt;/a&gt; and we've had some intriguing conversations about it. Once he posts his svn repo url I'll snag the code, run the tests on my MacBook Pro and add the results to his matrix.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-2138225417578211289?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/2138225417578211289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=2138225417578211289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2138225417578211289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/2138225417578211289'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/02/mike-heath-stumbles-upon-pile-of-java.html' title='Mike Heath stumbles upon pile of java JIT'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-7194063874318653084</id><published>2007-02-21T10:53:00.000-07:00</published><updated>2007-02-21T11:09:12.050-07:00</updated><title type='text'>UPS xml online tools and Ruby</title><content type='html'>UPS provides "XML Online Tools" to account holders &lt;a href="http://www.ups.com/content/us/en/bussol/offering/technology/automated_shipping/online_tools.html"&gt;here&lt;/a&gt;. Once you register as a developer you can get access to these tools and the associated specs and sample code. I needed access to the Rates and Service Selection tool, which happened to contain VB script and Java sample code from 2001. The docs are very thorough, but the code (as expected) was very outdated. Once I had it working with 1.5 (not too difficult at all) I was able to better understand what was needed for working with their HTTP-XML services.&lt;br /&gt;&lt;br /&gt;The following barebones Ruby code is the result of a quick implementation:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require 'net/https'&lt;br /&gt;require 'uri'&lt;br /&gt;&lt;br /&gt;auth_xml = (access request xml doc goes here)&lt;br /&gt;req_xml = (request xml doc goes here)&lt;br /&gt;both_xml = auth_xml + req_xml&lt;br /&gt;&lt;br /&gt;url = URI.parse("https://....")&lt;br /&gt;request = Net::HTTP::Post.new(url.path)&lt;br /&gt;request.body = (both_xml)&lt;br /&gt;request.content_type = 'application/x-www-form-urlencoded'&lt;br /&gt;&lt;br /&gt;http = Net::HTTP.new(url.host,443)&lt;br /&gt;#http.set_debug_output $stderr&lt;br /&gt;http.use_ssl = true&lt;br /&gt;http.timeout = 30&lt;br /&gt;&lt;br /&gt;@response = nil&lt;br /&gt;http.start do&lt;br /&gt;  @response =  http.request(request)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;p @response.body&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-7194063874318653084?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/7194063874318653084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=7194063874318653084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7194063874318653084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7194063874318653084'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/02/ups-xml-online-tools-and-ruby.html' title='UPS xml online tools and Ruby'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-133965735873385252</id><published>2007-01-31T12:09:00.000-07:00</published><updated>2007-01-31T12:33:28.211-07:00</updated><title type='text'>Another reason I dislike Microsoft</title><content type='html'>http://ajax.asp.net&lt;br /&gt;&lt;br /&gt;Hooray, welcome to the Ajax world ASP.NET. It's been around long enough, someone bright  in &lt;a href="http://www.eweek.com/article2/0,1895,2088644,00.asp"&gt;Redmond actually started the movement back&lt;/a&gt; in the mid 90's. But, Microsoft, could you not kill the term by branding your Ajax components as AjaxThisOrThat when it's &lt;a href="http://www.asp.net/learn/videos/view.aspx?tabid=63&amp;amp;id=87"&gt;really&lt;/a&gt; &lt;a href="http://www2.blogger.com/Use%20the%20ASP.NET%20AJAX%20Collapsable%20Panel%20Extender"&gt;just&lt;/a&gt; a &lt;a href="http://www2.blogger.com/Use%20the%20ASP.NET%20AJAX%20HoverMenu%20Extender"&gt;wrapper&lt;/a&gt; &lt;a href="http://www2.blogger.com/Use%20the%20ASP.NET%20AJAX%20ModalPopup%20Extender%20Control"&gt;for DHTML functionality&lt;/a&gt;? It appears to me that you're trying to capitalize on the current wave by simply naming DHTML controls as Ajaxed controls. &lt;a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29"&gt;Which is simply wrong&lt;/a&gt;. Then again, I suppose that's no surprise considering &lt;a href="http://blog.seattlepi.nwsource.com/microsoft/archives/110758.asp"&gt;your failed attempt at changing the meanings of things anyway&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Sadly, for the ASP.NET developers who may be new to it, they'll now be dumbed down (once again?) to the real concepts and essentials of what Ajax _really_ is and how/why it works.&lt;br /&gt;&lt;br /&gt;Oh, and nice job on making it &lt;a href="http://ajax.asp.net/docs/overview/AsynchronousLayerOverview.aspx"&gt;only work with web services&lt;/a&gt; and kudos to making &lt;a href="http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx"&gt;configuration  a breeze&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-133965735873385252?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/133965735873385252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=133965735873385252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/133965735873385252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/133965735873385252'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/01/another-reason-i-dislike-microsoft.html' title='Another reason I dislike Microsoft'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-7294153163647090119</id><published>2007-01-29T16:32:00.000-07:00</published><updated>2007-01-29T16:47:39.091-07:00</updated><title type='text'>Quote model, has_many and a couple hours of grief</title><content type='html'>I have two models, Quote and QuoteLineItem using the has_many and belongs_to respectively. I was having issues with AR dumping out insert statements like&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;INSERT INTO quote_line_items (`created_on`, `quote_id`, `price`, `modified_on`, `product_id`, `quantity`, `modified_by_person_id`) VALUES(#&amp;lt;Quote:0x36551f0&gt;,&lt;br /&gt;#&amp;lt;Quote:0x364dba8&gt;, #&amp;lt;Quote:0x3645728&gt;, #&amp;lt;Quote:0x363efa4&gt;, #&amp;lt;Quote:0x362ef3c&gt;, #&amp;lt;Quote:0x3636728&gt;, #&amp;lt;Quote:0x3624618&gt;))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This drove me nuts so I jumped into rdebug to figure out the issue. Turns out there is an ActiveRecord method name collision when using&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;belongs_to :quote&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;so you have to provide an alternative, something like&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;belongs_to :related_quote, :class_name =&gt; "Quote"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Wish I knew that when I was creating this migration....&lt;br /&gt;&lt;br /&gt;UPDATE:&lt;br /&gt;http://dev.rubyonrails.org/ticket/4248&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-7294153163647090119?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/7294153163647090119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=7294153163647090119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7294153163647090119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/7294153163647090119'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/01/quote-model-hasmany-and-couple-hours-of.html' title='Quote model, has_many and a couple hours of grief'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-8767977489436303656</id><published>2007-01-23T15:21:00.000-07:00</published><updated>2007-05-01T21:10:14.109-06:00</updated><title type='text'>Spotlight and indexed content</title><content type='html'>UPDATE: Check it out: http://www.arcadianvisions.com/downloads/RubyImporter.html&lt;br /&gt;&lt;br /&gt;Became apparent to me today as I was searching for some files that Spotlight only indexes content for files based on their extension (and plugin, if installed). I was able to confirm this with the following code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;echo "hello you hoser" &gt; something.java&lt;br /&gt;mdls something.java&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There's a bunch of data there associated specifically to the .java extension. Find that file based on its contents:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mdfind "you hoser" |grep java&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Aha, there's the file.&lt;br /&gt;Trying this again with, say, a .rb extension:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;echo "take off you nob" &gt; somethingelse.rb&lt;br /&gt;mdfind "take off you" | grep something&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;No results. mdls shows that there are some attributes associated with the .rb extension, but somehow the content isn't indexed.&lt;br /&gt;&lt;br /&gt;XCode provides a project template called "Metadata Importer" so you can write your own to deal with custom extensions. &lt;a href="http://developer.apple.com/documentation/Carbon/Conceptual/MDImporters/index.html#//apple_ref/doc/uid/TP40001267"&gt;Apple's doc explains the process.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-8767977489436303656?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/8767977489436303656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=8767977489436303656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8767977489436303656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/8767977489436303656'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/01/spotlight-and-indexed-content.html' title='Spotlight and indexed content'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116863668236005443</id><published>2007-01-12T14:16:00.000-07:00</published><updated>2007-01-12T14:18:03.116-07:00</updated><title type='text'>quicksilver shortcut for locking the screen in OSX</title><content type='html'>I copied the ScreenSaverEngine.app from System/Library/Frameworks/Screensaver.framework/Versions/A/Resources/ScreenSaverEngine.app &lt;br /&gt;to a cataloged QuickSilver directory. From there I just bound a key through the Triggers. Now I can lock the machine with ctl-option-l.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116863668236005443?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116863668236005443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116863668236005443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116863668236005443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116863668236005443'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/01/quicksilver-shortcut-for-locking.html' title='quicksilver shortcut for locking the screen in OSX'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116828253084620599</id><published>2007-01-08T11:35:00.000-07:00</published><updated>2007-01-08T11:55:31.630-07:00</updated><title type='text'>Suse 10.2 64-bit and VMWare Server</title><content type='html'>Need a 64-bit server so we can run our VMWare machines on it and utilize the 8+ gig of RAM. Originally tried CentOS but because VMWare Server is compiled against 32-bit libraries, it would be a nasty amount of work to install the needed libraries one-by-one (ldd spit out at least 20 libraries we needed). After digging around online it turns out that VMWare "officially" supports Suse but not much else. Time was of the essence and we bagged Gentoo for that reason. &lt;br /&gt;&lt;br /&gt;The 10.1 install was pleasant, but the user experience was very unpleasant. I didn't actually install it, but a coworker did and it was only a matter of days until he migrated to Ubuntu. We were hoping that some of the usability issues were resolved in 10.2, happy to report that is the case. We installed the base system, developer libraries, kernel development and the 32-bit libraries during the initial package selection. After that, once the system was up and running, vmware installed without issue.&lt;br /&gt;&lt;br /&gt;To use vnc (via ssh) we enabled Remote Login in Login Window Preferences (not sure why that's a System Application but not in the Control Center). The command to enable port forwarding for local vncviewer execution is "ssh -g -L localhost:5901:machine:5901 user@machine -X", then "vncviewer localhost::5901" will connect right up through that ssh tunnel (also, ssh with the -g enables anyone to use your tunnel).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116828253084620599?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116828253084620599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116828253084620599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116828253084620599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116828253084620599'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2007/01/suse-102-64-bit-and-vmware-server.html' title='Suse 10.2 64-bit and VMWare Server'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116602428597381690</id><published>2006-12-13T08:37:00.000-07:00</published><updated>2006-12-13T08:38:42.793-07:00</updated><title type='text'>Javascript dialog libraries</title><content type='html'>We explored various available libraries for managing dialogs within the application. We wanted an easy-to-implement solution that was intuitive to the user and didn't bog down the browser when rendering. We looked into the following solutions:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://developer.yahoo.com/yui/"&gt;&lt;span class="icon"&gt;&lt;/span&gt;Yahoo UI&lt;/a&gt;: YUI is feature-rich, but you pay for it. In order to render dialogs there were (IIRC) 5 javascript files to include. It also appeared to be slower than the other solutions and was a serious amount of code for just opening a URL as a dialog. Wasn't too hard to ditch this after looking at the more simple solutions.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://particletree.com/features/lightbox-gone-wild/"&gt;&lt;span class="icon"&gt;&lt;/span&gt;Lightbox gone wild&lt;/a&gt;: We liked this solution, but was pretty confined in terms of usage. You basically create links with a lightbox-specific class and then the initialization code for the page activates those links to function as lightboxes. No doubt this is easy, but it posed a problem with dynamic pages. We had some page that were returning links via AJAX, which would then require us to manually call the lightbox initialize() in order for those new links to behave properly. Wasn't worth the effort for the little (though nifty) functionality that lightbox provided.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://www.wingo.com/dialogbox/"&gt;&lt;span class="icon"&gt;&lt;/span&gt;jt_appdialogs&lt;/a&gt;: This was a very simple solution, but seemed slow (moving around the dialog) and not very friendly to fetching URLs (designed for rendering divs already in the page).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://www.subimage.com/dhtml/subModal/"&gt;&lt;span class="icon"&gt;&lt;/span&gt;submodal&lt;/a&gt;: Another rather simple solution, but limited in functionality. Couldn't move the dialog around, though that's supposed to be doable. We also had issues in getting the right sizes.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://prototype-window.xilinus.com/"&gt;&lt;span class="icon"&gt;&lt;/span&gt;prototype window class&lt;/a&gt;: Of all the solutions, this was the easiest to implement, provides a very intuitive user experience, is well-documented and simple to use. &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116602428597381690?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116602428597381690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116602428597381690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116602428597381690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116602428597381690'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/12/javascript-dialog-libraries.html' title='Javascript dialog libraries'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116542250520340659</id><published>2006-12-06T09:28:00.000-07:00</published><updated>2006-12-06T09:28:26.270-07:00</updated><title type='text'>testing issues with threaded ActiveRecord commits</title><content type='html'>I need to create a more generalized test in order to better exhibit the problems I experienced when spinning up a bunch of threads that all accessed a synchronized block of code that invoked ActiveRecord::Base#save &amp; ActiveRecord::Base#destroy with use_transactional_fixtures = true. Below is the investigation and conversation with Jamis:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(12:27:33) russ: Jamis, can I plead with you yet again for more assistance? Name your price.&lt;br /&gt;(12:31:34) jamisbuck: haha :) what's up?&lt;br /&gt;(12:32:06) russ: I'm having some deadlocking issues with some thread-safe code I'm _attempting_ to write, and I've narrowed my issue to what I'm doing with ActiveRecord&lt;br /&gt;(12:32:13) russ: here's the test:&lt;br /&gt;(12:32:18) russ: &lt;br /&gt;def test_provider_is_threadsafe&lt;br /&gt;    Thread.abort_on_exception = true&lt;br /&gt;&lt;br /&gt;    @ids = []&lt;br /&gt;    threads = []&lt;br /&gt;    &lt;br /&gt;    #obtain three threads, each getting 10 ids&lt;br /&gt;    begin&lt;br /&gt;      3.times do&lt;br /&gt;        &lt;br /&gt;        thread = Thread.new do&lt;br /&gt;          10.times do&lt;br /&gt;            sleep(0.2)&lt;br /&gt;            id = IdServiceHelper.instance.next_id&lt;br /&gt;&lt;br /&gt;            if (@ids.include?(id))&lt;br /&gt;              fail("Duplicate ID!")&lt;br /&gt;            else&lt;br /&gt;              @ids &lt;&lt; id&lt;br /&gt;            end&lt;br /&gt;            &lt;br /&gt;          end&lt;br /&gt;        end&lt;br /&gt;        threads &lt;&lt; thread&lt;br /&gt;&lt;br /&gt;      end&lt;br /&gt;    threads.each {|thread| thread.join}&lt;br /&gt;      &lt;br /&gt;    rescue Exception =&gt; ex&lt;br /&gt;     fail("Exception raised! " + ex.message + ex.backtrace.join("\n"))&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;(12:32:39) russ: and the culprit code is this:&lt;br /&gt;(12:32:45) russ: &lt;br /&gt;def next_id&lt;br /&gt;    &lt;br /&gt;    next_id = -1&lt;br /&gt;&lt;br /&gt;    synchronize do&lt;br /&gt;      #get the next seed&lt;br /&gt;      orig_seed = Seed.new&lt;br /&gt;      orig_seed.save&lt;br /&gt;      seed_val = orig_seed.id&lt;br /&gt;      &lt;br /&gt;      #destroy the used seed&lt;br /&gt;      orig_seed.destroy      &lt;br /&gt;   &lt;br /&gt;      next_id = @@provider_class.id_for_seed(seed_val)&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    return next_id&lt;br /&gt;  end&lt;br /&gt;(12:33:04) russ: however, when I run the tests I get deadlock errors&lt;br /&gt;(12:33:10) russ: and I've spent several hours trying different variations&lt;br /&gt;(12:33:19) jamisbuck: what does the 'synchronize' method look like?&lt;br /&gt;(12:33:39) russ: mixing in MonitorMixin&lt;br /&gt;(12:33:54) russ: if I remove the .save and .destroy on the Seed models then my deadlocks disappear&lt;br /&gt;(12:33:58) russ: but of course that fails the test&lt;br /&gt;(12:34:14) jamisbuck: deadlocks from where?&lt;br /&gt;(12:34:15) jamisbuck: AR?&lt;br /&gt;(12:34:33) russ: that's my issue, not sure exactly&lt;br /&gt;(12:34:39) jamisbuck: can you show me the error?&lt;br /&gt;(12:34:41) russ: Loaded suite test/unit/id/id_service_helper_test&lt;br /&gt;Started&lt;br /&gt;.deadlock 0xb7d73748: sleep:J(0xb73e2204) (main) - test/unit/id/id_service_helper_test.rb:57&lt;br /&gt;deadlock 0xb73e1a0c: sleep:-  - /usr/lib/ruby/1.8/thread.rb:100&lt;br /&gt;deadlock 0xb73e209c: sleep:-  - /usr/lib/ruby/1.8/monitor.rb:266&lt;br /&gt;deadlock 0xb73e2204: sleep:-  - /usr/lib/ruby/1.8/monitor.rb:266&lt;br /&gt;&lt;br /&gt;(12:34:46) jamisbuck: ok, not AR&lt;br /&gt;(12:35:03) jamisbuck: what's your OS?&lt;br /&gt;(12:35:05) jamisbuck: and ruby version?&lt;br /&gt;(12:35:06) russ: Gentoo&lt;br /&gt;(12:35:13) russ: 1.8.4&lt;br /&gt;(12:35:47) russ: so even if I remove the synchronization block, which I have done, I get the same errors&lt;br /&gt;(12:35:47) jamisbuck: where is MonitorMixin defined?&lt;br /&gt;(12:35:55) jamisbuck: is that in the stdlib?&lt;br /&gt;(12:35:57) russ: think so&lt;br /&gt;(12:36:12) jamisbuck: ok, I see it&lt;br /&gt;(12:36:21) jamisbuck: to be honest, I've never used monitor mixin&lt;br /&gt;(12:36:24) jamisbuck: I always just do&lt;br /&gt;(12:36:26) jamisbuck: require 'thread'&lt;br /&gt;(12:36:29) jamisbuck: mutex = Mutex.new&lt;br /&gt;(12:36:34) jamisbuck: mutex.synchronize { ... }&lt;br /&gt;(12:36:37) russ: done that too&lt;br /&gt;(12:36:38) russ: same results&lt;br /&gt;(12:36:39) russ: :(&lt;br /&gt;(12:36:54) russ: perhaps I should approach this differently&lt;br /&gt;(12:37:03) jamisbuck: it's almost like Seed#save or Seed#destroy are trying to do something thread-wise&lt;br /&gt;(12:37:11) russ: right, my thoughts also&lt;br /&gt;(12:37:17) russ: I already have  ActiveRecord::Base.allow_concurrency = true&lt;br /&gt;(12:37:22) russ: which I thought would solve my problem&lt;br /&gt;(12:37:29) russ: (since there is an underlying "freeze")&lt;br /&gt;(12:37:33) jamisbuck: well&lt;br /&gt;(12:37:37) jamisbuck: that only allows multiple connections&lt;br /&gt;(12:37:42) jamisbuck: one per thread&lt;br /&gt;(12:37:44) russ: gotcha&lt;br /&gt;(12:37:46) jamisbuck: AR is not thread-safe&lt;br /&gt;(12:37:48) jamisbuck: by itself&lt;br /&gt;(12:37:58) jamisbuck: but still&lt;br /&gt;(12:38:03) jamisbuck: save/destroy shouldn't be problematic&lt;br /&gt;(12:38:17) russ: k, so if I approach this differently, the problem being that I want to fetch a new Seed, get the id and then destroy it&lt;br /&gt;(12:38:36) russ: and lock anything else from getting the same value&lt;br /&gt;(12:38:38) russ: any other ideas?&lt;br /&gt;(12:38:42) jamisbuck: is your ruby version built with phtread support?&lt;br /&gt;(12:38:50) russ: good question, I'll check&lt;br /&gt;(12:39:23) russ: there is a USE flag for -threads&lt;br /&gt;(12:39:31) russ: not sure if I have it enabled or not&lt;br /&gt;(12:39:38) jamisbuck: k, well, you don't want it, regardless&lt;br /&gt;(12:39:42) russ: k&lt;br /&gt;(12:39:49) jamisbuck: try looking at what the ruby binary is linked against&lt;br /&gt;(12:39:51) jamisbuck: ldd&lt;br /&gt;(12:40:10) russ: ldd /usr/bin/ruby&lt;br /&gt;        linux-gate.so.1 =&gt;  (0xffffe000)&lt;br /&gt;        libruby18.so.1.8 =&gt; /usr/lib/libruby18.so.1.8 (0xb7e3b000)&lt;br /&gt;        libdl.so.2 =&gt; /lib/libdl.so.2 (0xb7e21000)&lt;br /&gt;        libcrypt.so.1 =&gt; /lib/libcrypt.so.1 (0xb7df3000)&lt;br /&gt;        libm.so.6 =&gt; /lib/tls/libm.so.6 (0xb7dd0000)&lt;br /&gt;        libc.so.6 =&gt; /lib/tls/libc.so.6 (0xb7cb6000)&lt;br /&gt;        /lib/ld-linux.so.2 (0xb7f05000)&lt;br /&gt;(12:40:17) jamisbuck: k, looks good&lt;br /&gt;(12:40:35) jamisbuck: I really have no idea on this&lt;br /&gt;(12:40:49) russ: then maybe the issue is that freeze I saw&lt;br /&gt;(12:40:51) jamisbuck: this is outside my area of expertise&lt;br /&gt;(12:41:11) russ: well you've broadened my horizons&lt;br /&gt;(12:41:15) jamisbuck: :)&lt;br /&gt;(12:41:18) russ: I'll keep digging in&lt;br /&gt;(12:41:22) jamisbuck: k, good luck&lt;br /&gt;(12:41:31) russ: you let me know if you have an Amazon list&lt;br /&gt;(12:41:39) jamisbuck: :) I don't, but thanks anyway&lt;br /&gt;(12:41:43) russ: your time is valuable and I appreciate the info&lt;br /&gt;(12:41:53) jamisbuck: fwiw, ruby threads are awful..if at all possible, you should consider using fork instead&lt;br /&gt;(12:41:59) jamisbuck: not always possible, but definitely preferable&lt;br /&gt;(12:42:04) russ: that's good to know&lt;br /&gt;(12:42:06) russ: I'll explore that also&lt;br /&gt;(12:42:12) russ: have a good one&lt;br /&gt;(12:42:15) jamisbuck: you too&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I changed my code to try a more sql-native approach with the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      #version 2&lt;br /&gt;&lt;br /&gt;       connection = ActiveRecord::Base.connection&lt;br /&gt;&lt;br /&gt;       orig_seed_val = Seed.find(:first).id&lt;br /&gt;       connection.begin_db_transaction&lt;br /&gt;      &lt;br /&gt;       seed_val = orig_seed_val+1&lt;br /&gt;       connection.delete("delete from seeds where id=#{orig_seed_val};");&lt;br /&gt;       connection.commit_db_transaction&lt;br /&gt;       Seed.connection.execute("insert into seeds values(#{seed_val});");&lt;br /&gt;&lt;br /&gt;       next_id = @@provider_class.id_for_seed(seed_val)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Using this method I was then getting a native MySQL error regarding a lock timeout. This was curious and lead to the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(14:05:01) russ: wanna hear the gruesome details?&lt;br /&gt;(14:05:20) jamisbuck: let's hear it&lt;br /&gt;(14:05:38) russ: the locking was at the MySQL level&lt;br /&gt;(14:05:48) russ: I tried to bypass AR&lt;br /&gt;(14:05:53) russ: and execute straight sql&lt;br /&gt;(14:06:03) russ: only to get a Lock timeout from mysql&lt;br /&gt;(14:06:12) russ: investigated by "show innodb status"&lt;br /&gt;(14:06:20) russ: and it gave me the locks/threads&lt;br /&gt;(14:06:25) russ: followed that to my log&lt;br /&gt;(14:06:30) russ: and whattayaknow&lt;br /&gt;(14:06:40) jamisbuck: really! the exception you posted didn't look like one from the database, so I discarded that hypothesis&lt;br /&gt;(14:06:48) russ: well, here's the culprit: self.use_transactional_fixtures = true&lt;br /&gt;(14:07:24) jamisbuck: ah, ok&lt;br /&gt;(14:07:26) jamisbuck: very wierd&lt;br /&gt;(14:07:27) russ: the top level transaction had the lock!&lt;br /&gt;(14:07:28) jamisbuck: what mysql version?&lt;br /&gt;(14:07:57) russ:  Gentoo Linux mysql-4.1.20&lt;br /&gt;(14:08:05) jamisbuck: wierd! good catch&lt;br /&gt;(14:08:13) russ: anyhow, changing back and then using AR&lt;br /&gt;(14:08:15) russ: everything is good again&lt;br /&gt;(14:08:21) jamisbuck: awesome, glad to hear it&lt;br /&gt;(14:08:27) russ: so I lose, for that specific test, the benefits of transactional fixtures&lt;br /&gt;(14:08:30) russ: oh well it's a toss up&lt;br /&gt;(14:08:34) jamisbuck: yah&lt;br /&gt;(14:08:43) jamisbuck: if your test uses transactions, you can't use transactional fixtures&lt;br /&gt;(14:08:46) russ: so I suppose the theory learned is:&lt;br /&gt;(14:09:03) russ: you can't write your own thread-safe code using AR in a test with self.use_transactional_fixtures=true&lt;br /&gt;(14:09:19) jamisbuck: well, not even thread-safe&lt;br /&gt;(14:09:21) jamisbuck: transactional&lt;br /&gt;(14:09:23) russ: right&lt;br /&gt;(14:09:27) russ: anyhow, back to work&lt;br /&gt;(14:09:30) jamisbuck: cool beans&lt;br /&gt;(14:09:32) jamisbuck: good find&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116542250520340659?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116542250520340659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116542250520340659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116542250520340659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116542250520340659'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/12/testing-issues-with-threaded.html' title='testing issues with threaded ActiveRecord commits'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116533399705301199</id><published>2006-12-05T08:48:00.000-07:00</published><updated>2006-12-05T08:53:17.430-07:00</updated><title type='text'>deadlocks and ActiveRecord</title><content type='html'>According to &lt;a href="http://wiki.rubyonrails.org/rails/pages/ActiveRecord"&gt;this&lt;/a&gt; ActiveRecord is thread-safe. Turns out that I have some code for multithreaded identifier generation and since the seed is from the db, I &lt;strong&gt;must&lt;/strong&gt; have thread-safe db interaction through ActiveRecord. My tests kept puking with deadlocks and I narrowed it down to the save/destroy operations on the model. Found &lt;a href="http://lists.rubyonrails.org/pipermail/rails/2006-July/052040.html"&gt;this post&lt;/a&gt; which contained my answer:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    ActiveRecord::Base.allow_concurrency = true&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The kicker here is that this is never mentioned in the API docs...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116533399705301199?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116533399705301199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116533399705301199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116533399705301199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116533399705301199'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/12/deadlocks-and-activerecord.html' title='deadlocks and ActiveRecord'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116482395477767149</id><published>2006-11-29T11:06:00.000-07:00</published><updated>2006-11-29T11:23:31.210-07:00</updated><title type='text'>self-signing certs in iis 6</title><content type='html'>Easiest way to do this is to download the &lt;a href="http://support.microsoft.com/kb/840671"&gt;IIS 6 Resource Kit Tools&lt;/a&gt;. Then find the site's id that will be assigned the cert. Search for the site's name in %SystemRoot%\System32\Inetsrv\MetaBase.xml, the id is the number appended in the Location attribute. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;IIsWebServer Location="/LM/W3SVC/445577612" AuthFlags="0" &lt;br /&gt;LogPluginClsid="{FF160663-DE82-11CF-BC0A-00AA006111E0}" SecureBindings=":443:" &lt;br /&gt;ServerAutoStart="FALSE" ServerBindings=":80: 192.168.88.62:80:" ServerComment="testsite" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The id here is 445577612.&lt;br /&gt;&lt;br /&gt;Then, the command to assign the self-signed cert is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;C:\Program Files\IIS Resources\SelfSSL&gt;selfssl.exe /N:CN=SERV2003DEV /K:1024 /V:700 /S:445577612 /P:443&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Where CN is the server's name, K is the key length, V is the number of days the cert is valid, S is the site id, P is the port.&lt;br /&gt;&lt;br /&gt;I did this on Windows 2003 Server, so no idea if it works in XP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116482395477767149?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116482395477767149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116482395477767149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116482395477767149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116482395477767149'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/11/self-signing-certs-in-iis-6.html' title='self-signing certs in iis 6'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116476040426116975</id><published>2006-11-28T17:32:00.000-07:00</published><updated>2006-11-28T17:55:40.913-07:00</updated><title type='text'>loading a cert into IIS 6 w/o a pending request</title><content type='html'>Thank you TechNet:&lt;br /&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/53dfdb5e-6106-4d99-85bb-da199bc27c7e.mspx?mfr=true&lt;br /&gt;&lt;br /&gt;Basically all that is needed is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;certutil -addstore my certnew.cer&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And then it'll appear in the "Assign an Existing Certificate" wizard selection and be available for selection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116476040426116975?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116476040426116975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116476040426116975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116476040426116975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116476040426116975'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/11/loading-cert-into-iis-6-wo-pending.html' title='loading a cert into IIS 6 w/o a pending request'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116365042650921925</id><published>2006-11-15T21:11:00.000-07:00</published><updated>2006-11-15T21:13:50.886-07:00</updated><title type='text'>ActiveRecord in .Net</title><content type='html'>I'm using ActiveRecord in .Net for a school project. And it's making db interaction somewhat bearable. Coming from a Hibernate/ActiveRecord background, this is a breath of fresh air. Never been a fan of the data-mapper/set and stored proc that MS is so up on. Thanks to the Castle (http://castleproject.org/) guys for putting this together, it's very simple to get up and running and I found it _far_ easier to understand their tutorial than any of the NHibernate ones. Their blog app is a piece of cake to understand and runs out of the box (granted you have have a "test" db created). &lt;br /&gt;&lt;br /&gt;The biggest issue I had was connecting to SQLServer Express 2005. Here's the connection string I ended up using:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Server=127.0.0.1,1433;Database=patstracks;Integrated Security=SSPI&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;ActiveRecord really makes it easy to decorate POCOs using attributes:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[ActiveRecord("[Client]")]&lt;br /&gt;&lt;br /&gt;    public class Client : ActiveRecordBase{&lt;br /&gt;...&lt;br /&gt; [PrimaryKey]&lt;br /&gt;&lt;br /&gt;        public int Id&lt;br /&gt;&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            get { return id; }&lt;br /&gt;&lt;br /&gt;            set { id = value; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;...&lt;br /&gt;public static Client[] FindByNameLike(string name)&lt;br /&gt;&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            return (Client[])Client.FindAll(typeof(Client), new Order[] {Order.Asc("Name") }, new ICriterion[] { Expression.Like("Name", name+"%")});&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116365042650921925?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116365042650921925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116365042650921925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116365042650921925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116365042650921925'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/11/activerecord-in-net.html' title='ActiveRecord in .Net'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116241538427130024</id><published>2006-11-01T14:04:00.000-07:00</published><updated>2006-11-15T21:15:54.910-07:00</updated><title type='text'>in place phone editor via Ajax</title><content type='html'>UPDATE: I went about this the wrong way. Should've just overridden the necessary methods. I'll do it and replace this when I'm done.&lt;br /&gt;&lt;br /&gt;Morphed the InPlaceEditor and made it more friendly for handling phone number entry:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;// script.aculo.us controls.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006&lt;br /&gt;&lt;br /&gt;// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)&lt;br /&gt;//           (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)&lt;br /&gt;//           (c) 2005 Jon Tirsen (http://www.tirsen.com)&lt;br /&gt;// Contributors:&lt;br /&gt;//  Richard Livsey&lt;br /&gt;//  Rahul Bhargava&lt;br /&gt;//  Rob Wills&lt;br /&gt;//  &lt;br /&gt;// See scriptaculous.js for full license.&lt;br /&gt;/*&lt;br /&gt; *Only tested via  load_text url&lt;br /&gt; *Parses for extension on '$'&lt;br /&gt; *Returns input as phone_value and ext_value&lt;br /&gt;*/&lt;br /&gt;Ajax.InPlacePhoneEditor = Class.create();&lt;br /&gt;Ajax.InPlacePhoneEditor.defaultHighlightColor = "#FFFF99";&lt;br /&gt;Ajax.InPlacePhoneEditor.prototype = {&lt;br /&gt;  initialize: function(element, url, options) {&lt;br /&gt;    this.url = url;&lt;br /&gt;    this.element = $(element);&lt;br /&gt;&lt;br /&gt;    this.options = Object.extend({&lt;br /&gt;      okButton: true,&lt;br /&gt;      okText: "ok",&lt;br /&gt;      cancelLink: true,&lt;br /&gt;      cancelText: "cancel",&lt;br /&gt;      savingText: "Saving...",&lt;br /&gt;      clickToEditText: "Click to edit",&lt;br /&gt;      okText: "ok",&lt;br /&gt;      rows: 1,&lt;br /&gt;      onComplete: function(transport, element) {&lt;br /&gt;        new Effect.Highlight(element, {startcolor: this.options.highlightcolor});&lt;br /&gt;      },&lt;br /&gt;      onFailure: function(transport) {&lt;br /&gt;        alert("Error communicating with the server: " + transport.responseText.stripTags());&lt;br /&gt;      },&lt;br /&gt;      callback: function(form) {&lt;br /&gt;        return Form.serialize(form);&lt;br /&gt;      },&lt;br /&gt;      handleLineBreaks: true,&lt;br /&gt;      loadingText: 'Loading...',&lt;br /&gt;      savingClassName: 'inplaceeditor-saving',&lt;br /&gt;      loadingClassName: 'inplaceeditor-loading',&lt;br /&gt;      formClassName: 'inplaceeditor-form',&lt;br /&gt;      highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor,&lt;br /&gt;      highlightendcolor: "#FFFFFF",&lt;br /&gt;      externalControl: null,&lt;br /&gt;      submitOnBlur: false,&lt;br /&gt;      ajaxOptions: {},&lt;br /&gt;      evalScripts: false&lt;br /&gt;    }, options || {});&lt;br /&gt;&lt;br /&gt;    if(!this.options.formId &amp;&amp; this.element.id) {&lt;br /&gt;      this.options.formId = this.element.id + "-inplaceeditor";&lt;br /&gt;      if ($(this.options.formId)) {&lt;br /&gt;        // there's already a form with that name, don't specify an id&lt;br /&gt;        this.options.formId = null;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (this.options.externalControl) {&lt;br /&gt;      this.options.externalControl = $(this.options.externalControl);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    this.originalBackground = Element.getStyle(this.element, 'background-color');&lt;br /&gt;    if (!this.originalBackground) {&lt;br /&gt;      this.originalBackground = "transparent";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    this.element.title = this.options.clickToEditText;&lt;br /&gt;&lt;br /&gt;    this.onclickListener = this.enterEditMode.bindAsEventListener(this);&lt;br /&gt;    this.mouseoverListener = this.enterHover.bindAsEventListener(this);&lt;br /&gt;    this.mouseoutListener = this.leaveHover.bindAsEventListener(this);&lt;br /&gt;    Event.observe(this.element, 'click', this.onclickListener);&lt;br /&gt;    Event.observe(this.element, 'mouseover', this.mouseoverListener);&lt;br /&gt;    Event.observe(this.element, 'mouseout', this.mouseoutListener);&lt;br /&gt;    if (this.options.externalControl) {&lt;br /&gt;      Event.observe(this.options.externalControl, 'click', this.onclickListener);&lt;br /&gt;      Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener);&lt;br /&gt;      Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener);&lt;br /&gt;    }&lt;br /&gt;  },&lt;br /&gt;  enterEditMode: function(evt) {&lt;br /&gt;    if (this.saving) return;&lt;br /&gt;    if (this.editing) return;&lt;br /&gt;    this.editing = true;&lt;br /&gt;    this.onEnterEditMode();&lt;br /&gt;    if (this.options.externalControl) {&lt;br /&gt;      Element.hide(this.options.externalControl);&lt;br /&gt;    }&lt;br /&gt;    Element.hide(this.element);&lt;br /&gt;    this.createForm();&lt;br /&gt;    this.element.parentNode.insertBefore(this.form, this.element);&lt;br /&gt;    if (!this.options.loadTextURL){&lt;br /&gt;      Field.scrollFreeActivate(this.editField);&lt;br /&gt;    }&lt;br /&gt;    // stop the event to avoid a page refresh in Safari&lt;br /&gt;    if (evt) {&lt;br /&gt;      Event.stop(evt);&lt;br /&gt;    }&lt;br /&gt;    return false;&lt;br /&gt;  },&lt;br /&gt;  createForm: function() {&lt;br /&gt;    this.form = document.createElement("form");&lt;br /&gt;    this.form.id = this.options.formId;&lt;br /&gt;    Element.addClassName(this.form, this.options.formClassName)&lt;br /&gt;    this.form.onsubmit = this.onSubmit.bind(this);&lt;br /&gt;&lt;br /&gt;    this.createEditField();&lt;br /&gt;&lt;br /&gt;    if (this.options.textarea) {&lt;br /&gt;      var br = document.createElement("br");&lt;br /&gt;      this.form.appendChild(br);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (this.options.okButton) {&lt;br /&gt;      okButton = document.createElement("input");&lt;br /&gt;      okButton.type = "submit";&lt;br /&gt;      okButton.value = this.options.okText;&lt;br /&gt;      okButton.className = 'editor_ok_button';&lt;br /&gt;      this.form.appendChild(okButton);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (this.options.cancelLink) {&lt;br /&gt;      cancelLink = document.createElement("a");&lt;br /&gt;      cancelLink.href = "#";&lt;br /&gt;      cancelLink.appendChild(document.createTextNode(this.options.cancelText));&lt;br /&gt;      cancelLink.onclick = this.onclickCancel.bind(this);&lt;br /&gt;      cancelLink.className = 'editor_cancel';&lt;br /&gt;      this.form.appendChild(cancelLink);&lt;br /&gt;    }&lt;br /&gt;  },&lt;br /&gt;  hasHTMLLineBreaks: function(string) {&lt;br /&gt;    if (!this.options.handleLineBreaks) return false;&lt;br /&gt;    return string.match(/&amp;lt;br/i) || string.match(/&amp;lt;p&amp;gt;/i);&lt;br /&gt;  },&lt;br /&gt;  convertHTMLLineBreaks: function(string) {&lt;br /&gt;    return string.replace(/&amp;lt;br&amp;gt;/gi, "\n").replace(/&amp;lt;br\/&amp;gt;/gi, "\n").replace(/&amp;lt;\/p&amp;gt;/gi, "\n").replace(/&amp;lt;p&amp;gt;/gi, "");&lt;br /&gt;  },&lt;br /&gt;  createEditField: function() {&lt;br /&gt;    var text;&lt;br /&gt;    if(this.options.loadTextURL) {&lt;br /&gt;      text = this.options.loadingText;&lt;br /&gt;    } else {&lt;br /&gt;      text = this.getText();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    var obj = this;&lt;br /&gt;&lt;br /&gt;    if (this.options.rows == 1 &amp;&amp; !this.hasHTMLLineBreaks(text)) {&lt;br /&gt;      this.options.textarea = false;&lt;br /&gt;      var textField = document.createElement("input");&lt;br /&gt;      textField.obj = this;&lt;br /&gt;      textField.type = "text";&lt;br /&gt;      textField.name = "phone_value";&lt;br /&gt;      textField.value = text;&lt;br /&gt;      textField.style.backgroundColor = this.options.highlightcolor;&lt;br /&gt;      textField.className = 'editor_field';&lt;br /&gt;&lt;br /&gt;      var size = 20;&lt;br /&gt;      if (size != 0) textField.size = size;&lt;br /&gt;      if (this.options.submitOnBlur)&lt;br /&gt;        textField.onblur = this.onSubmit.bind(this);&lt;br /&gt;      textField.maxLength = size;&lt;br /&gt;      this.editField_phone = textField;&lt;br /&gt;&lt;br /&gt;      var textField = document.createElement("input");&lt;br /&gt;      textField.obj = this;&lt;br /&gt;      textField.type = "text";&lt;br /&gt;      textField.name = "ext_value";&lt;br /&gt;      textField.value = text;&lt;br /&gt;      textField.style.backgroundColor = this.options.highlightcolor;&lt;br /&gt;      textField.className = 'editor_field';&lt;br /&gt;      var size = 6;&lt;br /&gt;      if (size != 0) textField.size = size;&lt;br /&gt;      if (this.options.submitOnBlur)&lt;br /&gt;        textField.onblur = this.onSubmit.bind(this);&lt;br /&gt;      textField.maxLength = size;&lt;br /&gt;      this.editField_ext = textField;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if(this.options.loadTextURL) {&lt;br /&gt;      this.loadExternalText();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    this.form.appendChild(this.editField_phone);&lt;br /&gt;    this.form.appendChild(document.createTextNode(" ext."));&lt;br /&gt;    this.form.appendChild(this.editField_ext);&lt;br /&gt;  },&lt;br /&gt;  getText: function() {&lt;br /&gt;    return this.element.innerHTML;&lt;br /&gt;  },&lt;br /&gt;  loadExternalText: function() {&lt;br /&gt;    Element.addClassName(this.form, this.options.loadingClassName);&lt;br /&gt;    this.editField_phone.disabled = true;&lt;br /&gt;    this.editField_ext.disabled = true;&lt;br /&gt;&lt;br /&gt;    new Ajax.Request(&lt;br /&gt;      this.options.loadTextURL,&lt;br /&gt;      Object.extend({&lt;br /&gt;        asynchronous: true,&lt;br /&gt;        onComplete: this.onLoadedExternalText.bind(this)&lt;br /&gt;      }, this.options.ajaxOptions)&lt;br /&gt;    );&lt;br /&gt;  },&lt;br /&gt;  onLoadedExternalText: function(transport) {&lt;br /&gt;    Element.removeClassName(this.form, this.options.loadingClassName);&lt;br /&gt;    this.editField_phone.disabled = false;&lt;br /&gt;    this.editField_ext.disabled = false;&lt;br /&gt;&lt;br /&gt;    var load_values = transport.responseText.stripTags().split("$");&lt;br /&gt;    if((load_values.length == 1) || (load_values.length == 2)){&lt;br /&gt;      this.editField_phone.value = load_values[0];&lt;br /&gt;      if(load_values.length == 2 ){&lt;br /&gt;        this.editField_ext.value = load_values[1]&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    Field.scrollFreeActivate(this.editField_phone);&lt;br /&gt;    Field.scrollFreeActivate(this.editField_ext);&lt;br /&gt;  },&lt;br /&gt;  onclickCancel: function() {&lt;br /&gt;    this.onComplete();&lt;br /&gt;    this.leaveEditMode();&lt;br /&gt;    return false;&lt;br /&gt;  },&lt;br /&gt;  onFailure: function(transport) {&lt;br /&gt;    this.options.onFailure(transport);&lt;br /&gt;    if (this.oldInnerHTML) {&lt;br /&gt;      this.element.innerHTML = this.oldInnerHTML;&lt;br /&gt;      this.oldInnerHTML = null;&lt;br /&gt;    }&lt;br /&gt;    return false;&lt;br /&gt;  },&lt;br /&gt;  onSubmit: function() {&lt;br /&gt;    // onLoading resets these so we need to save them away for the Ajax call&lt;br /&gt;    var form = this.form;&lt;br /&gt;    var value = this.editField_phone.value + "$" + this.editField_ext.value;&lt;br /&gt;&lt;br /&gt;    // do this first, sometimes the ajax call returns before we get a chance to switch on Saving...&lt;br /&gt;    // which means this will actually switch on Saving... *after* we've left edit mode causing Saving...&lt;br /&gt;    // to be displayed indefinitely&lt;br /&gt;    this.onLoading();&lt;br /&gt;&lt;br /&gt;    if (this.options.evalScripts) {&lt;br /&gt;      new Ajax.Request(&lt;br /&gt;        this.url, Object.extend({&lt;br /&gt;          parameters: this.options.callback(form, value),&lt;br /&gt;          onComplete: this.onComplete.bind(this),&lt;br /&gt;          onFailure: this.onFailure.bind(this),&lt;br /&gt;          asynchronous:true,&lt;br /&gt;          evalScripts:true&lt;br /&gt;        }, this.options.ajaxOptions));&lt;br /&gt;    } else  {&lt;br /&gt;      new Ajax.Updater(&lt;br /&gt;        { success: this.element,&lt;br /&gt;          // don't update on failure (this could be an option)&lt;br /&gt;          failure: null },&lt;br /&gt;        this.url, Object.extend({&lt;br /&gt;          parameters: this.options.callback(form, value),&lt;br /&gt;          onComplete: this.onComplete.bind(this),&lt;br /&gt;          onFailure: this.onFailure.bind(this)&lt;br /&gt;        }, this.options.ajaxOptions));&lt;br /&gt;    }&lt;br /&gt;    // stop the event to avoid a page refresh in Safari&lt;br /&gt;    if (arguments.length &amp;gt; 1) {&lt;br /&gt;      Event.stop(arguments[0]);&lt;br /&gt;    }&lt;br /&gt;    return false;&lt;br /&gt;  },&lt;br /&gt;  onLoading: function() {&lt;br /&gt;    this.saving = true;&lt;br /&gt;    this.removeForm();&lt;br /&gt;    this.leaveHover();&lt;br /&gt;    this.showSaving();&lt;br /&gt;  },&lt;br /&gt;  showSaving: function() {&lt;br /&gt;    this.oldInnerHTML = this.element.innerHTML;&lt;br /&gt;    this.element.innerHTML = this.options.savingText;&lt;br /&gt;    Element.addClassName(this.element, this.options.savingClassName);&lt;br /&gt;    this.element.style.backgroundColor = this.originalBackground;&lt;br /&gt;    Element.show(this.element);&lt;br /&gt;  },&lt;br /&gt;  removeForm: function() {&lt;br /&gt;    if(this.form) {&lt;br /&gt;      if (this.form.parentNode) Element.remove(this.form);&lt;br /&gt;      this.form = null;&lt;br /&gt;    }&lt;br /&gt;  },&lt;br /&gt;  enterHover: function() {&lt;br /&gt;    if (this.saving) return;&lt;br /&gt;    this.element.style.backgroundColor = this.options.highlightcolor;&lt;br /&gt;    if (this.effect) {&lt;br /&gt;      this.effect.cancel();&lt;br /&gt;    }&lt;br /&gt;    Element.addClassName(this.element, this.options.hoverClassName)&lt;br /&gt;  },&lt;br /&gt;  leaveHover: function() {&lt;br /&gt;    if (this.options.backgroundColor) {&lt;br /&gt;      this.element.style.backgroundColor = this.oldBackground;&lt;br /&gt;    }&lt;br /&gt;    Element.removeClassName(this.element, this.options.hoverClassName)&lt;br /&gt;    if (this.saving) return;&lt;br /&gt;    this.effect = new Effect.Highlight(this.element, {&lt;br /&gt;      startcolor: this.options.highlightcolor,&lt;br /&gt;      endcolor: this.options.highlightendcolor,&lt;br /&gt;      restorecolor: this.originalBackground&lt;br /&gt;    });&lt;br /&gt;  },&lt;br /&gt;  leaveEditMode: function() {&lt;br /&gt;    Element.removeClassName(this.element, this.options.savingClassName);&lt;br /&gt;    this.removeForm();&lt;br /&gt;    this.leaveHover();&lt;br /&gt;    this.element.style.backgroundColor = this.originalBackground;&lt;br /&gt;    Element.show(this.element);&lt;br /&gt;    if (this.options.externalControl) {&lt;br /&gt;      Element.show(this.options.externalControl);&lt;br /&gt;    }&lt;br /&gt;    this.editing = false;&lt;br /&gt;    this.saving = false;&lt;br /&gt;    this.oldInnerHTML = null;&lt;br /&gt;    this.onLeaveEditMode();&lt;br /&gt;  },&lt;br /&gt;  onComplete: function(transport) {&lt;br /&gt;    this.leaveEditMode();&lt;br /&gt;    this.options.onComplete.bind(this)(transport, this.element);&lt;br /&gt;  },&lt;br /&gt;  onEnterEditMode: function() {},&lt;br /&gt;  onLeaveEditMode: function() {},&lt;br /&gt;  dispose: function() {&lt;br /&gt;    if (this.oldInnerHTML) {&lt;br /&gt;      this.element.innerHTML = this.oldInnerHTML;&lt;br /&gt;    }&lt;br /&gt;    this.leaveEditMode();&lt;br /&gt;    Event.stopObserving(this.element, 'click', this.onclickListener);&lt;br /&gt;    Event.stopObserving(this.element, 'mouseover', this.mouseoverListener);&lt;br /&gt;    Event.stopObserving(this.element, 'mouseout', this.mouseoutListener);&lt;br /&gt;    if (this.options.externalControl) {&lt;br /&gt;      Event.stopObserving(this.options.externalControl, 'click', this.onclickListener);&lt;br /&gt;      Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener);&lt;br /&gt;      Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ajax.InPlacePhoneEditor.prototype.__initialize = Ajax.InPlaceEditor.prototype.initialize;&lt;br /&gt;Ajax.InPlacePhoneEditor.prototype.__getText = Ajax.InPlaceEditor.prototype.getText;&lt;br /&gt;Ajax.InPlacePhoneEditor.prototype.__onComplete = Ajax.InPlaceEditor.prototype.onComplete;&lt;br /&gt;Ajax.InPlacePhoneEditor.prototype = Object.extend(Ajax.InPlaceEditor.prototype, {&lt;br /&gt;&lt;br /&gt;    initialize: function(element, url, options){&lt;br /&gt;        this.__initialize(element,url,options)&lt;br /&gt;        this.setOptions(options);&lt;br /&gt;        this._checkEmpty();&lt;br /&gt;    },&lt;br /&gt;&lt;br /&gt;    setOptions: function(options){&lt;br /&gt;        this.options = Object.extend(Object.extend(this.options,{&lt;br /&gt;            emptyText: 'click to edit...',&lt;br /&gt;            emptyClassName: 'inplaceeditor-empty'&lt;br /&gt;        }),options||{});&lt;br /&gt;    },&lt;br /&gt;&lt;br /&gt;    _checkEmpty: function(){&lt;br /&gt;        if( this.element.innerHTML.length == 0 ){&lt;br /&gt;            this.element.appendChild(&lt;br /&gt;                Builder.node('span',{className:this.options.emptyClassName},this.options.emptyText));&lt;br /&gt;        }&lt;br /&gt;    },&lt;br /&gt;&lt;br /&gt;    getText: function(){&lt;br /&gt;        document.getElementsByClassName(this.options.emptyClassName,this.element).each(function(child){&lt;br /&gt;            this.element.removeChild(child);&lt;br /&gt;        }.bind(this));&lt;br /&gt;        return this.__getText();&lt;br /&gt;    },&lt;br /&gt;&lt;br /&gt;    onComplete: function(transport){&lt;br /&gt;        this._checkEmpty();&lt;br /&gt;        this.__onComplete(transport);&lt;br /&gt;    }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116241538427130024?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116241538427130024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116241538427130024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116241538427130024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116241538427130024'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/11/in-place-phone-editor-via-ajax.html' title='in place phone editor via Ajax'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116188047903292659</id><published>2006-10-26T10:32:00.000-06:00</published><updated>2006-10-26T10:34:40.766-06:00</updated><title type='text'>iterating an Enumerable just to create another array...</title><content type='html'>via ActiveSupport (thanks Jamis!):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;values.map(&amp;:name)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or the standard way&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;values.collect{|val| val.name}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116188047903292659?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116188047903292659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116188047903292659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116188047903292659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116188047903292659'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/iterating-enumerable-just-to-create.html' title='iterating an Enumerable just to create another array...'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116179723910565300</id><published>2006-10-25T11:26:00.000-06:00</published><updated>2006-10-25T11:27:19.280-06:00</updated><title type='text'>subversion and gse-locate.el</title><content type='html'>Updated this chunk in gse-locate.el:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(defvar gse-locate-regexp-list&lt;br /&gt;  (list "\\.elc"&lt;br /&gt;        "\\.class"&lt;br /&gt;        "/CVS"&lt;br /&gt;        "/target/classes"&lt;br /&gt;        "#"&lt;br /&gt;        "~"&lt;br /&gt;        ".cvsignore"&lt;br /&gt;        "/\.svn/"&lt;br /&gt;        )&lt;br /&gt;  "A list of regular expressions that match \"uninteresting\" filenames.&lt;br /&gt;These will be stripped from the locate list before it is displayed.")&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116179723910565300?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116179723910565300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116179723910565300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116179723910565300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116179723910565300'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/subversion-and-gse-locateel.html' title='subversion and gse-locate.el'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116179527784082952</id><published>2006-10-25T10:51:00.000-06:00</published><updated>2006-10-25T10:54:38.830-06:00</updated><title type='text'>pretty indenting HTML chunks in Emacs</title><content type='html'>After reading &lt;a href="http://www.dzr-web.com/people/darren/projects/emacs-webdev/"&gt;this&lt;/a&gt; and installing xmml and psgml, I can now indent a wildly formatted chunk of HTML with indent-region (in sgml-mode) and my buffer is then much more readable and formatted nicely. xmml modifies the faces in sgml-mode for much better readability and color identification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116179527784082952?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116179527784082952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116179527784082952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116179527784082952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116179527784082952'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/pretty-indenting-html-chunks-in-emacs.html' title='pretty indenting HTML chunks in Emacs'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116111871404901675</id><published>2006-10-17T14:56:00.000-06:00</published><updated>2006-10-17T14:58:34.316-06:00</updated><title type='text'>Dependency Inversion conversation with Jamis Buck</title><content type='html'>This conversation represents the sort of headache/transition in getting out of the strict OO mindset and contract-based programming that Ruby allows you to intuitively avoid:&lt;br /&gt;&lt;br /&gt;(14:45:35) russ: if you have a minute, gotta design question for you. I have an authentication component that I'd like to  turn into a service so it's interchangeable ala Hivemind. Would you recommend copland for doing that? At this point I only have two implementations of the service, but it makes sense to have more in the future...&lt;br /&gt;(14:45:59) jamisbuck: for ruby, I'd avoid DI implementations as a general rule&lt;br /&gt;(14:46:03) jamisbuck: ruby is flexible enough that you don't need them&lt;br /&gt;(14:46:11) russ: the alternative I could think of would be to create some sort of abstract base class and then extend as needed...though not sure how that would fit into Ruby's methodology&lt;br /&gt;(14:46:32) russ: I'm still stuck in j2ee thinking&lt;br /&gt;(14:46:40) jamisbuck: :) it took me two years to come around :)&lt;br /&gt;(14:46:49) russ: so recommendations for my issue?&lt;br /&gt;(14:47:02) jamisbuck: well, you could use a factory class&lt;br /&gt;(14:47:10) russ: two different classes, rely on some static class and put the logic in there to call the appropriately underlying?&lt;br /&gt;(14:47:11) jamisbuck: Foo.authentication_service&lt;br /&gt;(14:47:18) jamisbuck: sure&lt;br /&gt;(14:47:26) jamisbuck: without knowing all the details that sounds fine&lt;br /&gt;(14:47:30) jamisbuck: there may be an even simpler way to do it&lt;br /&gt;(14:47:39) russ: my problem is contracts: interfaces/abstract base classes&lt;br /&gt;(14:47:52) russ: how to move away from that yet make the Ruby code solid&lt;br /&gt;(14:47:54) jamisbuck: careful not to overthink the problem&lt;br /&gt;(14:48:01) jamisbuck: ruby encourages pragmatic solutions&lt;br /&gt;(14:48:20) jamisbuck: I know that when I was coming out of Javaland, I would frequently overlook the simple solutions because they were so simple :)&lt;br /&gt;(14:48:27) jamisbuck: that's not to say every problem has a simple solution&lt;br /&gt;(14:48:40) russ: indeed&lt;br /&gt;(14:48:49) russ: as usual, your feedback is highly valuable&lt;br /&gt;(14:48:52) russ: thanks Jamis!&lt;br /&gt;(14:48:53) russ: have a good one&lt;br /&gt;(14:48:56) jamisbuck: :) you too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116111871404901675?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116111871404901675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116111871404901675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116111871404901675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116111871404901675'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/dependency-inversion-conversation-with.html' title='Dependency Inversion conversation with Jamis Buck'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116066985203883513</id><published>2006-10-12T10:15:00.000-06:00</published><updated>2006-10-12T10:54:13.370-06:00</updated><title type='text'>middle-click selected text into Emacs</title><content type='html'>Since my conversion 18 months ago, I've been delaying my quest to find the solution for middle-clicking and getting my text from terminal into Emacs. After some chat in Freenode (thanks to twb)and looking in Google Groups, here's the solution I slapped into my .emacs:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(global-set-key (kbd "&lt;S-mouse2&gt;") (lambda () (interactive) (insert (x-get-selection 'PRIMARY 'COMPOUND_TEXT))))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;UPDATED:&lt;br /&gt;The problem was this line:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(setq x-select-enable-clipboard t)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;changed it to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(setq x-select-enable-clipboard nil)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and now I can paste in from mrxvt, xterm, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116066985203883513?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116066985203883513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116066985203883513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116066985203883513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116066985203883513'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/middle-click-selected-text-into-emacs.html' title='middle-click selected text into Emacs'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-116000310399642017</id><published>2006-10-04T17:00:00.000-06:00</published><updated>2006-10-04T17:06:36.956-06:00</updated><title type='text'>maven2 junit jvmargs</title><content type='html'>In the original maven you could put the following line in your project.properties to manage jvm args at testing time:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;maven.junit.jvmargs=-server -Dconfiguration.resourceType=properties ... -Xrunjdwp:transport=dt_socket,address=8787,server=y -Xmx512m&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In maven2, the easiset way is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;project&amp;gt;&lt;br /&gt;...&lt;br /&gt;   &amp;lt;build&amp;gt;&lt;br /&gt;     &amp;lt;plugins&amp;gt;&lt;br /&gt;       &amp;lt;plugin&amp;gt;&lt;br /&gt;         &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;           &amp;lt;artifactId&amp;gt;maven-surefire-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;             &amp;lt;configuration&amp;gt;&lt;br /&gt;               &amp;lt;argLine&amp;gt;&lt;br /&gt;                 -server -Dconfiguration.resourceType=properties ... -Xrunjdwp:transport=dt_socket,address=8787,server=y -Xmx512m&lt;br /&gt;               &amp;lt;/argLine&amp;gt;&lt;br /&gt;             &amp;lt;/configuration&amp;gt;&lt;br /&gt;      &amp;lt;/plugin&amp;gt;&lt;br /&gt;    &amp;lt;/plugins&amp;gt;&lt;br /&gt;  &amp;lt;/build&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-116000310399642017?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/116000310399642017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=116000310399642017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116000310399642017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/116000310399642017'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/maven2-junit-jvmargs.html' title='maven2 junit jvmargs'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115999761194317430</id><published>2006-10-04T15:32:00.000-06:00</published><updated>2006-10-04T15:33:32.240-06:00</updated><title type='text'>one of the reasons I like maven2</title><content type='html'>http://www.javaworld.com/javaworld/jw-12-2005/jw-1205-maven-p2.html&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Suppose you want to use Hibernate in your project. You would simply add a new dependency to the dependencies section in pom.xml, as follows:&lt;br /&gt;&lt;br /&gt;   &lt;dependency&gt;&lt;br /&gt;      &lt;groupId&gt;hibernate&lt;/groupId&gt;&lt;br /&gt;      &lt;artifactId&gt;hibernate&lt;/artifactId&gt;&lt;br /&gt;      &lt;version&gt;3.0.3&lt;/version&gt;&lt;br /&gt;      &lt;scope&gt;compile&lt;/scope&gt;&lt;br /&gt;   &lt;/dependency&gt;&lt;br /&gt;&lt;br /&gt;And that's it! You don't have to hunt around to know in which other JARs (and in which versions) you need to run Hibernate 3.0.3; Maven will do it for you!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That is sweet, and relieves great pain in larger projects with many tendrils to OSS jars.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115999761194317430?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115999761194317430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115999761194317430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115999761194317430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115999761194317430'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/one-of-reasons-i-like-maven2.html' title='one of the reasons I like maven2'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115997425927629758</id><published>2006-10-04T09:04:00.000-06:00</published><updated>2006-10-04T09:04:20.833-06:00</updated><title type='text'>Adding a custom attribute to the user class in Active Directory, then fetching it via Ruby</title><content type='html'>(credit: http://www.lacoude.com/docs/public/Attributes.aspx#_ftn8)&lt;br /&gt;&lt;br /&gt;First, install adminpak.msi from windows\system32 and then add the following registry key:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Key: HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters&lt;br /&gt;Value: "Schema Update Allowed" = 0x1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then run schmmgmt.msc. Right click on "Attributes" and "Create Attribute" as the "imsid" attribute, specifiying the x500 oid as created from oidgen.exe. Index it, activate it, and allow it to be shown in advanced view.&lt;br /&gt;&lt;br /&gt;Lastly, go to the properties of the "user" class, select the "Attributes" tab. Add an "optional" attribute by finding the "imsid" attribute.&lt;br /&gt;&lt;br /&gt;Now, using ADAM-adsiedit.msc, the Administrator can connect to the AD tree and update users' attributes with the appropriate imsids:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Right-click on ADAM ADSI Edit, select "Connect to..."&lt;br /&gt;select "Distinguished name or naming context"&lt;br /&gt;enter "cn=users,dc=devdomain,dc=it,dc=vital" (adjust dc values as necessary)&lt;br /&gt;click "Ok"&lt;br /&gt;expand the tree, find the CN of the user to edit&lt;br /&gt;right-click on user, select "Properties"&lt;br /&gt;find the "imsid" attribute, edit, apply&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Done. &lt;br /&gt;&lt;br /&gt;Here's the ultra-basic Ruby code that will lookup and print the imsid attribute:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require 'ldap'&lt;br /&gt;&lt;br /&gt;host = "192.168.88.20"&lt;br /&gt;port = 389&lt;br /&gt;username = "servuser"&lt;br /&gt;login = "servuser@devdomain.it.vital"&lt;br /&gt;password = "mypassword"&lt;br /&gt;found_imsid = "not_found"&lt;br /&gt;dn = "cn=users,dc=devdomain,dc=it,dc=vital"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;connection = LDAP::Conn.new(host,port)&lt;br /&gt;connection.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION,3)&lt;br /&gt;connection.bind(login, password)&lt;br /&gt;&lt;br /&gt;result = connection.search2( dn, LDAP::LDAP_SCOPE_SUBTREE, "cn=#{username}", ["imsid"])&lt;br /&gt;&lt;br /&gt;if(result.size == 1)&lt;br /&gt;  found_imsid = result.first["imsid"][0]&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;p found_imsid&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115997425927629758?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115997425927629758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115997425927629758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115997425927629758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115997425927629758'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/adding-custom-attribute-to-user-class.html' title='Adding a custom attribute to the user class in Active Directory, then fetching it via Ruby'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115988735316346799</id><published>2006-10-03T08:54:00.000-06:00</published><updated>2006-10-03T08:55:53.536-06:00</updated><title type='text'>mongrel_cluster startup script for Gentoo</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#!/sbin/runscript&lt;br /&gt;#&lt;br /&gt;# Copyright (c) 2006 Bradley Taylor, bradley@railsmachine.com&lt;br /&gt;#&lt;br /&gt;# Updated Oct 2006  by Russell Rollins for Gentoo compliance.&lt;br /&gt;#&lt;br /&gt;# mongrel_cluster       Startup script for Mongrel clusters.&lt;br /&gt;#&lt;br /&gt;# chkconfig: - 85 15&lt;br /&gt;# description: mongrel_cluster manages multiple Mongrel processes for use #              behind a load balancer.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;CONF_DIR=/etc/mongrel_cluster&lt;br /&gt;RETVAL=0&lt;br /&gt;&lt;br /&gt;depend() {&lt;br /&gt;    need net&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;    ebegin "Starting Mongrel cluster"&lt;br /&gt;    /usr/bin/mongrel_cluster_ctl start -c ${CONF_DIR}&lt;br /&gt;    eend $?&lt;br /&gt;}&lt;br /&gt;stop() {&lt;br /&gt;    ebegin "Stopping Mongrel cluster"&lt;br /&gt;    /usr/bin/mongrel_cluster_ctl stop -c ${CONF_DIR}&lt;br /&gt;    eend $?&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115988735316346799?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115988735316346799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115988735316346799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115988735316346799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115988735316346799'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/mongrelcluster-startup-script-for.html' title='mongrel_cluster startup script for Gentoo'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115988723864277786</id><published>2006-10-03T08:52:00.000-06:00</published><updated>2006-10-03T08:53:59.020-06:00</updated><title type='text'>pound and mongrel_cluster</title><content type='html'>In order to easily manage the development/deployment via Capistrano, it made sense to also be running mongrel_cluster automatically. This way deployment is real-time with instant results.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gem install mongrel_cluster capistrano --include-dependencies&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then install pound via emerge/yast. Edit the pound.cfg file:&lt;br /&gt;(this still doesn't seem to be working)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ListenHTTP&lt;br /&gt;  Address 0.0.0.0&lt;br /&gt;  Port    80&lt;br /&gt;  Service&lt;br /&gt;    BackEnd&lt;br /&gt;      Address 0.0.0.0&lt;br /&gt;      Port    8000&lt;br /&gt;    End&lt;br /&gt;    BackEnd&lt;br /&gt;      Address 0.0.0.0&lt;br /&gt;      Port    8001&lt;br /&gt;    End&lt;br /&gt;    BackEnd&lt;br /&gt;      Address 0.0.0.0&lt;br /&gt;      Port    8002&lt;br /&gt;    End&lt;br /&gt;    Session&lt;br /&gt;      Type BASIC&lt;br /&gt;      TTL  300&lt;br /&gt;    End&lt;br /&gt;  End&lt;br /&gt;End&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Start pound and add it to startup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/init.d/pound start&lt;br /&gt;rc-update add pound default&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next, railsapp/config/mongrel_cluster.yml would look like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cwd: /home/build/deploy/current&lt;br /&gt;port: "8000"&lt;br /&gt;environment: development&lt;br /&gt;address: 0.0.0.0&lt;br /&gt;pid_file: log/mongrel.pid&lt;br /&gt;servers: 3&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Initialize capistrano for railsapp:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cap --apply-to /path/to/railsapp MyApplicationName&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now that capistrano has been initialized, update the config/deploy.rb file adding:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Update the other properties as necessary, paying particular attention to:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;role :web, "someserver.yourinternaldomain.local"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The servers will have to be contactable by the exact name placed in the quotes.&lt;br /&gt;&lt;br /&gt;Update the remote variables:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;set :deploy_to, "/home/build/deploy"&lt;br /&gt;set :user, "build"&lt;br /&gt;set :keep_releases, 5&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Be sure to have the "build" user's password on hand since it'll be necessary for capistrano commands.&lt;br /&gt;&lt;br /&gt;Ensure capistrano is working with:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;rake remote:exec ACTION=setup&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Check that the target server has the releases and shared directories created, if so, capistrano worked. &lt;br /&gt;&lt;br /&gt;Lastly:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;rake deploy&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This should pull everything down and place it in the "current" directory (in relation to cwd). &lt;br /&gt;&lt;br /&gt;Create a link to mongrel_cluster script and mongrel_cluster.yml then add to startup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mkdir /etc/mongrel_cluster&lt;br /&gt;ln -s /home/build/deploy/current/config/mongrel_cluster.yml /etc/mongrel_cluster/railsapp.yml&lt;br /&gt;ln -s /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-0.1.3/resources/mongrel_cluster /etc/init.d/mongrel_cluster&lt;br /&gt;chmod +x /etc/init.d/mongrel_cluster&lt;br /&gt;rc-update /etc/init.d/mongrel_cluster default&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;TODO: autostart failing on Gentoo&lt;br /&gt;&lt;br /&gt;Lastly, start the mongrels:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/init.d/mongrel_cluster start&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Test from port 80, 8000, 8001 and 8002 that the rails intro page comes up. Done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115988723864277786?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115988723864277786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115988723864277786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115988723864277786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115988723864277786'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/10/pound-and-mongrelcluster.html' title='pound and mongrel_cluster'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115939717450031312</id><published>2006-09-27T16:41:00.000-06:00</published><updated>2006-09-28T14:31:32.503-06:00</updated><title type='text'>openEMM in Gentoo</title><content type='html'>1. downloaded OpenEMM-5.0.2.binary.tar.gz&lt;br /&gt;2. groupadd openemm&lt;br /&gt;3. useradd -m -g openemm -d /home/openemm -c "OpenEMM 5.0.2" openemm&lt;br /&gt;4. mysqladmin -u root -p create openemm&lt;br /&gt;5. mysql –u root openemm -p &lt; /home/openemm/USR_SHARE/openemm.db&lt;br /&gt;6. changed JAVA_HOME in httpd.sh to explicitly point to local jdk1.5&lt;br /&gt;7. su – openemm&lt;br /&gt;8. /home/openemm/bin/OpenEMM.sh start&lt;br /&gt;&lt;br /&gt;Sendmail stuff to get it working:&lt;br /&gt;vsruss russ # cd /home/openemm/&lt;br /&gt;vsruss openemm # cd bin/&lt;br /&gt;vsruss bin # chown root:root smctrl&lt;br /&gt;vsruss bin # chown root:root ../conf/bav/bav.rc&lt;br /&gt;vsruss bin # chmod 6755 smctrl&lt;br /&gt;vsruss bin # chmod 0600 ../conf/bav/bav.rc&lt;br /&gt;&lt;br /&gt;and in syslog-ng.conf:&lt;br /&gt;destination mail { file("/var/log/maillog"); };&lt;br /&gt;options { long_hostnames(off); sync(0); perm(0644); stats(3600); };&lt;br /&gt;&lt;br /&gt;restarted both sendmail and openemm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115939717450031312?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115939717450031312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115939717450031312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115939717450031312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115939717450031312'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/09/openemm-in-gentoo.html' title='openEMM in Gentoo'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115594170182916728</id><published>2006-08-18T16:53:00.000-06:00</published><updated>2006-08-18T17:05:08.550-06:00</updated><title type='text'>nfs simplified</title><content type='html'>(abridged from http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS)&lt;br /&gt;For the server&lt;br /&gt;&lt;br /&gt;1.emerge nfs-utils&lt;br /&gt;2.edit /etc/exports&lt;br /&gt;example: &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/opt/svnrepos vsdc1.vital.local(async,no_subtree_check,ro) 192.168.88.62(async,no_subtree_check,rw)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3.execute:&lt;br /&gt;exportfs -ra&lt;br /&gt;/etc/init.d/nfs reload&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;For the client&lt;br /&gt;&lt;br /&gt;ensure that portmap is running (and added as default via rc-update)&lt;br /&gt;then mount ala:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mount vssvn:/var/lib/trac ./vssvn_trac/&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115594170182916728?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115594170182916728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115594170182916728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115594170182916728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115594170182916728'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/08/nfs-simplified.html' title='nfs simplified'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115568176020217735</id><published>2006-08-15T16:29:00.000-06:00</published><updated>2006-08-15T16:42:40.420-06:00</updated><title type='text'>lspci is your friend</title><content type='html'>when looking up your NIC, easiest to emerge pciutils and then figure out the chipset&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115568176020217735?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115568176020217735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115568176020217735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115568176020217735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115568176020217735'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/08/lspci-is-your-friend.html' title='lspci is your friend'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115404095783762485</id><published>2006-07-27T16:41:00.000-06:00</published><updated>2006-07-27T16:56:53.530-06:00</updated><title type='text'>Test Driven Development -- Saving Grief and Pain</title><content type='html'>I recently inherited two projects at work, both in gloriously coded .NET. The first was a we'll-throw-together-a-CMS-like-web-application. Some simple concepts utilizing the webcomponents and master-template paradigms from Microsoft. Incidentally, another project was to tie into this one as a "component" to provide additional functionality. Both have zero lines of test code. Both have bugs. Both are now on my plate.&lt;br /&gt;&lt;br /&gt;Ever since reading &lt;a href="http://www.amazon.com/gp/product/0321146530/102-4241851-6740914?v=glance&amp;n=283155"&gt;Test Driven Development&lt;/a&gt; my world is no longer the same. Having spent some time as a quality assurance engineer(2000), I very much appreciated the concepts of this book. As a developer, I feasted upon the notions of overcoming assumptions/fear based on actual test results. Starting simple, refactoring as tests passed and building a solid foundation of functional code. I finished this book months ago and immediately put into practice writing tests first. I began to think in tests and then design from there, things worked out nicely every time.&lt;br /&gt;&lt;br /&gt;So, inheriting two development efforts (with their small portion of issues, ~60), neither of which has a lick of test code, my current outlook is a sliver of hope. A hope that, yes, we can fix things as we try to get the projects out the door. But, a serious sense of uncomfortableness pervades my being as I dig through code and fix things here and there. Deadline is approaching far too quickly, there's no time  to get a testing framework in place and cram tests through everything. The best we can do is get some automated web testing in place ala Fitnesse and Selenium. &lt;br /&gt;&lt;br /&gt;Now that the rant is done, what's the conclusion? Here it is: if you're gonna write code, write the test to go with it. That way you not only ensure the functionality of the immediate task of the code you're writing, you also spare the grief and pain of others when they look/touch/execute it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115404095783762485?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115404095783762485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115404095783762485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115404095783762485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115404095783762485'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/07/test-driven-development-saving-grief.html' title='Test Driven Development -- Saving Grief and Pain'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115351363178571588</id><published>2006-07-21T14:25:00.000-06:00</published><updated>2006-07-21T14:27:12.293-06:00</updated><title type='text'>sqlserver incremental table dumps</title><content type='html'>Very easy using bcp. Using cron, bash and ruby I can dump a given set of tables via cygwin and automate table data commits into subversion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115351363178571588?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115351363178571588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115351363178571588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115351363178571588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115351363178571588'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/07/sqlserver-incremental-table-dumps.html' title='sqlserver incremental table dumps'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115282512510664337</id><published>2006-07-13T15:09:00.000-06:00</published><updated>2006-08-14T10:40:07.856-06:00</updated><title type='text'>vnstat</title><content type='html'>SonicWall reported that my linux box pumped out "16588800 TBytes"  (no explaining what that number is) in a 3 day period. Right. vnstat is a nice handy tracker monitring your NIC traffic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115282512510664337?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115282512510664337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115282512510664337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115282512510664337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115282512510664337'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/07/vnstat.html' title='vnstat'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115160428268487995</id><published>2006-06-29T12:04:00.000-06:00</published><updated>2006-06-29T12:18:01.786-06:00</updated><title type='text'>Gentoo Trac with existing subversion project</title><content type='html'>&lt;pre&gt;&lt;br /&gt;sudo emerge trac sqlite pysqlite&lt;br /&gt;sudo webapp-config -I -d project/trac trac 0.9.5 #this will create the symlinks for the site, http://localhost/project/trac &lt;br /&gt;sudo trac-admin /var/lib/trac/project/ initenv #sets up the trac environment for the project&lt;br /&gt;sudo chown apache:apache -R /var/lib/trac/project&lt;br /&gt;sudo tracd -8000 /var/lib/trac/project&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;OR to run in apache&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;emerge mod_fastcgi&lt;br /&gt;#add "-D FASTCGI" to  /etc/conf.d/apache&lt;br /&gt;&lt;br /&gt;#add FastCgiServer /var/www/localhost/cgi-bin/trac.fcgi -idle-timeout 120        -initial-env TRAC_ENV=/var/lib/trac/project -processes 5&lt;br /&gt;# to /etc/apache/httpd.conf&lt;br /&gt;&lt;br /&gt;#add &lt;Location /project&gt;&lt;br /&gt;#          SetEnv TRAC_ENV "/var/lib/trac/project"&lt;br /&gt;#    &lt;/Location&gt;&lt;br /&gt;# ScriptAlias /project /var/www/localhost/cgi-bin/trac.cgi&lt;br /&gt;# to virtual hosts file&lt;br /&gt;&lt;br /&gt;#add users &lt;br /&gt;sudo htpasswd2 -c /etc/apach2/trac.htpasswd admin&lt;br /&gt;&lt;br /&gt;#then add&lt;br /&gt;#&lt;Location "/project/login"&gt;&lt;br /&gt;#  AuthType Basic&lt;br /&gt;#  AuthName "Trac"&lt;br /&gt;#  AuthUserFile /etc/apache2/trac.htpasswd&lt;br /&gt;#  Require valid-user&lt;br /&gt;#&lt;/Location&gt;&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;#to virtual hosts file&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115160428268487995?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115160428268487995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115160428268487995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115160428268487995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115160428268487995'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/06/gentoo-trac-with-existing-subversion.html' title='Gentoo Trac with existing subversion project'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115083583149837481</id><published>2006-06-20T14:33:00.000-06:00</published><updated>2006-06-20T14:37:12.060-06:00</updated><title type='text'>Parallels vs VMWare 4.x</title><content type='html'>I have reason to install Windows under linux, again (sadly). Given my recent experience of trying out Parallels on my MacBook, I thought I'd compare it to VMWare in Linux. I purchased a VMWare 4.x license two years ago and it worked decently enough in Gentoo. &lt;br /&gt;&lt;br /&gt;This time around, after emering it, there was network issues that I have heretofore not experienced. Then, for reasons I could not find, it wouldn't boot from the cd in the drive. This is when I decided to emerge Parallels (granted their ebuild is homebrewed, but still). Paraellels workstation is *so* much easier to install and configure, it's just not even funny. It's so simplistic, and it just worked! No network issues, no cd issues, it just worked. Just as simple and fast as on the Mac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115083583149837481?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115083583149837481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115083583149837481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115083583149837481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115083583149837481'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/06/parallels-vs-vmware-4x.html' title='Parallels vs VMWare 4.x'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-115031667484349259</id><published>2006-06-14T14:19:00.000-06:00</published><updated>2006-06-14T14:24:35.306-06:00</updated><title type='text'>Subversion, Apache2, DAV &amp; SAMBA</title><content type='html'>In order to easily facilitate a consolidated nightly backup we decided to mount (via SAMBA) a win2k3 share to store our Subversion repositories (Subversion being on a Gentoo box). Been live a week, today we had our first issue. The following message appeared on the "svn ci" output:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;snc: Commit failed:&lt;br /&gt;&lt;br /&gt;svn: Can't move '/opt/svn_repos/CrucialConversationsLP/db/current.3.tmp' to '/opt/svn_repos/CrucialConversationsLP/db/current': Text file busy.&lt;br /&gt;&lt;br /&gt;svn: MERGE of '/svn/repos/CrucialConversationsLP': 409 Conflict&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;followed by this (apache2's error-log):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[Wed Jun 14 14:05:04 2006] [error] [client 192.168.88.9] Could not MERGE resource "/svn/repos/CrucialConversationsLP/!svn/act/e920f6b2-3416-0410-b60c-8a4adf2ad0ca" into "/svn/repos/CrucialConversationsLP/courses/Crucial Conversations/slides".  [409, #0]&lt;br /&gt;[Wed Jun 14 14:05:04 2006] [error] [client 192.168.88.9] An error occurred while committing the transaction.  [409, #26]&lt;br /&gt;[Wed Jun 14 14:05:04 2006] [error] [client 192.168.88.9] Can't move '/opt/svn_repos/CrucialConversationsLP/db/current.10.tmp' to '/opt/svn_repos/CrucialConversationsLP/db/current': Text file busy  [409, #26]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;lsof did not indicate that the "current" file was open. &lt;br /&gt;&lt;br /&gt;The solution to this issue (for the time being) was to unmount the share and remount it. Then commits worked just fine. I also tried adding and committing test files on other projects, no issues there. So if this crops up again we'll consider an alternative backup scheme and perchance go down the NFS road.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-115031667484349259?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/115031667484349259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=115031667484349259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115031667484349259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/115031667484349259'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/06/subversion-apache2-dav-samba.html' title='Subversion, Apache2, DAV &amp; SAMBA'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114954231789808100</id><published>2006-06-05T15:16:00.000-06:00</published><updated>2006-06-05T15:18:38.050-06:00</updated><title type='text'>macbook RAM</title><content type='html'>If you're a developer and you just bought a new MacBook, spare yourself the lag headache and upgrade to 2G RAM (got mine for $160 @ macsolutions.com). I was about to send mine back convinced that something was wrong for how slow it was running. Sure it's warm, but with maxed ourtRAM, it sure hops.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114954231789808100?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114954231789808100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114954231789808100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114954231789808100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114954231789808100'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/06/macbook-ram.html' title='macbook RAM'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114953353297241644</id><published>2006-06-05T12:52:00.000-06:00</published><updated>2006-06-05T15:16:34.586-06:00</updated><title type='text'>simplified ssh and ssh-agent</title><content type='html'>(condensed version of http://www.gentoo.org/doc/en/keychain-guide.xml)&lt;br /&gt;ssh-keygen -t dsa&lt;br /&gt;scp ~/.ssh/id_dsa.pub server_user@server:~/myhost.pub&lt;br /&gt;ssh server_user@server "cat ~/myhost.pub &gt;&gt; ~/.ssh/authorized_keys"&lt;br /&gt;&lt;br /&gt;ssh-agent&lt;br /&gt;ssh-add id-dsa&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114953353297241644?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114953353297241644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114953353297241644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114953353297241644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114953353297241644'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/06/simplified-ssh-and-ssh-agent.html' title='simplified ssh and ssh-agent'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114913203186025506</id><published>2006-05-31T21:19:00.000-06:00</published><updated>2006-05-31T21:20:32.386-06:00</updated><title type='text'>OS X &amp; subversion install: bash: line 1: svnserve: command not found</title><content type='html'>Thanks to http://www.tbradshaw.net/archives/2005/03/02/subversion-on-dreamhost/, just symlinked my .profile to .bashrc and now everything works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114913203186025506?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114913203186025506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114913203186025506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114913203186025506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114913203186025506'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/os-x-subversion-install-bash-line-1.html' title='OS X &amp; subversion install: bash: line 1: svnserve: command not found'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114805322004928424</id><published>2006-05-19T09:34:00.000-06:00</published><updated>2006-05-19T09:40:20.793-06:00</updated><title type='text'>oh yeah, why back to Emacs?</title><content type='html'>So the new projects I'll be working have a wide range of underlying languages. Decided to give Eclipse, BlueFish &amp; JEdit a whirl (again). I'm on a much faster machine (3Ghz HT, compared to previous 1.7Ghz centrino) w/ 3G of RAM (compared to 2G) and thought these apps would perform quicker (and hence more efficient usage). Wrong.&lt;br /&gt;&lt;br /&gt;So Eclipse was still sluggish, still a pain to configure with clicking all over the place. Same with JEdit, a royal pain to get all the plugins needed then configure everything. Worth the time? I'm too impatient since the I can't use my locate db and open files as easily (any file, that is). Bluefish seemed nice, but when I opened a large PHP file with some HTML that was generated the thing slogged my CPU parsing it. That was the end of it. &lt;br /&gt;&lt;br /&gt;Took the 10 minutes to get JDE and php-mode up and running on my Emacs and I was back in business. Went 4 days w/o it, and now I'm in heaven again since I'm not bound to the mouse, crappy parsing, slow loading, inefficient file finding, etc.&lt;br /&gt;&lt;br /&gt;Oh the glory of Emacs...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114805322004928424?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114805322004928424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114805322004928424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114805322004928424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114805322004928424'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/oh-yeah-why-back-to-emacs.html' title='oh yeah, why back to Emacs?'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114805281429766109</id><published>2006-05-19T09:25:00.000-06:00</published><updated>2006-05-19T09:33:34.946-06:00</updated><title type='text'>Emacs and Ubuntu, finally harmony</title><content type='html'>Headache getting my emacs up and running smoothly after transitioning to this new box from my Gentoo laptop. Lesson learned: keep ALL my .el stuff in ~/site-load and don't use emerge/apt-get for new stuff. Thus everything is easily portable.&lt;br /&gt;&lt;br /&gt;Secondly, font selection was jacked for some reason and I had to go about updating my .Xdefaults on this new box with a font string that will work. Best tool I found for doing so is "&lt;a href="http://linux.about.com/cs/linux101/g/gtkfontsel.htm"&gt;gtkfontsel&lt;/a&gt;", makes it very slick (ugly sibling is xfontsel).&lt;br /&gt;&lt;br /&gt;For now I'm using:&lt;br /&gt;emacs.font: -*-terminus-*-*-normal-*-14-*-72-72-c-80-iso8859-13&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114805281429766109?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114805281429766109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114805281429766109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114805281429766109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114805281429766109'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/emacs-and-ubuntu-finally-harmony.html' title='Emacs and Ubuntu, finally harmony'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114779505053931592</id><published>2006-05-16T09:56:00.000-06:00</published><updated>2006-05-16T09:57:30.996-06:00</updated><title type='text'>.mrxvtrc</title><content type='html'>har_encoding: UTF-8&lt;br /&gt;mrxvt*mfont:  AR PL New Sung&lt;br /&gt;mrxvt*mfontn:  AR PL New Sung&lt;br /&gt;mrxvt*textShadow:  black&lt;br /&gt;mrxvt*opacity:          50&lt;br /&gt;mrxvt*OpacityDegree:    1&lt;br /&gt;mrxvt*vt0*saveLines:    10000&lt;br /&gt;mrxvt*initTermNumber:  3 &lt;br /&gt;mrxvt*protectSecondary: true&lt;br /&gt;mrxvt*loginShell:       true&lt;br /&gt;mrxvt*scrollBar:        true&lt;br /&gt;mrxvt*transparent:      false&lt;br /&gt;mrxvt*transparentScrollbar: false&lt;br /&gt;mrxvt*transparentTabbar:    false&lt;br /&gt;mrxvt*transparentMenubar:   false&lt;br /&gt;!mrxvt*foreground:      darkgray&lt;br /&gt;!mrxvt*background:      white&lt;br /&gt;mrxvt*foreground:       white&lt;br /&gt;mrxvt*background:       gray19&lt;br /&gt;mrxvt*backgroundFade:   60&lt;br /&gt;mrxvt*fading:           0&lt;br /&gt;!mrxvt*tintColor:       darkblue&lt;br /&gt;mrxvt*textShadow:       black&lt;br /&gt;mrxvt*textShadowMode:   botright&lt;br /&gt;!mrxvt*tabForeground:   black&lt;br /&gt;!mrxvt*tabBackground:   white&lt;br /&gt;!mrxvt*itabForeground:  black&lt;br /&gt;!mrxvt*itabBackground:  white&lt;br /&gt;mrxvt*tabForeground:    white&lt;br /&gt;mrxvt*tabBackground:    black&lt;br /&gt;mrxvt*itabForeground:   white&lt;br /&gt;mrxvt*itabBackground:   darkblue&lt;br /&gt;mrxvt*tabPixmap:        false&lt;br /&gt;mrxvt*syncTabTitle:     true&lt;br /&gt;mrxvt*hideTabbar:       false&lt;br /&gt;mrxvt*bottomTabbar:     true&lt;br /&gt;mrxvt*windowsSwitch:    false&lt;br /&gt;mrxvt*showMenu:         false&lt;br /&gt;mrxvt*hideButtons:      true&lt;br /&gt;mrxvt*xft:              true&lt;br /&gt;mrxvt*xftFont:          Bitstream Vera Sans Mono&lt;br /&gt;mrxvt*xftmFont:         Bitstream Vera Sans Mono&lt;br /&gt;mrxvt*xftAntialias:     true&lt;br /&gt;mrxvt*xftWeight:        normal&lt;br /&gt;mrxvt*xftSlant:         roman&lt;br /&gt;mrxvt*xftHinting:       true&lt;br /&gt;mrxvt*xftAutoHint:      true&lt;br /&gt;mrxvt*xftGlobalAdvance: true&lt;br /&gt;mrxvt*xftWidth:         normal&lt;br /&gt;mrxvt*xftRGBA:          rgb&lt;br /&gt;mrxvt*xftSize:          11&lt;br /&gt;mrxvt*cursorBlink:      false&lt;br /&gt;!mrxvt*cursorBlinkInterval:500&lt;br /&gt;mrxvt*geometry:         80x25&lt;br /&gt;mrxvt*inputMethod:      fcitx&lt;br /&gt;!mrxvt*cursorColor:     white&lt;br /&gt;mrxvt*cursorColor:      lightblue&lt;br /&gt;mrxvt*color0:           black&lt;br /&gt;mrxvt*color1:           #40e0d0&lt;br /&gt;mrxvt*color2:           #87cefa&lt;br /&gt;mrxvt*color3:           #ffff00&lt;br /&gt;mrxvt*color4:           #d1eeee&lt;br /&gt;mrxvt*color5:           #eed8ae&lt;br /&gt;mrxvt*color6:           #b4eeb4&lt;br /&gt;mrxvt*color7:           gray&lt;br /&gt;mrxvt*color8:           gray40&lt;br /&gt;mrxvt*color9:           #ee6363&lt;br /&gt;mrxvt*color10:          #c5f779&lt;br /&gt;mrxvt*color11:          #fff796&lt;br /&gt;mrxvt*color12:          #00b2ee&lt;br /&gt;mrxvt*color13:          #cf9ebe&lt;br /&gt;mrxvt*color14:          #71bebe&lt;br /&gt;mrxvt*color15:          white&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114779505053931592?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114779505053931592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114779505053931592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114779505053931592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114779505053931592'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/mrxvtrc.html' title='.mrxvtrc'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114773116616560847</id><published>2006-05-15T15:55:00.000-06:00</published><updated>2006-05-15T16:12:46.800-06:00</updated><title type='text'>VMWare Ubuntu 5.10</title><content type='html'>http://www.vmware.com/community/thread.jspa?threadID=29227&amp;tstart=0&lt;br /&gt;export CC=/usr/bin/gcc-3.4&lt;br /&gt;ran vmware-install.pl&lt;br /&gt;failed with insmod: error inserting '/tmp/vmware-config0/vmnet.o': -1 Unknown symbol in module &lt;br /&gt;then ran vmware-any-any (http://platan.vc.cvut.cz/ftp/pub/vmware/), no error message&lt;br /&gt;/etc/init.d/vmware stop&lt;br /&gt;sudo rm /etc/vmware/not_configured&lt;br /&gt;vmware&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114773116616560847?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114773116616560847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114773116616560847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114773116616560847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114773116616560847'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/vmware-ubuntu-510.html' title='VMWare Ubuntu 5.10'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114772610452394176</id><published>2006-05-15T14:47:00.000-06:00</published><updated>2006-05-15T14:48:30.656-06:00</updated><title type='text'>Radeon 9800 Dual-head Ubuntu 5.10</title><content type='html'># File: xorg.conf&lt;br /&gt;# File generated by fglrxconfig (C) ATI Technologies, a substitute for xf86config.&lt;br /&gt;&lt;br /&gt;# Note by ATI: the below copyright notice is there for servicing possibly&lt;br /&gt;# pending third party rights on the file format and the instance of this file.&lt;br /&gt;#&lt;br /&gt;# Copyright (c) 1999 by The XFree86 Project, Inc.&lt;br /&gt;#&lt;br /&gt;# Permission is hereby granted, free of charge, to any person obtaining a&lt;br /&gt;# copy of this software and associated documentation files (the "Software"),&lt;br /&gt;# to deal in the Software without restriction, including without limitation&lt;br /&gt;# the rights to use, copy, modify, merge, publish, distribute, sublicense,&lt;br /&gt;# and/or sell copies of the Software, and to permit persons to whom the&lt;br /&gt;# Software is furnished to do so, subject to the following conditions:&lt;br /&gt;# &lt;br /&gt;# The above copyright notice and this permission notice shall be included in&lt;br /&gt;# all copies or substantial portions of the Software.&lt;br /&gt;# &lt;br /&gt;# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL&lt;br /&gt;# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,&lt;br /&gt;# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF&lt;br /&gt;# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&lt;br /&gt;# SOFTWARE.&lt;br /&gt;# &lt;br /&gt;# Except as contained in this notice, the name of the XFree86 Project shall&lt;br /&gt;# not be used in advertising or otherwise to promote the sale, use or other&lt;br /&gt;# dealings in this Software without prior written authorization from the&lt;br /&gt;# XFree86 Project.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Refer to the XF86Config(4/5) man page for details about the format of &lt;br /&gt;# this file.&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# DRI Section&lt;br /&gt;# **********************************************************************&lt;br /&gt;Section "dri"&lt;br /&gt;# Access to OpenGL ICD is allowed for all users:&lt;br /&gt;    Mode 0666&lt;br /&gt;# Access to OpenGL ICD is restricted to a specific user group:&lt;br /&gt;#    Group 100    # users&lt;br /&gt;#    Mode 0660&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Module section -- this  section  is used to specify&lt;br /&gt;# which dynamically loadable modules to load.&lt;br /&gt;# **********************************************************************&lt;br /&gt;#&lt;br /&gt;Section "Module"&lt;br /&gt;&lt;br /&gt;# This loads the DBE extension module.&lt;br /&gt;&lt;br /&gt;    Load        "dbe"   # Double buffer extension&lt;br /&gt;&lt;br /&gt;# This loads the miscellaneous extensions module, and disables&lt;br /&gt;# initialisation of the XFree86-DGA extension within that module.&lt;br /&gt;    SubSection  "extmod"&lt;br /&gt;      Option    "omit xfree86-dga"   # don't initialise the DGA extension&lt;br /&gt;    EndSubSection&lt;br /&gt;&lt;br /&gt;# This loads the Type1 and FreeType font modules&lt;br /&gt;    Load        "type1"&lt;br /&gt;    Load        "freetype"&lt;br /&gt;&lt;br /&gt;# This loads the GLX module&lt;br /&gt;    Load        "glx"   # libglx.a&lt;br /&gt;    Load        "dri"   # libdri.a&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Files section.  This allows default font and rgb paths to be set&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;Section "Files"&lt;br /&gt;&lt;br /&gt;# The location of the RGB database.  Note, this is the name of the&lt;br /&gt;# file minus the extension (like ".txt" or ".db").  There is normally&lt;br /&gt;# no need to change the default.&lt;br /&gt;&lt;br /&gt;    RgbPath "/usr/X11R6/lib/X11/rgb"&lt;br /&gt;&lt;br /&gt;# Multiple FontPath entries are allowed (which are concatenated together),&lt;br /&gt;# as well as specifying multiple comma-separated entries in one FontPath&lt;br /&gt;# command (or a combination of both methods)&lt;br /&gt;# &lt;br /&gt;# If you don't have a floating point coprocessor and emacs, Mosaic or other&lt;br /&gt;# programs take long to start up, try moving the Type1 and Speedo directory&lt;br /&gt;# to the end of this list (or comment them out).&lt;br /&gt;# &lt;br /&gt;&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/local/"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"&lt;br /&gt;#    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"&lt;br /&gt;&lt;br /&gt;# The module search path.  The default path is shown here.&lt;br /&gt;&lt;br /&gt;#    ModulePath "/usr/X11R6/lib/modules"&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Server flags section.&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;Section "ServerFlags"&lt;br /&gt;&lt;br /&gt;# Uncomment this to cause a core dump at the spot where a signal is &lt;br /&gt;# received.  This may leave the console in an unusable state, but may&lt;br /&gt;# provide a better stack trace in the core dump to aid in debugging&lt;br /&gt;&lt;br /&gt;#    Option "NoTrapSignals"&lt;br /&gt;&lt;br /&gt;# Uncomment this to disable the &lt;Crtl&gt;&lt;Alt&gt;&lt;BS&gt; server abort sequence&lt;br /&gt;# This allows clients to receive this key event.&lt;br /&gt;&lt;br /&gt;#    Option "DontZap"&lt;br /&gt;&lt;br /&gt;# Uncomment this to disable the &lt;Crtl&gt;&lt;Alt&gt;&lt;KP_+&gt;/&lt;KP_-&gt; mode switching&lt;br /&gt;# sequences.  This allows clients to receive these key events.&lt;br /&gt;&lt;br /&gt;#    Option "Dont Zoom"&lt;br /&gt;&lt;br /&gt;# Uncomment this to disable tuning with the xvidtune client. With&lt;br /&gt;# it the client can still run and fetch card and monitor attributes,&lt;br /&gt;# but it will not be allowed to change them. If it tries it will&lt;br /&gt;# receive a protocol error.&lt;br /&gt;&lt;br /&gt;#    Option "DisableVidModeExtension"&lt;br /&gt;&lt;br /&gt;# Uncomment this to enable the use of a non-local xvidtune client. &lt;br /&gt;&lt;br /&gt;#    Option "AllowNonLocalXvidtune"&lt;br /&gt;&lt;br /&gt;# Uncomment this to disable dynamically modifying the input device&lt;br /&gt;# (mouse and keyboard) settings. &lt;br /&gt;&lt;br /&gt;#    Option "DisableModInDev"&lt;br /&gt;&lt;br /&gt;# Uncomment this to enable the use of a non-local client to&lt;br /&gt;# change the keyboard or mouse settings (currently only xset).&lt;br /&gt;&lt;br /&gt;#    Option "AllowNonLocalModInDev"&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Input devices&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Core keyboard's InputDevice section&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;Section "InputDevice"&lt;br /&gt;&lt;br /&gt;    Identifier "Keyboard1"&lt;br /&gt;    Driver "kbd"&lt;br /&gt;# For most OSs the protocol can be omitted (it defaults to "Standard").&lt;br /&gt;# When using XQUEUE (only for SVR3 and SVR4, but not Solaris),&lt;br /&gt;# uncomment the following line.&lt;br /&gt;&lt;br /&gt;#    Option "Protocol"   "Xqueue"&lt;br /&gt;&lt;br /&gt;    Option "AutoRepeat" "500 30"&lt;br /&gt;&lt;br /&gt;# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))&lt;br /&gt;#    Option "Xleds"      "1 2 3"&lt;br /&gt;&lt;br /&gt;#    Option "LeftAlt"    "Meta"&lt;br /&gt;#    Option "RightAlt"   "ModeShift"&lt;br /&gt;&lt;br /&gt;# To customise the XKB settings to suit your keyboard, modify the&lt;br /&gt;# lines below (which are the defaults).  For example, for a non-U.S.&lt;br /&gt;# keyboard, you will probably want to use:&lt;br /&gt;#    Option "XkbModel"   "pc102"&lt;br /&gt;# If you have a US Microsoft Natural keyboard, you can use:&lt;br /&gt;#    Option "XkbModel"   "microsoft"&lt;br /&gt;#&lt;br /&gt;# Then to change the language, change the Layout setting.&lt;br /&gt;# For example, a german layout can be obtained with:&lt;br /&gt;#    Option "XkbLayout"  "de"&lt;br /&gt;# or:&lt;br /&gt;#    Option "XkbLayout"  "de"&lt;br /&gt;#    Option "XkbVariant" "nodeadkeys"&lt;br /&gt;#&lt;br /&gt;# If you'd like to switch the positions of your capslock and&lt;br /&gt;# control keys, use:&lt;br /&gt;#    Option "XkbOptions" "ctrl:swapcaps"&lt;br /&gt;&lt;br /&gt;# These are the default XKB settings for XFree86&lt;br /&gt;#    Option "XkbRules"   "xfree86"&lt;br /&gt;#    Option "XkbModel"   "pc101"&lt;br /&gt;#    Option "XkbLayout"  "us"&lt;br /&gt;#    Option "XkbVariant" ""&lt;br /&gt;#    Option "XkbOptions" ""&lt;br /&gt;&lt;br /&gt;#    Option "XkbDisable"&lt;br /&gt;&lt;br /&gt;    Option "XkbRules" "xfree86"&lt;br /&gt;    Option "XkbModel" "pc104"&lt;br /&gt;    Option "XkbLayout" "us"&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Core Pointer's InputDevice section&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;Section "InputDevice"&lt;br /&gt;&lt;br /&gt;# Identifier and driver&lt;br /&gt;&lt;br /&gt;    Identifier "Mouse1"&lt;br /&gt;    Driver "mouse"&lt;br /&gt;    Option "Protocol"   "ImPS/2"&lt;br /&gt;    Option "ZAxisMapping"   "4 5"&lt;br /&gt;    Option "Device"     "/dev/input/mice"&lt;br /&gt;&lt;br /&gt;# When using XQUEUE, comment out the above two lines, and uncomment&lt;br /&gt;# the following line.&lt;br /&gt;&lt;br /&gt;#    Option "Protocol"   "Xqueue"&lt;br /&gt;&lt;br /&gt;# Baudrate and SampleRate are only for some Logitech mice. In&lt;br /&gt;# almost every case these lines should be omitted.&lt;br /&gt;&lt;br /&gt;#    Option "BaudRate"   "9600"&lt;br /&gt;#    Option "SampleRate" "150"&lt;br /&gt;&lt;br /&gt;# Emulate3Buttons is an option for 2-button Microsoft mice&lt;br /&gt;# Emulate3Timeout is the timeout in milliseconds (default is 50ms)&lt;br /&gt;&lt;br /&gt;#    Option "Emulate3Buttons"&lt;br /&gt;#    Option "Emulate3Timeout"    "50"&lt;br /&gt;&lt;br /&gt;# ChordMiddle is an option for some 3-button Logitech mice&lt;br /&gt;&lt;br /&gt;#    Option "ChordMiddle"&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Other input device sections &lt;br /&gt;# this is optional and is required only if you&lt;br /&gt;# are using extended input devices.  This is for example only.  Refer&lt;br /&gt;# to the XF86Config man page for a description of the options.&lt;br /&gt;# **********************************************************************&lt;br /&gt;#&lt;br /&gt;# Section "InputDevice" &lt;br /&gt;#    Identifier  "Mouse2"&lt;br /&gt;#    Driver      "mouse"&lt;br /&gt;#    Option      "Protocol"      "MouseMan"&lt;br /&gt;#    Option      "Device"        "/dev/mouse2"&lt;br /&gt;# EndSection&lt;br /&gt;#&lt;br /&gt;# Section "InputDevice"&lt;br /&gt;#    Identifier "spaceball"&lt;br /&gt;#    Driver     "magellan"&lt;br /&gt;#    Option     "Device"         "/dev/cua0"&lt;br /&gt;# EndSection&lt;br /&gt;#&lt;br /&gt;# Section "InputDevice"&lt;br /&gt;#    Identifier "spaceball2"&lt;br /&gt;#    Driver     "spaceorb"&lt;br /&gt;#    Option     "Device"         "/dev/cua0"&lt;br /&gt;# EndSection&lt;br /&gt;#&lt;br /&gt;# Section "InputDevice"&lt;br /&gt;#    Identifier "touchscreen0"&lt;br /&gt;#    Driver     "microtouch"&lt;br /&gt;#    Option     "Device"         "/dev/ttyS0"&lt;br /&gt;#    Option     "MinX"           "1412"&lt;br /&gt;#    Option     "MaxX"           "15184"&lt;br /&gt;#    Option     "MinY"           "15372"&lt;br /&gt;#    Option     "MaxY"           "1230"&lt;br /&gt;#    Option     "ScreenNumber"   "0"&lt;br /&gt;#    Option     "ReportingMode"  "Scaled"&lt;br /&gt;#    Option     "ButtonNumber"   "1"&lt;br /&gt;#    Option     "SendCoreEvents"&lt;br /&gt;# EndSection&lt;br /&gt;#&lt;br /&gt;# Section "InputDevice"&lt;br /&gt;#    Identifier "touchscreen1"&lt;br /&gt;#    Driver     "elo2300"&lt;br /&gt;#    Option     "Device"         "/dev/ttyS0"&lt;br /&gt;#    Option     "MinX"           "231"&lt;br /&gt;#    Option     "MaxX"           "3868"&lt;br /&gt;#    Option     "MinY"           "3858"&lt;br /&gt;#    Option     "MaxY"           "272"&lt;br /&gt;#    Option     "ScreenNumber"   "0"&lt;br /&gt;#    Option     "ReportingMode"  "Scaled"&lt;br /&gt;#    Option     "ButtonThreshold"    "17"&lt;br /&gt;#    Option     "ButtonNumber"   "1"&lt;br /&gt;#    Option     "SendCoreEvents"&lt;br /&gt;# EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Monitor section&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# Any number of monitor sections may be present&lt;br /&gt;&lt;br /&gt;Section "Monitor"&lt;br /&gt;    Identifier  "Monitor0"&lt;br /&gt;# === mode lines based on GTF ===&lt;br /&gt;# VGA @ 100Hz&lt;br /&gt;# Modeline "640x480@100" 43.163 640 680 744 848 480 481 484 509 +hsync +vsync&lt;br /&gt;# SVGA @ 100Hz&lt;br /&gt;# Modeline "800x600@100" 68.179 800 848 936 1072 600 601 604 636 +hsync +vsync&lt;br /&gt;# XVGA @ 100Hz&lt;br /&gt;# Modeline "1024x768@100" 113.309 1024 1096 1208 1392 768 769 772 814 +hsync +vsync&lt;br /&gt;# 1152x864 @ 60Hz&lt;br /&gt;# Modeline "1152x864@60" 81.642 1152 1216 1336 1520 864 865 868 895 +hsync +vsync&lt;br /&gt;# 1152x864 @ 85Hz&lt;br /&gt;# Modeline "1152x864@85" 119.651 1152 1224 1352 1552 864 865 868 907 +hsync +vsync&lt;br /&gt;# 1152x864 @ 100Hz&lt;br /&gt;# Modeline "1152x864@100" 143.472 1152 1232 1360 1568 864 865 868 915 +hsync +vsync&lt;br /&gt;# 1280x960 @ 75Hz&lt;br /&gt;# Modeline "1280x960@75" 129.859 1280 1368 1504 1728 960 961 964 1002 +hsync +vsync&lt;br /&gt;# 1280x960 @ 100Hz&lt;br /&gt;# Modeline "1280x960@100" 178.992 1280 1376 1520 1760 960 961 964 1017  +hsync +vsync&lt;br /&gt;# SXGA @ 100Hz&lt;br /&gt;# Modeline "1280x1024@100" 190.960 1280 1376 1520 1760 1024 1025 1028 1085 +hsync +vsync&lt;br /&gt;# SPEA GDM-1950 (60Hz,64kHz,110MHz,-,-): 1280x1024 @ V-freq: 60.00 Hz, H-freq: 63.73 KHz&lt;br /&gt;# Modeline "GDM-1950"  109.62  1280 1336 1472 1720  1024 1024 1026 1062 -hsync -vsync&lt;br /&gt;# 1600x1000 @ 60Hz&lt;br /&gt;# Modeline "1600x1000" 133.142 1600 1704 1872 2144 1000 1001 1004 1035 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 75Hz&lt;br /&gt;# Modeline "1600x1000" 169.128 1600 1704 1880 2160 1000 1001 1004 1044 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 85Hz&lt;br /&gt;# Modeline "1600x1000" 194.202 1600 1712 1888 2176 1000 1001 1004 1050 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 100Hz&lt;br /&gt;# Modeline "1600x1000" 232.133 1600 1720 1896 2192 1000 1001 1004 1059 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 60Hz&lt;br /&gt;# Modeline "1600x1024" 136.385 1600 1704 1872 2144 1024 1027 1030 1060 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 75Hz&lt;br /&gt;# Modeline "1600x1024" 174.416 1600 1712 1888 2176 1024 1025 1028 1069 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 76Hz&lt;br /&gt;# Modeline "1600x1024" 170.450 1600 1632 1792 2096 1024 1027 1030 1070 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 85Hz&lt;br /&gt;# Modeline "1600x1024" 198.832 1600 1712 1888 2176 1024 1027 1030 1075 +hsync +vsync&lt;br /&gt;# 1920x1080 @ 60Hz&lt;br /&gt;# Modeline "1920x1080" 172.798 1920 2040 2248 2576 1080 1081 1084 1118 -hsync -vsync&lt;br /&gt;# 1920x1080 @ 75Hz&lt;br /&gt;# Modeline "1920x1080" 211.436 1920 2056 2264 2608 1080 1081 1084 1126 +hsync +vsync&lt;br /&gt;# 1920x1200 @ 60Hz&lt;br /&gt;# Modeline "1920x1200" 193.156 1920 2048 2256 2592 1200 1201 1203 1242 +hsync +vsync&lt;br /&gt;# 1920x1200 @ 75Hz&lt;br /&gt;# Modeline "1920x1200" 246.590 1920 2064 2272 2624 1200 1201 1203 1253 +hsync +vsync&lt;br /&gt;# 2048x1536 @ 60&lt;br /&gt;# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync&lt;br /&gt;# 2048x1536 @ 60&lt;br /&gt;# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync&lt;br /&gt;# 1400x1050 @ 60Hz M9 Laptop mode &lt;br /&gt;# ModeLine "1400x1050" 122.000 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync&lt;br /&gt;# 1920x2400 @ 25Hz for IBM T221, VS VP2290 and compatible display devices&lt;br /&gt;# Modeline "1920x2400@25" 124.620 1920 1928 1980 2048 2400 2401 2403 2434 +hsync +vsync&lt;br /&gt;# 1920x2400 @ 30Hz for IBM T221, VS VP2290 and compatible display devices&lt;br /&gt;# Modeline "1920x2400@30" 149.250 1920 1928 1982 2044 2400 2402 2404 2434 +hsync +vsync&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Section "Monitor"&lt;br /&gt;    Identifier  "Monitor1"&lt;br /&gt;# === mode lines based on GTF ===&lt;br /&gt;# VGA @ 100Hz&lt;br /&gt;# Modeline "640x480@100" 43.163 640 680 744 848 480 481 484 509 +hsync +vsync&lt;br /&gt;# SVGA @ 100Hz&lt;br /&gt;# Modeline "800x600@100" 68.179 800 848 936 1072 600 601 604 636 +hsync +vsync&lt;br /&gt;# XVGA @ 100Hz&lt;br /&gt;# Modeline "1024x768@100" 113.309 1024 1096 1208 1392 768 769 772 814 +hsync +vsync&lt;br /&gt;# 1152x864 @ 60Hz&lt;br /&gt;# Modeline "1152x864@60" 81.642 1152 1216 1336 1520 864 865 868 895 +hsync +vsync&lt;br /&gt;# 1152x864 @ 85Hz&lt;br /&gt;# Modeline "1152x864@85" 119.651 1152 1224 1352 1552 864 865 868 907 +hsync +vsync&lt;br /&gt;# 1152x864 @ 100Hz&lt;br /&gt;# Modeline "1152x864@100" 143.472 1152 1232 1360 1568 864 865 868 915 +hsync +vsync&lt;br /&gt;# 1280x960 @ 75Hz&lt;br /&gt;# Modeline "1280x960@75" 129.859 1280 1368 1504 1728 960 961 964 1002 +hsync +vsync&lt;br /&gt;# 1280x960 @ 100Hz&lt;br /&gt;# Modeline "1280x960@100" 178.992 1280 1376 1520 1760 960 961 964 1017  +hsync +vsync&lt;br /&gt;# SXGA @ 100Hz&lt;br /&gt;# Modeline "1280x1024@100" 190.960 1280 1376 1520 1760 1024 1025 1028 1085 +hsync +vsync&lt;br /&gt;# SPEA GDM-1950 (60Hz,64kHz,110MHz,-,-): 1280x1024 @ V-freq: 60.00 Hz, H-freq: 63.73 KHz&lt;br /&gt;# Modeline "GDM-1950"  109.62  1280 1336 1472 1720  1024 1024 1026 1062 -hsync -vsync&lt;br /&gt;# 1600x1000 @ 60Hz&lt;br /&gt;# Modeline "1600x1000" 133.142 1600 1704 1872 2144 1000 1001 1004 1035 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 75Hz&lt;br /&gt;# Modeline "1600x1000" 169.128 1600 1704 1880 2160 1000 1001 1004 1044 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 85Hz&lt;br /&gt;# Modeline "1600x1000" 194.202 1600 1712 1888 2176 1000 1001 1004 1050 +hsync +vsync&lt;br /&gt;# 1600x1000 @ 100Hz&lt;br /&gt;# Modeline "1600x1000" 232.133 1600 1720 1896 2192 1000 1001 1004 1059 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 60Hz&lt;br /&gt;# Modeline "1600x1024" 136.385 1600 1704 1872 2144 1024 1027 1030 1060 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 75Hz&lt;br /&gt;# Modeline "1600x1024" 174.416 1600 1712 1888 2176 1024 1025 1028 1069 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 76Hz&lt;br /&gt;# Modeline "1600x1024" 170.450 1600 1632 1792 2096 1024 1027 1030 1070 +hsync +vsync&lt;br /&gt;# 1600x1024 @ 85Hz&lt;br /&gt;# Modeline "1600x1024" 198.832 1600 1712 1888 2176 1024 1027 1030 1075 +hsync +vsync&lt;br /&gt;# 1920x1080 @ 60Hz&lt;br /&gt;# Modeline "1920x1080" 172.798 1920 2040 2248 2576 1080 1081 1084 1118 -hsync -vsync&lt;br /&gt;# 1920x1080 @ 75Hz&lt;br /&gt;# Modeline "1920x1080" 211.436 1920 2056 2264 2608 1080 1081 1084 1126 +hsync +vsync&lt;br /&gt;# 1920x1200 @ 60Hz&lt;br /&gt;# Modeline "1920x1200" 193.156 1920 2048 2256 2592 1200 1201 1203 1242 +hsync +vsync&lt;br /&gt;# 1920x1200 @ 75Hz&lt;br /&gt;# Modeline "1920x1200" 246.590 1920 2064 2272 2624 1200 1201 1203 1253 +hsync +vsync&lt;br /&gt;# 2048x1536 @ 60&lt;br /&gt;# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync&lt;br /&gt;# 2048x1536 @ 60&lt;br /&gt;# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync&lt;br /&gt;# 1400x1050 @ 60Hz M9 Laptop mode &lt;br /&gt;# ModeLine "1400x1050" 122.000 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync&lt;br /&gt;# 1920x2400 @ 25Hz for IBM T221, VS VP2290 and compatible display devices&lt;br /&gt;# Modeline "1920x2400@25" 124.620 1920 1928 1980 2048 2400 2401 2403 2434 +hsync +vsync&lt;br /&gt;# 1920x2400 @ 30Hz for IBM T221, VS VP2290 and compatible display devices&lt;br /&gt;# Modeline "1920x2400@30" 149.250 1920 1928 1982 2044 2400 2402 2404 2434 +hsync +vsync&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Graphics device section&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# Any number of graphics device sections may be present&lt;br /&gt;&lt;br /&gt;# Standard VGA Device:&lt;br /&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;    Identifier  "Standard VGA"&lt;br /&gt;    VendorName  "Unknown"&lt;br /&gt;    BoardName   "Unknown"&lt;br /&gt;&lt;br /&gt;# The chipset line is optional in most cases.  It can be used to override&lt;br /&gt;# the driver's chipset detection, and should not normally be specified.&lt;br /&gt;&lt;br /&gt;#    Chipset     "generic"&lt;br /&gt;&lt;br /&gt;# The Driver line must be present.  When using run-time loadable driver&lt;br /&gt;# modules, this line instructs the server to load the specified driver&lt;br /&gt;# module.  Even when not using loadable driver modules, this line&lt;br /&gt;# indicates which driver should interpret the information in this section.&lt;br /&gt;&lt;br /&gt;    Driver      "vga"&lt;br /&gt;# The BusID line is used to specify which of possibly multiple devices&lt;br /&gt;# this section is intended for.  When this line isn't present, a device&lt;br /&gt;# section can only match up with the primary video device.  For PCI&lt;br /&gt;# devices a line like the following could be used.  This line should not&lt;br /&gt;# normally be included unless there is more than one video device&lt;br /&gt;# installed.&lt;br /&gt;&lt;br /&gt;#    BusID       "PCI:0:10:0"&lt;br /&gt;&lt;br /&gt;#    VideoRam    256&lt;br /&gt;&lt;br /&gt;#    Clocks      25.2 28.3&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# === ATI device section ===&lt;br /&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;    Identifier                          "ATI Graphics Adapter connector 0"&lt;br /&gt;    Driver                              "fglrx"&lt;br /&gt;# ### generic DRI settings ###&lt;br /&gt;# === disable PnP Monitor  ===&lt;br /&gt;    #Option                              "NoDDC"&lt;br /&gt;# === disable/enable XAA/DRI ===&lt;br /&gt;    Option "no_accel"                   "no"&lt;br /&gt;    Option "no_dri"                     "no"&lt;br /&gt;# === misc DRI settings ===&lt;br /&gt;    Option "mtrr"                       "off" # disable DRI mtrr mapper, driver has its own code for mtrr&lt;br /&gt;# ### FireGL DDX driver module specific settings ###&lt;br /&gt;# === Screen Management ===&lt;br /&gt;    Option "DesktopSetup"               "(null)" &lt;br /&gt;    Option "ScreenOverlap"              "0" &lt;br /&gt;    Option "GammaCorrectionI"           "0x00000000"&lt;br /&gt;    Option "GammaCorrectionII"          "0x00000000"&lt;br /&gt;# === OpenGL specific profiles/settings ===&lt;br /&gt;    Option "Capabilities"               "0x00000000"&lt;br /&gt;    Option "CapabilitiesEx"             "0x00000000"&lt;br /&gt;# === Video Overlay for the Xv extension ===&lt;br /&gt;    Option "VideoOverlay"               "on"&lt;br /&gt;# === OpenGL Overlay ===&lt;br /&gt;# Note: When OpenGL Overlay is enabled, Video Overlay&lt;br /&gt;#       will be disabled automatically&lt;br /&gt;    Option "OpenGLOverlay"              "off"&lt;br /&gt;# === Center Mode (Laptops only) ===&lt;br /&gt;    Option "CenterMode"                 "off"&lt;br /&gt;# === Pseudo Color Visuals (8-bit visuals) ===&lt;br /&gt;    Option "PseudoColorVisuals"         "off"&lt;br /&gt;# === QBS Management ===&lt;br /&gt;    Option "Stereo"                     "off"&lt;br /&gt;    Option "StereoSyncEnable"           "1"&lt;br /&gt;# === FSAA Management ===&lt;br /&gt;    Option "FSAAEnable"                 "no"&lt;br /&gt;    Option "FSAAScale"                  "1"&lt;br /&gt;    Option "FSAADisableGamma"           "no"&lt;br /&gt;    Option "FSAACustomizeMSPos"         "no"&lt;br /&gt;    Option "FSAAMSPosX0"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY0"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosX1"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY1"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosX2"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY2"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosX3"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY3"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosX4"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY4"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosX5"                "0.000000"&lt;br /&gt;    Option "FSAAMSPosY5"                "0.000000"&lt;br /&gt;# === Misc Options ===&lt;br /&gt;    Option "UseFastTLS"                 "0"&lt;br /&gt;    Option "BlockSignalsOnLock"         "on"&lt;br /&gt;    Option "UseInternalAGPGART"         "yes"&lt;br /&gt;    Option "ForceGenericCPU"            "no"&lt;br /&gt;    BusID "PCI:1:0:0"    # vendor=1002, device=4e48&lt;br /&gt;    Screen 0&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;    Identifier                          "ATI Graphics Adapter connector 1"&lt;br /&gt;    Driver                              "fglrx"&lt;br /&gt;    BusID "PCI:1:0:0"    # vendor=1002, device=4e48&lt;br /&gt;    Screen 1&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# Screen sections&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# Any number of screen sections may be present.  Each describes&lt;br /&gt;# the configuration of a single screen.  A single specific screen section&lt;br /&gt;# may be specified from the X server command line with the "-screen"&lt;br /&gt;# option.&lt;br /&gt;Section "Screen"&lt;br /&gt;    Identifier  "Screen0"&lt;br /&gt;    Device      "ATI Graphics Adapter connector 0"&lt;br /&gt;    Monitor     "Monitor0"&lt;br /&gt;    DefaultDepth 24&lt;br /&gt;    #Option "backingstore"&lt;br /&gt;&lt;br /&gt;    Subsection "Display"&lt;br /&gt;        Depth       24&lt;br /&gt;        Modes       "1600x1200"&lt;br /&gt;        ViewPort    0 0  # initial origin if mode is smaller than desktop&lt;br /&gt;#        Virtual     1280 1024&lt;br /&gt;    EndSubsection&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Screen"&lt;br /&gt;    Identifier  "Screen1"&lt;br /&gt;    Device      "ATI Graphics Adapter connector 1"&lt;br /&gt;    Monitor     "Monitor1"&lt;br /&gt;    DefaultDepth 24&lt;br /&gt;    #Option "backingstore"&lt;br /&gt;&lt;br /&gt;    Subsection "Display"&lt;br /&gt;        Depth       24&lt;br /&gt;        Modes       "1600x1200"&lt;br /&gt;        ViewPort    0 0  # initial origin if mode is smaller than desktop&lt;br /&gt;#        Virtual     1280 1024&lt;br /&gt;    EndSubsection&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;# **********************************************************************&lt;br /&gt;# ServerLayout sections.&lt;br /&gt;# **********************************************************************&lt;br /&gt;&lt;br /&gt;# Any number of ServerLayout sections may be present.  Each describes&lt;br /&gt;# the way multiple screens are organised.  A specific ServerLayout&lt;br /&gt;# section may be specified from the X server command line with the&lt;br /&gt;# "-layout" option.  In the absence of this, the first section is used.&lt;br /&gt;# When now ServerLayout section is present, the first Screen section&lt;br /&gt;# is used alone.&lt;br /&gt;&lt;br /&gt;Section "ServerLayout"&lt;br /&gt;&lt;br /&gt;# The Identifier line must be present&lt;br /&gt;    Identifier  "Server Layout"&lt;br /&gt;&lt;br /&gt;# Each Screen line specifies a Screen section name, and optionally&lt;br /&gt;# the relative position of other screens.  The four names after&lt;br /&gt;# primary screen name are the screens to the top, bottom, left and right&lt;br /&gt;# of the primary screen.&lt;br /&gt;&lt;br /&gt;    Screen "Screen0"&lt;br /&gt;    Screen "Screen1" LeftOf "Screen0"&lt;br /&gt;&lt;br /&gt;# Each InputDevice line specifies an InputDevice section name and&lt;br /&gt;# optionally some options to specify the way the device is to be&lt;br /&gt;# used.  Those options include "CorePointer", "CoreKeyboard" and&lt;br /&gt;# "SendCoreEvents".&lt;br /&gt;&lt;br /&gt;    InputDevice "Mouse1" "CorePointer"&lt;br /&gt;    InputDevice "Keyboard1" "CoreKeyboard"&lt;br /&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;### EOF ###&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114772610452394176?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114772610452394176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114772610452394176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114772610452394176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114772610452394176'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/radeon-9800-dual-head-ubuntu-510.html' title='Radeon 9800 Dual-head Ubuntu 5.10'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114772191892111467</id><published>2006-05-15T13:36:00.000-06:00</published><updated>2006-05-15T13:38:42.730-06:00</updated><title type='text'>Ubuntu Radeon</title><content type='html'>https://wiki.ubuntu.com/BinaryDriverHowto/ATI&lt;br /&gt;completed 1-5&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7643289-114772191892111467?l=rcrblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcrblog.blogspot.com/feeds/114772191892111467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7643289&amp;postID=114772191892111467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114772191892111467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7643289/posts/default/114772191892111467'/><link rel='alternate' type='text/html' href='http://rcrblog.blogspot.com/2006/05/ubuntu-radeon.html' title='Ubuntu Radeon'/><author><name>RR</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7643289.post-114531114518607487</id><published>2006-04-17T15:53:00.000-06:00</published><updated>2006-04-17T15:59:05.636-06:00</updated><title type='text'>Final accelerometer code</title><content type='html'>I should put all of this into a PDF and document it better, if I have time before the semester ends I'll do it. Best to get it out here in case something comes up.&lt;br /&gt;&lt;br /&gt;As it is, pressing switch1 on the board will read data from the accelerometer and store it an array of size 32. The tickCntr isn't exactly accurate, but I'm out of time to do finite testing/adjusting TPM2.&lt;br /&gt;&lt;br /&gt;main.c:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &lt;hidef.h&gt; /* for EnableInterrupts macro */&lt;br /&gt;#include "derivative.h" /* include peripheral declarations */&lt;br /&gt;#include "m68demo908gb60.h"&lt;br /&gt;#include "accelData.h"&lt;br /&gt;&lt;br /&gt;#define EMPTY 0&lt;br /&gt;#define READY 1&lt;br /&gt;#define HAVE_DATA 1&lt;br /&gt;#define ENABLED 1&lt;br /&gt;#define DISABLED 0&lt;br /&gt;#define PRESCALAR 7&lt;br /&gt;#define MODULUS_50hz 1475&lt;br /&gt;#define MODULUS_200hz (MODULUS_50hz /4)&lt;br /&gt;&lt;br /&gt;#define STATE_WAITING_CALIBRATION 1&lt;br /&gt;#define STATE_WAITING_INITIALIZATION 2&lt;br /&gt;#define STATE_RECEIVE_READY 3&lt;br /&gt;#define STATE_RECEIVING 4&lt;br /&gt;#define STATE_CALIBRATION_HOSED 5&lt;br /&gt;#define STATE_DO_READ 6&lt;br /&gt;#define STATE_DO_DATA_STORE 7&lt;br /&gt;&lt;br /&gt;#define CALIBRATION_RESPONSE_CHAR 72&lt;br /&gt;#define REQUEST_BYTE_STRING_CHAR 71&lt;br /&gt;#define RESPONSE_BYTE_STRING_SIZE 10&lt;br /&gt;&lt;br /&gt;int state = STATE_WAITING_CALIBRATION;&lt;br /&gt;&lt;br /&gt;#define INITIALIZED 1&lt;br /&gt;#define INITIALIZED_NECESSARY 0&lt;br /&gt;int initialized = INITIALIZED_NECESSARY;&lt;br /&gt;&lt;br /&gt;long receiveCnt = 0;&lt;br /&gt;int head = 0;&lt;br /&gt;int readOverflow = 0;&lt;br /&gt;#define BUFFER_LENGTH 6&lt;br /&gt;byte readbuffer[BUFFER_LENGTH] ;&lt;br /&gt;&lt;br /&gt;long cntr=0;  &lt;br /&gt;&lt;br /&gt;long tickCntr = 0;&lt;br /&gt;int seconds = 0;&lt;br /&gt;&lt;br /&gt;int readByteCounter = 0;&lt;br /&gt;#define ACCEL_BUFFER_LENGTH 32&lt;br /&gt;int accelHead = 0;&lt;br /&gt;AccelData accelDataBuffer[ACCEL_BUFFER_LENGTH];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void MCU_init(void); /* Device initialization function declaration */&lt;br /&gt;byte readBuffer;&lt;br /&gt;byte tempReadBuffer;&lt;br /&gt;&lt;br /&gt;void enableTransmission(){ &lt;br /&gt; SCI2C2_TE = ENABLED;&lt;br /&gt; SCI2C2_RE = ENABLED;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;void enableReceive(){&lt;br /&gt; SCI2C2_TE = ENABLED;//transmitter enabled&lt;br /&gt; SCI2C2_RE = ENABLED;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* Accelerometer calibration function&lt;br /&gt;*/&lt;br /&gt;void calibrateAccelerometer(){&lt;br /&gt; enableTransmission();&lt;br /&gt; SCI2D = 0b01010010;                                                                &lt;br /&gt; &lt;br /&gt; readBuffer = SCI2D;&lt;br /&gt; if(readBuffer != CALIBRATION_RESPONSE_CHAR){&lt;br /&gt;   state = STATE_CALIBRATION_HOSED;&lt;br /&gt; }&lt;br /&gt; readbuffer[0] = 0;&lt;br /&gt; readbuffer[1] = 0;&lt;br /&gt; readbuffer[2] = 0;&lt;br /&gt; readbuffer[3] = 0;&lt;br /&gt; readbuffer[4] = 0;&lt;br /&gt; readbuffer[5] = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* SCI1 initialization function&lt;br /&gt;*/&lt;br /&gt;void initSCI2(){&lt;br /&gt; &lt;br /&gt; //SCI2BDL=0b00100001;//37878, 33 = 20Mhz/16*384000, where BaudRate = clock/(16*prescalar)&lt;br /&gt; SCI2BDL=0b00100000;//39062, 32 = 20Mhz/16*384000, where BaudRate = clock/(16*prescalar)&lt;br /&gt; SCI2C2_RIE = 1;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* TPM2 initialization function&lt;br /&gt;*/&lt;br /&gt;void initTimer2_200hz(){//max rate that accelerometer can sample&lt;br /&gt;  /*configure Internal Clock Generator [ICG]*/&lt;br /&gt;  /*MFD[]={4,6,8,10,12,14,16,18}*/&lt;br /&gt;  ICGC2_MFD = 7; &lt;br /&gt;  ICGC2_RFD = 0; /* RFD[]={1,2,4,8,16,32,64,128}*/&lt;br /&gt;&lt;br /&gt;  ICGC1 = 0b00111000; &lt;br /&gt;  &lt;br /&gt;  while((ICGS1_LOCK==0)||(ICGS1_ERCS==0)){&lt;br /&gt;  /*Ensure COP doesn't reset device whilst waiting for clock lock*/&lt;br /&gt;  __RESET_WATCHDOG(); /* kicks the dog */&lt;br /&gt;  }&lt;br /&gt;  ICGC2_LOCRE = 1; /*enable reset if clock fails*/&lt;br /&gt;  &lt;br /&gt;  TPM2C0SC_CH0IE = 1;  //enable channel 0 &lt;br /&gt;   &lt;br /&gt;  TPM2SC_CLKSA = 1;/*Select BUS clock*/&lt;br /&gt;  TPM2SC_CLKSB = 0;&lt;br /&gt;&lt;br /&gt;  TPM2SC_PS = PRESCALAR;/*clock source divided by prescalar*/&lt;br /&gt;  TPM2MOD = MODULUS_50hz;&lt;br /&gt;  &lt;br /&gt;  TPM2SC_CPWMS = 1;&lt;br /&gt;  /*configure PWM mode and pulse*/&lt;br /&gt;  TPM2C0SC_MS0B = 1; /*MS0B=1, MS0A=0; &lt;&lt; Edge align PWM*/&lt;br /&gt;  TPM2C0SC_ELS0A = 1; /*Select low as true*/&lt;br /&gt;  TPM2C0V = MODULUS_50hz-1; //100% PWM&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* TPM2 Channel 0 timer overflow interrupt function&lt;br /&gt;*/&lt;br /&gt;void interrupt VTimer2Chnl0 intTimer2Chnl0(){&lt;br /&gt;    &lt;br /&gt;    tickCntr ++;&lt;br /&gt;    if(tickCntr % 100 == 0){&lt;br /&gt;      seconds++;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    TPM2C0SC_CH0F = 0;//reset overflow flag&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void initKeyboardInterrupt(){&lt;br /&gt;  KBI1SC_KBIE = 1;  //KBIE =&gt;Keyboard Interrupt Enable&lt;br /&gt;  KBI1PE_KBIPE4 = 1; //Keyboard Interrupt Port Enable 4 (switch1)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* SWITCH1 interrupt function sets state for accelerometer data retrieval&lt;br /&gt;*/&lt;br /&gt;void interrupt Vkeyboard intSwitch(){&lt;br /&gt;  if(SWITCH1 == DOWN){&lt;br /&gt;    state = STATE_DO_READ;&lt;br /&gt;    LED1 = ~LED1;&lt;br /&gt;  }&lt;br /&gt;  KBI1SC_KBACK = 1;//ack&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* SCI2 Receive interrupt function to handle data input from acceleromter&lt;br /&gt;*/&lt;br /&gt;void interrupt VSCI2_RX intRx(){&lt;br /&gt;  tempReadBuffer = SCI2S1;&lt;br /&gt;  tempReadBuffer = SCI2D;&lt;br /&gt;  if(tempReadBuffer != CALIBRATION_RESPONSE_CHAR){&lt;br /&gt;    &lt;br /&gt;    if(readByteCounter == 2 &lt;br /&gt;      || readByteCounter ==3 &lt;br /&gt;      || readByteCounter == 4 &lt;br /&gt;      || readByteCounter ==5 &lt;br /&gt;      || readByteCounter == 6 &lt;br /&gt;      || readByteCounter == 7){&lt;br /&gt;    &lt;br /&gt;      readbuffer[head] = tempReadBuffer;&lt;br /&gt;      head++;&lt;br /&gt;      LED2 = ~LED2;&lt;br /&gt;      &lt;br /&gt;    } &lt;br /&gt;    &lt;br /&gt;    readByteCounter ++;&lt;br /&gt;  &lt;br /&gt;    if(readByteCounter == 10){&lt;br /&gt;      head = 0;&lt;br /&gt;      state = STATE_DO_DATA_STORE; &lt;br /&gt;      &lt;br /&gt;    } else{&lt;br /&gt;      state = STATE_RECEIVING;&lt;br /&gt;    }&lt;br /&gt;  &lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* Function to handle storing readbuffer data into the accelDataBuffer&lt;br /&gt;*/&lt;br /&gt;void storeAccelData(){&lt;br /&gt;  accelDataBuffer[accelHead].msb_x = readbuffer[0];&lt;br /&gt;  accelDataBuffer[accelHead].lsb_x = readbuffer[1];&lt;br /&gt;  accelDataBuffer[accelHead].msb_y = readbuffer[2];&lt;br /&gt;  accelDataBuffer[accelHead].lsb_y = readbuffer[3];&lt;br /&gt;  accelDataBuffer[accelHead].msb_z = readbuffer[4];&lt;br /&gt;  accelDataBuffer[accelHead].lsb_z = readbuffer[5];&lt;br /&gt;  accelDataBuffer[accelHead].millis_snapshot = tickCntr;&lt;br /&gt;  &lt;br /&gt;  accelHead++;&lt;br /&gt;  &lt;br /&gt;  if(accelHead == ACCEL_BUFFER_LENGTH){&lt;br /&gt;    accelHead = 0;&lt;br /&gt;    readOverflow = 1; &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  state = STATE_RECEIVE_READY;&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* Function to send the request to the accelerometer for a snapshot of data&lt;br /&gt;*/&lt;br /&gt;void readAccelValues(){&lt;br /&gt; enableTransmission();&lt;br /&gt; state = STATE_RECEIVE_READY;&lt;br /&gt; readByteCounter = 0;&lt;br /&gt; &lt;br /&gt; SCI2D = REQUEST_BYTE_STRING_CHAR; //send the 'G' char to request data from the accelerometer &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void main(void) {&lt;br /&gt;&lt;br /&gt;  EnableInterrupts; /* enable interrupts */&lt;br /&gt;  PTADD = 0; //initialize as input (Data Direction Register)&lt;br /&gt;  PTAPE = 0xf0; //Pullups on upper 4 bits&lt;br /&gt;  /*initialize bits 0-3 of Port F as outputs (connected to led's)*/&lt;br /&gt;  PTFDD = 0x0f;&lt;br /&gt;  PTDDD = 0x0f;&lt;br /&gt;  &lt;br /&gt;  LED1 = OFF; &lt;br /&gt;  LED2 = OFF;&lt;br /&gt;  LED3 = OFF;&lt;br /&gt;  LED4 = OFF;&lt;br /&gt;  LED5 = OFF;&lt;br /&gt;  &lt;br /&gt;  initTimer2_200hz();&lt;br /&gt;  initSCI2();&lt;br /&gt;  initKeyboardInterrupt();&lt;br /&gt;  &lt;br /&gt;  SCI2C2_TE = DISABLED;&lt;br /&gt;  SCI2C2_RE = DISABLED;&lt;br /&gt;  calibrateAccelerometer();&lt;br /&gt;  state = STATE_WAITING_CALIBRATION; &lt;br /&gt;  &lt;br /&gt;  readAccelValues();   &lt;br /&gt;  for(;;) {&lt;br /&gt;    __RESET_WATCHDOG(); /* feeds the dog */&lt;br /&gt;  &lt;br /&gt;    if(state == STATE_DO_READ){&lt;br /&gt;      readAccelValues();&lt;br /&gt;    } else if (state == STATE_DO_DATA_STORE){&lt;br /&gt;      storeAccelData();&lt;br /&gt;      state = STATE_RECEIVE_READY;&lt;br /&gt;    }&lt;br /&gt;  } /* loop forever */&lt;br /&gt;  /* please make sure that you never leave this function */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;accelData.h:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;typedef unsigned char byte;&lt;br /&gt;&lt;br /&gt;typedef struct {&lt;br /&gt;  byte msb_x;&lt;br /&gt;  byte lsb_x;&lt;br /&gt;  &lt;br /&gt;  byte msb_y;&lt;br /&gt;  byte lsb_y;&lt;br /&gt;  &lt;br /&gt;  byte msb_z;&lt;br /&gt;  byte lsb_z; &lt;br /&gt;  &lt;br /&gt;  long millis_snapshot;&lt;br /&gt;}AccelData;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;M68DEMO908GB60.h:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/* File: M68DEMO908GB60.h*/&lt;br /&gt;/* include peripheral declarations */&lt;br /&gt;#include &lt;MC9S08GB60.h&gt;&lt;br /&gt;/*define value for led's when on and off*/&lt;br /&gt;#define ON 0&lt;br /&gt;#define OFF 1&lt;br /&gt;/*define value for switches when up (not pressed) and down (pressed)*/&lt;br /&gt;#define UP 1&lt;br /&gt;#define DOWN 0&lt;br /&gt;/*define led's*/&lt;br /&gt;#define LED1 PTFD_PTFD0&lt;br /&gt;#define LED2 PTFD_PTFD1&lt;br /&gt;#define LED3 PTFD_PTFD2&lt;br /&gt;#define LED4 PTFD_PTFD3&lt;br /&gt;#define LED5 PTDD_PTDD0&lt;br /&gt;&lt;br /&gt;/*define switches*/&lt;br /&gt;#define SWITCH1 PTAD_PTAD4&lt;br /&gt;#define SWITCH2 PTAD_PTAD5&lt;br /&gt;#define SWITCH3 PTAD_PTAD6&lt;br /&gt;#define SWITCH4 PTAD_PTAD7&lt;br /&gt;&lt;br /&gt;#define Vspi 15&lt;br /&gt;#define Vkeyboard 22&lt;br /&gt;//define Timer1 interrupts&lt;br /&gt;#define VTimer1Overflow 8&lt;br /&gt;#define VTimer1Chnl2 7&lt;br /&gt;#define VTimer1Chnl1 6&lt;br /&gt;#define VTimer1Chnl0 5&lt;br /&gt;&lt;br /&gt;//define Timer2 interrupts&lt;br /&gt;#define VTimer2Overflow 14&lt;br /&gt;#define VTimer2Chnl4 13&lt;br /&gt;#define VTimer2Chnl3 12&lt;br /&gt;#define VTimer2Chnl2 11&lt;br /&gt;#define VTimer2Chnl1 10&lt;br /&gt;#define VTimer2Chnl0 9&lt;br /&gt;&lt;br /&gt;#define VSCI2_RX 20&lt;br /&gt;&lt;br /&gt;#define Vatd 23&lt;br /&gt;#define Viic 24&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;MC9S08GB60:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/* Based on CPU DB MC9S08GB60, version 2.87.163 (RegistersPrg V1.118) */&lt;br /&gt;/*&lt;br /&gt;** ###################################################################&lt;br /&gt;**     Filename  : MC9S08GB60.h&lt;br /&gt;**     Processor : MC9S08GB60CFU&lt;br /&gt;**     FileFormat: V1.118&lt;br /&gt;**     DataSheet : MC9S08GB60/D Rev. 2.3 12/2004&lt;br /&gt;**     Compiler  : Metrowerks C compiler&lt;br /&gt;**     Date/Time : 27.10.2005, 16:38&lt;br /&gt;**     Abstract  :&lt;br /&gt;**         This header implements the mapping of IO devices.&lt;br /&gt;**&lt;br /&gt;**     (c) Copyright UNIS, spol. s r.o. 1997-2003&lt;br /&gt;**     UNIS, spol. s r.o.&lt;br /&gt;**     Jundrovska 33&lt;br /&gt;**     624 00 Brno&lt;br /&gt;**     Czech Republic&lt;br /&gt;**     http      : www.processorexpert.com&lt;br /&gt;**     mail      : info@processorexpert.com&lt;br /&gt;** ###################################################################&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#ifndef _MC9S08GB60_H&lt;br /&gt;#define _MC9S08GB60_H&lt;br /&gt;&lt;br /&gt;/* Types definition */&lt;br /&gt;typedef unsigned char byte;&lt;br /&gt;typedef unsigned int word;&lt;br /&gt;typedef unsigned long dword;&lt;br /&gt;typedef unsigned long dlong[2];&lt;br /&gt;&lt;br /&gt;#ifndef __RESET_WATCHDOG_MACRO&lt;br /&gt;#define __RESET_WATCHDOG_MACRO&lt;br /&gt;/* Watchdog reset macro */&lt;br /&gt;#ifdef _lint&lt;br /&gt;  #define __RESET_WATCHDOG()  /* empty */&lt;br /&gt;#else&lt;br /&gt;  #define __RESET_WATCHDOG() {asm sta SRS;}  /* Just write a byte to feed the dog */&lt;br /&gt;#endif&lt;br /&gt;#endif /* __RESET_WATCHDOG_MACRO */&lt;br /&gt;&lt;br /&gt;#define REG_BASE 0x0000                /* Base address for the I/O register block */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#pragma MESSAGE DISABLE C1106 /* WARNING C1106: Non-standard bitfield type */&lt;br /&gt;&lt;br /&gt;/**************** interrupt vector table ****************/&lt;br /&gt;#define Vrti                    0x0000FFCC&lt;br /&gt;#define Viic1                   0x0000FFCE&lt;br /&gt;#define Vatd1                   0x0000FFD0&lt;br /&gt;#define Vkeyboard1              0x0000FFD2&lt;br /&gt;#define Vsci2tx                 0x0000FFD4&lt;br /&gt;#define Vsci2rx                 0x0000FFD6&lt;br /&gt;#define Vsci2err                0x0000FFD8&lt;br /&gt;#define Vsci1tx                 0x0000FFDA&lt;br /&gt;#define Vsci1rx                 0x0000FFDC&lt;br /&gt;#define Vsci1err                0x0000FFDE&lt;br /&gt;#define Vspi1                   0x0000FFE0&lt;br /&gt;#define Vtpm2ovf                0x0000FFE2//timer2 overflow interrupt vector&lt;br /&gt;#define Vtpm2ch4                0x0000FFE4&lt;br /&gt;#define Vtpm2ch3                0x0000FFE6&lt;br /&gt;#define Vtpm2ch2                0x0000FFE8&lt;br /&gt;#define Vtpm2ch1                0x0000FFEA&lt;br /&gt;#define Vtpm2ch0                0x0000FFEC&lt;br /&gt;#define Vtpm1ovf                0x0000FFEE//timer1 overflow interrupt vector&lt;br /&gt;#define Vtpm1ch2                0x0000FFF0&lt;br /&gt;#define Vtpm1ch1                0x0000FFF2&lt;br /&gt;#define Vtpm1ch0                0x0000FFF4&lt;br /&gt;#define Vicg                    0x0000FFF6&lt;br /&gt;#define Vlvd                    0x0000FFF8&lt;br /&gt;#define Virq                    0x0000FFFA&lt;br /&gt;#define Vswi                    0x0000FFFC&lt;br /&gt;#define Vreset                  0x0000FFFE&lt;br /&gt;&lt;br /&gt;/**************** registers I/O map ****************/&lt;br /&gt;&lt;br /&gt;/*** PTAD - Port A Data Register; 0x00000000 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTAD0       :1;                                       /* Port A Data Register Bit 0 */&lt;br /&gt;    byte PTAD1       :1;                                       /* Port A Data Register Bit 1 */&lt;br /&gt;    byte PTAD2       :1;                                       /* Port A Data Register Bit 2 */&lt;br /&gt;    byte PTAD3       :1;                                       /* Port A Data Register Bit 3 */&lt;br /&gt;    byte PTAD4       :1;                                       /* Port A Data Register Bit 4 */&lt;br /&gt;    byte PTAD5       :1;                                       /* Port A Data Register Bit 5 */&lt;br /&gt;    byte PTAD6       :1;                                       /* Port A Data Register Bit 6 */&lt;br /&gt;    byte PTAD7       :1;                                       /* Port A Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTADSTR;&lt;br /&gt;extern volatile PTADSTR _PTAD @0x00000000;&lt;br /&gt;#define PTAD                            _PTAD.Byte&lt;br /&gt;#define PTAD_PTAD0                      _PTAD.Bits.PTAD0&lt;br /&gt;#define PTAD_PTAD1                      _PTAD.Bits.PTAD1&lt;br /&gt;#define PTAD_PTAD2                      _PTAD.Bits.PTAD2&lt;br /&gt;#define PTAD_PTAD3                      _PTAD.Bits.PTAD3&lt;br /&gt;#define PTAD_PTAD4                      _PTAD.Bits.PTAD4&lt;br /&gt;#define PTAD_PTAD5                      _PTAD.Bits.PTAD5&lt;br /&gt;#define PTAD_PTAD6                      _PTAD.Bits.PTAD6&lt;br /&gt;#define PTAD_PTAD7                      _PTAD.Bits.PTAD7&lt;br /&gt;&lt;br /&gt;#define PTAD_PTAD0_MASK                 1&lt;br /&gt;#define PTAD_PTAD1_MASK                 2&lt;br /&gt;#define PTAD_PTAD2_MASK                 4&lt;br /&gt;#define PTAD_PTAD3_MASK                 8&lt;br /&gt;#define PTAD_PTAD4_MASK                 16&lt;br /&gt;#define PTAD_PTAD5_MASK                 32&lt;br /&gt;#define PTAD_PTAD6_MASK                 64&lt;br /&gt;#define PTAD_PTAD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTAPE - Pullup Enable for Port A; 0x00000001 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTAPE0      :1;                                       /* Pullup Enable for Port A Bit 0 */&lt;br /&gt;    byte PTAPE1      :1;                                       /* Pullup Enable for Port A Bit 1 */&lt;br /&gt;    byte PTAPE2      :1;                                       /* Pullup Enable for Port A Bit 2 */&lt;br /&gt;    byte PTAPE3      :1;                                       /* Pullup Enable for Port A Bit 3 */&lt;br /&gt;    byte PTAPE4      :1;                                       /* Pullup Enable for Port A Bit 4 */&lt;br /&gt;    byte PTAPE5      :1;                                       /* Pullup Enable for Port A Bit 5 */&lt;br /&gt;    byte PTAPE6      :1;                                       /* Pullup Enable for Port A Bit 6 */&lt;br /&gt;    byte PTAPE7      :1;                                       /* Pullup Enable for Port A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTAPESTR;&lt;br /&gt;extern volatile PTAPESTR _PTAPE @0x00000001;&lt;br /&gt;#define PTAPE                           _PTAPE.Byte&lt;br /&gt;#define PTAPE_PTAPE0                    _PTAPE.Bits.PTAPE0&lt;br /&gt;#define PTAPE_PTAPE1                    _PTAPE.Bits.PTAPE1&lt;br /&gt;#define PTAPE_PTAPE2                    _PTAPE.Bits.PTAPE2&lt;br /&gt;#define PTAPE_PTAPE3                    _PTAPE.Bits.PTAPE3&lt;br /&gt;#define PTAPE_PTAPE4                    _PTAPE.Bits.PTAPE4&lt;br /&gt;#define PTAPE_PTAPE5                    _PTAPE.Bits.PTAPE5&lt;br /&gt;#define PTAPE_PTAPE6                    _PTAPE.Bits.PTAPE6&lt;br /&gt;#define PTAPE_PTAPE7                    _PTAPE.Bits.PTAPE7&lt;br /&gt;&lt;br /&gt;#define PTAPE_PTAPE0_MASK               1&lt;br /&gt;#define PTAPE_PTAPE1_MASK               2&lt;br /&gt;#define PTAPE_PTAPE2_MASK               4&lt;br /&gt;#define PTAPE_PTAPE3_MASK               8&lt;br /&gt;#define PTAPE_PTAPE4_MASK               16&lt;br /&gt;#define PTAPE_PTAPE5_MASK               32&lt;br /&gt;#define PTAPE_PTAPE6_MASK               64&lt;br /&gt;#define PTAPE_PTAPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTASE - Slew Rate Control Enable for Port A; 0x00000002 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTASE0      :1;                                       /* Slew Rate Control Enable for Port A Bit 0 */&lt;br /&gt;    byte PTASE1      :1;                                       /* Slew Rate Control Enable for Port A Bit 1 */&lt;br /&gt;    byte PTASE2      :1;                                       /* Slew Rate Control Enable for Port A Bit 2 */&lt;br /&gt;    byte PTASE3      :1;                                       /* Slew Rate Control Enable for Port A Bit 3 */&lt;br /&gt;    byte PTASE4      :1;                                       /* Slew Rate Control Enable for Port A Bit 4 */&lt;br /&gt;    byte PTASE5      :1;                                       /* Slew Rate Control Enable for Port A Bit 5 */&lt;br /&gt;    byte PTASE6      :1;                                       /* Slew Rate Control Enable for Port A Bit 6 */&lt;br /&gt;    byte PTASE7      :1;                                       /* Slew Rate Control Enable for Port A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTASESTR;&lt;br /&gt;extern volatile PTASESTR _PTASE @0x00000002;&lt;br /&gt;#define PTASE                           _PTASE.Byte&lt;br /&gt;#define PTASE_PTASE0                    _PTASE.Bits.PTASE0&lt;br /&gt;#define PTASE_PTASE1                    _PTASE.Bits.PTASE1&lt;br /&gt;#define PTASE_PTASE2                    _PTASE.Bits.PTASE2&lt;br /&gt;#define PTASE_PTASE3                    _PTASE.Bits.PTASE3&lt;br /&gt;#define PTASE_PTASE4                    _PTASE.Bits.PTASE4&lt;br /&gt;#define PTASE_PTASE5                    _PTASE.Bits.PTASE5&lt;br /&gt;#define PTASE_PTASE6                    _PTASE.Bits.PTASE6&lt;br /&gt;#define PTASE_PTASE7                    _PTASE.Bits.PTASE7&lt;br /&gt;&lt;br /&gt;#define PTASE_PTASE0_MASK               1&lt;br /&gt;#define PTASE_PTASE1_MASK               2&lt;br /&gt;#define PTASE_PTASE2_MASK               4&lt;br /&gt;#define PTASE_PTASE3_MASK               8&lt;br /&gt;#define PTASE_PTASE4_MASK               16&lt;br /&gt;#define PTASE_PTASE5_MASK               32&lt;br /&gt;#define PTASE_PTASE6_MASK               64&lt;br /&gt;#define PTASE_PTASE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTADD - Data Direction Register A; 0x00000003 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTADD0      :1;                                       /* Data Direction for Port A Bit 0 */&lt;br /&gt;    byte PTADD1      :1;                                       /* Data Direction for Port A Bit 1 */&lt;br /&gt;    byte PTADD2      :1;                                       /* Data Direction for Port A Bit 2 */&lt;br /&gt;    byte PTADD3      :1;                                       /* Data Direction for Port A Bit 3 */&lt;br /&gt;    byte PTADD4      :1;                                       /* Data Direction for Port A Bit 4 */&lt;br /&gt;    byte PTADD5      :1;                                       /* Data Direction for Port A Bit 5 */&lt;br /&gt;    byte PTADD6      :1;                                       /* Data Direction for Port A Bit 6 */&lt;br /&gt;    byte PTADD7      :1;                                       /* Data Direction for Port A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTADDSTR;&lt;br /&gt;extern volatile PTADDSTR _PTADD @0x00000003;&lt;br /&gt;#define PTADD                           _PTADD.Byte&lt;br /&gt;#define PTADD_PTADD0                    _PTADD.Bits.PTADD0&lt;br /&gt;#define PTADD_PTADD1                    _PTADD.Bits.PTADD1&lt;br /&gt;#define PTADD_PTADD2                    _PTADD.Bits.PTADD2&lt;br /&gt;#define PTADD_PTADD3                    _PTADD.Bits.PTADD3&lt;br /&gt;#define PTADD_PTADD4                    _PTADD.Bits.PTADD4&lt;br /&gt;#define PTADD_PTADD5                    _PTADD.Bits.PTADD5&lt;br /&gt;#define PTADD_PTADD6                    _PTADD.Bits.PTADD6&lt;br /&gt;#define PTADD_PTADD7                    _PTADD.Bits.PTADD7&lt;br /&gt;&lt;br /&gt;#define PTADD_PTADD0_MASK               1&lt;br /&gt;#define PTADD_PTADD1_MASK               2&lt;br /&gt;#define PTADD_PTADD2_MASK               4&lt;br /&gt;#define PTADD_PTADD3_MASK               8&lt;br /&gt;#define PTADD_PTADD4_MASK               16&lt;br /&gt;#define PTADD_PTADD5_MASK               32&lt;br /&gt;#define PTADD_PTADD6_MASK               64&lt;br /&gt;#define PTADD_PTADD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTBD - Port B Data Register; 0x00000004 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTBD0       :1;                                       /* Port B Data Register Bit 0 */&lt;br /&gt;    byte PTBD1       :1;                                       /* Port B Data Register Bit 1 */&lt;br /&gt;    byte PTBD2       :1;                                       /* Port B Data Register Bit 2 */&lt;br /&gt;    byte PTBD3       :1;                                       /* Port B Data Register Bit 3 */&lt;br /&gt;    byte PTBD4       :1;                                       /* Port B Data Register Bit 4 */&lt;br /&gt;    byte PTBD5       :1;                                       /* Port B Data Register Bit 5 */&lt;br /&gt;    byte PTBD6       :1;                                       /* Port B Data Register Bit 6 */&lt;br /&gt;    byte PTBD7       :1;                                       /* Port B Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTBDSTR;&lt;br /&gt;extern volatile PTBDSTR _PTBD @0x00000004;&lt;br /&gt;#define PTBD                            _PTBD.Byte&lt;br /&gt;#define PTBD_PTBD0                      _PTBD.Bits.PTBD0&lt;br /&gt;#define PTBD_PTBD1                      _PTBD.Bits.PTBD1&lt;br /&gt;#define PTBD_PTBD2                      _PTBD.Bits.PTBD2&lt;br /&gt;#define PTBD_PTBD3                      _PTBD.Bits.PTBD3&lt;br /&gt;#define PTBD_PTBD4                      _PTBD.Bits.PTBD4&lt;br /&gt;#define PTBD_PTBD5                      _PTBD.Bits.PTBD5&lt;br /&gt;#define PTBD_PTBD6                      _PTBD.Bits.PTBD6&lt;br /&gt;#define PTBD_PTBD7                      _PTBD.Bits.PTBD7&lt;br /&gt;&lt;br /&gt;#define PTBD_PTBD0_MASK                 1&lt;br /&gt;#define PTBD_PTBD1_MASK                 2&lt;br /&gt;#define PTBD_PTBD2_MASK                 4&lt;br /&gt;#define PTBD_PTBD3_MASK                 8&lt;br /&gt;#define PTBD_PTBD4_MASK                 16&lt;br /&gt;#define PTBD_PTBD5_MASK                 32&lt;br /&gt;#define PTBD_PTBD6_MASK                 64&lt;br /&gt;#define PTBD_PTBD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTBPE - Pullup Enable for Port B; 0x00000005 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTBPE0      :1;                                       /* Pullup Enable for Port B Bit 0 */&lt;br /&gt;    byte PTBPE1      :1;                                       /* Pullup Enable for Port B Bit 1 */&lt;br /&gt;    byte PTBPE2      :1;                                       /* Pullup Enable for Port B Bit 2 */&lt;br /&gt;    byte PTBPE3      :1;                                       /* Pullup Enable for Port B Bit 3 */&lt;br /&gt;    byte PTBPE4      :1;                                       /* Pullup Enable for Port B Bit 4 */&lt;br /&gt;    byte PTBPE5      :1;                                       /* Pullup Enable for Port B Bit 5 */&lt;br /&gt;    byte PTBPE6      :1;                                       /* Pullup Enable for Port B Bit 6 */&lt;br /&gt;    byte PTBPE7      :1;                                       /* Pullup Enable for Port B Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTBPESTR;&lt;br /&gt;extern volatile PTBPESTR _PTBPE @0x00000005;&lt;br /&gt;#define PTBPE                           _PTBPE.Byte&lt;br /&gt;#define PTBPE_PTBPE0                    _PTBPE.Bits.PTBPE0&lt;br /&gt;#define PTBPE_PTBPE1                    _PTBPE.Bits.PTBPE1&lt;br /&gt;#define PTBPE_PTBPE2                    _PTBPE.Bits.PTBPE2&lt;br /&gt;#define PTBPE_PTBPE3                    _PTBPE.Bits.PTBPE3&lt;br /&gt;#define PTBPE_PTBPE4                    _PTBPE.Bits.PTBPE4&lt;br /&gt;#define PTBPE_PTBPE5                    _PTBPE.Bits.PTBPE5&lt;br /&gt;#define PTBPE_PTBPE6                    _PTBPE.Bits.PTBPE6&lt;br /&gt;#define PTBPE_PTBPE7                    _PTBPE.Bits.PTBPE7&lt;br /&gt;&lt;br /&gt;#define PTBPE_PTBPE0_MASK               1&lt;br /&gt;#define PTBPE_PTBPE1_MASK               2&lt;br /&gt;#define PTBPE_PTBPE2_MASK               4&lt;br /&gt;#define PTBPE_PTBPE3_MASK               8&lt;br /&gt;#define PTBPE_PTBPE4_MASK               16&lt;br /&gt;#define PTBPE_PTBPE5_MASK               32&lt;br /&gt;#define PTBPE_PTBPE6_MASK               64&lt;br /&gt;#define PTBPE_PTBPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTBSE - Slew Rate Control Enable for Port B; 0x00000006 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTBSE0      :1;                                       /* Slew Rate Control Enable for Port B Bit 0 */&lt;br /&gt;    byte PTBSE1      :1;                                       /* Slew Rate Control Enable for Port B Bit 1 */&lt;br /&gt;    byte PTBSE2      :1;                                       /* Slew Rate Control Enable for Port B Bit 2 */&lt;br /&gt;    byte PTBSE3      :1;                                       /* Slew Rate Control Enable for Port B Bit 3 */&lt;br /&gt;    byte PTBSE4      :1;                                       /* Slew Rate Control Enable for Port B Bit 4 */&lt;br /&gt;    byte PTBSE5      :1;                                       /* Slew Rate Control Enable for Port B Bit 5 */&lt;br /&gt;    byte PTBSE6      :1;                                       /* Slew Rate Control Enable for Port B Bit 6 */&lt;br /&gt;    byte PTBSE7      :1;                                       /* Slew Rate Control Enable for Port B Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTBSESTR;&lt;br /&gt;extern volatile PTBSESTR _PTBSE @0x00000006;&lt;br /&gt;#define PTBSE                           _PTBSE.Byte&lt;br /&gt;#define PTBSE_PTBSE0                    _PTBSE.Bits.PTBSE0&lt;br /&gt;#define PTBSE_PTBSE1                    _PTBSE.Bits.PTBSE1&lt;br /&gt;#define PTBSE_PTBSE2                    _PTBSE.Bits.PTBSE2&lt;br /&gt;#define PTBSE_PTBSE3                    _PTBSE.Bits.PTBSE3&lt;br /&gt;#define PTBSE_PTBSE4                    _PTBSE.Bits.PTBSE4&lt;br /&gt;#define PTBSE_PTBSE5                    _PTBSE.Bits.PTBSE5&lt;br /&gt;#define PTBSE_PTBSE6                    _PTBSE.Bits.PTBSE6&lt;br /&gt;#define PTBSE_PTBSE7                    _PTBSE.Bits.PTBSE7&lt;br /&gt;&lt;br /&gt;#define PTBSE_PTBSE0_MASK               1&lt;br /&gt;#define PTBSE_PTBSE1_MASK               2&lt;br /&gt;#define PTBSE_PTBSE2_MASK               4&lt;br /&gt;#define PTBSE_PTBSE3_MASK               8&lt;br /&gt;#define PTBSE_PTBSE4_MASK               16&lt;br /&gt;#define PTBSE_PTBSE5_MASK               32&lt;br /&gt;#define PTBSE_PTBSE6_MASK               64&lt;br /&gt;#define PTBSE_PTBSE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTBDD - Data Direction Register B; 0x00000007 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTBDD0      :1;                                       /* Data Direction for Port B Bit 0 */&lt;br /&gt;    byte PTBDD1      :1;                                       /* Data Direction for Port B Bit 1 */&lt;br /&gt;    byte PTBDD2      :1;                                       /* Data Direction for Port B Bit 2 */&lt;br /&gt;    byte PTBDD3      :1;                                       /* Data Direction for Port B Bit 3 */&lt;br /&gt;    byte PTBDD4      :1;                                       /* Data Direction for Port B Bit 4 */&lt;br /&gt;    byte PTBDD5      :1;                                       /* Data Direction for Port B Bit 5 */&lt;br /&gt;    byte PTBDD6      :1;                                       /* Data Direction for Port B Bit 6 */&lt;br /&gt;    byte PTBDD7      :1;                                       /* Data Direction for Port B Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTBDDSTR;&lt;br /&gt;extern volatile PTBDDSTR _PTBDD @0x00000007;&lt;br /&gt;#define PTBDD                           _PTBDD.Byte&lt;br /&gt;#define PTBDD_PTBDD0                    _PTBDD.Bits.PTBDD0&lt;br /&gt;#define PTBDD_PTBDD1                    _PTBDD.Bits.PTBDD1&lt;br /&gt;#define PTBDD_PTBDD2                    _PTBDD.Bits.PTBDD2&lt;br /&gt;#define PTBDD_PTBDD3                    _PTBDD.Bits.PTBDD3&lt;br /&gt;#define PTBDD_PTBDD4                    _PTBDD.Bits.PTBDD4&lt;br /&gt;#define PTBDD_PTBDD5                    _PTBDD.Bits.PTBDD5&lt;br /&gt;#define PTBDD_PTBDD6                    _PTBDD.Bits.PTBDD6&lt;br /&gt;#define PTBDD_PTBDD7                    _PTBDD.Bits.PTBDD7&lt;br /&gt;&lt;br /&gt;#define PTBDD_PTBDD0_MASK               1&lt;br /&gt;#define PTBDD_PTBDD1_MASK               2&lt;br /&gt;#define PTBDD_PTBDD2_MASK               4&lt;br /&gt;#define PTBDD_PTBDD3_MASK               8&lt;br /&gt;#define PTBDD_PTBDD4_MASK               16&lt;br /&gt;#define PTBDD_PTBDD5_MASK               32&lt;br /&gt;#define PTBDD_PTBDD6_MASK               64&lt;br /&gt;#define PTBDD_PTBDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTCD - Port C Data Register; 0x00000008 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTCD0       :1;                                       /* Port C Data Register Bit 0 */&lt;br /&gt;    byte PTCD1       :1;                                       /* Port C Data Register Bit 1 */&lt;br /&gt;    byte PTCD2       :1;                                       /* Port C Data Register Bit 2 */&lt;br /&gt;    byte PTCD3       :1;                                       /* Port C Data Register Bit 3 */&lt;br /&gt;    byte PTCD4       :1;                                       /* Port C Data Register Bit 4 */&lt;br /&gt;    byte PTCD5       :1;                                       /* Port C Data Register Bit 5 */&lt;br /&gt;    byte PTCD6       :1;                                       /* Port C Data Register Bit 6 */&lt;br /&gt;    byte PTCD7       :1;                                       /* Port C Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTCDSTR;&lt;br /&gt;extern volatile PTCDSTR _PTCD @0x00000008;&lt;br /&gt;#define PTCD                            _PTCD.Byte&lt;br /&gt;#define PTCD_PTCD0                      _PTCD.Bits.PTCD0&lt;br /&gt;#define PTCD_PTCD1                      _PTCD.Bits.PTCD1&lt;br /&gt;#define PTCD_PTCD2                      _PTCD.Bits.PTCD2&lt;br /&gt;#define PTCD_PTCD3                      _PTCD.Bits.PTCD3&lt;br /&gt;#define PTCD_PTCD4                      _PTCD.Bits.PTCD4&lt;br /&gt;#define PTCD_PTCD5                      _PTCD.Bits.PTCD5&lt;br /&gt;#define PTCD_PTCD6                      _PTCD.Bits.PTCD6&lt;br /&gt;#define PTCD_PTCD7                      _PTCD.Bits.PTCD7&lt;br /&gt;&lt;br /&gt;#define PTCD_PTCD0_MASK                 1&lt;br /&gt;#define PTCD_PTCD1_MASK                 2&lt;br /&gt;#define PTCD_PTCD2_MASK                 4&lt;br /&gt;#define PTCD_PTCD3_MASK                 8&lt;br /&gt;#define PTCD_PTCD4_MASK                 16&lt;br /&gt;#define PTCD_PTCD5_MASK                 32&lt;br /&gt;#define PTCD_PTCD6_MASK                 64&lt;br /&gt;#define PTCD_PTCD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTCPE - Pullup Enable for Port C; 0x00000009 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTCPE0      :1;                                       /* Pullup Enable for Port C Bit 0 */&lt;br /&gt;    byte PTCPE1      :1;                                       /* Pullup Enable for Port C Bit 1 */&lt;br /&gt;    byte PTCPE2      :1;                                       /* Pullup Enable for Port C Bit 2 */&lt;br /&gt;    byte PTCPE3      :1;                                       /* Pullup Enable for Port C Bit 3 */&lt;br /&gt;    byte PTCPE4      :1;                                       /* Pullup Enable for Port C Bit 4 */&lt;br /&gt;    byte PTCPE5      :1;                                       /* Pullup Enable for Port C Bit 5 */&lt;br /&gt;    byte PTCPE6      :1;                                       /* Pullup Enable for Port C Bit 6 */&lt;br /&gt;    byte PTCPE7      :1;                                       /* Pullup Enable for Port C Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTCPESTR;&lt;br /&gt;extern volatile PTCPESTR _PTCPE @0x00000009;&lt;br /&gt;#define PTCPE                           _PTCPE.Byte&lt;br /&gt;#define PTCPE_PTCPE0                    _PTCPE.Bits.PTCPE0&lt;br /&gt;#define PTCPE_PTCPE1                    _PTCPE.Bits.PTCPE1&lt;br /&gt;#define PTCPE_PTCPE2                    _PTCPE.Bits.PTCPE2&lt;br /&gt;#define PTCPE_PTCPE3                    _PTCPE.Bits.PTCPE3&lt;br /&gt;#define PTCPE_PTCPE4                    _PTCPE.Bits.PTCPE4&lt;br /&gt;#define PTCPE_PTCPE5                    _PTCPE.Bits.PTCPE5&lt;br /&gt;#define PTCPE_PTCPE6                    _PTCPE.Bits.PTCPE6&lt;br /&gt;#define PTCPE_PTCPE7                    _PTCPE.Bits.PTCPE7&lt;br /&gt;&lt;br /&gt;#define PTCPE_PTCPE0_MASK               1&lt;br /&gt;#define PTCPE_PTCPE1_MASK               2&lt;br /&gt;#define PTCPE_PTCPE2_MASK               4&lt;br /&gt;#define PTCPE_PTCPE3_MASK               8&lt;br /&gt;#define PTCPE_PTCPE4_MASK               16&lt;br /&gt;#define PTCPE_PTCPE5_MASK               32&lt;br /&gt;#define PTCPE_PTCPE6_MASK               64&lt;br /&gt;#define PTCPE_PTCPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTCSE - Slew Rate Control Enable for Port C; 0x0000000A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTCSE0      :1;                                       /* Slew Rate Control Enable for Port C Bit 0 */&lt;br /&gt;    byte PTCSE1      :1;                                       /* Slew Rate Control Enable for Port C Bit 1 */&lt;br /&gt;    byte PTCSE2      :1;                                       /* Slew Rate Control Enable for Port C Bit 2 */&lt;br /&gt;    byte PTCSE3      :1;                                       /* Slew Rate Control Enable for Port C Bit 3 */&lt;br /&gt;    byte PTCSE4      :1;                                       /* Slew Rate Control Enable for Port C Bit 4 */&lt;br /&gt;    byte PTCSE5      :1;                                       /* Slew Rate Control Enable for Port C Bit 5 */&lt;br /&gt;    byte PTCSE6      :1;                                       /* Slew Rate Control Enable for Port C Bit 6 */&lt;br /&gt;    byte PTCSE7      :1;                                       /* Slew Rate Control Enable for Port C Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTCSESTR;&lt;br /&gt;extern volatile PTCSESTR _PTCSE @0x0000000A;&lt;br /&gt;#define PTCSE                           _PTCSE.Byte&lt;br /&gt;#define PTCSE_PTCSE0                    _PTCSE.Bits.PTCSE0&lt;br /&gt;#define PTCSE_PTCSE1                    _PTCSE.Bits.PTCSE1&lt;br /&gt;#define PTCSE_PTCSE2                    _PTCSE.Bits.PTCSE2&lt;br /&gt;#define PTCSE_PTCSE3                    _PTCSE.Bits.PTCSE3&lt;br /&gt;#define PTCSE_PTCSE4                    _PTCSE.Bits.PTCSE4&lt;br /&gt;#define PTCSE_PTCSE5                    _PTCSE.Bits.PTCSE5&lt;br /&gt;#define PTCSE_PTCSE6                    _PTCSE.Bits.PTCSE6&lt;br /&gt;#define PTCSE_PTCSE7                    _PTCSE.Bits.PTCSE7&lt;br /&gt;&lt;br /&gt;#define PTCSE_PTCSE0_MASK               1&lt;br /&gt;#define PTCSE_PTCSE1_MASK               2&lt;br /&gt;#define PTCSE_PTCSE2_MASK               4&lt;br /&gt;#define PTCSE_PTCSE3_MASK               8&lt;br /&gt;#define PTCSE_PTCSE4_MASK               16&lt;br /&gt;#define PTCSE_PTCSE5_MASK               32&lt;br /&gt;#define PTCSE_PTCSE6_MASK               64&lt;br /&gt;#define PTCSE_PTCSE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTCDD - Data Direction Register C; 0x0000000B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTCDD0      :1;                                       /* Data Direction for Port C Bit 0 */&lt;br /&gt;    byte PTCDD1      :1;                                       /* Data Direction for Port C Bit 1 */&lt;br /&gt;    byte PTCDD2      :1;                                       /* Data Direction for Port C Bit 2 */&lt;br /&gt;    byte PTCDD3      :1;                                       /* Data Direction for Port C Bit 3 */&lt;br /&gt;    byte PTCDD4      :1;                                       /* Data Direction for Port C Bit 4 */&lt;br /&gt;    byte PTCDD5      :1;                                       /* Data Direction for Port C Bit 5 */&lt;br /&gt;    byte PTCDD6      :1;                                       /* Data Direction for Port C Bit 6 */&lt;br /&gt;    byte PTCDD7      :1;                                       /* Data Direction for Port C Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTCDDSTR;&lt;br /&gt;extern volatile PTCDDSTR _PTCDD @0x0000000B;&lt;br /&gt;#define PTCDD                           _PTCDD.Byte&lt;br /&gt;#define PTCDD_PTCDD0                    _PTCDD.Bits.PTCDD0&lt;br /&gt;#define PTCDD_PTCDD1                    _PTCDD.Bits.PTCDD1&lt;br /&gt;#define PTCDD_PTCDD2                    _PTCDD.Bits.PTCDD2&lt;br /&gt;#define PTCDD_PTCDD3                    _PTCDD.Bits.PTCDD3&lt;br /&gt;#define PTCDD_PTCDD4                    _PTCDD.Bits.PTCDD4&lt;br /&gt;#define PTCDD_PTCDD5                    _PTCDD.Bits.PTCDD5&lt;br /&gt;#define PTCDD_PTCDD6                    _PTCDD.Bits.PTCDD6&lt;br /&gt;#define PTCDD_PTCDD7                    _PTCDD.Bits.PTCDD7&lt;br /&gt;&lt;br /&gt;#define PTCDD_PTCDD0_MASK               1&lt;br /&gt;#define PTCDD_PTCDD1_MASK               2&lt;br /&gt;#define PTCDD_PTCDD2_MASK               4&lt;br /&gt;#define PTCDD_PTCDD3_MASK               8&lt;br /&gt;#define PTCDD_PTCDD4_MASK               16&lt;br /&gt;#define PTCDD_PTCDD5_MASK               32&lt;br /&gt;#define PTCDD_PTCDD6_MASK               64&lt;br /&gt;#define PTCDD_PTCDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTDD - Port D Data Register; 0x0000000C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTDD0       :1;                                       /* Port D Data Register Bit 0 */&lt;br /&gt;    byte PTDD1       :1;                                       /* Port D Data Register Bit 1 */&lt;br /&gt;    byte PTDD2       :1;                                       /* Port D Data Register Bit 2 */&lt;br /&gt;    byte PTDD3       :1;                                       /* Port D Data Register Bit 3 */&lt;br /&gt;    byte PTDD4       :1;                                       /* Port D Data Register Bit 4 */&lt;br /&gt;    byte PTDD5       :1;                                       /* Port D Data Register Bit 5 */&lt;br /&gt;    byte PTDD6       :1;                                       /* Port D Data Register Bit 6 */&lt;br /&gt;    byte PTDD7       :1;                                       /* Port D Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTDDSTR;&lt;br /&gt;extern volatile PTDDSTR _PTDD @0x0000000C;&lt;br /&gt;#define PTDD                            _PTDD.Byte&lt;br /&gt;#define PTDD_PTDD0                      _PTDD.Bits.PTDD0&lt;br /&gt;#define PTDD_PTDD1                      _PTDD.Bits.PTDD1&lt;br /&gt;#define PTDD_PTDD2                      _PTDD.Bits.PTDD2&lt;br /&gt;#define PTDD_PTDD3                      _PTDD.Bits.PTDD3&lt;br /&gt;#define PTDD_PTDD4                      _PTDD.Bits.PTDD4&lt;br /&gt;#define PTDD_PTDD5                      _PTDD.Bits.PTDD5&lt;br /&gt;#define PTDD_PTDD6                      _PTDD.Bits.PTDD6&lt;br /&gt;#define PTDD_PTDD7                      _PTDD.Bits.PTDD7&lt;br /&gt;&lt;br /&gt;#define PTDD_PTDD0_MASK                 1&lt;br /&gt;#define PTDD_PTDD1_MASK                 2&lt;br /&gt;#define PTDD_PTDD2_MASK                 4&lt;br /&gt;#define PTDD_PTDD3_MASK                 8&lt;br /&gt;#define PTDD_PTDD4_MASK                 16&lt;br /&gt;#define PTDD_PTDD5_MASK                 32&lt;br /&gt;#define PTDD_PTDD6_MASK                 64&lt;br /&gt;#define PTDD_PTDD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTDPE - Pullup Enable for Port D; 0x0000000D ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTDPE0      :1;                                       /* Pullup Enable for Port D Bit 0 */&lt;br /&gt;    byte PTDPE1      :1;                                       /* Pullup Enable for Port D Bit 1 */&lt;br /&gt;    byte PTDPE2      :1;                                       /* Pullup Enable for Port D Bit 2 */&lt;br /&gt;    byte PTDPE3      :1;                                       /* Pullup Enable for Port D Bit 3 */&lt;br /&gt;    byte PTDPE4      :1;                                       /* Pullup Enable for Port D Bit 4 */&lt;br /&gt;    byte PTDPE5      :1;                                       /* Pullup Enable for Port D Bit 5 */&lt;br /&gt;    byte PTDPE6      :1;                                       /* Pullup Enable for Port D Bit 6 */&lt;br /&gt;    byte PTDPE7      :1;                                       /* Pullup Enable for Port D Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTDPESTR;&lt;br /&gt;extern volatile PTDPESTR _PTDPE @0x0000000D;&lt;br /&gt;#define PTDPE                           _PTDPE.Byte&lt;br /&gt;#define PTDPE_PTDPE0                    _PTDPE.Bits.PTDPE0&lt;br /&gt;#define PTDPE_PTDPE1                    _PTDPE.Bits.PTDPE1&lt;br /&gt;#define PTDPE_PTDPE2                    _PTDPE.Bits.PTDPE2&lt;br /&gt;#define PTDPE_PTDPE3                    _PTDPE.Bits.PTDPE3&lt;br /&gt;#define PTDPE_PTDPE4                    _PTDPE.Bits.PTDPE4&lt;br /&gt;#define PTDPE_PTDPE5                    _PTDPE.Bits.PTDPE5&lt;br /&gt;#define PTDPE_PTDPE6                    _PTDPE.Bits.PTDPE6&lt;br /&gt;#define PTDPE_PTDPE7                    _PTDPE.Bits.PTDPE7&lt;br /&gt;&lt;br /&gt;#define PTDPE_PTDPE0_MASK               1&lt;br /&gt;#define PTDPE_PTDPE1_MASK               2&lt;br /&gt;#define PTDPE_PTDPE2_MASK               4&lt;br /&gt;#define PTDPE_PTDPE3_MASK               8&lt;br /&gt;#define PTDPE_PTDPE4_MASK               16&lt;br /&gt;#define PTDPE_PTDPE5_MASK               32&lt;br /&gt;#define PTDPE_PTDPE6_MASK               64&lt;br /&gt;#define PTDPE_PTDPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTDSE - Slew Rate Control Enable for Port D; 0x0000000E ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTDSE0      :1;                                       /* Slew Rate Control Enable for Port D Bit 0 */&lt;br /&gt;    byte PTDSE1      :1;                                       /* Slew Rate Control Enable for Port D Bit 1 */&lt;br /&gt;    byte PTDSE2      :1;                                       /* Slew Rate Control Enable for Port D Bit 2 */&lt;br /&gt;    byte PTDSE3      :1;                                       /* Slew Rate Control Enable for Port D Bit 3 */&lt;br /&gt;    byte PTDSE4      :1;                                       /* Slew Rate Control Enable for Port D Bit 4 */&lt;br /&gt;    byte PTDSE5      :1;                                       /* Slew Rate Control Enable for Port D Bit 5 */&lt;br /&gt;    byte PTDSE6      :1;                                       /* Slew Rate Control Enable for Port D Bit 6 */&lt;br /&gt;    byte PTDSE7      :1;                                       /* Slew Rate Control Enable for Port D Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTDSESTR;&lt;br /&gt;extern volatile PTDSESTR _PTDSE @0x0000000E;&lt;br /&gt;#define PTDSE                           _PTDSE.Byte&lt;br /&gt;#define PTDSE_PTDSE0                    _PTDSE.Bits.PTDSE0&lt;br /&gt;#define PTDSE_PTDSE1                    _PTDSE.Bits.PTDSE1&lt;br /&gt;#define PTDSE_PTDSE2                    _PTDSE.Bits.PTDSE2&lt;br /&gt;#define PTDSE_PTDSE3                    _PTDSE.Bits.PTDSE3&lt;br /&gt;#define PTDSE_PTDSE4                    _PTDSE.Bits.PTDSE4&lt;br /&gt;#define PTDSE_PTDSE5                    _PTDSE.Bits.PTDSE5&lt;br /&gt;#define PTDSE_PTDSE6                    _PTDSE.Bits.PTDSE6&lt;br /&gt;#define PTDSE_PTDSE7                    _PTDSE.Bits.PTDSE7&lt;br /&gt;&lt;br /&gt;#define PTDSE_PTDSE0_MASK               1&lt;br /&gt;#define PTDSE_PTDSE1_MASK               2&lt;br /&gt;#define PTDSE_PTDSE2_MASK               4&lt;br /&gt;#define PTDSE_PTDSE3_MASK               8&lt;br /&gt;#define PTDSE_PTDSE4_MASK               16&lt;br /&gt;#define PTDSE_PTDSE5_MASK               32&lt;br /&gt;#define PTDSE_PTDSE6_MASK               64&lt;br /&gt;#define PTDSE_PTDSE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTDDD - Data Direction Register D; 0x0000000F ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTDDD0      :1;                                       /* Data Direction for Port D Bit 0 */&lt;br /&gt;    byte PTDDD1      :1;                                       /* Data Direction for Port D Bit 1 */&lt;br /&gt;    byte PTDDD2      :1;                                       /* Data Direction for Port D Bit 2 */&lt;br /&gt;    byte PTDDD3      :1;                                       /* Data Direction for Port D Bit 3 */&lt;br /&gt;    byte PTDDD4      :1;                                       /* Data Direction for Port D Bit 4 */&lt;br /&gt;    byte PTDDD5      :1;                                       /* Data Direction for Port D Bit 5 */&lt;br /&gt;    byte PTDDD6      :1;                                       /* Data Direction for Port D Bit 6 */&lt;br /&gt;    byte PTDDD7      :1;                                       /* Data Direction for Port D Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTDDDSTR;&lt;br /&gt;extern volatile PTDDDSTR _PTDDD @0x0000000F;&lt;br /&gt;#define PTDDD                           _PTDDD.Byte&lt;br /&gt;#define PTDDD_PTDDD0                    _PTDDD.Bits.PTDDD0&lt;br /&gt;#define PTDDD_PTDDD1                    _PTDDD.Bits.PTDDD1&lt;br /&gt;#define PTDDD_PTDDD2                    _PTDDD.Bits.PTDDD2&lt;br /&gt;#define PTDDD_PTDDD3                    _PTDDD.Bits.PTDDD3&lt;br /&gt;#define PTDDD_PTDDD4                    _PTDDD.Bits.PTDDD4&lt;br /&gt;#define PTDDD_PTDDD5                    _PTDDD.Bits.PTDDD5&lt;br /&gt;#define PTDDD_PTDDD6                    _PTDDD.Bits.PTDDD6&lt;br /&gt;#define PTDDD_PTDDD7                    _PTDDD.Bits.PTDDD7&lt;br /&gt;&lt;br /&gt;#define PTDDD_PTDDD0_MASK               1&lt;br /&gt;#define PTDDD_PTDDD1_MASK               2&lt;br /&gt;#define PTDDD_PTDDD2_MASK               4&lt;br /&gt;#define PTDDD_PTDDD3_MASK               8&lt;br /&gt;#define PTDDD_PTDDD4_MASK               16&lt;br /&gt;#define PTDDD_PTDDD5_MASK               32&lt;br /&gt;#define PTDDD_PTDDD6_MASK               64&lt;br /&gt;#define PTDDD_PTDDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTED - Port E Data Register; 0x00000010 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTED0       :1;                                       /* Port E Data Register Bit 0 */&lt;br /&gt;    byte PTED1       :1;                                       /* Port E Data Register Bit 1 */&lt;br /&gt;    byte PTED2       :1;                                       /* Port E Data Register Bit 2 */&lt;br /&gt;    byte PTED3       :1;                                       /* Port E Data Register Bit 3 */&lt;br /&gt;    byte PTED4       :1;                                       /* Port E Data Register Bit 4 */&lt;br /&gt;    byte PTED5       :1;                                       /* Port E Data Register Bit 5 */&lt;br /&gt;    byte PTED6       :1;                                       /* Port E Data Register Bit 6 */&lt;br /&gt;    byte PTED7       :1;                                       /* Port E Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTEDSTR;&lt;br /&gt;extern volatile PTEDSTR _PTED @0x00000010;&lt;br /&gt;#define PTED                            _PTED.Byte&lt;br /&gt;#define PTED_PTED0                      _PTED.Bits.PTED0&lt;br /&gt;#define PTED_PTED1                      _PTED.Bits.PTED1&lt;br /&gt;#define PTED_PTED2                      _PTED.Bits.PTED2&lt;br /&gt;#define PTED_PTED3                      _PTED.Bits.PTED3&lt;br /&gt;#define PTED_PTED4                      _PTED.Bits.PTED4&lt;br /&gt;#define PTED_PTED5                      _PTED.Bits.PTED5&lt;br /&gt;#define PTED_PTED6                      _PTED.Bits.PTED6&lt;br /&gt;#define PTED_PTED7                      _PTED.Bits.PTED7&lt;br /&gt;&lt;br /&gt;#define PTED_PTED0_MASK                 1&lt;br /&gt;#define PTED_PTED1_MASK                 2&lt;br /&gt;#define PTED_PTED2_MASK                 4&lt;br /&gt;#define PTED_PTED3_MASK                 8&lt;br /&gt;#define PTED_PTED4_MASK                 16&lt;br /&gt;#define PTED_PTED5_MASK                 32&lt;br /&gt;#define PTED_PTED6_MASK                 64&lt;br /&gt;#define PTED_PTED7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTEPE - Pullup Enable for Port E; 0x00000011 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTEPE0      :1;                                       /* Pullup Enable for Port E Bit 0 */&lt;br /&gt;    byte PTEPE1      :1;                                       /* Pullup Enable for Port E Bit 1 */&lt;br /&gt;    byte PTEPE2      :1;                                       /* Pullup Enable for Port E Bit 2 */&lt;br /&gt;    byte PTEPE3      :1;                                       /* Pullup Enable for Port E Bit 3 */&lt;br /&gt;    byte PTEPE4      :1;                                       /* Pullup Enable for Port E Bit 4 */&lt;br /&gt;    byte PTEPE5      :1;                                       /* Pullup Enable for Port E Bit 5 */&lt;br /&gt;    byte PTEPE6      :1;                                       /* Pullup Enable for Port E Bit 6 */&lt;br /&gt;    byte PTEPE7      :1;                                       /* Pullup Enable for Port E Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTEPESTR;&lt;br /&gt;extern volatile PTEPESTR _PTEPE @0x00000011;&lt;br /&gt;#define PTEPE                           _PTEPE.Byte&lt;br /&gt;#define PTEPE_PTEPE0                    _PTEPE.Bits.PTEPE0&lt;br /&gt;#define PTEPE_PTEPE1                    _PTEPE.Bits.PTEPE1&lt;br /&gt;#define PTEPE_PTEPE2                    _PTEPE.Bits.PTEPE2&lt;br /&gt;#define PTEPE_PTEPE3                    _PTEPE.Bits.PTEPE3&lt;br /&gt;#define PTEPE_PTEPE4                    _PTEPE.Bits.PTEPE4&lt;br /&gt;#define PTEPE_PTEPE5                    _PTEPE.Bits.PTEPE5&lt;br /&gt;#define PTEPE_PTEPE6                    _PTEPE.Bits.PTEPE6&lt;br /&gt;#define PTEPE_PTEPE7                    _PTEPE.Bits.PTEPE7&lt;br /&gt;&lt;br /&gt;#define PTEPE_PTEPE0_MASK               1&lt;br /&gt;#define PTEPE_PTEPE1_MASK               2&lt;br /&gt;#define PTEPE_PTEPE2_MASK               4&lt;br /&gt;#define PTEPE_PTEPE3_MASK               8&lt;br /&gt;#define PTEPE_PTEPE4_MASK               16&lt;br /&gt;#define PTEPE_PTEPE5_MASK               32&lt;br /&gt;#define PTEPE_PTEPE6_MASK               64&lt;br /&gt;#define PTEPE_PTEPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTESE - Slew Rate Control Enable for Port E; 0x00000012 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTESE0      :1;                                       /* Slew Rate Control Enable for Port E Bit 0 */&lt;br /&gt;    byte PTESE1      :1;                                       /* Slew Rate Control Enable for Port E Bit 1 */&lt;br /&gt;    byte PTESE2      :1;                                       /* Slew Rate Control Enable for Port E Bit 2 */&lt;br /&gt;    byte PTESE3      :1;                                       /* Slew Rate Control Enable for Port E Bit 3 */&lt;br /&gt;    byte PTESE4      :1;                                       /* Slew Rate Control Enable for Port E Bit 4 */&lt;br /&gt;    byte PTESE5      :1;                                       /* Slew Rate Control Enable for Port E Bit 5 */&lt;br /&gt;    byte PTESE6      :1;                                       /* Slew Rate Control Enable for Port E Bit 6 */&lt;br /&gt;    byte PTESE7      :1;                                       /* Slew Rate Control Enable for Port E Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTESESTR;&lt;br /&gt;extern volatile PTESESTR _PTESE @0x00000012;&lt;br /&gt;#define PTESE                           _PTESE.Byte&lt;br /&gt;#define PTESE_PTESE0                    _PTESE.Bits.PTESE0&lt;br /&gt;#define PTESE_PTESE1                    _PTESE.Bits.PTESE1&lt;br /&gt;#define PTESE_PTESE2                    _PTESE.Bits.PTESE2&lt;br /&gt;#define PTESE_PTESE3                    _PTESE.Bits.PTESE3&lt;br /&gt;#define PTESE_PTESE4                    _PTESE.Bits.PTESE4&lt;br /&gt;#define PTESE_PTESE5                    _PTESE.Bits.PTESE5&lt;br /&gt;#define PTESE_PTESE6                    _PTESE.Bits.PTESE6&lt;br /&gt;#define PTESE_PTESE7                    _PTESE.Bits.PTESE7&lt;br /&gt;&lt;br /&gt;#define PTESE_PTESE0_MASK               1&lt;br /&gt;#define PTESE_PTESE1_MASK               2&lt;br /&gt;#define PTESE_PTESE2_MASK               4&lt;br /&gt;#define PTESE_PTESE3_MASK               8&lt;br /&gt;#define PTESE_PTESE4_MASK               16&lt;br /&gt;#define PTESE_PTESE5_MASK               32&lt;br /&gt;#define PTESE_PTESE6_MASK               64&lt;br /&gt;#define PTESE_PTESE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTEDD - Data Direction Register E; 0x00000013 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTEDD0      :1;                                       /* Data Direction for Port E Bit 0 */&lt;br /&gt;    byte PTEDD1      :1;                                       /* Data Direction for Port E Bit 1 */&lt;br /&gt;    byte PTEDD2      :1;                                       /* Data Direction for Port E Bit 2 */&lt;br /&gt;    byte PTEDD3      :1;                                       /* Data Direction for Port E Bit 3 */&lt;br /&gt;    byte PTEDD4      :1;                                       /* Data Direction for Port E Bit 4 */&lt;br /&gt;    byte PTEDD5      :1;                                       /* Data Direction for Port E Bit 5 */&lt;br /&gt;    byte PTEDD6      :1;                                       /* Data Direction for Port E Bit 6 */&lt;br /&gt;    byte PTEDD7      :1;                                       /* Data Direction for Port E Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTEDDSTR;&lt;br /&gt;extern volatile PTEDDSTR _PTEDD @0x00000013;&lt;br /&gt;#define PTEDD                           _PTEDD.Byte&lt;br /&gt;#define PTEDD_PTEDD0                    _PTEDD.Bits.PTEDD0&lt;br /&gt;#define PTEDD_PTEDD1                    _PTEDD.Bits.PTEDD1&lt;br /&gt;#define PTEDD_PTEDD2                    _PTEDD.Bits.PTEDD2&lt;br /&gt;#define PTEDD_PTEDD3                    _PTEDD.Bits.PTEDD3&lt;br /&gt;#define PTEDD_PTEDD4                    _PTEDD.Bits.PTEDD4&lt;br /&gt;#define PTEDD_PTEDD5                    _PTEDD.Bits.PTEDD5&lt;br /&gt;#define PTEDD_PTEDD6                    _PTEDD.Bits.PTEDD6&lt;br /&gt;#define PTEDD_PTEDD7                    _PTEDD.Bits.PTEDD7&lt;br /&gt;&lt;br /&gt;#define PTEDD_PTEDD0_MASK               1&lt;br /&gt;#define PTEDD_PTEDD1_MASK               2&lt;br /&gt;#define PTEDD_PTEDD2_MASK               4&lt;br /&gt;#define PTEDD_PTEDD3_MASK               8&lt;br /&gt;#define PTEDD_PTEDD4_MASK               16&lt;br /&gt;#define PTEDD_PTEDD5_MASK               32&lt;br /&gt;#define PTEDD_PTEDD6_MASK               64&lt;br /&gt;#define PTEDD_PTEDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IRQSC - Interrupt Request Status and Control Register; 0x00000014 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte IRQMOD      :1;                                       /* IRQ Detection Mode */&lt;br /&gt;    byte IRQIE       :1;                                       /* IRQ Interrupt Enable */&lt;br /&gt;    byte IRQACK      :1;                                       /* IRQ Acknowledge */&lt;br /&gt;    byte IRQF        :1;                                       /* IRQ Flag */&lt;br /&gt;    byte IRQPE       :1;                                       /* IRQ Pin Enable */&lt;br /&gt;    byte IRQEDG      :1;                                       /* Interrupt Request (IRQ) Edge Select */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} IRQSCSTR;&lt;br /&gt;extern volatile IRQSCSTR _IRQSC @0x00000014;&lt;br /&gt;#define IRQSC                           _IRQSC.Byte&lt;br /&gt;#define IRQSC_IRQMOD                    _IRQSC.Bits.IRQMOD&lt;br /&gt;#define IRQSC_IRQIE                     _IRQSC.Bits.IRQIE&lt;br /&gt;#define IRQSC_IRQACK                    _IRQSC.Bits.IRQACK&lt;br /&gt;#define IRQSC_IRQF                      _IRQSC.Bits.IRQF&lt;br /&gt;#define IRQSC_IRQPE                     _IRQSC.Bits.IRQPE&lt;br /&gt;#define IRQSC_IRQEDG                    _IRQSC.Bits.IRQEDG&lt;br /&gt;&lt;br /&gt;#define IRQSC_IRQMOD_MASK               1&lt;br /&gt;#define IRQSC_IRQIE_MASK                2&lt;br /&gt;#define IRQSC_IRQACK_MASK               4&lt;br /&gt;#define IRQSC_IRQF_MASK                 8&lt;br /&gt;#define IRQSC_IRQPE_MASK                16&lt;br /&gt;#define IRQSC_IRQEDG_MASK               32&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** KBI1SC - KBI1 Status and Control; 0x00000016 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte KBIMOD      :1;                                       /* Keyboard Detection Mode */&lt;br /&gt;    byte KBIE        :1;                                       /* Keyboard Interrupt Enable */&lt;br /&gt;    byte KBACK       :1;                                       /* Keyboard Interrupt Acknowledge */&lt;br /&gt;    byte KBF         :1;                                       /* Keyboard Interrupt Flag */&lt;br /&gt;    byte KBEDG4      :1;                                       /* Keyboard Edge Select for Port A Bit 4 */&lt;br /&gt;    byte KBEDG5      :1;                                       /* Keyboard Edge Select for Port A Bit 5 */&lt;br /&gt;    byte KBEDG6      :1;                                       /* Keyboard Edge Select for Port A Bit 6 */&lt;br /&gt;    byte KBEDG7      :1;                                       /* Keyboard Edge Select for Port A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpKBEDG_4 :4;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} KBI1SCSTR;&lt;br /&gt;extern volatile KBI1SCSTR _KBI1SC @0x00000016;&lt;br /&gt;#define KBI1SC                          _KBI1SC.Byte&lt;br /&gt;#define KBI1SC_KBIMOD                   _KBI1SC.Bits.KBIMOD&lt;br /&gt;#define KBI1SC_KBIE                     _KBI1SC.Bits.KBIE&lt;br /&gt;#define KBI1SC_KBACK                    _KBI1SC.Bits.KBACK&lt;br /&gt;#define KBI1SC_KBF                      _KBI1SC.Bits.KBF&lt;br /&gt;#define KBI1SC_KBEDG4                   _KBI1SC.Bits.KBEDG4&lt;br /&gt;#define KBI1SC_KBEDG5                   _KBI1SC.Bits.KBEDG5&lt;br /&gt;#define KBI1SC_KBEDG6                   _KBI1SC.Bits.KBEDG6&lt;br /&gt;#define KBI1SC_KBEDG7                   _KBI1SC.Bits.KBEDG7&lt;br /&gt;#define KBI1SC_KBEDG_4                  _KBI1SC.MergedBits.grpKBEDG_4&lt;br /&gt;#define KBI1SC_KBEDG                    KBI1SC_KBEDG_4&lt;br /&gt;&lt;br /&gt;#define KBI1SC_KBIMOD_MASK              1&lt;br /&gt;#define KBI1SC_KBIE_MASK                2&lt;br /&gt;#define KBI1SC_KBACK_MASK               4&lt;br /&gt;#define KBI1SC_KBF_MASK                 8&lt;br /&gt;#define KBI1SC_KBEDG4_MASK              16&lt;br /&gt;#define KBI1SC_KBEDG5_MASK              32&lt;br /&gt;#define KBI1SC_KBEDG6_MASK              64&lt;br /&gt;#define KBI1SC_KBEDG7_MASK              128&lt;br /&gt;#define KBI1SC_KBEDG_4_MASK             240&lt;br /&gt;#define KBI1SC_KBEDG_4_BITNUM           4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** KBI1PE - KBI1 Pin Enable Register; 0x00000017 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte KBIPE0      :1;                                       /* Keyboard Pin Enable for Port A Bit 0 */&lt;br /&gt;    byte KBIPE1      :1;                                       /* Keyboard Pin Enable for Port A Bit 1 */&lt;br /&gt;    byte KBIPE2      :1;                                       /* Keyboard Pin Enable for Port A Bit 2 */&lt;br /&gt;    byte KBIPE3      :1;                                       /* Keyboard Pin Enable for Port A Bit 3 */&lt;br /&gt;    byte KBIPE4      :1;                                       /* Keyboard Pin Enable for Port A Bit 4 */&lt;br /&gt;    byte KBIPE5      :1;                                       /* Keyboard Pin Enable for Port A Bit 5 */&lt;br /&gt;    byte KBIPE6      :1;                                       /* Keyboard Pin Enable for Port A Bit 6 */&lt;br /&gt;    byte KBIPE7      :1;                                       /* Keyboard Pin Enable for Port A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} KBI1PESTR;&lt;br /&gt;extern volatile KBI1PESTR _KBI1PE @0x00000017;&lt;br /&gt;#define KBI1PE                          _KBI1PE.Byte&lt;br /&gt;#define KBI1PE_KBIPE0                   _KBI1PE.Bits.KBIPE0&lt;br /&gt;#define KBI1PE_KBIPE1                   _KBI1PE.Bits.KBIPE1&lt;br /&gt;#define KBI1PE_KBIPE2                   _KBI1PE.Bits.KBIPE2&lt;br /&gt;#define KBI1PE_KBIPE3                   _KBI1PE.Bits.KBIPE3&lt;br /&gt;#define KBI1PE_KBIPE4                   _KBI1PE.Bits.KBIPE4&lt;br /&gt;#define KBI1PE_KBIPE5                   _KBI1PE.Bits.KBIPE5&lt;br /&gt;#define KBI1PE_KBIPE6                   _KBI1PE.Bits.KBIPE6&lt;br /&gt;#define KBI1PE_KBIPE7                   _KBI1PE.Bits.KBIPE7&lt;br /&gt;&lt;br /&gt;#define KBI1PE_KBIPE0_MASK              1&lt;br /&gt;#define KBI1PE_KBIPE1_MASK              2&lt;br /&gt;#define KBI1PE_KBIPE2_MASK              4&lt;br /&gt;#define KBI1PE_KBIPE3_MASK              8&lt;br /&gt;#define KBI1PE_KBIPE4_MASK              16&lt;br /&gt;#define KBI1PE_KBIPE5_MASK              32&lt;br /&gt;#define KBI1PE_KBIPE6_MASK              64&lt;br /&gt;#define KBI1PE_KBIPE7_MASK              128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1BD - SCI1 Baud Rate Register; 0x00000018 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** SCI1BDH - SCI1 Baud Rate Register High; 0x00000018 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte SBR8        :1;                                       /* Baud Rate Modulo Divisor Bit 8 */&lt;br /&gt;        byte SBR9        :1;                                       /* Baud Rate Modulo Divisor Bit 9 */&lt;br /&gt;        byte SBR10       :1;                                       /* Baud Rate Modulo Divisor Bit 10 */&lt;br /&gt;        byte SBR11       :1;                                       /* Baud Rate Modulo Divisor Bit 11 */&lt;br /&gt;        byte SBR12       :1;                                       /* Baud Rate Modulo Divisor Bit 12 */&lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;      } Bits;&lt;br /&gt;      struct {&lt;br /&gt;        byte grpSBR_8 :5;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;      } MergedBits;&lt;br /&gt;    } SCI1BDHSTR;&lt;br /&gt;    #define SCI1BDH                     _SCI1BD.Overlap_STR.SCI1BDHSTR.Byte&lt;br /&gt;    #define SCI1BDH_SBR8                _SCI1BD.Overlap_STR.SCI1BDHSTR.Bits.SBR8&lt;br /&gt;    #define SCI1BDH_SBR9                _SCI1BD.Overlap_STR.SCI1BDHSTR.Bits.SBR9&lt;br /&gt;    #define SCI1BDH_SBR10               _SCI1BD.Overlap_STR.SCI1BDHSTR.Bits.SBR10&lt;br /&gt;    #define SCI1BDH_SBR11               _SCI1BD.Overlap_STR.SCI1BDHSTR.Bits.SBR11&lt;br /&gt;    #define SCI1BDH_SBR12               _SCI1BD.Overlap_STR.SCI1BDHSTR.Bits.SBR12&lt;br /&gt;    &lt;br /&gt;    #define SCI1BDH_SBR_8               _SCI1BD.Overlap_STR.SCI1BDHSTR.MergedBits.grpSBR_8&lt;br /&gt;    #define SCI1BDH_SBR                 SCI1BDH_SBR_8&lt;br /&gt;    &lt;br /&gt;    #define SCI1BDH_SBR8_MASK           1&lt;br /&gt;    #define SCI1BDH_SBR9_MASK           2&lt;br /&gt;    #define SCI1BDH_SBR10_MASK          4&lt;br /&gt;    #define SCI1BDH_SBR11_MASK          8&lt;br /&gt;    #define SCI1BDH_SBR12_MASK          16&lt;br /&gt;    #define SCI1BDH_SBR_8_MASK          31&lt;br /&gt;    #define SCI1BDH_SBR_8_BITNUM        0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** SCI1BDL - SCI1 Baud Rate Register Low; 0x00000019 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte SBR0        :1;                                       /* Baud Rate Modulo Divisor Bit 0 */&lt;br /&gt;        byte SBR1        :1;                                       /* Baud Rate Modulo Divisor Bit 1 */&lt;br /&gt;        byte SBR2        :1;                                       /* Baud Rate Modulo Divisor Bit 2 */&lt;br /&gt;        byte SBR3        :1;                                       /* Baud Rate Modulo Divisor Bit 3 */&lt;br /&gt;        byte SBR4        :1;                                       /* Baud Rate Modulo Divisor Bit 4 */&lt;br /&gt;        byte SBR5        :1;                                       /* Baud Rate Modulo Divisor Bit 5 */&lt;br /&gt;        byte SBR6        :1;                                       /* Baud Rate Modulo Divisor Bit 6 */&lt;br /&gt;        byte SBR7        :1;                                       /* Baud Rate Modulo Divisor Bit 7 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } SCI1BDLSTR;&lt;br /&gt;    #define SCI1BDL                     _SCI1BD.Overlap_STR.SCI1BDLSTR.Byte&lt;br /&gt;    #define SCI1BDL_SBR0                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR0&lt;br /&gt;    #define SCI1BDL_SBR1                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR1&lt;br /&gt;    #define SCI1BDL_SBR2                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR2&lt;br /&gt;    #define SCI1BDL_SBR3                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR3&lt;br /&gt;    #define SCI1BDL_SBR4                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR4&lt;br /&gt;    #define SCI1BDL_SBR5                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR5&lt;br /&gt;    #define SCI1BDL_SBR6                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR6&lt;br /&gt;    #define SCI1BDL_SBR7                _SCI1BD.Overlap_STR.SCI1BDLSTR.Bits.SBR7&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define SCI1BDL_SBR0_MASK           1&lt;br /&gt;    #define SCI1BDL_SBR1_MASK           2&lt;br /&gt;    #define SCI1BDL_SBR2_MASK           4&lt;br /&gt;    #define SCI1BDL_SBR3_MASK           8&lt;br /&gt;    #define SCI1BDL_SBR4_MASK           16&lt;br /&gt;    #define SCI1BDL_SBR5_MASK           32&lt;br /&gt;    #define SCI1BDL_SBR6_MASK           64&lt;br /&gt;    #define SCI1BDL_SBR7_MASK           128&lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} SCI1BDSTR;&lt;br /&gt;extern volatile SCI1BDSTR _SCI1BD @0x00000018;&lt;br /&gt;#define SCI1BD                          _SCI1BD.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1C1 - SCI1 Control Register 1; 0x0000001A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PT          :1;                                       /* Parity Type */&lt;br /&gt;    byte PE          :1;                                       /* Parity Enable */&lt;br /&gt;    byte ILT         :1;                                       /* Idle Line Type Select */&lt;br /&gt;    byte WAKE        :1;                                       /* Receiver Wakeup Method Select */&lt;br /&gt;    byte M           :1;                                       /* 9-Bit or 8-Bit Mode Select */&lt;br /&gt;    byte RSRC        :1;                                       /* Receiver Source Select */&lt;br /&gt;    byte SCISWAI     :1;                                       /* SCI Stops in Wait Mode */&lt;br /&gt;    byte LOOPS       :1;                                       /* Loop Mode Select */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1C1STR;&lt;br /&gt;extern volatile SCI1C1STR _SCI1C1 @0x0000001A;&lt;br /&gt;#define SCI1C1                          _SCI1C1.Byte&lt;br /&gt;#define SCI1C1_PT                       _SCI1C1.Bits.PT&lt;br /&gt;#define SCI1C1_PE                       _SCI1C1.Bits.PE&lt;br /&gt;#define SCI1C1_ILT                      _SCI1C1.Bits.ILT&lt;br /&gt;#define SCI1C1_WAKE                     _SCI1C1.Bits.WAKE&lt;br /&gt;#define SCI1C1_M                        _SCI1C1.Bits.M&lt;br /&gt;#define SCI1C1_RSRC                     _SCI1C1.Bits.RSRC&lt;br /&gt;#define SCI1C1_SCISWAI                  _SCI1C1.Bits.SCISWAI&lt;br /&gt;#define SCI1C1_LOOPS                    _SCI1C1.Bits.LOOPS&lt;br /&gt;&lt;br /&gt;#define SCI1C1_PT_MASK                  1&lt;br /&gt;#define SCI1C1_PE_MASK                  2&lt;br /&gt;#define SCI1C1_ILT_MASK                 4&lt;br /&gt;#define SCI1C1_WAKE_MASK                8&lt;br /&gt;#define SCI1C1_M_MASK                   16&lt;br /&gt;#define SCI1C1_RSRC_MASK                32&lt;br /&gt;#define SCI1C1_SCISWAI_MASK             64&lt;br /&gt;#define SCI1C1_LOOPS_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1C2 - SCI1 Control Register 2; 0x0000001B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte SBK         :1;                                       /* Send Break */&lt;br /&gt;    byte RWU         :1;                                       /* Receiver Wakeup Control */&lt;br /&gt;    byte RE          :1;                                       /* Receiver Enable */&lt;br /&gt;    byte TE          :1;                                       /* Transmitter Enable */&lt;br /&gt;    byte ILIE        :1;                                       /* Idle Line Interrupt Enable (for IDLE) */&lt;br /&gt;    byte RIE         :1;                                       /* Receiver Interrupt Enable (for RDRF) */&lt;br /&gt;    byte TCIE        :1;                                       /* Transmission Complete Interrupt Enable (for TC) */&lt;br /&gt;    byte TIE         :1;                                       /* Transmit Interrupt Enable (for TDRE) */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1C2STR;&lt;br /&gt;extern volatile SCI1C2STR _SCI1C2 @0x0000001B;&lt;br /&gt;#define SCI1C2                          _SCI1C2.Byte&lt;br /&gt;#define SCI1C2_SBK                      _SCI1C2.Bits.SBK&lt;br /&gt;#define SCI1C2_RWU                      _SCI1C2.Bits.RWU&lt;br /&gt;#define SCI1C2_RE                       _SCI1C2.Bits.RE&lt;br /&gt;#define SCI1C2_TE                       _SCI1C2.Bits.TE&lt;br /&gt;#define SCI1C2_ILIE                     _SCI1C2.Bits.ILIE&lt;br /&gt;#define SCI1C2_RIE                      _SCI1C2.Bits.RIE&lt;br /&gt;#define SCI1C2_TCIE                     _SCI1C2.Bits.TCIE&lt;br /&gt;#define SCI1C2_TIE                      _SCI1C2.Bits.TIE&lt;br /&gt;&lt;br /&gt;#define SCI1C2_SBK_MASK                 1&lt;br /&gt;#define SCI1C2_RWU_MASK                 2&lt;br /&gt;#define SCI1C2_RE_MASK                  4&lt;br /&gt;#define SCI1C2_TE_MASK                  8&lt;br /&gt;#define SCI1C2_ILIE_MASK                16&lt;br /&gt;#define SCI1C2_RIE_MASK                 32&lt;br /&gt;#define SCI1C2_TCIE_MASK                64&lt;br /&gt;#define SCI1C2_TIE_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1S1 - SCI1 Status Register 1; 0x0000001C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PF          :1;                                       /* Parity Error Flag */&lt;br /&gt;    byte FE          :1;                                       /* Framing Error Flag */&lt;br /&gt;    byte NF          :1;                                       /* Noise Flag */&lt;br /&gt;    byte OR          :1;                                       /* Receiver Overrun Flag */&lt;br /&gt;    byte IDLE        :1;                                       /* Idle Line Flag */&lt;br /&gt;    byte RDRF        :1;                                       /* Receive Data Register Full Flag */&lt;br /&gt;    byte TC          :1;                                       /* Transmission Complete Flag */&lt;br /&gt;    byte TDRE        :1;                                       /* Transmit Data Register Empty Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1S1STR;&lt;br /&gt;extern volatile SCI1S1STR _SCI1S1 @0x0000001C;&lt;br /&gt;#define SCI1S1                          _SCI1S1.Byte&lt;br /&gt;#define SCI1S1_PF                       _SCI1S1.Bits.PF&lt;br /&gt;#define SCI1S1_FE                       _SCI1S1.Bits.FE&lt;br /&gt;#define SCI1S1_NF                       _SCI1S1.Bits.NF&lt;br /&gt;#define SCI1S1_OR                       _SCI1S1.Bits.OR&lt;br /&gt;#define SCI1S1_IDLE                     _SCI1S1.Bits.IDLE&lt;br /&gt;#define SCI1S1_RDRF                     _SCI1S1.Bits.RDRF&lt;br /&gt;#define SCI1S1_TC                       _SCI1S1.Bits.TC&lt;br /&gt;#define SCI1S1_TDRE                     _SCI1S1.Bits.TDRE&lt;br /&gt;&lt;br /&gt;#define SCI1S1_PF_MASK                  1&lt;br /&gt;#define SCI1S1_FE_MASK                  2&lt;br /&gt;#define SCI1S1_NF_MASK                  4&lt;br /&gt;#define SCI1S1_OR_MASK                  8&lt;br /&gt;#define SCI1S1_IDLE_MASK                16&lt;br /&gt;#define SCI1S1_RDRF_MASK                32&lt;br /&gt;#define SCI1S1_TC_MASK                  64&lt;br /&gt;#define SCI1S1_TDRE_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1S2 - SCI1 Status Register 2; 0x0000001D ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte RAF         :1;                                       /* Receiver Active Flag */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1S2STR;&lt;br /&gt;extern volatile SCI1S2STR _SCI1S2 @0x0000001D;&lt;br /&gt;#define SCI1S2                          _SCI1S2.Byte&lt;br /&gt;#define SCI1S2_RAF                      _SCI1S2.Bits.RAF&lt;br /&gt;&lt;br /&gt;#define SCI1S2_RAF_MASK                 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1C3 - SCI1 Control Register 3; 0x0000001E ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PEIE        :1;                                       /* Parity Error Interrupt Enable */&lt;br /&gt;    byte FEIE        :1;                                       /* Framing Error Interrupt Enable */&lt;br /&gt;    byte NEIE        :1;                                       /* Noise Error Interrupt Enable */&lt;br /&gt;    byte ORIE        :1;                                       /* Overrun Interrupt Enable */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte TXDIR       :1;                                       /* TxD Pin Direction in Single-Wire Mode */&lt;br /&gt;    byte T8          :1;                                       /* Ninth Data Bit for Transmitter */&lt;br /&gt;    byte R8          :1;                                       /* Ninth Data Bit for Receiver */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1C3STR;&lt;br /&gt;extern volatile SCI1C3STR _SCI1C3 @0x0000001E;&lt;br /&gt;#define SCI1C3                          _SCI1C3.Byte&lt;br /&gt;#define SCI1C3_PEIE                     _SCI1C3.Bits.PEIE&lt;br /&gt;#define SCI1C3_FEIE                     _SCI1C3.Bits.FEIE&lt;br /&gt;#define SCI1C3_NEIE                     _SCI1C3.Bits.NEIE&lt;br /&gt;#define SCI1C3_ORIE                     _SCI1C3.Bits.ORIE&lt;br /&gt;#define SCI1C3_TXDIR                    _SCI1C3.Bits.TXDIR&lt;br /&gt;#define SCI1C3_T8                       _SCI1C3.Bits.T8&lt;br /&gt;#define SCI1C3_R8                       _SCI1C3.Bits.R8&lt;br /&gt;&lt;br /&gt;#define SCI1C3_PEIE_MASK                1&lt;br /&gt;#define SCI1C3_FEIE_MASK                2&lt;br /&gt;#define SCI1C3_NEIE_MASK                4&lt;br /&gt;#define SCI1C3_ORIE_MASK                8&lt;br /&gt;#define SCI1C3_TXDIR_MASK               32&lt;br /&gt;#define SCI1C3_T8_MASK                  64&lt;br /&gt;#define SCI1C3_R8_MASK                  128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI1D - SCI1 Data Register; 0x0000001F ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte R0_T0       :1;                                       /* Receive/Transmit Data Bit 0 */&lt;br /&gt;    byte R1_T1       :1;                                       /* Receive/Transmit Data Bit 1 */&lt;br /&gt;    byte R2_T2       :1;                                       /* Receive/Transmit Data Bit 2 */&lt;br /&gt;    byte R3_T3       :1;                                       /* Receive/Transmit Data Bit 3 */&lt;br /&gt;    byte R4_T4       :1;                                       /* Receive/Transmit Data Bit 4 */&lt;br /&gt;    byte R5_T5       :1;                                       /* Receive/Transmit Data Bit 5 */&lt;br /&gt;    byte R6_T6       :1;                                       /* Receive/Transmit Data Bit 6 */&lt;br /&gt;    byte R7_T7       :1;                                       /* Receive/Transmit Data Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI1DSTR;&lt;br /&gt;extern volatile SCI1DSTR _SCI1D @0x0000001F;&lt;br /&gt;#define SCI1D                           _SCI1D.Byte&lt;br /&gt;#define SCI1D_R0_T0                     _SCI1D.Bits.R0_T0&lt;br /&gt;#define SCI1D_R1_T1                     _SCI1D.Bits.R1_T1&lt;br /&gt;#define SCI1D_R2_T2                     _SCI1D.Bits.R2_T2&lt;br /&gt;#define SCI1D_R3_T3                     _SCI1D.Bits.R3_T3&lt;br /&gt;#define SCI1D_R4_T4                     _SCI1D.Bits.R4_T4&lt;br /&gt;#define SCI1D_R5_T5                     _SCI1D.Bits.R5_T5&lt;br /&gt;#define SCI1D_R6_T6                     _SCI1D.Bits.R6_T6&lt;br /&gt;#define SCI1D_R7_T7                     _SCI1D.Bits.R7_T7&lt;br /&gt;&lt;br /&gt;#define SCI1D_R0_T0_MASK                1&lt;br /&gt;#define SCI1D_R1_T1_MASK                2&lt;br /&gt;#define SCI1D_R2_T2_MASK                4&lt;br /&gt;#define SCI1D_R3_T3_MASK                8&lt;br /&gt;#define SCI1D_R4_T4_MASK                16&lt;br /&gt;#define SCI1D_R5_T5_MASK                32&lt;br /&gt;#define SCI1D_R6_T6_MASK                64&lt;br /&gt;#define SCI1D_R7_T7_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2BD - SCI2 Baud Rate Register; 0x00000020 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** SCI2BDH - SCI2 Baud Rate Register High; 0x00000020 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte SBR8        :1;                                       /* Baud Rate Modulo Divisor Bit 8 */&lt;br /&gt;        byte SBR9        :1;                                       /* Baud Rate Modulo Divisor Bit 9 */&lt;br /&gt;        byte SBR10       :1;                                       /* Baud Rate Modulo Divisor Bit 10 */&lt;br /&gt;        byte SBR11       :1;                                       /* Baud Rate Modulo Divisor Bit 11 */&lt;br /&gt;        byte SBR12       :1;                                       /* Baud Rate Modulo Divisor Bit 12 */&lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;      } Bits;&lt;br /&gt;      struct {&lt;br /&gt;        byte grpSBR_8 :5;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;      } MergedBits;&lt;br /&gt;    } SCI2BDHSTR;&lt;br /&gt;    #define SCI2BDH                     _SCI2BD.Overlap_STR.SCI2BDHSTR.Byte&lt;br /&gt;    #define SCI2BDH_SBR8                _SCI2BD.Overlap_STR.SCI2BDHSTR.Bits.SBR8&lt;br /&gt;    #define SCI2BDH_SBR9                _SCI2BD.Overlap_STR.SCI2BDHSTR.Bits.SBR9&lt;br /&gt;    #define SCI2BDH_SBR10               _SCI2BD.Overlap_STR.SCI2BDHSTR.Bits.SBR10&lt;br /&gt;    #define SCI2BDH_SBR11               _SCI2BD.Overlap_STR.SCI2BDHSTR.Bits.SBR11&lt;br /&gt;    #define SCI2BDH_SBR12               _SCI2BD.Overlap_STR.SCI2BDHSTR.Bits.SBR12&lt;br /&gt;    &lt;br /&gt;    #define SCI2BDH_SBR_8               _SCI2BD.Overlap_STR.SCI2BDHSTR.MergedBits.grpSBR_8&lt;br /&gt;    #define SCI2BDH_SBR                 SCI2BDH_SBR_8&lt;br /&gt;    &lt;br /&gt;    #define SCI2BDH_SBR8_MASK           1&lt;br /&gt;    #define SCI2BDH_SBR9_MASK           2&lt;br /&gt;    #define SCI2BDH_SBR10_MASK          4&lt;br /&gt;    #define SCI2BDH_SBR11_MASK          8&lt;br /&gt;    #define SCI2BDH_SBR12_MASK          16&lt;br /&gt;    #define SCI2BDH_SBR_8_MASK          31&lt;br /&gt;    #define SCI2BDH_SBR_8_BITNUM        0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** SCI2BDL - SCI2 Baud Rate Register Low; 0x00000021 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte SBR0        :1;                                       /* Baud Rate Modulo Divisor Bit 0 */&lt;br /&gt;        byte SBR1        :1;                                       /* Baud Rate Modulo Divisor Bit 1 */&lt;br /&gt;        byte SBR2        :1;                                       /* Baud Rate Modulo Divisor Bit 2 */&lt;br /&gt;        byte SBR3        :1;                                       /* Baud Rate Modulo Divisor Bit 3 */&lt;br /&gt;        byte SBR4        :1;                                       /* Baud Rate Modulo Divisor Bit 4 */&lt;br /&gt;        byte SBR5        :1;                                       /* Baud Rate Modulo Divisor Bit 5 */&lt;br /&gt;        byte SBR6        :1;                                       /* Baud Rate Modulo Divisor Bit 6 */&lt;br /&gt;        byte SBR7        :1;                                       /* Baud Rate Modulo Divisor Bit 7 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } SCI2BDLSTR;&lt;br /&gt;    #define SCI2BDL                     _SCI2BD.Overlap_STR.SCI2BDLSTR.Byte&lt;br /&gt;    #define SCI2BDL_SBR0                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR0&lt;br /&gt;    #define SCI2BDL_SBR1                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR1&lt;br /&gt;    #define SCI2BDL_SBR2                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR2&lt;br /&gt;    #define SCI2BDL_SBR3                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR3&lt;br /&gt;    #define SCI2BDL_SBR4                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR4&lt;br /&gt;    #define SCI2BDL_SBR5                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR5&lt;br /&gt;    #define SCI2BDL_SBR6                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR6&lt;br /&gt;    #define SCI2BDL_SBR7                _SCI2BD.Overlap_STR.SCI2BDLSTR.Bits.SBR7&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define SCI2BDL_SBR0_MASK           1&lt;br /&gt;    #define SCI2BDL_SBR1_MASK           2&lt;br /&gt;    #define SCI2BDL_SBR2_MASK           4&lt;br /&gt;    #define SCI2BDL_SBR3_MASK           8&lt;br /&gt;    #define SCI2BDL_SBR4_MASK           16&lt;br /&gt;    #define SCI2BDL_SBR5_MASK           32&lt;br /&gt;    #define SCI2BDL_SBR6_MASK           64&lt;br /&gt;    #define SCI2BDL_SBR7_MASK           128&lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} SCI2BDSTR;&lt;br /&gt;extern volatile SCI2BDSTR _SCI2BD @0x00000020;&lt;br /&gt;#define SCI2BD                          _SCI2BD.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2C1 - SCI1 Control Register 1; 0x00000022 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PT          :1;                                       /* Parity Type */&lt;br /&gt;    byte PE          :1;                                       /* Parity Enable */&lt;br /&gt;    byte ILT         :1;                                       /* Idle Line Type Select */&lt;br /&gt;    byte WAKE        :1;                                       /* Receiver Wakeup Method Select */&lt;br /&gt;    byte M           :1;                                       /* 9-Bit or 8-Bit Mode Select */&lt;br /&gt;    byte RSRC        :1;                                       /* Receiver Source Select */&lt;br /&gt;    byte SCISWAI     :1;                                       /* SCI Stops in Wait Mode */&lt;br /&gt;    byte LOOPS       :1;                                       /* Loop Mode Select */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2C1STR;&lt;br /&gt;extern volatile SCI2C1STR _SCI2C1 @0x00000022;&lt;br /&gt;#define SCI2C1                          _SCI2C1.Byte&lt;br /&gt;#define SCI2C1_PT                       _SCI2C1.Bits.PT&lt;br /&gt;#define SCI2C1_PE                       _SCI2C1.Bits.PE&lt;br /&gt;#define SCI2C1_ILT                      _SCI2C1.Bits.ILT&lt;br /&gt;#define SCI2C1_WAKE                     _SCI2C1.Bits.WAKE&lt;br /&gt;#define SCI2C1_M                        _SCI2C1.Bits.M&lt;br /&gt;#define SCI2C1_RSRC                     _SCI2C1.Bits.RSRC&lt;br /&gt;#define SCI2C1_SCISWAI                  _SCI2C1.Bits.SCISWAI&lt;br /&gt;#define SCI2C1_LOOPS                    _SCI2C1.Bits.LOOPS&lt;br /&gt;&lt;br /&gt;#define SCI2C1_PT_MASK                  1&lt;br /&gt;#define SCI2C1_PE_MASK                  2&lt;br /&gt;#define SCI2C1_ILT_MASK                 4&lt;br /&gt;#define SCI2C1_WAKE_MASK                8&lt;br /&gt;#define SCI2C1_M_MASK                   16&lt;br /&gt;#define SCI2C1_RSRC_MASK                32&lt;br /&gt;#define SCI2C1_SCISWAI_MASK             64&lt;br /&gt;#define SCI2C1_LOOPS_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2C2 - SCI2 Control Register 2; 0x00000023 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte SBK         :1;                                       /* Send Break */&lt;br /&gt;    byte RWU         :1;                                       /* Receiver Wakeup Control */&lt;br /&gt;    byte RE          :1;                                       /* Receiver Enable */&lt;br /&gt;    byte TE          :1;                                       /* Transmitter Enable */&lt;br /&gt;    byte ILIE        :1;                                       /* Idle Line Interrupt Enable (for IDLE) */&lt;br /&gt;    byte RIE         :1;                                       /* Receiver Interrupt Enable (for RDRF) */&lt;br /&gt;    byte TCIE        :1;                                       /* Transmission Complete Interrupt Enable (for TC) */&lt;br /&gt;    byte TIE         :1;                                       /* Transmit Interrupt Enable (for TDRE) */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2C2STR;&lt;br /&gt;extern volatile SCI2C2STR _SCI2C2 @0x00000023;&lt;br /&gt;#define SCI2C2                          _SCI2C2.Byte&lt;br /&gt;#define SCI2C2_SBK                      _SCI2C2.Bits.SBK&lt;br /&gt;#define SCI2C2_RWU                      _SCI2C2.Bits.RWU&lt;br /&gt;#define SCI2C2_RE                       _SCI2C2.Bits.RE&lt;br /&gt;#define SCI2C2_TE                       _SCI2C2.Bits.TE&lt;br /&gt;#define SCI2C2_ILIE                     _SCI2C2.Bits.ILIE&lt;br /&gt;#define SCI2C2_RIE                      _SCI2C2.Bits.RIE&lt;br /&gt;#define SCI2C2_TCIE                     _SCI2C2.Bits.TCIE&lt;br /&gt;#define SCI2C2_TIE                      _SCI2C2.Bits.TIE&lt;br /&gt;&lt;br /&gt;#define SCI2C2_SBK_MASK                 1&lt;br /&gt;#define SCI2C2_RWU_MASK                 2&lt;br /&gt;#define SCI2C2_RE_MASK                  4&lt;br /&gt;#define SCI2C2_TE_MASK                  8&lt;br /&gt;#define SCI2C2_ILIE_MASK                16&lt;br /&gt;#define SCI2C2_RIE_MASK                 32&lt;br /&gt;#define SCI2C2_TCIE_MASK                64&lt;br /&gt;#define SCI2C2_TIE_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2S1 - SCI2 Status Register 1; 0x00000024 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PF          :1;                                       /* Parity Error Flag */&lt;br /&gt;    byte FE          :1;                                       /* Framing Error Flag */&lt;br /&gt;    byte NF          :1;                                       /* Noise Flag */&lt;br /&gt;    byte OR          :1;                                       /* Receiver Overrun Flag */&lt;br /&gt;    byte IDLE        :1;                                       /* Idle Line Flag */&lt;br /&gt;    byte RDRF        :1;                                       /* Receive Data Register Full Flag */&lt;br /&gt;    byte TC          :1;                                       /* Transmission Complete Flag */&lt;br /&gt;    byte TDRE        :1;                                       /* Transmit Data Register Empty Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2S1STR;&lt;br /&gt;extern volatile SCI2S1STR _SCI2S1 @0x00000024;&lt;br /&gt;#define SCI2S1                          _SCI2S1.Byte&lt;br /&gt;#define SCI2S1_PF                       _SCI2S1.Bits.PF&lt;br /&gt;#define SCI2S1_FE                       _SCI2S1.Bits.FE&lt;br /&gt;#define SCI2S1_NF                       _SCI2S1.Bits.NF&lt;br /&gt;#define SCI2S1_OR                       _SCI2S1.Bits.OR&lt;br /&gt;#define SCI2S1_IDLE                     _SCI2S1.Bits.IDLE&lt;br /&gt;#define SCI2S1_RDRF                     _SCI2S1.Bits.RDRF&lt;br /&gt;#define SCI2S1_TC                       _SCI2S1.Bits.TC&lt;br /&gt;#define SCI2S1_TDRE                     _SCI2S1.Bits.TDRE&lt;br /&gt;&lt;br /&gt;#define SCI2S1_PF_MASK                  1&lt;br /&gt;#define SCI2S1_FE_MASK                  2&lt;br /&gt;#define SCI2S1_NF_MASK                  4&lt;br /&gt;#define SCI2S1_OR_MASK                  8&lt;br /&gt;#define SCI2S1_IDLE_MASK                16&lt;br /&gt;#define SCI2S1_RDRF_MASK                32&lt;br /&gt;#define SCI2S1_TC_MASK                  64&lt;br /&gt;#define SCI2S1_TDRE_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2S2 - SCI2 Status Register 2; 0x00000025 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte RAF         :1;                                       /* Receiver Active Flag */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2S2STR;&lt;br /&gt;extern volatile SCI2S2STR _SCI2S2 @0x00000025;&lt;br /&gt;#define SCI2S2                          _SCI2S2.Byte&lt;br /&gt;#define SCI2S2_RAF                      _SCI2S2.Bits.RAF&lt;br /&gt;&lt;br /&gt;#define SCI2S2_RAF_MASK                 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2C3 - SCI2 Control Register 3; 0x00000026 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PEIE        :1;                                       /* Parity Error Interrupt Enable */&lt;br /&gt;    byte FEIE        :1;                                       /* Framing Error Interrupt Enable */&lt;br /&gt;    byte NEIE        :1;                                       /* Noise Error Interrupt Enable */&lt;br /&gt;    byte ORIE        :1;                                       /* Overrun Interrupt Enable */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte TXDIR       :1;                                       /* TxD Pin Direction in Single-Wire Mode */&lt;br /&gt;    byte T8          :1;                                       /* Ninth Data Bit for Transmitter */&lt;br /&gt;    byte R8          :1;                                       /* Ninth Data Bit for Receiver */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2C3STR;&lt;br /&gt;extern volatile SCI2C3STR _SCI2C3 @0x00000026;&lt;br /&gt;#define SCI2C3                          _SCI2C3.Byte&lt;br /&gt;#define SCI2C3_PEIE                     _SCI2C3.Bits.PEIE&lt;br /&gt;#define SCI2C3_FEIE                     _SCI2C3.Bits.FEIE&lt;br /&gt;#define SCI2C3_NEIE                     _SCI2C3.Bits.NEIE&lt;br /&gt;#define SCI2C3_ORIE                     _SCI2C3.Bits.ORIE&lt;br /&gt;#define SCI2C3_TXDIR                    _SCI2C3.Bits.TXDIR&lt;br /&gt;#define SCI2C3_T8                       _SCI2C3.Bits.T8&lt;br /&gt;#define SCI2C3_R8                       _SCI2C3.Bits.R8&lt;br /&gt;&lt;br /&gt;#define SCI2C3_PEIE_MASK                1&lt;br /&gt;#define SCI2C3_FEIE_MASK                2&lt;br /&gt;#define SCI2C3_NEIE_MASK                4&lt;br /&gt;#define SCI2C3_ORIE_MASK                8&lt;br /&gt;#define SCI2C3_TXDIR_MASK               32&lt;br /&gt;#define SCI2C3_T8_MASK                  64&lt;br /&gt;#define SCI2C3_R8_MASK                  128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SCI2D - SCI2 Data Register; 0x00000027 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte R0_T0       :1;                                       /* Receive/Transmit Data Bit 0 */&lt;br /&gt;    byte R1_T1       :1;                                       /* Receive/Transmit Data Bit 1 */&lt;br /&gt;    byte R2_T2       :1;                                       /* Receive/Transmit Data Bit 2 */&lt;br /&gt;    byte R3_T3       :1;                                       /* Receive/Transmit Data Bit 3 */&lt;br /&gt;    byte R4_T4       :1;                                       /* Receive/Transmit Data Bit 4 */&lt;br /&gt;    byte R5_T5       :1;                                       /* Receive/Transmit Data Bit 5 */&lt;br /&gt;    byte R6_T6       :1;                                       /* Receive/Transmit Data Bit 6 */&lt;br /&gt;    byte R7_T7       :1;                                       /* Receive/Transmit Data Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} SCI2DSTR;&lt;br /&gt;extern volatile SCI2DSTR _SCI2D @0x00000027;&lt;br /&gt;#define SCI2D                           _SCI2D.Byte&lt;br /&gt;#define SCI2D_R0_T0                     _SCI2D.Bits.R0_T0&lt;br /&gt;#define SCI2D_R1_T1                     _SCI2D.Bits.R1_T1&lt;br /&gt;#define SCI2D_R2_T2                     _SCI2D.Bits.R2_T2&lt;br /&gt;#define SCI2D_R3_T3                     _SCI2D.Bits.R3_T3&lt;br /&gt;#define SCI2D_R4_T4                     _SCI2D.Bits.R4_T4&lt;br /&gt;#define SCI2D_R5_T5                     _SCI2D.Bits.R5_T5&lt;br /&gt;#define SCI2D_R6_T6                     _SCI2D.Bits.R6_T6&lt;br /&gt;#define SCI2D_R7_T7                     _SCI2D.Bits.R7_T7&lt;br /&gt;&lt;br /&gt;#define SCI2D_R0_T0_MASK                1&lt;br /&gt;#define SCI2D_R1_T1_MASK                2&lt;br /&gt;#define SCI2D_R2_T2_MASK                4&lt;br /&gt;#define SCI2D_R3_T3_MASK                8&lt;br /&gt;#define SCI2D_R4_T4_MASK                16&lt;br /&gt;#define SCI2D_R5_T5_MASK                32&lt;br /&gt;#define SCI2D_R6_T6_MASK                64&lt;br /&gt;#define SCI2D_R7_T7_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPI1C1 - SPI1 Control Register 1; 0x00000028 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte LSBFE       :1;                                       /* LSB First (shifter direction) */&lt;br /&gt;    byte SSOE        :1;                                       /* Slave Select Output Enable */&lt;br /&gt;    byte CPHA        :1;                                       /* Clock Phase */&lt;br /&gt;    byte CPOL        :1;                                       /* Clock Polarity */&lt;br /&gt;    byte MSTR        :1;                                       /* Master/Slave Mode Select */&lt;br /&gt;    byte SPTIE       :1;                                       /* SPI1 Transmit Interrupt Enable */&lt;br /&gt;    byte SPE         :1;                                       /* SPI1 System Enable */&lt;br /&gt;    byte SPIE        :1;                                       /* SPI1 Interrupt Enable */&lt;br /&gt;  } Bits;&lt;br /&gt;} SPI1C1STR;&lt;br /&gt;extern volatile SPI1C1STR _SPI1C1 @0x00000028;&lt;br /&gt;#define SPI1C1                          _SPI1C1.Byte&lt;br /&gt;#define SPI1C1_LSBFE                    _SPI1C1.Bits.LSBFE&lt;br /&gt;#define SPI1C1_SSOE                     _SPI1C1.Bits.SSOE&lt;br /&gt;#define SPI1C1_CPHA                     _SPI1C1.Bits.CPHA&lt;br /&gt;#define SPI1C1_CPOL                     _SPI1C1.Bits.CPOL&lt;br /&gt;#define SPI1C1_MSTR                     _SPI1C1.Bits.MSTR&lt;br /&gt;#define SPI1C1_SPTIE                    _SPI1C1.Bits.SPTIE&lt;br /&gt;#define SPI1C1_SPE                      _SPI1C1.Bits.SPE&lt;br /&gt;#define SPI1C1_SPIE                     _SPI1C1.Bits.SPIE&lt;br /&gt;&lt;br /&gt;#define SPI1C1_LSBFE_MASK               1&lt;br /&gt;#define SPI1C1_SSOE_MASK                2&lt;br /&gt;#define SPI1C1_CPHA_MASK                4&lt;br /&gt;#define SPI1C1_CPOL_MASK                8&lt;br /&gt;#define SPI1C1_MSTR_MASK                16&lt;br /&gt;#define SPI1C1_SPTIE_MASK               32&lt;br /&gt;#define SPI1C1_SPE_MASK                 64&lt;br /&gt;#define SPI1C1_SPIE_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPI1C2 - SPI1 Control Register 2; 0x00000029 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte SPC0        :1;                                       /* SPI1 Pin Control 0 */&lt;br /&gt;    byte SPISWAI     :1;                                       /* SPI1 Stop in Wait Mode */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte BIDIROE     :1;                                       /* Bidirectional Mode Output Enable */&lt;br /&gt;    byte MODFEN      :1;                                       /* Master Mode-Fault Function Enable */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} SPI1C2STR;&lt;br /&gt;extern volatile SPI1C2STR _SPI1C2 @0x00000029;&lt;br /&gt;#define SPI1C2                          _SPI1C2.Byte&lt;br /&gt;#define SPI1C2_SPC0                     _SPI1C2.Bits.SPC0&lt;br /&gt;#define SPI1C2_SPISWAI                  _SPI1C2.Bits.SPISWAI&lt;br /&gt;#define SPI1C2_BIDIROE                  _SPI1C2.Bits.BIDIROE&lt;br /&gt;#define SPI1C2_MODFEN                   _SPI1C2.Bits.MODFEN&lt;br /&gt;&lt;br /&gt;#define SPI1C2_SPC0_MASK                1&lt;br /&gt;#define SPI1C2_SPISWAI_MASK             2&lt;br /&gt;#define SPI1C2_BIDIROE_MASK             8&lt;br /&gt;#define SPI1C2_MODFEN_MASK              16&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPI1BR - SPI1 Baud Rate Register; 0x0000002A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte SPR0        :1;                                       /* SPI1 Baud Rate Divisor Bit 0 */&lt;br /&gt;    byte SPR1        :1;                                       /* SPI1 Baud Rate Divisor Bit 1 */&lt;br /&gt;    byte SPR2        :1;                                       /* SPI1 Baud Rate Divisor Bit 2 */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte SPPR0       :1;                                       /* SPI1 Baud Rate Prescale Divisor Bit 0 */&lt;br /&gt;    byte SPPR1       :1;                                       /* SPI1 Baud Rate Prescale Divisor Bit 1 */&lt;br /&gt;    byte SPPR2       :1;                                       /* SPI1 Baud Rate Prescale Divisor Bit 2 */&lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpSPR  :3;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpSPPR :3;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} SPI1BRSTR;&lt;br /&gt;extern volatile SPI1BRSTR _SPI1BR @0x0000002A;&lt;br /&gt;#define SPI1BR                          _SPI1BR.Byte&lt;br /&gt;#define SPI1BR_SPR0                     _SPI1BR.Bits.SPR0&lt;br /&gt;#define SPI1BR_SPR1                     _SPI1BR.Bits.SPR1&lt;br /&gt;#define SPI1BR_SPR2                     _SPI1BR.Bits.SPR2&lt;br /&gt;#define SPI1BR_SPPR0                    _SPI1BR.Bits.SPPR0&lt;br /&gt;#define SPI1BR_SPPR1                    _SPI1BR.Bits.SPPR1&lt;br /&gt;#define SPI1BR_SPPR2                    _SPI1BR.Bits.SPPR2&lt;br /&gt;#define SPI1BR_SPR                      _SPI1BR.MergedBits.grpSPR&lt;br /&gt;#define SPI1BR_SPPR                     _SPI1BR.MergedBits.grpSPPR&lt;br /&gt;&lt;br /&gt;#define SPI1BR_SPR0_MASK                1&lt;br /&gt;#define SPI1BR_SPR1_MASK                2&lt;br /&gt;#define SPI1BR_SPR2_MASK                4&lt;br /&gt;#define SPI1BR_SPPR0_MASK               16&lt;br /&gt;#define SPI1BR_SPPR1_MASK               32&lt;br /&gt;#define SPI1BR_SPPR2_MASK               64&lt;br /&gt;#define SPI1BR_SPR_MASK                 7&lt;br /&gt;#define SPI1BR_SPR_BITNUM               0&lt;br /&gt;#define SPI1BR_SPPR_MASK                112&lt;br /&gt;#define SPI1BR_SPPR_BITNUM              4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPI1S - SPI1 Status Register; 0x0000002B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte MODF        :1;                                       /* Master Mode Fault Flag */&lt;br /&gt;    byte SPTEF       :1;                                       /* SPI1 Transmit Buffer Empty Flag */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte SPRF        :1;                                       /* SPI1 Read Buffer Full Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} SPI1SSTR;&lt;br /&gt;extern volatile SPI1SSTR _SPI1S @0x0000002B;&lt;br /&gt;#define SPI1S                           _SPI1S.Byte&lt;br /&gt;#define SPI1S_MODF                      _SPI1S.Bits.MODF&lt;br /&gt;#define SPI1S_SPTEF                     _SPI1S.Bits.SPTEF&lt;br /&gt;#define SPI1S_SPRF                      _SPI1S.Bits.SPRF&lt;br /&gt;&lt;br /&gt;#define SPI1S_MODF_MASK                 16&lt;br /&gt;#define SPI1S_SPTEF_MASK                32&lt;br /&gt;#define SPI1S_SPRF_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPI1D - SPI1 Data Register; 0x0000002D ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;} SPI1DSTR;&lt;br /&gt;extern volatile SPI1DSTR _SPI1D @0x0000002D;&lt;br /&gt;#define SPI1D                           _SPI1D.Byte&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1SC - TPM 1 Status and Control Register; 0x00000030 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PS0         :1;                                       /* Prescale Divisor Select Bit 0 */&lt;br /&gt;    byte PS1         :1;                                       /* Prescale Divisor Select Bit 1 */&lt;br /&gt;    byte PS2         :1;                                       /* Prescale Divisor Select Bit 2 */&lt;br /&gt;    byte CLKSA       :1;                                       /* Clock Source Select A */&lt;br /&gt;    byte CLKSB       :1;                                       /* Clock Source Select B */&lt;br /&gt;    byte CPWMS       :1;                                       /* Center-Aligned PWM Select */&lt;br /&gt;    byte TOIE        :1;                                       /* Timer Overflow Interrupt Enable */&lt;br /&gt;    byte TOF         :1;                                       /* Timer Overflow Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpPS   :3;&lt;br /&gt;    byte grpCLKSx :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM1SCSTR;&lt;br /&gt;extern volatile TPM1SCSTR _TPM1SC @0x00000030;&lt;br /&gt;#define TPM1SC                          _TPM1SC.Byte&lt;br /&gt;#define TPM1SC_PS0                      _TPM1SC.Bits.PS0&lt;br /&gt;#define TPM1SC_PS1                      _TPM1SC.Bits.PS1&lt;br /&gt;#define TPM1SC_PS2                      _TPM1SC.Bits.PS2&lt;br /&gt;#define TPM1SC_CLKSA                    _TPM1SC.Bits.CLKSA&lt;br /&gt;#define TPM1SC_CLKSB                    _TPM1SC.Bits.CLKSB&lt;br /&gt;#define TPM1SC_CPWMS                    _TPM1SC.Bits.CPWMS&lt;br /&gt;#define TPM1SC_TOIE                     _TPM1SC.Bits.TOIE&lt;br /&gt;#define TPM1SC_TOF                      _TPM1SC.Bits.TOF&lt;br /&gt;#define TPM1SC_PS                       _TPM1SC.MergedBits.grpPS&lt;br /&gt;#define TPM1SC_CLKSx                    _TPM1SC.MergedBits.grpCLKSx&lt;br /&gt;&lt;br /&gt;#define TPM1SC_PS0_MASK                 1&lt;br /&gt;#define TPM1SC_PS1_MASK                 2&lt;br /&gt;#define TPM1SC_PS2_MASK                 4&lt;br /&gt;#define TPM1SC_CLKSA_MASK               8&lt;br /&gt;#define TPM1SC_CLKSB_MASK               16&lt;br /&gt;#define TPM1SC_CPWMS_MASK               32&lt;br /&gt;#define TPM1SC_TOIE_MASK                64&lt;br /&gt;#define TPM1SC_TOF_MASK                 128&lt;br /&gt;#define TPM1SC_PS_MASK                  7&lt;br /&gt;#define TPM1SC_PS_BITNUM                0&lt;br /&gt;#define TPM1SC_CLKSx_MASK               24&lt;br /&gt;#define TPM1SC_CLKSx_BITNUM             3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1CNT - TPM 1 Counter Register; 0x00000031 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM1CNTH - TPM 1 Counter Register High; 0x00000031 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1CNTHSTR;&lt;br /&gt;    #define TPM1CNTH                    _TPM1CNT.Overlap_STR.TPM1CNTHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM1CNTL - TPM 1 Counter Register Low; 0x00000032 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1CNTLSTR;&lt;br /&gt;    #define TPM1CNTL                    _TPM1CNT.Overlap_STR.TPM1CNTLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM1CNTSTR;&lt;br /&gt;extern volatile TPM1CNTSTR _TPM1CNT @0x00000031;&lt;br /&gt;#define TPM1CNT                         _TPM1CNT.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1MOD - TPM 1 Timer Counter Modulo Register; 0x00000033 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM1MODH - TPM 1 Timer Counter Modulo Register High; 0x00000033 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1MODHSTR;&lt;br /&gt;    #define TPM1MODH                    _TPM1MOD.Overlap_STR.TPM1MODHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM1MODL - TPM 1 Timer Counter Modulo Register Low; 0x00000034 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1MODLSTR;&lt;br /&gt;    #define TPM1MODL                    _TPM1MOD.Overlap_STR.TPM1MODLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM1MODSTR;&lt;br /&gt;extern volatile TPM1MODSTR _TPM1MOD @0x00000033;&lt;br /&gt;#define TPM1MOD                         _TPM1MOD.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C0SC - TPM 1 Timer Channel 0 Status and Control Register; 0x00000035 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS0A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS0B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS0A        :1;                                       /* Mode Select A for TPM Channel 0 */&lt;br /&gt;    byte MS0B        :1;                                       /* Mode Select B for TPM Channel 0 */&lt;br /&gt;    byte CH0IE       :1;                                       /* Channel 0 Interrupt Enable */&lt;br /&gt;    byte CH0F        :1;                                       /* Channel 0 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS0x :2;&lt;br /&gt;    byte grpMS0x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM1C0SCSTR;&lt;br /&gt;extern volatile TPM1C0SCSTR _TPM1C0SC @0x00000035;&lt;br /&gt;#define TPM1C0SC                        _TPM1C0SC.Byte&lt;br /&gt;#define TPM1C0SC_ELS0A                  _TPM1C0SC.Bits.ELS0A&lt;br /&gt;#define TPM1C0SC_ELS0B                  _TPM1C0SC.Bits.ELS0B&lt;br /&gt;#define TPM1C0SC_MS0A                   _TPM1C0SC.Bits.MS0A&lt;br /&gt;#define TPM1C0SC_MS0B                   _TPM1C0SC.Bits.MS0B&lt;br /&gt;#define TPM1C0SC_CH0IE                  _TPM1C0SC.Bits.CH0IE&lt;br /&gt;#define TPM1C0SC_CH0F                   _TPM1C0SC.Bits.CH0F&lt;br /&gt;#define TPM1C0SC_ELS0x                  _TPM1C0SC.MergedBits.grpELS0x&lt;br /&gt;#define TPM1C0SC_MS0x                   _TPM1C0SC.MergedBits.grpMS0x&lt;br /&gt;&lt;br /&gt;#define TPM1C0SC_ELS0A_MASK             4&lt;br /&gt;#define TPM1C0SC_ELS0B_MASK             8&lt;br /&gt;#define TPM1C0SC_MS0A_MASK              16&lt;br /&gt;#define TPM1C0SC_MS0B_MASK              32&lt;br /&gt;#define TPM1C0SC_CH0IE_MASK             64&lt;br /&gt;#define TPM1C0SC_CH0F_MASK              128&lt;br /&gt;#define TPM1C0SC_ELS0x_MASK             12&lt;br /&gt;#define TPM1C0SC_ELS0x_BITNUM           2&lt;br /&gt;#define TPM1C0SC_MS0x_MASK              48&lt;br /&gt;#define TPM1C0SC_MS0x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C0V - TPM 1 Timer Channel 0 Value Register; 0x00000036 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM1C0VH - TPM 1 Timer Channel 0 Value Register High; 0x00000036 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C0VHSTR;&lt;br /&gt;    #define TPM1C0VH                    _TPM1C0V.Overlap_STR.TPM1C0VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM1C0VL - TPM 1 Timer Channel 0 Value Register Low; 0x00000037 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C0VLSTR;&lt;br /&gt;    #define TPM1C0VL                    _TPM1C0V.Overlap_STR.TPM1C0VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM1C0VSTR;&lt;br /&gt;extern volatile TPM1C0VSTR _TPM1C0V @0x00000036;&lt;br /&gt;#define TPM1C0V                         _TPM1C0V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C1SC - TPM 1 Timer Channel 1 Status and Control Register; 0x00000038 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS1A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS1B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS1A        :1;                                       /* Mode Select A for TPM Channel 1 */&lt;br /&gt;    byte MS1B        :1;                                       /* Mode Select B for TPM Channel 1 */&lt;br /&gt;    byte CH1IE       :1;                                       /* Channel 1 Interrupt Enable */&lt;br /&gt;    byte CH1F        :1;                                       /* Channel 1 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS1x :2;&lt;br /&gt;    byte grpMS1x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM1C1SCSTR;&lt;br /&gt;extern volatile TPM1C1SCSTR _TPM1C1SC @0x00000038;&lt;br /&gt;#define TPM1C1SC                        _TPM1C1SC.Byte&lt;br /&gt;#define TPM1C1SC_ELS1A                  _TPM1C1SC.Bits.ELS1A&lt;br /&gt;#define TPM1C1SC_ELS1B                  _TPM1C1SC.Bits.ELS1B&lt;br /&gt;#define TPM1C1SC_MS1A                   _TPM1C1SC.Bits.MS1A&lt;br /&gt;#define TPM1C1SC_MS1B                   _TPM1C1SC.Bits.MS1B&lt;br /&gt;#define TPM1C1SC_CH1IE                  _TPM1C1SC.Bits.CH1IE&lt;br /&gt;#define TPM1C1SC_CH1F                   _TPM1C1SC.Bits.CH1F&lt;br /&gt;#define TPM1C1SC_ELS1x                  _TPM1C1SC.MergedBits.grpELS1x&lt;br /&gt;#define TPM1C1SC_MS1x                   _TPM1C1SC.MergedBits.grpMS1x&lt;br /&gt;&lt;br /&gt;#define TPM1C1SC_ELS1A_MASK             4&lt;br /&gt;#define TPM1C1SC_ELS1B_MASK             8&lt;br /&gt;#define TPM1C1SC_MS1A_MASK              16&lt;br /&gt;#define TPM1C1SC_MS1B_MASK              32&lt;br /&gt;#define TPM1C1SC_CH1IE_MASK             64&lt;br /&gt;#define TPM1C1SC_CH1F_MASK              128&lt;br /&gt;#define TPM1C1SC_ELS1x_MASK             12&lt;br /&gt;#define TPM1C1SC_ELS1x_BITNUM           2&lt;br /&gt;#define TPM1C1SC_MS1x_MASK              48&lt;br /&gt;#define TPM1C1SC_MS1x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C1V - TPM 1 Timer Channel 1 Value Register; 0x00000039 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM1C1VH - TPM 1 Timer Channel 1 Value Register High; 0x00000039 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C1VHSTR;&lt;br /&gt;    #define TPM1C1VH                    _TPM1C1V.Overlap_STR.TPM1C1VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM1C1VL - TPM 1 Timer Channel 1 Value Register Low; 0x0000003A ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C1VLSTR;&lt;br /&gt;    #define TPM1C1VL                    _TPM1C1V.Overlap_STR.TPM1C1VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM1C1VSTR;&lt;br /&gt;extern volatile TPM1C1VSTR _TPM1C1V @0x00000039;&lt;br /&gt;#define TPM1C1V                         _TPM1C1V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C2SC - TPM 1 Timer Channel 2 Status and Control Register; 0x0000003B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS2A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS2B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS2A        :1;                                       /* Mode Select A for TPM Channel 2 */&lt;br /&gt;    byte MS2B        :1;                                       /* Mode Select B for TPM Channel 2 */&lt;br /&gt;    byte CH2IE       :1;                                       /* Channel 2 Interrupt Enable */&lt;br /&gt;    byte CH2F        :1;                                       /* Channel 2 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS2x :2;&lt;br /&gt;    byte grpMS2x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM1C2SCSTR;&lt;br /&gt;extern volatile TPM1C2SCSTR _TPM1C2SC @0x0000003B;&lt;br /&gt;#define TPM1C2SC                        _TPM1C2SC.Byte&lt;br /&gt;#define TPM1C2SC_ELS2A                  _TPM1C2SC.Bits.ELS2A&lt;br /&gt;#define TPM1C2SC_ELS2B                  _TPM1C2SC.Bits.ELS2B&lt;br /&gt;#define TPM1C2SC_MS2A                   _TPM1C2SC.Bits.MS2A&lt;br /&gt;#define TPM1C2SC_MS2B                   _TPM1C2SC.Bits.MS2B&lt;br /&gt;#define TPM1C2SC_CH2IE                  _TPM1C2SC.Bits.CH2IE&lt;br /&gt;#define TPM1C2SC_CH2F                   _TPM1C2SC.Bits.CH2F&lt;br /&gt;#define TPM1C2SC_ELS2x                  _TPM1C2SC.MergedBits.grpELS2x&lt;br /&gt;#define TPM1C2SC_MS2x                   _TPM1C2SC.MergedBits.grpMS2x&lt;br /&gt;&lt;br /&gt;#define TPM1C2SC_ELS2A_MASK             4&lt;br /&gt;#define TPM1C2SC_ELS2B_MASK             8&lt;br /&gt;#define TPM1C2SC_MS2A_MASK              16&lt;br /&gt;#define TPM1C2SC_MS2B_MASK              32&lt;br /&gt;#define TPM1C2SC_CH2IE_MASK             64&lt;br /&gt;#define TPM1C2SC_CH2F_MASK              128&lt;br /&gt;#define TPM1C2SC_ELS2x_MASK             12&lt;br /&gt;#define TPM1C2SC_ELS2x_BITNUM           2&lt;br /&gt;#define TPM1C2SC_MS2x_MASK              48&lt;br /&gt;#define TPM1C2SC_MS2x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM1C2V - TPM 1 Timer Channel 2 Value Register; 0x0000003C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM1C2VH - TPM 1 Timer Channel 2 Value Register High; 0x0000003C ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C2VHSTR;&lt;br /&gt;    #define TPM1C2VH                    _TPM1C2V.Overlap_STR.TPM1C2VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM1C2VL - TPM 1 Timer Channel 2 Value Register Low; 0x0000003D ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM1C2VLSTR;&lt;br /&gt;    #define TPM1C2VL                    _TPM1C2V.Overlap_STR.TPM1C2VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM1C2VSTR;&lt;br /&gt;extern volatile TPM1C2VSTR _TPM1C2V @0x0000003C;&lt;br /&gt;#define TPM1C2V                         _TPM1C2V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTFD - Port F Data Register; 0x00000040 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTFD0       :1;                                       /* Port F Data Register Bit 0 */&lt;br /&gt;    byte PTFD1       :1;                                       /* Port F Data Register Bit 1 */&lt;br /&gt;    byte PTFD2       :1;                                       /* Port F Data Register Bit 2 */&lt;br /&gt;    byte PTFD3       :1;                                       /* Port F Data Register Bit 3 */&lt;br /&gt;    byte PTFD4       :1;                                       /* Port F Data Register Bit 4 */&lt;br /&gt;    byte PTFD5       :1;                                       /* Port F Data Register Bit 5 */&lt;br /&gt;    byte PTFD6       :1;                                       /* Port F Data Register Bit 6 */&lt;br /&gt;    byte PTFD7       :1;                                       /* Port F Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTFDSTR;&lt;br /&gt;extern volatile PTFDSTR _PTFD @0x00000040;&lt;br /&gt;#define PTFD                            _PTFD.Byte&lt;br /&gt;#define PTFD_PTFD0                      _PTFD.Bits.PTFD0&lt;br /&gt;#define PTFD_PTFD1                      _PTFD.Bits.PTFD1&lt;br /&gt;#define PTFD_PTFD2                      _PTFD.Bits.PTFD2&lt;br /&gt;#define PTFD_PTFD3                      _PTFD.Bits.PTFD3&lt;br /&gt;#define PTFD_PTFD4                      _PTFD.Bits.PTFD4&lt;br /&gt;#define PTFD_PTFD5                      _PTFD.Bits.PTFD5&lt;br /&gt;#define PTFD_PTFD6                      _PTFD.Bits.PTFD6&lt;br /&gt;#define PTFD_PTFD7                      _PTFD.Bits.PTFD7&lt;br /&gt;&lt;br /&gt;#define PTFD_PTFD0_MASK                 1&lt;br /&gt;#define PTFD_PTFD1_MASK                 2&lt;br /&gt;#define PTFD_PTFD2_MASK                 4&lt;br /&gt;#define PTFD_PTFD3_MASK                 8&lt;br /&gt;#define PTFD_PTFD4_MASK                 16&lt;br /&gt;#define PTFD_PTFD5_MASK                 32&lt;br /&gt;#define PTFD_PTFD6_MASK                 64&lt;br /&gt;#define PTFD_PTFD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTFPE - Pullup Enable for Port F; 0x00000041 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTFPE0      :1;                                       /* Pullup Enable for Port F Bit 0 */&lt;br /&gt;    byte PTFPE1      :1;                                       /* Pullup Enable for Port F Bit 1 */&lt;br /&gt;    byte PTFPE2      :1;                                       /* Pullup Enable for Port F Bit 2 */&lt;br /&gt;    byte PTFPE3      :1;                                       /* Pullup Enable for Port F Bit 3 */&lt;br /&gt;    byte PTFPE4      :1;                                       /* Pullup Enable for Port F Bit 4 */&lt;br /&gt;    byte PTFPE5      :1;                                       /* Pullup Enable for Port F Bit 5 */&lt;br /&gt;    byte PTFPE6      :1;                                       /* Pullup Enable for Port F Bit 6 */&lt;br /&gt;    byte PTFPE7      :1;                                       /* Pullup Enable for Port F Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTFPESTR;&lt;br /&gt;extern volatile PTFPESTR _PTFPE @0x00000041;&lt;br /&gt;#define PTFPE                           _PTFPE.Byte&lt;br /&gt;#define PTFPE_PTFPE0                    _PTFPE.Bits.PTFPE0&lt;br /&gt;#define PTFPE_PTFPE1                    _PTFPE.Bits.PTFPE1&lt;br /&gt;#define PTFPE_PTFPE2                    _PTFPE.Bits.PTFPE2&lt;br /&gt;#define PTFPE_PTFPE3                    _PTFPE.Bits.PTFPE3&lt;br /&gt;#define PTFPE_PTFPE4                    _PTFPE.Bits.PTFPE4&lt;br /&gt;#define PTFPE_PTFPE5                    _PTFPE.Bits.PTFPE5&lt;br /&gt;#define PTFPE_PTFPE6                    _PTFPE.Bits.PTFPE6&lt;br /&gt;#define PTFPE_PTFPE7                    _PTFPE.Bits.PTFPE7&lt;br /&gt;&lt;br /&gt;#define PTFPE_PTFPE0_MASK               1&lt;br /&gt;#define PTFPE_PTFPE1_MASK               2&lt;br /&gt;#define PTFPE_PTFPE2_MASK               4&lt;br /&gt;#define PTFPE_PTFPE3_MASK               8&lt;br /&gt;#define PTFPE_PTFPE4_MASK               16&lt;br /&gt;#define PTFPE_PTFPE5_MASK               32&lt;br /&gt;#define PTFPE_PTFPE6_MASK               64&lt;br /&gt;#define PTFPE_PTFPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTFSE - Slew Rate Control Enable for Port F; 0x00000042 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTFSE0      :1;                                       /* Slew Rate Control Enable for Port F Bit 0 */&lt;br /&gt;    byte PTFSE1      :1;                                       /* Slew Rate Control Enable for Port F Bit 1 */&lt;br /&gt;    byte PTFSE2      :1;                                       /* Slew Rate Control Enable for Port F Bit 2 */&lt;br /&gt;    byte PTFSE3      :1;                                       /* Slew Rate Control Enable for Port F Bit 3 */&lt;br /&gt;    byte PTFSE4      :1;                                       /* Slew Rate Control Enable for Port F Bit 4 */&lt;br /&gt;    byte PTFSE5      :1;                                       /* Slew Rate Control Enable for Port F Bit 5 */&lt;br /&gt;    byte PTFSE6      :1;                                       /* Slew Rate Control Enable for Port F Bit 6 */&lt;br /&gt;    byte PTFSE7      :1;                                       /* Slew Rate Control Enable for Port F Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTFSESTR;&lt;br /&gt;extern volatile PTFSESTR _PTFSE @0x00000042;&lt;br /&gt;#define PTFSE                           _PTFSE.Byte&lt;br /&gt;#define PTFSE_PTFSE0                    _PTFSE.Bits.PTFSE0&lt;br /&gt;#define PTFSE_PTFSE1                    _PTFSE.Bits.PTFSE1&lt;br /&gt;#define PTFSE_PTFSE2                    _PTFSE.Bits.PTFSE2&lt;br /&gt;#define PTFSE_PTFSE3                    _PTFSE.Bits.PTFSE3&lt;br /&gt;#define PTFSE_PTFSE4                    _PTFSE.Bits.PTFSE4&lt;br /&gt;#define PTFSE_PTFSE5                    _PTFSE.Bits.PTFSE5&lt;br /&gt;#define PTFSE_PTFSE6                    _PTFSE.Bits.PTFSE6&lt;br /&gt;#define PTFSE_PTFSE7                    _PTFSE.Bits.PTFSE7&lt;br /&gt;&lt;br /&gt;#define PTFSE_PTFSE0_MASK               1&lt;br /&gt;#define PTFSE_PTFSE1_MASK               2&lt;br /&gt;#define PTFSE_PTFSE2_MASK               4&lt;br /&gt;#define PTFSE_PTFSE3_MASK               8&lt;br /&gt;#define PTFSE_PTFSE4_MASK               16&lt;br /&gt;#define PTFSE_PTFSE5_MASK               32&lt;br /&gt;#define PTFSE_PTFSE6_MASK               64&lt;br /&gt;#define PTFSE_PTFSE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTFDD - Data Direction Register F; 0x00000043 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTFDD0      :1;                                       /* Data Direction for Port F Bit 0 */&lt;br /&gt;    byte PTFDD1      :1;                                       /* Data Direction for Port F Bit 1 */&lt;br /&gt;    byte PTFDD2      :1;                                       /* Data Direction for Port F Bit 2 */&lt;br /&gt;    byte PTFDD3      :1;                                       /* Data Direction for Port F Bit 3 */&lt;br /&gt;    byte PTFDD4      :1;                                       /* Data Direction for Port F Bit 4 */&lt;br /&gt;    byte PTFDD5      :1;                                       /* Data Direction for Port F Bit 5 */&lt;br /&gt;    byte PTFDD6      :1;                                       /* Data Direction for Port F Bit 6 */&lt;br /&gt;    byte PTFDD7      :1;                                       /* Data Direction for Port F Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTFDDSTR;&lt;br /&gt;extern volatile PTFDDSTR _PTFDD @0x00000043;&lt;br /&gt;#define PTFDD                           _PTFDD.Byte&lt;br /&gt;#define PTFDD_PTFDD0                    _PTFDD.Bits.PTFDD0&lt;br /&gt;#define PTFDD_PTFDD1                    _PTFDD.Bits.PTFDD1&lt;br /&gt;#define PTFDD_PTFDD2                    _PTFDD.Bits.PTFDD2&lt;br /&gt;#define PTFDD_PTFDD3                    _PTFDD.Bits.PTFDD3&lt;br /&gt;#define PTFDD_PTFDD4                    _PTFDD.Bits.PTFDD4&lt;br /&gt;#define PTFDD_PTFDD5                    _PTFDD.Bits.PTFDD5&lt;br /&gt;#define PTFDD_PTFDD6                    _PTFDD.Bits.PTFDD6&lt;br /&gt;#define PTFDD_PTFDD7                    _PTFDD.Bits.PTFDD7&lt;br /&gt;&lt;br /&gt;#define PTFDD_PTFDD0_MASK               1&lt;br /&gt;#define PTFDD_PTFDD1_MASK               2&lt;br /&gt;#define PTFDD_PTFDD2_MASK               4&lt;br /&gt;#define PTFDD_PTFDD3_MASK               8&lt;br /&gt;#define PTFDD_PTFDD4_MASK               16&lt;br /&gt;#define PTFDD_PTFDD5_MASK               32&lt;br /&gt;#define PTFDD_PTFDD6_MASK               64&lt;br /&gt;#define PTFDD_PTFDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTGD - Port G Data Register; 0x00000044 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTGD0       :1;                                       /* Port G Data Register Bit 0 */&lt;br /&gt;    byte PTGD1       :1;                                       /* Port G Data Register Bit 1 */&lt;br /&gt;    byte PTGD2       :1;                                       /* Port G Data Register Bit 2 */&lt;br /&gt;    byte PTGD3       :1;                                       /* Port G Data Register Bit 3 */&lt;br /&gt;    byte PTGD4       :1;                                       /* Port G Data Register Bit 4 */&lt;br /&gt;    byte PTGD5       :1;                                       /* Port G Data Register Bit 5 */&lt;br /&gt;    byte PTGD6       :1;                                       /* Port G Data Register Bit 6 */&lt;br /&gt;    byte PTGD7       :1;                                       /* Port G Data Register Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTGDSTR;&lt;br /&gt;extern volatile PTGDSTR _PTGD @0x00000044;&lt;br /&gt;#define PTGD                            _PTGD.Byte&lt;br /&gt;#define PTGD_PTGD0                      _PTGD.Bits.PTGD0&lt;br /&gt;#define PTGD_PTGD1                      _PTGD.Bits.PTGD1&lt;br /&gt;#define PTGD_PTGD2                      _PTGD.Bits.PTGD2&lt;br /&gt;#define PTGD_PTGD3                      _PTGD.Bits.PTGD3&lt;br /&gt;#define PTGD_PTGD4                      _PTGD.Bits.PTGD4&lt;br /&gt;#define PTGD_PTGD5                      _PTGD.Bits.PTGD5&lt;br /&gt;#define PTGD_PTGD6                      _PTGD.Bits.PTGD6&lt;br /&gt;#define PTGD_PTGD7                      _PTGD.Bits.PTGD7&lt;br /&gt;&lt;br /&gt;#define PTGD_PTGD0_MASK                 1&lt;br /&gt;#define PTGD_PTGD1_MASK                 2&lt;br /&gt;#define PTGD_PTGD2_MASK                 4&lt;br /&gt;#define PTGD_PTGD3_MASK                 8&lt;br /&gt;#define PTGD_PTGD4_MASK                 16&lt;br /&gt;#define PTGD_PTGD5_MASK                 32&lt;br /&gt;#define PTGD_PTGD6_MASK                 64&lt;br /&gt;#define PTGD_PTGD7_MASK                 128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTGPE - Pullup Enable for Port G; 0x00000045 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTGPE0      :1;                                       /* Pullup Enable for Port G Bit 0 */&lt;br /&gt;    byte PTGPE1      :1;                                       /* Pullup Enable for Port G Bit 1 */&lt;br /&gt;    byte PTGPE2      :1;                                       /* Pullup Enable for Port G Bit 2 */&lt;br /&gt;    byte PTGPE3      :1;                                       /* Pullup Enable for Port G Bit 3 */&lt;br /&gt;    byte PTGPE4      :1;                                       /* Pullup Enable for Port G Bit 4 */&lt;br /&gt;    byte PTGPE5      :1;                                       /* Pullup Enable for Port G Bit 5 */&lt;br /&gt;    byte PTGPE6      :1;                                       /* Pullup Enable for Port G Bit 6 */&lt;br /&gt;    byte PTGPE7      :1;                                       /* Pullup Enable for Port G Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTGPESTR;&lt;br /&gt;extern volatile PTGPESTR _PTGPE @0x00000045;&lt;br /&gt;#define PTGPE                           _PTGPE.Byte&lt;br /&gt;#define PTGPE_PTGPE0                    _PTGPE.Bits.PTGPE0&lt;br /&gt;#define PTGPE_PTGPE1                    _PTGPE.Bits.PTGPE1&lt;br /&gt;#define PTGPE_PTGPE2                    _PTGPE.Bits.PTGPE2&lt;br /&gt;#define PTGPE_PTGPE3                    _PTGPE.Bits.PTGPE3&lt;br /&gt;#define PTGPE_PTGPE4                    _PTGPE.Bits.PTGPE4&lt;br /&gt;#define PTGPE_PTGPE5                    _PTGPE.Bits.PTGPE5&lt;br /&gt;#define PTGPE_PTGPE6                    _PTGPE.Bits.PTGPE6&lt;br /&gt;#define PTGPE_PTGPE7                    _PTGPE.Bits.PTGPE7&lt;br /&gt;&lt;br /&gt;#define PTGPE_PTGPE0_MASK               1&lt;br /&gt;#define PTGPE_PTGPE1_MASK               2&lt;br /&gt;#define PTGPE_PTGPE2_MASK               4&lt;br /&gt;#define PTGPE_PTGPE3_MASK               8&lt;br /&gt;#define PTGPE_PTGPE4_MASK               16&lt;br /&gt;#define PTGPE_PTGPE5_MASK               32&lt;br /&gt;#define PTGPE_PTGPE6_MASK               64&lt;br /&gt;#define PTGPE_PTGPE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTGSE - Slew Rate Control Enable for Port G; 0x00000046 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTGSE0      :1;                                       /* Slew Rate Control Enable for Port G Bit 0 */&lt;br /&gt;    byte PTGSE1      :1;                                       /* Slew Rate Control Enable for Port G Bit 1 */&lt;br /&gt;    byte PTGSE2      :1;                                       /* Slew Rate Control Enable for Port G Bit 2 */&lt;br /&gt;    byte PTGSE3      :1;                                       /* Slew Rate Control Enable for Port G Bit 3 */&lt;br /&gt;    byte PTGSE4      :1;                                       /* Slew Rate Control Enable for Port G Bit 4 */&lt;br /&gt;    byte PTGSE5      :1;                                       /* Slew Rate Control Enable for Port G Bit 5 */&lt;br /&gt;    byte PTGSE6      :1;                                       /* Slew Rate Control Enable for Port G Bit 6 */&lt;br /&gt;    byte PTGSE7      :1;                                       /* Slew Rate Control Enable for Port G Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTGSESTR;&lt;br /&gt;extern volatile PTGSESTR _PTGSE @0x00000046;&lt;br /&gt;#define PTGSE                           _PTGSE.Byte&lt;br /&gt;#define PTGSE_PTGSE0                    _PTGSE.Bits.PTGSE0&lt;br /&gt;#define PTGSE_PTGSE1                    _PTGSE.Bits.PTGSE1&lt;br /&gt;#define PTGSE_PTGSE2                    _PTGSE.Bits.PTGSE2&lt;br /&gt;#define PTGSE_PTGSE3                    _PTGSE.Bits.PTGSE3&lt;br /&gt;#define PTGSE_PTGSE4                    _PTGSE.Bits.PTGSE4&lt;br /&gt;#define PTGSE_PTGSE5                    _PTGSE.Bits.PTGSE5&lt;br /&gt;#define PTGSE_PTGSE6                    _PTGSE.Bits.PTGSE6&lt;br /&gt;#define PTGSE_PTGSE7                    _PTGSE.Bits.PTGSE7&lt;br /&gt;&lt;br /&gt;#define PTGSE_PTGSE0_MASK               1&lt;br /&gt;#define PTGSE_PTGSE1_MASK               2&lt;br /&gt;#define PTGSE_PTGSE2_MASK               4&lt;br /&gt;#define PTGSE_PTGSE3_MASK               8&lt;br /&gt;#define PTGSE_PTGSE4_MASK               16&lt;br /&gt;#define PTGSE_PTGSE5_MASK               32&lt;br /&gt;#define PTGSE_PTGSE6_MASK               64&lt;br /&gt;#define PTGSE_PTGSE7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** PTGDD - Data Direction Register G; 0x00000047 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PTGDD0      :1;                                       /* Data Direction for Port G Bit 0 */&lt;br /&gt;    byte PTGDD1      :1;                                       /* Data Direction for Port G Bit 1 */&lt;br /&gt;    byte PTGDD2      :1;                                       /* Data Direction for Port G Bit 2 */&lt;br /&gt;    byte PTGDD3      :1;                                       /* Data Direction for Port G Bit 3 */&lt;br /&gt;    byte PTGDD4      :1;                                       /* Data Direction for Port G Bit 4 */&lt;br /&gt;    byte PTGDD5      :1;                                       /* Data Direction for Port G Bit 5 */&lt;br /&gt;    byte PTGDD6      :1;                                       /* Data Direction for Port G Bit 6 */&lt;br /&gt;    byte PTGDD7      :1;                                       /* Data Direction for Port G Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} PTGDDSTR;&lt;br /&gt;extern volatile PTGDDSTR _PTGDD @0x00000047;&lt;br /&gt;#define PTGDD                           _PTGDD.Byte&lt;br /&gt;#define PTGDD_PTGDD0                    _PTGDD.Bits.PTGDD0&lt;br /&gt;#define PTGDD_PTGDD1                    _PTGDD.Bits.PTGDD1&lt;br /&gt;#define PTGDD_PTGDD2                    _PTGDD.Bits.PTGDD2&lt;br /&gt;#define PTGDD_PTGDD3                    _PTGDD.Bits.PTGDD3&lt;br /&gt;#define PTGDD_PTGDD4                    _PTGDD.Bits.PTGDD4&lt;br /&gt;#define PTGDD_PTGDD5                    _PTGDD.Bits.PTGDD5&lt;br /&gt;#define PTGDD_PTGDD6                    _PTGDD.Bits.PTGDD6&lt;br /&gt;#define PTGDD_PTGDD7                    _PTGDD.Bits.PTGDD7&lt;br /&gt;&lt;br /&gt;#define PTGDD_PTGDD0_MASK               1&lt;br /&gt;#define PTGDD_PTGDD1_MASK               2&lt;br /&gt;#define PTGDD_PTGDD2_MASK               4&lt;br /&gt;#define PTGDD_PTGDD3_MASK               8&lt;br /&gt;#define PTGDD_PTGDD4_MASK               16&lt;br /&gt;#define PTGDD_PTGDD5_MASK               32&lt;br /&gt;#define PTGDD_PTGDD6_MASK               64&lt;br /&gt;#define PTGDD_PTGDD7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGC1 - ICG Control Register 1; 0x00000048 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte OSCSTEN     :1;                                       /* Enable Oscillator in Off Mode */&lt;br /&gt;    byte CLKS0       :1;                                       /* Clock Mode Select Bit 0 */&lt;br /&gt;    byte CLKS1       :1;                                       /* Clock Mode Select Bit 1 */&lt;br /&gt;    byte REFS        :1;                                       /* External Reference Select */&lt;br /&gt;    byte RANGE       :1;                                       /* Frequency Range Select */&lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpCLKS :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} ICGC1STR;&lt;br /&gt;extern volatile ICGC1STR _ICGC1 @0x00000048;&lt;br /&gt;#define ICGC1                           _ICGC1.Byte&lt;br /&gt;#define ICGC1_OSCSTEN                   _ICGC1.Bits.OSCSTEN&lt;br /&gt;#define ICGC1_CLKS0                     _ICGC1.Bits.CLKS0&lt;br /&gt;#define ICGC1_CLKS1                     _ICGC1.Bits.CLKS1&lt;br /&gt;#define ICGC1_REFS                      _ICGC1.Bits.REFS&lt;br /&gt;#define ICGC1_RANGE                     _ICGC1.Bits.RANGE&lt;br /&gt;#define ICGC1_CLKS                      _ICGC1.MergedBits.grpCLKS&lt;br /&gt;&lt;br /&gt;#define ICGC1_OSCSTEN_MASK              4&lt;br /&gt;#define ICGC1_CLKS0_MASK                8&lt;br /&gt;#define ICGC1_CLKS1_MASK                16&lt;br /&gt;#define ICGC1_REFS_MASK                 32&lt;br /&gt;#define ICGC1_RANGE_MASK                64&lt;br /&gt;#define ICGC1_CLKS_MASK                 24&lt;br /&gt;#define ICGC1_CLKS_BITNUM               3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGC2 - ICG Control Register 2; 0x00000049 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte RFD0        :1;                                       /* Reduced Frequency Divider Bit 0 */&lt;br /&gt;    byte RFD1        :1;                                       /* Reduced Frequency Divider Bit 1 */&lt;br /&gt;    byte RFD2        :1;                                       /* Reduced Frequency Divider Bit 2 */&lt;br /&gt;    byte LOCRE       :1;                                       /* Loss of Clock Reset Enable */&lt;br /&gt;    byte MFD0        :1;                                       /* Multiplication Factor Bit 0 */&lt;br /&gt;    byte MFD1        :1;                                       /* Multiplication Factor Bit 1 */&lt;br /&gt;    byte MFD2        :1;                                       /* Multiplication Factor Bit 2 */&lt;br /&gt;    byte LOLRE       :1;                                       /* Loss of Lock Reset Enable */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpRFD  :3;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpMFD  :3;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} ICGC2STR;&lt;br /&gt;extern volatile ICGC2STR _ICGC2 @0x00000049;&lt;br /&gt;#define ICGC2                           _ICGC2.Byte&lt;br /&gt;#define ICGC2_RFD0                      _ICGC2.Bits.RFD0&lt;br /&gt;#define ICGC2_RFD1                      _ICGC2.Bits.RFD1&lt;br /&gt;#define ICGC2_RFD2                      _ICGC2.Bits.RFD2&lt;br /&gt;#define ICGC2_LOCRE                     _ICGC2.Bits.LOCRE&lt;br /&gt;#define ICGC2_MFD0                      _ICGC2.Bits.MFD0&lt;br /&gt;#define ICGC2_MFD1                      _ICGC2.Bits.MFD1&lt;br /&gt;#define ICGC2_MFD2                      _ICGC2.Bits.MFD2&lt;br /&gt;#define ICGC2_LOLRE                     _ICGC2.Bits.LOLRE&lt;br /&gt;#define ICGC2_RFD                       _ICGC2.MergedBits.grpRFD&lt;br /&gt;#define ICGC2_MFD                       _ICGC2.MergedBits.grpMFD&lt;br /&gt;&lt;br /&gt;#define ICGC2_RFD0_MASK                 1&lt;br /&gt;#define ICGC2_RFD1_MASK                 2&lt;br /&gt;#define ICGC2_RFD2_MASK                 4&lt;br /&gt;#define ICGC2_LOCRE_MASK                8&lt;br /&gt;#define ICGC2_MFD0_MASK                 16&lt;br /&gt;#define ICGC2_MFD1_MASK                 32&lt;br /&gt;#define ICGC2_MFD2_MASK                 64&lt;br /&gt;#define ICGC2_LOLRE_MASK                128&lt;br /&gt;#define ICGC2_RFD_MASK                  7&lt;br /&gt;#define ICGC2_RFD_BITNUM                0&lt;br /&gt;#define ICGC2_MFD_MASK                  112&lt;br /&gt;#define ICGC2_MFD_BITNUM                4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGS1 - ICG Status Register 1; 0x0000004A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte ICGIF       :1;                                       /* ICG Interrupt Flag */&lt;br /&gt;    byte ERCS        :1;                                       /* External Reference Clock Status */&lt;br /&gt;    byte LOCS        :1;                                       /* Loss Of Clock Status */&lt;br /&gt;    byte LOCK        :1;                                       /* FLL Lock Status */&lt;br /&gt;    byte LOLS        :1;                                       /* FLL Loss of Lock Status */&lt;br /&gt;    byte REFST       :1;                                       /* Reference Clock Status */&lt;br /&gt;    byte CLKST0      :1;                                       /* Clock Mode Status Bit 0 */&lt;br /&gt;    byte CLKST1      :1;                                       /* Clock Mode Status Bit 1 */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpCLKST :2;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} ICGS1STR;&lt;br /&gt;extern volatile ICGS1STR _ICGS1 @0x0000004A;&lt;br /&gt;#define ICGS1                           _ICGS1.Byte&lt;br /&gt;#define ICGS1_ICGIF                     _ICGS1.Bits.ICGIF&lt;br /&gt;#define ICGS1_ERCS                      _ICGS1.Bits.ERCS&lt;br /&gt;#define ICGS1_LOCS                      _ICGS1.Bits.LOCS&lt;br /&gt;#define ICGS1_LOCK                      _ICGS1.Bits.LOCK&lt;br /&gt;#define ICGS1_LOLS                      _ICGS1.Bits.LOLS&lt;br /&gt;#define ICGS1_REFST                     _ICGS1.Bits.REFST&lt;br /&gt;#define ICGS1_CLKST0                    _ICGS1.Bits.CLKST0&lt;br /&gt;#define ICGS1_CLKST1                    _ICGS1.Bits.CLKST1&lt;br /&gt;#define ICGS1_CLKST                     _ICGS1.MergedBits.grpCLKST&lt;br /&gt;&lt;br /&gt;#define ICGS1_ICGIF_MASK                1&lt;br /&gt;#define ICGS1_ERCS_MASK                 2&lt;br /&gt;#define ICGS1_LOCS_MASK                 4&lt;br /&gt;#define ICGS1_LOCK_MASK                 8&lt;br /&gt;#define ICGS1_LOLS_MASK                 16&lt;br /&gt;#define ICGS1_REFST_MASK                32&lt;br /&gt;#define ICGS1_CLKST0_MASK               64&lt;br /&gt;#define ICGS1_CLKST1_MASK               128&lt;br /&gt;#define ICGS1_CLKST_MASK                192&lt;br /&gt;#define ICGS1_CLKST_BITNUM              6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGS2 - ICG Status Register 2; 0x0000004B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte DCOS        :1;                                       /* DCO Clock Stable */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} ICGS2STR;&lt;br /&gt;extern volatile ICGS2STR _ICGS2 @0x0000004B;&lt;br /&gt;#define ICGS2                           _ICGS2.Byte&lt;br /&gt;#define ICGS2_DCOS                      _ICGS2.Bits.DCOS&lt;br /&gt;&lt;br /&gt;#define ICGS2_DCOS_MASK                 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGFLT - ICG Filter Register; 0x0000004C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** ICGFLTU - ICG Upper Filter Register; 0x0000004C ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte FILT8       :1;                                       /* ICG Filter Bit 8 */&lt;br /&gt;        byte FILT9       :1;                                       /* ICG Filter Bit 9 */&lt;br /&gt;        byte FILT10      :1;                                       /* ICG Filter Bit 10 */&lt;br /&gt;        byte FILT11      :1;                                       /* ICG Filter Bit 11 */&lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;        byte             :1; &lt;br /&gt;      } Bits;&lt;br /&gt;      struct {&lt;br /&gt;        byte grpFILT_8 :4;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;        byte     :1;&lt;br /&gt;      } MergedBits;&lt;br /&gt;    } ICGFLTUSTR;&lt;br /&gt;    #define ICGFLTU                     _ICGFLT.Overlap_STR.ICGFLTUSTR.Byte&lt;br /&gt;    #define ICGFLTU_FILT8               _ICGFLT.Overlap_STR.ICGFLTUSTR.Bits.FILT8&lt;br /&gt;    #define ICGFLTU_FILT9               _ICGFLT.Overlap_STR.ICGFLTUSTR.Bits.FILT9&lt;br /&gt;    #define ICGFLTU_FILT10              _ICGFLT.Overlap_STR.ICGFLTUSTR.Bits.FILT10&lt;br /&gt;    #define ICGFLTU_FILT11              _ICGFLT.Overlap_STR.ICGFLTUSTR.Bits.FILT11&lt;br /&gt;    &lt;br /&gt;    #define ICGFLTU_FILT_8              _ICGFLT.Overlap_STR.ICGFLTUSTR.MergedBits.grpFILT_8&lt;br /&gt;    #define ICGFLTU_FILT                ICGFLTU_FILT_8&lt;br /&gt;    &lt;br /&gt;    #define ICGFLTU_FILT8_MASK          1&lt;br /&gt;    #define ICGFLTU_FILT9_MASK          2&lt;br /&gt;    #define ICGFLTU_FILT10_MASK         4&lt;br /&gt;    #define ICGFLTU_FILT11_MASK         8&lt;br /&gt;    #define ICGFLTU_FILT_8_MASK         15&lt;br /&gt;    #define ICGFLTU_FILT_8_BITNUM       0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** ICGFLTL - ICG Lower Filter Register; 0x0000004D ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte FILT0       :1;                                       /* ICG Filter Bit 0 */&lt;br /&gt;        byte FILT1       :1;                                       /* ICG Filter Bit 1 */&lt;br /&gt;        byte FILT2       :1;                                       /* ICG Filter Bit 2 */&lt;br /&gt;        byte FILT3       :1;                                       /* ICG Filter Bit 3 */&lt;br /&gt;        byte FILT4       :1;                                       /* ICG Filter Bit 4 */&lt;br /&gt;        byte FILT5       :1;                                       /* ICG Filter Bit 5 */&lt;br /&gt;        byte FILT6       :1;                                       /* ICG Filter Bit 6 */&lt;br /&gt;        byte FILT7       :1;                                       /* ICG Filter Bit 7 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } ICGFLTLSTR;&lt;br /&gt;    #define ICGFLTL                     _ICGFLT.Overlap_STR.ICGFLTLSTR.Byte&lt;br /&gt;    #define ICGFLTL_FILT0               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT0&lt;br /&gt;    #define ICGFLTL_FILT1               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT1&lt;br /&gt;    #define ICGFLTL_FILT2               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT2&lt;br /&gt;    #define ICGFLTL_FILT3               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT3&lt;br /&gt;    #define ICGFLTL_FILT4               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT4&lt;br /&gt;    #define ICGFLTL_FILT5               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT5&lt;br /&gt;    #define ICGFLTL_FILT6               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT6&lt;br /&gt;    #define ICGFLTL_FILT7               _ICGFLT.Overlap_STR.ICGFLTLSTR.Bits.FILT7&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define ICGFLTL_FILT0_MASK          1&lt;br /&gt;    #define ICGFLTL_FILT1_MASK          2&lt;br /&gt;    #define ICGFLTL_FILT2_MASK          4&lt;br /&gt;    #define ICGFLTL_FILT3_MASK          8&lt;br /&gt;    #define ICGFLTL_FILT4_MASK          16&lt;br /&gt;    #define ICGFLTL_FILT5_MASK          32&lt;br /&gt;    #define ICGFLTL_FILT6_MASK          64&lt;br /&gt;    #define ICGFLTL_FILT7_MASK          128&lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} ICGFLTSTR;&lt;br /&gt;extern volatile ICGFLTSTR _ICGFLT @0x0000004C;&lt;br /&gt;#define ICGFLT                          _ICGFLT.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ICGTRM - ICG Trim Register; 0x0000004E ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte TRIM0       :1;                                       /* ICG Trim Bit 0 */&lt;br /&gt;    byte TRIM1       :1;                                       /* ICG Trim Bit 1 */&lt;br /&gt;    byte TRIM2       :1;                                       /* ICG Trim Bit 2 */&lt;br /&gt;    byte TRIM3       :1;                                       /* ICG Trim Bit 3 */&lt;br /&gt;    byte TRIM4       :1;                                       /* ICG Trim Bit 4 */&lt;br /&gt;    byte TRIM5       :1;                                       /* ICG Trim Bit 5 */&lt;br /&gt;    byte TRIM6       :1;                                       /* ICG Trim Bit 6 */&lt;br /&gt;    byte TRIM7       :1;                                       /* ICG Trim Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} ICGTRMSTR;&lt;br /&gt;extern volatile ICGTRMSTR _ICGTRM @0x0000004E;&lt;br /&gt;#define ICGTRM                          _ICGTRM.Byte&lt;br /&gt;#define ICGTRM_TRIM0                    _ICGTRM.Bits.TRIM0&lt;br /&gt;#define ICGTRM_TRIM1                    _ICGTRM.Bits.TRIM1&lt;br /&gt;#define ICGTRM_TRIM2                    _ICGTRM.Bits.TRIM2&lt;br /&gt;#define ICGTRM_TRIM3                    _ICGTRM.Bits.TRIM3&lt;br /&gt;#define ICGTRM_TRIM4                    _ICGTRM.Bits.TRIM4&lt;br /&gt;#define ICGTRM_TRIM5                    _ICGTRM.Bits.TRIM5&lt;br /&gt;#define ICGTRM_TRIM6                    _ICGTRM.Bits.TRIM6&lt;br /&gt;#define ICGTRM_TRIM7                    _ICGTRM.Bits.TRIM7&lt;br /&gt;&lt;br /&gt;#define ICGTRM_TRIM0_MASK               1&lt;br /&gt;#define ICGTRM_TRIM1_MASK               2&lt;br /&gt;#define ICGTRM_TRIM2_MASK               4&lt;br /&gt;#define ICGTRM_TRIM3_MASK               8&lt;br /&gt;#define ICGTRM_TRIM4_MASK               16&lt;br /&gt;#define ICGTRM_TRIM5_MASK               32&lt;br /&gt;#define ICGTRM_TRIM6_MASK               64&lt;br /&gt;#define ICGTRM_TRIM7_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ATD1C - ATD1 Control Register; 0x00000050 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PRS0        :1;                                       /* Prescaler Rate Select Bit 0 */&lt;br /&gt;    byte PRS1        :1;                                       /* Prescaler Rate Select Bit 1 */&lt;br /&gt;    byte PRS2        :1;                                       /* Prescaler Rate Select Bit 2 */&lt;br /&gt;    byte PRS3        :1;                                       /* Prescaler Rate Select Bit 3 */&lt;br /&gt;    byte SGN         :1;                                       /* Signed Result Select */&lt;br /&gt;    byte RES8        :1;                                       /* ATD Resolution Select */&lt;br /&gt;    byte DJM         :1;                                       /* Data Justification Mode */&lt;br /&gt;    byte ATDPU       :1;                                       /* ATD Power Up */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpPRS  :4;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpRES_8 :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} ATD1CSTR;&lt;br /&gt;extern volatile ATD1CSTR _ATD1C @0x00000050;&lt;br /&gt;#define ATD1C                           _ATD1C.Byte&lt;br /&gt;#define ATD1C_PRS0                      _ATD1C.Bits.PRS0&lt;br /&gt;#define ATD1C_PRS1                      _ATD1C.Bits.PRS1&lt;br /&gt;#define ATD1C_PRS2                      _ATD1C.Bits.PRS2&lt;br /&gt;#define ATD1C_PRS3                      _ATD1C.Bits.PRS3&lt;br /&gt;#define ATD1C_SGN                       _ATD1C.Bits.SGN&lt;br /&gt;#define ATD1C_RES8                      _ATD1C.Bits.RES8&lt;br /&gt;#define ATD1C_DJM                       _ATD1C.Bits.DJM&lt;br /&gt;#define ATD1C_ATDPU                     _ATD1C.Bits.ATDPU&lt;br /&gt;#define ATD1C_PRS                       _ATD1C.MergedBits.grpPRS&lt;br /&gt;&lt;br /&gt;#define ATD1C_PRS0_MASK                 1&lt;br /&gt;#define ATD1C_PRS1_MASK                 2&lt;br /&gt;#define ATD1C_PRS2_MASK                 4&lt;br /&gt;#define ATD1C_PRS3_MASK                 8&lt;br /&gt;#define ATD1C_SGN_MASK                  16&lt;br /&gt;#define ATD1C_RES8_MASK                 32&lt;br /&gt;#define ATD1C_DJM_MASK                  64&lt;br /&gt;#define ATD1C_ATDPU_MASK                128&lt;br /&gt;#define ATD1C_PRS_MASK                  15&lt;br /&gt;#define ATD1C_PRS_BITNUM                0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ATD1SC - ATD1 Status and Control Register; 0x00000051 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte ATDCH0      :1;                                       /* Analog Input Channel Select Bit 0 */&lt;br /&gt;    byte ATDCH1      :1;                                       /* Analog Input Channel Select Bit 1 */&lt;br /&gt;    byte ATDCH2      :1;                                       /* Analog Input Channel Select Bit 2 */&lt;br /&gt;    byte ATDCH3      :1;                                       /* Analog Input Channel Select Bit 3 */&lt;br /&gt;    byte ATDCH4      :1;                                       /* Analog Input Channel Select Bit 4 */&lt;br /&gt;    byte ATDCO       :1;                                       /* ATD Continuous Conversion */&lt;br /&gt;    byte ATDIE       :1;                                       /* ATD Interrupt Enabled */&lt;br /&gt;    byte CCF         :1;                                       /* Conversion Complete Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpATDCH :5;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} ATD1SCSTR;&lt;br /&gt;extern volatile ATD1SCSTR _ATD1SC @0x00000051;&lt;br /&gt;#define ATD1SC                          _ATD1SC.Byte&lt;br /&gt;#define ATD1SC_ATDCH0                   _ATD1SC.Bits.ATDCH0&lt;br /&gt;#define ATD1SC_ATDCH1                   _ATD1SC.Bits.ATDCH1&lt;br /&gt;#define ATD1SC_ATDCH2                   _ATD1SC.Bits.ATDCH2&lt;br /&gt;#define ATD1SC_ATDCH3                   _ATD1SC.Bits.ATDCH3&lt;br /&gt;#define ATD1SC_ATDCH4                   _ATD1SC.Bits.ATDCH4&lt;br /&gt;#define ATD1SC_ATDCO                    _ATD1SC.Bits.ATDCO&lt;br /&gt;#define ATD1SC_ATDIE                    _ATD1SC.Bits.ATDIE&lt;br /&gt;#define ATD1SC_CCF                      _ATD1SC.Bits.CCF&lt;br /&gt;#define ATD1SC_ATDCH                    _ATD1SC.MergedBits.grpATDCH&lt;br /&gt;&lt;br /&gt;#define ATD1SC_ATDCH0_MASK              1&lt;br /&gt;#define ATD1SC_ATDCH1_MASK              2&lt;br /&gt;#define ATD1SC_ATDCH2_MASK              4&lt;br /&gt;#define ATD1SC_ATDCH3_MASK              8&lt;br /&gt;#define ATD1SC_ATDCH4_MASK              16&lt;br /&gt;#define ATD1SC_ATDCO_MASK               32&lt;br /&gt;#define ATD1SC_ATDIE_MASK               64&lt;br /&gt;#define ATD1SC_CCF_MASK                 128&lt;br /&gt;#define ATD1SC_ATDCH_MASK               31&lt;br /&gt;#define ATD1SC_ATDCH_BITNUM             0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ATD1R - ATD1 Result Data; 0x00000052 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** ATD1RH - ATD1 Result Data High Right Justified; 0x00000052 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte BIT8        :1;                                       /* ATD Result Data Bit 8 */&lt;br /&gt;        byte BIT9        :1;                                       /* ATD Result Data Bit 9 */&lt;br /&gt;        byte BIT10       :1;                                       /* ATD Result Data Bit 10 */&lt;br /&gt;        byte BIT11       :1;                                       /* ATD Result Data Bit 11 */&lt;br /&gt;        byte BIT12       :1;                                       /* ATD Result Data Bit 12 */&lt;br /&gt;        byte BIT13       :1;                                       /* ATD Result Data Bit 13 */&lt;br /&gt;        byte BIT14       :1;                                       /* ATD Result Data Bit 14 */&lt;br /&gt;        byte BIT15       :1;                                       /* ATD Result Data Bit 15 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } ATD1RHSTR;&lt;br /&gt;    #define ATD1RH                      _ATD1R.Overlap_STR.ATD1RHSTR.Byte&lt;br /&gt;    #define ATD1RH_BIT8                 _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT8&lt;br /&gt;    #define ATD1RH_BIT9                 _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT9&lt;br /&gt;    #define ATD1RH_BIT10                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT10&lt;br /&gt;    #define ATD1RH_BIT11                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT11&lt;br /&gt;    #define ATD1RH_BIT12                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT12&lt;br /&gt;    #define ATD1RH_BIT13                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT13&lt;br /&gt;    #define ATD1RH_BIT14                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT14&lt;br /&gt;    #define ATD1RH_BIT15                _ATD1R.Overlap_STR.ATD1RHSTR.Bits.BIT15&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define ATD1RH_BIT8_MASK            1&lt;br /&gt;    #define ATD1RH_BIT9_MASK            2&lt;br /&gt;    #define ATD1RH_BIT10_MASK           4&lt;br /&gt;    #define ATD1RH_BIT11_MASK           8&lt;br /&gt;    #define ATD1RH_BIT12_MASK           16&lt;br /&gt;    #define ATD1RH_BIT13_MASK           32&lt;br /&gt;    #define ATD1RH_BIT14_MASK           64&lt;br /&gt;    #define ATD1RH_BIT15_MASK           128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** ATD1RL - ATD1 Result Data Low Right Justified; 0x00000053 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte BIT0        :1;                                       /* ATD Result Data Bit 0 */&lt;br /&gt;        byte BIT1        :1;                                       /* ATD Result Data Bit 1 */&lt;br /&gt;        byte BIT2        :1;                                       /* ATD Result Data Bit 2 */&lt;br /&gt;        byte BIT3        :1;                                       /* ATD Result Data Bit 3 */&lt;br /&gt;        byte BIT4        :1;                                       /* ATD Result Data Bit 4 */&lt;br /&gt;        byte BIT5        :1;                                       /* ATD Result Data Bit 5 */&lt;br /&gt;        byte BIT6        :1;                                       /* ATD Result Data Bit 6 */&lt;br /&gt;        byte BIT7        :1;                                       /* ATD Result Data Bit 7 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } ATD1RLSTR;&lt;br /&gt;    #define ATD1RL                      _ATD1R.Overlap_STR.ATD1RLSTR.Byte&lt;br /&gt;    #define ATD1RL_BIT0                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT0&lt;br /&gt;    #define ATD1RL_BIT1                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT1&lt;br /&gt;    #define ATD1RL_BIT2                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT2&lt;br /&gt;    #define ATD1RL_BIT3                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT3&lt;br /&gt;    #define ATD1RL_BIT4                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT4&lt;br /&gt;    #define ATD1RL_BIT5                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT5&lt;br /&gt;    #define ATD1RL_BIT6                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT6&lt;br /&gt;    #define ATD1RL_BIT7                 _ATD1R.Overlap_STR.ATD1RLSTR.Bits.BIT7&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define ATD1RL_BIT0_MASK            1&lt;br /&gt;    #define ATD1RL_BIT1_MASK            2&lt;br /&gt;    #define ATD1RL_BIT2_MASK            4&lt;br /&gt;    #define ATD1RL_BIT3_MASK            8&lt;br /&gt;    #define ATD1RL_BIT4_MASK            16&lt;br /&gt;    #define ATD1RL_BIT5_MASK            32&lt;br /&gt;    #define ATD1RL_BIT6_MASK            64&lt;br /&gt;    #define ATD1RL_BIT7_MASK            128&lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} ATD1RSTR;&lt;br /&gt;extern volatile ATD1RSTR _ATD1R @0x00000052;&lt;br /&gt;#define ATD1R                           _ATD1R.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ATD1PE - ATD1 Pin Enable; 0x00000054 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte ATDPE0      :1;                                       /* ATD Pin Enable Bit 0 */&lt;br /&gt;    byte ATDPE1      :1;                                       /* ATD Pin Enable Bit 1 */&lt;br /&gt;    byte ATDPE2      :1;                                       /* ATD Pin Enable Bit 2 */&lt;br /&gt;    byte ATDPE3      :1;                                       /* ATD Pin Enable Bit 3 */&lt;br /&gt;    byte ATDPE4      :1;                                       /* ATD Pin Enable Bit 4 */&lt;br /&gt;    byte ATDPE5      :1;                                       /* ATD Pin Enable Bit 5 */&lt;br /&gt;    byte ATDPE6      :1;                                       /* ATD Pin Enable Bit 6 */&lt;br /&gt;    byte ATDPE7      :1;                                       /* ATD Pin Enable Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} ATD1PESTR;&lt;br /&gt;extern volatile ATD1PESTR _ATD1PE @0x00000054;&lt;br /&gt;#define ATD1PE                          _ATD1PE.Byte&lt;br /&gt;#define ATD1PE_ATDPE0                   _ATD1PE.Bits.ATDPE0&lt;br /&gt;#define ATD1PE_ATDPE1                   _ATD1PE.Bits.ATDPE1&lt;br /&gt;#define ATD1PE_ATDPE2                   _ATD1PE.Bits.ATDPE2&lt;br /&gt;#define ATD1PE_ATDPE3                   _ATD1PE.Bits.ATDPE3&lt;br /&gt;#define ATD1PE_ATDPE4                   _ATD1PE.Bits.ATDPE4&lt;br /&gt;#define ATD1PE_ATDPE5                   _ATD1PE.Bits.ATDPE5&lt;br /&gt;#define ATD1PE_ATDPE6                   _ATD1PE.Bits.ATDPE6&lt;br /&gt;#define ATD1PE_ATDPE7                   _ATD1PE.Bits.ATDPE7&lt;br /&gt;&lt;br /&gt;#define ATD1PE_ATDPE0_MASK              1&lt;br /&gt;#define ATD1PE_ATDPE1_MASK              2&lt;br /&gt;#define ATD1PE_ATDPE2_MASK              4&lt;br /&gt;#define ATD1PE_ATDPE3_MASK              8&lt;br /&gt;#define ATD1PE_ATDPE4_MASK              16&lt;br /&gt;#define ATD1PE_ATDPE5_MASK              32&lt;br /&gt;#define ATD1PE_ATDPE6_MASK              64&lt;br /&gt;#define ATD1PE_ATDPE7_MASK              128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IIC1A - IIC1 Address Register; 0x00000058 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ADDR0       :1;                                       /* IIC Address Bit 0 */&lt;br /&gt;    byte ADDR1       :1;                                       /* IIC Address Bit 1 */&lt;br /&gt;    byte ADDR2       :1;                                       /* IIC Address Bit 2 */&lt;br /&gt;    byte ADDR3       :1;                                       /* IIC Address Bit 3 */&lt;br /&gt;    byte ADDR4       :1;                                       /* IIC Address Bit 4 */&lt;br /&gt;    byte ADDR5       :1;                                       /* IIC Address Bit 5 */&lt;br /&gt;    byte ADDR6       :1;                                       /* IIC Address Bit 6 */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpADDR :7;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} IIC1ASTR;&lt;br /&gt;extern volatile IIC1ASTR _IIC1A @0x00000058;&lt;br /&gt;#define IIC1A                           _IIC1A.Byte&lt;br /&gt;#define IIC1A_ADDR0                     _IIC1A.Bits.ADDR0&lt;br /&gt;#define IIC1A_ADDR1                     _IIC1A.Bits.ADDR1&lt;br /&gt;#define IIC1A_ADDR2                     _IIC1A.Bits.ADDR2&lt;br /&gt;#define IIC1A_ADDR3                     _IIC1A.Bits.ADDR3&lt;br /&gt;#define IIC1A_ADDR4                     _IIC1A.Bits.ADDR4&lt;br /&gt;#define IIC1A_ADDR5                     _IIC1A.Bits.ADDR5&lt;br /&gt;#define IIC1A_ADDR6                     _IIC1A.Bits.ADDR6&lt;br /&gt;#define IIC1A_ADDR                      _IIC1A.MergedBits.grpADDR&lt;br /&gt;&lt;br /&gt;#define IIC1A_ADDR0_MASK                2&lt;br /&gt;#define IIC1A_ADDR1_MASK                4&lt;br /&gt;#define IIC1A_ADDR2_MASK                8&lt;br /&gt;#define IIC1A_ADDR3_MASK                16&lt;br /&gt;#define IIC1A_ADDR4_MASK                32&lt;br /&gt;#define IIC1A_ADDR5_MASK                64&lt;br /&gt;#define IIC1A_ADDR6_MASK                128&lt;br /&gt;#define IIC1A_ADDR_MASK                 254&lt;br /&gt;#define IIC1A_ADDR_BITNUM               1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IIC1F - IIC1 Frequency Divider Register; 0x00000059 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte ICR0        :1;                                       /* IIC Clock Rate Bit 0 */&lt;br /&gt;    byte ICR1        :1;                                       /* IIC Clock Rate Bit 1 */&lt;br /&gt;    byte ICR2        :1;                                       /* IIC Clock Rate Bit 2 */&lt;br /&gt;    byte ICR3        :1;                                       /* IIC Clock Rate Bit 3 */&lt;br /&gt;    byte ICR4        :1;                                       /* IIC Clock Rate Bit 4 */&lt;br /&gt;    byte ICR5        :1;                                       /* IIC Clock Rate Bit 5 */&lt;br /&gt;    byte MULT0       :1;                                       /* Multiplier Factor Bit 0 */&lt;br /&gt;    byte MULT1       :1;                                       /* Multiplier Factor Bit 1 */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpICR  :6;&lt;br /&gt;    byte grpMULT :2;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} IIC1FSTR;&lt;br /&gt;extern volatile IIC1FSTR _IIC1F @0x00000059;&lt;br /&gt;#define IIC1F                           _IIC1F.Byte&lt;br /&gt;#define IIC1F_ICR0                      _IIC1F.Bits.ICR0&lt;br /&gt;#define IIC1F_ICR1                      _IIC1F.Bits.ICR1&lt;br /&gt;#define IIC1F_ICR2                      _IIC1F.Bits.ICR2&lt;br /&gt;#define IIC1F_ICR3                      _IIC1F.Bits.ICR3&lt;br /&gt;#define IIC1F_ICR4                      _IIC1F.Bits.ICR4&lt;br /&gt;#define IIC1F_ICR5                      _IIC1F.Bits.ICR5&lt;br /&gt;#define IIC1F_MULT0                     _IIC1F.Bits.MULT0&lt;br /&gt;#define IIC1F_MULT1                     _IIC1F.Bits.MULT1&lt;br /&gt;#define IIC1F_ICR                       _IIC1F.MergedBits.grpICR&lt;br /&gt;#define IIC1F_MULT                      _IIC1F.MergedBits.grpMULT&lt;br /&gt;&lt;br /&gt;#define IIC1F_ICR0_MASK                 1&lt;br /&gt;#define IIC1F_ICR1_MASK                 2&lt;br /&gt;#define IIC1F_ICR2_MASK                 4&lt;br /&gt;#define IIC1F_ICR3_MASK                 8&lt;br /&gt;#define IIC1F_ICR4_MASK                 16&lt;br /&gt;#define IIC1F_ICR5_MASK                 32&lt;br /&gt;#define IIC1F_MULT0_MASK                64&lt;br /&gt;#define IIC1F_MULT1_MASK                128&lt;br /&gt;#define IIC1F_ICR_MASK                  63&lt;br /&gt;#define IIC1F_ICR_BITNUM                0&lt;br /&gt;#define IIC1F_MULT_MASK                 192&lt;br /&gt;#define IIC1F_MULT_BITNUM               6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IIC1C - IIC1 Control Register; 0x0000005A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte RSTA        :1;                                       /* Repeat START Bit */&lt;br /&gt;    byte TXAK        :1;                                       /* Transmit Acknowledge Enable Bit */&lt;br /&gt;    byte TX          :1;                                       /* Transmit Mode Select Bit */&lt;br /&gt;    byte MST         :1;                                       /* Master Mode Select Bit */&lt;br /&gt;    byte IICIE       :1;                                       /* IIC Interrupt Enable Bit */&lt;br /&gt;    byte IICEN       :1;                                       /* IIC Enable Bit */&lt;br /&gt;  } Bits;&lt;br /&gt;} IIC1CSTR;&lt;br /&gt;extern volatile IIC1CSTR _IIC1C @0x0000005A;&lt;br /&gt;#define IIC1C                           _IIC1C.Byte&lt;br /&gt;#define IIC1C_RSTA                      _IIC1C.Bits.RSTA&lt;br /&gt;#define IIC1C_TXAK                      _IIC1C.Bits.TXAK&lt;br /&gt;#define IIC1C_TX                        _IIC1C.Bits.TX&lt;br /&gt;#define IIC1C_MST                       _IIC1C.Bits.MST&lt;br /&gt;#define IIC1C_IICIE                     _IIC1C.Bits.IICIE&lt;br /&gt;#define IIC1C_IICEN                     _IIC1C.Bits.IICEN&lt;br /&gt;&lt;br /&gt;#define IIC1C_RSTA_MASK                 4&lt;br /&gt;#define IIC1C_TXAK_MASK                 8&lt;br /&gt;#define IIC1C_TX_MASK                   16&lt;br /&gt;#define IIC1C_MST_MASK                  32&lt;br /&gt;#define IIC1C_IICIE_MASK                64&lt;br /&gt;#define IIC1C_IICEN_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IIC1S - IIC1 Status Register; 0x0000005B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte RXAK        :1;                                       /* Receive Acknowledge */&lt;br /&gt;    byte IICIF       :1;                                       /* IIC Interrupt Flag */&lt;br /&gt;    byte SRW         :1;                                       /* Slave Read/Write */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ARBL        :1;                                       /* Arbitration Lost */&lt;br /&gt;    byte BUSY        :1;                                       /* Bus Busy bit */&lt;br /&gt;    byte IAAS        :1;                                       /* Addressed as a Slave Bit */&lt;br /&gt;    byte TCF         :1;                                       /* Transfer Complete Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} IIC1SSTR;&lt;br /&gt;extern volatile IIC1SSTR _IIC1S @0x0000005B;&lt;br /&gt;#define IIC1S                           _IIC1S.Byte&lt;br /&gt;#define IIC1S_RXAK                      _IIC1S.Bits.RXAK&lt;br /&gt;#define IIC1S_IICIF                     _IIC1S.Bits.IICIF&lt;br /&gt;#define IIC1S_SRW                       _IIC1S.Bits.SRW&lt;br /&gt;#define IIC1S_ARBL                      _IIC1S.Bits.ARBL&lt;br /&gt;#define IIC1S_BUSY                      _IIC1S.Bits.BUSY&lt;br /&gt;#define IIC1S_IAAS                      _IIC1S.Bits.IAAS&lt;br /&gt;#define IIC1S_TCF                       _IIC1S.Bits.TCF&lt;br /&gt;&lt;br /&gt;#define IIC1S_RXAK_MASK                 1&lt;br /&gt;#define IIC1S_IICIF_MASK                2&lt;br /&gt;#define IIC1S_SRW_MASK                  4&lt;br /&gt;#define IIC1S_ARBL_MASK                 16&lt;br /&gt;#define IIC1S_BUSY_MASK                 32&lt;br /&gt;#define IIC1S_IAAS_MASK                 64&lt;br /&gt;#define IIC1S_TCF_MASK                  128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** IIC1D - IIC1 Data I/O Register; 0x0000005C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte DATA0       :1;                                       /* IIC Data Bit 0 */&lt;br /&gt;    byte DATA1       :1;                                       /* IIC Data Bit 1 */&lt;br /&gt;    byte DATA2       :1;                                       /* IIC Data Bit 2 */&lt;br /&gt;    byte DATA3       :1;                                       /* IIC Data Bit 3 */&lt;br /&gt;    byte DATA4       :1;                                       /* IIC Data Bit 4 */&lt;br /&gt;    byte DATA5       :1;                                       /* IIC Data Bit 5 */&lt;br /&gt;    byte DATA6       :1;                                       /* IIC Data Bit 6 */&lt;br /&gt;    byte DATA7       :1;                                       /* IIC Data Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} IIC1DSTR;&lt;br /&gt;extern volatile IIC1DSTR _IIC1D @0x0000005C;&lt;br /&gt;#define IIC1D                           _IIC1D.Byte&lt;br /&gt;#define IIC1D_DATA0                     _IIC1D.Bits.DATA0&lt;br /&gt;#define IIC1D_DATA1                     _IIC1D.Bits.DATA1&lt;br /&gt;#define IIC1D_DATA2                     _IIC1D.Bits.DATA2&lt;br /&gt;#define IIC1D_DATA3                     _IIC1D.Bits.DATA3&lt;br /&gt;#define IIC1D_DATA4                     _IIC1D.Bits.DATA4&lt;br /&gt;#define IIC1D_DATA5                     _IIC1D.Bits.DATA5&lt;br /&gt;#define IIC1D_DATA6                     _IIC1D.Bits.DATA6&lt;br /&gt;#define IIC1D_DATA7                     _IIC1D.Bits.DATA7&lt;br /&gt;&lt;br /&gt;#define IIC1D_DATA0_MASK                1&lt;br /&gt;#define IIC1D_DATA1_MASK                2&lt;br /&gt;#define IIC1D_DATA2_MASK                4&lt;br /&gt;#define IIC1D_DATA3_MASK                8&lt;br /&gt;#define IIC1D_DATA4_MASK                16&lt;br /&gt;#define IIC1D_DATA5_MASK                32&lt;br /&gt;#define IIC1D_DATA6_MASK                64&lt;br /&gt;#define IIC1D_DATA7_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2SC - TPM 2 Status and Control Register; 0x00000060 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PS0         :1;                                       /* Prescale Divisor Select Bit 0 */&lt;br /&gt;    byte PS1         :1;                                       /* Prescale Divisor Select Bit 1 */&lt;br /&gt;    byte PS2         :1;                                       /* Prescale Divisor Select Bit 2 */&lt;br /&gt;    byte CLKSA       :1;                                       /* Clock Source Select A */&lt;br /&gt;    byte CLKSB       :1;                                       /* Clock Source Select B */&lt;br /&gt;    byte CPWMS       :1;                                       /* Center-Aligned PWM Select */&lt;br /&gt;    byte TOIE        :1;                                       /* Timer Overflow Interrupt Enable */&lt;br /&gt;    byte TOF         :1;                                       /* Timer Overflow Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpPS   :3;&lt;br /&gt;    byte grpCLKSx :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2SCSTR;&lt;br /&gt;extern volatile TPM2SCSTR _TPM2SC @0x00000060;&lt;br /&gt;#define TPM2SC                          _TPM2SC.Byte&lt;br /&gt;#define TPM2SC_PS0                      _TPM2SC.Bits.PS0&lt;br /&gt;#define TPM2SC_PS1                      _TPM2SC.Bits.PS1&lt;br /&gt;#define TPM2SC_PS2                      _TPM2SC.Bits.PS2&lt;br /&gt;#define TPM2SC_CLKSA                    _TPM2SC.Bits.CLKSA&lt;br /&gt;#define TPM2SC_CLKSB                    _TPM2SC.Bits.CLKSB&lt;br /&gt;#define TPM2SC_CPWMS                    _TPM2SC.Bits.CPWMS&lt;br /&gt;#define TPM2SC_TOIE                     _TPM2SC.Bits.TOIE&lt;br /&gt;#define TPM2SC_TOF                      _TPM2SC.Bits.TOF&lt;br /&gt;#define TPM2SC_PS                       _TPM2SC.MergedBits.grpPS&lt;br /&gt;#define TPM2SC_CLKSx                    _TPM2SC.MergedBits.grpCLKSx&lt;br /&gt;&lt;br /&gt;#define TPM2SC_PS0_MASK                 1&lt;br /&gt;#define TPM2SC_PS1_MASK                 2&lt;br /&gt;#define TPM2SC_PS2_MASK                 4&lt;br /&gt;#define TPM2SC_CLKSA_MASK               8&lt;br /&gt;#define TPM2SC_CLKSB_MASK               16&lt;br /&gt;#define TPM2SC_CPWMS_MASK               32&lt;br /&gt;#define TPM2SC_TOIE_MASK                64&lt;br /&gt;#define TPM2SC_TOF_MASK                 128&lt;br /&gt;#define TPM2SC_PS_MASK                  7&lt;br /&gt;#define TPM2SC_PS_BITNUM                0&lt;br /&gt;#define TPM2SC_CLKSx_MASK               24&lt;br /&gt;#define TPM2SC_CLKSx_BITNUM             3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2CNT - TPM 2 Counter Register; 0x00000061 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2CNTH - TPM 2 Counter Register High; 0x00000061 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2CNTHSTR;&lt;br /&gt;    #define TPM2CNTH                    _TPM2CNT.Overlap_STR.TPM2CNTHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2CNTL - TPM 2 Counter Register Low; 0x00000062 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2CNTLSTR;&lt;br /&gt;    #define TPM2CNTL                    _TPM2CNT.Overlap_STR.TPM2CNTLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2CNTSTR;&lt;br /&gt;extern volatile TPM2CNTSTR _TPM2CNT @0x00000061;&lt;br /&gt;#define TPM2CNT                         _TPM2CNT.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2MOD - TPM 2 Timer Counter Modulo Register; 0x00000063 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2MODH - TPM 2 Timer Counter Modulo Register High; 0x00000063 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2MODHSTR;&lt;br /&gt;    #define TPM2MODH                    _TPM2MOD.Overlap_STR.TPM2MODHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2MODL - TPM 2 Timer Counter Modulo Register Low; 0x00000064 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2MODLSTR;&lt;br /&gt;    #define TPM2MODL                    _TPM2MOD.Overlap_STR.TPM2MODLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2MODSTR;&lt;br /&gt;extern volatile TPM2MODSTR _TPM2MOD @0x00000063;&lt;br /&gt;#define TPM2MOD                         _TPM2MOD.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C0SC - TPM 2 Timer Channel 0 Status and Control Register; 0x00000065 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS0A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS0B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS0A        :1;                                       /* Mode Select A for TPM Channel 0 */&lt;br /&gt;    byte MS0B        :1;                                       /* Mode Select B for TPM Channel 0 */&lt;br /&gt;    byte CH0IE       :1;                                       /* Channel 0 Interrupt Enable */&lt;br /&gt;    byte CH0F        :1;                                       /* Channel 0 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS0x :2;&lt;br /&gt;    byte grpMS0x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2C0SCSTR;&lt;br /&gt;extern volatile TPM2C0SCSTR _TPM2C0SC @0x00000065;&lt;br /&gt;#define TPM2C0SC                        _TPM2C0SC.Byte&lt;br /&gt;#define TPM2C0SC_ELS0A                  _TPM2C0SC.Bits.ELS0A&lt;br /&gt;#define TPM2C0SC_ELS0B                  _TPM2C0SC.Bits.ELS0B&lt;br /&gt;#define TPM2C0SC_MS0A                   _TPM2C0SC.Bits.MS0A&lt;br /&gt;#define TPM2C0SC_MS0B                   _TPM2C0SC.Bits.MS0B&lt;br /&gt;#define TPM2C0SC_CH0IE                  _TPM2C0SC.Bits.CH0IE&lt;br /&gt;#define TPM2C0SC_CH0F                   _TPM2C0SC.Bits.CH0F&lt;br /&gt;#define TPM2C0SC_ELS0x                  _TPM2C0SC.MergedBits.grpELS0x&lt;br /&gt;#define TPM2C0SC_MS0x                   _TPM2C0SC.MergedBits.grpMS0x&lt;br /&gt;&lt;br /&gt;#define TPM2C0SC_ELS0A_MASK             4&lt;br /&gt;#define TPM2C0SC_ELS0B_MASK             8&lt;br /&gt;#define TPM2C0SC_MS0A_MASK              16&lt;br /&gt;#define TPM2C0SC_MS0B_MASK              32&lt;br /&gt;#define TPM2C0SC_CH0IE_MASK             64&lt;br /&gt;#define TPM2C0SC_CH0F_MASK              128&lt;br /&gt;#define TPM2C0SC_ELS0x_MASK             12&lt;br /&gt;#define TPM2C0SC_ELS0x_BITNUM           2&lt;br /&gt;#define TPM2C0SC_MS0x_MASK              48&lt;br /&gt;#define TPM2C0SC_MS0x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C0V - TPM 2 Timer Channel 0 Value Register; 0x00000066 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2C0VH - TPM 2 Timer Channel 0 Value Register High; 0x00000066 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C0VHSTR;&lt;br /&gt;    #define TPM2C0VH                    _TPM2C0V.Overlap_STR.TPM2C0VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2C0VL - TPM 2 Timer Channel 0 Value Register Low; 0x00000067 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C0VLSTR;&lt;br /&gt;    #define TPM2C0VL                    _TPM2C0V.Overlap_STR.TPM2C0VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2C0VSTR;&lt;br /&gt;extern volatile TPM2C0VSTR _TPM2C0V @0x00000066;&lt;br /&gt;#define TPM2C0V                         _TPM2C0V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C1SC - TPM 2 Timer Channel 1 Status and Control Register; 0x00000068 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS1A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS1B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS1A        :1;                                       /* Mode Select A for TPM Channel 1 */&lt;br /&gt;    byte MS1B        :1;                                       /* Mode Select B for TPM Channel 1 */&lt;br /&gt;    byte CH1IE       :1;                                       /* Channel 1 Interrupt Enable */&lt;br /&gt;    byte CH1F        :1;                                       /* Channel 1 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS1x :2;&lt;br /&gt;    byte grpMS1x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2C1SCSTR;&lt;br /&gt;extern volatile TPM2C1SCSTR _TPM2C1SC @0x00000068;&lt;br /&gt;#define TPM2C1SC                        _TPM2C1SC.Byte&lt;br /&gt;#define TPM2C1SC_ELS1A                  _TPM2C1SC.Bits.ELS1A&lt;br /&gt;#define TPM2C1SC_ELS1B                  _TPM2C1SC.Bits.ELS1B&lt;br /&gt;#define TPM2C1SC_MS1A                   _TPM2C1SC.Bits.MS1A&lt;br /&gt;#define TPM2C1SC_MS1B                   _TPM2C1SC.Bits.MS1B&lt;br /&gt;#define TPM2C1SC_CH1IE                  _TPM2C1SC.Bits.CH1IE&lt;br /&gt;#define TPM2C1SC_CH1F                   _TPM2C1SC.Bits.CH1F&lt;br /&gt;#define TPM2C1SC_ELS1x                  _TPM2C1SC.MergedBits.grpELS1x&lt;br /&gt;#define TPM2C1SC_MS1x                   _TPM2C1SC.MergedBits.grpMS1x&lt;br /&gt;&lt;br /&gt;#define TPM2C1SC_ELS1A_MASK             4&lt;br /&gt;#define TPM2C1SC_ELS1B_MASK             8&lt;br /&gt;#define TPM2C1SC_MS1A_MASK              16&lt;br /&gt;#define TPM2C1SC_MS1B_MASK              32&lt;br /&gt;#define TPM2C1SC_CH1IE_MASK             64&lt;br /&gt;#define TPM2C1SC_CH1F_MASK              128&lt;br /&gt;#define TPM2C1SC_ELS1x_MASK             12&lt;br /&gt;#define TPM2C1SC_ELS1x_BITNUM           2&lt;br /&gt;#define TPM2C1SC_MS1x_MASK              48&lt;br /&gt;#define TPM2C1SC_MS1x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C1V - TPM 2 Timer Channel 1 Value Register; 0x00000069 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2C1VH - TPM 2 Timer Channel 1 Value Register High; 0x00000069 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C1VHSTR;&lt;br /&gt;    #define TPM2C1VH                    _TPM2C1V.Overlap_STR.TPM2C1VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2C1VL - TPM 2 Timer Channel 1 Value Register Low; 0x0000006A ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C1VLSTR;&lt;br /&gt;    #define TPM2C1VL                    _TPM2C1V.Overlap_STR.TPM2C1VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2C1VSTR;&lt;br /&gt;extern volatile TPM2C1VSTR _TPM2C1V @0x00000069;&lt;br /&gt;#define TPM2C1V                         _TPM2C1V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C2SC - TPM 2 Timer Channel 2 Status and Control Register; 0x0000006B ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS2A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS2B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS2A        :1;                                       /* Mode Select A for TPM Channel 2 */&lt;br /&gt;    byte MS2B        :1;                                       /* Mode Select B for TPM Channel 2 */&lt;br /&gt;    byte CH2IE       :1;                                       /* Channel 2 Interrupt Enable */&lt;br /&gt;    byte CH2F        :1;                                       /* Channel 2 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS2x :2;&lt;br /&gt;    byte grpMS2x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2C2SCSTR;&lt;br /&gt;extern volatile TPM2C2SCSTR _TPM2C2SC @0x0000006B;&lt;br /&gt;#define TPM2C2SC                        _TPM2C2SC.Byte&lt;br /&gt;#define TPM2C2SC_ELS2A                  _TPM2C2SC.Bits.ELS2A&lt;br /&gt;#define TPM2C2SC_ELS2B                  _TPM2C2SC.Bits.ELS2B&lt;br /&gt;#define TPM2C2SC_MS2A                   _TPM2C2SC.Bits.MS2A&lt;br /&gt;#define TPM2C2SC_MS2B                   _TPM2C2SC.Bits.MS2B&lt;br /&gt;#define TPM2C2SC_CH2IE                  _TPM2C2SC.Bits.CH2IE&lt;br /&gt;#define TPM2C2SC_CH2F                   _TPM2C2SC.Bits.CH2F&lt;br /&gt;#define TPM2C2SC_ELS2x                  _TPM2C2SC.MergedBits.grpELS2x&lt;br /&gt;#define TPM2C2SC_MS2x                   _TPM2C2SC.MergedBits.grpMS2x&lt;br /&gt;&lt;br /&gt;#define TPM2C2SC_ELS2A_MASK             4&lt;br /&gt;#define TPM2C2SC_ELS2B_MASK             8&lt;br /&gt;#define TPM2C2SC_MS2A_MASK              16&lt;br /&gt;#define TPM2C2SC_MS2B_MASK              32&lt;br /&gt;#define TPM2C2SC_CH2IE_MASK             64&lt;br /&gt;#define TPM2C2SC_CH2F_MASK              128&lt;br /&gt;#define TPM2C2SC_ELS2x_MASK             12&lt;br /&gt;#define TPM2C2SC_ELS2x_BITNUM           2&lt;br /&gt;#define TPM2C2SC_MS2x_MASK              48&lt;br /&gt;#define TPM2C2SC_MS2x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C2V - TPM 2 Timer Channel 2 Value Register; 0x0000006C ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2C2VH - TPM 2 Timer Channel 2 Value Register High; 0x0000006C ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C2VHSTR;&lt;br /&gt;    #define TPM2C2VH                    _TPM2C2V.Overlap_STR.TPM2C2VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2C2VL - TPM 2 Timer Channel 2 Value Register Low; 0x0000006D ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C2VLSTR;&lt;br /&gt;    #define TPM2C2VL                    _TPM2C2V.Overlap_STR.TPM2C2VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2C2VSTR;&lt;br /&gt;extern volatile TPM2C2VSTR _TPM2C2V @0x0000006C;&lt;br /&gt;#define TPM2C2V                         _TPM2C2V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C3SC - TPM 2 Timer Channel 3 Status and Control Register; 0x0000006E ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS3A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS3B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS3A        :1;                                       /* Mode Select A for TPM Channel 3 */&lt;br /&gt;    byte MS3B        :1;                                       /* Mode Select B for TPM Channel 3 */&lt;br /&gt;    byte CH3IE       :1;                                       /* Channel 3 Interrupt Enable */&lt;br /&gt;    byte CH3F        :1;                                       /* Channel 3 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS3x :2;&lt;br /&gt;    byte grpMS3x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2C3SCSTR;&lt;br /&gt;extern volatile TPM2C3SCSTR _TPM2C3SC @0x0000006E;&lt;br /&gt;#define TPM2C3SC                        _TPM2C3SC.Byte&lt;br /&gt;#define TPM2C3SC_ELS3A                  _TPM2C3SC.Bits.ELS3A&lt;br /&gt;#define TPM2C3SC_ELS3B                  _TPM2C3SC.Bits.ELS3B&lt;br /&gt;#define TPM2C3SC_MS3A                   _TPM2C3SC.Bits.MS3A&lt;br /&gt;#define TPM2C3SC_MS3B                   _TPM2C3SC.Bits.MS3B&lt;br /&gt;#define TPM2C3SC_CH3IE                  _TPM2C3SC.Bits.CH3IE&lt;br /&gt;#define TPM2C3SC_CH3F                   _TPM2C3SC.Bits.CH3F&lt;br /&gt;#define TPM2C3SC_ELS3x                  _TPM2C3SC.MergedBits.grpELS3x&lt;br /&gt;#define TPM2C3SC_MS3x                   _TPM2C3SC.MergedBits.grpMS3x&lt;br /&gt;&lt;br /&gt;#define TPM2C3SC_ELS3A_MASK             4&lt;br /&gt;#define TPM2C3SC_ELS3B_MASK             8&lt;br /&gt;#define TPM2C3SC_MS3A_MASK              16&lt;br /&gt;#define TPM2C3SC_MS3B_MASK              32&lt;br /&gt;#define TPM2C3SC_CH3IE_MASK             64&lt;br /&gt;#define TPM2C3SC_CH3F_MASK              128&lt;br /&gt;#define TPM2C3SC_ELS3x_MASK             12&lt;br /&gt;#define TPM2C3SC_ELS3x_BITNUM           2&lt;br /&gt;#define TPM2C3SC_MS3x_MASK              48&lt;br /&gt;#define TPM2C3SC_MS3x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C3V - TPM 2 Timer Channel 3 Value Register; 0x0000006F ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2C3VH - TPM 2 Timer Channel 3 Value Register High; 0x0000006F ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C3VHSTR;&lt;br /&gt;    #define TPM2C3VH                    _TPM2C3V.Overlap_STR.TPM2C3VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2C3VL - TPM 2 Timer Channel 3 Value Register Low; 0x00000070 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C3VLSTR;&lt;br /&gt;    #define TPM2C3VL                    _TPM2C3V.Overlap_STR.TPM2C3VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2C3VSTR;&lt;br /&gt;extern volatile TPM2C3VSTR _TPM2C3V @0x0000006F;&lt;br /&gt;#define TPM2C3V                         _TPM2C3V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C4SC - TPM 2 Timer Channel 4 Status and Control Register; 0x00000071 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ELS4A       :1;                                       /* Edge/Level Select Bit A */&lt;br /&gt;    byte ELS4B       :1;                                       /* Edge/Level Select Bit B */&lt;br /&gt;    byte MS4A        :1;                                       /* Mode Select A for TPM Channel 4 */&lt;br /&gt;    byte MS4B        :1;                                       /* Mode Select B for TPM Channel 4 */&lt;br /&gt;    byte CH4IE       :1;                                       /* Channel 4 Interrupt Enable */&lt;br /&gt;    byte CH4F        :1;                                       /* Channel 4 Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte grpELS4x :2;&lt;br /&gt;    byte grpMS4x :2;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} TPM2C4SCSTR;&lt;br /&gt;extern volatile TPM2C4SCSTR _TPM2C4SC @0x00000071;&lt;br /&gt;#define TPM2C4SC                        _TPM2C4SC.Byte&lt;br /&gt;#define TPM2C4SC_ELS4A                  _TPM2C4SC.Bits.ELS4A&lt;br /&gt;#define TPM2C4SC_ELS4B                  _TPM2C4SC.Bits.ELS4B&lt;br /&gt;#define TPM2C4SC_MS4A                   _TPM2C4SC.Bits.MS4A&lt;br /&gt;#define TPM2C4SC_MS4B                   _TPM2C4SC.Bits.MS4B&lt;br /&gt;#define TPM2C4SC_CH4IE                  _TPM2C4SC.Bits.CH4IE&lt;br /&gt;#define TPM2C4SC_CH4F                   _TPM2C4SC.Bits.CH4F&lt;br /&gt;#define TPM2C4SC_ELS4x                  _TPM2C4SC.MergedBits.grpELS4x&lt;br /&gt;#define TPM2C4SC_MS4x                   _TPM2C4SC.MergedBits.grpMS4x&lt;br /&gt;&lt;br /&gt;#define TPM2C4SC_ELS4A_MASK             4&lt;br /&gt;#define TPM2C4SC_ELS4B_MASK             8&lt;br /&gt;#define TPM2C4SC_MS4A_MASK              16&lt;br /&gt;#define TPM2C4SC_MS4B_MASK              32&lt;br /&gt;#define TPM2C4SC_CH4IE_MASK             64&lt;br /&gt;#define TPM2C4SC_CH4F_MASK              128&lt;br /&gt;#define TPM2C4SC_ELS4x_MASK             12&lt;br /&gt;#define TPM2C4SC_ELS4x_BITNUM           2&lt;br /&gt;#define TPM2C4SC_MS4x_MASK              48&lt;br /&gt;#define TPM2C4SC_MS4x_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** TPM2C4V - TPM 2 Timer Channel 4 Value Register; 0x00000072 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** TPM2C4VH - TPM 2 Timer Channel 4 Value Register High; 0x00000072 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C4VHSTR;&lt;br /&gt;    #define TPM2C4VH                    _TPM2C4V.Overlap_STR.TPM2C4VHSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** TPM2C4VL - TPM 2 Timer Channel 4 Value Register Low; 0x00000073 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;    } TPM2C4VLSTR;&lt;br /&gt;    #define TPM2C4VL                    _TPM2C4V.Overlap_STR.TPM2C4VLSTR.Byte&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} TPM2C4VSTR;&lt;br /&gt;extern volatile TPM2C4VSTR _TPM2C4V @0x00000072;&lt;br /&gt;#define TPM2C4V                         _TPM2C4V.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SRS - System Reset Status; 0x00001800 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte LVD         :1;                                       /* Low Voltage Detect */&lt;br /&gt;    byte ICG         :1;                                       /* Internal Clock Generation Module Reset */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte ILOP        :1;                                       /* Illegal Opcode */&lt;br /&gt;    byte COP         :1;                                       /* Computer Operating Properly (COP) Watchdog */&lt;br /&gt;    byte PIN         :1;                                       /* External Reset Pin */&lt;br /&gt;    byte POR         :1;                                       /* Power-On Reset */&lt;br /&gt;  } Bits;&lt;br /&gt;} SRSSTR;&lt;br /&gt;extern volatile SRSSTR _SRS @0x00001800;&lt;br /&gt;#define SRS                             _SRS.Byte&lt;br /&gt;#define SRS_LVD                         _SRS.Bits.LVD&lt;br /&gt;#define SRS_ICG                         _SRS.Bits.ICG&lt;br /&gt;#define SRS_ILOP                        _SRS.Bits.ILOP&lt;br /&gt;#define SRS_COP                         _SRS.Bits.COP&lt;br /&gt;#define SRS_PIN                         _SRS.Bits.PIN&lt;br /&gt;#define SRS_POR                         _SRS.Bits.POR&lt;br /&gt;&lt;br /&gt;#define SRS_LVD_MASK                    2&lt;br /&gt;#define SRS_ICG_MASK                    4&lt;br /&gt;#define SRS_ILOP_MASK                   16&lt;br /&gt;#define SRS_COP_MASK                    32&lt;br /&gt;#define SRS_PIN_MASK                    64&lt;br /&gt;#define SRS_POR_MASK                    128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SBDFR - System Background Debug Force Reset Register; 0x00001801 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte BDFR        :1;                                       /* Background Debug Force Reset */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;  } Bits;&lt;br /&gt;} SBDFRSTR;&lt;br /&gt;extern volatile SBDFRSTR _SBDFR @0x00001801;&lt;br /&gt;#define SBDFR                           _SBDFR.Byte&lt;br /&gt;#define SBDFR_BDFR                      _SBDFR.Bits.BDFR&lt;br /&gt;&lt;br /&gt;#define SBDFR_BDFR_MASK                 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SOPT - System Options Register; 0x00001802 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte BKGDPE      :1;                                       /* Background Debug Mode Pin Enable */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte STOPE       :1;                                       /* Stop Mode Enable */&lt;br /&gt;    byte COPT        :1;                                       /* COP Watchdog Timeout */&lt;br /&gt;    byte COPE        :1;                                       /* COP Watchdog Enable */&lt;br /&gt;  } Bits;&lt;br /&gt;} SOPTSTR;&lt;br /&gt;extern volatile SOPTSTR _SOPT @0x00001802;&lt;br /&gt;#define SOPT                            _SOPT.Byte&lt;br /&gt;#define SOPT_BKGDPE                     _SOPT.Bits.BKGDPE&lt;br /&gt;#define SOPT_STOPE                      _SOPT.Bits.STOPE&lt;br /&gt;#define SOPT_COPT                       _SOPT.Bits.COPT&lt;br /&gt;#define SOPT_COPE                       _SOPT.Bits.COPE&lt;br /&gt;&lt;br /&gt;#define SOPT_BKGDPE_MASK                2&lt;br /&gt;#define SOPT_STOPE_MASK                 32&lt;br /&gt;#define SOPT_COPT_MASK                  64&lt;br /&gt;#define SOPT_COPE_MASK                  128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SDID - System Integration Module Part ID Register; 0x00001806 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** SDIDH - System Integration Module Part ID Register High; 0x00001806 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte ID8         :1;                                       /* Part Identification Number 8 */&lt;br /&gt;        byte ID9         :1;                                       /* Part Identification Number 9 */&lt;br /&gt;        byte ID10        :1;                                       /* Part Identification Number 10 */&lt;br /&gt;        byte ID11        :1;                                       /* Part Identification Number 11 */&lt;br /&gt;        byte REV0        :1;                                       /* Revision Number 0 */&lt;br /&gt;        byte REV1        :1;                                       /* Revision Number 1 */&lt;br /&gt;        byte REV2        :1;                                       /* Revision Number 2 */&lt;br /&gt;        byte REV3        :1;                                       /* Revision Number 3 */&lt;br /&gt;      } Bits;&lt;br /&gt;      struct {&lt;br /&gt;        byte grpID_8 :4;&lt;br /&gt;        byte grpREV :4;&lt;br /&gt;      } MergedBits;&lt;br /&gt;    } SDIDHSTR;&lt;br /&gt;    #define SDIDH                       _SDID.Overlap_STR.SDIDHSTR.Byte&lt;br /&gt;    #define SDIDH_ID8                   _SDID.Overlap_STR.SDIDHSTR.Bits.ID8&lt;br /&gt;    #define SDIDH_ID9                   _SDID.Overlap_STR.SDIDHSTR.Bits.ID9&lt;br /&gt;    #define SDIDH_ID10                  _SDID.Overlap_STR.SDIDHSTR.Bits.ID10&lt;br /&gt;    #define SDIDH_ID11                  _SDID.Overlap_STR.SDIDHSTR.Bits.ID11&lt;br /&gt;    #define SDIDH_REV0                  _SDID.Overlap_STR.SDIDHSTR.Bits.REV0&lt;br /&gt;    #define SDIDH_REV1                  _SDID.Overlap_STR.SDIDHSTR.Bits.REV1&lt;br /&gt;    #define SDIDH_REV2                  _SDID.Overlap_STR.SDIDHSTR.Bits.REV2&lt;br /&gt;    #define SDIDH_REV3                  _SDID.Overlap_STR.SDIDHSTR.Bits.REV3&lt;br /&gt;    &lt;br /&gt;    #define SDIDH_ID_8                  _SDID.Overlap_STR.SDIDHSTR.MergedBits.grpID_8&lt;br /&gt;    #define SDIDH_REV                   _SDID.Overlap_STR.SDIDHSTR.MergedBits.grpREV&lt;br /&gt;    #define SDIDH_ID                    SDIDH_ID_8&lt;br /&gt;    &lt;br /&gt;    #define SDIDH_ID8_MASK              1&lt;br /&gt;    #define SDIDH_ID9_MASK              2&lt;br /&gt;    #define SDIDH_ID10_MASK             4&lt;br /&gt;    #define SDIDH_ID11_MASK             8&lt;br /&gt;    #define SDIDH_REV0_MASK             16&lt;br /&gt;    #define SDIDH_REV1_MASK             32&lt;br /&gt;    #define SDIDH_REV2_MASK             64&lt;br /&gt;    #define SDIDH_REV3_MASK             128&lt;br /&gt;    #define SDIDH_ID_8_MASK             15&lt;br /&gt;    #define SDIDH_ID_8_BITNUM           0&lt;br /&gt;    #define SDIDH_REV_MASK              240&lt;br /&gt;    #define SDIDH_REV_BITNUM            4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    /*** SDIDL - System Integration Module Part ID Register Low; 0x00001807 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte ID0         :1;                                       /* Part Identification Number 0 */&lt;br /&gt;        byte ID1         :1;                                       /* Part Identification Number 1 */&lt;br /&gt;        byte ID2         :1;                                       /* Part Identification Number 2 */&lt;br /&gt;        byte ID3         :1;                                       /* Part Identification Number 3 */&lt;br /&gt;        byte ID4         :1;                                       /* Part Identification Number 4 */&lt;br /&gt;        byte ID5         :1;                                       /* Part Identification Number 5 */&lt;br /&gt;        byte ID6         :1;                                       /* Part Identification Number 6 */&lt;br /&gt;        byte ID7         :1;                                       /* Part Identification Number 7 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } SDIDLSTR;&lt;br /&gt;    #define SDIDL                       _SDID.Overlap_STR.SDIDLSTR.Byte&lt;br /&gt;    #define SDIDL_ID0                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID0&lt;br /&gt;    #define SDIDL_ID1                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID1&lt;br /&gt;    #define SDIDL_ID2                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID2&lt;br /&gt;    #define SDIDL_ID3                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID3&lt;br /&gt;    #define SDIDL_ID4                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID4&lt;br /&gt;    #define SDIDL_ID5                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID5&lt;br /&gt;    #define SDIDL_ID6                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID6&lt;br /&gt;    #define SDIDL_ID7                   _SDID.Overlap_STR.SDIDLSTR.Bits.ID7&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    #define SDIDL_ID0_MASK              1&lt;br /&gt;    #define SDIDL_ID1_MASK              2&lt;br /&gt;    #define SDIDL_ID2_MASK              4&lt;br /&gt;    #define SDIDL_ID3_MASK              8&lt;br /&gt;    #define SDIDL_ID4_MASK              16&lt;br /&gt;    #define SDIDL_ID5_MASK              32&lt;br /&gt;    #define SDIDL_ID6_MASK              64&lt;br /&gt;    #define SDIDL_ID7_MASK              128&lt;br /&gt;&lt;br /&gt;  } Overlap_STR;&lt;br /&gt;&lt;br /&gt;} SDIDSTR;&lt;br /&gt;extern volatile SDIDSTR _SDID @0x00001806;&lt;br /&gt;#define SDID                            _SDID.Word&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SRTISC - System RTI Status and Control Register; 0x00001808 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte RTIS0       :1;                                       /* Real-Time Interrupt Delay Select Bit 0 */&lt;br /&gt;    byte RTIS1       :1;                                       /* Real-Time Interrupt Delay Select Bit 1 */&lt;br /&gt;    byte RTIS2       :1;                                       /* Real-Time Interrupt Delay Select Bit 2 */&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte RTIE        :1;                                       /* Real-Time Interrupt Enable */&lt;br /&gt;    byte RTICLKS     :1;                                       /* Real-Time Interrupt Clock Select */&lt;br /&gt;    byte RTIACK      :1;                                       /* Real-Time Interrupt Acknowledge */&lt;br /&gt;    byte RTIF        :1;                                       /* Real-Time Interrupt Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;  struct {&lt;br /&gt;    byte grpRTIS :3;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;    byte         :1;&lt;br /&gt;  } MergedBits;&lt;br /&gt;} SRTISCSTR;&lt;br /&gt;extern volatile SRTISCSTR _SRTISC @0x00001808;&lt;br /&gt;#define SRTISC                          _SRTISC.Byte&lt;br /&gt;#define SRTISC_RTIS0                    _SRTISC.Bits.RTIS0&lt;br /&gt;#define SRTISC_RTIS1                    _SRTISC.Bits.RTIS1&lt;br /&gt;#define SRTISC_RTIS2                    _SRTISC.Bits.RTIS2&lt;br /&gt;#define SRTISC_RTIE                     _SRTISC.Bits.RTIE&lt;br /&gt;#define SRTISC_RTICLKS                  _SRTISC.Bits.RTICLKS&lt;br /&gt;#define SRTISC_RTIACK                   _SRTISC.Bits.RTIACK&lt;br /&gt;#define SRTISC_RTIF                     _SRTISC.Bits.RTIF&lt;br /&gt;#define SRTISC_RTIS                     _SRTISC.MergedBits.grpRTIS&lt;br /&gt;&lt;br /&gt;#define SRTISC_RTIS0_MASK               1&lt;br /&gt;#define SRTISC_RTIS1_MASK               2&lt;br /&gt;#define SRTISC_RTIS2_MASK               4&lt;br /&gt;#define SRTISC_RTIE_MASK                16&lt;br /&gt;#define SRTISC_RTICLKS_MASK             32&lt;br /&gt;#define SRTISC_RTIACK_MASK              64&lt;br /&gt;#define SRTISC_RTIF_MASK                128&lt;br /&gt;#define SRTISC_RTIS_MASK                7&lt;br /&gt;#define SRTISC_RTIS_BITNUM              0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPMSC1 - PM Status and Control 1 Register; 0x00001809 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte             :1; &lt;br /&gt;    byte             :1; &lt;br /&gt;    byte LVDE        :1;                                       /* Low-Voltage Detect Enable */&lt;br /&gt;    byte LVDSE       :1;                                       /* Low-Voltage Detect Stop Enable */&lt;br /&gt;    byte LVDRE       :1;                                       /* Low-Voltage Detect Reset Enable */&lt;br /&gt;    byte LVDIE       :1;                                       /* Low-Voltage Detect Interrrupt Enable */&lt;br /&gt;    byte LVDACK      :1;                                       /* Low-Voltage Detect Acknowledge */&lt;br /&gt;    byte LVDF        :1;                                       /* Low-Voltage Detect Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} SPMSC1STR;&lt;br /&gt;extern volatile SPMSC1STR _SPMSC1 @0x00001809;&lt;br /&gt;#define SPMSC1                          _SPMSC1.Byte&lt;br /&gt;#define SPMSC1_LVDE                     _SPMSC1.Bits.LVDE&lt;br /&gt;#define SPMSC1_LVDSE                    _SPMSC1.Bits.LVDSE&lt;br /&gt;#define SPMSC1_LVDRE                    _SPMSC1.Bits.LVDRE&lt;br /&gt;#define SPMSC1_LVDIE                    _SPMSC1.Bits.LVDIE&lt;br /&gt;#define SPMSC1_LVDACK                   _SPMSC1.Bits.LVDACK&lt;br /&gt;#define SPMSC1_LVDF                     _SPMSC1.Bits.LVDF&lt;br /&gt;&lt;br /&gt;#define SPMSC1_LVDE_MASK                4&lt;br /&gt;#define SPMSC1_LVDSE_MASK               8&lt;br /&gt;#define SPMSC1_LVDRE_MASK               16&lt;br /&gt;#define SPMSC1_LVDIE_MASK               32&lt;br /&gt;#define SPMSC1_LVDACK_MASK              64&lt;br /&gt;#define SPMSC1_LVDF_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** SPMSC2 - PM Status and Control 2 Register; 0x0000180A ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte PPDC        :1;                                       /* Partial Power Down Control */&lt;br /&gt;    byte PDC         :1;                                       /* Power Down Control */&lt;br /&gt;    byte PPDACK      :1;                                       /* Partial Power Down Acknowlege */&lt;br /&gt;    byte PPDF        :1;                                       /* Partial Power Down Flag */&lt;br /&gt;    byte LVWV        :1;                                       /* Low-Voltage Warning Voltage Select */&lt;br /&gt;    byte LVDV        :1;                                       /* Low-Voltage Detect Voltage Select */&lt;br /&gt;    byte LVWACK      :1;                                       /* Low-Voltage Warning Acknowlege */&lt;br /&gt;    byte LVWF        :1;                                       /* Low-Voltage Warning Flag */&lt;br /&gt;  } Bits;&lt;br /&gt;} SPMSC2STR;&lt;br /&gt;extern volatile SPMSC2STR _SPMSC2 @0x0000180A;&lt;br /&gt;#define SPMSC2                          _SPMSC2.Byte&lt;br /&gt;#define SPMSC2_PPDC                     _SPMSC2.Bits.PPDC&lt;br /&gt;#define SPMSC2_PDC                      _SPMSC2.Bits.PDC&lt;br /&gt;#define SPMSC2_PPDACK                   _SPMSC2.Bits.PPDACK&lt;br /&gt;#define SPMSC2_PPDF                     _SPMSC2.Bits.PPDF&lt;br /&gt;#define SPMSC2_LVWV                     _SPMSC2.Bits.LVWV&lt;br /&gt;#define SPMSC2_LVDV                     _SPMSC2.Bits.LVDV&lt;br /&gt;#define SPMSC2_LVWACK                   _SPMSC2.Bits.LVWACK&lt;br /&gt;#define SPMSC2_LVWF                     _SPMSC2.Bits.LVWF&lt;br /&gt;&lt;br /&gt;#define SPMSC2_PPDC_MASK                1&lt;br /&gt;#define SPMSC2_PDC_MASK                 2&lt;br /&gt;#define SPMSC2_PPDACK_MASK              4&lt;br /&gt;#define SPMSC2_PPDF_MASK                8&lt;br /&gt;#define SPMSC2_LVWV_MASK                16&lt;br /&gt;#define SPMSC2_LVDV_MASK                32&lt;br /&gt;#define SPMSC2_LVWACK_MASK              64&lt;br /&gt;#define SPMSC2_LVWF_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** DBGCAH - Debug Comparator A High Register; 0x00001810 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte Bit8        :1;                                       /* Debug Comparator A Bit 8 */&lt;br /&gt;    byte Bit9        :1;                                       /* Debug Comparator A Bit 9 */&lt;br /&gt;    byte Bit10       :1;                                       /* Debug Comparator A Bit 10 */&lt;br /&gt;    byte Bit11       :1;                                       /* Debug Comparator A Bit 11 */&lt;br /&gt;    byte Bit12       :1;                                       /* Debug Comparator A Bit 12 */&lt;br /&gt;    byte Bit13       :1;                                       /* Debug Comparator A Bit 13 */&lt;br /&gt;    byte Bit14       :1;                                       /* Debug Comparator A Bit 14 */&lt;br /&gt;    byte Bit15       :1;                                       /* Debug Comparator A Bit 15 */&lt;br /&gt;  } Bits;&lt;br /&gt;} DBGCAHSTR;&lt;br /&gt;extern volatile DBGCAHSTR _DBGCAH @0x00001810;&lt;br /&gt;#define DBGCAH                          _DBGCAH.Byte&lt;br /&gt;#define DBGCAH_Bit8                     _DBGCAH.Bits.Bit8&lt;br /&gt;#define DBGCAH_Bit9                     _DBGCAH.Bits.Bit9&lt;br /&gt;#define DBGCAH_Bit10                    _DBGCAH.Bits.Bit10&lt;br /&gt;#define DBGCAH_Bit11                    _DBGCAH.Bits.Bit11&lt;br /&gt;#define DBGCAH_Bit12                    _DBGCAH.Bits.Bit12&lt;br /&gt;#define DBGCAH_Bit13                    _DBGCAH.Bits.Bit13&lt;br /&gt;#define DBGCAH_Bit14                    _DBGCAH.Bits.Bit14&lt;br /&gt;#define DBGCAH_Bit15                    _DBGCAH.Bits.Bit15&lt;br /&gt;&lt;br /&gt;#define DBGCAH_Bit8_MASK                1&lt;br /&gt;#define DBGCAH_Bit9_MASK                2&lt;br /&gt;#define DBGCAH_Bit10_MASK               4&lt;br /&gt;#define DBGCAH_Bit11_MASK               8&lt;br /&gt;#define DBGCAH_Bit12_MASK               16&lt;br /&gt;#define DBGCAH_Bit13_MASK               32&lt;br /&gt;#define DBGCAH_Bit14_MASK               64&lt;br /&gt;#define DBGCAH_Bit15_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** DBGCAL - Debug Comparator A Low Register; 0x00001811 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte Bit0        :1;                                       /* Debug Comparator A Bit 0 */&lt;br /&gt;    byte Bit1        :1;                                       /* Debug Comparator A Bit 1 */&lt;br /&gt;    byte Bit2        :1;                                       /* Debug Comparator A Bit 2 */&lt;br /&gt;    byte Bit3        :1;                                       /* Debug Comparator A Bit 3 */&lt;br /&gt;    byte Bit4        :1;                                       /* Debug Comparator A Bit 4 */&lt;br /&gt;    byte Bit5        :1;                                       /* Debug Comparator A Bit 5 */&lt;br /&gt;    byte Bit6        :1;                                       /* Debug Comparator A Bit 6 */&lt;br /&gt;    byte Bit7        :1;                                       /* Debug Comparator A Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} DBGCALSTR;&lt;br /&gt;extern volatile DBGCALSTR _DBGCAL @0x00001811;&lt;br /&gt;#define DBGCAL                          _DBGCAL.Byte&lt;br /&gt;#define DBGCAL_Bit0                     _DBGCAL.Bits.Bit0&lt;br /&gt;#define DBGCAL_Bit1                     _DBGCAL.Bits.Bit1&lt;br /&gt;#define DBGCAL_Bit2                     _DBGCAL.Bits.Bit2&lt;br /&gt;#define DBGCAL_Bit3                     _DBGCAL.Bits.Bit3&lt;br /&gt;#define DBGCAL_Bit4                     _DBGCAL.Bits.Bit4&lt;br /&gt;#define DBGCAL_Bit5                     _DBGCAL.Bits.Bit5&lt;br /&gt;#define DBGCAL_Bit6                     _DBGCAL.Bits.Bit6&lt;br /&gt;#define DBGCAL_Bit7                     _DBGCAL.Bits.Bit7&lt;br /&gt;&lt;br /&gt;#define DBGCAL_Bit0_MASK                1&lt;br /&gt;#define DBGCAL_Bit1_MASK                2&lt;br /&gt;#define DBGCAL_Bit2_MASK                4&lt;br /&gt;#define DBGCAL_Bit3_MASK                8&lt;br /&gt;#define DBGCAL_Bit4_MASK                16&lt;br /&gt;#define DBGCAL_Bit5_MASK                32&lt;br /&gt;#define DBGCAL_Bit6_MASK                64&lt;br /&gt;#define DBGCAL_Bit7_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** DBGCBH - Debug Comparator B High Register; 0x00001812 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte Bit8        :1;                                       /* Debug Comparator B Bit 8 */&lt;br /&gt;    byte Bit9        :1;                                       /* Debug Comparator B Bit 9 */&lt;br /&gt;    byte Bit10       :1;                                       /* Debug Comparator B Bit 10 */&lt;br /&gt;    byte Bit11       :1;                                       /* Debug Comparator B Bit 11 */&lt;br /&gt;    byte Bit12       :1;                                       /* Debug Comparator B Bit 12 */&lt;br /&gt;    byte Bit13       :1;                                       /* Debug Comparator B Bit 13 */&lt;br /&gt;    byte Bit14       :1;                                       /* Debug Comparator B Bit 14 */&lt;br /&gt;    byte Bit15       :1;                                       /* Debug Comparator B Bit 15 */&lt;br /&gt;  } Bits;&lt;br /&gt;} DBGCBHSTR;&lt;br /&gt;extern volatile DBGCBHSTR _DBGCBH @0x00001812;&lt;br /&gt;#define DBGCBH                          _DBGCBH.Byte&lt;br /&gt;#define DBGCBH_Bit8                     _DBGCBH.Bits.Bit8&lt;br /&gt;#define DBGCBH_Bit9                     _DBGCBH.Bits.Bit9&lt;br /&gt;#define DBGCBH_Bit10                    _DBGCBH.Bits.Bit10&lt;br /&gt;#define DBGCBH_Bit11                    _DBGCBH.Bits.Bit11&lt;br /&gt;#define DBGCBH_Bit12                    _DBGCBH.Bits.Bit12&lt;br /&gt;#define DBGCBH_Bit13                    _DBGCBH.Bits.Bit13&lt;br /&gt;#define DBGCBH_Bit14                    _DBGCBH.Bits.Bit14&lt;br /&gt;#define DBGCBH_Bit15                    _DBGCBH.Bits.Bit15&lt;br /&gt;&lt;br /&gt;#define DBGCBH_Bit8_MASK                1&lt;br /&gt;#define DBGCBH_Bit9_MASK                2&lt;br /&gt;#define DBGCBH_Bit10_MASK               4&lt;br /&gt;#define DBGCBH_Bit11_MASK               8&lt;br /&gt;#define DBGCBH_Bit12_MASK               16&lt;br /&gt;#define DBGCBH_Bit13_MASK               32&lt;br /&gt;#define DBGCBH_Bit14_MASK               64&lt;br /&gt;#define DBGCBH_Bit15_MASK               128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** DBGCBL - Debug Comparator B Low Register; 0x00001813 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  byte Byte;&lt;br /&gt;  struct {&lt;br /&gt;    byte Bit0        :1;                                       /* Debug Comparator B Bit 0 */&lt;br /&gt;    byte Bit1        :1;                                       /* Debug Comparator B Bit 1 */&lt;br /&gt;    byte Bit2        :1;                                       /* Debug Comparator B Bit 2 */&lt;br /&gt;    byte Bit3        :1;                                       /* Debug Comparator B Bit 3 */&lt;br /&gt;    byte Bit4        :1;                                       /* Debug Comparator B Bit 4 */&lt;br /&gt;    byte Bit5        :1;                                       /* Debug Comparator B Bit 5 */&lt;br /&gt;    byte Bit6        :1;                                       /* Debug Comparator B Bit 6 */&lt;br /&gt;    byte Bit7        :1;                                       /* Debug Comparator B Bit 7 */&lt;br /&gt;  } Bits;&lt;br /&gt;} DBGCBLSTR;&lt;br /&gt;extern volatile DBGCBLSTR _DBGCBL @0x00001813;&lt;br /&gt;#define DBGCBL                          _DBGCBL.Byte&lt;br /&gt;#define DBGCBL_Bit0                     _DBGCBL.Bits.Bit0&lt;br /&gt;#define DBGCBL_Bit1                     _DBGCBL.Bits.Bit1&lt;br /&gt;#define DBGCBL_Bit2                     _DBGCBL.Bits.Bit2&lt;br /&gt;#define DBGCBL_Bit3                     _DBGCBL.Bits.Bit3&lt;br /&gt;#define DBGCBL_Bit4                     _DBGCBL.Bits.Bit4&lt;br /&gt;#define DBGCBL_Bit5                     _DBGCBL.Bits.Bit5&lt;br /&gt;#define DBGCBL_Bit6                     _DBGCBL.Bits.Bit6&lt;br /&gt;#define DBGCBL_Bit7                     _DBGCBL.Bits.Bit7&lt;br /&gt;&lt;br /&gt;#define DBGCBL_Bit0_MASK                1&lt;br /&gt;#define DBGCBL_Bit1_MASK                2&lt;br /&gt;#define DBGCBL_Bit2_MASK                4&lt;br /&gt;#define DBGCBL_Bit3_MASK                8&lt;br /&gt;#define DBGCBL_Bit4_MASK                16&lt;br /&gt;#define DBGCBL_Bit5_MASK                32&lt;br /&gt;#define DBGCBL_Bit6_MASK                64&lt;br /&gt;#define DBGCBL_Bit7_MASK                128&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** DBGF - Debug FIFO Register; 0x00001814 ***/&lt;br /&gt;typedef union {&lt;br /&gt;  word Word;&lt;br /&gt;   /* Overlapped registers: */&lt;br /&gt;  struct {&lt;br /&gt;    /*** DBGFH - Debug FIFO High Register; 0x00001814 ***/&lt;br /&gt;    union {&lt;br /&gt;      byte Byte;&lt;br /&gt;      struct {&lt;br /&gt;        byte Bit8        :1;                                       /* Debug FIFO Bit 8 */&lt;br /&gt;        byte Bit9        :1;                                       /* Debug FIFO Bit 9 */&lt;br /&gt;        byte Bit10       :1;                                       /* Debug FIFO Bit 10 */&lt;br /&gt;        byte Bit11       :1;                                       /* Debug FIFO Bit 11 */&lt;br /&gt;        byte Bit12       :1;                                       /* Debug FIFO Bit 12 */&lt;br /&gt;        byte Bit13       :1;                                       /* Debug FIFO Bit 13 */&lt;br /&gt;        byte Bit14       :1;                                       /* Debug FIFO Bit 14 */&lt;br /&gt;        byte Bit15       :1;                                       /* Debug FIFO Bit 15 */&lt;br /&gt;      } Bits;&lt;br /&gt;    } DBGFHSTR;&lt;br /&gt;    #define DBGFH                       _DBGF.Overlap_STR.DBGFHSTR.Byte&lt;br /&gt;    #define DBGFH_Bit8                  _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit8&lt;br /&gt;    #define DBGFH_Bit9                  _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit9&lt;br /&gt;    #define DBGFH_Bit10                 _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit10&lt;br /&gt;    #define DBGFH_Bit11                 _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit11&lt;br /&gt;    #define DBGFH_Bit12                 _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit12&lt;br /&gt;    #define DBGFH_Bit13                 _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit13&lt;br /&gt;    #define DBGFH_Bit14                 _DBGF.Overlap_STR.DBGFHSTR.Bits.Bit14&lt;br /&gt;    #define DBGFH_Bit15                 _DBGF.Overlap_STR.DBGFHSTR.Bi
