Category Archives: technology

How to publish an eBook for Kindle

Amazon.com announced that the sale of electronic books for the Kindle reader surpassed the sale of printed books in April 2011. There are many reasons for the shift from print to electronic media, including the fact that thousands of books are available in electronic form. Books in Kindle format can be read on Amazon’s Kindle and also in other devices such as the iPad, iPhone, Android phone, and personal computers. The Kindle reader can store more than one thousand books and can download those books via Wi-Fi wherever you are. Kindle readers also have a built-in web browser and text-to-speech so that you can listen to your books. Paper books can’t do that!

Publishing an electronic book for the Kindle is as easy as formatting a Microsoft Word document or developing an HTML web page, but there are additional requirements for HTML. You can prepare your text and images using Microsoft Word or OpenOffice Writer and save the text as HTML in a new folder. The text can also be prepared using HTML editors such as Microsoft FrontPage or SeaMonkey Composer. Once your source material is ready, you need to format the file for the Kindle, and prepare a book cover and table of contents. These are some of the steps you need to take:

– Read the Kindle publishing guidelines. https://kdp.amazon.com/self-publishing/help
– Create an account for Kindle Direct Publishing. https://kdp.amazon.com/self-publishing/signin
– Create a book cover JPG image (600 by 800 pixels) using Irfanview, Gimp, Photoshop, etc.
– Write a short description about the book, similar to what would be in a book jacket.
– Download the free software from Amazon to build and preview Kindle books:
//www.amazon.com/gp/feature.html?docId=1000234621

KindleGen is a command line tool used to build eBooks.  KindleGen will accept as input an HTML file or an .opf file which is an XML file that has the title of the book, the author, the location of the cover, the location of the table of contents, and the sequence in which the HTML files should be organized. The table of contents is an .ncx file also in XML format. KindleGen has a sample book with .opf and .ncx files that can be used as a guide. The KindleGen application integrates all the HTML files, the images and the table of contents to create a Kindle book file with a .mobi extension.

The Kindle Previewer can read a .mobi file and emulate how the book will display on Kindle devices. This is a useful tool to check the appearance of the book on the Kindle, Kindle DX, iPhone, and iPad.

Amazon also provides a free Kindle for PC application that allows you to read Kindle books on your PC or laptop.
//www.amazon.com/gp/feature.html/ref=kcp_pc_mkt_lnd?docId=1000426311

You will need to decide whether you want to assign an ISBN number to your book before you submit it to Kindle Direct Publishing. The ISBN is not required by Amazon, but you may want to get one if you plan to promote your book actively. The ISBN is used by libraries and book sellers as an identification for published items. An electronic book has to have a different ISBN from a printed book with the same contents. You can get an ISBN for $125 Dollars or a set of 10 ISBNs for $250 Dollars from https://www.myidentifiers.com/ The ISBN is contained in the .opf file, so you have to obtain it before you can produce the final version of your kindle book.

If you do all the book development and formatting yourself, the cost of the ISBN is your only expense. Once you have built your book and tested it, you are ready to publish it. For Kindle books that sell between $2.99 and $9.99, Amazon will pay 70% of the revenue to the publisher. When the eBook has been accepted, it will be listed in the Amazon.com web site and will also be available in ads such as this:

Spam e-mail is financed by illegal drug trade and scams

You probably received an e-mail asking for your help to transfer several million dollars on behalf of the daughter of an important Nigerian head of state.  This is a social engineering scam that takes advantage of your gullibility and greed.

Another message in your mail box probably says that your on-line bank account has been canceled and that you need to verify the account data to restore access.  This type of scam is called “phishing” and it is generally linked to a fake or “spoof” web site designed to steal your account information.  If you fall for the scam, you will become a victim of identity theft and your compromised bank account will be drained.

The majority of spam e-mail in your inbox is most likely about how to get drugs without prescription.  The drugs can be sedatives, diet pills, or medications like Viagra for improved sexual performance.  Here is a small sample of typical junk mail.  Many of the spam e-mails are purposely misspelled to try to avoid spam filters and guarantee that they land in your mailbox.

