Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Saturday, March 17, 2007

Sitemaps - make Googlebot aware you have something for it

"The Sitemap Protocol is a dialect of XML for summarizing Sitemap information that is relevant to web crawlers. For each URL, you can include crawl "hints" like the last modified date and approximate change frequency."

There are many SEO techniques you can play with but this one has some important advantages:

  • it's easy to implement
  • shows results in a very short time
  • it's recommended and offered by Google so you won't get blacklisted
The reason you would want to use a Sitemap is that I'm sure you know your website better that Googlebot does. So why not sharing the knowledge and let it know what you think is important and what is not. I used to underestimate the power of sitemaps until I saw this (Googlebot activity spike) a week after creating the Sitemap for my website:



The first time I tried to use sitemaps I got lost in the protocol specifications that Google provides, the fact that Google Sitemap Generator is not as user-friendly as I expected and in the multitude of options you have for submitting your sitemap. Well, it seems that the whole process is simpler that I thought. Here are the only steps you have to follow:

1. Create or generate the sitemap
2. Make sure it is valid
3. Submit it
4. Update it

1. How to create a sitemap?
The following image shows a Sitemap in XML format. The Sitemap in the example contains two URLs, each of which is identified using the XML tag. In this example, a different set of optional parameters has been provided for each URL.


Due the fact that XML files are just text files you can create them by hand or, if you have a more then a dozen URLs, you can generate them using PHP. So, go write a simple "sitemap.xml" file. Even a small sitemap will help. Repeat the <url>...</url> block for each link you want to include and don't forget to close the <urlset> tag at the end of the file.

2. If it's not valid it has no value
The next step is validating your file. And this is a must because XML parsers are less error tolerant than HTML parsers. So if your file has errors it will not be processed. There are plenty of ways to validate your file but the most easy I found is using validome.org. Just upload it to your website and point the validator to it.


3. Let Google know you have a sitemap (or more)
Google has a service called Google Webmaster tools which we will use to upload our sitemap. After you log in (you will need a Google account for that) just go to the Sitemaps section and click "Add a sitemap". Hopefully, if everything is ok you will see something like this after a while:


4. Keep your sitemaps up to date
Your Sitemap is more valuable if it's up to date. That is it points to working URLs and parameters reflect the state of the links. So, don't forget to update them from time to time. This is it, good luck!



Thursday, February 22, 2007

A big promise: Rapid Application Development for PHP

CodeGear, the company responsible for continuing Borland's developer tools made an interesting announcement this week: Delphi for PHP ("a component-based rapid application development (RAD) IDE, and VCL for PHP, an open source visual component library"). Although the final product it's not yet available the promise they made - to deliver RAD productivity to PHP developers - sounds very good if we look at the promoted features:

  • VCL for PHP – Open source PHP 5 visual component library with more than 50 extendable and reusable components with seamless AJAX integration
  • Out-of-the-box database integration with InterBase, MySQL, Oracle®, Microsoft SQL Server, and other popular databases
    Integrated PHP debugger
  • Deployment of PHP applications on Windows, Linux, Solaris and other platforms
  • Internationalization support for applications
  • Drag and drop database application development using the Data Explorer for InterBase and MySQL
  • Code editor with Code Insight, Code Explorer, and Code Templates, making it easier and faster to write PHP code
Delphi for PHP is scheduled to be available in March. The product will be available for an introductory price of $249. I truly hope that CodeGear will not disappoint us with this and they will bring Delphi back to life in one form or another.

Two CSS videos

A few days ago I recommended you some videos related to web design and development. Being more and more interested in this subject I decided to look further and I found the two amazing videos (below) related to CSS. The author - Douglas Bowman from Stopdesign - managed to make them both inspirational and informative at the same time and if you are interested in this subject you will not waste time watching them. And even if you are not interested these can change what you think about designing a website.


No More Tables: CSS Layout Techniques



Creating Beautiful Interfaces With CSS

Tuesday, February 20, 2007

Virtual PC 2007 final available

Microsoft has made the full version of Virtual PC 2007 available for download from their web site. The program is available in both 32- and 64-bit versions, and is supported on all versions of Windows XP (except Home and Media Center Edition), Windows Server 2003, and Windows Vista. The file is a 30MB download and requires a 400MHz or faster (1GHz recommended) processor and enough RAM to support the desired configuration for the guest operating system plus the host.

Virtual PC lets you create separate virtual machines on your Windows desktop, each of which virtualizes the hardware of a complete physical computer. Use virtual machines to run operating systems such as MS-DOS, Windows, and OS/2. You can run multiple operating systems at once on a single physical computer and switch between them as easily as switching applications—instantly, with a mouse click. Virtual PC is perfect for any scenario in which you need to support multiple operating systems, whether you use it for tech support, legacy application support, training, or just for consolidating physical computers.

