Monthly Archives: November 2009

FireFound Tracks Your Stolen Computer, Nukes Your Personal Data [Downloads]

Firefox: The worst thing about losing your laptop isn’t the cost of replacing your gear; it’s the loss of personal info and saved passwords. Firefox extension FireFound tracks your lost laptop’s location and nukes your personal data in a few clicks.

Once you install the add-on for Firefox or its mobile version Fennec, FireFound uses geolocation to track where you are every time you open your browser, sending that information to a secure server (or your own server, if you prefer.) If your laptop is ever lost or stolen, log into FireFound's web site from any computer and find out where your laptop's being used—handy information to pass on to the cops, though not necessarily info that'll get your laptop back. You can also choose to nuke the personal data in your browser, including history and saved passwords, to protect if from prying eyes until you get your computer back.

FireFound lets you tweak several settings according to what level of security you desire, including the option to receive email notifications if your computer is used more than a certain number of miles from its last location. The data protection feature instantly annihilates some or all of the personal information contained in your browser if someone can’t provide a password to use it.

We’ve seen a fair amount of similar tools for Windows users on a whole in the past (see our laptop thief-proofing guide for more details), but FireFound is the first Firefox-specific version we’ve seen, and it’s got some solid features of its own.

Keep in mind that none of these tools are guaranteed to keep your data safe or recover your hardware, and remember that your best bet to safeguarding your data is encrypting your data. What other steps do you take to protect your laptop’s data besides securing your browser? Talk about it in the comments.

Ed. note: Incidentally, FireFound also just won the Extend Firefox contest, for which both Gina and Adam served as judges.






The Quick Cyber Monday Link List [Cyber Monday]

Those deal-conscious guys and gals at Gizmodo have rounded up the links to the major sales on Cyber Monday, the day when you don’t need to stay up all night to surf and buy from the comforts of your browser.

Amazon, New Egg, Dell, and many more stores are doing the Cyber Monday thing, and Giz recommends checking out Logic Buy to see how deep that “sale” you’re seeing really is. [Gizmodo]






WPF: Changing ProgressBar Appearance As Values Change

 

Introduction
In this earlier blog, I looked at how to create a non-rectangular ProgressBar. As the next step, I want to look at how you can change properties dynamically as the current Value of the ProgressBar changes.

I'll start with the easy (and fairly realistic) scenario where you want to tone down the ProgressBar once it has reached its maximum value.

Currently the ProgressBar coloring looks like this:

If you want to apply changes to the look of the ProgressBar as it is running, you can use a DataTrigger in XAML or you can simply use the ValueChanged event of the ProgressBar in the code-behind. I say "simply", but you do in fact have to understand how to dig into the ControlTemplate and drill down in order to make the code-behind approach work.

There's a trade-off between these two approaches – DataTrigger or code-behind. DataTrigger offers a slightly more concise syntax, but only as long as your requirements are very basic. Once you step beyond the absolute basics, the XAML becomes quite complex. And as you are no doubt more familiar with VB, what's the point in struggling just to prove the point that it can be created in XAML? Sometimes, common sense has to win over technical ego.

Overall, in most cases, code-behind is the easiest answer. But just to be sure you know what a DataTrigger is and how it works, let's run through it.

DataTrigger
A DataTrigger is fired (and as a result some predefined change happens) when a value is reached. In the scenario we are looking at here, a DataTrigger could be set to fire when the Value property of a ProgressBar reaches its maximum. So in the case of the ProgressBar defined below that would of course be when it reaches 100.  

    <ProgressBar x:Name="CurvyPB" Width="300" Height="60"

       Template="{StaticResource PBCurvy}"

       Foreground="{StaticResource BlueGreenRed}"

       Minimum="0" Maximum="100" /> 

The 'predefined change' might be to alter the color of the outside edge of the control and also to dim its Opacity, so that it can be more easily ignored now that its work is done.

