Copying PNG image files copied from NSBundle to Documents seems wrong

My task was to have some image resources in my iOS application bundle, and copy them into my Documents folder for use later, namely HTML5 code generation. I had a big problem, in that the image sizes were all wrong. When I’d download the package contents from Organizer, and look at then in Finder, the images looked simply transparent. They looked fine in the Xcode project, so what happened?

Normally, images, particularly PNG images, are used for GUI elements, not as assets for use later, like uploading to a server. Xcode build settings use a utility called pngcrush to squeeze a touch more file size out of them. This is the default. To fix this, you go into your Build Settings, the Packaging section and change Compress PNG Files to NO. Now the files do not get crushed, and they keep their original form.

XCode 4.2 screenshot

Posted in iOS

Finder wants to make changes – Trash permissions reset

I have Lion, and for some strange reason, my Trash was now annoying me to enter my admin password to do it. Crazy. So I tried some things I searched on, no luck. Finally found a post that worked, and was fairly simple. Somehow, my Trash ownership got switched to root, instead of my user. Here’s how to fix it.

  1. Open Terminal
  2. Type sudo chown $USER ~/.Trash

That’s it!

Posted in Uncategorized

WordPress Spamming -or- How To Not Waste Your Life

I have to start by apologizing for turning off comments for a while. In the last two days, I’ve been slammed with over 800 spamming comments to my articles. Yes, it’s annoying, and at first I was attempting to build up a clever list of spammy words to trim the spam out. Then I realized I was wasting my life putting that much effort into it. I’m was not willing to play the game, even a little bit. I felt better right away.

Think about it. What is the point in expending a bunch of effort, because of something someone else has set up, for their own purposes, where your benefit is nothing? There has to be a reward somewhere, for yourself, or for someone else. Just following the other sheep or performing to the status quo does not come free. You expended energy.

It’s even worse if you expend money and time. Window PC repair comes to mind as a perfect example. The entire anti-virus industry is built on this most base and despicable display of wasting people’s lives. One solution: buy a Mac instead. Since “the switch” almost four years ago, the number of viruses we’ve had to deal with? Zero. That’s not hype, or slick marketing talking, it is quite simply a fact, and it is not up for dispute. And if you are stupid enough to manually launch a virus from a Mac, you are a sheep with the exact problem I’m describing.

If you are in a job where your purpose is to create these games, you are a complete waste of space. If you are clever enough to spam people, you should be clever enough to do something useful with your life. In an odd way, if someone is simply an identity thief, while destructive, it’s not surprising, because there is a point. But a spammer is a bandit that forces you to sit through commercials. They’ve stolen your time. Why is that?

Simple. A business started this chain of nonsense. Instead of casually showing their goods at the side of the road, they create a roadblock bandit, pointing to the gods at the side of the road. And there is a line of 800+ bandits to go through. So much for the myth of the efficiency of unbridled capitalism. Still not convinced, think about health insurance for a minute, and if that’s getting better and more efficient. Greed is not always good, and is often very destructive. The root of spamming is greed. Whatever it takes, the ends justify the means.

I submit that it’s up to all of us as individuals to determine if we allow someone else’s greed to waste our lives. So take a moment to pause throughout your day, and decide, am I doing something important right now, or am I walking with the sheep. If your gut is saying you’re not happy, it’s likely you’re wasting your time. Simply stop and walk away. It’s really okay.

Posted in Uncategorized

SLCAdobeUG October Meeting – AJAX Simplified

Here are the items for tonight’s presentation.

Go to Start Form

Download Source Files

Posted in Uncategorized

Deleting large “Other” in iOS 5 and iTunes

I had a strange problem. In iTunes, the Other was using up 7GB of my iPad capacity. Not good. Seems like it’s a corruption issue. To get this space back, on your iPad, go to the Settings app->General->Reset->Reset Network Settings.

Do NOT do Reset ALL Settings. I saw some posts on this. It’s overkill and forces you to restore, and waste a lot of time.

So, the iPad will show the big progress bar on the screen, and will reboot. Then sync with iTunes again. That should fix it.

Posted in Uncategorized

Problems with Installer and .mpkg files in Mac OS X Lion

Problem: I had a strange problem after upgrading to Lion (OS X 10.7). Any .mpkg files wouldn’t open Installer but instead would open Terminal, and no installation would happen at all. I saw someone else post that updating to 10.7.1 would fix it. For me, this didn’t work. Whatever happened to me, it happened after the update.

