Steel Poll 2

19 November, 2009 by Mathew

To maximise clear up any confusion I bring you the second poll. Please justify your selection in the comments section.

Second Steel Poll

Second Steel Pole
North Korean Flag Pole

Steel Poll

18 November, 2009 by Mathew

I created a poll so that we can decide once and for all which is the best phase of steel. You can see the poll below, next to the pole. Please feel free to justify your answer below.

A different kind of steel pole
Steel Poll Steel Pole

Note for Rupert Murdoch

10 November, 2009 by Mathew

According to the BBC, Rupert Murdoch will try to block google from using `news’ content from his companies. As you can read here, he can already do this easily by just requesting that google remove his websites from their news index by using the google news opt-out form. Even better he can create a robots.txt file on each of his webservers to prevent indexing of his site by any other webcrawler which respects the `Robots Exclusion Protocol’.

Another alternative is to use a header like this on each page he doesn’t want to be indexed:

<html>
<head>
<title>Faux News</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>

Interestingly a number of newspapers think that the extra traffic sent there way by google is a problem, as you can read in the blog post I already linked to once above. I think they have good cause for concern, but I don’t really know what they could do about it, unless they want to generate better content than other indexed websites. I think for these traditional media once they go online it will be really difficult for them to keep there customers, and that is probably why they want to go for a closed-content model. The trick is that they have to prevent all the news from being available online for that to work, otherwise people will see the competitor content too, or again generate something that people really want to read.

Google no doubt already pointed this out to the newspapers many times, as you can see for example, here.

Materials In action: Plane wings

9 November, 2009 by Mathew

This video on youtube shows very clearly the large deflections of the wings as the Boeing 747-400 is maneuvering during landing.

links:
Blog post showing wing deflection test for Boeing 777

View FCC Austenite in three dimensions

8 November, 2009 by Mathew

Channel 4 seem to be showing some 3d programs on t.v. the consequence is you can get 3d glasses for free in sainsburys, and you can use them with the Jmol sorfware to view molecular models in three dimensions.

3 dimensional model of 2 FCC unit cells

2 FCC unit cells (click image to enlarge)

check_html_recursive script to check website html validity

3 November, 2009 by Mathew

I made a dodgy bash script to check the validity of the web pages on my site http://mathewpeet.org. There is probably a better way to do this since the validator is open source, but I couldn’t see how it worked easily, any advice there welcome.

The script makes a list of directories under the root directory specified and then checks index.html in each directory according to w3.org validator. Status of each file is printed to screen, and error reports are sent to a readable text file.

These are the contents of the file check_html_recursive ;

#!/bin/bash
# Copyright Mathew Peet 2009, please use and modify
# but leave some credit
#This script checks if the pages are valid html or not, and puts errors in ~/bin/errors.txt

myfiles=`find ~/www/mathewpeet.org/ -name 'content' -exec dirname {} \;`
#myfiles="/home/user/public_html/"
for x in $myfiles
 do
    y=`echo ${x:32}`       #takes sting after nth character
    echo checking index in $y directory
    `w3m -dump http://validator.w3.org/check?uri=http://mathewpeet.org/$y/ > ~/b
in/temp.txt`
    popo=`grep "as XHTML 1.1!" ~/bin/temp.txt`
    echo $popo
    opop='Errors found while checking this document as XHTML 1.1!'
    if [ "$popo" != "$opop" ]; then
       echo "ok?!"
    else
      `cat ~/bin/temp.txt >> ~/bin/errors.txt`
       echo "$y/index.html does not validate as XHTML 1.1"
    fi
    echo ""
 done
echo "Any reported errors written to ~/bin/errors.txt (hopefully)"
echo "remove temp.txt"

Metal from space?

15 October, 2009 by Mathew

BBC reported this story, a 1.8 kg lump of metal it thought to have fallen from space and landed in a loft of a home.

http://news.bbc.co.uk/1/hi/england/humber/8309245.stm

I find it really amazing, I would have thought it would do more damage.

Any one seen pictures or has any more information about this story?

Daily mail have a larger picture.
http://www.dailymail.co.uk/news/article-1220621/Red-hot-piece-space-junk-crashes-pensioners-roof.html

Nobel Prize Game

