Cheat Sheet: From C# to iPhone

by Jon Davis 30. November 2008 20:55

I'm piecing together this cheat sheet. It's incomplete, and possibly less-than-fully-accurate in places, but I'm adding and editing as I go. If anyone who knows both C# and Obj-C has any suggestions for changes or additions please let me know.

On the left is "iPhone / Obj-C" and on the right is "C#/.NET understanding / equivalence".

Here's the Excel file (so far): iPhone_from_dotNet.xls

Click on the image to go to the full size version.

Currently rated 3.0 by 12 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

C# | iPhone | iPhone | Software Development | Software Development

Book: Beginning iPhone Development

by Jon Davis 30. November 2008 20:05

I've made a couple false-starts in learning iPhone development, but this time I'm not finding myself sputtering to a halt. In fact, I'm having a blast.

This weekend I'm reading through this book:

Beginning iPhone Development: Exploring the iPhone SDK

.. and I've posted the following review:

When this book arrived, and I saw the book cover, I knew I got something different. Not a cookie-cutter book but an original piece of work where somebody really intended to teach something.

I just got this book a few days ago and with this 4-day Thanksgiving weekend and living alone I have been having a blast focusing just on this book. I haven't read through it all yet, still just a quarter of the way through, but I'm not trying to cram. This book does exactly what I want a book to do (as opposed to an online reference resource): stop and talk about every little thing that is really useful to know in the workflow of applications programming on an iPhone.

These guys know how to write. They don't leave the reader with presumptuous word choice and leave the reader hanging; every time they say something it's like they read the mind of the reader, "Now you might be wondering, what about... or why not do ... Well, let's talk about that." Nearly every corner is covered, and where I still have questions it's usually not directly related to the topic, i.e. I have an Obj-C question. Even then, after I return from surfing the web for answers, I return to the book and turn the page and the book says, "You should read up on this stuff at [URL]"... I kid you not, this book had me floored.

Looking towards the latter pages of the book, I can't help but be astounded, thinking, wow, I get to learn about THAT? And in the same style of learning that I've been enjoying so far? This is great!

There are very few errors, mostly just little things that the reader can spot just by paying attention. There are plenty of enough illustrations and tips to keep the reader engaged and constantly learning not just the basics but how to get comfortable in the workflow of iPhone development.

My only disappointment is that the book assumes knowledge of Obj-C, but fortunately it comes with plenty of URLs and references to complete those prerequisites as well, and really, to discuss Obj-C in detail, beyond the rather brief coverage-as-we-go that is indeed in this book, would have been beyond the scope of the book so that's fine.

There's just nothing I can say bad about this book, and everything good. It is by far the funnest technical book I've owned and cracked open in months, if not years.

By the way, coming from a C# background (and Java and VB5/6 before that), lightweight programming of the iPhone is EASY!! It's different, but it's easy, particularly compared to C++ programming which I've had a number of false starts. For me, if I can go from VBScript to VB6 to Java to C#, I can go from C# to Obj-C. Also, the workflow of Xcode + Interface Builder is somewhat analogous to the workflow of Visual Studio + Expression Blend 2 for WPF programming, if indeed event handlers would have been set up in the Blend designer in a drag-and-drop way. I must also add, learning how to develop software in Xcode forces the developer to learn MVC. I don't know why people who are used to Visual Studio programming dislike the MVC-ness of Xcode programming, but I love the change of workflow, and I think there is much to take back with me when I return to C# development.

I'll Get A Zune When ...

by Jon Davis 30. November 2008 02:42

I'll get a Zune when Microsoft admits that the Zune was the backup plan for replacing Windows Mobile, and that they've been taking their time because they wanted to make the transition worthwhile and do app accessibility and multithreading right.

If that's not ever going to happen, I won't ever get a Zune. But who knows what Microsoft will pack into future versions of Zune... I might reconsider.

What I want, as a developer (albeit, a tinkerer, but point being not an end-user), is productivity application support, not just games development support. I'm very happy that XNA now supports Zune, but frankly I don't know who's interested in that except for Microsoft. Now if Microsoft can expand on this API set and make XNA for Zune support productivity applications development as a whiz-bang PDA platform, I'd go super-nuts with it.

More specifically, I guess what I'm looking for is a set of practical, nice-looking, and responsive UI controls, a rich networking stack, an integrated browser API (a la webkit but I guess using IE Mobile), appropriately categorized app accessibility, and the packaging and branding of a small, lightweight device, not a heavyweight song-playing brick. Also need multitouch if XNA 3 doesn't already have it, I haven't checked.

I want these things because I'm still in love with my yester-year's news iPhone, and XNA development just does not compare with iPhone development. iPhone isn't about games, it has never been about games, even though iPhone has an awful lot of games running on it.

And of course I'd be absolutely happy if it went the other way around, if everything on the Zune ended up on Windows Mobile as far as the developer is concerned (i.e. full support for XNA 3), as long as the Windows Mobile UX is still overhauled. I just always hated the Start menu on Windows Mobile, and I LOOOOVE Zune's UX although it's suited specifically for entertainment and not productivity. Update and Microsoft Web Platform

by Jon Davis 27. November 2008 23:09

Alright, I know I'm not supposed to blog about blogging but .. *sigh* alright here I am doing it, oh well. I've updated from 1.2 to v1.4.5. Seems to be basically the same but with some corners rounded out and some features added, most notably a sidebar "widgets" implementation and APML filtering. I was particularly looking forward to a severely needed TinyMCE update (stupid thing sometimes made me want to take a baseball bat to my monitor), as well as just being version-synchronized so I can consider adding plug-ins etc. The upgrade went without any issues except one: I had to create my own SQL Server update script because my old v1.2 implementation apparently had a wacky v1.1 schema implementation from my hack of a 1.1->1.2 upgrade, and so a v1.2->v1.3 script I found which I intended to use to then go v1.3->1.4 didn't work. Fortunately, the SQL schema was really simple in v1.1/v1.2 so it only took about 10 minutes to write my script.

I also changed my relative URL from /blog/ to /techblog/. (Redirection should work; if you followed a link to my blog or to any article from another site and got a 404 error, please let me know!!) I might do other types of blogs and my placeholder redirection page at / (site root) needs to be filled in with a vanity site. I have a 4-day weekend, I doubt I'll squeeze it in but hey I might.

On a completely different topic, I just want to say, kudos to Microsoft for stringing together all of the web development essentials (IIS, Visual Studio, ASP.NET MVC, etc) and packaging them up together into one beautiful download-and-install utility, the Microsoft Web Platform Installer. That is a REALLY good idea for both newcomers to the Microsoft platform as well as for veterans who are setting up new machines.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Blog | Web Development

Mac OS X: Notes On Upgrading A Bootable Hard Drive With Boot Camp Support

by Jon Davis 27. November 2008 22:27

I lost last weekend to a hard drive upgrade for my Mac Mini, the last "pimpage" I will do to this Mac. My Mac Mini now has 4GB RAM and a 320 GB hard drive (the largest I could find in 2.5" laptop hard drive class while retaining 7200 RPM), upgraded from 2GB RAM and 150GB 5400 RPM drive.

This was supposed to go smoothly. Oops.

First while doing the physical install, it was about 1:00 am. I snapped off the orange ribbon at its base--as in, permanent destruction, pins yanked from their soldered sockets. Mac Mini computers have these ribbons and they look kind of like old PATA ribbons for laptops so I was pretty much convinced I lost my computer altogether. I Googled a bit and discovered that this was an audio cable, not a hard drive I/O cable. Whew! I also discovered that you can replace the board for much cheaper than the cost of a new machine. First I ordered this and then I realized that it is probably this that broke on the opposite face so I ordered that.

Creative Xmod is a safe way to get audio back if you break your Mac Mini orange ribbon.

But I canceled both orders and realized, hey you know what, I don't need no stinkin audio ribbon in this thing. I do need audio, but I'm quite content with my Creative Xmod which works fine on the Mac.

I used Disk Utility to copy the actual bytes over from one drive to the other. OS X booted on the new drive fine, but then I noticed that VMWare Fusion didn't see the Boot Camp drive, and of course Boot Camp itself didn't work.

I think I repartitioned and reformatted at least five times over the weekend. Googling didn't seem to help, forum threads mostly led to "You have to reinstall OS X and set up from scratch," which I thought was an awful notion. Nonetheless, after so much time wasted, I started down that path. The whole time my original hard drive was untouched so I had nothing to lose.

But then the OS X installer disc refused to install. Looking it up online, Apple's site said that I have to repartition the drive using a GUID Partition table. Buried in one of the advanced settings in Disk Utility (and easily overlooked), there it was, the radio button that let me choose GUID Partition table. The default was Apple Partition table, which is intended for PowerPC computers I suppose. (WHY IS THAT THE DEFAULT IF DISK UTILITY IS ALREADY RUNNING ON AN INTEL?! EARTH TO APPLE??!) I repartitioned again, then I realized rather than doing a byte-for-byte data transfer from my old hard drive I should restore all using my Time Machine backup. Time Machine literally backed up my entire system, something I didn't expect because the Time Machine backup consumed much less space on its drive than the data on the original hard drive (even accounting for excluded files such as VMWare Fusion VMs); I guess Time Machine uses compression, which makes sense.

The Vista partition did not have a backup, though, and attempting a byte-for-byte transfer from the original hard drive failed. Vista was there but it refused to boot. I tried using the Vista installer disc to "Fix startup", "bootrec /fixmbr", "bootrec /fixboot", "bootrec /rebuildbcd", etc. (I should have looked for this rather than just randomly flip switches LOL..) I also got stumped by another problem: Boot Camp refused to give me a boot drive selector when I held the Option key down. This ended up being caused by having too many USB peripherals and a race condition resulting, so I disconnected everything except for my keyboard and mouse and it worked fine. Ten or so reboots later, I gave up, deleted the Vista partition, and reinstalled Vista from scratch. It's okay though, I wanted to claim the extra space and get a fresh OS start anyway.

This blog entry is posted from my fresh Vista partition on my Mac Mini.

Finally, I had to manually restore my iTunes Music library, including the XML files. Somehow that didn't make it onto my Time Machine backup; might be because I had excluded it, I don't remember.



Google Adding Web 2.0 Features

by Jon Davis 25. November 2008 16:18

A week or so ago, Google snuck in interesting new features to the search results. You can now comment on any hit, as well as manually give hits boost rankings or removing them.

Who'da thunk, that people could contribute to the accuracy of Google's search hits?! Honestly, how long did it take for this idea to come about, it's so simple and yet where has it been all this time?! :)

SiteCore: Take One Step Back

by Jon Davis 21. November 2008 08:15

A few days ago I posted a blog entry about SiteCore. I feel a bit ashamed because I said all that without having done a whole lot (actually none) with it that has made it out to production yet.

The issue is that my celebration of SiteCore has become somewhat irrelevant because a) SiteCore Xpress is not production-licenseable, b) I don't know what SiteCore's production license costs are but I know that they are out of the range of most individuals (like myself) and some small businesses, c) I came across N2 which looks like it's more up my alley despite the fact that it is very light (read: limited) compared to SiteCore, and d) for the moment (the next six months or so) my exposure to production SiteCore will be very limited, thanks to the utilization of and dependency upon a SiteCore partner.

I was pretty much sincere in posting the article but there were a few instances of exaggeration and naive word choice, such as the entire title of the blog entry. Calling it "the ultimate ASP.NET app" is kinda stupid, even if SiteCore is quite nice. 

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Keys To Web 3.0 Design and Development: I Have A Theory About Litter vs. Meat!

by Jon Davis 19. November 2008 21:21

I have a theory.

While Web 2.0 is generally well-defined and understood, Web 3.0 is still being defined and speculated upon every day. However, most folks are in agreement that a Web 3.0 web site has certain characteristics that set it apart from all web sites in the past. Among them, of which not everyone agrees but many do, is the general support for "Open API X" on a site such as OpenID, etc. According to Wikipedia

Nova Spivack defines Web 3.0 as the third decade of the Web (2010–2020) during which he suggests several major complementary technology trends will reach new levels of maturity simultaneously including:

  • transformation of the Web from a network of separately siloed applications and content repositories to a more seamless and interoperable whole.
  • ubiquitous connectivity, broadband adoption, mobile Internet access and mobile devices;
  • network computing, software-as-a-service business models, Web services interoperability, distributed computing, grid computing and cloud computing;
  • open technologies, open APIs and protocols, open data formats, open-source software platforms and open data (e.g. Creative Commons, Open Data License);
  • open identity, OpenID, open reputation, roaming portable identity and personal data;
  • the intelligent web, Semantic Web technologies such as RDF, OWL, SWRL, SPARQL, GRDDL, semantic application platforms, and statement-based datastores;
  • distributed databases, the "World Wide Database" (enabled by Semantic Web technologies); and
  • intelligent applications, natural language processing.[2], machine learning, machine reasoning, autonomous agents.

But simplest and most requisite among the Web 3.0 characteristics is the Web 2.0 ideal, that a Web 2.0/3.0 web site would be built around a "semantic web", whereby a spider or other "robotic" application would be able to make as much sense from a web site just by looking around as humans do today.

This is not my theory, this is fact--fact, that is, that these are the popular opinions and speculations of what "Web 3.0" actually is and how it is achieved. My theory, however, is one perspective on how to achieve a few basics of Web 2.0+/3.0 ideals in a web site. It goes something like this:

Objective: Isolate content from UI, advertising, and other fluff. This will enable SEO opportunities and facilitate semantic web mechanisms by giving "robots" a truly clean document right out of the oven. It can also help developers and content authors / content developers to have workflows that are consistently and entirely isolated from the merged production rendering and end user experience.

Theory: An SEO-rich semantic web site can be achieved when valuable content associated with a URL is returned by the URL (with strict and micro- formatting, and with isolated XML aggregation such as RSS/Atom), and all navigation, advertising, and other non-essential "content" is late-injected in script.

This theory boils down to just a few rules. These are Web 2.0 rules that used to be ideals, but a Web 3.0 site would require ALL of them to be carried out without any fail points.

SEO and aggregation know no style nor script - use this to your advantage!!

This is the core crux of my theory. CSS designers have been enjoying this fact for years, the fact that you can dump ugly, plain-vanilla, raw content on a page and convert it into an absolutely beautiful, breathtaking document while changing absolutely no markup whatsoever except simply a .css file reference. But unlike CSS experts, script gurus tend to be far from consistent. Most search engines and content aggregators don't bother with dynamic AJAX calls and document.write's. Granted, some search engines are getting smarter, smart enough to perform document.write's, but it will still be years before they will support content injection at runtime in order to index the content of a web page; by the time they start doing that, they might as well start aggregating Flash "MXML" and Silverlight "XAML" instances while they're at it (yeah right).

But instead of treating this as "something to keep in mind", what would happen if web developers built everything on a page around that rule, by breaking it down into several rules:

  1. Keep in mind that SEO (search engine optimization), aggregation-friendliness, and the semantic web all share similar requirements from a web site:
    • SEO-friendly data is good data
      • URL path - Use relevant keywords, use slugs, and prefer hyphens (-'s) over underscores or spaces which end up looking like %20's and may confuse the spiders / aggregators.
      • HTML <title> and <meta> keyword tags
      • Use of <h1>, <h2>, <h3>, <h4>, <h5>, <h6> tags and the like is absolutely critical. Never just use formatted <div>'s.
      • Always put the real content at the top of the document since the bottom part could be truncated.
      • Never, never, NEVER spam any page on your site to increase SEO. It doesn't work anymore and will get you blacklisted.
      • Never detect and customize the web page experience on behalf of the search engine such that the search engine sees something different than the user would see. Also blacklistable.
    • Non-content data in the document will be perceived as content if not treated with isolation.
  2. In planning, draw a line between "meat" content--your article paragraphs, your metadata, your title, your copyright line, etc--and everything else--your top-nav links, your left-nav sidebar, your advertisements, your widgets and buttons, etc.
  3. Label everything else as "litter content", because to a "robot" such as a spider or aggregator that's exactly what it is. A robot has no use for advertisements or sidebar except for the sitemap hyperlinks. Regular use of the verbiage "litter content" would be appropriate during design and development cycles because it forces you as a web developer to keep runtime isolation in mind in everything that you do.
  4. Treat a single web page as a multi-tier, multi-component application, not as generated HTML output. Specifically,
    • "Meat/SEO content" should be generated prior to client consumption, in either flat HTML files or as dynamically server-generated HTML (i.e. PHP or ASPX output). From the very first character to the very last line of "meat content", this file should be completely clean, rid of non-SEO content.
    • What the client receives should be NOTHING except for real, raw "meat/SEO content", along with what the client would perceive to be tiny bits of safely ignorable litter markup. Litter markup (tags) in itself is not litter content.
    • This litter markup would consist of all the attribute-decorated, XHTML-compliant placeholder tags and script blocks needed for the client to perform a secondary fetch or otherwise isolated insertion of litter content at runtime.
    • The litter content can be AJAX-fetched, or it can be appended to the tail end of the document. Runtime script would "inject" the content to their placeholder regions. For example, using jQuery, one can simply use: $("#placeholderID").append("#litter_contentID"); in a script block at the bottom of the page to inject litter content to a placeholder region of the page.
  5. Microformat everything. Anything that cannot be microformatted is "litter content" and should also be microformatted as basically ignorable. If no microformat standard exists for a particular region of content on a web page, look harder, and then otherwise invent your own.
  6. Supply XML equivalents to all types of content. This goes back to Web 2.0 ideals but never went away; have RSS/Atom aggregation support for all forms of content, whether for media galleries or for e-commerce product listings.
  7. Use proper cache controls on EVERY component of the page, including script links. In doing so, much of the potential "popping" of content, both meat and litter, can be minimized or altogether avoided. Theoretically.
  8. The litter content can modify the display characteristics of the meat content, but never the other way around. HTML injected with script as litter content should be viewed as transforming content into a thing of usability exactly the same way as CSS has already transformed content into a thing of beauty.

Here is a mind map that demonstrates these rules for e-commerce, CMS, and social web sites:


A new lightweight way to look at semantic web production


There are two very important questions that must be considered with regard to this overall theory.

  1. Does the user see any ugly "popping" of litter content, or is the page otherwise slow to load? While such "popping" can be unavoidable on the first hit to the site, subsequent eye sores such as this should be avoided if possible.
  2. Can the developer workflow and productivity sustain and ideally benefit from this redefinition of what a web page consists of?

For the most part, the answers are likely favorable depending entirely on the inventiveness of the web developer and what tricks he conceives.

These are rules worth building around. Assuming it's correct, it could be one of the several basis of the way we--or at least I--would want to build web sites for the next decade.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Web Development

SQL Server 2008: Ctrl-Shift-M

by Jon Davis 13. November 2008 14:59

When creating a new stored procedure in SQL Server Management Studio, the sproc template would generate:


	-- Use the Specify Values for Template Parameters
	-- command (Ctrl-Shift-M) to fill in the paramter
	-- values below.


Unfortunately, while the same template is used in SQL Server Management Studio for SQL Server 2008, Ctrl-Shift-M wasn't implemented.

The one-time fix is rather trivial:

  • Tools -> Options -> Environment -> Keyboard
  • Under Keyboard scheme, choose SQL Server 2000.
  • Click OK
  • Go back, .. Tools -> Options -> Environment -> Keyboard
  • Under Keyboard scheme, choose Standard.

This info was found here:

Disable Text Selection In An HTML Document

by Jon Davis 12. November 2008 15:14

I just stumbled upon this. For months I've been wondering why it is that the nature of web browsers is such that if you're building a RIA where text selection would be inappropriate, such as in client-side "widgets" and "controls" where text appears as a label or text over an image to appear as a button, etc, but is rendered using HTML just the same, you cannot disable the user's ability to click-and-drag and thereby highlight text, creating a selection. This was partly disappointing for security reasons--disabling selection makes it more difficult to copy things that shouldn't be copied--and it was partly for UIX (user interface / experience) reasons--hiding from the user the obviousness that this is just a bunch of DHTML tricks and not a natively running app. I've always figured it was not possible in HTML to disable the user's ability to select text on the document. 

I was wrong! There's an old hat trick that's been around for quite a while. It's documented here:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Web Development


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar