Friday, February 27, 2009

iPhone Journal 0000 1001

My objective today was to begin chapter 8 of Beginning iPhone Development: Exploring the iPhone SDK by Dave Mark and Jeff LaMarche and to meet with Mr. Collias' programming team. The day was more productive than I had anticipated.
In the morning, I learned about the implementation of tables, which are to be found in virtually every iPhone Application. Screenshots of a sample application I altered slightly are provided below.


Later, I spoke to Mr. Collias and Mr. Morelock about the problems I encountered over the course of the week and about what application would be suited for my final project. Mr. Collias explained good programming practices and warned me that I should never lose sight of the final goal of satisfying consumers and fulfilling the project goal in the midst of "fancy" code that is difficult to understand for others. Furthermore, efficiency may be slightly sacrificed for the goal of making code unfocused and capable of solving more than its goal. This allows for reusability when the project is inevitably expanded or when a similar application must be produced. Additionally, he was able to tell me from experience that interface code is constantly changing, but the underlying logic and languages change much more slowly. As a result, logic should be implemented in its own section such that a program may be deployed on a multitude of machines and operating systems by switching out the interface code while maintaining the basic program structure. This is especially important in a corporate environment, when efficiency is greatly reduced if code needs to be completely rewritten and tested due to initial bad programming decisions. Programs should always be planned out, and both Mr. Collias and David Malan, the Harvard professor teaching the CS50 course agree that programs must begin with a basic set of functionality that can be expanded only when it all works properly. Mr. Malan advocates taking "baby steps" to facilitate the debugging process.
In regard to my final project, I suggested both my "Blobs and Globs" application and my "Cingo" board game for porting to the iPhone. The result of a long discussion with Mr. Collias was that "Blobs and Globs" would be an amazing application, but I do not have time to fully complete all of the physical interaction logic between game particles in addition to learning Open GL for drawing and finally coding a sophisticated AI for determining the correct times to maintain defensive versus offensive play. For maximum effectiveness, an AI would have to assess distances between a multitude of particles and evaluate the structure of the particles relative to each other. A two player variant would require learning internet communication protocols. To do this project justice, I will have to work on it during Spring and Summer breaks from school.
It would be more beneficial for me to work on my board game concept which I currently could implement, even though I do not yet have the experience needed to draw moving images on an iPhone screen. Realistically, I will be able to advance to this point and an application of this type has plenty of room for improvement. Updates could include a one player variant against a computer opponent and a polished interface.
I also spoke to Mr. Morelock about some of my less general programming questions. He told me about specific bad programming practices and cited an example of a zip code application that included reading the last four digits of a zip code with code similar to the following:

int fullZipCode = zip; // zip is some number ending with a more specific 4 digit code
int zip4;
int *zipPointer;
zipPointer = &fullZipCode;
zip4 = *(zip + 4);

This code takes advantage of the fact that an integer is stored in memory "on the stack" in one block and reads the last 4 digits from memory directly. In another example, a programmer broke an application by writing to the first memory location, against which pointers are often checked to see if they do not point to anything. Altering memory can be extremely dangerous, which is why newer languages such as C#, .net, and objective-C attempt to prevent such code, which is extremely prone to security flaws.
Mr. Morelock demonstrated how to put Apple's documentation system to good use and was able to explain how objective-C classes can be made to conform to "protocols," the concept of which I had previously found confusing. He suggested that I begin making selective decisions about which chapters to read in my textbook and that I should start working on my final project earlier than what I had intended because from his experience applications usually take twice as long to write as planned. I can certainly verify this; it took me upwards of ten hours to write my checkers application when I had planned to take three. At the end of our meeting, we discussed board game AI, and he mentioned that he works with systems that are based on similar principles. When analyzing a string of text that contains a company name, probabilities of items in the string are assigned based on word location and relative location to prevent a computer from evaluating a location or a department name contained in the string as a company name. The problem is made more complex when the company name is abbreviated or contains a hyphen. For example, hyphens are often used to separate legal department names from company names, and always relying on this can cause a company name to be chopped in half.

