Category Archives: Software Development

iCIDR 1.0 just went live on the iTunes App Store!

iCIDR 1.0 released November 1, 2010.

iCIDR on the iTunes App Store

CIDR CONVERT

CIDR Convert(er) is a simple to use tool that allows rapid deconstruction and understanding of any valid CIDR block notation.

For example. You’ve received a block of IP’s from your ISP. Maybe they are add-ons to your existing network. Perhaps you are deploying a completely new network. When you look at the provisioning worksheet and see the notation 17.251.200.70/25 you will want to know what IPs are part of that range. Instead of trying to do perform the 32-bit math in your head, or on a calculator, why not just use this handy tool? If you with a simple push of a button you’d have known:

iCIDR - David DeMartini

I look forward to creating more useful, and more entertaining apps before Christmas Time.

My first iPhone App is now under review by Apple

The iCIDR App (link) is currently being reviewed by the Apple Store team. I hope to have it cleared and posted for download soon. This is my first app to go through the process, so I don’t expect it will be smooth. I’m sure there are some things that even the pages and pages of specifications and preparation documents did not fully cover, or at least I didn’t get the intent.

When I have more information about the status of the App, I will be posting it here.

Other applications are moving forward in their development.

Some of these new applications include 2 games, and 3 more technical tools. More information to come when I can talk about it.

Stay tuned!

iPhone App 001 is in the final testing phase!

I am pleased to announce that the first Application to roll off the assembly line, is in the final testing phase.

Soon to be released iPhone 'App 001'

The first in a series of utility applications is soon to be released to the Apple iTunes Application Store, and made available for public consumption.

App 01 is primarily designed for Systems Administrators. Providing a pair of commonly used tools, that come in handy more every day, but are most useful when you find yourself off-site, troubleshooting a networking issues, or in need of providing access credentials to other members of your organization. Having this handy pair of tools, will make your day just that much easier.

More information about this exciting development will be made available on my new Applications Site, located here: Apps by David. Right now, this is the only screen shot available for public distribution.

When testing has completed there will be a lot more information about this nifty little app to go around.

Next step completed, Apple Developer Program signup.

Well, after reading the 37-page EULA, which, for a 37 page EULA was not that tough to stomach, I completed the registration request, sent off my annual fees and now I await to here the disposition of my request for acceptance into the Apple iPod/iPad/iPhone Application Development family.

In the mean time, I continue to narrow in on the first of what I hope to be a few lucrative and useful Apps, and begin physical device testing next week.

It’s almost 4:00PM now, maybe I should go and get some lunch…


UPDATE:

Developer License delivered! It takes a while to get the CSR generated, sent to Apple the the completed Certificate returned. Then it has to be installed and integrated into the IDE/SDK. But once that’s done, I’m deploying apps for test to my iPhone.

The stakes (and motivation) just got a lot higher!

First image manipulation App – DONE

Shot of image manip app, here with the image shunk to a fractional size.

I have been writing code like a mad-man. 8-10 hours per day for the company I work for, then another 6-8 for my own education. Well beyond the ‘Hello World’ apps of just a week or so ago.

Of the apps I’ve worked on in the last few days, this one involved the most code writing. Well mostly copying from examples in the books. Some examples were downright scary! Like one that executed a division of two calculated numbers without doing a check to see if the divisor was zero! Want to crash a program? Divide some number by zero. I’ve not yet any language that takes too kindly to such shenanigans!

So.. back on topic. The App. It’s pretty simple and uses and embedded image (you can’t just pick one and mess it up), but it leverages a bunch of the built in functions in the SDK that are just fantastic.

It’s pretty easy to handle event driving multi-touch gestures in the code. The design of the iPhone itself was groundbreaking.. but now seeing he amazing work Apple developers did in the SDK.. it’s.. jaw dropping. They really designed a full system, not some bolted together pile of .DLLs and crap that competitors doe (ever written an app in the old MFC? NIGHTMARE!).

So.. the education continues. I’m at little bit closer to getting the match functions of my first *real to be published* app spec’d out. I don’t think I’ll need tangent and radian calculations, or need to use the Pythagorean Theorem to solve for the distance between two points in Cartesian space…. but if I do, I now have it well embedded in my brain how to do it.

Upward and onward…. just another day in the life of a professional computer geek working hard to comfortably retire before he dies.

iPhone Apping – 5 more Apps (3 completed, 2 underway)

A little peek at the apps I've been working on.
It’s been a really good and really bad few days of writing iPhone Apps based on a couple of books I’ve been reading. About 8 hours were burned slamming my head on the table, because the tutorial was just not *quite* clear enough on the exact actions suggested to accomplish a task.

It was not until I decided to just S-can it (for the 3rd time) and move onto the next task, and finally another after that, when I realized just exactly what the author really meant to say when wiring up a bunch of Objective-C code. Then I also found that I’d checked a checkbox (I have a newer SDK version with an option not shows in the texts) that really hosed me up by creating a TABLE based window when I wanted a NORMAL window. Lesson learned.

No matter what, I have deleted all the old ‘Hello World’ apps and have constructed 3 complete functioning aps that display, overlay and swap images. I picked a few of my favorites from recent work. The results are pretty good! It’s not *easy* to write iPhone apps, but with some planning, and not Boat in the Water shot-gun hacky-do programming.. it can be a pretty quick development cycle.

So the two Apps I intend to release for public consumption are now underway. Once is about 50% complete (I need to port some PERL code I have to Objective-C) and the other is a just a bare-bones framework and a bunch of scribbled notes. No matter.. progress has been made!

CIDR Calculator Demo

For those that were breathlessly waiting for me to publish one of my Sys Admin tools.. here is a little one, that I discussed a couple of weeks back.

It’s the CIDR Block Notation Converter. I use it quite frequently in my line of work. Now, I could of course used many of the other online CIDR translates available. Simply using a tool (like a car, or a computer) often requires little or no knowledge of how it, or one of it’s sub-systems works. But, to fully utilize a tool, you should understand it’s origin, it’s function and often you will find other, unrealized purposes for the tool.

Such as the car. You get your driver’s license (people should also need a computer license, they can also be dangerous to one’s self), plob behind the seat and go to the store. But, if you understand some of the mechanics, you might realize it’s useful for more than getting your latte at StarSucks, or a back of dog bones at the pet store. With a little tweaking, you could use it to cross deserts, mountains, even compete and MAKE MONEY with it.

A little knowledge is a powerful thing, so I embarked on reading the specifications for IPv4 (not ipv6… not going there.. yet, in fact I don’t believe CIDR notation has any meaning in IPv6.. digressing..) and CIDR notation so that I could not only understand it’s inner utility but how to write a converter of my own.

If you found utility in it.. awesome, I hope you post a comment (good or bad) to say thinks.

iPhone tutorial app #5 – images meet the road

Writing code for another iPhone App.

Finally, an app that has moving parts. Things are starting to get interesting.

This next app is again, a View Application (single view). The tutorial indicates that we’ll just have to play some tricks to give the illusion of the changes.. image overlays as you will.

Now.. finally, some code has to be written, so here is the first block that is from the controllers main header file:


hello005ViewController.h

//
//  hello005ViewController.h
//  hello005
//
//  Created by David DeMartini on 10/3/10.
//  Copyright 2010 David DeMartini. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface hello005ViewController : UIViewController {
 IBOutlet UILabel *label;
 IBOutlet UIImageView *uiImageView;
}

// Tell the compiler about these properties of our little object-method pointers
//   nonatomic - let the Apple core code handle the mutability (dynamics) of object
//   retain    - tell compiler that we reserve the right to fuck up our own meory management
@property (nonatomic, retain) IBOutlet UILabel *label;
@property (nonatomic, retain) IBOutlet UIImageView *UIImageView;

// Inform compiler that a Button Action (IB) will be part of this application
- (IBAction)buttonPressed:(id)sendr;

@end

Next, the Implementation file must be written.

hello005ViewController.m

//
//  hello005ViewController.m
//  hello005
//
//  Created by David DeMartini on 10/3/10.
//  Copyright 2010 David DeMartini. All rights reserved.
//

#import "hello005ViewController.h"

@implementation hello005ViewController

// Command synthesis
@synthesize label, uiImageView;  // defined that which needs synthesis

- (IBAction)buttonPressed:(id)sendr {
 
//  This modifies the text in object pointed to by 'label' to this string
 label.text = @"The only thing better than a cute girl, is two!";

 // Defining a pointer to the physical Image file (UIImage)
 UIImage    *imageSource = [UIImage imageNamed: @"top.jpg"];
 // Setting the synthsized object image property to the pointer to image file
 uiImageView.image = imageSource;
}

- (void)didReceiveMemoryWarning {
 // Releases the view if it doesn't have a superview.
 [super didReceiveMemoryWarning];

 // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
 // Release any retained subviews of the main view.
 // e.g. self.myOutlet = nil;
}

- (void)dealloc {
 [super dealloc];
}

@end

Now that the primary parts of the code are in place, it’s time to assemble a UI. Adding the main text label (at the top – temporary text displayed for design purposes) and the big button that will cause stuff to execute.

Deep in the UI layout phase using the SDK User Interface Builder.

Shortly after this however, everything went sideways. It would appear there are more brain-dead errors in the book frustrating my progress. It is forcing me to read more and more of the Objective-C documentation than the book suggested I’d have to. But to fix the errors, I must first gain at least a minimum understanding of their nature.

About 5 hours of work. Most of it burned trying to get the last bit of it working… the image swap. Outside of that everything else worked great. With intent to use a fair bit of image swapping when I put the final first app out.. I’d better get a handle on this.


Update: 4-October-2010

After sleeping on it last night, I rebuilt the entire thing from the ground up again. This time going in phases from the initial background image to the label an the button, compiling and executing. That worked perfectly.

Next part I fired up the screen cast the Professor made of him stepping through the process. It then became quite clear (it was not in the book) that the overlay container does NOT reference the second (upper) image directly, but instead is used simply as it’s container. This (of course, being the smart guy I am) made sense the first time around, and I did (what I though) was exactly that. Created a view with not image. Regardless, I re-created my steps this morning, created the empty container, re-compiled and ran. WORKED! Except it looked like doo-doo because the upper level image was NOT properly sized, and the overlay effect did not work. The book (and the screen cast) made it seem like it would expand as required. IT DOES NOT.

iPhone simulator with icon for my 'CuteGirl' app.

So, I referenced the the image view to the top image so I could size and position it to create just the desired effect, then I removed the image association and re-compiled again. This time.. PERFECTION

And the icing on the cake is that it now has a custom icon image for the application. That was pretty simple too. Once I checked online and found that despite what the book said (image size 320×480 which made ZERO sense..) the icon image size should be 57 x 57 pixels and of the format .png (at least the book had the latter part right).


Geek Links:

  • iPhone & iPad Application Custom Icon Design Guidelines
  • iPhone tutorial app 4

    Oh.. now I can press a button and make text appear over an image! WOO..

    It took about 1 hour to get this working. Actually, let me re-phrase that, it took me an an hour to build and ‘test’ a version of this that refused to run. No errors appeared, it just ran and then exited without so much as whimper. Pounded around in the code trying to find the cause.

    In the end, I deleted the entire thing and started over from scratch. Following (what I thought) were the same steps, I re-built the app in about 5 minutes, hit SAVE -> RUN and viola!



    What it does:

  • Upon start up, a photo (from about 15 years ago) for a beer can, yet to be opened appears.
  • At the top of the can is a button labeled ‘Press Here’.
  • Pressing the button makes the text “Beer is Good!” appear below the can.
  • Then, it sits there, tasks completed, waiting to be terminated.

    Pretty cool huh? At least I know the steps for including images as a background. And this is great, since I know how to place an image (required for my soon-to-be-coded real app), how to make text appear (but I don’t be using a button) and.. really.. that’s about it.

    I’m 77 pages into the 300 page book, 4 apps constructed and soon.. things might actually get interesting.

  • iPhone App2, App3 & App4 compiled – this time in pure Objective-C

    App 2


    Well, here it is in amazing glory. The 2nd version of that good old programming stallwort, the “Hello World!” example application.

    Now this one took me a bit longer to code and implement, HOWEVER, it’s pure Objective-C, not the hybrid app type that I used in Application #1. App1 was interesting, and fast to build, but it relies upon some pretty big external libraries. Not a big deal for a low-intensity application like I’m building right now, but the QuickConnect based hybrid app I first built comes with that (I think is) is a pretty high price to pay (with a couple of hefty line items)

    1. Every time you start the application, I get an unwanted QuickConnect Family Application splash screen. NO THANKS! I’m pretty sure I could hack around it, buy why bother, for now?
    2. It won’t run from XCode! I can get it to start, but it won’t actually Do anything.
    3. The hybrid HTML based application’s style sheets are partially ignored, things like the background and text colors are not honored, BUT the font family is. Very strange
    4. It’s a MAJOR pain in the ass to debug when you create it in DashCode… ‘deploy it’. Have to monkey around with several files to fill the XCode (Objective C based) language into using files it did not expect to need… it’s all very hacky and more kludgy than I like.

    Honestly, with XCode view based building, I don’t think I need to mess around with the hybrid application model at all, at least for now. So.. the application that I built purly in HTML, CSS and JavaScript will be shelved for now. Instead I’m going to re-open my Objective C tutorials and work my way into the project I was working on originally.

    It might be a pain in the butt to learn Objective-C, but in the end, I benefit. Question is, do I have the time and will to see it all the way through. I believe so. But until such time as I have the first application built and deployed on my phone.. it’s sort of.. moot. No?


    App 3

    App3

    This one is not a View Based Application like number one, but this is what is called a Navigation Based Application.

    Now, ever the hacker, I went beyond the code changes to RootViewController.m suggested in the book, and also had to fix some GLARING errors in the text (did they not have an editor look at this??). Anhow, this is the code that I wrote for the cell builder. The enhancements allow line wrap, and I changed the default font size from 17 to 13.


    // Customize the appearance of table view cells.
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
    cell.textLabel.numberOfLines = 0;
    cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:13.0];
    }

    cell.textLabel.text = @"This is my second Objective-C application.\nDespite the tutorial having MASSIVE bugs, I got it to run!"; // Configure the cell.

    return cell;

    }

    I’m trying to decide if a View Based (winning so far) or a Navigation Based application will be the way I go for the Real Application. The Navigation Based app is a lot easier to get started with, and does not require that rather odd method of linking elements with the fishing line drag and connect method in the View Application.

    Still a lot of code to write before I have enough experience to make a solid choice.


    App 4

    App4 is a derivative work of App3, but this time by simply enabling this little block of code, I get an Edit button and the ‘Delete’ context, if I need it, for the items. Pretty slick. Apple really went out and did a nice job on this SDK…

    - (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    self.navigationItem.rightBarButtonItem = self.editButtonItem;
    }

    Application 4 running in the iPhone simulator