16 November 2009

XNA game development

Trying to improve the computer's game:
I gave the software a way of evaluating a position. So some moves will result in a position that achieves a high score, such as capturing pieces, and some a low score, such as having pieces taken or leaving them exposed.

I am working out what to evaluate by noticing what I think is a good position when I am playing.

I gave random weights to each of the methods of evaluating the position, since I can't really say what priority I actually give to the things I consider.

The approach is to sum the results from each of the weighted methods for each possible position and use those to pick the best move.

The computer still loses every time.

10 November 2009

XNA game progress

I have been working on getting the computer to play. The simplest approach is to have it pick random pieces to move, and keep trying till it finds a legal move. This isn't a good approach, it loses every time, I just want to get the flow of the game going.

The game I am writing involves two players taking turns to roll two dice and move one or two of their pieces. Unfortunately, the computer move is instantaneous so it makes it difficult to see what is happening. I need to add some delays. I might leave this until I put the code into
XNA.

03 November 2009

Notes on Open University Course T206_2 An introduction to

4 Renewable Energy Sources
Most renewables originate from the sunTidal from gravityGeothermal from heat trapped in the earth Solar-thermal-PV
Indirect solar-Wind-WaveThese will be renewed naturally, won't run out.
Presently more expensive than fossil fuels but attractive
due to lower environmental impacts
5 Energy Services and Efficiency Improvement
Efficiency : 2 thirds of the energy ends up as waste heat
Energy has been reducing in price so little incentive to
attempt to improve efficiency.
Supply side: generation efficiency can be improved...Combined Cycle Gas Turbine (CCGT) uses hot exhaust gases
from gas turbine generator to power a steam generator.CHP Combine Heat and Power, uses waste heat from power
stations to heat buildings8% of energy lost through transmission/distribution
Demand side:More efficient appliances (must be wary of embedded carbon,
co2 produced in the creation of a new appliance can outweigh
any benefit from energy saved in use) Social changes (walking cycling to work, public transport)
Four sectors: Domestic (draught proofing, insulation) Commercial & Institutional Industrial (reuse waste heat, product design, thinner
materials) Transport
6 Energy in a Sustainable Future
How to improve sustainability:Carbon sequestration (storing carbon so it cannot get back
into atmosphere)Fuels switching - to less polluting fuelsSwitching to renewablesDemand side efficiency improvements
Royal Commission on Environmental Pollution (RCEP) proposed
four scenarios for the UK which consider the options
available for balancing supply with demand given the need to
reduce CO2 emissions by 60%.
World Energy Council has come up with six scenarios
incorporating different assumptions about rates of economic
growth in rich and poor countries; choices of technology and
its development; and the priority given to ecological issues
A number of paths to sustainability, but, since they rely on
different mixes of technology, they are likely to have
different social, environmental and political implications.

Writing an XNA Game

I'm writing a board game in C# with the intention of getting it to run in XNA.

I don't want to get distracted with xna and graphics just yet. I want to have a working game first. The approach I am taking is:-

1. Create a console app.


2. Get it to initialise and display the board as text. Each of the 24 squares on the board is numbered (0 - 23) and the pieces are represented by red or green non-zero values. An empty square is shown as a white zero. Start squares and home squares are in blue

3. I have added code to capture how the pieces move from square to square.

4. Also added rules, for checking when the game is over and who won, and preventing any illegal moves.

5. I have added a game loop so you can play a game human vs human.

This is working well so far, but the display is not easy to read in a console app.

12 August 2009

Notes on Open University Course T206_2 An introduction to sustainable energy

A free course from the Open University

1 Why sustainable energy matters
Current use of fossil fuels not sustainable.
Finite supply(but not about to run out immediately)

