Main menu:

Experimental Space

CSS, .Net, XHTML, flash, flex and general web development information


My new ‘garden’ space

I’ve wanted to try growing vegetables for a while now but my garden is rather restrictive being only 15ft x 15ft and of that already being fully occupied by flowers, some outdoor storage space and a small table and chairs. I found an allotment conveniently near my house however after enquiring about it found that there is a 2-5 year waiting list :(

I searched online and found a guy nearby that was offering his un-used garden space behind his house as an allotment-style area for someone and since then have grabbed it up and started to work through it. It’s going to be a rather tough going job as the ground I’ll be working with hasn’t been tended to for quite some time, being laid with tarps in attempt to control the weeds and then gravel being placed over the tarps when they failed to suppress the weeds. The area is approximately 10m x 4m although I think I will just work on a small chunk at a time as I need more and more room for plants.

Here’s two views of the garden after I’d already been working on it for a bit, trying to first clear most of the gravel on the tarps so I could put them off the ground.

The beginnings of the garden
The beginnings of the garden


After a days work of weeding, pulling tarps off, finding more weeds under the tarps and then finally starting to upturn the soil, this is what the result so far looks like:

After some work on the garden



The plants shown in the newly dug garden area are from the neighbors that were thinning out their plants and offered some to me. I don’t know if I’ll keep them because I had intended to have a vegetable plot but I have at least stuck them in the ground temporarily so they don’t wilt.

In seed trays at home I have prepared pumpkins, spring onions, broccoli, and courgettes to germinate. I also have pea and carrot seeds which I will sow directly once the garden is properly prepared. Hopefully something grows!

Fingerless Gloves

Really quick and easy fingerless gloves.
Fingerless Gloves pattern
Things you need:
- 100g Acrylic yarn
- 4mm needles (I used straight needles)

___

Stitch definitions

KFB (Knit in front and back)
– Good tutorial here: How to KFB

PFB (Purl in front and back)
- Good video on here (scroll down to PFB definition) How to PFB

C4F (Cable for front)
- Slip next 2 sts off left needle onto a cable needle at the front of the work, k2, knit 2 stitches from cable needle

C4B (Cable for back)
- Slip next 2 sts off left needle onto a cable needle at the back of the work, k2, knit 2 stitches from cable needle
Fingerless Gloves pattern

SKPO (Slip 1, knit 1, pass slip stitch over)
- Slip next stitch onto right hand needle, k1, pass slipped st over knit st

Left Cable Pattern
Row 1: k7, p2, k8, p2, k25
Row 2: p25, k2, p8, k2, p7
Repeat rows 1 & 2 once
Row 5: k7, p2, c4f, c4b, p2, k25
Repeat row 2
Repeat row 1 and 2 again

Right Cable Pattern
Row 1: k25, p2, k8, p2, k7
Row 2: p7, k2, p8, k2, p25
Repeat rows 1 & 2 once
Row 5: k25, p2, C4F, C4B, p2, k7
Repeat row 2
Repeat row 1 and 2 again

Fingerless Gloves pattern
_____

Left thumb bit

CO 22 sts

Row 1: K2 * p2, k2 * (Repeat from *-* to end)
Row 2: P2 * k2, p2 * (Repeat from *-* to end)

Repeat Row 1 once more

Row 4: Rib 14 sts, cast off 8 sts, put the 14 remaining sts on a holder

Put sts on a holder for later
Fingerless Gloves pattern
_____

Left glove

CO 42 sts

Row 1: K2 * p2, k2 * Repeat from *-* until end
Row 2: P2 * k2, p2 * Repeat from *-* until end

Repeat Row 1 once more

Row 4: Rib 29 sts, pfb, rib 2, pfb, rib until end (44 sts)

Rows 5 – 12: Knit one full round of the left cable pattern

Row 13: Left cable pattern for 22 sts, cast of 6 sts, knit to end

Row 14: Purl 16 sts, purl across 14 thumb sts from stitch holder, continue in cable pattern until end (52 sts)

Row 15: Left cable pattern for 22 sts, skpo, k10, k2tog, knit to end

Row 16: Cable pattern

Row 17: Cable pattern 22 sts, skpo, k8, k2tog, knit to end

Row 18: Cable pattern

Row 19: Cable pattern 22 sts, skpo, k6, k2tog, knit to end

Row 20: Cable pattern

Row 21: Cable pattern 1 st, skpo, k4, k2tog, knit to end

Row 22: Cable pattern

Continue pattern until it reaches just past the bottom of your palm with RS facing

Knit 1 row

* k2, p2 * Repeat from *-* to end
* p2, k2 * Repeat from *-* to end
Repeat last two rows 4 more times

Cast off loosely. Done one glove!

_____

Right thumb bit

CO 22 sts

Row 1: K2 * p2, k2 * (Repeat from *-* to end)
Row 2: P2 * k2, p2 * (Repeat from *-* to end)

Repeat Row 1 once more

Row 4: Cast off 8 sts, rib to end, put the 14 remaining sts on a holder

Right glove

CO 42 sts

Row 1: K2 * p2, k2 * Repeat from *-* until end
Row 2: P2 * k2, p2 * Repeat from *-* until end

Repeat Row 1 once more

Row 4: Rib 11 sts, kfb, rib 2, kfb, rib until end (44 sts)

Rows 5 – 12: Knit one full round of the right cable pattern

Row 13: K16, cast off 6 sts, continue in pattern until end

Row 14: Cable pattern for 22 sts, purl across 14 thumb sts from stitch holder, purl until end (52 sts)

Row 15: Knit 16 sts, skpo, k10, k2tog, cable pattern to end

Row 16: Cable pattern until end

Row 17: Knit 16 sts, skpo, k8, k2tog, cable pattern to end

Row 18: Cable pattern until end

Row 19: Knit 16 sts, skpo, k6, k2tog, cable pattern to end

Row 20: Cable pattern until end

Row 21: Knit 16 st, skpo, k4, k2tog, cable pattern to end

Row 22: Cable pattern until end

Continue pattern until it reaches just past the bottom of your palm with RS facing

Knit 1 row

* k2, p2 * Repeat from *-* to end
* p2, k2 * Repeat from *-* to end
Repeat last two rows 4 more times

Cast off loosely, two sides done!

_______

Join cast off sts of thumb to cast off sts of main glove pieces.

** Update **
I am currently working on a dual-colour version of these gloves and once I’m happy with the outcome I’ll post that pattern as well.

Error when trying to install full Visual Studio : You must uninstall all the pre-release products in a specific order before you can continue with setup

If you had been participating in the Beta program and once expired want to install the full 2008 you might come across this error. The dialog box will tell you which programs / components it wants you to delete before allowing you to install, however sometimes you won’t be able to find them in add/remove programs. Before you try what I originally did and delete nearly everything, most of which didn’t need to be deleted, try these steps:

1. Download msiinv.zip
2. Extract the contents of msiinv.zip to the folder c:\msiinv on your system
3. Click on the Start menu, choose Run, type cmd and click OK
4. Run c:\msiinv\msiinv.exe -p > c:\msiinv_output.txt
5. Open the msiinv_output.txt document and search for that damn program you hadn’t been able to find
6. Grab it’s program code which will look something like this: {90120000-0021-0000-0000-0000545446}
7. Open command prompt and run this line with your product code instead of the one I’ve used: Msiexec /x {90120000-0021-0000-0000-0000545446}
8. Repeat 6 & 7 for each of the programs you needed to uninstall
9. Run the VS 2008 installer again and you should be alright

If luck just isn’t going your way and it still isn’t working, try this link for further ideas:
http://blogs.msdn.com/varungupta/…..

Sorting Gridview (Get it working quick!)

There are lots of references out there for getting a sortable gridview up, however I feel each of them are missing certain bits of information which make them incomplete. I ended up having to use three different references before I could get mine working!

Firstly, the stuff you are here for, the complete code to get a sortable gridview up and working! Below the code are the details you may/may not want to be bothered with.

.aspx.cs file

using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
private string _connectionString;
private SqlConnection _conn;
private const string ASCENDING = " ASC";
private const string DESCENDING = " DESC";

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
gvSortable.DataSource = getData();
gvSortable.DataBind();
}
}

