Git 1.6.6 and Xcode 3.2.x

July 12th, 2010

I like to use git as my primary source code version control. Git commands are simple to use and git’s method of branching, commits, tags are easy to understand and use. However, Xcode supports only svn within the IDE. Git can still be used with Xcode but a .gitignore file and .gitattributes file should be created.

The .gitignore File

In Xcode 3.2.x the *.xcodeproj folder contains project files specific to Xcode. I usually specify to git that the xcodeproj folder should be ignored, except for the pbxproj file within the folder.

#
# .gitignore file
#
# Ignore any build files and older project files
build/*
*.mode1v3
*.mode2v3
*.pbxuser
*.perspective 
*.perspectivev3

# Ignore the xcodeproj
*.xcodeproj

# Don't ignore the pbxproj within the xcodeproj folder
!*.xcodeproj/project.pbxproj

# Ignore .svn information
.svn

# Ignore OSX-specific files
.DS_Store
profile

The .gitattributes File

I usually specify to git that it should not convert, diff, or merge the *.pbxproj file.

#
#
# .gitattributes file
#
# Effectively treat the pbxproj as binary
#
*.pbxproj -crlf -diff -merge

Links

For more info about gitignore

For more info about gitattributes

When working with other developers, I like to chat on the server itself using talkd. Talkd is the server that notifies a user that someone else wants to initiate a conversation. It acts a repository of invitations, responding to requests by clients wishing to rendezvous to hold a conversation

apt-get install inetutils-inetd
apt-get install talk
apt-get install talkd
vi /etc/inetd.conf

Make sure you have in the /etc/inetd.conf the following:

talk dgram udp4 wait root /usr/sbin/in.talkd in.talkd
ntalk dgram udp4 wait root /usr/sbin/in.ntalkd in.ntalkd

/etc/init.d/inetutils-inetd restart

System Agent AI “Agent Smith” is now online!

In case you didn’t know, the Agents are there to keep order and prevent the Players from becoming ‘Neo’ and hacking the game world, from inside. NPC System Agents will patrol the system looking for anomalies and punish those that attempt to overthrow or hack the game world.

Daimoku Multi-Programmer Online is an environment written in Ruby and ActiveRecord and implemented using Why’s Freaky-Freaky Sandbox. Daimoku allows multiple Ruby programmers to chat, share code and objects in real-time in an EW-Two-style environment.

Visit http://daimoku.elitefrontier.org for more information

Hungarian notation is a programming language naming convention. Writing with Hungarian notation entails creating variable names that start with a group of lower-case letters which are mnemonics for the type or purpose of that variable. Hungarian notation, fully implemented can be more trouble that it is worth. However, a subset of Hungarian notation can be useful.

A subset of Hungarian Notation

Modified Hungarian Notation (MHN) is a self-coined term, that described slight changes to normal Hungarian notation and also defines a subset of full Hungarian notation. The main point of MH is to help define scope and consistency of variable naming. We can differentiate between local variables and member variables that are semantically similar, by the prepended mnemonic; this results in less time wasted trying to determine a different variable name.

MHN Guidelines

Mnemonics

  • integer i
  • string str
  • float f
  • double dw

String Variables

Always prepend with the scope and the mnemonic:

string strMyName, g_strMyName;

Local Variables

Looping variables are: i, j, n, t

Short name local variables are the full type name but in lower case:

int counter(0), index(0), age;
float average, rateofclimb;

If the type of the local variable is important (mathematical or type operations) then the type is specified in lowercase:

float fSomeValue;

Do not place “C” before the class name, instead use the class name itself in lowercase when instantiating:

MyClass myclass; 

Global Variables

Prepend with g_ for example :

MyClass g_MyClass;

If the type is POD or string then always prepend the type mnemonic:

float g_fRateOfClimb;
string g_strNameOfTheShip;

Class member variables

Preped with m_ and always for example:

class A 
{
  string m_strValue;
  public:
  A(string s) { m_strValue = s; }
};

A a("hello world"); 

Function Signatures

Single letter lowercase can be used for the variable name if the function is a setter. If the single letters conflict then append a number:

int MyFunction(string s1, string s2, int i, float f1, float f2);

If the function is non-trivial (not a settor or getter) then use the full semantic name in lowercase. If conflicting then append a number:

void MyFunction2(string strFirstName, string strLastName);

Competence Delusion

April 22nd, 2009

My favorite APA article:

“Unskilled and Unaware of It: How Difficulties in Recognizing One’s Own Incompetence Lead to Inflated Self-Assessments”

From the article:
People tend to hold overly favorable views of their abilities in many social and intellectual domains. The authors suggest that this overestimation occurs, in part, because people who are unskilled in these domains suffer a dual burden: Not only do these people reach erroneous conclusions and make unfortunate choices, but their incompetence robs them of the metacognitive ability to realize it.

PDF Download

Project Naming Conventions

February 22nd, 2009

How about using major hollywood film titles?

The results would be hilarious and somewhat disturbing to non-insiders or to people that like to eavesdrop:

  • Project Alien
  • Project Bubba Hotep
  • Project Star Wars
  • Project Temple of Doom
  • Project The Day the Earth Stood Still

No more cable

January 5th, 2009

For the Win:
  • Saving over $50 a month
  • Uncompressed over-the-air HD signals
  • No more talk-news pundits
  • Jim Lehrer News Hour in HD
  • PBS in HD

Adverts on Webpages

January 5th, 2009

One word: Tacky.