ailon's DevBlog: Development related stuff in my life

Diarist 2

4/30/2008 5:26:53 PM

diarist I came across Diarist blogging application for Windows Mobile last year when I was still running my personal blog on LifeType. Unfortunately back then there was a problem posting using Diarist to my blog in Cyrillic. Kevin Daly (author of the Diarist) was very supportive and tried every possible way to solve that issue but unfortunately we were unable to solve it and I had to postpone blogging from my phone until the planned and delayed (due to my laziness) move to BlogEngine.NET.

Now I've moved to BE.NET and Yesterday I finally decided to try Diarist again. However there was a problem adding my blog to Diarist. It looked that there were some misunderstandings in the encoding department between the two. The most frustrating part was that I clearly remember that I tried Diarist with BE back in 2007 and it worked. Anyway I contacted Kevin and once again he was on it almost immediately.

Less than one day have passed and voila - new fixed version of Diarist is released!

Now, I provide support for a couple of projects (1, 2) and try to do it in a timely manner but Kevin's speed makes me blush.

Keep up the great work, Kevin and thank you very much!

Tags: , ,

Slug Transliterator Extension for BlogEngine.NET

4/28/2008 3:17:51 PM

While I'm at it, I decided to write another extension for BlogEngine.NET. Those writing in English or in other Latin alphabet language only aren't probably familiar with this issue but everyone else is (I think).

When you create a post in Russian (for example) with title like "Привет, мир!" ("Hello, World!") you get automatic slug and (as a result your post link) looking like this:

/blog/post/2008/04/d09fd180d0b8d0b2d0b5d1822c-d0bcd0b8d180!.aspx

This doesn't look much better then the GUID version if you ask me. So, this is where SlugTransliterator comes to rescue. After this post passes through this extension this URL will look like this:

/blog/post/2008/04/Privet--mir!.aspx

A little better, don't you think? I don't know if it has any positive effect on SEO related aspects but it's definitely much more readable and rememberable (is this a word?).

By default SlugTransliterator is configured to transliterate from Russian (Cyrillic) and Lithuanian (Baltic) titles. But it can be configured to do any sort of char-to-char translation using Extension Manager.

Download

SlugTransliterator for BlogEngine.NET v.1.0 (2.5kb)

Installation

Just copy SlugTransliterator.cs to your App_Code/Extensions directory and configure in the admin section as you see fit.

Hope this helps someone. If not, I did it for myself anyway :P

kick it on DotNetKicks.com

P.S.: you may also want to use this extension to transliterate * symbol which results in bad URL in current (1.3) version of BE. Default configuration translates "*" to "-"

Tags: , ,

Cross-post to LJ 1.0

4/25/2008 12:27:06 PM

Just a quick note for those who subscribe to my RSS feed and who's reader doesn't show updated posts:

I've released an updated version of Cross-post to LiveJournal Extension for BlogEngine.net.

Tags: , ,

Cross-post to LiveJournal Extension for BlogEngine.NET

4/24/2008 7:07:00 PM

Some time ago I decided to cross-post all my blog posts from various blogs to my blog at LiveJournal. I used cross-posting plugin for Windows Live Writer by Daniel Cazzulino for some time but then it stopped working with newer releases of WLW. So after toying with idea for some months I decided to write an extension for BlogEngine.NET to do this automatically.

Update: 2008-04-25: I've updated the extension to version 1.0. Here's what was added/fixed

  1. FEATURE ADDED: username, password, xml-rpc url and prepended text could now be edited in Extension Manager
  2. FEATURE ADDED: tags are now cross-posted along with the post
  3. BUGFIX: LiveJournal assumed that posts are in ASCII. Though they were stored and displayed just fine, it wasn't possible to correctly edit them in LJ. Added ver=1 protocol version number.

Note that you will need to configure the extension in Extension Manager after installation

Download it: BECrossPostToLJ-1.0.zip (2kb)

I've used excellent XML-RPC.NET library by Charles Cook so you'll need that too.

Installation

  1. Download XML-RPC.NET library from http://www.xml-rpc.net/
  2. Copy bin/CookComputing.XmlRpcV2.dll to Bin directory of your BlogEngine.NET installation
  3. Upload the files in App_Code/Extensions/ directory to the App_Code/Extensions/ of your BlogEngine.NET installation
  4. Configure the extension in Extension Manager

Known limitations/issues

  • In case your post includes relative URLs in links or image source attributes they wont work. I use WindowsLiveWriter for most of my posts and it inserts images with absolute URLs so this is a minor problem in my case
  • Only new posts are being cross-posted. Cross-posting updates adds too much overhead in tracking IDs, etc. so I don't plan to do this in the nearest future.

Other APIs

I plan to create similar extension for MetaWeblog API if someone needs it. So, again, let me know if you do, so I don't waste time for no reason.

kick it on DotNetKicks.com

P.S.: here's this post cross-posted to LiveJournal using this extension.

Tags: , ,

New ASP.NET Controls for amCharts

4/18/2008 4:00:45 PM

We've just released a new version of ASP.NET Controls for amCharts.

Thanks for spreading the word! Highly appreciated.

Tags: ,

Property Naming

4/17/2008 4:10:53 PM

I'm implementing support for new features in amCharts 1.5 where you can set Left and Top coordinate of several objects to be measured from opposite side meaning that if you set Left to 20px and specify that this should be actually 20px to the left from the right side of parent object (but it's still a coordinate of the Left corner (not right)). I know it's confusing :)

First I thought I would name new properties Bottom and Right but then I understood that this is not accurate since these are still Top and Left and only the axes change. Now I decided to add 2 boolean properties TopMeasuredFromBottom and LeftMeasuredFromRight but these look quite ugly to me.

Do you have an idea for better naming or/and approach?

Tags: ,

Milestone

4/16/2008 5:27:10 PM

This week I've reached a new milestone which doesn't make me happier. My Spam folder at Gmail has crossed the 30,000 message mark, meaning that now I officially get more than one thousand spam emails per day.

Amen.

Tags: , ,

Web Designers

4/15/2008 11:19:19 AM

It's time for some bitching and whining.

Some time ago I had a meeting with potential client who has ordered site design from a well known local ad agency and wanted my company to program the eshop. He showed me printed mockups of the site which were quite nice visually.

Later, as we talked further, he emailed me the same mockups in jpeg. I've noticed that content part of the site (a static width design) was 1300+ pixels wide. I informed the client that this is way too wide for a site and asked to make the design fit into 960 pixels. A couple of weeks later I've received new mockups where all that was done was the whole design proportionally resized to fit into 960 pixels.

When I pointed out that in some elements font sizes became unacceptably small (one button had text on it with 4px high font!) I got a few emails from the ad agency's project manager and then a call from a higher executive who in quite arrogant way tried to convince me that I can't make these judgements from JPG mockups but I have to get their magnificent CorelDraw file and everything will be fine. To my note that 4 pixels is 4 pixels and it's not enough for the text to be readable no matter how crisp it is, he responded with typical print designer gibberish talking about centimeters, 72 DPI, 150 DPI and other crap that has totally no relevance in web/screen design. He also noted that client has signed out on the design when they demonstrated it to him in their office (most likely on a shiny Apple's 30" screen with 500% zoom). I understood that I have no chance to convince these people to admit that they know nothing about web (after all they are well known ad agency!) and listen to my free advice. So I decided just to make a mockup web site with the design and show it to the client so he sees it in "field" conditions. We'll see how it goes.

After the conversation I was curious to find the origin of the 72 DPI tale so I googled it and found a perfect article - "Say No to 72 dpi" - which should be mandatory to every print designer before he or she is allowed to do anything for the web or screen. I suggest you read it even if you have a good idea what pixel is. It's hilarious. And definitely bookmark it so you can send it if you ever have a conversation like mine. After all since the web is total mainstream these days more and more people start designing web sites and print designers are leading the pack since the already know everything about design. And definitely more than those arrogant programmers!

Bonus design tip: Did you know that you can change black-gray-white-greenish site template to black-gray-white-bluish by simply swapping B and G values in RGB colors? :) This is what I did to convert the theme of my personal blog to this one.

kick it on DotNetKicks.com

Tags: , ,

Migrating from LifeType to BlogEngine.NET

4/8/2008 6:37:46 PM

Note: this post doesn't cover BlogEngine.NET installation.

