Laundry, Grocery Stores, Streetcars, and Hacking Away…

Just reading up on some thoughts being fed through twitter and I stumbled on one by @robbyrussel “today == laundry + hacking day”.  I couldn’t help but run through a few scenarios were I’ve seen people getting work done over the last few years.  Everywhere from the grocery store to the zoo bomb runs (before jumping aboard the ride).  Of course, one of my favorite ways to get work done is to jump aboard the streetcar and wire up with the SprintPCS card and work away.  For some reason, the streetcar, or MAX, is usually a great thinking place for me.

I’ve also read that maybe 5-15% of the people who could work remotely actually do.  A lot of that has to do with a paranoia from business interests about what an employee is doing and they are rightfully concerned.  I wouldn’t want someone to work remote, not do anything, grab a check and then disappear on me.  This fortunately is easily resolved with various modern processes and communications.  Agile itself bodes fairly well to remote work even, as long as those communication channels are maintained well.  I worked for about a month with someone completing work for me in Brazil, with just a few hours of communication a day, to remove roadblocks and hurdles, he (Jay! thx for the help!) was able to knock out the work tasks for the project super fast.

That leads me into another though, meddling over into my transit interests and economics in general.  A few assumptions stated; the tech market provides a vast amount of wealth in the US, it also consumes a vast amount of resources.

Technology workers continue their move toward more social interaction at work and to continue increasing productivity and efficiencies while decreasing our vast usage of the infrastructure. With these actions the tech sector alone could begin a revival of sorts within the economy itself!  But as I look at some companies that I’ll refer to as legacy companies, it is a slower move than it should be.  This shift to a more socially interactive, agile, and effective production method for software, and even hardware, in the marketplace needs to increase.

In Atlanta,Georgia and other auto-centric areas of the country the tendency for telecommuting has been increasing, but not nearly as much as it could.  In no ways would it eliminate the poor infrastructure design of Atlanta, that will take a lot of other work, but it would lead to more economic activity and allow for growth of more elaborate town centers.  Portland on the other hand, would probably benefit even more from this because it is already setup for this type of work.  Numerous individuals already work remotely in Portland, Oregon and have social interaction and efforts that make many legacy companies efforts seem arduously slow and cumbersome.

Just to name a few companies right off, that could drastically benefit from this even more are Microsoft, Intel, and other giants.  In many ways these companies have done great things with remote work, arguably their best work is done via remote effort.  They however could save millions a year on real estate and space needs by merely investing in local infrastructure and economic activity to provide places to setup these remote workers.  A coffee shop, a town center, simple meeting place for groups, are perfect for this type of effort.

The companies that have the greatest distances to cover to gain competitive advantage with remote work utilization are the real legacy companies.  These companies range from Ford, GM, Blue Cross, and other giant entities that really don’t build software as a primary revenue generator, but do build a lot of software.  These companies need to improve their management capability to better leverage these remote working abilities.  The advantages are too numerous to avoid.

When looking for work, always push for this type of work atmosphere, at least push for it being reviewed.  I can promise that any company that doesn’t take more advantage of remote workers will eventually lose their edge and fall to the wayside with the legacy companies that have already been put to death by inefficient and arduous old school thought.

It’s time to provide this freedom on a large scale.  Get with the progress.  Cheers!

How I'm Using BlogEngine.NET Part 1

BlogEngine.NET does not currently do multiple blogs per installation of the web application.  I know this is supposed to change in the future, but I needed a solution now.  The easiest fix really, and the previous Community Server Engine installation lent itself well to this, was to just create a web application for each blog I was going to have.

What I did was create a basic web application, which I planned to host at the root level of my domain, http://www.adronbhall.com.  I create that web application in my overall .NET Solution and then created two copied instances of the BlogEngine.NET Application in the same solution.  These would be copied into the existing directories, or paths of the current root application like; http://adronbhall.com/blogs/technology__software_development/ and http://adronbhall.com/blogs/my_transportation_obsession/.

I then created a separate database for each.  This of course, IMHO, isn’t all that great since I’ll have redundant users and all that.  I’m just going to have to figure that problem out later.  For now, I just want to get the engines setup so I can have total control over my sites and code base.

I reconnected each respective BlogEngine.NET installation to their own database.  I got good connectivity, downloaded the appropriate skins that I wanted for each, and got to work on setting them up.

Then things got really fun when I began building out the ETL for each of the sites.  The Community Server database was of course in a single source, but the other two were going to need to be in separate locations.  Not really complicated, but not something one whips up in 5 minutes either.

The first thing I tried was creating a true to the ideal ETL project with SSIS, which turned out to be a complete waste of time and a PIA.  After that I just wrote some straight SQL that would take data from the originating database and insert the data via mappings directly into the database I wanted it to end up in.  The following are the first steps of this makeshift ETL effort.

First I setup each database, configured each of the blogengine.net databases so they were ready for import.  Then I added a database project to my overall solution.

The Database Project “EtlCode”

The Databases

