Router Jigs for a Craftsman Bookcase

In the current issue of Popular
Woodworking
magazine (August 2008), Senior Editor Robert W. Lang used two jigs
on the bookcase shelves to cut the dados and to create the twin mortises for shelves’
through tenons.

The first jig, shown in “Router Jigs Part 1,” walks through making a dado jig to accomodate
any shelf thickness. Bob uses a straight router bit with a top-mount bearing to cut
the dados. You can use the steps shown to produce a perfect fit for any dado joint,
regardless of shelf thickness.

The second jig, shown in “Router Jigs Part 2,” is quite innovative in how it’s built.
Bob uses several pieces of 1/2″-thick Baltic birch plywood and a pin nailer to construct
this jig. From there, he’s just a drill and router away from a simple tenon-routing
setup. This is a great technique!

Enjoy!

—Glen D. Huey

Router Jigs Part 1

Router Jigs Part 2

Episode 55 – Tablesaw Setup/Tuneup (Pt. 1)

Download Low Resolution
Download High Resolution

Our tools are no good to us if they aren’t tuned up properly. As the “heart” of the workshop, its crucial that our tablesaws are configured to perform their best. So whether you are setting up a new saw, or tuning up your current one, this video guide will get you where you need to be. Part 1 covers three different methods for aligning the miter slot to the blade as well as a simple technique for attaching and leveling the extension wings.

I am sure you will also notice that this is a new sexy tablesaw. For those who are curious, it is a PM Custom from the folks at Wood Werks Supply. And even a big fancy saw still requires a good bit of setup and tweaking.

***The following clip was cut from the original video. Since the topic of table saw flatness came up in the comments, I decided to throw the clip out there as bonus footage. Enjoy.

Rewriting the TextBoxWatermarkExtender as an ASP.NET AJAX Plugin

I couldn’t help but continue exploring the ASP.NET AJAX JavaScript component topic I wrote about yesterday. So this afternoon I picked one of the simplest AjaxControlToolkit extender controls, the TextBoxWatermarkExtender, and rewrote it using the plugin approach I wrote about yesterday. Again, I am very happy with how it turned out. Read on for the details and don’t forget to check out the live demo and download links as well.

Live Demo | Download

image

Step 1: Find an existing jQuery watermark plugin in that does what I want

So I googled a bit and ended up following a link here. This looked like exactly what I wanted so I downloaded the JavaScript and took a look at it. And I was very happy to see that it was incredibly simple – only ~20 lines of code. The script uses some selectors to identify the textbox elements on the page. Once the elements are identified it wires up the focus, blur and click to some JavaScript handlers that add or remove the watermark based on the current value of the element.

Here the script is in all of its glory …

$(document).ready(function(){
  $("input:text, textarea, input:password").each(function(){
    if(this.value == '')
    this.value = this.title;
  });
  $("input:text, textarea, input:password").focus(function(){
    if(this.value == this.title)
    this.value = '';
  });
  $("input:text, textarea, input:password").blur(function(){
    if(this.value == '')
    this.value = this.title;
  });
  $("input:image, input:button, input:submit").click(function(){
    $(this.form.elements).each(function(){
      if(this.type =='text' || this.type =='textarea' || this.type =='password' ){
        if(this.value == this.title && this.title != ''){
          this.value='';
        }
      }
    });
  });
});

Step 2: Rearrange the code so it fits into an ASP.NET AJAX JavaScript based Component

So I implemented a very simple Sys.Component JavaScript object that uses the getElementsByClassName function to pull out all of the input elements with the watermark CSS class applied to them. The jQuery version extracts the elements by tag names, but I thought this might be grabbing elements I don’t want to apply the watermark to so I chose to use a css class instead.

To do this I setup my majax.watermark Component to handle the Sys.Application.load event. When this event fires I grab all of the elements that have the watermark class applied to them and apply the watermark logic to them as follows:

  • If the element doesn’t currently have a value, set the value to the title attribute and add the watermark CSS class to the element
  • When the focus event for the element fires check to see if the value is the same as the title. If it is remove the watermark text and as well as the watermark CSS class
  • When the blur event fires check to see if the value is empty. If it is reapply the title value and add the watermark CSS class back
