Archive for the ‘How To’ Category

How to create a table with alternative row style using PHP?

Wednesday, July 27th, 2011

Table With Alternative Row Style

Figure 1: Table with Alternative Row Style

How to create a table with look and feel similar to Figure 1 from above? Follow these steps below:

 

Step 1: Create CSS style for the even an and odd class. In figure 2, the background color of the even and odd table are set to different variation of grey color.

CSS Odd Even Class

Figure 2: CSS Code for Odd and Even class

Step 2: Display array data in a table and set table row class to odd or even. Figure 3 displays the code for display the table from Figure 1.

PHP Code To Display Table with Alternative Row Styles

The array $tblData contains randomly generated integers. The variable $key is the array index and $value is the actual integers.

The key line of code to differ the odd and even row is:

The Key Line of Code for Differentiate Odd and Even Rows

($key & 1)  checks if the array index is even or odd. The code sets the table row style to even and odd according the array index.

Did you like this? Share it:

How to code in a team effectively?

Tuesday, July 19th, 2011

If you are an experience programmer, you probably already follow something similar to the suggestions listed in this article. When developers work by themselves, they do not have to understand or decipher other people’s code. However, when a team of programmers collaborate together on a deadline, coding effectively can change the quality of the product and the team atmosphere.

 

  1. Use a content management / sharing system. Normally, I use SVN for sharing information. SVN allow developers to create update, submit, and revert to any version of the code.
  2. Add comments appropriately. Developers should always comment on their code, so that others can easily understand what they are doing.

    Example: This is the PHP comment style I normally use for methods.

    /*=====================================*\
    name       : getComments()

    intro       : use this function to get comments from object

    input       : $parameters, $passed, $into, $the, $function

    output     : returned value type

    modify    : 2011-07-19 11:22:33 by Developer

    \*=====================================*/

  3.  

  4. Think like multiple people, not one person. When working in a team, the project is normally divided into different parts for different programmers to work on. While you are doing your own parts, you should design your code to easily integrate with everyone else.

    Example:  Programmer A designs and codes the general structure of software. Programmer B develops the methods called which are called in the general structure. If Programmer A think in position of Programmer B, Programmer A would think about which methods are used a lot or really similar to each other. The Programmer A would use a consistent name for that method, and leave room for Programmer B to develop a well packaged method. This way, when Programmer B thought of ways to package the methods, Programmer A do not have to change the general structures again.

 

There are plenty other ways to code efficiently. But if you follow these three tips, it would definitely speed up the development process.

 

Did you like this? Share it:

How to convert website visitors to Facebook likes?

Monday, July 18th, 2011

The like button is easy to install, highly standardize and tied directly with Facebook’s analytics platform which can provide you a lot of information about each like button’s performance.

The like button exists in three formats: a standard, which show the name of friends who likes the page (this format is available with or without pictures) as well as the total number of likes, a box count showing the number of likes in a large box above the like icon and the button count that displays the number of count in a smaller format.

clip_image002

A light and dark color scheme is available, as well as different fonts. Choose them carefully in order to either match your site’s look and feel or improve conversions by using a color scheme and font that stands out. Also, make sure that your like button is placed where users are most likely to click on it.

Like vs Recommend

The Recommend button is something worth testing because it implies something stronger than “like” and clicking on it can sometimes be more appropriate than clicking on the “like button”.

Liking vs Sharing on Facebook

Since February 2011, Facebook’s users have the opportunity to comment friend’s like which was prior that only possible with the share button. Considering this fact as well as the fact that Facebook is not developing the share button anymore, there is no need to have both buttons. The “Like” one is enough.

Source : http://searchengineland.com/how-to-convert-website-visitors-to-facebook-likes-70545

Did you like this? Share it:

How to shrink the data center: 4 lessons learned by NY City Health and Hospitals Corp.

Thursday, July 14th, 2011

The business that manages New York City’s hospitals consolidates 11 data centers into two facilities, dispensing with two-thirds of their physical servers for a predicted savings of $70 million over 5 years. The data centers serving the hospitals had reached the end of their usefulness and required a large number of staff to support. Rather than renovating the 11 data centers, the NYC HHC decided on consolidation. The healthcare system cut the 1,700 physical servers hosted in its data centers by 63 percent and reduced the staff needed to manage and maintain the consolidated data centers. Here are the 4 steps they followed :

1. Fast virtualization saves money

Each year, in order to maintain his eleven data centers, the NYC HHC had to replace hundreds of servers and supporting hardwares. By quickly virtualizing their servers and reducing the number of data centers, NYC HHC saved about $8 million by avoiding those upgrade costs.

2. Consolidation allows greening of the data center

Consolidation has allowed the company to spend on greener technology, such as a better cooling system because it only had to take care of two data centers instead of the previous 11 facilities.

3. Better service trough standardization

Enforcing better standardization during the consolidation process has resulted in greater efficiency. Patches and maintenance can be distributed much more efficiently because the standards allow automation. NYC HHC estimates that the company has improved efficiency by a factor of 10 in the past three years.

4. Don’t forget the help desk

They also brought together all the help desks in one facility using the same monitoring tools and ticketing systems. Compared to before the consolidation, support issues are resolved more quickly.

Source : http://www.cio.com/article/680132/

How_to_Shrink_The_Data_Center_4_Lessons_Learned?page=1&taxonomyId=3028

Did you like this? Share it:

How to Avoid IT Outsourcing Contract Disputes

Wednesday, July 13th, 2011

Outsourcing customers can mitigate the risk of costly disputes by insisting on clarity at the time the contract is executed and at the first sign of trouble, say Peterson and Kriss. Anticipating all the issues that may arise during an outsourcing relationship is difficult, but drafters of outsourcing agreements should try to address as many specific problems as possible upfront to save money and heartache later.

1. Provide Specific Examples of Damages
Outsourcing contracts may state that the parties can recover only “direct damages,” not “consequential” ones. But case law is unclear about what constitutes direct versus consequential harm, says Peterson. […]

2. Avoid Open-Ended Terms
Many outsourcing contracts state that the parties will attempt to reach agreement on an important provision after signing. That’s a mistake, according to Kriss, who advises clients to avoid leaving contract provisions unresolved for two reasons. […]

3. Provide Specific Examples of Material Breach of Contract
An outsourcing contract often states that the relationship can be terminated for “material breach.” But as with damages, case law is unclear about the definition of material breach, especially in a particular case, says Peterson. […]

4. Define Performance Standards
Many outsourcing contracts require conformity to “industry standards” or performance that is “appropriate,” “sufficient” or “best practice.” The problem with these adjectives, says Kriss, is that they have no clear meaning. […]

5. Require Written Notice of Customer Failure
When outsourcing disagreements arise, the supplier may blame the customer. Therefore, the contract should require the supplier to provide contemporaneous written notice to a specified officer of the customer when the supplier contends that the customer is failing to meet its obligations. […]

6. Provide Written Notice of Any Breach of Contract
Outsourcing customers can limit the cost of disputes and litigation even after the ink is dry. “The biggest mistake we see in dispute resolution is failing to send firm correspondence about breaches,” Kriss says. […]

Read More:

http://www.cio.com/article/685011/Outsourcing_How_to_Avoid_Contract_

Disputes?page=1&taxonomyId=3195

Did you like this? Share it:

How to outsource

Monday, July 11th, 2011

I just came across a very interesting article that gives some tips that every business owner should have in mind while outsourcing.

Here are a few

1. Select the areas you want to outsource:

Select the tasks that are going to save company’s money as well as the ones that are going to be better performed with the outsourcing that they are for the moment.

2. Choose your provider carefully

The provider should be seen as a partner so you have to take into account is culture, etc etc. Choose a provider that can understand your motivation and goals and that is flexible.

3. Get your foundations right

You need to include in the contract how the pricing works and how change is managed. You need also to establish a way to evaluate your provider.

4. Manage the transition

Don’t outsource work that takes more than 6 weeks for the provider to learn! If it is more, the cost of transition would be very high! Also, some employees may need to learn how to manage the partnership.

5. Hire a contract manager

He will be there to manage the relationship from an operational process perspective and to communicate change in the business to the supplier.

6. Don’t forget that you are not handing over the risk!

Keep in mind that you only transfer responsibilities. The risk remain yours !

You can read more at : http://business.timesonline.co.uk/tol/business/career_and_jobs

/article5182716.ece

Did you like this? Share it:

How To Import .sql File in Three Simple Steps

Wednesday, June 29th, 2011

Operating System: Windows

I’m writing this tutorial assuming your already know how to use windows operating system.

  1. If you don’t already have MySQL bin configured, you can access MySQL through the command prompt. First, you should locate your MySQL bin folder, then you need to change the command prompt directory to your MySQL bin folder.
    You can change directory by typing in: cd E:\filepath\mysql\bin
  2.  

  3. Now that you are in the MySQL bin directory,  you can open MySQL by type in the following:  
    mysql -u username -p
    Note: Replace username with your actually MySQL database username and enter your password. Then type in
    use databasename
    Replace databasename with name of the database you are importing the .sql file into.
  4.  

  5. Import .sql File
    Type in the following:  SOURCE filedirectory/filename.sql
    Note: Replace filepath with the directory path that contains your .sql dump file and replace filename with your actual .sql filename.
  6. Simple right?

    If you are still lost, here is the picture version

Did you like this? Share it:

How to obtain my IP Address?

Monday, June 13th, 2011

Out of curiosity, I was browsing through a list of how to questions. I noticed that How to obtain my IP Address was one of these frequently asked questions. So how do you obtain your computer’s IP Address?

You can just visit http://whatismyipaddress.com/ or you can find your IP Address through the command prompt.

In order to open the command prompt, you’ll have to go to the start menu and type “cmd” in the dialog box. After the command prompt opens, you can type in “ipconfig” to view the simplified IP Address details or “ipconfig /all” to view everything.

Did you like this? Share it: