Friday, December 29, 2017

Resources for diving into Git internals

One of the things my boss asked me to do before I leave Farm Bureau for the bustling Bay Area was to put together some resources related to using Visual Studio Team Services.  One of my co-workers on the database team also asked me to put together some resources for learning git.  So, to that end, I pieced together a few things that would make my absence less disruptive. 

As part of the process, I ended up uncovering a few presentation that delved pretty deep under the covers.  Now, these are lessons that are best consumed by one who is already pretty familiar with git basics, but I think the reward is a deeper, richer understanding of git behavior that can make us more effective with the tool. I'm not going to rehash everything that is in the videos (just watch the videos, they're excellent), I'll just provide a link and a brief synopsis.


Tuesday, November 7, 2017

Microsoft 70-487: Design a Web API

Exam Objectives

Define HTTP resources with HTTP actions; plan appropriate URI space, and map URI space using routing; choose appropriate HTTP method (get, put, post, delete) to meet requirements; choose appropriate format (Web API formats) for responses to meet requirements; plan when to make HTTP actions asynchronous; design and implement routes


Quick Overview of Training Materials



Friday, October 20, 2017

Microsoft 70-487: Configure a web application for deployment

Exam Objectives

Switch from production/release mode to debug mode; use SetParameters to set up an IIS app pool; set permissions and passwords; enable and monitor ASP.NET App Suspend; configure WCF endpoints (including HTTPS protocol mapping), bindings, and behaviors; transform web.config by using XSLT (for example, across development, test, and production/release environments); configure Azure configuration settings


Quick Overview of Training Materials

Exam Ref 70-487 - Chapter 5.3
[MSDN] How to: Set Debug and Release Configurations
[MSDN] Understanding Build Configurations

[MSDN] Configuring Parameters for Web Package Deployment
[MSDN] Web Deploy Parameterization
[TechNet] Using declareParam and setParam
[Blog] MSDeploy with Declare and Set parameter files

[MSDN] Configuring Permissions for Team Build Deployment
[MSDN] Basic Security Practices for Web Applications
[MSDN] Best practices for deploying passwords
[Blog] Davidson Sousa - Setting folder permissions using Web Deploy
[Blog] Sayed Hashimi - Setting Folder Permissions on Web Publish
[Blog] Kevin Leetham - Modifying directory permissions with Web Deployment

[MSDN] Enable and monitor ASP.NET App Suspend on Windows Server 2012 R2
[MSDN] ASP.NET App Suspend – responsive shared .NET web hosting

[MSDN] How to: Transform Web.config When Deploying a Web Application Project
[MSDN] Web.config Transformation Syntax for Web Project Deployment
[GitHub] Xdt transform samples

[MSDN] Configure web apps in Azure App Service
[MSDN] Configure Azure cloud service roles with Visual Studio


Thursday, September 28, 2017

Microsoft 70-487: Manage packages by using NuGet

Exam Objectives

Create and configure a NuGet package; install and update an existing NuGet package; connect to a local repository cache for NuGet, set up your own package repository


Quick Overview of Training Materials



Monday, September 25, 2017

Wednesday, September 13, 2017

Monday, September 4, 2017

Saturday, September 2, 2017

Microsoft 70-487: Configure WCF services by using the API

Exam Objectives

Configure service behaviors; configure service endpoints; configure binding; specify a service contract; expose service metadata (XSDs, WSDL, and metadata exchange); WCF routing and discovery features


Quick Overview of Training Materials

Exam Ref 70-487 - Chapter 3.3
[Book] Programming WCF Services (in particular, Appendix C: Discovery)
[MSDN] Configuring WCF Services in Code (.NET 4.5+)


Friday, August 25, 2017

Microsoft 70-487: Configure WCF services by using configuration settings

Exam Objectives

Configure service behaviors; configure service endpoints; configure bindings including WebSocket bindings; specify a service contract; expose service metadata (XSDs, WSDL, and metadata exchange endpoint); configure message compression and encoding


Quick Overview of Training Materials


Friday, July 28, 2017

PluralSight WCF Library

PluralSight has a pretty robust collection of WCF related courses.  I decided it would be useful to index the concepts covered in the courses I watched (as part of putting together to 70-487 study guide).

