Saturday, April 12, 2008
Penne with a tuna and tomato sauce
-----------------------
Serves: 2
Points per serving: 4
-----------------------
Tomato: 400g tin : 0 points per person
Olive oil: 1tsp (1tsp = 1 point) : 0.5 points per person
Tuna: 150g tin drained weight (50g = 1 point) : 1.5 points per person
Garlic clove: 1 : 0 points per person
Penne: 200g uncooked weight (50g raw = 75g cooked = 1 point): 2 points per person
-----------------------
Heat up the oil in a frying pan.
Crush the garlic cloves and add them to the oil.
If the tomato is not chopped chop roughly.
Add the tomato to the oil..
Add in some salt.
Heat til simmering, then leave it at this temperature, stirring occasionally.
Add some pepper afer a few mins.
Boil a pot of water.
Add the penne to the boiling water.
Add a handful of salt if you're using large crystals, or 1tbs of salt granuals.
Drain the tuna.
Add the tuna to the tomato sauce and mix well, breaking the tuna up as you stir.
Drain the pasta when it's cooked and add it to the tomato sauce.
Mix well in the pan (still over the heat for a minute or so).
Serve.
Friday, April 11, 2008
Spaghetti and prawns
-----------------------
Serves: 2
Points per serving: 5
-----------------------
Prawns: 180g cooked and peeled weight (60g = 1 point): 1.5 points per person
(We used fresh prawns, but I'm not sure what weight we started off with.)
Spaghetti: 300g uncooked weight (50g raw = 75g cooked = 1 point): 3 points per person
Olive oil: 1tsp: 0.5 points per person
Chilli flakes
Black pepper
Parsley
Salt
Garlic cloves: 3
-----------------------
If using fresh prawns boil them til cooked, then drain and peel.
Boil a pot of water.
Add the spaghetti to the boiling water.
Add a handful of salt if you're using large crystals, or 1tbs of salt granuals.
Heat up the oil in a frying pan.
Crush the garlic cloves and add them to the oil.
Add the chilli flakes.
Add the prawns.
Cook for a few mins, adding water from the pasta if it looks too dry.
Add in some pepper to the prawns.
Drain the pasta when it's cooked and add it to the prawns.
Mix well in the pan (still over the heat for a minute or so).
Serve.
Baked cod and potatoes
-----------------------
Serves: 2
Points per serving: 6
-----------------------
Cod: 400g (whole fish without the head or innards, cleaned) - (90 - 100g = 1 point): 2 points per person
Olive oil: 3 tsp (3 points) : 1.5 points per person
Rosemary stem (about 8-10cm long) and some more rosemary leaves.
Garlic cloves: 3 (0 points)
Potatoes: 500g (100g potatoes = 1 point. 500g for two people) : 2.5 points per person
salt
mixed herbs
-----------------------
Line a baking sheet with baking paper and place the fish on the paper.
Rub some salt into the skin and the flesh.
Stuff it with the rosemary, whole garlic cloves and rub 1.5 tsp oil into skin and flesh.
Peel the potatoes and chop into chips or wedges.
Place them around the fish.
Sprinkle with the other 1.5 tsps of oil, some salt, the mixed herbs and the rosemary leaves.
Mixed the potatoes, rubbing all the oil, salt and herbs into them.
Put in a medium oven and bake for an hour or so until fish and potatoes are cooked.
Check to see if fish is still moist half way through. If need, add some more oil or water to keep it moist.
Serve.
Thursday, February 08, 2007
Forcing SSL and Redirecting non-HTTPS requests to Home Page
I setup an ASP.NET 2.0 application on a website recently that required users to login and be recognised by the different roles they were assigened to. I was subsequently asked to have it run exclusively under SSL in order to encrypt the login information. So, I got Saverio to publish me an SSL certificate which he then set up for the application in IIS. He then checked the box in IIS in order to force SSL for that website. All was going well until we realised that we should manage non-HTTPS somewhat elegantly.
My first thought was to write some code in the application's Master Page that checked to see if the request was HTTP or HTTPS then redirect to HTTPS, but that would require a change in the code. This wasn't a problem for my current application, but I thought it would be nicer to be able to write these in a modular fashion so that it could be easily added in to another application.
I did a quick search on the web and came across this article [1] posted on Paul Wilson's blog on the asp.net website. It discusses using a Custom Error page in IIS for the 403.4 HTTP error code: the code that identifies the request as being forbidden as a result of SSL being required. The posting describes how to setup your custom error to be an ASP.NET page that performs a redirect to another page. I thought that it would be acceptible to redirect all non-HTTPS requests to the home page of our application, as the only url the users would be likely to type would be that of the home page, so I created an HTML page with a simple META refresh rather than an ASP.NET page.
A short while afterwards we got a call from a user saying that the home page of the site was giving them an error. We had a look into it and noticed that our redirect was working in Firefox but didn't work in IE. Remembering about IE's "Show friendly HTTP error messages" it seems that when the browser requests a page over HTTP that requires HTTPS, the server returns a 403.4 error along with the URL of a page where you can find the error page. When "Show friendly HTTP error messages" is select in IE it doesn't request the error page from the server but rather uses its own one. Seeing as "Show friendly HTTP error messages" is selected by default in IE, we had a problem.
We did some more searching and happened upon this article [2] from Scott Guthrie's blog. He explains that i) if you are using IE, ii) your requested HTTP request returns a status that is not 200, iii) the associated error page is < 512 bytes, and iv) "Show friendly HTTP error messages" is checked, then IE displays its own error page that corresponds to that error code. He follows on to say that all you need to do is make sure your Custom Error page is > 512 bytes and Bob's your uncle. He adds in an HTML comment to his page to bulk it up, so that's what we did too.
Thanks again, Scott!
References:
Wednesday, January 31, 2007
Visual SourceSafe - HOWTO
CREATING A NEW APPLICATION
---------------------------------------------------------------------------------------------------------
Visual Studio
---------------------------------------------------------------------------------------------------------
File -> Open Web Site
In "Open Web Site" dialog select "Source Control" button on left, then "Select Source Control Project" on right
In "Open SourceSafe Database" dialog selected "Add" button on the right
Add SourceSafe Database Wizard
---------------------------------------------------------------------------------------------------------
i) In "Welcome to the Add SourceSafe Database Wizard" click "Next"
ii) In "Database Selection" select the "Create a new database" radio button and click "Next"
iii) In "New Database Location" click on "Browse"
We keep all our SourceSafe Databases under the \\nerone\d$\VSSBD
In "Browse For Folder" dialog you can create a new folder to hold your SourceSafe Database under \\nerone\d$\VSSBD by either:
i) expanding the tree to find this folder, left clicking once on it to select it, then clicking on "Make New Folder", or
ii) type \\nerone\d$\VSSBD, press the return key, click "Browse" again in screen 3 of "Add SourceSafe Database Wizard" dialog, (this selects the specified folder) then click on "Make New Folder"
Rename the folder (still in "Browse For Folder" dialog), make sure the newly created and renamed folder is selected, then click "Ok"
Back in "New Database Location" verify that the path to your new folder is in the "Location" textbox and click "Next"
iv) In "Database Connection Name" enter a name for your Database (I left the default - the same name as the Database file) and click "Next"
v) In "Team Version Control Model" select the radio button beside (I prefer "Copy-Modify-Merge Model") and click "Next"
vi) In "Completing the Add SourceSafe Database Wizard" verify the Name, Database Path and Team Version Control Model and click "Finish"
Finishing the "Add SourceSafe Database Wizard" will return you to the "Open SourceSafe Database" dialog with your newly created Database selected.
Before opening this database, you should setup the access rights in the Visual SourceSafe Administrator (see I below)
Then you should create your "development branch", the development project in your SourceSafe Database (see II below)
Once you have setup the access rights in the Visual SourceSafe Administrator and setup the Development Branch, change the "Username" you created for your self in Visual SourceSafe Administrator
Click on "Open"
In "Create local Project from SourceSafe":
(You must do these in the order written below, otherwise you will have to select the location twice)
i) select the development branch (the project with the name of your Application) in the "SourceSafe project to download" tree
ii) click the "Browse" button beside the "Create a new project in the folder" textbox, and choose the folder in which you wish to have the data checked out to. This folder will not be your root folder.
(example - In the SSPWEB Database, I choose the SSPWEB project node and choose e:\src\sspweb as my local folder)
Click "Ok"
"Open Web Site" dialog should now have a "Web settings" area with "Save to local folder" set to the location you chose in the previous step.
Leave the "Run as IIS Web site" UNCHECKED and click "Open"
A "Source Control" dialog will appear with some information "The Open from Source Control operation is still in progres but you can start working now. The rest...".
Click Ok
You have now created a new application! Well done!
I) Setting up the access rights in a Visual SourceSafe Database using Visual SourceSafe Administrator
---------------------------------------------------------------------------------------------------------
Open Visual SourceSafe Administrator.
If your new database is not already opened (the name should be in the title bar of the Visual SourceSafe Administrator window):
File -> Open SourceSafe Database
In "Open SourceSafe Database" dialog select the database
Note that a user for your Windows' user was automatically created using your Windows' user name
Select Admin user (left click on user name), then
Users -> Change Password
Leave "Old SourceSafe Password" blank
Set "New SourceSafe Password" and "Verify" to new password
Click "Ok"
For each user:
Users -> Add User
In "Add User" fill in the user name (see list above) and set the password
Click "Ok"
Select the user name that is associated with your Windows' user (for example, the automatically created SDonnelly for me, rather than the newly created Shane):
Users -> Delete User
Click "Yes" in response to the "Are you sure you want to delete?" prompt
Delete also the Guest user (deleting performed as has just been described above)
Close Visual SourceSafe Administrator
II) Setting up the development branch in a Visual SourceSafe Database
---------------------------------------------------------------------------------------------------------
Open the Visual SourceSafe client - this opens the Visual SourceSafe Explorer
If the Database selected in the "Log On to Visual SourceSafe Database" dialog is not the one you wish to use
i) click "Browse"
ii) in "Open SourceSafe Database" left click on the Database name and click "Open"
Fill in the "User name" and "SourceSafe Password" fields
Click "Ok"
Ensure that the Database name in the title of the "Visual SourceSafe Explorer" is the one you expect
In the left hand pane, right click the root node ($/)
Select "Create Project"
In the "Create Project in $/" dialog, put in the name of your Application, for example "SSPWEB" and fill in the comment textfield with something like "The development branch of SSPWEB"
Close Visual SourceSafe Explorer
---------------------------------------------------------------------------------------------------------
CREATING A BUGFIX BRANCH
---------------------------------------------------------------------------------------------------------
Open the Visual SourceSafe client - this opens the Visual SourceSafe Explorer
In the left hand pane you should see the root of your Database and under the root your Development Branch
Right click on the root and select "Share to $/"
In "Share to $/" dialog, under projects on the right hand side, select your Development Branch
Put a check in the "Brach after share" checkbox
Click on the "Share" button
In the "Share $/<development branch name>" dialog, replace the name in the "New name" textbox field.
I just added Bugfix to the end of it - so SSPWEB branches to SSPWEBBugfix
Fill in the "comment textfield" with something along the lines of "This is the bugfix branch for SSPWEB 1.0"
Put a check in the "Recursive" checkbox.
Click "Ok"
Click "Close" in the "Share to $/" dialog
You now have your bugfix. You can now perform a checkout from Visual Studio
---------------------------------------------------------------------------------------------------------
BUGFIXING AND MERGING BRANCHES
---------------------------------------------------------------------------------------------------------
I started off by making a change to the bugfix branch. This took the form of changes to a few files, which I all checked in together. Seeing that VSS has no changeset, I installed CodeMiner VSS Manager (http://codeminer.adventnet.com/vss-manager/index.html) so that I could see check-in reports listed by date.
TO FINISH
---------------------------------------------------------------------------------------------------------
LABELLING A PROJECT
---------------------------------------------------------------------------------------------------------
Open the Visual SourceSafe client - this opens the Visual SourceSafe Explorer
Decide on what you wish to label this version of the PROJECT (for example, the Bugfix branch).
i) To see what the latest label for this project is, right click the project and choose "Properties"
ii) Under the "General" tab on the right of the dialog is the text "Last label" followed by the label number
Right click on the project (for example, the Bugfix branch) you wish to label
Select "Label"
Type the label name in the "Label" textbox
i) Bare in mind the labelling rules :
Visual SourceSafe defines a label as a string of up to 31 characters. Any of the following is a valid label: "1.0", "2.01b", "Final Beta", and "Approved for QA". Label names cannot start with a capital "L" or "#s".
Add a comment
Click "Ok"
---------------------------------------------------------------------------------------------------------
GETTING A PARTICULAR LABELED VERSION
---------------------------------------------------------------------------------------------------------
Open the Visual SourceSafe client - this opens the Visual SourceSafe Explorer
Set working folder
Right click on Project
"Show History"
Check "Include Labels"
Click "Ok"
Left click on label
"Get"
Check "Recursive"
Click "Ok" - Note: files that are "Got" are listed in bottom pane in the main SourceSafe window
Click "Close"
Known Issues with Visual Studio 2005 Service Pack 1
We had some problems in work installing Visual Studio 2005 Service Pack 1 on Windows 2003 and found the following blog posting:
Heath Stewart's Blog : Known Issues with Visual Studio 2005 Service Pack 1
We ran into the Error 1718.File '...' was rejected by digital signature policy error which we resolved by following the steps in Microsoft's KB925336, creating a new Software Restriction Policies and setting the "All users except local administrators" option as detailed.
Tuesday, January 30, 2007
Somethings to notice
Births
FEENEY - Larkin, Jen, Isabel and Arthur are delighted to announce the birth of Linus Seán on January 19, 2007. A thanks to Sinéad and all the Community Midwives, Dr. Declan Keane and all at the NMH.
Date: Friday, 19 January 2007
Published: 27 January 2007
Births, Marriages, Deaths Notices in Ireland – ireland.com
Engagements
ELLEN DONNELLY SEBASTIEN LE CALLONNEC Ellen and Sébastien together with their parents, in Portmarnock and St-Mars-du-Désert, Loire-Atlantique, are delighted to announce their engagement.
Published: 27 January 2007
Births, Marriages, Deaths Notices in Ireland – ireland.com
Sunday, October 01, 2006
Bennett Robot Works
From technabob.com
Who said that robots needed to be all clean and shiny (or functional for that matter?) The Bennett Robot Works designs sculptural robots made from junk.
Each (non-functional) robot is unique and handmade by Gordon Bennett and made from a carefully selected assemblage of old and new parts. The robot designs are inspired by the 1940s and 1950s “futurama” visions of Norman Bel Geddes and Raymond Loewy.
Robots each take about a month to build and range in size from 14″ to 34″ tall. Since each bot is a unique work of art, they’re not inexpensive (from $850 to $2500 depending on size and complexity.) However, for those with an eye for original art, they are extremely cool pieces.
technorati tags:art
Martin O'Neill
Aston Villa manager, Martin O'Neill, interviewed after his side's 1 - 1 draw at Chelsea, agrees the referee was right to have advised him to stop the repeated questioning of his decisions, but offers some advice of his own:
"He's absolutely right to come over to say to me that there's only one referee on the pitch, absolutely. But perhaps maybe tonight, and, em, rather than going out for something to eat, maybe he just has fish and chips at home and watches the video of the game."
technorati tags:quotes
Mina and Lucio Battisti duet
technorati tags:music
Thursday, July 20, 2006
Visual Studio 2005 and Visual Studio 2003 side-by-side
According to Microsoft, cf [1], Visual Studio 6.0, 2002, 2003 and 2005 can all be run side by side on the same machine. If, however, you open a project created in Visual Studio 2003 in Visual Studio 2005, you cannot open it again in Visual Studio 2003.
Regarding Visual SourceSafe, Microsoft explains, cf [2] that the SourceSafe database format has not changed between SourceSafe 6.0 and SourceSafe 2005, therefore, you can access a Visual SourceSafe 6.0 database from a Visual SourceSafe 2005 client installation. From what I've read, cf [5], [6] and [8], you can just use Visual SourceSafe 2005 with Visual Studio 2003 and it works fine. Some new features of Visual SourceSafe 2005 are not available from within Visual Studio 2003, but that seems quite reasonable to me. While you can install Visual SourceSafe 2005 and Visual SourceSafe 2003 on the same machine, it seems, cf [7], that only one Visual Studio plug-in (ssscc.dll) can be registered at a time. There are tools to allow you to re-register the appropriate dll, cf [9].
Regarding IIS, in order to separate them, you can apparently, cf [4], run different version of the CLR in different application pools.
So, I would suggest installing Visual Studio 2005 and Visual SourceSafe 2005 on our pcs. I don't think it should be a problem leaving Visual SourceSafe 6.0 installed, but if you want to uninstall Visual SourceSafe 6.0, I would recommend doing it before installing Visual SourceSafe 2005 in order to avoid causing registrations problems with the plug-in dll for Visual Studio.
References:
Microsoft Articles:
[1] Installing Visual Studio Versions Side-by-Side
[2] What's New in Visual SourceSafe
[3] Previous Versions
Microsoft Blogs:
[4] HOWTO: Install and Run ASP.Net 2.0 Side-by-Side
Forums on microsoft.com, but not necessarily Microsoft's opinions:
[5] VSS 2005 and VS .NET 2003? (for HTTP support) - June 2005
Non-Microsoft.com forum posts:
[6] VS 2003 and VS 2005
"With ASP.Net you must just keep in mind that after installing ASP.Net 2.0 the default framework on the machine might be 2.0 and not 1.1. Normally if your site have changed to 2.0 you can just change it in IIS back to 1.1. I know this is an issue for some stuff like Report server (2000)."
[7] side-by-side install of sourcesafe 6.0d and 2005?
Non-Microsoft blogs:
[8] SourceSafe 2005 and Visual Studio .NET 2003
Non-Microsoft tools:
[9] Source Control Provider (SCP) Selector