359 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
A Tool I Made To Export From Notes to SQL (ETL) | Blog
Tue, Jan 14th 2014 251
The Perfect Desk Quest - 2013 Update (Part 2) | Blog
Wed, Dec 11th 2013 130
Recovering a Laptop After Forgetting Windows and BIOS Password | Blog
Wed, Dec 4th 2013 157
Rockall Design Now in its 11th Year! | Blog
Fri, Nov 1st 2013 132
Using Font Awesome Icons in Fireworks | Blog
Mon, Oct 14th 2013 209
Document Action Logs, Including "Limitless" User Comments | Blog
Wed, Sep 25th 2013 455
Bootstrap Advanced Date Picker Plugin | Blog
Fri, Sep 6th 2013 322
Top 10
Document Action Logs, Including "Limitless" User Comments | Blog
Wed, Sep 25th 2013 455
The Hidden Cost of Holidays | Blog
Thu, Jun 14th 2012 412
Bootstrap Advanced Date Picker Plugin | Blog
Fri, Sep 6th 2013 322
Money Saving Expert
Wed, Jun 15th 2011 281
A Tool I Made To Export From Notes to SQL (ETL) | Blog
Tue, Jan 14th 2014 251
Using Font Awesome Icons in Fireworks | Blog
Mon, Oct 14th 2013 209
Web Services: Using Complex Types | Blog
Mon, Apr 16th 2012 171
How To Remove Voice Command From Galaxy S2 Without Rooting | Blog
Tue, Jul 10th 2012 167
Solution to Java Applet Puzzle | Blog
Fri, May 4th 2012 164
Recovering a Laptop After Forgetting Windows and BIOS Password | Blog
Wed, Dec 4th 2013 157


My Coming of Age (as a Developer)
   

The other week I posted on Google+ about the warm fuzzy feeling I'd gotten when writing this line of code:

public class Poster extends Entry implements IEntry

Why so? Because all the classes involved were of my own making. Finally things had started to come clear to me; I understood the importance of class inheritance and the role of implementable classes.

While I'd kind of understood this for a while it wasn't until it all clicked and I actually did it for myself that I could truly say it really made complete sense.

The Poster class the code refers to lives inside a Flex-based app I've been working on for a while now that lets school kids create artwork from photos they've taken by adding their own words to them. The app is the closest I've come to making actual software. 

As well as posters they can create a Calendar, which is also an Entry-based class. Posters and Calendars both consist of one or many pages. For this there's a Page class, which has a property that defines what size of paper it's based on. Ultimately the kids will print out their entries, so the paper size is important, so as to get the proportion of width/height right.

In order to define the paper sizes available I created another class called PaperSize, which you can see below (the code is ActionScript 3, but is a lot like Java/most other languages).

package 
{
    public final class PaperSize{
        
        public static const A4:PaperSize = new PaperSize(595, 842, "A4", "A4 (International)");
        public static const Letter:PaperSize = new PaperSize(651, 842, "Letter", "Letter (US)");
        
        public var width:int;
        public var height:int;
        public var name:String;
        public var description:String;
        
        public function PaperSize(width:int, height:int, name:String, description:String){
            this.width = width;
            this.height = height;
            this.name = name;
            this.description = description;
        }
        
        public static function AllSizes():ArrayCollection{
            return new ArrayCollection([
                PaperSize.Letter,
                PaperSize.A4
            ]);
        }
        
        public static function get Default():PaperSize{
            return PaperSize.Letter;
        }
        
        public static function findByName(name:String):PaperSize{
            for each(var size:PaperSize in AllSizes()){
                if (size.name.toLowerCase()==name.toLowerCase()){
                    return size;
                }
            }
            return Default;
        }
    }
}

Again, the fact that I wrote the above code un-aided and without any kind of copy-pasting off the internets was nothing short of a revelation for me. Once again I got that nice feeling, knowing that I'd written the class all on my ownsome.

I'm not saying the above PaperSize class is perfect, but it works well for me and does everything I need it to and in a way classes were meant to (at least as I understand it).

I'm sure you guys can offer suggestions to improve it (and I welcome them) but my point here is that I finally understand how and when to use static classes. Finally, it's all coming together.

It's not only writing the classes that give me a nice feeling. I get the feeling over and over again each time I refer to my classes and type-ahead popups, suggesting properties that I made appear there, as below:

image

With the class I can do things like:

page.height = PaperSize.A4.height;

or

paperSizePicker.dataProvider = PaperSize.AllSizes();
paperSizePicker.labelField = "description";

or

entry.paperSize = PaperSize.findByName(xml.@size);

The findByName() method comes in handy as each Entry gets stored as XML, so the students can come back and re-load/edit them at a later date. The XML holds the name of the paper size used and I can reload it when needed.

My point? Not sure really. As ever, just sharing my adventures in coding. Also wanted to share my excitement that - after 15 years as a "developer" - I can finally call myself a programmer without feeling too much like a fraudster.

What about you guys? Am I the only saddo who gets a kick out of seeing their own classes' properties and methods appear in code type-aheads when programming?

Click here to post a response



---------------------
http://www.codestore.net/store.nsf/unid/BLOG-20111005-0350
Oct 05, 2011
18 hits



Recent Blog Posts
251


A Tool I Made To Export From Notes to SQL (ETL) | Blog
Tue, Jan 14th 2014 6:10a   Jake Howlett
As I watch all my customers leaves Notes/Domino behind, all I can do is try and assist as best I can. As part of this process I've found myself creating a Notes-to-SQL export tool. The tool is Notes-based and involves the following three part process: Step 1. Loop through and analyse every single document in the target database and build a list of all unique combinations of Form + Field + Data-Type. For each combination it finds, a Notes document is created which lists the Form name, the Fie [read] Keywords: domino lotus notes rich text database server sql
130


The Perfect Desk Quest - 2013 Update (Part 2) | Blog
Wed, Dec 11th 2013 3:10a   Jake Howlett
Back in March I updated you all on how my on-going quest for the perfect desk was coming along. Here now is another update. Question: Can you ever have too many monitors or enough "real estate" desktop size? Answer: No! Here's how my desk looks now: From left to right, there's a (newly-added) Dell U2713H (showing OS X), a Dell U2711 and a Samsung SyncMaster 245B (both showing the same Windows 7 PC). All in there are 9,676,800 pixels glaring back at me!! Aside from adding a brand new monito [read] Keywords: desktop mac
157


Recovering a Laptop After Forgetting Windows and BIOS Password | Blog
Wed, Dec 4th 2013 3:10a   Jake Howlett
My sis-in-law loves a bargain (she's from Yorkshire!) and recently rang to ask me (via her sister, my wife) if I'd be able to recover a laptop she'd been offered, before she went ahead and bought it. Apparently the owner of the laptop had forgotten the Windows password and had written the laptop off as worthless, so was willing to sell for next-to-nothing. I said yes, I'd able to do something with it. What I didn't realise was that it might have a BIOS password, which it did! Initially I' [read] Keywords: google laptop password
132


Rockall Design Now in its 11th Year! | Blog
Fri, Nov 1st 2013 4:00a   Jake Howlett
Rockall Design ltd (the little company I run from the office-slash-garage in my garden) was 10 years old yesterday. It's customary on this day each year that I plot a chart of turnover growth over the years. So, here it is: As you can see it's been a bumper year. Last year I put down what, at the time, I thought was a good year to: Long hours and 'hard' work. But mainly luck! This year is much the same. Although, if I thought I was doing long hours back then I had no idea what was in stor [read] Keywords: domino lotus microsoft office
209


Using Font Awesome Icons in Fireworks | Blog
Mon, Oct 14th 2013 4:00a   Jake Howlett
The font-based web icons from Font Awesome is brilliant. Especially when used in conjunction with Bootstrap. You can quickly and easily add any one of the icons to your HTML buttons (or many other elements for that matter). Like so: Sometimes though, you can't use web fonts. Either you can't rely on them being supported or, for some other reason, you just want to use an image file. That was the case for me recently and I wanted an image file of an exclamation mark. Here's how easy it was usi [read] Keywords:
455


Document Action Logs, Including "Limitless" User Comments | Blog
Wed, Sep 25th 2013 4:00a   Jake Howlett
Action Logs are something I'm sure we've all added to the bottom of a Domino web form. Here's an example of one I added to a recent Domino-based app I created and then wrapped with Bootstrap. The log is shown to the user as a three column table(when, who, what) with the latest action first. My approach to storing this data has always been to use a single multi-value text field. The value stored might look something like this:24/09/2013 17:08:12^^24 Sep '13^^17:08^^Joe Bloggs/ROCKALL^^Docum [read] Keywords: admin agent domino lotusscript ajax css email




322


Bootstrap Advanced Date Picker Plugin | Blog
Fri, Sep 6th 2013 4:00a   Jake Howlett
For some time now I've been creating date fields in Bootstrap-based websites that look like this: Clicking either in the field or on the button next to it launches a date-picker, like this: In the Notes Form the Date Field is configured in such a way that it accepts dates in the format 12-Dec-2009 (while storing them in normal Notes DateTime format of course). The field properties are like so: It all works well and users like them. Not least because there's no confusion over whether it' [read] Keywords: domino notes application javascript properties
97


Quick Tip: Login To Same Site as Two Different Users | Blog
Tue, Aug 20th 2013 12:00p   Jake Howlett
Here's a tip I discovered kind of by accident in one of those "I wonder if" moments. It came about after discovering a Fiddler tip that lets you trace localhost http traffic. The solution is simple: you simply add a trailing space, so that you surf to http://localhost./ At first I'd assumed that this was some odd quirk in the way browsers handled host names. Turns out it's actually working the way it should. Technically speaking all FQDNs should have a trailing space, in order to make them [read] Keywords:
124


How To: Virgin Media + BT Infinity = Reliable Internet Connection? | Blog
Mon, Aug 12th 2013 4:03a   Jake Howlett
The quest for an always-on internet connection is almost at an end! As if to assure me it was worth it, within 24 hours of Virgin Media connecting my secondary (failover) broadband connection the "primary" BT line went down. Again. For the third time in as many months. This time, however, I was prepared and had a backup connection and could carry on working. The BT engineer that came this time was very helpful. Bordering on apologetic for the fact I'd had so many visits of late. So much so he [read] Keywords: admin agent email interface wifi
81


Modern Day Communication Reliability | Blog
Thu, Aug 8th 2013 4:09a   Jake Howlett
Two weeks ago today I mentioned that I'd ordered a Virgin Media cable internet connection as a redundant 2nd connection in case my first goes down. Today the engineer is due to come and connect me up. Yep, a two week wait to get connected. Luckily I'm already on the internet, otherwise there's not a chance I'd ever wait that long. Anyway, I booked a date and the AM time slot for the visit and went about "waiting". Then, yesterday I got the message below: Which sent my overly-paranoid an [read] Keywords: twitter




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition