Monthly Archives: March 2008

First Look at Ubuntu 8.04 “Hardy Heron” Beta [Screenshot Tour]Lifehacker


Every six months when a new version of Ubuntu Linux gets released, long-time users and curious toe-dippers ask the same questions: “What’s new?”; “Is it worth upgrading?”; and, “Will my wireless card finally work with this version?” Having grabbed the newest beta release of Ubuntu and spent a few hours looking around, I can answer, “A few great things,” “Yes, once it’s officially released,” and, well, “Hopefully.” Version 8.04, or “Hardy Heron,” is more a compilation of stable-ish features and proven apps than a showcase for the latest and greatest in Linux technology. But for those seeking a usable, steady system in which to get things done, that’s a real killer app in itself. Follow through the jump to see what’s new, and what just works (and doesn’t) in Hardy Heron.

If there’s one area where the latest version of the GNOME-based Ubuntu distro has made great strides, it’s in installation. Pop a live CD into your drive before you boot up, and you no longer see a confusing “Start or Install Ubuntu” option; instead, newcomers will see more descriptive choices, like “Try Ubuntu without any change to your computer” and a straight-up “Install Ubuntu” that doesn’t bother loading the whole desktop, just the install prompts.

Even better is the inclusion of a boot prompt and launcher for the wubi installer, which appears when you pop the Ubuntu CD in while Windows is running. Wubi lets you create an installation of Ubuntu inside a Windows system without having to mess with partitions, boot managers, or anything of the sort, by creating a virtual device you can choose to boot into just before Windows starts up. It's great for those who want to give Ubuntu a real test run—installing apps, tweaking settings, the whole nine yards—instead of waiting for a live CD to boot.

install2.jpgThose running 7.10, or “Gusty Gibbon,” should have a (relatively) smooth upgrade process to the beta or the final version of 8.04. Those starting over with a clean partition will see the same installation prompts we’ve had for a year or two now (minus a cool-but-not-quite-helpful zooming time zone selector). I’m still waiting to see a bit more hand-holding in the partition-and-format process to open the system up to less savvy users.

Once you arrive at your new desktop, you’ll notice the basic orange/brown/yellow scheme is only slightly tweaked; the default wallpaper is nifty and a few icons and colors have been swapped, but the major theme overhaul has been held off until 8.10, arriving in October. Click the screen below for a bigger view:

While Hardy only got a touch-up paint job, each of its three software engines—the Linux kernel, the GNOME desktop environment, and the Xorg graphics handler—got an actual upgrade. The kernel chages include better power management for 64-bit processors and (supposedly) better performance in multitasking. Xorg, the not-fun-to-configure graphics manager, gets more monitor and video card compatibility, along with a GUI tool to change the resolution and rotation of an external monitor or projector on the fly.

The biggest desktop changes aren't actually new, at least to anyone who's touched a Mac or Windows system before, but they're very welcome—the ability to pause, undo, or cancel multiple file operations, and restore files from the trash to their original positions. Heron also promises a "significant performance boost." I'm hoping the hiccups and delays on file transfers I encountered in Hardy are just some of the bugs that get worked out between now and the mid-April launch.

Onto the cool new stuff. The Hardy beta comes with Firefox 3 Beta 4 loaded, and it’s already customized with GNOME-ish buttons and better overall theme integration. Plus, the in-browser forms, buttons, and text boxes already look polished and smooth, eliminating the need for a common Linux-only hack.

Transmission is a welcome upgrade from the previous default BitTorrent client, granting encryption, selected-file downloading, and throttling abilities, but I kind of wish it looked as nice as its Mac cousin. It gets the job done, however.

Hardy introduces a graphical VPN client, Vinagre, to supplement the command-line xvncviewer, and it’s a smart move. Vinagre makes connecting to single or multiple machines easy, and lets you bookmark and search your network for VNC servers if you can’t quite remember the IP address you need.

