Missing documentation

October 19th, 2008

I’ve been reading up on the CakePHP documentation (as I have mentioned a few times before), and I’ve noticed that there are some sections missing from it. Not a whole lot, but enough that one can miss some things. I have also noticed a lot of people complaining about it, or at least commenting on it, but I’m of the belief that one shouldn’t complain about things that one can change, and since they enable people to edit the manual, I’m determined to do so once I feel secure enough in my knowledge of CakePHP.

That being said, I’m almost done reading the manual, or the bits I need anyway, so I’m going to get started on the actual development. Also, a quick side-note here.. The Containable behaviour is brilliant and quite definitely one I’m going to use for my projects.

Regarding the CakePHP manual

October 16th, 2008

I have to admit that I am very impressed with the manual for CakePHP v1.2. Back when I was using v1.1 it was lacking in a lot of areas, and my guess is that enabling users to edit it has done quite a bit, although from I understand, there are still a lot of people who use the Trac to suggest updates to the manual, rather than just adding them, but I guess that’s likely to happen.. After all, we are dealing with users here.

I’ve been reading the manual, and I’m about halfway through, reading it page-to-page, but I have a feeling I’ll be going back to some of the areas when I need them, until I get a hang of it again. I’m also thinking about going back to the CakePHP IRC channel, which is a really nice place, with friendly, helpful people.

Actually, I think that’s one of the things I like best about CakePHP, the friendly community. Of course, the structure of CakePHP and the way it works has a lot of say as well, but the community is what makes me stay there, and especially what makes me want to help out if I can. It’s also why I donated a while back, and why I’m going to donate more once I finish with this project and get paid for it. It’s one of those projects that I feel deserve donation. :)

So anyway, I will be posting more about CakePHP and my experiences with it, as I get further, but for now, I have set up my database tables, baked the application as well as models, controllers, and views for it. I’ve also added the tables needed for ACL, but I’m not entirely sure I will be using ACL for this project, so I’m skipping that bit for now. Once I actually know if I need it, or I need it for another project, I will return to it.

CakePHP major minor version

October 14th, 2008

I was discussing this with a dear friend, and fellow CakePHP enthusiast, the other day, and I felt like writing about it in my blog..

Over the past couple of years or so, CakePHP v1.2 has been developed, and while it isn’t officially ready for production use, I have to say I have found little to no problems with it, that would prevent me from using it.. So I am.. But what baffles me, as well as my friend, is the fact that this is a minor version change.. Going from v1.1 to v1.2 is supposed to be a minor version jump, and perhaps it is, but the number of changes, and the importance of these changes, are astronomical. I recently installed OpenOffice.org v3.0, after having used the v2.x range for a while, and I thought to myself, that this is actually the magnitude of changes found in that minor version update in CakePHP..

This, of course, beckons the question.. If so much goes into a minor release.. What sort of changes would then go into a major release? I’ve looked at the CakePHP Roadmap and it doesn’t even have a v2.0 yet.. There’s the v1.2, and some Bakery versions, as well as the usual Manual stuff, so I guess we won’t really know what the plans are for v2.0.. Unless of course we ask.. ;)

Change of plans.. Focus changed to Swimulator

October 12th, 2008

I know I recently posted about getting started on another project, and I’m probably still going to be working on it once in a while, but I tend to push personal projects aside whenever I have a paying assignment I can focus on (who wouldn’t, right?)

So.. What is this project? Well it’s actually one I’ve been working on for a while, but I just haven’t really disclosed anything about it, mainly because I wanted to get it to a state where I felt confident enough about it, and this step has been reached, with the conclusion of the first, initial part of the assignment. It’s a specialized J2ME stopwatch meant for swim coaches. It will register so-called splits and strokes, and will calculate various statistics based on these numbers, including the FINA score, if the event in question was a FINA event.

There were quite a few challenges in relation to this project, including handling floating-point numbers, which MIDP1 does not support, and also sending data to the web server, to store in a database.

That was the first part of it, and it works like it should, so now I have been asked to make modifications to it, expanding the application with some extra features, the main ones being to retrieve some data from the server again, as well as an auto-update feature. In addition to the application changes, and the obvious web server alterations to accommodate these changes, I have been asked to write a website without any particular design, that will handle these things, and enable people to go in and check the statistics for a particular swimmer, searching by a coach’s ID.

I’m really glad I got this assignment. Not because it pays well, because God knows it really doesn’t.. It’s a personal project for my client, and not something he’s probably going to make any money of ever (by choice, that is, because I personally think he could earn a bit from it).. Anyway, I’m side-tracking here.. The reason I’m so happy about it is, that this is a really nice project to work on, first of all, and second.. It allows me to play with CakePHP again, which I haven’t done since v1.1, and there are so many nice features in the new 1.2, that I’ve been itching, trying to come up with an excuse to get back to programming stuff with CakePHP. Here’s that chance, and I’m happy to have gotten it.

CakePHP is a really nifty implementation of MVC (Model, View, Controller), and while I know that there are quite a lot of purists out there, who will claim that it is in no way as complete an implementation as Ruby on Rails, I have to say that I tried that, and I could never really get properly used to Ruby, plus there are still more hosts that supports PHP, which makes it more plausible for smaller clients, like I usually have. The larger ones can afford dedicated servers, where they decide what to install.. My clients cannot, and they usually already have a hosting plan, which has so far always included PHP, and never RoR.

There are of course other MVC-based frameworks for PHP, but of the ones I’ve tried, I’ve found CakePHP to be the best, and not just in functionality, but also in terms of support. Whenever I’ve had a question, that I couldn’t answer by looking in the manual, the “bakery” (where people can post articles, including tutorials), and occasionally in the API documentation, I have been able to ask on the IRC channel, and get a really helpful answer. This type of support is really good, and a powerful community goes a long way, at least for me, when selecting something like a framework.

I think I will be posting updates on this project, as well as experiences with CakePHP as I work on this site, since this will be my first v1.2 project, and thus I’m bound to come across new stuff I haven’t dealt with before. I’m getting all giddy just thinking about it. Heh.

BSCurrency - Eve Edition

September 30th, 2008

So I started coding today. I haven’t really gotten very far, as I have been out most of the day, but still, I’ve decided to write the Eve VM edition of my BS Currency application.

But why did I choose this over the other projects I had in mind? I guess it was a combination of things, really. The main being that I would really like the ability to look up rates while I’m out, but it was also a need to learn to use the Eve VM properly. I’ve written a small test app in it, and that didn’t work on my HTC Touch Diamond, so I sorta just let it rest, but the people at the Eve VM forum are really helpful, so with their latest suggestions, I’m going to try and see if I can’t make a functional application for my mobile, and then afterward, I just might make a J2ME version of it as well.

Also, I just might write down and publish the steps I’m taking in programming this application, though first, I might publish a small tutorial on how to make Eve VM work in the newer versions of NetBeans.

Deciding on my next project

September 29th, 2008

I haven’t really been keeping this blog updated, which is a shame, but then again.. I wanted it to be tutorials and tips and such, and that hasn’t really worked out so well, because I never really know where to begin when writing a tutorial..

But perhaps a developer’s diary will be better anyway? I think it might be, and that’s what I’m going to try and do, as soon as I decide on a project, that is. It’s not that I’m lacking the inspiration for projects, because I actually have quite a few projects I’m thinking about these days.

My first idea is a game, actually.. One that exists in quite a lot of editions already, and creating it would mainly be for my own benefit anyway, unless someone actually found it useful.. Anyway, it’s Sudoku. It’s a simple game really, and shouldn’t take too long to program, once I get the interface created. The pros for this project are, other than the obvious satisfaction of writing a game, that I enjoy Sudoku, and I can make it the way I enjoy playing it.. But there are some cons as well, the biggest being that it’s not exactly a constructive piece of software.. It cannot be used for anything practical.

The next idea is a currency converter, like the one I’ve already made, only better and faster, and with support for more units, as I would write both a J2ME version, as well as a version for the Eve VM. This is a piece of software that I know I will eventually write, but is it something I want to focus on now? I’m not entirely sure it is..

There’s also an expense tracker that I’ve been thinking about creating. That would primarily be for Eve VM, but I might also consider making a J2ME version as well.. Again, I’m not entirely sure I want to do this right now, even if it could potentially be very useful.. Why? Because so far it’ll only be useful for me. I don’t have any readers here, I think, so it’s highly unlikely that anyone is going to find them, much less a chance that they will actually have a use for it. Of course, I could find a way to spread it around, but it would also be a learning experience, which is why I’m considering it in the first place.

The final project I’ve been considering, is a calorie counter. It would be an obvious choice, if it wasn’t for the fact that my friend is working on one too, and from what I’ve been told, it has quite a lot of potential to be good, but on the other hand, we note things down differently when we register calories, so perhaps I should try making a version for myself, just for kicks.. And just to have something to do.. I don’t know.. But at least now I have it down in writing, even if no one else is actually going to see it. So I can think it through a lot better.

My current project

June 12th, 2008

I haven’t updated this blog in a while, and that’s a mistake really, because I want to keep it occupied, but I haven’t been able to figure out what to write in my tutorial, so it will be a while away still. I want it to be useful for people who decide to read it, so it will definitely also contain various screenshots and such.

That being said, however, I have been working quite a lot on some J2ME recently, more specifically a project for a client on the Rent-A-Coder site. It is proving to be quite the interesting project indeed, even though the workload is a lot bigger than originally assessed, but luckily that just means that I’ll get paid more to do it. Not proportional to the actual increase in workload, but that’s okay. :)

