Sunday, February 14, 2010

iPhone SDK 3.1.3

toolsAnother new iPhone SDK 3.1.3 is available. This one is very similar as the previous one on Feb 1 I got. The size is very big, about 3.05GB. Here is what Apple says about the SDK:

What’s New in this Version
- SDK support for targeting non-Mac OS X platforms, including iPhone OS SDK.
- GCC 4.2 & LLVM GCC 4.2 optional compilers for use with Mac OS X 10.5 SDK
- Updated assistants to create new projects, targets, and source files
- Toolbar uses a single popup to choose platform, target, and debug/release
- Integrated SCM support now works with Subversion 1.5

Company:Apple Inc.
Version:3.1.3
Post Date:February 2, 2010
License:Freeware
File Size:3.05GB
URL Type:Form
Download ID:17946




Here is what actually in the installation:

iPhone SDK 3.1
Installs the iPhone SDK 3.1.

iPhone SDK 3.1.2
Installs the iPhone SDK 3.1.2.

iPhone SDK 3.0
Installs the iPhone SDK 3.0.

iPhone SDK 2.2.1
Installs the iPhone SDK 2.2.1. NOTE: this will install the iPhone SDK 2.2.1 to work only on a device; the iPhone Simulator requires iPhone SDK 3.0 or later on Mac OS X 10.6 Snow Leopard.

Sytem Tools
Installs system-wide tools such as Shark (part of the CHUD performance tools), DTrace components used by Instruments, and distributed build processes.

There can be only one, newest set of System Tools per Mac OS X installation at a time, and are always installed into /Developer on the boot volume.

UNIX Development Support
Optional content to allow command-line development from the boot volume. Installs a duplicate of the GCC compiler and command line tools included with the core Xcode developer tools package into the boot volume. It also installs header files, libraries, and other resources for developing software using Mac OS X into the boot volume.

This package is provided for compatibility with shell scripts and makefiles that require access to the developer tools in specific system locations. This content is not relocatable and will only be installed onto the boot volume.
Documentation
Xcode will download developer documentation to disk at first launch, and automatically keep it updated. Deselecting this option requires a network connection while viewing documentation. You can change this at any time in the Xcode Documentation preferences.


Finally, here is the space difference between before and after the update:
Command: df -lakUsed(Kilobytes in 1024-blocks)
Before ...4,408,568
After...2,729,796
Difference (A-B)-1,678,772

Read More...

Monday, February 08, 2010

iPhone Development Update

In the past week evenings and weekend, I spent most of my watching iPhone development related videos. I got those video information when I accessed to Apple’s iPhone developer web site. I remember that I watched a serials of iPhone development classes by Stanford University last Spring. Since then there are more training materials from Apple and other institutions.

Here is a snap-shot of videos I have in my iTunes:



It is great to watch those on my Mac iTunes. However, they are not directly available from Web, or from browsers. I tried to install iTunes at my work PC and I was planning to watch them after work so that I would have quite time there. Unfortunately, I could not get those videos from iTunes in Windows. It looks like that the download URLs or iTunes protocols are blocked at the work. There is no way to get them from browsers, at least I don’t know. In this sense, those videos are not widely opened.

For videos I watched last week, I understand most contents very well. I think that this is the benefit of my past year reading iPhone OS Reference Library and other materials at Apple’s Dev Center. Still those excellent videos greatly help me to understand some concepts such as memory management, MVC, KVC, KVO, and delegates.

By the way, I tried to optimize the size of my snap picture by using Yahoo’s Smuit.com. It is very interesting that Smushit could not find any savings in my pictures. Mac’s png picture is quite good if it is true. I am not sure if the recent update enhances this or not.

Read More...

Saturday, February 06, 2010

Retry Component

Last Friday, I finished a project of reading data from a service and saving the data to a network drive. The project is a console application based on a framework of DI. that is, dependency injection. The whole process is divided into several small tasks, and each task is corresponding to a component, or a library in .Net. Each one does one job and does it well. Together, the components are plugged in to a main controller, where a work flow of components is laid out in a logic as expected. In addition to this clear and well defined structure, there are many other advantages as well, for example, easy maintenance and reusability.

The application will run on daily base to prepare data for one department. I demoed the application to my project team leader. He was very happy to see how the demo run. After the demo, he asked me a question: how about retry? Is there a way to run this application on a retry style if the required data are failed to deliver to the network drive? I have worked on several cases to read required data from SQL servers. All those application have the retry feature. For example, one applications gets the required data first, if the returned data is empty, then the application will quit immediately. If the required data are not empty, the application then gets the data and saves them to the server.