The DataTrigger sits in a Triggers collection in the ControlTemplate for the ProgressBar. The syntax is as follows: 

      <ControlTemplate.Triggers>

        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}"

                    Value="100">

          <Setter TargetName="PART_Track" Property="Stroke" Value="DarkGray" />

          <Setter TargetName="PART_Track" Property="Opacity" Value="0.3" />

        </DataTrigger>

      </ControlTemplate.Triggers> 

(Note that this is only one section of the complete ControlTemplate.)

The DataTrigger Binding looks awkward and is one of those rather peculiar constructs that makes XAML hard to decipher (and create) sometimes. Essentially it translates to :
"Keep checking the Value property of the ProgressBar instance that is using this ControlTemplate. If and when it reaches a Value of 100, fire the trigger."

The Setters both target the Path named 'PART_Track'. The first changes the Stroke to DarkGray and the second one turns down the Opacity of that Path (which effectively reduces the Opacity of the templated ProgressBar).

Here is the full XAML for the Window which contains the ControlTemplate and the ProgressBar instance: 

<Window x:Class="CurvyWithTriggers"

   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   xmlns:converter="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna"  

   Title="Curved ProgressBar" Height="200" Width="400">

  <Window.Resources>

    <ControlTemplate x:Key="PBCurvy" TargetType="{x:Type ProgressBar}">

      <Grid>

        <Path x:Name="PART_Track"

             Stroke="{StaticResource BlueGreenRed}"

             StrokeThickness="5"

             Data="F1 M46.802502,0.50000018 C59.803562,0.50000006 71.553123,3.7052743 79.942001,

              8.9014616 C88.330879,3.7052746 100.08044,0.5 113.0815,0.50000018 C125.92575,

              0.5 137.54851,3.6284194 145.9305,8.6908474 C154.3125,3.6284194 165.93524,

              0.50000006 178.7795,0.50000018 C204.35167,0.5 225.082,12.900593 225.082,

              28.1975 C225.082,43.494408 204.35167,55.895 178.7795,55.895 C165.93524,

              55.895 154.3125,52.766582 145.9305,47.704151 C137.54851,52.766582 125.92575,

              55.895 113.0815,55.895 C100.08044,55.895 88.330879,52.689728 79.942001,

              47.493538 C71.553123,52.689728 59.803562,55.895 46.802502,55.895 21.230335,

              55.895 0.5,43.494408 0.5,28.1975 0.5,12.900593 21.230335,0.5 46.802502,

              0.50000018 z"

             Stretch="Fill">

          <Path.Fill>

            <MultiBinding>

              <MultiBinding.Converter>

                <converter:ProgressBarBrushConverter />

 

              </MultiBinding.Converter>

              <Binding Path="Foreground" RelativeSource="{RelativeSource TemplatedParent}" />

              <Binding Path="IsIndeterminate" RelativeSource="{RelativeSource TemplatedParent}" />

              <Binding Path="ActualWidth" ElementName="PART_Indicator" />

              <Binding Path="ActualHeight" ElementName="PART_Indicator" />

              <Binding Path="ActualWidth" ElementName="PART_Track" />

 

            </MultiBinding>

          </Path.Fill>

        </Path>

        <Decorator x:Name="PART_Indicator" />

       </Grid>

 

      <ControlTemplate.Triggers>

        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}"

                    Value="100">

          <Setter TargetName="PART_Track" Property="Stroke" Value="DarkGray" />

          <Setter TargetName="PART_Track" Property="Opacity" Value="0.3" />

        </DataTrigger>

      </ControlTemplate.Triggers>

    </ControlTemplate>

 

  </Window.Resources>

  <Grid>

    <ProgressBar x:Name="CurvyPB" Width="300" Height="60"

       Template="{StaticResource PBCurvy}"

       Foreground="{StaticResource BlueGreenRed}"

       Minimum="0" Maximum="100" />

 

  </Grid>

</Window> 

This markup in the Application.xaml file creates the LinearGradientBrush: 

    <Application.Resources>

    <LinearGradientBrush x:Key="BlueGreenRed"

       EndPoint="1,0.5" StartPoint="0,0.5">

      <GradientStop Color="#FF2D3ADD" Offset="0"/>

      <GradientStop Color="#FFF13E14" Offset="1"/>

      <GradientStop Color="#FF9775D8" Offset="0.192"/>

      <GradientStop Color="#FF3F893B" Offset="0.481"/>

      <GradientStop Color="#FF2B9518" Offset="0.625"/>

      <GradientStop Color="#FECC7638" Offset="0.812"/>

    </LinearGradientBrush>

  </Application.Resources> 

The code-behind to animate the ProgressBar: 

Imports System.Windows.Media.Animation

 

Partial Public Class CurvyWithTriggers

 

    Private Sub CurvyWithTriggers_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

        Dim a As New DoubleAnimation

        a.From = 0

        a.To = 100

        a.Duration = New TimeSpan(0, 0, 8)

 

        CurvyPB.BeginAnimation(ProgressBar.ValueProperty, a)

    End Sub

End Class 

Apologies if you already have all that code and markup from the previous blog. Personally I hate it when someone says "I've used the same code as in my earlier blog", which means I then have to go and find that blog, dig through it and find the missing bits before I can test out what I'm working on now. So I much prefer to repeat it and make life easier for you, at the expense of a slightly longer blog entry.

After the ProgressBar completes its mission, it hits that Value of 100 and the look changes to this:

So if you're sat there saying to yourself that there's nothing there that you couldn't have easily done in code-behind, I almost agree with you. Certainly the Opacity change would be easy: 

        If progressBar1.Value = 100 Then

            progressBar1.Opacity = 0.3

        End If 

But what about changing the value of the Stroke property though? The ProgressBar doesn't have a Stroke property. That's tucked away inside the ControlTemplate and is a property of the Path named PART_Track. To get to that, we will need a way to access the ControlTemplate and then drill down into the Path.

Before we look at the code-behind approach, I just want to mention a problem with DataTriggers, especially as they relate to ProgressBars. The only arithmetic operator available to you in the DataTrigger in XAML is the equals operator. For fairly obvious reasons, the less-than and greater-then operator symbols have the potential to cause problems in a language that uses them as element delimiters.

The reason that this is a particular problem with the ProgressBar is that the algorithm that breaks the ProgressBar movement into its time chunks will rarely, if ever, space them across whole numbers. That is to say if the Minimum Value is 0 and the Maximum Value is 100 and the duration is 10 seconds, you might reasonably suppose that each new block will appear at intervals of 0, 10, 20, 30, etc. However it doesn't work that way and the values are more likely to be something like :
0
0.252538
0.299015
0.613981
: etc
: ending with
99.769844
99.890324
100

This makes it impossible for you to set a DataTrigger on a value that you can be certain will be matched exactly, except for the starting and ending values of 0 and 100. In theory, you could tweak the size settings of the PART_Track and PART_Indicator to ensure whole number partitions (these being the key factors in the breakdown), but none of my experimenting with this approach worked. An alternative approach, which I haven't tried, would be to create a ValueConverter which would then allow you to set value parameters, such as < 20 or > 40 and so on. However, I didn't really see any gain in going that route, as I can use the ValueChanged event of the ProgressBar directly, together with a bit of WPF delving, as we will now see.

FindResource and FindName
When you need to get at a ControlTemplate (or other Resource, for that matter), you can use the FindResource method of the FrameworkElement class. Before, I get into that, I am going to make two changes to the markup in the Window.
The first change is to add a Name property to the Window, placing this inside the opening tag of the Window class markup:  

 x:Name="CurvyValueChangedWindow" 

This is necessary in order for the Window to be accessed from the code-behind.

The second change is purely decorative – changing the Stroke property of the PART_Track path from the LinearGradientBrush to plain Yellow.  

        <Path x:Name="PART_Track"

             Stroke="Yellow" 

 The ProgressBar now looks like this at startup:

To locate that ControlTemplate, I use the following code, which I have placed in the ValueChanged event of the ProgressBar: 

        Dim ct As New ControlTemplate()

        Try

            ct = CType(CurvyValueChangedWindow.FindResource("PBCurvy"), ControlTemplate)

 

        Catch Ex As ResourceReferenceKeyNotFoundException

            '  Design time message

            Console.WriteLine("CT Not found")

            '  Quit gracefully if not found

            Exit Sub

        End Try 

