A PHP function for the Fibonacci sequence

I was recently asked as a test to write a function that outputs the Fibonacci sequence in PHP. Here it is:

No one wants to die

No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma — which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

-Steve Jobs

Getting MySQL and PHP running on Terminal with XAMPP

I have XAMPP setup on my Mac. Getting MySQL and PHP to run in terminal didn’t work after installation. To be able to run mysql and php you have to add the xampp application to the .bash_profile file in your users home directory.

To check that it has worked, open a new terminal session and type in:

Both should point to /Applications/xampp/xamppfiles

Recursively remove .svn folders on Windows

I’m not an SVN guy; I love my GIT but, sometimes you inherit projects where SVN was the choice used for version control. There are many ways to do this of course but my preferred method is creating a Batch (.bat) file in the root of the target folder, add this line and run it.

Why do some startups fail?

There are many variables that are instrumental to the failure of a startup. Having a failed startup myself, I studied and analyzed my thoughts and actions during this period to see what I did wrong; and what I could have done to improve the process of beginning and maintaining my startup. I wish I would have been more knowledgeable or had a mentor to coach me through some of the surprises and feelings I encountered but, sometimes the process of learning is a lonely and difficult one, and one that you’ll never forget. So, I would like to share some of the insights that I’ve gathered from my journey and hopefully, you won’t make the same mistakes I made.

My first mistake

I was 22 years old and not thinking large in terms of starting a full scale business.my-first-mistake I always knew I wanted to be an entrepreneur, but lacked the knowledge of starting, running or even owning a business. One thing was certain though, I wanted to be a free man. We all want that freedom; freedom of money to buy what we want, freedom of time to go to the gym, spend more time with our families, kids, friends, travel, etc. Although all achievable, freedom doesn’t come easy; it’s something that you have to work hard to attain.

While I was working in a residential building I came up with an idea that was so simple and useful that I was surprised nobody had thought of it before. This also made me think twice about the success of my idea. Like most inceptions of startups, scarcity and necessity are the catalysts of invention. Regardless of this fear I had, I decided to go with my gut instinct and move forward with building a beta version.

My idea was to build an application that would aid in the automation of the day to day tasks of building staff. I quickly saw the need for this type of an application and how it would make the staff work more efficiently, while providing better service to the residents. I was in school taking programming courses and saw this as the perfect opportunity to perfect and hone my skills in programming and venture into the startup world.

I finished writing this software, a touch screen based access control system, pitched it and successfully sold it for under 20k. This was a huge achievement for me in life and my dream of being an entrepreneur. I was so sure of myself and proud of my creation that I made the biggest mistake in my life. I got comfortable with paying myself meager wages and never grew the business or continued to market my product. Not before long, other companies sprouted up providing software based on this idea.

What I learned from my experience

You should always run your business in startup mode. What I mean by this, is that you should never stop improving or evolving the ideas or features of your product or service. Your business is like a child; It constantly needs nurturing and direction. Just like a parent’s job never ends, you should never get comfortable just because your business is doing well, or not. Avoid being stagnant at all costs.

Fear

fearFear is one of the biggest initial drivers of startup failure. As much as we all want to be successful in life, success-fullness and fear are synonymous. Early entrepreneurs are fearful of their idea and all the hard work and hours spent on building their startup; all with the possibility of failure. I have to admit it’s frightening! Before my co-founder and I launched Nice Emails, it seemed like it took us forever to launch and it did. We wanted everything to be perfect and wanted to keep adding features to make certain that we had a product our customers would love. This form of fear, is what kept us from launching so long.

Your idea or product isn’t viable

It’s not what we like to hear of course, but sometimes our ideas don’t flourish into something successful. Take it as a learning experience and before you invest your time or money, question some friends or even strangers about your idea. A fair amount of market research should also be performed before you invest resources into your idea. A lot of people have this notion that if they share their idea or put it out in the open, that someone will steal it. That’s very unlikely and should not stop you from doing market research. You can lose much more pouring time and resources into a product that won’t amount to anything.

