Outlets vs Referencing Outlets

The term referencing outlet means an outlet in another object that references, or points to, the current object.

As an example, say you have a nib that has a File’s Owner and a UITableView in it, among other things. In order for a tableview to work it has a datasource and delegate, which are outlets and can be connected in IB. From the standpoint of the tableview the datasource and delegate are outlets. From the standpoint of the File’s Owner the datasource and delegate in the tableview are referencing outlets.

Ref 1 : https://stackoverflow.com/a/5786061/1450201

Yorum bırakın

Filed under iOS App Development, Uncategorized

Xcode Error : The maximum number of apps for free development profiles has been reached.

I just came across with this silly error. I think error message itself is self-explanatory enough so i’ll just write down how to fix this;

Just delete some apps you developed from your device. Yep, it’s that simple.

Yorum bırakın

Filed under Xcode

How to reinstall Cocoapods?

Dealing with cocoapods can be tricky time to time. And if you ever found yourself in need of reintalling it, just follow these steps:

  1. sudo gem uninstall cocoapods
  2. sudo rm -fr ~/.cocoapods/repos/master
  3. sudo gem install cocoapods
  4. pod setup

Btw, if you ever have something like this in 3rd step;

  ~ sudo gem install cocoapods


ERROR:  While executing gem … (Errno::EPERM)

    Operation not permitted – /usr/bin/pod

Just follow these instructions:

  ~ mkdir -p $HOME/Software/ruby

  ~ export GEM_HOME=$HOME/Software/ruby    

  ~ gem install cocoapods

Fetching: cocoapods-1.2.0.gem (100%)

Successfully installed cocoapods-1.2.0

Parsing documentation for cocoapods-1.2.0

Installing ri documentation for cocoapods-1.2.0

1 gem installed

  ~ export PATH=$PATH:$HOME/Software/ruby/bin

  ~ pod –version


And if it’s not working properly, just do this;

sudo gem install -n /usr/local/bin cocoapods

Yorum bırakın

Filed under Mac OS X

How to change Bundle ID and/or Package Name in Ionic?

Every mobile developer is gonna need to change this at some point wheter they port their Ionic project to iOS or Android or any other platform that ionic supports. And in my case it was because i needed to configure it so that i can send push notification in Android.(For iOS, i changed the bundle id from Xcode. I know it’s not the right way but in my defense; it was a friday night and i was still in office at 11pm and i was working on a demo project. Not something real) And this is how I did it:

Go to config.xml file in your project’s root and find something very similar to the following line:

 <widget id="com.ionicframework.exampleproject223738" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 

You need to change that reverse domain thing as you desire then reinstall all your plugins by;

ionic state reset — plugins;

Also when you rebuild your project, ionic might say it has missing platform but don’t worry. It adds it automatically back to your project.

Yorum bırakın

Filed under Uncategorized

Project Euler – 07

This is the problem:

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?

And this is how you solve it:

#include <cstdlib>
#include "iostream"

using namespace std;
bool isPrime (int x);

int main(int argc, char** argv) {
    int x=1; // index of prime number
    int r; // result
    int c; // counter
    // i excluded 2 from prime number squences so i'm looking for 10000th prime now
    for(c=3; ; c+=2){
        if(isPrime(c) && x<=10000) {
            cout<< "index: " << x << " number: " << c << endl;
    return (0);

bool isPrime (int x) {
    bool res;
    if( x%2 != 0 ){
        for(int i=3; i<x; i++){
                res = false;
                res = true;
    } else {
        res = false;
    return res;

Yorum bırakın

Filed under Project Euler

Project Euler – 06

Here’s the problem:

The sum of the squares of the first ten natural numbers is,

12 + 22 + … + 102 = 385

The square of the sum of the first ten natural numbers is,

(1 + 2 + … + 10)2 = 552 = 3025

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Here’s the code:

#include <cstdlib>
#include "iostream"

using namespace std;

int main(int argc, char** argv) {
    int sumOfSquares = 0;
    int sums = 0;
    for(int i=1; i<=100; i++){
        sumOfSquares += i*i;
        sums += i;
    cout << "Sums: " << sums << endl;
    cout << "Square of sums: " << sums*sums << endl;
    cout << "Sum of squares: " << sumOfSquares << endl;
    cout << "result: " << ((sums*sums)-sumOfSquares) << endl;
    return 0;

Yorum bırakın

Filed under Project Euler

Project Euler – 05

Here’s the question:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

And here’s the code: (I know it’s really not my the most elegant work but it get’s the job done)

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    int res = 2520;
    int list[20] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
        if (res % list[0] == 0 && res % list[1] == 0 && res % list[2] == 0 && res % list[3] == 0 && res % list[4] == 0 && res % list[5] == 0 && res % list[6] == 0 && res % list[7] == 0 && res % list[8] == 0 && res % list[9] == 0 && res % list[10] == 0 && res % list[11] == 0 && res % list[12] == 0 && res % list[13] == 0 && res % list[14] == 0 && res % list[15] == 0 && res % list[16] == 0 && res % list[17] == 0 && res % list[18] == 0 && res % list[19] == 0)
            cout << "LCM = " << res << endl;
    } while (true);
    return 0;

Yorum bırakın

Filed under Project Euler

How to fix django runserver ‘port already in use’ error

This usually happens if you  $ python manage.py runserver 8000 and then don’t stop the server by hitting Cntrl+C but hit something like Cntrl+Z instead.

To stop the server on port 8000 so that you can run another instance again you can do the following..

Run the below command to list all your processes with ‘manage’ in their name.
$ ps aux | grep -i manage

Note the process_id (pid)  for our “manage.py runserver” process which should be the second column from the left.

And then simply run
$ kill -9 <pid>

e.g. $ kill -9 30144

Ref: http://stackoverflow.com/a/5788609/1415352

Yorum bırakın

Filed under Django

How to install and integrate Django Suit to Django’s admin tool?

  1. You can get stable version of Django Suit by using pip or easy_install:

    pip install django-suit==0.2.15
    # or
    easy_install django-suit==0.2.15
  2. You will need to add the 'suit' application to the INSTALLED_APPS setting of your Django project settings.py file.:



'suit' must be added before 'django.contrib.admin' and if you are using third-party apps with special admin support (like django-cms) you also need to add 'suit' before 'cms'.

  1. You also need to add 'django.core.context_processors.request' toTEMPLATE_CONTEXT_PROCESSORS setting in your Django project settings.py file.:

    from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
Note: This is required to handle left side menu. If by some reason you removed original Django Suit menu.html, you can skip this.
Source: http://django-suit.readthedocs.org/en/develop/

Yorum bırakın

Filed under Django, Python

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

This little sucker happens because Apple doesn’t love http anymore, they love https. But also not to make developers angry, they made it configurable. One can find it easily by googling it for a 5 seconds.

Here’s a screenshot from stackoverflow:

this is how you do it

Yorum bırakın

Filed under Swift