Category Archives: technology

Our grandchildren will have to cope without fossil fuels

If the exploitation of fossil fuels becomes economically prohibitive in 50 to 100 years, our grandchildren and our 4th generation descendants will have to find new ways to power their cities and industries. In addition, they will have to try to reverse the effects of global warming from the combustion products of fossil fuels that we are using today.

It is unlikely that industrialized nations will give up the use of fossil fuels any time soon because they are so convenient and so cheap. In spite of the Kyoto Protocol and similar agreements to reduce greenhouse gas emissions, the use of fossil fuels will only stop when these fuels cannot be economically extracted from the Earth. BP’s “Statistical Review of World Energy” published in mid 2014 says that the world has in reserves 892 billion tons of coal, 186 trillion cubic meters of natural gas, and 1688 billion barrels of crude oil. At current rates of usage, the oil and gas will be exhausted in 55 years, and the coal will last 113 years.[1]

Hydroelectric power will not be a viable option in the future because global warming will reduce the glacier ice in the mountains which is the source of the water in the rivers. Similarly, the experiences with Chernobyl and Fukushima show us that we cannot build nuclear power plants that guarantee the safety of our environment. One accident can make the surface of the Earth uninhabitable for hundreds or thousands of years, and no satisfactory solution has been found for the problem of disposing of nuclear waste that remains radioactive for millennia. The zone contaminated by the Fukushima disaster is roughly 310 sq miles (800 sq km). Radioactive cesium-137 has a half-life of 30 years, and since it takes about 10 half-lives for any radionuclide to decrease to a tolerable radiation level, the Fukushima exclusion zone will be closed to human habitation and farming for at least 300 years. The Fukushima nuclear reactors are still leaking radioactive material, and if one of the heavily damaged reactors should collapse, additional radiation would be released and much of Japan could become uninhabitable.[2]

This only leaves geothermal, tidal, wind and solar energy as the safest and most reliable power sources for the future. Geothermal energy is used extensively in Iceland, but places which are not in volcanic areas would have to dig very deep to tap the heat in the crust of the Earth. The use of energy from tides and marine currents may only be practical in coastal areas. Similarly, the use of wind energy may only be feasible in areas with constant winds.

Solar energy appears to be the most abundant and widely available clean energy source, and it can be harvested through photovoltaic cells and through biofuels. Biofuels require irrigation, and that is a problem when our supply of fresh water is limited. In a world where there is much hunger, it is a perversion to use corn or cane sugar to fuel our machinery. Farmland should not be used for fuel production because the population of the Earth will only increase and therefore more land will be required for food production. Only cellulose from grasses, or the inedible parts of plants should be used for biofuels. Perhaps algal aquaculture on the surface of the ocean or harvesting the algal blooms that pollute the oceans might be a source of biofuels. If photovoltaic cells could be produced by processes that do not cause pollution, the roofs of our buildings could be covered with photovoltaic cells that could help us meet many of our daily energy needs. Germany is already making substantial progress in the use of solar energy in houses and factories.

[1] BP. Statistical Review of World Energy 2014.

[2] Steven Starr, Costs and Consequences of the Fukushima Daiichi Disaster.

Solitaire Game in JavaScript

Computer hacking has increased in recent years.  Criminals can profit from the personal and financial information stolen from the victims they have hacked.  In some cases, weaknesses in Java Applets have been exploited to infect computers with malware.  Web browsers now warn users of the potential risk.  The following discussion describes the differences between Java, Java Applets and JavaScript.

Java is a general programming language that can run on Windows, Linux or Mac computers regardless of computer architecture.  This versatility is accomplished by converting the Java computer programs into bytecodes that are interpreted by a virtual machine.  The Java Virtual Machine (JVM) is a computer program tailored for the specific hardware and operating-system platform.  When you download Java software, the package contains the JVM and Java Plug-in software that enables browsers to execute Java Applets.

A Java Applet is a small application written in the Java language and stored as bytecodes.  When a browser encounters a web page containing a Java Applet, the browser uses the Java Plug-in to decode the instructions indicated by the applet.  The result is usually an interactive web page that the user can use to play a game or perform calculations.  Weaknesses in the web browsers can be exploited by malicious Java applets, and for this reason some mobile browsers do not run Java applets at all, or they issue a security warning that asks for confirmation before allowing Java applets to be executed.  The warnings may discourage users from using particular web pages even when they pose no danger. It is possible that in the future, browsers will not run Java Applets at all.

