The Lanham Factor
The (ir)rational thoughts of a (not-so)mad man

Roanoke Code Camp 2014

I had a great time yesterday at Roanoke Code Camp!  Many thanks to American National University for the venue, the code camp staff and volunteers, the other speakers, and of course the attendees who made my sessions interactive.  I learned a lot yesterday and it was a good time all around.

I attended sessions on Apache Cassandra by Dr. Dave King (@tildedave), Angular JS by Kevin Israel (@kevadev), and JavaScript for Object-Oriented Programmers by Joel Cochran (@joelcochran).  I regret I was unable to attend all the sessions.

I also had the opportunity to present.  I spoke on Redis and got some people excited about graph databases by talking about Neo4j.  You can find my slides and other materials at the following links:

If you have any trouble getting any of the materials just respond to this post or tweet me @codesailor and I will make sure you get the information you need.



Generic C# Data Providers for Neo4j

Recently I started working with Neo4j in C#.  I am using the Neo4jClient and decided to write a wrapper for it using Generics.  In this blog post I'll show how I did it.  As always, your feedback is appreciated.

The first is the CRUD operations provider.  CRUD stands for Create, Retrieve, Update, Delete in case you don't know.  The CRUD provider is quite simple. 

But before we jump into that, we need to make some concessions.  We must have a common base type with a common property in order to find the node on successive calls.  So I created a base class with a single property, “Id”, as an int.  You can choose any property or properties you like but for simplicity I chose a small footprint.  Here is my base class:

public abstract class Neo4jBase
{     
	public int Id { get; set; }
}

(I don’t know why the “I” is uppercase.  I guess I got a little keyboard crazy.)

With that in place, we can build our CRUD data provider.  Remember, you must be using the Neo4jClient library.  Here is my generic provider:

using Neo4jClient;
public class Neo4jDataProvider<T> where T : Neo4jBase
{     
	IGraphClient _client = null;     
	public Neo4jDataProvider (IGraphClient client)     
	{         
		_client = client;     
	}     
	public T Create(T record)     
	{         
		if (_client != null)         
		{             
			var inputString = string.Format("({0}:{1}", typeof(T).Name.ToLower(), typeof(T).Name);             
			inputString += " { newRecord })";             
			_client.Cypher                 
				.Create(inputString)                 
				.WithParam("newRecord", record)                 
				.ExecuteWithoutResults();         
		}         
		return record;     
	}     
	public T Retrieve(int id)     
	{         
		T result = null;         
		if (_client != null)         
		{             
			var inputString = string.Format("({0}:{1})", "record", typeof(T).Name);             
			var query = _client.Cypher                         
					.Match(inputString)                         
					.Where((T record) => record.Id == id)                         
					.Return(record => record.As<T>());             
			result = query.Results.FirstOrDefault();         
		}         
		return result;     
	}     
	public T Update(T entry)     
	{         
		if (_client != null)         
		{             
			var inputString = string.Format("({0}:{1})", "record", typeof(T).Name);             
			_client.Cypher                     
				.Match(inputString)                     
				.Where((T record) => record.Id == entry.Id)                     
				.Set("record = {updatedRecord}")                     
				.WithParam("updatedRecord", entry)                     
				.ExecuteWithoutResults();         
		}                     
		return entry;     
	}     
	public void Delete(int id)     
	{         
		if (_client != null)         
		{             
			var inputString = string.Format("({0}:{1})", "record", typeof(T).Name);             
			_client.Cypher                     
				.Match(inputString)                     
				.Where((T record) => record.Id == id)                     
				.Delete("record")                     
				.ExecuteWithoutResults();         
		}     
	}
}

So what’s going here?  First it is a generic class of type T where T is a Neo4jBase object.  The reason is the Id property.  That property allows us to find and deal with nodes individually in an easy and familiar fashion.  Notice that the constructor takes an IGraphClient object.  It is expected the IGraphClient is instantiated and connected to a database.

The next point to note is the use of the type of T as the label.  For those of you new to graph databases, the “label” is the “type” of the node in the database.  For example, labels may be “Person”, “Movie”, “Book”, etc.  So in each method, the name of the type of T is used as the label.  You will also see the word “record” scattered throughout the code.  This is used as a variable name. 

An interesting behavior is that the .WHERE methods seem to break if the variable name in the .MATCH methods is not the same name as the name of the variable in the lambda expression.

What about Relationships?

Remember that relationships are first-class citizens in graph databases, just like nodes.  However, since relationships involve nodes of various types I decided to create a separate class for handling them.  The class is still a generic class but instead uses two different types, TLEFT and TRIGHT. 

A caveat: 1) The relationships data provider only handles unidirectional relationships (always left-to-right);  Here is the relationship data provider:

using Neo4jClient;
public class Neo4jDataProviderRelationships<TLeft, TRight>                                              where TLeft : Neo4jBase                                              where TRight : Neo4jBase
{     
	IGraphClient _client = null;     
	public Neo4jDataProviderRelationships(IGraphClient client)     
	{         
		_client = client;     
	}     
	public void Associate(TLeft left, string relationshipName, TRight right)     
	{         
		if (_client != null)         
		{             
			var inputStringLeft = string.Format("({0}:{1})", "tleft", typeof(TLeft).Name);             
			var inputStringRight = string.Format("({0}:{1})", "tright", typeof(TRight).Name);             
			_client.Cypher                 
				.Match(inputStringLeft, inputStringRight)                 
				.Where((TLeft tleft) => tleft.Id == left.Id)                 
				.AndWhere((TRight tright) => tright.Id == right.Id)                 
				.Create("tleft-[:" + relationshipName + "]->tright")                 
				.ExecuteWithoutResults();         
		}     
	}     
	public void Dissociate(TLeft left, string relationshipName, TRight right)     
	{         
		if (_client != null)         
		{             
			var inputStringLeft = string.Format("({0}:{1})", "tleft", typeof(TLeft).Name);             
			var inputStringRight = string.Format("({0}:{1})", "tright", typeof(TRight).Name);             
			_client.Cypher                 
				.Match(inputStringLeft + "-[:" + relationshipName + "]->" + inputStringRight)                 
				.Where((TLeft tleft) => tleft.Id == left.Id)                 
				.AndWhere((TRight tright) => tright.Id == right.Id)                 
				.Delete(relationshipName)                 
				.ExecuteWithoutResults();         
		}     
	}
}

Notice that like the CRUD data provider, an IGraphClient is expected by the constructor.  There are two methods for associating and dissociating nodes.

Usage

So how are these classes used?  Well, suppose you have a class, Person, and a class, Movie as follows (borrowed from the demo database that ships with Neo4j):

public class Movie : Neo4jBase
{     
	public string title { get; set; }     
	public string released { get; set; }     
	public string tagline { get; set; }

}
 
public class Person : Neo4jBase
{     
	public string name { get; set; }     
	public string born { get; set; }

}

Now suppose you want to create a Person and a Movie and relate them.  Specifically, let’s create William Shatner, and Airplane II, and relate them.  First, create the nodes:

Neo4jDataProvider<Person> personDataProvider = new Neo4jDataProvider<Person>(client);
Person person = new Person { Id = 1, born = "1966", name = "William Shatner" };
personDataProvider.Create(person);
 
Neo4jDataProvider<Movie> movieDataProvider = new Neo4jDataProvider<Movie>(client);
var movie = new Movie { Id = 1, released = "1982", tagline = "The Sequel", title = "Airplane II" };
movieDataProvider.Create(movie);

That will create the two nodes.  Let’s relate them:

Neo4jDataProviderRelationships<Person, Movie> relDataProvider = new Neo4jDataProviderRelationships<Person, Movie>(client);
relDataProvider.Associate(person, "ACTED_IN", movie);

And that’s it!

What’s the catch?

There are a number of catches including:

  • You must manage the “Id” values yourself.
  • You can’t easily retrieve a node based on any other property.
  • You can’t retrieve relationships. Even though they are fist class citizens, I only created CRUD operations wrappers.
  • The “Create” method doesn’t check for duplicates.  The “Update” method allows changing the “Id” field.

I’m sure there are more catches.  As an apology, I am just getting started.  I hope to extend these classes with more robust operations.  Your feedback is appreciated.  If someone has already done this (or something similar) I’d love to know about it. 



Binding Checkboxes with KnockoutJS

Recently I had occasion to bind a list of checkbox input elements to a KnockoutJS observableArray.  It actually took me a great deal of time to get the implementation working.  In this post I am going to cover the issues I experienced.  Then I will explain how implement a surefire checkbox-KnockoutJS binding solution.  This post assumes you have a working knowledge of KnockoutJS.  If you are new to KnockoutJS, please acquaint yourself at http://www.knockoutjs.comNOTE: Try is yourself on JSFiddle http://jsfiddle.net/codesailor/H7wLT/37/.

The Solution

I need to display a list of available associated items to associate with a base or “root” item.  For example, think of a “teacher” who is associated with multiple “classes” for providing instruction.  So the plan is to show the basic teacher information on the left side of the screen with the list of items on the right side of the screen.  What is needed, then, is a list of available classes as well as a list of classes already associated with the teacher.

image

Problem A – Visual Checkbox State Never Changes

My first issue revolved around trying to use the KnockoutJS checkbox binding inappropriately.  I decided to use a single observableArray wherein each array element has a “Selected” observable.  Then I “merge” the list of available classes with the list of associated classes by setting the Selected property to “true”.  This method actually works for displaying the initial state

image

You can see that the “click” event is wired to the “toggleClassassociation” method in my viewModel. That method makes a Web API call to toggle the teacher-class association.  However, no matter what I did, the visual state of the checkbox never changed.  When I refresh the page the initial state displays correctly.  The back-end code is working to make/break the associations.  So what is going on?

I found on a forum that I need to return “true” from the “click” event handler.  That did cause the visual state to change but it wasn’t enough.

Problem B – Misunderstanding the Binding

It turns out that I truly did not understand the binding for checkboxes.  There are a few key points in checkbox (and radio button) binding when using KnockoutJS.

  • If binding the checkbox list to an observableArray, the “checked” attribute needs to be the observableArray, not a property name.  KnockoutJS will automatically update the observableArray based on the state of the checkbox.
  • KnockoutJS automatic updating of the bound array is dependent on the “value” attribute of the element.  Notice the code screenshot above that only the “checked” attribute is set.  In order to bind to an array you need to use the “value” attribute as well.

Let’s look at the code snippet for the working solution.

image

There are a few key items to point out in this implementation.

  1. The parent <div> uses an observableArray (“ClassesPicklist”) that is different from the binding observableArray (“SelectedTeacher().ClassIds”).  This isn’t a problem because KnockoutJS only looks at the array elements
  2. The “value” attribute is used but the actual value is cast to a string.  That took me a while to figure out.  My initial implementation used the numeric ID values.  I started with using actual JavaScript objects and when that didn’t work I switched to numeric values only.  That didn’t work either and I decided to use strings as in the example on the KnockoutJS Web site.
  3. How does “checked” get set?  This is the magic of KnockoutJS.  As stated above, when the “checked” attribute is bound to an observableArray, KnockoutJS will search the array for any element that matches the “value” attribute.  Again, it only seems to work if they are both of type string.

Let’s look at the method called on “click”.

image

Notice that by default, KnockoutJS still passes the current data item (“cls”) to the function when it is called.  But remember that the items are bound to a different array than the checkbox binding.  The “ClassesPicklist” observableArray contains the values that are displayed in the browser.  So I use the “Selected” property to determine which action to take.  Notice, also, that I swap the value of “Selected” just before returning from the function.

This operation is not required.  I could scan both arrays and toggle all items not in the checkbox-bound array (“SelectedTeacher().ClassIds”).  But that would cause a lot of unnecessary traffic and overhead and it’s just as easy to track the items manually as shown above.

And speaking of tracking the items, when does “SelectedTeacher().ClassIds” get updated?  KnockoutJS does that for us.  Note that the “checked” attribute is bound to the array so KnockoutJS performs some wonderful magic and takes care of it for you.  If you check the checkbox KnockoutJS adds the value in the “value” attribute to the observableArray associated with the “checked” attribute.  So if the class ID is, for example, 13 then the value of that item will be “13” (remember, strings) and the “SelectedTeacher().ClassIds” array will contain “13”.  If it is already checked and you click it then the value “13” is removed from the array.

Summary

So to wrap it up, here are the key points to remember when binding a list of checkboxes using KnockoutJS where each checkbox represents a child element of some parent object:

  1. Use a separate observableArray for the binding and associated with array with the “checked” attribute.
  2. Use a value that can be represented as a string in both the bound array and the “value” attribute of the checkbox element.
  3. If you need to perform some server-side operation, return true from the “click” event handler.
  4. Separately track those items which are and aren’t associated with the root object.

So give it a try yourself using JSFiddle! http://jsfiddle.net/codesailor/H7wLT/37/

Obviously you should feel free to respond and or contact me if you have any trouble running the sample or any issues or questions.



Web API, JavaScript, Chrome & Cross-Origin Resource Sharing

The team spent much of the week working through this issues related to Chrome running on Windows 8 consuming cross-origin resources using Web API.  We thought it was resolved on day 2 but it resurfaced the next day.  We definitely resolved it today though.  I believe I do not fully understand the situation but I am going to explain what I know in an effort to help you avoid and/or resolve a similar issue.

My Lotic Factor colleagues Joel Cochran and Chris Atienza suffered with me and Joel wrote an excellent, complementary blog post to this post.

References

We referenced many sources during our trial-and-error troubleshooting.  These are the links we reference in order of applicability to the solution:

Zoiner Tejada

JavaScript and other material from -> http://www.devproconnections.com/content1/topic/microsoft-azure-cors-141869/catpath/windows-azure-platform2/page/3

WebDAV

Where I learned about “Accept” –>  http://www-jo.se/f.pfleger/cors-and-iis?

IT Hit

Tells about NOT using ‘*’ –> http://www.webdavsystem.com/ajax/programming/cross_origin_requests

Carlos Figueira

Sample back-end code (newer) –> http://code.msdn.microsoft.com/windowsdesktop/Implementing-CORS-support-a677ab5d

(older version) –> http://code.msdn.microsoft.com/CORS-support-in-ASPNET-Web-01e9980a

 

Background

As a measure of protection, Web designers (W3C) and implementers (Google, Microsoft, Mozilla) made it so that a request, especially a JSON request (but really any URL), sent from one domain to another will only work if the requestee “knows” about the requester and allows requests from it. So, for example, if you write a ASP.NET MVC Web API service and try to consume it from multiple apps, the browsers used may (will?) indicate that you are not allowed by showing an “Access-Control-Allow-Origin” error indicating the requester is not allowed to make requests.

Internet Explorer (big surprise) is the odd-hair-colored step-child in this mix. It seems that running locally at least IE allows this for development purposes.  Chrome and Firefox do not.  In fact, Chrome is quite restrictive.  Notice the images below. IE shows data (a tabular view with one row for each day of a week) while Chrome does not (trust me, neither does Firefox).  Further, the Chrome developer console shows an XmlHttpRequest (XHR) error.

image image

Screen captures from IE (left) and Chrome (right). Note that Chrome does not display data and the console shows an XHR error.

Why does this happen?

The Web browser submits these requests and processes the responses and each browser is different. Okay, so, IE is probably the only one that’s truly different.  However, Chrome has a specific process of performing a “pre-flight” check to make sure the service can respond to an “Access-Control-Allow-Origin” or Cross-Origin Resource Sharing (CORS) request.  So basically, the sequence is, if I understand correctly: 

1)Page Loads –> 2)JavaScript Request Processed by Browser –> 3)Browsers Prepares to Submit Request –> 4)[Chrome] Browser Submits Pre-Flight Request –> 5)Server Responds with HTTP 200 –> 6)Browser Submits Request –> 7)Server Responds with Data –> 8)Page Shows Data

This situation occurs for both GET and POST methods.  Typically, GET methods are called with query string parameters so there is no data posted.  Instead, the requesting domain needs to be permitted to request data but generally nothing more is required.  POSTs on the other hand send form data.  Therefore, more configuration is required (you’ll see the configuration below).  AJAX requests are not friendly with this (POSTs) either because they don’t post in a form.

How to fix it.

The team went through many iterations of self-hair removal and we think we finally have a working solution.  The trial-and-error approach eventually worked and we referenced many sources for the information.  I indicate those references above.  There are basically three (3) tasks needed to make this work.

Assumptions: You are using Visual Studio, Web API, JavaScript, and have Cross-Origin Resource Sharing, and several browsers.

1. Configure the client

Joel Cochran centralized our “cors-oriented” JavaScript (from here). There are two calls including one for GET and one for POST

(function (window) {
    function CorsAjax() {
        this.post = function(url, data, callback) {
            $.support.cors = true;
            var jqxhr = $.post(url, data, callback, "json")
                .error(function(jqXhHR, status, errorThrown) {
                    if ($.browser.msie && window.XDomainRequest) {
                        var xdr = new XDomainRequest();
                        xdr.open("post", url);
                        xdr.onload = function () {
                            if (callback) {
                                callback(JSON.parse(this.responseText), 'success');
                            }
                        };
                        xdr.send(data);
                    } else {
                        logger.write(">" + jqXhHR.status);
                        alert("corsAjax.post error: " + status + ", " + errorThrown);
                    }
                });
        };

        this.get = function(url, callback) {
            $.support.cors = true;
            var jqxhr = $.get(url, null, callback, "json")
                .error(function(jqXhHR, status, errorThrown) {
                    if ($.browser.msie && window.XDomainRequest) {
                        var xdr = new XDomainRequest();
                        xdr.open("get", url);
                        xdr.onload = function () {
                            if (callback) {
                                callback(JSON.parse(this.responseText), 'success');
                            }
                        };
                        xdr.send();
                    } else {
                        logger.write(">" + jqXhHR.status);
                        alert("corsAjax.get error: " + status + ", " + errorThrown);
                    }
                });
        };
    };

    window.corsAjax = new CorsAjax();
})(window);

The GET & PUT CORS JavaScript functions (credit to Zoiner Tejada, Joel Cochran)

Now you need to call these functions to get and post your data (instead of, say, using $.Ajax). Here is a GET example:

corsAjax.get(url, function(data) { if (data !== null && data.length !== undefined) { // do something with data } });

And here is a POST example:

corsAjax.post(url, item);

Simple…except…you’re not done yet.

2. Change Web API Controllers to Allow CORS

There are actually two steps here.  Do you remember above when we mentioned the “pre-flight” check?  Chrome actually asks the server if it is allowed to ask it for cross-origin resource sharing access.  So you need to let the server know it’s okay.  This is a two-part activity.  a) Add the appropriate response header Access-Control-Allow-Origin, and b) permit the API functions to respond to various methods including GET, POST, and OPTIONS.  OPTIONS is the method that Chrome and other browsers use to ask the server if it can ask about permissions.  Here is an example of a Web API controller thus decorated:

NOTE: You’ll see a lot of references to using “*” in the header value.  For security reasons, Chrome does NOT recognize this is valid.

[HttpHeader("Access-Control-Allow-Origin", "http://localhost:51234")]
[HttpHeader("Access-Control-Allow-Credentials", "true")]
[HttpHeader("Access-Control-Allow-Methods", "ACCEPT, PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST")]
[HttpHeader("Access-Control-Allow-Headers", "Accept, Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control")]
[HttpHeader("Access-Control-Max-Age", "3600")]
public abstract class BaseApiController : ApiController
{
    [HttpGet]
    [HttpOptions]
    public IEnumerable<foo> GetFooItems(int id)
    {
        return foo.AsEnumerable();
    }

    [HttpPost]
    [HttpOptions]
    public void UpdateFooItem(FooItem fooItem)
    {
        // NOTE: The fooItem object may or may not
        // (probably NOT) be set with actual data.
        // If not, you need to extract the data from
        // the posted form manually.

        if (fooItem.Id == 0) // However you check for default...
        {
            // We use NewtonSoft.Json.
            string jsonString = context.Request.Form.GetValues(0)[0].ToString();
            Newtonsoft.Json.JsonSerializer js = new Newtonsoft.Json.JsonSerializer();
            fooItem = js.Deserialize<FooItem>(new Newtonsoft.Json.JsonTextReader(new System.IO.StringReader(jsonString)));
        }

        // Update the set fooItem object.
    }
}

Please note a few specific additions here:

* The header attributes at the class level are required.  Note all of those methods and headers need to be specified but we find it works this way so we aren’t touching it.

* Web API will actually deserialize the posted data into the object parameter of the called method on occasion but so far we don’t know why it does and doesn’t.

* [HttpOptions] is, again, required for the pre-flight check.

* The “Access-Control-Allow-Origin” response header should NOT NOT NOT contain an ‘*’.

3. Headers and Methods and Such

We had most of this code in place but found that Chrome and Firefox still did not render the data.  Interestingly enough, Fiddler showed that the GET calls succeeded and the JSON data is returned properly.  We learned that among the headers set at the class level, we needed to add “ACCEPT”.  Note that I accidentally added it to methods and to headers.  Adding it to methods worked but I don’t know why.  We added it to headers also for good measure.

[HttpHeader("Access-Control-Allow-Methods", "ACCEPT, PROPFIND, PROPPA...
[HttpHeader("Access-Control-Allow-Headers", "Accept, Overwrite, Destin...

Next Steps

That should do it.  If it doesn’t let us know.  What to do next? 

* Don’t hardcode the allowed domains.  Note that port numbers and other domain name specifics will cause problems and must be specified.  If this changes do you really want to deploy updated software?  Consider Miguel Figueira’s approach in the following link to writing a custom HttpHeaderAttribute class that allows you to specify the domain names and then you can do it dynamically.  There are, of course, other ways to do it dynamically but this is a clean approach.

http://code.msdn.microsoft.com/windowsdesktop/Implementing-CORS-support-a677ab5d



Get to Know a Candidate (19-25 of 25): Independent Candidates

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting.  Information sourced for Wikipedia.

The following independent candidates have gained access to at least one state ballot.

  • Richard Duncan, of Ohio; Vice-presidential nominee: Ricky Johnson Candidate Ballot Access: Ohio - (18 Electoral)  Write-In Candidate Access: Alaska, Florida, Indiana, Maryland
  • Randall Terry, of West Virginia; Vice-presidential nominee: Missy Smith Candidate Ballot Access: Kentucky, Nebraska, West Virginia - (18 Electoral)  Write-In Candidate Access: Colorado, Indiana
  • Sheila Tittle, of Texas; Vice-presidential nominee: Matthew Turner Candidate Ballot Access: Colorado, Louisiana - (17 Electoral)
  • Jeff Boss, of New Jersey; Vice-presidential nominee: Bob Pasternak Candidate Ballot Access: New Jersey - (14 Electoral)
  • Dean Morstad, of Minnesota; Vice-presidential nominee: Josh Franke-Hyland Candidate Ballot Access: Minnesota - (10 Electoral)  Write-In Candidate Access: Utah
  • Jill Reed, of Wyoming; Vice-presidential nominee: Tom Cary Candidate Ballot Access: Colorado - (9 Electoral)  Write-In Candidate Access: Indiana, Florida

Jerry Litzel, of Iowa; Vice-presidential nominee: Jim Litzel

Candidate Ballot Access: Iowa - (6 Electoral)

That wraps it up people. We have reviewed 25 presidential candidates in the 2012 U.S. election. Look for more blog posts about the election to come.



Get to Know a Candidate (18 of 25): Jack Fellure–Prohibition Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting.  Information sourced for Wikipedia.  NOTE:  I apologize for getting this entry out of order.

Fellure (born October 3, 1931) is an American perennial political candidate and retired engineer.  Fellure has formally campaigned for President of the United States in every presidential election since 1988 as a member of the Republican Party. He asserts on his campaign website that his platform based on the 1611 Authorized King James Bible has never changed. As a candidate, he calls for the elimination of the liquor industry, abortion and pornography, and advocates the teaching of the Bible in public schools and criminalization of homosexuality. He has blamed the ills of society on those he has characterized as "atheists, Marxists, liberals, queers, liars, draft dodgers, flag burners, dope addicts, sex perverts and anti-Christians." After another run in 2008, Fellure initially ran for the Republican Party's 2012 presidential nomination. He then decided to seek the nomination of the Prohibition Party at the party's national convention in Cullman, Alabama

The Prohibition Party (PRO) is a political party in the United States best known for its historic opposition to the sale or consumption of alcoholic beverages. It is the oldest existing third party in the US. The party was an integral part of the temperance movement. While never one of the leading parties in the United States, it was once an important force in the politics of the United States during the late 19th century and the early years of the 20th century. It has declined dramatically since the repeal of Prohibition in 1933. The party earned only 643 votes in the 2008 presidential election. The Prohibition Party advocates a variety of socially conservative causes, including "stronger and more vigorous enforcement of laws against the sale of alcoholic beverages and tobacco products, against gambling, illegal drugs, pornography, and commercialized vice."

Fellure has Ballot Access in: LA

Learn more about Jack Fellure and Prohibition Party on Wikipedia.



Get to Know a Candidate (17 of 25): James Harris–Socialist Workers Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting.  Information sourced for Wikipedia.

Harris (born 1948) is an African American communist politician and member of the National Committee of the Socialist Workers Party. He was the party's candidate for President of the United States in 1996 receiving 8,463 votes and again in 2000 when his ticket received 7,378 votes. Harris also served as an alternate candidate for Róger Calero in 2004 and 2008 in states where Calero could not qualify for the ballot (due to being born in Nicaragua). In 2004 he received 7,102 votes of the parties 10,791 votes. In 2008 he received 2,424 votes. More recently Harris was the SWP candidate in the 2009 Los Angeles mayoral election receiving 2,057 votes for 0.89% of the vote. Harris served for a time as the national organization secretary of the SWP. He was a staff writer for the socialist newsweekly The Militant in New York. He wrote about the internal resistance to South African apartheid and in 1994 traveled to South Africa to attend the Congress of South African Trade Unions convention.

The Socialist Workers Party is a far-left political organization in the United States. The group places a priority on "solidarity work" to aid strikes and is strongly supportive of Cuba. The SWP publishes The Militant, a weekly newspaper that dates back to 1928, and maintains Pathfinder Press.

Harris has Ballot Access in: CO, IO, LA, MN, NJ, WA (write-in access: NY)

Learn more about James Harris and Socialist Workers Party on Wikipedia.



Get to Know a Candidate (16 of 25): Stewart Alexander–Socialist Party USA

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

Alexander is an American democratic socialist politician and a resident of California. Alexander was the Peace and Freedom Party candidate for Lieutenant Governor in 2006. He received 43,319 votes, 0.5% of the total. In August 2010, Alexander declared his candidacy for the President of the United States with the Socialist Party and Green Party. In January 2011, Alexander also declared his candidacy for the presidential nomination of the Peace and Freedom Party.

Stewart Alexis Alexander was born to Stewart Alexander, a brick mason and minister, and Ann E. McClenney, a nurse and housewife.  While in the Air Force Reserve, Alexander worked as a full-time retail clerk at Safeway Stores and then began attending college at California State University, Dominguez Hills. Stewart began working overtime as a stocking clerk with Safeway to support himself through school. During this period he married to Freda Alexander, his first wife. They had one son.

He was honorably discharged in October 1976 and married for the second time. He left Safeway in 1978 and for a brief period worked as a licensed general contractor. In 1980, he went to work for Lockheed Aircraft but quit the following year.  Returning to Los Angeles, he became involved in several civic organizations, including most notably the NAACP (he became the Labor and Industry Chairman for the Inglewood South Bay Branch of the NAACP).

In 1986 he moved back to Los Angeles and hosted a weekly talk show on KTYM Radio until 1989. The show dealt with social issues affecting Los Angeles such as gangs, drugs, and redevelopment, interviewing government officials from all levels of government and community leaders throughout California. He also worked with Delores Daniels of the NAACP on the radio and in the street.

The Socialist Party USA (SPUSA) is a multi-tendency democratic-socialist party in the United States. The party states that it is the rightful continuation and successor to the tradition of the Socialist Party of America, which had lasted from 1901 to 1972.

The party is officially committed to left-wing democratic socialism. The Socialist Party USA, along with its predecessors, has received varying degrees of support, when its candidates have competed against those from the Republican and Democratic parties. Some attribute this to the party having to compete with the financial dominance of the two major parties, as well as the limitations of the United States' legislatively and judicially entrenched two-party system. The Party supports third-party candidates, particularly socialists, and opposes the candidates of the two major parties.

Opposing both capitalism and "authoritarian Communism", the Party advocates bringing big business under public ownership and democratic workers' self-management. The party opposes unaccountable bureaucratic control of Soviet communism.

Alexander has Ballot Access in: CO, FL, NY, OH (write-in access in: IN, TX)

Learn more about Stewart Alexander and Socialist Party USA on Wikipedia.



Get to Know a Candidate (15 of 25): Jerry White–Socialist Equality Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

White (born Jerome White) is an American politician and journalist, reporting for the World Socialist Web Site.  White's Presidential campaign keeps four core components:

  • * International unity in the working class
  • * Social equality
  • * Opposition to imperialist militarism and assault on democratic rights
  • * Opposition to the political subordination of the working class to the Democrats and Republicans
    The White-Scherrer ticket is currently undergoing a review by the Wisconsin election committee concerning the ballot listing of the party for the 2012 Presidential elections. White has visited Canada, Germany, and Sri Lanka to campaign for socialism and an international working class movement.

The Socialist Equality Party (SEP) is a Trotskyist political party in the United States, one of several Socialist Equality Parties around the world affiliated to the International Committee of the Fourth International (ICFI). The ICFI publishes daily news articles, perspectives and commentaries on the World Socialist Web Site.

The party held public conferences in 2009 and 2010. It led an inquiry into utility shutoffs in Detroit, Michigan earlier in 2010, after which it launched a Committee Against Utility Shutoffs. Recently it sent reporters to West Virginia to report on the Upper Big Branch Mine disaster and the way that Massey Energy has treated its workers. It also sent reporters to the Gulf Coast to report on the Deepwater Horizon oil spill. In addition, it has participated in elections with the aim of opposing the American occupation of Iraq and building a mass socialist party with an international perspective. Despite having been active for over a decade, the Socialist Equality Party held its founding congress in 2008, where it adopted a statement of principles and a historical document.

White has Ballot Access in: CO, LA, WI

Learn more about Jerry White and Socialist Equality Party on Wikipedia



Get to Know a Candidate (14 of 25): Peta Lindsay–Party for Socialism and Liberation

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

Lindsay is an American anti-war activist and presidential nominee of the Party for Socialism and Liberation despite being ineligible to become president due to her age, under Article II, Section 1, Clause 5 of the U.S. Constitution; she would need to be at least 35 in order to take office.

Lindsay was born in Virginia and grew up in Philadelphia, Pennsylvania. She became an activist as a middle school student with the Philadelphia Student Union, a non-profit organization of students demanding a high quality education. She was a high school senior in Washington D.C. during the September 11 attacks. Soon thereafter she became active with the ANSWER coalition (Act Now to Stop War and End Racism). On September 24, 2001, Lindsay spoke at ANSWER's first press conference as a high school student. In 2002, she traveled to Cuba with Pastors for Peace. She attended Howard University and continued as a leader with the ANSWER coalition, including as a lead organizer of the January 2003 protest against the upcoming Iraq War. She was recognized by The Washington Post in March 2003 for her anti-war activism in a piece entitled "Student Leader Sees Through Bush Propaganda". In October 2003, Lindsay said of the Iraq War, "The US government has no right to try and recolonize Iraq".

The Party for Socialism and Liberation (PSL) is a Marxist-Leninist political party in the United States. It was created as the result of a split within the ranks of Workers World Party (WWP). The San Francisco branch and several other members left WWP in 2004, announcing that "the Workers World Party leadership is no longer capable of fulfilling that mission [of building socialism]". The PSL has since established two national offices in Washington, D.C. and in San Francisco alongside 23 local branches across the country.

The PSL sees as its main goal the formation of a revolutionary workers' party, based upon the ideology of Marxism-Leninism. This party would lead a revolution and pave the way towards socialism. Under socialism a new government of working people would be formed.

Historically, the PSL is generally positive on the former Soviet Union, describing the October Revolution as "the single biggest event that shaped global politics in the 20th century". The PSL acknowledges that the New Economic Policy of Vladimir Lenin led "to a re-polarization of social classes, especially in the countryside". The PSL blames the reforms initiated by Mikhail Gorbachev for the fall of the Soviet Union

The PSL is a member of the steering committee of the Act Now to Stop War and End Racism Coalition (A.N.S.W.E.R.). As one of the most active members of the coalition, PSL has gained notice for successfully forging ties with Arab and Muslim American groups such as the Muslim American Society, Al-Awda and the American-Arab Anti-Discrimination Committee.

    Lindsay has Ballot Access in: AR, CO, IO, LA, MN, NJ, NY, RI, UT, VT, WA, WI

Learn more about Peta Lindsay and Party for Socialism and Liberation on Wikipedia



Get to Know a Candidate (13 of 25): Mitt Romney–Republican Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

I believe the media are covering this candidate and party sufficiently that information need not be duplicated here.

Learn more about Mitt Romney and Republican Party on Wikipedia.



New Workstation – Lenovo W530 Core i7 32GB 256GB SSD Win8Pro

So I pretty-much have my new machine up and running full-time. I am still going to have to hit my old workstation for some things but am more-or-less working on my new machine.  It’s really fast. And Bret was right, I’m not so far using all the RAM. 16 would have been enough but as @CodeMonkeyJava “go big or go home”.

Windows 8 is…interesting.  So far I still seem to do most of my work in the “Desktop”.  However, I like the Store concept and I like the Metro UX.  Live tiles are also nice.  I really like how I can switch between Desktop and Metro easily.  Overall I think Microsoft has done a great job of combining the needed experience for touch and mouse.

My overall Windows 8 rating is 5.9 because of the video card. Otherwise I’m hitting 7.8.  The system boots from cold in about 11 seconds and performs complete shutdown in 4.7 seconds.  It wakes from sleep in less than 1 second.

VS 2012 starts and restarts almost instantly.  In fact, I find myself staring at the start page without realizing it.  Build time doesn’t seem to be significantly increased but it is faster.

I seem to already be reinvigorated for work with this new machine. I’m looking forward to the performance.



Get to Know a Candidate (12 of 25): Andre Barnett–Reform Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

Barnett is an American politician and entrepreneur. He is the founder of the information technology (IT) company WiseDome Inc.  Barnett was born in Zanesville, Ohio in 1976. He attended Austin Peay State University and Western Governors University.  A former member of the United States Armed Forces, Barnett served in Sarajevo before being wounded in a helicopter accident.  Following his military service, Barnett became a fitness model in New York. In 2001, he founded WiseDome Incorporated, an IT company that provides information technology and data recovery services.

Reform Party of the United States of America (RPUSA), generally known as the Reform Party USA or the Reform Party, is a political party in the United States, founded in 1995 by Ross Perot. Perot said Americans were disillusioned with the state of politics—as being corrupt and unable to deal with vital issues—and desired a viable alternative to the Republican and Democratic Parties. The party has nominated different candidates over the years, such as founder Ross Perot, Pat Buchanan, and Ralph Nader.

The party's most significant victory came when Jesse Ventura was elected governor of Minnesota in 1998. Since then, the party has been torn by infighting and disagreements, which it seeks to overcome.

The Reform Party platform includes the following:

  • * Maintaining a balanced budget, ensured by passing a Balanced Budget Amendment and changing budgeting practices, and paying down the federal debt
  • * Campaign finance reform, including strict limits on campaign contributions and the outlawing of the Political action committee
  • * Enforcement of existing immigration laws and opposition to illegal immigration
  • * Opposition to free trade agreements like the North American Free Trade Agreement and Central America Free Trade Agreement, and a call for withdrawal from the World Trade Organization
  • * Term limits on U.S. Representatives and Senators
  • * Direct election of the United States President by popular vote
  • * Federal elections held on weekends
    A noticeable absence from the Reform Party platform has been social issues, including abortion and gay rights. Reform Party representatives had long stated beliefs that their party could bring together people from both sides of these issues, which they consider divisive, to address what they considered to be more vital concerns as expressed in their platform. The idea was to form a large coalition of moderates; that intention was overridden in 2001 by the Buchanan takeover which rewrote the RPUSA Constitution to specifically include platform planks opposed to any form of abortion. The Buchananists, in turn, were overridden by the 2002 Convention which specifically reverted the Constitution to its 1996 version and the party's original stated goals.
    Barnett has Ballot Access in: FL

Learn more about Andre Barnett and Reform Party on Wikipedia.



Get to Know a Candidate (11 of 25): Roseanne Barr–Peace & Freedom Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

Barr is an American actress, comedienne, writer, television producer, and director.  Barr began her career in stand-up comedy at clubs before gaining fame for her role in the sitcom Roseanne. The show was a hit and lasted nine seasons, from 1988 to 1997. She won both an Emmy Award and a Golden Globe Award for Best Actress for her work on the show. Barr had crafted a "fierce working-class domestic goddess" persona in the eight years preceding her sitcom and wanted to do a realistic show about a strong mother who was not a victim of patriarchal consumerism.

The granddaughter of immigrants from Europe and Russia, Barr was the oldest of four children in a working-class Jewish Salt Lake City family; she was also active in the LDS Church. In 1974 she married Bill Pentland, with whom she had three children, before divorcing in 1990 and marrying comedian Tom Arnold for four years. Controversy arose when she sang "The Star-Spangled Banner" off-key at a 1990 nationally aired baseball game, followed by grabbing her crotch and spitting.

After her sitcom ended, she launched her own talk show, The Roseanne Show, which aired from 1998 to 2000. In 2005, she returned to stand-up comedy with a world tour. In 2011, she starred in an unscripted TV show, Roseanne's Nuts that lasted from July to September of that year, about her life on a Hawaiian farm.

The Peace and Freedom Party (PFP) is a nationally-organized political party with affiliates in more than a dozen states, including California, Florida, Colorado and Hawaii. Its first candidates appeared on the ballot in 1966, but the Peace and Freedom Party of California was founded on June 23, 1967, after the LAPD riot in the wealthy Century City section of Los Angeles, and qualified for the ballot in January 1968.  The Peace and Freedom Party went national in 1968 as a left-wing organization opposed to the Vietnam War.

From its inception, Peace and Freedom Party has been a left-wing political organization. It is a strong advocate of protecting the environment from pollution and nuclear waste. It advocates personal liberties and universal, high quality and free access to education and health care. Its understanding of socialism includes a socialist economy, where industries, financial institutions, and natural resources are owned by the people as a whole and democratically managed by the people who work in them and use them.

Barr is on the Ballot in: CA, CO, FL

Learn more about Roseanne Barr and Peace and Freedom Party on Wikipedia.



Get to Know a Candidate (10 of 25): Tom Stevens–Objectivist Party

DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting. Information sourced for Wikipedia.

Stevens is an American professor, attorney, politician and blogger. He is the founder and chairman of the Objectivist Party and was that party's nominee for President in the 2008 and 2012 United States Presidential elections. He is the party's presidential nominee in the 2012 election as well. He is also the founder of the Personal Freedom Party of New York.

Stevens was the first vice chairman of the political party Boston Tea Party. He resigned from that position in 2008. In 2010, he announced the formation of the Personal Freedom Party of New York.

Stevens runs the blog site Liberty Lion. He is a graduate of New York University and Hofstra University School of Law.

Stevens is on the ballot in CO, and FL.

The Objectivist Party is a political party in the United States that seeks to promote Ayn Rand's philosophy of Objectivism in the political realm. The party was formed on February 2, 2008 by Thomas Stevens; the date was chosen to coincide with Rand's birthday.

The party believes in the repeal of the federal income tax; thus the repeal of the 16th Amendment. The income tax would then be replaced by a Flat Tax of 10% or Federal sales tax.

The party supports the 2nd Amendment, but only as long as violent criminals are not permitted to own any weapon.

Learn more about Tom Stevens and Objectivist Party on Wikipedia.