The end

October 20, 2011

This blog is no longer active.

Follow me on twitter for latest news and updates: https://twitter.com/#!/daveman


Funny computer chess story

June 11, 2010

One of my first computer opponents, back in the early 80ties, was a certain Chess Champion MK I. When I accidentally made an illegal move against it, it simply played on, which gave me the idea to start with 1.Rh1xh8 in the next game. Probably seeing its Ng8 was attacked, it played 1…Nf6 – a blunder, as this allowed 2.Ng1xg7 mate. The champion acknowledged the mate; its window said: LOSE. In the next game, I opened with 1.Bc1xe8, hoping to settle the question of the shortest game forever. But Chess Champion MK I did not comply – it played 1…Qd8xe8, somehow leaving me without a plan.

by Tim Krabbé

http://www.xs4all.nl/~timkr/chess2/diary_15.htm


How to remove DRM from wmv files

June 9, 2010

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

Updated for 2010.

How to remove drm from video files you own. It is legal to remove DRM from files you own, for example if you want to put it on an ipod or watch it on tv without using cables connecting it to a windows PC.

1. Install VMware Workstation.

2. Install Windows XP Pro (NOT SP3). (SP3 comes preinstalled with WMP11 which you can’t uninstall) Preferably, install the earliest 32-bit version of XP. Not win2k as it doesn’t support WMP10.

3. Install Windows Media Player 10. (may need to run wga.reg  (google it) )

4. Find/Download FairUse4Wm Fix 1.3.

5. Individualise your XP box. In internet explorer, go to: http://services.wmdrm.windowsmedia.com/indivSite/en/indivit.asp

6. Use Mirakagi, press start.

7. Transfer wmv file to XP.

8. Double-click to open video in WMP10, enter any login details and password if needed.

9. Press play and it should be possible to watch a few seconds of video.

10. Run FairUse4Wm. Drag and drop protected wmv file into the box, and click output to the same directory for convenience. Press next and it should convert (should take about 1 minute depending on filesize).

11. Delete original wmv file, and transfer the new file back to your OS. Rename. You now have the same file minus the DRM.

There are many reasons why DRM is bad. Here are some: http://en.wikipedia.org/wiki/Digital_rights_management#Controversy

One of the reasons is that if you purchased a file to keep ‘forever’ and the original website you got it from goes bust, then you won’t be able to license your file and won’t be able to play it anymore.


quick thought on pseudoscience

May 16, 2010

A few days ago I watched “Derren Brown investigates” which followed the life of a ‘psychic’ who claimed to be able to contact the dead.

It was interesting to watch and it covered the psychic as he gave talks in which he appeared to communicate with the dead. The way this is done is simply in a technique called cold reading, where you gain as much information as possible just by looking at them. People give away much more information about themselves from what they wear, how they respond to a certain statement, and many other factors.

The psychic used a lot of numbers, and repetition of facts. When using numbers, the host would attribute their own meaning, and fill in the details, for example the number 5 meaning the number of people in their family and the number 3 meaning the number of siblings in their family. It is a lot of guesswork and mixing in some Barnum statements to make the hits seem sucessful.

At the start of each personal visit, the psychic would perform some data collection, by ‘using the toilet’ upstairs. In the shows, the people attending stated they had seen the psychic personally a few times before, and had a reading from him before. No wonder he got hits on the night. It seems the same people are being misled over and over. The second personal visit was unsucessful, and the psychic blamed this on Derren having visited the woman at the house previously on the same day.’ This would exhibit negative skeptic energy’, and therefore make the reading not work and clearly this makes no sense. Just before they entered the house, the psychic asked Derren if he had visited the house before, Derren said yes, he had, and later, the psychic misremembered and stated that ‘if he had known Derren had visited the house before, then they would have not have fallen for this ruse’. In the show, Derren cold read successfully the facts of a woman having a holiday at the Maldives, having a _blue_/silver cat, amongst over things. The best the psychic could come up with was ‘did you have a mini in the past’, response was ‘I drive one now’ – when he clearly knew that fact as she drove and parked next to him. Wording of the question is important, as simply saying ‘do you have a mini’ is less likely to have an effect, as the respondant simply says yes, and it is easier to think off the top of your head of what happened earlier e.g. I drove in with it today. Testing the psychic on celebrities was a bit useless, as it is possible to research a lot of information beforehand, e.g. on wikipedia. Again, vague and partial questions, even if complete knowledge is known is able to make the host fill in the gaps and make it seem more sucessful to the reader. The fact that psychics visit people’s homes make it a lot easier to cold read, as homes contain a wealth of personal information relating to the person.