Another tool long missing from Ubuntu (and Linux distros in general) is an easy-to-configure firewall. It doesn’t get much more simple than ufw, or the Uncomplicated Firewall, which runs from the command line but doesn’t require much to get started or set up. Starting ufw and making it persistent takes just two commands, but you can later poke as many holes into it as you need.

Here’s a few more notable new and interesting changes in Hardy:

  • PulseAudio integration: A well-received universal sound driver that should eliminate a lot of confusion about OSS vs. Alsa vs. ESD, and on and on …
  • Brasero by default: Replaces the minimalist, built-in audio and data CD/DVD burning program in the Nautilus file browser.
  • PDF support for Inkscape: Gives the scalable vector graphics editor better integration and convenience for printing and sharing with other apps.
  • International times & weather: Keep track of the time and conditions in custom locations around the world.
  • Better memory protection: Security changes should prevent malicious code from attacking via unchecked kernel bugs and low-level memory.

That’s it, at least while testers and developers are working out bugs and other issues. Got a feature or change you think Ubuntu still needs to really make it the Linux distro that “just works?” Happy as can be with the beta you tried out over the weekend? Share your experiences in the comments.

Kevin Purdy, associate editor at Lifehacker, is still waiting for an Ubuntu his dear old dad can use—but feels like it's getting closer. His weekly feature, Open Sourcery, usually appears on Fridays on Lifehacker (except when a new Ubuntu beta release appears over a weekend).




Download Files to Favorite Folders with FavLoc [Featured Firefox Extension]Lifehacker


Windows/Mac/Linux (Firefox): You can always customize where you want files you grab in Firefox to end up, but a catch-all “Downloads” folder, or just a desktop, often ends up seriously cluttered. Free Firefox extension FavLoc lets you set pre-defined locations where you’ll likely place files and send them there directly from your right-click menu. For dual-booters like myself, it’s really handy, as you can see above, but it’s also useful for sorting the images, pictures, programs, and all the other downloads any avid browser ends up grabbing. FavLoc is a free download, and works wherever Firefox does.




Start Your Small Business [Entrepreneurship]Lifehacker

Thinking about taking the plunge into entrepreneurship? The Small Biz Survival Guide offers a collection of checklists for starting your first business.




Jailbreak Any iPhone or iPod Touch in 45 Seconds [Feature]Lifehacker


If you’ve been waiting for Apple to officially open the iPhone and iPod touch for development, you may have been disappointed to find out that you won’t get third-party applications until June. That means that if you’ve been aching for those killer third-party apps already available to folks with jailbroken iPhones or iPod touches, you’ve still got a few more months of waiting to go. However, by downloading and running one simple application, you could be up and running with a jailbroken iPhone or iPod touch in just under a minute. Sound appealing? Here’s how it works.

The Special Sauce is ZiPhone

The application that does all the heavy lifting for you is a free, open source, cross-platform application called ZiPhone, and it can do everything from quick and simple iPhone and iPod touch jailbreaks to unlocking the iPhone for unofficial carriers (i.e., not AT&T). I'm going to cover the very basic jailbreaking of the iPhone and iPod touch, but the process is the same no matter what device you're jailbreaking and what level of unlocking you want.

When you’re done using ZiPhone you’ll be running a jailbroken iPhone or iPod touch with the latest 1.1.4 firmware. Since using ZiPhone is so simple, the purpose of this post is more to demonstrate just how easy it is to jailbreak and run those third-party apps until Apple finally gives its official, official blessing in June.

Prepare Your iPhone or iPod touch for Jailbreak

First, let's talk preparation. If you're working with a fresh, up-to-date device, there's really nothing to it—you're ready to proceed to the next step. If you've already jailbroken your phone once before—especially a 1.1.3 iPhone jailbreak using one of the older methods—then you should restore your iPhone or iPod touch to the latest factory firmware (1.1.4) before continuing. When you restore, tell iTunes that want to set up the restored iPhone as a new phone rather than restoring the settings from the previously jailbroken phone. (I can't speak for the iPod touch on this front, but the first time I used ZiPhone on my previously jailbroken iPhone without taking this step, the jailbreak resulted in some bugs.)