For continued progress, I plan to start sketching out the basic specifications of the "Cingo" application and to read about and experiment with graphics functions for drawing the board of the game.

iPhone Journal 0000 1000

Today (2/26/08), I planned to get further in my textbook and to plan part of my final project, for which I had some ideas yesterday.
A few years ago, when I was first examining programming concepts using a graphical programming language, I played a game with a friend in which we each tried to use replicating objects to fill a screen as quickly as possible with as few commands as possible. The result of this evolved into an extremely addicting computer game for two players, "Blobs and Globs." Today, we spoke together about the physics that would be involved in simulating fluid on a tilting plane with friction such that a mobile device such as the iPhone could handle the required calculations of an updated version. The only problems with the game in its current form is that a one player implementation is not as good as would be possible with a language such as objective-C, and movement was possible only with two sets of keys that could not be held down to move characters; the key buffer was essentially of length one.
Using the iPhone and its unique accelerometer controls could improve that game to a very high degree and produce a fun game-playing experience. However, creating this game will likely require me to gain at least a beginner's understanding of OpenGL ES, a low level graphics API. In case I am unable to reach this point by the end of this project, I invented a board game several years ago. It is easy to learn, yet very difficult to master, involving strategies at a similar level as Chess. I could easily create an application for the iPhone that implements this game, "Cingo," in two player form. The problem with this app would be training a computer player to be a challenging opponent. Furthermore, the amount of people interested in board games is sadly much smaller than the amount interested in short addicting games with a simple premise.
Finally, I reached what seems to be the end of the C portion of the CS50 Harvard Lectures and finished chapter 7 in my textbook. While I intended to make progress into chapter 8, the final step of the chapter, which is simply to import the AudioToolbox framework into the project proved to be a painful experience. After adding it and pressing compile, the compiler informed me of 416 errors of the type "Syntax error before...". I tried compiling the version included with the book successfully, but deleting the framework in the provided project and reimporting produced the same error. I searched online extensively, and yet no one seemed to have reached the same error. After multiple application restarts, computer restarts, "Clean all Targets" commands, and a great deal of trial and error, I copied all of the files in my project to a blank project. Upon compiling, I got only 7 errors, which I fixed by adding two #import statements. However, when I launched my application, I got a black screen. At that point, I realized that both the new and old projects were likely irreversibly broken, and I am only glad that I have sample code available that does essentially what my application was intended to.
In the future, I will never make any changes to frameworks without making a project backup first. There is no "undo" option to reverse a process of that nature.
Tomorrow, I will forge ahead in chapter 8 and will get an opportunity to ask questions of Mr.Collias' team of programmers. Maybe they will be able to figure out what went wrong with my chapter 7 project.

Thursday, February 26, 2009

iPhone Journal 0111

On Wednesday, 2/25/08, I planned to get further in my textbook and to discover exactly what @property and @synthesize do in Objective-C. I was able to finish the 9th of 13 weeks of CS50 lectures, determined exactly how the two commands listed above work, and fixed several bugs in my Checkers program. I also completed 4/5 of chapter 7 in my textbook.
I am starting to wonder if I will be able to finish working through all of the chapters in the textbook (chapters 7-9 are particularly long), but conversely, am learning more of the C and Objective-C languages than I ever expected to. Writing the Checkers program gave me a great deal of insight into the foundation of iPhone applications, which has allowed me to understand the previous textbook chapters to an unprecedented level. Some screenshots of the chapter 7 application are provided below:


On Thursday, I intend to continue working in my textbook and to see if I can complete a final project idea based on a strategy board game I invented and recently remembered.

Tuesday, February 24, 2009

iPhone Journal 0110

