typemismatch

just a projection of my own imagination

  • You are here: 
  • Home
  • Software

IPhone applications and objective-c

Posted on May 19th, 2009

So I wanted to post a little about the things I’ve found now working with Cocoa and the application I chose to target first was an iPhone application. I haven’t really had much time to dig into a native mac application yet.

Firstly lets talk a little about XCode. This great IDE comes free when you own a mac – pretty cool. Unlike Visual Studio which must be purchased if you want anything besides the free version. XCode is a great IDE, it is fast and simple enough to use. Apple has included everything you need including performance and memory profiling tools.

The extensions to support iPhone development are totally seamless so that was a nice find. Once I started getting into objective-c I thought my eyes were going to bleed :) Really, it is too old. The future is with managed languages and the thought of any form of memory management is pretty lame but right now, I have no choice. If you want an iPhone application you’re going to be using obj-c.

The language did have a couple positive points, at least what I’ve discovered so far. The way it passes around messages is a cool idea. Parameters are named when passing values to a method. (msg) – this makes for more coding but it makes it a hell of a lot easier to read the code later.

I did like Apple’s take on controller and view separation. Even using a separate tool for the interface design is a great way to keep the UI developer out the controller code. Up until Microsoft released the new ASP.NET MVC framework all views and code behind files were tied together. Unfortunately for traditional ASP.NET and WinForm development this is still true.

So right now I’m impressed and enjoying the development process. I think Microsoft could learn a few things from Apple however …. I do feel strongly that Apple need to connect the dots and that their code needs to move to a managed environment. They could adopt Ruby more rather than just supplying the API bridge.

Tags: , ,
Filed under Software | No Comments »

Rails, Grails and .NET MVC

Posted on May 3rd, 2009

We certainly do have a lot of choices when building applications these days! :) Here is a little insight into my latest project application choice. It might or might not work for you and it is not intended to be a guide per se since as good programmers know – pick what makes sense for your application.

I needed a new web application that was only going to be used for internal administration and so I could do something fun and not care about how it scales. Here are a couple key requirements so we can discuss over them. Firstly, I need page authentication and I have no need for a database since I’ll use SimpleDB so the DAL isn’t as important.

My initial thought was, lets just roll with Rails since in the last couple months I’ve been doing a lot of R&D using Ruby and Rails however I recently started some work on Grails and so the decisions begin.

Let me prefix first by saying I could have built this using .NET MVC and I believe that would have been the fastest way, sorry but it is – that isn’t bias for Microsoft just a fact especially since my skills lie heavily in that area … but I wanted something more fun :)

ASP.NET MVC

  • Easy to use for sure, especially if you’re already a .NET developer.
  • Tools are fantastic.
  • Authentication is as simple as using the [Authorize] decoration on your controllers.
  • Data is via an existing SimpleDB Provider I wrote.
  • Doesn’t run well on anything but IIS
  • No exposure to other technologies <- the fun part :)

Ruby on Rails

  • I think Ruby is pretty easy to learn.
  • The tools are getting better – don’t be a hero, use and IDE like NetBeans/Eclipse.
  • If you have complex database requirements activerecord is going to be painful for you.
  • I’ve found the community a bit broken with Rails, you can generally get help but not always the easiest to understand.
  • Far too many depreciated gems floating around and even the Rails wiki is out of date.
  • As for authentication, well nothing easy to find – does require more code than I’d like. Not sure what is best.
  • SimpleDB access was OK but not great, relative name spaces break when importing classes while using Amazon libraries so that wasn’t cool. Had to hard code some paths.

Grails

  • Just started R&D on this and I didn’t feel like jumping into Groovy although it is close to Ruby I’d rather learn one new thing at a time.
  • Does have the huge benefit of running on the JVM and also being able to use existing java classes.
  • Can be deployed on well established application servers, so that is great.
  • Tools are ok, new at this stage but Netbeans seems to do the job.
  • Authentication is ok, there is a good plugin but still requires far too much code for my liking compared to .NET
  • I can’t find a Grails/Groovy SimpleDB library but there is one for Java so I guess I can just use that.

and then I found ….

JRuby

  • Will allow me to keep on the learning curve with Ruby but
  • Lets me deploy in single packages and do java application containers.
  • Exposes me to more java technology.
  • Tools are pretty good and I’m using NetBeans right now.

So that kinda sealed the deal. I wanted something fun and like Ruby so JRuby lets me keep that knowledge but also I get better exposure to Java technologies. You might wonder, “If you want Java exposure why not use JSP or similiar” … right, no thanks :) Keep it simple!.

I’ll post when I’ve deployed my first working JRuby application and I plan to run it on Tomcat/Ubuntu 9x.

Tags: , ,
Filed under .NET, Software | 2 Comments »

Why you should never buy Winzip!

Posted on March 8th, 2009

And no, not because it sux :) I like it, it works well and does handle massive numbers of files with good compression.

The story goes as follows – after using some form of Winzip since the dawn of time I decided I’d like to do my bit and buy my own license. I mean it is just $30 (or was!) and so off I went happy to have my own license.

Well that was on Winzip 10 and after some security updates, they now have version 12 out. So what is the problem? They suck, not the software – the idiots running the company. I can no longer download version 10 of the software that I OWN. If I want a download I’m forced to upgrade to version 12, which isn’t going to happen. If you can’t make money as a company, squeezing it out of existing clients is a really bad business model. This coupled with the fact I get spammed by Winzip and 3rd party crap really grinds my gears. (ref: FG) <- duh

So, I’m now going to “attempt” the same thing with WinRar – buy a license and go on my merry way. I doubt those guys will be as quick to try screw me over. As for Winzip, you guys can kiss my ass.

Tags:
Filed under Software | No Comments »

For mail, I’ll wait until Snow Leopard is released.

Posted on January 11th, 2009

So as you can tell I really need a good email client. I do far too much work over email both work and private. When I posted earlier that I went back to the default Mail.app on OS X I forgot that I had seen a link for a beta of Thunderbird 3 from Mozilla.

After some searching I found the download link:

http://www.mozillamessaging.com/en-US/thunderbird/early_releases/downloads.php

Turns out this does solve most of the issues I was complaining about. There still isn’t any background sending options but it is a beta, maybe they’ll be nice and turn that on just before release … you know … who doesn’t save a few gems for the end :)

Anyway, I had for other reasons started to look at the features that will be available in Snow Leopard the next big OS update from Apple. Turns out it will have, what they’re at least calling, full Exchange 2007 support for native applications like iCal and Mail. If this really is the case and it supports offline and remote email (RPC?/or OWA) then I’ll be rocking.

So I’m using a mix of Mail and Thunderbird 3 beta and it does the job. Fingers crossed for a release soon from Apple for the OS.

Tags: ,
Filed under General, Software | No Comments »

OS X Email Clients … or lack of

Posted on January 8th, 2009

These posts are for my x-fellow windows users who might have or want to switch over the using a Mac. Not everything is 100% perfect and for some reason Email software is probably the biggest missing piece of Apple’s offering.

The default Mail.app that comes with os x is Ok but that is about it. If you’re like most people you need to connect to your work exchange server and the only way to do that is via IMAP. The IMAP integration in Mail just sux, no other way to put it. It jumps off messages while reading, gets out of sync with the server and other macs and sometimes gets really slow.

So I shopped around and besides Microsoft Office 2008 … you don’t really have any great choice. Sorry. I’ve heard MS Office 2008 is fine but I really only need Entourage (Outlook) and you can’t buy that on it’s own. Open office for the Mac is just dandy for almost everything else.

Right now the best IMAP client I can find is Thunderbird from Mozilla. It is fine but not great either, not enough editing options. As I stated in another post my personal email is kept on GMail so no worries with that.

So for now this is it – not great but still, better than living in a Vista world.

Tags:
Filed under Software | No Comments »

Get an Apple Mac

Posted on December 10th, 2008

That is what you want to hear right? Why else would you be reading a blog posting about switching to Macs. Like me you’re probably a hardcore, long time windows user and developer and you’re sick to death of the crap that comes out of Microsoft these days.

So again, let me keep it simple. Go get a Macbook Pro and see what that world is like. No point playing with one in a store, to really get into it you need to commit so you need to buy one. I really didn’t think I’d like OS X and would just end up installing Vista on their nice hardware but it turns out that OS X is really great – not just super stable but feature rich and far more intuitive than any Windows OS you’ve ever used.

After a day or so I maxing out my new baby I wasn’t just happy but pissed at how crappy all my machines up to this point had been. How crappy Microsoft products really are. Why can’t Microsoft make some of these really simple things work? I mean, Apple have really nailed the “it just works”.

I’m not sure what has gone wrong at Microsoft. Everything coming out of Redmond is just crap – and Vista … let’s not put lipstick on that pig. It is crap, it is built on crap and mark my words – it will probably go down in history as their biggest failure. Sure it has a couple things better than XP … wow, that really isn’t very hard. Want a concrete example of something that should just work properly? How about file copy – identical hardware – 30-45 minutes to copy 20 Gigs yet on my Mac, just 9 minutes. Basically 3x-5x faster. Everything on this machine is just better. I think Microsoft has become too big, trying to do everything and nothing well. They need to go back to basics, a few core – good products.

So you’re probably asking … but I have all these programs that run on Windows … quit ya crying, there is a program either identical and just compiled for the Mac or something, usually better that what you’ve used before. Get this, even MSN Messenger is better, from Microsoft … on a Mac. Go Figure. Everything I do development wise for .NET I use under VMWare Fusion which is fantastic, it actually integrates the guest XP into OS X and with Unity you can’t go wrong.

My next purchase is going to be a 8 Core G5 with 24″ Cinema display … I’m comitted to Apple hardware and software now for at least 5 years. We’ll see how the playing field looks after that. I do know this much. Every student I know or talk to or see or hear from these days has a Mac, more and more home users have Macs and when people like me start switching, you’ve got a land slide coming. I’ll convince a ton of people to switch :) Including you …

Tags:
Filed under Electronics, General, Software | No Comments »

Silverlight Tip – Initialize!

Posted on October 20th, 2008

Wow, who said learning new stuff wasn’t fun! :) Here is another little gem I found which will change your understanding of how Silverlight applications work.

I had a little application that was working great, it even had a bunch of nifty video things taking place in the code behind. I wanted to redo my layout and so cleaned out the old code, built my new layout and then something went wrong.

I just got a blank web page with no errors, compiler error or warnings – just no Silverlight control. I checked and checked and recompiled and cleaned cache and had a beer – still nothing.

So I created a new project and test xaml page and that worked fine – then I looked at the code behind and spotted the issue. The code below is added by default and IS required – I had accidentally removed it when cleaning up, must be getting old ;-)

You must have the following in your code behind page (user control class)

public Page()
{
    InitializeComponent();
}

Pretty simple but something you can delete and not notice until nothing works :) Silly me.

Tags:
Filed under Software | No Comments »

Silverlight Tip – Grid layouts

Posted on October 20th, 2008

Just a simple tip if you haven’t already tried to use these layout controls.

When you are creating content (controls) to add to the grid via a Row and Column number it would help if you knew the index is 0 (Zero) based …. that would be Column 0, Row 0 for the top left corner and not 1,1 as it should be :)

Enjoy!

Tags:
Filed under Software | No Comments »

Selecting a single LINQ2SQL Entity

Posted on October 19th, 2008

Linq2SQL is fast becoming one of my favorite frameworks for throwing quick sites together. I used to use a lot of object relational mappers but this is free and built in so .. yay :)

I’ve noticed recently a lack of understanding in trying to return a single entity from a collection. Many times when you fetch data you know there will only be 1 row but you get a collection or have to request First from an IQueryable type.

Lets say you have a Customers table. You want to fetch 1 row of type Customer.

Customer myCustomer = (from c in dataContext.Customers
                      where c.CustomerId = 1
                      select c).Single<Customer> ();           

myCustomer will now be of type Customer – nice and clean :)

 


A good all around LINQ book, not just L2SQL but Link to everything.
image

Tags:
Filed under Software | No Comments »

Silverlight and Google searches

Posted on October 15th, 2008

Well unless you’ve been living under a rock you’d know that Silverlight 2.0 has now been released. Why do you care? … Assuming the rock you were under wasn’t too big :) you’d know that the first release of Silverlight was really intended for designers and not developers although, there was technically nothing stopping you from creating anything you wanted. It was just extremely painful. Think pencil in ear.

Silverlight 2.0 brings all the goodies that we’ve come to expect as good little Microsoft developers. We have better looking user controls, layout controls and a host of 3rd party controls from companies like Telerik and ComponentArt.

And so the great move to Silverlight begins, anyone that has any half decent web application is going to want it redone in Silverlight and most new projects will want to take advantage of the hype around this technology. Please note (pretty please?) I don’t really like the word “hype” since the technology truly is amazing .. anyway with the CYA out the way I too started on a new design for some of my own products.

One of these is my Mafooku shared store system. This site, like many, requires that Google can do a good job searching for content since there are thousands of products for sale. Then it hit me. How is Google going to search my content when it’s embedded in a control … I’m sure many of you are already shouting – but just emit the same content and hide it … nah, not really practical on many sites and a waste of bandwidth.

You probably hoping there is some great solution – nah … nothing yet. I’m thinking there needs to be some interface added for search engines to find the exact content you’re displaying but I am unaware of anything as yet. I’m not saying there isn’t :) I just haven’t found it yet.

I did want to share a link to a short blog post about a transform you can add, that a search engine can use to get a form of rendered and readable content which can be searched.

Content Transform

It did also just occur to me that creating external links like

http://somelink/?id=x

need a way to be interpreted by the Silverlight application so that the correct content can be displayed … fun :) I’m sure it will be easy but definitely a new way of doing things.

It is the best of Flash, Smart clients and the web all in one. I hope you’re going to get learning too! Nobody needs another html web site :)

ps: Dear Google, please make me a Silverlight Adsense control :)

Tags: ,
Filed under General, Software | No Comments »