Friday, April 19, 2024

Goodies to Go! Newsletter #390

************************************************************

                     
Goodies to Go ™

              
May 23, 2006 — Newsletter # 390


     This newsletter is part of
the internet.com network.

                 
http://www.internet.com


          Please visit http://www.htmlgoodies.com

************************************************************


A Note about Email Filtering:
All Goodies To Go
newsletters are sent from the domain “internet.com.”  Please use this
domain name (not the entire “from” address, which varies) when configuring
e-mail or spam filter rules, if you use them.



Featured this week: a


*   Goodies Thoughts – Eyes Train To See
*   Q &
A Goodies
*   Discussion Goodies
*   News Goodies

*   Feedback Goodies
*   Windows Tech Goodie of the
Week 
*   And Remember This…


Eyes Train To See


Maybe it’s just me, but there’s something I’ve noticed that makes me
wonder.  Certain diseases seem to become “trendy” for a while, and
everybody is diagnosed as having them, then the next thing you know, they’re no
longer so fashionable and the incidence rate seems to drop dramatically. 
I’ll give an example, but first let me say that I’m only giving a lay person’s
crude observations; there’s nothing medical or scientific about them!


A little while ago everybody was talking about TMJ.  It stands for
temporomandibular joint, which is where the jaw joins the skull, but was used to
refer to all sorts of problems associated with that joint.  It seemed like
everywhere I turned people were being diagnosed and treated for TMJ, then it
just seemed to fade away.  A friend of mine recently mentioned that he was
being treated for TMJ and the thought popped into my head “I remember that, I
wonder whatever happened to it!”  It has become what I call a definite
“Hmmmm!”


Then there’s Carpal Tunnel Syndrome.  This is associated with the pain
people experience when they use a computer keyboard too much.  Or perhaps
it’s when they use it incorrectly; I’m not really sure.  It was all the
rage for a while, though, and stores were selling wrist rests and ergonomic
keyboards and other paraphernalia like it was going out of fashion.  Which,
strangely enough, it seems it was!  The people I know who have bought these
items swear by them, though, so there’s no arguing with the result.  I’ve
been using computers for more decades than I care to admit and in that time I
have found that the pain in my wrists builds mostly when I’m having the hardest
time with what I’m working on, not when I’m typing the most.  I call it
tension and for me the cure is to get up, walk away and do something else for
ten minutes or so.  I usually can think better when I return, also.


I certainly don’t mean to belittle these diseases, though.  I know
that they are truly a problem for those who suffer from them; I just wonder if
there aren’t cases where stress and tension are diagnosed as something
else.


Years ago, monitors sat on top of desktop computers on your desk, putting
the bottom edge of the screen some nine or ten inches above the desktop. 
Then along came monitors with “tilt and swivel” stands that were designed to
stand directly on the desktop and put the bottom edge of the screen about six
inches above the desktop.  I remember when I first used one.  At the
end of the day I was noticeably less tired and felt less strain in my
neck.  It seems that the slight change in the angle of my head made a big
difference to me.  I have since observed this many times, especially when I
help out somebody who has their computer arranged in one of those furniture
pieces specifically designed for a computer, and sporting a shelf for the
monitor to stand on.  I only have to sit there for a fairly short while
before I can feel the tension in my neck.  One of my neighbors recently
replaced their computer hutch with a flat table as I had suggested.  They
tell me that they are using the internet more now because it seems less
stressful.


As the day gives way to the night and I am still working away at my
machine, I will notice my eyes getting tired and the pain building in the back
of my neck.  If I keep going without making adjustments the pain gets to
the point where I am forced to stop and am now miserable.  I am sure that
there are a lot of contributing factors, such as ordinary tiredness or my ever
increasing age (funny how that happens, isn’t it?!) etc., etc..  My
observation here, however, has been that there seems to be a relationship
between the tension I feel building and the relative brightness of my monitor to
that of the room it’s in.  For example, I might start working at the same
time each day, but will feel the strain earlier in the winter than I do in the
summer.  The cure is as simple as turning the lights on.


