Friday, September 19, 2008

How to diet the JTB way:

Please read my previous blog regarding how to calculate your BMI:

http://www.jtbarton.com/Blog/default,date,2008-09-19.aspx#a3a7adbdb-ca53-4341-a5a7-b3aa39f9ab6f

and at least this site about your BMI and what (Body Mass index means)

http://en.wikipedia.org/wiki/Body_mass_index

and for a really easy to use BMI calculator visit:

http://www.halls.md/body-mass-index/av.htm

Still reading...

Well, you have to realise you've got a problem, if you don't, just keep eating, you will die soon enough.

According to eveyone I discussed my diet with, it's not the reccomended approach, but here goes:-

  1. Cut out a meal ( I only used to eat lunch and an evening meal), so now I just have an evening meal.
  2. Excersie

Ok, So what has that actually meant:

Before

Well I tend to start work at 7:30am, get a large sandwich and extra for lunch and be back at work 20 minutes later, continuing until 4:30pm or 5:45pm, thats 8hrs 40 mins to 9hrs 45mins a day.

Now

I still get in at 7:30, but have realised that being healthy and alive is the most important thing to both myself and my company, I've done something everyone can do - start walk during my lunch period.

I'm not joking - Instead of getting a sandwich and an after snack, I've started walking every lunch hour and not eating.  Not only do you feel healthier after your walk, you do not even feel like eating.

