Category: Uncategorized

Great Link: Desktop Interface Vote

If you haven’t already, go vote on your Desktop Interface —

Pourquoi pas !!: Unity or not Unity ?

At the time of this writing, Unity was winning by a narrow margin.  Here are the results so far, but go vote, and check out the changes:

Desktop Interface Survey

In my opinion, I like the ideas behind Unity.  I am young, and I like new ideas and new features.  As has been said many times, Unity is a bold move on Canonical’s part.  Probably without that risk, that survey wouldn’t have %48 for Unity users, and we wouldn’t have all the feedback from those users who have tried to make it work.  The big thing to watch is whether or not Ubuntu can iron out all of the issues in the next version or two.

Adding the Google +1 to Garland Theme in WordPress

Today, I came across a suggestion on Google AdSense to add the Google +1 Widget to my posts on my website.  Here’s what the notification looked like:

If you want a short description on what the +1 button does, you can watch this short video from the +1 Website:

So, here’s how I made it work in my theme (I am using Garland Revisited). First, I added the javascript link at the bottom of my header.php file.  Here’s the code I added:

<!-- begin Google +1 button -->
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<!-- end Google +1 button -->

So, here’s what the bottom of my header.php looks like (wp-content/themes/garland-revisited/header.php):

</ul>
</div> <!-- /header -->
<?php get_sidebar(); ?>
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
<!-- begin Google Adsense -->
....(Adsense code removed)
<!-- end Google Adsense -->
<!-- begin Google +1 button -->
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<!-- end Google +1 button -->
<!-- begin content -->
<div class="node">

Next, I added the button to the home page. This is the line of code that i added to index.php:

<div style='float:right'><g:plusone href="<?php echo get_permalink() ?>"></g:plusone></div>

Update: I added the href=”<?php echo get_permalink() ?>” code for the index.php.  Without that, the user would be indicating a plus one for the home page rather than the article that the button is next to.

So, here’s what the top of my index.php looks like (wp-content/themes/garland-revisited/index.php):

<?php get_header(); ?>
<?php is_tag(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<div style='float:right'><g:plusone></g:plusone></div>
<h2><a href="<?php echo get_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<span class="submitted"><?php the_time(get_option('date_format')) ?> &#8212; <?php the_author() ?> <?php edit_post_link(__('Edit'), ' | ', ''); ?></span>
<div class="content">
<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) {
	the_post_thumbnail(array( 75,75 ), array( 'class' => 'alignleft' ));
}
?>

Now, that only affects the home page. If you go into one of the posts, you won’t see the button. To fix that, we need to add it to single.php. And, here’s what the top of my single.php looks like (wp-content/themes/garland-revisited/single.php):

<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<div style='float:right'><g:plusone></g:plusone></div>
<h2><?php the_title(); ?></h2>
<span class="submitted"><?php the_time(get_option('date_format')) ?> &#8212; <?php the_author() ?> <?php edit_post_link(__('Edit'), ' | ', ''); ?></span>
<div class="content">

Resources

Ubuntu 11.04: Fixing Notifications

I have seen several posts on how to fix the programs that can’t display notifications.  Let me combine them and give you my solutions.

Here are the other solutions.  Their solutions are probably better anyway, but that doesn’t stop me!

Step 1: Installed “dconf Editor”

There are many different ways to change the configuration settings.  You can edit settings files, or you can use a command-line program.  I like the graphical option that dconf Editor supplies, so that is what I am installing.  You can use any number of methods.  I just used the Ubuntu Software Center:

Step 2: Opened the dconf Editor

I used Alt+F2 and typed dconf-editor to open it:

Step 3: Changed the systray-whitelist option

To get to the option, I opened the tree on the left to: desktop > unity > panel.  Then, I changed the option to [‘all’] to allow everything.  Otherwise, you have to enter all the specific applications that you expect.

And, now I have Shutter, Gnome-RDP, and Skype all showing in the notifications area!

If I could influence this at all, I would suggest having a blacklist option instead of whitelist.  I can’t think of very many indicators that I would like to hide.  If I don’t want to see the indicator, in most cases, I would kill the program behind it.

Java: getSystemJavaCompiler returns null!

After reinstalling my laptop with Ubuntu Natty, I had an issue with one of my custom built tools.  I have this tool that installs a Tomcat-based web application and server.  In the part that compiles the JSON library, I received a NullPointerException.

On further examination, I found that ToolProvider.getSystemJavaCompiler() was returning null for some reason.  I found the answer on IBM DeveloperWorks:

The ToolProvider.getSystemJavaCompiler()method can return null if tools.jar is not in the application’s classpath. The CharStringCompilerclass detects this possible configuration problem and throws an exception with a recommendation for fixing the problem. Note that Sun’s licensing allows tools.jar to be redistributed with the JRE.