Today, on 2/24/08, I planned to follow an objective-C tutorial so that I could understand how the language actually works without the additional layer of abstraction added by the iPhone API. I began to follow the tutorial that I mentioned yesterday, but soon realized that experimentation would be the most effective route to take. After a few simple tests that allowed me to understand the nature of Objects as pointers to memory locations rather than as normal variables that can be accessed with little thought. For example, copying an object by assigning a new variable to equal a previously created object actually creates a link between the objects; when a value is assigned to one, the same value is assigned to the equivalent structure in the other. My tests culminated in the first objective-C program I have ever written without templates: a command line application that allows two people to play a game of Checkers against each other. While it will not run on the iPhone without some additional interface logic, this application has allowed me to understand the framework of objective-C applications. I combined the knowledge I gained from the Harvard CS50 lectures (I am currently on week 7/13) (such as how to use the gdb debugger and how pointers actually work) with the tutorial and online forums to produce the following code and debug it. I might eventually include a video of the application in action, but for now:

//Constants.h
#define UNCHANGED -1

#define RED 0
#define BLACK 1

//Checkers.m
/**************************************************************************************/
/**************************************************************************************/
//*Checkers application written in Objective C
//*Date begun: 2/24/24
//*Creator: Julian Ceipek
//*copyright 2009 True Star Design
/**************************************************************************************/
/**************************************************************************************/
/*******************************************RULES:*************************************/
//Every turn, a player specifies a piece to move and a location to move it.
//Pawns, designated by P#, where #=0=RED and #=1=BLACK, can only move forwards
//diagonally or jump diagonally. Chained jumps are not permitted.
//Jumping is not required.
//When a pawn reaches the opposite side of the board, it becomes a King K#.
//Kings may move and jump in any diagonal direction.
//Objective: cause the opponent to lose all pieces or movement options.
/**************************************************************************************/

#import
//Objects
#import
//ObjC
#import
// Print

#import "Constants.h" //Constants: RED, BLACK, UNCHANGED

//Import Classes


#import "Board.h" //Gameboard Header

//Pieces
#import "Piece.h"
#import "Pawn.h"
#import "King.h"

int gameStatus;

//Implementation of game loop is here
int main (int argc, const char * argv[]) {
printf("Welcome to Checkers!\n");

//Setup Board
Board *board = [[Board alloc] init];
[board setUpBoard];

//Loop through game
do
{
//display board
[board display];
//move piece
[board askToMovePiece];
//switch player
[board changePlayer];

gameStatus = [board testForWin];

[board incrementMoves];
} while(gameStatus == UNCHANGED);

if (gameStatus == RED)
{
printf("Player RED has won the game.");
}
else
{
printf("Player BLACK has won the game");
}

printf("The game took %d moves.", [board getMoves]);

//Release memory
[board releasePieces];
[board release];
return 0; // 0 errors encountered.
}

//Board.h
#import

#import "Pawn.h"
#import "Piece.h"



@interface Board : NSObject
{
Piece *field[8][8];
int moves;
int currPlayer;
int gameStatus;
}

-(void)setUpBoard;
-(void)display;
-(void)releasePieces;

-(int)testForWin;

-(void)changePlayer;
-(BOOL)askToMovePiece;

-(void)incrementMoves;
-(int)getMoves;



@end

//Board.m
#import
// Print

#import "Constants.h" //Constants: RED, BLACK, UNCHANGED
//Red moves down; black moves up

#import "Board.h" //Header for curr class

//Pieces
#import "Piece.h"
#import "Pawn.h"
#import "King.h"



@implementation Board

-(void)setUpBoard
{
moves = 0;
currPlayer = 0;

//Set all to blank
for (int x=0; x<8; y="0;" x="0;" x="1;" currplayer ="=" x="1;" y="0;" x="0;" currplayer =" (currPlayer+1)%2;" rcount =" 0;" bcount =" 0;" y="0;" x="0;" rcount ="=" bcount ="=" x="0;" y="0;">7 || start[1]>7)
{
start[0]=-1;
printf("Invalid Location!");
}
//Check if square is empty
else if(field[start[0]][start[1]] == nil)
{
start[0]=-1;
printf("That Square is Empty!");
}
else if([field[start[0]][start[1]] getOwner] != currPlayer)
{
start[0]=-1;
printf("That Piece Belongs To Your Opponent!");
}
else if([field[start[0]][start[1]] canMoveAtX:start[0] Y:start[1] On:field] == NO && [field[start[0]][start[1]] canJumpAtX:start[0] Y:start[1] On:field] == NO)
{
start[0]=-1;
printf("That Piece Cannot Move!");
}

}
while (start[0]==-1);
//Valid piece was chosen