Woodrow Hanson, Need any of the 3?..ViagraXanax vicodin valium?, 4:01 AM 3KB
Elba Sheridan, Ambien, Soma, Phentermin, and more without a prescription!, 3:58 AM 2KB
Mildred Thorpe, tips that are good for bed, 3:50 AM 2KB
Leroy Rutherford, We have great anti anxiety medications!!, 3:42 AM 3KB
Maria Cunningham, Much bigger, than you used to have it!, 3:35 AM 2KB
Adela Britton, Get all the medications you want online!, 3:15 AM 3KB
Dee Amos, prosolution pill, 3:13 AM 2KB
Joan Carson, good news for the bed, Tue, 7/21/09 3KB
Raymond Rollins, Get Vicodin Online - NoPRESCRIPTION Needed!, Tue, 7/21/09 3KB
Young Spears, Buy Hydrocodone Online from a US Pharmacy, Tue, 7/21/09 3KB
Leigh Trent, Acai Diet, lose weight without impossible diets, Tue, 7/21/09 4KB
Harriett Park, ORder ALL YOUR favorite meds online NO_PRES needed!, Tue, 7/21/09 2KB
Rich A. Robison, great web offer, Tue, 7/21/09 3KB

What is likely to happen if you respond to one of these messages?  One possibility is that you will get bilked.  You send your money to buy some drugs and you never see the drugs or your money.  To whom are you going to complain?  Will you complain to the police or some government agency that you did not get your illegal drugs?  Not very likely.  Another possibility is that your e-mail address is harvested by mass marketers to send you some more spam e-mail.   A third possibility is that the drugs that you get are fake and not what you expected.  The best thing to do is just to delete the junk mail.

The United States is the largest market for illegal drugs in the world.  America’s great hunger for drugs is what keeps the Mexican and Columbian drug cartels in business.  Many of the contacts for the distribution of illegal drugs start through the Internet using spam e-mail.

Learn about Drug Addiction

Comparing Blosxom and WordPress weblogs

The old adage that “necessity is the mother of invention” is so true.  When we are frustrated, or our current approach to a problem does not produce satisfactory results, we often try something else, and in the process we may discover something new.

I have had a WordPress blog since May of 2007.  At the time, I did not know much about how blogs worked, and used the cookie-cutter approach provided by my web hosting service.  I started learning about WordPress themes, syndication, database backups, MySQL databases, phpMyAdmin, and many technical details that were necessary to interface the blog with my website seamlessly and reliably.

All was well until, one day, I noticed that the RSS subscription to my own blog had not been updated.  When I investigated, I found that my WordPress blog had been hacked.  Someone had modified the WordPress wp-blog-header.php file and added some code that would divert search engine requests to a variety of casino and porno sites.  The code was clever enough to avoid diverting direct accesses to the blog, thus reducing the chance of detection of the hack by someone who accessed the blog directly.  I restored the original code, and determined that the hack had been made possible by a buffer overflow through the blog comments.  I modified the WordPress code to prevent further changes.  I described the technique here.

My original WordPress database was in Latin-1 code page and I wanted to convert it to UTF-8 to make internationalization easier.  At the same time, I decided to upgrade the original version of WordPress that I had been using to the latest and greatest version.  Disaster!  The intelligible permanent links stopped working because the permalinks plugin from my host was not compatible with the new version of WordPress.  The solution required being able to modify the .htaccess file, which I was not allowed to do on my host system.  Disappointed, I decided to use an ugly default link format, and I had to modify my 404 processing (for pages not found) so that requests for pages from “permanent” links to my blog would be converted to blog searches to try to find the blog post.

It was at this time that I started looking for blogging alternatives to WordPress that did not involve a database, and I found Blosxom. Comparing WordPress to Blosxom is like comparing a modern automobile to a horse and buggy.  They both can get you to the same place, but the ride in the horse carriage requires a lot more tending.   So it is with Blosxom, but after a couple of days, I was able to convert my WordPress blog for use by Blosxom.  The real strength of Blosxom becomes evident if you want to create static web pages and remove the dependency on PHP and MySQL.  The dynamic version of Blosxom also works well, but unless you are a good Perl programmer, you better stick with WordPress.  If you are still interested, click on the following link.

Learn how to convert a WordPress Blog to Blosxom

Lucky Numbers Gadget – New directions in the Internet

There is a revolution in the way people communicate with each other.  Newspapers are getting thinner or going out of business.  Television programs keep saying “go to our website for more details”.  Almost everybody has a cell phone, and cell phones have evolved into multi-function devices that, besides carrying voice messages, take pictures or act like Global Positioning System (GPS) devices that show maps and provide directions.  The cell phones also can store and play your favorite music.  Many of these advances are due to the way that the Internet is developing.

Google has become the major search engine in the world and neither Yahoo nor MSN (now Bing) comes close to the breadth and depth of coverage that Google offers.  The greatest handicap for finding information has been the multiplicity of languages in the world.  Google is making great strides in its statistical translation approach.  A user can search in other languages and have the results translated into his native language.  It is now possible to search information in Arabic or Russian even if you don’t know these languages.  The translations are somewhat rudimentary, but they are understandable.  I can imagine that in twenty years many language barriers will disappear.