Microsoft first announced that they would be giving away Virtual PC for free when they made Virtual PC 2004 SP1 available on their web site. The new version adds the following features:

  • Support for Windows Vista as a host
  • Support for Windows Vista as a guest
  • Support for Windows Vista 64-bit as a host
  • Improved performance compared to Virtual PC 2004

Thursday, February 15, 2007

Useful web design/development videos

A few days ago I found a nice and very useful resource for anyone who has to do with web design or web development. The main content is a series of videos (offered for free by the author) centered around four main topics: CSS, JavaScript, PHP and MySQL. There are very easy to watch and practice lessons and if you are interested in this topics you will not waste your time. Here are the links and my "ratings":

CSS
CSS DIV-Layouts - USEFUL & MUST KNOW THIS
Cascading Style Sheets - Part I - USEFUL
Cascading Style Sheets - Part II - USEFUL
CSS “Absolute” and “Relative” Positioning - VERY USEFUL
Rounded Corners with CSS - USEFUL & POPULAR

PHP
PHP Basics - MUST KNOW THIS
PHP Conditional Statements - MUST KNOW THIS
PHP Custom Functions - MUST KNOW THIS
PHP and Arrays - MUST KNOW THIS
PHP Pagination - MUST KNOW THIS
Inserting MySQL Data with PHP - USEFUL
Query MySQL From PHP - Part 1 - MUST KNOW THIS
Query MySQL From PHP - Part 2 - MUST KNOW THIS
Query MySQL From PHP - Part 3 - USEFUL
Using Cookies in PHP - USEFUL
PHP “Include” and “Require” - MUST KNOW THIS
PHP Objects & Classes - Part I - USEFUL
PHP Objects & Classes - Part II - USEFUL & OOP KNOWLEDGE NEEDED
PHP Objects & Classes - Part III - USEFUL & OOP KNOWLEDGE NEEDED

JavaScript
Home-made Javascript WYSIWYG - I DON'T KNOW
JavaScript Voting Stars - NICE & POPULAR

Friday, February 9, 2007

The Developer Cheat Sheet Compilation

Nice compilation of cheat sheets (original post)

Command Line

Databases

Programming

Unix/Linux

Web Development

Miscellaneous Topics

Tuesday, January 16, 2007

PostgreSQL vs MySQL benchmark

Pushed by the latest news about MySQL stopping to provide Windows binaries and the split between a community edition and a enterprise server I started to look for other options. The first one is without doubt PostgreSQL. The first things you will hear about PostgreSQL is that it is technically superior to MySQL - and this is true - but way slower. There are few side by side benchmarks to be found so I thought to check the second statement using latest available versions.
The results are from a TPC-C like benchmark ("it combines read-only and update intensive transactions simulating the activities found in complex OLTP enterprise environments"). I used MySQL 5.0.27 (innodb) and PostgreSQL 8.2.1 with comparable memory and disc settings. Database size is about 80MB for each test (5000 - 300000 rows/table) and the number of concurrent users ranges from 1 to 20. I think this is a good testing scenario but if you have suggestions or other results please comment. Here are the results (500MHz PIII, 256 MB RAM, 2 IDE HDDs - client on different computer, 100MB/s network):

Transactions/second (MySQL, PostgreSQL)

Transaction graph MySQL
Transaction graph PostgreSQL
Timeout errors MySQL
Timeout errors PostgreSQL
Conclusions:
  • PostgreSQL was slower at populating the database.
  • MySQL is faster overall overall (~2x faster).
  • No timeout errors for PostgreSQL. Interesting.
  • Maybe there is more room for improvements in PostgreSQL config file.

More links on the subject:
http://monstera.man.poznan.pl/wiki/index.php/Mysql_vs_postgres
http://www.mysqlperformanceblog.com/2006/11/30/interesting-mysql-and-postgresql-benchmarks/
http://tweakers.net/reviews/657/6
http://tweakers.net/reviews/649/9
http://benchw.sourceforge.net/benchw_results_open3.html
http://www-css.fnal.gov/dsg/external/freeware/pgsql-vs-mysql.htm

MySQL no longer providing Windows binaries for free

MySQL AB have decided that Windows binaries will no longer be available for free from their web site. The source code will still be available for free download, but will have to be compiled before it is usable. If you take a look at the “community” edition download page you will notice that the latest source version is 5.0.33 and the latest compiled Windows binary is 5.0.27.

I find this very frustrating because, as many Windows developers do, I use MySQL and other open source software but I don't have the needed tools and time to learn how to compile/modify/tune the whole stuff. For me it's not just a "just compile it" situation as it might be for Linux users. And that's because I don't know and I don't want to spend time learning to do that. I don't feel that I need to spend time compiling MySQL. Here's what you need to compile the source:

  • Visual Studio .Net 2003 (7.1) compiler system
  • Between 3GB and 5GB disk space.
  • Windows XP, Windows 2000 or higher.
  • Patience (because it will take some time).