Thursday, May 18, 2017

How To Create an On-Prem Windows Build Agent for Visual Studio Team Services

Motivation


I've been working on migrating our code repositories from CVS into git hosted on Visual Studio Team Services (VSTS)... formerly Visual Studio Online.  While I've reduced the CVS migrations to running a single script, I also wanted to start exploring some of the other CI functionality VSTS offers.  Many of our projects are Maven projects, and while Maven builds are supported, I ran into a snag trying to connect to our on-prem Nexus repository.  Using the VSTS "hosted" build agents would involve one of a couple of bad work arounds:

  • expose an endpoint in IIS to talk to the Nexus repo outside our firewall.  While a one-off point to point fix might solve this issue... the scenario is likely to recur, especially when I start looking at deployments
  • open a vpn connection from the hosted build agent to the network.  Eww.  This would feel like a clunky solution, assuming I could get it working at all.  I could see authentication being a real obstacle for this route

The obvious solution was a private (i.e. on-prem) build agent running within our network.  I shied away from this approach at first because I didn't want to deal with the server configuration (rightly so, yuck!), but it rapidly became clear that this actually was the simpler solution. The final straw was after I tried to create a Hudson job and ended up fighting with git the whole time (couldn't find the installed binary, installed it again, long file names choked, couldn't get authentication working... quelle nightmare!)



Sunday, May 7, 2017

LINQ Basics by Example

While working on my 70-487 study guide I wrote up a looong section on basic LINQ operators that, while certainly germane, was not really the subject at hand.  So I'm refactoring that stuff into it's own post.  I look at the LINQ extension methods provided by Enumerable and Queryable (basically the same operations, just different underlying behavior), with lots of example code and console screenshots.  All the code samples can be found on my Github page for the study guide examples.

Friday, April 28, 2017

Microsoft 70-487: Query and manipulate data by using Data Provider for Entity Framework

Exam Objectives

Query and manipulate data by using Connection, DataReader, and Command from the System.Data.EntityClient namespace; perform synchronous and asynchronous operations; manage transactions (API); programmatically configure a Data Provider


Quick Overview of Training Materials

Tuesday, April 25, 2017

MIT 6.005 - Software Construction (edX)

The resources for MIT's "Software Construction" class are distributed between several disparate sources.  There is an entry for 6.005 on the MIT Open Courseware page, where it is called "Elements of Software Construction", and there are two classes on edX: 6.005.1x "Software Construction in Java" and 6.005.2x "Advanced Software Construction in Java".

I'm hoping that working through this class will sharpen my understanding of general software engineering concepts.  The emphasis of the class is writing bug free code that is easy to understand and easy to change, which is certainly something you can never be too good at, am I right?

Monday, April 24, 2017

Microsoft 70-487: Create an Entity Framework data model

Exam Objectives

Structure the data model using table per type, table per class, table per hierarchy; choose and implement an approach to manage a data model (code first vs. model first vs. database first); implement POCO objects; describe a data model by using conceptual schema definitions, storage schema definition, mapping language (CSDL, SSDL, MSL), and Custom Code First Conventions

Thursday, April 20, 2017

Instantiating an object in Java without calling a constructor

The Scenario


This isn't a cliche...


