French Cheat Sheet – une antisèche pour la langue française

Today I created a cheat sheet for French. I looked on the Internet for a French cheat sheet but I did not find exactly what I was looking for. Most of the French cheat sheets are only good for tourists because they just give you the basic phrases. If you are serious about learning the language, you need to master the grammar so a cheat sheet should show you how to conjugate the verbs. I designed my cheat sheet to look like the cheat sheets that are available for HTML, CSS, JavaScript, and other information technology topics. You can find those kinds of cheat sheets at http://www.addedbytes.com/cheat-sheets/.

Although I’m learning French for personal reasons, the web is a global community so this does relate to my profession. A business can expand beyond the local market by communicating with the French, the Germans, and other nationalities. I’ve been interacting with a lot of people from other countries through YouTube and Vloggerheads; mostly Brits, Canadians, and Australians but also a few Germans, one Croatian, one Greek, and expats living in French but no actual French native. The Elgg social networking developer community is also international and I have to keep that in mind when I develop my plugins. When I released my weather widget I got some feedback suggesting that I create an international version that supports temperatures in Celsius and the weather in other countries. I had to find a source of international weather, the Weather Underground, instead of using the National Weather Service.

I have not mastered the French language yet, but I can now comprehend a great deal of the text on French web sites. This opens up a whole new world of information, culture, and news. I can watch French TV on YouTube (mostly news reports) and listen to French radio stations through streaming audio feeds. Unfortunately I still cannot understand a word of spoken French so I’ll probably spend more time lurking on French message boards.

C’est une antisèche pour la langue française! Il est basé sur les nombreuses feuilles de référence (antisèches) qui sont disponibles pour des sujets technologiques comme le HTML, CSS, etc. Bien qu’il y ait beaucoup de ressources en ligne pour apprendre le français, j’étais incapable de trouver une feuille de référence (une antisèche) convenable. Il y a quelques-uns qui se concentrent sur les expressions de base qui sont excellentes pour des touristes, mais si vous voulez vraiment apprendre la langue vous devriez étudier la grammaire française.

Faites-moi savoir si vous trouvez des fautes d’orthographe ou autres erreurs.

Posted in French | Tagged , , , | 9 Comments

Reading French – J’apprends à lire le français

I have a lot of time on my hands so I’m learning French. My goal is to learn how to read French so I can read French books. I’m not studying pronunciation or developing listening skills. For now, I’m just studying grammar and building my vocabulary. I have a lot of French language textbooks and audio tapes (actually CDs) but I’m not interested in conversational French so instead I’ve read numerous books that concentrate more on grammar and vocabulary. So far, I have read the following books:

  1. McGraw-Hill French Rencontres (old high school textbook)
  2. The Complete Idiot’s Guide To Learning French
  3. French For Dummies
  4. Essential French Grammar

Currently I’m reading Teach Yourself French In 24 Hours. This book is really filling in a lot of details on French grammar that were not covered in the other books. I should finish reading this book in a week. When I am done reading this book I should know everything you need to know about French grammar. I have not memorized anything but at least I’ve been exposed to every aspect of the language. Memorization is only really necessary to pass tests. In the real world, I prefer to get repetition by reading multiple books on a subject that interests me.

I have created a help file to organize my notes on French. I currently have 127 pages in this help file. A few audio files are built into the help file to help me with pronunciation, but most of it is notes on French grammar and vocabulary lists.

After I finish Teach Yourself French In 24 Hours, I will read three French textbooks published by Harcourt Brace Jovanovich; Nouveaux copains, Nous, les jeunes, and Notre monde. These textbooks were published in the early 1990s. Most of the text is in French which is why I saved these for later. They should give me a lot of practice in reading simple French. I may also use the workbooks Cahier d’Exercices which are available for each book, although I only have two. I also have the Nouveaux Copains Teacher’s Edition with all the answers to the exercises.

Nouveaux-compains400x500 Nous-les-jeunes400x500 Notre-monde400x500

After I read those three books, I’ll move on to Skills and Techniques for Reading French by Louise C. Seibert and Lester G. Crocker. This book is specifically designed to help you learn how to read French.

I expect to be able to read French fairly well after that, but I still have many more French textbooks that I could read to reinforce the material. At the moment, I can sort of half read the news on French web sites.

Posted in French | Tagged , , , | 3 Comments

Elgg 1.6 – International Weather Widget

I have created a new Elgg widget to display your local weather on your profile page or the dashboard. In response to suggestions from Elgg users I have revised this widget to support International locations. You can download the plugin for this widget at: http://community.elgg.org/pg/plugins/rsrobbins/read/255213/international-weather-widget

This is probably the last Elgg project I will work on for awhile. I have to get back to paying work. Pennsylvania has yet to pass a budget so I’m still laid off but my unemployment is covering my bills.

Posted in Elgg, PHP, Programming, Web | Tagged , , , | Leave a comment

Elgg 1.6 Threaded Blog Comments

Elgg 1.6 has been released and I’ve created a new version of my threaded comment system to work with the current version. You can download the latest plugin at http://community.elgg.org/pg/plugins/rsrobbins/read/242714/threaded-blog-comments-elgg-16. I made a few improvements while working on the new version. All of the JavaScript is now stored within the module to make installation easier. I also added some support for other languages. I created a compiled help file and a readme.txt file to document my work.

Amazon now requires web service requests to be authenticated. This has broken my Amazon Wish List widget for Elgg 1.5. I will have to completely rework that widget using a different method. My AJAX example on this web site is also broken. I won’t be able to create a purely JavaScript version because you have to perform some encryption to sign your request and JavaScript cannot handle that. I will have to make it dependent upon some server side code running on my web site.

Posted in Elgg, Programming, Web | Tagged , , , | 1 Comment

Elgg 1.5 Widget – Amazon Wish List

Yesterday I upgraded my Amazon Wish List widget for Elgg 1.5. You can download it at http://community.elgg.org/pg/plugins/rsrobbins/read/230079/amazon-wish-list-widget Now that I’ve finally completed my work on the threaded comments for Elgg 1.2 it is time to move on to Elgg 1.5 and upgrading my Amazon Wish List widget was the first step. This widget follows the Elgg best practices more closely than the previous version. I even moved the jquery-flydom-3.1.1.js file into the widget’s mod folder to simplify the installation. The CSS has been moved into the css.php file in the views folder and several strings are now specified in the en.php file so you can more easily create other language files. Now that I’m learning German I’ll want to install a German language pack to my Elgg development site.

Elgg Amazon Wish List Widget

I’m spending a lot of time on Elgg because I’ve seen more interest in customization work on Elgg than anything else. Hopefully I can pick up some new clients doing Elgg customization. Also, my expertise level is higher for this open source web application than it is for any other, with the possible exception of WordPress.

Posted in Elgg, Programming, Vlogging | Tagged , | 1 Comment

Elgg Threaded Blog Comments

I have finally finished my work on a threaded comment system for Elgg 1.2. You can download the plugin at http://community.elgg.org/pg/plugins/rsrobbins/read/228544/threaded-blog-comments This must completely replace the existing blog plugin because the change from an annotation comment to an ElggObject comment is more extensive than a view can handle. But I tried to follow the Elgg way of doing things as much as possible.

The Threaded Blog Comments plugin allows you to reply to a specific blog comment so you can create comment threads without using some hack like the @ ampersand sign (made popular by Twitter). A comment that is a reply to a previous comment will appear underneath and indented. This makes it much easier to have a conversation in the comments. In addition to the nesting of comments, I also added pagination controls for comments which was not a feature of the original comment system.

Much of this work is based on the similar customization I did for Ning before they killed their platform for third party developers. And prior to that I developed this style of nested comments for YouTube videos using the YouTube API which you can see at http://www.williamsportwebdeveloper.com/YouComment.aspx. The legacy of this prior work is that the Elgg version still uses a XML feed. So you also get a RSS feed for a blog’s comments as a bonus.

If I don’t go back to work any time soon, I’ll work on applying this customization to Elgg 1.5. I will also see about implementing nested comments for other types of content besides blogs.

Posted in Elgg, PHP, Programming, Web | Tagged , , | Leave a comment

Vista’s Virtual Store Bites Me In The Ass

I’ve been working on my blog comment threading modification of Elgg for the last few days. As I was copying my files to my iBook to test my instructions on how to implement the changes, I noticed something weird. When I opened a PHP file in my code editor I would see the current code. But when I copied to file to a new folder and opened it in my editor I would see an old version of the code. This caused me several problems as I implemented the changes to the copy of Elgg running on my iBook.

