HEMA – online winkelen

I dislike the use of Flash for most business web sites. In this case I will make an exception. This Dutch site, HEMA – online winkelen, has one of the best and most amusing uses of Flash. It is worth the wait!

Javascript Code Highlighter: Chili vs SyntaxHighlighter :: PseudoCoder.com

Today I tried to get Chili to work on this blog. I post code occasionally and Chili was appealing to me since it uses jQuery for most of the heavy lifting. I was hopeful that Chili would be quick and incrementally increase the amount of JavaScript downloaded. Chili didn’t work for me. It had syntax errors in the JavaScript. My debugging skills were not finding any quick answers so I decided to give plan SyntaxHighlighter a try.

From the post it looked like SyntaxHighlighter was going to be a bear to install so I decided to check the WordPress plugins web site for possible alternatives. Guess what I found, SyntaxHighlighter-Plus! This recently updated plugin uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev and makes installing a syntax highlighter a snap. The instructions are a little sparse on how to use it but I converted several existing code snippets to use the plugin. They looked good after I figured out how to get around the automatic encoding of HTML entities. The first time the editor encodes those special characters it was nice. The less than character becomes <. The second time it encodes the characters, it created a mess. The less than character becomes <. I guess I should turn off the visual editor again. I also had to hand tune the CSS to get around some alignment issues.

Overall I give the plugin a thumbs up based on ease of installation and the light load it added, ~25K bytes. Editing a post is still a problem but I can work around that problem.

Javascript Code Highlighter: Chili vs SyntaxHighlighter :: PseudoCoder.com

Shadowbox.js Media Viewer

thumbnail

 

Shadowbox.js Media Viewer
I_CRE8
Fri, 25 Jan 2008 21:00:00 GMT

This looks interesting but it is considerably larger than my current jQuery lightbox plugin. Since I do not use flash or the other media the plugin supports, this plugin has limited benefits for my personal use and most of the web sites I maintain. Maybe sometime in the near future I will need it.

Using VBA to create import files for QuickBooks

A couple of years ago I created some spreadsheets to help me migrate data into QuickBooks. I set up a worksheet that followed the IIF format and then saved it as a tab delimited file. The biggest problem was that one row of data required three rows in the IIF format. If you try and use copy and paste method to adding new rows, this can become quite a pain. The addressing is all screwed up. I figured out how to do it with some Excel functions(e.g. rows and offset) but the final result was still troublesome.

I finally bit the bullet and decided to use VBA to dynamically create a new worksheet in IIF format. I select the rows I am interested in and then I let the macro iterate through the selection creating IIF transactions in the worksheet. After I did a lot of searching for VBA examples I had a macro that worked remarkably well. It is a very simple program but it took me a while to find the right commands. Although the macro was a success, I still had problems with the IIF invoice transaction was not doing what I expected it to do when QuickBooks imported it. It was “in” but I had to fix a lot of transactions. This was hardly the time saver I hoped for.

My next step in the evolutionary process was to switch from IIF to an AutoIT script. I chose to modify the VBA macro to write out the data as an AutoIT array. This allowed me to use an include statement in my main AutoIT script to include the file containing the AutoIT code for the array. Since I run the script interactively, this was an easy way to get the data into the program. The good news is that after fine tuning the script I was able to achieve a pretty high success rate with the invoices. Part of the problem was with the data but a more challenging problem was the timing issues. Interactive scripting is still closer to an art form than a science. The script is not perfect but it is an improvement. Another advantage of using AutoIT is that I was able to further extend the scripting process to  let it partially fill out the QuickBooks Receive Payments screen. The script would wait for me to manually match invoices before continuing.  QuickBooks does not have an IIF transaction for receive payments.Since this traditionally is a manual process in QuickBooks, this is a big time saver.

Today I wrote another macro using my previous work on the macros as my example. Within a fairly short period of time I was able to create a new VBA macro to write out a worksheet of bills in the IIF format. I could of chosen to write an AutoIT script but I remembering having good success with importing IIF bills. Once again this will save me a lot of manual data entry and will undoubtedly make the bills more accurate since it is important that the memo fields get filled out with the proper billing information.

WordPress › jQuery Lightbox « WordPress Plugins

