How to Generate Random Number in Java

This is the easiest way to generate a random number (in a given range) in Java. This can be helpful especially if you want to randomize an animation in Android. It might be useful in Java too (if you need a random number out of a range).

int min = 65;
int max = 80;
Random r = new Random();
int i1 = r.nextInt(max - min + 1) + min;

Hope this little snippet helps!

How to Use Motivation To Boost Your Sales

Two days ago I started learning Japanese seriously. Really serious. I never have been this serious before except when I wrote profit-pulling sales letters for select clients.

I read mangas, impressed with Japanese arts, interested in their cultures for all my life and yet I only started learning after a few years. Tim Ferris calls it as “Harajuku Moment”.

A moment where there is a single instance in our lives that cause the switch to flip and turn our inaction into fiery determination to take whatever it takes to achieve the goal we have set.

You must understand that people are hard to change. And IT IS hard to change.

Why? Because we are wired to do things that we are comfortable with. You know how funny it is when people try to change you so hard that they give up?

Well, that because they don’t understand the fact that people does not like to be guided by others. They want to believe whatever they do is their decision. Yes… their decision. That’s why most preachers failed. They failed to make people believe that the action that they will take is theirs, not of the preacher.

If they believe the preacher is trying to win them over, they will resist to whatever idea they are presenting and that, my friend, is the same as selling.

People love to believe that they are in control of what they want. If they believe that it might do them good without significant change in their lifestyle, they will do it immediately.

For example: walking. If you are so used to drive a car to go from one place to another, you will get bored and want a change of pace. Then you read something about the virtues of walking. It will increase the blood flow, decrease the risk of heart attack and make you last longer in bed.

And you think it’s not a bad idea. Then you walk from your home to a shop near you just to buy some fruit juice and buy some groceries.

If you did that, the author of the article has successfully implanted the idea that you should try walking. If you went from just another walk to a daily ritual, the article about walking has successfully convinced you to do a very relaxing physical activity that could even save his life.

Direct response on the other hand moves people from a comfortable position to do something they might be uncomfortable with: get your wallet out and give me your account information so I could charge you RM37 for a product that may make you weigh 5 kilogram less.

So what’s the best way to make to make the sale?

By making the process as comfortable as possible for them. Nothing has changed, believe me. Seriously. Nothing has changed. But… You just have to do this only… and this… and this… and you will lose 5 kilos. I got myself RM37, and you got yourself 5 kilos less than a month before.

Now let me clear something up: you probably won’t be able to make them comfortable. They will be uncomfortable. Who in the right mind will be comfortable giving someone they doesn’t know they hard-earned money? No one. Except when people trust you.

Marketing really is about making people to believe that the choice that they make is theirs, and not others.

The reality is, people are the sum of the experiences that they have. Conciously, or unconciously. That’s how marketers market their product, and you need to think of how you can make people say… “aha… this is the product I WANT”.

When you are able to do that, my friend, you have successfully created a good marketing campaign.

So I have a question for you. As a reader of this blog, what do you want to see in this blog? What is a question that you think is so hard to tackle concerning marketing on the Internet, or even business in general. I think I can give you some from my 7 years experience (from 2006 until now) as a consultant, copywriter and programmer.

Seize the day,
– Abdul Rahman

How to Install Intel Hardware Accelerated Execution Manager

You need to install Intel Hardware Accelerated Execution Manager (or HAXM) if you want to run Android emulator.

One of the things that I encountered when I tried to install Intel HAXM is that the installer said that my virtualization (vt-x) is disabled. If it is disabled, then the installer will refuse to install Intel HAXM.

There are three fixes for that.

1. Are you using Avast Antivirus?

If you are using Avast, it might disable your CPU’s virtualization feature. I’ve tried to allow it from Avast control panel, but unfortunately it doesn’t work. What I did was, I downloaded another antivirus (right now it’s Avira — Avira is right now has one of the highest virus detection rate) and then I uninstall Avast.

2. Turn off this Windows feature 

