Author: digitaleagle

Ubuntu Screen Woes

I have been noticing several problems with my graphics driver or screen in Ubuntu 11.04 Natty Narwhal.  Here’s to hoping someone can add some comments that help.

Dual Screen Problems

At work, I have a second monitor for my laptop.  If I plug the monitor in before I turn on the computer, everything works fine.  I can even unplug the monitor, run to lunch, and plug it back in.  Now, Ubuntu recognizes the monitor plugging and automatically switches between single screen and dual screen.

The problem is when I plug the monitor in after I have booted, it doesn’t work.  The second screen displays like normal.  The bar displays on the top, but the desktop area of the screen is black.  I can drag a window to the other screen, but I can’t see the window.  I can see the mouse though.  It’s not life threatening but very annoying and weird.

Lock Up Issues

I have turned my power settings to not put my computer to sleep when I close the lid.  I just have it blank the screen.  That way I can close it to move to another desk or room without having to wait for it to suspend.

A couple of times, I noticed that the screen quits responding.  I can move the mouse, and the computer seems fine, but nothing responds.  I can’t click on any of the windows, nothings seems to respond to the keyboard, and the indicators by the clock don’t work.

I have finally noticed that it seems to be when I leave the lid closed for a period of time.  Reading the bug post, I think it is after 10 minutes.  So, I can close it to move between rooms but not to drive to work.

Again, just annoying.

Here are two bug reports that seem related:

Bug #728101:  [gm45] Closing laptop lid causes screen to freeze

Bug #762918: Natty Screensaver freezes system after some period of inactivity

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