I was very confused! I would see different code depending on where the file was located. After posting a question on Stack Overflow I finally learned what was causing the problem. Vista has something known as the Virtual Store which it uses to store files in order to pretend a user has permission to write files to protected locations like “Program Files”. I have Apache 2 installed under “Program Files”. My web sites are located under C:\Program Files\Apache Group\Apache2\htdocs. So when I edited my PHP files a few would be copied to the Virtual Store because I did not have permission to edit files under “Program Files”.

One clue to the problem that you can watch out for is the Compatibility Files button that will appear in Windows Explorer when the folder has files in the Virtual Store:

Vista-Virtual-Store

To solve this problem give your user account full permissions to your Elgg web site directory under “Program Files” and keep an eye on the Virtual Store to make sure none of the files you are working on are coming from there.

Vista sucks! This caused me considerable confusion and many problems. I should send Microsoft a bill for the time and money it cost me.

Posted in Elgg, General, PHP, Programming | Tagged , , | 1 Comment

6 Ways To Work With Dates In JavaScript

Yesterday I added another AJAX demonstration to my web site using the Reddit API. http://www.williamsportwebdeveloper.com/reddit.html The reddit API provides dates in the UTC number format which forced me to spend some time figuring out how to convert it into other date formats. Since I frequently deal with different date formats in JavaScript I decided to do some research on the topic and add a cheatsheet to my notes. I might as well share it with you because I don’t share this kind of knowledge often enough.

Get Current Date/Time

The first example just shows you how to get the current date and time. Note that this can vary slightly depending upon the browser. Also, it does not factor in your time zone.

   1: function fnNow() {
   2:     var now = new Date();
   3:     alert(now);
   4: }
Thu Aug 6 22:49:52 EDT 2009 
Thu Aug 06 2009 19:43:34 GMT-0400 (Eastern Daylight Time)

UTC (Coordinated Universal Time) String

This example gets the date and time in a slightly different string format.

   1: function fnUTCString() {
   2:     var now = new Date();
   3:     alert(now.toUTCString());
   4: }
Thu, 6 Aug 2009 22:49:52 UTC 
Thu, 06 Aug 2009 23:44:14 GMT

UTC (Coordinated Universal Time) Number

The UTC() method takes a date and returns the number of milliseconds since midnight of January 1, 1970 according to universal time. 10 to 13 digits, last 3 digits for miliseconds.

Syntax: Date.UTC(year,month,day,hours,minutes,seconds,ms)

   1: function fnUTC() {
   2:     var now = new Date();
   3:     var d = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
   4:     alert(d);
   5: }

The example above converts a UTC date in the numerical format, 1249585988774, into the string format. This is what I needed to work with the Reddit API.

1249585988774

ISO 8601

ISO 8601. Note that the “T” appears literally in the string, to indicate the beginning of the time element. Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator (“Z”). Used in ATOM RSS feeds.

   1: function fnISO() {
   2:     // Only works in Firefox using ECMAScript 5
   3:     var now = new Date().toISOString();
   4:     alert(now);
   5: }

As noted in the code comment above, ECMAScript 5 will support the toISOString() method. Firefox 3.5 appears to be the only browser with a JavaScript engine that has this method for the Date object. This will make it easier to convert dates into the proper format for RSS feeds.

2009-08-06T23:36:31.390Z

UTC Number To JavaScript Date

In the following sample code, I finally factor in my time zone and convert an UTC date in the numerical format into a regular JavaScript Date object.

   1: function fnUTC2Date() {
   2:     var now = new Date();
   3:     var d = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
   4:     // obtain local UTC offset and convert to msec
   5:     localOffset = now.getTimezoneOffset() * 60000;
   6:     var c = new Date(d + localOffset);
   7:     alert(c.toLocaleString());
   8: }

JavaScript Date To ISO8601

Since the toISOString() method is not available for Internet Explorer yet you will need to reformat a date into the ISO 8601 format yourself. The following code is just one way to accomplish this:

   1: function padzero(n) {
   2:     return n < 10 ? '0' + n : n;
   3: }
   4: function pad2zeros(n) {
   5:     if (n < 100) {
   6:         n = '0' + n;
   7:     }
   8:     if (n < 10) {
   9:         n = '0' + n;
  10:     }
  11:     return n;
  12: }
  13: function toISOString(d) {
  14:     return d.getUTCFullYear() + '-' +  padzero(d.getUTCMonth() + 1) + '-' + padzero(d.getUTCDate()) + 'T' + padzero(d.getUTCHours()) + ':' +  padzero(d.getUTCMinutes()) + ':' + padzero(d.getUTCSeconds()) + '.' + pad2zeros(d.getUTCMilliseconds()) + 'Z';
  15: }
  16: function fnToISO() {
  17:     var now = new Date();
  18:     alert(toISOString(now));
  19: }
Posted in General, JavaScript, Programming | Tagged , , , | 12 Comments

Elgg And Zen Cart

Pennsylvania still has not passed a budget so I continue to work on my web development skill set. Currently I plan to focus on Elgg and Zen Cart. Zen Cart is a new web application for me. I think it is being maintained more than OsCommerce so there are probably more web sites using that shopping cart. My web hosting company supports Zen Cart so I may eventually put up a demo store to sell my old technology books.

I have resumed my work on threaded comments for Elgg blogs. Yesterday I revised my comment RSS feed to sort the comments for a threaded discussion and then I created a test page to display the comments as a thread of nested comments, with replies appearing under the original comment. Now all I need to do is put everything together into its final form.

After I complete the threaded comments I will spend some more time exploring Elgg 1.5.

Now that I have a lot of free time, there are various other things I’m doing to keep busy. I will be making more YouTube videos after I figure out the best method of editing videos on my new system. I never got around to installing my synthesizer software or much video editing software. I have a lot of video from my traveling to use as raw footage.

I also plan to create some Vista Gadgets, write an AJAX page using the reddit API, and continue to study French and German. Yesterday I finally finished adding all the material from a book on essential French grammar to my notes so I’ve been exposed to every aspect of French grammar.

Now is not the time to relax or take a vacation because I fear the Pennsylvania state budget could impose severe budget cuts leaving my permanently laid off.

Posted in Business, PHP, Programming, Web | Tagged , | Leave a comment

Brothel Locator Web Service In COBOL

My last article on How To Create A JSON Web Service in ASP.NET did not attract much interest so it is time to step it up a notch. To make this article more interesting I’m going to create a new web service in Fujitsu NetCOBOL. As far as I know, there are no examples on the Internet on how to do anything meaningful with the .NET Framework using the COBOL language. Although you can use many programming languages with .NET nobody really uses anything other than C# and VB.NET.

Let’s suppose your company has senior management who often travel to Germany. Most of your expertise is in the COBOL programming language because the company has been using COBOL for years. And lets assume any new work must be done in COBOL as well to maintain the corporate IT culture. The executive puts in a request for a web service to help him find brothels while in Germany. You already have a web service that supplies him with client addresses from a contact database. He can’t easily find information on brothels in Germany because he does not read German so you’ll be maintaining a database of their locations.

Below is the database schema that we will be using for a database named Laufhaus with one table named ErosCenters:

column_name data_type numeric_precision character_maximum_length is_nullable column_default
ID int 10   NO  
BrothelName nvarchar   255 YES  
Street nvarchar   255 YES  
City nvarchar   255 YES  
PostalCode nvarchar   6 YES  
Phone nvarchar   25 YES  
Link nvarchar   255 YES  
Latitude nvarchar   50 YES  
Longitude nvarchar   50 YES  

Fujitsu NetCOBOL supplies an utility program which will add the necessary XML nodes to your web.config file for the database connection. This program will error until you run another utility program to update the machine.config. This was not well documented. Run the following command first: C:\Program Files\Common Files\Fujitsu NetCOBOL for .NET Runtime V3.0\Runtime\x86>setupconfig.exe /install

This will add the following section to your web.config file:

   1: <fujitsu.cobol>
   2:     <runtime>
   3:         <sqlSettings>
   4:             <connectionScope>
   5:                 <add key="@SQL_CONNECTION_SCOPE" value="APPLICATION_DOMAIN" />
   6:             </connectionScope>
   7:             <serverList>
   8:                 <server name="SERVER1" type="adonet" description="SERVER1">
   9:                     <add key="@SQL_DATASRC" value="LocalSqlServer" />
  10:                     <add key="@SQL_USERID" value="sa" />
  11:                     <add key="@SQL_PASSWORD" value="HIFDOBLHCFAPANBFLOJCNNMLDDHO" />
  12:                 </server>
  13:             </serverList>
  14:             <sqlDefaultInf>
  15:                 <add key="@SQL_DATASRC" value="LocalSqlServer" />
  16:                 <add key="@SQL_USERID" value="sa" />
  17:                 <add key="@SQL_PASSWORD" value="HIFDOBLHCFAPANBFLOJCNNMLDDHO" />
  18:             </sqlDefaultInf>
  19:         </sqlSettings>
  20:     </runtime>
  21: </fujitsu.cobol>

