Coding


I visited a family’s website recently. It looks nice. It appears to be done as a WordPress site. I did notice one glitch. On one page, the last paragraph contains what probably are dashes or double dashes. I’m guessing the writer pasted from Microsoft Word into the WordPress editor used for the site. Unfortunately, Word uses a character code for the dash which html does not properly display.  My browser displayed – instead of the dash. The WordPress editor allows you to look directly at the html by selecting the “Text” tab instead of the “Visual” editor view.

editor

If this happens to your site, I would recommend you edit the page and substitute the html entity code —  for whatever you see there.

Looking at the technical bits: Most current html coding and browsers are set to use a character coding called “UTF-8” or “Unicode.” It is the international extension of the older “ASCII” from the early computer days. You can actually have a lot of fun exploring Unicode. I have done a few pages on it, as it turns out (in case you have not seen them yet).

http://runeman.org/articles/unicode/index.html
http://runeman.org/articles/utf8_codes.html
http://runeman.org/programming/javascript/utf-from-js.html

Happy exploration!

“H” is for happiness!

The “Hour of Code” is an initiative to get all sorts of kids and adults to devote an hour during the 2013 Computer Science Education Week (CSEd), promoted by the Computer Science Teachers’ Association (CSTA), especially to draw attention to getting the activity to happen in the daily routine of school work. Lots of different groups have signed up to participate. There are hundreds of challenge activities which have been designed for every age group and for all sorts of contexts, in school and outside of the school setting.

Image

This example is based on the Khan Academy activity at https://www.khanacademy.org/hour-of-code/hour-of-code-tutorial/p/challenge-h-for-hopper.

This was my first use of the Kahn Academy site. The Kahn Academy activity was well done, with lots of popup support from an animated character named Hopper which is similar to the infamous “Clipper” help system of Windows. Hopper worked, especially in this context. The site does NOT require login or an account to use the coding tool. There is nothing to download. You are free to play.

Are you planning to participate?

Screencapture of my Kahn challenge. Yes, I know that the expected result is just the basic large “H” outlines, but what’s the point of stopping when the urge to extend washes over? If you choose to complete the activity for the badge, you will want to set up an account and go through the steps without doing extensions. You are not limited to the planned activity, but the system is set up to get a particular result in order for you to earn official recognition.

Image

The ePUB file format is one of a few ebook file formats. The Nook from Barnes and Noble uses ePUB. The Kindle from Amazon uses Mobi. For a general comparison of ebook file formats, see the Wikipedia Article. The demo for the NatickFOSS meeting will concentrate on ePUB for a few reasons.

  • I own a Nook
  • ePUB is an open standard.
  • ePUB is the format with which I have the most experience.
  • ePUB files are often available without DRM (Digital Rights Management or Digital Restrictions Management). See Project Gutenberg. That means we can look inside. That’s the plan for the meeting.

The ePUB format is an open standard with wide ereader support. Apple’s iBooks for the iPad and Barnes and Noble’s Nook use ePUB formats. Granted, the books they sell are commonly encumbered by DRM. The ePUB format does not require DRM. Some publishers have decided to abandon DRM. The technical publisher O’Reilly and Baen Books, are two examples.
Any more you recommend?

O'Reilly Logo Baen Logo

We will take a look at a simple ebook to keep our effort uncluttered, but the current ePUB version 3 enables all sorts of great features, including the ability to embed movies…Wait. It’s a “book”, isn’t it?”

The format is based on the same elements as the web. In some ways, ePUB software is a modified browser. The core of ePUB (and also of Mobi) is html code with cascading stylesheets (CSS) and some descriptive elements in XML files. All of these are common on the Web, too. Almost every web page has words and images kept in html code. The layout and color scheme are controlled by stylesheets. Extensible Markup Language (XML) is intended to be “meta” information, not usually displayed as part of a web page or ebook. XML contains code for the ereader, to identify file sources, author, title, table of contents, and other such things which a librarian might find especially interesting.