I later visited the psychic’s website, and he had a response to the show which is below.

One line is interesting:

>>” I do not ask you to believe what I do is true. My gift provides a lot of people throughout the country with a certain amount of comfort and happiness. Like many other psychics and mediums throughout the country, you either believe us or you do not. I am not forcing you to believe me but the programme will have upset a lot of people who do.”

Clearly the psychic, now after seeing the show realises, that he is completely disingenious in what he does. The website even states a disclaimer: ‘For entertainment purposes only’. Obviously people who are paying _do_ care if what they are paying for is true or just a scam. They would be unlikely to pay for a personal reading if they did not believe.

The price of entertainment.
There are a lot of moral implications of passing of this ‘entertainment’  to unknowing individuals. Often, they are victim to this sort of scam, and they are unaware of such charlatans that operate. They are playing with the memories of the bereaved, and false comfort is likely to be psychologically damaging when they find the truth. There is no proof it even provides _any_ amount of comfort, as there have been no real scientific studies done on this. The money could be better spent on other things.

Why do people fall for this.

People may have a like for mystery and things that cannot be explained. For science, it is being able to tackle problems that lie on the forefront of unsolved problems, and most of the mind is intrigued with difficult challenges and puzzling questions. For example the large hadron collider is one of the largest scientific experiments in an attempt to find more about the Higgs boson. On the other hand for pseudoscientists, this is simply a way to mislead other people by selling them snake oil in buckets and other forms of quackery. In this day and age where information is so abundant, it is a big surprise to me that these practises still are commonplace especially in a developed country such as UK.

An example of this is homeopathy. This is the practise where selling very diluted solutions will heal a person. In fact, the more diluted the solution is, the better its effects. Actually, the dilution is so great that there are definitely no molecules of the substance, essentially they are selling water. A small vial of pure H_2O, in supposedly reputable chemists on the high street such as Boots, sells  for around  5 to 10 pounds.

It is now post recession, we are recovering from bad ecomomic times, and UK just appointed a new government, which I can hope has the best thoughts not only of ensuring the wellbeing of its inhabitants, but also the economic stability of the country. This is not helping when we are throwing money away such as building hospital wings and giving money to people practising pseudoscience. If there is one thing that should be cut from the NHS budget, then it should be 4 million, which is unecessarily wasted, although it is a small proportion of the however many billions, every little helps.

The difficulty of stopping such practises, is that the law is a big invisible forcefield that everybody holds, one that is not on the side of truth and reason. It is on the side of whoever has the most money, time and resources to hand. In producing a television show on this subject, where peoples livelihoods are spent from this activity, one has to tread softly on ice, as a biased opinion affects the famity of the subject and the liability to be sued.

The question is, will this ever be stopped, and if so how? I believe that education is the most important thing. I recently noticed that for the new generation of teenagers, critical thinking is an optional subject at AS level. I think that this essential education should be made mandantory at a much earlier age. People should be educated, and then they have a choice of being able to consider alternative views and opinions and make their own mind up based on the facts and evidence they have received.

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

Homeopathy is witchcraft
http://www.telegraph.co.uk/health/alternativemedicine/7728281/Homeopathy-is-witchcraft-say-doctors.html

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

http://pastebin.com/8yZXXcZq – statement from pyschic regarding derren brown show.

http://www.telegraph.co.uk/health/alternativemedicine/7728281/Homeopathy-is-witchcraft-say-doctors.html

on news servers

May 6, 2010