Clue: The problem is noticeable in Finder, as I could see that the file extension icon was not the gold/tan box icon that goes with Installer. That’s not good. It means that Installer.app is no longer the default application for the file extension.

Solution: There are two ways to do this.

1) In Finder, right-click, or get to the property window, and “Open With” and navigate to /System/Library/CoreServices/Installer.app. There is a checkbox to always open with this app. Check it, and let Installer run.

-or-

2) Open Installer itself and drag the .mpkg file into it. Run Installer.

Both of these options will cause Installer.app to run, and saves the new app default back to Installer. To check that it’s working, go back into Finder, and view the file extension. If you see the gold/tan icon on the file, it’s fixed.

Posted in Mac Tagged , , , ,

Book Review: Beginning iPhone Development: Exploring the iPhone SDK

( Originally reviewed 3/20/09 )

This is the most enjoyable computer book I have ever read. That is not a typo, it’s not an exaggeration. I have read more computer books than I can count, spanning decades. I have not had a more fun, immersive, reasonably comprehensive, easy to understand, software development book. This book has taken longer for me to review than any other I can remember. Learning a new platform can be challenging, but with this book, it was incredibly enjoyable. If you are getting started with iPhone/iTouch programming, and you are looking for a book, this one is easily at the top of the list. Start here first, you won’t regret it. Beginning iPhone Development: Exploring the iPhone SDK is outstanding in every way.

So why is this book so great?
The journey is rich. This book has a very clear purpose, to get you up and running with the iPhoneSDK quickly and competently. It succeeds masterfully. If you’re coming from the outside, with no Objective-C or Mac experience, you have a lot to learn. You have a new platform, new language, new development tools, new APIs, new GUI expectations, and (if you are so lucky) a new Mac. With all those challenges, I cannot be more impressed with how well this book handles that potential scenario without losing any focus or trying to do too much.

This book never gets distracted. It has incredible flow. It doesn’t waste time. There is so much to try and explore and understand in these pages, that you just get caught up in it. I have read a lot of books that whole chapters were just fluffy, or there to simply cover the territory. You can skim through the chapter without feeling any sense of loss. This book isn’t like that at all. I found I couldn’t breeze through this book. I was having too much fun.

Comprehension is the key
It’s easy to go over some basic concepts, and apply them with some examples. I’ve read lots of really good books that have done that. If you’re going to really become skilled, you have to have some comprehension of what is going on and why. While it wold be easy to just blaze through all the templates, like a TabBar application, this book has you build things yourself. This way you get to understand what is connected to what, and why. I think this is a critical benefit. I think its more important in the long term to understand what is going on, rather than a how-to of project templates.

MVC and Interface Builder
In order to do any Cocoa programming well, you need to embrace the model-view-controller pattern (MVC). This book does an outstanding job of connecting the objects, where, when, and why. After you get through a couple of chapters, this gets easy, and puts you in a positive work flow. I’ve found in learning Objective-C and Cocoa, that the better you embrace this, the better off you’ll be.

If you are a sloppy, Microsoft Windows kinda programmer, you are in for a rude awakening. Mac-based development requires a high level of discipline and quality just to get successful compiling. As for myself, I completely love it. I enjoy the discipline, and I’m rewarded with performance and stability. This book reinforces everything I love about Mac programming in general, as well as letting me extend it to a new platform. This book keeps you on the right track, out of trouble, and doesn’t let you go astray.

Covering the SDK territory
One of the strengths of this book is how much of the SDK is covered. You would expect a lot less from a “beginning” book. This book is for someone who is beginning, so the title is appropriate. But the reward is how MUCH of a beginning you get from this book. It’s like a collection of goodies being handed to you one at a time, and they just keep coming.

I really appreciated that there was a chapter on Quartz and OpenGL ES. The coverage of themultitouch architecture was well written. I was just engulfed with fun things to test, and it was easy to absorb. Core Location was covered, which gives you all kinds of creative ideas about using the GPS in the iPhone 3G. The Accelerometer chapter is one of the best parts of the book. It also covers the camera, which is another item that relates to the iPhone, but not the iTouch.

Comparisons
The part that was lacking, compared to other iPhone books, is not covering video and audio. But it more than makes up for it in its coverage of localization. With the iPhone in 80 countries now, it’s best to have that understood from your first iPhone app. I’m also glad it didn’t waste my time talking about web apps for iPhone. The mood of the book is not intimidating, which can happen in computer books in general. The prose never gets “nerdy.”

Another comparison I want to make is to the expensive iPhone camps and webinars. Personally, I felt I got a much better experience from this book than the online seminars I’ve been in. The value of this book in comparison is amazing. If you want to do a seminar, great, but bring this book with you.

Conclusion
The strength in Beginning iPhone Development: Exploring the iPhone SDK is how well it covers the SDK from a dead start. It gets you doing good habits now for those things you NEED to know now. This book has style and substance. It’s wonderful, polished, and relaxed. I would compare this book to Girardelli premium chocolate squares. It’s a great experience, that makes you happy, that you can’t scarf down, that you simply enjoy slowly because it’s so rich. For beginning iPhone development, you could not ask for a better book than this one.

Posted in Books - iOS Tagged , , ,

Book Review: Manning Adobe AIR in Action

( Originally reviewed 8/3/08 )

As of this writing, there are more books on AIR coming in the fall (200Smilie: 8). So I was excited to have an opportunity to review a book before its release. So, many thanks to Manning and Emmy Southworth of he Salt Lake City Adobe User GroupAdobe AIR in Action is a superb book, and I would say is the first must-have book on Adobe AIR.

One of the strengths of this book is the flow and pacing, which is pretty consistent, and comfortable to follow. I came to appreciate the way Manning uses it’s code samples, with numbered comments, that also correspond to the sentences in paragraphs that relate to lines of code. It’s practically impossible to get lost, and that’s a confidence boost for the reader.

Another trait of the “In Action” books is the concept->example formula. Easier said than done, this book is a fine example of really pulling it off. I never felt overwhelmed. The sample applications here are refreshingly concise. Many books have examples that have a lot of code that wanders off a little, but not this one. One of the applications is using YouTube APIs, where there’s enough dazzle, without extra fluff. The sample applications here stuck to the point, and didn’t waste my time.

So what are the highlights of the book?

When it comes to standard Flex/Flash RIAs, there’s really no need to consider anything outside the browser. This book concentrates on desktop-oriented programming, the things you need to know. I thought the section on menu types and how they work across OSes was very thorough. They cover many of the gotchas of window types, and things that we tend to expect from a windowed application as far as behavior.

File system concepts, like reading files, reading directories, reading streams, writing files, all are handled well. Excellent examples of all. The copying, pasting, and drag and drop are covered equally as well. The material always feels complete, not rushed.

The database section concentrates in AIR’s support for SQLite, and again gets to the implementation in a direct way. There are obligatory pages going over the basics of SQL, and a nice explanation of how to create a database and tables. They show a relational junction table as well. However, I am always a little sad when databases are discussed, and normalization is not. I know that AIR application databases are relatively small in size. But…Normalization is THE most important thing to know – truly know, when building any database. It’s a serious gotcha.

I enjoyed the Network communication chapter, which covers HTTP and other network connectivity monitoring. There’s only so much to show here, whereas a Flex book may show a lot more about the actual communications.

The HTML in AIR chapter could easily be applied to a normal Flex RIA. It’s always nice to see how you can have Actionscript and Javascript communicate via the DOM. There is no shortage of good examples, and they don’t disappoint. Obviously the authors were very excited about it. However, the parts that I found most interesting was loading PDF, managing caching, cookies, authentication, and sandboxes. I was really pleased they included this material.

This book has the best explanation of installing with badges and updating that I’ve read so far. It’s easy to read, and takes away any intimidation. If only all desktops were this easy! They finish up with launching an AIR application via file type or browser RIA (Flex or Flash). This functionality of the AIR runtime is really appreciated by those of us who’ve done desktop development, and done it manually.

Summary

Adobe AIR in Action is a great book that is very concise in its concept descriptions. The examples are top notch, well explained, and easy to follow. They cover the basics of what a desktop application needs: windows, menus, file access, clipboard. They cover using the SQLite database and network connection well. And the installer and automatic updates features of AIR are simple and complete. The best way to describe this book is concise and competent. If you are a web developer, doing a desktop application for the first time with AIR, this is a book that will really help you. For any AIR developer, this book is easily a strong reference/sample book, that will not collect a lot of dust. It’s that good, very usable.

Posted in Books - Adobe Tagged , , ,

Book Review: FriendsOfEd Foundation Flash CS3 Video


( Originally reviewed 7/19/08 )

Being someone who works with Flash and video as my profession, this is obviously an appropriate book for me to read. I am happy to say that this is a really good book, and touches on some subjects where previous Flash video books have not gone before.

As with all Flash video books, they start with the usual “Here’s how to slap in a video, encoded, and running in an FLVPlayback component. Standard stuff, not unexpected, and yes, I’d say obligatory.

They also go into how to create some video content and editing with iMovie and Movie Maker. I was surprised that this actually well done, and had the right length.

Where things start to get interesting is in the “Talking Heads” chapter. It was really good to see a much more expanded explanation of how to approach this common technique. They go into more detail about creating alpha channels with After Effects and Final Cut Pro than I’d seen before. Instead of just showing how to do it, they also discuss how to do it with some flare. This includes applying filters, blends, shadows, video-on-video, and video reflections. The book really goes to some places I really hadn’t considered trying with video. There is a nice explanation of using a matrix and how to apply a Convolution Transform.

This book shows masks and effects in much more detail than previous books I’ve read. They do examples of moving masks, rotoscoping, aging and more. Although I prefer to use After Effects for video effects, this is a good alternative if you don’t have video production products to do that.

I like the section on playing multiple videos. It gives you some different ways to do that. The interactive video of the guy slapping himself was hysterical. If you have a kid who likes slapstick, this interactive approach to video abuse is pretty entertaining.

The chapter on going small and going big is excellent. While I’m not into video for the phone — yet, this is covered fairly well. Much more appropriate for my work is going big, and that’s looking at fullscreen h.264. This is the only Flash video book at this time that really dedicates space to this subject, and does a good job. There has been a lot of moaning and crying over Flash Player and it only supporting flv and mp4, and how that’s not “acceptable.” Grow up already! AVIs, WMVs and MPG (2) are ancient, obsolete formats, and are the video equivalent of the 8-track tape. The difference in compression, bit density and quality is absolutely huge. Don’t believe me? Standard video on an HDTV looks terrible, but that is not stopping sales, is it? It’s the same thing. If you are a Microsoft guy, and you’re trying to do video — I pity you. In stark contrast, the Apple MOV format is identical to mp4, and their video tools are incredible. They are in great shape!

The last section they have that is unique is using the camera object. But they really go a lot further, using video for boxes, flipping them, and inserting them into various displays. The effects and things you can do are very similar to iPhoto and iMovie effects, only you can do them from Flash. I can just see some security guy wanting to use the motion capture example.

Summary
FriendsOfEd Foundation Flash CS3 Video is an excellent book, with a lot of solid detail. It covers a lot of territory, as far as techniques that someone can use. Other Flash video books cover a lot more video production and encoding than this book does. But if you are doing any video with alpha channel production, fullscreen, mp4, or cameras, this is the right book for you. That’s where this book shines.

Posted in Books - Adobe Tagged , , , ,

Book Review: The Zen of CSS Design: Visual Enlightenment for the Web


( Originally reviewed 4/14/08 )

This book has the whole package: layout strategies, using images, proper fonts, special effects. 

If you are doing anything with CSS, this book is required reading. In fact, I can safely say this is my favorite CSS book. Why? While most books cover the technology, this book covers the philosophical and design aspects of the application of CSS.

As a programmer, I feel at home with the standard fare of CSS books. However, there is something missing. The element of design is a core half of what CSS brings to us. An ugly page can be done in CSS just as well as a sliced up table layout. But a well designed page, and a well constructed page as far as markup, is what we all want to achieve in the end, right?

If you are not awate of what CSS Zen Garden is, you are in for a treat. This one site single-handedly converted me to CSS, in one day. It was the last time I ever did a table layout. It shows the power of CSS, where the markup does not change — a true separation of content and design. Check it out, you won’t regret it. If you are not impressed, you must be one of those command-line, hopeless types.

The book takes different posted designs, and describes how they work. It’s one thing to see the code, and try to figure out what it’s doing. This book explains the concepts, explains the code. It’s clear, concise, and a fast read. It also makes a great coffee table addition!

Bottom line: This book is incredible. It brings a more complete appreciation for implementing CSS, it brings the design portion in, and gives it a prominent spot. If you are a designer, you will appreciate what programmers can do to set your creative side free. If you are a programmer, you have the function, now embrace form a bit, and make something extraordinary.

Posted in Books - CSS Tagged ,