Location of 2 thirds of oil in Middle East or N. Africa - has led to conflict.
Price rises led to protests. (Renewables need to enable the same level of affluence that fossil fuels have enabled, else acceptance will be low)
Accidents during extraction, distribution and use.
Pollutants from use. And CO2 leading to climate change affecting ecosystems, agriculture, sea levels
Nuclear is source of 7 percent of primary energy
No green house gases, but...Supply of uranium also limited (decades or possibly centuries at current rate of use), proliferation of weapons, problems of disposal and cleanup.
Efficiency of systems is an important factor in mitigating the effects of energy use.

Renewables - Replenished by natural processes.
Solar energy, bioenergy, hydroelectricity, wind and wave power
Current costs can be higher than conventional sources, slows take up.
Need:-
  • To reduce impact of fossil and nuclear
  • To develop and deploy renewables
  • To improve efficiency of conversion, distribution and use
2 Definitions: Energy, Sustainability and the Future

Energy is the capacity to do work.
Power is the rate of doing work.
Energy = power x time
Sustainable development is ‘development that meets the needs of the present without compromising the ability of future generations to meet their own needs ’ (United Nations, 1987).

3 Present Energy Sources and Sustainability

80% of energy comes from fossil fuel at present
At current rate-200 years of coal, 60 years gas, 40 years oil

Hydrocarbons release co2 on combustion, a greenhouse gas.

Nuclear:Energy released by splitting uranium atoms (fission)
Major concerns are safety and disposal of waste
Biofuel:Combustion of straw and forestry waste. Incomplete combustion can release pollutants. Only sustainable if trees replanted ( also only sustainable if biodiversity of resource is maintained.)
Hydroelectricity 17% of electricity produced in 2000 came from hydroelectric.
- indirectly solar power from evaporation of water to rain

14 June 2009

Bee pictures

Here is a view inside the hive. The bees are mostly on five frames:-


Rachel with some of the bees on a new frame:-

Me, posing with the hive:-



14 April 2008

Jottit

I have just tried out Jottit for the first time, it seems to be a very friendly wiki-like web site. It is free.

Jottit makes it very easy to create and edit web pages, almost a friction free publishing experience.

My site is here. I don't know if it will catch on with me for frequent use, but I'll try anything new. Especially if it is free.

06 March 2008

Mix08

Tim Sneath wrote a wonderful blog post on the Mix08 keynote.

The Mix08 sessions are appearing online now...

13 February 2008

ASP.NET wiki

There is now a wiki on ASP.Net

05 February 2008

MSDN Code Gallery

MSDN Code Gallery is a new community site for code samples, snippets and resources...

22 November 2007

Silverlight Training

Free Silverlight Essential Training on Lynda.com, by Mike Harsh.

18 September 2007

DDD6

DDD6 has been announced for November 24th.

With SqlBits on the 6th October, I can't help wondering when the next WebDD will be?

03 September 2007

SQLBits

SQLBits is a community conference on all things SQL, to be held at Microsoft Reading on 6th October. It's free.

17 July 2007

Galaxy Zoo

Galaxy Zoo is a site where you can help to classify galaxies, up to a million of them if you have the time...

A lot of them look very fuzzy, but then they are far away and long ago...

09 July 2007

Scott Guthrie videos

Phil Winstanley has made four videos of Scott Guthrie available on the WebDD website. These were really good sessions, so it is worth downloading them...

28 June 2007

Live Folders

Windows Live Folders is in Beta, but not in this region. Maybe later?

It offers 500MB of online storage.

23 June 2007

MixUK

Mix:UK 07 is "the premier event for web designers and web developers."

I wonder if it will be like Mix07... where all the sessions are recorded? I hope so.

13 June 2007

11 June 2007

Real Alternative to Real Player

The BBC still seems to provide a lot of content in Real Player formats, .ram or .rm files. Rather than installing Real Player there is an alternative, called Real Alternative.

I have installed it, and so far it seems ok. There are a lot of other free video and audio tools on the site.

07 June 2007

05 June 2007

Keep running

Here's another one...