The project is forcing me to seriously consider things like best practices for J2ME applications, and how to make things work properly for even the older J2ME-phones, the so-called MIDP1 phones. Coding around problems like the lack of support for floating-point numbers and math is quite a challenge, but one I quite enjoy.

There’s a lot of other things I’ve been learning about here, such as optimization techniques for J2ME, and other such useful information, so what this basically means is, that I’m going to be rewriting the BSCurrency application to support MIDP1, and to be faster and lighter on the system.. Not to mention easier to maintain because I’ve come to realize that Netbeans’ “Visual MIDlets” are best for those trying to learn how to program for J2ME, and that making the switch over to just “MIDlets”, giving you full control of the process, is a good choice for many.

One more thing.. I finally figured out how to easily compile for, and manage the code for multiple versions of the platform, thus using one bit of code for devices with MIDP2, and another for those that only has MIDP1.

Anyway, this is all I have to write for now. I will update again soon with something more interesting. I promise. :)

Basics or not?

May 9th, 2008

I’m having trouble deciding if I should start out writing tutorials that covers the basics of J2ME programming, or maybe even the basics of Java programming? Or if I should just refer readers to other tutorials on the internet that covers those basics, and go straight to writing about the more advanced stuff?

Now I know I don’t have any readers right now, but I’m kinda hoping that’ll change soon, and then maybe someone will be able to give me some feedback on this issue.

BSCurrency Beta v0.6.60

May 6th, 2008

While this is still very much a work in progress, I’ve decided to release this first beta version. It’ll be a functional version that supports several features listed in the previous post about the program.

Short guide
When you initially start it up, you’ll see a currency symbol on the screen, and the application will appear to have frozen up. It hasn’t, it’s just loading the list of currencies from an array, which seems to take forever (20+ seconds on slower phones) unless you have a powerful phone like the W960 from Sony-Ericsson.

Once it finishes loading the screen should look something like this:

There are three important fields to consider here; the first one is the amount, which represents the amount of “from” currency you’re converting into “to” currency. The other two are the “from” and “to” currencies selected with the “Sel” (or “Select”) option.

Once the currencies have been selected and the amount has been entered, you can activate the “Calc” option which will go online and fetch the rating (after asking for permission to do so), and then calculate the result before displaying it to you.

The rates will be stored for up to 24 hours after which the program will try to download the new rates, if you attempt to convert between those two rates again.

Please note that the program will use the rate for conversions both ways which can give a fractional difference in the result. Thus is you convert USD to EUR, it’ll download the rate for that. If you then convert USD to EUR, or EUR to USD within 24 hours, it’ll use that same rating, which saves bandwidth, something that’s desirable to most people.

The rest
There are other parts of the program that I haven’t explained here, like the “MemStats” page, which will show you how much memory the program is using, as well as the number of entries in the RecordStore (RS). It’ll also allow you to “Purge RS” which will delete entries older than 24 hours, though this shouldn’t as such be necessary since they don’t take up a lot of space, but running through the records can take a bit longer (mere seconds) if there’s a lot of entries in the RS.

  

“Clear RS” will remove all entries, no matter what their age is. And of course, you can use the “List RS” to see the individual rates registered in the RS as well as how old they are. From here you can also Purge or Clear, as well as delete individual entries.

Reporting back
If you find anything wrong with the program, no matter how minute it might be, please let me know about it. But please be specific, because comments such as “This sucks!” are valid opinions, but they won’t help me create a better program. I hope some of you will try it out, and let me know what you think.

Weapons of Choice

May 5th, 2008

Before I start writing tutorials on how I program certain things, I feel it’s important to tell people what sort of development environment I’ve chosen for myself.

OS - Windows XP/Vista
While this one is less important I still want to mention it, as there is one tool I use that isn’t yet available for other platforms, but that tool isn’t necessary in order to develop these things.

IDE - Netbeans 6.x
I have tried out multiple IDEs over time, and for Java development, in particular J2ME, I’ve found Netbeans to work better for me, especially starting with version 6. Now you may personally prefer another IDE, like Eclipse, which is fine by me. It just means you’ll likely need to do some manual work in converting things from how I do it in Netbeans, into how you’d do it in your preferred IDE.

Source Control - Subversion
In this day and age I find it nearly impossible to do any serious development without using Subversion. Of course it might be overkill for someone who develops alone, on just one computer, but I use a laptop as well as a desktop PC, so for me it’s definitely necessary.

Extra - Sony-Ericsson Wireless Toolkit
This one apparently only works on Windows, which sucks a bit, but it’s not strictly necessary, so you don’t have to worry about it if you cannot install it on your system.

That’s all, folks
I believe this is it for now. Shall get started on a tutorial soon. :)