Installing PHPUnit On Windows With Out PEAR

This is a quick description of how I got PHPUnit working on Windows without installing PEAR

The PHPUnit documentation is a cryptic and sparse when describing how to install PHPUnit on windows.

I am assuming that PHP is already installed and working.

Steps:

  1. Download the latest version of PHPUnit (currently 3.4.9) from here http://pear.phpunit.de/get/
  2. Extract to somewhere (I put it in my PHP directory)
  3. Edit the phpunit.bat file. At the bottom of the file there are two lines:
    set PHPBIN="@php_bin@"
    %PHPBIN% "@bin_dir@\phpunit" %*
  4. Change them to something like this:
    set PHPBIN="C:\Program Files (x86)\PHP\php.exe"
    %PHPBIN% "C:\Program Files (x86)\PHP\phpunit.php" %*
  5. To test if PHPUnit is working run “phpunit --help” from a command  prompt (PHP directory needs to be set in the path environment variable).

Setting Return-Path in PHP

We have a system that needs to send automated emails. But we were having a problems where we were not getting bounce emails from invalid email addresses.

After half a day of digging it turns out the problem was that the Return-Path header was being set to the user that the web server runs as. Which was a non-existent email address.

To set the Return-Path in PHP on a unix environment use:
mail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com');

In windows envioronment use:
ini_set('sendmail_from', 'webmaster@example.com);

For more information see: http://www.php.net/manual/en/function.mail.php

First telescope

Quick review/initial thoughts of the SkyWatcher BKP13065EQ2 telescope I just brought.

As the model name suggest its a 130mm (5.1″) Newtonian Reflecting telescope. It has a focal length of 650mm and a focal ratio of F/5. For more detailed spesifications see the  SkyWatcher BKP13065EQ2 page. The scope cost $500 NZD before shipping.

The first thing to note is how easy the setup was. I found instructions very easy to understand and follow and had the telescope setup under and hour (all tools were provided in the box). And seeing as this was the first time I’ve setup a telescope I don’t think thats to bad. The instructions are well written with easy to follow diagrams. They also contain details on how to polar align the scope, collimating the optics, even calculating the magnification and true field of view.

The scope looks nice all in black with a slight sparkle to it.

It comes with 2 eye pieces, a 25mm and a 10mm. These are probably fine for a first telescope, but I’ll likely want to pick up some more and maybe some filters at a later date.

The mount feels quite sturdy, with adjustable height. Seems to manage the scope and 3.5 kg counter weight easily (once balanced correctly).  One of the main criteria I was looking for a first telescope was portability. Once fully assembled the whole thing is difficult to move around, but can easily be broken down to manageable pieces in a couple of minutes.

I can’t really comment on the viewing experience as I haven’t had a chance to do any night viewing yet. I’ve only had the scope for one night and it was clouded out. Expect a follow up

Conclusion:
I can’t really find a fault with the SkyWatcher BKP13065EQ2 telescope. It looks good, has excellent instructions, simple to setup and reasonably portable.

Move Music Into Artist Folders

I like my music in artist folders so I created this little VB Script to move music albums into single folders.
It takes a folder full of albums in the format “Artist – Album” and creates a folder for each artist, then moves the Albums into that folder.

For example if you have a folder C:\Music and sub folders in the format ”Artist – Album” like below:

C:\Music\Artist1 – Album1
C:\Music\Artist1 – Album2
C:\Music\Artist2 – Album1

It will turn it into:

C:\Music\Artist1\Artits1 – Album1
C:\Music\Artist1\Artist1 – Album2
C:\Music\Artits2\Artits2 – Album1

Just copy the below code into a text file, rename it something like “music mover.vbs” put it in your root music directory (C:\Music\ in my example) and run it. Your music should now be in folders by artist.

Script is:

Dim fso, folderObj, folders, outputFile, currentDir, newFolder, dashPos, folderName

Set fso = CreateObject("Scripting.FileSystemObject")
currentDir = fso.GetAbsolutePathName(".") + "\"

Set outputFile = fso.CreateTextFile(currentDir&"\FileList.txt", True) 'file for loging things
Set folderObj = fso.GetFolder(currentDir)

Set folders = folderObj.SubFolders

For each folderIdx In folders
	newFolder = ""
	dashPos = InStr(folderIdx.Name, "-")
	folderName = currentDir + folderIdx.Name

	if dashPos <> 0 then 'we found a dash in the folder name (asuming that there are no artists or albums with dashes in their names the format is Artist - Album)

		newFolder = currentDir + Trim(Left(folderIdx.Name, dashPos-1))

		if not fso.FolderExists(newFolder) then
			fso.CreateFolder(newFolder)
			outputFile.WriteLine("Created new folder (" + Trim(Left(folderIdx.Name, dashPos-1)) + ")")
		else
			outputFile.WriteLine("Folder already exists (" + Trim(Left(folderIdx.Name, dashPos-1)) + ")")
		End If		

		outputFile.WriteLine(" - Added (" + folderIdx.Name + ")")
		Call fso.MoveFolder(folderName, newFolder + "\\")

	End If
Next

outputFile.Close

If I feel like it I might write a script that does the opposite, takes Music\Artist\Artist – Album and moves them to Music\Artist – Album.

Follow

Get every new post delivered to your Inbox.