Author Archives: Tom

Which is better: to embed images or link images in HTML emails?

Early this morning, and later in the evening, I was working on a PHP script that composes HTML emails with extra files included, but rather than making images as attachments, the script embeds the images so they don’t actually appear as attachments, but appear instantly within the email.

It works fine for <img> tags, but the big issue comes when trying to use CSS.

<img src=”cid:20110212231111.1we615e” />

This works in Thunderbird, immediately.  And it works in Gmail’s web-interface.
BUT…

body { background-image: url(cid:20110212231111.1we615e); }

This DOES NOT work in Thunderibrd, and NOT in Gmail’s web interface.  These items do however appear as attachments.  So that defeats the purpose of having everything appear instantly and properly.

And given client demands, I need to make everything as perfectly seamless AND painless as possible.

So, I believe I’m going to simply link ALL images.  That will save on bandwidth, plus any email client that has image security will simply display a link that says something sounding like “Do you want to display images in this email?”.  If the recipient clicks to say yes they want to see, then everything will appear, instead of just the <img> tags, but no background.

This is an example of the far-out strange places I go in my work.

Trying to embed and compose HTML emails is difficult on a Windows machine since Thunderbird’s only HTML composing feature is old and not updated to work with the latest version, and Outlook only works (so I’ve read) with HTML composed from within Frontpage (not going to touch that with a 10-foot pole!!).  A few days ago I created an automated emailer that attaches vCard files, and in order to do this, I had to learn about MIME boundaries, content-type, content-disposition (inline vs attachment) and a whole lot of extra stuff.  Lots of technical stuff.  In the end, I’m here wasting time figuring out embedding images, just because Gmail’s web interface doesn’t operate to the most ideal level possible.

Oh well.  So I’ll just link every image.  And that’s a wrap! … several wasted hours later.

Posted in Activities & Adventures, Technology | Tagged , , , , , , , , , | 2 Comments

Mobile web problem on the Blackberry Torch/Tour/Style

One of the benefits of having smartphone is surfing the internet with a high-quality web browser while you’re driving down a high-speed highway.  Then, often if you’re looking for information on a destination, anything from a restaurant or hospital or mechanic or astrophysicist, you’ll discover a phone number.

And magically, any android phone or apple iphone, will see the phone numbers and make them clickable.  Even the Opera browser I have on the iPhone 4 does this.

But NOT the built-in browser in the OS 6 phones from RIM.. the Blackberry Torch, Blackberry Style and Blackberry Tour.

Unfortunately, there is no solution for that personlooking up a contact phone number on their Blackberry phone. HOWEVER, that does not mean it is impossible.  The solution rests completely on the shoulders of the creator of the web page.
For a web designer/developer, instead of putting a line of text within HTML in your page like

Call me!  1-800-123-4567

simply change the HTML code to

Call me! <a href=”tel:1-800-123-4567″>1-800-123-4567</a>

I’ve downloaded all the emulators for these devices, to verify the solution.  Yep, works. Very, very simple.

Posted in Technology | Tagged , , , , , , , , , , | Leave a comment

Optimism, self-development and word-of-mouth

Lots of things going on in life.

I’ve been lethargic/apathetic about a number of important parts of my life, and am really starting to focus.  Helps to rely on good writings by professionals in self-improvement.  Thanks, Brian Tracy!

A large-size whiteboard in my room has a number of papers taped to the perimeter, schedule for the YMCA, a story, a funny editorial cartoon.  Right in the middle, in big coloured letters are the two lines “START DECLARING AFFIRMATIVE STATEMENTS” and “MASTER TIME MANAGEMENT”.

So, that’s what I see when I wake up in the morning… if I look at the white board. hah.

A project that I’m developing, guided by a local real-estate agent, is turning into a minimally profitable venture.  That is good, because most projects I do are not profitable, and I’ve barely survived the last three years (sparing you the story about business partner who don’t pulling their own weight!)

It’s really nice to see projects being useful to other people, and enough so that word of mouth is present, and people start spreading their excitement of their experience with a product or service I have to offer.  Yeah!

Okay this is just a happy post.  I’m crossing my fingers.

Posted in Activities & Adventures, Thoughts | Tagged , , , | Leave a comment

Google’s Android OS and Apple’s iOS – Introduction

Other blog sites probably have content about this subject, but I felt a desire to share my two-cents-worth.

Now I’ve begun to learn Google’s Android OS and it’s helping me appreciate Apple’s iOS more.  Another reason, I found a blog with some good info on it yesterday and had an article something like “10 great things for ____”, and the author created a list of 5 things, and finished the list saying “I’ll get more written soon.”  That was 2 years ago.  Nothing was posted on the blog afterward.  Seems like one of those late-1990’s websites that were PERMANENTLY “under construction”.

So, this is the beginning of a number of writings about the two mobile smartphone operating systems, and I’m writing a bunch of this now, but posting it separately.

Topics:

  • Introduction
  • Hardware
  • OS & Software
  • User Interface
  • Apps
  • … more later, possibly!!

 

Introduction

Recently, I chose to put effort, serious and dedicated effort, into learning the Android OS for smart phones.  When doing development, it helps very much to have one of the real physical devices to test and give a sense of “yes it works!” excitement, and the money expense also helps force the progress, since a financial commitment has been made.

So I now own an iPod Touch 2nd generation, iPhone 4, and Acer Liquid E running Android.  These are my mobile development devices, and I am really getting to understand them both more than I could with only the simulators.  Having the iPod touch for two years before the iPhone 4, and having that 2 months before the Android phone, I would think I understand most everything in terms of how it works on iOS, and be irritated when the Android environment is different.  Well, it’s true in most cases, there are a lot of things I prefer about iOS than the Android OS, but the interesting thing is: I realize that I don’t appreciate Apple’s operating system as much without having something different to compare it to.  Thus I am now beginning to understand some philosophy behind the design in iOS, and how it is different to the Android philosophy.

The main difference is the open-versus-closed models; Android being open-source and you can mess around with the OS and recompile it, and install it on the phone, making it do what you want. That’s for the way-out-there developers, but people can install apps anyway in their own home, downloaded from the internet and installed using the Eclipse IDE, if a person is ambitious enough, and patient enough to go through the necessary steps.   The iPhones and iPod Touches can’t have any app downloaded from the internet and installed… they must be downloaded through the device’s App Store app, or through iTunes on the desktop/laptops and synced onto the phone.  Apps are developed in Xcode on  Mac computers, and can only be installed on the device if a person has paid $100 for a yearly subscription to the “iOS Developer Program”.  Then you can download sample apps from the internet, and install them on your device.

Most the other differences are under the hood, which only developers will see or understand.  For example:  Apple expects apps to be singular, and it’s the normal way of apps on a desktop like Microsoft Word or Firefox/Safari/Google Chrome.  You double click an icon for the program,  or a file that is viewed by the program, and the program opens.

With Android, an app can have different bits that are each disconnected from each-other, but are loosely joined together… for example an app that is designed for note taking, allows you to write notes.  But it can also convert notes to PDF files, and you can email those PDF files with the app.  The PDF part is secondary to the note-creation, and yet the app can be made so that any other app can “create a PDF” and this app will be run, but instead of showing the standard note-taking component, ONLY the PDF converter component will be activated.  I haven’t seen this in practical action yet, because I’m only just learning, but this is the way it is according to the introduction on http://developer.android.com.

So those are two examples of philosophy differences, each with a description for Android and iOS.

 

Next, the more useful information begins.

 

Posted in Activities & Adventures, Technology, Thoughts | Tagged , , , , , , , , , , | Leave a comment

Transfer files from Windows to Mac With Proper Ownership

Here are two computers for work: a machine running windows XP for web development, and art and media development, plus a machine (laptop) running Mac OSX 10.6 for iOS development.
This past year I’ve done a lot of work on the Windows machine and transferred it to the mac to a publicly shared folder on the mac.  Trouble is, Windows Explorer on the Windows machine was always connected to the Mac machine in the regular method, through the standard sharing of folders, etc.
On the Mac, I navigated to System Preferences > Sharing.  Selected and made a checkbox in “File Sharing”, then added folders in the Share Folders box.
On the right, “Everyone” had Read Only access, but for some folders I chose Read & Write.
I was still always connecting as an anonymous account, grouped under “Everyone”.  Tonight I figured out how to not do that.  Numerous sites around the internet give instructions to do various tasks, but I had to read a number of them and put all the bits of suggestions together to form a complete solution.
Still within System Preferences > Sharing, in the top “Computer Name” text box, I put a short simple name for this mac computer.
Then, I created the name for this mac to show up under Windows networks.  I clicked “Show All” to return to System Preferences, and click on “Network” within “Internet and Wireless”, then clicked the Advanced button.
Finally clicking on “WINS”, I arrived at the place where I set the NetBIOS name and Workgroup, and set the NetBIOS name to be the same as in the “Computer Name” text box, and the Workgroup was set explicitly to the same as the Windows XP machine.
Finally, the icing on the cake: control exactly how the windows machine silently logs into the mac machine.  It’s almost always silent, and also silent when connecting to another windows machine. For years I’ve struggled with this.  And it’s all good now.
On the mac, the system username of my account is what shows in finder beside the house icon.  On the windows machine, click on Start > Control Panel > User Accounts.  I selected the account I use to sign into Windows (an Administrator account), and in the upper-left of the User Accounts window, under “Related Tasks” appeared a link “Manage my network passwords”.  I clicked on that, then reviewed the window that appeared “Stored User Names and Passwords”.  I clicked on Add, then typed in the name of the mac computer for Server, then for the username,  I entered [name of mac computer]\[my username on mac computer], and also my password in the last box, and clicked OK.
Now, when I attempt to access the mac machine, windows automatically uses the specific username for the mac, and the password, and files that are transferred have the proper ownership on the mac.
This suits my needs perfectly.
After this, I can easily setup a mapped network drive to any of the shared folders on the mac, and have better file management.
Yahoo!
Posted in Activities & Adventures, Technology | Leave a comment

The app customizing job is complete

The customization of a pre-existing app to a new app for the Apple AppStore is complete.

Technical words:
The cron-job is properly working. It runs the check-feeds script, that loads a CSV file of urls and last-modified headers from each feed url. Then each url is checked if the last-modified date is newer, and if so, or if there is no existing saved feed file, the check-feeds script downloads and saves the feed as a file.  After all feeds have been downloaded (or not) then they’re all loaded and processed, and a static file is created that contains the data pulled directly into the app.

Translation:
I’m going to sleep.

Posted in Activities & Adventures, Technology | Leave a comment

And now for something completely different

Here’s a switch from the first 6 months of 2010… I am working on a different iPhone/iPad application.  Part of it includes building an RSS aggregator.  This post is going to be included in the collection and display of the aggregator.   There is much to be done when building an aggregator.  The entire Google Reader system is a world-class aggregator, but as of this point there is no public, released API.  So primarily, I’m working on simply collecting the data, sorting it all by date, and then saving it as a flat text file for the app to collect.  Wahoo!

Posted in Activities & Adventures, Technology | Leave a comment

The experience of writing a game

I am typing this post on my iPod touch, just to let everyone know incase I have spelling errors.

A person suggested the possibility of me writin about the process of developing a game app, or perhaps more about the experience of it than the details.
Well, it is a good idea!
One thing that comes to mind almost immediately is the time consuming tasks.
I find that graphic design takes a lot of time, but it is a very fun process.
Anoter thing that comes to mind is all the late nights up, awake, working on one of the many problems. Like tonight.

Good night!

Posted in Activities & Adventures, Technology, Thoughts | Tagged , , | Leave a comment

The organization of a game app

The central-most Objective-C class in this game I’m developing is called “HBDGame”. The main source file has gone beyond the previously-mentioned 6000 lines and is now over 7200 lines. It seems a lot (for my own records).

Now I want to make a quick post because I will forget if I don’t… and because I do not want to write about this in detail right now.

There is a difficulty in maintaining strong organization when I have over 40 classes and dozens or hundreds of images, giant world map files (around 10/25 made so far) with dozens of configured elements within each, and a handful of soundeffects.

So I have probably 100+ pages of hand-written notes and diagrams and pencil illustrations, plus all the source mockup files for the computer graphics, and e-documents typed to keep myself organized.

And it’s becoming very challenging. I make constant use of text-based two-way references. That’s one of the best helps for me to keep track of execution paths in the program. blah. Now this is really starting to sound technical.. hah.

