Monday, January 25, 2010

Friday, January 22, 2010

Wednesday, January 13, 2010

The Drive to Build More

Based upon the myriad of tweets over the past three months or so, most who follow me know that I have been working on my first iPhone app.  Well, first to submitted to the app store.  I have finished an app for work and have started on another for www.feedfootball.com.  Though the app hasn't hit the stores YET, I already have the inspiration to build more.  EraseUrX has by far been the most rewarding project I have worked on in the past three years.  Even if I don't make a lot of money, it truly has been self satisfying to just complete this project.  I can't wait to get started on the next one not only for the challenges that await, but also I know that I be able to put it in the App Store faster.

There has been a lot of criticism of Apple's approval process in the App Store, but over the past three months they have made great strides to improve this process and it has benefited developers greatly.  In addition, there are rumors floating around of a possible upcoming announcement of the 4.0SDK and a new phone device, which if the 3.0 release is any indication of the amount new features added to the phone, then the 4.0 release will give developers even more tools to increase the usability and features in our apps.

Hopefully, the saying is true...

If you build it they will come.

Posted via email from Cory Wiles Blog

Monday, January 4, 2010

2010: Location, Location, Location

I guess you could really argue that the "mobile revolution" was started when Apple first released the iPhone, but 2010, I predict, will be a year full of explosive new mobile technologies and adoption.  2009 saw a huge spike in the adoption of smart phones, as well as, the release of new platforms, devices, and applications.  For the past 10 years I have focused on desktop web apps, but am VERY excited about the breakthroughs and innovation that has evolved in the mobile arena, especially with the offerings coming from Google and of course Apple.  As a consequence, 80% of my focus will be on mobile applications, both native and web.

2008 was the year of "web 2.0", 2009 was consumed by social media, and I predict that 2010 will be a digital Magellan on steroids with the Location Based Services popping up everywhere.  Evidence of this is already presenting itself, with the purchase of GeoAPI from Twitter, Google is offering "turn-by-turn" directions for free in the latest Android SDK, and Apple purchased a map tile software company.  The question will be how will all this data and the services used to manage the data be best served for the consumer.  The days of showing pins on a map are growing quite old.  It is time for more forward thinking, which is what the before mentioned companies do best.

Posted via email from Cory Wiles Blog

Thursday, November 19, 2009

The Need for Mobile Optimization

This is definitely a NEED not a want.

Being in a profession of constant change I am always reading someone's blog, tutorial or latest trends in various subsets of the web.  Most of the time I just fire up Google Reader and start reading.  However, over the past 6 months I have found myself using my iPhone as my "reader" of choice.  Partly because of the convenience factor and in addition, I don't have to carry my laptop around everywhere I go.  Outside of Google Reader one of the best sources that I have for great articles are from some of the big names in web development that I follow on Twitter.

However, the sites and articles that people are linking to are still optimized for a standard browser, not the mobile experience which is HIGHLY annoying.  It is not that I am too lazy to wait for the page to load, but the lack of patience that I have for the delay in the page to finish loading due to 30+ stylesheets requested, some ad tracking pixel or any number of other tasks that are processing that have ZERO to do with what I, the user, is trying to accomplish.  What I find myself doing more and more is using the mobile app functionality of emailing the link to myself so that I can read it when I do get back to my laptop.

Should this mean that companies should have a regular/mobile site?  There is no right or wrong answer for that.  You have to do research and look at your visitor trends and who your target audience is.  I would venture to say that if you are a news organization then the answer would be yes.  However, even though currently you might have a low percentage of mobile visitors that number will only increase over time and your site should at the bare minimum be optimized for a mobile browsing experience.

Posted via email from Cory Wiles Blog

Friday, October 30, 2009

AVAudioRecorder prepareToRecord Silent Error

I was working on the voice record feature for one of my upcoming iPhone apps, but when I would try to start recording the app would crash.  During the adventure of debugging I couldn't trace anything back to my code as far as memory leaks, uninitialized properties, missing delegate methods, etc.  After about an hour I think I almost as many NSLog entries as I did code.  The two biggest troubling aspects where:
  1. prepareToRecord was the method that was failing
  2. AVAudioRecorder initialization wasn't throwing any errors
I turned to some sample code that I knew worked, but mine would still fail.  At this point I knew it was going to be something little that I was overlooking.  After reading through a few posts on StackOverFlow I noticed a difference in my audio configuration settings that was being passed to: initWithURL:settings:error:

I have a separate class where I set the settings argument.  The last two setting items are for: AVLinearPCMIsBigEndianKey and AVLinearPCMIsFloatKey.  Their values need to be NSNumbers so I was using [NSNumber numberWithBool:], but instead of passing in "YES" or "NO" I was passing in TRUE and FALSE, which is INCORRECT.  Just one of those oversights I forget about when switching from one language to another.

I am still not sure why my NSError wasn't populated with some information.  I don't know why the initializer didn't catch my syntax error either.

After I made my corrections, the recording worked perfectly.  Whew!  Now I just need to write the playback portion.

Posted via email from Cory Wiles Blog

Monday, October 26, 2009

Zend Framework Dynamic Site - In Production

Back in April I wrote a blog post discussing my concept of having a dynamic site using the Zend Framework.  In addition, I posted an some example code of how everything works.  I am a firm believer that one should practice what they preach and two different sites are now in production using the framework that I wrote and so far it works beautifully.  I had to make a few changes to the route to allow for module exceptions.

Towards the end of the project there was a request to have a search functionality and also custom forms.  Normally this wouldn't be an issue what so ever, but the way that the custom route is setup all requests are send to the default module/index controller/index action.  I modified the route to ignore any request that started with search or forms and route those requests to the search or forms module.  The regex is easily modified to allow for other exceptions.

Custom Regex:
<route>^(?!\bsearch|forms\b)(\w+-?[\w-?]*\/?)(.*)?</route>

I also setup the ability to add in meta keywords and meta description tags in the content.xml file.  Finally, both sites use the EXACT same doc root and dynamic site framework.  Since both sites use the same layouts, just different menus and different background images, I didn't want to duplicate a lot of code.  So in the setup page display plugin I am able to transverse the content mapping file based upon not only the request, but the url host name to display the proper layout.

Posted via email from Cory Wiles Blog

Thursday, October 8, 2009

SlideView Contribution

One of my favorite iPhone related sites to read is iPhone Developer Tips.  The tutorials are outstanding and most importantly "real world" useful.  Back in August there was a blog posted showing how to implement a "slideable" message that can be presented to a user.  After reading through it I decided to modify how it was used to make it a little more extensible for an iPhone project that I am working.  After I got everything working correctly and they way I wanted to I decided to contact the site owner, John, with all of my source code in case he wanted to use it.

After a little more tweaking to my code he posted my changes, as well as another developer, Greg's code in a new post.

This is a small example of the importance of using open source software, as well as, the importance for developers to use the knowledge and skills of other developers to make the good....GREAT.

Sliding Views On and Off Screen – Part 2 – Reader Contributions

Posted via email from Cory Wiles Blog

Monday, September 28, 2009

Best Practices That Work

Tonight I got an email from a friend that my site was down.  Sometimes, if Apache has been running for a long time on my vhost then for some reason the process id gets corrupted.  I don't know if that has to do with the VPS or what.  I never had that problem when I had my dedicated server.  It happens so infrequently I rarely even notice.  However, my usual task of just restarting Apache didn't work.  I got an error message that the main site's docroot didn't exist. That was very strange and very disturbing.  I got on the phone with the sysadmins at my hosting company and couldn't really find the culprit and they didn't have the automated backup of the site.

The good news, as I was told, was that they could recreate the directory structure within one minute and get Apache up and running. SWEET!  However, what about my site?!  Though they offer backups for the VPS they are not guaranteed.

I was not panicking because I keep all site changes backed up in subversion on a completed different host.  Once the directory structure was put back in place all I had to do was check the latest copy of my site and I was backup and running.  It was good to see and know that using best practices does ACTUALLY work.  Imagine that.

Posted via email from Cory Wiles Blog

Tuesday, September 22, 2009

Using NSNotificationCenter with UINavigation Controllers

When presenting an app to user with a large list of information, most developers will add in the ability to search the list inside of the table view.  To further increase usability it is a good practice to include different filters.  For example, a scope button that allows the user to filter by name, address, phone number, etc.  Implementing these features is pretty straight forward.  However, one of the filter options that was needed for a particular app that I am working on was to filter by department.

The complexity to this problem came in the fact that the search term couldn't be the department name, but the code.  Obviously, most users don't know the corresponding codes for a given department.  So I needed a way to present a list of "friendly" department names to the user to pick from, and once a given department was chosen then the corresponding department code would be populate the search bar field.

The first attempt was to use a UIPickerView.  Unfortunately, this wasn't the best solution mainly because you can't use key/value pairs with the UIPickerView.  Well...not in a very straight forward manner.  My second solution attempt was to use a modalViewController and then pass the selected object back to the parent controller.  Everything worked out just fine, but the parent object property wasn't being updated.

To solve this problem there are a couple of schools of thought.

  1. Set the parent controller as the delegate and setup a new protocol that the child controller implements.
  2. Use the NSNotificationCenter which uses the Observer Pattern to update another object based upon some action/method.
Most of the time I would say that the second option is overkill since it is designed for a one-to-many object broadcasts, but in this use case it is the preferred approach because "you would otherwise have to pass instances around of delegates just to connect objects". - http://alexvollmer.com/index.php/2009/06/24/cocoas-ways-of-talking/

FINAL SOLUTION:
// Parent UIViewControlller

- (void)viewWillAppear:(BOOL)animated {

  [[NSNotificationCenter defaultCenter] addObserver:self
                                        selector:@selector(refreshSearchBarControllerWithDepartmentCode:)
                                        name:@"DepartmentCodeNotification"
                                        object:nil];
 
  [super viewWillAppear:animated];
}


- (void) refreshSearchBarControllerWithDepartmentCode:(NSNotification *)notification {

  NSString *key;
  NSString *trimmedSearchString;

  for (key in [notification userInfo]) {
    trimmedSearchString = [[[notification userInfo] valueForKey:key] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
  }
 
  self.searchDisplayController.searchBar.text = trimmedSearchString;

  [self.searchDisplayController.searchBar becomeFirstResponder];
  [self.searchDisplayController.searchResultsTableView reloadData];
}

- (void)searchBar:(UISearchBar *)searchBar selectedScopeButtonIndexDidChange:(NSInteger)selectedScope {

  if (selectedScope == DEPARTMENT_SCOPE_TITLE_INDEX && [[self.searchDisplayController.searchBar text] length] <= 2) {
   
    DepartmentsViewController *dvController = [[DepartmentsViewController alloc] initWithNibName:@"DepartmentsView" bundle:[NSBundle mainBundle]];

    [self presentModalViewController:dvController animated:YES];

    [dvController release];
   
  } else if ([[self.searchDisplayController.searchBar text] length] >= 2) {
   
    NSString *trimmedSearchString = [[self.searchDisplayController.searchBar text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    [self getEmployees:trimmedSearchString method:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:selectedScope]];

    [self.searchDisplayController.searchResultsTableView reloadData];
  }
}

//Child UIViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

  NSString *code        = [self.tableView cellForRowAtIndexPath:indexPath].detailTextLabel.text;
  NSString *description = [self.tableView cellForRowAtIndexPath:indexPath].textLabel.text;
 
  NSDictionary *searchDepartmentCode = [NSDictionary dictionaryWithObjectsAndKeys: code, description, nil];

  [[NSNotificationCenter defaultCenter] postNotificationName:@"DepartmentCodeNotification"
                                                      object:nil
                                                    userInfo:searchDepartmentCode];

  [self dismissModalViewControllerAnimated:YES];
}

END RESULT:
After a user selects the appropriate department, the child controller is dismissed and the search bar text is updated with appropriate department code.

Posted via email from Cory Wiles Blog

Thursday, September 10, 2009

Microsoft and Enhanced Experience

I read a very interesting article yesterday that ranked the usability between Apple's website and Microsoft's website.  Granted, I am a little biased toward Apple, but I do feel that the author did a great job in their comparison. *spoiler: Apple won.  To add to the critique the Microsoft website does something that is a HUGE pet peeve of mine.

If a company claims to be in the "web" business then they need to create websites that look the same in all browsers.  Microsoft has a HORRIBLE reputation on releasing browsers that are not standards compliant, but are constantly giving non-IE users who visit their websites a second rate experience.  Case in point...their own website.  If you go their website with anything other than Internet Explorer, the visitor is presented with this ANNOYING alert in the upper left hand corner that is asks if you want to "Upgrade your Internet experience".  After few seconds it does minimize, but if you don't click the "Don't show me this EVER again link" the next page you navigate to will show it.

The fact is that I do want to upgrade my internet experience, but not by installing Silverlight, or IE7 or IE8 for that matter.  All of the before mentioned pieces of software are horrible, lack innovation, and do nothing but dumb down the web.  I want to upgrade my internet experience by not being harassed by Microsoft.

Posted via email from Cory Wiles Blog

Tuesday, September 8, 2009

Automate Adding Twitter Followers with Zend Framework

Adding followers to a user one at a time is sometimes a VERY lengthy process.  Last night the question was posed to me if there was a way to automate adding followers from users who follow someone else.

Example scenario:
John Doe follows Jane Doe
John Doe wants to follow at 600 followers of Jane Doe

Unfortunately, the Zend_Service_Twitter class doesn't offer any functionality to retrieve a list of followers from another user, but I was able to extend the class and add the functionality.

The particular user that I chose to test has roughly 6,000 users.  My client didn't want all 6,000, but the first 200.  Within 10 minutes the new custom class was written,  the script ran, and now my client was now following 200 new people of like mind. :)

I plan on submitting the feature request to the Zend Framework gurus to have the ability to find followers from other users so that it can be apart of the main service.

Until then here is the class and script:

require_once 'Zend/Service/Twitter.php';

class CW_Twitter extends Zend_Service_Twitter {

  public function __construct($username, $password) {
    parent::__construct($username, $password);
  }

  public function getOtherUserFriends($name) {
        $this->_init();
        $path = '/followers/ids/' . $name . '.json';
        $response = $this->restGet($path);
        return $response->getBody();
  }

}

$twitter = new CW_Twitter('username', 'password');
$response = $twitter->getOtherUserFriends('friendusername');

$arrayObject = new ArrayObject(Zend_Json::decode($response));
$limitIterator = new LimitIterator($arrayObject->getIterator(), 0, 200);

    foreach ($limitIterator as $value):
      $twitter->friendship->create($limitIterator->current());
    endforeach;

Posted via email from Cory Wiles Blog

Thursday, August 27, 2009

Google Interview - Could You Pass?

The gold standard of programmer interview questions.  It is not what they ask, but how they ask them.

http://courses.csail.mit.edu/iap/interview/materials.php

Posted via email from Cory Wiles Blog

Friday, August 21, 2009

Migrating to HTML5 and CSS3

It seems that in the past six months there has been more and more news, examples, and excitement concerning HTML5 and CSS3.  I must say that I too have been bitten by the bug.  What features that I have seen makes me very excited about the future of web development.  It is time to get back to basics and standards.  However,  because both are their infancy as far as adoption, not all browsers support the new technologies and the ones that do support them don't support all the features of HTML5 and/or CSS3.

Being, what most people consider, an earlier adopter I am going to be converting www.corywiles.com over to HTML5 layout using CSS3.  In order to not shut out those of you who don't have a supported browser, I will keep the old layout around until the percentage of those browsers falls below 5%.

Posted via email from Cory Wiles Blog

Friday, July 31, 2009

It's Not Easy to Get Mobile

Over the past two months I have been approached to develop at least three different iPhone apps.  Two out of three clients weren't as shocked with the price as they were with the time line.  While each developer out there has a different level of expertise, I would say that your average iPhone app will take 2 - 3 months of FULLTIME development and then at least 7 days for Apple to approve it.  Let me reiterate that the previously estimated time frame is not only a conservative estimate, but also based up a fairly simple app.

To define fairly simple, let's say that you want to have an app where you can search a database for a list of people based upon different criteria: name, age, state and country, have those displayed in a list where a user can then select one of the search results, view the person's complete detail information, and have the ability to copy that user's information to the phone's contacts.  Not that complicated as far as the requirements go.

However, once you start writing the app you will realize that as a developer you need to consider the asynchronous loading of the data, connection speed (Wifi, 3G, Edge or none at all), caching, processor limitations, memory limitations, phone orientation and interruptions of the app. For example, what if a call comes in while your user is trying to perform a save operation in the application or how should the app perform if there is a memory warning and/or crashes).  You have to keep those, and more, in mind just when you want to display a simple list of data.

Finally, after you have all your functionality worked out and you think that you are bug free the REAL fun begins.  The software that is used to develop for the iPhone and Macs has profiling and testing features.  At this point, the developer starts really digging into the bits and bytes of the app to make sure that it is not suffering from memory leaks, releasing objects too early/too late, and overall performance.  While the phone itself is VERY powerful, it is still a mobile device with limitations.

iPhone applications, in my development experience, are not usually offered as a standalone product or service, but as a companion to an existing or large product and/or service.  As a consequence, I have seen many applications rushed out the door on time for what was an unrealistic deadline.  The is usually driven by release date of the "big brother" to the application, which was set to meet a profit projection.  However, if the natural mobile development time is not taken into consideration then the app doesn't reach it's full potential.  At this point everyone loses.

If you decide that you want an iPhone app, and one that works, plan it taking sometime to develop.  Manage the expectations.

Posted via email from Cory Wiles Blog

Sunday, July 19, 2009

Speeding Up the Site

I have decided that since I don't have too much time in the next three months to update a lot of the UI for this site then I will be spending my time making it load faster, especially on the main page.  This first bottleneck that I noticed was when the feeds at the bottom of the page where being de-cached, the entire page was not being loaded until they were done.  This has been rectified by having those load separately through AJAX calls after the page has finished loading.


The next area of improvements will be the portfolio gallery.


It is all about getting to where you have to go faster and more efficient.


Thursday, July 16, 2009

Posterous Is Keeping It Simple

Leveraging social media outlet's to promote your site can be a love/hate relationship.  While the power of promotion is undeniable within the social networking outlets to spread the gospel of whatever business or service you are offering, it can be a daunting task to note only keep up with the number of sites out there, but also maintaing them.  You are seeing more and more companies having to extend their marketing or PR departments to include employees whose day to day tasks are to post and moderate these sites.

One of the statements that I hear most often from clients is that they want to have a presence on Facebook, Twitter, YouTube, LinkedIn, etc., as well as blog, but they don't want to  have to update twenty different sites.  The best solution by far for this is to use Posterous.

Posterous is by far the EASIEST service for not only, blogging, but also blasting out updates to individual services or groups of services at once.  Just send an email to post@posterous.com and you have an instant blog.  You don't even have to create an account first, but if want to have access to some of their other services then an account is required.  If you want to attach a video to blog or images...no problem. Just attach them to the email and embedded videos are added to the blog post as well as, images and audio files.

While some people require more advance features from a blog or need to have better control of their design, then there are plenty of great choices for them to choose from. However, I have found that most people don't have the time to do anything other than email.  Well your white horse has arrived.

Just send an email.  It doesn't get much simpler than that.

::NOTE:: This blog was posted using Posterous.

Posted via email from Cory Wiles Blog

Monday, June 8, 2009

WWDC Day One

While I can't disclose all that I learned from the WWDC, due to the NDA, I will say that it has been amazing.  Apple has not only put on a well oiled conference, but the new product lines as well as tools and resources available have just been amazing.

In case you didn't catch today's keynote here are some highlights:

  • Macbook Pros now come in 13in, 15in, 17in models
  • Macbook Pros can have up to 8gb of RAM
  • Macbook Pros have SD Slot
  • Snow Leopard has an almost seamless connection to Exchange
  • Snow Leopard and iPhone SDK use 90% of the same framework/APIs
  • Prices have dropped tremendously
  • iPhone 3g are now only $99
  • iPhone 3gp[s] are coming in 16gig/32gig
  • iPhone 3.0 now supports voice dialing, improved camera (with autofocus and highlighting), video camera with in-context editing and digital compass.
Obviously there was much more discussed so to get all the juicy details check out the keynote video.  

Friday, June 5, 2009

WWDC Next Week in San Francisco

The party will begin in roughly three days. I am one of the lucky individuals who is attending the 2009 WWDC in San Fransisco. With all the rumors flying around the web right now it is definitely hard to discern fact from fiction, but I have been working diligently on my first iPhone application using the 3.0Beta_3 SDK and while I can't speak specifically about a lot of the new features, because of the NDA, I can say that Apple once again has kept the users in mind with the new features. All will be pleased.

Everyone from developers to the casual user.

For up-to-date information on the conference just follow me on Twitter.

Friday, May 1, 2009