The secret ingredients in wine April 20, 2009 No Comments
This weekend we had a nice bbq at a friends house and of course, with any bbq, there is alcohol involved. At the moment, Claire’s allergies are flaring and she has become super sensitive to wheat, cows milk, eggs etc. It seems that there is something in wine that she is allergic to, but no bottles of wine put their ingredients on the bottles??
I did a bit of googling and found this article on the Daily Telegraph website.
The first paragraph starts:
“Ingredients routinely added to wine, such as fish extracts and charcoal, should be listed on the bottle so that consumers know what they are drinking, the Food Standards Agency (FSA) is demanding. ”
Interesting. Reading a bit further on and it lists some of the common names, Hardy’s, Jacob’s Creek and Blossom hill are routinely adding ingredients such as egg, gelatin, milk, tartaric acids, enzymes and even clay. These are used to make the wine less cloudy, add flavour and add colour. Some of the low end wines even add oak chips to make the wine taste a bit like its out a barrel!
At the moment the alcohol producers currently have an exemption from European Union food and drink labelling rules which means they do not have to list the additives – often used so that vast quantities of wine can all be made to taste the same.
In the only UK retailer who lists the ingredients on their bottles are the Co-op. I’m going to have a look this evening in Corfe Mullen to see whether they do and see what they include in their wines.
The below substances are all approved by EU authorities for use in the production of wine. Some of them are used in the winemaking process but are not found in the finished product. I’ve included Wikipedia links where there is one, so people can take a more detailed look at the ingredients.
| tartaric acid | copper sulphate | potassium caseinate |
| calcium tartrate | charcoal | ovalbumin (egg white) |
| betaglucanase | diammonium phosphate | lactalbumin |
| lactic bacteria | ammonium sulphate | bentonite |
| ion exchange resins | ammonium sulphite | silicon dioxide or colloidal solution |
| potassium ferrocyanide | ammonium bisulphite | kaolin |
| calcium phytate | thiamine hydrochloride | tannin |
| lysozyme | polyvinylpolypyrrolidone | pectinolytic enzymes |
| dimethyldicarbonate | calcium tartrate | sorbic acid or potassium sorbate |
| urease | calcium phytate | potassium tartrate |
| oxygen | lysozyme | potassium bicarbonate |
| lees | dimethyl dicarbonate | calcium carbonate |
| oak wood | argon | carbon dioxide |
| sulphur dioxide | nitrogen | acacia (gum arabic) |
| calcium sulphate | potassium bisulphite | calcium alginate |
| sucrose | potassium metabisulphite | potassium alginate |
| yeast cell walls | gelatin | allyl isothiocyanate |
| carbon dioxide | plant proteins | yeast mannoproteins |
| ascorbic acid | isinglass | |
| citric acid | casein |
Final Fantasy 13 Gameplay Footage April 17, 2009 No Comments
Square Enix have released a playable demo of Final Fantasy 13 on the PS3 that is being shipped with Japanese versions of Advent Children. Fortunately for us, some people have got copies and recorded the footage while they are playing. There are 5 parts, all about 9minutes each, which I will embed below for your enjoyment!
Have to say, the game itself looks pretty awesome. Unfortunately because the game is in Japanese, the menus all look rather confusing, but no doubt Square Enix have worked their magic and made it intuitive.
Part One:
Part Two:
Part Three:
Part Four:
Part Five:
Can’t wait for Final Fantasy XIII to be released!
Pirate Bay Torrents Verdict – Guilty No Comments
The main points and full story can be found on TorrentFreak, here. Check TorrentFreak for breakthrough updates.
Just minutes ago the verdict in the case of The Pirate Bay Four was announced. All four defendants were accused of ‘assisting in making copyright content available’. Peter Sunde: Guilty. Fredrik Neij: Guilty. Gottfrid Svartholm: Guilty. Carl Lundström: Guilty. All receive 1 year in jail.
While only a few weeks ago, it seems like an eternity since the trial of The Pirate Bay Four ended and the court retired to consider its verdict. The prosecution claimed that the four defendants were ‘assisting in making copyright content available’ and demanded millions of dollars in damages. The defense did not agree, and all pleaded not guilty – backed up by the inimitable King Kong defense.
Today, Friday April 17, the court issued its decision.
The court said that the four defendants worked as a team, were aware that copyrighted material was being shared using The Pirate Bay and that they made it easy and assisted the infringements. It categorized the infringements as ’severe’. The judge said that the users of The Pirate Bay committed the first offense by sharing files and the four assisted this.
While the court did not agree with the plaintiff’s estimates of losses (around $12m), it still set the damages at 30 million SEK ($3,620,000). This a hugely significant amount and the court has ordered that the four should pay this amount between them.
The judge also stated that the usage of BitTorrent at The Pirate Bay is illegal. Rest assured, other torrent sites hosted in Sweden will be keeping a close eye on developments.
At one point the judge was asked if he was concerned for his personal safety after handing down this decision. The judge said he hadn’t received any harassment and was quite surprised at the question.
Peter Sunde has already explained that this decision does not mean the end of the line in this case. There will be an appeal which means we are still far away from the ultimate decision – possibly years away. The case is now expected to move to the high court. Both sides have three weeks to file a written appeal.
As for the fate of the site, Peter has already promised that The Pirate Bay will continue. The site itself was never on trial, only the four individuals listed above.
Formula One – Diffusers, what the? April 16, 2009 No Comments
Finally the feud between Ferrari, Red Bull, BMW etc etc vs Toyota, Brawn GP and Williams has finally been resolved. I know this is a bit old news, as it was resolved yesterday, but I thought I’d write a post anyway.
The item in question, the diffuser, is effectively an extension of the floor at the back end of a racing car, it is situated between the rear wheels. It’s a key part of the aerodynamics as it can create a lot of downforce and reduce drag, which helps the cars to stick to the ground. It works by collecting and gathering all the high speed air that is rushing under the car, making the window flow more straight line. As Toyota, Brawn and Williams have slightly more sophisticated diffusers (split / triple level), they can collect more air thus creating even less drag and even more downforce.
This is the problem with new blanket regulations because but fortunately for Brawn, Toyota and Williams they have interpreted the regulations covering the shape and dimensions of the diffuser in a way that their rivals have not. Which has turned out to be a vital point at the start of this season, as we have seen by Jenson Button winning the first two races and qualifying on pole both times.
Unfortunately for some of the teams (I think it’s Red Bull), they can’t actually incorporate these now legal diffusers into their car due to restrictions on their suspension preventing them from shoe-horning it into the area at the back of the car. I wouldn’t be suprised if McLaren, Ferrari, Renault and possibly BMW will be running one driver with a new diffuser from friday practice in Shanghai. Now with testing only allowed at specific times throughout the weekend, testing these new parts will be a bit of a crash course, but that is something the teams need to sort out.
As for my prediction, I reckon this weekend will be a good one for Williams and Rosberg. I’m still backing Niko Rosberg to be my suprise of the season, taking the title from Sebastian Vettel last season; and having the extra diffuser should help!
As for qualifying; I wouldn’t be suprised if Button / Barrichello are on the front row again, as the Brawn GP cars have the straight line speed and agility to get around the hairpins on Shanghai.
7am start on Sunday… ngggg.
Engagement Shoot Photos No Comments
Last week Claire and I had a free engagement shoot with our photographers.. We have bought the copyrights for the images, some of which you can see on facebook.
Those that aren’t on facebook can be seen here.
They have done a good job on the photos, so can recommend them! Lets hope there are some good shots on the wedding day, which I’m sure there will be :)
Bit of blurb about them; Photofinish-UK are based at Longham Business Centre, which suprisingly is in Longham, on the way to Ferndown just down from the Angel Pub. The package price was good, especially as we have a discount for it being a midweek wedding. We also managed to get a signature frame chucked in too, which will be there for everyone to sign at the reception; no obscenities please, yes, that means you Daz and P :)
Top search queries – Google Webmaster March 31, 2009 No Comments
I’ve had the site up a while now and it’s slowly getting indexed within Google for various search terms, which is quite interesting to see, and it is a good way to see what people are searching for to appear at the site!
Google Web Master Tools is a free tool from Google that collates this information and more. There is a section called “Top Search Queries” which I have pasted below!
This data is based on Impressions and it is the top 20 queries in which your site appeared, and the percentage of the top 20 queries represented by each search.
| # | % | Query | Position |
|---|---|---|---|
| 1 | 47% | clicktag | 9 |
| 2 | 24% | ian bailey | 6 |
| 3 | 3% | sortexpression “vb net” | 11 |
| 4 | 3% | “gridview sorting” “vb net” | 43 |
| 5 | 1% | wordpress ian bailey | 1 |
| 6 | 1% | c# “webcontrols sortdirection ascending” | 2 |
| 7 | 1% | gridview sort | 2 |
| 8 | 1% | word press ian bailey | 5 |
| 9 | 1% | gridsortexpression | 6 |
| 10 | 1% | gridview save to viewstate | 6 |
| 11 | 1% | death stats | 7 |
| 12 | 1% | viewstate gridview | 8 |
| 13 | 1% | swf clicktag c# | 9 |
| 14 | 1% | gridview_sorting “vb net” | 10 |
| 15 | 1% | tank stats | 10 |
| 16 | 1% | root clicktag | 31 |
As you can see, posting my code orientated posts is starting to slowly work! I’m not sure how well the things like tag cloud (see right) and meta tags are working, but I can see that when people google for content in the posts, it is appearing. It’s all about the keywords! Also remember, this is only on .co.uk I think, which isn’t suprising as its a .co.uk domain.
Website 404 Link Checker / Dead Link Checker March 20, 2009 2 Comments
After doing lots of changes to a website, it’s always good to test your links (if you have made any) to see if they cause a 404 error due to a simple typo.
The W3C Link Checker is an invaluable tool for this, as it will crawl / trawl / spider through a fair few pages on your website and check anchor tags and see if they are causing any errors. Link here.
I used this tool quite a few times today and it has found my 404′s every time! It even finds pages that are set to redirect and informs you, so you know if this is correct or not. It can take quite a bit of time if there are a LOT of links on your page, but it will never time out.
I’d like to know how they coded it, looks like it uses AJAX as the page does not refresh but it still updates the results before your eyes!
There is another Dead Link Checker located here at SubmitShop, which doesn’t just check anchor tags, but it hits all the images as well and checks their status. I’ve been running both to find all my bad links, the results are easy to see, it simply flags up as BAD if it is well, a bad link!
GridViews and Paging – ASP.NET VB.NET March 17, 2009 No Comments
Following on from the post about Sorting, another important aspect of .NET GridViews is the functionality of paging. Paging is effectively creating different pages for your set of results, so you aren’t bombarded with 500 results on one long page.
To turn paging on, set the below property of the GridView to TRUE.
<asp:gridview allowpaging="true">
PageSize="20"
ID="GridView1">
</asp:gridview>
Setting the PageSize will 20 means it will display 20 results per page, then small numbers will appear under the bottom right of the GridView.
To handle the Paging method, use the below function:
Protected Sub gridView_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs) Handles GridView1.PageIndexChanging
Dim newPageIndex As Integer = e.NewPageIndex
GridView1.PageIndex = newPageIndex
MethodToBindGridView()
End Sub
As you can see, it is a lot easier than configuring sorting!
It is also possible to put a CSS class on the Paging controls, as by default, they are simple text numbers. To use a CSS class, you need to set the following property on the GridView:
PagerStyle-CssClass=”paging”
Sorting and GridViews – VB.NET March 13, 2009 1 Comment
GridViews have a handy option called “Sorting”, which can be set to true or false. Unfortunately, this enables the sorting, but in the default classes there is no code to handle the sort event, so unfortunately you had to add it yourself.
It’s not quite as simple as you’d like, as you need to handle the ascending and descending choices and then rebind the gridview after each click.
Below is an example of the code for VB.NET / ASP.NET. This could easily be converted to C# .NET, in that case the ASP.NET code stays the same.
First you need to setup the code before the GridView is bound telling it which way to display the results, this can be done with the below code:
'apply sorting filter
Dim sortExpression As String
If gridSortDirection = SortDirection.Ascending Then
sortExpression = gridSortExpression & " ASC"
Else
sortExpression = gridSortExpression & " DESC"
End If
ds.Tables("Results").DefaultView.Sort = sortExpression
GridView_Default.DataSource = ds.Tables("Results").DefaultView
You then will need to add two private properties which will change the gridview order, but also, more importantly, set it when the page is loaded and define which column you will be doing the default sorting by. The SortExpression can be assigned to which column you wish to sort by and SortDirection is of course the direction, ASC of DESC.
Private Property gridSortDirection()
Get
' Initial state is Ascending
If (ViewState("GridSortDirection") Is Nothing) Then
ViewState("GridSortDirection") = SortDirection.Ascending
End If
' Return the state
Return ViewState("GridSortDirection")
End Get
Set(ByVal value)
ViewState("GridSortDirection") = value
End Set
End Property
And the SortExpression controller.
Private Property gridSortExpression()
Get
' Initial sort expression is DepartmentID
If (ViewState("GridSortExpression") Is Nothing) Then
ViewState("GridSortExpression") = "ZoneID"
End If
' Return the sort expression
Return ViewState("GridSortExpression")
End Get
Set(ByVal value)
ViewState("GridSortExpression") = value
End Set
End Property
You also need to add code to handle when a user clicks on the headings to initate the sort, this can be handled using the below code:
Protected Sub gridView_Sorting(ByVal sender As Object, ByVal e As GridViewSortEventArgs) Handles GridView_Default.Sorting
' Retrieve the name of the clicked column (sort expression)
Dim sortExpression As String = e.SortExpression
' Decide and save the new sort direction
If (sortExpression = gridSortExpression) Then
If gridSortDirection = SortDirection.Ascending Then
gridSortDirection = SortDirection.Descending
Else
gridSortDirection = SortDirection.Ascending
End If
Else
gridSortDirection = WebControls.SortDirection.Ascending
End If
' Save the new sort expression
gridSortExpression = sortExpression
' Rebind the grid to its data source
DisplayItems()
End Sub
You can set which columns you want to Sort by on your gridview using this variable:
<columns>
<asp:boundfield datafield="DataField" headertext="TestColumn" sortexpression="DataField" />
</columns>
Utilising FileUpload with duplicate file names March 11, 2009 No Comments
Heres a good piece of code which is useful when you are using the FileUpload control to upload files to your web server, but require it to not overwrite the original, but rename it instead by appending a number onto the end. The below code example is in VB.NET for ASP.NET, this could easily be converted into C# .NET, but as I’m coding in VB.NET for now, that is what the example is in!
Private Function GetNextFileName(ByVal path As String, ByVal base As String, ByVal extension As String) As String
Dim fullFileName As String = System.IO.Path.Combine(path, base & extension)
If System.IO.File.Exists(fullFileName) Then
Dim counter As Integer = 0
Do
counter = counter + 1
fullFileName = System.IO.Path.Combine(path, base & "_" & counter & extension)
Loop While System.IO.File.Exists(fullFileName)
End If
Return System.IO.Path.GetFileName(fullFileName)
End Function
I have made the function work by passing the file path, base is the filename without an extension and extension is the file extension. These can be retrieved using methods in the System.IO.Path class called GetFileNameWithoutExtension and GetExtension.
Once passed to the function, it checks to see if that file exists and if so it will add an underscore, followed by a value (in a loop incase of multiple file uploads) to the original combination of path, base and extension. This is then returned by the function to my save method, which saves the file from the FileUpload with the new dynamically created name.