JavaScript is an interpreted computer programming language that is used by web browsers to interact with the user and control the display of the web page. Except for a similarity in the name, JavaScript is not related to the Java programming language.  Although JavaScript can have some security problems, it does not have the vulnerabilities of Java Plug-ins.  The use of JavaScript is now ubiquitous in many web applications such as Gmail and Google Maps that use Ajax (Asynchronous JavaScript and XML).  The following links let you compare the implementation of a FreeCell Solitaire game implemented as a Java Applet and as a JavaScript application.

FreeCell Solitaire Java Applet

FreeCell Solitaire in JavaScript

The End of the World is coming

The End of the World is coming on December 21, 2012 according to some interpretations of the Mayan calendar.  Enough people are concerned about this doomsday prediction that they are taking special precautions.  In Michigan, Matt Wandrie, superintendent for Lapeer Community Schools, closed 30 Michigan schools two days early for the Christmas holidays.  There were numerous rumors circulating about potential threats of violence against students following the recent shootings that killed 20 children in Connecticut.  According to Wandrie, the ancient predictions of apocalypse were a secondary concern, but the rumblings about violent threats against schoolchildren were more serious.

Rational people should know that time does not stop just because your clock stops.  Calendars are just clocks that measure time in days instead of minutes.  So, reaching the last day of the calendar does not mean that the world will end.  It just means that you need to flip the page of the calendar to start measuring a new era.

Calendar adjustments have been made throughout the ages.  Pope Gregory XIII introduced the calendar that we now use on February 24, 1582.  The Gregorian calendar corrected an error in the Julian calendar that preceded it.  The Julian calendar considered the year to consist of 365.25 days, when in fact it is about 11 minutes shorter. This discrepancy, although small, caused the seasons to drift by about three days every 400 years. At the time of Gregory’s reform, the vernal equinox that marks springtime was already 10 days earlier than in Roman times.  The new calendar skipped 10 days to get the seasons in agreement with earlier times.  This was equivalent to setting the hands of a clock forward for a clock that had been running too slowly.  Superstitious people believed that this change of the calendar would cut their lives short by 10 days.

The end of the world has been predicted and described many times.  The Biblical story of Noah’s Ark tells how the world survived when God decided to destroy the world because of mankind’s evil deeds.  But the world did not end. The real end of the world will come in about 5000 million years when the Earth is engulfed by our Sun after it runs out of hydrogen and changes into a red giant star.  We will not be around to see that.  Before then, a supervolcanic eruption or a collision with a large asteroid would be two natural events that could wipe out mankind, but we cannot predict when that might happen.  In the meantime, we will be lucky if we are able to survive the next thousand years without becoming extinct from our own pollution and our weapons.

Learn more about the End of the World

Flash Player spyware in your computer

The video camera and microphone of your computer can be controlled remotely by web sites if you installed the Flash player using the default settings. This is a great invasion of privacy because most computer users do not know how to change the settings to avoid this type of intrusion. In addition, the Flash player allows web sites to store information on your computer that can be used to track your activities on the web.

Adobe’s Flash Player is used extensively on web pages to provide dynamic web content. Web sites like YouTube rely on the Flash Player or Shockwave Flash plugin to display movies and video clips on a user’s terminal. In January of 2010, Steve Jobs announced that Apple would not support Flash because it was so buggy that it caused most of the crashes in Mac computers, but the Flash player is a very common component of Windows computers. Beginning with Flash Player 10.1, the Flash Player integrates with web browsers to automatically clear stored data in accordance with the browser’s private browsing settings.

When installing Flash, the first concern is that the download screen has a checkbox for McAfee security scan that is checked by default. If you click the “Download now” button without unchecking the box, you are going to end up with extra software in your computer that you may not want and will have to uninstall later.

Once you install the Flash player, you have to set the privacy settings. Open a web page like that uses Flash and right click on a Flash object. A pop-up panel like the one below appears. Click on Global Settings…

If you don’t want to be tracked through the Flash player, click on the option to block all sites from storing information. The interface may give you a warning that some sites may not work properly. Click OK to set your choice.

Next, click on the “Camera and Mic” tab and set the option to block all sites from using the camera and microphone. If you will only be using the Flash player to watch videos, there is no reason to allow any site to eavesdrop or spy on you.

The following link invokes the Flash Player settings manager for your computer with the web interface below. Needless to say, you have to go through this procedure for each computer on which you have installed the Flash player.

Global Privacy Settings panel

Scientific Research in Washington DC