Now that you’re working with a fresh device, it’s time to move on to the easy part: jailbreaking.

Jailbreak Your iPhone or iPod touch in Under a Minute

Now head to the ZiPhone blog and click through on the “Click here to Download ZiPhone” link to grab the latest Windows or Mac version.

http://lifehacker.com/assets/resources/2008/03/ziphone-win1-thumb.pngzipone-mac1.pngOnce you download ZiPhone, you’re ready to go. When you run the application, you’ll see a window like the one of the two images to the left. (The first one is the Windows version, the second is the Mac version. Click the image for a larger view.)

The simple jailbreaks (that is, the ones that don’t unlock your iPhone for other cell phone carriers) are pointed out in the screenshot.

ziphone-success.pngQuit iTunes. (This may not be strictly necessary, but it’s a good practice.) Choose the option that applies to you: iPod touch jailbreak or iPhone jailbreak. ZiPhone will cycle your device into recovery mode, perform the jailbreak, and in 45 seconds your iPhone or iPod touch will be officially and completely jailbroken.

jailbroken-home.pngNow you can go through iTunes, set up, and sync the device just as you would if it were fresh out of the box. (Just remember not to restore your old settings if you were using a 1.1.3 jailbroken iPhone.) When you head to your home screen for the first time, you'll notice two new icons: the Installer.app icon—which is the application that allows you to install the best iPhone apps currently available—and a web clip icon that will take you to the ZiPhone homepage (which you can remove if you don't want it).

Should I Jailbreak with ZiPhone if I’ve Already Jailbroken?

If you’ve already jailbreakon your iPhone or iPod touch, there’s no hugely compelling reason to do it again with ZiPhone. However, I had been using a 1.1.3 jailbreak on my iPhone prior to jailbreaking with ZiPhone, and the ZiPhone jailbreak did fix the common Google Maps faux-GPS problem. Additionally, it’s always good to run the latest firmware if and when you can, jailbroken or not.


That’s all there is to it. Simple, quick, and effective. If you’ve been dying to run more apps on your iPhone or iPod but the long wait until June is more than you can stomach, jailbreaking your device is easier than ever with ZiPhone. (Okay, maybe not quite as easy as the one-click jailbreak for 1.1.1, but still really easy).

If you’re rocking a ZiPhone jailbroken iPhone or iPod touch or a device you jailbroke using another method, let’s hear more about your experience in the comments.

Adam Pash is a senior editor for Lifehacker who’s not sure he’ll stop jailbreaking his iPhone or iPod even after Apple opens it up, and who likes the iPhone so much he wrote an iPhone book. His special feature Hack Attack appears weekly on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.




Drill Press Table UpgradeWoodworking Online

You can sharpen your woodworking skills with helpful tips and techniques from the editors of Woodsmith and ShopNotes magazines. Get a FREE tip sent to your email address each week! Go to WoodworkingTips.com and sign up today.

Here’s last week’s tip from ShopNotes online editor Phil Huber:

20080313sn-1.jpg
I wanted to add an auxiliary table and fence to my drill press. But I didn’t want to spend a lot of money. So I built the simple drill press table and fence with a replaceable insert you see in the photo above. The fence is adjustable and has a sliding stop.

20080313sn-3.gif
20080313sn-4.gif

Table

20080313sn-2.jpgThe table is two layers of ¾″ plywood that are glued together. A dado on the top side at each end holds T-tracks for attaching the fence. Two bottom-mounted T-tracks attach the table to the drill press, as you can see in detail ‘b’ and the photo at right.

Fence

The fence is nothing more than a length of aluminum angle. A slotted hole at each end accepts a flange bolt from the table so you can quickly mount and adjust the fence to meet almost any drilling challenge.

Stop Block