You can create a ASP.NET web service using COBOL as the language. It took me hours of experimentation to figure out how to turn a simple “Hello World” demo program into an actual web service. I had to work through how to make the database connection, how to return XML instead of a string, how to return multiple records, how to create an .NET object within COBOL, and how to call an object method. It was a hell of a lot of fun though to work in COBOL. As you can see this program is far more wordy than an equivalent program in C# would be.

   1: IDENTIFICATION DIVISION.
   2: CLASS-ID. CLASS-THIS AS "Service" INHERITS CLASS-WEBSERVICE
   3:     CUSTOM-ATTRIBUTE CA-WEBSERVICE CA-WEBSERVICEBINDING.
   4: ENVIRONMENT DIVISION.
   5: CONFIGURATION SECTION.
   6: SPECIAL-NAMES.
   7:     CUSTOM-ATTRIBUTE CA-WEBSERVICE
   8:       CLASS CLASS-WEBSERVICEATTRIBUTE
   9:       PROPERTY PROP-NAMESPACE IS N"http://www.williamsportwebdeveloper.com"
  10:     CUSTOM-ATTRIBUTE CA-WEBSERVICEBINDING
  11:       CLASS CLASS-WEBSERVICEBINDINGATTR
  12:       PROPERTY PROP-CONFORMSTO IS PROP-BASICPROFILE1_1 OF ENUM-WSIPROFILES
  13:     CUSTOM-ATTRIBUTE CA-WEBMETHOD
  14:       CLASS CLASS-WEBMETHODATTRIBUTE
  15:     .
  16: REPOSITORY.
  17:     CLASS CLASS-STRING AS "System.String"
  18:     CLASS CLASS-WEBMETHODATTRIBUTE AS "System.Web.Services.WebMethodAttribute"
  19:     CLASS CLASS-WEBSERVICE AS "System.Web.Services.WebService"
  20:     CLASS CLASS-WEBSERVICEATTRIBUTE AS "System.Web.Services.WebServiceAttribute"
  21:     CLASS CLASS-WEBSERVICEBINDINGATTR AS "System.Web.Services.WebServiceBindingAttribute"
  22:     CLASS CLASS-SQLPROCEDURE AS "Microsoft.SqlServer.Server.SqlProcedureAttribute"
  23:     CLASS CLASS-XML AS "System.Xml.XmlDocument"
  24:     CLASS CLASS-STRING-BUILDER AS "System.Text.StringBuilder"
  25:     ENUM ENUM-WSIPROFILES AS "System.Web.Services.WsiProfiles"
  26:     PROPERTY PROP-BASICPROFILE1_1 AS "BasicProfile1_1"
  27:     PROPERTY PROP-CONFORMSTO AS "ConformsTo"
  28:     PROPERTY PROP-NAMESPACE AS "Namespace"
  29:     .
  30: OBJECT.
  31: DATA DIVISION.
  32: WORKING-STORAGE SECTION.
  33: 01 MSG                  PIC X(1200).
  34: 01 WK-BROTHEL-NAME      PIC X(255).
  35: 01 WK-STREET            PIC X(255).
  36: 01 WK-CITY              PIC X(255).
  37: 01 WK-POSTAL-CODE       PIC X(6).
  38: 01 WK-PHONE             PIC X(255).
  39: 01 WK-LINK              PIC X(255).
  40: 01 WK-LATITUDE          PIC X(50).
  41: 01 WK-LONGITUDE         PIC X(50).
  42: 01 WK-STRING            OBJECT REFERENCE CLASS-STRING.
  43: 01 WK-STRING-BUILDER    OBJECT REFERENCE CLASS-STRING-BUILDER.
  44: PROCEDURE DIVISION.
  45:
  46: METHOD-ID. NEW.
  47: PROCEDURE DIVISION.
  48:     *> Uncomment the following line if using designed components.
  49:     *> INVOKE SELF "InitializeComponent".
  50: END METHOD NEW.
  51:
  52: METHOD-ID. GET-BROTHELS AS "GetBrothels" CUSTOM-ATTRIBUTE CA-WEBMETHOD.
  53: DATA DIVISION.
  54: WORKING-STORAGE SECTION.
  55: *> There must be enough fields for the number of columns.
  56:     EXEC SQL BEGIN DECLARE SECTION END-EXEC.
  57: 01 BROTHEL-LIST.
  58:   02 BROTHEL-NAME           PIC X(255).
  59:   02 STREET                 PIC X(255).
  60:   02 CITY                   PIC X(255).
  61:   02 POSTAL-CODE            PIC X(6).
  62:     02 PHONE                  PIC X(25).
  63:     02 LINK                   PIC X(255).
  64:     02 LATITUDE               PIC X(50).
  65:     02 LONGITUDE              PIC X(50).
  66: 01 NUMBER-OF-RECORDS    PIC S9(9) COMP-5.
  67: 01 SQLINFOA.
  68:     02 SQLERRD              PIC S9(9) COMP-5 OCCURS 6 TIMES.
  69: 01 SQLSTATE                 PIC X(5).
  70:     EXEC SQL END DECLARE SECTION END-EXEC.
  71: LINKAGE SECTION.
  72: 01 RET-VAL OBJECT REFERENCE CLASS-STRING.
  73: 01 RET-VAL-XML OBJECT REFERENCE CLASS-XML.
  74: PROCEDURE DIVISION RETURNING RET-VAL-XML.
  75:     EXEC SQL WHENEVER NOT FOUND GO TO :P-END END-EXEC.
  76:     EXEC SQL
  77:       DECLARE CUR1 CURSOR FOR SELECT BrothelName, Street, City, PostalCode, Phone, Link, Latitude, Longitude FROM ErosCenters
  78:     END-EXEC.
  79:  P-START.
  80:     EXEC SQL CONNECT TO 'SERVER1' AS 'CNN1' END-EXEC.
  81:     EXEC SQL
  82:          SELECT COUNT(*) INTO :NUMBER-OF-RECORDS FROM ErosCenters
  83:     END-EXEC.
  84:     EXEC SQL OPEN CUR1 END-EXEC.
  85:     *> CREATE AN STRING BUILDER OBJECT
  86:     INVOKE CLASS-STRING-BUILDER "NEW" RETURNING WK-STRING-BUILDER.
  87:     *> CALL THE OBJECT METHOD
  88:     SET WK-STRING TO "<ErosCenters>"
  89:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
  90:     PERFORM P-LOOP NUMBER-OF-RECORDS TIMES.
  91:  P-LOOP.
  92:     EXEC SQL
  93:         FETCH CUR1 INTO :BROTHEL-LIST
  94:     END-EXEC.
  95:     *> MOVE SQLERRD(3) TO MSG.
  96:     *> MOVE BROTHEL-LIST TO MSG.
  97:     MOVE BROTHEL-NAME TO WK-BROTHEL-NAME.
  98:     MOVE STREET TO WK-STREET.
  99:     MOVE CITY TO WK-CITY.
 100:     MOVE POSTAL-CODE TO WK-POSTAL-CODE.
 101:     MOVE PHONE TO WK-PHONE.
 102:     MOVE LINK TO WK-LINK.
 103:     MOVE LATITUDE TO WK-LATITUDE.
 104:     MOVE LONGITUDE TO WK-LONGITUDE.
 105:     *> CONSTRUCT XML STRING
 106:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Brothel><Name>" WK-BROTHEL-NAME N"</Name>").
 107:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 108:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Street>" WK-STREET N"</Street>").
 109:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 110:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<City>" WK-CITY N"</City>").
 111:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 112:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<PostalCode>" WK-POSTAL-CODE N"</PostalCode>").
 113:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 114:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Phone>" WK-PHONE N"</Phone>").
 115:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 116:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Link>" WK-LINK N"</Link>").
 117:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 118:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Latitude>" WK-LATITUDE N"</Latitude>").
 119:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 120:     SET WK-STRING TO CLASS-STRING::"Concat"(N"<Longitude>" WK-LONGITUDE N"</Longitude></Brothel>").
 121:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 122:  P-END.
 123:     SET WK-STRING TO "</ErosCenters>"
 124:     INVOKE WK-STRING-BUILDER "Append" USING BY VALUE WK-STRING.
 125:     EXEC SQL CLOSE CUR1 END-EXEC.
 126:     EXEC SQL ROLLBACK WORK END-EXEC.
 127:     EXEC SQL DISCONNECT DEFAULT END-EXEC.
 128:     *> INVOKE SELF "GetData" .
 129:     *> CREATE AN XMLDOCUMENT OBJECT
 130:     INVOKE CLASS-XML "NEW" RETURNING RET-VAL-XML.
 131:     *> CALL THE OBJECT METHOD
 132:     SET WK-STRING TO WK-STRING-BUILDER::"ToString".
 133:     INVOKE RET-VAL-XML "LoadXml" USING BY VALUE WK-STRING.
 134: END METHOD GET-BROTHELS.
 135:
 136: METHOD-ID. GET-DATA AS "GetData".
 137: PROCEDURE DIVISION.
 138:     MOVE "Hello" & " World" TO MSG.
 139: END METHOD GET-DATA.
 140:
 141: END OBJECT.
 142: END CLASS CLASS-THIS.

