The Rise of AI – A Cautionary Halloween Tale

According to the hype doing the rounds at the moment, we’re all about to be replaced by Robots and/or Artificial Intelligence.
Alexa, Cortana, Siri, we already have computers that are talking to us.
Incidentally, all of these devices seem to have female voices, even the gender-neutrally named Google Assistant.
Deb reckons that this is because everyone understands that, when it comes down to it, women know best.
Whilst I wouldn’t presume to question this assertion, I must confess to being somewhat unconvinced as to the inevitability that AI is about to take over the world.
For a start, there are those automated checkouts that have been in supermarkets for several years now.
Not only are they all rather temperamental, they all have their own individual quirks.
Then there are the Sat-Navs they’re incorporating into cars. What with one thing and another I seem to be spending an increasing amount of my life arguing with other programmers’ bugs…
Continue reading

Advertisements

Importing an Excel Spreadsheet into an Oracle database with SQLDeveloper

It was late. In a corner of the Treasury however, a light burned brightly.
Phillip Hammond, Chancellor of the Exchequer, was still working.
“Spreadsheet Phil” was trying to formulate a plan to rectify the nation’s finances in the event that the Prime Minister was won over by the ebullient Mr Johnson and decided upon a “No Deal” Brexit.
Boris Johnson was currently based at the F.O. which, Phil considered darkly, was somewhat appropriate.
If only his predecessor had had the foresight to stick a couple of billion on Liecester City to win the league at 5000 to 1, The Country’s finances would be in much better shape.
In the midst of this gloomy reflection, he was struck by a sudden inspiration. The crowded half-hour that followed resulted in – what else – a spreadsheet.
The information therein could save The Economy. “Hmmm”, thought Phil, “this stuff is far too important to leave in Excel, I really need to put it into my Oracle database. I wonder if SQLDeveloper could help”… Continue reading

In-Line Views versus Correlated Sub-queries – tuning adventures in a Data Warehouse Report

Events have taken a worrying turn recently. I’m not talking about Kim Jong Un’s expensive new hobby, although, if his parents had bought him that kite when he was seven…
I’m not talking about the UK’s chief Brexit negotiator David Davies quoting directly from the Agile Manifesto and claiming that the British were “putting people before process” in the negotiations, although Agile as a negotiating strategy is rather…untested.
I’m not even talking about the sunny Bank Holiday Monday we had in England recently even though this may be a sign of Global Warming ( or possibly a portent for the end of days).
The fact is, we have an Ashes series coming up this winter and England still haven’t managed to find a top order that doesn’t collapse like a cheap deckchair in a light breeze.

On top of that, what started out as a relatively simple post – effectively a note to myself about using the row_number analytical function to overcome a recent performance glitch in a Data Warehouse Application – also seems to have developed an unexpected complication…

Continue reading

The March of IDEs – Installing Visual Studio Code on Ubuntu

When I started programming, the world was black and white. I’d write my code in Vi on Unix ( Sequent’s dynix/ptx if you want to get personal) and then run it through a compiler to find any errors. End of story, [Esc]:wq!.
Then, along came GUI IDEs with their white backgrounds and syntax colouring.
Things now seem to have come full circle as the colour schemes currently en vogue for IDEs tend to look a bit like this :

Finding a lightweight, general purpose IDE for Linux has been something of a quest for me. It’s not that there aren’t any out there, it’s just that none of them quite seemed to be exactly what I was looking for. Until now.

Look, I know that programmers tend to be rather attached to their favourite editor/IDE and this post is not an attempt to prise anyone away from their current toolset. It is simply an account of how I managed to install and configure Visual Studio Code in Ubuntu to use for Python.

Hang on, lightweight ? We’re talking about Microsoft Visual Studio, right ?
Actually, Visual Studio Code (VS Code) is a rather different beast from the Visual Studio Professional behemoth that’s used for knocking up .Net applications on Windows.

What I’m going to cover here is :

  • Installing VS Code
  • Adding the Python plug-in
  • Adding a Python linter
  • Executing a program the simple way
  • Using intellisense for code-completion
  • Debugging a program
  • Executing a program inside VS Code

If you’ve stumbled across this post in the hope of finding some information about setting up VS Code for PL/SQL, I would refer you to Morten Braten’s excellent post on the subject.

Here and now though, it’s Python all the way… Continue reading

REGEXP_LIKE – Happy thoughts whilst searching for multiple substrings in Oracle SQL

International relations seem to be somewhat tense at the moment with various World Leaders being publicly grumpy with each other.
To keep my mind off damoclesian digits dangling dangerously over Big Red Shiny Buttons, I really just want to hear some nice news to help me think happy thoughts.

I’d like to read about Luton Town because they’re doing quite well, or the England Cricket team winning a Test Series. I might even treat myself to a random Cat Video…

Continue reading

Using Edition Based Redefinition for Rolling Back Stored Program Unit Changes

We had a few days of warm, sunny weather in Milton Keynes recently and this induced Deb and I to purchase a Garden Umberella to provide some shade.
After a lifetime of Great British Summers we should have known better. The sun hasn’t been seen since.
As for the umbrella ? Well that does still serve a purpose – it keeps the rain off.

Rather like an umbrella Oracle’s Edition Based Redefinition feature can be utilized for purposes other than those for which it was designed.
Introducted in Oracle Database 11gR2, Edition Based Redefinition (EBR to it’s friends) is a mechanism for facilitating zero-downtime releases of application code.
It achieves this by separating the deployment of code to the database and that code being made visible in the application.

To fully retro-fit EBR to an application, you would need to create special views – Editioning Views – for each application table and then ensure that any application code referenced those views and not the underlying tables.
Even if you do have a full automated test suite to perform your regression tests, this is likely to be a major undertaking.
The other aspect of EBR, one which is of interest here, is the way it allows you to have multiple versions of the same stored program unit in the database concurrently.

Generally speaking, as a database application matures, the changes made to it tend to be in the code rather more than in the table structure.
So, rather than diving feet-first into a full EBR deployment, what I’m going to look at here is how we could use EBR to:

  • decouple the deployment and release of stored program units
  • speed up the process of rolling back the release of multiple stored program unit changes
  • create a simple mechanism to roll back individual stored program unit changes

There’s a very good introductory article to EBR on OracleBase.
Whilst you’re here though, forget any Cross-Edition Trigger or Editioning View complexity and let’s dive into… Continue reading

Keyboard not working in Citrix Receiver for Linux – a workaround

In technological terms, this is an amazing time to be alive.
In many ways, the advances in computing over the last 20-odd years have changed the way we live.
The specific advance that concerns me in this post is the ability to securely and remotely connect from my computer at home, to the computer in the office.
These days, remote working of this nature often requires the Citrix Receiver to be installed on the client machine – i.e. the one I’m using at home.
In my case, this machine is almost certainly running a Linux OS.
This shouldn’t be a problem. After all, the Citrix Receiver is available for Linux. However, as with any application available on multiple platforms, any bugs may be specific to an individual platform.
I was reminded of this recently. Whilst my Windows and Mac using colleagues were able to use the Citrix Receiver with no problems, I found the lack of a working keyboard when connecting to my work machine something of a handicap.
What follows is a quick overview of the symptoms I experienced, together with the diagnosis of the issue. Then I go through the workaround – i.e. uninstalling the latest version of the Receiver and installing the previous version in it’s place.
Continue reading