Hi Weber Readers,
We made a decision to accept credit cards - the major ones and
incurred various expenses.
We had a choice of buying or leasing an electronic terminal. But since we
mostly attend craft fairs held in parks, open fields or in the middle of a
street, we had no convenient access to electrical power or telephones.
Therefore, we chose to buy a manual imprinter ("knuckle buster") and
a software program to process sales on our home computer. Costs included:
software, a manual imprinter and it's attachable plate.
We have since seen other crafters with 12-volt car batteries coupled to a
converter running their electronic terminal and a radio transmitter; others
have used a combination of a cellular phone and another type of electronic
terminal to facilitate the on-the-scene swiping of the customer's card. Some
of these terminals cost anywhere from $950 on up depending on how you want the
terminal to function. However if any craft fair is located in a dead zone as
far as cellular phone reception is concerned that would be a problem.
Our agreement with the credit card processor also involved fees - which
were directly proportional to the volume of sales, for example, if an average
sale was $50, the discount fee that the processor charged would be between 1.7
to 3 percent. Since we could not swipe a card electronically at the time of
sale, we could only enter in the sales data with the software when we returned
home. This process is designated as a "manual key-in" and an
additional non-qualifying fee of about 3 percent is charged!
The expense of the manual imprinter and the software, was part of the cost
of our doing business. That's something you either pass onto your customers or
you absorb it. However, if you are in a profit-oriented business, then you
have to factor these types of expenses into your prices. After all, the
acceptance of a credit card as payment is for the convenience of the purchaser
vs. their tendering a check or cash.
In the credit card company merchant agreement there was a zero limit
provision - in other words, we took the hit if a credit card was tendered in a
fraudulent way. We had no recourse if the person had a stolen card or the
account was over the its limit. We could only find this information out at the
time when the transaction was entered into our computer. This would be later
in the evening or when we returned home after a 2-day show. If we received a
"declined" message i.e., the customer's account would then not
accept the charges for whatever reason. Fortunately our experience has been
only one deadbeat for less than $75.
The particular credit card processing company that we started with changed
its terms from time to time, with the option of our opting out if we didn't
accept the new rules.
One of their new conditions was the imposition of a minimum-processing fee
of $19.95 per month. So, if there were no sales early in the year because of
the lack of a suitable show, they would charge $19.95 whether or not you did
any business. This of course is a great way for them to weed out the small
accounts!
Well, we elected to dump this company and look around for someone else.
Other factors in helping us to make this choice was the lack of support from
the initial company - no sales reps. contacted us - late, after-the-fact, or
no material being sent by mail, conflicting information when we did telephone.
We received information from three new sources. While an electronic
terminal was a principal part for two of them, with either leasing or outright
purchase arrangements, the cost again was at least $950, plus the same range
of discount fees, PLUS a per transaction fee ranging from $.25 to $.30 PLUS a
$10. per month statement fee. It doesn't take a CPA to evaluate the cost of
using this approach!
The third source turned out to be a winner for us: we can continue to use
the manual imprinter; we paid $3 for a new imprinter plate (to reflect our new
merchant number). We can still use the software we have, but with a $99 fee
for technical support to "re-program" the merchant data and a 2.79
percent discount fee for processing each sale. NO STATEMENT COSTS, NO MINIMUM
MONTHLY PROCESSING FEES, NO PER TRANSACTION FEES.
In evaluating our sales and credit card usage by customers, I would say
25-30 percent of our sales was through credit cards. As our Internet business
also continues to grow, it becomes an essential method of payment to ensure
prompt completion of the sale both ways. There is no delay in our getting paid
thus enabling us to ship within 48 hours to customers versus a 7-10 day wait
for a check to clear before we ship.
In summary, if you decide at some point in time to accept credit cards,
look at and compare all the potential expenses and charges before you make
your decision.
The names of companies have been withheld to protect the guilty! However,
you can email Cliff cqbrodie@californiajewels.com for additional info.
A fairly common question I receive relates to adding ads to your site
in order to generate revenue. How many visitors do you need, where do
you get the ads and how much does it pay?
The good news is that you can get ads for your site if you have as
few as 5000 visitors (or less) a month. The bad news is that it will
hardly pay anything.
I suspect that many new Internet entrepreneurs are hoping to make the
majority of their income from advertising. Although it is possible I
feel that for most on-line business it is an unrealistic expectation.
In order to generate a significant amount of income from advertising
you will need to attract 10 to 100 times the amount of traffic to
your site than a company that is selling a product or service. What
do you have to offer that will do that (besides sex)? If the content
you are offering is cheap or easily acquired (such as sex), then a
lot of other sites will also be offering it.
Our primary business and source of income is developing software.
Although we include ads in this newsletter and on our site, they
represent a small secondary source of revenue. For many businesses
however, even a supplementary income source can be quite valuable.
So what are realistic expectations when it comes to selling ads?
If your site generates a relatively small number of visitors (under
50,000 page views), you can still get ads from several sources. These
are mostly "click" based which means that a visitor must click on
the
ad in order to generate a payback to you. The amount varies but
generally seems to be in the 10 cent to 20 cent range. The actual
revenue generated will depend on how good the ad is and how well it
fits with the demographics for your site. From what I have
experienced and heard, you can expect to make between $0.50 and $1.00
CPM. If you do the math it does not add up to much. 100,000 page
views a month would generate approximately $75 income. In order to
pay 1 person a decent salary at that rate you would need to generate
approximately 10 million page views a month. Yeah right!
As your page views increase, you will become more attractive to some
of the larger advertising distributors. The big daddy of advertising
sales (the last time I heard) is Double Click. You will need to have
over 500,000 page views a month to get their interest. They recently
got caught harvesting and selling information gathered by cookies in
their banners. Needless to say that does not encourage people to
click on a banner. I do not have any specific information on the
amount that you can hope to receive from Double Click (or their main
competitors) but I expect that it is not significantly higher than it
is for the smaller sites. Even if it were double or triple the CPM it
would still only equal $1.50 to $3.00 per 1000 impressions.
What about selling impressions directly to advertisers? The rate
cards I have seen typically list $25 to $50 per 1000 impressions.
That's not bad. At that rate 100,000 impressions a month would
generate between $2500 and $5000. At least it would if rate cards had
anything to do with reality. Finding information on exactly how much
a typical advertiser is paying compared to the rate card is somewhat
difficult to come buy. Neither the advertisers nor sellers seem to be
very willing to talk. I think it would be a safe bet however, that if
many distributors are paying the equivalent of $1.50 to $3.00 per
1000 impressions, it is very unlikely that anyone is getting $50 or
even $25.
The best information I have found suggests that $5 to $8 per 1000 is
more realistic. At that rate 100,000 page views a month would
generate approximately $500 to $800. This of course, does not include
the cost of selling your ads.
Even though banner ads may not generate a lot of revenue for most
sites, they have the advantage that they do not necessarily require a
lot of effort. Once they are set up they can usually be left alone
allowing you to concentrate on more profitable aspects of your online
business.
If you would like to get more information about online advertising,
there are several excellent newsgroups and mail lists. One mail list
I often look at is OnLine-Ads.
If you are interested in getting ads for your site, you can take a
look at:
Double Click http://doubleclick.com/
Flycast http://www.flycast.com/
Advertising.com http://advertising.com/
Burstmedia http://burstmedia.com/
bCentral http://bcentral.com/
----------------------------------------------------------------------
"IMS Web Tips" is a weekly news letter for all web site managers
regardless of experience who are looking for detailed information on
creating, maintaining and promoting their web sites.
http://www.imswebtips.com
======================================================================
Apache, the most popular web server on earth, is distributed with
a large number of modules, some of which are included by default when
you compile the package, and some which aren't. One of those that you
can optionally compile is mod_vhost_alias, which I find particularly
useful. It's been available since Apache version 1.3.7.
Mod_vhost_alias adds dynamic virtual hosting. That is, we don't need
a VirtualHost declaration for each site. Using mod_vhost_alias
directives, we can rewrite requests based on the IP address or the
host name of the requested resource and return documents from the
correct site. The advantages of this capability are that you can add
any number of web sites without resorting to modifying and reloading
the Apache configuration time and time again.
The extra directives available to us when mod_vhost_alias is present
are: VirtualDocumentRoot,VirtualDocumentRootIP,VirtualScriptAlias,
and VirtualScriptAliasIP.
Those ending with 'IP' use the IP address of the site requested,
whereas the others use the host name. Since IP addresses are hard to
come by these days, that is until IPV6 (the 128-bit net addressing
protocol) becomes the norm, we'll concentrate on using
VirtualDocumentRoot and VirtualScriptAlias to maximize the number of
sites we host under one IP. If you need to use the IP versions of
these instructions, it shouldn't be difficult for you to figure out
since they work exactly the same way, but parse the IP of the
requested host name instead.
Let's start with an example from an imaginary configuration file...
CustomLog /www/logs/208.231.13.91.log vcommon
UseCanonicalName Off
VirtualDocumentRoot /www/webdocs/%-2/
VirtualScriptAlias /www/scripts/%-2/
You'll first notice the "UseCanonicalName Off" core directive. This
is mandatory for our purposes as it tells Apache to use the host name
as requested by the client rather than a value set in a ServerName
directive or devising one if it's absent. You'll also notice that all
our sites' web documents must be in a sub-directory of /www/webdocs
and all their scripts in a sub-directory of /www/scripts. For each
site you added, you'd have to create these sub-directories and add
a DNS zone with the IP 208.231.13.91, but that's all.
More important are the strange %-2 in the paths. This is a vhost
instruction that allows us to extract a part of the host name and use
it in the rewriting of the document path. The parts of the host name
are determined by the '.' it contains. Thus, www.xyzcgrf.com has 3
parts. '%-2' means "extract the second to last part of the host
name".
Again using our example, suppose we have a request for
"http://www.xyzcgrf.com/hello.htm"...Since xyzcgrf.com resolves to
208.231.13.91, Apache would use our VirtualHost declaration and would
replace '%-2' with 'xyzcgrf', as the latter is the before last part
of the host name. The document to return would thus be found at
/www/webdocs/xyzcgrf/hello.htm.
Continuing with our example, a request for the script
"http://www.xyzcgrf.com/cgi-bin/test.cgi" would execute the script
found at /www/scripts/xyzcgrf/test.cgi. Note that even if the
requested url omitted the 'www', it would still be rewritten correctly
in my example.
While the above example would serve you well for the dot-com and
dot-net domains, it would not fare well for country domains. Thus, a
request for http://xfxfvc.co.uk and http://ghtrrd.co.uk would both
translate to a path of /www/webdocs/co/, which is obviously not what
we intended. There's actually a whole slew of interpolation meta
characters that we can use, so we're not stuck. Here are some of
them, using http://www.bogus.xyzcgrf.com as an example.
%0 : use the whole name [www.bogus.xyzcgrf.com]
%1 : use the first part [www]
%2 : use the second part [bogus]
%3 : use the third part [xyzcgrf]
%-1 : use the last part [com]
%-3 : use the third to last part [bogus]
%2+ : use the second and all subsequent parts [bogus.xyzcgrf.com]
%3+ : use the third and all subsequent parts [xyzcgrf.com]
...etc...
You can also go nuts by extracting a part from a host name, then
extracting a part from that part. In the latter case, the part would
be a letter. We do this by using the format '%N.M', where %N is our
first extract and 'M' is the second. The '.' is mandatory, but you
omit the '%' in the second. For example...
VirtualDocumentRoot /www/webdocs/%-2.2/
...if we put the url http://www.bogus.xyzcgrf.com through this
directive, we get /www/webdocs/y/. That's because %-2 extracted
xyzcgrf, and the '2' gave us the second letter 'y'. Frankly, I never
needed this capability, but maybe you'll find some use for it. If what
truly interests you is extreme url rewriting, there's another module
which can allow you to slice and dice urls any which way, called
"rewrite_module". We'll explore its possibilities in the near
future.
In order to smoothly rewrite paths for our xfxfvc.co.uk type host
names that our first example fumbled with, we need to assign them a
different ip in a separate VirtualHost declaration. Our vhost
directives in that one would look like this...
VirtualDocumentRoot /www/webdocs/%-3/
VirtualScriptAlias /www/scripts/%-3/
Thus, we'd extract the xfxfvc rather than the 'co'. I believe in
keeping things simple, so I avoid using anything but the %-
interpolations, as the rightmost part of any host name is reliable
whereas the leftmost isn't.
One drawback to using vhost_mod is that you can't have individual log
files for each site sharing the IP. Instead, all will log to the same
files. The way we compensate for that is by creating a special
logging definition that will include a field that registers the
domain of the request.
Thus, for example, the instruction...
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
Appears somewhere in our configuration file. The "%V" tells
apache to
log the host name requested by the client [See: mod_log_config].
With the LogFormat we've just defined, your log might look something
like this...
www.rtzxfgh.com 172.128.55.43 - - [03/May/2001:10:21:48 -0400]
"GET /bogus.htm HTTP/1.1" 200 0
www.ouwqagxh.com 172.128.55.44 - - [03/May/2001:10:21:49 -0400]
"GET / HTTP/1.1" 200 0
In order to generate individual traffic reports for each site sharing
the log file is a statistical tool that can parse such a log. I leave
that one for you to figure out, but we'll get back to it when we
compare various log analyzers in a future issue.
Some useful links you can follow to get further knowledge on the
subjects discussed today:
mod_vhost_alias:
http://httpd.apache.org/docs/mod/mod_vhost_alias.html
UseCanonicalName:
http://httpd.apache.org/docs/mod/core.html#usecanonicalname
mod_log_config:
http://httpd.apache.org/docs/mod/mod_log_config.html
- Tom Germain
----------------------------------------------------------------------
AUTHOR:
Tom Germain has been our ace programmer here at iEntry.com. He has
expertise in several different languages and operating systems.
Basically, he's just a geek stud. -Pete
======================================================================
Find out if bluntness is a problem for you. To do that simply ask
five of the people closest to you at home and at work something
like: "Do I come across as too blunt sometimes?" "Do I say
things
that hurt other people's feelings without realizing it?" If you get
back some "yes" answers, then you need to pay attention to the ways
you communicate. Any one of several things can make your
communication hurtful when you don't intend it. One is obviously
your choice of words. Another is the tone of your voice. The words
can be fine, but the tone conveys hostility. How would you feel if
someone said to you: "That's a great piece of work." [said flatly
with a slight edge of sarcasm -- could be taken as positive or
negative].
Many people don't realize that their tone is gruff or negative
sounding. One way to tell is to tape record yourself having a phone
conversation. Tape your end of it and play it back. Make sure it's a
substantive conversation where you can really hear yourself speaking
at length, preferably to someone you're not trying to impress.
Listen to the tape carefully, pretend it's someone else. How does
this person sound to you? Friendly? Matter-of-fact? Or is there an
edge in the voice that's unfriendly?
Hearing what we sound like to other people can sometimes be a
revelation. If there's a hostile edge to your voice, then you'll
need to consciously modify your tone. That'll take time - weeks,
maybe even months. But nationally recognized speech consultant,
Carol Fleming, in her audio program, The Sound of Your Voice, says
it can be done, if you're willing to put in the conscious effort.
Modifying the sound of your voice may be the single most important
thing you can do to improve the first impression you make on people,
after your appearance. One woman I know was told by Dr. Fleming that
she pushed the pitch of her voice down [Say next part in lower
pitch] in order to sound more authoritative. The woman had to
consciously work at allowing her voice to find its natural pitch. It
took several months of effort, but it made her speaking voice sound
more alive and musical.
In general, overcoming bluntness in your communication style means
becoming more aware of other people's feelings. The more you can do
that, the more successful you'll be in developing satisfying
relationships. If you have a tendency toward being authoritarian,
you can work on recognizing when it's appropriate to back off. If
you listen more to other people's opinions, ideas and concerns,
you're less apt to express your own in a blunt way.
2- Confidence
Having confidence means you believe in yourself, you trust your own
judgment and resourcefulness. In his many books on self-esteem, Dr.
Nathaniel Branden defines self-esteem as the sum of self-confidence
and self-respect. For him, self-confidence is knowing that you have
the wherewithal to function reasonably well in the world.
You feel competent to make choices, competent to satisfy your needs,
to chart the course for your life. Having confidence in specific
situations, such as in gaining influence with someone, would flow
from a general self-confidence about your ability to meet life's
challenges.
A person who exhibits confidence appreciates a sincere compliment and
doesn't brush it off. A confident person is comfortable giving, and
receiving, compliments. He's also able to handle criticism if it
comes his way because he basically likes himself and knows that a
single negative incident won't change that.
Confidence in yourself gets built up over time. You can fake
confidence, and you may need to at first, but real self-confidence
comes from a history of small victories and accomplishments that add
up to a sense that you can handle yourself well in most every
situation. I suggest you take an inventory of the major
accomplishments you've achieved over the past few years. Then remind
yourself of the minor ones too. What about the computer course you
completed? Have you built anything that still standing? What about
those kids you're raising? That's (!) an accomplishment. Don't be
modest. Tell the truth about how hard you worked, what sacrifices
you've made. If you can't think of any, then begin by congratulating
yourself for living as long as you have. Sheer survival is an
accomplishment these days! Seriously, it pays to take the time to
know your strengths and appreciate them. What's unique about you?
What skills do you bring to an organization or project that you can
count on?
Confidence is a fundamental trait for flexibility. It's hard to be
flexible when you're fearful, or easily intimidated. Confidence is
indispensable if you want to engage someone's attention.
3- Discontent
The next characteristic that belies flexibility is discontent. I'm
talking about someone who's just never positive or completely happy
about anything - the nay-sayers, the fault-finders who've decided
that their mission in life is to tell you the glass is half-empty,
in case you missed it. In more vernacular terms, this person is
called a complainer, a whiner, a wet blanket.
One possible reason for this type of inflexible behavior is that the
person has set high standards for him or herself and no one,
including the person herself, measures up. They pride themselves on
being able to analyze things critically, to bring a discerning eye
to the table. But someone whose primary response is fault-finding,
who seems discontented with almost everything, will get little
cooperation and respect from others.
If you think that there's a fault-finder lurking within your
personality, ask some people close to you who'll give you honest
feedback. If your suspicions are confirmed - Yes, you can be a wet
blanket at times - Yes, people are afraid to share their tentative
ideas with you for fear of getting them picked apart - then let me
give you a couple of tips.
First, develop the habit of saying something positive BEFORE you say
anything negative. You'll have to make a conscious effort at first
if your tendency is to just point out flaws. But if you really do
think to yourself "say something positive" before you open your
mouth, eventually it'll become a habit. Sometimes you may have to
really stretch to find something good to say. But again, I'm
stressing that the way you engage, and the way you communicate is
every bit as important as the gist of what you say.
Starting with the negative often stops the flow of a process. If
you're willing to be flexible about how you present your feedback,
other people will be much more open to sharing your high standards.
----------------------------------------------------------------------
About the Author:
Dr. Tony Alessandra helps companies out-market, out-sell, and
out-service the competition with his street-wise, college-smart
perspective on business. He has authored 13 books, recorded over 50
audio and video programs, and delivered over 2,000 keynote speeches
since 1976. If you would like more information about Dr.
Alessandra's books, audio tapesets, and video programs, or
information about Dr. Alessandra as a keynote speaker, call his
office at 1-800-222-4383 or visit his website at
http://www.alessandra.com
When you build a website you want people to come to your site, of
course. But not only do you want them to visit, you want them to come
back, and often!
Most people will not come back unless they have a good reason to do
so. This is what you must keep in mind when designing and building
your website. When you visit a site, take note of what that site has
that would make you come back for another visit. Incorporate some of
these ideas into your website and also add in your own unique style.
On your homepage introduce yourself and talk to your visitors.
Explain what your site is about and what it can do for them. Put a
little personality into your site. That is what will make it unique.
Some things you can incorporate into your website to keep people
coming back are:
• Quality Content
A must if you want people to come back to your site. Rather than just
showing your products, offer useful, practical information for using
the products. If you have a site where you sell cleaning products,
provide tips and ideas on how and where to use your products and
tips on other aspects of cleaning and maintaining your home.
• Freebies
There are many places you can get freebies such as ebooks, downloads,
e-cards, webmaster resources, and more. Choose freebies that relate
to your site content. For example, if you have a business resource
site you want to provide freebies that will help people with their
business.
Sites for freebies:
http://www.freewarefiles.com/
http://www.all-4-free.com/
http://www.free-ebooks.net/
http://www.kresch.com/resources/
• Contests
You can have weekly or monthly contests for your visitors to win a
free sample product. Have a trivia contest, or a weekly drawing. Be
creative and make your contest interesting and fun!
• Updates - You definitely do not want your site to become old and
stale. You must continuously update and add new information,
products, services, etc. to your site. People will get tired of
reading the same old information over and over again. Put a "What's
New" section on your homepage to inform your visitors of new
additions. This way your visitors will know exactly where to find
the new content.
• Message Board - Build a community on your website for people to
learn, share, network, and voice opinions, concerns or whatever is on
their mind. This is a great way to keep people coming back for more
visits.
Sites for free message boards:
http://www.ezboard.com/
http://www.coolboard.swsites.net/
http://www.boardhost.com/
The main goals of your website should be to increase visitor
participation and benefits. Visitors are looking for things to
benefit them and for interaction. Provide an interesting, beneficial
and useful website and they will come back!
---------------------------------------------------------------------
Terri Seymour is the publisher of Web Success Ezine and owner of Web
Success Central. Contact her at: mailto:ter02@newnorth.net
Visit Web Success Central at http://www.websuccesscentral.com for
resources, ideas, guidance and more for your Web Success.
--------------------------------------------------------------------
2.) Efficient XML: Some Basics for the Windows Platform Developer
I regard myself as a particularly fortunate "XML Dude": About a
year
ago, I determined that, regardless of the amount of time I had in the
day, and regardless of the fact that the company I worked for at the
time had virtually no vision as to what XML could do to help solve
their problems, I was going to spend some time -- for ME -- each
evening, studying this new technology and learning how to use it. I
don't know about you, but I come home each evening tired from being
paid to think all day long. Very tired, I might add. But, I kept my
promise to myself and made the time to study XML and XSLT. I remember
when I bought my first book on XML, a Wrox title that I still refer
to today (although I now posess many more such books). My first
reaction was "Oh, crap! This is not going to be fun at all."
To their credit, this same company which had little XML vision saw
fit to pay to send me to both Tech-Ed and the Microsoft Professional
Developer's Conference, both of which were conveniently held in sunny
Orlando (where I live), last year. All I can say is, when I arrived
home each evening from the conferences, I was so excited I couldn't
sleep. I saw the vision! I felt the excitement of the Microsoft
gurus, who were genuinely enthusiastic about what they were doing
and what the possibilities were. And it was all about XML and DOT
NET.
Now, I am even more fortunate, because my vision of learning XML
(along with DOT NET and related technologies) has begun to pay off. I
now work for a company whose XML vision is well-formed (to make a
pun) and the project I work on is almost 100% XML / XSLT based. Every
ASP page in our application serves only as the "glue" to receive and
process querystring or other parameters from an XML-based menu
choice, to tell it what Javascript and XSL include files to load. All
the loading and transformations are dynamic, all plumbing is handled
by global Javascript functions, every single browser page in the
application is the result of a dynamically generated XSL tranform.
Client - side XML data islands hold important dynamically updated
information that is accessed through global Javascript functions,
and 100% of all data access is handled through XMLHttp XML request /
response documents via COM + middleware components that we have
authored, and it's sent, received back and processed --- from the
CLIENT SIDE -- over the wire, to and from the databases. And it's all
100% financial industry standards compliant. I feel proud to have
been a member of the architectural team that went through a lot of
pain to flesh out all this stuff and make the "proof of concept"
become a reality that will provide real value to the customer (and
make the company that I work for a ton of money). One of our biggest
concerns continues to be performance tuning (see my "Performance
Tuning Checklist" article for more on this).
Recently a friend I used to work with started using XML, and he sent
some emails asking for comments and advice. Some of the assumptions
he made in doing his "Beginning XML" exersize made me think:
"Well,
if he is making these mistakes (the same ones that I made, a lot of
them) then I wonder how many other developers struggling with XML /
XSLT are also doing this? So I decided to write this article to try
and summarize some of the most important things I've learned. If this
helps you because you're just starting out with XML, that's great.
And if you're already well under way as an XML Developer and some of
the things that I touch on here make you think - well, that's even
better. I am by no means an XML "guru". But you know what? I intend
to become one. When I read in magazines like "Smart Partner" that
XML gurus are currently being billed out at $300 an hour, I feel
gratified that my decision almost a year ago was the right one for
me. This technology is not going to go away, folks. It's big time.
Study XML! It's the best job security you can get since winning the
lottery became popular.
XML PERFORMANCE VARIABLES
In working with XML data and documents, there are four major
variables that can affect the performance of MSXML:
The kind of XML data
The ratio of tags to text
The ratio of attributes to elements
The amount of discarded white space
There are also four key performance "metrics" involved on the
Win32
platform:
Working set: The peak amount of memory used by MSXML to process
requests. Once the working set exceeds available RAM, performance
usually declines sharply as the operating system starts paging memory
out to disk.
Megabytes per second: The raw speed for a given operation, such as
the document load method.
Requests per second: How many requests the XML parser can handle per
second. An XML parser might have a high megabytes-per-second rate,
but if it is expensive to set up and tear down that parser, it will
still have a low throughput in requests per second. For example, if
the clients hit the server at a peak rate of one request per second,
and if the server can do 150 requests per second, the server can
probably handle up to 150 clients.
Scaling: How well your server can process requests in parallel. If
your server is processing 150 client requests in parallel, then it
is doing a lot of multi-threading. Processing 150 threads in parallel
is a lot for one processor, it will spend a lot of time switching
between threads. You could add more processors to the computer to
share the load.
The fastest way to load an XML Document
The fastest way to load an XML document is to use the default
"rental" threading model (which means the DOM document can be used
by
only one thread at a time) with validateOnParse, resolveExternals,
and preserveWhiteSpace all disabled, like this in Javascript:
var doc = new ActiveXObject("MSXML2.DOMDocument");
doc.validateOnParse = false;
doc.resolveExternals = false;
doc.preserveWhiteSpace = false;
doc.load("mystuff.xml");
If you have an element-heavy XML document that contains a lot of
white space between elements and stored in Unicode, it can actually
be smaller in memory than on disk. Files that have a more balanced
ratio of elements to text content end up at about 1.25 to 1.5 the
UCS-2 disk file size when in memory. Files that are very data-dense,
such as an attribute - heavy XML - persisted ADO recordset, can end
up more than twice the disk-file size when loaded into memory.
Attributes vs. Elements
You could conclude that attribute-heavy formats (such as an XML -
persisted ADO recordset) deliver more data per second than element-
heavy formats. But this should not be the only reason for you to
switch everything to attributes. There are many other factors to
consider in the decision to use attributes versus elements.
Unique elements
My friend, in his honest but less than informed effort to create a
useful XML document, made the mistake of attempting to use the XML
elements as if they were unique "database fields". For example if
you have an XML Document that consists of survey questions, you could
conceive that in order to make each element "unique" you would give
the tag a unique name. So your survey questions document might end up
looking kind of like this:
Internet Service Provider?
Now what is wrong with the above document fragment? Two things,
actually. First, it does not lend itself easily to XPATH statements
that allow you to walk the DOM and find isolated nodes and / or
subnodes of elements. True, each element has a "unique" tag name,
but
that's not the point. XML is a tree-like hierarchical structure. If
you need to be able to find an element or a node by number, or to
sort, search or group, it's better to use either an attribute
(
nodes, or to include a sibling element (
Question tag. You can also use the position() operator. The second
thing that's "wrong" is that the answer tags simply follow closed
Question tags here -- there is no closing "Question" element that
encompasses both the question and it's answers. A more productive
version of the above might look like this:
Internet Service Provider?
Separate Memory Structure for unique elements
With the second example, we can find any question by its number using
XPATH like: //Question[@Qnum="2"]. We can sort, search, grab a
question node along with its answers, and so on. And there is another
very important but often overlooked reason to try and arrange your
XML documents so that all the major tags have the same names: when
the XML parser loads and processes your document, it creates a
separate memory structure for each unique element name. So
conceivably the first example above, if it had 1000 questions, could
occupy orders of magnitude more memory than the second example with
1000 questions, taking a lot longer to parse, and possibly a lot
longer to search or sort as well.
Walking the DOM tree for the first time also has an impact on the
working set metric because some nodes in the tree are created "on
demand", they are not automatically "there" after loading the
document. Creating a DOM tree from scratch results in a higher peak
working set than loading the same document from disk. Loading a
document is roughly five times faster than creating the same document
from scratch in memory. The reason is that the process of creating a
document requires a lot of DOM calls, which slows things down.
Walk Fast
The fastest way to walk the tree is to avoid the children collection
and any kind of array access. Instead, use firstChild and
nextSibling:
function WalkNodes(node)
{
var child = node.firstChild;
while (child != null)
{
WalkNodes(child);
child = child.nextSibling;
}
}
However, if you are looking for something in the tree, the fastest
way to find it is to use XPath via the selectSingleNode or
selectNodes methods.
Free-Threaded Documents
The "free-threaded" DOM document exposes the same interface as
the
"rental" threaded document. This object can be safely shared across
any thread in the same process. It can be safely stored in ASP
Application state on IIS.
Free-threaded documents are generally slower than rental documents
because of the extra thread safety work they do. You use them when
you want to share a document among multiple threads at the same time,
avoiding the need for each of those threads to load it's own copy.
In some cases, this can result in a big performance gain.
For example, suppose you have a 12K XML file on your Web server, and %>
you have a simple ASP page that loads that file, increments an
attribute inside the file, and saves the file again. Such ASP code is
likely to be completely tied up with disk I/O. However, you could put
the file into shared-application state using a free-threaded DOM
document:
<%@ LANGUAGE=JSCRIPT %>
<%
Response.Expires = -1;
var doc = Application("Stuff");
if (doc == null)
{
doc = Server.CreateObject("Msxml2.FreeThreadedDOMDocument");
doc.async = false;
doc.load(Server.MapPath("stuff.xml"));
Application("Stuff") = doc;
}
Application.Lock();
var c = parseInt(doc.documentElement.getAttribute("count"))+1;
doc.documentElement.setAttribute("count",c);
Application.UnLock();
<%=c%>
This second approach using the free-threaded DOM document can easily
be seven times faster than the other.
IDispatch
Late-bound scripting languages such as JScript and VBScript add a lot
of overhead to each method call and property access in the DOM
interface. The script engines invoke the methods and properties
indirectly through the IDispatch interface and first call
GetIDsOfNames or GetDispID, which will pass in a string name for the
method or property and return a DISPID. Finally the engines package
all the arguments into an array and call Invoke with the DISPID.
This is slower than calling a virtual function in C++ or compiled
Visual Basic. For this reason, you may want to consider calling all
your DOM functions from a "wrapper" compiled component that has the
generic methods you need to do what you want, when using a script
based application environment such as ASP. With VB, you want to also
avoid late- bound DOM object invocation calls like the following:
Dim doc as Object
set doc = CreateObject("Microsoft.XMLDOM")
This will be as slow as VBScript or JScript. To speed this up, from
the Project menu, select References and add a reference to the latest
version of the "Microsoft XML" library. Then you can write the
following early-bound code:
Dim doc As New MSXML.DOMDocument
Use XSL to get the data you need for speed
XSL can be a big performance win over using DOM code for generating
"transformed" reports from an XML document. For example, suppose you
wanted to show all the questions and answers matching a certain key
word category element. You might use selectNodes to find all the
questions matching the category, then use another selectNodes call
to iterate through the answer elements of each of those questions.
But you could also write an XSL stylesheet:
You could then create your output with a function like:
function report(doc) {
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load("pollquestions.xsl");
return doc.transformNode(xsl)
}
This XSL transformation could be from 5 to 10 times faster than
iterating through the DOC looking for your data!
The "//" Operator
The "//" operator walks the entire subtree looking for matches. if
you are lazy like me, you use it more than you should because you
are too lazy to look up and type in the full path. If you can, use
the full path to get your data; it will typically give you up to a
15% performance boost. In editors such as XML Spy, there is a
clipboard copy function that will return the XPATH statement to
return any element.
Many of the items I"ve chosen to cover in this article, and others,
along with real - world test results and detail, can be found in
some excellent work by Chris Lovett of Microsoft. Also, author
Kurt Cagle has some great work on using the IXSLTemplate interface
to use cached template processors that will speed up repetitive
transformations big time. You can find articles by both authors at
MSDN online, by simply searching on their names.
---------------------------------------------------------------------
ABOUT THE AUTHOR: By Peter A. Bromberg, Ph.D.
Peter Bromberg is a Senior Programmer / Analyst at Fiserv, Inc. in
Orlando and a co-developer of the EggheadCafe.com developer website.
He can be reached at mailto:pbromberg@yahoo.com
When my friend Sharon told me she was an Industrial Hygienist, I had
no idea what that term meant. Did she do dental work in
manufacturing areas? I found out that she deals with the workplace
environment to ensure a safe and comfortable place of employment.
Ergonomics is one of her fields and is essentially the study of what
makes our bodies most comfortable in relation to light, sound,
movement, temperature, air quality, and our furniture. Since the
average office worker now sends and received 52 phone messages, 36
e-mails, 36 pieces of mail, 14 faxes, and 8 pager messages per day;
we need to be comfortable doing all these things.
Here are some insider secrets on how ergonomics can help increase
your personal energy and your health while you are at your office so
you don't have to go home from work exhausted. Posture, type of
furniture, work organization, and other personal space practices all
work together to affect fatigue, stress, strains, or injuries.
Follow these pointers and you will have more energy left over at the
end of the day to play with your kids, your pets, your partner, or
your friends. And playing as hard as we work is what leads to a
balanced life with less stress and more fun since our work hours
have increased by 20% and our leisure time has decreased by 32%
since 1973, we need to make the most out of what leisure time we
have and be sure we have the energy to enjoy it.
Have a seat:
* Working for long periods of time without a break in an
uncomfortable position can lead to headaches, eye-strain, and loss
of concentration. Moving within your range of comfort zones and
various postures is good for your spine, muscles, joints, and
circulatory system. Get up and stretch to get the blood flowing
into your limbs and to allow your left brain and right brain to
integrate more readily by focusing on something else for a while.
You will come back refreshed.
* Find your various comfort zones which may include standing or a
more upright posture when speaking on the phone to enhance the voice
by opening up the diaphragm. It may include a more relaxed position
when using the computer. I find myself doing all my writing on my
comfy couch on a lap desk, while my antique writing desk goes
untouched for that purpose. I can't seem to get creative while
sitting at a slant-top desk. Use what works best for you.
* Your chair should be of comfortable height with your fee firmly
planted on the floor or on a footrest. Shorter people may have back
strain if their feet cannot touch flatly on the floor since their
backs must arch to get their feet to touch. Footrests can alleviate
such a strain - this goes for airplane seats, buses, bleachers etc.
I have found a box of copy paper or a file box is just the right
height for someone 5' 2"!
* The backs of your knees and the underside of your thighs should be
free of pressure with enough space under your desk for your knees
and thighs to clear should you cross your legs or decide to use a
footrest.
* Your lower back should be supported. If you are in a hotel room -
use the blanket draped over the back of the desk chair and a pillow
or rolled towel behind the lower part of your back. There are also
portable back pillows for conferences and road trips to help support
your back. Your mother was right - avoid slouching forward as it
impedes breathing and fatigues the back.
* Your shoulders should be relaxed with your hands, wrists, and
forearms aligned in a straight, neutral position. If you use
armrests, your shoulders should be relaxed with your elbows in near
your body when they are resting on the chair. Your forearms should
make a 90 degree angle to your upper arm when poised at the keyboard
to aid in bloodflow to the fingers. Avoid resting your hands and
wrists on sharp edges which will impede circulation.
Technical Difficulties:
* Your computer keyboard should be directly in front of you and
sometimes it may be in your lap to change positions. Your hand
should be relaxed when holding the mouse and if you are not actively
using it, rest your hand elsewhere. Practice typing and clicking
with a light touch and clean your tracking mechanism regularly so it
moves effortlessly. Your keyboard slope should allow your wrists to
be straight.
* Do you refocus your eyes intermittently on distant objects or get
up and walk around to give your eyes a rest. Position your monitor
to avoid glare on the screen - by reducing ceiling lights, or
positioning the monitor between lights, or by using a
glare-reduction filter. If you wear bifocals, avoid tilting your
head back to see the monitor. Your monitor should be about arm's
length from your face just below eye level, and directly in front of
you or a bit to the side if your document holder is the main thing
you are focusing on in front of you. By properly positioning your
monitor, you will reduce eye strain, and muscle fatigue in your
shoulders and upper back.
* After switching from a very active job to become a computer jockey,
I noticed my arm going numb and tingling in the fingers. I found
out from my chiropractor that I had huge knots in my shoulders from
improper chair/desk height and from scrunching the phone between my
shoulder and my head. Even though you may take a break from the
stresses which caused these ailments, the muscle knots do not go
away on their own - you must have them worked out by a massage
therapist. I have found freedom from tension knots by purchasing a
cordless headset telephone and by having preventive massages on a
regular basis. Sometimes we need to listen to our bodies when they
tell us something is askew.
Lights, Sound, Action!:
* Fluorescent lighting can cause headaches from the constant buzz and
flicker. Natural light or full-spectrum lighting can increase your
productivity by 255 and reduce headaches as well.
* Avoid assaulting noises or sounds which disturb your natural
rhythms. For some people white noise helps drown out unpleasant,
distracting sounds. For others playing soft music with the
tonalities of smooth jazz or classical is more energizing.
* Getting fresh air during the day helps boost your energy along with
getting some sunlight and vitamin D from the sunshine. A short walk
outdoors will help breathe new life into your during the afternoon
slump. Some buildings are known for their toxic air or sick
building maladies. Oddly enough, the Environmental Protection
Agency had some of the worst air in the country until they took
steps to rectify it.
So Ergonomics plays a big part in personal energy - even though I
could not find ergonomics in 3 of my dictionaries and thesauruses
which were printed in the 1970's. We've come a long way in
detecting what makes our bodies comfortable and most productive. In
the end, it is an individual choice on what makes us comfortable.
All we have to do is sit still long enough to really listen to it.
---------------------------------------------------------------------
About the Author:
Gail Howerton, MA, CLP is the CEO (Chief Energizing Officer) of
Fun*cilitators. She is a professional speaker facilitating fun and
effectiveness to energize your enterprise and promoting peak
performance through playful professionalism. She is the Author of
Hit Any Key To Energize Your Life. Contact Gail on her cordless
headset for more information at 800-930-6096 or subscribe to your
free monthly ezine Live Wire at http://www.funcilitators.com for
tips to lighten up your work and your life. Feel free to reprint this
article along with my name and contact information. I would also
appreciate a copy of your publication in which it appears.
Copyright 2000 Fun*cilitators
Looking to learn how to build dynamic Web sites? There are many
options out there, the most popular of which include ASP, PHP, and
other scripting languages. Another option is Java. Oh sure, Java
began as a language for writing Web-based Applets and cross-platform
applications, but in the past few years its role has been expanded to
include server-side programming of Web pages. In fact, there is great
demand in the job market for developers with experience in writing
server-side Java applications. Your first step towards adding these
skills to your résumé should be to pick up a basic understanding of
the Java language in general.
This is the first in a series of articles that will teach you the
Java programming language with an eye to features and techniques
that are applicable to building dynamic Web sites. Specifically,
after covering the basics of the language and the object-oriented
concepts you need to use the language effectively, I'll proceed to
a discussion of Java Servlets and JavaServer Pages (JSP), the two
technologies used to build dynamic, data-driven Web sites using
Java. Along the way, I'll introduce you to related technologies,
like Java Database Connectivity (JDBC). But before I get too bogged
down in a description of things to come, let me turn your attention
to the object of this article: an introduction to the basics of the
Java language.
What Is Java?
Java is a full-featured programming language like C/C++, but simpler
and more tightly structured. Like C++, Java is an object-oriented
programming language, which is a concept I'll expand on in the next
article in this series. In basic terms, however, Java programs are
written by creating a structured set of software components that
interact with each other to produce the desired effect. These
components are called objects, and the fundamental task of a Java
developer is to determine the best object structure to achieve a
system that works as required, as efficiently as possible and,
wherever possible, producing components that may be reused in
similar applications.
If all that sounds a little scary, don't worry; it'll all make sense
once you've learned it. For now, we'll proceed in baby steps.
Java programs, instead of running directly on a computer's operating
system, run on a "Java Virtual Machine" (JVM), which itself is a
program that runs on the computer's operating system. Since the
production of Java Virtual Machines is highly standardized,
incompatibilities between different platforms are minimal. This means
that, in theory, any operating system that has a JVM (pretty much all
major operating systems these days) can run any Java program, with no
need to recompile the program for each platform. This leads to one
of the most attractive features of the Java language: "Write Once,
Run Anywhere" (WORA). The disadvantage is that Java programs tend to
run slower because the Virtual Machine has to convert Java program
instructions and pass them to the operating system on which it is
running.
Most current Web browsers can also run Java programs that are
downloaded from the Web, either using a JVM built into the browser
(as in Netscape 4 and Internet Explorer browsers), or by interfacing
with a standard JVM installed separately (as in Netscape 6 and Opera
browsers). Java programs designed to run in Web browsers are called
Java Applets. When Java was originally released, much of the marketing
hype surrounding the language centred on these little programs that
run in Web browsers. Over the years, however, the focus of Java on the
Web has shifted to server-side applications (including Servlets and
JSP), and Java applets have been replaced in many instances by more
nimble technologies like Dynamic HTML and Flash. Common uses of Java
applets these days include Web-based chat programs and online games.
Now that you know what you're getting yourself into, it's time for
you to get a hold of the tools you'll need to get started with your
Java development efforts....
To read the rest of this tutorial:
http://www.sitepoint.com/tribune/100/article364.php