Goodies to Go (tm)
November 11, 2002-- Newsletter #206
Goodies to Go (tm)
November 11, 2002--Newsletter #206
This newsletter is part of the internet.com network.
* Goodies Thoughts
- A Smooth Operator
* Q & A Goodies
* News Goodies
* Feedback Goodies
* And Remember This...
Just in case you missed it before, the new Beyond HTML Goodies book is now available!
|Goodies Thoughts -||A Smooth Operator|
Since operators are so fundamental to the work of programming languages, it is important to understand the types of operator that there are, and their place in a language. Understanding fundamental aspects of language structure makes it simpler to get to know a language you are seeing for the first time. That being so, a little clarification couldn't hurt. I don't intend to provide a comprehensive list of either the types of operator or of the operators themselves, but rather to provide a basic understanding of the concepts involved.
In a computer language it's the operators that tell the computer what to do. If you want to add one to one to get a result, you would tell the computer "result equals one plus one". In this example there are two type of operator at work. "Plus" is an arithmetic operator that says to add the two numbers either side of itself together. "Equals" is an operator that says to assign the value of the answer to "result".
Not all types of operator are present, or implemented, in every language. Perl, for example, has a few special groups of operators that are peculiar to Perl. Common to most programming languages, and certainly to those that I have mentioned here, are arithmetic, assignment, relational and logical.
"Add" adds one number to another, meaning that is operates on two numbers, or has two operands. Operators with two operands are called "binary" operators. Those with one operand are called unary, and those with three are called ternary. I don't know of any operators with more than three operands, but they might exist in some language.
While subtract is a binary operator, there is also a unary variation. In its unary form, minus is used to define a negative number, "-1" for example. Exponentiation refers to raising a number to a power. For example (in Perl) 2**4 is equivalent to 2*2*2*2 which yields 16 (2 to the fourth power). Modulus (a.k.a. Modulo) returns the remainder after dividing the first operand by the second operand. For example -- result = 7 modulus 3 -- would give a value of 1 in result.
Assignment operands direct a value into a data item. If our examples above we have shown "equals" as an assignment operator. Most languages these days, including the three previously mentioned, assign from right to left. That is, in the arrangement "op1 = op2" the value already in op2 is assigned to op1, replacing its value. There are still some languages, however, that assign from left to right. Cobol is one such, as in "move op1 to op2" or "add 1 to 1 giving result". By the way, in case you think Cobol is dead, it's worth remembering that it is estimated that there are still more lines of Cobol code in use today than any other language. Of course, we don't really care very much because it's (probably) never used for web site development!
Hopefully, this explanation of this part of computer language structure will help you to operate on your own!
Thanks for Reading!
- Vince Barnes
Questions are taken from submissions to our Community Mentors. You can ask a Mentor a question by going to http://www.htmlgoodies.com/mentors/.
Q. But how do I make a link in one frame change both the main frame and the sidebar, each going to different pages?
A. There's a tutorial on just that subject:
A. This is what I have done in the past: document.write("Copyright ) 2001 - 2002")
Q. I have downloaded a script that is basically a choice box with a description of the option selected below the choice box. My problem is that I want it to target a frame called "frame1" and Icant seem to find a way to fit that into the code. Any ideas??
A. Try changing your onClick event to this: onClick="parent.frame1.location=document.a294.a969.options
Q. I have a website that can be viewed nicely in my resolution 1152 x 764 and I want to be able to do some HTML code that allows me to keep the page the same size on computers with all different resolutions so people out there can view my page the way I have built it.
A. You will have to build your content into a table and set the table for 790 x auto or such to accommodate the 800 x 600 window that is most common.
[You can't change the resolution of your visitor's screen -- Ed]
Q. I am trying to change the way my text is displayed on my documents. I understand the left, center and right alignments. What I am looking for is a command that allows me to space my text from the left border to the right border. In other words I want the left edge of my text to align left and the right edge of my text to align right. I have searched but come up empty handed so far.
A. Try adding align="justify" to the P tag.
Smaller, Cheaper Pocket PCs on the Horizon
[November 11, 2002] Microsoft and Samsung today announced a concept design for 'light and thin' Pocket PCs that they say will greatly reduce costs and development time for manufacturers of the devices.'
AOL Goes After Small Business
[November 11, 2002] SOHOs (small office/home offices) remain the fastest-growing segment in the business world. AOL positions to offer them a ready-made network of marketing and branding services
Hollywood: Hooray for Broadband!
[November 11, 2002] Major film studios launch the beta of a download site where you can rent movies; the questions are how fast it will catch on and whether it can survive the attack of the Napster clones.
Gates To Lay Out Future of C++, C#
[November 8, 2002] At the OOPSLA 2002 conference in Seattle Friday, Microsoft Chairman Bill Gates will lay out the road map for the Visual C++ .NET and Visual C# .NET programming languages.
As the Bridex Worm Turns
[November 5, 2002] The Bridex e-mail worm targets a known vulnerability in Microsoft Windows: it's capable of spreading a variant of the active Funlove virus.
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 will help 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.
Many thanks to all who noticed that a US social Security number does indeed follow the format 999-99-9999 (three digits, hyphen, two digits, hyphen four digits) and not 99-999-9999 (two digits, hyphen, three digits, hyphen, four digits) as we said in the text. To the gentleman who modified the script to make it work, you might want to change it back since it was correct as written - only the text was wrong!
And Remember This . . .
On this day in...
1918 World War Ends!
At the 11th hour on the 11th day of the 11th month of 1918, the Great War ended. The armistice was signed at 5:00 am on a train at Compihgne, France. Nine million soldiers were killed in that war. Another twenty-one million were injured. Germany, Russia, Austria-Hungary, France, and Great Britain each lost close to a million or more. World War I was known as the "war to end all wars" because of the great slaughter and destruction it caused. Unfortunately, the peace treaty that officially ended the conflict -- the Treaty of Versailles of 1919 -- forced punitive terms on Germany that destabilized Europe and laid the groundwork for World War II.
1997 Intel confirms bug
On this day in 1997, Intel confirmed that its Pentium chips contained a bug that hackers could exploit to crash computers, and the company released a fix by the end of the week. The first breed of Pentium chips, released in 1994, had been plagued by a bug that produced mathematical errors. After a public uproar, Intel agreed to replace those faulty chips with no questions asked
Thanks for reading Goodies to Go!