04/09/2009

Lotusphere on tour

Tags: :
0
Yesterday I attended the Lotusphere comes to you conference in Washington DC. It was a good day out - learned a lot about Connections 2.5, Sametime 8.5 and then the day was spoiled by a terrible websphere portal presentation. It was a sales pitch and not a techo/cool presentation like the others. It had the opportunity to tie the rest of the day together and it failed miserably.

Oh well :)

02/08/2009

Java References

Tags: :
0
Setting up Eclipse to debug your Lotus Notes Java Agents
(Using Lotus Notes with Eclipse to manage and run your Java programs)
http://www.ibm.com/developerworks/lotus/library/notes-eclipse/


Eclipse Tutorials






02/08/2009

Marky goes forth into Java

Tags: :
0
Many years ago it seemed clear to me that I was moving away from development and more into a project management role within my company. I said at the time (circa 2004) that the true test of whether I was a developer or not would be if I learned Java.  And it is 2009 and I have little to know practice experience with Java. It is clear to me that I have missed on a huge opportunity to expand my learning and solve many of the practical day to day problems we have with my customer.

I am going to have to learn Java (or at least a smattering) in the next few months as I have tagged myself on 3 projects to be completed before the summer and they all require Java. Sametime, Omnifind and Digital Signatures. The only problem is who is going to be doing the program management - and we're working on that one as well.

What I want to do it track my journey as a help to anyone else daft enough to follow behind. If nothing else i am very good at doing the research and using other people as sources of information. So why not collate it..........for myself as well :)


01/25/2009

The Fredericksburg Pub......Best Fish and Chips in America.....!!

Tags: :
0
So there is a chain of "British Pubs" (www.luvthepub.com) sweeping the nation apparently and the newest opened 10 days ago in Fredericksburg, VA.

Multiple people have told me I must go and I would love it - and we went, and I did :) and I didn't :(

For those of you unfortunate to have never been to England and been to a real pub you have to understand that there really is nothing like it (as a whole) in the USA. A Pub is a social focal point for the community point where people have a beer or two and walk home or take public transport home to - so other than in old (e.g Boston) built up areas this just does not happen...

So this "Pub" is at the back of the Mall a mile of so from the interstate (not a good start). but the inside looks vaguely pubbish and the bar looks pretty awesome. They have Rubgy on the tv - RUGBY!!! and they server some pretty good beers. The Guiness is excellent, Fullers ESB is very good and the Old Speckled Hen was pretty much as I remember it. The menu had Fish and Chips on it, Bangers and Mash and Shepard pie...looked promising. I had the pie and the wife had the fish and chips.....I was robbed :(

The fish and chips was fantastic - I mean seriously one of the best I have had in america. The Sherpard Pie was not bad - but it was a LOOOONG way from being Shepard Pie. It has mozzarella cheese on it?!?! There was no gravy in the minced beef?!?!?! but the Fish and Chips was fantastic!!

So overall score:

beer 8/10
food 6/10 (except fish and chips 11/10)
atmosphere 7/10 (same as any other mall restaurant really)

When I have a craving for beer and fish and chips we will be going back.


01/22/2009

Fat Rib blankets

Tags: :
0
My daughter's name for a bra

Check out www.fatribs.com :)

01/21/2009

Netgear ReadyNAS Duo

Tags: :
0
I got money from my parents for Xmas and with it I splurged on a Network Backup storage solution - the Netgear ReadyNAS. Like all the Netgear products I have bought it was dead easy to set up and I was backing up over the wireless network in less than 30 minutes.

I am SO happy to finally get all the years and years of files (which I honestly probably don't need but don't want to delete), backed-up and off the many portable harddrives, CDs, DVDs and computers I have around the office and home.

The product only comes with one drive (I guess to keep the cost competitive) so because I wanted redundancym I bought another 500G Seagate drive and plugged that in as I was backing up onto the first drive. It started up and started duplicating immediately. The system also is configured to email me when there is a problem so if one of the drives dies I can shut the whole thing down until I get another drive.

Yes it is more expensive than converting one of my old computers into a linux backup option but so much easier! It also comes with a BitTorrent client, UPnP server, iTunes server (firefly) and Photo media server all installed and easily configurable through the web interface.

Another cool feature is that you can configure the front USB port to automatically download the information off it onto a specific network share. This means SD card comes out of the camera, into the USB reader and into the NAS. Within 5 minutes over 2G of photos were on the ReadyNAS and backed up. It is fast and so much easier than having it first on my computer then on the wife's Mac, then on backup somewhere and THEN off the SD card.

SOOOOOO much easier.

Recommend it to anyone!!

01/20/2009

Automating the populating of a PowerPoint brief

