TiddlyWiki AJAX example
Thursday, April 21st, 2005Shawn pointed me to TiddlyWiki as an AJAX example. Looks pretty cool.
Shawn pointed me to TiddlyWiki as an AJAX example. Looks pretty cool.
So I noticed that the pebble distribution included a J2ME client for moblogging, and I figured it would be a good oppurtunity for me to learn J2ME.
I hacked together an addition to it which would allow me to use my phone's camera whilst composing a new blog entry directly in the app. Got it working perfectly .. on the simulator! Yeah, thats right, I didn't realize that MMAPI was an optional API for MIDP 2.0, and the IBM JVM for my Treo 650 left it out! Doh!
I guess I'll just write something to attach an image from the filesystem instead. Anyone know of any open source file browser widgets for MMAPI?
I’m always upgrading to the most recent development build of eclipse, and having to manually migrate my plugins each time is a PITA. Life became much easier when I setup an eclipse Extension Location to house just my plugins so that upgrading becomes the simple task of unzipping the new eclipse distribution.
Creating an extension location works under both the 3.0.x and 3.1.x releases of eclipse, under both linux and windows (and I assume all others). The steps to accomplish this under linux are as follows:
name=My Eclipse Configuration id=my.eclipse.configuration version=1.0.0
The thing I really like about this method is that aside from installing the eclipse runtime as root, I never have to do anything else as root again - I can install all my plugins as myself in my home directory, and when it comes time to upgrade eclipse, I don’t have to deal with moving my plugins to a new install - I simply install the new eclipse into it own directory, run it, perform step 6, and all my plugins are present (assuming they work across eclipse versions =)
Also, for large multi-feature/multi-plugin extensions like the eclipse WebTools Project, I’ll create a new extension location just for that extension so that I can treat it as a single unit for enable/disable/upgrade.
The process under windows is identical except you don’t have to worry about user permissions, and you need to choose windows paths that make sense to you. I use c:\devtools\eclipse for my eclipse install and c:\devtools\eclipse-config for all my configuration.
I found a trick to getting my immediate cancel button working correctly in JSF (myfaces 1.0.8).
I have a backing bean which does a DB query to return a list of beans - with an accessor of getBeans(). Each bean is displayed as a row in a h:dataTable, with certain fields being directly editable as h:inputText’s - specifically the get/setRuleText() member.
I added a cancel buton (non-immediate) which simply nulls out the underlying member variable for getBeans(), returning null to stay on the same page, and resulting in the list getting regenerated next time getBeans() gets called.
This was working fine, but things went wrong once I added a custom validator. I could no longer cancel if there was an invalid entry. So I figured I could just add the immediate flag and everything would be hunky dory.
Wrong!
With the immediate flag present, the cancel button would work, and trigger my action, but the getRules() method would not get called again for the rest of that lifecycle, and though I wouldn’t get validation errors, the data in the view objects was not being refreshed - just showing the pre-cancel data.
However I noticed that if I left and came back to the page, it would then show the correct data. Thus we come to my tip - instead of returning null from the cancel action to stay on the same page, return a string which triggers an explicit navigation rule, and this will cause the view objects to refresh and call the getters as needed.
Not sure if this is a bug or expected behavior - please feel free to enlight this JSF newbie either way =)
At work we only have POP configured on our mailserver, but I much prefer using IMAP, so I came up with this set of hacks to allow me to tunnel IMAP access to the IMAP server running on my workstation.
First I setup IMAP on my workstation. Since I’m running Fedora Core 2, this was just a matter of installing the dovecot rpm package. In order to get my POP mail delivered to my workstation, I setup fetchmail to run as a daemon to deliver my POP account mail to my local mail queue (Using postfix as my MTA, also installed as a rpm as part of FC2)
Once I’m getting mail delivered to my local workstation, then I simply point my Mail client there using IMAP instead of POP to our standard mail server.
Then I setup stunnel to act as a proxy to my imap mail server. Once configured, stunnel runs as a daemon, listens for connections to the indicated port, and runs ssh to connect to my work gateway to run netcat to connect to my workstations imap server. Once a connection is established, all traffic just gets sent back and forth along this chain of connections, so in effect, even though I connect to port 1234 on my home machine, it transparently ends up as a connection to port 993 on my workstation. Also, thanks to stunnel, connections are created on demand and dropped when client hangs up.
So from any imap client to my home machine, its ssl encrypted courtesy of stunnel serverside ssl. From my home machine to my work gateway machine its ssh encrypted, and from the gateway to my workstation its ssl encrypted thanks to the clientside ssl in stunnel and ssl on the imap server.
If you don’t need the extra security for the gateway to workstation leg, you can stop stunnel from being a ssl client by using “client = no” in stunnel.conf, make netcat connect to port 143 instead of 993, and skip making a certificate on your workstation.
First make a certificate on home machine so ssl clients can create an ssl connection to stunnel:
cd /usr/share/ssl/certs make stunnel.pem
Then make another certificate on work workstation so stunnel can create an ssl connection to dovecot:
cd /usr/share/ssl/certs make dovecot.pem
******************* workstation:/home/myuser/.fetchmailrc poll mail.mywork.com protocol pop3 username "myuser" password "foobar" ******************* home:/etc/init.d/rc.local: /usr/sbin/stunnel /etc/stunnel/stunnel.conf ******************* home:/etc/services: imapwork 1234/tcp ******************* home:/etc/stunnel/stunnel.conf: cert = /usr/share/ssl/certs/stunnel.pem client = yes [imapwork] accept = 1234 exec = /etc/stunnel/imapwork ******************* home:/etc/stunnel/imapwork: #!/bin/bash # For this to work, make sure you have a passphraseless ssh key setup to that you can login to the gateway machine /usr/bin/ssh myuser@mymachine@mywork.com /home/myuser/bin/netcat -c -w 10 myworkstation.mywork.com 993