As binary retention increases due to the ever decreasing price of storage, the popularity of newsreaders as a method of obtaining information is increasingly becoming a mainstream resurgence. A few years ago I used programs such as MIRC in which bots would spam bits of messages corresponding to different file parts. To obtain the files one would have to connect to the server by typing in an obscure command, wait in the queue, and request the file, and doing so for each part of the file. There often would not be any overhead in file checksums, so that damaged files and missing pieces would be impossible to find. In the current decade, as new laws are being passed to counteract digital file sharing, the importance of usenet in becoming the next bittorrent is surely becoming mainstream, but not without its risks.

The providers today offer an excellent service in regards to security in that connections are made using 256 bit SSL and so that usernames and passwords as well as the file transmission is encoded. This encryption dependent on the length of your password would take a large corporation around 1 month to decrypt assuming  the password is length 8. If the password is 64 characters or longer, it would be even longer to the point that it does not become worthwhile to do so. If you compare this to bittorrent, you are sharing files by connecting to each others IP addresses, whether anonomysed or not, and currently the speed decrease for the former is so much that it becomes unusable, the fact is that connecting without a peer blacklist in the future for well seeded files would be extremely risky. Using Tor, one can use an encrypted and anonomysed network, but this is extremely slow. The alternative is to use remote cloud computing services such as remote downloading or a remote linux terminal, but the end file transfer is still necessary and could still be traced to your current IP.

The future may hold services that make it possible to not have to install an operating system at all, such as with the Google OS. The internet will need to speed up significantly in order to make this a possibility, and an increasing trust in keeping your files and documents online. With the recent Facebook chat privacy hole and the Gmail outages, I would say that this is not going to be here for at least a few years or around 2015.

The one thing that will dramatically increase the speed of computers now, is the storage. The previous bottleneck was the internet speed, on dialup 56k connections it was plain impossible to see how large files could be transferred using a method other than HTTP. Today, a large, cheap non-volatile memory, would speed up computers to no end. Usenet servers are benefiting from the decrease cost in storage resulting in ever increasing binary retention rate. NewsDemon offers 608 days, and Giganews offers 638 days and counting. This is a long shot from a decade ago where the average length was a mere 30 days for text and less for binary files. This means that news servers never have to press the delete key again as day by day they can accomodate the gigabytes of extra storage that is stored.

File verification is another point to touch upon, the bittorrent system uses a checksum for each file part, and alternatively for transferring large files via external servers uses parity files. The mathematics of parity files is incredible in that it is able of correcting errors based on any missing piece or pieces.  As well as SFV, the file is usually wrapped in a rar with a small percentage of recovery record, as such the overhead is enough to protect the integrity of the file contents. As the code transmission will never be perfect, and as algorithms improve the file verification is superior to just the CRC which the BT system provides.

The major and single foremost risk involved in transferring files using usenet, is that the larger providers are likely to hold logs, and then use them against you if a government requested. Therefore it is better choosing second best or a not well known provider to minimise this security risk. There are also cases of spiders and index sites being requested to provide information too, even though there is no link between what information they actually provide to the users, they are merely holding the signposts.

The major risk in usenet access becoming redudant itself is the trend that it is no longer being used as much in universities and ISPs no longer provide them, so there is an increasing reliance on privatised providers. For example, google groups provides over 700 million postings from the past 20 years from within an internet browser, so that text retention is becoming redundant for old hosts.

In conclusion, the factors that are going to be influential in the future of usenet is the users needs and the pace of change of technology in the next few years.

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

http://googlesystem.blogspot.com/

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

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

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

http://www.slyck.com/

http://www.slyck.com/story1949_The_Effort_to_Save_Duke_Universitys_Usenet_Server

http://www.newsdemon.com/


Paywall=shooting yourself in the foot

April 7, 2010

The recent trend for news corporations to start charging for online content is risky. The success of which relies on the competitors to follow the exact same business model. This is not usually how business competition works. For the user, if something is free for several years, and the next day it will cost money, then unless they have a necessity for the product will not have an incentive to use it anymore. Especially if one can get the same or similar content for free elsewhere, then the user will make a decision to visit the cheaper site, and online, as Chris A. says, ‘there is no cheaper price than free’.

One thing will definitely happen, the free sites that remain free will have an increase in readership and advertising value, as well as a bigger share of the market.

The sites that do not stay free but have a ‘loyal’ user base, are in effect are closing themselves off to the outside world.

The potential for new readers to trial their content is reduced, as some sites are planning on disallowing spidering from Google. The news site will become closed off and this in turn will confuse consumers as they try to decide which news site is best to subscribe to given the imperfect information. I predict the onset of a few paywall comparison sites that would scrutinise every article behind the closed doors and judge which is best value for money.

The news sites will have a constant advertising revenue and user base of millions, suddenly drop to zero, then increase slightly. If the increase is not strong enough, they will have to open up again to the advertising based model, otherwise the revenue will not be good enough to bring in good journalists and articles, and therefore death spiral down to nothing. In some ways, adding a paywall is like shooting yourself in the foot whilst trying to get to running speed again as fast as posisble.

Niche vs Commmon
FT.com is a ‘niche’ financial based news site, and it is having moderate success from the paywall business model. AFP, Reuters, Bloomberg are the main sources which FT.com takes the articles from, which all currently do not charge for content.

Common sites such as Guardian, Times, The Sun etc.. are not niche sites, in that they all provide the same news headlines except with a slightly different style, political slant and aim for slightly different user bases. Switching from one to the other as long as they are free will not affect normal users, in that people are not devoted readers to a common news site.

BBC
Most people in UK pay tax money and are indirectly paying for BBC online news services, and BBC news is the most popular online news site in UK. Viewing from other locations, there is advertising to offset the bandwidth costs. It is very likely that the BBC will remain a free news site. Therefore, if all the other common sites add paywalls, the BBC will not have to follow suit and therefore it becomes the odd one out thus breaking the paywall model dependency.

Freemium model
In Chris Andersons FREE audiobook, he states that if 1 person pays for content it should be able to fund 15 other free users. Thus leaving the content free, and later charging for extra premium features would maximise revenue. The free users will still read the articles and the advertising revenue stream is still there. The paywall model is cutting off the 15 free users for the 1 reader, in the hope that it becomes more.

Chris A. also states if there are two things one which is free one that is not, the price will gravitate towards the free business model, whether by itself or by external intervention or circumvention. The paywall is a contradiction of this statement, and it is uncertain what this business model offers in terms of profitability or longevity.

I recommend listening to the 7 hour free FREE audiobook by Chris Anderson: http://itunes.apple.com/us/podcast/free-the-future-radical-price/id325694782

Current news on paywall:
http://news.google.co.uk/news/search?aq=f&pz=1&cf=all&ned=us&hl=en&q=paywall


How to create svg link maps for fighting fantasy books

January 8, 2010

Fighting Fantasy Warlock of Firetop Mountain Full Link Map (svg)

Fighting Fantasy Deathtrap Dungeon Full Link Map – Ian Livingstone #6 (svg)

How to create svg maps for fighting fantasy books.

THis is a quick tutorial on how to use svg graphs to create linked directed graphs.

Fighting fantasy books have a interactive storyline inside numbered pages in which the user decides the next number page to go based on the current page.

IN the first ever fighting fantasy book, there are 400 pages, and a very complex labyrinth to navigate near the end. IN the past one has to resort to using pen and paper to draw maps to navigate the links. Today, I used a combination of Excel, Matlab and svg programs to draw the full map. (python can be used instead of matlab). As you can see this map is visually very complex to draw, but simple to understand, it can be used as an walkthrough for diehard fans to play every route or for casual players as a navigation aid, the latter is the reason why I made this graph in the first place.

Making a digraph.

digraph name{
a -> b;
}

The simplest digraph code is shown above. It points an arrow from a to b. Note name can be changed to any name.

To create a svg (vector based graphic file) in windows using graphviz (open source graph visualization), I use GVedit, open a new file and copy and paste the above, and click run, then choose svg output, then click on ok.

To create the map for a book, start by opening excel. For each row (which corresponds to a page number) type in the links that it refers to. For example in FF1, the first page links to 71 and 278. Type in 71 in cell A1 and 278 in B1. Do the same for all of the pages, moving down the rows and adding the links. This shouldn’t take too long, the numbers are usually in bold.

sample xls file:
A     B
1|    71    278
2|    16    269

