Jun 29, 2010

Win7Tip: Set Default DNS Search Domains

Problem: You need to set up Windows to use default Internet search domains for your company. This way you can just enter host names. For example, http://hr instead of http://hr.mycompany.com.

Solution: You can add default search domains pretty easily. The only thing that is hard is to find the actual dialog box to enter the information. :) To get to the dialog do the following.

  1. Click on Start -> Control Panel -> View Network Status and Tasks.
  2. Then on the upper left side of the screen click Change Adapter Settings.
  3. Right click the network adapter you are using. Choose Properties.
  4. Select one of the Internet Protocol drivers (either will work). Click Properties.
  5. In the Protocol Dialog, click the Advanced button.
  6. Click the DNS tab.
  7. Halfway down the page you will see a box labeled "Append these DNS Suffixes". Enter your company domains here. For example:

region.mycompany.com
mycompany.com


That is it. Simple. :)

Jun 25, 2010

JQuery: Prevent Scrolling to the Top of a Page

JQuery LogoProblem: Each JQuery click event scrolls to the top of the HTML page.

Solution: Often, links (<a href="#">) are used to create buttons with JQuery and JavaScript applications. When the internal link "#" is used the default behavior for that link is to go to the top of the page. However, in many situations, this is not the desired behavior. There are two ways to prevent this behavior.

First, simply return false at the end of your method.
return false;

Second, use the JQuery preventDefault method on the event.
e.preventDefault();

Thanks for this StackOverflow article on the subject.

Jun 23, 2010

HTML5: Google Creates HTML5 Web Site

Interested in HTML5 and Chrome development? If you are, check out HTML5 Rocks. Lot's of great information on HTML5 and Chrome. Definitely a must read for web developers interested in the subject.

Jun 22, 2010

World Cup Page with All the Info

I found it, I found it! A web page with all the world cup info in one place. You can see everything at a glance.  ESPNSoccernet Bracket

4 iPad News Sites from the Big Boys

Some of the higher traffic sites now have iPad specific URLs. So now you can get all your iPad news with a single click.

  1. CNET - iPad
  2. CrunchGear - iPad
  3. SlashGear - iPad
  4. TUAW - iPad

Jun 21, 2010

Java: Derby/JavaDB Database Basics

Duke WavingAt work today I had to do a little database troubleshooting and had to learn a little bit about JavaDB which is really the Apache Derby database. So I'm creating this post to record some of that information for future reference.

Documentation
You can download the documentation from Apache Derby Documentation Page. There are manuals for all versions of the db. NetBeans 6.8 is using Derby 10.5. If you need quick access to the SQL reference materials, there are links to the online Derby Reference in HTML. The reference contains detailed information on SQL syntax and functions.

SQL Shell
Today I really needed access to an interactive SQL shell for Derby, just like the mysql command for MySQL. One actually exists for Derby. Its call IJ and if you are using Windows and NetBeans its located in:
C:\Program Files\sges-v3\javadb\bin\ij.bat.

If you navigate to that directory, you can start up the shell by typing ij. The only thing that is a little tricky and different, is that before you can access a database, you must issue a connect command. For example, something like this:
ij> connect 'jdbc:derby://localhost:1527/dbname;create=true;user=user;password=pass;';

Once the connection is established you can issue normal SQL statements. I was attempting to change the starting value for an auto generated ID field. To reset the counter to 5, I could issue a command like this:
ALTER TABLE table-name ALTER column-name RESTART WITH 5;

Of course in the end, this was not really the problem. lol. But, issuing the command eventually nudged me in the right direction.

Mashable App for iPad

One of my favorite web sites has released a free app for the iPad. The Mashable app is essentially a wrapper for the Mashable site. It downloads the HTML stories from Mashable and caches them. This allows you to quickly and easily browse stories and topics. Here is what the app looks like in portrait.


Clicking on the Navigation button brings up a popup list of site categories.


Of course if you put the app in portrait mode, the list of categories is always displayed.


Simple, yet elegant. Nicely done.

Jun 19, 2010

4 Places to Talk About Your iPad

Looking for a place to talk about your iPad?  Here are some forum sites you might check out.
  1. Apple Forums - Mostly support forums but includes discussions on Applications and Accessories too.
  2. MacRumors - A complete set of forums on all things Mac including the iPhone and the iPad.
  3. tipb Forums - Since the forums are for The iPhone Blog (tipb), totally focused on iPhone and iPad.
  4. everythingiCafe - Another everything Apple kind of forum.

Google Command Line Tool

Google LogoTalk about retro, Google has come out with a set of command line tools for accessing Google services. For example, you can do something like this:
$ google blogger post --blog "My blog" --tags "python, googlecl, development" my_post.html

Written in Python, you should be able to run them from any operating system.

Jun 18, 2010

Win7Tip: Change File Time Stamps with Cygwin and Touch

Problem: I need to change the time stamp of Windows files, but I don't what to buy or install some silly shareware application.