To help position and hold the workpiece, I added a stop block to the fence. It’s simply a block of wood attached to an aluminum bracket. A knob and T-nut, are used for adjusting the block and securing it in position on the fence (detail ‘a’).

You can find even more ways to upgrade your power tools, just go to: plansnow.com/toolstandplans.html.

Good Woodworking,

Phil Huber
Online Editor, ShopNotes

Send for a preview issue of ShopNotes magazine

Get the Most from Your Rechargeable Batteries [Saving Money]Lifehacker

batt-charger.pngBlogger Jeff Atwood has been rolling with rechargable batteries since the late 90s, and after a bit of research he delves into the finer points of making the most of your rechargeable batteries, from choosing the longest lasting batteries to finding the best types of chargers. In both cases, Atwood highlights the tools that will give you the most bang for your buck. Whether you’re keen on rechargeable batteries but quickly draining batteries have you questioning your rechargeable ways, or you want to start saving money and the environment by switching to rechargeable, this post is a must-read.




Creating a Custom Skin for Silverlight 2′s Button ControlMatt Berseth

For the past couple of weeks I have been reading about Silverlight 2. I have gone through ScottGu’s tutorial, checked out the deep zoom demos (here and here) and even browsed the XAML for some sample control themes. But I haven’t actually tried to build anything myself yet. So I thought I would put together a small sample around Silverlight’s styling and templating features by creating a skin for the Button control that looks somewhat like the a button renders in IE7 on my Vista box. I know that in a way it’s taking a step back (Silverlight’s default Button is really pretty sweet looking), but I didn’t want to be too overwhelmed for my first sample.

The grid below shows what my Button control looks in each of the 4 states the Button supports. If you look close at the Buttons background, you can see it has that nice glassy look that we used to use images for when working with HTML. Besides that bit of flare, the rest of the Button is primarily made up of one of the most basic Silverlight elements – the Rectangle (one for the background, one for the glassy overlay and another for the focus dashed border). In addition to the Rectangles, my custom Button skin is also configured to animate the Button as the user mouses over, clicks or disables the Button. Below are some screen shots of what my custom Button looks like in a few different states.

image

Live Demo | Download (Requires VS 2008 Plus Silverlight 2 Beta 1 Tools)

Customizing the Button’s Control’s Appearance

Before we can start skinning the Button control, we need to understand what the Button’s visual customization points are – this way we can tap into them to control how it renders.

Using in-lined styles

Much like ASP.NET controls, the Buttons appearance can be customized by setting the buttons attributes via the markup. So if you want a blue button, just set the Background attribute to the value Blue.

image

image

Using style elements

That should feel pretty natural for most UI developers. But of course in-lining styles is hard to maintain and gets messy pretty fast. So instead we could move these inline settings to the Resources collection of the Application to encapsulate these settings as a reusable resource – ala CSS. To do this, I have added a Style element to the Application’s nodes Resources collection. Within this Style element, I have set the Background property to Blue as follows …

App.xaml

image

Page.xaml

image

image

Again, this pattern should feel pretty familiar if you are comfortable with CSS. Instead of in-lining styles, you just point to the resource that knows what style elements you want applied.

Completely replacing a control’s visual appearance while still keeping the original behavior

And now to the really cool part. With Silverlight and WPF we can customize just about every aspect of how the Button control renders. ScottGu’s tutorial on using control templates has some pretty interesting examples that show the full flexibility of this technique by embedding a fully functional calendar control within the Buttons content (the screen shot below is from his blog).

image

And along with allowing us to add other shapes and controls to the Button’s template, the Button control also supports hooks that allows us to declaratively specify how our button should look as it as it passes through the following four states: {Normal State, MouseOver State, Pressed State, Disabled State} as well as when the button currently has focus. I found the following description from MSDN especially helpful in explaining this.

When you create a new template for a control, you redefine its visual structure and visual behavior. Is some cases, the code of a control might refer to parts of the control’s ControlTemplate. For example, the code might call a method on an element that is in the template to perform some functionality. This means you must understand how the template and the code relate to each other. That relationship is described by the control contract, which is an agreement between the logical and visual parts of the control. – MSDN

