Showing posts with label unknown. Show all posts
Showing posts with label unknown. Show all posts

Comment on David Ascher's posting "Am I reading these trends right?"

My comment on David Ascher's posting is Am I reading these trends right?

What if the big 5 are perceived as "magazines." That is, if you look at what the big 5 are doing it is little more than gaining an audience by offering remarkable content. When you buy a magazine you don't think about the conveyance, the staples or glue bound, high-resolution images on paper. The same will happen with tablets and other hardware. You pickup the "Vogue tablet" to read its curated content. And "Maker tablet" to read its. I am sure there will be national and international standards shaping a convergence of software and hardware as these "magazines" accumulate. Just as there is, today, an international standard for shower-curtain rings.

Animag Photo Stands

I love these photo stands. The price is high, but this does inspire me (the good Scott that I am) to make them myself. All you need is to pickup plastic animals (or other things you can cut in half!) from the yard sales (25 cents each), a hack saw (1 dollar), some epoxy glue, and two neodymium magnets per photo stand (50 cents each). Total cost for 4 photo stands is $6 and a lot of fun.

I bought a big box of these magnets for some LED throwies but do you think I can find them now? No.

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

"A considerate cartographer wielding a stencil and a can of spray paint has left a helpful navigational compass at the top of the stairs outside the NRW train at Prince Street for commuters exiting the station. As even native New Yorkers cant attest, everyone has exited a subway station and needed a moment to reorient themselves; a directional compass will make it that much easier. The unknown compass crusader stenciled the sidewalk at the uptown 6 train station on Spring Street as well. "

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?

JConsole and JMXMP

For the record, if you want to use jconsole with an MBean server using JMXMP you need to run it using

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

The record of activities of users of Google, Facebook, Twitter, etc have enormous use in the service of the common good [1]. Google shows us how searching on flu and flu related terms bests the CDC's reportage on outbreaks by two weeks. Facebook's shear population size and its tools for instant affinity groups sees people helping people under good and adverse circumstances. And lack of Twitter activity is the same warning signal grasshoppers give [2]. The upshot of this is that in our current networked world these private institutions need to start making this activity record public.

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

Whitelines Hard Bound A5 Squared Notebook

Varanasi has an almost perfect web site

Varanasi, http://www.varanasi-indian.com/, has an almost perfect restaurant web site. Just one page containing the menu, hours of operation, and location. And one page that works with a mobile browsers as well as a desktop browsers. No Flash. No extra navigation. No big pictures. No complex layout. It was a pleasure to use.

The food, by the way, is fantastic. I really enjoyed the Punjabi Eggplant with spice level 4.

Ranks and snap lines in Instaviz

A Graphviz features is the abilty to align nodes using "ranks" [1]. Does Instaviz [2] offer a means of using ranks? If not, I imagine a means of dragging a node to "snap" to one of several equidistant lines drawn on the canvas. In this way, the user is able to specify some node organization and still allow Instaviz to automatically layout the graph as a whole. (I think it is reasonable to limit the snap lines to be in one direction only per graph.)

[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:

Always include a telephone number

Whenever you find yourself typing or saying "call me" ALWAYS include a telephone number. It it only 7 numbers locally and 10 nationally. Obviously, this is a pet peeve of mine.

Looking for webapp suitable for community garden hub

I am looking for a webapp that combines

* 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

A current project uses JMX to monitor the application. Using JMX's Standard MBeans makes publishing an application's health, for example, very easy. This is the "server" side of the story. The "client" side of the story is not so satisfying. The JMX API is designed to support a highly dynamic management environment. To this end, the API uses an indirect access to the data. The client uses textual, untyped descriptors to get, set, and invoke methods on mbeans. Unless you are building a general purpose client this leads to lots of code and mental overhead. For example, if this is your 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;
    }

    public  T 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

A great command line file editing helper is to combine find and vi so that you can skip specifying paths. For example, the command
vif IndexerTool.java
effectively is the same command line as
vi ./java/org/crossref/qs/citationdocument/index/IndexerTool.java
(for a current project.) The script is
#!/bin/bash
[ -z "$1" ] || vi $(find . -name $1 -type f)
You can use wild cards too. For example, this will edit ALL your java files
vif \*.java

Blogger and Twitter link

This tip is a reworking of the tip given in Blogger Buster: 16 Useful Twitter Tools for Blogger Add a simple "Tweet This" link. Since Blogger's links can be long, the code uses bit.ly to shorten the link. The code to use is
<!-- TWITTER -->
<a expr:href='&quot;http://bit.ly/?u=&quot; + data:post.url + &quot;&amp;s=&quot; + data:post.title + &quot; (via @YOUR-TWITTER-USERNAME)&quot;' 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

Quick note that to make a widget/gadget conditional in Blogger you need to edit the template's HTML and add a <b:if cond='... tag. For example, the following makes the given HTML widget only display on the index page (the main page).
<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<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.

2010 South County Coop Tour

The 2010 South County Coop Tour preparation is well underway!

Shell enhancement to round-robin through list of directories

When working at the command line (Unix mostly) I am often working with files in several directories at once. The pushd and popd commands are useful but require a strict stacked directory use and require too much planning for me to use efficiently. (Clearly, self actualization has reached a new level of specificity.) What would be better would be a way to change directories by rotating through a list of directories. Much as is done today with applications vis Cmd-Tab under Mac OS X and Alt-Tab under Windows. Configuring the list of directories should be via a hot-key. The hot-key should work not only when in the current working directory but also when using filename completion. Often, the directories I want to return to are discovered during filename completion. So, one hot-key is used to add and remove directories from the list and another hot-key to change directories to the next directory in the list.

Re: What the iPad Means for the Future of Computing

Comment regards Wired's 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.

Mag+

This posting about Mag+, a possible future digital magazine, is a very well considered design. The short video is well worth watching.