The Microsoft code name “Acropolis” Community Technology Preview 1 is a set of components and tools that make it easier for developers to build and manage modular, business focused, client .NET applications. Acropolis is part of the “.NET Client Futures” wave of releases, our preview of upcoming technologies for Windows client development.

02 June 2007

Expression videos

The Microsoft Expression Knowledge Centre has some videos on the Expression tools

31 May 2007

DDD5 agenda

The agenda for DDD5 is available...

30 May 2007

Microsoft Surface

The Microsoft Surface computing website...

and a video.

29 May 2007

DDD5

Register now for DDD5. It is on June 30th, at Microsoft in reading, and it's free.

26 May 2007

Popfly mashups

Popfly makes mashups easy. This one gets videos from soapbox and displays them in a video player. I didn't write any code, not a single line.

22 May 2007

Bristol DotNetDevNet

Alex Homer gave a splendid talk, at Monday evening's .NET Developer Network meeting, on the Enterprise Library from the Microsoft Patterns and Practices group.

He then went on to talk about Cross Cutting concerns, Aspect Oriented Programming and The Policy Injection Block.

As you can tell from all the links, this was a learning experience for me.

18 May 2007

Popfly

Microsoft Popfly... online tools for building mashups.

17 May 2007

Ajax view

Mike Ormond on Ajax View

15 May 2007

Scratch

The BBC has a story on Scratch, another "programming for kids" tool, this one from MIT.

14 May 2007

13 May 2007

SilverlightPad

Silverlight Pad is a Silverlight 1.0 Beta application that gives you a simple way to experiment with creating XAML content--the XAML you enter can be instantly rendered as Silverlight content.

11 May 2007

100 apps

A list of 100 web applications for freelancers.

10 May 2007

The upside-down-ternet

I'm not sure whether to think this is real or not, but it sounds very convincing. The upside-down-ternet... a brilliant way to discourage your neighbours from stealing your wifi.

There are some very clever people about.

08 May 2007

Scott Hanselman on Mix

Scott Hanselman's post on Mix, DLR and Silverlight

07 May 2007

The Guardian

The Guardian on Silverlight.

05 May 2007

Silverlight Quickstarts

The Silverlight Quickstarts are now available...

04 May 2007

Silverlight everywhere?

Miguel de Icaza seems to be very keen on the idea of creating a version of Silverlight on Mono.

03 May 2007

02 May 2007

Jasper

Another one!

Jasper sounds a bit like Ruby on Rails. Convention over configuration, RAD database applications...

Astoria

What is Astoria?

01 May 2007

Getting started with Silverlight Streaming

Following Tim Sneath's post on Getting started with Silverlight Streaming.

I downloaded Expression Media Encoder and encoded a short video. The video I imported was not widescreen, so I had to resize it. It had something like a coloured barcode effect down the right hand side after being imported into Media Encoder.

After encoding, it opened a browser to view the results... and wanted to install Silverlight. That's a bit odd, since I already have it installed. Then it wanted to restart, reporting Error 3010, "Silverlight installed successfully, but needs to restart"...

I followed the rest of Tim's instructions and soon had my video uploaded to Silverlight.live.com and available to play on my own web page.

The Expression Media Encoder trial version has a 180 day licence.

30 April 2007

Mix announcements

The Mix07 keynote.

"Today we announced that Silverlight is not only a great media platform; it is cross-platform .NET."... Silverlight on Channel9

Silverlight Streaming. A free account, with 4GB of space where you can upload Silverlight applications.

There are a lot of Silverlight screencasts on Channel9 too.

29 April 2007

Silverlight quickstart coming soon

The Silverlight SDK and QuickStart will be available April 30th.

28 April 2007

DDD5

Don't forget to vote...

26 April 2007

Javascript intellisense

The Visual Web Developer 2005 Express edition has Javascript intellisense support just like Orcas.

I have been writing more Javascript recently, and this could really save a lot of time. And, it's free.

25 April 2007

DotNetDevNet Bristol

I attended the first DotNetDevNet meeting in Bristol on Monday.