And I think I get this – the code for the control needs to know a little something about the items in the template for it to function properly. If you want the background color to change from red to blue when the button is hovered over, you need to let the Button know. Or when my control currently has focus, the Button can make sure the dashed rectangle shape is displayed. So after learning about these additional customization points I went to the Button control’s Style and Templates page on MSDN where I found a description of the elements and StoryBoard (used for playing animations) the Button control looks for within the ControlTemplate. So if you are creating a template for the Button and want a certain animation played when the Button is hovered over – make sure you include a StoryBoard item within the template with the name MouseOver State. Below is a table that summarizes these additional elements that make up the Button controls public interface.

image

These additional bits of information are call Template Parts in the documentation. And if you go to the MSDN page for the Button control, you will notice these items are specified as part of the documentation for the Button class. I don’t think you would get to far creating a control skin if you don’t understand what Template Parts a control defines.

image

Creating the Shapes that Define the IE Button Skin

And now with some of the background information out of the way, we can start creating our IE button skin.

Step 1: Add the RootElement, background Rectangle and the ContentPresenter

If we look back to the table above, the Button’s ControlTemplate looks for two elements within the control’s template: one with the name RootElement and the other with the name FocusVisualElement. The RootElement is the element that contains all of the visual elements for our control – so this is where we will start. I have used the Grid control for the layout of my Button and the first child contained within the Grid is a Rectangle (with rounded corners natively supported!) that is filled with a light gray color. After the Rectangle I have added a ContentPresenter that handles rendering the content portion of the Button. I have used markup extension syntax to bind the properties of the control to the ContentPresenter (I am still wrapping my head around exactly what a ContentPresenter is and isn’t. When I figure that out well enough so that I can explain it I will no doubt include a post about it).

image

With just this single rectangle, the button displays like this:

image

Step 2: Add the glassy-look by overlaying a semi-transparent Rectangle

Next, I added another Rectangle to the template that sits on top of the Background Rectangle. This second Rectangle is responsible for providing us with the nice glassy effect. To achieve this I added a second Rectangle to the markup (unless I am mistaken, Z-Order is the order in which the items are added. Because the Background Rectangle is added first it will have a lower Z-Order). And instead of adding a semi-transparent image, instead I filled this rectangle with a gradient brush – lighter on the top, darker on the bottom.

image

With the second Rectangle added to the template, the button now displays like this:

image

Step 3: Add the FocusVisualElement Rectangle

Next, I added another Rectangle to the template that handles applying the dashed shape just inside the Buttons border when the button currently has focus. Again, I added this Rectangle after the first two so it has the highest z-order. When the button has focus, a white dashed border is applied to the control. I didn’t find this specifically mentioned in the documentation, but all of the examples for skinning the button had the FocusVisualElement initially set to the Visibility=Collapsed state. I haven’t verified this, but I believe when the Button determines it has focus it updates the Visibility value to Visible causing the dashed Rectangle to be displayed.

image

Step 4: Add a Rectangle that overlays all of the other shapes

Finally, to handle the disabled button state, I have added yet another Rectangle to the very end of the template (giving it the highest z-order). I initially set the Opacity to 0 making it invisible. When the button enters the Disabled State I will use a StoryBoard to update the Opacity value to 1, placing it on top of all of the other Rectangles.

image

Step 5: Use StoryBoards for animating state transitions

The last step in building our IE skin is attaching the animations that will be run as the button passes through the 4 well-known button states mentioned earlier. Here is a quick summary of what actions need to be taken as the Button passes through these states:

MouseOver State
  • Change the color of the Background Rectangle to Blue
image
Pressed State
  • Change the Background Rectangle to Blue
  • Make the gradient Rectangle slightly see through by setting the Opacity to 0.7 (this will make more of the Blue color show through)
  • Thicken up the border
image
Normal State
  • Make the Background Gray,
image
Disabled State
  • Render a grayed out Rectangle over the control
image

If you notice, when the button changes between the various states, I want to update properties on a few of the embedded Rectangles. To achieve this, I have added 4 StoryBoard nodes to my template – a different StoryBoard for each of the Button states. The MouseOver StoryBoard is the simplest one – it runs when the user mouses over the RootElement. This StoryBoard uses the ColorAnimation object to change the Color property of the Brush that fills the Background Rectangle from gray to blue. Here is the markup for this StoryBoard …

image

A few things to notice:

  • The value of the StoryBoard’s Key attribute is MouseOver State. The Button control looks for this item by name, so you will need to enter it just as I have above
  • The Duration of my animation is set to 0:0:0 – meaning this animation happens instantly. If you wanted it to slowly turn blue, you could set this to a small value. Something like 0:0:0.5 would cause it to turn to from gray to blue in 1/2 a second.
  • The ColorAnimation is pointing to the Target named Brush. If you look back to step 1, this is the name of the Brush that fills the Background Rectangle

The rest of the animations follow a similar pattern. The TargetName attribute points to the item I want to animate. And I animate the objects by changing one of their property values (i.e. Opacity, StrokeThickness, Color).

And finally, after all of this work is done, I have moved my new skin to the Resources section of the Application XAML file and used the Style setting to point my buttons towards their lovely new IE skin …

image

And when all of this runs – it looks something like this.

image

Finally, I collapsed all of the elements and resources that make up my custom style so you could get a feel for what it looks like when it is all put together. The complete skin comes to a about 150 lines of markup. Really not too bad considering the flexibility it provides. I haven’t worked with Silverlight too long, but I am already getting the feeling that control skinning is going to be one of my favorite topics.

image

That’s it. Enjoy!

DIY Power distribution

2268244880_6110ae7030.jpg
Chris sent in his homemade controller for an old APC power distribution unit. This is a great way to recycle some old electronics.

I found some ‘flaky’ APC AP9217 PDUs in the trash and grabbed a few to play with. These have 8 power plugs that can be individually toggled which is infinitely useful for cycling the power on anything. As well as documenting how I modified this device this page is meant to serve as a general hardware hacking HOW-TO since it is a pretty easy to follow example.

Make your own Power Distribution Unit

[Read this article] [Comment on this article]

Want to Learn How to Use LINQ? Check out LINQPad!Dan Wahlin’s WebLog

I was catching up with some of the people I follow on Twitter tonight (as a side note, I used to think Twitter was a waste of time but I’m actually finding it useful now days) and noticed that Scott Cate listed a link to a free tool called LINQPad.  Wow…I wish I would've known about this tool a few months back when I was working on different LINQ queries for an application.  It really simplifies building queries and also happens to be a great way to learn the LINQ syntax as well.  It was created by Joseph Albahari for the C# 3.0 in a Nutshell book.

Here's a screenshot from the Website.  You can download LINQPad at www.linqpad.net.  I'm really impressed with it so far. 

On a related note, if you’re interested in seeing how LINQ, Lambdas and LINQ with Stored procedures can be used, you can download the sample ASP.NET 3.5 application I put together that will help get you started with the different options available in .NET 3.5.

Your Best Stain Removal Tricks? [Ask The Readers]Lifehacker

stain.jpgIf you’ve ever had an “oops!” moment and realized you soiled your new clothes or a precious piece of furniture, you no longer have to scour the internet for a remedy while the stain soaks in. The School of Fibre Science and Technology in Australia has a beginner’s list of what home remedies can remove even the nastiest stains. If you have a paint stain, for example, apply turpentine to the area. For tar, the best remedy is a grease solvent. And if you perspire a lot (and don’t want it to show), sponge the area of your shirt with a weak vinegar solution and then wash it according to the fabric instructions. What are your favorite household remedies or resources for stains? Share them in the comments.




WP Like Button Plugin by Free WordPress Templates