After saving the file, open and run a matlab script to convert it into something that GVedit can read, the code for matlab here (pseudocode for any language):

pa = xlsread(‘filename.xls’);
[m,n]=size(pa);
for i=1:m
for j=1:n
if isnan(pa(i,j))==0
fprintf(1,’%i -> %i;\n’,i,pa(i,j));
end
end
end

This will produce the following sample code (this is from ff6)

1 -> 270;
1 -> 66;
5 -> 185;
5 -> 395;
6 -> 364;
9 -> 158;
9 -> 375;
… some omitted
397 -> 369;
398 -> 230;
399 -> 192;

This above is a form readable by graphviz. This shows why the excel step is used, as it is an efficient way of entering the numbers. Add the following code and compile to get the resulting graph.

digraph name{

}

(After typing in hundreds of numbers there might be errors that occurred, to check, look at the resulting graph and see if the graph is fairly linear, for example there shouldn’t be many links that retrace back to the beginning. If so, re-check, edit and recompile.)

Once done, upload to wikimedia commons, it is one of the only picture/file upload host that support direct svg upload.

You now know how to use graphviz to create svg link maps for fighting fantasy books! :)


Penneys ante flow diagram

September 12, 2009
http://en.wikipedia.org/wiki/Walter_Penney

Here is a graph I made for this.  To make it a fair game, instead of flipping coins  until you reach a given state, throw 3 coins as one single event.

penny graph

the arrows mean: ‘beats this choice’

from wikipedia:

1st player’s choice 2nd player’s choice Odds in favour of 2nd player
HHH THH 7 to 1
HHT THH 3 to 1
HTH HHT 2 to 1
HTT HHT 2 to 1
THH TTH 2 to 1
THT TTH 2 to 1
TTH HTT 3 to 1
TTT HTT 7 to 1

Clock puzzle

August 5, 2009

Clock puzzle

After 5:15 what time will the hour and second hand both meet?

Solution:

Taking 0 degrees to be the uppermost point of the clock, at 5:15 the second hand is currently at 90 degrees and the hour hand is at 90+67.5=157.5 degrees. Let x be the degrees from the second hand at which the hands meet.

In 60 minutes the hour hand moves 5 marks, the second hand moves 60 marks. The hour hand moves at a rate of 1/12 of a mark each minute, (and the second hand moves a mark each minute.)

At the same point where they meet, the hour hand is at 157.5 degrees + 1/12*x and the second hand is at 90 degrees + 1*x.

Equating and solving:

157.5 + 1/12 * x = 90 + x

67.5 = 11/12 * x

x = 73.6364 degrees.

Therefore the second hand will travel a further 73.64 degrees, so the final position is 73.64+90 = 163.6364 degrees from 0.

163.6364/ 360*60 will give the minutes which is 27.2727… minutes.

So the hour and second hand both meet next at exactly 5:27:16.


5 coins puzzle

August 5, 2009

5 coins puzzle

Given 5 coins, 4 fair and 1 unfair (2 heads), and after randomly selecting one coin from the 5, what is the chance of the coin being the unfair coin if the event that 5 heads in a row are tossed.

Solution:

Using Bayes theorem try to find the conditional probability P(U|5H) where U is the unfair coin and 5H is the event 5 heads are tossed in a row.

P(U|5H) = P(5H|U) P (U) / P(5H)

P(5H|U), the probability of 5 heads given that it is the unfair coin being tossed is 1.

P(U), the probability of selecting the unfair coin: 1/5.

P(5H), the probability of tossing 5 heads, there is 4/5 chance of choosing the fair coins, and 1/(2^5) chance of them getting 5 heads in a row, and a 1/5 chance of choosing the unfair coin, with probability 1 of getting 5 heads in a row: 4/5*1/32 + 1/5*1.

P(U|5H) = ( 1*1/5 ) / (4/5*1/32 + 1/5*1)

= (1/5) / (1/40 + 1/5)

= (1/5) / (9/40)

= 1/5 * 40/9 = 8/9 = 0.8888.. = 88.8…%

So there is 88.8…% chance the coin is the unfair one.


Follow

Get every new post delivered to your Inbox.