I then started created the various extraction SQL that is needed for the views in the AdronsCommunity Database.  There were several views, with some code duplication (SQL isn’t exactly an OOP language), but specifically geared toward each database the data would eventually end up in.

Each of the views created had the following code, notice that I’ve used a lot of “as SomeColumn” so that the names would align easily and reduce prospective confusion.  If I want to extract the other entries not related to these two blogs later I wanted to make it easy on myself.

Query for Categories

SELECT  dbo.cs_Post_Categories.Name,
    dbo.cs_Post_Categories.Description,
    dbo.cs_Post_Categories.CategoryID AS CS_CategoryID,
    dbo.cs_Post_Categories.IdForBlogEngine AS CategoryId
FROM dbo.cs_Post_Categories INNER JOIN
    dbo.cs_Post_Categories_Parents ON
        dbo.cs_Post_Categories.CategoryID = dbo.cs_Post_Categories_Parents.CategoryID
WHERE (dbo.cs_Post_Categories.SectionID = 13)

Query for Posts

SELECT     TOP (100) PERCENT
    IdForBlogEngine AS PostID,
    Subject AS Title,
    Body AS Description,
    FormattedBody AS PostContent,
    PostDate AS DateCreated,
    NULL AS DateModified,
    'Adron' AS Author,
    IsApproved AS IsPublished,
    NULL AS IsCommentEnabled,
    NULL AS Raters,
    NULL AS Rating,
    NULL AS Slug,
    PostID AS CS_PostID
FROM dbo.cs_Posts
WHERE (PostAuthor = N'adron') AND
    (UserID = 2102) AND
    (SectionID = 13) AND
    (IsApproved = 1) AND
    (PostType = 0)
ORDER BY DateCreated DESC

Query for Categories & Posts Many to Many Table

SELECT TOP (100) PERCENT
    dbo.cs_Posts.Subject,
    dbo.cs_Post_Categories.Name,
    dbo.cs_Posts_InCategories.PostID,
    dbo.cs_Posts_InCategories.CategoryID,
    dbo.cs_Posts.IdForBlogEngine AS PostIDForBlogEngine,
    dbo.cs_Post_Categories.IdForBlogEngine AS CategoryIdForBlogEngine
FROM dbo.cs_Post_Categories
            INNER JOIN
    dbo.cs_Posts_InCategories ON
        dbo.cs_Post_Categories.CategoryID = dbo.cs_Posts_InCategories.CategoryID
            RIGHT OUTER JOIN
    dbo.cs_Posts ON
        dbo.cs_Posts_InCategories.PostID = dbo.cs_Posts.PostID
WHERE (dbo.cs_Post_Categories.Name IS NOT NULL) AND
    (dbo.cs_Post_Categories.SectionID = 13)
ORDER BY dbo.cs_Posts.PostDate DESC

Query for Comments

SELECT TOP (100) PERCENT
    dbo.cs_Posts.IdForBlogEngine AS PostCommentID,
    dbo.l_looselyPosts.PostID,
    dbo.cs_Posts.PostDate AS CommentDate,
    dbo.cs_Posts.PostAuthor AS Author,
    '' AS Email,
    '' AS Website,
    dbo.cs_Posts.FormattedBody AS Comment,
    dbo.cs_Posts.IPAddress AS IP,
    dbo.cs_Posts.IsApproved
FROM dbo.cs_Posts INNER JOIN
    dbo.l_looselyPosts ON
        dbo.cs_Posts.ParentID = dbo.l_looselyPosts.CS_PostID
WHERE (dbo.cs_Posts.PostType = 1)
ORDER BY CommentDate DESC

Notice in the queries above, I turned each one into a veiw.  Some of the above views have dependencies on each other to derive the new primary keys and other criteria for the process.  Also one thing I stumbled upon is that I had to make the Email and Website columns on the Query for Comments empty nvarchar types instead of null, because in code they break when they’re null but work fine when they just have empty strings.  This might be a bug, at some point, I’ll mention but doubt it is causing any harm at this point.

Once each of these were created I could then create my actual queries for the process.

Get the Categories

DELETE FROM [looselycoupled].[dbo].[be_PostCategory]
GO
INSERT INTO [looselycoupled].[dbo].[be_PostCategory]
           ([PostID]
           ,[CategoryID])
SELECT l_looselyPostsCategories.PostIDForBlogEngine,
    l_looselyPostsCategories.CategoryIdForBlogEngine
FROM l_looselyPostsCategories
            INNER JOIN
    l_looselyCategories ON
        l_looselyPostsCategories.CategoryID = l_looselyCategories.CS_CategoryID
            INNER JOIN
    l_looselyPosts ON
        l_looselyPostsCategories.PostID = l_looselyPosts.CS_PostID

Get the Posts

DELETE FROM [looselycoupled].[dbo].[be_Posts]
GO
INSERT INTO [looselycoupled].[dbo].[be_Posts]
           ([PostID]
           ,[Title]
           ,[Description]
           ,[PostContent]
           ,[DateCreated]
           ,[DateModified]
           ,[Author]
           ,[IsPublished]
           ,[IsCommentEnabled]
           ,[Raters]
           ,[Rating]
           ,[Slug])
SELECT [PostID]
      ,[Title]
      ,[Description]
      ,[PostContent]
      ,[DateCreated]
      ,[DateModified]
      ,[Author]
      ,[IsPublished]
      ,[IsCommentEnabled]
      ,[Raters]
      ,[Rating]
      ,[Slug]
FROM [AdronsCommunity].[dbo].[l_looselyPosts]

Get the Many to Many Posts to Categories

DELETE FROM [looselycoupled].[dbo].[be_Categories]
GO
INSERT INTO [looselycoupled].[dbo].[be_Categories]
           ([CategoryName]
            ,[Description]
            ,[CategoryID])
SELECT DISTINCT
    CAST(Name AS nvarchar(50)) AS Name,
    CAST(Description AS nvarchar(200)) AS Description,
    CategoryId
FROM         AdronsCommunity.dbo.l_looselyCategories

Get the Comments

DELETE FROM [looselycoupled].[dbo].[be_PostComment]
GO
INSERT INTO [looselycoupled].[dbo].[be_PostComment]
           ([PostCommentID]
           ,[PostID]
           ,[CommentDate]
           ,[Author]
           ,[Email]
           ,[Website]
           ,[Comment]
           ,[Ip]
           ,[IsApproved])
SELECT    [PostCommentID]
      ,[PostID]
      ,[CommentDate]
      ,[Author]
      ,[Email]
      ,[Website]
      ,[Comment]
      ,[IP]
      ,[IsApproved]
FROM    [AdronsCommunity].[dbo].[l_looselyComments]

That’s it for the ETL.  In the next part I’ll cover some other tasks I had to complete in order to get moved over onto BlogEngine.NET.

Just for fun I’ve added the Acronym Translation List for any newbies.

  • ETL – Extract, Transform, and Load.  Something that is generally used to refer to business intelligence data warehouses or other elaborate data processes.- PIA – Pain In the Ass.  Self descriptive.- IMHO – In My Humble Opinion.  Exactly what is written.- SQL – This isn’t really an acronym, according to the original creators, it became an acronym, then un-became an acronym.  However, many people think that it means Standard Query Language, when it reality it just means Sequal.

America Stupid? Ha!

Typewriters, baby, Typewriters.

Thomas L. Friedman has a great article on Making America Stupid.  I’ve ranted about it a million times before, but one comment really brought home the silliness of the “drill, baby, drill!” chant at the RNC.

From my point of view in the technology industry, to my professional interests in transit, transportation, and automobiles America just continues to implement these things in a horribly innefficient manner, and the RNC really just points to their backing of bad implementations.

Mind you, I don’t really intend to make this a political entry, because I doubt the Democrats have any truly better ideas (at least in functional implementation).  But the Republicans seem hell bent to prove to any remotely intelligent human being that they definitely do NOT have any real solutions.

Even in technology we have these issues, and slowly I’ve started seeing legislative encroachment into the software field.  Sarbanes Oxley is almost touching on actual implementation, which removes progress.  If it encroaches further I am scared the technology industry will quickly lose its A-Game Geeks, not just Microsoft or single companies in the country, but the whole country.  Those non-stupid Americans that become these A-Game Geeks, the productive of the country would not tolerate being dictated their profession to them.  Just like the  machine geeks  of the guilded age left their trades and it slowly began, and now has died a slow death over the last 50 years.  Politicians Republican, Democrat and others will be treading a thin line between starting the decay of the industry, or staying out of the way and letting the industry to continue its breakneck pace of progress, advancement, job growth, and intellectual stimulation.

I hope as long as I live, I will see this freedom in the industry be maintained and the liberty to innovate, advance, and procure progress and growth for America will continue.  This freedom is even more important in the coming years with the giants of China and India becoming economically vital in the world economy.  Our freedom and unhindered progress is vital to the continued standard of living in America.  To keeping our economic freedom, cheers to success, cheers to America the non-stupid.

Technorati Tags: America,Democrats,Republicans,A-Game,Geeks,Freedom,Liberty

del.icio.us Tags: America,Democrats,Republicans,A-Game,Geeks,Freedom,Liberty

Slowly But Surely

…I’ve been bringing up new tools on Ubuntu to start using in my, sort of transition, to the other side of the tracks.  I’ve also downloaded Ruby on Rails, and so far it was easy, after going through multiple steps on Ubuntu it appears I’m missing several pieces.  I kind of guessed I’d be in this situation so I’m not that surprised.  I am somewhat surprised that the ROR camp doesn’t have a little more support for more Linux distros.  Of course, I’ve been planted so deep in the Microsoft Camp for the last 5+ years that I don’t really know where Linux related sites are except for system admin related stuff.

So back to figuring this out.  But on the note of these new products and tools I want to toss a few blogs out that I’ve started reading over the last few weeks.  Some of the guys that write these I know, so I don’t yet.  Hopefully I’ll eventually know em’ all.