Disclaimer

The views and opinions expressed in this blog are my own and do not necessarily reflect those of my employer. The views and opinions expressed by visitors to this blog are theirs and do not necessarily reflect my own

Wednesday, November 21, 2007

I use Ubuntu, But Why?

Those that know me well, will know that I am a desktop Linux advocate and that I completely moved my home desktop to Ubuntu after considering what I really need my computer to do. The list below is a pretty comprehensive list of what I want to be able to do with my computer:


  • Run in a timely manner
  • Not crash when something/anything throws a wobbly
  • Internet Access (General Web Surfing)
  • Internet Chat (MSN, Skype)
  • Word Processing, Spreadsheets
  • Storing / Editing Photos from my digital camera
  • Printing Documents
  • Scanning the odd document or photo
  • Playing music (MP3s, Internet Radio)
  • Playing Videos/DVDs
  • Burning CDs/DVDs
  • Simple Development & Editing Text Files

For me the switch was not about the politics of "free software vs. the almighty evil other company or proprietary software" but the fact I don't need or want a server farm to run the latest version of the software, have a bloated desktop that takes 10 minues to “load my personal settings”, have to upgrade my PC every 6 months or update my virus definitions religiously.

I migrated to Ubuntu just after Vista was released, after hearing and having a few negative experiences with Vista on other people’s hardware. For me, moving to Vista would have meant that I would need some new hardware. My home PC has a fairly modest specification consisting of Athlon XP 2000 (1.67 GHz Processor), 1GB RAM, 64 MB RAM NVIDIA Geforce 2 Graphics card, and 2 x 250gig hard drives. I could have moved to Mac but that would have meant shelling out at least £600 on hardware (something I might still consider when my current hardware starts to feel slow).

I’ve been using Ubuntu on my home servers since the “Badger” but never really felt that it was quite ready for my desktop, until Feisty. I took the plunge after weighing up the pros/cons and trying the live CD with my hardware. Do I regret it? Definitely not. For years I’d run Linux in a VM, now it is the other way round and I am running Windows in a VM for all those legacy applications that must use Windows.

The first thing that hit me was how fast my system goes on such a modest specification. Put simply, every aspect of my computing needs in the list above is covered by Ubuntu. I’ve yet to encounter a task which I can’t accomplish in Ubuntu. For me the benefits include “less” worry about mal-ware, viruses and my general security, performance and the total cost of my home computing experience is much less (More Free-Software/Free-To-Use alternatives and less hardware upgrades).

There are a few minor niggles such as driver compatibility, wireless connectivity and lack of commercial software. However, I am lucky enough to own a scanner (Packard Bell 2400), wireless card (Not sure of model, it just worked) and printers (Samsung ML-1210, Samsung ML-4550) that are ALL supported under Linux. Others might not be so lucky. The fact I am NOT a gamer also helps. The lack of commercial software refers to the unavailability of commercial software like Photoshop and Fireworks. These are pieces of software I’d be happy to pay for if they were available. Though I believe this will change over time as more and more people are starting to use Desktop specific versions of Linux such as Ubuntu. Free-to-use software such as Skype, Opera and RealPlayer are already available and have been for some time.

The simple truth is that if Windows was as performant and secure as my Linux Desktop I would have probably stuck with Windows as it does just work with most hardware.

My advice to anyone looking to buy a new PC would be to try Ubuntu first. You can download the live CD from the Ubuntu website and try it without installing it. Its also the first real distribution that doesn’t require extensive Linux or computing knowledge. You can install it and use it.

Ubuntu Website -> http://www.ubuntulinux.org
Ubuntu Forums -> http://www.ubuntuforums.org
Dell computers with Ubuntu -> http://www.dell.com/ubuntu

Wednesday, November 14, 2007

Clear Page Cache When Using Tabs & Sub-tabs (new solution)

Previously I posted a solution for clearing page cache of a target page when a user clicks a sub-tab. While my solution works there is much cleaner way of achieving this involving the use of APEX_UTIL.CLEAR_PAGE_CACHE().

Using the same scenario, consider that we need to clear the page cache of the page that we will be re-directed to, before it loads. The solution is very similar but requires no modification of the target page.

Firstly, create a new application page process:
Navigate to Applications -> Shared Components -> Application Processes and hit “Create” in the application builder. Create a process which runs “On Submit: After Page Submission – Before Computations and Validations”. In Process Source type the following
IF (:REQUEST = 'T_YOUR_TAB_NAME’) THEN
APEX_UTIL.CLEAR_PAGE_CACHE(your_page_number);
END IF;

T_YOUR_TAB_NAME can be identified from the developer mode or using firebug in Firefox on the specific tab your interested in. That's it! Now when a user clicks on a sub-tab the target page's, page cache will be cleared before it loads. To clear the cache for another tab, just add a new block to the application process you have created.

Apex Gotchas

While Apex is an intuitive easy to use development environment it can cause some frustrations and has a number of gotchas that are worth been aware of. The following are a few I've discovered over the last couple of months.

Validations of type PL/SQL Expression without conditions

This little beauty caused me an hour and half worth of grief.

Set up a pl/sql validation of type pl/sql expression, give it a name but leave the condition entry blank.

When you run the page you will see “Invalid PL/SQL Expression” at the top of page before the header and rest of your page.

POP LOV, display description return value returns “undefined”

If you have a page item (Select List), which uses an LOV query, and have enabled null columns (but not specified a null value) you can typically expect the value in the session state to be “%null%” after the page has been submitted.

However it appears that if you have a “Popup LOV, display description, return value” item then the null value actually gets submitted to the session state as “undefined” and not “%null%”. Although this one is easier to spot it more of an annoyance and just appears odd as it actually returns “undefined” to the display area too.

Setting Page Items in Validations, Report Regions and PL/SQL Function Body Conditions

Have you ever worked on a bit of functionality where you're effectively hacking it to get it to work with the good intention of re-factoring it later and make it look pretty?Well on one occasion where I had forgot to go back and re-factor a particular page I had worked on I discovered that I had set a page item within a validation.

Logically thinking, I personally would not expect to see a page item set in a validation (your circumstances may be different). Apex allows you to make an assignment to a page item anywhere you can place PL/SQL blocks (E.g. report regions returning SQL Queries, item/region conditions (I.E. function body returning boolean), LOV Queries. Generally speaking I'd expect such a function to be carried out in process. The old saying , “just because you can doesn't mean you should” comes to mind.

I feel this is a good example demonstrates the need for standards and consistency when developing Apex Applications if not for your own sake then for the poor person who is going to support your application once your gone. More about good practice in a later post.

I did have one more gotcha, concerning dates but can't remember the specifics, if I do I'll add it to the list, likewise if anyone has any more please feel free to add them to the comments section and I'll update the post.

(The gotchas may not apply to versions of Apex greater than 2.2.1 unfortunately the project I was working on was at that particular version)

Ending the Silence

It has been well over 3 months since my last post and I know its lame but “I just have not had the time”.

Since then I’ve been coding and documenting as my long stint at my last client came to an end last week. After a hard day at the office, touching a computer is the last thing I’ve wanted to do. However my blog-topic list has got ever longer where I’ve jotted down idea but not had the time to follow them up and there has been some exciting developments on the Oracle Landscape.

So if you a regular reader, fear not, I am still alive and there will be more posts coming over the next couple of weeks.