You need to turn off Hyper-V in order to install HAXM successfully. Go to your Control Panel and then go to Programs and Features. On the left hand side, you can see three options. Click on ‘Turn Windows features on or off’. Untick Hyper-V. After that click OK. Wait until Windows finished changing things in its features and then restart your computer.

3. Check your BIOS setting

This is important too. Make sure that you enable virtualization in your BIOS setting too. If not, all of the steps above are useless. You can see the video below if you don’t know how to enable it in your BIOS. You can Google or  search YouTube to see how to do this.

So there you go, three ways to enable virtualization. This is for Windows 8, 8.1 and maybe Windows 7 as well. I hope you are able to install Intel HAXM and learn more about making apps for Android.

Cheers mate! 🙂

How to Install Laravel on Windows

Most tutorials on the Internet are using Linux/Ubuntu. However, in this post I will show you how to install the latest Laravel  on Windows. I will be using Microsoft Windows 8.1 and WAMP. I’m using Laravel 4.2 for this tutorial. But you don’t have to worry as long as it’s version 4 and above, you can use this tutorial.

Let’s begin.

1. Install WAMP first.

There are several things that you need to make sure in order to run Laravel successfuly.

– You have to make sure it’s PHP 5.3.7 or higher

To make sure of this, use the latest version available at WAMP Server website.

– mCrypt module enabled

mCrypt module comes enabled at default so you don’t have to worry about this.

2. Enable OpenSSL in PHP.ini

Update for Laravel 5.4.

Laravel version 5.4 require these:

PHP >= 5.6.4
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension

After you installed WAMP, you need to do this. This is how you make sure OpenSSL is enabled:

On your right hand side of your taskbar, click WAMP and then choose PHP.ini.

And then find php_openssl, and then remove the semicolon in front of php_openssl.

And then, save. Close that file and now go to wamp manager again, and now enable OpenSSL there just to be safe.

After you do that, restart Wamp.

3. Install Composer

Go to and download Windows installer.

The setup will ask for your PHP. if you install your WAMP in default setting, it will usually end up in C:\wamp\bin\php\php5.4.12.

If your installation is successful, by running composer on command prompt, you will see all kinds of info just by running that command.

If you can see it, that means your Composer installation is complete. Let’s move to the next one.

4. Make sure that your htppd.conf includes httpd-vhosts.conf

Now let’s make sure that your htppd.conf also includes httpd-vhosts.conf. This is beneficial if you want to make a pretty URL just like this one:

Instead of writing up localhost/mylaravel, it would be “nicer” to have that pretty URL, right?

Anyway, let’s go on.

Go to C:\wamp\bin\apache\Apache2.4.4\conf and then open up httpd.conf.

After that, search for httpd-vhosts.conf and make sure that there is no ‘#’ (pound sign) in front of it. Save. After that restart Wamp just to be safe.

Now let’s begin the fun part: installing Laravel.

5. Install Laravel in specified folder

You usually want to install your Laravel in your www folder. (Obviously!)

So open up your command prompt, and then change directory to your WWW folder inside your wamp. For me it will be: C:\wamp\www

To change directory, just type cd c:\wamp\www

Basically you are changing folder to your www folder.

And then, you can install Laravel. Just use this in your command prompt:

composer create-project laravel/laravel your-project-name –prefer-dist

And then hit enter.

Just wait a while until it is finished downloading and installing.


Wait until… everything finished.

6. Create Virtual Host

Now let’s create your pretty URL. You have to go to C:\wamp\bin\apache\Apache2.4.4\conf\extra and then open up httpd-vhosts.conf.

After that, you just need to paste the following and change your laravel folder to appropriate ones.

<VirtualHost *:80>
DocumentRoot “c:/wamp/www/mylaravel/public”

In my case, I used mylaravel for my laravel installation. You have to change it to something else. For server name, you can change it to whatever you want. In my case, I am using (You don’t want to use because if you do, you won’t be able to open up Google).

Obviously, you have to save and then restart your WAMP again.

7. Update Windows Hosts file

After you have changed your virtual host, you need to change your host file.

Go to C:\Windows\System32\drivers\etc and copy hosts and paste it on your Desktop. And click on the host file you have pasted on your Desktop. Open that up using Notepad.