If its raining (heavily, still don't eat, just walk twice as long the next day, work during lunch on day 1 and take a 2 hour lunch on day 2, it up to you to determine if you feel you can walk that far (about 6 miles) ), otherwise still walk.

A routine is the best thing you can achive.

Most of all be happy with they way you feel and what you know you are achiving.  I like to walk during the lunch period because in the UK we have a very good debate and current affairs program between 12:00 and 13:30 on Radio 4 followed by lively debate until 14:00 on Radio 2

I still go home at the same time in the evening, but I cannot be sure, but I feel metally alived and refreshed in the afternoon, although sometime physically exhauted.

To all Dieters, just lose it, we know we can!

Friday, September 19, 2008 9:19:41 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 

I quit smoking last your (well just about, 28 December 2007) and at the time I weight about 18st, (252lb, 114.5kg) since then I have gradually gained weight reaching a current total of 20st 8lb (288lb, 131kg). My height is 5' 10" (70", 178cm).

I looked up BMI at the time and was shocked to find it was above 40 (actually it was 41.41) which is considerably over the standard limit. So I wanted to know how the BMI was calculate, just to prove that bit sticking out in front of me was actually fat.

Being mathematical I wanted to know how the BMI was calculated, then a very kind American friend (he said I was not that overweight) say how was the BMI (body mass index) calculated.

So here's how the BMI is calculated KG / M^2.

That's probably Greek to most people as we say in the England. So I've decided to explain the calculation at least in English:

Height : Ft ' In ', this will require a translation to metric metres, its not that difficult

(ft * 12) + In, so for me that (5' * 12 ) + 10" = 70" now multiply this by 0.0254 ( that the number of inches in a metre) = 1.778 (fig A)

Weight : St (Stone) Lb (Pounds), Ok so I was (20st 8lb, in US that (20 * 14 (Lb per St is 14)) plus the Lb ( 8 lb )= 288lb (fig B)

So to convert this to metric its simply a case of Lb / 2.2 which gives you Kg (so in my case its 130.9kg, fig C)

BMI (Body Mass Index) :  The formula is simple its Kg / M^2, but again lets just explain how to work that out

In simple form its ( fig C / ( fig A * fig A) ) = BMI

So using my calculation above this is :

Weight (130.9Kg, fig C) / (1.778, fig A * (multiplied by) 1.778, fig A which gives 3.1612) and a final BMI of 41.40

Or to show it just as my weight this is = 130.9+(1.778*1.778) = 41.40 BMI

So for:

UK people its ( Weight (Kg) * ( (Height cm / 100 ) * (Height cm / 100 ) ) )

US people its ( Weight (lb) / 2.2 ) * ( Height ( ( ( ft*12) + In ) * 0.254 ) * Height ( ( ( ft*12 ) + In ) * 0.254 ) )

No matter how you look at it, I am fat!!

Do I care, well yes, I actually feel uncomfortable with my weight so I'm doing something about it.

I'll keep my blog posted about how my weight loss is going.

Friday, September 19, 2008 8:31:15 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Friday, May 16, 2008

A friend of mind Claudio recently told me he had been working in the software development industry for just over 5 year with the same company, this is the second time he's worked for a company this long, (read his blog to understand how and what a fascinating background Claudio has), and it got me thinking on how long I'd being working within the steel industry and software development generally.

The short answer is 21 years, covering languages such as Z80 & 8086 assembly, C, FoxPro and finally C# (thanks Claudio for the assist), the longer answer is that I've worked for the same company for 21 years as of May 01 2008, first company a steel fabricator for 11 years to the day, then sold to another software house, who then sold me on to FabTrol Systems, giving a total of 21 years without changing job (at least on my behalf) as of May 01 2008, having started on May 01 1987, and I'm steel happy in steel, but some may ask if I'm a U2 fan and I've "steel not found what I'm looking for"!

Friday, May 16, 2008 10:04:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Thursday, April 17, 2008

Wow what a set of products:

  • Visual Studio 2008
    • is the most productive version of an application developers platform ever release.
  • SQL 2008
    • A great product by all accounts - It will give the development world tools to deliver enhance BI (Business Intelligence - If they have any) to all (it may take a while to get to grips with)
  • Server 2008 -what an experience (Orgasmic)
    • I'm a developer (did you not guess) but seeing this product launched, I wanted to change camps, I'm a tech know, no, wishing I'm an IT guru (wasn't that a film about being a sex guru)

Anyway, my many thanks once again go to Black Marble personally (yes, that even included their management, and I'm not being paid (yet) for saying that) for letting me loose, along with their many guest Black Marble had to their well represent and acknowledged event.

My experience was gained through 10 hours of FREE consultation by a local company to Yorkshire run by 3 very professional MVP's all employed or owners of Black Marble

Thursday, April 17, 2008 10:37:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Friday, November 23, 2007

Did you know that Microsoft in partnership with Black Marble are hosting developer events in Leeds and Bradford, West Yorkshire.

I've been to the last 3 events hosted by Black Marble in association with Microsoft, which were on the subjects of (latest first):

  • SQL 2008 (afternoon) - in the evening was a compressed re-run of Mix UK.
  • What's news in VS 2008, WPF, WCF, WF & CardSpace
  • Ajax and ASP.net 3.0

Well, I wanted to say a big thank you to all the staff at Black Marble for hosting these events, and to the Microsoft evangelists for presenting at these events.

The best appreciation I can show is by linking to each of these companies, people (via their blogs) or forthcoming events:

Microsoft UK staff:

Black Marble who host the MSDN events, also have there own very knowledgeable speakers who provide feedback at:

If you are interested in attending the next events visit MSDN event in the North (Bradford / Leeds - Tong)

Friday, November 23, 2007 12:40:18 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Thursday, November 22, 2007

Microsoft have release Visual Studio 2008 early (wow, is this a first).

Also available are the team editions and Team Foundation server of the professional, Team and Express edition is now available.

A 90 day free trial for non-MSDN subscribers is available at VS2008 trial 

For more information review Scott Guthrie's blog article - Visual Studio 2008 and .NET 3.5 Released - ScottGu's Blog

Enjoy and experience the new features of Windows Presentation Foundation, Windows Communication Foundation, Windows Workflow, CardSpace, , Silverlight, Ajax Extensions and many many more new features.

Again, for details of what is included within VS2008 see ScottGu's Blog.

Thursday, November 22, 2007 10:31:28 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Friday, November 09, 2007

Well, I dragged it out, and my lawnmower was just about cutting the grass but taking me forever, so what did I do.

Was really lucky and found a local company to fix it Power Equipment Repairs for lawn mowers in Yorkshire, what a job they done.  I cut my neighbors grass just for fun when it was returned and was so impressed, I even cut my own once more before the session ended.  Lets just hope my grass does not grow too much over the winter, but with these new blades I'm know it wont be an issue.

Friday, November 09, 2007 8:28:07 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Thursday, October 04, 2007

I wanted to test Windows Live Writer Beta 12 in association with my DasBlog site.

So this is just a test post to ensure that items are been raised correctly.

Thursday, October 04, 2007 12:01:44 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Saturday, July 07, 2007

Comment and links for recommendation to next meeting,

Feel free to share and discuss!

CrazyMan Miles

Friday, July 06, 2007 11:42:23 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Wednesday, July 04, 2007

I've wanted to link the following type of issues back to an article I've previously blogged about:

  • A web page back to an article I've previously written.
  • One article to another article using DasBlog.

but was unsure how to go about this, well it took me a while to figure out (but I'm stupid) so here goes my answer:

When you click on you blog, you can click on a date, and it will give you a link such as www.jtbarton.com/Blog/default,date,2007-07-04.aspx but this is not what you want to use, just imagine you posted 20 blog that day and you want to link to a single blog article, how do you find the specific item.

Well if you have an "On this page" category after clicking the required date, then click on the link from there and it will give you an absolute link such as http://www.jtbarton.com/Blog/default,month,2007-07.aspx#a126de405-8e0f-43c4-a8c6-17d9218f03d6 then just cut and paste this link from the address bar into the article you wish to write.

So to see my article on JavaScript update With Master And Content Page just click the previous link.

Wednesday, July 04, 2007 10:28:24 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Sunday, July 01, 2007

How do you update an asp.net controls via Java Script when working with Master and Content pages, to labels, textboxes and/or pure html controls?

I looked long and hard to find the answer to the abouve question.  The answer is out there if you can find it, but it took me in excess of 3 hours to get to the answer of the above question.  I also wanted to be able to determine the time of the client computer rather than the servers time.

So here goes with what I have learnt, by example: (if your like me and want to see an example first then click this text)

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"

CodeFile="JavaScriptUpdateWithMasterAndContentPage.aspx.cs" Inherits="JavaScriptUpdateWithMasterAndContentPage"

Title="JavaScript Update With Master And Content Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<script language="javascript" type="text/javascript">

// Get users current time

function getTime()

{

// Get client computers date and time

var today=new Date();

var h = today.getHours();

var m = checkTime( today.getMinutes() );

var s = checkTime( today.getSeconds() );

// Update content of HTML div, ASP:TextBox and asp:Label

document.getElementById("div1").innerText = h+":"+m+":"+s;

document.getElementById("<%=TextBox1.ClientID %>").value = h+":"+m+":"+s;

document.getElementById("<%=Label1.ClientID %>").innerText = h+":"+m+":"+s;

document.getElementById("<%=HiddenField1.ClientID %>").innerText = h+":"+m+":"+s;

return false;

}

// Ensure that minutes and seconds are 2 digits in length

function checkTime(i) { if (i<10) {i="0" + i} return i; }

</script>

<div id="div1">HTML div text here (text prior to a button press)</div>

<asp:TextBox ID="TextBox1" runat="server" Width="326px">asp:TextBox text here (text prior to a button press)</asp:TextBox><br />

<asp:Label ID="Label1" runat="server" Text="asp:Label text here (text prior to a button press)" Width="326px"></asp:Label><br />

<asp:HiddenField ID="HiddenField1" runat="server" />

<br />

<asp:Button ID="Button1" runat="server" Text="ASP Button" OnClientClick="getTime()" />

&nbsp; &nbsp;&nbsp;

<input id="Button2" type="button" value="HTML button" onclick="getTime()" />

</asp:Content>

 

The clever bits are in bold and "Red" or "BurlyWood".

 

The ("<%=TextBox1.ClientID %> works out the internal name of the control as its used by the page when view at source.

Getting the JavaScript to update the hidden field allows us to update the label on post back, see code behind below.

I deliberately have not made the HTML control div1 part of the "asp runat server" to demonstate the difference in the control style,

but it could be and there for the getElementById("div1") would need to be changed to getElementById("<%=div2.ClientID %>").

 

The other clever bit is to use a hidden field to allow the post back to pick up this value and re-apply to the required text,

this currently is just the Label1, but could also be the div1 when runat="server" is applied.

 

Heres the code behind for the update when the asp:Button1 is clicked, is just accepting that a post back that has been raised and using the hidden

field to apply the text back to the label (Label1).

 

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 
public partial class JavaScriptUpdateWithMasterAndContentPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack)
        {
            Label1.Text = HiddenField1.Value;
         }
    }
}

 

And just for completeness (because I personally hate examples that cannot be run,

I've included a simple master page that relates to the above code):

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!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>ajax.jtbarton.com AJAX, JavaScript and Master / Content Pages</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<strong>Welcome to John T Barton's AJAX test page</strong><br />

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>

</div>

</form>

</body>

</html>

 

There is no code behind for this master page file, I was keeping the sample simple.

 

Thats really how simple it is when you finally work out the solution.

 

I must reference the following link which some of the above code is based on:

      http://www.coveryourasp.net/Technical/ClientsideIDs

 

I'm thinking of writing a follow up article to show how these controls can be updated via an AJAX UpdatePanel and Timer, but unless I

get some feedback about this article I will not bother, the decision is yours.

 

Saturday, June 30, 2007 11:52:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Saturday, June 30, 2007

Well, I've been scared about starting to use these features and now I've bitten the bullet and started to use it.  What a fantastic set of features it has.

Anyone developing / has developed or intends to develop should visit the ajax.asp.com website.

If you were like me and unsure about installing or retro fitting AJAX into existing site, just watch the videos.

Saturday, June 30, 2007 7:21:31 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |