Saturday, November 07, 2009
Streaming Netflix on a PS3
Yesterday, I received a disc from Netflix finally allowing streaming content on my PS.
Interestingly, the feature seems to actually run off the CD they send. It doesn't appear to install anything on the PS3. I put the disc in and selected it under the "video" section of the menus. It popped up with a code to go to the website and type in - I guess you have to use a computer for that, not the PS3 browser.
When I went to the Netflix site there was a link right on the front to activate the device with the code. I put the code in and it said it might take a few minutes, but when I walked back to the PS3, it was already displaying movie choices. Apparently my on-demand queue is already populated with every movie I've ever gotten that was also available on demand.
Anyway, it's about as painless it could be. The interface is very simular to what I've seen on a Roku. The video quality was pretty poor though on the one thing I watched. There is an "HD" icon under selections that are supposed to be high definition, but the selection I tried was still very highly compressed. I hope that I simply picked a poor example, or that this improves over time. Regardly, I'm glad to finally have this feature!
Thursday, November 05, 2009
Wednesday, November 04, 2009
Markham
http://www.pps.k12.or.us/departments/schoolmodernization/1627.htm
Portland Pulic Schools has posted a collection of documents on the historic significance of its school buildings. Markham is an interesting case. PDF here:
http://www.pps.k12.or.us/files/schoolmodernization/Markham_ILS.pdf
I attended this school from 4th through 8th grade. I also went there for kindergarten. First through 3rd grades where at a school down the road a bit, no longer standing.
As the historic assessment notes, the Markham school, named for the poet Edwin Markham, is shaped like an 'H'. The reason for this is that it was built at the height of the cold war to serve as a field hospital in the event of a nuclear exchange with the Soviet Union.
Really.
This is also the reason it's built of brick, and the reason it has ramps instead of stairs throughout the split-level floor plan. I doubt they are there now, but I recall the large circles painted on the paved playground surfaces behind the building, with X marks in the center. These were of course handy for playground games. They were helicopter landing pads.
Saturday, October 31, 2009
Wednesday, October 28, 2009
Shed Again
Monday, October 26, 2009
Saturday, October 24, 2009
Friday, October 23, 2009
Intercepting Log Messages in Glassfish
Image by Getty Images via Daylife
I wanted a way to capture certain types of errors from an OpenESB application, under the Glassfish application server. I had to do this because a couple of error scenarios get their exceptions handled at a lower level than my application code and I never get a chance to detect the problem. One approach to resolving this is to write some completely external process to monitor the log file itself. But a another way is to use Glassfish's Self-Management Framework, an MBean and a rule.There weren't a lot of examples of this to be found, so here some code. First, the MBean itself. The MBean needs to be built in conformance with some simple but very specific rules.
- It must implement javax.management.NotificationListener
- It must have an interface of its own with the same name as the MBean, but ending in "MBean"
package com.log.monitor;It is a trivial Java Bean interface with one getter/setter pair added here just as an example. Here is the implementation class:
import javax.management.Notification;
import javax.management.NotificationListener;
public interface CustomActionMBean {
public int getA();
public void setA(int a);
}
package com.log.monitor;
import javax.management.Notification;
import javax.management.NotificationListener;
public class CustomAction implements CustomActionMBean, NotificationListener {
private int a = 0;
public CustomAction() {
}
public void setA(int a) {
this.a = a;
}
public int getA() {
return a;
}
public void handleNotification(Notification arg0, Object arg1) {
System.out.println("Called... " + arg0.getMessage());
}
}
These get built into a jar file called CutomAction.jar, using whatever IDE or command line you prefer. I used Eclipse, and I found that I had to uncheck the compression option to get this to fully work.I deployed the jar file to Glassfish using its web-based administration console. This is done in a manner simular to deploying anything else, but using the section under "custom mbeans." There is a command line method too, using asadmin. The deployment will fail if there's anything wrong with the MBean, such as an incorrect interface name or referring to the wrong Notification classes.
Once this is done, a Management Rule can be created. The key here is that the "event type" should be "log". The MBean deployed above should appear in the "Action" drop down list. Each event type has different options. In the case of a log type it is also possible to select a log level, and a specific logger as filters. But once activated, this rule will call the new MBean as needed when an appropriate log message is created. The raw message string is available from the Notification object with getMessage().
Here's a few good resources on all this:
http://weblogs.java.net/blog/sankara/archive/2006/02/self_management.html
http://blogs.sun.com/technical/entry/self_management_rules
https://glassfish.dev.java.net/javaee5/selfmanagement/selfmanagementhome.html
http://www.caucho.com/resin-3.0/jmx/tutorial/listener/index.xtp
Thursday, October 22, 2009
Shed, Part One
Monday, August 10, 2009
US Internet Service is Pathetic
Image by [ r ♥ c e y t ♥ y ] {I br♥ke for bokeh} via Flickr
http://www.ohgizmo.com/2009/08/10/getting-bandwidth-envy-portugal-to-have-1gbps-internet-service-by-fall/"Portugal ISP Zon will be offering its customers 1Gbps service starting this September. The country will then become the world’s third (and the first in Europe) to provide such speeds, along with Japan and South Korea."
Wednesday, July 22, 2009
Apollo
Image by Vaguely Artistic via Flickr
http://www.nytimes.com/2009/07/19/opinion/19wolfe.html?pagewanted=1&_r=1
"Three months after the landing, however, in October 1969, I began to wonder ... I was in Florida, at Cape Kennedy, the space program’s launching facility, aboard a NASA tour bus. The bus’s Spielmeister was a tall-fair-and-handsome man in his late 30s ... and a real piece of lumber when it came to telling tourists on a tour bus what they were looking at. He was so bad, I couldn’t resist striking up a conversation at the end of the tour.
"Sure enough, it turned out he had not been put on Earth for this job. He was an engineer who until recently had been a NASA heat-shield specialist. A baffling wave of layoffs had begun, and his job was eliminated. It was so bad he was lucky to have gotten this stand-up Spielmeister gig on a tour bus. Neil Armstrong and his two crew mates, Buzz Aldrin and Mike Collins, were still on their triumphal world tour ... while back home, NASA’s irreplaceable team of highly motivated space scientists — irreplaceable! — there were no others! ...anywhere! ... You couldn’t just run an ad saying, “Help Wanted: Experienced heat-shield expert” ... the irreplaceable team was breaking up, scattering in nobody knows how many hopeless directions."Several years ago I read an article that seriously questioned whether or not a project on the scale of Apollo was even possible today. It may well not be. It's an odd thing for someone from my generation to consider; that, for all sorts of reasons, the time and achievements of Apollo represent a high point, the very best, a peak of technology, will, project organization, and plain quality... Just memory, never to come again.
Tuesday, July 21, 2009
Toast
Image via Wikipedia
The Toaster Project:http://www.thetoasterproject.org/
"So are toasters ridiculous? It depends on the scale at which you look. Looking close up, a desire (for toast) and the fulfilment of that desire is totally reasonable. Perhaps the majority of human activity can be reduced to a desire to make life more comfortable for ourselves, and has thus far led to being able to buy a toaster for £3.99 [among other achievements]. But looking at toasters in relation to global industry, at a moment in time when the effects of our industry are no longer trivial compared to the insignificant when our, they seem unreasonable. I think our position is ambiguous - the scale of industry involved in making a toaster [etc.] is ridiculous but at the same time the chain of discoveries and small technological developments that occurred along the way make it entirely reasonable."
Monday, July 20, 2009
What Could Go Wrong?
The company explains: "Despite the far-reaching reports that this includes 'human bodies,' the public can be assured that the engine Cyclone has developed to power the EATR runs on fuel no scarier than twigs, grass clippings and wood chips."
...
Well quite. Cyclone CEO Harry Schoell further assures: “We completely understand the public’s concern about futuristic robots feeding on the human population, but that is not our mission."
Whew! That's a relief!
Tuesday, July 14, 2009
AuthBasicAuthoritative
Image via Wikipedia
Quite some time ago I posted an entry here about configuring Apache to authenticate against an NT4 Windows domain using PAM. That was on an older Fedora box. The original post is here:http://jsexton0.blogspot.com/2007/10/subversion-fedora-pam-winbindd-apache.html
On a new Debian box, a very simular configuration failed. The Apache server recorded this message in its error log:
Internal error: pcfg_openfile() called with NULL filename
It turns out that later versions of Apache expect a users file even if the authentication method does not use one. The fix is to add an additional directive to protected
AuthBasicAuthoritative Off
Tuesday, June 23, 2009
Reset the Service Light on a Volvo C70
Image via Wikipedia
Years ago, I saved an email on resetting the dash service light on a newer Volvo, such as my C70. I finally needed to do this, dug out the email and sure enough it worked! No OBD-II required.1. Turn the ignition to the "I" position (accessory), and hold down the trip meter reset button
2. While holding it down turn the key to position "II" (don't start)
3. Continue to hold the reset button down until the service light begins to flash.
That's it - the internet used for good.
Tuesday, May 19, 2009
Hmmmm
Image by law_keven via Flickr
http://news.bbc.co.uk/2/hi/uk_news/8056284.stm"For decades, hundreds of people worldwide have been plagued by an elusive buzzing noise known as "the Hum". Some have blamed gas pipes or power lines, others think their ears are faulty. A few even think sinister forces could be at work.
...
"The internet is abuzz with rumour and speculation. There are dark mutterings about secret military activity, alien contact and government cover-ups. The hum even featured in an episode of the sci-fi drama "The X-Files"."
Monday, May 18, 2009
Blogger and Escaping HTML
Image by grebo guru via Flickr
While attempting to create a blog post containing a couple of XML fragments, I ran into a surprising problem with Goggle's Blogger editor. It is staggeringly difficult to get greater-then and less-then signs into you text!I Goggled up this other blog post that sums up the problem nicely:
http://justfreakingwork.blogspot.com/2007/06/why-cant-blogger-escape-special.html
It's a little hard to believe in this day and age that Google has made such a mess of this.
Headless Build Automation for Netbeans BPEL Projects
When I first started using Netbeans I was encouraged that it used ant for its builds rather than some process implemented as part of the IDE. However, in practice, doing a build outside the IDE turns out to be not only non-trivial but extremely complex, and may be impossible in some cases. For example, in the case of a BPEL project that includes a WSDL dragged into the BPEL editor from another project...
When a WSDL from a separate project is included in a BPEL, the tag's location cause looks like this:
<import namespace="http://myns" location="otherProject/my.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
where "otherProject" is the project containing the web service being used. WSDLs from the local BPEL project look like this:
<import namespace="http://myns" location="my.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
This location tag is not an operating system file path. "otherProject/" in the above example can be anyplace on the system relative to the project being built and the the IDE somehow finds it. Using "file://something" in the location tag is apparently a syntax error. It's hard to say what this location tag actually is. At the moment, I don't know.
Outside of the IDE, a location tag such as the above fails to find the WSDL file during the build. The failure occurs in at least two java classes that the build script invokes.
org.netbeans.modules.bpel.project.anttasks.cli.CliValidateBpelProjectTask
org.netbeans.modules.bpel.project.anttasks.cli.CliGenerateCatalogTask
Somehow these classes are able, in the IDE, to map the location tag to a physical WSDL file. The only reference I could find to these location strings is in the catalog.xml file in the project's base directory. But removing these does not create a build error in the IDE, so that can't be how it knows. Is there some internal database in Netbeans tracking these references? Hard to say.
A good deal of essential information on building Netbeans projects outside of the IDE can be found here:
http://blogs.sun.com/tronds/entry/creating_a_simple_headless_build
This information is vital to getting started with the build environment, outside the IDE. That setup may be enough for most projects, or at least projects other than BPEL projects that refer to WSDLs in other projects.
GUI-only builds is a very surprising limitation, but there it is. It seems we will have to replace the build scripts for our projects. It would have been better to know about this a long time ago, before beginning projects using this otherwise really quite nice technology.
Thursday, April 02, 2009
Monday, March 09, 2009
Breaking News!
Image by hose902 via Flickr
This Just in!Children are easily fooled!
http://www.msnbc.msn.com/id/29468137/
"In a new study, 186 4-year-olds were given regular carrots and, on other lunch days, they were given the same vegetables renamed X-ray Vision Carrots. On the latter days, they ate nearly twice as many."
Monday, March 02, 2009
Bell
Image via Wikipedia
http://www.porticus.org/bell/bell.htm"A website created as a memorial to the people, history, technology and the "Spirit of Service" of what was known as the "Bell System" prior to 1984."
Cool...
"You see, this phone system consists of a multibillion-dollar matrix of space age technology that is so sophisticated even we can't handle it. But that's your problem, isn't it? So, the next time you complain about your phone service, why don't you try using two Dixie cups with a string? We don't care. We don't have to. We're the Phone Company."
-- Lily Tomlin
Friday, February 27, 2009
Remake
Image via Wikipedia
http://www.theregister.co.uk/2009/02/27/total_recall/"Columbia Pictures is in "final negotiations" with producer Neal H Moritz to develop a "contemporary version" of 1990 Arnold Schwarzenegger sci-fi romp Total Recall, the Hollywood Reporter, er, reports.
...
"The original Paul Verhoeven-helmed movie - which grossed $261m worldwide - was based on the Philip K Dick story We Can Remember It for You Wholesale. Moritz described the Dick tale as "prescient"."
I hope it doesn't suck (but what are the odds...)
Tuesday, February 24, 2009
Hardware?
Image via Wikipedia
http://tech.slashdot.org/article.pl?sid=09/02/24/2220209"Microsoft executives have been telling the tech industry that if hardware supports Windows Vista, it will support Windows 7, but it now looks like that may not entirely be the case. According to CRN: 'But after a series of tests on older and newer hardware, a number of noteworthy issues emerged: Microsoft's statement that if hardware works with Windows Vista it will work with Windows 7 appears to be, at best, misleading"
The first thing that went through my mind when I read this was how pathetic it was - you'd never have that problem with Linux.
The second thing that occured to me was how remarkable it was that I had thought that, without hesitation. Hardware compatibility used to be a reason you'd need Windows of Linux. But now it's the other way around!
It was inevitable that MSFT's stategy of building the kitchen sink directly into it's giant, monolethic "operating system" would fail eventually. It's finally happening. What a relief!
Friday, February 13, 2009
Bits
Image via Wikipedia
http://news.opb.org/article/4263-trimet-looks-cutting-routes-reducing-service/"TriMet has just announced cuts of 5 percent across-the-board. That means fewer routes; buses that come every half-hour instead of every 15 minutes; and fewer trains at off-peak times.
"The cuts are coming now because most of the agency's income is derived from employer payroll taxes. Meaning when people lose their jobs, TriMet loses income."
There's something wrong with this equation. At a time when more people may be turning to TriMet, and starting a public transportation habit, TriMet should be improving its service.
* * *
http://news.opb.org/article/4267-elections-divisions-opens-sizemore-investigation/
"The Oregon Elections Division opened an investigation Thursday into Bill Sizemore's campaign activities during the 2008 elections. Kristian Foden-Vencil reports."
It's about time.
* * *
"An internet of things"
Someday I'll get spam from my toaster.
* * *
"The Canadian military is evoking the wisdom of the green, pint-sized Yoda character from Star Wars for a video it's creating to give soldiers returning from Afghanistan tips on coping with the psychological scars of combat zones."
"I don't believe it," Skywalker says.
"That is why you fail," Yoda replies.
They're trying to touch soldiers to lift X-Wing Fighters with their minds?
Thursday, February 12, 2009
Marshalling and Unmarshalling Without a @XmlRootElement
Netbeans has a handy feature off on the palette on the right (usually) of the code editor, where you can drag a marshal or unmarshal object into your Java code and it will generate marshal/unmarshal code for the XML or JAXB object of your choice.
It is interesting that sometimes, although it does not complain when generating these code fragments, there will occur an error at runtime stating that an object has no @XmlRootElement.
@XmlRootElement annotations are not always created in JAXB objects. Here is a nice explanation of why that is:
http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
The subject of this post is not why this happens, but rather how to deal with these objects when you don't want to use inline complex types.
Here's a sample marshal method more or less as generated by the wizard of Netbeans:
private String jaxbMarshalToString(MyType jaxbObj) throws javax.xml.bind.JAXBException, java.io.IOException
java.io.StringWriter sw = new java.io.StringWriter();
javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(jaxbObj.getClass().getPackage().getName());
javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8");
//NOI18N
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(jaxbObj, sw);
sw.close();
return sw.toString();
}
Here is an unmarshal method for the same object:
private MyType jaxbUnmarshalFromString(String str) throws javax.xml.bind.JAXBException
MsgQMessageType ret = null;
javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(MyType.class);
javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
ret = (MyType) unmarshaller.unmarshal(new java.io.StringReader(str));
//NOI18N
return ret;
}
This object has "Type" appended to its name. That is a sign that this is a container rather than the JAXB representation of the XSD itself. These methods fail at runtime because the object jaxbObj includes no root annotation.
Here are these two methods changed so they work. In the first method, we create a new JAXBElement (so it will have a root element) and marshal that. In the second method, we unmarshal to a JAXBElement, and return that object's getValue(), cast to our desired type. Also in the unmarshal code, the context is created using getPackage().getName() rather than just the class.
private String jaxbMarshalToString(MyType jaxbObj) throws javax.xml.bind.JAXBException, java.io.IOException
java.io.StringWriter sw = new java.io.StringWriter();
javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(jaxbObj.getClass().getPackage().getName());
javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8");
//NOI18N
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(new JAXBElement(
new QName("http://www.namespace.com/schema/My", "My"),
MyType.class, jaxbObj), sw);
sw.close();
return sw.toString();
}
JAXBElement ret = null;
javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(MyType.class.getPackage().getName());
javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
ret = (JAXBElement) unmarshaller.unmarshal(new java.io.StringReader(str));
//NOI18N
return (MyType)ret.getValue();
}
Tuesday, February 10, 2009
Big Mac Latte Numbers
Image by Getty Images via Daylife
http://pewresearch.org/pubs/1111/starbucks-versus-mcdonalds-choices-demographics"Would you prefer to live in a place with more McDonald's or more Starbucks?" The Golden Arches won the head-to-head contest by 43%-35%"
Some interesting demographic breakdowns...
Monday, February 09, 2009
Sunday, February 08, 2009
Thursday, February 05, 2009
Fire Drill
Image via Wikipedia
http://games.slashdot.org/article.pl?sid=09/02/05/1136228"Researchers at Durham University have modified a video game and turned it into a fire drill simulator using the Source engine (the 3D game engine used to drive Half-Life 2), and created a virtual model of one of the university's departments. Dr. Shamus Smith said that although 3D modeling software was available, modifying a video game was faster, more cost effective, and had better special effects. 'We were interested in using game technology over a customized application and the Source Engine, from Half-Life, is very versatile,' said Smith.
Plus there might be mutants shooting at you during a fire. You never know.
Wednesday, February 04, 2009
Shut
"An icon of the Columbia River Gorge, referred to as the "Waldorf of the West" in its heyday, has become the latest victim of the economic crisis.
"The historic Columbia Gorge Hotel shut its doors Friday, canceling reservations and laying off dozens of employees."
A shame...
Saturday, January 31, 2009
Mediatomb and Playlists
Also, once a directory is processed by a timed rescan, I have trouble adding new playlist files, individually, from that location. A couple of weeks ago, inexplicitly, a playlist I had previously used without trouble disappeared from Mediatomb, and I could not add it back (no errors, it just didn't show up). I removed my other playlists and found I could not add those back either. So I made a brand new file, and that would not add. To fix this I had to be sure that the directory and all playlists were removed from Mediatomb, and there were no timed rescans on that folder. I added back each m3u file individually, and they worked fine.
I think it's best to stay away from timed rescan, on my installation away, for playlists (I've had no trouble with rescans of music, video and photo files). I should note that this feature is supposed to work. And I should note that I have seen Mediatomb pick up m3u files on timed rescans from my music folders in the past. But from my playlist directory, I've had odd behaviors (no, this is not related to file/diectory permissions in my case, that is a common problem though. Check that if it is not working for you).
For creating playlists I have been using fapg. This worked well for me because I had already some long lists of files to work with and fapg can take these simple lists on stdin. Many people that use Mediatomb and similar servers use other media handler just to create playlists. I have been experimenting with juk. Juk seems to be particularly suited to larger collections (a problem I have with many of these tools is that they simply have not been designed for large and well organized media collections, with correct tags and such). There are other choices. I've seen Rhythmbox mentioned quite a bit. Such tools tend to support media playing or streaming on their own, but they also have nice playlist editors and search features that are useful alone.
One of the reasons I have been working to replace the system I had built myself, is that more standard bits and pieces (like m3u files) will allow me to use a variety of off the shelf packages (there are any number of programs available to edit playlists and now I can use any one, or more than one). There are also other servers and clients that support the same protocols. One does not have to be limited to one combination, if one server is better than another for, say, one type of content or another.
Friday, January 30, 2009
Pride and Prejudice and Zombies
Here's something new, public domain classic literature, with zombies added in. No really. Seriously. Stop laughing, it's true.
"Pride and Prejudice and Zombies features the original text of Jane Austen's beloved novel with all-new scenes of bone-crunching zombie action. As our story opens, a mysterious plague has fallen upon the quiet English village of Meryton—and the dead are returning to life! Feisty heroine Elizabeth Bennet is determined to wipe out the zombie menace, but she's soon distracted by the arrival of the haughty and arrogant Mr. Darcy."
...and so on.
Toying with Bacon
"A being with no knowledge of what it means to be sightless, having never had eyes. It knows no pain, but also no hope."
Bacon man...
Awesome.
Google Street View Death Machine Hits a Deer
Image via Wikipedia
http://www.stuff.co.nz/stuff/dominionpost/4834025a27483.html
"The images show a young deer running beside the Google car before it can been seen lying on its side. A third screen grab shows the deer lying on the side of the road in the distance as the car moves away.
"The car was travelling in broad daylight down a narrow road in rural New York state when the accident happened."Thursday, January 29, 2009
Zimbabwe Abandons its Currency
Image via Wikipedia
http://news.bbc.co.uk/1/hi/world/africa/7859033.stm"BBC southern Africa correspondent Peter Biles says the Zimbabwean dollar has become a laughing stock. A Z$100 trillion note was recently introduced. "
Things can always be worse.
Just $53.5 Million and It's Yours!
Image via Wikipedia
http://www.reuters.com/article/oddlyEnoughNews/idUSTRE50S4DF20090129He complained the apartment was "attic-like" with small windows, low ceilings, obstructed views and ugly drainage grates. He demanded the return of his $10.7 million deposit and $30 million in damages.
In a counter suit, El-Ad accused Vavilov of libel and demanded $36 million in damages.
The Plaza overlooks Central Park and has inspired writers such as Kay Thompson, author of the "Eloise" stories about a 6-year-old girl who lived at the hotel, and Neil Simon, who wrote the Broadway play and hit film "Plaza Suite."
Jeff Sexton