Sunday, September 27, 2009

Experiencing HTC Hero and Android

A month or so ago I had my HTC S710 Windows Mobile out while canoeing and it rained heavy so it hasn't been the same since then. Especially the screen just going black is quite irritating and not to say very unproductive. Curious on this new Android-platform and having a desire to develop software for it made me look on Android-phones, yesterday I went out and bought a HTC Hero.

My first experiences wasn't all that well. I tried it out of the box and it seemed okay. Then I remembered that my old HTC needed a ROM-upgrade very early on and it totally cleaned everything so I decided to upgrade to the latest ROM from start. Unfortunately it made the HTC Sync software unable to connect to my phone. After uninstalling/installing the software and upgrading to XP and numerous other stuff it finally got sync with Outlook up and running again. I hope it stays that way.

Next problem... I can't find the files on the phone! And the device that Windows claim is the new one states that "Please insert disk into drive". After heavy googling I finally figured out that you must slide the USB-icon on the phone downwards and Mount the drive! I find it hard to believe that it works that way but I guess I have to face the reality and now I know...

And that is all for the moment. I hope I am able to write more about my experiences with HTC Hero and Android later on in this blog.

Thursday, May 28, 2009

Transparent form for Delphi

I got the question if I could make one of my applications transparent. Well, I know it's possible but I have no clue on how to do it. I tried a lot of different examples on the web but none of them seemed to work with my Delphi 5 application. They also simply ignored the panel that I had on the form. Then I stumbled upon this link:

http://users.telenet.be/ws36637/transparent1.html

Simple code and real easy to implement. The example was well written and the code got the job done. Thanks Serhiy for it! Apparantly he has a page called the Delphi beacon at

http://users.telenet.be/ws36637/

I think I will spend a few more minutes on his page and see what he is doing. :)

Sunday, March 22, 2009

PDF for the programmer...

Since PDF is probably the de-facto format when distributing documents on the Internet today it's good to know how to generate such files. I will try to gather a couple of links here for PDF-programming and write a few lines if possible.

PDF Creator
http://www.pdfforge.org/products/pdfcreator
Has a free driver but fly2pdf which is the Active X library is not free for commercial use.

Sunday, February 8, 2009

Joomla/VirtueMart and restrict content

My customer requested that certain parts of VirtueMart only would be accessible if you are registered user. This is pretty easy when you have found the proper object to call. You need to retrieve the user object and then check if it has an ID:

$user =& JFactory::getUser();

if ($user->id > 0)
{ /* do code */}

That's all to it. When you have gotten the user-object you can of course access a whole lot more information which is documented in the user class. Below are two interesting links if you need to find out more.

http://api.joomla.org/Joomla-Framework/User/JUser.html

http://www.jlleblanc.com/joomla/Tutorials/JUser_tutorial_for_Joomla!_1%115/

Monday, February 2, 2009

VirtueMart not showing all related products...

Today I found a little bug in VirtueMart 1.13 or perhaps it's a feature. When using related products on your product page only 4 items of related products would show. If you modify
administrator/components/com_virtuemart/html/shop.product_details.php

at line 85:

$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '', ',' )) LIMIT 0, 4";

to

$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '', ',' )) ";

you remove this silly limit. Easy! :)

Sunday, February 1, 2009

VirtueMart experiences while building a pretty large site

Currently I am building a website with a whole lot of products and categories... well to be exact there is currently 22623 products and a total of 6973 categories! Yes, that's a whole lot of categories and some might think it sounds crazy but it gives an organized look and the number of products will rise up and probably beyond 100000 but the categories will probably remain the same.

Initially I wasn't aware of that the customer wanted to have these huge amounts of data in the system. Having run systems with less than 1000 products and 20 - 30 categories or so I figured that this customer was about the same ratio. Was I up for a big surprise...

The import of the product was done using a custom application built in Delphi that took the Excel-files and added the data directly into the MySQL-database. The categories was worse. They didn't exist! Adding all of them in VirtueMart would have taking forever as well. We also did experience a whole lot of slowness over the Internet since the test-site was located far away from us and due to issues with VirtueMart and Internet Explorer 7. I decided to create a small GUI in Delphi now titled "WorkMan ViMA", except a public release in a few months time. It allowed my customer to add multiple categories entered in a textbox and just selecting appropriate parent category in a treeview. Adding all of those categories was suddenly quite easy and fast.

The next big issue was the category menu at the frontpage - it was dead slow. After trying all possible menus and some Ajax-trees I found a plaintext XHTML-tree that was rock solid and fast as a racecar. I forgot the link but if I find it I will update this blog.

Issues with administration in Internet Explorer was also a nightmare. Operation aborted error popped up all the time. Out of chance we tried Firefox - what a difference! It actually works okay in there now. Future customers will have to download and install FF and use it for administration.

While working with products it occured that the search-possibilities aren't quite optimal when you have more than 10-20 categories or a whole lot of products. Hopefully someone is looking at this and provide a fix in a future update. I will look around for tweaks but I am not sure I will find one. Otherwise I will take a shot at adding better search possibilities than those that exists today.

Well, that's my initial take on VirtueMart and a whole lot of data. Expect to read more about it soon.