It was a brilliant event, organised by Guy Smith-Ferrier, with Mike Taulty as the inaugural speaker.

Guy explained the aims of the group. This is a free group, which is remarkable really, given the quality of speakers Guy has already lined up for the first three meetings.

Mike Taulty was entertaining and informative. I liked his approach to presenting LINQ, explaining some of the mysterious features that have been appearing in .NET recently and showing how, although they may not be things you have wanted to use, the LINQ team needed them. I found it was a struggle to keep up at times, it had been a long day... but fortunately Mike Taulty's blog has plenty of posts on LINQ and other topics to catch up on.

He also mentioned the Road Show Resources.

LINQ for SQL was very impressive. At first, I had what turned out to be inappropriate flashbacks to SQL select statements hardcoded in VB3, but then realised that this is very different. LINQ seems to offer a lot of power, and does an amazing job of figuring out the right way to behave whatever you do.

I'm looking forward to the next meeting. Alex Homer is another excellent speaker.

20 April 2007

Strangeloop

Strangeloop.net... not ready yet, check back later. Some kind of clever optimisation, using routers...

19 April 2007

Geocoding

Rooftop geocoding allows you to locate properties correctly. A lot of current map applications seem to locate by postcode.

18 April 2007

The Region

The Region is a web site run by Microsoft Regional Directors. It has posts from people like Richard Campbell and Scott Hanselman.

16 April 2007

Silverlight

Tim Sneath announces Microsoft Silverlight, previously known as WPF/E.

15 April 2007

Another way to sell shareware

ByteCommerce offers another way to sell shareware. They keep the payment for every twentieth item sold.

14 April 2007

MicroISV in 25 steps

Leon Bambrick has reached step three of his microISV series, designing your website.

13 April 2007

Where's Wally

You can find out on the BBC's Walrus Tracking map. Over the next two months the map will be updated to show the location of ten tagged animals.

It's a shame they didn't use Virtual Earth or Google maps.

12 April 2007

UI design

Fun with check-boxes.

I don't like check boxes. Too complicated.

11 April 2007

Run As Radio

Run As Radio is a new weekly podcast from Richard Campbell.

It doesn't seem to be available on iTunes yet, but maybe that will change.

10 April 2007

DDD5

The proposed sessions for DDD5 are looking good.

09 April 2007

Speech in Vista

An article on speech recognition in Windows Vista.

It seems there are new voices available, including "the Windows Vista Chinese synthesizer, Lili".

08 April 2007

XML Tools

There are some useful XML utilities here.

Xml Notepad 2007 and XML Diff and Patch...

07 April 2007

04 April 2007

Search .NET

Dan Appelman has created a .NET specific search site using Google's custom search. It limits the search to selected web sites that Dan recognises as having good .NET related content.

03 April 2007

$5 app

More on the $5 app idea.

Of course, there is more profit to be made from a £5 app.

02 April 2007

Selling software

ShareIt.com - Selling software online

01 April 2007

31 March 2007

WPF/e demo

There is a very nice new grand piano demo of WPF/E on Channel 9.

30 March 2007

Viewstate

An article on truly understanding viewstate written by Dave Reed.

29 March 2007

£5 app

Simon Harriyott blogged about a £5 app event. It seems the idea is to create a small app and sell it cheap, or possibly a lot of small apps.

A bit like the microISV idea with less time invested in creating the product.

28 March 2007

27 March 2007

Bristol-On-Sea

What would Bristol look like if the sea level rose by 10 metres? Or 7?

There are many places more at risk, as this site shows

26 March 2007

Gmaps Pedometer

Gmaps Pedometer can show you the elevation of a route.

25 March 2007

Bristol .NET group

A new Bristol based .NET user group, organised by Guy Smith-Ferrier

23 March 2007

22 March 2007

Architecture Conference

The Microsoft Architect Insight Conference presentations are available for download.

21 March 2007

OpenAJAX

