Archive October 2009

17 Websites for Sharing Programming Knowledge

17 Websites for Sharing Programming Knowledge

Whether you are trying to drive traffic to your own blog or are looking for assistance when developing – it’s sometimes useful to participate in programming forums and blogs by sharing knowledge.

I’ve compiled a list of 17 websites where you can share your own knowledge or search for help on a problem.

Apple

Apple Discussions – Developer Forum

AppleDiscussions

Apple Discussions are a resource for everything Apple: iPhone, OS X, Hardware, etc. One of the categories is the Developer Forum, which is a resource for developers using the Apple OS X platform.


Java

Sun Forums

SunForum

The Sun Forums are a resource for Java developers and other Sun software and hardware. Some of the Java topics covered:

  • Java Essentials
  • Core
  • Database Connectivity
  • Desktop
  • Developer Tools
  • Security
  • Java HotSpot Virtual Machine
  • Enterprise & Remote Computing
  • Real-Time
  • Java Mobility

Microsoft

ASP.NET Forums

ASPNET

The ASP.NET forums is a resource for those developing web applications in Microsoft ASP.NET. Some of the topics covered:

  • General ASP.NET
  • ASP.NET AJAX
  • Visual Studio
  • Data Access
  • Advanced ASP.NET
  • Migration to ASP.NET
  • Starter Kits and Source Projects
  • Microsoft Downloads
  • Development Tools
  • Windows Hosting
  • Community
  • .NET Languages

IIS Forums

IIS

The IIS forums are a resource for those developing on the Microsoft Windows Server platform. Some of the topics covered:

  • IIS 5.x & 6.0
  • IIS 7
  • 64-bit Editions of IIS
  • General

MSDN Forums

MSDN

The MSDN forums are a great addition to the MSDN Library, for those developing in .NET. Some of the topics covered:

  • .NET Development
  • Visual Studio
  • Visual Studio Express Editions
  • Visual Studio Team System
  • Visual Basic
  • Visual C#
  • Visual C++
  • Visual J#
  • Visual FoxPro

PHP

PHP Developers Network

PHPDev

The DevNetwork forums are a resource for those developing in PHP. Some of the topics covered:

  • General
  • Programming
  • Design
  • System
  • Business

Ruby on Rails

Ruby Forum

RubyForum

The Ruby forum is a collection of forums related to the Ruby language and the Rails framework. Some of the forum topics:

  • Ruby
  • Ruby Core
  • JRuby
  • IronRuby
  • Rails
  • Rails Deployment
  • Rails I18N
  • Rails Engines
  • Rails Core (r/o)

Rails Forum

RailsForum

The Rails Forum is for those developing in Ruby on Rails. Some of the topics covered:

  • Starting Out
  • Planning
  • Programming Rails
  • Extending Rails
  • Production
  • Web Development

Python

Python Forum

PythonForum

The Python Forum is a resource for those developing in Python. Some of the topics covered:

  • Python Coding
  • Forum Activities: Contests & Challenges

Perl

Perl Guru

PerlGuru

The Perl Guru forums is a resource for those developing in Perl. Some of the topics covered:

  • Perl Programming Help
  • Fun with Perl
  • Custom Perl Written Program Requests

General – Web Development & Design

Coding Forums

CodingForums

CodingForums is a resource for those developing in a variety of web technologies. Some of the topics covered:

  • Client-Side Development
  • Server-Side Development
  • Computing and Sciences
  • Web Projects and Services Marketplace

Web Design Forum

WebDevForums

Web Design Forum is a resource for both web developers and web designers. Some of the topics covered:

  • Web Design
  • Graphic Design
  • Scripting Languages
  • SEO
  • Marketing
  • Hosting
  • Business

General – Various

Code Guru

CodeGuru

CodeGuru Forums are a resource for all types of developers. Some of the topics covered:

  • Visual C++ and C++ Programming
  • Visual Basic Programming
  • .NET Programming
  • Java Programming
  • Other Programming: AJAX, Scripting, Database, XML