What I found was that I was using a JRE instead of a JDK installation.  Of course, when I switch the Java Home to my JDK, I had some other error and the App wouldn’t even run.  So, I added the tools.jar from the JDK installation to the classpath and ran it with the JRE, and everything worked fine.

So, here is the code I use to compile (including the catch for the missing tools.jar):

		//compile
		JavaCompiler jc = ToolProvider.getSystemJavaCompiler();
		// handle issue where tools.jar is not on the classpath
		if(jc == null) {
			log.logException(new InstallException("Could not access the system Java compiler -- check to make sure tools.jar is on the class path."));
			return;
		}
		StandardJavaFileManager fm = jc.getStandardFileManager(null, null, null);
		File compilePath = new File(unzipPath, "org/json");
		Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(compilePath.listFiles());
		for(JavaFileObject f : files) {
			log.logInformation("Compiling - " + f.getName());
		}
		CompilationTask task = jc.getTask(log.getStream(), fm, null, null, null, files);
		try {
			fm.close();
		} catch (IOException e) {
			log.logException(new InstallException("Could not unzip " + zipPath, e));
		}
		boolean result = task.call();
		log.logInformation("**Compile result = " + result);

Resources

IBM DeveloperWorks: Create dynamic applications with javax.tools

Chrome and Gnome, Unity Integrating?

I read about a feature on the about:flags screen entitled “Experimental GNOME menu bar support”, and it caught my attention.  Apparently, I don’t have a late enough installation of Chrome to get this feature, so I can’t play with it, but I wanted to keep my eye out.

So, I found reference to the “Experimental GNOME menu bar support” in a bug report, and it referred me to an 81170 revision.  That led me to the corresponding Code Review.  Now, it looks to me like this revision changed it.

Now, this bug is labeled part of Milestone-13, so does that mean that I won’t see it until I get Chrome 13.  Right now I have version 11.0.696.68, and 13 is a ways off unless I go to the unstable release.

Please comment if you can point out anything else.  Otherwise, it just waiting…

Messing with an HTC HD2 Phone

Well, this past week I became the new owner of an HTC HD2 phone.  I had read that you can flash them to Android, and so begins my saga!  I have it most of way, but it is still a little flaky.  I was actually surprised that it was more difficult than I remember my G1 being.  It was because there were too many partial directions that conflicted.

Below, I will give you some unorganized links and thoughts.  It was too crazy to create a step by step process.

Read More

DD-WRT on Linksys350N

I just flashed my router, and I wanted to provide some links to come back to.

In case you aren’t familiar with DD-WRT, it is a custom router firmware that provides more features than the factory delivered one.  I specifically bought my router because it was on the list of supported devices.  Here are some of the features I use:

  • DNS — I can point DNS names to special IP addresses
  • VPN — I am thinking about using the Open VPN server
  • I have considered trying to install Squid or Dans Guardian on the device to make a transparent proxy, but I haven’t fully fleshed out that idea.

According to the main website, here is their description:

DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety of WLAN routers and embedded systems. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used.

First, if you are using the LinkSys350N, you have to make sure that you have version one.  Here is an article on how you can check:

Cisco Home Community: WRT350N – How to tell if it’s V1 or V2? Having major problems with it

Here are the instructions for installing:

DD-WRT Wiki: Linksys WRT350N

Since I already had an older version of DD-WRT on the router, these are the instructions that applied to me:

You can now upgrade to any generic dd-wrt build except Micro. Be sure to always do a hard reset prior to flashing another build, do a power cycle followed by another hard reset after flashing, and NEVER re-use a configuration file from a previous build or another router. Reconfigure from scratch.

So, my biggest question was remembering how to do a hard reset.  This article solved my problem:

DD-WRT Wiki: Hard Reset Or 30/30/30

Basically, you hold the resest button, wait 30 seconds, pull the power for 30 seconds, and plug it back in for 30 seconds (holding the reset button the whole time).  It takes about 3 or 4 hands to do.  I think next time I may try to commands from telnet.

I flashed the new v24 SP2, and here is the Change Log:

DD-WRT Wiki: Change Log

Adding Apps to Unity’s Dash

Usually, you install apps from either the Ubuntu Software Center or Synaptic or apt-get.  In those cases, the package manager automatically adds the new programs to the menu.  But, what if you install a program manually?

Before Unity, I could right click on the menu and choose Edit Menus.  Now, in Unity, that option is not there.  For that matter, the menu isn’t there.

So, I found that I could type “Main Menu” in the dash to get to the same interface as before:

Main Menu Editor

You can easily add a new menu item in this tool:

Adding Menu Item

Previously, I found that the dash didn’t pick the new menu item up until after I rebooted.  When I just tried it, it worked without me needing to reboot.  Maybe an update fixed it or something.

If you have trouble with it not working, explore this command to start and stop the indexing tool:


zeitgeist-daemon --quit

zeitgeist-daemon &

Resources