I just changed out one of my WordPress Plugins. I generally use thumbnails of my images and let a plugin called Lightbox show a larger image when the image is clicked upon. Today I replaced WP Lightbox 2 plugin with jQuery Lightbox plugin. I was hoping to reduce the amount of JavaScript the page downloads and I was not disappointed. One one website I maintain the new plugin reduced the JavaScript downloaded from 161,100 to to 39,420 bytes. There are some minor formatting issues but I think I can handle that.

CSS Fix #1 – On the web site using CSS dropped shadows I had to add new selector to remove the dropped shadows.

#lightbox img {
background:none;
border:0;
padding:0;
}

CSS Fix #2 – One of my themes has tabs on the top and after installing jQuery Lightbox the body was overlaying most of the tabs. I found that I could restore the tabs and not cause any other problems if I removed the CSS attribute, “height: 100%”, from the body selector in the jquery.lightbox.packed.css.

WordPress › jQuery Lightbox « WordPress Plugins

Linux Tip: Replacing GKSUDO for CENTOS users

One of the annoying things about maintaining CENTOS installations is performing system maintenance as the super user from the command line. Don’t get me wrong but I was programming before graphical interfaces(BGI). The command line is a good and trusty way to perform maintenance. As long as everything works you can get by with a minimum of memorization. Since most of us live in an after graphical interfaces(AGI) world and we do not practice our Linux command line knowledge on a daily basis, we quickly get rusty on the tricks of the trade and yearn for an easier way. Something with a fast learning curve. This is precisely why we have graphical interfaces.

For reasons I did not understand until today CENTOS does not make it easy to run graphical programs as the super user, such as nautilius and gedit. Ubuntu offers a fairly simple way to create menu items to start graphical programs as a super user, gksudo.  CENTOS does not offer this utility in either Version 4 or 5. A similar utility, kdesu, was offered in CENTOS Version 4 but is not offered in CENTOS 5. Opening a terminal window and running SUDO is an pretty clumsy option so I was pretty sure that there probably was a better way! I wanted a menu item like the other system maintenance menu items that would authenticate me before running an application as a super user.

Today I found the answer. Matt Hansen wrote a tip how to “How to run a program from GNOME menu with root privileges ” back in 2004. The tip uses a utility called consolehelper. You have to create a couple of configuration files but the whole process can be completed in about five minutes. It is interesting that today was the first time I found a reference that claims consolehelper is the “proper” way to solve the “missing” gksudo problem.

Changing ownership and deleting unknown accounts from objects

Yesterday I decided to fix an old problem. I had some directories and files with the unknown accounts in the access control lists(ACL). This can occur when you migrate user files to a new server. The easy way to fix this problem is right click on the directory and follow the menus to change ownership, delete the unknown account, and grant full access to the new owner. Another way of changing ownership is to use the command line utility, SubInACL. That is what I chose to use yesterday.

Sometime ago I had downloaded and installed the Windows 2003 Resource Kit which includes SubInACL. This is the utility to change ownership. After a lot of attempts and re-reading the help multiple times, I gave up. It did not work. So I downloaded FileACL and after a few attempts I figured out the command line to change the object. As an example the following command will grant full access to user1, revoke access to the unknown account, and change ownership of the directory, subdirectory, and files.

fileacl "Pinnacle Studio" /s user1:f /r S-1-5-21-73586283-1644491937-682003330-1123 /o user1 /sub /files

It bothered me that SubInACL did not work properly so I decided to spend a few minutes to find out why. After a little searching I found that the version(4.0) included in the resource kit did not work for several people and that there was a newer version, Download details: SubInACL (SubInACL.exe). The new version(5.2) works Windows 2003. I wonder how this slipped by quality control.

NewsGator, FeedDemon are Free!

Through the grapevine I heard that FeedDemon is now free! Since GreatNews has been crashing on me recently, I decided it was a good time to give FeedDemon a try.

Greg Reinacker just announced that NewsGator Outlook, FeedDemon and all the NewsGator clients are now totally free! The NOT-FREE thing about FeedDemon has always been the one point that has stopped me from using it. Sounds like Nick has a new user.

NewsGator, FeedDemon are Free!
randy@kbcafe.com (Randy Charles Morin)
Fri, 11 Jan 2008 04:33:50 GMT

Getting a L2TP VPN connection to work through the Comodo firewall

I have been using the Comodoâ„¢ Firewall for over a year now. My experience with it leads me to believe that it is more secure than others on the market. I really liked its flexibility and monitoring capability. When the beta for version 3 came out I enthusiastically installed it. I was surprised and disappointed that I was no longer able to use my VPN network connections. So I went back to version 2.4. Since I switched back to the old version I struggled to get back to configuration that worked before I undertook the leap of faith with the beta. The PPTP VPN connection worked but the L2TP VPN connection did not work for me locally.

Let me digress for a bit and describe my local network and the VPN connections I have set up. When I am out of the office and accessing my server via the Internet, I use a VPN connection that uses the DNS name in its configuration. The DNS name points to the static IP address of my hardware firewall. The hardware firewall forwards the VPN traffic to my SBS server where the software firewall, ISA, completes the VPN connection. When I am at my office my laptop connects to the same network that connects the SBS server to the firewall and the VPN connection I use to access the server remotely does not work. To get around this minor problem I use a different VPN connection with the local IP address of the server in the configuration. This connection goes directly to the server and does not go through the firewall. Yesterday I figured why the L2TP connection was not working.

The ports they say you need to open up on your hardware firewall to allow L2TP access from the Internet are 500, 1701, and 4500. When I look at the ISA log I can see the laptop using ports 500 and 1701. When I looked at the Comodo activity log I found that it blocked an outbound access to protocol 50. This sounded vaguely familiar. It was hard to find but Microsoft talks about protocol 50 and 51 in this article, Interoperation with Other Services. Why was Comodo blocking outbound access? I was befuddled but I decided to go ahead and add a IP IN/OUT allow for protocol 50 rule to my local server IP. My L2TP VPN is now working. It is interesting that you will not find protocol 50 showing up in the ISA log but according to the Comodo log it is talking to the server with this protocol.

Aaron Stebner’s WebLog : Automated cleanup tool to remove the .NET Framework 1.0, 1.1, 2.0, 3.0 and 3.5

A big thank you goes out Aaron for his automated cleanup tool to remove the .NET Framework 1.0, 1.1, 2.0, 3.0 and 3.5. Yesterday I found myself in “No Man’s Land”. My PC was trying to install Microsoft .NET Framework 2.0 Service Pack 1(KB110806). It did not work and complained about not finding 2.0a.  The .NET Framework 2.0 that worked the day before was now toast. Live Writer and QuickBooks 2008 no longer worked since they depend on .NET. I get a little antsy when I have to resort to my backup plan to run payroll. Uninstalling .NET via the control panel did not work. It could not find the source!? Running the dotnet.exe I originally used to install .NET Framework 2.0 did not work either. So I ran Aaron’s tool to uninstall .NET Framework 2.0. After I rebooted I let Microsoft Update install a new version of .NET Framework 2.0. Live Writer and QuickBooks 2008 are working again! Yea, Aaron!

For those who are still trying to figure out what I am talking about Aaron describes his tool as:

This tool automates the manual cleanup steps for the .NET Framework 2.0 that I posted a while ago.  These steps have helped solve most of the known .NET Framework 2.0 beta uninstall issues that I know of.  In addition, the tool can be useful to return your system to a known (relatively clean) state in case you run into any .NET Framework 2.0 installation failures so that you can try to install again.

Installing Live Writer behind a ISA firewall

I like Live Writer a lot but it is very hard to install when you are behind Microsoft’s ISA firewall. I spent a couple of hours trying to figure out what ports I needed to open in the firewall so that the Live Writer install program would install. All of my attempts ended with the “Try Later” message. I finally gave up and added the computer temporarily to my Linux firewall rule to complete the install.

Then I set about writing this post. When I opened the post properties to add some keywords, the keywords field was not there. Hmm.. The Live Writer version on my laptop works has the keywords field so I was befuddled. After a little searching I found this post, Add Tags To WordPress 2.3 Posts From Windows Live Writer 2008. I am running the latest version of WordPress so I was not surprised to see that I already had the code changes. I was missing the wlwmanifest.xml file. After downloading the zip file, uploading it to the “wp-includes” directory, and then updating my weblog style, I was back in business.

