Friday, February 27, 2009

The Passive-Aggressive Door Holding Game


Remake

Philip K.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...)


Reblog this post [with Zemanta]

Tuesday, February 24, 2009

Hardware?

Windows Vista, showing its new Aero Glass inte...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!

Reblog this post [with Zemanta]

Friday, February 13, 2009

Bits

YodaImage 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.

* * *

http://blog.makezine.com/archive/2009/02/5_companies_building_the_internet_o.html?CMP=OTC-0D6B48984890

"An internet of things"

Someday I'll get spam from my toaster.

* * *

http://www.theglobeandmail.com/servlet/story/RTGAM.20090210.wdefence10/BNStory/National/home?cid=al_gam_mostemail

"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?

Reblog this post [with Zemanta]

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();
}


private MyType jaxbUnmarshalFromString(String str) throws javax.xml.bind.JAXBException 
{
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

LOS ANGELES, CA - JULY 24:  The sun rises behi...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...
Reblog this post [with Zemanta]

Thursday, February 05, 2009

Fire Drill

Half-Life 2Image 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.

Reblog this post [with Zemanta]

Wednesday, February 04, 2009

Shut

http://www.kgw.com/lifestyle/stories/kgw_020209_lifestyle_columbia_gorge_hotel_closing.12b89d3b.html

"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...

Jeff Sexton

007 1:144 Scale 1:350 Enterprise 10 Barrel Brewing 14 1856 2001 A Space Odyssey 3D modeling 40and20 4th of July 78 RPM Abyss Adam West Advertising Agora Models Air Canada Airline Airways Brewing Alan Bennett Alaska Alberta Alberta Street Pub Alfa Romeo Spider Touring Gran Sport Amati Amazon Amnesia Brewing AMT Analog signal Android Anomalies and Alternative Science Antiques Apache Apollo Apple Apple Stores Art Artisanal Beer Works Assembly Brewing Aston Martin Astoria Asus Atlas Audrey Augmented reality Aurora Famous Fighters auto-awesome Automobile Autos Aviary Aviation Backups Baelic Brewing Bale Breaker Brewing Bandai Barack Obama Barley Brown's Beer Bars Base Camp Brewing Batman Battery Beards Beer Beer Bar Bell System Bellwether Berkshire Hathaway Betty White Beyond the Fringe Bigfoot Bikes Bill Clinton Bird Food Bird Toys Birds Birthdays Bleriot Bleriot XI Block 15 Brewing Blogger Bojack Horseman Bolton Landing Brewing Boltons Boneyard Brewing Books Boxer Ramen Boxer Ramon Breakside Brewing Brian Eno Build Management Buoy Brewing Burger King Business and Economy Business Process Execution Language Bye & Bye Byte-order mark Canadian Carrot Cats Chex Mix Chihuly Chipmonk Christmas Civil Defense Clinton Clocks Closet Doors CNN Cockatiels Cocktails Collections Columbia Grafonola Columbia River George Columbia River Gorge Corners Corvallis County Cork Crooked Stave Brewing Crows Crux Brewing Cuisinart Culmination Brewing David Byne DB5 Dear Jane Debian Deschutes Brewing DFW C.V Diabetes Dick Curtis Digital Living Network Alliance Digital television Dinosaurs Disney Doll House Don the Beachcomber Double Mountain Brewing Dow Jones Industrial Average Dragons Dudley Moore Duesenburg SJ Roadster Durham University DVD E-mail address E9 Eagle Eagle Creek Fire Eaglemoss Easter ebauche Ecliptic Economics Ed Ed and Olive Eels EJB Elgin Elysian Brewing Energy development Enterprise Enterprise JavaBean ESP Evergreen Air Museum Everybody's Brewing Ex Novo Brewing F-84G Thunderjet Facebook Family Photos Fathers Day Fearless Brewing Fedora Ferment Brewing Ferns Festival of The Dark Arts Filesharing Finance Finger Firesign Theater Fireworks Flowers Flying Sub Food Ford Fort George Brewing Fossil fuel Free House Garfield James Abram Garfield Minus Garfield Gateway Brewing Gene Sexton Gene Wilder George Carlin Gigantic Brewing Gilgamesh Brewing Glass Glassfish Global warming Golden Arches Goldfinger Goofy Google Google Assistant Google Buzz Google Docs Google Home Google Lively Google Photos Google Reader Google Wave Google+ Goose Graffiti Grammar Gravy Great Divide Brewing Great Notion Brewing Greek Festival Greenhouse gas Gruen GT40 H. G. Wells Half-Life 2 Halloween Harlan Hawaii Helbros High-definition television Hilo Hilo Brewing History Ho 229 Hollywood Theater Hopworks Urban Brewery Horizon Models HP Hybrid electric vehicle IBM Impala Inner city Instagram Insulin Investing IPMS Iris Irony J.C. Penny James Bond Jane Austen Java Java Architecture for XML Binding JC Penny JDBC Jeannine Stahltaube Jeff's! Jim Davis joe the plumber John McCain Jonathan Miller Jubelale Kapaau Karma Kauai Kay Thompson Kermit the Frog Keys Keys Lounge Kids and Teens Kona LA Auto Show Labrewtory Larry King Laser Laserdisc Leavenworth Wenatchee River Level Brewing Lilly Tomlin linux Little Beast Brewing Lloyd Center Logging Lowry Sexton LPs Lucky Lab Magnets Mark Cuban Market trends Martin Mull Maytag McDonald Mediatomb Meier and Frank Mel Brooks Mercury Microsoft Microsoft Windows Migration Brewing Mobius Models modern Times Brewing Money Monkey monsters Moon MOUNT HOOD Mount Tabor Movie Reviews Multnomah Falls Music Music industry Muxtape MySQL NetBeans Netflix Nikon Nikon Z50 Ninkasi Brewing Nintendo Nissan Cube Norm Coleman North Bar Nuclear fallout Nuclear warfare Nuggest Nuts OBF Office Depot Offshoot Beer Co Oktoberfest Ola Brewing Old Town Brewing Olive Open ESB Oracle Corporation Orca Oregon Orion Space Clipper Owls Pacific Ocean Packard Boattail Pam American Parrots Patio Sale PDX Pearl District Pearl District Portland Oregon Peppers Performance Review Peter Cook Peter Iredale Pets Pfriem Brewing Philip K Dick Phone Book photography Pizza Plank Town Brewing Play Station PlayStation 3 pluspora Pocher Podcast Poke Pokémon HeartGold and SoulSilver Polar Lights Politics Pono Brewing Portal Portland Portland Development Commission Presidents Pride and Prejudice Programming Projects PS3 PS4 Pumpkins Quotation Marks Rad Power Radio Radio Room Ramen Ramon Recipes Recording Industry Association of America Renewable energy Reservoir Reuben's Brewing Reubens Brewing RIAA Richmond Pub Robot Chicken Rock-paper-scissors Rogue Brewing Round 2 Sales San Francisco Santa Sarcasm Sasquatch Brewing SATA Science fiction film Sea Quake Brewing Seattle Selfie Serbia Service-oriented architecture Seward Shelby Cobra Shipwreck Shopping Signs Silver Moon Brewing Slide Rule Snow Soap Soap Cutter Social Security Social Studies Society6 Sony Sopwith F.1 Camel BR.1 Soviet Space 1999 Space Race Spad XIII Speaker Repair Spirit of St. Louis Spitfire SQL Squirrel's St Patricks Day Stanford Hospital Star Trek Star Wars Starbucks Stock market Storm Breaker Strip search Stripes Studebaker Studellac Sun Microsystems Supernatural T-Mobile Tablet Tamiya Tamiya Spitfire Taube TechCrunch Technical Television Terminal Gravity Thanksgiving The Producers ThinkGeek Three Creeks Brewing Thunder Island Brewing Tiki Time Bandits Toaster Tom Peterson Tools Top Ferment Total Recall Transportation Security Administration Trumpeter Tubboat Tyco UFOs Unicode United States United States Department of Homeland Security Universal Plug and Play Unknown Primates USB USS Yorktown Valcom Van Gilder Hotel Vegetable garden VHS Victoria Video Video game Vintage Images Vintage Vintage! Virtual world Volcano Hawaii Volvo C70 Voyage to the Bottom of the Sea Wall Street War of the Worlds Warren Buffett Warrenton watches Watercolor Wayfinder Brewing We Can Remember It for You Wholesale Web service Web Services Description Language Whiskey Wii Windows 7 Windows Phone 7 Windows Vista Windows XP Windy Wingnut Wings Wood Worthy Brewing WWI WWII X-Files X-ray vision XML XML Schema Y2K Yeti YouTube Yugo Zero Mostel Zima Zoom H2n