In my workroom, I recently replaced the ceiling fan and the new one came
with a light fixture for four bulbs where the old one only had one.  The
pull chain that turns on the lights turns on first one pair, then the other
pair, then all four.  I have two forty watt bulbs for the first pair and
two sixties for the second.  This gives me eighty, one hundred and twenty
or two hundred watts worth of light.  My old one was just sixty.  I
have found this to make a huge difference.  As the horizon rises to conceal
the sun and steal the ambient light from my room I only have to remember to turn
on the light and I can continue much longer than before without any pain
building up.  It seems that my eyes feel the strain more when my screen is
so much brighter than the room.  Getting rid of eye strain is as much a
matter of training myself as training my eyes!


Like I said before, these are only a lay persons unscientific observations,
but if you sometimes suffer from these annoying symptoms while using your
computer, you might try these little fixes to see if they help at all.  Of
course, if they don’t help, get medical help — we want you to enjoy your
computer in comfort so that you will continue to build on the internet we have
come to depend on so much!


As to the eye strain I feel, I feel it is less than I strain my punny
language!


Thanks for reading!


– Vince Barnes


************************************************************


Q & A Goodies
***********************************
Questions are
taken from submissions to our Community
Mentors. You can ask a Mentor a
question by going to
http://www.htmlgoodies.com/mentors/



XXXXXXXXXXXXXXXXXXXXXXXXXX

X                       
X
X   Please take note:    X

X                       
X
XXXXXXXXXXXXXXXXXXXXXXXXXX


We have had a number of people indicate that their email client programs
are interpreting code examples in this newsletter as actual HTML code instead of
text.  To overcome this problem and to enable everyone to read the
newsletter, there is a period after the “<” in each tag.  If you cut and
paste to try out code examples, please remember to remove the periods. 
Wherever we intend you to use “<.” in your code, the example will show
“<..”.  In this way, you will be safely able to use a global edit to
change “<.” to “<“.  Thanks to all of you for your patience with
this; if this technique creates an undue problem for you however, please let us
know via our feedback address (see Feedback, below).



*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers
    
Q. I want to have a small window open
when someone clicks a link on my page.  I don’t want a full size window,
just a small one.  Can JavaScript do this?


A. Since you will probably have more than one link on a page you should set
up a function in your head section of your document that will be used by
multiple links.  You can pass the html page you want to load in the window
to the function when the link is clicked on.  With window.open() you can
set the
width, height, postion and other attributes.  Here is an
example:
<.script language=”javascript”> function
OpenWin(linkid)
    {  NewWin=window.open
(linkid,”newwin”,config=”width=200,height=250,location=no,status=no,directories=
no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=30,left=30″);
   
NewWin.focus()
    }
<./script>
The variable
“linkid” contains the page you want to load.  This was passed to the
function when the link was clicked on.  Then in the body section of your
document your link could look like this:
<.A
HREF=”javascript:OpenWin(‘somepage.html’)”>Apples<./A>
You would
wrap the link around the word that you want to click on for more info.  The
HTML Goodies site does have a tutorial on window.open()
(see http://www.htmlgoodies.com/primers/jsp/article.php/3478231
and http://www.htmlgoodies.com/primers/jsp/article.php/3478241 
— Ed.)


*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers
    
Q. I  have been working on
trying to come up with a better menu for my index page. I used Sothink DHTMLMenu
to generate one. I have it working, but it takes quite a while for the menu to
load. What is my problem?


A. I can’t see your menu, but I can make a couple guesses. You have a bunch
of images that need to load to make the menu work. The browser looks for them
when you do your mouseover, which means calling the server and asking for the
image, and repeating the process for each image. My first guess is you could fix
your problem with a preloader, so the images are already in the browser cache.
Here’s an example of a preloader:
// preload
images
        var an_image1 = new
Image(151,37);
        an_image1.src =
“images/navigation/options_home_over.jpg”;
       
var an_image2 = new Image(151,37);
       
an_image2.src=”images/navigation/easement_over.jpg”;
       