private DataSet getData()
{
_connectionString = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString;
_conn = new SqlConnection(_connectionString);
SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM tbl_user", _conn);

DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}

public SortDirection GridViewSortDirection
{
get
{
if (ViewState["sortDirection"] == null)
ViewState["sortDirection"] = SortDirection.Ascending;

return (SortDirection)ViewState["sortDirection"];
}
set { ViewState["sortDirection"] = value; }
}

protected void sortGv(object sender, GridViewSortEventArgs e)
{
string sortExpression = e.SortExpression;

if (GridViewSortDirection == SortDirection.Ascending)
{
GridViewSortDirection = SortDirection.Descending;
SortGridView(sortExpression, DESCENDING);
}
else
{
GridViewSortDirection = SortDirection.Ascending;
SortGridView(sortExpression, ASCENDING);
}
}

private void SortGridView(string sortExpression, string direction)
{
DataTable dt = getData().Tables[0];
DataView dv = new DataView(dt);

dv.Sort = sortExpression + direction;
gvSortable.DataSource = dv;
gvSortable.DataBind();
}
}

.aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Sorting Gridview</title>
</head>
<body>
<form id="form1" runat="server">

<asp:GridView ID="gvSortable" runat="server" Width="100"
AutoGenerateColumns="false"
AllowSorting="true" OnSorting="sortGv">
<Columns>
<asp:boundfield DataField="user_id" HeaderText="Id" SortExpression="user_id" />
<asp:boundfield DataField="name" HeaderText="Name" SortExpression="name" />
<asp:boundfield DataField="age" HeaderText="Age" SortExpression="age" />
</Columns>

