Commutative data types and their operations is a powerful idea.
Downgrading my iPhone to iOS 3
One-liner to find all occurrences of property names within a stream of text
cat * | perl -ne 'while ( /\G.*?([-a-z\.]+\.enabled)/gi ) { print "$1=x\n"; }' | sort -u > /tmp/enabled
This posting is mostly to remind me that 1) print "..." while /.../ does not work and 2) to use \G to anchor the regular expression to the first and/or last match.
Having a Java generic class return a type reference to its specialized class. Aka, using the self-type.
public class GenericsTest { // We have a generic type here that needs to return from its check method // a reference to the specialized type (that is, the generic's sub-class). static class Common<SelfType extends Common<SelfType,ElementType>,ElementType> { protected SelfType self() { return (SelfType) this; } public SelfType check( ElementType e ) { // do something here that is general to all sub-classes return self(); } // ... } static class Foo extends Common<Foo,Integer> { public Foo doFoo() { // do something here is is specific to Foos return this; } } static class Bar extends Common<Bar,String> { public Bar doBar() { // do something here is is specific to Bars return this; } } public static void main( String[] args ) throws Exception { Foo foo = new Foo(); Bar bar = new Bar(); foo.check(1).doFoo(); bar.check("a").doBar(); } } // END
Tools needed to support a simple content organization and workflow
When this happens, it is then possible to create your own tools that support your workflows. (Note that in this posting I am concerned with explorer integration and not command line integration.)
Unfortunately, this has not been the norm and so we have iPhoto, iTunes, etc, having there own content organization that is independent of the file system. These content specific explorers are often created due to the weaknesses in extending the system's explorer but mostly it is because creating another explorer is just easier to both imagine and code. The up-shot is that we have organizational silos with little integration between them. And, worse, the inability to create your own specialized tools from the integrations.
This Sunday I spent far too much time tracking down tools that would allow me to use the file system to collect and organize content as follows:
1. Each content collection is a folder. I am comfortable with using the file system hierarchy for organizing and I am aware of the weaknesses of hierarchical organization. However, most collections can be organized into a primary hierarchy and augmented either by search or linking (aliases on the Mac and shortcuts on Windows).
2. Each folder will have, at least, one plain text file of dated notes. Each note is separated by a simple delimiter, for example, a row of dashes. My experience is that this one file of notes is much easier to review and keep updated than to place notes into individual files. With that said, a good tool that can hide the file-ness of the notes would be acceptable too. Until then, one file of notes and using Merlin Man's tip for adding content to it <http://bit.ly/a1kfV6> will do fine.
3. The primary hierarchy needs to be supplemented with full text search. Tagging is not enough and, moreover, tagging can be achieved via search by using specialized tokens: For example, in normal English typography a colon is always followed by a space and so the expression ":foo" distinguishes the tag "foo" from the rest of the text. Spotlight on the Mac is the system's full text searching facility. It is extendable so that other content types can be incorporated. The plugin I am looking for would index the dated notes in a file as collection of "records". (This Spotlight feature was introduced in OS X 10.6.) The Spotlight plugin is the most specific tool that I need. While it is a Mac only indexing solution it is based on plain text content and so could be indexed easily under other operating systems. Unfortunately, as far as I can tell, and I spent a good amount of time looking, there is no plugin for indexing delimited content as records. There are plugins for content types that somewhat match, for example mailboxes, but there is no documentation on how to use them outside of their intended application. The up-shot that that for this very simple workflow I can not compose a supporting tool from existing parts. Looks like I am going to have to write my own Spotlight plugin: If anyone has skeleton code I can build upon please drop me a note.
Cat & tail
Using gnuplot to plot a time-series in text
2010-11-06T00:00:01 35 2010-11-06T00:05:01 38 2010-11-06T00:10:02 45 2010-11-06T00:15:01 38 2010-11-06T00:20:02 38 2010-11-06T00:25:01 38 ...Note the two spaces between the data columns. The command line & script to plot this data is
gnuplot <<EOH set terminal dumb set autoscale set xdata time set timefmt "%Y-%m-%dT%H:%M:%S" set xlabel "Date & Time" set ylabel "Count" set title "Requests waiting on connection" plot "data" using 1:2 with lines EOH
which outputs
Requests waiting on connection Count 160 ++--+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+-++ + + + + + + + "data" using 1:2 ****** + | ***** | 140 ++ ****** * ++ | ** * | 120 ++ ** * ++ | * * | | * * * | 100 ++ * * * ++ | *** * | 80 ++ *** * ++ | * ** * | | * ** * | 60 ++ **** * ++ | * ****** * | 40 +*************** * *************************** ++ *** ******** | + + + + + + + + + + + 20 ++--+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+-++ 00:00 02:00 04:00 06:00 08:00 10:00 12:00 14:00 16:00 18:00 20:00 Date & TimeMust easier to see the trend in the data.
I found the following helpful in figuring this out http://linuxgazette.net/126/peterson.html.
Update: Use the watch command to turn the graph generation into a dynamic visualization. For example watch -n 60 bash plotting_script will run the plotting_script every minute and update the terminal.
Update: See the bash script timeplot for a useful expression of this posting.
Vi and a little macro to step through a file of data
1) creating a macro to find the next datum and move it's line to the top of the screen
qn /^"http- zt q
2) use the macro to move from datum to datum
@n
I found the following helpful in figuring this out http://www.pixelbeat.org/vim.tips.html.
If you want to change the schools RUN FOR SCHOOL COMMITTEE
Windows Phone 7 is worthy addition to smartphone market
"Nobody seems to be committing themselves to optimizing those 10- to 30-second phone experiences. Everyone is focused on building phones that you can stare at for thirty minutes. If this is truly the path Microsoft has followed, then they've made strong and brave choices."
Welcome to Code City!
Prototype of an Open Web App Ecosystem
http://blog.mozilla.com/blog/2010/10/19/prototype-of-an-open-web-app-ecosystem/
The premise of Open Web App that I WANT to install and application in my browser. I don't want to do this because this ties me and the application to the browser I am CURRENTLY using. I don't use one browser. I don't use one machine. Today I regularly use three machines -- one MacBook, one iPhone, and one Windows laptop -- and four browser instances -- two of FireFox, one of Safari, and one of Internet Explorer. Tomorrow I expect to be using even more machines -- iPads, Android pads, setup boxes, Wii, etc. I don't want to be tied to one machine and one browser -- even if I can choose which ones. I want to be free to sit at any browser on any machine and just use an application and my data.
What I really want is for applications and data to be separated so that I can pick which application I want to use today to surface (visualize) a data repository. More on that another day.
Jim O'Neill must not be reelected to the South Kingstown Town Council
A new independence is needed at Town Hall. One that will work with other councilors and interested parties in moving ideas to action. Do not vote for O'Neill this November.
Please share this note with others.
New Commons office space
Safari and accessing an HTTPS site behind a web proxy
1. Use FireFox to initially access the site and to accept the untrusted certificate.
2. Use FireFox's certificate manager at ForeFox / Preferences... / Advanced / Encryption / View Certificates to export the certificate. Use the PEM encoding and make sure to name the file with a ".pem" extension.
3. Use Keychain Access to import the certificate
You should now be able to access the web site from within Safari.
A Gentle Introduction to CouchDB for Relational Practitioners
The short introduction to CouchDB at
http://blog.couchone.com/post/1167966323/a-gentle-introduction-to-couchdb-for-relational
How to add commands to the OS X "right-click" menu – Simple Help
http://www.simplehelp.net/2007/06/12/how-to-add-commands-to-the-os-x-right-click-menu/
MongoDB is Web Scale
What is your toolset?
Halo around the foremost window
16 months is too short a time to adopt Wave
Every group establishes the tools and protocols of communication very early in its formation. Only new groups -- and perhaps only new groups in new situations -- have the chance to immediately adopt new forms of communication. For every other group, the group needs a lot of time to 1) recognize what is being lost in the current means of communication, 2) understand the loss's cost to the group, 3) set out to discovered tools and/or protocols that enables both to continue the successful communication and to reduce/eliminate the recognized lose, and, finally, 4) adopt the change with planning for the concomitant communications turbulence. 16 months is far too short a time to adopt Wave. For those that have adopted Wave within those 16, the time since adoption has been far too short to understood Wave effectiveness.
Google pulled the plug on Wave too soon.
[1] http://googleblog.blogspot.com/2010/08/update-on-google-wave.html
[2] http://wave.google.com/about.html
[3] http://googleblog.blogspot.com/2009/05/went-walkabout-brought-back-google-wave.html
Corporate Blogs: Front Page Structure (Jakob Nielsen's Alertbox)
Corporate Blogs: Front Page Structure
http://www.useit.com/alertbox/blog-front-pages.html
Sounds in presentations
My very first posting to this blog was about sound <http://calliopesounds.blogspot.com/2007/07/i-had-weird-moment-today.html>.
Gobby and reviewing some source code
1. Gobby is a peer-to-peer networked application and so your application is both a server and a client. This kind of networking does not play well between corporate and ISP firewalls. The only way we were able to communicate was to have three instances of Gobby running: One for me, One for Evans, and one running on my home Linux box acting as a server. And even then, Evans needed to ssh tunnel to the Linux box. To effectively use Gobby in a WAN much consideration needs to be given to network connectivity.
2. As anticipated, Gobby's document management is very weak. The documents are listed alphabetically with no meta-data about ownership, modification time, directory path, revision number, etc. I also found the floating document list to get in the way more time than not.
3. When Evans and I were discussing our first document Evans asked if I was seeing his highlighting. I was not. We both assumed that not only would you see other's changes but you would also see other's highlighting. This is a good example of not knowing what you want until to actually trial your tools.
4. Gobby knows almost nothing about the documents it is presenting and editing. It does highlight the syntax of the document based to the document's file name extension. However, our experience with IDEs is that we want really good navigation between source code elements. For example, with Java source code we want, at a minimum, 1) class name to definition source file, 2) method name use to definition location in source file, and 3) method name definition to locations of use.
5. Gooby has a instant-messaging feature but we used Skype's voice chat. Gobby as an extension to Skype would be more useful.
Overall, Gobby has too many network connectivity issues and not enough document navigation features. If Gobby were to be implemented today then it should be a web application built using the Etherpad <http://etherpad.com/> and Bespin <https://bespin.mozillalabs.com/> toolkits with a little of the Nautilus file manager <http://live.gnome.org/Nautilus>.
A tool for informal review of a tree of documents is needed. (As opposed to a set of patches for which there are great tools. For example, Rietveld <http://codereview.appspot.com/>.) So, I will keep looking. Tell me if you find something good.
Streaming content for non-media applications
node := data children children := node* data := field+ field := name value name := string value := stringThe problem with this design is that it you can only know about the structure of the data only after reading the whole document. You can not do anything for the user between making the request for data and getting the last byte of the response.
I don't know about you, but I hate waiting for all the data when I don't want it. When I am in browsing mode or manual indexing mode [*] I only want to get the gist and move along quickly. For example, if I am flipping through a list of the movies playing at the local cinema I don't need an image of the movie's poster. What I do need is to know that there are 6 movies, the 6 titles, and the next two showings of each movie. When I settle on a movie then I might be interested in seeing the promotional poster, trailer, and reviews and so am willing to wait for this data to fill-into the UI. (Don't have me press a "more details" button, please!)
Most schema designers will create something like this
movies := (movie)* movie := title rating director casting poster-url trailer-url movie-reviews showtimes movie-reviews := star-rating reviews director := person casting := person part person := string part := string showtimes := showtime+ showtime := start-time end-time start-time := number ':' number reviews := review* review := person star-rating comment-string ...
You get the idea: A straight forward and clear hierarchical organization of the data. The problem with this design is that for web apps or mobile apps the app needs to read far more bytes than it needs to enable browsing and manual indexing. It needs to read all the bytes up to the last movie's node first byte just to know that there are 6 movies. That could be several thousand bytes of data just to know the number 6.
Network performance is not instantaneous. Cell network performance is worse than network performance. Schema designers need to stop designing data structures as though the data will be instantaneously transferred from the host to the client. We don't do this for audio or video and we should not do it with other data either. Data on the wire should be designed more as packets to be explicitly organized. And it should be ordered so as to ensure the application's usability remains high even under poor network throughput conditions.
In the case of the movie listings, the following is a better data structure
movies := count id* ( title | showtime | poster-url | trailer-url | ... )* title := id 'title' string showtime := id 'showtime' timestamp poster-url := id 'poster-url' url trailer-url := id 'trailer-url' url review := ...
Here the related data is explicitly linked together with ids, tags, and values rather than implicitly by position within a hierarchy. Next, order the transfer of data to the client such that the client can use progressive disclosure. The user will now be able to see some structure and some content and so be able to perform some interaction with the application before the whole structure and all the content is delivered.
In the case of the movie listings it might look like
6 m1 m2 m3 m4 m5 m6 ; # now get the titles and next showtimes for the movies m1 title Inception ; m1 showtime 6:30 ; m1 showtime 3:10 ; m2 title The Sorcerer's Apprentice ; m2 showtime 4:50 PM ; m2 showtime 7:20 PM ; m3 title Despicable Me ; m3 showtime ... m3 showtime ... m4 title ... ; m3 showtime ... m3 showtime ... m5 title ... ; m3 showtime ... m3 showtime ... m6 title The Last Airbender ; m3 showtime ... m3 showtime ... # now get the remaining showtimes m1 showtime 12:00 ; m1 showtime 9:40 ; m2 showtime 11:45 AM ; m2 showtime 2:15 PM ; m2 showtime 10:00 PM ; ... # now get the star-ratings for the movies ... # etcHere I am using a semi-colon delimited encoding to simplify this example. There is no reason to abandon using JSON or XML as the encoding. You must, however, use a streaming JSON or XML parser so that the application client is able to get at the data as soon as it arrives.
This lesson was taught to me by David Durand when we were working on MAPA at Dynamic Diagrams. A visualization within MAPA was a Java applet that displayed a map of locations within a web site. The maps needed to display the canonical path to the location, the local structure of the site around the location, and the kinds of pages there. The data structure we used to communicate the data needed to display the map had the structural data up front so the applet could start rendering the map (in another thread). Meanwhile, the details about each page came trickling in and could be rendered piecemeal to the existing skeletal frame as it arrived. (David wanted me to use fixed-width data but I could not bring myself to do that.)
It is only now that I more regularly use mobile apps that I really want his lesson to be spread as far as possible because mobile app usability in conjunction with cell network activity just plain sucks. I don't think the primary reason for this condition has to do with hardware, or the network, and, probably, not the algorithms. That leaves the data.
[*] Manual indexing is when you have a list of 10 items and you flip through them until you find the one item that you want. I am sure there is a interaction-design term for this but I don't know what it is.
RFPs that discourage response
Wow! It is not until page 48 that you finally get some detail on what this RFP is asking for. And, of the 61 pages only 2 are about the work. I thought (mostly in passing) I might submit a proposal regards this request but the effort to complete the submission is by far more time consuming than the completion of the work itself. No wonder government costs are so high and RFPs are submitted by companies filled by mid-level employees.
Animag Photo Stands
Using logrotate to manage Apache Tomcat's catalina.out log file
0 0 * * * /usr/sbin/logrotate -v --state $HOME/var/logrotate.status $HOME/etc/logrotate.conf
Set the logrotate.conf to
$HOME/lib/apache-tomcat-5.5.28/logs/catalina.out { daily rotate 10 copytruncate compress missingok }
# END
Notes: I run Tomcat from within its own user directory and so all paths are relative to $HOME. Logroate does not perform environment variable substitution on the configuration and so replace $HOME in logrotate.conf with the actual path.
Manual duplex printing with OSX presets
I have wanted to be able to manually print duplex for sometime but never scratched the itch until today. With a quick Google search and I discovered
http://www.maclovin.de/2009/03/manual-duplex-printing-with-osx-presets/The basic plan is to print the document twice. The first print prints only the odd pages. The second print prints only the even pages and (very importantly) with a reverse page orientation. So, print the document using the first settings. Next, take the stack of pages from the output tray and place them in the input tray as is, that is, don't flip them or turn them in anyway. Lastly, print the again document using the second settings. The result is a duplex document with the pages in the correct order in the output tray.
Max OS X allows for creating printing presets and so I have created a "Duplex Pass 1" and a "Duplex Pass 2" presets. The only bug is that the "Reverse page orientation" setting (aka checkbox) seems to be independent of the preset so be sure to make sure it is unchecked for pass 1 and checked for pass 2.
HP has a very useful application for manual, duplex printing but it has stopped working since OS X 10.8.4.
Sidewalk Graffiti Provides Navigational Assistance For Subway Commuters
http://nyctheblog.blogspot.com/2010/06/sidewalk-graffiti-provides-navigational.html
I love simple, unobtrusive signage. It can be used in physical space and virtual space. Brainstorming on this example from NYC that painted a compare rose at the exit of subway stations you could use the same technique too
* point to bathrooms near parking
* point to information booths
* point to insert-your-favoriate-coffee-franchise-here
What would you point too?
Helping out Instapaper
I can't swipe horizontally to read email
I have been thinking about interface design for the iPhone and iPad for a while now. I have been working through ideas with the design of an issue tracking application as this is a tool I will use every day. (I am a software developer, after all.) I am greatly inspired by Mag+ design. It is such a deep source of ideas. The Mag+ magazine is virtually laid out in a very strong 2d space: The horizontal is used to hold the articles side by side and the vertical is used to hold the article's content. This is a very easy visual model to internalize and it can be used for lots of different kinds of content with strong peer relationships and long content. I had assumed that Apple had this idea too. You see it in their photograph applications, but I was wrong. When reviewing the iPad's email application I was shocked that I could not swipe to view the next or the previous email. This was such a natural gesture that I assumed I did something wrong. As far as I can tell, I did not. Afterwards I realized that I can't swipe horizontally with the iPhone either.
The A Future of Information Interfaces for Emergency Management
* big displays with three-heads being common
* virtual whiteboard+touch screen that shows the distant participant as if on the other side of the device.
* pie menus are finally (!) showing their strengths in a touch-screen world.
* more direct touch interaction with specialized virtualized controls.
* heads-up display on the truck's windshield.
MonoTouch and Apple's Section 3.3.1: Two Theories
MonoTouch and Apple's Section 3.3.1: Two Theories
"[...] MonoTouch has been misrepresented, initially by Gruber and by most people covering the debate over section 3.3.1. Probably because few of them have actually used MonoTouch or because they are not familiar with .NET. Probably folks think that MonoTouch is .NET, and .NET is Microsoft's Java and draw their own conclusions.
MonoTouch brings the C# language and the core of .NET to the iPhone, but does nothing to provide a cross-platform UI experience or for that matter any sort of mobile device cross-platform APIs.
We bring the C# language, garbage collection, a type safe system that help reduce errors, make programmers happier and more productive on the iPhone while getting access to every single iPhoneOS API that they want to.
We have also been able to expose new APIs that Apple has exposed in record time thanks to the fact that we are not really an abstraction layer over the iPhoneOS, but merely a compiler that talks to the native APIs. [...]"
JConsole and JMXMP
java \ -classpath $JAVA_HOME/lib/jconsole.jar:$JAVA_LOCAL_LIBS/jmxremote_optional.jar \ sun.tools.jconsole.JConsole \ "service:jmx:jmxmp://$JMXMP_HOST:$JMXMP_PORT"
Other incantations just don't work. Define JAVA_HOME, JAVA_LOCAL_LIBS, JMXMP_HOST and JMXMP_PORT appropriately. Now, back to work.
Network activity records and the common good
At one time most decent roadways were private enterprises. They supported commerce and so tolls were used to support them. At some point, roads were seen as too valuable to be held in private hands and government took over the task of building and maintaining decent roadways. The same story can be told about potable water. But why did this not happen to the electric grid or the telephone infrastructure? I don't have an answer today but I do want to find out. I think the answer will lead to a better understanding as to our rights as citizens to having the activity records available for the common good.
[1] http://en.wikipedia.org/wiki/Common_good
[2] The Origins of Knowledge and Imagination. Jacob Bronowski. http://bit.ly/akd0gR
Varanasi has an almost perfect web site
The food, by the way, is fantastic. I really enjoyed the Punjabi Eggplant with spice level 4.
Ranks and snap lines in Instaviz
[1] http://www.graphviz.org/pdf/dotguide.pdf
[2] http://itunes.apple.com/us/app/instaviz/id299022481?mt=8
UpdateFor example, I want a graph to have have three ranks: The first rank contains the nodes A, C, and E; The second contains B, D, F; And the third contains X. Without ranks the following definition
digraph rankexample {
A -> B -> X;
C -> D -> X;
E -> F -> X;
C -> X;
X -> C;
}
Creates this graph:
However, adding ranks (i.e. the "snap lines") to the definition
digraph rankexample {
{ rank = same; A; C; E; }
{ rank = same; B; D; F; }
{ rank = same; X; }
A -> B -> X;
C -> D -> X;
E -> F -> X;
C -> X;
X -> C;
}
I get the layout I was looking for:
Addressing the needs of individual and groups with predictability
1. style over substance, and
2. individual-casting over broad-casting.
The style over substance argument is very easy to see. Every travel website that I have used obscures the process's workflow (and the broader information architecture) with abusive Web 2.0 techniques. Most of these techniques require an inordinate number of communications between the browser and the server. The upshot is that under moderate load the website fails to respond with predictable timing. Without this predictability customers are greatly frustrated and this leads them to use a telephone where they can at least know what their predicted wait time is!
The casting issue is more difficult to see. There are more casting groups then just "me" and "everyone else". Depending on your service, customers can be group into multiple and overlaps groups. For example, specific airport groups, country groups, traveling with children groups, etc. Each of these groups have common and unique information and advice needs in times of emergency (and times of calm!). The general public group is, generally, the most useless group unless there is system-wide failure. Without addressing the needs of affinity groups you are not truly servicing the needs of your customers.
The upshot is, let's spend less money and effort on individual-casting with technical acrobatics and instead balance the money and effort on addressing the needs of individual and groups with predictability.
This posting was inspired by Mark Bernstein's posting http://www.markbernstein.org/Apr10/InternetFailure.html
Always include a telephone number
Tomcat, JMX and working at the local library
<Connector address="127.0.0.1" port="8080" redirectPort="8443" minSpareThreads="25" connectionTimeout="20000" maxSpareThreads="75" maxThreads="150"> </Connector><Connector address="127.0.0.1" port="8009" redirectPort="8443" protocol="AJP/1.3"> </Connector>
Atul Gawande: The Checklist Manifesto | Free Lecture | Forum Network from PBS and NPR
Looking for webapp suitable for community garden hub
* Wiki
* Issue Tracking
* CRM
All of these can be -- and, perhaps, should be -- feature-light. This will be used by members of a community garden. Anyone know of a turn-key solution for this?
Using a proxy & reflection to access a JMX Standard MBean
public interface HugsMBean { boolean isHappy(); int getHugs(); void addHugs( int hugCount ); }
To use the isHappy() method requires the code
MBeanServerConnection mbeanServerConnection = ... ObjectName happyMBeanName = new ObjectName( "com.andrewgilmartin.hugs:name=hugs"); Boolean isHappy = (Boolean) mbeanServerConnection.invoke( happyMBeanName, "isHappy", null, null ); if ( isHappy ) { ... }
If you are using Standard MBeans to publish data it would be great for your client to also use the Standard MBean to access the data. For example,
MBeanServerConnection mbeanServerConnection = ... HugsMBean hugs = ... // i.e. associate with com.andrewgilmartin.hugs:name=hugs if ( hugs.isHappy() ) { ... }
To this end, below is a little set of helper classes that use Java's reflection and proxy facilities to do just this. The first code we need is an invocation handler that will send attribute and invocation mbean requests between the proxy and the mbean server:
package com.andrewgilmartin.common.management; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import javax.management.Attribute; import javax.management.JMException; import javax.management.MBeanServerConnection; import javax.management.ObjectName; public class MBeanClient implements InvocationHandler { private MBeanServerConnection mbeanServerConnection; private ObjectName mbeanName; public MBeanClient( MBeanServerConnection mbeanServerConnection, String mbeanName ) throws JMException { this.mbeanServerConnection = mbeanServerConnection; this.mbeanName = new ObjectName( mbeanName ); } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( method.getName().startsWith("get") && method.getParameterTypes().length == 0) { String attributeName = method.getName().substring(3); return mbeanServerConnection.getAttribute( mbeanName, attributeName); } else if ( method.getName().startsWith("set") && method.getParameterTypes().length == 1) { String attributeName = method.getName().substring(3); Attribute attribute = new Attribute( attributeName, args[0] ); mbeanServerConnection.setAttribute(mbeanName, attribute); return null; } else { return mbeanServerConnection.invoke(mbeanName, method.getName(), args, null); } } }
And now we need a factory (or perhaps just a static creator method somewhere) to tie together the Standard MBean interface, the MBeanClient helper, and the proxy:
package com.andrewgilmartin.common.management; import java.lang.reflect.Proxy; import javax.management.JMException; import javax.management.MBeanServerConnection; public class MBeanClientFactory { private MBeanServerConnection mbeanServerConnection; public MBeanClientFactory( MBeanServerConnection mbeanServerConnection ) { this.mbeanServerConnection = mbeanServerConnection; } publicT create( String objectName, Class... mbeanInterfaces ) throws JMException { T mbeanClient = (T) Proxy.newProxyInstance( this.getClass().getClassLoader(), mbeanInterfaces, new MBeanClient( mbeanServerConnection, objectName ) ); return mbeanClient; } }
Now, connect the client and create the proxy
// connect to the mbean server
MBeanServerConnection mbeanServerConnection = ... // create the mbean client factory
MBeanClientFactory clientFactory = new MBeanClientFactory(mbeanServerConnection); // create the mbean client for the server's mbean
HugsMBean hugs = clientFactory.create("com.andrewgilmartin.hugs:name=hugs",HugsMBean.class); // use the mbean client while ( ! hugs.isHappy() ) { hugs.addHugs( 27 ); } System.out.println( "happy with " + hugs.getHugs() + " hugs");
Post script: Here is how to connect to a JMX server running on localhost at port 9999 using RMI:
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi"); JMXConnector jmxc = JMXConnectorFactory.connect(url, null); MBeanServerConnection mbeanServerConnection = jmxc.getMBeanServerConnection();
A vi command line helper
vif IndexerTool.javaeffectively is the same command line as
vi ./java/org/crossref/qs/citationdocument/index/IndexerTool.java(for a current project.) The script is
#!/bin/bashYou can use wild cards too. For example, this will edit ALL your java files
[ -z "$1" ] || vi $(find . -name $1 -type f)
vif \*.java
Blogger and Twitter link
<!-- TWITTER -->
<a expr:href='"http://bit.ly/?u=" + data:post.url + "&s=" + data:post.title + " (via @YOUR-TWITTER-USERNAME)"' target='_new' title='Tweet via bit.ly'>Tweet This</a>
somewhere within the DIV element
<div class='post-footer-line post-footer-line-1'>
Replace YOUR-TWITTER-USERNAME with your Twitter user name. See the original tip for more details.
Blogger and conditional widgets
<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "index"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
This can be useful if you want some introductory content to be displayed to the viewers of the home page but not to viewers of of the specific posting pages.
Also, a new feature of Blogger is "Pages". Pages are named postings that can be listed and accessed by direct links. There is also a widget for showing the pages as a list or as tabs.
Shell enhancement to round-robin through list of directories
Re: What the iPad Means for the Future of Computing
What the iPhone did (and iPad will do) is to bring back sanity to interface design. For decades UI vendors — Microsoft, Apple, HP, Sun, etc — brought to tool/application front-end development well considered and consistent structural and visual interface elements. The tool’s new users needed only to learn how these elements were applied to the business function to use the tool. The value of this UI work was, some how, lost during the rise of the web.
The other element of the iPhone’s success is single user focus. The iPhone becomes the tool/application in use. User multi-tasking is not a requirement to productivity. Switcher was one of Apple’s greatest productivity successes. It was ahead of its time and ahead of the capabilities of the hardware. The hardware in the iPhone and the iPad make switching to another application fast and into the same context you were when you left.
Microsoft's Our Productivity Future Vision
Genuinely enthralled with Microsoft's Our Productivity Future Vision. Lots of reviewing stuff and not enough creating stuff, however.
Update: When I worked for Mesa Systems Guild (10 years ago) the data point that drove the product was that for every 1 creator there there 40 users of the creation. I wonder what the ratio is today?