Tags: :
10
This demonstration will only work in Internet Explorer as vbScript is not supported in any other browser.

The Stated Problem
How to automate creation of a PowerPoint brief from data held within a Domino Database.

The Solution
The solution to this problem is a compromise as many solutions are. The stated problem is full automation of a PowerPoint brief creation. Whereas the actual problem can be described as the automated population of a PowerPoint template with stored database data. Subtle difference but one which makes a solution possible.

Recording a Macro

The first thing to do is record a macro of modifying your existingbrief. This is only possible in office 2000 or 2003 as the option hasbeen removed from powerpoint in Office 2007. To record a right click in the toolbar and make the "Visual Basic" toolbar visible.

Select to record a macro and record it in this presentation.



Once you have made the changes click the "Stop" icon.

To view the VBA code recorded select the "Play" icon in the toolbar to view the stored macros. Select the macro we just recorded and then "Step Into". The code editor and reveal the code.



The code in our example looks like this - which works in PowerPoint but does not translate to the Internet Explorer browser.

    ActiveWindow.Selection.SlideRange.Shapes("Text Box 2").Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=23).Select
    ActiveWindow.Selection.TextRange.Text = "Project Title Here"
    ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="M:\Images\tank.jpg", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=309, Top:=232, Width:=101, Height:=76).Select
    ActiveWindow.Selection.Unselect
    ActiveWindow.Selection.SlideRange.Shapes("Rectangle 7").Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=15, Length:=16).Select
    ActiveWindow.Selection.TextRange.Text = "This project Rocks!"

Converting VBA to vbScript
Once you have the code you have to translate it from VBA to vbScript so that it will run in the browser. I did a lot of research in this area and did not find a definitive example. I cobbled the solution together from a number of sources and good ole fashioned trial and error. An link to an example database is provided below.

Creating a MSOffice application object in the browser

This code allows for the creation of an instantiation of PowerPoint to be created. The object "PowerPoint.Application" is a registry object which is called by the browser. To allow this you must permit unsigned ActiveX to run in the browser. The most secure way to do this is add your www.hostname.com to your trusted sites in the Internet Explorer browser configuration and change the settings for your trusted host.

    Set wApp = CreateObject("PowerPoint.Application")
    wApp.visible=true

Because we are doing this on the user's client (Windows with Office installed as prerequisits) machine we need to know where the PowerPoint briefing template is. How the users gets it to their desktop is up to them but in the example provided I have them download it from the web page. Then we need to prompt them to provide the location of this file (pptLoc Field). The code then opens the file within the instantiation of PowerPoint (wApp)

    pptLoc=document.getElementById("pptLoc").value
    set objPres = wApp.presentations.open(pptLoc)  


Adding text to a Shape on a Slide

Within VBA and vbScript you can concatenate commands into one long command rather than declaring objects for each object, and then the sub object etc etc. For me this saves on code and it also makes it easier to de-bug. The previous VBA example of 4 lines is combined into one line of vbScript
    ActiveWindow.Selection.SlideRange.Shapes("Text Box 2").Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=23).Select
    ActiveWindow.Selection.TextRange.Text = "Project Title Here"

Becomes
    objPres.Slides.Item(1).Shapes(2).TextFrame.TextRange.Text = document.getElementById("InitTitle").value


In this case I do not have to worry about the length of the text being replaced (see below) as I am filling the whole text box with the Project Description. I also find it easier to mentally envision because we are looking at the second shape on the first slide.

Inserting Text into the middle of an existing Text block

The next set of code describes the Slide Range.Shapes and does not mention the fact that it is on the second slide. This I can only assume is because the macro does not track the "Page Down" key stroke....Anyway because we are not describing the vbScript with the slide and shape number this is simplifed again into one line of code
    ActiveWindow.Selection.SlideRange.Shapes("Rectangle 7").Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
    ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=15, Length:=16).Select
    ActiveWindow.Selection.TextRange.Text = "This project Rocks!"
Becomes
    objPres.Slides.Item(2).Shapes("Rectangle 7").TextFrame.TextRange.Characters(15,16).Text = document.getElementById("ProjDesc").value

In this case I DO care care about the number of character where I am doing an insert - I want it to start 15 characters into the text box and I want to replace the next 16 characters. These 16 characters are the sample text I want to replace. (In doing this I am also inheriting the text formatting from the text in the template - which saves me having to format it programmatically)
NOTE
As soon as you add new information into the text field within the slide - you change the number of characters which exist within that text box. To overcome this problem when you have to fill multiple areas, start from the end and work backwards - the code looks into the text from the beginning so if you start with the last section to update and work backwards - you won't change the starting character of prior sample text in the template.

Inserting an image

Inserting the image is again done on the local client and if the user wants to add one it will have to be identified as a local file in the same way as the PowerPoint file described above. You'll also notice that the FileName, LinktoFile etc etc monikers are not necessary.

   ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="M:\Images\tank.jpg",LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=309, Top:=232,Width:=101, Height:=76).Select
Becomes (with a check to see if a location has been specified by the user)
    imageLoc=document.getElementById("imageLoc").value
    if imageLoc<>"" then
        set newic=objPres.Slides.Item(1).Shapes.AddPicture(imageLoc, 0, 1, 220, 175, 101, 100)
    end if

The example
I have created an example to demonstrate this capability. It is a simple example but effective. We have only scratched the top of the capability of PowerPoint and there are many many other posibilities. But hopefully using this as a starting point and will enable you to expand the possibilities.

The example has two forms and two views. A form and a view to generate and edit content and a view to access the second form opening the data in the Presentation.

Click here to view the example


My Expectation

If this is useful to you please share you ideas, thoughts,modifications and improvements so that the next person reading the article will be more educated, more inspired and from that we all benefit.

Cheers,

Marky







01/20/2009

Vision

Tags: :
0
Many years ago I did a professional personal test and I was determined to have a "Visionary" personality. I am the kind of person who solves the problems, comes up with the solutions and then moves on to the next challenge. That doesn't mean that I can't do a project from start to finish, it just means that I get the biggest kick personally and my greatest contribution to a team environment is up front in a project.

But a Vision is not something which ends once development begins. The customers requirements and vision for the project translate into a vision for the application interface, a vision for the architecture, a vision for the documentation and a vision for the help and support. These things come together over the length and breadth of the project.

My Vision for this blog is to become not only another recourse which users will come to read examples and find answers to their problems, but I want it to become a place where other people also post there ideas. My expectation will be stated at the end of every article. If this is useful to you please share you ideas, thoughts, modifications and improvements so that the next person reading the article will be more educated, more inspired and from that we all benefit.


01/18/2009

Automated PowerPoint slide creation

Tags: :  
0
Something which has bugged me for years is automation of PowerPoint creation. Unlike Word and Excel which can be created with HTML. PowerPoint just sucks when it comes to formatting. This week I completed my 6 years journey on repeatedly trying to automate the creation of PowerPoint slides.

VBA has always been something I have liked to play with because it generates a LOT of functionality customers expect from their applications. I have used the user's locally installed MS Word to function as a spell checker. I have used Excel through the web and MS Excel client to create graphs and pivot tables.

I have a customer who semi-annually inputs all their project information into a Notes database. By entering into into a web based application it exposes the information to other internal customers who can then edit it for accuracy.

This amounts to around 150 projects and each of these projects has to be briefed at least once to the senior leadership using a standard briefing template. This is currently a copy and paste job and wastes a significant amount of man hours.

My problem - automate the brief creation from the information in the database. I tried the following.
  1. Knowing that Office files can be saved as HTML files; I tried to save the brief as HTML and then try to create the HTML using a LS agent. Unfortunately when PowerPoint saves as a web page it generates a multude of files including macro files. Creating all these files is not practical, time consuming on the server and all round.

  2. Using Office 2003 you can record a Macro. Which allows me to record a VBA version of what I do to the template. I tried to build a template from scratch using the macro recorder. This provided the means but generated a significant amount of VBA code which would take me eons to build the 20+ pages necessary and then I would still have to convert to something usable.

  3. Finally I basically compromised and came up with a solution which does require a modicum of interaction from the user - but still saves them hours of work. The user has to download the template to their machine, using a File Upload Control tell me where it is, and I will load it using vbScript, and fill it from the database. This is not total automation but sometimes an 80% solution is a whole lot better than 0% !
I will create an example and post it as my first article.


01/18/2009

Problem solving - an art form

Tags: :
0
What constitutes a problem and a solution? A child who cannot completetheir jigsaw puzzle has a problem and needs help. They can be shownwhere the pieces go but that does not help them the next time.

Whatwe do for our children is help them solve problems - more specificallywe need to teach them exactly how to solve their problems by learningmethodologies. The same goes for adults although by that point it isusually too late.

One of the things I find fascinating iswatching other people and how they solve problems. There are manymethods which people learn as they grow up and "trial and error" is oneof the first and many times the best way.

What is sad to seemany times is that people are too afraid to even trial and errorsomething. A grandmother on a computer, afraid that she will breaksomething if she clicks the wrong key. A programmer who is afraid totry something new, outside of their comfort zone.

Problemsolving is an art which very few people truly embrace. Lateralthinking, research, strategy, planning and common sense all play theirpart in solving any problem large or small.