The REAL location of the CIFilter in OS X Mountain Lion (Development)

So you are trying to use CIFilter for the first time and the documentation tells you that this class sits in the following location?



The documentation is LYING its ass off to you. The real location of this class is in the QuartzCore framework. Import QuartzCore.framework and you are sorted.



Setting and Achieving Goals

What are Goals?

Before you begin, there are a few things I need to ask you to do:

  • You need pen and paper if you want to really learn something from this article. You will just waste your time if you are reading it because you are bored. Just stop and save yourself some time.
  • You need to physically write down what I ask you to write down. Do not type them on a computer or any other electronic device. Physical contact with a pen and writing your goals down on a piece of paper is scientifically proven to have a better effect on the results that you achieve. Do not fall into the trap of memorizing your goals or writing them in a word document.
  • Write them down on a piece of paper and have that paper always with you to remind yourself of your goals. If you write your goals down on paper that you have no access to during your work hours, then this exercise is pretty much useless.

I have been obsessed with setting and achieving goals. Ever since I was a teenager, about 16 or 17 years of age, I was setting daily goals for myself. I will later mention how setting daily goals is counterproductive so bear with me while I explain all these.

I started setting goals for myself when I was young, to utilize my time and focus my energy on things that I believed at that time were important to my growth. Let me give you an example: I have always been a geek. One of the ultimate projects a computer geek would like to work on, would be writing his or her own operating system. So I set on the challenge of programming an operating system. I was setting daily goals for myself that would ultimately result in what I understood at that point in time to be the perfect program. I followed my dream through to the point that I actually had a working operating system but then later I gave up. Other important things happened in my life. I left the operating system and never went back to it. What happened there? Why did I just leave it without ever going back to it? Was I discouraged by an external factor? Was I overwhelmed or perhaps was the task too much for a young man like me at that age to solve? I am yet to find the answer to some of these questions but I have, over the years, come to conclusion as to why we humans like setting goals and why we sometimes fall short of following them through until we get results.

We all like checklists. We like to have a list of things that we need to take care of every day. The daily goals that we set and accomplish every day will really shape our lives. They will shape who we are, what we say and what we do. Goals are indeed powerful tools either to make us or destroy us, depending on how we set them, what we set them to and whether or not we can and will follow them.

Sometimes we even set goals to fool ourselves into believing that we are busy! I remember setting daily goals for myself years ago and then after a few months I noticed that I didn’t really accomplish much towards the bigger goals that I had in mind. You see, goals have an extreme and unique power. They have the power to pull us towards them. What happens if you get pulled towards your daily goals? Well, the answer is simple. You will become your daily goals. Now what happens if we set weekly goals? Is that any different from daily goals? How about monthly or even yearly goals? Are those any different from daily or weekly goals?

Let’s take an athlete as an example. When a road cyclist trains for the olympics, she will set a target weight for herself, amount of calories to consume and burn on a daily basis, a list of foods that she can eat and a list of food that she must not; she will even adjust her sleeping hours to make sure that she is getting enough sleep. All this hard work for what? To get to the olympics and make her country proud. Well, wait a second. What happened there? How is that an athlete can follow through such a long-period of intense goal setting and exercising and dieting but we cannot even set daily goals for ourselves and achieve them? What is so special about the way the athlete was setting goals for herself and why don’t we possess the same goal-setting skills?

Goals are very powerful, as I mentioned before. They are the mechanism through which we can achieve our dreams or go as far as destroying our future. It depends on us and it all comes down to how we set goals. In next sections of this article I will describe to you a method that I have perfected over the years that may or may not help you not only set, but also follow through and achieve your goals.

Setting Goals

In this part of the article, I will describe to you the method that I personally use to set goals for myself. I have used various methods, either self made or the ones that I have learnt from others. The method I’m going to discuss here is a mix of everything I have learnt so far about setting and following through goals. I have broken it down into smaller chunks and steps so that they are easier to follow.

1 – Start With an Empty Mind

The first thing that you need to do is to just empty your mind. Got issues at work? Forget them. Now is not the time to think about that. Do you have issues in your marriage or relationship? Throw them out the door. Empty your mind. You need to make sure that no external (emotional) factor is predetermining the output of this exercise. Once you are completely relaxed and your mind is at east, then you can go to the next step.

2 – Write Down 4 Things That You Want to Achieve in The Next 4 Years

Your goals all have to have the following qualities:

  1. They must be bold and brave, with no limitations in mind
  2. They must be very specific. Vagueness only discourages you and may/will affect your overall performance towards achieving that goal
  3. They must be written down on a piece of paper, not just memorized in your head

Studies have shown that human beings can only really remember 4 things at a time easily. Once there is more than 4, you will start to forget one or the other. So set 4 main goals for the next 4 years. Make sure that you are pushing yourself and setting really big, yet achievable, goals. For instance, saying “Go skydiving” may be a good goal but it’s not good enough. Going skydiving requires some money… and that’s it! So all you are saying here is “Make £200 money and register for skydiving”. That’s not a big enough goal to achieve in 4 years. The very important part about this step is this: do not limit your thoughts. Have you been wanting to achieve something but you’ve never been focusing enough on it? Now is the time. Maybe set that as one of your yearly goals. For instance, you may say “Get the mortgage sorted in the next 4 years and become a house owner”. This can be a great goal to set for the next 4 years.