DZone

Dzone

DZone is a link sharing community specifically for developers. Developers can submit, share, vote and comment on links.

Proggit (Reddit Programming Subreddit)

Proggit

Reddit is a link sharing community, where users can submit, share, vote and comments on links. Reddit Programming is a category of Reddit specifically for links related programming.

Stack Overflow

StackOverflow

Stack Overflow is a Q&A site for programmers. Users can ask questions related to any programming language and submit answers, vote and comment.

Tech Republic

TechRepublic

TechRepublic is a community site for IT professionals containing blogs, forums, white papers, videos, photos, etc. All topics related to IT are covered in one of the above formats.


Please share any programming forums or blogs that you frequently visit in the comments.

13
What Programming Language Should I Learn Next?

What Programming Language Should I Learn Next?

I am a big fan of reddit and it is usually my primary source of reading what’s new.

There is a sub-category (sub-reddit) on Reddit for Programming and one question that is posed very frequently is: What programming language should I learn next?

If your purpose for learning a new language is career motivated, I recommend that you start your quest looking at what what top companies are searching for in candidates. Companies such as Microsoft, Google and and Apple will generally seek individuals who have knowledge of the core programming languages such as C, C++, Java and will mix in some of the more cutting-edge technology such such as AJAX or jQuery.

Here are some sample job requirements from Google, Microsoft, Facebook and Apple.

Google - Software Engineer

  • BS, MS, or PhD in Computer Science or related technical discipline (or equivalent).
  • A solid foundation in computer science, with strong competencies in data structures, algorithms, and software design.
  • Extensive programming experience in C/C++ and/or Java (strong OO skills preferred).
  • Several years of large systems software design and development experience, with extensive knowledge of Unix/Linux.
  • Coding skills in Python or Javascript/AJAX, database design and SQL, and/or knowledge of TCP/IP and network programming are a plus.

FacebookFront-End Engineer

  • A passion for performance debugging and benchmarking Experience building JavaScript/HTML/CSS applications and frameworks
  • Experience working with JavaScript/HTML/CSS in high-performance environments
  • Knowledge of but not reliant on Prototype JS, MooTools, Dojo, jQuery
  • Identify performance bottlenecks in JavaScript applications
  • Build performance minded front end abstractions and systems
  • Provide code optimization recommendations
  • Prototype and implement optimization techniques
  • Benchmark existing code and enhancements
  • Participate in design and code reviews
  • Code primarily in JavaScript, HTML & CSS
  • Interface with other team members to incorporate their innovations and vice versa
  • Identify and communicate best practices interpersonal and communication skills, and proven ability to work effectively with all organizational levels
  • BS or MS degree in Computer Science or Engineering preferred

MicrosoftSoftware Development Engineer (SDE)

  • Pursuing a B.S./M.S. or Ph.D. degree in Engineering, Computer Science, or related field
  • 1-2 years experience programming in C/C++/C#, Java, and/or other computer programming languages preferred
  • Ability to derive creative and innovative solutions by thinking “outside the box”
  • Expertise in feature definition, design, and feasibility
  • Demonstrated skill in estimating development time

Apple - Application Software Engineer

Key Requirements:

  • BS CS/CE or equivalent
  • Strong programming skills, preferably with C, Objective-C, and/or C++
  • Excellent communication and collaborative skills
  • Excitement and passion to work on amazing products
  • Deep understanding of performance assessment and optimization
  • Proven ability to excel in a fast-paced development team

Preferred skills:

  • Mac OS X and/or iPhone OS programming experience
  • User-interface programming experience
  • Familiarity with web technologies and XML

By reviewing the job postings of the leaders in technology, you should be able to get a good idea of what is in demand these days.

I know from past experience when I looking for a job, I often saw postings that listed every programming language known to man: Cobol, Fortran, Pascal, QBasic, C, C++, C#, VB, VB.NET, Java, PHP, Perl, Python, Ruby, etc. Any not only that, they were looking for 10+ years experience in each one. These types of postings are unrealistic, not to mention ridiculous – it is highly unlikely that anyone has all the required experience (especially 10 years of .NET).