var an_image3 = new Image(151,37);
       
an_image3.src=”images/navigation/mutual_over.jpg”;
This is a JavaScript that
declares a variable as an image and specifies the size so the browser doesn’t
have to figure it out, and then give the variable a value consisting of a
URL.
My second guess is that your images are large and taking a long time to
download. Keep them small, like 3k each, or even eliminate them if you
can.
Get rid of the “best viewed at” message. No visitor will change their
screen setting just for your site, nor take the blame for he site not working at
their screen setting. You just have to make it work at different sizes.


*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers


Q. I am using the script under the So You Want to Resize Your Window, Huh?
tutorial and was wondering if I could have it so that when a website visitor
clicks on my main image, the re-sized window would pop up rather than them
having to only click a text link.


A. This is an example of how you can click on an image and have a window
popup that is sized to the width and height of the larger
image:
<.html>
<.head>
<.title>Image Pop Up
Viewer<./title>
  <.SCRIPT
LANGUAGE=”JavaScript”>
       
image0=new Image()  // preload images large
images
       
image0.src=”large0.gif”
        image1=new
Image()
       
image1.src=”large1.gif”
        image2=new
Image()
       
image2.src=”large2.gif”
        image3=new
Image()  // preload thumb nail images of large
images
       
image3.src=”thumb0.gif”
        image4=new
Image()
       
image4.src=”thumb1.gif”
        image5=new
Image()
       
image5.src=”thumb2.gif”
        var
ImgWin=” “
        function imgwin(Imgn)
// get width of large image that was pre loaded
above
           
{
            
w=eval(Imgn+”.width”)
            
if(w<.100)
              
{w=100}
            
h=eval(Imgn+”.height”) // get height of large image that was pre loaded
above
            
if(h<.100)  // cannot open window less than 100  by 100
pixels
              
{h=100}
            
h=h+25
            
picgif=eval(Imgn+”.src”)  // build image
source
            
if(ImgWin.open)  //  if the window is open close
it
              
{ImgWin.close()}
           
/*Create window and display large image of
thumbnail.
              
If you want to change the position of the window when it pops up change the
values for the top and
left
              
properties below in the variable WinProps.  The values in top and left are
number of pixels from the
top
              
and left of the edge of the
screen.
           
*/
            
WinProps=”width=”+w+”,height=”+h+”,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resize=no,top=0,left=0″
            
ImgWin=window.open(“”,”winimg”,config=WinProps);
            
ImgWin.document.write(“<.HTML>”)
            
ImgWin.document.write(“<.HEAD><.TITLE>Display
Image<./TITLE><./HEAD>”)
            
ImgWin.document.write(“<.BODY marginheight=’0′
marginwidth=’0′
leftmargin=’0′ topmargin=’0′
bgcolor=’lightyellow’>”)
            
ImgWin.document.write(“<.CENTER><.IMG SRC=”+picgif+”
BORDER=’0′
HSPACE=0
VSPACE=0><.BR>”)
            
ImgWin.document.write(“<.FONT SIZE=-1><.A
HREF=’#’
onClick=’self.close()’>Close
Me<./A><./FONT><./CENTER>”)
            
ImgWin.document.write(“<./BODY>”)
            
ImgWin.document.write(“<./HTML>”)
            
ImgWin.document.close()
            
ImgWin.focus()
           
}
 
<./SCRIPT>
<./head>
<.body>
<.CENTER>
   
<.SCRIPT>
    /*
     If you add
more thumbnail images make sure that you include the thumbnail and larger image
in the
     preload sections above.  In the onClick
event for the added images make sure you change the
value
     being passed to match the image name of the
large image that matches the thumbnail image. 
Both
     of these must be setup in the image preload
sections above.
    */
   
<./SCRIPT>
  
<.BR><.BR><.BR>
   <.A HREF=”#”
onClick=”imgwin(‘image0’);return false;”><.IMG SRC=”thumb0.gif”
NAME=”img0″ BORDER=”0″><./A>
  
<.BR>
   <.A HREF=”#” onClick=”imgwin(‘image1’);return