The third line does all the work and you will see now why I added a name to the WPF Window. This Name is used to identify the container in which the Resource named PBCurvy (i.e. the ControlTemplate) should be found.
Note also that if due to a typo or other error the Resource can't be found, then no further action will be taken. At this stage, the Catch is superfluous. It is however important to avoid the application crashing as we move on to the next step.

FindName
So now we have got ourselves a reference to the ControlTemplate, but we still need to drill down into the Path named PART_Track which is a sub-element of that template. To do this, you can use the following code, placing it immediately below the code used to find the ControlTemplate resource:  

        Dim p As New Path

        p = CType(ct.FindName("PART_Track", PBCurvy), Path)

 

        If IsNothing(p) Then

            Console.WriteLine("Path Not found")

            Exit Sub

        End If 

This time the FindName function searches through that ControlTemplate (now referenced as 'ct') in order to find the named Path.
Once again, the test for IsNothing isn't necessary at this stage, because we have not yet tried to do anything with the Path variable 'p'. As before though, when we add further code, this checkpoint – and the Exit Sub if the Path isn't found – are important.

Changing The values
We've now reached the point where we can manipulate values of that Path according to the current values of the ProgressBar. This code placed immediately below the previous snippet will change the color and thickness of the Stroke: 

        Select Case PBCurvy.Value

            Case Is < 25

                p.Stroke = New SolidColorBrush(Colors.Yellow)

                p.StrokeThickness = 5

            Case 25 To 49

                p.Stroke = New SolidColorBrush(Colors.Green)

                p.StrokeThickness = 7

            Case 50 To 75

                p.Stroke = New SolidColorBrush(Colors.Orange)

                p.StrokeThickness = 9

            Case 76 To 99

                p.Stroke = New SolidColorBrush(Colors.Red)

                p.StrokeThickness = 11

            Case Else

                p.Stroke = New SolidColorBrush(Colors.DarkGray)

        End Select 

When you run the application, the colors will change as things progress:  

 

 I have chosen to make those particular changes for demo purposes, but you are of course not limited to those. The key take away points in this blog are the availability of the DataTrigger and the use of the very helpful FindResource and FindName methods when you want to trigger a change via the code-behind.

Reinforcing the Indestructible

The other day I was finishing up the Stickley
music cabinet
that will be featured in the February issue of Popular Woodworking.
One of the final tasks was to peg the through-mortise-and-tenon joints that hold the
case together. Glen Huey was in the shop, getting a good start on the Shaker
Stepback Cupboard
. It was nice to have company as I split and formed the pegs.



Good dowels can be hard (if not impossible) to find, so when I need the right size
and the right species, I make my own. It doesn’t take long, and the work is a nice
relief from fussing with other details. I start with a straight-grained piece of scrap
about 3″ long, and split off pieces with a chisel. All it takes is a good rap with
a mallet after I put the chisel in place.



I start by aiming for about 3/8″-square blanks to make 1/4″ dowels. Sometimes the
split will be off course, and the blank is made smaller by laying it down on the bench
and continuing the splitting by placing a wide chisel on the wood and pressing down
or tapping with a mallet. Essentially, this is riving lumber on a small scale. It
doesn’t take long to get the hang of it, and it doesn’t matter if I lose a few in
the process. Split material works much better than sawn for making these short lengths.
The blank is stronger because the grain is continuous throughout the length.



When the blanks are close to the right size, I knock the corners off with the chisel
or by whittling with a knife. I whittle down the end to make it easier to start in
the holes in the dowel plate. The plate is just a 1/4″ thick piece of scrap steel
with a series of holes drilled in it. The holes are in steps of 1/16″ and I didn’t
bother trying to sharpen them. If they get dull I may take a flat file across the
face to create a burr, but this works just fine. If that’s too simple for you, you
can buy a fancy dowel plate or try to harden and hone the thing. To use it, I start
with a large hole and pound the blank through. The first hole or two will knock the
corners off, and the final hole will scrape the entire edge of the dowel.



