Friday 27 December 2013

How To Create A Chrome Web App

A while ago I visited the Chrome Web Store to try and find a web app for an application I'd seen on a well known web site. The store didn't have the app, so I did a bit of research and came up with the following method of creating my own Chrome Web app.

First Steps To Building A Chrome Web App 

Chrome Web apps are derived from two files namely a 128 x 128 pixel png image file and a JSON file called manifest.json which contains a reference to the image file and other information such as the URL of the site you want to turn into a web application. So, to create a chrome web app you first need to create a png image file. This image will represent the the icon of the web app you want to create. The image will be displayed on the new tabs page along with other chrome web apps. When you have located an appropriate image, save it as 128.png.

Next, create a JSON file. Below is a template for the file which you can copy, adjust and then save as manifest.json. (This can be done using windows Notepad)

{
"name": "AppName",
"description": "AppDescription",
"version": "1.0",
"icons": {
"128": "128.png"
},
"app": {
"urls": [
"AppURL"
],
"launch": {
"web_url": "AppURL"
}
},
"permissions": [
"unlimitedStorage",
"notifications"
]
}


The highlighted text in the above code should be replaced as follows


  • Replace AppName with the name of your app (place the name between the speech marks).
  • Replace AppDescription with a description for the app. (Again, place the description between the speech marks).
  • Replace AppURL with the full web address of the web page that contains the app e.g. http://www.webapp.com/ once again make sure that the URL is placed between speech marks in the above code.


Once you've created the png image file and manifest.json file, place them in a separate folder. Call the folder something like ChromeWebApps.

Test Your Chrome Web App

Now you need to test your app. To do this open chrome, and select Tools, then Extensions from the spanner icon in the top right hand corner of the browser. Next, locate the "Developer Mode" plus/minus button on the top right hand side of the Extensions page. Make sure the button shows the minus sign. If it shows the plus sign click the button so that it shows the minus sign.

Select "Load Unpacked Extension" from the developer mode menu. When the pop up menu appears, navigate to the folder that contains the image and manifest files then select the folder and click ok. The icon for your Chrome web app now appears on the new tab page with your other apps (if you have any). Click the icon to make sure that it loads the correct page.

Create The Full Chrome Web App

Now that you've determined that your app works, you can go ahead and create the full web app. Chrome web apps are contained in files with the .crx extension. This file combines (by a process known as  packing) the png and manifest.json files you created.

To create the full chrome web app, first navigate back to the Entensions page in the chrome browser. Next locate your web app (the one you just tested) in the extensions list. Now click uninstall. Once the app has been uninstalled, click the "Pack Extension" button from the Developer Mode menu on the chrome browser extensions page. A new pop up with two fields appears.

In the field titled "Extension Root Directory" use the "Browse" button to navigate to the directory containing your png image file and manifest.json files as before. (The field labled "Private key file (optional)"  is used for editing Chrome web apps. You do not need this at the moment). Select the directory and click ok. The path of your Chrome Extension now appears in the "Extension Root Directory" field. Click the ok button. A new pop up appears titled "The page at chrome://extensions says:" which gives information regarding the location of two files namely a .crx file (your newly created full web app) and a .pem file which contains a key code which can be used to edit your app if needed.


Go to the location of the .crx file as mentioned above then select and drag the file to the Chrome web browser. A window should now appear entitled "Confirm Installation" with a message saying "Install (whatever your app is called)?". Click the Install button. A New Tab page is now automatically generated with your newly created Chrome web application appearing alongside other apps. Enjoy!

Wednesday 25 December 2013

How To Fix A Laptop If You Spill A Drink On It

Here's a tip that might get your laptop working again if you spill a drink on it. I don't know if it works for all drinks or for all levels of spill severity, but it's worth a try.

Firstly, if you spill a drink on your laptop, shut it down immediately (assuming that it hasn't already turned itself off as a result of the spillage). If the laptop is connected to the mains then make sure you disconnect it.

Once you've shut off the power supply,   turn your laptop upside down and allow it to dry naturally for at least 24 hours. Turning your laptop upside down should prevent any liquid reaching the laptop's circuit boards. Do not use haidryers or similar heating appliances to speed up the drying process as this may damage the device.

After a day or so, turn your laptop the right way again and then turn it on. Hopefully your laptop should now be working as normal.

Tuesday 17 December 2013

Celebrities Who Have An Erdős–Bacon Number

Below is a list of celebrities (mainly actors) who have an Erdős–Bacon number. But first some definitions.


What Is An Erdős number?

The Erdős number is named after Paul Erdős who was a well known mathematician born in 1913. He published over 1500 scientific papers. The Erdős number was created to honor the mathematician's prolific scholarly output. Paul Erdős wrote more papers during his lifetime (mainly through co-authorship) than any other mathematician.

An Erdős number is calculated as follows. The Erdős number of Paul Erdős is set to 0. The Erdős number of someone else is calculated using the formula k+1 where k is the lowest Erdős Number of a co-author.

So, for example if someone, let's say his name is Jack, collaborates directly with Paul Erdős on a scientific paper, then Jack's Erdos number is 0+1 = 1. If Jack then goes on to collaborate will Jill on another paper, but Jill does not directly collaborate with Paul Erdos, then Jill's Erdos Number is 1+1 = 2.

Anyone who does not bare a co-authorship connection with Paul Erdos is given and Erdos number of infinity or is said to have an undefined Erdos number.

To be given an Erdos Number, someone has to collaborate with a co-author who has a finite Erdos number.


What Is A Bacon number?

The Bacon number got it's name from the actor Kevin Bacon who claimed that he ad worked with everyone in Hollywood or worked with someone else whose worked with someone in Hollywood. This claim was made in 1994 during an interview for the film "The River Wild".

The Bacon number is the acting equivalent of the  Erdos number and is calculated using a similar "shortest path" algorithm. The Bacon number of Kevin Bacon is 0. The Bacon number of another actor is calculated using the formula N+1 where N is the lowest Bacon number of the co-star.

For example, an actor or actress who has worked directly with Kevin Bacon (Bacon number = 0) has a Bacon number of 0 +1 = 1. An actor who works with a co-star who has a Bacon number of 1, but has not themselves worked with Kevin Bacon, has a Bacon number of 1+1 =2 and so on.


What Is An Erdős–Bacon number?

The Erdős–Bacon number is simply the sum of someone's Erdős number and their Bacon number. As you might already appreciate, people who have an  Erdős–Bacon number are a rarity. Below is a list of famous people with Erdős–Bacon numbers.


List Of Celebrities With Erdős–Bacon numbers

Colin Firth (Actor)

Colin has an Erdős number of 6 as a result of the co-authorship of a paper entitled "Political Orientations Are Correlated with Brain Structure in Young Adults". Colin Firth's Bacon number is 1 since he acted directly with Kevin Bacon in the film "Where the Truth Lies". Colin Firth's Erdős–Bacon number is therefore 1+6 = 7.

Natalie Portman (Actress)

Natalie Portman's Erdős number is 2 by way of a scientific collaboration that leads to a connection with the mathematician Joseph Gills who has an Erdos number of 1. Natalie's Bacon number is 5 through an appearance with Sarah Michelle Gellar (Bacon number 1) in the film "A Powerful Noise Live". So, Natalie Portman's Erdős–Bacon number 2+5=7

Danica McKellar (Actress)

Danica McKellar has an Erdős number of 4 which came about as a result of a co-authorship of a mathematical paper that she wrote while studying at UCLA. She has a Bacon number of 2 through her work with Margaret Easley. Danica McKellar's Erdős–Bacon number is 4+2 = 6.

Carl Sagan (Popular Astronomer & Cosmologist)

Carl Sagan has an approximate Erdős number of 4 by way of a connection to the astronomer Steven J. Ostro. Carl's Bacon Number is 2 giving an Erdős–Bacon number of 6.

Richard Feynman (Nobel Prize Winning Physicist)

Feynman's Erdős number is 3 and with a Bacon number of 3 as a result of an appearance in the film "Anti Clock" with Tony Tang, Richard Feynman's Erdős–Bacon number is 6.

There are likely to be other celebrities with an Erdős–Bacon number and these will be added to the above list in due course.





Monday 16 December 2013

A Brief History Of Shoptagon

Shoptagon came into existence around seven years ago. The first incarnation of the Shoptagon was as an online affiliate based store promoting mainly electrical goods such televisions, digital cameras and mobile phones. Tradedoubler was the main affiliate network used by Shoptagon in these early stages.

Around the time of its existence as a store, a new entry to the Merriam-Webster online dictionary was made which defined Shoptagon as a large collection of retail outlets either online or in the real world. There was also a somewhat short lived debate on Yahoo Answers as to whether Shoptagon would in fact be a better name for Amazon.

After some time as a store, Shoptagon evolved into an online repository for celebrity Tweets. This occured around the time that Twitter really started to take off as a social network. During its "Twitter Phase" Shoptagon listed celebrity tweets alphabetically using the Twitter search API. The API was also used to provide search results around areas such as "sightings of Elvis" and "who is an A-list or Z-list celebrity"

Finally, as of late 2013, Shoptagon has become a blog based site providing articles on a range of topics from Daleks to Bitcoin Mining. The store element still exits in the form of the Shoptagon Store tab above. As with the original store the current store promotes affiliate products. This vesrion of the Shoptagon store uses Amazon Associates as its affiliate network.

As for future incarnations of Shoptagon? Who knows?

Another Coca-Cola Can Barcode


Another image of a Coca-Cola can barcode as promised in the previous post. The real thing, again!

Coca-Cola Can Barcode


An example of a Coca-Cola can barcode. This is the real thing! More images of Coca-cola can barcodes will follow.

Saturday 7 December 2013

What Is A S'more?

A s'more or smore as it is sometimes spelt is a campfire treat which is particularly popular in the United States and Canada.

The s'more was created by Nathaniel Ayers and the phrase is believed to be contraction of the term "some more".

A typical s'more consists of a toasted marshmallow and a chocolate layer sandwiched between two Graham crackers which are traditionally made by combining wheat flour, wheat bran and wheat germ.

There are many derivatives of the s'more which, although they may contain the core ingredients mentioned above, are nevertheless served cold. A popular example is the Hershey's S'mores bar.

Incidentally, thank you Evan-Amos for placing the above image of a s'more in the public domain.

Here's a video of how to make a s'more in a microwave using a dedicated s'more machine:


The s'more has become such a popular treat that it has even been given its own special day of celebration. National S'mores Day is celebrated on the 10th of August.

Monday 2 December 2013

How Long To Mine One Bitcoin?

How long does it take to mine one Bitcoin? This is a question that is often asked by people who are just starting out with Bitcoin.

The quick answer to this is Bitcoins are not produced one at a time so it is inaccurate to ask how long it would take to produce a single Bitcoin.  Instead, Bitcoins are currently produced in blocks of 25. The method of Bitcoin production is outlined below.

As mentioned elsewhere on this site, Bitcoins are produced through a process known as Bitcoin mining. This involves running computer software (Bitcoin mining programs) that looks for solutions to extremely complex mathematical problems of known difficulty. Automatic adjustments of difficultly levels ensure that worldwide solution rates remain fairly constant. The current global solution rate is 6 problems per hour.

When solutions are found, everyone is notified by means of a block. The block contains a notification that a solution has been found together with other pertinent information. Blocks generate a block reward which is currently set at 25 new Bitcoins. The block reward acts as an incentive for people to carry out the calculations needed to generate blocks. The block reward is also reduced by 50% every 4 years so that the total number of Bitcoins available will eventually never exceed 21 million Bitcoins (blocks that are created fraudulently are automatically rejected by the system). The limitation on Bitcoin availability is what ensures that Bitcoins have a financial value.

At present a new Bitcoin block is created every 10 minutes. This means that at the moment 25 new Bitcoins will be produced every 10 minutes.