HTML5, CSS3, jQuery, JSON, Responsive Design...

Domino Data Services in Domino 9 - first fumblings!

Michael Brown  April 9 2013 06:12:34 AM
I've been playing with Domino Data Services in Notes/Domino 9.

I've never looked at this in Domino before.  And every bit of info that I found on the subject, when I did start looking, seemed to tell me that I had to write xPages, dojo.js controls and install the xPages Library from openntf.org.  Maybe that was true in the past, but with Notes/Domino 9 you don't need any of that to get started.  Everything I've played with so far involved no more than a bit of JavaScript and jQuery.  Here's the official documentation that I followed:

http://www-10.lotus.com/ldd/ddwiki.nsf/xpDocViewer.xsp?lookupName=Domino+Data+Service

You can see that there's all the standard CRUD (Create, Read, Update, Delete) commands that you need, i.e. POST, GET, PUT and DELETE.  Plus there's another one called PATCH, although I'm not sure why that's required when you already have PUT.  Hell, there's even computwithform switches to let you run form formulae on save!  Everything you need to start building RESTful services, in fact.

There's some housekeeping before you can get started.  You have to enable Domino Data Services (which I'll abbreviate to DDS from this point on) at the server level, the database level and possibly at the view level too.



Enabling At Server Level

Open your Server document (or Web Site document if you're using those) and look for the Domino Access Services section. It's under the Internet Protocols -> Domino Web Engine tabs on the Server document, or under the Configuration tab on the Web Site document.  There's only one field: Enabled services.  Set it to "data" and save your document.

I restarted the server at the point, although I'm not sure it was necessary.  A "tell http restart" might have been enough.


Enabling at Database Level

Open your Database Properties using the Notes client.  Under the far-right, "propeller-head" tab, you should see a new field: Allow Domino Data Service.  In Notes 8.5.3, I believe you needed a notes.ini variable set to see this field, but in Notes 9 it's just there.  Set it to "Views and Documents".


That's all the housekeeping you need do for some simple testing.  Now let's get into some code.


A Sample GET

This example makes a jQuery Ajax call to the sample NAB/Directory database, called fakenames.nsf.  It uses DDS to query /api/data/documents to return JSON data about those documents.  NB: /api/data/documents is one of the fixed paths used by DDS; there is no actual view/folder of that name in the database design, at least not a normal one that you can see in the Designer.

$.ajax({
  url: "/tools/fakenames.nsf/api/data/documents",
   type: "GET"
});


Here's a sample web form that uses the code above to retrieve the documents JSON data and display it on the screen when you've clicked the button.:

http://184.73.169.93:8080/mike/testjson.nsf/ftforms/testget


A Sample POST

The example code makes a POST to the same test NAB/Directory database.  It uses a jQuery Ajax call to pass (stringified) JSON to create a new Person document with defined FullName field.

For RESTful services, however, it's little use to be able to POST/create such a document without getting a handle on a unique ID by which you can then access it again.  In Notes, of course, what you want to get is the new Document Unique ID (or UNID)  And thankfully, the DDS POST call does pass the UNID back to your callback function as the Location parameter, but you do have to dig around a little find it.  The Location parameter is actually in the Response Header of the callback though, and you can access this via jQuery's .getResponseHeader() method.  You can see this in the .done() function call below.  (NB: .done() is replacement for the now deprecated "success" function in jQuery's $.ajax() function.)

var newPersonObj = {Form: "Person", FullName: "Benji Marshall"};
$.ajax({
 url: '/tools/fakenames.nsf/api/data/documents',
 type: 'POST',
 data: JSON.stringify(newPersonObj),
 dataType: 'xml',
 accepts: {
        xml: 'text/xml',
        text: 'text/plain'
 },
 contentType: "application/json"
}).done(function(data, textStatus, jqXHR) {
 var newPersonLocation = jqXHR.getResponseHeader("Location");
});


Here's a sample form to test the POST:

http://184.73.169.93:8080/mike/testjson.nsf/ftforms/testpost

Enter a name and click the button.  DDS will create a new document, grab the Location parameter of the new doc and display it on the screen as a clickable URL.  Clicking on that URL actually returns JSON data about your new document.  That's because it points to your new UNID at /ap/documents/unid, which is another special path used by DDS.  Once again, there is no actual view/folder of that name in the database design that you can see in the Designer client.


Notes 9 on (K)Ubuntu 13.04 64-bit

Michael Brown  April 9 2013 03:19:31 PM
As with Notes 8.5, it takes a  bit of hacking to get Notes 9 to run on 64-bit Linux.  You need to install the 32-bit compatible dependences but unfortunately, not all of them appear to be available.  So, you'll have to hack the installer .deb files to remove those dependencies, recompile a new .deb, and then install that.  Thanks again to http://usablesoftware.wordpress.com for some pointers.  I installed on Kubuntu 13.04 Beta 2, but this guide should also work for Ubuntu.  (NB: Kubuntu 13.04 uses KDE 4.10, which is seriously fast!  If like me, you've previously turned your nose up at KDE for being slow and bloated, you may want to give this release a try.)  As ever, you follow these instructions at your own risk.  They worked for me!


Installing compatibility libraries

First, you need to install some extra computability libraries by pasting the following into a console:
sudo apt-get install ia32-libs libgnomeprint2.2-0:i386 libgnomeprintui2.2-0:i386 libgnomevfs2-bin:i386 libgnome2-0:i386 libgnomeui-0:i386 libjpeg62:i386 grep:i386 libgconf2-4:i386 libpam0g:i386 libxkbfile1:i386

You may see some scary looking warnings about only installing these files "if you know what they do".  Of course, you know what you're doing, don't you?

You've now installed all the i386 compatibility libraries that you can.  Notes still won't install though, because there's still some libraries that don't appear to available.  (I couldn't find them anyway.)  Those libraries are libcupsys2 and one of the libgnomedesktop libraries.  The only way that I could get around this was remove those dependencies from the installer.

Removing Dependencies from the .deb file


NB: if you don't have Passport Advantage access, trial versions of the Notes/Domino 9 are available at http://www14.software.ibm.com/webapp/download/brand.jsp?b=Lotus .
  1. You need to create a folder structure to host your build files.  I called my top-level folder "buildnd9".  Below that you'll need a "debian" folder and then below that, a "DEBIAN" folder.  (Note the case.)  So you structure should be buildnd9/debian/DEBIAN.

  2. Right click on your ibm-notes-9.0.i586.deb installer file and open it with your archive manager from the pop-up menu.  In Kubuntu, you use Ark, but I'm not how it's done in Ubuntu these days.  

  3. In your archive manager, extract the two files control.tar.gz and data.tar.gz to your top level folder.  Note: the drive to which you extract the folders must be a Linux formatted partition - e.g. EXT3 or EXT4 -  and not an NTFS or FAT32 formatted partition. Otherwise you will run into file permission errors when you try to build your new .deb later on.

  4. Open the data.tar.gz file with your archive manager.  You need to extract all the files within it to your debian (lower case) folder, preserving any folder paths as you extract.

  5. Open the control.tar.gz file with your archive manager.  You need to extract all the files within it to your DEBIAN (upper case) folder.

  6. Navigate to the DEBIAN folder and edit the file called "control" using your text editor (Kate on Kubuntu, Gedit on Ubuntu).

  7. Within Gedit, you need to remove some dependencies from the control file.  Look for the line that starts "Depends:".  You need to delete "libcupsys2" and all of the "libgnome-desktop..." files.  Save your new control file.

  8. Open a terminal console and cd to your top-level folder, e.g buildnd9.  To kick off the build of the new .deb file, enter the following into the console:
    dpkg-deb --build debian
    Note: that's two dashes in front of the word "build".

  9. Let dpkg --build do its thing.  It may take a couple of minutes, depending on how fast your PC is.  When it's finished, you shoud have a new deb installer file called debian.deb.  Rename it to something more descriptive, e.g. notes-9.0.i586.dependencies-adjusted.deb.  Install Notes using the new .deb, i.e.:
    sudo dpkg -i inotes-9.0.i586.dependencies-adjusted.deb

Windows to dump desktop altogether?

Michael Brown  March 29 2013 05:29:26 PM
You hate Windows Metro (or whatever they're calling it this week)?

You've installed Classic Shell, or StartX, or some other utility that takes you straight to Windows 8 Desktop mode, so you can avoid Metro altogether?

Hanging out for the next release of Windows?   You know, the one where Microsoft gets hit around the head with the big clue stick and puts everything right that's wrong with Windows 8, like Windows 7 did with Vista?

Time to get real, sucker!

The next version/service pack of Windows, code name "Windows Blue", has already been leaked, and it seems that there's more Metro than ever!  No changes to the Desktop at all.  Could this be the be end of the road for the Windows Desktop?  Microsoft cheerleader extraordinaire, Paul Thurrott, certainly thinks so: "this is clearly an indication of how we get from here (Windows 8) to there (Windows 9, with potentially no desktop)" he says at one point in his hands on review.

Think about what that's going to mean for your company.  Sure, we can take it as read that there will be a Metro version of Office.  But what other desktop apps do you rely on?  A Metro version of Photoshop, for example?  No sign of that yet.  And how usable would such a thing be, I wonder?  And all your in-house line of business apps?  You better hope they run through a browser or you can kiss all those goodbye too!

It's not all bad though: apparently, the new Metro will allow you to have four whole applications displayed on your screen at the same time.  That's double, or an an increase of 100% if you like, the number of apps you can display with Windows 8 Metro!!  Thank you so much, Microsoft!  Where do I sign up?  Oh, and I'm in Australia, so don't forget to charge me double what the rest of the world pays.

How to get U.S Netflix and BBC iPlayer in Australia

Michael Brown  March 1 2013 03:32:57 AM
For the various people that have asked me in the last few months, this is how to get U.S. and U.K. streaming video content if you happen to live outside of those areas...like me!

Although the article is really about how to get U.S. Netflix content on your Australian iPad, you can also use the Unblock Us service to access the BBC iPlayer and the ITV Player from outside the UK.  I've used the latter to watch Downton Abbey through a PC web browser, for example.  If you're an Android/Linux user then there's no reason that this shouldn't work for your devices either, although I've not tested that.

Legality thereof?  Well, you're paying Netflix in the U.S. to watch their content, so I don't see how anybody can paint you as a pirate.  The local rights holders won't be happy of course, but well.. screw 'em, I say.  They buy up these foreign TV shows and then sit on them for months, sometimes even years.  Sorry, but the world's not like that any more.

There are signs that things are changing though; FX, who are the Australian rights holders for the Walking Dead, now boasts that they show episodes within days of their U.S broadcast.  But until more Australian channels get the idea...

http://apcmag.com/access-netflix-on-your-ipad.htm

Major downer: Unblock Us doesn't work over mobile phone networks.  You have to be on a WiFi or wired network connection.

If you have a jail-broken iOS device, then check out GuizmoDNS, available on Cydia.  It lets you easily toggle your DNS setting between U.S and local modes.  Because remember, if you've switched your DNS settings to the Unblock US servers, as per the APC's article, then any Australian streaming services, like the ABC and Channel 9, are going to see you as "foreign" and will likely block you because of it!

PC Pro: "Windows 7 still being sold on up to 93% of British PCs"

Michael Brown  February 20 2013 04:10:17 AM

"The vast majority of British-assembled PCs are being sold with Windows 7, not Windows 8, according to several system builders contacted by PC Pro.... 'Customers struggle to find their way around [Windows 8]'".

Well, who'd have thunk it?


http://www.pcpro.co.uk/news/380044/windows-7-still-being-sold-on-up-to-93-of-british-pcs



Paul Thurrot - Surface’s lack of storage "doesn’t matter"!

Michael Brown  February 5 2013 02:29:56 PM
An unintentionally hilarious rant from Paul Thurrott on last week's Windows Weekly podcast.  I've always enjoyed that show, but there comes a point when you cross the line from being a fan of a particular product to being its, well... I don't like the word "Shill".  But let's say, that a loss of perspective can ensue when you've defended the indefensible for too long.  And I guess that Lotus Notes aficionados are as much as risk as anybody on that score!

What provoked Thurrott's is the amount of local storage (lack thereof) on Microsoft's Surface RT and Surface Pro tablets.  FYI, the "64 Gig" version of the Surface Pro - and they really should be put the figures in quotes on the box - will only leave 23 Gig available to the user.  Windows will eat a full 43 Gig for itself!  Read on to find out how it's all your own fault if you're not happy about this!

http://twit.tv/show/windows-weekly/297


"Should people be freaking out getting less than half the stated storage for themselves?" asks stand-in host, Iyaz Akhtar, to kick things off (at about the 30 minute mark).

"No they should not", is Paul Thurrott's firm rely, and he's off.   "We don't have the same needs for local storage that we used to, so I don't understand all the complaining about this".

Paul's used a lot of tablets you see, and has "never run out of space on any of them".  Mary Jo Foley, who later to confesses to only ever running Notepad (yes, Notepad!) and web apps on her Surface RT, doesn't see a problem either, funnily enough.

"Let me play Devil's advocate here", says Iyaz.  I.e., let me point the completely obvious flaws your arguments, such as the fact hat other tablet OSs manage not to eat up 41 Gig of their 64 Gig allocation.

That really sets Paul off.  "The issue is that the people complaining about this are hypocrites" he thunders.  Why'?  Because "you knew going into this that Windows 8 is Windows 8.  It is of whatever size…You don't buy a Surface because it has some about of space on it.  You buy it because it's a Windows computer and that's what you want".  He goes on.  "People who buy an iPad want an iPad.  They don't really care about how much space is on the thing."  Hmmm… that must be news to Apple, who've just released a 128 Gig iPad, with no extra new features except for that extra space.

"If somebody sees an ad for a Surface Pro…that it has 23 or 80 or whatever Gig of space is not gonna change those people's minds…The people who *are* complaining about this thing… it's this self-righteous indignation thing…If you care enough to know that amount of space is unacceptable then you also know that … this is not an issue."

Wow!

But Paul's not finished.   He veers off onto battery life, although nobody's asked him about that.  (It's only going to be about 5 hours on the Surface Pro, by the way.)  Speaking of the iPad's battery life, he says "Who cares if you can't run Office?…What are you doing to do with 9 hours of battery life?  Are you watching movies or something?…I'd rather have 5 hours of battery life and get some work done…I'm not going to get 5 hours of work done on an iPad…It's like a fake argument.  It doesn't matter….It almost completely doesn't matter at all."

So there.  After 5 minutes of chasing his own tail around, you get the feeling that Paul's pretty much convinced himself that this is all true.

Paul's conclusion is a real mind-blower.  It's because "Microsoft is trying to … make decisions like Apple does."  

Yep, just like Apple!  Apart from the bit where Apple actually knows what it's doing.

Half-life now runs natively on Linux

Michael Brown  February 4 2013 04:57:59 AM

Half-life running natively on Kubuntu 12.10 64-bit:

Half-life on Linux

Sadly, it's the original version rather than the Source version, which had some improved graphics.  I'm sure that's on the way though, along with Half-life 2, Left for Dead and the rest of Valve's games!

 

Choice.com.au reports Microsoft’s Surface to Australian authorities

Michael Brown  January 24 2013 04:21:59 AM
Surface RT disk sizes

Heard the one about the 16 Gig version of Microsoft's Surface RT tablet?  There's no such thing.  Ahh, but do you know why?  It's because the OS and the supplied apps take up 16 Gig for themselves.  So a 16 Gig version would have precisely eff all storage available to the customer!!

And that's why the Surface RT starts out at 32 Gig.  And there's the rub.  Can they really call it a 32 Gig version when the customer only gets half that to play with?  Especially when Microsoft isn't exactly going out of its way to advertise that little factoid by, for instance, mentioning in the device's box.

Australian consumer watch group Choice thinks not.  And they've reported Microsoft to the ACCC (Australian Competition and Consumer Commission) over it.

http://www.choice.com.au/media-and-news/consumer-news/news/tech-giant-referred-to-the-accc.aspx

Not sure how this one's going to play out.  Microsoft's defenders point out that all PCs and tablets reserve some disk space to themselves.  The iPad takes 2 or 3 Gig, for example.  But 16 Gig??  That's just taking the piss, IMHO.  So here's hoping Microsoft gets the slap from the authorities that it so richly deserves.

Disclaimer: I'm a Choice subscriber myself, and proud of it!

Image courtesy of Choice.

Steam on Linux!

Michael Brown  January 10 2013 02:52:49 PM
At long last!

This is the native Steam client beta, running on Kubuntu 12.10 64-bit:

Steam on Linux

No tweaks or anything needed for 64-bit.  Just download the .deb and off you go.

Okay, it's not going to set the world alight with its 41 games currently listed, and only of them from Valve itself (Team Fortress 2).  But it's a start!

Windows is crap, part 583 - reinstalling

Michael Brown  January 9 2013 01:53:02 AM
Frying in the heat!
We had a power outage last night due to the ferociously hot weather: 43 degrees Celsius!  (That's 110 degrees Farenheit.)  Not just any power outage though; not a clean one where the power just goes off.  No, this was more of a brown-out: the power was still trickling through, but massively reduced in ... ermm.. power!

So, the lights were on but very dim.  The digital clock on the microwave still displayed but did not tick over; it remained at the same time.  And so on.  This went on for about 10 minutes before we lost power completely.  Two or three hours before it came back on again and everything was back to normal, or so it seemed.  Until I tried to boot my PC in the morning, and it didn't want to play.  It gave me a grub boot error, saying that it couldn't find something or other.

Bottom line, one of the five (yes, five!) had drives in there was fried.  It was a 60 Gig SSD that contained my Windows 7 and Linux/Kubuntu partitions.

Off to Orange IT on Sydney's George Street this afternoon, and picked up a new 128 Gig SSD for a mere $69!  A year or two ago I was paying over $100 for SSDs half that size.  Got the new drive mounted in place of the fried one, put in my Windows 7 install CD and rebooted.  Off we go!  Except, we didn't.  It got as far as letting me select my new drive for the installation of Windows, before throwing the error "Windows 7 setup was unable to create a new system partition".

I tried every option I could think of: the drive empty, the drive pre-formatted as FAT32, the drive pre-formatted as NTFS, and so on.  A quick trip to the forums brought the solution straight away, but I spent another half and hour searching because I didn't think that the problem could be anything so stupid.  (I forgot I was dealing with Microsoft.)

Other OSes?  What are they?

What I had to do was power down the PC, open the case and then disconnect every other drive in there except for the one that wanted to install Windows 7 on!!!  Yep, Windows is too damned stupid to cope if it sees multiple drives, or maybe there was something on one of those drives that freaked it out.  Hardly surprising given how Microsoft's been demonstrating their breathtaking arrogance in this field for years.  No need for them to write an OS installer that can cope with the presence of - whisper it - other operating systems.  It's simply not in their DNA.  After all, their OS is the one that dominates the desktop (for now) so why should they bother?  Everybody else can program around them, as far as they're concerned  Incompetence or malice?  It's so hard to say: Microsoft has both commodities in abundance.


Drivers You Mad

So, I got Windows 7 installed and to give Microsoft credit, the installation was commendably brief.  Time to download the latest graphics drivers then.

Stop right there!  There's no internet connection!  Huh?  This isn't wireless: I'm connected directly to the router over ethernet.  Where's my internet connection?  Then I seemed to remember... yes, I rummaged through my shelf of installer CDs and there it was: the Windows drivers for the motherboard.  Yep, Windows, which is famed for its supposed compatibility with like everything, needs a special driver just to work the freaking ethernet port!  That's a little trick that Linux - you know, Linux, where you have to compile everything from source using arcane command line switches - has managed to do out of the box for as long as I've been using it (about six years).