The major point of this post is simply this: the source-code and information hierarchy model I’ve found myself using (and pretty comfortable with) is something like this:

  1. Main game class is HBDGame, and it is the ultimate boss, next to the app delegate itself.
  2. There is a layer of persistent data (game settings that are important to keep the same for every game-session, like music volume and choice of accelerometer control versus touch-screen control). This persistent data is saved and loaded by 3 different simple functions.  The HBDGame controls these, and every class that wants stuff saved goes through the boss class.
  3. Significant game components, including the GamePlayer, menu systems (main menu, pause menu, quick popup menus) and other significant game objects.
  4. Interaction layer which handles the inputs to affect the game.  Some of this goes through the boss, and the boss passes off the inputs to the proper recipient.  Other times it goes directly to the recipient (specifically in the case of menus).
  5. Finally, the graphics themselves.  The graphics are controlled almost all completely through the main game components.

Probably doesn’t qualify as a model-view-controller layout.  More like a Global support-storage-model-controller-view.  I think the model-view-controller is a great model for software, but it seems complex projects have blurry lines of communication between the three concepts.

Perhaps there is a better way to organize what I’m doing, but right now I’m still finishing up the core of the game.

I’ll try to write more about this, with concise details, later on.

Posted in Activities & Adventures, Technology, Thoughts | Tagged , , , , | Leave a comment

Custom rotation/orientation, and almost too much code

I have my major iPhone project game-app organized in this manner:

Custom class for appplication delegate class (as all apps have)

it has a generic UIWindow as the view property.

To this window, I add a background wood image.

Then the app delegate creates an instance from a nib, of my main game object view-controller-subclass.  I actually use this view controller subclass as the main model of the game, instead of separating it out to form a more appropriate model-view-controller relationship model.

The game object has a custom UIView subclass, NOT the one for the OpenGL view.

This view is permanently in UIInterfaceOrientationLandscapeRight (the default orientation set in the Info.plist).
Extra trivia: when an orientation change occurs, I manually rotate subviews of the main game view individually.  This is done by  picking one of my five global CGAffineTransform variables created with assigned values

CGAffineTransform transRot0 = CGAffineTransformMakeRotation( 0 );
CGAffineTransform transRotMinus90 = CGAffineTransformMakeRotation( – M_PI / 2 );
CGAffineTransform transRot90 = CGAffineTransformMakeRotation( M_PI / 2 );
CGAffineTransform transRotMinus180 = CGAffineTransformMakeRotation( – M_PI );
CGAffineTransform transRot180 = CGAffineTransformMakeRotation( M_PI );

The two 180s are very important, only if using animations to transition with style.  And that’s what I am doing (in some cases).
The UIInterfaceOrientationLandscapeRight is the same thing as UIDeviceOrientationLandscapeLeft (when you rotate the iPhone or iPod touch from having the home-button down = portrait, to having it on the right-side = device landscape left, the interface must rotate the opposite direction = landscape right, to maintain the same upward direction so you don’t have to tilt your head).  The direction of positive rotation is clockwise,  so if someone starts the app and has the home button down = device/interface portrait, the interface must rotate counter-clockwise 90 degrees, thus I assign transRotMinus90.
NOW IF the device is rotated again to device-landscape-right/interface-landscape-left, all my subviews including the play-screen and main menu will need to be rotated to a 180 degree transform rotation. But because the view was previously a Minus-90 degree, the next rotation should be a Minus-180 degree.  If using animations and assigning all subviews a 180 degree rotation from minus-90 degrees, rotating from portrait to device-landscape-right will have a terrible looking 270 degree opposite rotation.  Again, it isn’t important to do minus-180 if there is no animation.

That’s a long-winded orientation discussion.

And as mentioned, the game-viewcontroller has a custom subclass UIView.  It has two primary views added as subviews (there are other subviews which are not important for discussion).  The first primary view is a view from a custom subclass of UIViewController controlling the main menu, and the second of the two primary views is a custom subclass of UIView which is for the OpenGL graphics.

And I haven’t been working on this today, but I mentioned all of my game’s orientation methods are contained within the main game class, not the custom subview class.

All of this orientation code, and much more (multiple levels of initializing and setup, haha) combine to a pretty large line count – today I went over 6000 lines in this one file.

Everything is very well organized still, so I have no problem navigating or finding things.  Woohoo.  Otherwise, it would be a colossal nightmare.

Posted in Technology | Tagged , , , , , , , , | Leave a comment