Evan J Palmer's Blog

A blog about learning (code, improv, film and, anything else).

Category: General Tech

Using a sys_refcursor Output Parameter from a Oracle Stored Procedure

In your SQL IDE, such as PL SQL Developer it’s not entirely straight forward to access the results of an Oracle stored procedure, when the results are returned via an output parameter of type sys_refcursor.

In short, here’s the code:

l_rc sys_refcursor;
l_rec my_rules%rowtype;
mypackage."MyProcName"( l_rc );
FETCH l_rc INTO l_rec;

dbms_output.put_line( l_rec.field_one || ' ' || l_rec.field_two );

CLOSE l_rc;

An explanation:

Firstly we need to declare some variables to use. l_rc is a cursor that we will pass to the procedure, to store the output results.
l_rec is a record into which we’ll store each iteration of the cursor.

After the declaration we execute the package, populating the cursor.

We then loop over the cursor, storing the value in to record, or row, that we declared above, ending when the cursor is empty.

Remember to close the cursor to release the context area in memory.

Thank you to Justin on StackOverflow for answering my question.

As an aside, moving from SQL Server to Oracle has been interesting. I’ve found several commands or concepts that are trivial in SQL Server to be a little challenging in Oracle.

  • No auto increment for primary keys (before version 12) have to use triggers instead
  • The concept of Packages, with a public spec and a private body
  • We don’t have to tell parameters how long their nvarchar2 is, but we do in the table (this is cool logically, but feels inconsistent)
  • The concept of the ORA file

Pretend Like You’re Interested.


I’ve recently been giving series of presentations to large(ish) groups at work. In my opinion they’re good presentations, and I’ve received some great feedback.

While I was giving the presentations I noticed a few different categories of body language given by attendees in the room – there seems to be a spectrum of visual attentiveness.

Some people looked directly at me, and nodded as I made points, leaning forward on their chairs attentively while I explained finer points in detail with a diagram.

Other people looked mostly at the slides, even though there isn’t a massive amount of info on there – maybe a few word or an image. They tended to have a fixed focused on the projection, rarely looking at me.

There was also a third type of attendee who seem disinterested and was on their phone or looking out the window for whatever reason.

I have a few points I’d like to make about this.

Firstly, I was initially disheartened and put off by the latter type. Why weren’t they interested in my awesome presentation? Am I doing it wrong? Am I not speaking clearly? Is my subject complete and utter crap? Have they realised I’m actually just a big phony?

No, I don’t think so. There are probably lots of reasons these people were looking disinterested. Maybe they’re super familiar with the topic already? Maybe they were deep in a debugging session before the meeting, and haven’t fully context switched yet? Maybe they have something on their minds from out of work? Or perhaps that’s just how they listen and learn? For whatever reason, I think it’s important not to be distracted and dejected when presenting to people with this sort of body language – which was my initial reaction. 

Secondly, the people who stared at the slides throughout the presentation. These people were fairly easy to present to. They didn’t give me much feedback, but I felt as if they were letting the information sink in, and it was easy to roll through the motions and get the content out to them.

Thirdly, the more active attendees. The people who looked at me, and nodded. The people who smiled when I made a light remark. The people taking notes. Thank you! Having some feedback or recognition really helped me. When I wasn’t sure if I had explained myself well seeing these people jotting things down in there notpads/laptops confirmed that I was on the right track. I think the more people who were like this in the room, the better my presentation went.

In conclusion, if you’re attending a presentation perhaps it’s worth considering how you present yourself. Show some interest and that enthusiasm may be fed back to you! If you’re the one doing the presentation, my advice is to be ready to expect different types of body language and don’t be too disheartened by blank faces.

Logging into Visual Studio 2013 – forms done wrong

So I thought I’d have a bit of a play with Visual Studio 2013.

Here’s my experience

I download, install and, run.

It prompts me with a login screen. Hmmm.. I’m not a member… that’s cool I’ll sign up. *click*

Now I fill out a long scrolling form and fill out the captcha *click*.

ERROR! Ah, I forgot to put in my post code because hardly any of the form fits in the miniature space they’ve allowed.

That’s cool… filling it in… *click*.

ERROR! Oh, they cleared out my CAPCHA… okay, filling that back in. *click*

ERROR: did I get that wrong? was that ‘p’ or a ‘b’? That ‘j’ kinda looks like an ‘s’. I’ll try the audio version *click*.

Listening… nope that. Doesn’t make sense to me. back to the written version *click*

ERROR! Ooh, I got the CAPCHA right! (Wooott!) but my email address is already registered. Thanks Microsoft, you could have told me earlier. Oh well that’s cool. Back to the log in screen. *click*

Filling in my details… guess my password *click*

ERROR! I guessed wrong. Well I’ve been trying to use different passwords for different sites for a while now. So that’s not surprising. I’ll just click the reset password button *cliiii…… nope that button doesn’t exist.

Okay… I pull up Chrome and go to the MS site. And am logging in automatically.

Okay. So I log out, try to log back in again, and FIND THE RESET PASSWORD BUTTON!

And it’s smooth sailing from here.

What I think, in order of importance:

1) Make the form smaller. Is that really the minimum amount of info needed?
2) Have a reset password link on or near the error
3) Asynchronously check my user id as I’m filling out the massive form
4) Make better CAPCHAs. Surely we have a better alternative… ?
5) Make it more obvious that the log in optional ? I just ran through the process again, and noticed a small “skip” link under the sign in button on the first screen. That’s cool, but there’s no skip button on any subsequent screens.

Popcorn Time – Awesome Illegal Netflix/Plex Alternative



If you’re familiar with Netflix, or Plex, or XBMC, you’ll get a kick out of Popcorn Time. It’s this great program that acts like a slick media player with a basically complete library, but instead of hooking into a legitimate library (like Netflix) or your local files (like Plex/XBMC) it STREAMS TORRENT FILES! …hence the illegality.

Well, I guess it’s illegal… if the country you live honours American copyright law… and only if you choose to download content that is under copyright (there’s a lot of public domain stuff out there too).

But whatever. I love this thing  – even though it’s not finished yet (IMO… and it’s in beta). They still need to get the search a bit better, give us some preferences around quality and, make some kind of offline mode (so we can choose some poor-health-torrent flicks to download now, and watch them when we get home).

I’d also love to see offline mode integrated with tablets and phone devices, like Plex does.

Having said all that, this is such a massive awesome step in the right direction, I’m very excited about the future.

One other interesting thing to note is it’s lack of adverts in the app. If there are no adverts to pay the pirateers, and the movies aren’t being paid for by subscribers or movie-goers… I guess no one makes money. Not a problem, since the share of Popcorn Time users is basically nil at the moment, but interesting none-the-less.

Ideally, I’d love to see something like this take off, where the movie industry can still make some money and keep making stuff I love – HAVE THE SCIENTIST WORKING ON THAT IMMEDIATELY!


Agile Techniques and Developer Stress

Homer: [to staff] Are you guys working?
Man 1: Yes, sir, Mr. Simpson.
Homer: Could you, um… work any harder than this?
Man 2: Sure thing, boss. [they do]
Homer: Hey, call me Homer.

I’m an advocate of Agile Methodologies, but it’s recently been brought to my attention that there is a potential downside. When this downside manifests, good developers can feel over worked, over pressured, and burnt out.

In this article I’ll give a brief outline of the problem in each situation, followed by how it could possibly be remedied.

The first case that was brought to my attention when I was was chatting to a new colleague of mine, I’ll call him Jimmy Lazerface (or JL for short). We were talking tech and he had been super enthusiastic about everything. Then I moved onto Agile – I was acting like a total Agile Fan Boy. I noticed he quieted up. Once I pressed him for details it turned out that the last job he’d had, indeed the place he’d worked only a few weeks earlier, had implemented their version of Agile, and he had had a bad experience. The Scrum Master/Tech Lead was giving very tight estimations on work and holding the developers to those deadlines – ensuring that the velocity stayed where he thought it should be.

I think there are a few parts to a solution here. Firstly, the developers should be involved in the estimation process, not just one person. Using a technique like Poker and T-shirt sizing, we can get a better, fairer, idea of how much work can be achieved.

Next, I think trying to maintain a velocity is a bad idea. Velocities should be used to help estimate. If there is a big drop, can it be explained in the retrospective? Or does your velocity need to be adjusted?

Finally, I think some responsibility can be put on the scrum master/tech lead for not not having some faith in his team (JL is one of the most switched on developers I’ve met, so I know he wouldn’t be slacking off).

The next example I came across of Agile being viewed in a less-than-positive-light was today. An older colleague of mine known as Professor Donaltron (or PD), was discussing the shift over the last few years to agile from a more waterfall/BDUF. He told me, That in the waterfall days, a project might last six months. The first month or so would be design, the next, say four, would be writing up functionality (i.e. actual coding) followed by a month of testing. The way he viewed this cycle was the work ramping up at the beginning, then ramping down at the end. He felt that with agile, his whole work-life was a busy period – no down time. Poor PD. It was obvious that he was feeling burnt out, and as a close colleague of mine I know he has been working really bloody hard.

Seeing as how I work with PD now, I have an insight that might point us in the direction of why he feels this way. I know PDs team do not use retrospectives or do much estimation. They are almost entirely R&D so instead they kind of pile on stories and move them across the agile board once they’re “completed” (which in itself is often hard to define. Everyday they have stand ups, where they have to explain what they did the day before. One card might could be XL (or more) and take a developer longer than a sprint to do. This whole time it could be perceived that PD is not making much progress, despite the fact that he could have put an enormous amount of effort in.

Since PDs team is R&D estimation is very difficult and rarely happens. In the same vein, it’s difficult for the Scrum Master/Stakeholder’s to understand how much progress was made.

I think in this case PD has to do a better job of communicating what he has done in the stand up. I actually advocate him adding new stories to the board (or sub tasks perhaps) so that there’s a visual representation of what he’s doing as movement across the board. This should then be discussed in the retrospective. This may sound like a break from agile, but I believe that agile implementations should be just that – agile. Teams should select the most useful parts of the methodology and apply that. In this particular R&D team, cannot apply many of the cool agile techniques we know and love, so must adpot a subset, coupled with anything that works for them. As long as there’s communication, openness and iteration, I can dig it.

My own experience of Agile has been overly positive, however upon reflection, I remembered when I was first introduced to daily stand ups. At the time I had been at this particualr company for a year or so, so my responsibilities included my project work, AND daily support-style work for stake holders. I remember that I wasn’t used to having to account for my time every day, so as a result I’d get to the daily stand up and have trouble talking about why I hadn’t made as much process as was expected.

The solution here is was, once I realised the problem, was to keep track of any bespoke support I’d done the day before and talk about it in the stand up. Then in the retrospective I would collate what I’d done and show that it was a meaningful amount of work. From here we started putting effort numbers on support work (kind of reverse estimation) so we could work out a kind of velocity separate to the usual project work. We then created a support roster to share the support work, and tried to focus on getting the “support velociy” down. It was a successful way to tackle that problem.

In conclusion, I think developer burn out is a worthwhile thing to note when employing agile techniques. Perhaps more emphasis should be placed on asking how developers feel during the retrospective? Did they work too hard? Not hard enough?

[Chrome Extension] TPB IMDB Pirate Bay Seach Plugin

I wrote a Chrome Extension that adds a drop down list of the top five torrents to an IMDB page.


Check it out here:


The links are ordered by seeders, so what ever has the most seeders will be at position one and the least at position five.

You can see how big the file is too, so that’s handy.


Take a look at a movie page, an artist page, a list page and a TV series page. The links are on there too!

I think this plug in covers the majority of cases, but I plan to add a preference page, so we can do things like exclude pron, have more items in the drop down list or optionally use the http://bayproxy.me/. Stuff like that.

I also have plans to hook this into Wikipedia, and Rotten Tomatoes, Google etc. Any movie page I can think of.

If you’d like to help with any of that, send me a pull request!

Initial Thoughts on Hot Desking

whoooooooooo-oooo-ooooo your desk is on fire

I’ve recently started working a company that “Hot desks” – that’s when you don’t have a designated desk when you come in to work. Instead you can sit anywhere you like.

I’ve found a few pros and cons.

Desks are clean – you can’t leave your crap over them, which means you don’t have dirty mugs (or sensitive documents) sitting around everywhere.
If you come in early you can get a cool spot near a window or something
You can sit with your team members, or however it’s most convienient for you
Saves money for the company. If only 75% of people are in the office on any given day, they can save 25% on seating

When you’re new you dont know who anyone is
I’ve heard of people missing stuff (leaving stuff on their desk that’s gone missing)
It takes me longer to get set up in the morning
I’ve heard two (overly loud) arguments regarding someone sitting in someone else’s spot both of which I found amusing, so could probably be a PRO too.
You can’t keep good personal things on your desk – like a pot plant or your cool drink bottle etc

Examples of Context Switching

poison cup challenge

Context switching is bad – try to do it as little as possible if you want to be productive and really benefit from Kaizen.

What I’m talking about when I say “context switching” is changing what your brain is focusing on. The more often your brain has to drop out of “The Zone” and switch into something then back to the original task, the more engery you’ll burn and the harder it’ll be.

So the typical context switch I’m talking about is when you’re at work, and you’re deep into the Henderson Account and it sucks. You really don’t care about The Hendersons or their accounts, but The Man buying your lifeforce so you have to do it. It’s boring and you remember that movie with… what’s his name… it was his first movie… the budget was like $7000 oh yeah, it was Primer. Has his new film come out yet – quick Google and your mind is no longer immersed in the Henderson Account, but is thinking about a cool movie. The context has been switched and you’ll need to exert effort to get back up to speed.

So this is a thing that you should try not to do. Which is easier than it sounds.

Anyway, I’ve been thinking recently about different types of context switches that happen to human beings. Firstly, we have the mind wandering one, which I talk about above. Here are a couple of other examples, that I think of as context switches.

When you’re working on something almost every alt+tab is going to be a physical manifestation of a mental context switch – whether you’re checking emails or Reddit.

Reddit, Instagram etc- flicking between little images 
So you go to Intstgram or Reddit or Facebook and you’re greeted with tonnes of little snippets of information that is generally not related to each other. You’ll see a picture of a cat, then a status about Cheryl’s boy trouble, then a photo of Mark at a party, then a video of a guy skating. All these amazing unrelated thing are little context switches that make your brain expel energy … and don’t really give you much benefit.

Working on a large project or little tasks
At your work do you generally have a big project to sink your teeth into or lots of little projects that take up your day. I am proposing that the poeple with the larger projects are more useful to the company and are gaining skills at a faster rate than those who are doing smaller jobs, and I put this down to context switching.

Changing jobs and careers
Do you change jobs regularly? Or even careers? I suggest that the more you do this the more energy is expelled making the switch and the more slowly you’ll be gaining useful skills. I’m not suggesting you stay in a job or career you hate, nor am I suggesting we work for the same company our entire lives. What I am thinking is that maybe we should think, until I can do a  job with something like an 80% efficiency, I should not look for more work. Or, once I feel I haven’t learnt anything new for a while, it’s time to move on. Rather than “screw this, too hard” change jobs.

Yeah, that’s all. This is just opinion. Not sure if there’s any real truth in it, but it’s worth considering how this concept could also be applied to sports and physical training. Do you think this could be applied to relationships as well? Is being friends with someone for a long time better than bouncing between groups of friends? Do you get more out of being with the one person for a long time, or having shorter relationships?

I don’t use iTunes


I have an iPhone and an iPad.

I’m actually really looking forward to switching to a Droid phone in February when my current contract runs out. Not because I dislike my iPhone, the opposite in fact. But, I’m just looking forward to trying some of the new features that I’ve been hearing about.

I probably won’t upgrade my tablet for a while.

Anyway, I’ve told a few people that I don’t use iTunes recently and they freak out.

I actually don’t see the use for it.

Here’s how I do it.

I should also note that this wasn’t a conscience decision. Like, I didn’t say to myself “Fuck iTunes and all y’all. Imma investigate to work around it.” I just naturally picked apps that tended to not require iTunes.

  1. Back up I use iCloud
  2. For music, I use Spotify
    I sync some playlists offline (via wi-fi) so I rarely use MP3s anymore – I never pirate music.
  3. I install my apps via the App Store on my phone
  4. Podcasts I use Downcast
  5. RSS I use Feedly
    I actually don’t know if RSS is something that iTunes does, but hey, I like Feedly
  6. For Comics I use Comic Zeal
    Comic Zeal can share a folder over WiFi
    Honorable mention to the amazing app Comixology, which is only a little too pricey for me to use.
  7. Stanza/iBooks for reading
    with stanza I download fiction by connecting to Tuebl
    with iBooks, I email PDFs of tech stuff. I have to admit, this is probably a bit of a work around. But it works for me, and is faster than connecting my iPad to the computer and loading up iTunes.


Computers do what you tell them to.


So there’s some conventional wisdom in computer science that goes something like “computers only do what you tell them to do”. So basically, if your code isn’t working it’s your fault. In other words, your code is working, you just told the computer do something dumb.

So picture this, you click on the reporting tab of your application, and see an error page. That’s exactly what should happen. You told the computer to get the data, and divide “a” by “b”. Since “b” was zero and you told the computer that when when you divide by zero you should throw an excpetion. And when you throw an exception, you should show the error screen.

See! You told the computer to show the error screen when you click the reports tab!


Well no – the programmer did. But YOU didn’t. So mabe the addage should changed to:

“Computers only do what the programmer told them to do?”


Well I don’t think that’s right either.

I mean, the programmer didn’t tell the machine to throw a DivideByZeroException. It’s true the developer should have handled that case, but the programmer didn’t tell it to do that at all.

The language designer did.

So should the adage be change to:

“Computers only do what the developer and language designer told them to”

Maybe – although it doesn’t really have the same ring to it.

Anywho, my only point is that computers don’t do what YOU (i.e. one peson) told them to do. They do what a person who told a person who told a person who told a ….

In the words of Jeff Goldblum in Jurassic Park:

[We] stood on the shoulders of geniuses to accomplish something as fast as you could, and before you even knew what you had, you patented it, and packaged it, and slapped it on a plastic lunchbox, and now! Now you’re selling it, you wanna sell it!