Tuesday, May 31, 2011

The Great Office Project - Part 2

Being the main room of the house for us as a couple; the office was quickly finished; save for some decorating. Once the floor was completed the path was cleared to get desks in and finish up.

We continued the office by planning for a possible return to being a bedroom; either for selling the house or as needed. So we did built-ins for the closet. This gives us a lot of storage for the office; while requiring only that we put a door back on to convert it back to a bedroom with a closet.



With the closet done; I get into the attack and added a support brace so that we could hang a ceiling fan with no worries. With the ceiling fan and the new HVAC; it is very easy to heat or cool the office.


After that; I simply trimmed the bottom of the door a bit and put it back on. The kick plate for the door was wrong; so I chiseled it out a bit more; so now the door swings freely and shuts. With this done; I immediately noticed it was 'hanging'; so like many other doors in the house; I removed the 3/4" screws in the top and put in 4 in screws; which pulled it right up into place.

With that and the desks, we consider the office complete for now. 

Monday, May 16, 2011

Back To Robotics - A Long Awaited Update

There has been next to no progress on my robot; this has been due to buying a house and realizing I would need to do a lot of work on it. That aside; I now have a work bench coming together and the time and money freeing up to get back to it (yay!).

There is some news; there is now a local Maker Space getting started up. This may provide tools, resources and people to work with. I am very excited since I live nearby (about a mile away); though there is no way I could currently afford the membership fee. We will see; as I plan to stop by one of their open houses.

More exciting; I have purchased a part. I saw the part come up on my reader feed and realized it was cheap and would go quickly. I refer to the 1.8 inch 18 bit color TFT LCD display with microSD card breakout released by adafruit. At only $25.00 I knew they would be gone in an instant so I just went ahead and purchased one! My goal for this is to use it for output from the robot; debugging output in the short term and more interesting output in the long term. I'm not sure what to do with the SD card slot; but it is great to have it.

So; when I make progress on my robot, including adding the TFT as output in regards to what the robot is doing; then I will post with haste here! I do have a new idea for the line following so that it isn't so jerky, and I'm excited to try and implement it. For now; here are some pics of the screen as it arrived.

 

Thursday, May 12, 2011

Improving your Netbeans Java Class Template And Including A License File

Well, working with Netbeans I have a problem occur over and over. One of those annoying programming tasks where you always make the change but are too lazy to deal with underlying problem. Today I decided to address on of them. Every time I create a class in Netbeans, there is a comment that appears at the top:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

My co-workers leave this in place; I am OCD about removing it every time. I don't like four lines of useless code at the top. This morning I decided to change this problem and maybe make my Java class templates a little better. I will walk through improving the class template, and adding the license file for display.

This is a stub class created before the changes:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.something.somewhere;

/**
 *
 * @author GFrick
 */
public class MyClass {
 // class here.    
}

We will start by creating a license file. You just have to create a file "license-company.txt" anywhere on your file system and fill it with your company license info. This can be any information you want in the header of all of your created Java classes. Netbeans has to be told about this file, so we choose Tools->Templates and then go down to the folder "Licenses"; highlight it and click "Add...". Navigate to the text file, choose it and click "Add". Now for any project to use this; simply open the project.properties file and add a line like this:

project.license=company

With this done, your license file should now appear when you create new files in Netbeans.

Now, we will improve the Java class template to include a little better javadoc and information at the top. Go to tools->templates again, find the "Java" folder and the "Java Class" item under it. You will want to copy/paste this to make a backup so you have the original. The original looks like this:

<#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">
<#if package?? && package != "">
package ${package};

/**
 *
 * @author ${user}
 */
public class ${name} {

}

We will add some additional information, namely date and encoding to convenience; the updated version looks like this:

<#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">
<#if package?? && package != "">
package ${package};

/**
* ${nameAndExt} (${encoding})
*
* ${date}
* @author ${user}
*/
public class ${name} {

}

Now when you create a new class, a much nicer version of the template appears and there is no need to remove the top comment. Here is an example class created:

/*
* Software property of Something Somewhere Companies. Copyright 2011.
*/
package com.something.somewhere;

/**
* MyClass.java (UTF-8)
*
* May 12, 2011
* @author gfrick
*/
public class MyClass {
 
}

There are of course plenty of other things you can add to the template. They are written using FreeMarker; so you can script them up to your desire. There are a list of variables here: Netbeans Template Variables

Wednesday, May 04, 2011

New Site For Robotics And Electronics Supplies

I was browser my Google reader feed and a great site popped up. I've checked it out and once I get my work bench set up and get back to my robot; I'll definitely be ordering some things from here. I wanted to spread the word about the site: http://www.inmojo.com/

They have lots of RFID, Robotics and just Arduino stuff that I think would be cool to play with.

I hope to get a full post up soon.

Create a "GG Button" With an IOT Button on Discord

I was having some fun with my internet button (found here: https://store.particle.io/collections/shields-and-kits), and also working on some...