Developing in Linux

A few days ago I decided to program a little application that my daugther (7 years old) could use to practice math.
My daughter is running Ubuntu Linux 12.04 (currently) with Cinnamon.

And because she is a graphic used youngster, I had to create a GUI application.

In my work I develop in C# and Visual Studio, and so a natural choice is Mono. But I wanted to check out other options.
Ubuntu has created something they call Quickly which is a package that will help you create applications in Python.
I don’t know Python, but I was willing to do this little application in any language as long as the IDE was good enough.
When I read in an IRC chat log (getting started with Quickly) that Quickly was shell based, I dropped that option.
And so I thought: Why not go for Java?
We use some Java at work, but I am not.
I have Eclipse installed (using that for PHP) and so I thought I could just add the perspective for Java and maybe add a little something to get GUI-design up and running and I would be good to go.
Well, it wasn’t that easy. And so I jumped the Java-option.

Well, so Mono was the last option. And since I then could use Mono Develop I was good to go after starting up the application. And about 30 minutes later the Math Game (which I called it) was ready.

I believe that there is a lesson for someone out there to be learned from my exprience:
If you want to have developers to use your program to create Linux Application – have an IDE that makes it easy and fast for them to get up and running.
It should not have to be like this:

  • Find an IDE that will make it possible to write the code
  • Decide which GUI-design-plugin you should use
  • Install GUI-design plugin for this IDE – if it exists for your IDE-version that is – or install a PPA or something first…
  • Start developing … (hopefully)

Just so it is noted: Mono Develop is not perfect either. It is a – more or less – copy of Visual Studio, but it differs (of course). One big difference is that when you add a new Form in VS you get the form design mode. In Mono Develop you get the code. I would suggest that is changed, and so you can configure it to show code first in preferences.

An upgrade from 10.04 to 12.04.1 experience

This last week I did the upgrade from 10.04 to 12.04.1. When running LTS the preferred upgrade-path is to upgrade when there is a .1 version ready.

So I waited until late August before I could upgrade. And when I did, I did run into some problems. It shows that doing upgrade is a bit different than doing a clean install.

Which problems did I hit?

Because I had installed a ppa for the xorg (xorg-edge or something), I had to uninstall this before the upgrade even could get started. And when I had done that and the upgrade was done, I had to totally remove the rest of the packages from this ppa – and the ppa. Otherwise I was running unity 2d – and also filled up my .xsession-errors file.

When I had finally found that out, Ubuntu 12.04.1 started working like it should.

I ran the Unity version of 12.04 for a week. I hit a few bugs (and I believe I have filed reports on them) and sometimes collisions.One such collision are keyboard shortcuts and Compiz plugins/features.

One bug is that Eclipse (and other Java programs) does not show up in the window-tab-switcher (unity switcher). Solution to this is to click super (windows-key) + w and then you see all running programs (I had 3 versions of eclipse running then…).

After these experiences I decided that Unity was not mature enough, and decided to try Gnome 3 instead. So I am currently doing that now. Because it is G3 you don’t have the effects of Compiz, but I believe I can live without them.

At the moment the system seems stable and I am happy with my upgrade. I’ll return to the blog when I have experienced G3 a bit.

UPDATED: Upgrade Ubuntu 64-bit from 10.04 to 12.04

I am running Ubuntu 10.04 64-bit version and since 12.04 is out, I am considering upgrading to the latest Long Time Support version.
But since this is my production computer, I don’t want to end up with a brick, or a system that is unstable. If you read the Ubuntu Wiki it says the following:

It is generally recommended that users of Ubuntu 10.04 LTS wait until the first point release, due in July, before upgrading.

So I will follow this recommendation, but I will use the time from now and until July wisely.