However, for this case, the data source and destination are not at the same place. Therefore, the application will always get the data from source when it runs. I have to work out a way for the retry. In other words, I have to define or create some key references to check if the retry is needed.

Since the job will run on daily base, I come out two keys to check: date and status. For the date, there is one as expected date, and another as actual last date; same for the status, one as expected status and another actual last status. The actual value has to match to the expected value. For example, a user can set up the expected date today and the expected status as a string of "ProcessOK". When those conditions are true or the actual values match the expected values, the application will not read data from source; otherwise, it will read data and continue the remaining steps. After all is done, the actual values will be updated.

All those expected and actual information are defined and saved in an XML configuration file. The expected date can be a script of C# code like "DateTime.Parse(DateTime.Now.ToShortString())", which will always to get today's date. The expected status is static as well. Therefore, only two actual values have to be updated by the application when a complete run is finished.

Here are the pseudo codes of the retry logic:

   bool retry = method call to an instance of Retry with the logic:
!(actual_last_date is set) ||
!(actual_last_status is set) ||
(expected_date != actual_last_date) ||
(expected_status != actual_last_status);
if (retry)
{
run_application
...
save actual_last_date
save actual_last_status
}

The Retry class is a component in a library project. The Retry class implements an interface of ICommuncationChannel in a framework library:
  interface ICommunicationChannel<TData, TValue>
  {
    TData Request(TValue value);
  }

so that it can be requested to return a result of retry. A configuration class is also defined in the Retry component library. The config class is simple class with property definitions corresponding to the expected values and the actual values. An instance of the config is wired to the XML configuration.

After one day hard-thinking and coding, I got the component completed, added the DI mapping and XML mapping for Retry's config, and almost finished the main controller with Retry component in the logic.

The reason that I decided to save the actual last results the XML configuration file is that those values can be easily parsed out by another PowerShell script project to get the job status. I have done a monitor process based on PS and Growl for sending notification messages. With the retry feature, I can bring an additional benefit: adding these actual values to the monitor process so that the notification message will include the information.

Read More...

Monday, February 01, 2010

iPhone SDK 3.1.2

After about one year reading of iPhone development reference documentations and training materials, I am going to start my new adventure of iPhone application development. I downloaded the iPhone SDK long time ago. I think I need to get the newest version of DSK 3.1.2 first. The total package is about 2.5GB, which takes long time to get it. I just started about a few minutes ago, now the remaining time is about 37 minutes.

At the same time, I found there are some iTune video materials available from ADC, I am going to get them as well. My first application will be in the category of Productivity area for managing personal expense information. The datastore will be based on SQLight which is recommended by Apple for iPhone app. I have created several tables for raw data. In order to management raw data, I am going to use Tags to let user to tag those information. The main interface will be based on tableview controls for displaying data with editing features. The edit view will be a view with text and date time controls. I am going to draw those views and workflow structure of views.

The application will be MVC based application. To my surprise, Apple developers has implemented this pattern for quite long time, even long before the current Microsoft MVC model in Windows and ASP applications.

Even the iPhone development and Objective-C are new for me, I think I have very good knowledge of C/C++, as well as extensive experience in OO. I have explored some iPhone applications and had my hands on some examples. I really like the framework of Cocoa. It will take time get used to the new framework for sure. I think the most achievement is to develop my own applications and test them out on the Apple Store.

I have a line of ideas to develop iPhone applications. iPad will be available in less than 60 days and iPad 3G in less than 90 days. If I can get some out for iPhone, it will be fun to see how they are in iPad. I may move to iPad application development as well.

The following are snap-shots of the installation steps:







Detail descriptions for items:

iPhone SDK 3.1
iPhoneSDK.3.1.2Install1
iPhone SDK 3.0
Installs the iPhone SDK 3.0.
iPhone SDK 2.2.1
Installs the iPhone SDK 2.2.1. NOTE: this will install the iPhone SDK 2.2.1 to work only on a device; the iPhone Simulator requires iPhone SDK 3.0 or later on Mac OS X 10.6 Snow Leopard.
System Tools Support
Installs system-wide tools such as Shark (part of the CHUD performance tools), DTrace components used by Instruments, and distributed build processes.


There can be only one, newest set of System Tools per Mac OS X installation at a time, and are always installed into /Developer on the boot volume.
Documentation
Xcode will download developer documentation to disk at first launch, and automatically keep it updated. Deselecting this option requires a network connection while viewing documentation. You can change this at any time in the Xcode Documentation preferences.
Mac OS X 10.4 Support
Support for developing applications that target Mac OS X 10.4 APIs.

I checked the "Mac OS X 10.4 Support" (even it is still Zero KB).

Read More...