</asp:GridView>

</form>
</body>
</html>

Add into the webconfig

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=YOUR_SERVER_URL_HERE;Initial Catalog=YOUR_DB_NAME;Persist Security Info=True;User ID=YOUR_USER_NAME;Password=YOUR_PASSWORD;" providerName="System.Data.SqlClient"/>
</connectionStrings>

If you stick all of this code into your project and have a table (tbl_user) with user_id (int), name (varchar) and age (int) then your gridview will be up and working already!

You can choose to divert from the above and go with different options, but for seeing it working the code above is all that you need.

I’m going to revisit this post later to add in some options and comments however for now I have to go finish the project that I needed this sortable gridview for in the first place!

Change database owner in SQL server
(single and multiple items)

Changing a single table owner:

Exec sp_changeobjectowner ‘dbo12323.my_table’,’dbo’

dbo12323 = make this whatever the table currently has as the db owner
dbo = the new db owner

Changing multiple items owners:

SELECT * from sysobjects where uid = user_id(’UseNAme’)
declare @Return int
exec @Return = sp_configure ‘allow updates’, ‘1′
SELECT @Return as ‘Returned Code’
GO
reconfigure WITH OVERRIDE
GO
DECLARE @Rows int, @Error int
BEGIN TRANSACTION
update sysobjects set uid = user_id(’dbo’) where uid = user_id(’UseNAme’)
SELECT @Error = @@Error, @Rows = @@RowCount
SELECT @Rows as ‘#Rows’
IF @Rows > 0
BEGIN
SELECT @Rows AS ‘#Rows’
COMMIT TRANSACTION
END
else
BEGIN
SELECT @Error AS ‘Error #’
ROLLBACK TRANSACTION
END

exec sp_configure ‘allow updates’, ‘0′
reconfigure WITH OVERRIDE
go

Babbel – Learn Italian easily in this flex based environment

I’ve ’started’ to learn several different languages, all ending up in the same place that I didn’t want to spend the time or money taking classes at a school or a lot of money on a set of training-up cd’s. Recently I’ve taken to learning Italian and started by purchasing a rather in-expensive cd from Earworms (warning, the site is not high on the ‘pretty’ scale) whose method actually works really well. It combines the learning experience with a base of music, the same concept as putting the alphabet to a tune to help it stick in your mind.


As of yesterday however, I discovered Babbel.com, a flex based (+1 point) online language learning tool (+1 point) that is free!(+10 points!!) I registered and had a play through two of ‘packages’ and found the user-experience and ability to learn from it to be excellent. They start off by teaching you single words, which are each associated to an image, they then eventually go on to teach you to memorise them and learn to understand them when spoken within phrases. By the end I was very pleasantly surprised at how much I got through and how much was easily retained into memory. They also marked one of my finished exercise packages as needing a refresher in 4 days time, which I think is great to keep you interested and remembering previous lessons. So there’s my bit raving about how great it is for learning a new language, which isn’t just available for Italian either, but so far it also has German, French and Spanish.

I’m quite pleased to see it’s been created with Flex. It’s allowed them to create a fluid learning step-through environment, making it easy to learn the language. It’s also good to see that they’ve made it really simple for the community to contribute to it. On the home page, for example, there is an area of phrases that require images, and you as a user can click one of these phrases and choose to upload an image that you believe describes this phrase best. You can also mark images that others have uploaded as good/bad as you go through the exercises, although what effect that ultimately has on the image you’ve marked I’m not quite sure yet. All in all I still have to have a thorough play in it, but it is by far the best tool I have ever used for learning a language and I highly recommend you give it a try as well.

Ciao!

I’m a mac girl

Mac girlOh yes, I’ve got a MacBook Pro and am immensely proud of it as well. As a new mac user I was (and still am) noticing constant ‘attention to detail’ bits that make using a computer ‘fun’ again. Ok, so that sounds really cheese but it’s true! Little things like when it’s too dark the keyboard lights up (ok, I might have got a wee bit over excitable at that one than I should have) or how nice most installations are comparatively to Windows. The initial drawback is having to experience the humbling effect it has when you can’t figure out what should be the simplest tasks, the ones that you laugh at your mom for when she gets completely lost, I am now my mom (to mom: sorry for the reference).

So after the first 2 hours playing with Photo Booth I finally was ready to put the intriguing effects away and get some programs on so I could actually use it for development. I had / decided to go in search of a few different programs than normal to suit the mac environment.

Adium - An excellent IM client for MacFirstly, of course, was an instant messaging system. I ended up installing Adium and seems to be working out just fine so far. It has most of the features you’d expect in a typical IM client and it also allows for multiple email addresses to be bundled and controlled at once.

I also really needed a remote desktop client to access our Windows servers at work and found and would highly recommend one named CoRD. So far I’ve found this program to be excellent, allows for connections to be saved and easily connected to, multiple connections at once and generally well provide a well organised system for managing remote access to our Windows servers.

I do quite a bit of .net development so it led to a bit of a problem in that you can’t get a version of visual studio for Mac (yet). A solution I’ve found and I’m sure many of you are familiar with already is Parallels - An excellent VM allowing you to use Windows programs on your MacParallels. A virtual machine that allows me to set up Windows and run the programs which I otherwise couldn’t have running off the Mac. I’ve read though a lot of the documentation and can’t seem to find if you are supposed to download all of the windows updates and install anti-virus as if it was a completely separate machine so if someone has some advice on this it would be much appreciated. At any rate I have decided to take the safest route for now and get all the updates and install Clamwin on the VM, a free anti-virus for Windows.

I still have to sort a few other programs that I’m going to need but I’m rolling along nicely now
Does anyone know of a good Mac program that works well with Exchange? Mail just isn’t cutting it and prefers to spaz out then keep a constant and accurate connection with my new emails…I blame exchange (I love my Mac, it can do no wrong)

“I’m not hungry when I listen to techno”
- Flash on the Beach 2007

I love flash conferences, the ones I’ve been to have always had such an excellent selection of speakers and the general atmosphere is so lively and friendly (ok, so maybe not so lively first thing after a disco-styley party, but still).

The speakers I had the pleasure of seeing were:
Erik Natzke
Joshua Davis
Robert Hodgin
Brendan Dawes
Craig Swann
Carlos Ulloa
Hoss Gifford
Aral Balkan
Branden Hall
Grant Skinner
Keith Peters
Tink
Jared Tarbell
Ted Patrick
André Michelle

…and a little bit of Mario Klingemann at the 20 minute / 3 speaker session that they arranged last minute.

If you want to see what each speaker had to say, visit Dan’s blog cause I just snuck a peek over his shoulder to see him writing nice little details about each session we saw, so I’ll won’t go much into that and actually get some sleep while he does all the extra bits! Woohoo!!

But from creating insanely beautiful globes of light moving to audio created straight from numbers and code you couldn’t have been disappointed or uninspired.

My favourite quote from all of the FOTB’s sessions would have to be André’s answer to overrunning into lunch time and when being asked to wrap it up replied with “I’m not hungy when I listen to techno”. Queue well deserved applause. :D

Already looking forward to the next flash conference, and hopefully inbetween now and then I’ve actually sat myself down and put some of what I’ve learned into practice.

Import CSV to SQL Server Database

Quick steps to importing a csv to a sql server database. There are a couple first steps incase you have an existing database that you should make a backup copy of first or you can skip right to step number 3 which highlights the import itself.

1. Creating a backup of existing table

The code to take a table and back it up in case you do something wrong!

SELECT *
INTO tbl_mytable20070110
FROM tbl_mytable

TRUNCATE TABLE tbl_mytable;

That will take all of your existing table data and put it in a safe backup file. The truncate function then erases all of your tbl_mytable data, ready for the new data to be entered.

2. Conforming the CSV to date compliancy

Ensure the dates of your csv are in yyyy-mm-dd format to avoid any global date format issues.

3. Import the CSV data to the SQL database

  • Open SQL server and right click on the database’s ‘table’ section.
  • Choose ‘All Tasks > Import Data > Next’
  • Choose ‘Text’ from the drop down as the import file type and then browse to the location of your CSV file.
  • Click for larger example of choosing text

  • Ensure ‘delimited’ option is chose and that ‘first row has column names’ is ticked. Hit next
  • Click for larger example of choosing file format

  • Choose ‘Comma delimited’ and hit next.
  • For the destination source, make sure ‘Microsoft OLE DB Provider for SQL Server’ is chosen. I used the SQL server authentication. Choose the Database you wish to import the data too and hit next.
  • Click for larger example of choosing destination

  • In the ‘source tables and views’ window, select ‘destination’ and choose the tbl_mytable that you will be importing the data to.
  • Click ‘transform’ (the … button)
  • Ensure that all of the ‘Source’ items correctly match the ‘Destination’. Change as necessary.
  • Click for larger example of column mapping

  • Un-tick ‘Enable identity insert’ and hit OK.
  • Choose ‘run immediately’ if not already chosen and hit next and then finish.

Now this is the way that some CSV imports will work, you may have to adjust if you do not use column names in your excel/CSV document for example.

Growing from seeds : Part two…

Seeds in warm water overnight to encourage germination If you’ve read part one of “Growing from seeds” I’m sure you’ve been left cliff-hanging wondering what has happened to the seeds since their overnight warm water bath! Ok, so maybe not quite cliff-hanging but here’s the end to the seed planting opening scene nonetheless.

The sweetpeas and the lupins experienced a nice warm water bath over night to encourage germination, so in the morning I positioned myself in the usual ‘rainy-day, dry porch’ spot and started putting the seeds into the propagator. Sweet pea seeds in the propagator before covering with a layer of compost I’ve been using general purpose compost, which indications on the bag it is ideal for baskets, cuttings and seeds. I’ve recorded which colour sweetpea seeds were put which cells as I’m curious to see if it impacts which colour they ultimately grow as. I had yellow, brown and black seeds. Hopefully we’ll see soon!

Both of the propagators are now taking up the spare room’s windowsill and they all have different germination expectancy dates, with the soonest being 10 days (sweet peas) so hopefully in 10 days times I’ll be seeing some green work its way out from the compost.

I found a good reference guide here as well: (For sweetpeas)