David Huby’s Blog Technical and business stuff

10Aug/100

Android Development – ADT Eclipse error

I got Hello World working without any problems, but when getting the LunarLander example I ran into a bit of an issue ... "The project cannot be built until build path errors are resolved"

I found the solution at http://code.google.com/p/android/issues/detail?id=5509 (by Philip Lowman)

1. Right click in Package Explorer and choose Import
2. Choose "Existing project into workspace" under General
3. Click Browse next to "Select root directory"
4. Select the following folder in your android SDK directory:
samples/android-8/ApiDemos
5. Check the "Copy projects into workspace" box
6. Click Finish
7. The project should now build successfully.

Filed under: Programming No Comments
6Aug/100

Get started learning PHP

Someone I met the other day asked me how they could get started with PHP - should they do a course?

I don't think a course is the best way to start PHP - with so many good resources online you can get started and start writing practical PHP, and come back and use a book or do a course once you've already grasped the basics.

Tips

Make sure you understand

  • the control structures like if, while, the difference between for and foreach
  • most of the string manipulation functions
  • print and echo and the difference between them
  • some of the array manipulation functions

You will also want a really good grasp of how arrays work, it's a pretty long article but I'd read through the whole thing php.net/array . I think the biggest strength of PHP is its very flexible array implementation and understanding it well will give you a great deal of the benfits of PHP.

Once you have that covered move on to understanding the object oriented functionality that was introduced in PHP5.

Resources

Stackoverflow.com

This is a great resource for a number of languages. One of the cool things about having people who know all these different languages is they can look at something like PHP from a bunch of different perspectives. A lot of people say PHP is terrible, and they have their reasons ... But I also think that there are many cases where PHP is the best or most economically viable solution

http://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible

Some really good responses on this thread. This will give you more of a feel for the language at a bit of a higher level than the nuts and bolts of this or that function.

You can look at all the PHP threads here

http://stackoverflow.com/questions/tagged/php

php.net

Thisis the official resource. One handy thing about php.net is if you want to search for how to use strlen (string length) for example, just navigate to php.net/strlen and you will be redirected to that manual page. In the left hand column there will be a bunch of other similar functions to the one you just looked up - in this case string manipulation

phpclasses.org

This is sometimes good sometimes bad. they have a lot of resources on there but I've found some of the submitted code is unpolished. On the other hand I've used some email and graphing libraries from there and they have been fantastic.

So if you want to find a library to do something that you think might have been done before, sign up and check out this site, try things and be aware the first thing you download might not be the right tool for the job.

From time to time they also have great newsletter articles.

Filed under: Programming No Comments
8Mar/102

Single sign on in Sitecore

Even after going through the Active Directory and Custom Providers documentation with a fine toothed comb, there was still an issue with Single Sign On. Every time I hit sitecore/admin/LDAPLogin.aspx - the 'configuration test' for SSO, which had anonymous authentication disabled and Windows Integrated authentication turned on, I was presented with a pop up login box. After several failures using login details I knew to be correct, I was presented with a 401.1 Error Page.

It turns out this is due to custom host headers being used on a local site. You can read about this in more detail here at Microsoft support.

26Feb/100

Sitecore tip of the day – Rebuild Lucene Search Index

How do I rebuild a Lucene Search Index in Sitecore?

  • Log in to the Sitecore desktop at http://yoursite/sitecore/
  • Click the Sitecore button and open the Control Panel
  • Click on the Database group
  • Click Rebuild the Search Index
  • Select the indexes you wish to rebuild and click the Rebuild button
2Feb/101

TortoiseSVN icons not working in Windows 7

I have been having a problem where Tortoise SVN icons have not been appearing in Windows 7, and this seemed to fix my problem.

http://stackoverflow.com/questions/1057734/tortoisesvn-icons-not-showing-up-under-windows-7

Filed under: Programming 1 Comment
23Nov/090

Tool for duplicate code detection

I have spent some time evaluating freeware tools which can identify duplicate code.

I had mixed success with PMD/CPD, phpcpd, and others, until finally I came across Duplicate Code Finder. This is a visual tool compiled into a single 33KB exe, and seems to work perfectly.

Download link - http://www.gaijin.at/en/dldupcodefind.php

Only one downside - all the labels in the tool are in German, so you might need to keep a Google translate window open while you're using it...