Andrew Carnegie founded the Carnegie Institution of Washington as an organization for scientific discovery in 1902.  The organization changed its name in 2007 to the Carnegie Institution for Science to reflect the fact that scientists work not only in Washington, but in six scientific departments on the West and East Coasts of the United States.  The Geophysical Laboratory and the Department of Terrestrial Magnetism are both located on a beautiful campus at 5241 Broad Branch Road, NW in Washington, D.C.

The Department of Terrestrial Magnetism was founded in 1904 to map the geomagnetic field of the Earth. This goal was accomplished by 1929, and the focus of the department’s research shifted toward understanding the Earth and its place in the universe.  Today, the department has an interdisciplinary team of geophysicists, geochemists, astronomers, astrophysicists, cosmochemists and planetary scientists.

Dr. Linda Elkins-Tanton is the director of the Department of Terrestrial Magnetism. Dr. Elkins-Tanton conducts research on the evolution of terrestrial planets, and the relationships between Earth and life on Earth.  One of Dr. Elkins-Tanton’s latest projects analyzed the relationships between large volcanic provinces and global extinction events, focusing on the gaseous emissions of sulfur, chlorine, and fluorine from the Siberian flood basalts and their possible contribution to the end-Permian extinction 251 million years ago.  In the above photograph, Dr. Elkins-Tanton introduces a lecture on the use of pressure to make novel materials by Dr. Timothy A. Strobel of the Geophysical Laboratory.

Dr. Strobel answers questions after his presentation

The Geophysical Laboratory was founded in 1905 to examine the physics and chemistry of Earth’s deep interior. The laboratory is a world-renowned center for the study of rock compositions. The laboratory’s research in high-pressure and high-temperature physics has produced many scientific publications in both Earth and material sciences.

Dr. Russell J. Hemley is the director of the Geophysical Laboratory.  His research program has expanded to include high-pressure experimental and theoretical studies in condensed matter physics, Earth and planetary science, and materials science.

The Geophysical Laboratory and the Department of Terrestrial Magnetism host a series of Neighborhood Lectures at 5251 Broad Branch Road, NW, Washington, DC 20015.  The lectures are open to the public and provide information about the research programs.  Light refreshments are served after the lectures.  Click this link for more information about the Carnegie Institution for Science.

Learn about the Timeline of the Earth

HTML web pages for mobile devices

The iPhone and other smart phones have become very popular because in addition to making telephone calls they can also access the Internet, play music, take photographs and record videos.  Tablets like the iPad are also increasing in popularity because they are lightweight and eliminate the need for a keyboard, but they can perform many of the functions of a computer.  Before tablets were introduced, “mobile devices” were telephones with small screens that could only handle small web pages.  Web programmers were encouraged to redirect traffic from mobile devices to a mobile subdomain containing streamlined web pages that would load fast and format data for the small screens.

Telephone manufacturers reacted to the need for accessing the Internet by introducing bigger screens with higher resolution and by developing pinch-in and pinch-out zoom gestures to make the text more readable.  The variety of mobile devices and the way in which the pixels of web pages are mapped to the screens has made it difficult to design optimum mobile web pages, particularly with the introduction of tablets with displays equivalent to a laptop or a desktop computer.

The increasing number of tablets means that it may not be appropriate to automatically redirect mobile devices to web pages for small screens.  A more practical approach is to let the user decide which format to access by providing a button such as the following that is displayed close to the top of the page for mobile devices only.