apply : function(e) {
    //  if the field is empty, show the watermark
    if(e.value == '') {
        e.value = e.title;
        Sys.UI.DomElement.addCssClass(e, 'watermark');
    }
    //  when the field has focus hide the watermark
    $addHandler(e, 'focus', function(){
        if(e.value == e.title) {
            e.value = '';
            Sys.UI.DomElement.removeCssClass(e, 'watermark');
        }
    });
    //  when the field loses focus and the
    //  input is empty, show the watermark
    $addHandler(e, 'blur', function(){
        if(e.value == '') {
            e.value = e.title;
            Sys.UI.DomElement.addCssClass(e, 'watermark');
        }
    });
}

Step 3: Add the Script References to your Page

After the watermark plugin component is written all we have to do to use it is let the ScriptManager know about it like so …

image

And of course make sure the scripts have been saved to the appropriate file paths on the web server …

image

And finally, just set the ToolTip and CssClass attributes for all of the ASP.NET TextBox controls that should have the watermark applied to them …

<asp:TextBox ID="TextBox1" runat="server" CssClass="watermark" ToolTip="First Name" />
<br />
<br />
<asp:TextBox ID="TextBox2" runat="server" CssClass="watermark" ToolTip="Password" TextMode="Password" />
<br />
<br />
<asp:TextBox ID="TextBox3" runat="server" CssClass="watermark" ToolTip="Example Text" TextMode="MultiLine" />
<br />
<br />

Step 4: Enjoy!

image

Conclusion

Well I am pretty much sold on this as a potential plugin pattern for getting some of the jQuery goodness into ASP.NET AJAX. What about you?

That’s it. Enjoy!

ASP.NET AJAX: Creating Reusable JavaScript Components (that are not Controls)

So I have been working with ASP.NET AJAX and the Toolkit for about a year and a half total – give or take a few months. Over this period I have played around with building a handful of AJAX controls …

… and I am generally happy with how each one of these turned out. However I have learned over time that a new control extender or script control is not always the right fit for the job.

Take the problem Mustafa was solving the other day …

I have recently figured out that if there is a scrollbar’ed Panel control inside an UpdatePanel, it looses its scrollbar position after any type of partial postback within that UpdatePanel. There can be a GridView, a DIV container or another similar control instead of this Panel.

Mustafa generously provides a solution to the problem. He describes a technique he is using for hooking into the PageRequestManager’s beginRequest and endRequest events to tuck away the scroll bar position before the partial page is reloaded. He then reapplies the scroll position after the panel has been refreshed. I look at the code he provides for this and I am thinking – Yep, that looks great. I want it.

image

And I want that on every page except I don’t want to copy/paste everywhere and I don’t want to have to edit the JavaScript every time I add a new panel to the page. The thing is, solving this problem via a reusable solution is a little tricky. We could create an extender control that would hook onto the Panel’s using the TargetControlID, but that seems a little heavy when all we have is a touch of JavaScript. And besides the direct reference to Panel1′s ClientID in Mustafa’s solution – the script is completely reusable. So I did a little reading up on some of ASP.NET AJAX’s client side components to see if there was anything I could use to pull this code together into some sort of non-visual component that I could re-use across pages that wouldn’t require me to write any server side code.

Hello Sys.Component

And that is when I came across this bit of documentation

image

This sounded promising so I decided I would try to refactor the original JavaScript into a Sys.Component and see where it takes me. So I moved Mustafa’s original code into a Sys.Component class called majax.MaintainScrollPosition. Within the Components initialize function I grab a reference to the PageRequestManager object and wire handlers to the pageLoading and pageLoaded events. When pageLoading fires (this happens after the async-postback has completed but before the DOM is rewritten with the resulting data) I tuck away the scroll positions of the elements I am interested in and when pageLoaded is invoked I look up those elements again and set the scroll positions to what it was before the async-postback fired. Here is the bit of JavaScript I am using to handle this …

onPageLoading : function(sender, args) {
    // get a list of the panels that are going to
    // be updated
    var updatedPanels = args.get_panelsUpdating();
    if(updatedPanels && updatedPanels.length > 0){
        // clear the array
        Array.clear(this._elements); 
        // find all elements with the 
        // and remember the scroll position 
        for(var i = 0; i < updatedPanels.length; i++) {
            Array.forEach($majax.getElementsByClassName('maintain-scroll', null, updatedPanels[i]),
            function(e){
                if(e.id) {
                    Array.add(this._elements, { "id":e.id, "x": e.scrollLeft, "y":e.scrollTop });
                }
            }, this); 
        }
    }
},
 