28 September, 2009 by Mathew

Nobel prize website has a kids game were we can make steels, don’t give much scope for allowing us to alter the allows, but shows which elements make up the compositions of some steels, and what they are used for.

Nobel information about steel making and Invar

Click Image to Play:
nobel prize invar and steels game

Do feel free to let me know your score.

Making new criminals

24 September, 2009 by Mathew

Making new laws is the fastest way to make more criminals… a government minister who drafted a law on employing illegal immigrants has fallen foul of the same law. She’s had to pay a £5000 pounds fine, for what she described as a administrative error. She says she did examine the documents of her cleaner when starting her employment, but she failed to make a copy of them as a proof. BTW as she explains this is a civil case we can’t say she is a criminal. I’m not sure if that this distinction applies to everyone who employs illegal immigrants or not.

It’s really amazing that she can’t follow these rules, after drafting the documents, and argueing for the adoption of them in parliament.

Does this mean the law is to complicated, the rules were too difficult to follow, she should surely have known the rules? Or is she just incompetent, I think lawyers are usually careful not to break the law?

BBC report:

As mentioned at the end of the video, she is the first individual to be prosecuted under these rules, all previous cases were businesses.


Addendum
According to the house keeper, who nobody in the judicial system thought to ask before the case was heard, the baroness did not see here passport. BBC Story:Baroness ‘did not see passport’ .

Pret A Manger Against Science?

9 September, 2009 by Mathew

I really like the sandwiches that Pret make, but after reading the blurb on the back of my sandwich yesterday, I am a bit worried about their stance on science.

Pret A Manger Sandwich Pack

Pret A Manger Sandwich Pack

So if scientists are so terrible what lengths do they go to to avoid them? Does this mean they only employ liberal arts students in their shops were the sandwiches are made? Do they avoid using any scientific theories about hygiene? Are they going to remove the refrigerators and monitoring methods they use? What about their Coffee makers? They seem quite complicated, how can they be sure no science was used in the design?

Of course I appreciate that they make their sandwiches from recognisable ingredients rather than synthesising them using industrial chemicals, but I also think it is a bit spurious to claim that this doesn’t interfere with nature. Most of the food we eat isn’t really ‘natural’ they have been domesticated by the introduction of farming. (A notable exception are berries, because although we grow them we can’t really propagate them better than birds can, so can’t interfere with with the selection of the next generation).

Shame on Pret A Manger for propagating FUD, I thought your sandwiches were better than that.

Steel butterflies minimise earthquake damage

8 September, 2009 by Mathew

Scientists in Stanford university and others have developed earthquake resistant steel frames in which yielding of steel is used to dissipate the energy of the earth quake.

The steel frame structure contains replaceable cut steel plate ‘fuses’ which deform during the earthquake, and can be replaced easily afterwards.

Images of cut steel butterfly after simulated earthquake

Read more here: Standford Press release and here: Network for Earthquake Engineering Simulation pages

Industry Losses

20 July, 2009 by Mathew

2 stories from BBC.
BBC is reporting about it’s citizen journalist scheme. One lady from Port Talbot in Wales has made a program about the threat to Jobs at the Corus plant there. She was refused a interview with the Corus’ new CEO Kirby Adams, she went to Mumbai and interviewed the head of Tata Steel – Balasubramanian Muthuraman.

http://news.bbc.co.uk/1/hi/uk/8152853.stm

The second story is scandalous. Workers are staging a sit-in protest over closure of the UK’s only wind turbine plant, and the loss of 625 jobs at Newport in the Isle of White (525 jobs) and Southampton (100). The Dutch parent company says Northern European orders are falling, but at the same time the UK government says we need more “green jobs”. The parent company at the same time reported a quarterly sales rise of 59% to 1.11bn euros.

http://news.bbc.co.uk/1/hi/england/hampshire/8160218.stm

UK Government sets Unrealisitic Climate Targets

8 July, 2009 by Mathew

The institute of physics have published a paper by Roger A Pielke Jr, in which he says the (UK) governments targets for climate change are unrealistic. In his paper The British Climate Change Act: a critical evaluation and proposed alternative approach he shows that the rate of change proposed by UK government is much higher than the rate of change made by the French in the past. More can be found on the IOP news feed.