The following code sets up a non-display <div> element containing the image.  The JavaScript code that follows checks the screen width and the userAgent to allow the display of the button for screens with a width smaller than 500 pixels or for web browsers used by mobile devices.  The BMI web page ( uses this code. View the page with a desktop computer and with a mobile device to see this technique in action.

<div id="mobile" style="display:none;">
  <a href="">
    <img src="mobile-page.gif" width="100" height="71" alt="view mobile page"/>

<script type="text/javascript"><!--
if (screen.width < 500 || 
    navigator.userAgent.match(/Android/i) || 
    navigator.userAgent.match(/iPhone/i) || 
    navigator.userAgent.match(/BlackBerry/i) || 
    navigator.userAgent.match(/webOS/i) || 
    navigator.userAgent.match(/iPod/i) ) {
      document.getElementById('mobile').style.display = "block";

Android phone turns on by itself

Android Pro phone

I have been using an Android Pro phone for about one year.  It is a good smart phone that lets me access e-mail and the Internet easily.  The phone can play music, take pictures, and I have also used it tethered to a laptop to get Internet connectivity in places without WiFi hotspots, but I have three basic complaints:

1) The phone is slow to respond to the input from the touch screen. This is particularly noticeable soon after I have turned on the phone.  This is a major problem for a device whose main function is to make telephone calls.  This deficiency is inherited from the operating systems that run our computers.  Many times I have clicked on a window to try to stop a process only to be ignored by the computer.  I click, and click, and click, but the computer is too busy with its internal processing to pay attention to my commands.  Today’s operating systems are not designed to be smart enough to give priority to human commands over other processes that may be running on the computer.

2) The reflectivity of the glass makes it impossible to read the screen in bright sunlight.  Sometimes, I just put the phone back in my pocket and wait to use it when I am indoors.  This is the same as not having a phone.  Cupping the hand to shade the screen can help to read the screen, but then you only have one hand free to enter numbers or other information.  I wish that phones could activate a high contrast screen like the E Ink display of the Kindle DC book reader so that it could be read in bright sunlight.  You could then use the back-lit LCD screen at night and the E Ink screen in the daytime.

3) The Android phone turns on by itself.  There are various online groups and bulletin boards that have discussions about this problem but they don’t offer any real solutions. Approximately three or four minutes after I turn off the phone, it turns on again by itself.  One time, I found that my phone battery was completely discharged because the phone had turned itself on and spent all its energy trying to get a signal.  After I turn off the phone a second time it generally stays off, but not always.  The purpose of turning off the phone is to conserve the battery, but if the “power off” command does not really turn off the phone, what is its purpose and what is it doing?   We can be a little paranoid and imagine that the phone is turned on by Google or some government agency that is secretly tracking our location and using the phone’s microphone to eavesdrop on our conversations clandestinely.  More likely, it is just a software bug or a hardware problem and not some secret Big Brother plot, but my phone turns on by itself so frequently without my authorization that I now take out the battery after I power off.  This shows the phone who is the boss.

Standards compliance vs. cross-browser functionality

Webmaster’s Dilemma.

The World Wide Web Consortium (W3C) provides defines for coding HTML and provides a validator to check the markup of HTML and other types of Web documents ( The advantage of complying with the W3C standards and having error-free code is that the web page will have cross-browser compatibility, facilitate analysis of the web pages by search engines, and ultimately enhance search engine ranking.

Standards are moving targets, and web browsers face tough competition. In the past, Netscape and Internet Explorer battled for supremacy to act as the gateways of the Internet. Each of the browsers introduced unique features that gave them an advantage over their competitor, but this created chaos for web programmers who had to provide alternative code for the browsers and their different versions.

As the number of browser competitors increased, customized browser coding lost favor and there was a clamor for HTML standards. The battle was only partially won, because the browser developers still had to support old HTML coding conventions while trying to meet the majority of the new standards. Today, five browsers dominate access to the internet: Internet Explorer (IE) from Microsoft, Safari from Apple, Chrome from Google, FireFox (FF) and Opera. Both FireFox and Opera obtain revenue from Google by setting it as the default search engine.

Most of the browsers update themselves automatically when newer versions become available. Microsoft originally tightly bundled the IE browser with its ubiquitous operating system in order to get marketplace dominance, but this turned out to be a bad decision because the newer versions of the browser cannot be installed in the older operating systems. Windows XP is locked into using version 8 of IE because the browser is used to apply updates to the operating system. Consequently, versions 6 through 9 of IE are still out in the field, and the browser has lost significant usage share. IE usage was over 70 percent in 2005, but it has dropped to about 20 percent in 2012.

The HTML5 standards, which are still under development, have the potential to standardize web applications of the future. In the meantime, web developers still have to code using some of the old conventions to get the required cross-browser functionality. A case in point is the HTML5 error message for the following applet element: “The applet element is obsolete. Use the object element instead.”

<applet code=”AudioBox.class” height=”0″ name=”AudioBox” width=”0″>
<param name=”ab0″ value=””/>

The correct HTML5 code should be:

<object type=”application/x-java-applet” height=”0″ width=”0″ name=”AudioBox”>
<param name=”code” value=”AudioBox.class” />
<param name=”ab0″ value=””/>
Applet failed to run. No Java plug-in was found.

Unfortunately, the object element for AudioBox.class works for FF, IE version 9, and Opera, but not for Safari or Chrome, whereas the applet element works on all five browsers. Other applets work fine when converted to the object element on the Safari and Chrome browsers, but not this particular one. There must be some subtle point of incompatibility. Hence the dilemma: 1) comply with the standards and lose support for two browsers which have a combined usage share of about 40 percent, or 2) disregard the standards in favor of code that works in the five major browsers. From a business perspective, the decision to disregard standards and support the majority of customers is easy. Perhaps later, when the specification of the HTML5 is finalized and all the major browsers are compliant, there will be a time when it will be possible to meet standards and support all users.

The convergence to HTML5 will eventually reduce web site maintenance, but the diversification of web-enabled devices, such as smart phones and tablets, is already making it harder for webmasters to serve all users with common code. The small screens of the phones require customized display formats to be useful, and these web pages are usually kept in a separate mobile subdomain and have completely different code.

The search for extraterrestrial life

Many years of robotic exploration of Mars have not produced evidence of life on the Red Planet.  During the next twenty years, NASA will conduct several missions to try to determine whether life ever arose on Mars.  NASA’s Mars Science Laboratory mission Curiosity rover, will launch in late 2011 and land on Mars in August 2012.  The search will focus on places where there may be liquid water at sources of geothermal energy.  There is great expectation that there may be Martian microbial life, but it would really be surprising to find multicellular organisms.  Some scientists think that life on Earth may have had its start from microorganisms that traveled on rocks ejected from Mars after meteorite impacts.  If life is found on Mars, DNA analysis will be used to identify similarities to Earth organisms.

The search for intelligent life has been a dream of science fiction.  The Star Trek television series started each episode with the prologue “Space: the final frontier. These are the voyages of the starship Enterprise. Its five-year mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before.”

Establishing a technologically advanced society has a great number of special requirements.  We have been able to achieve this because we live in an oxygen atmosphere where we can make fire that makes it possible to smelt metals.  Our manual dexterity enables us to manipulate objects easily and to build tools.  Had we been relegated to the realm of the sea with flippers instead of hands with opposable thumbs, even with all our brain power we would not have been able to build the technology to send a probe to another world.  The Neanderthals who preceded us were able to use fire for cooking and for warmth, but in the 250,000 years that they were on Earth they did not advance beyond the stone age.  Modern humans have existed for about 60,000 years, and civilizations were only established 10,000 years ago.  In the last 250 years, our industrialization has managed to pollute the atmosphere to the point that we may trigger a global warming event within a couple of hundred years and cause the extinction of many species, perhaps even our own.

Learn more about the evolution of life on Earth

WordPress wp-admin/install.php gives blank page

The installation of the WordPress content management system is straightforward with very clear installation instructions. The basic steps consist of 1) downloading the WordPress package, 2) creating a MySQL database and establishing a MySQL user with all privileges for accessing and modifying the database, 3) setting up a configuration file wp-config.php that identifies the database, user, and password, and 4) running the installation script by accessing wp-admin/install.php.

I wanted to install a local copy of WordPress on my Windows Vista computer to develop a WordPress theme.  My computer had the required Apache web server, PHP, and MySQL database programs.  Using phpMyAdmin, I set up the database and the user ID for the blog without problems.  However, when I ran the WordPress installation script, I got a blank page.

To get some diagnostic messages, I changed the WP_DEBUG variable from “false” to “true” in the wp-config.php file.

define('WP_DEBUG', true);

This produced the following messages:

Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\www\wordpress\wp-includes\wp-db.php on line 1037

Fatal error: Maximum execution time of 60 seconds exceeded in C:\www\wordpress\wp-includes\wp-db.php on line 1037

About one year earlier, I had a problem establishing a connection with a MySQL database from a Perl program.  The problem was finally resolved when I used the numeric IP address of the localhost instead of just “localhost”.  This same solution worked for WordPress by specifying for my localhost in the wp-config.php file.

/** MySQL hostname */
define('DB_HOST', '');  /* localhost */

My Perl programs accessing local MySQL databases look like this:

# Access MySQL database "names"
use DBI;
$database = 'names';
$hostname = '';  # localhost
$port = '3306';
$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
$user = 'user1';
$password = 'xxxxx';

$dbh = DBI->connect( $dsn, $user, $password )
|| die "Cannot connect to $database: $DBI::errstr";

$query = 'show tables;';
$sth = $dbh->prepare($query);
my $numRows = $sth->rows;  # number of rows
print "Number of Tables=$numRows\n";
while (my $row = $sth->fetchrow_arrayref) {
print join("\t", @$row), "\n";
print ' * * * *',"\n\n";