Really Bad CAPTCHA

Okay, seriously we really really have to think about a better alternative then this.

Bad CAPTCHA

This image is from a very well known site. (I’m not showing the link, because I don’t want to make bad reputation).

Compiled VC Questions About Startup Idea

I recently had a VC interview for one of my projects I’m working on. These were the questions they asked me, I organized them into different sections. I hope it’s helpful.

Questions about your idea

  • What are you going to create ?
  • What need in the marketplace will be filled by your product or service ?
  • What is your target audience ?
  • How long have you been working on this idea ?
  • How far have you gotten ?
  • Why do you want to do this ?
  • What do people currently do since your solution does already exist ?
  • Who will be your competitors ?
  • Why do you think yours will be better ?
  • How long will it take for you to develop / complete a prototype ?

Team questions

  • How long have you known each other ?
  • Have you worked together on a project before ?
  • What would be each member’s responsabilities ?
  • Is there anyone else that you need to execute on your idea ?

Execution and business issues

  • What is your biggest concern about this idea or project ?
  • Would your product be difficult to duplicate ?
  • Was any of your code written by someone who is not one of your founders ?
  • What core underlying tools or platforms will you be using ? (e.g. open-source)
  • How do you think people will discover the product or know it exists ?
  • How do you think you will be able to make money from it ? (charge for use, advertising, subscription based)

PHP Code Optimization Tips #10

Check out my other PHP optimization tips by clicking on the Optimization category.

It’s time to test string concatenations, I’ve seen so many tests and so many myths that I had to try it for myself.

Basically 3 methods come into my mind:

Method 1:


$tmp = 'test_';

for ($i=0; $i < 20000; $i++) {

$tmp = $tmp .'test_';

}

Method 2:


$tmp = "test_";

for ($i=0; $i< 20000; $i++) {

$tmp .= "test_";

}

Method 3:


$tmp = str_repeat("test_",20000);
Time
Method 1 1.5460
Method 2 0.02916
Method 3 0.000216

So, if you want to repeat a string Method 3 is the best option, for anything else use Method 2, because it’s 53 times faster then Method 1.

How Much An IDE Configuration Counts

Many developers use an IDE’s configurations as is, without any modification to suite their needs. This is absolutely wrong, in fact you should change every configuration option you can to suite your need and to optimize development time.

Funny thing happened to me a couple of days ago. I was coding and when I wrote a particular line of code for a couple of seconds I felt something wasn’t right with it, I saved the file and tested it in a browser and there it was, a run-time error thrown by PHP.

I forgot to put some text in quotes, then I realized why I felt it was wrong even if it was for just a second. The syntax color wasn’t the same as with normal strings. To me is absolutely essential that I can configure an IDE or text editor as much as I can to avoid such things.

Many developers code in Notepad. To me those people are hardcore and stupid. Of course very complicated feature rich (or feature cripple) IDEs are not the best option either. Every programmer should find his/her balance when dealing with editors.

The editors I find particulary useful are Aptana and since I’m newly coding on a Mac, Textmate. Okay. Textmate isn’t a full blown IDE, but with bundles you can do amazing things with it. When I was on Windows I found very useful Notepad++, I used it for rapid code modifications.

For DZone Users Who Read My Blog

I just wanted to let you know that I changed the bookmarking plugin on my blog, it’s located under every post, now you can vote on them, even DZone is supported (it’s the fourth icon from left :) ) and also Digg, Technorati, Del.icio.us, Facebook, etc.

Basics of Framework Design in PHP Part 2

Hey, I saw that the first part of this post (Basics of framework design) got a little bit attention I decided to continue that thought. Before you continue reading make sure you read the first part for easier understanding of this post.

In order to use or even build a framework first we need to understand what type of architecture the framework was built upon. We need to understand the design behind it.

So let’s start with framework types generally. In the PHP world the majority of framework are either full stack or glue frameworks.

A full stack framework is essentially a lots of tight coupled components/modules, not necessarily built upon each other, but almost all the time this is the case. For ex. Symfony or Cake PHP are full stack frameworks. Another characteristic of this type is that it enforces the developer to use these components in order to build the web page or web application.

A glue framework is composed by a bunch of loosely coupled components. It is rather a flexible type, you can use these components together, but not necessarily. Zend Framework is an example of glue framework.

In my personal opinion a team with less than 5 or 10 developers should use a glue framework, because it’s much easier and much faster to work with. The developers doesn’t have to learn all the ins and outs of the framework. Larger teams almost always should use full stack frameworks, because with larger teams the most important and frustrating problem is communication. Therefore a project manager who enforces a full stack framework on his team will cut down the development time. The developers will have consistent components to work with and the framework will enforce a consistent coding style and conventions making the project more manageable. (eg. On many of Yahoo’s pages a modified version of Symphony framework is used).

Many of these frameworks are based on the MVC architecture and they’re push based. MVC stands for Model - View - Controller and what essentialy means that the application is separated into model (or data access), controller (or action) and view (or user interface, template) layers. Push based means that the action (or controller) pushes the data gathered from the model (or data access) to the view (or user interface). CodeIgniter, Zend and Symfony are all push based frameworks.

Choosing Hex Colors in Mac OS X

How to choose colors in Mac OS X is not so obvious for the first time. Fortunately we have a built-in Color Picker application in Mac OS X, but it’s rather difficult to locate and run every time I need to choose a color. So I developed I method for simplifying color picking.

What you need:

1. Quicksilver (Shame on you if you don’t know this app.)

2. Apple Script (built-in)

3. Mac OS X Color Picker (built-in)

4. Waffle Software’s Hexpicker (love the company’s name)

Step 1:

First let’s install Hexpicker. This is a Color Picker plug-in which let’s you choose Hex colors, needed for web development. So download, unpack and put the HexColorPicker.colorPicker file into <username>/Library/ColorPickers folder.

Step 2:

Install Quicksilver if it’s not already installed…

Step 3:

Open AppleScript Editor (/Applications/AppleScript/Script Editor) and write this command: choose color

If you hit run it will bring up the built-in Mac OS X Color Picker.

Step 3 - AppleScript Editor

Step 3 - AppleScript Editor

Save this script: Choose File -> Save As…

Make sure you choose either application (for PPC Mac) or application bundle (for Intel based Mac) from the file format drop down.

AppleScript File Format

AppleScript File Format

Okay. Now if you double click on that file the color picker should open. Now to open this file globally I found the easiest way is to assign a trigger in Quicksilver.

Step 4:

Open Quicksilver Preferences and choose the Triggers Tab. Click the little + button on the bottom of the window to add a new trigger and select hotkey from the drop down.

Step 5:

Select the saved Apple Script file from the Select an item pane and choose Open from the Actions pane. Save it.

Step 6:

You see the created trigger in the list. Double-click on this entry’s Trigger column to open an additional window to select the hotkey for it. I choosen the Command-P hotkey…

Now every time you press Command - P (or whatever hotkey you selected) it will run the color picker. One final note. You can find the Hex colors on the last tab of the color picker.

HexPicker

Enjoy.

Changed Theme

Hey. The old one was boring.

This is fresh and funky.

My Top 5 Advice On Working With Clients

From my past experiences I concluded that clients do not know what they’re doing, asking you to do, but they want instant results and they’re always changing their mind about the project.

Sounds familiar? Then read own…

1. Talk with your clients in ’simple language’ and talk about every aspect of the project.

Most clients are not developers, they don’t understand the developers’ jargon. HTML, Javascript, PHP, AJAX, doesn’t mean to them anything. How they see it is they have a problem what needs to be fixed and you’re the one who makes this problem go away. They don’t care about how you achieve it or how difficult it is, they just want to get it done.

For a healthy communication you have to understand each other. You have to understand exactly what your client wants and you have to explain to him what you want in a simple manner.

2. Always record the communications with your client.

Always keep an organized record of your conversations with your clients. Use e-mail, Skype or whatever communication tools that let’s you record it, but let the client know that you’re doing this. Insist using a project management or a ticketing software that lets you keep a record of current issues with the project. Make sure your client uses the application correctly.

Always tell him that if a feature or a bug is not added through this application that from your point of view it doesn’t exist. This way you have evidence if the client changes some aspect or feature of the project. You will avoid such dialogs like: “I didn’t wanted this way” or “This doesn’t looks like what I want

3. Set your prices correctly.

One of the biggest mistake I ever made when I started my business was that I set my prices very low so I can get more client and get the business going. Big mistake. If you set your prices low it means that you don’t value your time and resources and you will attract very ugly clients, they will always want more for that money and they won’t appreciate your work.

4. Make your life easier for you and for your client by doing what you know best.

When you set very fixed, rigid goals this doesn’t mean you can’t improve on those things. Let your client know what is the best solution for approaching a particular problem. Explain the advantages and disadvantages of the solution.

Always keep your suggestions in concordance with the problem, don’t try to change the base idea, just try to improve it how you know best and make sure your client understands it.

5. Always sign a contract with your client.

A contract will assure that you won’t get burnt and wake up with a lawsuit on your head.

Make sure you state all the third party source code you will be using and all the licenses that comes with these apps.

And finally 5 more advice from my experience with clients:

  • Avoid control freak clients.
  • Try to over deliver, it will make a good impression.
  • Ask for feedback from time to time, not just when the project is done.
  • Try to be realistic, don’t try to impress your client too much.
  • Be very prompt to your clients’ e-mails, be on time for meetings and just be yourself try to show your clients that “Hey this is me. If you don’t like it’s no hard feelings.

How to see .htaccess under Mac OS X

One the the most frustrating things I encountered developing under Mac is when I’m trying to access .htaccess files. By default hidden files under Mac are, well, hidden.

I found a couple of ways of showing hidden files, but none of them was very convinient. The closest thing I came to regarding ease of use was simply opening the Terminal and writing a couple of commands to show the hidden files. Then I discovered Automator, a hidden gem, probably one the best tools you can find on Mac OS X.

What Automator does is simply let’s you create workflows of commands and actions. So for example I can mimic the actions and commands I’m doing when I open my Terminal and write the show hidden file command and make it automatic.

So here it is:

Step 1:

Open Automator. (It’s in your Applications folder)

Step 2:

We need to mimic our actions, in Automator we need to use a Shell Script. In the library pane go to Automator then drag Run Shell Script onto your workflow.

Step 3:

In that little box that appears write the following commands:

defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder

The first line tells Automator to show all the files and the second line to restart Finder. This command is needed to show the hidden files in Finder.

Step 4:

Save this workflow as a Finder plugin. You can do this by going to File -> Save as Plug-in. In the following window write a name for this action and make sure you select the Plug-in for: Finder.

Step 5:

For hiding the files repeat from Step 2 except you write the following commands in the textbox:

defaults write com.apple.Finder AppleShowAllFiles FALSE
killall Finder

Save it as plug-in.

Testing it:

Now go to Finder -> Right Click and under the Automator popup you can see your 2 workflows.

That’s it. Now every time you want to show your hidden files you can do it from Finder.