There are several things you can do before you release your full-scale product to get a feel for how your audience will take to your idea:

  • Create a Coming Soon Page – Before we launched Nice Emails, we created a coming soon page with a sign-up box. This helped us inform people when we launched, letting us know if we had a product that was viable and if people were even going to be interested in our product.
  • Release a closed Beta Version – Provide special invitations to industry blogs, people, PR/News outlets and anyone influential that can help you get the word out. If they enjoy your product, they’ll be sure to let you and everyone know about it.
  • Don’t be afraid to do things manually at first. Not everything needs to be automated in the beginning. Think big, but start small.

Focusing on too many features

focusing-on-too-many-featuresAs I mentioned earlier, focusing on too many features caused the delay of launching Nice Emails. This Feature Creep can destroy your product or idea from having any chances of survival. As an entrepreneur or developer, you want your product to be the best in the market right? So we load it with every imaginable feature for the customer to fall in love with. This philosophy is incorrect. People like features but, features that are useful and usable. Nobody likes features that are bloated and make it more difficult or complicated to use your product.

Focusing on the quality and usability of a feature rather than the quantity of features is the ultimate goal. This will benefit you in many ways such as:

  1. You’ll get to launch your product quicker
  2. You’ll get feedback from customers regarding features that they would love to see and actually use in your product.

Getting feedback from customers doesn’t have to be difficult either. There are several free products on the market that can aid you in getting constructive feedback from your customers. I’ve listed some of them here:

Poor customer support

poor-customer-supportSupport is paramount in having a good rapport and continuing a relationship with your customers. A lot of people dismiss this after the sell. This is what keeps your customers coming back for more. Here are some things you could be doing to improve the lines of communication with your customers.

  • Always make it easy to reach you.
  • Get back to your customers in less than 24 hours.
  • Setup an auto-responder when someone contacts you stating that you received their email and it will be answered shortly.
  • Offer a live chat if you can afford it.

Having a twitter account can also be very beneficial to providing good customer support for your business. It can be utilized as a tool for informing and even customer service.

A couple of months ago, I was having some frustrations with the hosting company SITE5. I tweeted about my frustration (http://twitter.com/#!/rcastera/status/15487334980001793) and got an immediate response from the president (@BenAtSite5) of the company! I was more than surprised and very intrigued. He made sure that all of my concerns were taken care of promptly. This kind of service is what will make me remain a loyal customer.

Presentation and communication

Your home page is the most important page on your site. It needs to effectively communicate what you’re offering and provide call-to-actions to engage your visitors. The copy on the page should be short and digestible. Use images, big headlines and clean fonts to get your point across. Your product page is the next important page. You visitor wants to easily discern information regarding your product or service. The headlines, fonts, colors and layout are all influential on their decision making.

Split testing can be a great tool in determining what colors, button & image placements produce the best results. Here are some that I’ve used or recommend:

Visibility of social networking activity is another important factor in showing that your active and involved in your product. In today’s market people look for social networking sites to see if you foster a following behind your product and if people are speaking positively about them. Make sure it’s easy to find your company’s product or service on your website.

Poor pricing model

Finding the perfect pricing strategy is difficult. This is something that you’ll want to think of carefully before you launch and not change to often after you launch. You’ll have to do a fair amount of research on based on your competitors and the market in general.

I always find it difficult to price my products or services. I usually try to keep it really simple and charge for my time and how useful I actually think it is. There are tons of methods and even software to help you determine the “right price”. At the end of the day, you have to make sure that your making enough to cover the cost of startup, time invested and profit.

Not enough marketing

Now that you’ve spent all of your time working on your fantastic product, don’t neglect to have a solid marketing plan in place. I should take some of my advice on this one because we have yet to market our new startup. Here are some things that you should look into:

Not capable of handling fast growth

There is nothing worse then experiencing failure because you miscalculated stock, traffic or some other issue. But you have to look on the bright side; the fact that your product or service is experiencing this, is actually a good sign. It means your product is viable 🙂 nevertheless, you have to be prepared for growth. Make sure you choose a hosting provider that can scale your account if need be, try to anticipate stock quotas and be prepared to move quickly if something should arise.

Not taking care of yourself

not-taking-care-of-yourselfIt’s something that early entrepreneurs can neglect. Your health is something that can take a toll while building your startup. Taking care of yourself is taking care of your business. Make time for yourself to train, eat properly and sleep. This allows you to be more creative. Working constantly has a negative effect on productivity.

Conclusion

Most startups do not become successful overnight. It takes a lot of hard work, blood, sweat and tears to end up with a successful end-product so, don’t be discouraged if you don’t start making money overnight like we all hope for our ideas. If you remember anything from what you’ve read today, a startup is like a baby; It has to be nurtured and taken special care of. Good luck!

Drupal – How to install Drush

What is Drush?

It’s a command line shell and scripting interface for Drupal. The Drush Package Manager allows you to download, enable, disable, uninstall, update modules/themes/profiles/translations from the command line in a very simple way (apt-get style) – just type,

and

in a Drupal directory to install the Views project! Additionally, the Drush Package Manager also allows you to update all your modules and even Drupal core with just one command,

How to install Drush

  1. Download the current version of the Drush Package from the Drupal website.
  2. Upload the folder to the root directory of your server. I did this on a shared environment.
  3. Login to your server via shell.
  4. Make the ‘drush’ command executable:
  5. create an alias to drush:
  6. Now, you must log out and then log back in again or re-load your bash configuration file to apply your changes to your current session:
  7. Start using drush by running “drush” from your Drupal root directory.

5 ways to test the Usability of your E-commerce Site

Usability testing is a technique used to evaluate a product, service or website by testing it on users and it’s good practice to perform tests in combination with Split testing. Having an e-commerce site myself, I had to pay special attention to the elements on pages and where my products are positioned in relation to the page. There are so many variables involved in optimizing the usability of page such as dimensions, colors, copy, etc. If users cannot find your product, then they cannot buy it either.

There are many methods for studying usability, but the most basic and useful is done through user testing. Here are some tools to help you in studying if your missing out on sales, and what you can do to improve conversions.

FiveSecondTest.com

Fivesecondtest helps you fine tune your landing pages and calls to action by analyzing the most prominent elements of your design. Here’s how it works:

  1. Upload a screenshot or mockup, set some questions you want answered and wait for the feedback to roll in!
  2. Testers have five seconds to view your image and must then answer the questions you have set.
  3. We collect all of the responses for you, extract the frequent keywords and then present the data with beautiful graphs.

UserTesting.com

UserTesting.com’s discount usability testing helps website owners discover why people leave their website, without the hassle and expense of traditional usability testing. Here’s how it works:

  1. Sign Up in 3 Minutes.
  2. We Notify our User Panel.
  3. Get Results in as Little as an Hour.

Usabilla.com

Whether you’re looking to test out an experimental layout, a full-fledged mock-up or a working website, Usabilla’s usability testing platform combines power with simplicity, offering insight minus manual labor. Here’s how it works:

  1. Create a test.
  2. Select your pages.
  3. Select questions.
  4. Invite your users.
  5. Analyze feedback.

Userfly.com

Run instant usability studies for your website using your real users. Watch movies of your users’ browsing sessions to analyze their behavior and optimize your forms, landing pages, and conversion rates. Web usability testing just got cheap, simple, and instantaneous!. Here’s how it works:

  1. Sign up.
  2. Install script seconds with one line of code.
  3. Watch videos of your real users!

FeedbackArmy.com

Feedback Army is a cheap website usability testing service built on Mechanical Turk. Submit your questions and get feedback from 10 people for $15. Here’s how it works:

  1. Sign up.
  2. Request Feedback.
  3. See Results!

Magento – Add Static Block to CMS Page

Static blocks are a great way to add sections of HTML to your CMS or Catalog pages. I’m going to show you how to add a static block to a CMS page.

It’s a 2 step process and a very simple one. First, create your static block by going to CMS->Static Blocks. You will use the identifier of your static block to reference it on the CMS page. Edit the CMS page you would like this block to appear in, and add this code in the location where you would like it to show up:

MySQL – Using a Column Name Inside the LIKE Keyword

When using the LIKE keyword in a MySQL query, I use it the most typical way, LIKE ‘%STRING%’. One day, I was in need to use a column name instead and could not figure out how to do it! At first, I tried to just replace the string value with the column name like this, LIKE (%t.column%). The end-result was not good as the LIKE keyword expects a string.

So, I thought of trying the CONCAT() function since that returns a string. And it worked!

Hope this helps someone!

Page 2 of 1112345678910...Last »