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";

Skeptics doubt global warming

A NASA report stating that it was “unprecedented” that melting was taking place on 97 percent of Greenland’s ice cover was criticized by people who doubt that global warming is actually occurring. The critics point out that the current melting may be part of a regular planetary cycle that recurs approximately every 150 years, with the last one happening in 1889. Furthermore, they say that the current fires in the west coast and the drought in the central and southern part of the U.S. are just variations within the normal range of weather patterns and are not the result of global warming.

Is global warming real, or is it an exaggeration? If it is real, and if it is caused by the carbon dioxide emissions from burning fossil fuels, there is something that we can do about it by switching to alternate sources of energy. If we don’t do anything about global warming, there are serious consequences. Two major things will happen: 1) as the ice in Greenland and Antarctica melt, the sea level will rise by several feet flooding coastal communities around the world, and 2) the shrinking glaciers and snow cover in the mountains will decrease the flow of fresh water in the rivers thus reducing our crop yields and our food supply.

Some scientists have predicted that there will be a mass extinction event in about 200 years if nothing is done about the rate at which we are putting carbon dioxide into the air. Basically, we are killing ourselves and many other fragile life forms with our pollution. After humans are gone, other life forms will inherit the Earth.

The following video shows a huge newly discovered rift in Antarctica that will create a giant glacier when the ice finally breaks. You may hear about this in the news soon.

Did Cleopatra bathe in milk?

At last, healthy feet

It has been widely reported, although not confirmed, that Cleopatra bathed in milk. The practice may seem eccentric and somewhat bizarre, but close analysis indicates that bathing in milk or washing the skin with milk has some merits.

At room temperature, milk is fermented by bacteria that produce lactic acid. Such bacteria are commonly found in yogurt. Lactic acid is an alpha-hydroxy acid with the chemical formula CH3CH(OH)COOH. Alpha-hydroxy acids (AHA) are used extensively in the cosmetics industry in products claiming to reduce wrinkles, fade age spots and improve the overall look and feel of the skin. They are also used by dermatologists in chemical peels, and by beauty spas and home kits in lower concentrations. The effectiveness of alpha-hydroxy acids for improving the skin is well documented, although there are many cosmetic products with exaggerated claims. It is quite reasonable to expect that washing the skin with milk could promote the growth of lactobacilli bacteria that would help to remove dead skin cells by the action of the acid generated. In addition, the butterfat in milk would act as a moisturizer to prevent the skin from becoming dry.

Recent studies have revealed that many microbes inhabit the skin and mucosa of the digestive system of healthy humans. It is estimated that there are at least ten times as many bacteria as human cells in the body and that these bacteria are beneficial by preventing the growth of pathogenic organisms.[1] In view of this, we should question whether the use of antibacterial soaps is useful or harmful. Killing the beneficial bacteria on our skin could leave us vulnerable to infections by fungi and disease-causing bacteria.

I recently read Mycophilia: Revelations from the Weird World of Mushrooms by Eugenia Bone. This book describes the life cycle of fungi and the lengths to which people go to find edible wild mushrooms. The book points out the pervasiveness of fungi throughout nature, the fungal infections that afflict humans, and the intricate and delicate balance of conditions required to culture mushrooms.

I decided to integrate some of the ideas of the human microbiome and the knowledge that I had gained from reading this book to fight a minor, but persistent athlete’s foot infection that I had had since my early twenties. For more than 40 years, I had used antifungal powders and creams to keep the infection in check, but nevertheless, I still had scaly feet and rough heels.

My new treatment consisted of scrubbing the feet with a lava stone to remove dead skin while showering. After the shower, I rubbed about one tablespoon of hydrogen peroxide to each foot so that the bubbling action of the hydrogen peroxide could loosen flaky skin. While the feet dried, I mixed one teaspoon of plain yogurt with a quarter cup of milk and stirred. Once the feet were dry, I applied the milk inoculated with yogurt to my feet making sure to rub the feet thoroughly, including between the toes. I allowed the milk to air dry, and applied a little bit of coconut oil to the feet as a moisturizer. My feet looked healthy with no sign of fungus infection after two weeks of this daily treatment, as shown in the picture above.