This is what I will do:

  • I will test the 12.04 64-bit version in a virtual environment.
    Update: Currently testing out the 32-bit version in Virtualbox. Already experienced the upgrade/update bug when you are to update the software packages. (I will not report this as it has already been reported by numerous of people already)
    I experienced that Eclipse and Google Chrome was installed without the  icon in the launcher, and the only way to get icons in is trough shell or by creating a desktop-file. I don’t like this approach. It should have been a menu choice that said something like ‘Add icon’ (especially if there was no icon present) or ‘Change icon’ (if there were an icon present). (I will report this as a feature request)
    After a reboot both programs had their icons present in the unity launcher. So I might report this as a bug.. It should not be like that.
    I have decided to give Unity a chance just to see how well it works. I must say that I am missing the more or less standard way of doing things with a menu where you can choose which program to start, but I am trying to convince myself that the unity/gnome3 way is the new way of doing this…
    • Testing programs that I am using often.
      One such program is Inkscape. I have found that the pallette view now is not placed at the bottom, and that it also is made so small that it is useless. You have to drag it out and have it not at the bottom but on the right hand side of the screen. Not optional.
      I have installed Gimp 2.8 from the PPA and it looks promising.
      Eclipse was quite easy to install and (as stated above) the icon came in place after a while…
  • I will test the Live-CD. (and report any bugs)
  • I will run and tune backing up the system. Goal is to find out what to backup and what not to backup.
  • Find and delete duplicates on my system.
  • Find and delete files that are no longer in use – or move the file to some remote system.
  • Find and delete programs that are no longer in use.
  • Document the current laptop and what I need to do when upgrading to 12.04.
I will also do a clean install rather than doing an upgrade. This because I have experienced in the past that the system does not work as expected after an upgrade. This could be because I am running home as a separate partition…
Some experiences so far:
  • Update manager does not notify me of a new LTS release.
    FIXED: You have to run update-manager -d in order to get this notification.
  • When running the 12.04 64-bit CD no menu comes up. Could be an error with the CD…

I’d like to hear how you are planning your upgrade from 10.04 to 12.04.

REST api

I’m currently doing some development on a mobile website that gets it’s data from an API. After going back and forth on whether to use REST or SOAP I ended, after talking to a few people, with REST.
Setting up the most of the system was pretty simple. There are quite a few tutorials out there on how to set one up, so just follow one of those for the language you are using.
Security is a different matter. My API will not have any possibilities to do updates or deletes, but still, security is something that you always must consider when doing web development.
As I have only scratched the surface when it comes to REST API and security, I will start by listing a few webpages that I have found that discusses security issues with APIs.
If you have suggestions on how to secure a REST API, please do not hesitate to use the comment area.

Some suggestions I have heard and are considering

Using self signed certificates – This can be an idea for the application that I am developing for as the mobile website will mostly be accessible by users from defined customers. But there could be other users as well…

OAuth – It’s being used by Twitter and other popular websites, so it must be something doing something good. Twitter uses OAuth in combination with SSL. OAuth is: “An open protocol to allow secure API authorization  in a simple and standard method from desktop and web applications.” So it seems to be a good choice to use the technology to secure the API.

Question is: Can I use OAuth when a client want to log in to the service? hm…

 

Links:

http://features.techworld.com/security/3213655/the-security-nightmare-of-rest-web-services/

http://1raindrop.typepad.com/1_raindrop/2006/12/rest_security_o.html

http://blog.apigee.com/detail/why_rest_security_actually_does_exist/

http://oauth.net/

http://tools.ietf.org/html/rfc5849 (OAuth 1.0 documentation)

http://oauth.net/code/ (how to use OAuth with different programming languages)

What Linux need is software

In about a month or so Canonical will come out with a new version of Ubuntu Linux – the 12.04. This is a Long Term Support version and so I guess I have to upgrade from 10.04.

With this release Canonical is running an Ad campaign to make some go from Windows to Ubuntu Linux. Bold move, but someone has to be the first.

The Linux Desktop has come a long way. More or less gone are the days when you had to compile and build the drivers for which ever printer you had bought. Now you use a Software Center to install new software (In Ubuntu Linux both open and closed (commercial) source).

I feel it is time that developers now focus on Software. And not the type of software that makes it possible for you to create new software. No. Now is the time to find out what type of Software is needed on the Linux Platform. And I don’t mind if it is closed source and commercial as long as it is software for the Linux Platform. It would actually be a good thing if the software could be found in ‘name of your favorite electronics / gadget store here’ among other commercial software. This would make people start thinking: That software looked good, maybe I should consider a computer with Linux next time?

So what is needed?

Some would say that some work has to be done in the Games department. So those of you that are Games developers, start developing.

Others would say that we need applications for the enterprise. I could not agree more. I can see a demand for Invoice applications. The good thing with Invoice programs is that they can work all over the world. The rules for generating an invoice is pretty uniformed around the globe. And if it isn’t, try to follow the rules in the country with the tough rules for generating invoices.

With Open office and Libre office we are covered in the Office suites – except that both software could need some more work being done to them.

Graphics applications: Scribus 1.4 is out, but the interface needs a face lift – seriously. Maybe they should team up with the Inkscape people – and so we’ll have a graphics powerhouse on the Linux side just as we have Adobe on the commercial Windows and Apple side. For Photos there is still a great need for something better (looking) and more intuitive than Gimp. Gimp is OK, but it is not Photoshop. And the development for Pixel has, as far as I can see, stopped completely.
Ideally we should have access to Adobe on Linux (and not by using WINE or similar programs).

IDEs: We have plenty of those. Don’t make a new one. My favorite is Mono as it is very close to Visual Studio that I use in my day-job. I’ve looked quickly on QT, but I am not a C++ developer (for a while). There should be similar IDEs for other languages as well. Those type of software makes it easier to create the kind of software that the mainstream would like.

So, if you are a developer follow these steps:

1) Visit some companies in your neighborhood.

2) Find out what type of software they are in need of – not specially for them, but the most general ones (accounting, invoicing and so on)

3) See if there is one that you really would like to create.

3b) Team up with some GUI-designers

4) Start coding!

best of luck

Maybe 2012 could be the year when applications for Linux exploded!

Patents wide open

With this patent Apple managed to stop import of HTC phones in the US:

“A system and method causes a computer to detect and perform actions on structures identified in computer data. The system provides an analyzer server, an application program interface, a user interface and an action processor. The analyzer server receives from an application running concurrently data having recognizable structures, uses a pattern analysis unit, such as a parser or fast string search function, to detect structures in the data, and links relevant actions to the detected structures. The application program interface communicates with the application running concurrently, and transmits relevant information to the user interface. Thus, the user interface can present and enable selection of the detected structures, and upon selection of a detected structure, present the linked candidate actions. Upon selection of an action, the action processor performs the action on the detected structure.”

Read the patent here: http://www.google.com/patents/US5946647?printsec=abstract&source=gbs_overview_r&cad=0#v=onepage&q&f=false

And when you start looking at the flow-plans, you can begin to understand that by pure luck Apple was able to patent this. I could have to, because I am doing more or less the same thing when I am getting data from a provider, checking against a database and updating it if there are differences.

But it is about time that someone stood up and talked some sense to the patent bureau in the US, and also to the judges. These are common algorithms, and the patents are written so broad that you can more or less do what you want with the patent. What Apple has patented is just something that even script kids have been doing since the beginning of computer age.

As Apple says: Competition is healthy, but our competitors should create their own original technology, not steal ours. (translated from Norwegian).

To Apple: Stop reinventing the wheel and patenting it. Stop stealing from the past, and from great programmers before you. Stop hindering inventions and healthy competition.

 

 

Open source vs. commercial

I’m starting this blog-post with a quote from the ‘about’ text from the website Saxonica.

Saxonica is the company created by Michael Kay, developer of the Saxon product, to bring the technology to the commercial market. The company was created to ensure continued investment in moving the Saxon technology forwards, and remove the risk associated with using open-source software that has no support infrastructure. Over the six years Saxonica has been operating, this strategy has proved successful in providing quality products and services to both the commercial and open source user communities.

Why am I quoting this website.

Well because it confirmes my feelings that there should be a company wanting to generate money from – hopefully – their own open source projects.

This because, as this text says: “The company was created to ensure continued investment in moving the Saxon technology forwards, and remove the risk associated with using open-source software that has no support infrastructure. ”

Saxonica, who is responsible for XSLT and other XML technologies, undertakes the development of the Saxon XSLT, XQuery, and XML Schema processors. These are now available in Enterprise Editions, Professional Editions and Home Editions – the latter is free though with restrictions, while the others costs to use.

You could say that Saxonica is not the only one using the business model. Zend, the company that developed the Zend Engine to the PHP Scripting Language, also produces commercial products related to PHP. Examples are Zend Studio (which is based on Eclipse) and the Zend Server.
Because of the commercial business plan Zend is interested in developing PHP and show professional and enterprise usage of PHP.

These business models are described in detail in this report from SAP Research: http://dirkriehle.com/publications/2009-2/the-commercial-open-source-business-model/

My gut feeling is that the Saxonica and other similar Commercial Open Source Business Model is the right path, and I think that more and more OSS providers/organizations/… should follow.

 

Patent and patent troll registry

It is about time we start fighting the patent trolls. One way to do this is to greate a registry or a wiki to help out developers and companies to avoid breaching the patent and/or getting into patent disputes.

This is of great importance when your application has to deal with breaching a patent that is of so generic structure that you have to breach it – almost – no matter what you do.

Such a registry could (should?) be a tool also for lawyers and judges when dealing with such cases.

Again: It is time to fight these trolls back. Get them into the sunlight and turn them into stones. Are you up for a troll fight?

Methods and Apparatus for Information Storage and Retrieval Using a Dallas 279664v1 Hashing Technique with External Chaining and On-the-Fly Removal of Expired Data

Yes, the title is long – and it is also the name of the United States Patent
No. 5,893,120.
This is the patent that Bedrock Computer Technologies LLC claims that a total of 10 companies is infringing. You can read the filing here.
So what does this patent say?

“A method and apparatus for performing storage and retrieval in an information storage system is disclosed that uses the hashing technique with the external chaining method for collision resolution. In order to prevent performance deterioration due to the presence of automatically expiring data items, a garbage collection technique is used that removes all expired records stored in the system in the external chain targeted by a probe into the data storage system. More particularly, each insertion, retrieval, or deletion of a record is an occasion to search an entire linked-list chain of records for expired items and then remove them. Because an expired data item will not remain in the system long term if the system is frequently probed, it is useful for large information storage systems that are heavily used, require the fast access provided by hashing, and cannot be taken off-line for removal of expired data.”

It was registered by Richard Michael Nemes of Brooklyn, New York on January 2, 1997.

When I start reading the article, I am noticing that it is referencing, among others, DE. Knuth – The Art of Computer Programming. The “inventor” also references Knuth later in the application.

I am therefor questioning: Is this really an invention by Richard Michael Nemes?

What he is doing is using the work and knowledge of other persons and creating his own variation of it – probably enhancing it and probably also making it better. Searching (again, use your favorite search engine) for Richard Michael Nemes and you will find some rather interesting “inventions”.

  • Methods and systems for electronic transactionsIn the preferred computer system, the user is provided with a separate Internet-accessible entity referred to here as the “personal page.” A personal page, preferably, includes memory for storing information related to the user. For example, on his/her personal page the user indicates what he/she wishes to purchase, possibly along with other criteria associated with the purchase, such as, for example, a time that the purchase should take The user is provided with the ability to create personalized bidding rules that vendors that offer goods and services must respect. Vendors have the ability to specify similar criteria, which describe the goods and/or services they offer. Vendors can indicate, for example, the prices of their goods, times and places that their services are available, etc. Preferably, these specifications, called “vendor scripts,” are embodied in active software/data entities (agents) that traverse sites on the Internet visiting sites hosting users’ personal pages. Thus, preferably, vendor software/data agents (comprising vendor scripts) are the mobile, active elements in the system and purchasing requirements are stationary and more passive in comparison.
  • Electronic Transactions Based on Deal Forms In the preferred computer system, the user is provided with a separate Internet-accessible entity referred to here as the “personal page.” A personal page, preferably, includes memory for storing information related to the user. For example, on his/her personal page the user indicates what he/she wishes to purchase, possibly along with other criteria associated with the purchase, such as, for example, a time that the purchase should take The user is provided with the ability to create personalized bidding rules that vendors that offer goods and services must respect. Vendors have the ability to specify similar criteria, which describe the goods and/or services they offer. Vendors can indicate, for example, the prices of their goods, times and places that their services are available, etc. Preferably, these specifications, called “vendor scripts,” are embodied in active software/data entities (agents) that traverse sites on the Internet visiting sites hosting users’ personal pages. Thus, preferably, vendor software/data agents (comprising vendor scripts) are the mobile, active elements in the system and purchasing requirements are stationary and more passive in comparison.