There is nothing wrong with learning an outdated or obsolete programming language for fun – I encourage it, if you have the time to learn it. But for advancing your career, a solid understanding of a core language is key.

Beyond programming skills, you might decide to acquire skills in another area such as development estimation, code design, or something non-technical such as communication skills.

How do you decide what you are going to learn next?

6
5 Steps for WordPress Preparation

5 Steps for WordPress Preparation

If you are self-hosting your WordPress blog (not using WordPress.com), it is a good idea to setup an instance on your local computer.

Setting up a local instance of WordPress and a development environment will help you tweaking theme source files, test upgraded WordPress installations and test plugins – without making changes on your live site. You won’t be using the local instance for posting, but you might want to post a few dummy posts.

Step One: Installing WordPress locally

WordPress has some tutorials on how you can setup a local version of WordPress using tools such as MAMP, XAMPP, etc. depending on your operating system.

Step Two: Install a (source/version/revision) control system

It’s unlikely that you will like everything about a WordPress theme, so before you start editing the theme source files, establish a source control repository to keep track of your revision history.

You can use the SCM of your choosing – Smashing Magazine has a review of the 7 most popular revision control systems in use today:

Step 3: Test all your plugins locally

Before you activate any plugins on your live site, install and test any plugins locally. Some plugins may make modifications to your database and potentially corrupt your WordPress installation. Other plugins may not be compatible with your version of WordPress or behave well with your selected theme.

Step 4: Install an IDE (and a FTP client)

The Appearance Editor within the WordPress Admin site is not the most user-friendly for editing and formatting source code. It is better to use a Text Editor or an IDE that supports syntax highlighting. Some of the better IDE include a built-in FTP/SFTP so you don’t need to switch applications when deploying your files.

Editors with Built-In SFTP/FTP

Even if your IDE supports SFTP/FTP, I would still recommend installing a FTP client such as Filezilla.

Edit your files that are under version control and when you are ready to deploy, FTP them to your local WordPress directory.

Step 5: Install WordPress on your web-host

Most web-host will have some sort of one-click WordPress installation through cpanel or GoDaddy’s Hosting Control Center. These make it relatively easy to setup on your web-host without the need of transferring and configuring WordPress files.

Once, WordPress is installed on your web-host, add the FTP server information for your web-host to your FTP client and IDE.

Note: Once you have WordPress deployed on your webhost, I recommend that you backup your WordPress database regularly – this will preserve your posts. See this post from ProBlogger: How to Backup Your WordPress Blog In Three Easy Steps.

* WordPress Icon provided by BlogPerfume.com

1
How to Find Time for Learning

How to Find Time for Learning

One of the biggest challenges when trying to learn something new is finding the time to do it.

We all have obligations (work, school, family, sleep, etc.) that require our attention and finding free time in amongst all of these can sometimes be difficult.

Scheduling Out Your Day

Here’s an activity for you to perform to figure out how much free time you have available.

Note: Everyone’s schedule will differ on different days, but start by looking at the the 24 hours that you have available in a typical day.

A typical workday

Work: 8 hours
Sleep: 8 hours
Quality Time: x hours
Free Time: 8 – x hours
Total: 24 hours

Required Time: Work and Sleep

First, subtract 16 hours, this includes 8 hours for work (assuming you work a typical 8 hour day) and 8 hours for sleep – you will be left with 8 hours.

I would recommend against taking time away from work and sleep. You might be able to get away with modifying your sleep schedule occasionally, but try not to make a habit out of it. Also, if your employer allows you to take 30 minutes during working hours to explore something new, then adjust the hour allocation for work.

Quality Time

The remaining hours will vary depending on your lifestyle, but are what I call Quality Time – time that you cannot be substituted for other voluntary activities. Subtract time you spend getting ready for work, eating (breakfast, lunch and dinner), commuting, spending time with family (or significant other) and any other activities in which you participate in a typical workday.