Linux has a good open source ePUB tool called Sigil which takes in text files or html files, formats them to the requirements of ePUB, adds the descriptive XML file automatically. Sigil also has Macintosh and Windows versions.

The following image shows the layout of the Sigil window. Click to enlarge the image and look closely. You should notice that it has many buttons that look very much like the ones in a word processor like LibreOffice Write. There are options specific to the ePUB format, but you would be able to immediately start work on your “Great American Novel” with Sigil.

sigil image

A very detailed exploration of ePUB by Elizabeth Castro EPUB: Straight to the Point is worth buying if you plan to really dig in to making them on your own. She writes about the kind of information you need to make a good-looking ebook. She begins with a section on Adobe InDesign as the development tool, but the details further into the book are useful with Sigil, too.

If anybody wants to explore the Dwarf Planet short story, you can download it and transfer it to your Kindle [mobi] or Nook [ePUB]. If you just want to be perverse and read it with your browser [html], go ahead.

After you have created and saved your work, you can also make conversions to other formats. The excellent open source ebook management tool called Calibre makes converting from one ebook format to another very easy. There are also on line tools for doing conversions. See the resources list at the end of this page.

Calibre Logo

Kindle and Mobi

Mobi is Kindle’s file storage system. The image below shows the file structure. It looks similar to the ePUB file structure we saw while looking in Sigil.

Mobi Files

What if I want to read an ebook on my computer?

I love to see these questions. Keep them coming.

Kindle-PC – [ Mac ] and Nook-PC – [ Mac ] applications are available for Mac and Windows along with iBook and Android devices like tablets and phones. Linux users can use the Kindle CloudReader, though you do need a Kindle account. Remember, most Kindle and Nook ebooks are encumbered with DRM.

The dawn of ebook availability was a while ago. The day has fully begun and the sun shines pretty brightly on us. Publishers of paper-based books are struggling to deal with it. Book stores are struggling. The Borders bookstore chain closed a couple of years ago.

Firefox has an extension which organizes and lets you read ePUB books right in your browser.

epub extension

Self Publishing

Writing is only one step. If you want to “publish” your options are wider today than ever before. You can go the way of famous authors and get an agent who will send your book to publishers, you’ll get involved with editors and contracts, etc. There are alternative paths available. A good place to start to understand the options for self publishing is the author J.A. Konrath who has successful experience with traditional publishing and doing it on his own.

Project Gutenberg
Getting DRM-free ebooks

gutenberg logo

A long time back, Project Gutenberg began converting out-of-copyright works from their paper format into digital text files. More recently the project has been converting the works to ebook formats, html and PDF. These works are often out of print, hard to get. But they are in the public domain, with their copyrights expired. The project is a service to all who love books, the reading part, not the physical tomes.

Electronic files like these ebooks can be legally downloaded to your computer and then can be easily transferred from your computer to a dedicated ebook reader like the Nook or Kindle. Check the manual of your device for the appropriate directions.

As an example of long fiction, here are screenshots of A Tale of Two Cities by Charles Dickens which is available in both ePUB (Nook) and Mobi (Kindle) formats.

Link to the book

Tale of Two Cities

ePUB file contents

This information was part of a presentation given at the NatickFOSS User Group, located in beautiful Natick, Massachusetts (Metrowest Boston). You are invited to attend.


Other Resources:
Online ePUB converter
Python Mobi Extraction Scripts

I’ve been hearing rumors about software that creates books from scratch in minutes. http://www.guardian.co.uk/education/2008/feb/05/highereducation.research1

I think I might have just gotten a SPAM comment which links back to a fake blog. That blog has just one post and no “About” text. To me, that indicates the blog and the person behind it are trying to spam this blog. Spam happens all the time and WordPress has a filter called Askimet that does a great job of catching the obvious spam.

Spam catching is a see-saw operation. Some always gets through and we who blog need to read those marginal comments to judge them. Fine.

Tell me what you think. Is this following a machine-written post?