Wind turbines in an Danish Storm

I think we are off to a good start because of the drop in the economy, but I don’t think that is a sustainable way to reduce CO2 which requires investment in nuclear power stations (short term) and renewables like wind. I think it is good to set a target, but I am a bit worried that there is a lack of consensus over what needs to be done.

Take a look at David Mackay’s book Sustainable Energy – without the hot air for a reasoned plan of how we can meet our future energy needs in the UK.

BBC: UK energy customers ‘overcharged’

25 June, 2009 by Mathew

A story by BBC on reports that UK households are being charged by 1.6 billion pounds.

http://news.bbc.co.uk/1/hi/business/8117962.stm

The report is denied by the Energy Retail Association. Who say they need to hedge their purchases to guarantee supply.

We need to keep an eye on the reported profits of these energy suppliers (Big 6).

Latex Poster/ Modelling Thermal Conductivity

17 June, 2009 by Mathew

Norman Gray and Graeme Stewart at Glasgow have provided useful examples to make posters using Latex.

I used these to make a tex file, which produced a poster using pdflatex. Should also be possible using latex command if you include graphics as eps rather than pdf. Make sure if you convert graphics to pdf or ps that you have a bounding box (use pstoeps command for example), otherwise your poster will break horribly. It was important to convert from eps to pdf using the epstopdf command rather that ps2pdf.

This saved me time by allowing me to use the equations from latex directly, and allowed me to include my graphs at high resolution – it doesn’t make sense to convert to jpg or other bit map to include in a powerpoint presentation file.

You can find the poster here: Poster (best viewed with xpdf)
and the latex file to make it here: Poster source file

Thanks to the people who showed an interest in the poster. I wish I had taken picture at the conference to make this post more dynamic!

My second g++/cpp program – Using a Makefile

17 June, 2009 by Mathew

I downloaded the example files from here:

http://www.cs.bu.edu/teaching/cpp/separate-compilation/

This demonstration explains how to compile using the make file. In this example you split up the program into separate modules, and use a make file to compile. This has the advantage that after making a change, only that part of the program needs to be recompiled.

Read the instructions on the web page, after downloading you need to edit Point.h to prevent it being included twice.

#ifndef POINT_H
#define POINT_H
/*
* File: Point.h
* Last Modified: January 31, 2000
* Topic: Modules, Separate Compilation, Using Make Files
* ----------------------------------------------------------------
*/

#include // one of two
using namespace std; // two of two, yay!

class Point
{
public:
Point();
Point(int xval, int yval);
void move(int dx, int dy);
int get_x() const;
int get_y() const;

private:
int x;
int y;
};

#endif

otherwise you will get the error:
g++ -c -o main.o main.cpp
In file included from Rectangle.h:13,
from main.cpp:9:
Point.h:13: error: redefinition of 'class Point'
Point.h:14: error: previous definition of 'class Point'

The files you download are: main.cpp, Makefile, Point.cpp, Point.h, Rectangle.cpp, Rectangle.h

and the Makefile looks like this:

# Makefile for Separate Compilation Example

# *****************************************************
# Parameters to control Makefile operation

CXX = g++
CXXFLAGS =

# ****************************************************
# Entries to bring the executable up to date

main: main.o Point.o Rectangle.o
$(CXX) $(CXXFLAGS) -o main main.o Point.o Rectangle.o

main.o: Point.h Rectangle.h

Point.o: Point.h

Rectangle.o: Rectangle.h Point.h

after running the make command you will have a bunch of object files (.o) and an executable. If you edit Rectangle.cpp and run make again then only Rectangle.o needs to be made again. The programs fragments of binary are linked by the .h header files.

if you run without preventing the multiple inclusion you get this error:

$ make
g++ -c -o main.o main.cpp
In file included from Rectangle.h:13,
from main.cpp:9:
Point.h:13: error: redefinition of ‘class Point’
Point.h:14: error: previous definition of ‘class Point’
make: *** [main.o] Error 1

After correction you get this:

$ make
g++ -c -o main.o main.cpp
g++ -c -o Point.o Point.cpp
g++ -c -o Rectangle.o Rectangle.cpp
g++ -o main main.o Point.o Rectangle.o