And if I have to pay to download Windows binaries then PostgreSql will suddenly start to look better in my eyes. I thing the guys are already throwing a party right now. Stupid move MySQL, stupid!

PostgreSQL vs MySQL benchmark

If you need more information sources (no binary :)):

http://www.planetmysql.org/kaj/?p=83
http://discuss.joelonsoftware.com/default.asp?biz.5.439544.15
http://ilia.ws/archives/153-MySQL-5.0.33-Community-Server.html
http://www.mysqlperformanceblog.com/2006/12/29/where-to-get-recent-mysql-version/

Tuesday, December 12, 2006

Things you can do to become a good manager

MOTTO: The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind (William James)

Communicate. Employees must be empowered with information so that they can make the best decisions, quickly and without the approval of higher-ups.
Do not think you know everything. Listen to the people around you. Ask for their input when appropriate. Seeking help from individuals with expertise in specific areas is a sign of strength, not weakness.
Delegate. You can't do everything yourself. And even if you could that would not be the most effective use of your time as a manager.
Accept responsibility. A common mistake made by managers is to either delegate blame or simply not accept responsibility for that which happens under their guidance. Eventually, avoiding responsibility will catch up with a manager and usually not bode well for his or her future.
Take time to get to know your people. Learn what makes them excited, how to motivate them, what they fear or worry about. Get to know them as individuals, because that's the only way you can effectively manage them.
Do not try to show everyone who's in charge. Everyone in your group already knows who the new manager is. You don't have to make a big show about being "the boss".
Be human. Just because you are the boss doesn't mean you can't laugh, or show emotion, or make an occasional mistake. Make doing a good job for your company fun.
Protect your people. It's your job to stand up for your people and make sure they are treated as fairly as possible. They will return the loyalty.
Set goals with your employees.
Effective performance starts with clear goals. It is up to you as a manager to meet with your employees to develop attainable goals and guide them in their efforts to achieve those goals.
Make the transition from worker to manager. Becoming a manager requires the development of a whole new set of business skills: people skills. Sometimes it is a tough transition, but with the proper tools and assistance, it will be a satisfying transition.
Learn as more as you can. Today, more than at any other time, managers must be ready to change if the situation changes.
Don't fool yourself that you can stop change.
Instead, concentrate your efforts on taking actions that make a positive difference in your business life. Learn how to adapt to change and use it to your advantage instead of spending your energy fighting it. But do not change everything. Don't re-invent the wheel.
Don’t get out of balance in your life. Our lives are made up of Seven Vital Areas: Health, Family, Financial, Intellectual, Social, Professional, and Spiritual. We will not necessarily spend time every day in each area or equal amounts of time in each area. But if in the long run, we spend a sufficient quantity and quality of time in each area, our lives will be in balance.
Get enough sleep.
For most people, they get the quantity of sleep, but they lack the quality of sleep. If you will plan your day, then work your plan, you will get more done, feel a higher sense of accomplishment, and experience less stress and enjoy a more restful night's sleep.
Take a lunch break.
Many do not take a lunch break, working through that time period in the hopes that it will give them more time to produce results. A lunch break, even a short fifteen minute break, gives us a chance to get our batteries all charged up again to more effectively handle the afternoon's challenges.

If you are not yet a manager pretend you are and use these advices. The results will be surprising!

Tuesday, December 5, 2006

WPF/E - Teach your browser new tricks

If you visited Channel9 lately it's impossible not to have noticed the Now with 100% more “WPF/E” text on the top of the page. So what is WPF/E? It is a cross-platform, cross-browser web technology that supports a subset of WPF(Windows Presentation Foundation) XAML. WPF/E supports programmability through javascript for tight browser integration. The WPF/E package also contains a small, cross platform subset of the CLR and .NET Framework that can run C# or VB.NET code. “WPF/E” is the Microsoft solution for delivering rich, cross-platform, interactive experiences including animation, graphics, audio, and video for the Web and beyond. Utilizing a subset of XAML (eXtensible Application Markup Language)-based Windows Presentation Foundation technology, “WPF/E” will enable the creation of content and applications that run within multiple browsers and operating systems (Windows and Macintosh) using Web standards for programmability. If this description doesn't tell you much I'm sure the images below will. If you are interested here are some resources you can use to find more:

  • “WPF/E” page on MSDN link
  • “WPF/E” Community Technology Preview download
  • Getting Started with "WPF/E" - screencast
  • Joe Stegman talks about the "WPF/E" CTP video
  • Celso Gomes : Designing in "WPF/E" video



