July 17th, 2010
If you are adding ID’s you are doing something wrong.
This will cause issues for people who want to have multiple copies of the widget in
the page. There is to much risk of ID collision.
There is always a way of navigating down the tree to find children (Especially if you
are writing a JQueryUI widget).
Classes are ok – and use them to find children – but DO NOT add an ID.
(This blog post written as a public service, after having seen way to many JQueryUI widgets that don’t get this right).
Posted in Miscellaneous | No Comments »
May 31st, 2010
It’s suprisingly easy to mount a folder via ssh. This is especially useful when you need to access something via ssh tunnels. Following is the process to follow when using an ssh tunnel. To do without the tunnel, remove step 3, and make the sshfs command directly reference the server in step 4.
Step 1) get and install macfuse http://code.google.com/p/macfuse, along with the ssh filesystem http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS
Step 2) create a folder to mount to. mkdir -p /mnt/remote
Step 3) setup the ssh tunnel: ssh -C -L 2022:server_with_data_to_get:22 ssh.tunnel.server (going into server_with_data_to_get via ssh.tunnel.server, making this available at localhost:2022).
Step 4) Use sshfs to mount the drive: sshfs -C -p 2022 username@localhost:/path/to/folder_to_mount /mnt/remote (connect to the localhost -ssh tunnel end point- mount remote folder /path/to/folder_to_mount to the local folder /mnt/remote).
Posted in Miscellaneous | 1 Comment »
April 26th, 2010
As I’ve said earlier, I think that the Play! framework is lovely. It makes it easy to develop and write code quickly. One of the ways that it enables this is through performing runtime byte code enhancement of the code. This makes execution of your code somewhat non-trivial when coming from a non-Play! context. Play! aims to meet all your needs, but use cases exist where it is important non-Play! code with Play! code, and have your non-Play! code call into Play!
Having said that this is non-trivial, it is reassuring to know that the process to do this is very straight forward.
- Create a subclass of play.Invoker.Invocation.
- Override the public void execute() method.
- Call the run() method of the invocation.
1 2 3 4 5 6
| Invoker.Invocation invocation = new Invoker.Invocation() {
public void execute() {
//do stuff with play here
}
};
invocation.run(); |
With this simple snippet of code, it is possible to have non-Play! code easily and cleanly call your Play! application code.
Posted in Java, Miscellaneous, Play! Framework | 4 Comments »
April 10th, 2010
The Play! Framework is a great tool for rapidly building Java web applications. Play! takes many of the ideas from the dynamic languages world (Rails and Django), and provides them to Java web development. Reasons to conside Play! for Java Development are:
- Rapid development via a local development server that automatically compiles your java code for you. It’s amazing how good it is to develop like this, and what a difference the rapid feedback loop makes.
- A good clean MVC famework.
- Nice testing support baked in.
- A useful routing table to make clean urls easy to work with.
- A focus around REST, but no slavish observence of it.
- built-in simple JSON support.
- A good module framework with useful modules including a “CRUD” module, and a Scala module currently under development
- An interesting mix of Java class enhancement that makes it easy to work with code, and then have the enhancer provide some of the hard work for ensuring that multiple threads are handled well.
- Deployment to a range of platforms, including JEE Servlets (Play! 1.0.2 has been tested on containers such as tomcat, jetty, JBoss and IBM WebSphere Portal 6.1), and the GAE.
- Enhancements to the JPA which make it really easy to work with.
- An active and supportive community. There is the right balance between having strong opinions about the “Play!” way of doing things, and helping people to get things done.
Play! makes Java web development fun and productive. The feedback loop is really quick, and much of the boilerplate code is removed. It’s well worth considering for any application you want to write in Java.
Take a look at the video, and work through the tutorial to get a feel for what development with Play! is like.
Posted in Development, Java, Play! Framework | 8 Comments »
November 24th, 2009
The installation of the Lotus Connections 2.5 pilot looks easy. Unfortunately the out of the box experience was not at all pleasurable for me. Here are some of the issues that I encountered while doing the install. I’m not sure how many of these were specific to my environment, but they did all hurt.
1) Don’t install from a directory with spaces.
If you download the pilot to your desktop and try and install from here, things will crash and burn
2) Don’t expect the VM to be easily moved around networks
I started my second installation on my laptop at home, then brought it to work. This crashed and burned.
3) Use fully qualified hostnames
While the installer said that you could specify a short hostname or a fully qualified hostname, the short hostname did not work for me.
4) Connections 2.5 is RAM hungry
1.5 GBytes is not enough 2.5 GBytes is. Not sure of the exact threshold for it to work, but I can confirm that 2.5 GBytes is enough RAM.
Posted in Development | 2 Comments »
November 16th, 2009
Situation
You have received a WebSphere Portal VM that is setup to use security settings that don’t match your environment, and you need to go back to a simple config.
Running the recommended
1
| ConfigEngine wp-restore-default-repository-configuration |
does not work, because you have not got a working Portal environment in the first place, so it won’t start.
Overview of solution
Disable the security, then perform wp-restore-default-repository-configuration.
Files and Tools used
- security.xml
- ConfigEngine
- wkplc.properties
Whenever you see some code with bold and italics that is something for you to change to match your environment
Details:
1) disable security.
This involves directly editing the security.xml file for your node. Note that your portal instance will NOT work when security is disabled, so performing this step will disable your portal instance. You should not think about doing this in a production environment (you probably shouldn’t be passing around Portal VM’s for production environments anyway). (The security.xml will live in the config for your node. I’ll assume you know where this is, if not use the find command on your operating system).
To disable security, edit the security.xml, and change the enabled attribute on the root security element to be false ie change enabled=”true” to enabled=”true”
2) start up your portal instance using whatever commands are appropriate.
On linux you might find
useful.
3) Setup restore properties in your wkplc.properties file.
Profile/ConfigEngine/properties/wkplc.properties
# The realm name to be used. A realm with this name will be created.
restore.file.realm=New Unique Realm restore.file.delimiter=/
# Portal and WAS admin UID (short name) and password
restore.file.primaryAdminId=New Unique Admin ID
restore.file.primaryAdminPassword=Password
# CN of portal admin group (short name)
restore.file.primaryPortalAdminGroup=adminGroupCN
4) run ConfigEngine.sh
Profile/ConfigEngine/ConfigEngine.sh wp-restore-default-repository-configuration
5) Turn on security (reversing step 1)
6) shutdown (or kill) portal
7) startup portal.
You should now see your portal server running without using LDAP.
Posted in WebSphere Portal | 3 Comments »
July 7th, 2009
I have just finished reading the book The Shack. Through its powerful narrative story, The Shack presents the most powerful images of God that I have seen for a long time. The book challenges the reader's assumptions and views of God and the bible. I'd highly recommend it to anyone remotely interested in God, Jesus and the Trinity. When making this recommendation, I'd only add that this is a book of fiction, that doesn't have everything perfect about God. IMHO the best place to understand and learn about God is the bible, it is the direct source. Reading the accounts of the life of Jesus for yourself as an adult will challenge mosts peoples perceptions and understandings of Jesus. The Shack been touted as a modern day successor to The Pilgrim's Progress
, a title which (while somewhat bold) is at least partially justified. It's a fresh, unique and thought-provoking book that manages to touch the heart in very real ways
Posted in Miscellaneous | No Comments »
July 7th, 2009
In Outliers: The Story of Success
, Malcolm Gladwell presents his findings on why some people achieve in statistically outlying ways. Malcolm Gladwell has performed a broad reaching study aiming to find what makes people who are extremely successful different. As usual he’s done a pretty good job at presenting some of his findings with a good mix of anecdotes and facts.
One of the big overriding factors is how much external influences impact people. The location and cultural context in which someone is born, the year in which they were born, and even the birth month has a huge impact. Before reading the book I would have had no idea, after I can agree with him, but don’t worry, I’m not about to become an astrologer, and I don’t think it is directly related to the Chinese birth years (although there might be some links). Of additional interest is the idea of 10000 hours of practice being required to become an expert.
The quick list of impacts of particular interest for me were:
- 10,000 hours of practice is required before becoming an expert
- the birth month can have a huge impact (6-9 months of age difference can make a huge difference in early childhood – so early streaming favours the older children, with cascading effects)
- the birth year can have a huge impact (careers available, and many hugely successful people are early adopters, so there is only a small window of age/experience that makes it available)
- our cultural heritage makes a huge difference (what path and options make sense is often dependant on how we are guided by our parents, which cascades backwards)
The lessons are taught well through the book, and it is a compelling read. You may not agree with all the findings, but I’m sure you will get a good read, learn the stories of some successful people, and be challenged in some of your thinking about success.
Posted in Book Reviews | No Comments »
June 30th, 2009
My father-in-law is experimenting with selling his home privately. I’m not sure how it will go, but it will be interesting to see how the internet helps make it all happen. He’s started with an early launch of the website, before sending it out to some of the relevant Real Estate sites soon.
If you are interested in having a look at the site he put together, or if you are interested in buying a house in the coastal suburb of Wynnum, in Brisbane, Australia, take a look at Bayside House For Sale.
Posted in Miscellaneous | 1 Comment »
June 25th, 2009
I always find the latest incarnations of phishing spam entertaining. I almost clicked on one of the fake facebook links a while ago, but really wasn't at all tempted to click on the links in the one that came in today..
Yes, I am looking at that message in Mail.app, and viewing the source did show that the link didn't go to where it said it would go.
Posted in Fun | No Comments »