When Microsoft’s recommendations do not fix your userdata persistence error(0x800A0046)

About once a month I go to the Windows Update and let it check my computer. If Windows Update is working properly, the Windows Update cupboard will be bare. Sometime in December Windows Update stopped working for me and it started giving me a userdata persistence error. The help system said that all of my problems would disappear if I would just enable userdata persistence in my browser. So what do you do when your browser already has userdata persistence enabled? While I pondered that problem I ran Microsoft Baseline Security Analyzer to get my updates.

Today I found my solution. While I was investigating another problem, I found KB943144 – Updates are not installed successfully from Windows Update…. In this article it tells you how to manually re-install Windows Update. This was just what the doctor ordered!

Notes on Setting up the Eclipse C++ IDE on Linux

Since I had recently setup my laptop with C++ version of Visual Studio 8 Express, I was curious about setting up a similar IDE environment on Linux. I initially tried to set up Anjuta DevStudio and I failed miserably. I am running CentOS 5.1. There does not appear to be a recent RPM of Anjuta. I stumbled badly when I tried to manually install the dependencies and quickly became inspired to look for an IDE solution that would set up as easily and quickly as Visual Studio Express. Eclipse was the obvious answer.

So I went to the Eclipse site and downloaded the Linux version of the Eclipse IDE for C/C++ Developers. After I had uncompressed the file I tried running Eclipse and it did not work. It was complaining that my version of Java needed to be at least 1.5. Although I had installed a newer version of Java JRE, Eclipse was finding the 1.4 version. To get Eclipse to work I had to modify the PATH statement so that it would find the verion in “/usr/java/jdk1.6.0_03/bin” first. The best way I found to fix this problem was by modifying the .bash_profile file and adding the following statement:

export JAVA_HOME=jdk1.6.0_03

and modifying the path statement to read:

PATH=/usr/local/java/$JAVA_HOME/bin:$PATH:$HOME/bin

After I logged out and logged back in, I could start Eclipse. To test my Eclipse setup I decided to use the Hello World program for CPPUnit. This is the traditional Hello World program with a little extra, a C++ unit testing framework. The steps I performed to build this program are:

  1. Created a new C++ Project. In my case I called it HelloWorldCPPUnit.
  2. Next I created a “Source Folder” that I called “src” and a “Source File” in that directory that I called “HelloWorldCPPUnit.cpp”. I copied all of the source code from http://pantras.free.fr/articles/helloworld.html into the file and saved it.
  3. Before you compile this program you need to download and install cppunit. The instructions for installing it are straightforward but you will need to do a few more things to get it to work with Eclipse.
    1. You will need to modify the project settings for the GCC C++ Compiler-Directories in Eclipse to add the path to the include files, “/usr/local/include/cppunit”. This adds a “-I” parameter for the compile.
    2. You should run the command, “./cppunit-config –libs” to see the library linking information. In my case it showed “-L/usr/local/lib -lcppunit -ldl”. I modified the project settings for the GCC C++ Linker-Libraries in Eclipse to add these libraries, ccpunit and dl, and the library search path, “/usr/local/lib”.
  4. The final setup step was to tell CentOS where to find ccpunit shared library. At this point the program will build but will not run because CentOS cannot find the run-time library for cppunit. The cppunit installation creates a shared library and puts it in the “/usr/local/lib” directory. To tell CentOS where to find it I had to do the following steps.
    1. As the user, Root, I created a file that I called “local.conf” with one statement in it, /usr/local/lib, in it. I saved this file in the “/etc/ld.so.conf.d” directory.
    2. Then I ran the command, “/sbin/ldconfig”. This tells CentOS to update the links to the shared libraries.
  5. If everything is set up properly the program will build and run the simple unit test.

Overall Eclipse with CDT is slightly more difficult to set up then Visual Studio Express. Most of my difficulties occurred when I tried to go a little beyond the default configuration. Recently I tried to go slightly beyond the default configuration for Visual Studio Express. Since I had minor difficulties setting up both packages my gut feeling is that it was slightly easier to find answers to set up problems from the Internet for Visual Studio problems because there is a larger developer community specializing in Visual Studio. Of course, your mileage will vary! 😉