SharpDevelop - a free and opensource .NET IDE


If you want to develop applications using C# and .NET you have two free choices: Visual Studio Express and SharpDevelop. I'm sure you know about the first so I'll make a short description of SharpDevelop because I know it deserves your attention. At the first glance it looks a lot like Microsoft's Visual Studio: it has a Start Page, Solution Explorer, Toolbox, Clipboard Ring, Class Viewer and Task List. The first think that you will notice is the small download size: 4.1 MB (compared to ~400 MB for VS Express CD). And that's because it's also written in C#. Here are some of SharpDevelop main features:

  • Forms designer for C#, VB.NET and Boo
  • Integrated debugger
  • Code completion for C#, VB.NET and Boo (including Ctrl+Space support)
  • XML Editing
  • Integrated NUnit support plus code coverage (NCover)
  • Refactoring support
  • Parser-based code converter (C# to VB.NET / Boo and more)
  • Code AutoInsert (Alt+Ins)
  • C# to VB.NET converter, as well as VB.NET to C# converter
  • Completely written in C#
  • Compile C#, VB.NET & Boo code in the IDE out-of-the-box
  • Open source, LGPL licensed
  • Xml documentation preview
  • User interface translated to many languages
  • Everything templated: add new project or file types, or even compilers to SharpDevelop
There are some minuses like support for ASP.NET development, web services tools and lack of built-in debugger but even so it's a nice tool for those who want to start learning .NET or want to hack a small application fast. It's another proof that free and open source software can be good. If you are a Linux user you may be interested in MonoDevelop, a port of SharpDevelop for the Mono version of the .NET Framework.

Fast install latest Apache, PHP and MySQL on Windows

The easiest way to install a WAMP (Windows, Apache, MySQL) suite is by using a pre-built package like WAMPServer. However there are some situations this approach will not work: maybe you need a PHP version released today or maybe you need a specific version of MySQL. You can always install these packages separately and it will take you no more then 10 minutes if you know the steps. I will present you the process for the latest versions available today.

1. Download the packages

2. Apache installation
  • Start apache_2.2.3-win32-x86-no_ssl.msi from your downloads folder
  • Click "Next" until you get to the "Server Information" dialog. Usually default settings will be ok so click "Next" again.
  • Choose "Custom" install and click "Next"
  • I usually choose a different folder for the server like "C:\Server\Apache\". This will help later when you will edit configuration files. Choose the path and click "Next" then "Install".
  • Open a browser and enter "http://localhost/" in the address field to see if all went well.

3. PHP Installation
  • Unzip your downloaded file (php-5.2.0-Win32.zip) to a folder (I will use "C:\Server\PHP\")
  • Rename php.ini-recommended from PHP folder to php.ini
  • Open Apache configuration file (httpd.conf) from "C:\Server\Apache\conf\" and add 3 lines at the end (replace "C:/Server/PHP" if needed):
    PHPIniDir "C:\Server\PHP\"
    LoadModule php5_module "C:/Server/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php
  • Click "Start > Run..." and enter "net stop apache2.2" to stop apache service
  • Click "Start > Run..." and enter "net start apache2.2" to restart apache service (this is needed to reload configuration file)
  • Now create a file called test.php in your web root folder (in our case "C:\Server\Apache\htdocs\") . The contents of the file should be:
  • Open a browser and enter "http://localhost/test.php" in the address field to see if all went well.

4. MySQL installation
  • Start mysql-essential-5.0.27-win32.msi from you downloads folder
  • Click "Next" and choose "Custom" installation type
  • Leave the default options selected and change the install folder if you want (I will use "C:\Server\MySQL\")
  • Choose "Next" then "Install"
  • I choose to skip registration but you may use it if you want
  • Make sure you let "Configure the MySQL Server now" checked before you click "Finish"
  • In the Server Instance Configuration Wizard click "Next" and chose "Detailed Configuration".
  • In the next screen I advise you to choose "Developer Machine" unless you plan to use this for a server.
  • Choose "Multifunctional Database" next.
  • Leave the default options for the "InnoDB Tablespace Settings" and click "Next";
  • Choose OLAP on the following page.
  • You can now click "Next" until you get to "Security Settings" page. Type a root password and write it down or make sure you will remember it.
  • Choose "Next" and then "Execute" to apply these settings.
  • To enable MySQL support for your PHP installation edit php.ini and uncomment (remove ;) the following line : extension=php_mysql.dll and modify the extension_dir parameter (to extension_dir = "c:\server\php\ext")
  • Apache needs a restart now so use "net stop apache2.2", "net start apache2.2" commands
  • All should be ready to go!
This is a simple procedure but I often get into trouble with it because I forget to set something. So I'll also use this when needed. I hope it helps!