Thursday, 7 February 2013

Thursday thought - QR codes

Have you ever played with QR codes?

We used them at our SAGE booth at the Perth conference to link to our conference beta mobile application. I stumbled across one idea recently, possibly via Martin - my electronic signature

My nail in the head? #matrixreference
This gave me a sobering thought - it's another brick in the wall towards a world where we communicate with each other with a twitter-esque environment but with a tightly coupling of electronics & biology, and this is the stamp on our painting, so to speak, detailing whatever information will be required to identify us.

Too much?

Tuesday, 5 February 2013

Syntax differences between JavaScript & PL/SQL

I'm sure anyone who's worked with multiple programming languages - particularly at the same time - can attest to the occasional slip-up.

It's just unfortunate that they are just so hard to debug. Take these two statements
console.log('id:' || this.attr('id'));
console.log('id:' +  this.attr('id'));
Both are valid JavaScript statements & both work - in that the execute without error, but one returns the ID attribute value as debug output.

Thanks to Tom in the forums for helping me see what I missed
https://forums.oracle.com/forums/message.jspa?messageID=10654246#10654246
For those with a strong, habitual PL/SQL background such as myself, I think making this mistake at one point was pretty much inevitable.

Basically the first one accepts to expressions within an OR statement, while the second concatenates the two strings as desired.

It makes me wonder how many times strange things like this happen with human language. I'm sure there are some good analogies out there.

I certainly don't envy those people constructing multi-lingual applications - not that much demand here down under :-)

Scott

Wednesday, 30 January 2013

Dynamic Action hidden False actions

I thought I'd share what's quite literally a hidden problem I experienced in 4.1.1 involving dynamic actions.

The project used hundreds of dynamic actions, and often I would copy them between pages.

Something to watch out for, however, is the cleaning up APEX does with dynamic actions in it's own builder. I've notice in the past the meta-data I saw in dictionary views contained stale information, hidden after no longer being needed when adjusting some other attribute - like condition types.

By looking at the stock debug, I noticed that a good portion of my page render time was for dynamic action plug-ins. One of these was for the notification plug-in supplied by Oracle (gritter). Over time the number of notifications on the Global Page Zero had grown - but in my case could be consolidated using &ITEM. substitution syntax to define the title & message.

But there were still more instance of the gritter notification in the rendered page sauce than was expected, so I looked a little harder...

In regard to dynamic actions, beware the non-condition - in past I must have copied this from another action; removed the event "when" condition; the false action region was hidden from the developer, but and a false action remained - causing unnecessary rendering of a plug-in, hence performance issue. What a paragraph, hope that made sense!

All I saw when editing the item were the True actions.
True actions for DA with no JavaScript "when" event condition
By changing the when condition to "equal to", I was able to see the previously hidden False action.
screenshot actually from 4.2
Sure enough - there it is
A hidden False action, displayed when condition restored
So I had a few false actions to remove that would never fire.

You can find such cases yourself with the following SQL - I used this query to check for other issues.
select * 
from   apex_application_page_da d
-- no when condition present
where when_condition is null 
--and dynamic_action_name = ''
and application_id = 104
and page_id = 0
and exists  -- a false condition
  (select null 
   from apex_application_page_da_acts a
   where a.dynamic_action_id = d.dynamic_action_id
   and dynamic_action_event_result = 'False')
/

I saved about .05 seconds each plug-in render, so notifications in page zero added up over time. I saved about third of a second in my clean up of these alone. Plus I was finding other minor performance gains - they all add up!

Scott

Tuesday, 29 January 2013

Learning Oracle APEX? Try these books

If you're a reasonably confident Oracle developer and want to learn Oracle Application Express via books - I would recommend the following:

Start:

Pro APEX 4 - I read the original and I trust the updated would be even better. Start strong and solid.

Detail:

Expert APEX - compendium of great topics written by multiple authors, for a good cause.

Refine:

APEX Best Practices - Brilliant book to help make sure you properly apply what you've learnt above.

Future:

APEX Mobile - to be released this year, if you want to keep working in Oracle web development this decade, you'll need to read this. It's been brilliant so far.

Update August 2016
Time have changed, APEX 5 provides big improvements in development productivity and style, and the Universal Theme changes things, too. Look here for the best list of APEX books
apex.oracle.com/books 

For added bonus, here is one on APEX Security - on my to read list but the chapters look spot on.

Some of these I've reviewed already, plus others that are available.

If you want to keep up-to-date with what people are doing around the world, or pick up tips and tricks - subscribe your preferred blog reader to apexblogs.info - an aggregation of Oracle APEX blogs

For those perhaps not so confident, or would like to see things being done instead of reading them - I'll be publishing something early this year - stay tuned!

Scott

Thursday, 24 January 2013

What if Google went bust?

Ever consider that? What would you lose?

During life we put a spectrum of trust in different areas, depending on our own risk assessment. We originally entrusted our tribe members to help protect the community. Now, we might give a dollar to a little boy to fetch us something, and we might not get it back. Who cares? it's a buck.
We trust out mortgage to the banks because they have a proven history of money management.

So what about your data? I trust Google with a lot of my content. In fact, not really content, but information. Dates, numbers, links, hints, prompts, memories...
It's hard to back up because it's a network of information. A lattice that Google so elegantly lets you search.

We occasionally joke about our reliance on these modern devices when an old fashioned diary will do - but what happens when you lose that? I was listening to an interesting podcast recently from our public broadcaster ABC, a program called "All in the mind". A recent discussion on memory suggested we've been using these aids in various forms to help us remember from computers to paper to papyrus to cavern walls - so what's the matter with using this tool aiming for a device harmoniously engineered for bio & robotics. Well, maybe I added some thoughts in the description - but a program well worth a listen.
http://www.abc.net.au/radionational/programs/allinthemind/new-document/4420956


On a slight tangent (ba-dum), searching is an interesting topic itself - what if all information humanity knows about the universe was in a cube the size of a dice? Search facilitation would have to be impeccable. Search companies are never going to die (altavista? well, companies that aren't a verb in the Oxford English Dictionary)

If Google went bust, I'd be in the doo doo.

So what about your personal finance software? What if that went bust? or your hard disk died? laptop stolen? fire?
How much information would you lose? How easy is to backup? Copy the export to a disk, thumbdrive, cloud service, cd - somewhere off-site.

And know how to get it back.

Risk vs benefit vs simplicity.

I have what I feel is a very strong password - that's all you need, right? Remember the TV show "Weakest Link", think about that with your security. Cars used to be hot-wired, now they can't so criminals steal keys out of houses.

Heck, what happens when our cars start integrating via bluetooth with more intelligence to other aspects of your life? Smartphone applications getting more advanced and integrated than Google's My Tracks or Angry Birds.

People are being asked to put passwords everywhere now right? People using simpler passwords and not caring about that added security because it's too hard an unnecessary - who would be interested in me, right?

Shit happens and sometimes it gets up your nostrils. People might start to take notice - sites are providing shared authentication through a number of accounts - google, facebook, twitter - so the closer we get to one-size-fits-all authentication, we can perhaps think about just having one good, strong, but easy to remember password.

So, passwords is too strong for a super duper force of networked computers to hack? well try basic social engineering.

I think everyone should read the story of Mat Honan, a man who's heavily invested digital life was destroyed with a simple phone call.
http://www.wired.com/gadgetlab/2012/08/apple-amazon-mat-honan-hacking/all/

He lost all his information, and tells the horrible story of someone gaining access to a single point of his online identity, then trail blazed from there - just by someone pretending to be him on a phone, getting a password reset. All because they liked his 3 letter twitter handle.

I've had this rambling drafted for a while, and now I encounter the perfect concept to take away from this - Google has now announced a war on the password.
http://www.wired.com/wiredenterprise/2013/01/google-password/

I've always had interests in various security aspects of computer science, and I think this will be an interesting part of the journey. I wonder which science fiction writers ended up being right in helping us imagine the future we encounter?

When will we close a year of technology and comment on the general disappearance of the common password, gone like the day of the 3.5" disk that fits perfectly in your starched shirt chest pocket?

Wednesday, 23 January 2013

Which pages are locked in APEX?

Would you some SQL to tell you which pages are locked?

As far as I could tell, there is no data dictionary view that this information.

So I found this using the all_tab_columns view
SELECT 
  id
 ,flow_id
 ,object_id
 ,locked_by
 ,locked_on
 ,lock_comment
 ,security_group_id
FROM apex_040200.wwv_flow_lock_page
WHERE 1=1
--AND   flow_id   = :APP_ID 
--AND   object_id = :APP_PAGE_ID
/
I used it to add a region (bound to a build option) that displayed a notification in the sidebar to other developers that the page was locked and under construction/change/development.

Scott.

ps - can you find the joke on this post?

Thursday, 17 January 2013

Thursday Thought: Helicopters, batteries & squid

First of all, this photograph was difficult to take.

Second of all, this is one of the most fun inventions ever.

And I have a greater respect for helicopter pilots. I found an even better backdrop, but this little thing is highly sensitive to wind.

The question I'd like to ask is - when are scientists going to make even moderate gains in battery efficiency? This thing last less than 20 minutes per USB charge.

Update 2013-1-24
I have some data points - only 3, but better than a guess.
MI:SS

08:44 - in garage, wind affected,  charged previous day, left to drain?
16:13 - inside home, occasional breaze, longer flight times, recent charge, flying lights on - did I write down total, not lap time?
07:30 - inside home, occasional breaze, longer flight times, recent charge, flying lights off

04:47 - inside home, light breeze, mostly flying, charged previous day, left to drain? 
07:26 - inside home, light breeze, mostly flying, just charged

I've gathered no data as yet on charge times.
I want a bigger copter ;-)


Imagine what scaling down battery size, the way microcomputers and hard disks have paved a path to miniature. After healthcare, of course, think about what you might like to do?

Think exploratory devices - for caves you could use perhaps like the ones I just saw in Prometheus, but as quadcopters? Clever people are already using these to map rooms and find things, good steps towards disaster relief efforts.

But my number one would be the oceans.

Who shall I quote talking about how much we know about astronomy and cosmology, compared to the dark, inhabitable depths of the world's ocean. 95% of ocean ready to be explored - the other, final frontier.

All this seeded by the announcement of footage of a giant squid airing recently on NHK - I can't wait to see that footage on Discovery.

Impressive as this is, finding a kraken would be the one cryptid I'd like come true!

Who knows what other discoveries could be made by an autonomous, sensor laden, self propelling robot with the capacity to last for days?