Monday, March 08, 2010

Links Dumped

Oregon DMV offices cancel their Muzak service.

http://blog.oregonlive.com/commuting/2010/03/oregon_dmv_killing_muzak_in_se.html

"Oregon taxpayers pay up to $160 a month to pipe Muzak’s acoustic wallpaper into lobbies where drivers come to take tests, renew licenses and register vehicles."

* * *

Make your URL shady with ShadyURL!

http://www.shadyurl.com/

* * *

End tables from Ikea turn out to work great as 19" hardware racks.

http://wiki.eth-0.nl/index.php/LackRack

* * *

Here's in impressive visualization of the science, or lack o science, behind food supplements.

http://www.informationisbeautiful.net/play/snake-oil-supplements/


* * *

Google Public Data Explorer...

http://www.google.com/publicdata/home

* * *

Raptor-Cam!

http://www.kgw.com/lifestyle/raptor-cam

Thursday, March 04, 2010

Extending Java Socket Logging With SSL


The java.util.logging package includes a handy way to send log message out a port to a server. This is done by replacing the usual log handler with an instance java.util.logging.SocketHandler. The provided SocketHandler, by default, uses java.util.logging.XMLFormatter to create an XML message that will be send out a socket to the host of your choice, and to your own server code. Suppose you need to do this with an SSL connection, rather than a normal socket? This is simple to do using a alternate handler which functions similarly to SocketHandler, but creates an SSL connection.
package com.example.logger;

import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.logging.LogRecord;
import java.util.logging.StreamHandler;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.util.logging.SocketHandler;
public class SSLHandler extends StreamHandler {
 private SSLSocket sslSocket;
 private String host;
 private int port;

 private SSLHandler() throws IOException {
 }

 public SSLHandler(String h, int p) throws IOException {
  host = h;
  port = p;
  connect();
 }

 private void connect() throws IOException {
  SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
  sslSocket = (SSLSocket) sslsocketfactory.createSocket(host, port);

  OutputStream out = sslSocket.getOutputStream();
  BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(out);
  setOutputStream(bufferedOutputStream);
  java.util.logging.Logger.getLogger(getClass().getName()).log(
    java.util.logging.Level.INFO,
    "connect() completed to [" + host + "] at port " + port);
 }

 public boolean isLoggable(LogRecord record) {
  return true;
 }

 public synchronized void publish(LogRecord record) {
  if (isLoggable(record)) {
   super.publish(record);
   flush();
  }
 }

 public synchronized void close() throws SecurityException {
  super.close();
  if (sslSocket != null) {
   try {
    sslSocket.close();
   } catch (IOException e) {
   }
  }
  sslSocket = null;
 }
}
The use of this class is the same as using a SocketLogger. Logger logger = Logger.getLogger(getClass().getName()); Handler handler = new SSLHandler("my_host_name", 3000); logger.addHandler(handler); logger.log(Level.INFO, "Hello World"); Logged messages are send as XML fragments to the designated host at port 3000 via SSL. The developer is free to implement any sort of server needed to catch and process these messages. There's some good information related to remote logging here, including a simple non-SSL logging server example: http://blogs.sun.com/CoreJavaTechTips/entry/socket_logging The non-SSL server code is easily altered to open an SSL connection using an instance of SSLServerSocket.

Tuesday, March 02, 2010

Panic

1917 photograph of the board of the Federal Re...Image via Wikipedia

This is the sort of thing that gets people really hating stock market traders.

http://www.marketwatch.com/story/us-stocks-pare-gains-after-fed-hawkishness-2010-03-02

"Kansas City Federal Reserve President Thomas Hoenig reiterated . . . that the Federal Reserve should not guarantee zero-percent interest rates for an extended period. "We're going to have these days throughout the year, when investors get hit with the idea of eventual tightening," said Owen Fitzpatrick, head of U.S. equity group at Deutsche Bank. But the reaction is largely a knee-jerk one that's bound to dissipate, Fitzpatrick added"

Proving Hoenig correct, as he (shockingly reiterated) that interest rates might not stay near zero forever, the indexes dipped sharply on these words at about 10:30 eastern time this morning - only (of course) to climb right back up again.

So... I'm just wondering what traders expected him to to say? Maybe something like "I absolutely guarantee that interest rates will remain near zero from now until the end of times, for sure, no matter what." Ya, that would make sense. But since he didn't say that it's all OMG! Sell! Sell! Sell!

You just have to laugh...

Reblog this post [with Zemanta]

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