Solution: Install Cygwin and use the Unix touch utility to modify the timestamp.

  1. Start Cygwin.
  2. Change to your C: drive: cd /cygdrive/c
  3. Navigate to your file.
  4. Use the touch command.
  5. For example, set the date to Jan 6, 2010 at 4:20pm:
    touch -d '6 Jan 2010 16:20' myfile.txt

That's all there is too it.

Jun 17, 2010

Check Your Qwest DSL Download Speed on a Regular Basis

Well I just found out my DSL modem was running at 1.5 Mbps when I have been paying for 5 Mbps. Finally, got hold of tech support and they had me reset my modem and voila, back to 5 mbps. Apparently, Qwest modems can "randomly" do this and it is up to me to check my connection speed on a regular basis to make sure my modem hasn't reset its speed!

Is this any way to treat your customer who is paying hundreds of dollars a year for your service? Plus the first tech support person I got hung up on me (no profanity from me or anything, 2nd tech support person was very nice). So I'm a little angry about the whole thing. This doesn't sound like a "random" thing to me. Sounds more like a good way to throttle your customers without their knowledge. How much have I overpaid for my service over the last couple of years?

Anyway, I found this simple bandwidth test that seems to be easy to use and pretty accurate: http://www.speakeasy.net/speedtest/

If you are a Qwest DSL customer, run the test and make sure you are getting your money's worth.


 

Jun 12, 2010

JQuery Tip: Select List Item with Deselect

JQuery LogoHow do select an item from a list? Well this is what I came up with as part of my iPhone/iPad experiments. Using JQuery, a click event is bound to each <li> element. When an item is clicked, the picked class is assigned to that item. The background is changed to show the selected item.

One additional feature of this example, when a selected item is clicked, it is deselected. This is accomplished by a simple check if the current item has the picked class assigned. JQuery makes this code really simple.

See Example

Here is a snippet of the source code.

 8:  <style type="text/css">
 9:.ThinListTable { width:480px;}
10:.ThinListTable ul{ list-style-type:none; border:2px solid black; padding:0px; border-bottom:0px;}
11:.ThinListTable li{ border-bottom:2px solid black; padding:4px; margin:0px;}
12:.picked{ background:#EDEDED; }
13:  </style>
14:<script type="text/javascript">
15:
16:// View Source
17:function getSource(){
18:  window.open("view-source:" + location.href);
19:  return;
20:}
21:
22:// Mouse Handler
23:function mouseHandler(e){
24:  // Add Picked Class
25:    if ($(this).hasClass('picked')) {
26:        $(this).removeClass('picked');
27:    } else {
28:        $(".picked").removeClass('picked');
29:      $(this).addClass('picked');
30:    }   
31:}
32:
33:function start(){
34:    // Bind all li
35:    $('.ThinListTable li').bind('click', mouseHandler);
36:}
37:
38:$(document).ready(start);
39:</script>
40:

Update: Changed the link to the example page. Moved it on the server.

Jun 9, 2010

All Things iPhone 4

Engadget has a great summary of all things iPhone 4.

The improved display and better battery life are the real draws for me. The better cameras are nice too. I will be getting one, but probably not right away, a few weeks or months after release.

Jun 8, 2010

Is Twitter Really All That Great?

I ran across this article today on Digg: Bye Bye Birdie: Why Twitter is On the Outs. It makes some interesting points to go along with interesting statistics. Only 3% of twitter users have 100 or more followers.

For all its flaws, Facebook does a much better job of connecting me to people I actually know.I have used Twitter now for about 6 months, I am beginning to agree with the article, what is the point?  Unless you are already famous, there does not seem to be much of a point to the service. How is anyone going to find you in the endless sea of tweets?

Direct TV Bricked All their DVRs?

Did Direct TV Brick all their DVRs last night?  That appears to be the case. A lot of people are reporting the DVRs no longer work this morning.

The suggested fix. Unplug your DVR for 15 seconds. Plug back in. Unplug for 15 seconds. Plug back in.

I have tried this twice and it did not work for me. My DVR appears to be a boat anchor now. Folks on twitter are reporting that it worked for them. Someone in their software group is in big trouble this morning. :)

Update: If the above does not work for you, hit the red reset button twice, or reset your DVR twice in 30 minutes. Once I hit the reset button, I could turn on my DVR with the button on the front of the machine. But the DVR still did not respond to the remote after I turned it off again. After the second reset, all seems to be good.

Jun 2, 2010

Steve Jobs at D8 Conference

PC World has this story summarizing what Steve Jobs had to say at the D8 conference in New York. Also with links to his actual answer. Very interesting stuff.

Jun 1, 2010

Java Wrong Name Error when Running a class

Duke Waving
Problem: You have compiled a class from a source file in a package. For example:
javac mypackage\MyClass.java

The class compiles fine. But when you go to run it you get an error.
java mypackage\Myclass

results in:
Exception in thread "main" java.lang.NoClassDefFoundError: Myclass(wrong name: mypackage/MyClass)

Solution: You can not use a backslash in a Java class path. Instead you need to use a forward slash.
java mypackage/Myclass

Better yet, as a best practice, always use a dot to specify the class name. This avoids the slash issue altogether.
java mypackage.Myclass

That should solve any future runtime errors for classes in a package.