Put this in that host file:

Change into what you already decided in your virtual host file. For me, mine will be

Copy the one that you modified just now and put it back into your C:\Windows\System32\drivers\etc folder.

You’re done!

That’s it! That’s the way you can install Laravel and have a pretty sexy URL together. If you have any questions, please send your questions in the comment form below and I will try as best to answer your question.


Coding Days

Today I’m not going to talk about marketing. I talked a lot about it in this blog. Today I’m remiscing of the old days… of the system that I have built in the university. You can see it in its full glory below.

Sometimes when you go through your own stuffs, you realized that you have created a lot. Sometimes it’s mediocre, sometimes it’s good and sometimes it’s awesome.

Whatever you are in the past, you should try to be better in the future so that you can be proud of yourself and say, “I did this“. Be thankful that you are still alive today and possible for you to still do good job in whatever career you have chosen for yourself.

Shit Happened. So What’s Next?

Shit will happen all the time. You know that. I know that. We all know that. Last week I lost my phone (RIP Arc S) and my wallet. That’s shitty thing happened to me.

That’s life.

Sometimes we doesn’t get the hand that we want and sometimes people do screw us. There are people out there that will steal things from you and will do nasty thing on you.

That’s life.

We are not prophet. We can’t predict future. We can plan but we are not the governor of fate. We will get screwed – and we don’t know how we are going to get screwed.

So shit happened.

What do we do?

We move on.

We do things that we think we should do. Don’t allow ourselves to weep too much. Don’t allow ourselves to feel sorry too much. Too much of anything is disastrous to our body. Too much food, too much ice cream, too much ice cream. It’s all dangerous.

How do we move on?

We do things. Mop the floor. Wash your car. Write. Plan how to live your life so well that people get jealous of you.

Do something.

Use the negative energy for positive things.

And of course, at one time in a day, reflect on the shitty things that happened to you. How does it happen? Why does it happen? Who make it happen? How can you prevent it from happening? And so on.

Know your time to be productive. And time to be reactive. Learn to know yourself. As I try to learn to know about myself.

The Importance of Split Testing and Getting into Your Prospect’s Mind

There are no secrets to success. It is the result of preparation, hard work, and learning from failure.
— Colin Powell

What I’m going to tell here hasn’t been talked much about in internet marketing world. And it still is one of the best kept technique of making more money of the gurus. I wonder why that is. One of the reasons why I make my clients a lot of money is that I know what variables (perubahan) that I should make in order to make my clients more money. You see, making money can be simple, if you study hard enough.

You see there are four places where a small changes can lead to a big improvement dalam kadar tukar pembaca kepada pembeli (conversion rate). Before I explained what that four are, I want to explain to you how important is the concept I am going to talk about.

Let’s say there are two apples in front of you. Both have the same quality. But one is green apple and another is red apple. You choose green apple. And what I want to question you now is: if there are 100 people waiting in line to get their apple, which one do you think will be chosen more?

Red or green?

Answer: you can guess, but your chance is just 50% correct.

If you just have a tool, a tool that could measure other people impulses’… you would be better off in predicting which one is more desirable than the other. And that’s what Google Website Optimizer does.

It is used to split test your ads and see which one is more desirable for people. What would they would choose? Would they choose your original (control) ad… or would they choose your new ad? Your market will decide which one is better. You only have the right to think which one will perform better… but you don’t have the right to dictate to others which one they should prefer.

And guess what: if you are copywriter, you have higher chances of failing to see which one would perform better more than a normal person is. Why?

Because you are so trained in this art and science of copywriting, you will start asking yourself – does this follow the rules of copywriting? Does this seduce, amplify the desire of the people? And when you start asking this kind of question, well, you tend to forget it’s not about how you think of the ad, but what your audience think of the ad.

The best bet for you to see if that ad is a winner or not is this: you need to be in your prospect’s shoes. Really. If you don’t, you’ll be stuck in “does this have all the persuasion power necessary to sell”. I made a video that explains how important split testing is and I hope you will find it beneficial. All comments, feedbacks are welcomed.

