Author Archives: Umair
Finding the Start of a Loop in a Circular Linked List
A lot of people are familiar with the problem of detecting a loop in a linked list. The problem goes as follows: “Given a linked list, what is the algorithm to determine if it has any cycles (loops)?” The algorithm … Continue reading
Filed under Algorithms, Java
Incorrect C++ compiler behavior in Visual Studio
[Note: Special credit for this post goes to my colleague Yuliy Gerchikov, who first discovered this issue] As most C++ programmers know, an object that has been constructed via the new expression must be destroyed by calling delete. The delete-expression … Continue reading
Filed under Programming, Tools
Stern-Brocot Tree
Stern-Brocot tree is a tree data structure whose vertices correspond to the set of non-negative rational numbers. Thus, this tree provides a very elegant way for constructing the set of fractions m/n, where m and n are relatively prime. To … Continue reading
Filed under Algorithms
Manual Memory Management in Objective-C
Objective-C on iOS has no garbage collector, so it is up to the programmer to make sure that memory is properly freed once an object is no longer needed. On the other hand, Objective-C on the Mac does have a … Continue reading
Filed under Cocoa
Snapshots in Xcode
When writing code, I usually write code in an incremental fashion. I try to get one set of functionality to work before I start on the next set. Due to this, I frequently create incremental backups of my files/project before … Continue reading
2010 in review
The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health: The Blog-Health-o-Meter™ reads This blog is doing awesome!. Crunchy numbers A Boeing 747-400 passenger jet … Continue reading
Filed under Uncategorized
Xcode – How to bring back the splash screen at launch
When Xcode is started, I like the fact that a splash screen comes up with a list of recent projects (shown below). I somehow unchecked the “show at launch” box, and now Xcode starts up in headless mode. I checked … Continue reading
Filed under Tools
Code Snippets in Visual Studio 2010
Visual Studio allows developers to save snippets of code which can be inserted at a later time. This saves on retyping blocks of code that are used often. I also find it very useful when I have to show code … Continue reading
Filed under Visual Studio
XAML Resources
Every element in Silverlight contains a Resource property that maintains a dictionary of resources. This collection can hold any type, and a key is used to refer to each individual resource. Each element has access to its own resources as … Continue reading
Filed under .NET, Programming
Custom Attached Properties in Silverlight
An attached property is a type of global property that is settable on any nested object. In Silverlight (and WPF), attached properties are usually defined as a specialized case of Dependency Properties, and like all dependency properties they are managed … Continue reading
Filed under .NET, Programming