Shared posts

02 Jul 16:25

12c - Invisible Columns...

by Thomas Kyte
Remember when 11g first came out and we had "invisible indexes"?  It seemed like a confusing feature - indexes that would be maintained by modifications (hence slowing them down), but would not be used by queries (hence never speeding them up).  But - after you looked at them a while, you could see how they can be useful.  For example - to add an index in a running production system, an index used by the next version of the code to be introduced later that week - but not tested against the queries in version one of the application in place now.  We all know that when you add an index - one of three things can happen - a given query will go much faster, it won't affect a given query at all, or... It will make some untested query go much much slower than it used to.  So - invisible indexes allowed us to modify the schema in a 'safe' manner - hiding the change until we were ready for it.

Invisible columns accomplish the same thing - the ability to introduce a change while minimizing any negative side effects of that change.  Normally when you add a column to a table - any program with a SELECT * would start seeing that column, and programs with an INSERT INTO T VALUES (...) would pretty much immediately break (an INSERT without a list of columns in it).  Now we can add a column to a table in an invisible fashion, the column will not show up in a DESCRIBE command in SQL*Plus, it will not be returned with a SELECT *, it will not be considered in an INSERT INTO T VALUES statement.  It can be accessed by any query that asks for it, it can be populated by an INSERT statement that references it, but you won't see it otherwise.

For example, let's start with a simple two column table:

ops$tkyte%ORA12CR1> create table t
  2  ( x int,
  3    y int
  4  )
  5  /
Table created.

ops$tkyte%ORA12CR1> insert into t values ( 1, 2 );
1 row created.

Now, we will add an invisible column to it:

ops$tkyte%ORA12CR1> alter table t add 
                    ( z int INVISIBLE );
Table altered.

Notice that a DESCRIBE will not show us this column:

ops$tkyte%ORA12CR1> desc t
 Name              Null?    Type
 ----------------- -------- ------------
 X                          NUMBER(38)
 Y                          NUMBER(38)

and existing inserts are unaffected by it:

ops$tkyte%ORA12CR1> insert into t values ( 3, 4 );
1 row created.

A SELECT * won't see it either:

ops$tkyte%ORA12CR1> select * from t;

         X          Y
---------- ----------
         1          2
         3          4

But we have full access to it (in well written programs! The ones that use a column list in the insert and select - never relying on "defaults":

ops$tkyte%ORA12CR1> insert into t (x,y,z) 
                        values ( 5,6,7 );
1 row created.

ops$tkyte%ORA12CR1> select x, y, z from t;
         X          Y          Z
---------- ---------- ----------
         1          2
         3          4
         5          6          7

and when we are sure that we are ready to go with this column, we can just modify it:

ops$tkyte%ORA12CR1> alter table t modify z visible;
Table altered.

ops$tkyte%ORA12CR1> select * from t;

         X          Y          Z
---------- ---------- ----------
         1          2
         3          4
         5          6          7


I will say that a better approach to this - one that is available in 11gR2 and above - would be to use editioning views (part of Edition Based Redefinition - EBR ).  I would rather use EBR over this approach, but in an environment where EBR is not being used, or the editioning views are not in place, this will achieve much the same.

Read these for information on EBR:


30 Jun 17:59

Another group interaction experiment I’d like someone to perform

by david

I posted a while back about an interesting experiment in group intelligence I’d like someone to perform. I thought of another interesting experiment I’d like to see performed, so it’s apparently starting to become a habit.

The experiment is as follows:

Put two people in a room. Tell them to talk to eachother. After some fixed period of time (say, 10 minutes), take them out of the room and give each of them a questionnaire. The questionnaire has N questions on of it, each of which is a binary choice. These questions could be things like “Do you mostly agree with this complex political statement?”, “You are given a choice between these two scenarios, which do you pick?” etc. Things which are very much about your value and behaviours rather than simple statements of objective facts.

Each of these questions must be filled out twice. Once with your answer, once with what you think your partner is most likely to answer.

Basic questions it would be interesting to answer:

  • What questions are people particularly good at bad or predicting?
  • Is the prediction rate asymmetric? If one person successfully predicts the other well, is the other likely to be worse or at prediction?
  • Are predictions better when the answers are different or the same?

More advanced questions that would be interesting to answer:

  • How do prediction rates differ when we vary the length of the conversation?
  • How do prediction rates differ with different primings for the conversation? e.g. rather than instructing “Talk to eachother”, say “Talk to eachother about your family”
  • How do prediction rates differ if instead of talking to eachother in person you talk via an instant messaging program? Or via a phone?

flattr this!

30 Jun 17:33

"We don’t like the picture of the guy wearing the tie because it looks like it’s pointing..."

“We don’t like the picture of the guy wearing the tie because it looks like it’s pointing to his crotch.”

-

A client who rejected each and every tie picture afterwards for the same reason. It was for a tie advertisement.

30 Jun 17:30

"An error occurred due to some kind of data."

“An error occurred due to some kind of data.”

-

Client attempt to help me understand what went wrong.

30 Jun 17:29

Me:  And what size is this image supposed to be? Client: Medium.

Me:  And what size is this image supposed to be?

Client: Medium.

30 Jun 17:28

"Whenever I choose a larger font size, I see less information on the screen. Can you please fix..."

“Whenever I choose a larger font size, I see less information on the screen. Can you please fix this?”
28 Jun 21:46

Editor’s Note: This story was submitted without any sort of context, which sort of makes it better....

Editor’s Note: This story was submitted without any sort of context, which sort of makes it better. Let me know in the comments why you think a banana’s scent is being discussed.

The following story deals with one of my regular editing clients. He often requires a bit of patience.

Me: I don’t understand what this section of the wording means.

Client: What it says there.

Me: I see what it says, but I don’t understand what you mean.

Client: Look, what should I put there?

Me: Well, I can’t tell you what to put there until I know what you’re trying to say

Client: It’s a description of the smell of a banana.  Can’t you just tell me what should I put there?

Me: But your description is “A banana has a smell like a strong scent of the smell."

Client: I don’t see the problem. Is there something wrong with the grammar?

28 Jun 21:45

Client: I need a brochure, letterhead, business cards and a website ASAP. Me: What’s your...

Client: I need a brochure, letterhead, business cards and a website ASAP.

Me: What’s your deadline?

Client: Two weeks from now.

Me: That shouldn’t be a problem. First thing we have to do is speak to the printer.

Client: No problem, way ahead of you.

Me: Oh yeah? When do they need the final artwork?

Client: They need it 14 days in advance.

21 Jun 14:01

Sunset on the British Empire

Sunset on the British Empire

When (if ever) did the Sun finally set on the British Empire?

—Kurt Amundson

It hasn't. Yet. But only because of a few dozen people living in an area smaller than Disney World.

The world's largest empire

The British Empire spanned the globe. This led to the saying that the Sun never set on it, since it was always daytime somewhere in the Empire.

It's hard to figure out exactly when this long daylight began.  The whole process of claiming a colony (on land already occupied by other people) is awfully arbitrary in the first place. Essentially, the British built their empire by sailing around and sticking flags on random beaches.[1] This makes it hard to decide when a particular spot in a country was "officially" added to the Empire.

The exact day when the Sun stopped setting on the Empire was probably sometime in the late 1700s or early 1800s, when the first Australian territories were added.[2]

The Empire largely disintegrated in the early 20th century, but—surprisingly—the Sun hasn't technically started setting on it again.

Fourteen territories

Britain has fourteen overseas territories, the direct remnants of the British Empire.[3]

(Many newly-independent British colonies joined the Commonwealth of Nations. Some of them, like Canada and Australia, have Queen Elizabeth as their official monarch. But they are independent states which happen to have the same queen; they are not part of any empire that they know of.)

The Sun never sets on all fourteen British territories at once (or even thirteen, if you don’t count the British Antarctic Territory). However, if the UK loses one tiny territory, it will experience its first Empire-wide sunset in over two centuries.

Every night, around midnight GMT, the Sun sets on the Cayman Islands, and doesn't rise over the British Indian Ocean Territory until after 1:00 AM. For that hour, the little Pitcairn Islands in the South Pacific are the only British territory in the Sun.

The Pitcairn Islands have a population of a few dozen people, the descendants of the mutineers from the HMS Bounty. The islands became notorious in 2004 when a third of the adult male population, including the mayor, were convicted of child sexual abuse.[4][5]

As awful as the islands may be, they remain part of the British Empire, and unless they're kicked out, the two-century-long British daylight will continue.

Will it last forever?

Well, maybe.

Four hundred years from now, in April of 2432, the island will experience its first total solar eclipse since the mutineers arrived.[6]

Luckily for the Empire, the eclipse happens at a time when the Sun is over the Cayman Islands in the Caribbean. Those areas won't see a total eclipse; the Sun will even still be shining in London.

In fact, no total eclipse for the next thousand years will pass over the Pitcairn Islands at the right time of day to end the streak. If the UK keeps its current territories and borders, it can stretch out the daylight for a long, long time.

But not forever. Eventually—many millennia in the future—an eclipse will come for the island, and the Sun will finally set on the British Empire.

20 Jun 15:50

Reader Replacement Recommendations?

by Luke Maciak

In March I wrote a lengthy post about death of Google Reader and my out of control subscription list that I could never even dream of keeping up with. Well, I managed to solve one of the problems I mentioned in that post: I curtailed my subscription list. I mercilessly culled out all the dead blogs and unsubscribed from any high-volume publications I no longer had active interest in following. I went from 400 blogs, to less than 40 and I can typically zero-out my unread count every morning or at lunch without even breaking a sweat. Feels good man.

Not only that, but my OPML suddenly got much, much more portable. As a result I have been able to shop around for a replacement to the venerable old Reader much more efficiently. I tried couple of other services and the one I spent most of my time with was Feedly. It is actually a really nice service – the interface is great, and the fact it syncs up with Reader made switching to it incredibly easy. All I had to do was to sign in and authorize it with my Google account and I was ready to go. It also had a very nice iOS app that went with it which was a huge bonus.

That said, the service is not without flaws. Firstly, for some strange reason it requires you to use a browser plugin. Most of the processing is running locally and changes are asynchronously synced with the back end whenever it feels like it. Most of the back-end heavy lifting seems to still be handled by Google, with the Feedly website being there to just coordinate things. Despite off-loading most of the work to the client and to Google, Feedly still couldn’t keep my read-counts straight on some days. Rather frequently stuff I clicked through on my laptop or on my phone would still show up as unread on my desktop. I kinda figured this might have been glitches caused by them transitioning away from Google and towards their own independent back end so I didn’t really fret about it to much. It wasn’t until I realized Feedly had no export option that I decided to abandon it.

Yes, you read that right. Feedly does not currently have an OPML export feature. It is dumb easy to switch to Feedly, but virtually impossible to get out of it. Fortunately former Reader users that suynced their subscriptions over still have option of logging back to Google and exporting their feeds that way. Any feeds added to Feedly do still sync back to Google so you won’t loose anything. If you however set up a “proper” Feedly account without Reader integration you are utterly fucked. Allegedly the OPML export functionality is on their TODO list, but currently rather low on the priority list with the looming demise of Reader drawing near.

I decided to play it safe, and quit while I still could. If and when Feedly chooses to add an export button I might give them another chance. Until then however I’m out. I really do not want to get locked in – especially now that I got my shit in order, and I’m actually reading my feeds regularly again. So once again I’m in the market for a good feed reader.

Recently, Chris chronicled his own quest in search of a Reader replacement. Seeing how I have more or less the same list of requirements as he does, I figured I might as well follow his lead. After testing a number of different services he settled on The Old Reader. I figured I might as well give it a try. My first impressions are rather positive. It is a proper web application, and thus it suffers from no weird local sync issues. It does not have a sync-functionality with Reader which makes migration a little bit more annoying, but is actually a good thing in the long run. It is uncertain how exactly Feedly servers are going to behave the day Google Reader closes – the Old Reader on the other hand can be expected to work exactly as it does not since it never actually used Google service as a back end.

The user interface is very simple (spartan even) and bootstrapy but that’s actually not a bad thing. They are using a responsive design, so it scales very well to a mobile screen. It is clean, functional and it does everything I need it to do. My only complaint is that it is noticeably slower at picking up new entries than Feedly. That said, I’m fairly sure Feedly is currently cheating and using the Google Reader magic indexing powers to refresh their subscriptions. So who knows how it will behave next month. Perhaps it is not that The Old Reader is slow, but that Google Reader has conditioned us to expect nearly real-time feed refresh rate which are nearly impossible to achieve unless you happen to have Google’s army of web crawlers at your disposal.

You know what’s the best part? If the performance continues to suck, or if I find a better alternative, The Old Reader has this on the bottom of its settings panel:

The Old Reader Export

The Old Reader Export

Yep, I get a one-click access to my up to date OPML that I can download and import to a competing service at any time. That feature alone more than makes up for the slower refresh rate. It gives me a peace of mind, and confidence that the team behind the service is actually interested in providing its users with a valuable service rather than in capturing, locking in and capitalizing on the once in a lifetime opportunity that is the Google Reader closing and subsequent user migration.

So, what feed reading services have you tried since Google announced the closing of Reader? Are you still shopping around or have you picked a replacement you are going to stick with? Is there any service you would recommend? Much like Chris, I prefer a cloud based solution that can be accessed via a web browser from anywhere, and I’d rather avoid the headache and hassle of configuring and running it on my own server. A working iOS app is a plus, but not required as long as the site is usable on the phone.