Skip to main content.
December 28th, 2006

Quick Searches and Answers

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but you may still find them useful.

Norton Ghost Free Trial (15 Days)
Here I am answering two questions. Where do I find the free trial for Norton Ghost 10? (The link above). It’s not obvious on their website. And what are the limitations of the free trial? 15 days and it has the disc cloning feature disabled!

Please, For the Love of All That’s Recoverable, Shred Your Hard Drive! - O’Reilly Sysadmin
Easily shred (safely randomize) your old hard drive using Knoppix before you sell it or throw it out. I like this article because it’s very easy to follow the instructions.

Long Titles | Firefox Add-ons | Mozilla Corporation
Have you ever noticed that you can’t read long title tags in Firefox? Those tool-tip like things that pop up when you hover over some images. Well this extension claims to fix it for you. I was excited.

Tim Golden’s Python Stuff: Catch system-wide hotkeys
This could be useful for catching hot keys in a Python app.

How to Make a Screensaver in Python
This module really works. I put together a screensaver in an hour (well really just a Python wrapper around an existing screen saver so I could get another program launched when the screensaver is called .. long story actually…

Basic anatomy of a Windows screensaver
Screensaver executables (.scr files) can run in two modes, the configuration mode and the screensaver mode. The mode is set by a command-line argument of either -c (for configuration) or -s (for screensaver). If there is no argument, the configuration dia

Tags: , , , , , , , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Uncategorized at 4:30 AM MST

Comments Off

December 23rd, 2006

Quick Searches and Answers

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but you may still find them useful.

Tutorial: Monitoring global input with pyHook
You can intercept keystrokes before the Windows apps get them! There’s got to be a use for this!

WordPress mime-config Plugin
Use this WordPress plugin to get WordPress to allow you to upload fun file types like *.gz, *.py, etc. I haven’t tried it yet though, but people are saying it works. I.e., this should fix the WordPress error: File type does not meet security guidelines

Defeat Traffic Light Cams with an Ambiguous Vanity Plate
It might be worth a try. I wonder what 1l1lll1 will look like on my truck?

How to Get a Vanity Plate in Maryland
It’s $25/year … might be worth a shot

ASPN : Python Cookbook : Speech recognition in Windows using the MS Speech API
This is an example of using the Microsoft Speech SDK 5.1 under Windows for command and control speech recognition in Python. Perhaps this would be a good way to add some fun voice controls to a Windows app. I suppose there’s nothing similar for Linux :-(

Table Sorting, Filtering, Etc from JavascriptToolbox.com
This looks like a robust javascript library for sorting tables. It’s much faster than the one I’m using (sortable, next link) however I can’t tell if this is as easy to implement as sortable where I simply include it in the html.

sorttable: Make all your tables sortable
This is the javascript library I currently use to sort tables. It works well and it’s easy to implement.

NewClassVsClassicClass - PythonInfo Wiki
So this is what a “new style class” in Python is. Looks like I might as well start using them …
That’s class Greg(object): instead of class Greg:

Tags: , , , , , , , , , , , , , , , , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Uncategorized at 4:30 AM MST

Comments Off

December 22nd, 2006

How to Send F6 with Only a Number Pad (Stupid Python Tricks)

This little script will detect when you hit certain number pad numbers and send the specified function keys on to Windows instead:

import win32com.client
import pythoncom
import pyHook # http://sourceforge.net/projects/uncassist

def translate_keystrokes(event):
    if event.Key=='Numpad6': #Next in Screen Saver
        print 'You hit numpad 6!'
        shell.SendKeys("{F7}")
        return False #blocks keystroke
    elif event.Key=='Numpad4': #Previous in Screen Saver
        print 'You hit numpad 4!'
        shell.SendKeys("{F6}")
        return False #blocks keystroke
    else:
        return True #Key stroke continues to Windows apps  

#object to let us send keystrokes
shell = win32com.client.Dispatch("WScript.Shell")
# create a hook manager
hm = pyHook.HookManager()
# watch for all keyboard events
hm.KeyDown = translate_keystrokes
# set the hook
hm.HookKeyboard()
# wait forever
pythoncom.PumpMessages()

Why on earth would I want to do this?
Well, this lets me control a screensaver application with a $10 number pad so that the laptop controlling the display can be tucked away out of site. The alternative was to buy this $80 programmable keypad. (If you hadn’t guessed, the screen saver inflexibly requires F6 to move to the next page.)

To make this little script I followed the pyHook examples here. And figured out how to send keystrokes here.

Finally this page gives you a run down on what WScript.Shell does. And this project looks like another promising alternative for sending keystrokes.

Posted by Greg Pinero (Primary Searcher) as GUI Automation, win32, Python at 6:34 PM MST

2 Comments »

December 21st, 2006

Python - Getting the Number of Days in a Month

The built-in calendar module gives you this useful list:

>>> calendar.mdays
[0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

As an example of using it, here I get the number of days in the current month:

>>> import calendar
>>> import datetime
>>> calendar.mdays[datetime.date.today().month]
31

BTW this would also tell you the last day of a month.

Fine Print:

I’m not sure how this handles leap years. Perhaps mdays is for the current year? In any case, if you want something more robust you could try this:
[0]+[calendar.monthrange(year,month)[1] for year in [2006] for month in range(1,13)]
in place of calendar.mdays since you provide it with the year to use.

Found that idea in the comments here.

Posted by Greg Pinero (Primary Searcher) as Python at 11:57 AM MST

3 Comments »

December 20th, 2006

Quick Searches and Answers

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but you may still find them useful.

What Product Should I Get?
It only has a few product types so far, but it has the potential to save hours of research when trying to buy a large ticket item.

The Trick to Getting Debug to Work in Pydev (Eclipse Python IDE)
You have to set a break point in your code before running debug! This page will walk you through your whole first program in pydev.

How to take backup copies of DVDs on Linux | Dizwell Informatics
An excellent writeup of the hardest possible way to backup a DVD in Linux. But if all else fails (K9Copy, etc), this may be your last resort.

DVD9 -> DVD5 using lxdvdrip HOWTO - Ubuntu Forums
Another convoluted, difficult way to backup DVDs on Linux. But again as a last resort you may want to give it a shot.

Using Very Latest K9copy on Ubuntu
Follow these instructions to install the latest version of K9copy from source. This is beta2 for tonight. So far it’s working…

Create your Google Sitemap Online - XML Sitemaps
This is useful for creating a quick Google sitemap for a small website. It works as advertised. My theory is that sitemaps do affect Google search rankings … just a hunch though.

Tags: , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Uncategorized at 1:24 AM MST

Comments Off

« Previous Entries