The Android lawsuits – idiocrizy?

This post was started a while back when Apple sued HTC and their use of Android Mobile Operating System. Since then Windows to has sued Mobile Phone Makers that has used Android (and not Windows).

This whole patent “shit” is driving me more or less insane.

When I started this post I was reading the lawsuit from Apple on the HTC Android software and just read the breach of the 721 patent.
And seriously it really pisses me off. I am this -><- (possibly 1mm) close to apply for a pattern on how to move sprites interrupted which I did on my Commodore 64 back in the days. That breach in which Apple is putting their lawyers to work with is really that stupid.
According to the claim the 721-patent is: “the 721 patent relates generally to means of allowing computer programs running one process to access objects that are located within a different process”

If you are a developer I have a feeling that you are in deep shit at the moment. Reading the different patent breaches in the claim from the BAD Apple I am wondering if it is really safe to write object oriented programs or do procedural programming.

So many of these breaches is so stupid that I mean the judge has to be more like a kindergarten teacher telling the BAD Apple to calm down, rather than having to be a judge.

I really, really, really, REALLY hope that BAD Apple is loosing this lawsuit. Not because I am an Android phone owner, but because I am a developer, and I don’t want to find a new job just because an idiot from California who hasn’t written a program in his life is sitting on a few stupid patents. And I really, REALLY hope it does something really, REALLY bad to their reputation.

Now we’ve also gotten the BAD Oracle to the table as well. They are suing Google for developing a branch/fork (whatever) of Java in order to come up with the Android Operating System. Oracle has bought all rights to Java from Sun and are now doing what they can to get some of their investments back.
I read somewhere that some of the patents that Sun (and their developers) have registered related to Java are of the sort ‘I wonder if we could pattent this’, and so undermining the whole IT-patent (industry?).

Again, I hope that all these lawsuits related to Android/Java/Linux comes to an end. Some say that it is there to protect their intelligent property (now, what’s intelligent about a file system that does not allow you to copy/move a file larger than 4 gb (as in Fat32)) and their investment in developing their fantastic system…
What these last lawsuits has shown is that the pattents is not there to protect intelligent property, but the (already) wealthy wallets of large IT corporations (like the BAD Oracle, the BAD Apple and the BAD Microsoft).

Getting Real from 37 signals

If there is one book that you shall buy in 2010, it is the Getting Real book from 37 signals.
It’s – to say the least – inspiring. And not only if you develop websites. Try and think outside the box, and you can most likely learn a thing or two to get any project (software, hardware, design, DIY, car-fixing – you name it) of the ground!
Buy it!
Now!

Being a standard browser

I’d like to stir up some controversy with this post.
I would like the W3C to say that in order for a browser to call it self a standard it needs to be available for all three OS platform.
That means:
Safari must be developed to work under Linux.
Internet Explorer must be developed to work under Linux.
This means that only Opera, Firefox and Chrome currently are standard browsers.

Also:
A browser shall not be dependent or locked into the operating system. It shall be a software standing on its own.
Just my $0.05

Standards matter

I am not that great fan of Apple, but sometimes they have an idea of doing things correctly (like when they built the iPod). It’s when they start getting proprietary that everything hits the fan.
This is what they’ve said recently:

Standards matter. Before standards, every browser had its own play book. With standards, every browser’s on the same page. Great for developers, standards let them create sites that work on all browsers out of the box. Great for the browsing public, they ensure that you enjoy a great experience on every site you visit. And these technologies are free for anyone to use.

I am currently spending some time checking out HTML5 and CSS3. And from what I can see the browser world is now just as unsynchronized as it was in the first browser war.
My inspiration for checking the new features in HTML5 and CSS3 is the fact that so many people are saying that with HTML5 (and CSS3) Flash is dead.

Well.

The good thing about Flash is that it runs on all platforms, though really slow on iPads and iPhones – but that’s another issue. It is browser independent, which makes it look the same in all browsers. That’s what makes Flash a graphic designers choice instead of HTML5/CSS3.
An example I can use is this:
Let’s say there is a website wanting to show information about the players on the teams playing in the World Cup in South Africa (in 2010). The designer want some animation like flipping cards, sliding in/sliding out and so on. Let’s say the company creating this application wants to use HTML5. Well, he can’t:

  1. Internet Explorer (from 6 up to current build of IE) does not understand all the 3d-stuff in CSS3
  2. Firefox 3.6 (and most likely 3.7) does not understand all the 3d-stuff in CSS3
  3. Opera 10.5 (and most likely 10.6) does not understand all the 3d-stuff in CSS3
  4. Chrome 5 does not understand all the 3d-stuff in CSS3