Edit Rectangle.cpp and run again; (e.g. open and save to update time, or just type “touch Rectangle.cpp“.


e$ make
g++ -c -o Rectangle.o Rectangle.cpp
g++ -o main main.o Point.o Rectangle.o

My first g++/cpp program

17 June, 2009 by Mathew

test.cpp is a text file containing:

#include

using namespace std;
int main()
{
cout<<"test test"<<endl;
return 0;
}

This is compiled using the command:
g++ -o test test.cpp

Missile Tests!

1 June, 2009 by Mathew

A quick look at http://www.spacewar.com/ will show the surprising news that North Korea aren’t the only ones testing missiles!

For USA news you can also see here: http://www.mda.mil

Excocet Missile Launch from wikipedia.

With so much news about North Korea launching a few rockets, you might be shocked to know that USA, Britain, France, Israel, India, Pakistan, Russia, China are all testing missiles regularly!

March 29, 2009 Indian tests cruise missile: official (developed with Russia).
Apr 02, 2009 Raytheon Standard Missile-2 Destroys Target
May 07, 2009 Raytheon Develops Anti-Surface Warfare Capability For Tomahawk Block IV Missile More than 1900 Tomahawk missiles launched in combat since 1991.
May 20, 2009 Iran hails successful test of new medium-range missile
May 29, 2009 KMSAM Program Achieves Significant Milestone (USA and South Korea)

May 28, 2009 NKorea blast likely less powerful than hoped: expert

The explosive, while larger than the first test in October 2006, was still far short of the expected yield of a crude Hiroshima-type bomb, according to Jeffrey Park, director of the Yale Institute for Biospheric Studies.

“More than likely this means North Korea tried and failed to get a simple plutonium bomb to detonate correctly,” Park wrote in an article on the website of the Bulletin of the Atomic Scientists.

Pdf from windows prn file, MS Powerpoint, MS Excel, MS Word (On Linux).

31 May, 2009 by Mathew

Having a ps file of your presentation is Dandy for printing, but to send it by email it would be better to reduce the size below 10 MB.

Our mission, to make powerpoint presentation file into reasonably sized pdf. (Note all of this was done on Linux, we tried with MS XPS printed to file and fell at the ps2ps stage).

Print to file to generate a prn file (I think this is microsoft version of a postscript file). Select paper size A4. Landscape mode. Note we used postscript driver in our emulated version of windows. (Using Wine). You may need to install a postscript driver for a printer, and select that printer, before printing to file. This hasn’t been tested by the author of this blog.

Printing to Postscript in MS Office 2003 on Linux using Wine

Printing to Postscript in MS Office 2003 on Linux using Wine

Move to the linux terminal (we tried on debian lenny but these commands are very basic – install psutils if not available).

Try to clean up file by converting to postsript, not sure this is necessary or not.
ps2ps -sPAPERSIZE=a4 file.prn file.ps

If you want to put 2 pages per size use
psnup -l -2 -s.7 file.ps double.ps

convert to pdf – downsize images to make file reasonable size. Other commands to do this automatically seemed not to work (ps2pdf14 -dPDFSETTINGS=/screen)
ps2pdf -dGrayDownsampleType=2 -dAutoFilterColorImages=false -dDownsampleColorImages=true double.ps

Cross over office is a compatibility tool which helps migration away from Microsoft Windows, they provide software to let you run many windows programs on Mac and Linux. Here is a link to the cross over office site:
CodeWeavers

2007 TED lectures and Flu

17 May, 2009 by Mathew

This video from 2007 of a lecture by Barry Schartz, in which he says we may be disappointed due to having too many choices. This leads to higher expectations, which are harder to satisfy. It’s all reasonable except he says that this is something that advertisers don’t know. This is something they really do understand better than anyone.

A very energetic talk also from 2007 talk my Prof. Hans Rosling who presenting statistics about development in different countries, and has made tools available at gapminder.com.

The gap minder website lets you make your own graphs, and the data is also available in the documentation section.

Prof. Rosling gave a warning about the swine flu on 6th May suggesting that it is overhyped in terms of deaths/news report. For this he compared the number of deaths from the flu and tubercolosis in the same peroid against the number of news reports available from searching on google news. The ratio was 8176 vs 0.1.