Okay. It has been a long time now that I have needed to learn EMacs. So I have created a task for myself to learn one new thing about EMacs every day. So while this might be a repeating simple and stupid tasks, I have decided to log them down into a tag collection so that later on I can review them for enhancing and memory.
Currently I am using Carbon Emacs on my mac book pro. So far I have not used it much but in the past couple of days, I have been forcing myself to get out of my patterns and into something new.
The tags I will be using to cover all of the things I learn on the way will be "lessons emacs".
Hopefully, I can keep all this in my head!
I had to find some files for processing and wanted to find the latest file by modification date. So here is what I came up with:
Dir.glob("c:/path/to/files/*.*").sort_by {|f| File.mtime(f) }.reverse[0..7]
Explanation:
Dir.glob("c:/path/to/files/*.*")
grab the entries in the specified directory
.sort_by
pass the entries into the block for sorting
F.mtime(f)
sort by modification time
.reverse[0..7]
reverse the list and show 0 to 7 entries (which comes out to 8 entries)
Posted via email from my prime directive
To make a QR code with Google charts, set your img src tag to something like this:
src="http://chart.apis.google.com/chart?cht=qr&chl=http://9thport.net&chs=120x120" alt="www.9thport.net"

Today I got an error message of "microsoft visual c++ runtime library: runtime error ..." when attempting to run Adobe Dreamweaver CS4. This is horrible!! Here is a screen show showing what I got:

my dreamweaver cs4 windows error
My method for fixing this error on Windows XP was to do move the following directory into my Recycle Bin:
- c:\Documents and Settings\[username]\Application Data\Adobe\Dreamweaver CS4
Note: The "Application Data" folder is hidden and you might need to do the following:
- Choose menu "Tools"
- Choose menu item "Folder Options"
- Choose tab "View"
- Enable "Show hidden files and folders"
- Click "OK"
After removing the directory, launching Dreamweaver worked! I was also surprised that I did not loose any of my site settings.
I found that all my bash scripts really bennifet with the following template because:
- it handles options with possible responses of needs
- debugging with a flag
- help description of the script
This template keeps proving to be enough to start my script building. There is really nothing more to say about this so here is my template:
#!/usr/bin/env bash
# created at: Wed Apr 04 10:03:41 PDT 2009
# updated at: Wed Apr 22 15:33:24 PDT 2009
# author: aaron addleman
# manage subversion with swatch and ftp log file. all actions will be sent to a file for throttling purposes to allow SVN to handle its own lock files
# BEGIN SCRIPT
usage()
{
cat << EOF
usage: $0 options
This script takes commands from a swatch and converts to svn commands for a directory under version control.
OPTIONS:
-h Show this message
-a Action needed (STOR, DELE, MKD, ENTRIES, SVNUPDATE)
-u Username to use for commits
-f File or directory being affected
-m message to use
-x Execute SVN commands from the $SVNACTIONS file
(when this option is used, all others are ignored)
-v Verbose (boolean)
-t Test (dont run any commands, but print them to the command line)
EOF
}
ACTION=
USER=
FILE=
MESSAGE=
VERBOSE=
TEST=
while getopts "h a:u:f:m:x:v:t" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
a)
ACTION=$OPTARG
;;
u)
USER=$OPTARG
;;
f)
FILE=$OPTARG
;;
m)
MESSAGE=$OPTARG
;;
v)
VERBOSE=1
;;
t)
TEST=1
;;
?)
usage
exit
;;
esac
done