false”><.IMG SRC=”thumb1.gif” NAME=”img1″
BORDER=”0″><./A>
   <.BR>
   <.A
HREF=”#” onClick=”imgwin(‘image2’);return false”><.IMG SRC=”thumb2.gif”
NAME=”img2″ BORDER=”0″><./A>  <./CENTER> <./body>
<./html>



*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers


Q. I have noticed that some of my internal pages will come up on a search
engine. Is there anyway that I can have these visitors redirected to the main
home page instead of having them link to a page that is basically out of the
flowing order of the site?


A. You might try using document.referrer to check where they came from and
if it is not the page you want then redirect them to it.  Something like
this:
<.script language=”JavaScript”>
if(document.referrer!=”http://www.yourpage.com/index.html“)
 
{location.href=”http://www.yourpage.com/index.html“}
<./script>
You
would place the above in the head section at the very beginning.  The
drawback to this script is that if they go to this document from anywhere in
your site other than the document specified it will redirect them to that one
document (page).
[You can also prevent specific pages from being indexed in
(most) search engines; see:
http://www.htmlgoodies.com/introduction/newsletter_archive/goodiestogo/article.php/3476501
about
halfway down the title piece there is a discussion of the ROBOT Meta tag and
Robots.txt — Ed.]


*** This question was submitted to our Mentor
Community.
    The answer was provided by one of our Mentor
Volunteers


Q. Is there any way that a web page can be updated by using a simple form
button?  For example: a school wants to post that their school is closed by
going to a page and clicking the “school is closed” button, which updates the
home page.


A. You could have the part of the page where the closing notice would
appear be pulling code from a server side include, and let someone have access
to just that file where they can change the text. If you use the form, the form
could write to a database and the display page pulls data from the database.
Perhaps a server side script could write a file, which could then be picked up
as a server side include. If you decide to go with a form, you’ll have to use
some server side script and perhaps how to hook up to a database. You would need
to find out from your host what languages they support. Having users directly
update the include file is the simplest to set up. This tutorial explains it:

http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341




Discussion Goodies
***********************************


Have you seen the discussion forums on the HTML Goodies website?  It’s
a great place to get help from others who, just like you, are developing web
pages.  Many different topics appear in the forum, and a new one will
appear if you create it!  Here’s a sample of recent topics:


Adding a password feature to exsiting script:
http://www.webdeveloper.com/forum/showthread.php?threadid=107441






compatybility code for Opera, IE, Mozilla, Firefox:
http://www.webdeveloper.com/forum/showthread.php?threadid=107444


cant display image in Mozilla – please help !:
http://www.webdeveloper.com/forum/showthread.php?threadid=107238




News Goodies
***********************************


Business Integration Via Open Source
[May 23, 2006] Jitterbit stirs up
the business integration pot with its open source contribution.  

Read the article:
http://www.internetnews.com/dev-news/article.php/3608076



Motorola Q Could Spell Trouble For Treo
[May 23, 2006] The Moto Q is
not a BlackBerry killer — yet. However, analysts say, the Treo may be in
trouble.
Read the article:
http://www.internetnews.com/wireless/article.php/3608356



VA Data Breach Stirs Washington
[May 23, 2006] The bad guys have
personal data on 26.5 million veterans. But they may not know it yet.
Read
the article:
http://www.internetnews.com/bus-news/article.php/3608411



Microsoft’s Triple Play Beta Release
[May 23, 2006] UPDATED: Vista
gets up close and personal looks. Will it fit the world of the changing PC?

Read the article:
http://www.internetnews.com/ent-news/article.php/3608386



WinFX Adds New Security Method
[May 23, 2006] No more entering a
username and password? Sign me up!
Read the article:
http://www.internetnews.com/dev-news/article.php/3608441



Sun Looks to Cut Staff After All
[May 23, 2006] Company plans to
close one campus as part of restructuring
Read the article:
http://www.internetnews.com/bus-news/article.php/3608426



Cisco Notices NeoPath
[May 23, 2006] Cisco funds the file
virtualization startup, which also nabs a NetApp executive as its new
COO.
Read the article:
http://www.internetnews.com/storage/article.php/3608376



Enterprise Search is About The ‘Folks’
[May 23, 2006] Enterprise
Search Forum speakers agree that effective search engines depend more on people
than technology.
Read the article:
http://www.internetnews.com/ent-news/article.php/3608291



Video Ads Mark Shift in Google
[May 23, 2006] The search giant
finally embraces portal metrics.
Read the article:
http://www.internetnews.com/ec-news/article.php/3608316



It Must Be WinHec Time
[May 23, 2006] AMD unveils new desktop
processors, while Microsoft chairman Bill Gates talks up Vista at WinHec
conference.
Read the article:
http://www.internetnews.com/ent-news/article.php/3608141



 
 
 
Feedback Goodies

***********************************


Did you ever wish your newsletter was an easy two way communications
medium?  Ploof! It now is!
If you would like to comment on the
newsletter or expand/improve on something you have seen in here, you can now
send your input to:




We already receive a lot of email every day.  This address helps us
sort out those relating specifically to this newsletter from all the rest. 
When you send email to this address it may wind up being included in this
section of the newsletter, to be shared with your fellow readers.  Please
don’t send your questions to this address.  They should be sent to our
mentors: see http://www.htmlgoodies.com/mentors/


Thanks for all your feedback!





Windows Tech Goodie of the Week 

***********************************


Visual Studio 2005 Hands-On Tutorial – Part 4


This is the fourth part in a series of hands-on tutorials that will take
you through all the steps to build a complete application using Visual Studio
2005 and SQL Server 2005. The tutorial is finished by creating a Web Service to
host the data and then consume the Web Service from Windows, the Web, and the
business layer.





*** AND ***



User Tips: Receiving an Email When Database Data is Changed


This tip, from Wade, demonstrates how to use a trigger and xp_sendmail to
alert a DBA or developer when any data is updated in a certain database
table.





*** AND ***



Stacked Bar Chart Sample Code


It seems that some of our visitors were experiencing technical difficulties
with the positioning used in our stacked bar chart sample. This update
simplifies the generated HTML and should cause fewer display problems.






And Remember This …
***********************************


On this day in…


1430 Joan of Arc was captured by Burgundians at Compiegne, who sold her to
the British; 1701 Captain Kidd was hanged in London for piracy and murder; 1785
Benjamin Frankilin announced his invention of bi-focal eyeglass lenses; 1867 the
Jesse James gang robbed a bank in Richmond, MO, killing two and stealing
$4,000.00; 1887 the first transcontinental train arrived in Vancouver, British
Columbia; 1922 Walt Disney incorporated his first film company, Laugh-O-Gram
Films; 1945 Winston Churchill resigned as British Prime Minister; 1966 The
Beatles released “Paperback Writer”; 1969 The Who released the rock opera,
“Tommy”; 1981 NASA launched Intelsat V; 1990 the cost of rescuing failed Savings
& Loan associations was put at $130 Billion;


Born today were: in 1707 Swedish botanist and the “Father of Taxonomy” (the
naming of plants and animals) Carolus Linnaeus; 1734 Austrian physician and
hypnotits Friedrich Anton Mesmer; 1883 actor Douglas Fairbanks; 1890 English
actor Herbert Marshall; 1912 actor John Payne; 1912 English actor Marius Goring;
1920 actor Sid Melton; 1928 English actor Nigel Davenport; 1931 actress Barbara
Barrie; 1933 English actress Joan Collins; 1934 synthesizer inventor Robert
Moog; 1936 actor Charles Kimbrough; 1951 Russian chess champion Anatoli Karpov;
1961 comedian/actor Drew Carey; 1966 English actress Helena Bonham Carter; 1984
actor Adam Wylie;







*************************************************************

EarthWeb’s family of online services for IT insiders

*************************************************************
IT
MANAGEMENT http://www.earthweb.com/dlink.index-jhtml.72.949.-.0.jhtml

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured