Monthly Archives: February 2008

Use Unix Commands in Windows’ Built-In Command Prompt [Command Line]Lifehacker

Lifehacker reader Michael writes in with a nifty tip that was lurking in our comments all along, but deserves to see the bright light of posting. If you’re already using the Unix-like Cygwin, it’s an easy hack to embed Cygwin’s commands into your standard Windows comand prompt; if not, it might be worth checking out the free download. The instructions follow after the jump.

These instructions are for Windows Vista, but fairly similar to the process in Windows XP (check out an XP-specific environment variable tutorial for more clarification.) The steps:

  1. Find out where your Cygwin installation is on your hard drive and copy the path to its bin subfolder (usually C:Cygwinbin).
  2. Open the Control Panel, hit “System and Maintenance,” then “System,” then “Advanced System Settings” on the left.
  3. Click the “Environment Variables” button at the bottom of the new window.
  4. Scroll through the “System Variables” list at the bottom of this window until you find the line for “Path,” then select it and hit “Edit.”
  5. Add a semi-colon to the end of the “Variable Value” line (if it’s not there), then add the path to Cygwin’s bin directory. Hit OK on this and any windows opened along the way.

Now you’ve got better directory listing capabilities with “ls,” can SSH into a remote server right from the Windows prompt, and (if you’re a dual-booter or Unix/Linux enthusiast) avoid all those annoying confusions with Windows commands.

Firefox Quick Tip: How to Delete Items from Address Bar HistoryLifeSpy

Firefox Address Bar

One funny thing I’ve seen while attending a corporate presentation is have one guy try to access a website typing a few letters and have the address bar history refer him to the porn sites he had visited. Imagine the embarrassment of that guy and the crazy looks everyone had. But whether it’s hiding traces of your “deeds” over the Net, it’s always a good thing to clean your Address Bar history.


SHOPNOTES: Micro-Adjust Your Router Table FenceWoodworking Tips Blog

My router table fence is an accurate, reliable part of my router table. My only gripe was how difficult it was to make fine adjustments. So I came up with a simple solution that doesn’t take a lot of time or material. To see how it works, click the following link:

Continue reading “SHOPNOTES: Micro-Adjust Your Router Table Fence”

Sharpen a Fore PlaneWoodworking Magazine

The fore plane is a traditional English tool used to get rough boards fairly flat
so that you can then make them really flat with a jointer plane and ready to finish
with a smoothing plane, scrapers and (sometimes) sandpaper.

Fore planes are supposed to be about 14″ to 18″ long. If you want to use an old metal
plane as a fore plane, a No. 5 jack plane or No. 6 fore plane would be a good choice.
I use a Hock Tools A2-steel replacement blade
in my fore plane. A2 is a little harder to sharpen for me, but this modern steel takes
a heck of a beating before it gives up, so it’s perfect for a fore plane. I also have
a couple wooden-bodied fore planes that are nice because their light weight makes
them less tiring to use.

Fore planes are supposed to have a curved cutting edge and are used directly across
and diagonal to the grain of your board. Most people understand the idea of working
across the grain (it allows you to take a deeper cut without tear-out). But many people
are flummoxed by sharpening the curve on the edge. In fact, I’ve had about a half
dozen readers send me their irons and ask me to do it for them.

Because I don’t want to open a sharpening service, here is how I grind and hone the
curved edge of a fore plane’s iron. It’s a simple process. And if you take your time
the first time you do it, I know that you will succeed.

This week I noticed that the edge of my metal fore plane was chipped up and the tool
was getting quite hard to push. It was time to grind and hone a fresh edge. The first
thing to do is mark the shape of the curve on the iron so I can replicate that shape.
I use a curve that is an 8″ radius. I’ve experimented with lots of curves between
10″ and 6″ radii. I like 8″.

I have a wooden template that is the same width as my iron and has the curve shaped
on one end. I place the template on flat face of the iron and mark the curve with
an “extra fine” point Sharpie.

Place the template on your iron and trace its edge on your iron. A thin, consistent
line is best.

Then I go to my grinder to remove all the nasty chipped-up metal. I keep my grinder’s
stock tool rest set to always grind a 25° bevel. I don’t futz around with the tool
rest. The first thing to do is to grind away the excess metal right up to your marked
curve. This is done with the iron at 90° to the stone. I just balance the iron on
the tool rest and go to town.

Grinding at 90° to the stone removes metal quickly to the shape you want and it creates
a small flat on the edge of your iron. This is a good thing. The flat helps prevent
your steel from overheating while you grind away the bevel at 25°. Thin steel heats
up really quickly.

Hold the iron 90° to the wheel and show the edge to the iron. Remove all the steel
right up to your Sharpie line. The first time you do this, take your time. It gets
easy real quick.

When you get to the Sharpie line, put the iron flat on your tool rest and start grinding
the bevel until the flat spot on the end is almost – repeat almost – gone. You remove
the last little whisker of the flat on the sharpening stones.

Start by showing the middle of the iron to the grinder wheel. You’ll feel when the
bevel is flat on the stone. Then sweep the iron right to grind up to the left corner.
Try to keep the bevel in full contact with the wheel the entire time. Then repeat
this process and sweep left.

Continue to grind and watch the flat shrink. Don’t use a lot of pressure when applying
the iron to the wheel or you will cook your edge (it will get black).

Show the center of the iron to the wheel and sweep left or right. Here I’m sweeping
right to grind to the left corner.

Here is my completed edge, ready for honing.

Here is the flat left on the tip of that edge. The reflection makes it look bigger
than it really is. It’s a little less than 1/64″.

You can then hone the edge freehand. The edge doesn’t have to be perfect because the
fore plane never produces a finished surface. However, you can use your cheap little
side-clamp honing guide to help you (and your edge will look a lot sweeter, as well).

Put the iron in your honing guide and set the iron to hone a 30° secondary bevel.
Place the iron on your coarse stone (#1,000-grit or coarser if you’ve got it). Put
finger pressure hard on one corner of the iron and press that to the stone. Pull the
guide toward you and shift your pressure to the other corner. This will feel awkward
at first. But eventually you’ll rock it smoothly and naturally.

Repeat this process by starting with all your finger pressure on the other corner.
If you are doing this correctly you should see an X-shape appear on your stone. Then
it’s just like sharpening any tool.

Rock the edge back and forth as you move the jig. This might look hard. It’s not.
It also tends to shape the wheel of your honing guide into a slight barrel shape –
which is a good thing.

Remove the flat bit on the end of the iron – you’ll know it’s gone when you can feel
a burr on the other face of the iron. Then move up the grits until you run out of
grits or patience.

Now reassemble your chipbreaker and your plane. Sight down the sole of the plane and
tweak the lateral-adjustment lever until the curve of the iron is in the center of
the sole. This is easy to see.

When you are done sharpening you should have a nice even secondary bevel.

Then work directly across the grain of a board. Increase the projection of the iron
until you are removing material quickly and can easily push the plane. The shavings
should be thick – I shoot for 1/32″-thick with most woods.

You can probably take a larger shaving in a softwood, but I usually poop out if
I try to take a shaving thicker than 1/32″ – but yet, that’s a lot of material for
one stroke of a plane.

The fore plane is really useful for me, even though I have a nice powered planing
machine. It allows me to remove material in a localized area with ease or to peel
the edge off a rough board faster than my jointer (because I can work only the high
spots). And it allows me to flatten boards and panels that are too wide for my jointer
and planer.   

— Christopher Schwarz

LinkedIn Style Themes for the AjaxControlToolkit Tab Container ControlMatt Berseth

Here are a couple more themes for the AjaxControlToolkit’s Tab control based on the tabs found on Below the screen shots are a few bullet points discussing how I created them. If tab theming is new for you – it might be helpful to check out these other samples as well …

As usual, here are the links for the demo and download …

Live Demo (IE6, IE7, FF, Opera 9.26) | Download (.Net 3.5 and AJCT 3.5.11119.0)


Tab Header Images

Different images are used all three tab states: {Default, Hover, Active}. Each tab is made up of 2 images, the left edge and the tab body plus the right edge. Because a the three states are rolled into 2 images, no flicker occurs during a roll-over because the hover state images have already been loaded. Here are the 2 images used for the blue themed tab.

Shifting the Tab Header to the Right

The Toolkit’s demo page for the Tab control has the tab header left aligned. If you would rather have the header strip shifted slightly to the right (like I have done for this sample), it can easily be done with a stylesheet. Just specify a left margin for the .ajax__tab_header class like I have done below.


Can I Apply Different Background Images to Different Headers?

The LinkedIn page has different header images applied to different tabs within the same container. I was curious if something like this could be done with the Toolkit’s Tabs control. I wanted it to look something like this …


I was hoping the CssClass attribute on the TabPanel class could be used to accomplish this (highlighted in the screen shot below), but it looks like this attribute is never rendered. So I guess the answer is No, not at this time (Someone please let me know if I am wrong).


Ok, The Tab Headers Look Nice, What About the Tab Body?

I was thinking the same thing, having just a box around the content area of the tab doesn’t always look so great. So for this sample, I included some rounded corners to see if that helped spruce up the content area. I think it does.

That’s it. Enjoy!

Latency Bubbles follow up

Following on from the latency bubbles in your IO posting. I have been asked two questions about this post privately:

  1. How can you map those long numbers in the output into readable entries, eg sd0.
  2. How can I confirm that disksort has been turned off?

The first one just requires another glob of D:

# #pragma D option quiet #define SD_TO_DEVINFO(un) ((struct dev_info *)((un)->un_sd->sd_dev)) #define DEV_NAME(un)         stringof(`devnamesp[SD_TO_DEVINFO(un)->devi_major].dn_name) /* ` */ #define DEV_INST(un) (SD_TO_DEVINFO(un)->devi_instance) fbt:ssd:ssdstrategy:entry, fbt:sd:sdstrategy:entry {         bstart[(struct buf *)arg0] = timestamp; }  fbt:ssd:ssdintr:entry, fbt:sd:sdintr:entry / arg0 != 0 / {         this->buf = (struct buf *)((struct scsi_pkt *)arg0)->pkt_private; } fbt:ssd:ssdintr:entry, fbt:sd:sdintr:entry / this->buf / {           this->priv = (struct sd_xbuf *) this->buf->b_private; } fbt:ssd:ssdintr:entry, fbt:sd:sdintr:entry / this->priv / {              this->un = this->priv->xb_un; } fbt:ssd:ssdintr:entry, fbt:sd:sdintr:entry / this->buf && bstart[this->buf] && this->un / {          @l[DEV_NAME(this->un), DEV_INST(this->un)] =                  lquantize((timestamp - bstart[this->buf])/1000000, 0,                  60000, 60000);          @q[DEV_NAME(this->un), DEV_INST(this->un)] =                  quantize((timestamp - bstart[this->buf])/1000000);                  bstart[this->buf] = 0; }

The second required a little bit of mdb. Yes you can also get the same from dtrace mdb gives the the immediate answer, firstly for all the disks that use the sd driver and then for instance 1:

 # echo '*sd_state::walk softstate | ::print -at "struct sd_lun" un_f_disksort_disabled' | mdb -k 300000ad46b unsigned un_f_disksort_disabled = 0 60000e23f2b unsigned un_f_disksort_disabled = 0 # echo '*sd_state::softstate 1 | ::print -at "struct sd_lun" un_f_disksort_disabled' | mdb -k 300000ad46b unsigned un_f_disksort_disabled = 0

Phoenix DIY 5 – this Thursday!MAKE Magazine


Hey DIYers in Phoenix! We’re having our fifth meeting this Thursday at 7pm at Conspire Gallery in downtown Phoenix. Presentations will be given on DIY earthenware stoves and Google Sketchup! More info – Link.

[Read this article] [Comment on this article]

Building a LinkedIn Style Address Book with the ListView and LinqDataSource ControlsMatt Berseth

LinkedIn has a nice looking address book widget that displays all of your connections partitioned by last name. To the left of the contact listing is an index that allows you to jump right to a section. This control isn’t overly fancy, but I was curious what HTML/CSS/JavaScript was used to create it. So I took it apart using the IE Developer Toolbar and rebuilt it using ASP.NET 3.5 – making use primarily of LINQ to XML, the LinqDataSource and a couple of ListView’s. Feel free to browse the source code by following the download link. And, of course I recommend checking out the live demo as well. If you are interested in how I created the sample, a quick description of the implementation details can be found just below the screen shot. And the best part – excluding the CSS, only 115 lines of markup/code are required to build this sample.

Live Demo (IE6, IE7, FF, Opera 9.24) | Download (.NET 3.5)

Creating the LinqDataSource

The demo makes use of a single LinqDataSource that feeds all three ListView controls found on the page. This datasource returns a record for each of the letters of the alphabet – {A, B, … Z}. Additionally, each of these 26 records contains a collection of all of the contacts whose last name starts with the current letter. If no contacts have last names starting with a given letter, an empty collection is returned. The table below shows this structure – notice the empty Contacts collection for letters ‘C’ and ‘Z’.

First Letter of Last Name Contacts
FirstName LastName
Syed Abbas
Francois Ajenstat
Alberts Amy
FirstName LastName
David Bradley
Kevin Brown
Eric Brown
FirstName LastName
FirstName LastName

To generate this structure, I use LINQ to extract the contact records from an XML file and join them by the first letter of their last name to an in-memory character array that contains all of the letters in the alphabet. After these structures are joined together, I select out the attributes required to build the interface. The resulting structure is similar to one that could have been created by grouping the contacts by the first letter of their last name. I used the join instead because I want to make sure I include all letters – even those that do not have any associated contacts (I use all of the letters to build the index piece of the address book).


This LINQ query is wired to a LinqDataSource by placing the code into the datasources Selecting event handler.


Contact Listing ListView

After the datasource was created, I moved on to adding the ListView that will generate the listing of contacts for the address book. The core portion of the address book displays contacts grouped by last name. I used two ListViews to generate an OL structure for grouping the contacts. Each of the LI elements within the OL contains a TABLE element that has a row for each contact within the current group. Before the TABLE element is a H2 element that contains the heading for the current group. The screen shot below shows how this general structure would be applied to elements listed in the table above.

The outer ListView binds directly to the LinqDataSource we previously created. This outer ListView generates the grouping information contained within the outer OL element. Within the ItemTemplate of this ListView is another nested ListView that binds to the Employees property and generates the nested TABLE that contains items for each of the contacts within the current group.


Contact Index ListView

Next, I went ahead and created the markup structure for generating the contact index. If a letter in the index (like Z or C) does not have any associated contacts, I still want to render the letter. If there are associated contacts, I want to render an anchor element that will scroll the page automatically to the contacts for the selected index. Again, I used the ListView to create a OL/LI structure for these items. If a letter doesn’t have any associated contacts, I render the letter within a SPAN. Otherwise, I render an anchor element and set the href to the ID of the grouping header element I created using the previous ListView.


Some CSS Trickery

The most complex part of the addressbook widget is the CSS that controls how the index and grouping headers are aligned – both accomplish this by making use of negative margins. The index DIV floats left and has a negative margin set, making sure it displays to the left of the addressbook container.


The 2px solid line that appears before each grouping of contacts is actually the top border of the table (the table is shifted up by setting the top margin to a negative value). It is shifted up just enough that it aligns with the middle of the H2 element above it.


That’s it. Enjoy!

Европейский суд решит судьбу британской базы ДНК НОВОСТИ, 26.02.2008

Европейский суд может принять решение, которое повлечет за собой уничтожение 560 тысяч образцов ДНК из британской национальной базы генетических данных. Два человека, которые подозревались в преступлениях, но не были осуждены, подали иск в Страсбург с требованием удалить их ДНК из общей базы.

How to view code that is covered by the IntelliSense pop-up.NET Tip of The

When working in Visual Studio 2008 and the IntelliSense pop-up is visible, but you would like to view the code that is covered by it, press and hold the Ctrl key, and the pop-up becomes transparent so that you can view the code that is below the pop-up.

WP Like Button Plugin by Free WordPress Templates