I feel that this experiment, although not scientifically rigorous, demonstrates that the milk-yogurt mixture changed the environment of my feet to promote the growth of bacteria that inhibited the persistent fungus. Looking at Cleopatra’s milk baths from this perspective makes a lot more sense now.

[1] Human microbiome, Wikipedia

Questions about the personality test

Carl Jung

Personality analysis can be very useful for understanding people and the mechanisms of social interactions.  The Zamora Personality Test provides an approach for identifying behavioral characteristics that contribute to what is called “personality”.  Through these characteristics we are able to judge whether a person is honest, hard-working, aggressive, etc.  Such knowledge enables us to develop strategies for successful business negotiations or satisfactory everyday interactions.  Recently, I got the following questions about the personality test.

Question from Alex:

I happened upon your interesting website and conducted your online personality tests for myself.  Might you answer the following questions on these Zamora tests, please?
1. Which personality theories, or tests, are they based on, or are they entirely your own creation?
2. I had problems answering quite a few questions, both in the Social and in the Individual Attributes test. The reason is, I think, that these, and many of your questions are actually a compound of two questions, but your questionnaire only allows for one answer;  thus, I believe, my conflict, or disagreement with being forced into giving one answer to actually two questions, also will affect the results of your testing procedure. I admit, I am very logical when it comes to reading and writing, but these remarks to you are intended as a stimulating thought process to see if I, or you, have missed anything!

An example from the Social Attributes Test:
Your Question reads:  I have enough money, and I don’t like to spend it:
say my Answer is: Disagree (No), then logically I am agreeing to two statements:
First, that “I have enough money” and second, “That I don’t like to spend it”.
But for any individual person, two other answers (which match reality) as combinations of the double-question are possible, namely:
Alternative Answer 1:
First, that “I have enough money” (Agree = Yes) and second, “That I don’t like to spend it” (Disagree = No). I.e., this person has enough money for their needs, and does enjoy spending the money they have (possibly few people in today’s consumerism-driven society!)

Alternative Answer 2:
First, that “I have enough money” (Disagree = No) and second, “That I don’t like to spend it” (Agree = Yes).  I.e., this person tends to spend money, even more than they have (a common social affliction apparently!).

I think my interpretation of this question is logical and correct, and there are many other of questions that are equally “difficult” for me to answer as the questions similarly allow two possible answers, but only one answer is allowable to both in the questionnaire.

I would value your comments to this conundrum in your questionnaire.

I approached the personality test form a linguistic perspective.  The rationale is explained in the discussion of what is personality.  With regard to the questions, I tried to identify personality attributes by probing from different perspectives and then coordinating and ranking the results.  In any linguistic test, it is inevitable that there will be misinterpretations because language has many subtleties and ambiguities.  This is one of the reasons for the variety of statements, some of which appear to be redundant.  Inconsistency in answering may indicate a neutral attitude, but it may also be the result of not understanding the question.

Regarding the particular statement: “I have enough money, and I don’t like to spend it.”, The purpose of the statement is to try to determine whether a person is generous or stingy as a measure of egocentrism; it is also an indicator of tolerance for risk.  Of course, if a person does not have enough money, the answer is tricky, as you mentioned.  Many of the personality attributes could be obtained by asking direct questions, such as “Are you mature?”, “Are you generous?” or by posing ranking criteria “On a scale of 1 to 10 how dependable are you?”. Unfortunately, people are not very objective judges of their character and it is better to classify them by their actions.  The test provides this round-about way of gathering information which hopefully is more reliable than an introspective self-evaluation.

Looking at the question from a Boolean perspective, as you have, is an interesting exercise, but it does not apply well to natural language.  The statement  “I like apples and oranges” could not be true in Boolean logic since the intersection of apples and oranges is null in set theory.  The Boolean interpretation is “I like apples or oranges” where the set includes both, but this is not the way we speak in English, or any other natural language. The sentence “I like apples or oranges” has the natural language implication of liking one or the other, but not both, which is another Boolean conundrum.  I am sure that logicians could write many papers on the topic that the English “and” is approximately equal to the Boolean “or”, but not quite.

Try the Zamora Personality Test

BET Information Systems nSphere scam

Beware of working with BET Information Systems, doing business as nSphere, which is supposedly a Boston-based high-growth technology company that builds informative aggregate websites targeting local markets.  BET lists its address as 100 Franklin Street, Suite 900 in Boston, but the address is occupied by a real estate investment company.  When I contacted the Better Business Bureau, they could not find any information about BET or nSphere, but they told me that the address had come up before as a virtual office.

The scam works by teaming with a web site owner who agrees to split revenue 50/50 for a “localmarket” subdomain of the website which is hosted by BET/nSphere.  The web site owner only needs to provide a few articles, add a few links in the home web page, and redirect the subdomain to a server controlled by BET/nSphere. nSphere organizes local information and connects users to the local data that they need.  It takes some time for the traffic to build up on the, but BET/nSphere starts collecting ad revenue from Google AdSense and posts the monthly earnings in a database accessible to the web site owner.  BET/nSphere is supposed to send monthly reports, but they don’t do it, and they also don’t make the payments for half of the revenue as required by the contract. E-mail messages about the missing payments are ignored, and even written invoices sent by certified mail are ignored. As far as I can tell, nSphere only has people setting up systems to collect revenue, but all the people disappear when it is time to pay. Some web site owners may forget that they redirected their localmarket subdomain and may continue being victims of the scam for years.

My advice is to avoid doing business with BET Information Systems or nSphere.  The company does not seem to have honest management.

Learn more about scams

Vitamins are harmful in large doses

Vitamins are necessary for a healthy life.  A proper diet can supply all the vitamins that our body needs, but vitamin deficiencies can result from diets that do not include a variety of vegetable and animal products.  People who don’t eat animal products for philosophical reasons (vegans) need to take Vitamin B12 supplements to avoid deficiencies that can cause anemia or nervous system damage.

The sale of vitamins in the United States is a multi-million dollar industry.  If you turn on the television at dinner time, you are likely to see many advertisements for vitamin pills and dietary supplements.  Many people self-medicate without consulting a dietitian or nutritionist and try to compensate for their bad diets by taking daily doses of vitamin and mineral supplements.  Also, many doctors find it easier to recommend vitamin pills, rather than educate their patients about nutrition.

Experimentation with large doses of vitamins was proposed by Nobel Laureate Linus Pauling, who claimed that gram quantities of Vitamin C could prevent colds and cure cancer.  Further scientific studies found that Vitamin C was not effective for colds or cancer.  There is a lot of popular appeal for the idea that if a little is good, more must be better.  But this is not so.  A healthy body can only be maintained through moderation.

In the 1950s, Denham Harman proposed the idea that damage from free radicals on the cells caused aging.  Free radicals are highly reactive unstable groups of atoms that can be neutralized with antioxidants.  Since Vitamin E is an antioxidant, many people started to take the vitamin in doses as high as 2000 IU per day, when the Recommended Daily Allowance (RDA) is only 22.4 IU.  However, large doses have been found to increase the risk of cancer, rather than reduce aging.  Researchers at the National Cancer Institute found that men who took a high daily dose of vitamin E (400 IU per day) had a 17 percent greater risk of developing prostate cancer.  The trial included 35,533 men in the U.S., Canada, and Puerto Rico who were monitored for 7 to 12 years.[1,2]

Vitamin A is a fat-soluble vitamin that is found in carrots, green leafy vegetables and liver.  Vitamin A toxicity develops after taking too much vitamin A for long periods. Excessive vitamin A intake is associated with increased risk of fracture.  Some of the symptoms of hypervitaminosis A are blurred vision, bone pain or swelling, and abnormal softening of the skull in children.[3]

What vitamins or minerals should you supplement?  Start by using a free web application for tracking your nutrition such as CRON-O-Meter. Enter the foods and the amounts that you eat in a typical week.  When you have data for one week, you can determine the deficiencies in your diet, and only then can you decide what supplements to take.  Most people find that they only need to supplement magnesium.  Calcium may also be necessary for those who don’t consume dairy products regularly.  A detailed analysis of the foods that you eat can lead you to make more nutritious choices.

Chemical Structure of Vitamins and Minerals

[1] Klein EA, et al., Vitamin E and the risk of prostate cancer: the Selenium and Vitamin E Cancer Prevention Trial (SELECT), JAMA. 2011 Oct 12;306(14):1549-56. PMID: 21990298

[2] Lippman SM, et al., Effect of selenium and vitamin E on risk of prostate cancer and other cancers: the Selenium and Vitamin E Cancer Prevention Trial (SELECT), JAMA. 2009 Jan 7;301(1):39-51. Epub 2008 Dec 9. PMID: 19066370

[3] Zile M. Vitamin A deficiencies and excess. In: Kliegman RM, Behrman RE, Jenson HB, Stanton BF. Nelson Textbook of Pediatrics. 18th ed. Philadelphia, Pa: Saunders Elsevier; 2007:chap 45.

How to make an Albert Einstein head from a mango seed

Ripe mangos are sweet, juicy and delicious.  Sometimes you cannot stop sucking on the seed to get every bit of pulp.  When all the pulp is gone, you are left with a hairy seed that is perfect for making doll heads. You can draw facial features with a pen, or cut out faces from magazines and paste them on the seeds.  Mango seed dolls have real hair that you can comb and trim.  Here is a step-by-step guide for making mango seed doll heads.

Eat the mango and remove all the pulp from the seed.  Let it dry and comb the hair from time-to-time as it dries to prevent the hair from matting.  This is the way the mango seed looks after combing.
Cut out a picture of your favorite rock star or scientist.  Make sure the size of the face is approximately the size of the seed.  Paste the picture on the mango seed and comb the hair in a suitable style.  For Einstein we leave the hair a little bit wild.

Here is the finished Einstein head at a party with several clowns.

You can make a two-faced doll by gluing another face to the back side of Albert Einstein.  Since the mango hair is nice and blond we can choose a picture of Marilyn Monroe, but it looks like she had a bad hair day.

Global warming brings early cherry blossoms

Carpet of cherry blossomsThe USDA published a new Plant Hardiness Zone Map based on the average annual minimum winter temperatures.  Growers and gardeners use the map as a guide to determine which plants are most likely to thrive at a location. When the new guide came out, it was evident that the hardiness zones had shifted further to the north.  This is a clear indication that the plants feel that the weather is warmer.  Some lettuce plants that sprouted in the fall in Washington, DC survived the winter without freezing.  Washington’s famous cherry trees reached peak bloom two weeks earlier than usual, and the Cherry Blossom Festival had to be held earlier.  By the end of March, which is the usual time of the festival, the flowers were gone and the ground and the cars were covered with cherry blossom petals.
Car covered with cherry blossoms
The release of the new hardiness map did not mention global warming because this is a political hot topic in the United States.  If global warming is accepted as a fact, there are economic implications.  For example, carbon dioxide and other greenhouse gases will have to be controlled by reducing the combustion of fossil fuels.  This would reduce the profits for energy producers, car manufacturers, and many other industries.  To maintain the current business models, it is better to deny global warming and continue burning fossil fuels.  There is another reason why manufacturers would like to keep the status quo.  If the cost of fossil fuels is raised to try to reduce their use, new alternative fuel technologies and green power sources will be developed to compete with existing industries.  This is bad for the businesses that profit from the consumption of fossil fuels.  They will be like the buggy whip manufacturers that eventually went out of business when internal combustion vehicles replaced horse-drawn carriages and became the main mode of personal transportation at the beginning of the twentieth century.

Global warming poses a real threat to our ecosystems, including the risk of mass extinctions.  The winters with little snow, tornadoes before springtime, rising sea levels, and early blooming of trees are all signs of warmer weather.  The rise in temperatures is correlated with the increase of atmospheric carbon dioxide which started with the industrial revolution.  It is getting harder and harder to deny the impact that our industrialization is having on our planet.

Geologic history of the Earth and global warming

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.