Monday, July 30, 2012

Mark-up for superscript, subscript, and display code

 for Firefox 10, Google Chrome 20, Internet Explorer 8


Raised script is called "superscript".

The tags are and .


The superscript tag looks like this when rendered:

"This text contains superscript text."

Or when used in mathematical notations: 2(3)


Lowered script is called "subscript".

These are the subscript tags: and .


Rendered subscript looks like this: "This text contains subscript."

Or like this: 2(3)

Show Code

Above, when I was showing how to code for raised script I wrote,

"The tags are and ."

You may be asking, 'How did you make the tags show as characters - and prevent the browser from raising the word, "and" - like it's supposed to?'

In this example, the secret is the "textarea" tag. When one writes code between textarea tags they are rendered just as text, the browser doesn't interpret them as functions.

Some time ago, in the early days of of the internet, a group of code writers decided that a textarea should have certain characteristics associated with them. I don't understand why, I think its a waste of time - but in any case, this is what a default textarea looks like (in your browser):

Different browsers attach different defaults to textareas in different versions. Firefox 10 and Chrome 20 add a re-size tab that allows the user to expand the textarea by dragging it, while Internet Explorer 8 adds a scrollbar instead - even if there is no content in the textarea. In Google Chrome a scrollbar is added if default height is set at less than the browser's default line-height (18 pixels) - even if there is enough room for content in the prescribed width. In Google Chrome and IE8 browsers, textareas have a default width (20 characters) and height (2 lines), while Firefox 14 defaults 3 rows high instead of 2.

To show you the tags in a sentence unrendered by the browser, I had to add a stylesheet to this post that gets rid of all the defaults. One does this by adding attributes that over-ride unwanted, default attributes.

You can read them below, I have pasted the style sheet into another textarea. I got rid of the border in the first line: "border: 0px none;"; I set a width and a height, which over-rides columns and rows defaults; and got rid of the resize tab by writing "resize: none;". In Google Chrome a scrollbar is added to the textarea even though all the content would fit in the prescribed parameter - if it wasn't in the way! To get rid of the scrollbar in Chrome 20, and in IE8 I had to add the fifth attribute, "overflow: hidden;".


[Note: I had to break the 'end textarea' tags ('</textarea') so browsers wouldn't read it as the end of the yellow textarea box. This does not happen with any other tag, except textarea.]

Originally when I wrote this article in my source code editor, Nopepad++ I had the width set to contain 5 characters (60 pixels - Blogger's default character width for this blog template is 12 pixels), and height is set to the common browser default line height (18 pixels). But because Blogger has a default line height and font size smaller than the default line height and font-size in most browsers, the textarea-surrounded-text sat high above the other text in a sentence. To fix this I reduced the line height and the font-size inside the "show-code-1" textareas. The change works well in all the browsers mentioned here.

(Opera and Safari are two other fairly popular browsers, but I don't have them on my machine right now as I'm learning data bases - and that project is taking up a lot of disk space and memory.)

This would be much simpler if W3C (the web standards body) would restate the standard to no defaults, except to contain the writing between the tags.

I have no idea why textarea is preset with all these defaults. At present textarea is set to 20 characters wide and 2 lines high. ???


W3C | Elements | textarea |

Nopepad++ code editor by Don Ho (free AND free!) |


Monday, July 16, 2012

UV-Index readings 'off the scale' this summer

Editor's Note - 18 July 2012: The EPA maps included in this post are updating URL's, the map images that I posted here, and the copy written about them, was about forecast UV levels for Monday, July 16, 2012. When I published the images I thought I was getting an image that would remain static - but it turns out these are 'light-box' URL's - the image addresses get re-newed daily, a new image is added each day to the image address showing each day's forecast UV-Index highs. There is an archive of the data that was used to make these EPA maps, at National Oceanic and Atmospheric Administration (NOAA) - (see links and data below).

I've been noticing that the sun has been rather 'hot' this summer, as in it feels like your skin is burning as soon as you walk outside.

Last week's sizzling temperatures in the U.S. worked their way across the border into Toronto on a couple of days - but luckily we've had some periodic respite through this period, unlike our friends to the south.

Look at today's UV-Index predictions from the U.S. Environmental Protection Agency (EPA) - look at Louisiana, Texas and New Mexico. Twelve ?!!  I didn't know the UV-Index went up to 12!

Environment Canada is predicting "9 or very high" for noon today.

I thought the polar ozone holes were diminishing since we got the chlorofluorocarbons out of the fridges and air conditioners ... oh wait - we didn't!

We did start using more pumps, pour-ons and roll-ons instead of sprays; and we did start slathering our skin with UV blockers that likely cause skin cancer themselves --- but with the refrigerators and the air-conditioners, they still need chlorofluorocarbons (CFC's) to work. 

With those sources, we just started recycling them - so when your A/C (or your refrigerator) stops working well, and you call in the professional HVAC person, they're now supposed to make sure the old Freon (Dupont's trademark name for CFC's) that is still in the machine doesn't escape while they're fixing it --- or when they're replacing old machines they're supposed to collect all the old Freon and store it in a canister and re-use it.

Since those laws were passed all talk in the Popular Press about the antarctic ozone hole seems to have gone away - and since that law was passed the number of residences with A/C has likely quadrupled. According to Canadian Federal Government's Office of Energy Efficiency (OEE) study, from 1990 to 2007 energy use for air conditioning in residences in Canada tripled.

"2007 Survey of Household Energy Use (SHEU-2007) -- Summary Report"

II. Survey findings 
Air conditioning and other cooling methods
According to Natural Resources Canada’s Energy Use Data Handbook Tables,13 from 1990 to 2007, the energy consumed in the residential sector for space cooling almost tripled (increasing by 266 percent). Furthermore, there was a noticeable increase in the penetration rate of air conditioning systems in Canadian households. Because of this, SHEU-2007 collected information on the characteristics and use of residential air conditioning systems.

Add five more years of expanding use to that figure.

Now it's not the hole in the ozone layer over the arctic polar region that we need to worry about; it's the hole over North America! 

And check out the colours in the Legend on the EPA UV-Index contour map below - it looks like they had to add colours after the Index started to regularly pass the red (presumably the highest UV climatologists thought they'd need 10 years ago was "9", which they descided to colour red - as in fire, hot, death. Red is always the top end of any scale of heat or intensity.

But look at the scale, "0", on the far left, is dark blue - no UV to speak of - "9" is red - we all know the warnings we get through the media on days like today, 9 is always accompamied with the phrase, "very high" --- and at the extreme far end of the scale is light blue "15". Signifying... the end of times? When we all turn blue? ..I guess... .

We've 'burnt' through this scale with our recent and increasing, predilection for energy sucking 68 degree rooms when it's 100 degrees outside.

We need a new scale.

No, we need a new life - this one isn't working.


Map Images: 
United States Government, Environmental Protection Agency (EPA), UV Index | SunWise | US EPA -

Government of Canada, Office of Energy Efficiency (OEE) "2007 Survey of Household Energy Use - Summary Report - OEE":

Wikipedia, "Ozone depletion":

Environment Canada, Toronto Island Weather Office:
(open link in new tab for full screen size)
Environment Canada, Toronto Island, loaded at 6:00 am edt 16 July 2012

US Dept of Commerce, National Oceanic and Atmospheric Administration (NOAA), National Weather Service, Archive of UV Index bulletins - June 28, 1994 - present -

Forecast data for July 16, 2012 (File: "uv.2012071512.uvbull 15-Jul-2012 19:25 3.4K" - released on July 15, 2012) - forecast values shown below are the subject matter of this article - 

MON JUL 16 2012
CITY               STATE  UVI       CITY               STATE  UVI
ALBUQUERQUE          NM    12       LITTLE ROCK          AR    11
ANCHORAGE            AK     4       LOS ANGELES          CA    11
ATLANTIC CITY        NJ     9       LOUISVILLE           KY    10
ATLANTA              GA    11       MEMPHIS              TN    11
BALTIMORE            MD     9       MIAMI                FL    10
BILLINGS             MT    10       MILWAUKEE            WI     9
BISMARCK             ND    10       MINNEAPOLIS          MN    10
BOISE                ID     8       MOBILE               AL    11
BOSTON               MA     9       NEW ORLEANS          LA    12
BUFFALO              NY     9       NEW YORK             NY     9
BURLINGTON           VT     9       NORFOLK              VA    10
CHARLESTON           WV     9       OKLAHOMA CITY        OK    11
CHARLESTON           SC    11       OMAHA                NE    10
CHEYENNE             WY    11       PHILADELPHIA         PA     9
CHICAGO              IL    10       PHOENIX              AZ    11
CLEVELAND            OH     9       PITTSBURGH           PA     9
CONCORD              NH     9       PORTLAND             ME     9
DALLAS               TX    11       PORTLAND             OR     7
DENVER               CO    11       PROVIDENCE           RI     9
DES MOINES           IA    10       RALEIGH              NC    10
DETROIT              MI     9       SALT LAKE CITY       UT    11
DOVER                DE     9       SAN FRANCISCO        CA    10
HARTFORD             CT     9       SAN JUAN             PU    12
HONOLULU             HI    12       SEATTLE              WA     8
HOUSTON              TX    12       SIOUX FALLS          SD    10
INDIANAPOLIS         IN    10       ST. LOUIS            MO    10
JACKSON              MS    11       TAMPA                FL    11
JACKSONVILLE         FL    11       WASHINGTON           DC     9
LAS VEGAS            NV    11       WICHITA              KS    10