Instead of a C# using namespace, you must alias a class in the REPOSITORY section. You define your string variables in the WORKING-STORAGE SECTION. Line 80 is where the database connection is being made. Then there is a query to determine how many records there are which tells you how many times to perform a routine. The database fields are moved to working storage strings which are then concatenated with XML tags. As you can see, just getting COBOL to build a string is hard work. A XmlDocument is created on line 130 and its LoadXml method is called to load the string that was built. This is what the web service returns.

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <ErosCenters>
   3:   <Brothel>
   4:     <Name>Laufhaus Vitalia</Name>
   5:     <Street>Helene-Wessel-Bogen 16</Street>
   6:     <City>Munich</City>
   7:     <PostalCode>80939</PostalCode>
   8:     <Phone>+49 (0) 89 35818865</Phone>
   9:     <Link>http://www.laufhaus-vitalia.de</Link>
  10:     <Latitude>48.197147</Latitude>
  11:     <Longitude>11.592529</Longitude>
  12:   </Brothel>
  13:   <Brothel>
  14:     <Name>Maison d'envie</Name>
  15:     <Street>Danziger Strasse 61</Street>
  16:     <City>Berlin</City>
  17:     <PostalCode>10435</PostalCode>
  18:     <Phone>030 417 259 20</Phone>
  19:     <Link>http://www.danziger61.de</Link>
  20:     <Latitude>52.540201</Latitude>
  21:     <Longitude>13.422267</Longitude>
  22:   </Brothel>
  23:   <Brothel>
  24:     <Name>Laufhaus Eros</Name>
  25:     <Street>Ulmer Strasse 16</Street>
  26:     <City>Goppingen</City>
  27:     <PostalCode>73107</PostalCode>
  28:     <Phone>07161-50 60 180</Phone>
  29:     <Link>http://wwwlaufhaus-eros.de</Link>
  30:     <Latitude>48.699458</Latitude>
  31:     <Longitude>9.663935</Longitude>
  32:   </Brothel>
  33: </ErosCenters>

I’ve used Eiffel for the .NET Framework but I would prefer COBOL since it can be used with the .NET Framework 2.0 and Visual Studio 2005. I learned COBOL in community college but never got the chance to use it professionally.

Please note that the brothel locator web service is intended as a joke. I just thought it would entice programmers to check out COBOL for the .NET Framework. My serious articles are often ignored. Nobody has actually requested this web service and it will not be used. It was purely a programming exercise. The nature of the data in the database is unimportant compared to the interesting choice of programming language and the technical challenge of making this work in COBOL.

Posted in ASP.NET, COBOL, Programming | Tagged , , , , | 5 Comments

How To Create A JSON Web Service In ASP.NET

ASP.NET makes it easy to create web services but they usually return XML. Like many web developers I now prefer JSON. This article and sample code will show you how to get your web service to return data in the JSON format. The web service is written in C#. Since my web hosting company only provides me with a MySQL database, we’ll make this project a little more challenging by pulling data from a MySQL database. Finally, I will show you how to use jQuery to call your web service. So you get three kinds of value from this article; a web service in C# to return JSON data, how to use a MySQL database, and how to call an ASP.NET web service using jQuery. None of those three tasks are very intuitive or simple when using ASP.NET because they all go against the framework conventions.

The first task to tackle is connecting to the MySQL database. ASP.NET is usually used with SQL Server or SQL Server Express so using MySQL is not always easy. On my local development web server I downloaded the MySQL Connector/ODBC 5.1 from http://dev.mysql.com/downloads/connector/odbc/5.1.html. Then my web.config file merely needed a connection string node:

   1: <connectionStrings>
   2:         <add name="Books" connectionString="Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=books;uid=root;pwd=password;option=3;" providerName="System.Data.Odbc"/>
   3: </connectionStrings>

NOTE: This is not my real password and there is no external access to MySQL server running on my development server.

For this demonstration, I am using a simple database I use to keep track of the books I read. It has a single table “reading” which has only three columns; BookNum, Title, Author. I don’t know if CrystalTech has the MySQL ODBC driver installed, but I was able to create a datasource name using the control panel so the connection string used a “dsn=books” instead of the driver.