printf("Where do you want to move that piece?\n");
do
{
//Ask for destination
printf("XLoc:");
scanf("%d", &end[0]);
printf("YLoc:");
scanf("%d", &end[1]);
printf("\n");
end[0]--;
end[1]--;

//Check if square is on board
if (end[0]<0>7 || end[1]>7)
{
end[0]=-1;
printf("Invalid Location!");
}
//Check if square is empty
else if(field[end[0]][end[1]] != nil)
{
end[0]=-1;
printf("That Square is not Empty!");
}

else if([field[start[0]][start[1]] movePossibleFrom:start To:end On:field] == NO)
{
end[0]=-1;
printf("That Move is Illegal!");
}

}

while (end[0]==-1);
//Valid location was chosen

//Move Piece
//Jump? (test by checking if dist between start and end is 2;
//since only diagonal movement is possible, only x coords need be compared)
if ((end[0]-start[0])*(end[0]-start[0])/2 == 2)
{
//Eliminate through capture
printf("A piece was Captured!\n");
[field[(end[0]-start[0])/2+start[0]][(end[1]-start[1])/2+start[1]] release];
field[(end[0]-start[0])/2+start[0]][(end[1]-start[1])/2+start[1]] = nil;

//Add code for multiple jumps if desired....
}
//Move Piece
field[end[0]][end[1]] = field[start[0]][start[1]];
field[start[0]][start[1]] = nil;

//Crown King if necessary
if ([field[end[0]][end[1]] isaPawn])
{
if (end[1] == 7 && [field[end[0]][end[1]] getOwner] == RED)
{
[field[end[0]][end[1]] release];
field[end[0]][end[1]] = [[King alloc] init];
[field[end[0]][end[1]] setOwnerToPlayer:RED];
}
else if (end[1] == 0 && [field[end[0]][end[1]] getOwner] == BLACK)
{
[field[end[0]][end[1]] release];
field[end[0]][end[1]] = [[King alloc] init];
[field[end[0]][end[1]] setOwnerToPlayer:BLACK];
}
}


return YES;
}

@end

//Piece.h

#import


@interface Piece : NSObject
{
int owner;
}

-(void)setOwnerToPlayer:(int)player;
-(int)getOwner;


@end

//Piece.m

#import "Piece.h"

@implementation Piece

-(int)getOwner
{
return owner;
}

-(void)setOwnerToPlayer:(int)player
{
owner = player;
}


@end

//Pawn.h
#import "Piece.h"
#import "Board.h"

@interface Pawn : Piece
{

}

-(BOOL)movePossibleFrom:(int[2])start To:(int[2])end On:(Piece*[8][8])field;
-(BOOL)canMoveAtX:(int)x Y:(int)y On:(Piece*[8][8])field;
-(BOOL)canJumpAtX:(int)x Y:(int)y On:(Piece*[8][8])field;
-(BOOL)isaPawn;

@end


//Pawn.m
#import "Pawn.h"
#import "Constants.h" //Constants: RED, BLACK, UNCHANGED
//Red moves down; black moves up
#import


@implementation Pawn

-(BOOL)movePossibleFrom:(int[2])start To:(int[2])end On:(Piece*[8][8])field
{

//Warning: Feed this function no out of bound values!

//Is Slide Possible?
if ((start[0]-end[0])*(start[0]-end[0]) == 1)
{
if ([self getOwner] == RED)
{
if ((start[1]-end[1]) == -1)
{
return YES;
}
}
if ([self getOwner] == BLACK)
{
if ((start[1]-end[1]) == 1)
{
return YES;
}
}
}

//Is Jump Possible?
if ([self getOwner] == RED)
{
if ((start[1]-end[1]) == -2)
{
//Right
if(start[0]-end[0] == -2)
{
if (field[start[0]+1][start[1]+1] != nil)
{
return YES;
}
}
//Left
if(start[0]-end[0] == 2)
{
if (field[start[0]-1][start[1]+1] != nil)
{
return YES;
}
}
}
}
if ([self getOwner] == BLACK)
{
if ((start[1]-end[1]) == 2)
{
//Right
if(start[0]-end[0] == -2)
{
if (field[start[0]+1][start[1]-1] != nil)
{
return YES;
}
}
//Left
if(start[0]-end[0] == 2)
{
if (field[start[0]-1][start[1]-1] != nil)
{
return YES;
}
}
}
}

return NO;
}

-(BOOL)canMoveAtX:(int)x Y:(int)y On:(Piece*[8][8])field
{
if ([self getOwner] == RED && y+1 <>= 0)
{
if (field[x-1][y+1] == nil)
return YES;
}
if (x+1 <>= 0)
{
if (x-1 >= 0)
{
if (field[x-1][y-1] == nil)
return YES;
}
if (x+1 <>= 0)
{
if (field[x-1][y+1] != nil)
{
return YES;
}
}
}
if ([self getOwner] == BLACK && y-2>=0)
{
//Right
if(x+2 <>= 0)
{
if (field[x-1][y-1] != nil)
{
return YES;
}
}
}

return NO;

}

-(BOOL)isaPawn
{
return YES;
}

@end

//King.h
#import "Piece.h"

@interface King : Piece
{

}

-(BOOL)movePossibleFrom:(int[2])start To:(int[2])end On:(Piece*[8][8])field;
-(BOOL)canMoveAtX:(int)x Y:(int)y On:(Piece*[8][8])field;
-(BOOL)canJumpAtX:(int)x Y:(int)y On:(Piece*[8][8])field;
-(BOOL)isaPawn;

@end

//King.m
#import "King.h"


@implementation King

-(BOOL)movePossibleFrom:(int[2])start To:(int[2])end On:(Piece*[8][8])field
{

//Warning: Feed this function no out of bound values!

//Is Slide Possible?
if ((start[0]-end[0])*(start[0]-end[0]) == 1)
{
if ((start[1]-end[1]) == -1)
{
return YES;
}
if ((start[1]-end[1]) == 1)
{
return YES;
}
}

//Is Jump Possible?
if ((start[1]-end[1]) == -2)
{
//Right
if(start[0]-end[0] == -2)
{
if (field[start[0]+1][start[1]+1] != nil)
{
return YES;
}
}
//Left
if(start[0]-end[0] == 2)
{
if (field[start[0]-1][start[1]+1] != nil)
{
return YES;
}
}
}

if ((start[1]-end[1]) == 2)
{
//Right
if(start[0]-end[0] == -2)
{
if (field[start[0]+1][start[1]-1] != nil)
{
return YES;
}
}
//Left
if(start[0]-end[0] == 2)
{
if (field[start[0]-1][start[1]-1] != nil)
{
return YES;
}
}
}


return NO;
}

-(BOOL)canMoveAtX:(int)x Y:(int)y On:(Piece*[8][8])field
{
if (y+1 <>= 0)
{
if (field[x-1][y+1] == nil)
return YES;
}
if (x+1 <>= 0)
{
if (x-1 >= 0)
{
if (field[x-1][y-1] == nil)
return YES;
}
if (x+1 <>= 0)
{
if (field[x-1][y+1] != nil)
{
return YES;
}
}
}
if (y-2>=0)
{
//Right
if(x+2 <>= 0)
{
if (field[x-1][y-1] != nil)
{
return YES;
}
}
}

return NO;

}

-(BOOL)isaPawn
{
return NO;
}

@end

Sadly, the formatting is somewhat lost by pasting the program here. Copying and pasting to a text editor such as that included in XCode and re-indenting will produce my actual code. Note that the file names are comments in boldface
Tomorrow, I plan to figure out exactly what "@property" does and to get further in my textbook.

Monday, February 23, 2009

iPhone Journal V

On Sunday, I  intended to work further in my textbook and to prepare for my meeting with Mr. Collias. I was able to complete chapter 6, yet I am still unsure of exactly how the code I wrote works since it overrides functions hidden inside libraries that are hidden from the programmer for simplicity.
Today, I fulfilled my goal of completing almost half of the CS50 lectures at Harvard. I then went to visit Mr. Collias and his team of programmers in order to overcome several initial challenges I faced in development. While he and his colleague, Mr. Morelock, were unable to answer many of my specific questions, I was able to define an effective system for future progress with their help. Mr. Morelock understands my learning methods to a high degree and told me from experience that I should not worry about the hidden functionality present in internal code libraries. Instead, I should use the provided template files without necessarily comprehending exactly what code is executing behind the scenes, especially with the limited time I have for this project. I was advised to find a tutorial on Objective-C that serves as an introduction to the specific syntax with which they were unable to help me as much as with implementation questions. I have located one that seems to be a good start at the following address: http://www.otierney.net/objective-c.html. Overall, Mr. Collias and Mr. Morelock seemed impressed with my progress in understanding how everything fits together.
A combination of their advice and that provided in the CS50 lectures prompted me to change my first independent application, RPG Calc such that it completed the same work with about 120 less lines of code.
Sadly, tightVNC, the remote desktop application I intended to use for a demonstration environment on a powerful desktop at my home was unable to function properly because of security measures. I have attempted to use port forwarding techniques on my home router to overcome this problem, but am unsure of the results.
Tomorrow I plan to work on the 42 page Objective-C tutorial, to continue reviewing C through the Harvard lectures, and to move on in the textbook if possible.

Sunday, February 22, 2009

iPhone Journal III-IV

I have returned. I spent half of Thursday (2/19/09) on a flight to Boston, MA, Friday visiting MIT, and Saturday visiting Harvard and flying back home. For this reason, I have been unable to write any entries until now.
On Thursday, I continued to learn about programming in C through Harvard's online CS50 lectures and made a bit of progress in chapter 6 of Beginning iPhone Development: Exploring the iPhone SDK. More importantly, I was able to speak to Mr. Collias about my problems for the first time. We were unable to speak in person since he had been unwell earlier, but we were able to make some important advances in how effective communication could be established in the future. My specific questions could not be answered because of the inability to share code over the telephone. However, I was able to ask about the functionality of "pointers" and was able to suggest a way to use VNC, an open source remote desktop client so that sharing code would not be an issue in the future. I also sent Mr. Collias a copy of "The Objective-C Programming Language" annotated by myself so that some of my problems will be evident when I mee with him next.
The inability to get my questions answered meant that I was unable to progress much further in my textbook. While I could have written the sample application(s), this exercise would have been of little value without understanding. Nevertheless, I am happy to say that my questions will almost certainly be answered on Monday, when I will finally be able to meet Mr. Collias in person. We will also set up VNC and Skype to facilitate future conversations through voice over systems.


On Friday and Saturday, I spent most of my time flying and visiting Colleges, as mentioned before, but I was also able to continue my education. I progressed very far in the CS50 course because I had loaded all of the lectures and lecture slides to my iPhone before departing. I have now completed lecture weeks 0-4, and only 5-12 remain. Thus far I have reviewed the implementation of sorting algorithms, learned about the benefits of parallelism in computing, and educated myself on a great deal of programming syntax that is similar in C and Objective-C. Today (2/22/09) I will focus on my textbook to see if there is anything else I can do before my questions are answered tomorrow.

Wednesday, February 18, 2009

iPhone Journal II

Today, I planned to look over more programming documentation, to work through chapters 5 (Autorotation and Autosizing) and 6 (Multiview Applications) in Beginning iPhone Development: Exploring the iPhone SDK, and to create an example program demonstrating my knowledge. Since I spent much of the morning uploading my first journal entry in various formats and underestimated the technical complexity of applications that respond to rotation of the iPhone, I was only able to finish chapter 5. To compensate, I completed the equivalent of 8/3 weeks of C lectures at Harvard and was able to review many basic programming concepts as well as to learn new rules and syntax that govern both C and Objective-C. I created 3 example applications from the textbook, but still have a few questions I hope to clear up with the help of Mr. Collias, the programmer who has kindly agreed to help me.
The code in chapter 5 of the textbook is slightly flawed, and so it took me awhile to obtain functioning applications. Instead of wasting setup time that could be better utilized with experimentation, I modified the sample code with concepts from Precalculus and programming themes/syntax from the Harvard video lectures, which may be found at http://cs50.tv/. While there is no modification that is visible superficially, the code itself has been modified. Some changes include using actual radian values rather than a converter from degrees to radians and an elegant select case statement rather than a long series of "else if" statements. The actual application cannot be demonstrated by a picture, so I have included a short video below:

video

Basically, this application displays two buttons and rotates them when the iPhone is turned. The application accomplishes this through two different views (one for portrait and one for landscape) that are rotated when the iPhone is. If a button is clicked, it is hidden, as is the corresponding button on the other view.

Mr. Collias was sick for the past two days and thus I am not certain if he will be able to meet with me in person tomorrow (2/19/09). However, I discovered that the Beta version of the freely downloadable, cross-platform application supports screen sharing as well as video conferencing. I could use this application to demonstrate code and to ask questions.
Tomorrow I intend to work on chapter 6 and iron out problems from chapter 5 as well as talking to Mr. Collias if possible. I will also continue to view the Harvard lectures online for additional instruction.

iPhone Journal I

Welcome to my iPhone Programming Blog, where I will detail the results of my four week research into the incredible world of iPhone programming.

On Tuesday, 2/17/09, I planned to read "The Objective-C Programming Language" on the Apple Developer website and then to review chapters 1-4 in the textbook I have (Beginning iPhone Development: Exploring the iPhone SDK by Dave Mark and Jeff LaMarche) by creating a sample application. In fact, I read 40 pages of the 105 page programming guide and realized that the remainder of the guide was very technical and unnecessary for basic applications. As I gain more experience, the rest should make more sense to me.
Next, I located a series of introductory C programming videos on the Harvard University website and have found that they are exceptionally effective in demonstrating programming principles. Each day I shall use these as an effective way to gain background information in the C language which forms the basis for Objective-C.
I then decided to create the example application mentioned above. First, I had to reinstall the iPhone SDK because the iPhone was updated since I last wrote an application. Following the directions in the iPhone Developers Portal, I created a new App Id for the applications I will be writing and added this to a new development profile for uploading applications to the iPhone. While reviewing concepts from my textbook, I created a simple application that fills out a "Mad Lib" from the game book "Madagascar Mad Libs: World's Greatest Word Game," by Roger Price and Leonard Stern. This application works very well and is pictured below.
Finally, I decided that the most effective way to create a journal entry would be through a screencast, a video of my computer screen accompanied with audio. After some experimentation, I determined how to accomplish this with my favorite video viewing and capturing application, VLC, along with Audacity, which records audio. Since the video and audio were asynchronous, I needed to combine them with a video editing program. After about an hour of frustration with iMovie '08, one of the worst editing applications in existence (in my opinion), I created an effective screencast. Soon I realized that iMovie '08 had exported a 130 MB movie file and I spent another hour or two before discovering that the application Garageband was capable of exporting a high quality file requiring only 14 MB. I added this file to an email and sent it on its way. About 10 minutes later, I received an email stating that the recipient server had rejected it. As a result, I created this blog capable of storing files up to 100 MB, and processing continued for an hour without any signs of true progress. Now I have made this written journal entry to compensate and am rather irritated.
On Wednesday, 2/18/09, I plan to work on chapters 5-6 of my textbook and maybe chapter 7 depending on how long this takes. I will create another example application and continue to look at online documentation and the Harvard CS Intro tutorials.
~Julian Ceipek