Free Time

Your Free Time should be things that if they are not done, the consequences are minimal. This might be things such as time spent watching TV, exercising, browsing the internet, reading, etc. This is the time that you can allocate for learning something new.

Determine What’s Important

If you completed the exercise and found that you don’t have any free time, what do you do? Determine what’s important to you or prioritize. Is watching your favorite TV show more important to you than spending time learning something new?

Create Time

Of course you can’t create time in the literal sense, but you can adjust your habits so it appears that you have more free time. If you must do everything on your list, try modifying the time spent on each activity – instead of exercising for 1 hour, exercise for 30 minutes. Here are a couple things that you can do to change your TV habits.

1. Stop Watching Commercials

If you have a Tivo or DVR, record all of your favorite shows and watch them when you have time. By skipping commercials, you can save over 15 minutes of commercials are shown on TV every hour. Or you can watch shows on your computer via Hulu.

2. Browse Internet/Email During Commercials

If you don’t have a DVR and like to watch shows at their scheduled time, productively use the time during commercials to do other things such as respond to email or browse the internet.

The free time that you have will fluctuate throughout your life, but it’s important that you always try to allocate some time to your continued learning.

1
Output PDF Binary to Browser in ASP.NET

Output PDF Binary to Browser in ASP.NET

Here is the code to output PDF Binary to the browser using ASP.NET / VB.NET.

Note: This code assumes that you already have the PDF binary data stored in a byte() array called data.

Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Response.BinaryWrite(buffer)
Response.End()

To add an Open / Save dialog window:

Response.AddHeader("content-disposition","attachment;filename=report.pdf")

If you encounter errors in Adobe Reader, make sure that your aspx page contains only the page directive:

<% @ Page Language="vb"%>

0
How to Read a Book Using SQ3R

How to Read a Book Using SQ3R

Before I entered college over 10 years ago, I participated in a 1-day seminar for incoming freshmen called Strategies for Success. The purpose of the seminar was to introduce you to study habits and prepare you for the college workload. What reminded me recently of this seminar was a book that I started reading: ‘Secrets of the Rockstar Programmers’. The book is a collection of interviews with top programmers. In the first chapter I came across a term that looked vaguely familiar: SQ3R. When I got to thinking about it, I recalled that it was during the Strategies for Success workshop that I originally heard about this.

What is SQ3R ?

SQ3R is an reading strategy, abbreviated: Survey, Question, Read, Recite, Review. This technique is meant to be applied to a chapter in a book. Some textbooks have indirectly adopted this strategy by including a chapter outline, a pre-test, chapter summary and a post-test.

If you were to apply SQ3R to a book on the Python programming language, this is how it could be done:

Survey

During this step you want to skim through the chapter and read any headings, diagrams, charts, pictures, etc. You do not want to read too much in depth but rather get a overview of what to expect in the chapter.

Some items that I might pull out of the book are:

  • Functions
  • Objects
  • Indenting
  • Lists, Tuples, Dictionaries
  • Exceptions

If you don’t understand something upon the first glance, start to formulate some questions.

Question

From the items that you just skimmed were there any items that made you curious or unsure? This is where you want to start formulating some questions. Write down several questions that you want to understand about content you just skimmed. Some questions you might ask are:

  • How is indenting my code important in Python?
  • What data types are objects?
  • What is a tuple?

You may also have a question that is not relevant to the chapter you skimmed such as:

  • Why is Python preferred over scripting languages such as Perl?

Though it may not be answered in the chapter, it may be covered in later chapters.

Read

Now you are ready to start reading the chapter. While you are reading start looking for answers to the questions that you posed previously, but try not to ignore the other information.

If the book you are reading contains code, try to walk through the code on paper without typing it into a computer.

Recite

After you have read the chapter, try to summarize by writing down the main points of what you read.

  • How is indenting my code important in Python? Indenting is required in Python and results in standardized formatting.
  • What data types are objects? All data types are objects.
  • What is a tuple? A tuple is an immutable list.