One of the latest trends in the Internet is the use of gadgets which perform functions such as displaying the weather, news, or other useful information.  Gadgets are XML containers with HTML and JavaScript that may be easily manipulated within web pages.  To get familiar with the technology, I developed the Lucky Numbers Gadget illustrated above.  It is amazing what you can do with less than 90 lines of code.  Anybody can now develop customized web pages by selecting the gadgets that they find most useful.

You can add the Lucky Numbers gadget to your iGoogle web page by pressing the button: Add to Google

Swine flu forces students and parents to work from home

Don't Pollute e-commute

Many schools across the country have closed because of swine flu infections.  This has forced some parents to stay at home to take care of the kids.  These unexpected changes in schedules are a hardship for the parents and for the firms that employ them because it reduces productivity.

Some firms provide employees with the opportunity to work from home.  The work-at-home programs may be called telecommuting, e-commuting, e-work, or telework.  The firms that allow working from home may also provide equipment, such as computers, modems, and internet access.  The most effective way to work from home requires a connection for the computer and a separate line for the telephone so that both can be used at the same time.

When a significant portion of the employees work from home, a company is able to reduce its office space.  In addition, a company that allows telecommuting may be able to hire qualified individuals who live far away or who, because of disabilities or other obligations, may not be able to drive to the company location.

Telecommuting provides a “green” alternative to driving.  You don’t use gasoline.  You don’t have to fight traffic.  You don’t pollute and you reduce your carbon footprint.  However, you need to have discipline to get your work done in spite of the distractions that can be found at home.  You cannot just surf the internet or play solitaire and expect to get paid.

(OS 3) The system cannot find the path specified

Apache Web Server

Recently, I got a new computer and I had to install the Apache Web Server on a Windows platform to be able to test my CGI scripts locally before publishing them on the internet.  The installation went well and I could test CGI executables without problems, but HTML pages that used Perl scripts displayed the dreaded HTTP Status 500 – Internal Server Error.  My Apache error.log file had the entry:

[client 127.0.0.1] (OS 3)The system cannot find the path specified.
: couldn’t create child process: 720003: echo1.pl

This type of error occurs more frequently in Windows systems than in Linux or Unix systems.  The reason is that the shebang line of the Perl script (#!/usr/bin/perl) is used by the Apache web server to find a program to interpret the script.  In Windows systems, the Perl interpreter is normally installed as C:\Perl\bin\perl.exe, whereas in Linux/Unix systems the path is usually /usr/bin/perl, as indicated in the shebang line.  Although there are several ways of telling the web server where to find the Perl interpreter, I have found that the simplest solution is to leave the Apache configuration alone and store a copy of the Perl interpreter as C:\usr\bin\perl.exe.

In this way, I can test my Perl scripts in the Windows system with exactly the same code that will run in the Linux systems.  In the event that I upgrade to a new version of Perl, I have to remember to also change the copy in the local C:\usr\bin\ directory, or install the new version of Perl in directory C:\usr instead of the default directory C:\perl.

Click Here for a list of Free and Open Source Software

Fear of Friday the 13th

triskaidekaphobia

Fear of the number 13 is called Triskaidekaphobia.  Although the origins of this superstition have been lost in antiquity, they still persist in our modern world.  In Hispanic and Greek cultures Tuesday the 13th is considered an “unlucky” day, but in English folklore it is Friday the 13th.  The superstitions about the number thirteen are so ingrained in society that they even affect architectural decisions.  The building in which I live does not have a 13th floor, as you can see in the elevator panel above.

Yesterday, was Friday the 13th, and I had a particularly unlucky day.  Actually, it could have been worse, but I am glad that it wasn’t.  It all started with my usual TGIF celebration which consists of going to a restaurant for dinner and having a relaxing evening at home.  But not last night.

The French food was a complete disaster.  I ate only half of the food because it was too much, but nevertheless, I woke up in the middle of the night with a stomach ache.  I don’t think that the food was bad, it was just too salty and my organism is not used to so much salt.  I probably had dehydration cramps.  My girlfriend ordered something that had some crab meat and something else with a strange French name.  She should have heeded her instinct when the waiter asked if that was what she really wanted and whether she had had it before.  She asked “What is it?”, the waiter explained that if she liked sardines or anchovies she might like it.  mmhhh…  At this point I thought that she would change her mind, but no, she is an adventurous gourmand.

Too bad.  During the middle of her culinary adventure, it seemed to me that she looked a little bit green.  At about this time she offered to let me try her dish.  Having once been duped into tasting a horribly vile fishy morsel, I politely declined.  Then she confessed that she really didn’t like the dish, and that the mystery ingredient with the French name seemed to be some kind of raw roe or organ which was too fishy and unpleasant.  We left the restaurant in a less than pleasant mood.

But Friday the 13th had not worked its full magic yet.  The worst part was about to happen on the way home.  The first sign of trouble sounded like a pop as we passed a car that had been stopped by a police car.  I did not realize then that my rear tire had blown out and was leaking slowly.  As I turned into the cloverleaf to get on Washington’s outer belt, Route 495, I felt the car sway in an unusual way.  The steering became harder, and then I realized that I had to pull to the edge of the road.

Fortunately, the blowout was on the right wheel along the curb of the road, otherwise I would not have been able to change the tire without risking my life.  I fiddled in the dark with the jack and the spare tire while my girlfriend held a flashlight.  The flashlight gave up the ghost after a few minutes.  I managed to get the spare tire on in the dark.  When I tried to get back on the road, there were some strange noises from the wheel that I had changed.  I could not drive.  I called the Mercedes help line, and a knowledgeable assistant asked me if I had changed the tire myself.  When I said yes, he mentioned that the spare tire uses shorter wheel bolts than the regular wheels and suggested that this might be the problem.

I looked back through my toolkit using the cabin light of the car and there I found the five shorter bolts that I needed.  I jacked the car up again and replaced the bolts in the dark.  Now the car could move, but there was still some drag.  I drove home slowly, which was eight miles away, and I could hear that the rear brake calipers were dragging on the disk.  Evidently, the longer bolts had bent something.  The tire was under warranty.  I changed it on Saturday, but it cost me $101 Dollars to replace it after credit for residual value.  The brake repairs will have to be done on Monday, and they will probably be a lot more expensive than the tire.  This is a Friday the 13th that I will not soon forget.

Surviving the Flood in Bethesda

Bethesda Flood

A 66-inch water main broke in Bethesda today due to several days of sub-freezing weather.  The flow of the water was so powerful and so sudden, that it trapped several cars on River Road and the drivers had to be rescued by helicopter.  The water company took several hours to determine which valves to turn off to control the flood, but we will be living with the consequences of this rupture for many days. The strong water flow undermined a portion of the road and it will take several days to repair it.   There will be terrible traffic jams because River Road is a major commuting artery from Potomac, MD to Washington, D.C.

The water main break happened early in the morning, and many people woke up to find that they could not brush their teeth or take a shower.   Shoppers rushed to the grocery stores to stock up on drinking water.  Partial water service was restored by noon to some neighborhoods, but the pressure was too low to get to the top of high-rise buildings.  On the 19th floor of my building there is no water.  The breakfast dishes are piled in the sink.  County regulations require office buildings to close when there is no water due to concerns about sanitation.  The Bethesda Post Office was closed and the bank across the street was closed.   You cannot mail Christmas gifts, and you cannot do banking transactions unless you travel several miles to Rockville, Md. which is unaffected by the water main break.

Incidents like this make you think about strategies for surviving natural disasters.   In this modern age, we depend on an infrastructure of utilities that bring water, electricity, and communications to our home.   Water is the most important for survival, but electricity is a basic necessity that powers elevators, heating fans, telephones, and computers.  It would probably be impractical or impossible to live in a high-rise building without electricity.

Remote Control Chaos

Remote controls

The first TV remote control that I owned was connected by a wire to the television.  You could not take it more than twenty feet away from the TV because that was the length of the wire, but it never got lost.  Cordless infrared remote controls became popular in the late 1950s, and soon they were being used not only for televisions, but for audio systems and cable television boxes.

Unfortunately, every manufacturer set up their own coding system and a remote control could not be used for two different appliances.  Remote controls proliferated because one was needed for the TV, another one for the cable box, and a third one for the DVD player.  There are several “universal remote” controls which promise to manage all your devices, but the programming is so hard that the average person prefers to use multiple controls.

This week, I have had calls from two little old ladies.  One of them accidentally pressed some button on one of her two remote controls and lost the picture on her TV completely.  She tried and tried but could not get the picture back.  The other lady subscribed to a cable channel to watch some programs in her native language.  She ended up with one cable system for her American programs and another cable system for her foreign programs.  Each cable system has its own remote control, but to switch between them or to turn the TV on or off it is necessary to use a third remote control.  This is too complicated for her and now she cannot watch her programs because she cannot get past the barrier of complexity.

Technology was so simple half a century ago.  Remote controls had wires and telephones were connected to the walls.  Today, you have to keep your mind sharp to be able to change the channels on the TV.