But this would mean that I could take any Computer book that I own, read up on what the author is teaching me – enhancing and probably making the code (algorythm) better, and then file for a patent.

Honestly, this does not make sense. But I am just a humble Norwegian that happens to be a programmer. I am no lawyer and so I have no interest in creating a patent just to create one and then claim that some company has used it – even though I could make a sh*tload of money from it.

Again, I can use my typical example from back in the Commodore 64 days. In those days (mid 1980s) I created some assembly code (yes, I programmed in 6502 assembly) that moved some sprites back and forth on the screen. All done while I could write text on the screen. It used raster and interrupt techniques.

So I could create a stupid patent called: “Methods and apparatus for moving a graphical object on a computer screen without interruption of the operating system.”

Another issue related to this patent lawsuit is the company that has filed it: Bedrock Computer Technologies LLC. Do a search (use your favorite search engine (probably patent secured)) and you’ll find that they really don’t do much technology work, except for reading up on patents (buying some as well) and filing suits against large companies.

The worst thing in this lawsuit is that Bedrock also claimed that the small Web consulting company CitiWare Technology Solutions. Some websites claimes that the only reason why Bedrock added CitiWare to the list of infringers is that this company was the only one based in Texas, which was where Bedrock filed the lawsuit. Nice move.

Patents on such basic algorythms and/or techniques in programming must be put to an end.

Doing a search for David Garrod who is the man behind the Bedrock company on freshpatents.com I came over quite a few interesting results, one of which is called Distributed computing which is described as this:

The invention provides an off-the-shelf product solution to target the specific needs of commercial users with naturally parallel applications. A top-level, public API provides a simple “compute server” or “task farm” model that dramatically accelerates integration and deployment. By providing built-in, turnkey support for enterprise features like fault-tolerant scheduling, fail-over, load balancing, and remote, central administration, the invention eliminates the need for customized middleware and yields enormous, on-going savings in maintenance and administrative overhead.

This “invention” is so general that it cannot even be called a patent. It is more a specification for a job where you want to do distributed computing…

The abstract is even worse: “A distributed computing system manages execution of jobs and their associated tasks. Multiple scheduling strategies respect job priority preferences. A graphical user interface allows viewing of job status information and on-the-fly modification of job priorities

Can we now put an end to this patent bulls*it? Please?

Links to organizations who’s trying to put patent trolls out of practice:

Linux Defenders: http://www.linuxdefenders.org
Open Invention Network: http://openinventionnetwork.com/

One last note: Does this lawyer know how to actually use the patent. Can he see in code where this patent has been used?

PHP going down?

Visited the php.net website for other reasons than just to fresh up on a function that I was not sure how to use (PHP has the best documentation out there – period. Yes. It. Is. Even. Better. Than. The. C#. Or. VB. Documentation. At. Microsoft. Period!)

How ever, looking at the statistics that you can watch if you click on the links on This page: http://www.php.net/usage.php
You will notice that the usage of PHP is going down. C# is on the rise and so are other programming languages like Python.

I can understand why it is faster to program websites in C# (or .Net), and I do think that PHP should move in that direction. How ever.

I just had an enlightening moment with PHP and Smarty. It is so freakin’ fast to create forms and templates with Smarty that coding websites is more fun.

Earlier it’s been code this, then that and then populate that string. With Smarty you just create the template, look at it and decide that – yes this is what I want my page to look like – THEN – start populating the different elements on the page.
FAN-Tastic!
Still there are things that is easier in a real object oriented language like – for instance – C#. Whereas you’d do this for instance:
string strTest = “This is a text where I would like to replace goosebumps with cheeze!”;
So you do this: strTest.Replace(“goosebumps”, “cheeze”);
Instead of:
$strTemp = “Goosebumps shall be replaced”;
$strNew = str_replace(“Goosebumps”, “cheeze”, $strTemp);

But anyway. This is not a blogpost where I bash on PHP, I am just saying that it seems like the interest of PHP is declining. Maybe the community should do something about it.

Make it easier and more joy able to code websites.