I was working on a Java project that talks to a web service with a custom "Client" class that was written internally.  In my project, the client is pulled in from a hosted maven repo as a dependency, so I didn't have access to the source (at least not from this project).  I'm trying to be better about writing characterization tests for existing code before I go in and change anything (if nothing else it's a good way to feel out the code). But I had a problem...

The Client has a single constructor, which takes an endpoint, a username, and a password. Calling this constructor tries to connect to the endpoint (and crashes if it fails).  Because this was the only defined constructor, subclassing wasn't going to help me.  It doesn't implement an interface, so that avenue was also closed down.

So there was no obvious way for me to create a test double to pass in to the code I was actually interested in testing.  How in the hell was I going to get around this???

Wednesday, April 19, 2017

Proxy Windows Authentication with a WCF Relay Service

Motivation

The problem I'm going to address here is pretty specific, and the solution I came up with isn't terribly intuitive, but it works.  I ran into a situation where we were trying to integrate web services with a vendor product.  This is a .NET app running on IIS, and we wanted to authenticate using Active Directory by passing in a username and password to a "UserLogin" soap action (this action returns a security token that is used to make other calls).  While initially we thought this worked, it turned out that it wasn't behaving the way we thought it should.  Any request was getting a security token, even if the username and password were garbage.

Yeah... not what we were going for...

Sunday, April 16, 2017

MIT 6.046 - Design and Analysis of Algorithms

6.046 is described by Eric Demaine as the final undergraduate algorithms class, with more advanced and more specialized algorithms classes being at the graduate level.  I've had my eye on the advanced data structures and advanced algorithms classes for a while, and this class is a fundamental prerequisite for those.  Now, being that it's my MO to totally overdo it, naturally I had to find overlapping classes from some of my other favorite providers and watch everything.  Had I limited this to one overlapping class it probably wouldn't have been that bad... but I found three other classes: Berkeley CS170, Georgia Tech CS6505, and Stanford CS261.  All four classes are what I would call "intermediate" level algorithms courses, with significant overlap in concepts covered:


I probably would have been done a month ago if I hadn't gone so crazy with watching everyone's lectures...

Wednesday, March 22, 2017

How to convert a CVS repo to git


Doing this conversion basically requires a Linux environment. My first attempt was in Windows using the various Unix tooling and I just could never get everything to work the way it needed to. It was less work to just spin up a VirtualBox vm with Ubuntu Server and do everything in bash. This document is going to assume you have access to a suitable Linux environment (this will have a Debian-esque flavor being Ubuntu, but any major distro should work).

I’m also assuming you have zero prior CVS knowledge (like me), so I’ll explain a few of the basics around CVS.

Tuesday, March 21, 2017

Exploiting the YOP Poll WordPress plugin


Somewhere in the vast expanses of the wild internet, there is a site I sometimes frequent that likes to put surveys in their blog posts.  Quite by accident, I discovered that if I reload the page in an incognito window, I could vote in these surveys multiple times.  Being hopelessly curious about what's going on behind the curtain, I ventured down the rabbit hole that led me to spammy scripts and purple underwear (No, seriously...).

Saturday, March 18, 2017

Legacy Berkeley course material pulled over accessibility


One of the earliest sources of free education materials I stumbled upon was webcast.berkeley (right up there with MIT OCW).  Seeing these institutions of higher learning release their lectures and course content free, to the masses, made me envision a time when the entire education system could be transformed.  Today, with Coursera, Udacity, and edX, we are well on the way to that revolution.  But despite these (arguably more sophisticated) offering, I always found myself returning to that well.  No more...

Friday, March 17, 2017

Making assertions with jUnit against log4j console output


I will open by saying that making assertions against your log output is probably a bad idea.  Probably violates every rule of good testing.  That said, I found myself writing characterization tests against some legacy code and I wanted to make sure I didn't break the logging.  So I decided to write some flakey, brittle unit tests.  It was several hours of pain, and I figured it would be a good idea to document my pain so you can avoid some of it (hopefully by not following in my footsteps at all... sigh)

Friday, February 3, 2017

Advanced CSS Concepts (edX)

Last summer I enrolled in a class on edX called "Advanced CSS Concepts".  It was delayed until November because of technical issues on their end, and I put it off until a week ago because Google.

"Oh, advanced ey?  That should be interesting" I thought.  Boy was I in for a disappointment.

Wednesday, January 11, 2017

My Google Interview Journey

The Hook


It's mid November and I'm minding my own business, when out of the blue I get a message on LinkedIn.  It's a technical recruiter from Google, we'll call her "K" (you know, like in The English Patient), and she says she was impressed by my HackerRank badge for Algorithms.  She wants to have a chat and learn a little bit about my background, she says.  Of course this blew my mind, in a sort of "glitter and confetti shooting out my ears" sort of way.  I've had recruiters hit my up on LinkedIn before, but this was Google!  I allowed myself to glow in it for a little while, but I tried to keep myself in check too.  At this stage, it was just one phone call with a recruiter.