Another example of a good goal would be to say, for example, “Double my income from x to y”. So you see, doubling an income is something that people will look at as a big, yet achievable goal. So I say: go for it, set big goals for the next 4 years. There is one thing that I need to tell you about though. Unachievable goals only discourage you from setting further goals. For instance, I am a computer engineer. What if I set a goal that said “Build a spacecraft and fly to the moon”. Even though this is “achievable” by definition, it most definitely not achievable by me alone. So this is a silly goal to set and in the long run, will only discourage me as I spend more and more time and energy on it and basically waste my life. So although I am asking you to set big goals, I want to make sure that you are not setting out-of-this-world goals that are not achievable.

3 – Write Down 4 Goals That You Want to Achieve in Each Year, For The Next 4 Years

The previous step was about setting 4 goals that you want to achieve in the next 4 years. This step however is about setting 4 goals for every one of the 4 years

For instance, my Step 2 goals can be written down like this:

My goals for the next 4 years:

  1. Buy a house
  2. Start a family
  3. Travel across Europe
  4. Travel to America

Now that I know the most important goals of the next 4 years of my life, I have to break it down into smaller details. So I will then start to describe what I have to achieve each year, for the next 4 years, in order to achieve my bigger goals, mentioned before:

  • Year 1
    • Save £40k for the down-payment of the mortgage
    • Take my relationship with Ms X to the next level and see if there is a spark
    • Start saving up for EU travel next year
    • Start planning for the US travel
  • Year 2
    • Goal 1
    • Goal 2
    • Goal 3
    • Goal 4
  • Year 3
    • Goal 1
    • Goal 2
    • Goal 3
    • Goal 4
  • Year 4
    • Goal 1
    • Goal 2
    • Goal 3
    • Goal 4

The important thing to keep in mind is this: the yearly goals that you set have to be directly connected to the 4-yearly goals that you have set for yourself. For instance, in the previous example we set the goal of buying a house, starting a family, traveling across EU and America. Now, when it comes down to setting goals for each year, I cannot ignore my 4-yearly goals and go on a drunken episode of setting goals that are completely irrelevant to my 4-yearly goals. Make sure they are relevant to the 4-yearly goals, that’s what I’m trying to say here!

4 – Set 4 Goals For Every Month of Every Year of Your 4-Year Plan

I think now you are getting the idea. Now depending on each year’s goals, break the yearly goals down into smaller chunks that can fit into 12 months. For instance, if one of your goals 4-yearly goals is to buy a house, and one of your first year’s goals is to save £40k money, then you can set the goal of saving £3.33k every month in the first year to achieve that goal. Now how achievable that is, is down to you to decide. I am not saying you should do this. I’m just giving you an example.

As you start setting monthly and weekly and daily goals, you will notice that the task becomes more and more cumbersome and time consuming. You will sometimes not know how you can set the monthly or weekly/daily goals. In that case, just leave the paper blank and move on to the next month/week/day. It’s absolutely ok. Do not beat yourself over because you cannot write goals like a machine. We are humans, we have limits and this is one of them as you probably have noticed by now. Make sure the paper on which you write your goals is by your side, always! This way, once you do think of a goal, you can write it down immediately. If you don’t have the paper with you, just forget it. The moment is gone. You won’t be able to capture that goal unless you keep it in your head until you get hold of your paper. Forget about capturing them electronically on your smartphone. It won’t work, I can guarantee. Once a goal is written in electronic format, you probably won’t ever bother achieving it. It needs to be written in your handwriting, on a piece of paper, using a pen that you physically hold in your hand.

Make sure that you write all these down. If you are just reading this article without writing these down, stop! Stop right now and get a pen and paper.

5 – Set 4 Goals For Every Week of Every Month of Every Year of Your 4-Year Plan

Write 4 goals for ever week. The goals in every week have to be directly related to the goals that you have set for that particular month.

6 – Set 4 Goals For Ever Day of Every Week of Every Month of Every Year of Your 4-Year Plan

I don’t have to explain this anymore, do I? Great.

You may be tempted to set more goals for every day and that is ok. You can do that if you want to! But the 4 goals that I’m asking you to set every day is the absolutely necessary and the most important goals that you need to achieve every day.

 7 – Go to Bed And Leave Your Written Goals for a Whole Week, Revise After a Week

This perhaps is one of the most important steps that a lot of us just never bother with. If you are like me, you can probably set all these goals in a day but how achievable are these goals? How likely are you to actually want to achieve them? These are two different matters. Something that matters to you today may not matter to you the next. That is why you have to constantly review and amend your goals.

Achieving Goals

You have your goals written down on a piece of paper. But is that all you need to achieve your true potential and goals? Nope! I am sure you could see that coming. That’s correct. You need much more than just a list of goals. You need to do the followings to be able to achieve your goals:

  1. Review and amend your goals on a weekly basis, preferably on Sunday, mid-day is my preference. Sunday usually works out best but you can find another day if it works better for you.
  2. Review your last week’s performance and list 4 things that you learnt from last week and how these 4 things can help you in your revisions of your goals for the next 4 years. If you learnt a valuable lesson, make sure that you amend your list of goals if it applies.
  3. If a goal is not relevant anymore, don’t keep it in your list. Get rid of it. For instance, if one of your current-year’s goals was to “Double my salary” and by now you have tripled your salary, probably there is no point to keep the original goal in your list unless you want to double your tripled salary, in which case, I say, go for it. Do it. Why not?

There is one important thing that I’ve noticed as well during setting and achieving goals. You will need more time for yourself than you have been allocating in the past. That means your goal setting may or may not affect your relationship with people around you. Mastering this art takes time and after you have mastered it, you no longer will see this affecting your relationships. Just bear in mind that if you start losing friends because you have been so focused on your goals, you have to ask yourself “Was it worth losing this person?”. If the answer is yes, then carry on. But if you held that person very dear, then revise your plans and priorities. You may also have to do some damage control. Talk to the person, get her/him back if they are worth your life/time.

I hope these guides will help you. I know that by now you probably have a lot of questions that I have not answered. That’s what the comments box below is for. Just leave some comments/questions. Show some love. I will make sure I answer your questions. Also if a friend/family can benefit from this article, please share it with them.

Find cpp, c++, clang++ and clang in Xcode 4.3.x and Higher


So you have some scripts that use “cpp”, “c++” or “clang” and etc but you cannot find them in your path? Not to worry, read on…

With OS X Lion and sandboxing, you can find your c++ compiler using the “find” command:

find /Applications/ -name “c++”

This will return something like:

find /Applications/ -name “c++”

The one in the “bin” folder is the one we are looking for so the folder that contains our toolchain is here:


Navigate to that folder to do some inspection:

cd /Applications/
ls -la c++
lrwxr-xr-x 1 root wheel 7 19 Jun 22:41 c++ -> clang++
ls -la clang++
lrwxr-xr-x 1 root wheel 5 19 Jun 22:41 clang++ -> clang
ls -la clang
-rwxr-xr-x 1 root wheel 22985632 19 Jun 22:41 clang

You can see right away that c++ is a symlink to clang++ and clang++ is a symlink to clang. What a mess!

Now let’s find “cpp”:

ls -la cpp
ls: cpp: No such file or directory

Oopsy daisy, it’s not there. That’s one of the issue a lot of developers will be facing. So let’s remedy this by first creating cpp as an alias. We want this alias to be permanent between Terminal sessions so we put it in our bash_profile and we also have to make sure the toolchain bin url highlighted above is in our path:

vim ~/.bash_profile

And then change the content of your bash profile so that your path includes:


and also create an alias for cpp to point to clang. The contents of my ~/.bash_profile now looks like this:

export PATH=~/bin/:/Applications/$PATH
alias cpp=’clang’

Once you are done, press Escape in vim and then type :wq and press enter. That will “write” and then “quit”.

After you are done, close Terminal and open it again and type cpp:

clang: error: no input files

Lovely, it’s working. Any questions? Leave them down below 🙂

New theme for my blog, what do you think?

Hi lovely people of the internetz 🙂 I have chosen a new theme for my blog. I like this theme better than the theme I had before and I think it makes the blog much more accessible by putting only a snippet from each post in the main page, avoiding cluttering your screen with information you may not need. What do you think about the new theme?

Git from command-line after installing Xcode on OS X Lion

Xcode 4.3.x or newer comes with Git but the problem is when you install Xcode on your machine (OS X Lion or newer), Git’s path won’t be added to the user path which means if you run git from your command-line, your system will say:

-bash: git: command not found

Xcode’s installation of Git is at the following location on your machine:


With the git binary sitting here:


To add this binary to your path (which will allow you to run “git” from any directory on your system), go to terminal and type this command:

export PATH=”/Applications/”:$PATH

There is one caveat to this approach and that is the PATH will only be changed in your current running instance of terminal. As soon as you close terminal and open it again, you will have to enter the above command again to get access to the git app. So what is the proper solution? You will have to add the above “export” command to the .profile file in your home directory. The .profile file gets read every time you open terminal. So open a terminal instance and type the following command:

cd ~/

And then type this command:

ls -la | grep “.profile”

We are trying to find out if we already have a file named .profile in our home directory. If after running the above command you won’t see anything getting printed to the terminal, use the following command to create a new .profile file. If you already have a .profile file, skip this command:

touch .profile

Now open the .profile with this command:

open .profile

Now add the git path to the PATH variable in the .profile file so that your .profile content will look something like this (it really depends on what you already have in this file. I am assuming your .profile file didn’t exist until now and you just created it):

export PATH=”/Applications/”:$PATH

Save your changes to the .profile file and close terminal and open it again. Now whichever directory you are in, in terminal, you can use the git command. Good luck.