Sunday, November 8, 2009

Dell Mini 10v Netbook Running Ubuntu

Overview
A few month ago, I started looking for a small portable computer. I ended up targeting netbook class portable computers. I needed something small and reasonably powerful to allow me to work where ever I happened to be. I also needed something that I could put linux on since that is what I prefer over other operating systems. I ended up getting a Dell Mini 10v netbook for use when traveling.

Specifications
I got the Mini 10v version which is configured as following:
  • Intel® Atom Processor® N270 (1.6GHz/533Mhz FSB/512K cache)
  • 10.1" Widescreen Display (1024x600)
  • 1GB DDR2 SDRAM
  • 120G SATA HD
  • Intel Graphics Media Accelerator (GMA) 950
  • 56WHr Lithium-Ion Battery (6-cell)
  • Ubuntu 8.10 Linux
  • Webcam (1.3 megapixel)
  • 3 USB
  • 1 VGA
  • Headphone/Mic
I got it with the default color case which is black. The only upgrade I got was the battery which was bumped from a 3-cell to a 6-cell.

Aside from that, I picked up a cheap-o portable USB mini mouse at a local computer store since I hate touchpads (only option for the mini) and a Caselogic PLS-9Black Ultra Portable 7-Inch - 10-Inch Laptop Sleeve (Black) So I could safely carry my netbook in a separate compartment from my main laptop.

The unit comes in a very small and tidy box with just the things you need.
  • Netbook
  • Power supply
  • CD with OS and such
  • Small getting started guide
After charging the battery fully, I booted it up. The following are my impressions about the Dell Mini 10v.

Screen
The screen is small. Duh? At 10.1" with 1024x600 resolution, it does not provide much heights to work with. Lets just say, any code I develop on it is even more modular and concise then normal since a page on the mini is shorter then on just about anything else.

For python programming (first job it was tasked with) I had no problems. Emacs is lean and well suited for this computer.

For things like Netbeans, you will want to collapse just about everything except the editor. I have not needed to do heavy programming yet but I suspect it is up to the task.

It does support a VGA output. So far I have not been able to get an extended desktop to work. I can, however, pump all video output to an external monitor or projector. Extended desktop would be a serious advantage for someone who wants to connect this to an external monitor when at home or work.

Image Quality
Fantastic. The screen is bright and clear. I have had no issues reading documentation, code, emails, and blogs using it. I like the 10v screen better then my main Latitude E6500.

Performance
The Intel Atom process does a fine job. It is not very beefy but I have not had noticeable waits. I am not a gamer so I cannot speak for that. For business work and casual Internet work, the performance is just fine.

Ubuntu 8.10
I commend Dell for pre-installing Ubuntu 8.10. It is great that they choose hardware that will work for more then just Windows. Ubuntu 8.10 works well out of the box. It doesn't have any "crap ware" that you usually get with a non-Apple computer. I powered it on, answered a few question and was up and running.

However, I upgraded to 9.04 almost right away since it was more mature. To upgraded, I just downloaded the image and flashed it to a pen drive. After booting and following the base instructions, install was a snap. There were absolutely no issues at all upgrading. All hardware was detected and everything came up perfectly. Even the webcam.

When Ubuntu 9.10 came out, I upgraded that day using the standard Ubuntu network upgrade. Again, no issues. A perfect install/update.

UPDATE (2010-01): I have spoken with a few people who have said that a clean install to 9.10 does not go very smooth. If this is the case, your best bet is to get 9.04 and upgrade to 9.10. It is a little more work but should not cause any issues. Hopefully 10.04 in April 2010 will improve the clean install.

Why not Windows XP? Well, after installing all the extra windows applications + virus scanner, I would be dealing with a pretty sluggish computer. With XP, a real time virus scanner is a must. Especially on a system that is designed to be used for travel.

Overall Linux seems better suited to leaner systems. Plus, it has everything I need to be productive out of the box. Linux is just my personal preference.

Battery
The one upgrade I did for my netbook was to get a bigger battery. The 6-cell is about $35 more and well worth it. On a long flight with my wireless off, I had power for just about the entire time. I was quite surprised actually.

To date, I only use my netbook on battery and the battery life is still very good. The battery life will be less with wireless on but it is still very long for a portable computer.

With the 6-cell battery, there is a long round strip that sticks out the bottom of the netbook. At first I hated this since it put a bulge on the back. I got over it once I realized that it helped keep it cool and put the whole thing at a slight angle for better and easier typing. The sleeve I got stretches to accommodate the bulge from the battery.

Keyboard
For something so small, the keyboard is great. It has the extra windows keys between control and alt that work great with Ubuntu. For me, the feel is very good and I can type fast on it.

For Ubuntu, I suggest going into the CMOS setup of the netbook (accessed when you see the dell logo during boot) and set the function keys (F1-F12) to be function versus multi-media. For me that is a personal preference.

Touchpad
Before I talk about the touchpad, I have to confess, I hate all touchpads. They just don't work for me very well. Especially when I am doing graphical programming.

Of all the touchpads inflicted on me, this is probably one of the worst I have used. Dell made a mistake by mixing the buttons and touchpad area. I can use it but others I have used work better. For me, I don't care since I got a cheap mini-mouse that plugs into a USB port. When the mouse is not plugged in, the touchpad does fine.

I wish it came with an inteli-stick option like the latitude or thinkpad series laptops.

Usability
Even being so small, Dell did a good job balancing the size and usability. I can be productive on this unit. I get the benefit of portability and quick boot up times. The keyboard is great and the screen is clear.

Overall Opinion
I am happy with my Dell Mini 10v. Although I bought it for travel, I find I use it more then I expected. It follows me to meetings at work and around the house.

Pros
  • Great battery life
  • Good quality screen
  • Proper keyboard
  • Runs Ubuntu 8.10, 9.04, 9.10 like a champ
  • UPDATE (2010-12): 10.04 and 10.10 like a champ.
  • 3 USB ports.
Cons
  • Touchpad
  • External VGA out could support extended desktop.
Hope this feedback helps.

Saturday, November 7, 2009

Emacs Configuration .emacs file

Overview
The following is my .emacs file for reference.

.emacs Configuration
;; -*- lisp -*-
;;
;; (c)2009 StoKen Software by uuklanger@gmail.com
;;
;; 2009.11.13 - updated for emacs23
;; 2009.11.14 - added settings for font and height/width
;;
;; ============================================================================
;; Setup Keyboard
;; ============================================================================

(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(global-set-key [delete] 'delete-char)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [C-end] 'end-of-buffer)

;; ============================================================================
;; Emacs customize section
;; ============================================================================

; Window Colors
(set-background-color "DarkSlateGray")
(set-foreground-color "Wheat")
(set-cursor-color "Orchid")
(set-mouse-color "Orchid")
(set-default-font "DejaVu Sans Mono-8")
(set-frame-height (selected-frame) 50)
(set-frame-width (selected-frame) 80)

; Turn off toolbar (toggle)
(tool-bar-mode)

; Display time
(display-time)

; Show column number
(column-number-mode t)

; Show line numbers
(line-number-mode t)

; FAQ 34: Highlight regions of text
(transient-mark-mode t)

; FAQ 66: font-lock-mode for all major modes
(global-font-lock-mode t)
(setq font-lock-maximum-decoration 't)

; FAQ 67: Only scroll one line when moving past screen
(setq scroll-step 1)
(setq scroll-conservatively 1)

; Dont show the GNU splash screen
(setq inhibit-startup-message t)

; Make all "yes or no" prompts show "y or n" instead
; (fset 'yes-or-no-p 'y-or-n-p)

;; Enable wheelmouse support by default
(cond (window-system
(mwheel-install)
))

; Ensure we stay in UNIX mode for EOL char
(setq inhibit-eol-conversion t)

; if we compile, ensure ouput scrolls
(setq compilation-scroll-output t)

;; ============================================================================
;; My preferred key bindings
;; ============================================================================

; Set C-g to goto-line
(global-set-key "\C-cg" 'goto-line)

;; ============================================================================
;; CC Mode setup
;; ============================================================================

(defun stroustrup-common-hook ()
(c-set-style "cc-mode")
(setq tab-width 4 indent-tabs-mode nil)
)
(add-hook 'c-mode-common-hook 'stroustrup-common-hook)

;; ============================================================================
;; Perl Mode setup
;; ============================================================================

(defun perl-common-hook ()
(setq tab-width 4 indent-tabs-mode nil)
(setq perl-indent-level 4
perl-font-lock t
perl-electric-lbrace-space nil
perl-electric-parens nil
perl-electric-linefeed t
perl-electric-keywords nil
perl-info-on-command-no-prompt t
perl-clobber-lisp-bindings t
perl-lazy-help-time 1)
)
(add-hook 'perl-mode-hook 'perl-common-hook)

;; ============================================================================
;; Other hooks
;; ============================================================================

; turn on auto fill mode when editing text files

(add-hook 'text-mode-hook 'turn-on-auto-fill)

;; ============================================================================
;; Runs Scripting Languages Program using compile key bindings
;;
;; if you have another lanugage, simply create a ____-run defun and add an if
;; statement to script-run()
;; ============================================================================

(defun python-run ()
"Use compile to run python programs"
(interactive)
(message "Running python for buffer %s." (buffer-name))
(compile (concat "python " (buffer-name)))
)
(defun perl-run ()
"Use compile to run perl programs"
(interactive)
(message "Running perl for buffer %s." (buffer-name))
(compile (concat "perl -w " (buffer-name)))
)
(defun script-run ()
"Use to run a script"
(interactive)
(if (equal (file-name-extension(buffer-name)) "py")
(python-run))
(if (equal (file-name-extension(buffer-name)) "pl")
(perl-run))
)
(global-set-key [f5] 'script-run)

;; ============================================================================
;; Printer settings
;; ============================================================================
;; ============================================================================
;; Fun stuff. Functions you can call up from the command line
;; ============================================================================

(defun ascii-table ()
"Print the ascii table. Based on a defun by Alex Schroeder
"
(interactive)
(switch-to-buffer "*ASCII*")
(erase-buffer)
(insert (format "ASCII characters up to number %d.\n" 254))
(let ((i 0))
(while (< i 254)
(setq i (+ i 1))
(insert (format "%4d 0x%02X %c\n" i i i))))
(beginning-of-buffer))
(defun insert-date ()
"Insert date at point."
(interactive)
(insert (format-time-string "%a %b %e, %Y %l:%M %p")))
;;; Convert DOS file format to Unix
;; look at
;; M-x comint-strip-ctrl-m
;; Command: Strip trailing `^M' characters from the current output group.
;; from: elf@ee.ryerson.ca (Luis Fernandes)
;; 22 May 1997
;;; Usage: M-x dos2unix
;;;
(defun dos2unix ()
"Convert this entire buffer from MS-DOS text file format to UNIX."
(interactive)
(save-excursion
(goto-char (point-min))
(replace-regexp "\r$" "" nil)
(goto-char (1- (point-max)))
(if (looking-at "\C-z")
(delete-char 1))))
;; ============================================================================
;; End of file
;; ============================================================================
Final Thoughts
If you use emacs, some of the settings above may help. I have gathered or created these settings and lisp code

HOWTO: dos2unix in emacs

Overview
I switch between Linux, OSX, and Windows quiet a bit. One problem with that can be the dreaded EOL issue.

For example, if you add #!/usr/bin/env python and have a DOS/Windows formatted file, running it in UNIX right from a shell may not work.

For my development, I prefer to standardize on UNIX format. For the languages I use, I know it will not cause any issues regardless of where they are run.

Requirements
If you are using linux, OSX, or Solaris you will edit your ~/.emacs file. If you are running Windows, you will be editing your %HOME%/_emacs

For this howto, emacs-22 is being used under Ubuntu Linux 9.10. I doubt the OS or version of emacs will make a difference.

Force Unix EOL
To avoid having to deal with EOL on your own code, add the following to your .emacs file.
; Ensure we stay in UNIX mode for EOL char
(setq inhibit-eol-conversion t)
Now emacs will only use UNIX EOL Plus, you will see ^M in your file for each line with a DOS/Windows EOL.

dos2unix Code
I found this code and have been using it. Why re-invent the wheel.
;;; Convert DOS file format to Unix
;; look at
;; M-x comint-strip-ctrl-m
;;   Command: Strip trailing `^M' characters from the current output group.
;; from: elf@ee.ryerson.ca (Luis Fernandes)
;; 22 May 1997
;;; Usage: M-x dos2unix
;;;
(defun dos2unix ()
"Convert this entire buffer from MS-DOS text file format to UNIX."
(interactive)
(save-excursion
 (goto-char (point-min))
 (replace-regexp "\r$" "" nil)
 (goto-char (1- (point-max)))
 (if (looking-at "\C-z")
     (delete-char 1))))
To use, press ESC-x and type dos2unix After pressing return, you will see the magic happen. I suggest making a backup before doing any global changes to anything. All ^M will disappear.

Final Thoughts
Adding this lisp code will help you standardize on UNIX EOL. You will find the full .emacs file here.

HOWTO: setup emacs to run scripts within UI

Overview
Lately, I have gone back to my old friend... emacs. Some would agree that a better and more flexible editor has never been created. I used emacs for many years for C/C++, perl, HTML, and shell programming. Over time, projects and jobs drove me to full IDEs like Netbeans and Visual Studio.

I recently purchased a DELL Mini 10v netbook running (of course) Ubuntu. With the tiny (but beautiful and clear) screen, big IDEs are just not practical. Even with all panels minimized there is still only a tiny amount of space.

For my last trip, I needed to develop some code to hack a pile data I was emailed right before I got on the plane... stat! Thank ___ for having a plane friendly computer like a netbook.

I have become dependent on all the work heavy IDEs automatically do. Do I really know who to code or does the IDE guide me to a completed program? Plus, data hacking is better for scripting languages like python or perl. On taxi I thought it over and made my call. Welcome back to my tool belt emacs.

Once we hit cruising altitude, I booted up Ubuntu 9.04, fired up emacs and started coding. There was one problem. I have been so used to simply pressing F6 to run my program. I wanted to do the same thing in emacs. Why be limited?

The following tells you howto setup emacs, for this type of behavior, using just a small amount of lisp code. The only real dependency is having the languages you are using in the path. If python or perl doesn't run from a command prompt, this will not work very well.

Requirements
If you are using linux, OSX, or Solaris you will edit your ~/.emacs file. If you are running Windows, you will be editing your %HOME%/_emacs

For this howto, emacs-22 is being used under Ubuntu Linux 9.10. I doubt the OS or version of emacs will make a difference.

Launch Interpreter using F5
Simply open your .emacs or _emacs file and add the following
;; ============================================================================
;; Runs Scripting Languages Program using compile key bindings
;;
;; if you have another lanugage, simply create a ____-run defun and add an if
;; statement to script-run()
;; ============================================================================

(defun python-run ()
"Use compile to run python programs"
(interactive)
(message "Running python for buffer %s." (buffer-name))
(compile (concat "python " (buffer-name)))
)
(defun perl-run ()
"Use compile to run perl programs"
(interactive)
(message "Running perl for buffer %s." (buffer-name))
(compile (concat "perl -w " (buffer-name)))
)
(defun script-run ()
"Use to run a script"
(interactive)
(if (equal (file-name-extension(buffer-name)) "py")
(python-run))
(if (equal (file-name-extension(buffer-name)) "pl")
(perl-run))
)
(global-set-key [f5] 'script-run)

If the file is python (py) then python will be run in a separate buffer. If the file is perl (pl) then perl will be run in a separate buffer. To trigger this, all that is needed is to press F5 while in a buffer that is either a python or perl file. That is it.

Final Thoughts
This approach can easily be expanded for other languages like ruby and such. I hope this helps simplify programming using emacs. Find my full .emacs file here.

Personally, I am glad I dusted off emacs. Humm... what about VI.

POLL: To me, a netbook is.... (Results)

  • 20% say "to small for me"
  • 20% say "only good for travel"
  • 20% say "perfect if it runs Windows"
  • 40% say "perfect if it runs Ubuntu"

Sunday, July 12, 2009

Fedora 11 - Upgrade from Fedora 10... not good... not good at all

Overview
So there I was, sitting at my workstation, doing a bit of work on my Fedora 10 server. When, all of a sudden a docile little dialog appeared notifying me that Fedora 11 was available and I could run pre-upgrade before upgrading.

Well, being an Ubuntu user, I have done many simple and smooth network based upgrades. So I figured, why not. Lets give it a shot. All my critical data is backed up anyway.

Now, I know what you are thinking. It states on the fedora project website that they prefer a clean install vs an upgrade. However, that doesn't mean an upgrade isn't possible? Right. I mean if your system pops a dialog saying "Distribution upgrades available" you should feel comfortable doing it. If it is possible but not recommended, why make the option so obvious.

I have been using Redhat/Fedora for as long as I have been using linux. Normally, I have followed the advice of doing a clean install vs upgrade. This time, I did the upgrade via network and let just say, it was not a good experience. Very little worked as advertised and I was always this close to system corruption and rebuild.

Now, I am not saying that an upgrade path from Fedora 10 to 11 spells doom. I am just saying that it almost did for me.

Background
My system has been upgraded twice by DVD. From Fedora 7 to 9. Then from Fedora 9 to 10. This may have set the stage for my upgrade distress. In all cases, there were some issues and bugs that I had to correct. Before FC7, I only did clean installs.

What Happened
My issues started during the pre-upgrade process. The updates dialog pops letting me know that FC11 is available. When clicked, the update process looks at your system and stages what it needs to upgrade.

During this phase, I got a message saying that the install image would not fit in /boot that that I needed a wired network after reboot to get the image during the upgrade. I had a wired network so I let it go.

After reboot, being sure to hit enter when you see the boot countdown (not documented) to get the option for the upgrade boot kernel.

Once I got into the actual upgrade process, I started getting error messages saying that it could not find packages (RPMs). That I could reboot or retry. The dialog said that reboot would mean possible corrption of my system. Retry, would simply retry (which is stupid). There was not a third option like, specify new location, data source, or continue anyway.

What is worse, is that it appeared that the installer was expecting RPMs to be in a different directory then they were in the install image (!!!). How this is possible, I have no idea since I never specified either. The update handled the mirror selection and all the behind the scenes work.

Well, corrupting my server, requiring a rebuild was just not going to happen. The following are a few thing I did to get through the mess and to a final working system.

Problem - Cannot Find Package to Install
It is possible that Fedora expected their install to barf so they were kind enough to provide most of the tools needed to correct them.

gives you a prompt. Here you will save the day.
gives you the current console log. Here you will see what is missing.

Two main tools that saved the day
  • wget
  • lynx
Both are text based and will let you fetch one or many missing files. lynx will complain since it needs a config. In /mnt/.../etc (look around) you will find a lynx.cfg and a lynx.lss. Copy them to /etc/. wget simply works.

Next thing you will need is a good working mirror. You will need to visit the fedoraproject site for that to find one. Each system will be different so you wil need to look at the console log to see where it is expecting to find the RPMs. Once you can see that (i.e. file:///mnt/system/...) you can cd to that directory and fetch each missing file one by one as you see the errors.

This job actually sucks since a missing gnome-libs problably means that gnome-libs-devel will be needed later. To get around this, I worked in broad strokes.
  1. I fetch a list of all the files using wget from the mirror site.
  2. I washed the "packages.html" file through cut and awk to get a list of only the rpm files
  3. This list of files was then washed through awk a second time to pre-pend wget http://..../file.rpm.
  4. This was then redirected into a text file for later use
When an error would pop up. For example gnome-libs. I would simple run the following from the prompt:

cat packages_wget.txt |grep gnome-libs |sh

Now the file (or any file with gnome-libs in it) will get fetched. This does not mean that it will get automatically installed but will be available for the installer.

I did this for all missing files. Later during the upgrade phase, there were more errors, so I followed the same approach.

I now what your are thinking
Why didn't I stop the install and download a DVD? I thought about that, however, the error messages dialog warned about corruption to the system and it was not clear how many files were actually missing. I might have been on my "last one". Once I got the above approach working, it went pretty fast. It was just an unforgiveable waste of time.

Hurray, the system upgrade is done. Reboot and Run Updates...!!!..Grumble
Finally, the upgrade completed. I rebooted the system and prepared for doing a yum update. This should be cut and dry now.... right? Nope. Aparently, there are several pre-release packages that were included in something the system was upgrading. Others had errors.

dhcp and cyrus-imap had a refernce to an openssl library that had an incorrect symlink. Looking at the error and correcting the symlink did the trick.

In a nutshell, yum update tried to upgrade a packages that does not exist on any mirror or even on the fedora site. Unless you know the full dependancy tree within the 631 updates, it is hard to turn off the ones in questions. For this reason, I had to upgrade in small batches until I found the packages that had the dependancies to the other packages that didn't exist.

Final Thoughts
I don't think I can stomach another Fedora upgrade. Will this happen to you? I am not sure. There could have been many reasons for my hardship, however, I have been using Fedora/Redhat for at least 10 years so I now the ins and outs. Install is not a strong point. It is flexible and easy to manage once running however. It is my (current) choice for a server OS.

My thought to you is: if the installer tells you that you do not have room on your /boot partition, cancel and walk away. I have a feeling that a DVD install would have gone better. A clean install would be best.

I just wish they could make it work like Ubuntu. That distro is great for package management. They just tend to be slower on updates (i.e. Java).

I will try to add more details about specific commands and syntax. My main goal here was to put information out, in the event, that other of you have run into the same issues.

Update 2009-Sept
Since my painful upgrade, the updates have been flowing just fine. My system has been running pretty well.

Monday, June 29, 2009

Netbeans 6.7 Is Here

Today I downloaded and installed Netbeans 6.7. My first impressions are very good. The performance seems better and I really like what was done for unit testing.

I have used it under Windows and Linux. Thanks Netbeans team!! Another great version delivered right on time.

Tuesday, June 23, 2009

HOWTO: Install Python Soap Libraries ZSI + SOAPpy + PyXML Under (of all things) Windows XP

Overview
I recently needed do some simple scripting using Python under Windows. The main goal was to test some web service calls (via SOAP). Python lets you put something like this together pretty quickly. Including WSDL processing, business logic, and unit testing.

Adding a SOAP library (ZSI+SOAPpy in this case) under linux (ubuntu or fedora) is also simple since you just install a package from a repo. However, I found that setting is up under Windows to be more of a pain.

Problem
Get ZSI, SOAPpy, fpconst, and PyXML setup for use in SOAP programming under Python 2.6.

The main issue is that one of the dependancies, PyXML, does not have a package for versions of Python > 2.4. This means that it will need to be manually built. The typical setup.py usually does the trick but for PyXML a C module was also included as part of the distro. Compiling modules under Windows requires an open source compiler or Visual Studio 2008. For me, neither are an option. Man I wish I could just use linux :-)

Lets Begin
After you fetch the packages through the Python Website...

Install fpconst
This, I think, is needed by SOAPpy. Fetch fpconst-0.7.2.tar.gz
  1. Under Windows I use WinRAR to extract the setup/temp folder
  2. run: python setup.py build
  3. run: python setup.py install
That is done.

Install PyXML
PyXML is required by SOAPpy and possibly ZSI. The problem you will run into installing it is that there are a few Python extensions that need compiled and unless you have Visual Studio 2008, it will not compile under Python 2.6.

Fortunatally, I discovered that SOAPpy (or ZSI) don't use these extensions so as long as you don't need it yourself you can install it as follows.
  1. Under Windows I use WinRAR to extract the setup/temp folder
  2. run: python setup.py install --force -skip-build
The -skip-build skips the building of the C based extension. Without this parameter you will get an error under windows as it looks for Visual Studio 2008. If you have Visual Studio 2008, you are probably not reading this blog and had no issues installing PyXML :-)

Installing SOAPpy
With PyXML installed, the hard part is over.
  1. Unzip SOAPpy-0.12.0.zip to a setup/temp folder
  2. run: python setup.py build
  3. run: python setup.py install
That is done.

Install ZSI
Now the dependencies are install, ZSI can be installed. This is what you will use for all your SOAP calls. It is pretty well documented and fairly easy to use. The approach is similar to how it is handled in Java or .NET. Install is simple
  1. WinRAR ZSI-2.0.tar.gz to a setup/temp folder
  2. run: python setup.py build
  3. run: python setup.py install
That is done

Does it work?
To test, you will first need to process your web service WSDL file into something Python can work with. The approach is similar to what is done when you add a web service reference in .NET or JAVA. This this case, you use a simple command line utility called wsdl2py. On my windows computer, it is found in C:\Python26\Scripts\ You should find it in a similar place. Assuming that you do not have this script in the path and have not been clever enough to make a batch file, you can run it as follows. CD to the directory where you want your PY files created by the utility to go.

python C:\Python26\Scripts\wsdl2py -bu http://moneycow.sandwich.lan:8888/moneyfinder.asmx?WSDL

There are more parameters, but this command will get you what you need. You may see a few deprecation warnings but they don't hurt anything. In the end, you will get two files.
  • *_services.py
  • *_services_types.py
Or similar. Read the ZSI docs on how to use them. I will try to post a blog soon with an example.

Unknowns
I have not figured out how to get SSL to work with ZSI. If any of you have figured this out, please post me a message. I would love to hear about it. It is not an issue for me now since none of the services I need to consume are Internet exposed. If I get stuck and need to access one, I will just use Java or .NET ;-)

Conclusion
If you have to use Windows and need to do Web Services with Python 2.6, the above steps should get you setup and ready to role. Once you are setup and get your first basic program working, you will find that Python does a good job and the performance is just fine.

Sunday, May 31, 2009

Subversion - Checking out a Project

Overview
When it is time to get work done, code will need to be checked out. The main steps to checkout code that was imported as described in a previous post is as follows:
  • Create a workspace folder for your project
  • Change directory into that folder
  • Checkout code from the trunk (or tag or even branch) into the current directory.
Procedure
The following steps will checkout the sqlbuilder project that is part of the perl repo into my local filesystem's sqlbuilder folder.

Create new folder called sqlbuilder. My code is targeted to be on my local file system in a base directory of ~/work/perl/sqlbuilder

cd ~/work/perl/
mkdir sqlbuilder
cd sqlbuilder

svn checkout https://www.inhouse.stoken.net/repos/perl/sqlbuilder/trunk/ ./

Now your code is in a subversion managed folder.

Tagging Current Trunk
Tagging is a common practice in which you create a snapshot of your code as it stood in time or within a version. In this example, the sqlbuilder code needs to be tagged. The tagged version will be stored in the repo within a 20090528 folder.

svn -m 'tagging first release' copy https://www.inhouse.stoken.net/repos/perl/sqlbuilder/trunk/ https://www.inhouse.stoken.net/repos/perl/sqlbuilder/tags/20090528

Use a browser to view trunk and tag using the above URLs.

Final Thoughts
The process of checking out a tagged version is the same as for a trunk version, just ensure that the URL path is correct and it will work.

I personally tag frequently in Subversion since Subversion does it pretty efficiently. Your thoughts may vary on this.

This concludes the series on basic Subversion usage. When I have time, I will post something on Subversion + Netbeans. Netbeans handles Subversion very well but there are few small details that may help. I will post them soon.

Subversion - Importing a new Project

Overview
Once a repo has been created, it is time to import your code. This has only a few main steps.
  • Create a base directory within the repo with the project name
  • Build the standard subversion project tree (tags, branches, trunk)
  • Import code into trunk
Procedure
In this example, I have created a simple helper project called sqlbuider.

As described above, the first step is to create the base directory within the repo.
svn mkdir -m 'adding new project area' https://www.inhouse.stoken.net/repos/perl/sqlbuilder

Next, the standard subversion directory tree needs to be created.
svn mkdir -m 'adding new project area' https://www.inhouse.stoken.net/repos/perl/sqlbuilder/branches
svn mkdir -m 'adding new project area' https://www.inhouse.stoken.net/repos/perl/sqlbuilder/tags
svn mkdir -m 'adding new project area' https://www.inhouse.stoken.net/repos/perl/sqlbuilder/trunk


If you are building your repo as you are reading along, you should be able to point your browser to it and see an empty folder for .../tags .../trunk .../branches

We are ready for the next step, Import the project. On the local system, change directory to local project folder (sqlbuilder in my case) and import. My local source happens to be in ~/work/perl/sqlbuilder. Subversion doesn't care about the location. Just that you are sitting in the project folder. The following will import the project

cd ~/work/perl/sqlbuilder
svn -m 'inital import' import ./ https://www.inhouse.stoken.net/repos/perl/sqlbuilder/trunk/

The command says, "using the message of 'initial import', import everything in ./ to https://..../trunk/

If you refresh your broswer in the trunk folder, you will see code.

Normally, I will take my local directory (sqlbuilder in my case) and rename it to something like sqlbuilder_pre_svn or sqlbuilder_old.

This process can be followed for multiple projects within the same repo. Just create the directory structure and then import your code into it.

When you are ready to work on the project, you will want to create a new sqlbuilder folder and checkout the https://..../trunk/ code into it. That will be described in my next post.

Final Thoughts
Why not import the folder sqlbuilder? Why import just the contents of the folder into trunk? The main reason is that it simplifies situations where you may have one or many versions of the same project checked out. Now you can checkout a trunk or tag version into whatever directory you want. It makes things easier to deal with. The only thing to remember is to check out after you create a local workspace folder before checking out into it.

The next post will describe howto check out and tag code.

Subversion - Adding a new Repo

Overview
Based on my previous post, you should now have a working and configured Subversion environment. Most of the work was done in Apache.

Now a repo is needed to store all related projects. Subversion is pretty flexible here. You can create a repo per project, on single repo for everything, or do what I do. Create a repo per language you work in. For example:
  • /opt/intranet/svn/python/
  • /opt/intranet/svn/ruby/
  • /opt/intranet/svn/java/
  • /opt/intranet/svn/php/
The amount of repos is up to you.

Procedure
For this example, I am adding a new repo for my perl code projects. All my repos are stored in /opt/intranet/svn/

to create a new repo:

• cd /opt/intranet/svn
• svnadmin create perl
• chown -R apache:apache perl/

Within each repo, one or many projects. The following shows how to prepare and import files into a new project.

Final Thoughts
With this repo created, new projects can be added.

Saturday, May 30, 2009

Subversion - Setting up Apache and Users

Overview
Subversion is a fantastic source control system. Not only is it pretty easy to setup and use but it also integrates with a vast list of IDEs.

This post describes how to setup the base environment for Subversion. This consists of:
  • Apache Configuration
  • Apache Web Server User
Other posts will cover adding repos.

My environment:
  • Internal access only
  • linux/Unix environment
  • Apache + Subversion
Configuring Apache With Subversion
When you install Subversion, there will be a default subversion.conf file setup (most likely) in /etc/httpd/conf.d/ for Apache

Within the environment I use, the following file system structure is used:
  • /opt/intranet/svn - Main area for subversion repos. Local file system.
  • /repos - Apache reference to Parent Path
  • /opt/intranet/svn/users.passwd - Location of subversion user/password file for any/all repos.
What to modify in your /etc/httpd/conf.d/subversion.conf to get it to work like the one described below.

# START OF CONFIG
<Location /repos>
DAV svn
SVNParentPath /opt/intranet/svn

# Limit write permission to list of valid users.
<LimitExcept GET PROPFIND OPTIONS REPORT>
# Require SSL connection for password protection.

SSLRequireSSL
AuthType Basic
AuthName "StoKen Software Subversion"
AuthUserFile /opt/intranet/svn/users.passwd
Require valid-user
</LimitExcept>
</Location>

# END OF CONFIG

Adding a Subversion User
# htpasswd -c /opt/intranet/svn/users.passwd thawk
New password: mypassword
Re-type new password: mypassword
Adding password for user thawk

Final Thoughts
With this step complete, subversion is ready but will not do anything interesting until you add some repos. But that is another post...

POLL: What Persistance Engine Do you Use? (Results)

  • 50% Java Persistence API
  • 37% Hibernate (Java)
  • 25% NHibernate (.NET)
  • 0% LINQ (.NET) 0 (0%)
  • 12% ActiveRecord (Ruby)
  • 12% Other
Poll closed 04/02/2009

POLL: What JAVA Do you use? (Results)

This was not much of a surprise. SUN Java is the way to go. I just hope Oracle continues the to support JAVA like SUN did.
  • 90% SUN Java (linux/Windows)
  • 5% OpenJDK
  • 0% SUN Java (OSX)
  • 5% IcedTea (linux)
Poll Close 04/24/2009