Yesterday I've moved my personal blog (in Russian) from LifeType to BlogEngine.NET.

I've used LifeType blogging platform (formerly know as pLog) since 2003. It's a decent, mature blogging engine for both standalone blogs and multi-blog communities. I didn't move away from it because there's something seriously wrong with it. I just had several minor reasons for the move:

  1. I have a personal Windows/.NET hosting account, but my blog was hosted on my company's server because of the blogging engine's PHP nature;
  2. I can do my share of PHP coding but I feel more at home with .NET these days;
  3. The most frustrating thing and the one which was the main reason for the move and main obstacle - there's no way to export blog content from LifeType into some widely supported format (like BlogML)

Unsolved Problems

In case you are going to follow my path, I want to warn you right away:

  1. I've lost all comments in the old blog. Since there are no tools to export them and no comment RSS, I decided to sacrifice comments rather than try and create some tool to export them from the MySQL database and then map to the posts in the new blog
  2. Back links to your own posts will be broken. To resolve this you'd need to make a mapping table of your old and new post IDs and then replace all the links based on that. I decided to skip this

Migration

The only readily accessible way to export posts from LifeType is RSS feed. The number of posts in RSS feed is controlled by "Number of recent posts" setting in LifeType. Since we need them all you should set this value to something that is undoubtedly higher than the number of posts in your blog.

Basically one may think that this is it - just feed your feed (sorry) to BlogEngine.NET's Blog Importer and you are set. Unfortunately it's not that simple.

First of all, as of this writing (BE.NET v.1.3), it looks like Blog Importer has problems opening feeds with parameters in the URL. But since LifeType's rss.php can serve default RSS profile (can be set in configuration) this is not a major issue. However, in my case, Blog Importer still choked on my feed. Maybe it was the number of posts (1200) in my blog, maybe something else but it didn't work out that way.

Anyway even if Blog Importer doesn't choke on your feed, you wouldn't want to import your posts that way unless you've never touched LifeType's Resource Gallery. So, we just need to save our full RSS feed content as file by simply downloading it with your favorite download manager. Make sure you set locale of your blog to English US even if your blog is not in English. At least in my case importing with Russian locale resulted in incorrect dates.

You can specify File Path in Blog Importer. Everything under that path is considered a file by it and will be downloaded into your new blog as is and appropriate URLs in your content will be modified accordingly. Unfortunately if you've used Resource Gallery in LifeType most of your images will have an src attribute looking something like this: http://yourdomain.com/blog/resserver.php?blogId=1&resource=someimage.jpg

Setting File Path to http://yourdomain.com/blog/resserver.php? (or something like this) doesn't work. Fortunately the image is physically accessible at http://yourdomain.com/blog/gallery/1/someimage.jpg (I guess this can vary slightly in different installations).

What we need to do is open our saved RSS file and run a replace changing

http://yourdomain.com/blog/resserver.php?blogId=1&resource=

to

http://yourdomain.com/blog/gallery/1/

Now we need to place our static RSS file on the server, because there's no option to load RSS file from disk in Blog Importer. I don't know what MIME-TYPE it expects to get but I was unable to find an extension for it to accept my RSS file. Finally I've changed extension to .aspx and voila, my RSS was finally declared valid.

I've set File Path field to http://yourdomain.com/blog/gallery/1/, entered connection information for my BE.NET blog and pressed Import. In a matter of seconds all my posts were imported into Blog Engine.

However there were still some issues left.

  1. File Path URLs were replaced with http://localhost/... URLs (I did the import on my local machine which is the only logical approach, imho);
  2. Author wasn't set on my posts, even though I've tried importing with "Use Source Author" checked and unchecked and usernames in both blogs were identical.

I've solved both of these issues by running a find & replace in files on App_Data/posts/ directory replacing http://locahlost/ with just a slash, and <author /> with <author>ailon</author>. The later wont save you if you had more than one author in your blog.

After that I've just uploaded all the files to my hosting server and everything (except the known issues above) seems to be working fine.

Hope this helps someone.

kick it on DotNetKicks.com

Tags: , ,

Copyright © 2003 - 2017 Alan Mendelevich
Powered by BlogEngine.NET 2.5.0.6