Protothreads are a type of extremely lightweight threads - each protothread requires only two bytes of memory - that are usually used for embedded firmware programming, where memory is at a premium. Protothreads combine the low overhead with event-driven programming with the algorithmic clarity of threaded programming.
Larry Ruane from LeftHand Networks Inc. has written a protothreads library for Unix systems that, unlike Adam Dunkels' original library, contains a complete scheduler that allows several protothreads to run inside a regular thread. Ruane's protothreads are implemented in less than 400 lines of C code using gcc's labels-as-values feature. The project wiki has a thorough explanation of how protothreads work and how they are intended to be used. The open source code can be downloaded from the project's SourceForge page.
Read More...
Monday, February 9, 2009
Thursday, January 29, 2009
Joomla! 1.5 FAQ:Where is the Static Content Item?
Before Joomla! 1.5, the so called Mambo-Joomla connection version, there were two separate process of creating a content item.
Remember the two Types of Content Items for the “Mambo-Joomla connection version? They were known as Static Content Item usually used for About Us and the “Duh” Content Item which is associated with Sections and Categories …
Hands-on! exercise:
Create a Static Content Item? (About us | Mission Vision | Permanent Information
Create “Duh!” Content Item? (Ever changing contents, company updates)
With Joomla 1.5, the two entities have been combined. No more Static and no more “Duh” Content Item.
Read More..
Remember the two Types of Content Items for the “Mambo-Joomla connection version? They were known as Static Content Item usually used for About Us and the “Duh” Content Item which is associated with Sections and Categories …
Hands-on! exercise:
Create a Static Content Item? (About us | Mission Vision | Permanent Information
Create “Duh!” Content Item? (Ever changing contents, company updates)
With Joomla 1.5, the two entities have been combined. No more Static and no more “Duh” Content Item.
Read More..
How to Move Your Joomla! Site to a New Server
Why not use a fresh install?
In my case, I probably could have. I only had about 4 or 5 articles on the test site, and I am using relatively few 3rd party CMT's (JomComment, TagBot, and JoomlaXplorer). But, I decided it would be easier just to move the installation I had to the new server, so I did.
You will want to move your Joomla! installation rather than re-install if you fit one or all of the following parameters:
Your site has accumulated a large amount of data in the database over time (sections, categories, content items, contacts, newsfeeds, etc.).
Your site uses multiple 3rd-part extensions already configured and/or customized for your site.
You just feel like trying it out to see if you can do it.
Step 1: Backup everything!
The first thing you want to do is backup all files within your Joomla! installation. Create a folder on your local system, and download all files to that folder using your ftp client application. I used FileZilla as my ftp client application to download all of my files to a folder on my desktop I named "howtojoomla".
Step 2: Export your database
Note: For this step, it really helps if you have phpMyAdmin installed on your server. Most hosting companies have phpMyAdmin already installed. If you are unsure, ask your hosting provider.
The second thing you need to do is export your Joomla! database. The best thing to do is to export it into an SQL file, which makes importing it easier in a later step. An SQL file will contain all of the necessary SQL commands for creating your database tables and filling them with your data. Be sure you export the entire database.
Step 3: Modify configuration.php
This step is very important. Go to the folder on your local system to which you downloaded all of your Joomla! files. In the first level folder, you will find the file named "configuration.php". Open this file with a text editor and make the necessary changes. At the very least, you will probably need to change the following parameters:
$mosConfig_absolute_path: This is the absolute server path to your new Joomla! installation. It will probably look something like "/path/to/joomla/installation".
$mosConfig_cachepath: This is the absolute server path to the cache for your Joomla! installation. It will probably look something like "/path/to/joomla/installation/cache".
$mosConfig_live_site: This is your website's url. It will be something like "http://www.yoursite.com".
$mosConfig_host: This is the location of the server that hosts your MySQL database. For most instances, this value will be "localhost". If you are unsure, ask your hosting provider.
$mosConfig_db: This is the name of your MySQL database.
$mosConfig_user: This is the database user name. Make sure this user has all privileges on your database.
$mosConfig_password: This is the password for your MySQL database user.
Step 4: Upload all of your files to your new server
Using an ftp client application (like FileZilla), upload all of your files to the location on your new server where you want to install Joomla!.
Step 5: Import your database to your new MySQL server
Using phpMyAdmin (or console commands if you are an advanced database administrator) and the SQL file you generated in step 2, import your old database into your new database.
Step 6: Test your new installation
Your move should now be complete, but please don't take my word for it. Test your site to make sure that everything is in it's proper place and working the way you expect it to. For example, if you did not use relative url's for your links on your old site, they will not work properly on your new site.
Read More...
In my case, I probably could have. I only had about 4 or 5 articles on the test site, and I am using relatively few 3rd party CMT's (JomComment, TagBot, and JoomlaXplorer). But, I decided it would be easier just to move the installation I had to the new server, so I did.
You will want to move your Joomla! installation rather than re-install if you fit one or all of the following parameters:
Your site has accumulated a large amount of data in the database over time (sections, categories, content items, contacts, newsfeeds, etc.).
Your site uses multiple 3rd-part extensions already configured and/or customized for your site.
You just feel like trying it out to see if you can do it.
Step 1: Backup everything!
The first thing you want to do is backup all files within your Joomla! installation. Create a folder on your local system, and download all files to that folder using your ftp client application. I used FileZilla as my ftp client application to download all of my files to a folder on my desktop I named "howtojoomla".
Step 2: Export your database
Note: For this step, it really helps if you have phpMyAdmin installed on your server. Most hosting companies have phpMyAdmin already installed. If you are unsure, ask your hosting provider.
The second thing you need to do is export your Joomla! database. The best thing to do is to export it into an SQL file, which makes importing it easier in a later step. An SQL file will contain all of the necessary SQL commands for creating your database tables and filling them with your data. Be sure you export the entire database.
Step 3: Modify configuration.php
This step is very important. Go to the folder on your local system to which you downloaded all of your Joomla! files. In the first level folder, you will find the file named "configuration.php". Open this file with a text editor and make the necessary changes. At the very least, you will probably need to change the following parameters:
$mosConfig_absolute_path: This is the absolute server path to your new Joomla! installation. It will probably look something like "/path/to/joomla/installation".
$mosConfig_cachepath: This is the absolute server path to the cache for your Joomla! installation. It will probably look something like "/path/to/joomla/installation/cache".
$mosConfig_live_site: This is your website's url. It will be something like "http://www.yoursite.com".
$mosConfig_host: This is the location of the server that hosts your MySQL database. For most instances, this value will be "localhost". If you are unsure, ask your hosting provider.
$mosConfig_db: This is the name of your MySQL database.
$mosConfig_user: This is the database user name. Make sure this user has all privileges on your database.
$mosConfig_password: This is the password for your MySQL database user.
Step 4: Upload all of your files to your new server
Using an ftp client application (like FileZilla), upload all of your files to the location on your new server where you want to install Joomla!.
Step 5: Import your database to your new MySQL server
Using phpMyAdmin (or console commands if you are an advanced database administrator) and the SQL file you generated in step 2, import your old database into your new database.
Step 6: Test your new installation
Your move should now be complete, but please don't take my word for it. Test your site to make sure that everything is in it's proper place and working the way you expect it to. For example, if you did not use relative url's for your links on your old site, they will not work properly on your new site.
Read More...
Monday, January 26, 2009
Firefox -Features and advantages
Firefox 3 is relatively a new software. With recent improvements, the browser has gained immense popularity. The biggest advantage of using this software is that it has a small installation, multiple shortcuts features, tabbed browsing, integrated Google search, large viewing area, integrated popup ad blocking, friendly design, clean interface and no noticeable security holes. Firefox 3 will also work well with your Outlook email, browser plugins like Shockware. In spite of its small flaws, the browser is excellent.
Firefox pros: Firefox is amazingly lean: If you download and install Firefox , it will just take around 4.9MB of disk space. That is why many prefer Firefox when it comes to downloading a browser as it does not consume lot of disk space. In short, Firefox doesn't suffer from the flaw of being overweight. This 4.9MB install doesn't include plugins like Flash player, Shockwave, Java virtual machine, but these features can always be added through minimum effort.
Firefox supports user keystrokes and shortcuts: Both power users and novices find shortcuts like CTRL-Enter for completing URLs, “Type Ahead” and CTRL-T for launching new tabs. You will definitely find that Firefox is far better than its competitors.
Integrated popup blocking: With Firefox, you won't be able to see those popup ads as Firefox shuts down those advertisement for you. There is absolutely no need for installing 3rd party software. Just set the Firefox options to prevent pop-ups.
Firefox can also prevent those annoying Javascript code: Firefox prevents from moving or resizing your window and hiding the status bar.
Larger viewing area: With smaller toolbars, you can fit 10 percent more surface area. Isn't that amazing?
Nifty bookmarking features: If you like a particular site, you can always bookmark that site as well as organize multiple tabs.
The best feature of Firefox are as follows:
Tabbed browsing: This feature will allow to open multiple windows in one browser at once. Now there is no need to download 40 Megabytes of browser code every time, you want to open a new website. Just use this tabbed browsing feature to open a new website in the same window.
Each new tab will add less than 1 megabyte of overhead load. You have to just press Ctrl-T to open Google Window, a news window, a Hotmail window, multiple browsing screens and even Iceberggradio.com. This is especially useful for those on dial up who wish to multi-task. For instance you can check your email while waiting to open slow pages of some other website. Firefox also allows creation and saving of a large number of window tabs than any other web browser does. People who are professional web surfers find this feature extremely useful.
Firefox is a great browsing tool and there is ample evidence to prove it. Although, there are issues with Firefox, they are small and not serious. These deficiencies are negligible and your work will hardly get affected even if these issues are present in your Firefox. Even if these glitches are there, you can easily resolve them by following some simple steps.
Read MOre..
Firefox pros: Firefox is amazingly lean: If you download and install Firefox , it will just take around 4.9MB of disk space. That is why many prefer Firefox when it comes to downloading a browser as it does not consume lot of disk space. In short, Firefox doesn't suffer from the flaw of being overweight. This 4.9MB install doesn't include plugins like Flash player, Shockwave, Java virtual machine, but these features can always be added through minimum effort.
Firefox supports user keystrokes and shortcuts: Both power users and novices find shortcuts like CTRL-Enter for completing URLs, “Type Ahead” and CTRL-T for launching new tabs. You will definitely find that Firefox is far better than its competitors.
Integrated popup blocking: With Firefox, you won't be able to see those popup ads as Firefox shuts down those advertisement for you. There is absolutely no need for installing 3rd party software. Just set the Firefox options to prevent pop-ups.
Firefox can also prevent those annoying Javascript code: Firefox prevents from moving or resizing your window and hiding the status bar.
Larger viewing area: With smaller toolbars, you can fit 10 percent more surface area. Isn't that amazing?
Nifty bookmarking features: If you like a particular site, you can always bookmark that site as well as organize multiple tabs.
The best feature of Firefox are as follows:
Tabbed browsing: This feature will allow to open multiple windows in one browser at once. Now there is no need to download 40 Megabytes of browser code every time, you want to open a new website. Just use this tabbed browsing feature to open a new website in the same window.
Each new tab will add less than 1 megabyte of overhead load. You have to just press Ctrl-T to open Google Window, a news window, a Hotmail window, multiple browsing screens and even Iceberggradio.com. This is especially useful for those on dial up who wish to multi-task. For instance you can check your email while waiting to open slow pages of some other website. Firefox also allows creation and saving of a large number of window tabs than any other web browser does. People who are professional web surfers find this feature extremely useful.
Firefox is a great browsing tool and there is ample evidence to prove it. Although, there are issues with Firefox, they are small and not serious. These deficiencies are negligible and your work will hardly get affected even if these issues are present in your Firefox. Even if these glitches are there, you can easily resolve them by following some simple steps.
Read MOre..
10 Handy Video plugins for WordPress
1. Viper’s Video Quicktags
This plugin adds on new buttons to the rich text editor on WordPress. In order to embed a video, you just need to paste the video URL into the prompt box. With this plugin you can also fully configure the width, height, colors and alignment on the page.
2. Smart YouTube
The main function of the plugin is to correctly embed YouTube videos into your blog post. It’s designed to be small and fast with customizable options for colors, border, full screen etc.
Don’t worry about the visual mode messing it up.
3. Interactive Video Plugin
Apart from video embed this plugin also includes the ability to upload/ record/import videos directly to your post, edit and remix content with an online video editor. You can even enable video responses, manage and track your video content.
Includes custom sizing of the video player, advanced sharing options and allow readers and subscribers to add video and audio comments.
4. Embedded Video
Using this plugin the videos can be integrated from external sites or they can be uploaded to the web server or a remote server and integrated as well. Additionally, a corresponding link to the video on the particular video page or a download link to the local file can be generated automatically, if demanded.
5. Video Widget
In order to embed videos using this plugin only the video id is required and no HTML code to paste.
6. Flash Video Player
This plugin allows the addition of videos into WordPress by using a menu with post-level overrides for customization of size, background color etc.
7. Video Embedder
To embed a video using this plugin, all you need is the ID of the video. With this plugin you can manage the settings for all of your embedded movies from the WordPress settings for Video Embedder, the properties for all the movies will be updated instantly as soon as you save the settings.
8. EasyTube
This plugin allows you to easily embed YouTube and Google Videos using one simple tag and places a preview image of the YouTube videos in your RSS feed linked to the video.
9. Youtuber
This plugin lets you embed YouTube videos in your posts very easily using simple tags.
It also includes an option to set the width and height of the videos.
10. FLV Embed
This plugin supports video sitemap generation, includes options such as auto start and menu control bar. It also supports text only output for RSS that prompt readers to visit the original post for Flash content.
Read MOre..
This plugin adds on new buttons to the rich text editor on WordPress. In order to embed a video, you just need to paste the video URL into the prompt box. With this plugin you can also fully configure the width, height, colors and alignment on the page.
2. Smart YouTube
The main function of the plugin is to correctly embed YouTube videos into your blog post. It’s designed to be small and fast with customizable options for colors, border, full screen etc.
Don’t worry about the visual mode messing it up.
3. Interactive Video Plugin
Apart from video embed this plugin also includes the ability to upload/ record/import videos directly to your post, edit and remix content with an online video editor. You can even enable video responses, manage and track your video content.
Includes custom sizing of the video player, advanced sharing options and allow readers and subscribers to add video and audio comments.
4. Embedded Video
Using this plugin the videos can be integrated from external sites or they can be uploaded to the web server or a remote server and integrated as well. Additionally, a corresponding link to the video on the particular video page or a download link to the local file can be generated automatically, if demanded.
5. Video Widget
In order to embed videos using this plugin only the video id is required and no HTML code to paste.
6. Flash Video Player
This plugin allows the addition of videos into WordPress by using a menu with post-level overrides for customization of size, background color etc.
7. Video Embedder
To embed a video using this plugin, all you need is the ID of the video. With this plugin you can manage the settings for all of your embedded movies from the WordPress settings for Video Embedder, the properties for all the movies will be updated instantly as soon as you save the settings.
8. EasyTube
This plugin allows you to easily embed YouTube and Google Videos using one simple tag and places a preview image of the YouTube videos in your RSS feed linked to the video.
9. Youtuber
This plugin lets you embed YouTube videos in your posts very easily using simple tags.
It also includes an option to set the width and height of the videos.
10. FLV Embed
This plugin supports video sitemap generation, includes options such as auto start and menu control bar. It also supports text only output for RSS that prompt readers to visit the original post for Flash content.
Read MOre..
Friday, January 23, 2009
Google offers help transplanting your blog
Google on Friday released an open-source project, Google Blog Converters, intended to help people move their blogs from one service to another.
There are a number of popular publishing systems for housing blogs, some of them services and some of them software people can run on their own servers. But if you want to change infrastructure, it's rough going. Information isn't necessarily locked up and inaccessible, but the practical barriers of moving it to a new publishing system are high.
Google, which actually has a "data liberation team," announced the Blog Converters project to deal with the situation. It released a collection of libraries and scripts, written in the Python language, that converts between the export formats of LiveJournal, MovableType, WordPress, and Google's own Blogger service, said J.J. Lueck of the team in a blog posting about the Blog Converters project.
That means that a person could convert an exported file into a format another blog system comprehends, permitting the data to be imported into the new system. That could make it easier for a person to move to Google's own service--but also to move off it.
Of course, you'll have to be proficient in running Python scripts to use the technology. But it could get easier soon: Google said the scripts can be hosted on Google App Engine, its service for running Web-based applications written in Python, so perhaps somebody will set up some tools to make blog migration easier for the non-programmers out there.
Future versions of the technology will support the BlogML data format and a mechanism to synchronize blogs with services that have an API (application programming interface) for accessing data but not import-export abilities.
Read More...
There are a number of popular publishing systems for housing blogs, some of them services and some of them software people can run on their own servers. But if you want to change infrastructure, it's rough going. Information isn't necessarily locked up and inaccessible, but the practical barriers of moving it to a new publishing system are high.
Google, which actually has a "data liberation team," announced the Blog Converters project to deal with the situation. It released a collection of libraries and scripts, written in the Python language, that converts between the export formats of LiveJournal, MovableType, WordPress, and Google's own Blogger service, said J.J. Lueck of the team in a blog posting about the Blog Converters project.
That means that a person could convert an exported file into a format another blog system comprehends, permitting the data to be imported into the new system. That could make it easier for a person to move to Google's own service--but also to move off it.
Of course, you'll have to be proficient in running Python scripts to use the technology. But it could get easier soon: Google said the scripts can be hosted on Google App Engine, its service for running Web-based applications written in Python, so perhaps somebody will set up some tools to make blog migration easier for the non-programmers out there.
Future versions of the technology will support the BlogML data format and a mechanism to synchronize blogs with services that have an API (application programming interface) for accessing data but not import-export abilities.
Read More...
Thursday, January 22, 2009
Basics of looping in PHP
Loops are an integral part of PHP, and many other programming languages for that matter, the basics covered here would apply to javascript as well, even the code is very similar. A loop is simply a block of code that executes multiple times, controlled either directly, by explicitly telling the script to execute “X” times, or by using a variable, telling the script to execute “as many times as the exact hour at the time of viewing” for example.
So why do we use loops? There are hundreds and hundreds of reasons, the widest usage is probably to cycle through values of some sort of data. For example, you might be writing a messaging system in PHP, which would allow users of your website to send private messages to each other once they register. You would write a MySQL query which would pull all the user’s letter from the database. To show all the letters you would use a loop to show all the rows of the query (all the separate messages) on a page.
To create a loop you need to add some rules which will dictate how the loop should behave. Usually we need to give three values, the starting value of the counter (which tells the loop how many times it has executed), an ending value (which tells the script to stop looping if it is reached) and an increment, which deals with changing the starting counter value in some way (so that it eventually reaches the end value, hence ending the loop).
Read More..
So why do we use loops? There are hundreds and hundreds of reasons, the widest usage is probably to cycle through values of some sort of data. For example, you might be writing a messaging system in PHP, which would allow users of your website to send private messages to each other once they register. You would write a MySQL query which would pull all the user’s letter from the database. To show all the letters you would use a loop to show all the rows of the query (all the separate messages) on a page.
To create a loop you need to add some rules which will dictate how the loop should behave. Usually we need to give three values, the starting value of the counter (which tells the loop how many times it has executed), an ending value (which tells the script to stop looping if it is reached) and an increment, which deals with changing the starting counter value in some way (so that it eventually reaches the end value, hence ending the loop).
Read More..
Subscribe to:
Posts (Atom)
