Archive for the ‘Utilities’ Category.

WordPress Plugin to feed CodeProject Technical Blogs

CodeProjectFeeder

Update 3. sept. 2011:
Fixed a bug according to WeBiscuit’s post at the CodeProject Technical Blog Article. See download of version 1.11.

In the beginning, everything was done manually.

After the third time I had to edit feed-rss2.php of wordpress to fulfill CodeProjects Technical Blogs requirements I now wrote my first (and last?) wordpress plugin.

As you may know, CodeProject allows you to publish articles through your current blog. See here for the FAQ.

As I am using wordpress, I started some time ago to submit blog entries into CodeProject. I had to find out myself, where to change which file.

Limit published articles

To limit the range of blog entries that are published at CodeProject Technical Blogs I use a ‘hidden’ feature and created a category named ‘CodeProject’ in my WordPress blog. On my Technical Blogs site in CodeProject I then used http://www.hjgode.de/wp/category/codeproject/feed/ for the feed input. Now only the articles marked with WordPress category ‘codepoject’ are feed to CodeProject.

Manually changes required in WordPress for CodeProject Technical Blogs

In feed-rss2.php I always had to add a <category>CodeProject</category> line below <channel>. Further I had to change the footer.php of the wordpress theme Win7blog that I use. There I added a rel=”tag” line as recommended by CodeProject.

The pain of doing it again and again

Now, the first manual change has to be done everytime you update your wordpress release. I had to to this at least three times before I start now with a plugin to I avoid changing the file again manually.

The idea of a WordPress plugin

I never wrote a WordPress plugin before, but I did some html, php and mysql coding before (ie the calendar on www.fewo-britta.de or the static pages at www.derbiedermann.de, which are generated from a db). But the learning curve was hard and it took me several hours to get the plugin working. I started with the plugin described at DevLounge in there “How to write a WordPress plugin” series. The article was the only one I could find that describes wordpress plugin development from scratch with a working example.

As I had problems adopting the code to my needs, especially the AdminPage, I had to rewrite the code a little bit.

Continue reading ‘WordPress Plugin to feed CodeProject Technical Blogs’ »

iTextSharp running on Compact Framework – Windows Mobile

PDF library iTextSharp working in Compact Framework 2: iTextSharpCF

Recently I needed a tool to combine several pictures into one file. First I thought about creating a memory bitmap and then BitBlit the source files into this single bitmap. Then I found an entry about iText and iTextSharp. This is a JAVA and .NET class library to create pdf files. As it seems very easy to use I decided to take a closer look. I found one message, where Marco states he has done a port for .NET compact framework and provided a patch to the sourceforge iTextSharp team. Unfortunately the iTextSharp team seems to ignore this port. So I started with iTextSharp and the patch to get iTextSharp running on Compact Framework.

The patch was done against version 4.0.1 of iTextSharp but there were still some rejects and some additional work to do. The main problem was the use of GetInstance where always the general WebRequest.Create(url); and then GetResponseStream() was used. A first workaround is to load the bitmap first and then provide this to doc.Add:

Continue reading ‘iTextSharp running on Compact Framework – Windows Mobile’ »

Toggle keyboard using keyboard hook

This is transfered from my static page:

KeyToggle

Using function keys by pressing numbers. Written for ITC 700 color running windows mobile 2003.

Note: Updated KeyToggle.exe and download cab:
[Download not found]

There was a bug, so the sticky key still produced wm_keydown messages. Fixed version is v2.1.1.0.

With keytoggle you can define a ‘sticky’ key that will change the behaviour of the number keys. As long as the sticky key is ‘active’, number keys from 1 to 0 will produce the function keys F1 to F10. If sticky key is active, the left LED will light in green.

Continue reading ‘Toggle keyboard using keyboard hook’ »