onPageLoaded : function(sender, args) {
     var updatedPanels = args.get_panelsUpdated();
    if(updatedPanels && updatedPanels.length > 0){
        // find all elements with the 
        // and remember the scroll position 
        for(var i = 0; i < updatedPanels.length; i++) {
            Array.forEach(this._elements, function(e){
                var element = $get(e.id, updatedPanels[i]);
                if(element) {
                    element.scrollLeft = e.x;
                    element.scrollTop = e.y;
                }
            }, this);
        }
    } 
}

getElementsByClassName

The one thing you should notice with the onPageLoading function is that I am maintaining the scroll position for all HTML elements that have the maintain-scroll class applied to them. To fetch these elements I am using a helper function called getElementsByClassName (taken from here) that scans the panel to find all of the elements that have this maintain-scroll class applied to them. This approach is different from the typical extender control that extends a single control that it knows the ID of.

So for my demo page, I have a DIV contained within an UpdatePanel with a fixed width/height, and have enough content that scroll bars are being applied. To let my component know that we want it to maintain the scroll position of this DIV across partial postbacks all we have to do is tag the DIV with the maintain-scroll class like so …

image

And to get my majax.MaintainScrollPosition script loaded I let the ScriptManager on the page know about my scripts and it will take care of the rest (the reference to majax.js is the script that contains the getElementsByClassName function. I planned on putting other common scripts in this file as well).

image

These Path references are pointers to the location on the webserver where my scripts reside.

image

Is this a one-off Solution or is it something more General?

After creating the component that maintains the scroll position, I started wondering if this was a pattern that could be applied a little more broadly. One of the first Toolkit controls I created extended a GridView control and added a bunch of cool row and column hovering effects. And after I got it build just the way I wanted .Net 3.5 came out and I fell head over heals for the new ListView control. And while I could still use my original extender control, it would take a little more work (i.e. explicit calls to $create for each of the tables I want to apply the behaviors to). So I quick like moved my old TABLE hover behavior script into this new patter to see how it fit. So I …

  • Created a new Sys.Component JavaScript class that uses the getElementsByClassName function to fetch all TABLE’s on the page that are tagged with the tablehover class
  • After these TABLE’s are located I use the $create function to apply my hover behavior to the control
  • Add a reference to my script to the ScriptManager control

image

  • Updated my GridView to include the tablehover CSS class

image

And the coolest part is that without any code changes I can render the same grid using the ListView control as well …

image

And they both work exactly the same.

Finally, The Demo’s

The demo page for this post contains 2 sections. The first one demonstrates how the majax.MaintainScrollPosition can be used to persist the scroll position of elements between async postbacks. You can move the scroll bar around, then click the post back button. This will cause the panel to refresh and because this panel has Mustafa’s script tied to it – the original scroll position will be restored.

image

And the second demo shows how to use the majax.TableHover script with both the GridView and ListView controls. Just hover over any of the table’s cells and you will see how it works.

image

And you can download the sample site here.

Conclusion

I am kind of impressed with how this is looking so far. I like that …

  • I can easily apply the same behavior to elements that match a CSS selector. This is nothing new to the wider JavaScript community, but to those of us using ASP.NET AJAX and the Toolkit it certainly is.
  • If I don’t need to interact with the control from the server I don’t need to go through the process of building a server side piece for the component
  • I thought it was cool how I could easily apply the same behavior to both a GridView as well as an HTML table rendered by the ListView without changing a single line of code
  • I can hook into the PageRequestManager and attach to the ASP.NET AJAX client side life cycle events from within the Component

All of that being said, I spent a total of 3 hours putting this together stream-of-consciousness style, so odds are that I am missing something huge or that none of this is really all that useful to anyone but me. Either way, leave a comment and let me know what you think.

That’s it. Enjoy!

Controlling Input/Output of Device Drivers

Hands-on tutorial for monitoring and configuring I/O for network device drivers at the Kernel level.

Creating a Simple Dashboard using the TabContainer and ListView Controls

As a user, I am a fan of dashboard pages.  Many data centric web applications have these as landing pages (I know the one I am currently building does).  These pages usually display a high-level summary of the data the application is managing for the user.  A few weeks ago when I was playing around with some Google Analytic style skins I tried combining the AjaxControlToolkit’s TabContainer control with a simple ListView rendered data table to see if I could mimic some of the dashboard controls that google uses.  I thought it turned out pretty well so I figured I would write a quick post …

