|
||||
Home
| Products & Projects | Downloads
| FAQs | News Archive
| Feedback | Forums
| Site Map | Search
| The Fool
|
||||
Fun Scripts and Programs Language: PHP Many students and instructors of the Chinese language
have a need to display pinyin with tone marks in their documents. A number
of fonts have been created for PC and Macintosh which allow the easy input
of pinyin (for example, Easytone by James Dew). I developed a Macintosh
application to convert documents between many of these fonts called Pinyin
Font Converter. With the growth of Unicode's popularity and the ease
with which users can now display unicode, especially in their browsers,
many of us want to produce pinyin with tones in unicode. Installation: Download the script. The script contains a function which does the conversion. Below this is some code used by my site to output the results, you will need to customize this according to your own needs.
Language: Perl With scripting languages such as PHP, ASP, JSP, ColdFusion, etc. it is easy to create web page templates. You have a header file, the web page itself, and a footer file. You put the three together and build your site. Later, when you want to change the header/footer on every page of your site, you simply change one file. You can do this with JavaScript too, which allows you to use simple HTML files for your pages. JavaScript calls the header file as an external script (for example header.js). You simply wrap a header html file with print.document(""). I wrote this really simple perl script to wrap a header.html and footer.html files in this JavaScript statement for easy conversion between an HTML and a JavaScript header. Installation: Download the script. Change the name from template.txt to template.pl (at the command line this might be mv template.txt template.pl). Usage: Put the header.html and footer.html files (or one or the other) into the same directory as the template.pl file. Run the template.pl script from the command line and a header.js and footer.js files will be created. To run the script, you may have to add the execute permission (for example chmod +x template.pl) and indicate the script as being in the current directory (for example ./template.pl). This script has only been tested on Linux and Mac OS X. |
||||
|