If a woman is constantly scouring beauty aisles or reading up on the trendiest makeup tricks of the season, then this combination of cosmetics is just what she needs. Previously on Pretty Little Liars Season 1 Episode 12: Salt Meets Wound Hanna is released from the hospital, but confined to a wheelchair. When he brushes her off she asks him if it’s because he isn’t attracted to her. Moreover, make sure that you are choosing super entertainment facilities to watch this show. Finally, we get to the Homecoming dance and the Pretty Little Liars don’t really have an easy time of it right from the start. From the very beginning, Pretty Little Liars was a splashing success not to mention those who watched the episodes again and again online or any other means that allows us to watch the previous episodes. Someone to Watch Over Me is the title of episode 20 airing next week. Although she was very polite, there is something about her that sends a shiver down my spine.

I’m not going to tell you the address of the blog. I don’t want to support it. I didn’t quote the whole post. This is a transformative commentary whose intent is not to try to infringe on someone’s copyright.

The big question is: Will the machine writing improve to the point that it is hard to tell that it isn’t a human putting the whole composition together?

And, if it is that good, should we care?

For the record, the comment was:

Hello, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam feedback?
If so how do you prevent it, any plugin or anything you can recommend?
I get so much lately it’s driving me insane so any help is very much appreciated.

Now, tell me, has this person used WordPress for long?

JavaScript is a programming language that most people associate with dynamic Web pages. It is one component of the HTML5 development cycle.

document.write('JavaScript: My coding future!');

However, Javascript (as it is also sometimes written) isn’t a coder big deal like  C, C++, Java or even Python. I know. I’ve missed your favorite programming language.

But JavaScript is possibly becoming a bigger deal.

Two posts today suggest that you might want to point your students to learning JavaScript soon.

Healthcare programming is a field of both now and the near future. Node.js is being integrated with the healthcare database/programming language called M.
http://opensource.com/education/13/1/nodejs-nosql-m-healthcare-it

The Gnome FOSS desktop team has just made JavaScript its first-class language.
http://www.zdnet.com/writing-a-gnome-app-do-it-in-javascript-say-developers-7000010826/

What curriculum do your Computer Science classes use? Does it currently include the JavaScript language?

Maybe it should. Remember. You aren’t teaching students for the programming jobs of today. Look to tomorrow.

I love my GUI interface on Kubuntu. I love to listen to music with Audacity as I plunk around making clipart or writing or learning to code in Python. A computer is a big part of my life.

Sonar Project Logo

Jonathan Nadeau is blind. He’s also the guy behind Northeast LinuxFest. He  is also working to develop a FOSS distribution specifically directed to making it easier to use a computer for people with impaired vision and any other impairment, actually. Computers are a big part of his life, but the GUI that is fun for me doesn’t help him much. He needs accessibility software like a screen reader that really works.  Jonathan writes:

It’s true that there is proprietary accessible software to help blind and low vision people access a computer, but the average cost of this software is around $900. Since 90% of blind and low vision people live in developing countries, how are they supposed to afford this?

One answer is using the power of the community. There are great coders out there. They love contributing their skill and they are doing so. Jonathan is trying to put together a really great distribution targeting the needs of those with any disability that limits their access to computer power. The Sonar Project is that distribution.

There is a lot of work needed to organize, build, expand and deliver a FOSS distribution. FOSS may be based on Free Software, but the work takes away from other jobs that pay. Burning CDs, printing manuals, all that sort of thing takes more than dedication, too.

Jonathan has started an Indigogo campaign to raise $20,000. Please consider supporting the effort. http://www.indiegogo.com/sonar

sonar

You may have students in your school, or even children of your own who would benefit from a FOSS distribution that serves them.

FOSS projects depend on a strong, dedicated, vibrant and supporting community. Even if you are not a coder, you can be involved, and you can make a difference.

By the way, if you are going to the Northeast LinuxFest this spring, stop by to say hello. I’ll be at the KDE table.

 

For those looking at block-based programming experiences, especially for younger students, Alfred Thompson gives an excellent review of several tools.

 

http://blog.acthompson.net/2012/12/programming-with-blocks.html

Oh, some of you thought I meant LEGO…not this time.