Happy Independence Day!

by Codewiz51 4. July 2014 07:56

On this day, July 4th, 2014, I would like to thank the thousands of men and women that have given their lives for our liberty.  So many stories of bravery and sacrifice are untold but are appreciated beyond my ability to express.  We can live and breath and pursue happiness in this country thanks to the vision and wisdom of our Founding Fathers, some 238 years ago.  It would do well for all citizens to read and understand the Declaration of Independence and the US Constitution, along with the first ten amendments, known as the Bill of Rights.  I wish all of you well, free to enjoy a safe and happy celebration of our Independence.

Tags:

Vacation, Staycation and Coding

by Codewiz51 2. July 2014 08:13

I'm taking vacation this week, and honestly intended to do more coding.  However, I find myself doing a lot more around the house than I envisioned.  The weather has been unseasonably cool in Oklahoma and I find myself on my mountain bike a lot more than I anticipated.  I like to ride for distance at Lake Hefner, and I ride for excitement on the Bluff Creek trail.  I am in sore need of decompression time.  Sometimes, you get wound up in your job so tightly, you forget to balance your work and personal time.  Perhaps, this afternoon when it's supposed to get hot, I will retreat indoors and do more than vegetate on the couch.  (Or maybe, I will just read some science fiction.) Cool

Update: I made 2.5 laps today on the bike trail at Bluff Creek.  Not a stellar time, but at least I made it.  Not hot, but very humid.

Tags: , , ,

Life | Programming

I've drunk the Enterprise Library 6 Kool Aid.

by Codewiz51 29. June 2014 18:42

I've never really been a fan of Enterprise Library, until I had to assist with a coworker's project.  He had used Entity Framework and Enterprise Library in his MSMQ project.  I was really impressed with the logging in the project and the flexibility.  So I decided to bite the bullet and start anew with Enterprise Library 6.

So, here I am with a shiny new library downloaded from here: Enterprise Library 6 April 2013

I downloaded the eBook documentation here.

And the example applications are at this link.

So far, this is good stuff.  Not great, but solid and useful.  It applies some order to what can be a disorderly process.  I am deeply into studying Unity at this point, as I just completed some work in Java, using CDI and Weld on Jboss, complete with dependency injection.  The comparisons are favorable, although I like the annotation approach used by Java a little bit better at this point.  But this is just an opinion on semantics.

Update: Be sure to execute the logging example with Administrative privileges.  The program needs to add an event source, and you need to be an administrator to perform this task.

This blog entry for the Ent Lib 6 team is a bit dated, but still very useful. Just released - Microsoft Enterprise Library 6

I was not able to get the EntLibConfig.exe program working correctly. I came across this web article and found I needed to execute install-packages.ps1 by right clicking and choosing Run with Powershell.

Tags:

Programming

PostgreSQL, Entity Framework and Node.js

by Codewiz51 29. June 2014 08:28

The company I work for has embarked on the great open source experiment.  Java, JavaScript, Single Page Apps, AngularJS, JBoss, PostgreSQL, PostGIS, MongoDB(maybe) and Hadoop (like everyone else, big data is a big experiment unto itself.)  While I believe this experiment shows promise, we've become mired in lack of experience, lack of training and the occasional change in direction that doesn't seem to be communicated clearly to all developers.  Mostly, we suffer from lack of proper transitional training and the deep experience that comes with working with a particular stack for the last one or two decades.

I've never been a Java programmer.  I don't particularly like Eclipse and the 50 million plug-ins that I am not familiar enough to know why I need them.  I've come to respect Maven, but that's led me to a much deeper understanding of Nuget and how to use it in a similar fashion with my .Net projects.  My learning progress with JBoss has led me to a deeper understanding of some of the decisions Microsoft has made regarding .Net and how to implement the technologies using more reliable techniques.  I was recently introduced to IntelliJ, and I feel it shows a lot more promise for implementing the types of back end services projects that we implement.

So, while my day time job is definitely spent coding Java and JavaScript, my night time hobby is now spent on .Net, and occasionally attempting to interface reliably with open source components like PostgreSQL and MongoDB.  As a contrarian, I like to investigate JavaScript frameworks other than Angular.  I currently spend a great deal of time on Knockout.js and Backbone.js coupled with marionette.js.  I'm also back to spending a lot more time on C++ as a hobby.  All of this means I am not getting as much sleep as I probably need.

Which brings me to the point of this blog post (thankfully):

Rob Conery has published a simple, but very useful introduction to using Entity Framework with PostgreSQL.  Along the way, he also manages to drag in some useful node.js utilities for creating tables in PostgreSQL and the amazing thing is that the tutorial actually works as advertised, is easy to modify and actually teaches the uninitiated a few useful nuggets of wisdom along the way.

If you are a .Net programmer and you are intrigued by this title, by all means go read it and implement it.  You'll be glad you did, and I bet you'll save a bookmark to the page.

Using Entity Framework 6 with PostgreSQL

I do have to add one tip to this post: My company maps the "My Documents" directory to a network drive, which means under the hood, everything is addressed as a network path.  The section in Rob's blog regarding node.js will not work correctly with this setup.  Node.js does not support network paths, e.g. \\someMachine\someShar\temp\blah\bleh.  Simply copy the program to a location on your local hard driver and rerun the node.js commands, such as db-migrate.  Everything should function correctly at this point.

 

 

Tags:

Installing MS Sql Server JDBC 4.0 Driver

by Codewiz51 23. February 2014 07:02

My company has a major new initiative to utilize open source software.  While I'm primarily a Microsoftie, my C++ skills have not been in great demand, so I've volunteered to go over to the dark-ish side.  At work, we are utilizing PostgreSQL and PostGIS heavily for our mapping and search applications.  However, at home, I'm still a big fan of MS SQL Server, particularly SQL Server 2012.  I'm in the process of learning JBoss at work, and I work with it at home "A LOT!" However, I prefer to step through the examples with SQL Server 2012.

Which brings me to the point of this post: How the heck do I point my Java stuff to use SQL Server 2012 from Eclipse, Maven, JBoss, TomCat, etc.?

I found this thread on Stackoverflow.com which really helped me get up and running on my home system: Setting up maven dependency for SQL Server

  1. I thought I would summarize all the inputs into a few steps that are easier to follow:
  2. Download and Install SQL Server JDBC driver from Microsoft: Microsoft JDBC Driver for SQL Server
    (I suggest installing to a much shorter directory name than the default.  The default directory is a pain to use and involves the use of quotes to get around spaces in the FQ path.)
  3. Optional: Install to a network location that is available to your whole team.  You'll see why this is useful in a following step.
  4. Install Maven on your PC so you can run it from the command line: How to install Maven on Windows
  5. Install the SQL Server JDBC driver in your local Maven Repository with this command:
    mvn install:install-file -Dfile="C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar" -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
    You may need to adjust the file path, version and/or file name. Don't just copy this command line blindly!
  6. If you installed to a network location instead of a local directory, you can add the following to your pom.xml, and all your team can gain access to the driver without having to perform a bunch of setup steps:
    <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>sqljdbc4</artifactId>
        <version>4.0</version>
        <scope>system/scope>
        <systemPath>//MyServer/MyShare/lib/sqljdbc4.jar</systemPath>
        <optional>true</optional>
    </dependency>

I hope this helps someone.  If you have questions, please search Google using the following terms: "Maven SQL Server JDBC."

Tags:

Eclipse | Java | JBoss | Maven

Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cat or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.  So, take most of what I say with a grain of salt.

© Copyright 2008-2014