OpenAJAX is an alliance of companies working towards open and interoperable AJAX based web technologies. It is interesting that the list of members includes both Microsoft and Google.

20 March 2007

Fun with Antivirus Software

Something upset my antivirus software the other day... so, after a quick reinstallation I am now having fun with antivirus software.

I am running:
Grisoft AVG
SpyBot Search and Destroy
Lavasoft Ad Aware
Windows Defender
and Windows Firewall

Just for extra fun this evening I am trying out Windows Live OneCare. Although I am not sure about it. Why does it cost $49? All the software I listed above is free. Does Microsoft need my money? Wouldn't it be nice if Windows included this in the OS?

I'm also not sure why it orders things the way it does. It does a disk cleanup and disk fragmentation scan before checking for open ports. I would have thought it better to check the ports before worrying about fragmentation...

19 March 2007

Security

Alik Levin's links on Google Hacking

17 March 2007

Mock Objects

TypeMock is a tool for creating Mock Objects for use in Unit Testing.

It says in the list of features...
"Mocking takes place on the fly, working on your production assemblies."

One of the benefits is that it...
"Saves time by eliminating refactoring and restructuring of your code, just to make it testable."

There is an explanation of how it works, and this explains that you do not have to change your code to make it testable.

16 March 2007

Blinq prototype

The blinq prototype...

"Blinq is a tool for generating ASP.NET websites for displaying, creating, and manipulating data based on database schema. Just point Blinq at a SQL database and it will create a website with pages that display sorted and paged data, allow you to update or delete records, create new records, and follow relationships between tables in your database."

15 March 2007

Security engineering

Advice on Security Engineering from Microsoft Patterns and Practices. Including security checklists for ASP.NET 2.0

In fact, there is a huge amount of information available on making websites more secure.

14 March 2007

WPF Tools

Microsoft .Net Framework WPF tools for Developers and Designers including Charles Petzold's XAMLCruncher, an application that lets you experiment with XAML.

13 March 2007

Keywords

An article on keywords. I had thought search engines didn't take too much notice of keywords these days, but this article seems to suggest that they do.

It also suggests that choosing keywords correctly is very important, that as a website developer you need to think of the way your customer's customers will search. Their choice of keywords may not match your customer's choice.

12 March 2007

Amnesty Widgets

Amnesty Widgets is a free tool for converting web widgets to run in the Vista Sidebar.

11 March 2007

Microsoft and small businesses

Two Microsoft websites for small businesses...

Microsoft Small Business Channel Community

and

The Microsoft Startup Zone

10 March 2007

RSS on CodePlex

ASP.NET RSS Toolkit on CodePlex gives ASP.NET applications the ability to consume and publish to RSS feeds.

09 March 2007

Timeline search

TimeSearch.info is a time-based search engine. For example if you enter -4m as the search term it will return information on events 4 million years ago.

08 March 2007

07 March 2007

Virtual Earth

PietschSoft.VE - ASP.NET AJAX Virtual Earth Mapping Server Control on CodePlex, allows you to use Virtual Earth without any need to use JavaScript.

06 March 2007

More videos

More videos than I have time to watch...

Microsoft eLearning Developer Catalog has some free courses.

Russ and Joe on Microsoft Expression Web (60 minutes)

Virtual Labs on Windows Workflow (90 minutes)

And, it only takes 14 minutes to create a data driven web-site.

05 March 2007

04 March 2007

Lunar Eclipse photographs

The start of the eclipse...


Totality...


And the beginning of the end of the eclipse...

03 March 2007

Lunar Eclipse



Look outside.

Burning ISO image CDs on XP

A utility for burning ISO images to CD that runs on XP.

Why the operating system didn't do this itself I don't know, but this is a nice utility. It attaches itself to the .iso file extension, so if you right click on an .iso file in Windows Explorer the pop-up menu includes an option to "Copy image to CD".

02 March 2007

Kids Corner

Microsoft Kids Corner has some fun resources, including C# for Sharp kids.