P.S About the four areas of improvement where you can see huge improvement in conversion rate, I will write it soon.

What is The Right Marketing Question?

Right now I’m thinking about asking question to people with the intention of figuring out what they really want… or need… or why they buy. Anything with objective.

I mean, most people asked the wrong question. And therefore get the wrong answer. They interpret based on the incorrect information which in turn will cause mistake in the way they market their product. What I mean is people don’t buy a product, they buy for a reason that they only know. We cant say we know all bout them. But seriously… no one knew what is going on in people’s head unless they tell us.

The problem is: people often lie.

You know, when we ask people “why do you buy this”, I don’t think we get the answer we NEED to market the product. We only get answer that they are willing to tell. I mean, will people say I buy this product because I am desperate to solve (problem)? May be they will tell you in round about way about the truth and they long about something. Maybe they are hooked to it. We don’t know because we don’t really know them.

It’s same with the Cola thing. The New Coke thing. People rebelled because they know its new and well, they think they like the old better although the truth is they can’t tell the differences between the old and the new one … in a blind test Coke did, the consumer prefer New COKE better. Interesting isn’t it? The way how mind works. Fool them and they won’t know, and tell them that you fooled them and they get angry at you.

Funny… but that’s the truth. I don’t think we can profit a lot without asking the right question. Like asking a girl. They won’t tell you directly most of the time what they want from you but if you knew “the way…” they will tell you INDIRECTLY about what you want to know… and what they really, really want.

Heh, funny little world isn’t it?

Therefore we must ask the right question. The RIGHT QUESTION. You have to first understand how human mind works. I don’t think I really understand how mind works but we primarily think in “primate” brain. Our emotional brain. You can tell people something that is good for them but they are not necessarily will do it.

I mean… look: no matter how good something is, they won’t give a damn UNLESS they have an interest in it. I mean like a good feeling or something that they appreciates. A connection between that task and themselves. That’s what happened. Really, you won’t care if shit happens to the world unless you care about the world. Most people don’t do an thing because they don’t care enough!

Do something or make them care. That’s the key to marketing.

So what this has to do with asking the right question. We are marketers so asking the right question means we know wat we need to know to do the right thing. I hope you will ask the right question to your prospect.

Do you have a good story to do your marketing?

A good story makes people want to read and hurting when reading it. For example you can take a manga written and illustrated by Seo Kouji. The first manga I read authored by him is Kimi no Iru Machi (A Town Where You Live).

In that story the boy met a beautiful yet clumsy girl who came all the way to Hiroshima from Tokyo for one reason: she wants to live a new life. The story starts to get interesting when it was told that her family is a problematic family and she actually met the boy when both of them were young.

Now, I rarely read manga that can be put under romance category but this one stroke my heart. I clicked from one page to another at OneManga and anxiously waiting for new chapter to be published(right now it stopped at chapter 81).

Now, what this has to do with marketing and copywriting? A lot in fact. If you study every successful branding and positioning, you will realize that the fact that they are successful because they tells a good story in their campaigns.

You probably have heard these companies:

Coca Cola.

All of them have something to tell. From the clubs they sponsored (Nike), to how awesome is to use their product (Coca Cola), and you’ll be able to save nature by buying their products (Crocodile).

People loved good story. Every great movie has a great story to tell. At least they tell it in a way that people remember. From explosions every two minutes… or a heavy dialogue with quotes from famous people every now and then… they always have something that hook people in to make them sit in front of the TV and make you and me watch them.

Yes, good story is probably the most underutilized way to market your product. Fortunately, not many people out there knew how to utilize story to their advantage. Now is your turn to make your story into a successful marketing campaign.

Here are few key questions you can ask yourself to start using story in your campaign:

How does my company make this product?
How can I tell it in a way people will want to know more?
What is the process used and can be told to people without damaging us?
What is a common thing everyone in the market do that they don’t tell others?

Above questions are just some of the ways you can use to discover your story. If you need help to implement your story in your marketing efforts, do tell me.

– Abdul Rahman