So there is only Safari (with about 5% of the market) that understands the 3d-stuff in CSS3. Which is not so weird. Apple was one of the promoters of 3D-transformations in CSS.
Also: In Flash there is only one build. There are no specific style sheet for IE(6-X), Firefox, Webkit/Chrome/Safari or Opera. There are no need for [IF IE] in the HTML/CSS-code.

I do hope that the developers and the designers who works with CSS3 and HTML5 at Apple will become advocates of standards and that they will fight for this in their forums. I experienced the lasts browser war (which Microsoft claims it won… you don’t win wars, ok! and… look where it left us: With IE6 still being widely used in 2010!!!). I don’t want another one in 2010.

And I think there is only one way we can achieve a compliant standard that all browse vendors will follow: Start thinking of your users and the web developers. Stop creating HTML/CSS rendering engines. Standardize on one or two (Webkit and Mozilla, with the latter also being the one to disappear).
Sorry Microsoft. When you are nine years behind… although you did invent the XMLhttpRequest, most important part of AJAX, why not start contributing to an open source project instead?
And sorry Opera. Your market share is way to small, and I think you are better off using one of the other engines and start contributing to those instead. And: Three is one to many (or three is a crowd as the saying goes).

So what shall the vendors do when they cannot focus on their own engine?

  • Contribute to the two standard engines (webkit/mozilla)
  • Focus on making the best looking, fastest or functional browser out there.

Computing HTML5

I’ve just recently tested the HTML5-site at Apple, and one at Microsoft. Except that a lot of the example HTML5-pages that are on those websites are amazing, I also noticed one more thing:
Quite a lot of the examples needs computers with lots of computing power.
I experienced this by noticing that my computer, a Dell D420 laptop with 1.5 gb ram, was really slowing down.
If this is the future of web design or web applications I am worried.
It is of course great to see all the possibilities HTML5 gives us who works with web development.
It’s just that I don’t like the expenses.

Proposal: Windows-tag in HTML5

Suggestion: windows tag

Usage: If you want to create a modal form/window, a “popup” or a lightbox you have to use Javascript. I am suggesting this tag to remove the javascript need to create such a standard feature on the web. This technique uses iframe and css to create the look.

Implementation: I am suggesting that can use most of the same attributes as iframe/frame.
Adding the following attributes:

  • modal
    boolean, if the window shall be modal or not
  • movable
    boolean, true if the window shall be moveable, false if not
  • fade-background-color
    Color, set the background color being used when window opens. Default is dark gray…
  • background-opacity
    integer, set the transparency for the background

I am not part of the W3 HTML 5 working group and I have not posted this suggestion to this group. I am just suggesting it here as something I wish to see in HTML 5.

PHP-Tip: Commenting your code

This really isn’t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there.
This post is all about commenting. Some do it, some don’t. I tend to do it. Sometimes I even comment to much. But that’s sometimes better than not doing it at all.
Why should you comment your code:

  1. Because sometime in the future you might have to go back to the code and fix it. It’s always nice to know what the initial idea was. And with years and years of programming, you now know a better way to do it. If you don’t have the comment, you have to analyze your own code much more thoroughly.
  2. If someone else is going to work with your code, it is always nice for them to read your comments. It makes it easier for them to understand the code and to get into it.
  3. It can be fun looking at the comments you’ve written. I recently looked over some code I did back in 2005(ish) and here I write: “This part is done in an amazingly stupid way” or what about: “I must do this to keep the string value (line break and some code)Really…????“.
    I posted this on twitter and I got an answer from Frank W. Zammetti (fzammetti): “The person that wrote this is a grade A a**hole… oh wait, it was me!” I wrote that one once.
    I just couldn’t stop laughing.

This is my style of commenting (example in PHP/C/C++/C#-style)
My first line in the file is always the name of the file. This is a habit I’ve grown to use. It is smart when you are editing code in e.g. VI where you not necessary get the name of the file in the titlebar.

// name-of-file.php

Next comes a general description of what the code in the file shall do:

/**
* This file is used to create and edit blog posts
*

Eclipse, Komodo-IDE and NetBeans (And probably other IDEs) supports @todo in the comment. By adding this "tag" you add tasks to your tasks list.
I tend to add tasks in the beginning of the file.

* @todo: This file need some work.
* @todo: Fix the code related to creating blog posts

In the same area I also write out bugs that I have fixed, or tasks that I have completed:

* FIXES:
* 01.01.2010: Fixed a bug related to updating a blogpost
* 17.05.2010: Translated all of the comments from Norwegian to English
*/

(note/suggestion) I wouldn't mind if the IDEs could have a @fixed element that I could add to the end of the line so that the IDE could mark out the task as completed.

Then in the code I can comment like this (note that PHP-example is just as an example here):

// Fixing the string so that it is ready for SQL-input
$string = mysql_real_escape_string($string);

// Creating a string for a dropdown-menu.
foreach ($this as $that) {
$string .= $that;
}

I also sometimes use comments to clear my head or to get a clear overview of the task at hand. This is especially important when you feel that the task is complicated.
An example could be:

/**
* In this section we shall create the tree-view.
* We must remember that all nodes starting with W shall be at the top
* And that we shall mark posts with pictures with a (p) or a small icon
* Also remember that no lines can be longer than 25 characters. Check the left syntax in mySQL...
*/

This is also good practice when you sometimes do not return to the code in a couple of days. An example could be:

/**
* continue here on Monday.
* The idea behind the following section is ... .... .. . . ..
*/

Hope this post regarding commenting your code is of any help for you. If you have any great examples of self criticism in your code, please do post them as comments... (No pun intended)

PHP-tip: How to fix problems with file permissions

Have you tried to create or read a file with fopen, file_get_content or file_put_content and only getting permission denied.
A reason for this error message can be that the file you are about to read/write already exists and with your account as owner.
A quick, and safe, fix is to change the owner and group of the file to the same owner/group as the apache-server is running as.
Example:
Let’s say you are about to update index.htm. This file was uploaded by you to the ftp-server, and so the file is owned by foo (you) which is a member of the group bar. The Apache-server how ever is being run by user:group apache. the user:group apache does not have permission to change anything to this file.
So what you do is:

  • Connect to the web server with ssh (shell account)
  • Change ownership to the file to apache by running chmod apache:apache index.htm

Now you should be able to change the content of the file with PHP.
I have seen suggestions on websites where they say that you should change the mode to 775 or even worse, 777. This is a security breach and so you should not do so.
Hope this helps someone out

Suggested links

Virtual Ubuntu

Because of an introduction to laptop at work, I have to bring my laptop back and forth to work. Because this isn’t my laptop I feel that I cannot run Ubuntu Linux as the main OS – although I wish I could. Instead I have to rely heavily on windows 7 and VirtualBox.
As of writing this I have already had two crashes. This could be caused by the fact that the Ubuntu version I am running is quite new, and so the VirtualBox version I am running does not support it fully.
During this process I have tried to find out if it was possible to make the physical Dell D420-laptop virtual using virtualization tools – also known as P2V. VMWare has such a tool, but when you only have VMWare Server installed, making a Linux OS virtual is not possible.
What I ended up doing was to create a Virtual partition. Then install Ubuntu 10.04 (LTS). Then I started moving files and folders from the old laptop to the new one.
I used SCP in this process.
The good thing about doing this by hand is that you have total control over the process. The “drawback” is that it takes time.
I hope that the guys (and girls) at Virtualbox (Oracle) will start developing a P2V with Linux-support for VirtualBox. It would be a nice addition to what seems to be a great product.

No more c# on iPhone

Apple does not stop to surprise me. Luckily I haven’t started writing iPhone/iPad applications, and I am not sure if I want to either. As a Linux / windows user as I see it, I cannot create an application in my development environment. What do I have to do?

  1. Buy a Macintosh ($999 for MacBook)
  2. Get XCode
  3. Register as a iPhone developer ($99 annually

So it’ll only cost me $1100 to start writing applications for iPhone/iPad. That’s quite a lot of applications to sell…

With monotouch you have to pay $399, so that’s not cheap either. And I believe this might be the reason why Mr. Steve “I don’t want to share any money related to Apple products with anyone. And I want total control cos I am a control freak!” Jobs has changed the rules for developing applications for iPhone.

Daring Fireball on why Apple changed Section 331.

Compared to Android:

  1. I don’t have to buy a new computer since I already have one ($0)
  2. I can use Eclipse($0) (which is cross platform, so I can develop in both Windows and Linux environment)
    Or I can use MonoDroid that will ship in August to develop in C#
  3. I have to register as an Android developer ($25)

That’s more than $1000 difference. And even if I had a Mac, the difference is $74.

So, for which Touch phone platform are you going to develop for?