With a brad-point drill, I drill through the front edge and about 1″ into the tenon.
I put a dab of glue in the hole, and drive the dowel in place. After the glue dries,
I trim it flush with a saw, then pare it down flush with a chisel. A few swipes with
a block plane and it’s finished.


That’s the “how to do it” part. After I had the pegs in place, I took a short break
and when I returned to the shop, Glen asked me about the “why to do it” part. Not
why in the sense of “what does the peg do?” but why in the sense of “why go to that
much trouble to reinforce a joint like that; where is it going to go?”

And I confess that I didn’t have a good answer, except that I was copying an original
detail that does make a statement about building for forever. So I reverted to being
a smart aleck and said, “It’s just in case there’s a disturbance in the earth’s magnetic
field that yanks us out of orbit and sends us toward the sun. On the way to oblivion
it might get hot enough for all the glue to melt and for the wood to shrink enough
to pull out. Other than that, I don’t think you need to do it.”

— Robert W. Lang

Roll Your Own TV Guide With FreeGuide [Downloads]

There are plenty of online TV listing services that detail what programs are showing in your area. Then again, you probably don’t care what’s on every single channel. Create a personalized TV guide with FreeGuide and skip The Flossing Network.

Photo by daveynin.

FreeGuide grabs data on only the channels you’re interested in and displays them in a list or grid format. You enter your region, ZIP code, and time zone while setting up the software, as well as whether you’ll be using a free or paid channel listing guide, and FreeGuide sets up your personalized listing window. You can search for shows by channel, time, title, or sub-title, and highlight favorites so you can find them quickly in listings in the future.

FreeGuide is available as a free download for Windows, Mac OS X, and Linux. It requires at least the Java 2 Runtime Environment v1.6 or higher to work, and Mac users will also need to grab XMLTV

How do you track your favorite TV shows? Let us know in the comments.






How To Paint Laminate Furniture [DIY]

Don’t give up on painting your laminate furniture just because it seems nothing could stick to the glossy laminate surface. Use this simple guide to change it to the color you want.

Laminate furniture is created with wood, almost always a particle board, that is covered with a thin laminate veneer. If you’ve ever dinged the side of a cheap desk or file cabinet with “wood” grain and seen a different kind of wood underneath you’ve seen a piece with a laminate finish.

You can’t just take a gallon of latex paint to it, the adhesion is poor and the surface won’t look right when you’re done. At the craft and design blog Living with Lindsay, they turned an armoire from fake wood laminate to a nice bright white with some elbow grease, 220 grit sand paper, and a liberal application of primer and paint. Check out the link below for photos of the process and some more tips for working with laminate surfaces.

Have a painting trick of your own? Let’s hear it in the comments.






7 Ways to Watch TV Online For Free

Post by David Pierce. Find me on Twitter.

I’m a senior in college, and for the first time since I was about 6, I don’t have cable TV. Who knows why: some combination of cheapness, laziness, and some subconscious desire to actually do productive things sometimes. If you know me, you know that’s a bit of a problem: I have approximately 59 shows I must watch every week always, or people start losing limbs.

Believe it or not, though, I don’t miss cable. Thanks to these seven websites, I can waste every bit as much time watching TV, and never (ever) miss an episode of my favorite shows.

Here’s where I get my fix:

Network Websites

ABC, CBS, NBC and many other networks all have their own websites, where they put up recent episodes of most of their shows. The upside of these sites is that they’re usually the first to have the show, it’s usually great quality, and it’s a decent way to support the shows you like. The downsides: the websites are usually ridiculously slow, and you’ll probably see a lot of ads.

sunny

Hulu

Unless your favorite show is on CBS, it’s probably on Hulu. Hulu’s got deals with most major networks, meaning the shows it has are good quality, and they’re supporting the show and network. Hulu’s also an excellent website, and full of content—it’s where I look first for any show I want to watch.

Fancast

Fancast is a lot like Hulu—except nobody knows about it. It’s a Comcast website, and has a huge number of TV shows and movies for you to watch—including CBS, for some reason. There’s basically no difference between Fancast and Hulu, except the Hulu interface is better and the videos are slightly higher quality. Between the two, odds are great you’re going to find what you’re looking for.

justin

Justin.tv

Justin.tv is tough to navigate, but awesome when you get it working. I can’t tell you a lot about it, because I only really use it for one thing: live sports. Sports were, for a while, the only reason I still had cable, but now I can mostly do without it. When there’s a game on that I can’t get on TV, odds are great that someone’s streaming it on Justin.tv—just search for what you’re looking for, and enjoy!

SideReel

SideReel’s a combination of information, reviews, and discussion about TV shows, all alongside links to episodes. No videos are actually hosted by SideReel—it just keeps links out to tons of shows and movies, including every episode, ever, from a lot of TV shows. It’ll often point you to slow, crappy-looking videos, but it’s as complete a database as I’ve found, and works great in  a pinch, even offering links to buy from Amazon or iTunes if you’re really in need.

Surf The Channel

Surf The Channel’s basically the same as SideReel, except it’s better at letting you pick which site you want to go to, and prioritizing the best ones. If the episode’s available on Hulu, STC will tell you to go there first—it also indexes the network websites and a few others, meaning its got an enormous world to search through for episodes of your favorite shows.

southpark
South Park Studios

South Park Studios does only one thing, and does it mind-blowingly wonderfully: it plays South Park episodes. Every single one. From every season. In all their poorly-drawn glory. I’m just getting into South Park recently, and I can safely say it’s the greatest thing in the history of the universe. No exaggeration.

Where do you watch TV or movies online? Movies, in particular, are harder to find for free—where do you look?

Liked the post? Read more from The 2.0 Life

7 Ways to Watch TV Online For Free

The Snuggie 2.0!

The Snuggie 2.0!

Submitted by: Japanese Blog via Picture is Unrelated Submissions

TouchFreeze Disables Your Touchpad As Soon As You Start Typing [Laptop]

Windows only: Most laptop owners have experienced the frustrations of an unpredictable cursor when your wrist grazes the touchpad. Free, open-source utility TouchFreeze disables your touchpad as soon as you start typing, re-enables it when you stop.

Photo by AlishaV

Although you can always go to your Control Panel and then to Mouse Properties to disable your touchpad the long way, it still means you have to turn it back on when you’d like to use it. TouchFreeze makes things a little easier, and as long as you’re not doing any heavy photo editing that might necessitate the simultaneous use of the touch pad and keys, this should be a winner of a program for you.

TouchFreeze sits in your system tray and simply turns off the touchpad when you start typing. It’s a dead simple, free, and open-source program that works with Windows 2000, Windows XP, Windows Vista, Windows Server 2003/2008, Windows Server 2008, and Windows 7.






HandBrake Updates to 0.9.4 with Over 1,000 Changes, 64-Bit Support [Downloads]

Windows/Mac/Linux: If you ever have to rip DVDs to your desktop or convert video, you know how awesome open-source encoder HandBrake is. Well, it’s just been updated with over 1,000 changes since the last release, including 64-bit support.

The 64-bit support is probably the most notable change in this build, as it allows you to encode videos about 10% faster than the 32-bit builds—in a lot of cases, bringing encoding up to real-time or faster. And, note that Mac users don't need Snow Leopard to see this improvement, long as they have a 64-bit capable machine (Intel Core 2 Duo or later). Linux users will also be able to reap the benefits of the 64-bit build; unfortunately at this point there doesn't appear to be a 64-bit version for Windows users.

Other changes include soft subtitles (it rips subtitles that you can turn on or off), a live preview mode (so you don't waste your time encoding only to find you had a setting wrong), constant quality encoding (for better quality video and no need for 2-pass encoding), and some cleaning up of the settings. It looks like there are no more presets for PSP, PS3, or Xbox 360, just one "Normal" setting that, in theory, will work with anything that supports Main Profile H.264. Also, AVI, OGG/OGM and XviD encoding have been removed from the program—the HandBrake team has apparently decided to focus on H.264 encoding and get rid of old codecs.

HandBrake is a free, open source download.






WP Like Button Plugin by Free WordPress Templates