Write down the answers to your questions and then write down any other additional information.

  • What does immutable mean?

In this step you should explore the code samples introduced in the chapter. Type and run the sample code to see if the actual output is the same as the expected output when you previously read through the code.

Review

At this point you should be able to comprehend all the main points in the chapter from memory, if not, write down more questions and repeat the read, recite, review steps until it becomes clear.

By completing all the steps of SQ3R you should have a mastery of the chapter content. I find that this strategy tends to work better with technical books or textbooks than with novels.

How does this reading strategy compare to how you typically read a chapter of a technical book?

0
An Overview of Microsoft PowerShell

An Overview of Microsoft PowerShell

I decided to install SQL Server 2008 Express and while I was resolving my prerequisite issues I noticed that one of the requirements was to have Windows PowerShell installed. I have to admit, I have never heard of Windows PowerShell at this point, I just passed this off as another utility that was included as a part of Visual Studio. Since it was a requirement for SQL Server, I installed it. A few days later as I was exploring my Programs folder I noticed an entry for Windows PowerShell, so I decided to take a look.

My first impressions were that it looked a lot like the command window (cmd.exe), until I did a “dir” command; the output was Unix/Linux-like. I then tried a couple of Unix commands such as “ls” and “ps” and surprisingly they worked! Other commands such as “grep” and “who” did not work. It looks like Microsoft had developed a shell comparable to those found on Unix/Linux and they also borrowed a lot.

Power Shell

PowerShell Resources

I was determined to test-drive PowerShell to see what it was capable of, and surprisingly found out that PowerShell had already been out since late 2006 and there was a lot of documentation and tutorials available. Frank Koch (Infrastructure Architect at Microsoft) developed some workshops and documentation for learning PowerShell that are available for download in both English and German. I walked through the first of his tutorials and discovered most of what you can accomplish in the shells of Unix (e.g. ksh, bash), can be accomplished with PowerShell and the syntax is very similar. Most of the commands (called cmdlets) will utilize pipes ‘|’ to redirect the output of a command to another or to a file. PowerShell also supports looping, and formatted output (i.e. csv, xml, html).

Another great site for PowerShell tutorials and resources is PowerShell Pro! One of the more useful features of the site is the Script Library, a forum where users can find/post shell scripts.

When starting to learn PowerShell commands, you will find that there is a lot more typing involved. Many of the commands will use a “verb-noun” context, for example, the equivalent of the “kill” command is “Stop-Process”. Fortunately, like in Unix, PowerShell supports the use of aliases and by default will map most of the known Unix Shell commands to their respective cmdlet. Here is a list of the built-in aliases:

Alias Cmdlet
ac Add-Content
asnp Add-PSSnapin
clc Clear-Content
cli Clear-Item
clp Clear-ItemProperty
clv Clear-Variable
cpi Copy-Item
cpp Copy-ItemProperty
cvpa Convert-Path
diff Compare-Object
epal Export-Alias
epcsv Export-Csv
fc Format-Custom
fl Format-List
foreach ForEach-Object
ft Format-Table
fw Format-Wide
gal Get-Alias
gc Get-Content
gci Get-ChildItem
gcm Get-Command
gdr Get-PSDrive
ghy Get-History
gi Get-Item
gl Get-Location
gm Get-Member
gp Get-ItemProperty
gps Get-Process
group Group-Object
gsv Get-Service
gsnp Get-PSSnapin
gu Get-Unique
gv Get-Variable
gwmi Get-WmiObject
iex Invoke-Expression
ihy Invoke-History
ii Invoke-Item
ipal Import-Alias
ipcsv Import-Csv
mi Move-Item
mp Move-ItemProperty
nal New-Alias
ndr New-PSDrive
ni New-Item
nv New-Variable
oh Out-Host
rdr Remove-PSDrive
ri Remove-Item
rni Rename-Item
rnp Rename-ItemProperty
rp Remove-ItemProperty
rsnp Remove-PSSnapin
rv Remove-Variable
rvpa Resolve-Path
sal Set-Alias
sasv Start-Service
sc Set-Content
select Select-Object
si Set-Item
sl Set-Location
sleep Start-Sleep
sort Sort-Object
sp Set-ItemProperty
spps Stop-Process
spsv Stop-Service
sv Set-Variable
tee Tee-Object
where Where-Object
write Write-Output
cat Get-Content
cd Set-Location
clear Clear-Host
cp Copy-Item
h Get-History
history Get-History
kill Stop-Process
lp Out-Printer
ls Get-ChildItem
mount New-PSDrive
mv Move-Item
popd Pop-Location
ps Get-Process
pushd Push-Location
pwd Get-Location
r Invoke-History
rm Remove-Item
rmdir Remove-Item
echo Write-Output
cls Clear-Host
chdir Set-Location
copy Copy-Item
del Remove-Item
dir Get-ChildItem
erase Remove-Item
move Move-Item
rd Remove-Item
ren Rename-Item
set Set-Variable
type Get-Content

If you use PowerShell regularly, what tasks do you find it is best suited for?

0
Enhance Your Skills By Belonging to Professional Organizations

Enhance Your Skills By Belonging to Professional Organizations

If you work in information technology, how do you keep both your social and technical skills up-to-date to remain competitive? Enrolling in an academic program could be beneficial to improving your skills, but it could get expensive and often a technical curriculum will not cover the latest technologies. This is where belonging to a professional organization may be an option.

Social Skills

No matter what line of work you are in, everybody could use some improvement in their social skills. Unless you speak regularly to groups in your profession, the venues for you to practice public speaking are limited.

Toastmasters International is an organization that I have recently joined. Toastmaster’s provides a venue and focuses on helping members develop leadership, communication and public speaking skills. Most people would be apprehensive about joining an organization like this because of their fear of public speaking, but the reason Toastmasters exists is to help overcome this fear in a supporting environment.

Leadership

You acquire leadership skills by taking on roles each week to help out your fellow members. Some of the roles are:

Toastmaster - The M.C. for that day’s meeting.

Timer - Keeps track of each speaker’s time.

‘Ah’ Counter – Identify filler words that speakers use (e.g. er, um, ah, but, so, etc.)

Evaluator - Ensures speakers follow the guidelines of their prepared speeches.

Table Topics Master – Facilities a session known as Table Topics or speaking off-the-cuff.

Communication & Public Speaking

At all meetings there is an opportunity to speak by giving a prepared speech or participating in table topics. If you fulfill one of the roles above, you must present your findings to the group.

If this sounds like something you are interested in, I encourage you to contact a local club and attend a meeting as a guest to see firsthand how Toastmasters could help you. Membership fees can vary by club, but the cost is usually less than $100 for the year.

Technical Skills

With technology changing as fast as it does these days, learned skills can become obsolete very quickly. Fortunately there are plenty of online tutorials and books/magazines available so you can advance your skills through self-study. I think the difficulty lies in determining what you should study because there are so many technologies out there. I’ve read blogs where people ask “What programming language should I learn?” One possible answer to this question is: try learning different ones. If you want to commit yourself to life-long learning about new topics, consider joining a technical professional organization.

ACM

I recently joined the Association for Computing Machinery (ACM). ACM provides access to journals, magazines, online courses and books. The selling point for me was their collection of online books. For the price of a couple of technical books, I can access over 1,000 books online. ACM also provides a monthly email consisting of several articles related to your interests. These are just a few of the benefits that they provide. ACM offers two levels of yearly membership the basic membership is $99 USD and if you want the basic plus access to their Digital Library $198 USD.

IEEE

IEEE is a little less focused than ACM and covers a wider range of fields such as physical sciences, biology, law, as well as, the computing fields. IEEE provides access to numerous journals and magazines, but did not offer access to the same book catalog as ACM. The cost of a yearly IEEE membership is $169 USD.

Networking

The added benefit of belonging to either a social or technical professional organization is the opportunity to network. These organizations often host conferences several times a year, where you can meet people who share your interests and are in your field of work.

What are some other professional organizations that you belong to?

3
Using Subversion with Xcode, Part III

Using Subversion with Xcode, Part III

In Part I, I walked through the process of setting up repositories and projects in Subversion, Part II covered configuring Subversion with Xcode, this part will provide an overview of the SCM tools within Xcode and also show you how to tag and branch your code within Subversion.

Xcode SCM Attributes

If you have your project successfully configured for use with Subversion, once you check-out your files and make any changes Xcode will identify these changes with attributes. Once you start editing a file, an ‘M‘ will show up next to the file in the Groups & Files window. Also, if you add any files to your project these will be identified with a ‘?‘. These attributes will remain until your changes are committed or if you discard your changes.

SCM Attributes

Committing & Discarding Changes

If you are familiar with other version control systems, you might know committing as ‘check-in’ and discard as ‘undo check-out’. You can commit or discard changes at the file level by right-clicking each file or folder and making the selection or by selecting ‘SCM‘ from the menu and selecting commit or discard changes. The ‘SCM‘ menu also allows you to commit all the changes in your project by selecting ‘Commit Entire Project‘.

Committing Changes

Other SCM Tools

The Xcode SCM Menu provides a couple of ways to easily compare the contents of any file that you have checked-out with any revisions committed in Subversion, using FileMerge and the Unix diff tool.

Compare

By selecting ‘Compare With’ from the ‘SCM‘ menu, Xcode will open the FileMerge application that will show each file side-by-side and indicate the differences between each file. In File Merge, you can choose to add or remove any lines in your checked-out file.

Diff

If you have had exposure to the diff tool in Unix/Linux, it is available as an option to use within Xcode. By selecting ‘Diff With‘ from the ‘SCM‘ menu, Xcode will execute the diff command with your currently checked-out file and the revision file that you specify as arguments. The results of this command will be displayed in the current code window.

Subversion Tagging

In Part I, I mentioned that Subversion also has the following folders: tags and branches. The tag folder is used for storing releases or stable builds of your code and allows you recall the correct version of the project files if you need to fix any bugs. Here is a script that will allow you to tag your project, it assumes that whatever the is currently committed in the trunk folder is what you want to tag:

#!/bin/ksh
# A script to tag a SVN release

reporoot=/Library/Subversion/Repository/
projdir=Projects

# Prompt for repository name
print -n "Enter repository name:"
read repo

# Prompt for project name
print -n "Enter project name:"
read project

# Prompt for release number
print -n "Enter release number:"
read release

# Tag release
svn copy file://$reporoot/$repo/$projdir/$project/trunk file://$reporoot/$repo/$projdir/$project/tags/release-$release -m "Tagging the $release release of the ‘$project‘ project."

echo
echo Tagging the $release release of the $project project Complete!
echo

Subversion Branching

The branches folder is used for storing code that you want to develop new functionality with or experiment on without making revisions to the code in the trunk. Here is a script that will allow you to branch your code, also it assumes that whatever the is currently committed in the trunk folder is what you want to branch.

#!/bin/ksh
# A script to branch a SVN trunk

reporoot=/Library/Subversion/Repository/
projdir=Projects

# Prompt for repository name
print -n "Enter repository name:"
read repo

# Prompt for project name
print -n "Enter project name:"
read project

# Prompt for branch name
print -n "Enter branch name:"
read branch

# Create branch
svn copy file://$reporoot/$repo/$projdir/$project/trunk file://$reporoot/$repo/$projdir/$project/branches/$branch -m "Creating a branch of the ‘$project‘ project."

echo
echo Creating a branch of the $project project Complete!
echo

I hope you enjoyed reading this 3 part tutorial on setting up Subversion within Xcode. Please share your thoughts on how you use Subversion or any other SCM system with your development environment.

4