The C# code for the web service at http://www.williamsportwebdeveloper.com/BookServices.asmx shows you how an ODBC connection is used to query the MySQL database. What you should notice in the code is that various method attributes are used on the web service class and methods. These method attributes require the System.Web.Script reference. If you get an error concerning missing assemblies then make sure your web.config file has everything it needs for an AJAX enabled ASP.NET site. As you can see, there is a ScriptMethod method attribute that specifies JSON as the response format. The tricky part is converting a dataset into a JSON string. I used a jagged array to accomplish that because it will serialize properly. That is probably the most valuable tip in this entire article.

   1: using System;
   2: using System.Web;
   3: using System.Collections;
   4: using System.Web.Services;
   5: using System.Web.Services.Protocols;
   6: using System.Data;
   7: using System.Data.Odbc;
   8: using System.Web.Script.Serialization;
   9: using System.Web.Script.Services;
  10:
  11: /// <summary>
  12: /// Web services to query the book database. All methods return JSON data.
  13: /// </summary>
  14: [WebService(Description = "Web services to query the book database.", Namespace = "http://www.williamsportwebdeveloper.com/")]
  15: [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  16: [ScriptService]
  17: public class BookServices : System.Web.Services.WebService {
  18:
  19:     public BookServices () {
  20:
  21:         //Uncomment the following line if using designed components 
  22:         //InitializeComponent(); 
  23:     }
  24:
  25:     [WebMethod(Description = "Gets the books matching part of a title.")]
  26:     [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  27:     public string GetBooksByTitle(string strTitle) {
  28:         OdbcConnection objConnection = new OdbcConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Books"].ConnectionString);
  29:         OdbcCommand objCommand = new OdbcCommand("SELECT * FROM reading WHERE Title LIKE '%" + strTitle + "%' ORDER BY BookNum;", objConnection);
  30:         DataSet objDataSet = new DataSet();
  31:         OdbcDataAdapter objDataAdapter = new OdbcDataAdapter(objCommand);
  32:         objDataAdapter.Fill(objDataSet, "reading");
  33:         objConnection.Close();
  34:
  35:         // Create a multidimensional jagged array
  36:         string[][] JaggedArray = new string[objDataSet.Tables[0].Rows.Count][];
  37:         int i = 0;
  38:         foreach (DataRow rs in objDataSet.Tables[0].Rows)
  39:         {
  40:             JaggedArray[i] = new string[] { rs["BookNum"].ToString(), rs["Title"].ToString(), rs["Author"].ToString() };
  41:             i = i + 1;
  42:         }
  43:
  44:         // Return JSON data
  45:         JavaScriptSerializer js = new JavaScriptSerializer();
  46:         string strJSON = js.Serialize(JaggedArray);
  47:         return strJSON;
  48:     }
  49:
  50:     [WebMethod(Description = "Gets the books matching part of an author's name.")]
  51:     [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  52:     public string GetBooksByAuthor(string strAuthor)
  53:     {
  54:         OdbcConnection objConnection = new OdbcConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Books"].ConnectionString);
  55:         OdbcCommand objCommand = new OdbcCommand("SELECT * FROM reading WHERE Author LIKE '%" + strAuthor + "%' ORDER BY BookNum;", objConnection);
  56:         DataSet objDataSet = new DataSet();
  57:         OdbcDataAdapter objDataAdapter = new OdbcDataAdapter(objCommand);
  58:         objDataAdapter.Fill(objDataSet, "reading");
  59:         objConnection.Close();
  60:
  61:         // Create a multidimensional jagged array
  62:         string[][] JaggedArray = new string[objDataSet.Tables[0].Rows.Count][];
  63:         int i = 0;
  64:         foreach (DataRow rs in objDataSet.Tables[0].Rows)
  65:         {
  66:             JaggedArray[i] = new string[] { rs["BookNum"].ToString(), rs["Title"].ToString(), rs["Author"].ToString() };
  67:             i = i + 1;
  68:         }
  69:
  70:         // Return JSON data
  71:         JavaScriptSerializer js = new JavaScriptSerializer();
  72:         string strJSON = js.Serialize(JaggedArray);
  73:         return strJSON;
  74:     }
  75:
  76: }

At this point you have a web service that queries a MySQL database and returns records as JSON data. This is extremely useful if you want to use that data on your home page without making it an ASP.NET page. You can get the data using AJAX and avoid having your home page show an error should your ASP.NET web application develop a problem. Next I will show you the JavaScript code for calling the web service. I’ll use the jQuery library because it is extremely popular with web developers right now. It makes it easy to write JavaScript that works in both browsers but you may not know how to call an ASP.NET web service using jQuery, especially since we need to pass a parameter to the web service methods. This is also tricky because the content type must be JSON.

   1: $(document).ready(function() {
   2:     $("#btnTitleQuery").bind("click", function() {
   3:         $("#query_results").empty();
   4:         $("#query_results").append('<table id="ResultsTable" class="BooksTable"><tr><th>BookNum</th><th>Title</th><th>Author</th></tr>');
   5:         $.ajax({
   6:             type: "POST",
   7:             contentType: "application/json; charset=utf-8",
   8:             url: "BookServices.asmx/GetBooksByTitle",
   9:             data: '{ strTitle: "' + $("#txtTitle").val() + '" }',
  10:             dataType: "json",
  11:             success: function(msg) {
  12:                 var c = eval(msg.d);
  13:                 for (var i in c) {
  14:                     $("#ResultsTable tr:last").after("<tr><td>" + c[i][0] + "</td><td>" + c[i][1] + "</td><td>" + c[i][2] + "</td></tr>");
  15:                 }
  16:             }
  17:         });
  18:     })
  19:     $("#btnAuthorQuery").bind("click", function() {
  20:         $("#query_results").empty();
  21:         $("#query_results").append('<table id="ResultsTable" class="BooksTable"><tr><th>BookNum</th><th>Title</th><th>Author</th></tr>');
  22:         $.ajax({
  23:             type: "POST",
  24:             contentType: "application/json; charset=utf-8",
  25:             url: "BookServices.asmx/GetBooksByAuthor",
  26:             data: '{ strAuthor: "' + $("#txtAuthor").val() + '" }',
  27:             dataType: "json",
  28:             success: function(msg) {
  29:                 var c = eval(msg.d);
  30:                 for (var i in c) {
  31:                     $("#ResultsTable tr:last").after("<tr><td>" + c[i][0] + "</td><td>" + c[i][1] + "</td><td>" + c[i][2] + "</td></tr>");
  32:                 }
  33:             }
  34:         });
  35:     })
  36: });

You can try a working example at: http://www.williamsportwebdeveloper.com/BookQuery.html. This JavaScript is binding function prototypes to the button click events. These functions call the web service methods using the POST method and pass the required parameters as JSON data. The JSON data that it receives in response is used to create a table. You can continue to issue queries without reloading the web page. If you view the source of the BookQuery.html page you will find all the code required for the client page because it does not require any server side code.

Posted in ASP.NET, Databases, JavaScript, Programming, Web | Tagged , , , , , | 46 Comments

Web Site Revamped

Tonight I revamped my web site. I have not updated my web site in a long time although I had a task on my To Do List to improve the wording. I have updated the content to reflect my current skills and services. I removed a lot of crap and made it look more professional.

The page touting my ASP.NET expertise was way out of date and made it seem like I was still studying ASP.NET 2.0. I now know everything about ASP.NET 2.0. Of course, Microsoft has moved on to ASP.NET 3.5, ASP.NET MVC, Linq, and Silverlight 3.0. So I’m still behind on Microsoft technology.

I added a page about my PHP web development skills because I’ve been doing a lot of PHP programming. I learned a lot of PHP while working on the Vloggerheads Ning site and I’ve been doing stuff with Elgg.

I also restored some material about Storefront 6.0. Tonight I learned LaGarde filed for Chapter 11 bankruptcy last year and Storefront has been acquired by Dydacomp. Businesses are really screwed if they are still using Storefront 6.0 but I’m still willing to support Storefront 6.0 because it always made me money and I have a lot of time invested in the necessary expertise to customize that old ASP.NET 1.1 web application. I think there may be a SQL Injection vulnerability for Storefront 6.0 which probably exists on many of the old sites I worked on.

I also made it easier to find my AJAX demonstrations and ASP.NET sample web pages through the Flash navigation. I have a lot of working code on my site which really demonstrates how good I’ve become as a web developer. I still have an unused MySQL database that I’m being charged for so I ought to use that for something. Elgg won’t run on an IIS web server so I may install OsCommerce, Joomla, or a CakePHP demo.

Posted in ASP.NET, PHP, Programming, Web Design | Tagged , , , | Leave a comment

Looking For More Freelance Work

I’ve allowed my client list to dwindle down to just one but now I need to look for more freelance work. Pennsylvania has not passed a budget for the 2010 fiscal year and instead of issuing IOUs like California, they are not paying state employees, vendors, suppliers, and non-profit agencies. This has caused an emergency for many businesses that are dependent upon state funding. It has caused me to lose my major source of income although this may be only temporary, just until Pennsylvania passes a budget.

In any event, this is a wake up call to find additional sources of income. I have not been looking for freelance work because many of my clients have been deadbeats and I got tied off being taken advantage of. It seemed like a better idea to just concentrate on my best client who always pays on time. But you really can’t put all your eggs in one basket in this economy. I doubt that Pennsylvania will be able to pass a budget next year so this will occur again. They may also slash the budget so deeply that they eliminate the programs my employer is servicing.

In the past most of my freelance work has been customizing LaGarde’s Storefront shopping cart software. I see that another company has bought Storefront and their forum has been taken down. Therefore it is hard to tell if that business has dried up or there are many desperate e-commerce sites that need somebody to support this web application. I’ll probably have to find another shopping cart to specialize in. Or maybe I should put more effort in Elgg because there are a few companies looking for developers to install and customize that web application. I have already put considerable effort into understanding Elgg. Some other possibilities are Joomla and Drupal but they are mainly used as content management systems. Web Development companies that are too biased towards design use content management systems to create basic web sites which the client can manage. I think there is more money in e-commerce. A company that sells an actual product is more likely to want an e-commerce site which will actually generate revenue. These businesses tend to be pretty good about paying their bills. However, I would avoid the entrepreneur who is burning through his savings and credit trying to start a web business because he lost his job.

Posted in Business, General, Web | Tagged , , , , | Leave a comment

My Professional Development

I have not been putting as much time into my professional development as I used to but I still make incremental advances. ASP.NET technology has outpaced me since I managed to catch up with ASP.NET 2.0. I have not learned anything about MVC and very little about Linq or Silverlight. Now that Silverlight 3.0 has been released and can be used with Microsoft Web Developer Express, I have begun to reacquaint myself with Silverlight.

I have been doing a lot more with Flash CS4 and ActionScript 3.0. I’ll probably be expanding my expertise with Flash because I recently used it in a project. That finally gives me an excuse to really master the technology. I’m reading the book Flash Hacks on my lunch breaks. I recently added a topic to my notes on SWFObject 2.2 which has been updated. It now comes with an AIR application to generate the code.

I also resumed work on my code for nested comments in Elgg blogs but this is going very slowly. I figured out how to create a RSS feed for the comments using a custom script. It could not be done using the REST API or a RSS view so this is somewhat non-standard. Now I need to order the comments for nested replies and then work on the final display of the nested comments.

I’ve been feeling uninspired because I don’t have any all consuming interest or passion at the moment. So instead of putting a lot of energy into any one thing I’ve been rotating between a multitude of previous interests which I put a little work into for incremental progress.

Posted in General, Programming, Web | Tagged , , , | Leave a comment

WordPress – Windows Live Writer Fix

I think I have finally solved the problem I have been having with WordPress and Windows Live Writer. Windows Live Writer is a free Microsoft program that allows you to write blog posts and submit them to your blog. It is a useful program if you maintain multiple blogs and don’t like the built-in text editors. Windows Live Writer uses XML-RPC, a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism, to submit the blog post.

I’ve been getting the infamous “An error occurred while attempting to connect to your weblog: Invalid Server Response = The response to the blogger.getUsersBlogs method received from the weblog server was invalid: Invalid response document returned from XmlRpc server” error when my Now Reading plugin was enabled. I would have to disable that plugin before using Windows Live Writer. This required logging in to my WordPress administration and that defeats the whole purpose of using the program to avoid using the browser.

There are various solutions to this problem but eventually I found it came down to the XML response from the xmlrpc.php file. Windows Live Writer complains when the XML response cannot be parsed. In order to troubleshoot this problem you need to see the XML response. I did find a XML-RPC debugger at:  http://gggeek.raprap.it/debugger/ but it is not very helpful when the XML is malformed. It can give you some insight into the methods that are available though. In order to figure out exactly what was going on, I wrote a simple VBScript to submit a POST request to the xmlrpc.php file and saved the response to a file.

   1: ' #################################################

   2: ' # VBScript To Call WordPress XMLRPC             #

   3: ' # Need to examine XML response to troubleshoot  #

   4: ' # programmed by Robert S. Robbins on 06/10/2009 #

   5: ' #################################################

   6:

   7: Set oXMLHTTP = WScript.CreateObject("MSXML2.XMLHTTP")

   8: oXMLHTTP.open "POST", "http://www.williamsportwebdeveloper.com/cgi/wp/xmlrpc.php",False

   9:

  10: oXMLHTTP.setRequestHeader "Content-Type", "text/xml"

  11: 'oXMLHTTP.send "<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName><params></params></methodCall>"

  12: oXMLHTTP.send "<?xml version="1.0"?><methodCall><methodName>demo.sayHello</methodName><params></params></methodCall>"

  13:

  14: Set fso = WScript.CreateObject("Scripting.FileSystemObject")

  15: strWorkingDirectory = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName,"\")-1)

  16: ' Third parameter must be True for Unicode if the XML contains unicode characters

  17: Set objOutputFile = fso.CreateTextFile(strWorkingDirectory & "\wp-response.xml", True, True)

  18: objOutputFile.Write oXMLHTTP.responseText

  19: Set objOutputFile =  Nothing

  20:

  21: MsgBox  "Done Processing!"

My script revealed that the XML response was missing a few characters from the final closing tag. I fixed that problem by adding some newlines to the class-IXR.php file in the wp-includes directory. I added newlines just before the EOD; on line 336. Then I found that there was a BOM (Byte Order Mark) just before the first XML tag. This problem was caused by my use of Microsoft Expression Web which added the BOM to my wp-config.php file when I edited it in that crappy program.

After finally verifying that the XML response would be valid I was able to use Windows Live Writer without disabling any of my WordPress plugins. Who da man?

This blog post was written using Windows Live Writer and will serve as a test of my fix.

Posted in PHP, Programming, Web | Tagged , , , | 9 Comments

What I’ve Been Adding To My Notes

As a busy web developer, I learn something new every day and I take the time to document what I learn in my notes. The following is a list of material I’ve recently added to my notes:

  1. A tagged regular expression for the search and replace in Microsoft Expression Web. This is useful for preserving the inner text when you need to modify the surrounding tags. It has saved me a lot of time in my efforts to improve the CSS in my web pages.
  2. Access Data Projects – I had some trouble figuring out how to create an Access database linked to SQL Server in Microsoft Office 2007. There was no obvious way to create this kind of Access database. I documented this so I won’t struggle with that task again.
  3. Microsoft Agent – I like the Microsoft Character Animations used for the Office Assistant. I have downloaded many characters and developer tools for Microsoft Agent but I never took any notes on the subject so it took me awhile to get back up to speed when I wanted to play around with Microsoft Agent.
  4. Amazon URL Shortener and Amazon Associates Product Links. Amazon is practically an Internet institution so I have a topic in my Notes on some things I need to remember about their services.
  5. Microsoft Translator Widget – I’m studying French and German so I signed up for the Microsoft Translator Widget. I may want to business with the French and Germans in the future.
  6. ActionScript 3.0 – I’ve been doing a lot of work with Flash CS4 recently but none of my old Flash books cover ActionScript 3.0. I compiled in a PDF cheat sheet and some sample code.
  7. Animated PNGs – since Firefox 3.5 came out I’ve heard about animated PNGs so I added a topic to my notes on that. Unfortunately, there aren’t any graphic programs available to create animated PNGs yet.
  8. Linux Command Reference cheat sheet. I converted the PDF into a PNG using Adobe Illustrator and compiled it into my notes.
  9. iTouch Web Applications – this topic is mostly material from http://www.iphonewebdev.com with some additional information like the iPhone user agent string and a listing of iPhone fonts
  10. CSS Font-Face Rule -all the material I could gather concerning the new CSS @font-face rule that Firefox 3.5 supports
  11. Digg JSON – I used the Digg API to whip up a little Digg widget to run in my notes.
  12. Reddit and BookMooch widgets – just some external JavaScript I created topics for so I can find it easily

That is just material I’ve added in the last couple of weeks. I add something almost every day.

Posted in CSS, Programming, Web | Tagged , , | 1 Comment

Silhouette Theater – My Webcomic Project

I have started a personal project in order to see if I can make any money by producing content on the Internet. I’ve recently read a book, YouTube: Online Video and Participatory Culture, which got me to thinking about how much time I spend contributing content to online communities. Many web sites are making money by providing a platform for the average user to contribute content in the form of videos, photos, comments, writing (blogs and comments) and knowledge. They then monetize the content and get all the rewards from the work that was done by the users. We are serving as their unpaid labor. This is similar to how freelance writers are treated by the small press. The writers provide all the content in exchange for the privilege of being published in a widely read magazine. Only the publishers stand to make any money.

Well any fool can publish on the Internet. It is just as easy for me to register a domain name, find a web hosting company, and create the web site or web application to publish my work. Then I can monetize it as I please without sharing the revenue with the provider of the “platform”.

So I have started a webcomic, http://www.silhouettetheater.com/, to explore various methods of content monetization. I chose a webcomic as the form of content because it is easy to produce. It does not require very much writing. I just use the snarky remarks that I leave as comments on YouTube videos. I’ve been giving my wit away for free! It also does not require much artistic ability. I got the bright idea of using silhouettes. It is easy to create silhouettes in Photoshop and the lack of detail reduces the amount of drawing that is necessary. I’m using vector graphics as much as possible because I can then scale and rotate the images to create new poses.

Successful webcomics like http://xkcd.com/ are based on nothing more than stick figure drawings. Randall Munroe is making a living doing this based entirely upon his engineering humor. Then there is Dinosaur Comics which is just the same clip art every time with only the text changing. Alien Loves Predator is done by Photoshopping toys and photos. The bar seems to be set pretty low. However, I have seen some really well drawn and entertaining webcomics which are a labor of love. Many people are creating webcomics without making any money.

I’m determined to see if it is really possible to profit from my Internet participation. This project provides an excellent excuse to experiment with different ways to drive traffic to a site and various methods of monetizing content. Many of my clients have been interested in Search Engine Optimization and online marketing but they frequently are disappointed by the results. Therefore I have a professional interest in learning how to make a web site popular and profitable through the use of technology. As a web developer, I am expected to be an expert on what is essentially a publishing platform. Many of the old tricks like keyword selection, image alt text keyword stuffing, and meta tags no longer seem to be effective. Being successful in the attention economy clearly requires a more creative approach.

My first innovation has been to create a custom web page that is iPhone friendly. I’m using the ComicPress plugin for WordPress to manage my webcomic content because I’m familiar with WordPress and can design themes for it. However I did not find any webcomic applications for the iPhone that could be used to view my webcomic and I did not like how my web site appears in the Safari Mobile browser. My custom iPhone web page at http://www.silhouettetheater.com/m/#_cartoons displays a simple list of links to my comics. Each comic can then be viewed as a simple image which can be rotated to the landscape mode by tilting the iPhone or iTouch. That is exactly the kind of exploration and experimentation that this project is intended to foster. I’m sure I can use everything I learn in future projects for the benefit of anyone I’m working for.

Posted in Business, General, Web | Tagged , , , , , , | 2 Comments

Ich bin ein Berliner

Foreign travel is one of the best ways to keep life interesting. Everything about a foreign country can seem fresh and exciting even though it may bore the locals. And the United States is such an xenophobic country that we often know very little about other nations. I like to do a lot of research before I travel abroad because I’m very nervous about getting around town when I can’t speak the language. But this just serves as a prolonged period of armchair travel which makes the entire enterprise more engrossing for a longer period of time than the one week I’ll spend in the foreign city. My trip to Paris seemed like a grand adventure but I just did the usual touristy things so in actuality it was rather mundane. It is hard to say if foreign travel is an adventure or a mundane experience. The French are certainly bored with life in their country. After all, “ennui“ is a French word and there are many French films about bourgeoisie existential angst.  I recently saw the French film “She’s One Of Us” (aka “Elle est des Notres“) which reminded me of Albert Camus’s novel “The Stranger“ in a modern office setting because the main character seems emotionally detached and kills someone for no apparent reason. This film depicts the workplace culture of France which seems just as mundane as office life in the United States. It seems ironic that tourists seek their little adventures in a country that isn’t very different from their own.

I’m currently preparing for my trip to Berlin even though I can’t afford to do any more travel until next year. But I’m glad it is far in the future because there is a lot of preparation I want to do. I didn’t leave much time to prepare for my trip to Paris. I didn’t read all the travel guides I bought or learn much French. However, I should have plenty of time to read all the travel guides for Berlin. And I’ll read several books to learn enough German to get by. I studied French in high school and retained some basic familiarity with the language but German is completely unfamiliar to me.

I’ve already bought two travel guides for Berlin. “National Geographic Traveler Berlin“and “The Rough Guide To Berlin“. I’m currently reading the National Geographic guide because they have the best photos and maps. Unfortunately, you cannot learn anything about Berlin without encountering the sad history of the Nazis and the East German Stasi. The World War II bombing of Berlin which flattened many of the historic buildings and the division of Berlin by the Berlin Wall are just too significant to the present city to be ignored or glossed over.

Personally I would rather concentrate on modern Berlin, especially the music scene which is very influential in the alternative music scenes that I enjoy. For example, I learned that punk diva Nina Hagen was born in East Berlin. Fortunately I already have four Nina Hagen CDs that I must have bought as part of my 1980s nostalgia. One of the CDs has Nina Hagen singing “My Way” in German. Today I got a book I ordered from the German Amazon web site. This is the first book I’ve owned that is all in German. I can’t read it but it has many photos of German rock groups that I can check out on the Internet. The only musician I recognized is Tilo Wolff, of the band Lacrimosa, based in Switzerland. I have a lot of Lacrimosa CDs with songs sung in German.  Their music is very symphonic with classical arrangements. I also like the German groups Rammstein and Das Ich.

On Sunday, I bought some bratwurst and sauerkraut at the grocery store to sample some German cuisine. I don’t like sauerkraut alone but it adds some flavor to the bratwurst which I ate in a bun like a hot dog. Sauerkraut is pickled cabbage. I remember it was frequently served in school lunches but I never touched it. And sauerkraut can really stink up a home where people like to eat it.

I found some German TV channels on YouTube, openreichstag and zdf which allows me to hear spoken German and get some sense of German news. But my favorite German web site is The Local which provides German news in English.

Posted in General | Tagged , , , , , , , , , | Leave a comment

iTouch Web Applications And Web Slices

I’ve been slacking off for the past two months due to travel but I’m finally getting back into gear. I recently added some material to my notes on creating web pages for the iTouch and iPhone. I have an iTouch which I like to carry with me when I am traveling, although I don’t always have a WiFi connection. Anyway, it would be useful if I could publish some information on my web site that I could easily look up using my iTouch while walking around town. For example, I could access my directions and notes that way. The stupid iPhone operating system does not even provide a means of storing offline text files on the device. Apple computers and devices frequently suffer from such Steve Jobs design limitations. There is always something missing because Apple doesn’t want to include it in the design or operating system. But I think there is a way to store web pages offline so I can use that to store text information. While every other developer is busy creating iPhone applications to get rich quick, I may develop a few web applications for the iPhone to meet my needs.

Today I explored web slices in Internet Explorer 8. Microsoft has a gallery of web slices at http://ieaddons.com/en/webslices/ but there is not much there. This looks like another one of their bright ideas that never take off. I thought it might be useful for keeping track of information that is published on the web and sometimes updated without your being aware of the change. For example, the Lycoming College Theater Season is something I’d like to be notified about when it’s web page changes. I don’t want to visit the page every day because it rarely changes. Unfortunately, web slices require some special CSS classes in the HTML content so I can’ create a web slice for a web page that I can’t edit.

My next travel adventure will be Berlin, Germany. I’ve begun to research the country, language, culture, and tourist attractions. Unfortunately, I won’t be able to afford to travel for a long time. I need to concentrate more on reducing my debt. Things have been slow in my web development business. I may need to actively search for new clients. However, there is only so much money you can make doing work that requires billable hours. I’ve been reading about passive income and I think some sort of creative work would bring in more money for less effort. I’m still studying French. Knowing a foreign language could prove to be rewarding financially, especially in the United States where few people study foreign languages. If there is one thing I’ve learned, it is that your job skills and expertise is the only thing you can really rely upon.

Posted in Business, Web | Tagged , , | Leave a comment

Philly Sunday

For Sunday the only thing I had planned was the Star Trek exhibit at the Franklin Institute. I bought a ticket for that online via TicketMaster last week. I checked the local weather on my laptop and saw that they were expecting rain in the afternoon. I had forgotten my umbrella. Usually I keep one in the car but I keep forgetting to put it back. Fortunately the Holiday Inn gift shop sold umbrellas so I didn’t have to find a store to buy one. (It never did rain that day). I walked all the way from the Historic District back to the Parkway / Museum District. Along the way I shot some additional photos of the skyscrapers around City Hall and Claes Oldenburg’s Clothespin sculpture.

At the Franklin Institute I saw the huge statue of Benjamin Franklin sculpted by James Earle Fraser. Benjamin Franklin is the king of Philadelphia. At the YoTube Gathering in Independence Park, I bought a biography of Benjamin Franklin by Edmund S. Morgan which I’ve read already so I knew he achieved fame as a scientist. I probably would not have gone to this museum if not for the Star Trek exhibition which seemed like a cool thing to do while I was in town. Unfortunately, you are not allowed to take any photos in the Star Trek exhibition, although you could be photographed sitting in Captain Kirk’s chair or on the set of the bridge. The exhibit consisted mostly of costumes, props, complete sets, models, and videos. They even had a few costumes and props from the 2009 movie. While in the engine room set, I had the bright idea of doing a web site navigation in the design of the control panels. I remember a Star Trek CDROM that had an user interface like the control panels (the Star Trek: The Next Generation Interactive Technical Manual). Unfortunately I could not ride the Star Trek Simulator because it requires two people for a ride. I did walk through the Giant Heart which is a Philadelphia icon (according to Wikipedia). I saw some gang sign graffiti in the Giant Heart so blood corpuscles better stay out of the left ventricle.

Franklin Institute

I did not spend much time at the Franklin Institute so after that I walked the rest of the way to the Philadelphia Museum Of Art. I’ve been there before in 2003. The first thing I did was circle around the Washington Monument at Eakins Oval to take lots of photos. Another photographer there asked me about the four pools of water which represent the Mississippi, the Potomac, the Delaware, and the Hudson rivers. When I didn’t answer right away she asked me if I spoke English. The Philadelphia Museum Of Art gets a lot of foreign tourists. I saw a French couple speaking French while I was there.

Washington Monument

I also took a lot of photos of the Ben Franklin Parkway from the “Rocky Steps” and the Greek Revival facade of the Philadelphia Museum Of Art. This location is really impressive and grand. It is hard to believe that the Rocky movies eclipse its intrinsic grandeur. The Philadelphia Museum Of Art is as impressive as the Palace of Versailles and they both had one wing covered in scaffolding during my visit.

Philadelphia Museum of Art

Since it was Sunday, you could pay whatever you liked for the entrance fee but I just paid the usual fee of $14.00. I made sure to pick up a map which I usually forget. I’ve given some thought about how I should blog about the art I saw. Rather than lecture my readers on the art and artists, I think I should stick to giving my impressions. I started my visit by accident in the Arms and Armor gallery. The museum has many suits of armor dating from the 16th Century on display. They look like medieval robots, the only context I have for medieval knight armor, although steam-punk has made the style popular again. The ancient firearms made more of an impression on me because they were elaborately engraved and pretty fancy for guns.

After consulting the museum map I went to the European Art gallery. You could take photos as long as you didn’t use a flash so I took a few photos of paintings I wanted to remember. You really don’t need to photograph any of the artwork because you can always find a better image of a painting online but it does help you to identify something later. One of the paintings I liked was “A Carnival Evening” by Henri Rousseau. This dreamlike painting shows characters from Commedia dell’Arte, the mime Pierrot, in a dark and mysterious landscape. Pierrot is an interesting clown / mime appearing in literature and art. I’ve read two fascinating scholarly studies of Pierrot by Robert Storey; “Pierrots On The Stage Of Desire” and “Pierrot: A Critical History Of A Mask”. There is a black and white photo of “A Carnival Evening” in the “Pierrot: A Critical History Of A Mask” book.

A Carnival Evening

On my previous visit to the Philadelphia Museum Of Art I had admired a set of four paintings depicting an angel child as the four seasons but I never found out who the artist was. I took a photo of it on this trip and was able to determine that it is Leon Frédéric’s “Four Seasons”, a Belgian Symbolist. These paintings reminded me of “The Knight with the Flowers” by Georges Antoine Rochegrosse which I saw at the Musée d’Orsay. They both portray human figures in a very colorful and fanciful sea of vegetation. I believe Georges Antoine Rochegrosse was also a Symbolist. I appreciate these paintings because they elevate fantasy to a grandeur that I consider appropriate.

Frederic Leon

Another famous painting that caught my eye was “Dance At The Moulin Rouge” by Henri de Toulouse-Lautrec which depicts decadent cabaret society. But its imagery has become so commercialized that I’m overly familiar with it so this painting merely represented art itself for me. Henri de Toulouse-Lautrec’s paintings just look like art book covers to me now.

Moulin Rouge

I also liked the painting “Liverpool from Wapping” by John Atkinson Grimshaw which I had to identify online from my photo. The bright lights of the store fronts across from the ship masts express the allure of European travel. I prefer cities at night when the electric lights create dramatic tableaux. Empty streets and city architecture can look like a mysterious stage set then.

Liverpool from Wapping

The next gallery I went to was devoted to Asian Art. My photo of the Tibetan art appears quite blurry from motion blur I think but it looks better when scaled down. I liked this gallery because I appreciate the mysticism of Buddhist philosophy. But while the Buddhist form of mysticism is based on the serenity of the empty mind, I prefer the mysticism of a profound imagination, drawing deeper from the unconscious, so William Blake is more my style. This wing of the museum features the famous Japanese tea house with its bamboo garden which transports you to Japan. But they don’t serve tea there.

Tibet Art

The last gallery I wanted to tour was the Modern Art gallery. One of the most striking works of art I saw there was a digital painting. It was like artwork from the future. I don’t remember seeing it on my previous visit to the Philadelphia Museum Of Art. It was two flat screen monitors proportioned to the size of a canvas, showing a high definition film of a man and a woman performing a series of anguished expressions. Many people were standing around this vivid video painting. I dare say people spend more time staring at this work of art than anything else in the museum. I can picture an art museum of the future where all the canvases will be transforming before your eyes like that.

Another artwork that I don’t remember from my last visit was Tom Chimes’ “Portrait of Antonin Artaud”. Artaud is a significant figure to anyone familiar with modern theater due to his book “The Theatre and its Double” which details the concept of The Theatre of Cruelty. This painting certainly captures his fierce, piercing, tortured expression.

Portrait of Antonin Artaud

Apparently the Philadelphia Museum Of Art had a photo of Dali draped over the “Rocky Steps” in 2005 but I missed that. I did see his painting “Soft Construction with Boiled Beans (Premonition of Civil War)”. I don’t think I’ve ever read a Salvador Dali biography so I should probably buy one. Dali’s work is always reproduced in any book on dreams and dream symbolism. Since he is one of the masters of the unconscious I should be more familiar with his life story. I wonder if there is a Jungian interpretation of his work?

Soft Construction with Boiled Beans

One artist I want to rant about is Cy Twombly and his painting “Vengeance of Achilles”. The museum has several large canvases like that which are just scribblings with a few names from Homer thrown in. They look like giant copies of a bored student’s English class notebook. I’m not sure that this qualifies as art. You can’t just scribble something and then consider it art because you scrawl the names of a few Greeks on it! The only thing that is impressive about Cy Twombly’s work is its size which makes idle doodles seem monumental. By the way, you can see all of my Philadelphia trip photos on my Flickr photo set at http://www.flickr.com/photos/youtuber/sets/72157618687603776/. The Wikipedia entry for Cy Twombly has an amusing story about a woman who kissed one of his paintings and got arrested for leaving lipstick on it.

While moving between galleries I snapped a photo of the large sculpture of Diana and the Alexander Calder mobile from the 2nd floor of the Grand Stair hall.

Diana Calder Mobile

I bought two books at the museum gift shop which has a great collection of art books. I bought “Fresh Fruits”, the second book of Japanese fashion portraits taken in Tokyo’s Harajuku district. I’m not surprised that they would be selling this book because it is an eye-popping chronicle of colorful costumes and outrageously creative personalities. I also bought “A Critical History of Modern Architecture“, a survey of 20th-century architecture, because architecture is something I know little about and I was seeing plenty of architecture in Philadelphia on my trip.

I then had Sunday Brunch at the museum restaurant which was an expensive buffet. I had a glass of complementary champagne which is the first time I’ve ever drank it. I also ate a large waffle and a salad. That cost over $40! I wasn’t too happy about that.

The Philadelphia Museum of Art was running a Paris fashion exhibit but in order to see that I had to walk over to another building, their new Ruth and Raymond G. Perelman Building. Along the way I came across the monument of Joan of Arc by Emmanuel Fremiet. This is the same French sculptor who did the Joan of Arc sculpture in Paris which I saw last month! This is its “sister” statue in Philadelphia. Joan of Arc interests me because she was a visionary although in our day and age she would be considered merely psychotic (a radically different interpretation, n’est pas?). Apparently the locals call her “Joanie on a Pony” [rolls eyes].

Joan Of Arc

The Perelman Building is an impressive example of Art Deco architecture. I saw most of the current exhibitions; Shopping in Paris: French Fashion 1850-1925, Daid? Moriyama: Tokyo Photographs, Visual Delight: Ornament and Pattern in Modern and Contemporary Design, A Taste for Modern: The Jeanne Rymer Collection of Twentieth-Century Chairs, and Henri Matisse and Modern Art on the French Riviera. They just scanned my ticket from the Philadelphia Museum of Art’s main building. I did not have to pay again.

Perelman Building

On the second floor I went through the small exhibit of Kansai Yamamoto, a Japanese fashion designer (Hello! Fashion: Kansai Yamamoto). He did the wardrobe for David Bowie’s Ziggy Stardust. There was a flat screen TV there showing footage from his extravagant fashion shows which seemed as grand as Olympic opening ceremonies. It is hard to believe that a fashion designer could stage such extravaganzas. This was all new to me because I know nothing about Japanese fashion.

When I left the Perelman Building at 4:00 PM I walked all the way from the Ben Franklin Parkway back to the Historic District which was very tiring. I had to stop to sit on some park benches a few times. When I got back to my hotel I had to unwind and nap for almost an hour. After my feet stopped aching I walked over to Walnut Street and had dinner at the Caribou Café. This time I had a glass of wine (Bordeaux), the pasta duck, and Irish Ice Cream. The Les Pâtes was Pappardelle (a kind of noodle, large, very broad fettuccine) served with duck confit, figs and Port wine sauce. It was very good but I could not finish all the noodles. This time I left a $5 tip in the check before they charged my credit card which seemed to make the waitress happy.

After dinner I walked to South Street to cruise this colorful neighborhood of shops and restaurants. I took a photo of the Digital Ferret street sign even though the store was gutted and empty. I guess they moved a few blocks away but I did not see their new store. Dancing Ferret Entertainment Group is part of the goth underground. I think I may have one of their CDs or bought something from them via mail order.

Digital Ferret

I did go into an used record store on South Street, Repo Records. I spent a lot of time looking for the kind of music I like but eventually had to settle for Nico “Chelsea Girls” and Nick Cave and the Bad Seeds “The Boatman’s Call”.

That was the end of my Philadelphia weekend. I was thinking of staying a little longer on Memorial Day but everything would have been closed so I left early in the morning. I think I did plenty in just two days. Fortunately I did not get lost on the long drive home.

In conclusion, Philadelphia has a lot to offer and it makes for a perfect trip after Paris. I don’t know when I’ll visit the city again although the Philly Fringe Festival may tempt me. My next adventure in travel will be Berlin but it will take me at least a year to research the trip, learn a little German, and pay down my credit card.

Posted in General | Tagged , , , , , , , , , , | 1 Comment