For my example app I created a Sales Dashboard control that displays sales figures for all of the sales people in some fictional company.  The dashboard has three different tabs, each provides a different view of the same data.  For my example, the only different in the queries that fill these grids is the order by clause (SalesYTD desc, SalesLastYear desc, Projected desc), but clearly these queries could be as simple or as complex as needed. 

After configuring the ListView to render the grids, I then gave each of the tabs a title that reflected the data the tab is displaying.  Here is what it looks like …

image

And of course – here are links to download the code and browse the live demo – Live Demo (IE6, IE7, FF, Opera) | Download

There really isn't much for implementation details for this one because I didn't really hit any snags or gotchas that are worth mentioning.  But if you download the code and run into something that looks puzzling, I would recommend checking out my ListView and TabContainer archive pages for additional information.

That's it.  Enjoy!

Building a Bookcase Part IV

In this episode we look at attaching a fixed shelf by two different methods: Biscuit Joinery and with a Stopped Dado Joint.

Next, we look at different ways to reinforce our shelves so they won’t sag under the weight that’s put on them. We also talk about a cool program that can calculate for you, based on information you put in, whether your shelves are strong enough to support what you intend to put on them.

Finally, we look at how to cut the rabbit joints into the side pieces for the back to fit into so you end up with a nice, clean looking fit.

Thanks so much for watching, we hope you enjoy!

And as always, if you have any questions, or want more information, go to our website:

www.WoodworkersResource.com

Craig Stevens

Xen Virtualization with Novell SUSE Linux Enterprise Server 10 on HP ProLiant servers

Virtualization has become the buzz word of the industry, with people looking at consolidation of multiple servers onto a single server. Many reasons for consolidation come to mind, including cost reduction, better utilization of hardware, and better control of resources. This document will look at virtualization using Xen, Novell’s implementation of Xen within SUSE Linux Enterprise Server 10, and implementation on HP ProLiant servers.

Bob’s Bench-A Decent First Week

I’ve started on the bench, spending as much time in the shop as I could spare, and
after a week and a day, it looks like I’m making good progress. The shop is messy,
but there are now piles of parts where a stack of rough lumber used to be. I’ve probably
spent about 25 hours actually working on it, it gets hard to keep track when I have
to stop and take photos or shoot video. Here is a link to some previous posts showing
what I’m up to: Previous
Blog Posts
. And here in a moment of neatness is where I was last Friday morning.



At the bottom of the pile are the two glued up slabs that will comprise the top, and
the stack on top is destined to become legs, rails and stretchers. Even though milling
rough lumber takes some effort, one of my favorite parts of any project is hitting
this point. I tend to fuss over the rough milling, because if my parts will form a
nice neat stack, it means they are straight and square. And if they’re straight and
square, every step that follows will be considerable easier.


One of the purposes for building this bench, and documenting it on the blog and on
video is to show that a good bench can be built with a minimal amount of machines,
space, experience and skill. I’ve set up a space in a corner of the shop with a 6-inch
joiner, a twelve-inch lunchbox planer, and a 1-3/4 horsepower hybrid table saw. This
is a pretty basic setup, and although at times I’ve pushed the machines close to their
limits, they’ve been up to the task so far. I designed this bench to work around these
tools, matching parts and subassemblies to their limitations. So if you’ve been putting
off building a bench until you have a massive table saw, an aircraft carrier size
jointer, and a planer the size of a house trailer, find another excuse and get to
work.



After rough cutting the 8/4 material to manageable sizes, I milled all the individual
pieces, then for the top, glued them together in pairs. Each glued up pair took another
trip over the jointer and through the planer. Three pairs were then glued together
to make each 3″ thick, 12″ wide and 8-foot long top section. Because these parts were
all carefully made, the final assembly went smoothly. I put two straight pieces of
material the long way across my horses, and then laid square pieces across them at
about 12-inch intervals. This gave me a level platform for gluing, and stock this
size doesn’t want to twist or bend.



One of the other myths to dispel about building a bench is that “You need a bench
to build a bench”. Now that I have the tops together, I have a better work surface
than I’ve ever had, and there’s no reason not to put them to work. Here’s a photo
from around lunchtime Friday as I work on the mortises for the leg assemblies.

–Bob Lang

My DebugBar | IETester / HomePage

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8 beta 1, IE7 IE 6 and IE5.5 on Vista and XP, as well as the installed IE in the same process.

WP Like Button Plugin by Free WordPress Templates