Random Flickr Pics

			krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:				krandor posted a photo:
Used tag: 2011

Pre Paid Progress

It’s been about two months since i dropped Sprint and went to T-Mobile. My experience has been pretty good so far, but there are a few ‘but’s in there. For the transfer I got an unlocked Nexus 4. The plan is that here in a while i’ll also get an AT&T prepaid plan and compare the services.

Price

I was able to get in on the $30/month prepaid plan for T-Mobile. Which is even cheaper that what I was going to get through Straight Talk. This plan is just rediculous! You get unlimited data and texting (up to 5GB at 3/4G speeds) and 100 minutes of talk. I really don’t talk on the phone much so that’s just fine for me, and I don’t think I’ve come close to hitting the 5GB limit on data (…yet ;))

Speeds

Where i live and with my phone, the fastest I’ll get is HSPA+42 (T-Mobile’s non-LTE 4G). In town, and once i’m in other towns I’ve gotten good speeds of between  1200 and 6000 kbps down, which is a huge increase from the 30 – 500 kbps i was getting with Sprint.

Coverage

This is where i think T-Mobile fails a bit. While the only place i’ve never had service was the same place most other people didn’t have service, there are areas where i wished me speeds were better. While in town i have great service and good speeds, but if i’m on the interstate or travelling between towns, often times my connection drops to E or even G — at which point doing any kind of music streaming is just impossible. Overall I would give the coverage a grade of satisfactory, but with much room for improvement.

With that said, I’m definitely more content with T-Mobile than I was with Sprint. I am curious though on how AT&T will stack up. I have friends on AT&T and while they have more and better coverage, I don’t think they get the same speeds that i do. I’d like to do an Apples-to-Apples comparison in the next few months.

Trying to move from Sprint to Straight Talk

This whole process has been quite frustrating.

But first, let me give you some background information on what i’m trying to do. I’ve been with Sprint for years, I’d say since 2000 or 2001 when i was still on with my parents. Then a few years ago, 2008 i think, I got a new phone and wanted to go off on my own. So i got a new number and my own account with Sprint. For the longest time I was quite happy. The speeds were good, the call quality was great, and the phones were pretty on par with everyone else. But then the smartphone revolution happened. And slowly i started to notice that Sprint had fewer and fewer phones that i was actually interested in. I also started noticing that my speeds weren’t keeping up with what other carriers were offering. So finally, after my contract expired in august i’ve been on the lookout for what new phone i’d want to get, and what carrier i’d go to.

Then a few months ago I discovered the Nexus 4. I knew about it for a while, but i didn’t quite looked into it. What really caught my eye is that it’s 1) a newer phone and 2) you can get it unlocked cheaper than you can get it from a carrier! The unlocked portion is extra nice especially since it’s now illegal for you to unlock your own phone!

Now that i knew what phone i wanted to get it was time to start looking at providers. A friend of mine has been using multiple resellers (or MNVOs) over the last two years or so and has had some good things to say. He was on Straight Talk at the time using AT&T. I figured I could get a couple of SIMs and then test out both networks, since Straight Talk used both AT&T and T-Mobile networks. I’d also looked at a few others and while the prices were comparable, I noticed that only Straight Talk explicitly referred to offering 4G speeds (which for the Nexus 4 meant HSPA+).

I order my phone from Google, and my SIM and Service Plan from Straight Talk. When the phone comes in i’m totally stoked! It’s pretty and clean and fast and everything i’d hoped it would be! I wait a few days and get my SIM (on 4/11). First thing i noticed was that my SIM was a full sized one, and not a micro SIM which the Nexus 4 needs. After hunting around and even stooping to go to Walmart to try and get a different SIM (which they don’t have for ST), i found a ‘conversion’ kit i could print out online. I chop up my SIM to make it fit into the SIM Slot, turn on the phone and everything looks good. It detected the SIM and started looking for signal. I then went to the Straight Talk website to Activate my SIM and service. Everything goes pretty smoothly from what i can tell. I say that i’m activating a new SIM and that i want to transfer an existing number from another company. I put in all the information they requested for my Sprint account, and then completed the process. I noted that for company to company transfers it could take up to two business days (this is weird because I later read online that there’s an FCC regulation saying that these transfers are supposed to be done within 24 hours).  I wait until the next Monday (4/15) and then make a post on the Straight Talk facebook page, which I’d read was the best way to get any kind of customer service. I ask if i can get some assistance since my port had taken longer than the two days they communicated in their policy. The conversation starts with comments on my post asking me to put in a helpdesk ticket, which i try, but the page kept giving me an error saying that my email address belonged to a deleted account. In the end we resort to Facebook Messaging, which I’ve exported and will display here fully intact except for any sensitive information. I find the whole situation quite frustrating.

On April 15, 2013 8:43:35 AM PDT, Dan Colomb wrote:
Hi Phil,
 The MEID of my old Sprint Phone is XXXXXXX, the IMEI of my new phone is XXXXXXX.
my ST user account email is xxxx@xxxx.com
Let me know if you need anything else.
On April 15, 2013 8:44:23 AM PDT, Phil ST wrote:
Thank you for that information, Dan.
Let me check your account now. I'll get back to you in few minutes.
On April 15, 2013 8:45:09 AM PDT, Phil ST wrote:
Can you provide me the phone number that you're trying to transfer to Straight Talk?
On April 15, 2013 8:46:44 AM PDT, Dan Colomb wrote:
555-555-5555
On April 15, 2013 8:53:13 AM PDT, Phil ST wrote:
Were you given a reference or ticket number for your port request? If so, please provide me with the numbers so that I can pull out your account. Thanks!
On April 15, 2013 8:57:16 AM PDT, Dan Colomb wrote:
The only thing i see on my ST account is the SIM (XXXXX) and that it states there is a port in progress. I don't recall receiving an email with a reference or ticket number.
The only number i have in my email is for my SIM order (XXXXX).
On April 15, 2013 9:10:55 AM PDT, Phil ST wrote:
Dan,
We regret to inform you that we failed to port your number to the SIM card that you purchased. If you want we can activate your SIM with a new phone number or you may purchase a brandnew Straight Talk phone and we'll attempt to port again the phone number. Thanks!
On April 15, 2013 9:17:26 AM PDT, Dan Colomb wrote:
Wow, that is not the response i was expecting. Is there a reason why the port failed?
I noticed that on your website you no longer offers Micro SIMs, that is what my phone requires. How would i go about getting a Micro SIM for ST?
On April 15, 2013 9:20:05 AM PDT, Phil ST wrote:
Because porting any numbers to a T-Mobile compatible SIM is not possible as of now.
For now, Straight Talk Wireless is not selling SIM cards that are compatible with AT&T devices. We will bring them back as soon as we can. For updates on this issue, please visit our website at www.Straighttalk.com.
On April 15, 2013 9:22:41 AM PDT, Dan Colomb wrote:
Is there a way to get a refund for the 30 days of service i purchased? I guess i'll be going to another provider.
On April 15, 2013 9:23:45 AM PDT, Phil ST wrote:
We're sorry to hear that, Dan.
Where did you purchase your service plan?
On April 15, 2013 9:24:08 AM PDT, Dan Colomb wrote:
I purchased it through the website when i bought the SIM.
On April 15, 2013 9:25:10 AM PDT, Phil ST wrote:
Dan,
If you want, you may purchase a brandnew Straight Talk phone and we'll just convert the amount you paid for the SIM and will add also your service plan.
On April 15, 2013 9:27:55 AM PDT, Phil ST wrote:
In addition, we will also re-process the porting of number if ever you will purchase a Straight Talk phone.
On April 15, 2013 9:28:44 AM PDT, Dan Colomb wrote:
i don't want to buy a new phone, i want so use the new Unlocked GSM phone which i just purchased.
So if, as of right now, there is no way for me to get my number transferred and have my service activated, i would like to have my 45 dollars refunded. I can handle eating the SIM price, since i know that's non-refundable.
On April 15, 2013 9:37:09 AM PDT, Phil ST wrote:
Dan,
I'll need first to update my floor supervisor regarding your request. I'll get back to you in few minutes. Thanks.
On April 15, 2013 10:48:33 AM PDT, Phil ST wrote:
Dan, 
We regret to inform that we do not issue refunds for airtime purchases.

This did not go anywhere near where i thought this would go. So i’m out about 70 dollars, and have nothing to show for it. Like a told a friend, i went from irritated, to insulted, to angry. I’m totally disappointed in the customer support, and will never use Straight Talk again. And i urge you all to stay away from them.

On the plus side, i ended up going to the T-Mobile store during lunch and found out that there’s a chance i can still get on their old $30 dollar a month unlimited pre-paid plan, which i may be able to go to Walmart (yes, another trip to WM… *shudder*) for and get today. Otherwise i can just order a new SIM online, which will properly fit my phone, and get a plan that’s even cheaper than Straight Talk’s. If i can’t get in on the $30 a month plan, then i’ll go to the new play they offer which is $50 a month, only 5 dollars more than ST.

I’ll let you all know how things go :)

Sushi Shift is out of Beta!

I know it’s been a long time since i’ve posted here, and to be honest, i sort of forgot i had this blog.

We’ve recently gotten our game out of beta and we’ve been trying to get the word out. We’ve submitted the app to blogs and review sites, but nothing seems to be helping right now.

So maybe I can use this blog and its limited traffic to maybe give our game some extra needed exposure.

Our game is a puzzle game with unique twist — gravity.  The link to the game is below :)

http://goo.gl/nAdaf — Sushi Shift on Google Play.

Stop Internet Censorship!

I’ve censored the following, in protest of a bill that gives any corporation and the US government the power to censor the internet–a bill that could pass THIS WEEK. To see the uncensored text, and to stop internet censorship, visit:
http://americancensorship.org/posts/739/uncensor

██████████ of any ████ is █████ and ████ ███████ the ████████ ███████ of ████ ███████!

████ ███████ is our █████, ████ ███████ is our █████. Don’t let ████ ████ it ████ ████ us!

We need to fix it, we need to do something!

At the time of this posting, i’m only about half-way done watching this video, but i feel that I need to post this now and share it with everyone i know. What he says sums up what is wrong with our government and makes me want to go to Capitol Hill and kick every politician out of Congress and force change to happen.

Now if you’re more to the Left or more to the Right doesn’t really matter here. No matter what your beliefs in how government works are, they clearly don’t line up with what reality is. Even if you’re not very political and have no interest in politics, what happens in our government DOES affect you.

I’d really like to see some real change happen. Some of the ideas like elections funded from public small amounts only or the ways to reform our government.

Give yourself an hour and a half and watch this.

Deploying Windows Services from TFS

As part of our initiative to automate code deployments, we needed to move windows services from TFS to our test servers. The way we did this before was to have a build stage all the files and then either stop the services on the destination machine manually, copy files, and restart the services, or use a homebrewed application to deploy the service; which is fine and dandy, except that the original developer isn’t with the company anymore and the application is limited in certain ways.

So to solve this, I went ahead and created a new build template that would deploy our windows services from a TFS build.

Some prerequisites:

  • PsExec must be on the build machine
  • Your build service must be an admin on the machine you’re deploying to (to be able to stop and start services)

First, we’ll set up a new Code Activity, it’s very similar to the DeployFiles class i wrote about before

using System;
using System.Activities;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.TeamFoundation.Build.Client;
using Microsoft.TeamFoundation.Build.Workflow.Activities;
using Microsoft.TeamFoundation.Build.Workflow.Tracking;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
namespace BuildProcess.Activities
{
    [BuildActivity(HostEnvironmentOption.Agent)]
    public sealed class DeployWindowsService : CodeActivity
    {
        //Source dir being deployed from
        [RequiredArgument]
        public InArgument<string> SourceDir { get; set; }
        //Destination dir being copied from
        [RequiredArgument]
        public InArgument<string[]> DestinationDir { get; set; }
        //Files to include
        [RequiredArgument]
        public InArgument<string> FileInclusions { get; set; }
        //Folders to include
        [RequiredArgument]
        public InArgument<string> FolderInclusions { get; set; }
        [RequiredArgument]
        public InArgument<string> CollectionName { get; set; }
        public InArgument<string> ConfigLocations { get; set; }
        //globals
        public string fileInclusionPattern = "";
        public string folderInclusionPattern = "";
        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument
            string fileInclusions = context.GetValue(this.FileInclusions);
            string folderInclusions = context.GetValue(this.FolderInclusions);
            string configLocations = context.GetValue(this.ConfigLocations);
            string[] destinations = context.GetValue(this.DestinationDir);
            string collectionName = context.GetValue(this.CollectionName);
            DirectoryInfo sourceDir = new DirectoryInfo(context.GetValue(this.SourceDir));
            //parse exclusions, add them to regex patterns
            if (!String.IsNullOrWhiteSpace(fileInclusions))
            {
                string[] fileinarr = fileInclusions.Split(',');
                fileInclusionPattern = "(";
                foreach (string s in fileinarr)
                {
                    fileInclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "$|";
                }
                if (fileInclusionPattern.EndsWith("|"))
                    fileInclusionPattern = fileInclusionPattern.Substring(0, fileInclusionPattern.Length - 1);
                fileInclusionPattern += ")";
            }
            if (!String.IsNullOrWhiteSpace(folderInclusions))
            {
                string[] folderinarr = folderInclusions.Split(',');
                folderInclusionPattern = "(";
                foreach (string s in folderinarr)
                {
                    folderInclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "$|";
                }
                if (folderInclusionPattern.EndsWith("|"))
                    folderInclusionPattern = folderInclusionPattern.Substring(0, folderInclusionPattern.Length - 1);
                folderInclusionPattern += ")";
            }
            foreach (string dir in destinations)
            {
                DirectoryInfo destDir = new DirectoryInfo(dir);
                //Used for debugging, you don't need this, unless you want to display something custom here.
                context.Track(new BuildInformationRecord<BuildMessage>()
                {
                    Value = new BuildMessage()
                    {
                        Importance = BuildMessageImportance.High,
                        Message = "Source: " + sourceDir.FullName +
                            "\r\nDestination: " + destDir.FullName +
                            "\r\nFolder Inclusion Pattern: " + folderInclusionPattern +
                            "\r\nFile Inclusion Pattern: " + fileInclusionPattern +
                            "\r\nFolder Inclusions String: " + folderInclusions +
                            "\r\nFile Inclusions String: " + fileInclusions,
                    },
                });
                CopyDir(sourceDir, destDir);
            }
            //copy config files
            if (!String.IsNullOrWhiteSpace(configLocations))
            {
                string strTFSName = collectionName;
                //set up TFS connectivity
                Uri tfsName = new Uri(strTFSName);
                TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(tfsName);
                VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
                //copy config files to proper location
                string timestamp = DateTime.Now.Ticks.ToString();
                string workspacePath = @"C:\temp\TFSConfigDeployment_" + timestamp;
                Workspace ws = vcs.CreateWorkspace("TFSConfigDeployment_" + timestamp, vcs.AuthorizedUser);
                //get the workspace locally
                ws.Map(configLocations, workspacePath);
                ws.Get();
                foreach (string configDir in destinations)
                {
                    CopyDir(new DirectoryInfo(workspacePath), new DirectoryInfo(configDir));
                }
                RemoveWorkSpaceDirectory(workspacePath);
            }
        }
        private void RemoveWorkSpaceDirectory(string workspacePath)
        {
            DirectoryInfo dir = new DirectoryInfo(workspacePath);
            var files = dir.EnumerateFiles();
            foreach (FileSystemInfo info in files)
            {
                string filePath = info.FullName;
                if ((File.GetAttributes(filePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                {
                    File.SetAttributes(filePath, FileAttributes.Normal);
                }
            }
            var subDirs = dir.EnumerateDirectories();
            foreach (DirectoryInfo subDir in subDirs)
            {
                RemoveWorkSpaceDirectory(subDir.FullName);
            }
            dir.Delete(true);
        }
        private void CopyDir(DirectoryInfo sourceDir, DirectoryInfo destDir)
        {
            //create destination dir if it doesn't exist
            if (!destDir.Exists)
            {
                destDir.Create();
            }
            // get all files from current dir
            FileInfo[] files = sourceDir.GetFiles();
            //copy ze files!!
            foreach (FileInfo file in files)
            {
                string destFilePath = Path.Combine(destDir.FullName, file.Name);
                if (!String.IsNullOrWhiteSpace(fileInclusionPattern))
                {
                    if (Regex.IsMatch(file.Name.ToUpper(), fileInclusionPattern))
                    {
                        if (File.Exists(destFilePath))
                        {
                            if ((File.GetAttributes(destFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                            {
                                File.SetAttributes(destFilePath, FileAttributes.Normal);
                            }
                            File.Delete(destFilePath);
                        }
                        file.CopyTo(destFilePath);
                        if ((File.GetAttributes(destFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                        {
                            File.SetAttributes(destFilePath, FileAttributes.Normal);
                        }
                    }
                }
            }
            // get subdirectories.
            DirectoryInfo[] dirs = sourceDir.GetDirectories();
            foreach (DirectoryInfo dir in dirs)
            {
                // Get destination directory.
                string destinationDir = Path.Combine(destDir.FullName, dir.Name);
                if (!String.IsNullOrWhiteSpace(folderInclusionPattern))
                {
                    if (Regex.IsMatch(dir.Name.ToUpper(), folderInclusionPattern))
                    {
                        // Call CopyDirectory() recursively.
                        CopyDir(dir, new DirectoryInfo(destinationDir));
                    }
                }
            }
        }
    }
}

For the next step, you’ll also want to look at the previous post about deploying files from TFS. After you’ve opened up your ProcessTemplate, you’ll want to have the following arguements:

  • DeploymentDir – In – String[]
  • SourceRootDir – In – String
  • CollectionName – In – String
  • PsExecPath – In – String
  • ServiceName – In – String
  • ServerName – In – String
  • FileInclusions – In – String
  • FolderInclustions – In – String
  • RestartService – In – Boolean – True

Each of these you’ll probably want to add to the Metadata Argument so you can keep your build definitions organized.

And you’ll want to add the following Variable:

  • PsExecResult – Int32 – Revert Workspace and Copy Files…

Under Process > Sequence > Run On Agent > Try Compile, Test, and Associate Changesets and Work Items > Revert Workspace and Copy Files to Drop Location > If Deployment Location is Set you’ll want to place a new Sequence and call it Stop Service, Copy Files, Start Service.

Inside that Sequence you’ll want to place an Invoke Process activity, the new DeployWindowsServices code activity, and an If statement with another Invoke Process activity in the Then clause.

For the first Process Invocation:

Arguements:  ServerName + ” -s -d net stop ” + ServiceName
DisplayName: Stop Service
FileName: PsExecPath
Result: PsExecResult

For the Deployment Activity:

CollectionName: CollectionName
DestinationDir: DeploymentDir
DisplayName: Deploy Windows Service
FileInclustions: FileInclusions
FolderInclustions: FolderInclusions
SourceDir:  BinariesDirectory + “\” + SourceRootDir

For the If statement, just check to see if RestartService is set to True, and then enter the values for the second Process Invocation:

Arguements:  ServerName + ” -s -d net start ” + ServiceName
DisplayName: Start Service
FileName: PsExecPath

*NOTE, THE FOLLOWING SECTION DOES NOT WORK PROPERLY YET*

After the If statement, you’ll want to add in another If, this will check to see if PsExec has failed or not.

Since this isn’t working properly yet, i just check to see if PsExecResult is ’1′, which it hasn’t been as of this writing. In the Then block, add a Throw activity and have it throw an exception of:

New Exception("PsExecResult: " + PsExecResult.ToString())

Optionally, you can also add WriteBuildMessage and WriteBuildWarning activities to your Invoke Process Activities, these are nice because you can see what the process you are invoking outputs.

New Camera and weekend exploits!

Ever since the trip to North Carolina I’ve been wanting to get a new camera, a DSLR to be precise. I’ve been looking at different cameras for the last week or so, trying to decide between a Canon T2i, a Nikon D90, and a Nikon D7000. Well, earlier this week i finally settled and got the D7000. And thanks to my friend Angela, who hooked me up with a Amazon Prime trial I was able to get 1-day shipping for 4 bucks! Order the camera, get it within the next two days, that was the plan anyway. The first day I get home from work and see a note on my door. The package required a signature on delivery, so they couldn’t just leave the camera on my door step. I guess that’s smart of Amazon to do, require the signature on expensive items. I’d never had that happen before, even on things i’d bought from Amazon. I decided that the second day i’d take a half-day from work so i could catch the delivery truck and get my precious new toy. No such luck. I get there 15 minutes too late and get another note stuck on my door. So, what i did was change the package to be held at the UPS Customer Center, so i could pick it up that day. I didn’t want to wait another day. I NEEDED MY PRECIOUS!

Saturday, after staying out a little late the night before after picking up my camera and going to judo, a few friends and I decided to go out for drinks and eat sushi for dinner, aka an awesome chance to try out my new camera :D

Osaka Sushi Restaurant
Osaka is delicous, it’s actually one of my favorite places to get sushi at. But before we get to that we take a little detour. On the way up to Osaka, we get a phone call from Daphne, saying she has to work late. FOR AN ENTIRE HOUR!

 

DSC_0098
Sarah and I take this opportunity to get some delicious iced beverages at the Zen Tea House while we waited.
Abandoned house
After we ate at Osaka, we decided to take a little walk to help our food digest and to use up some time before heading out to Sergio’s World Beers. On the way, we saw this old house in very sad shape.
DSC_0110
After our walk we headed down to the bar where we partook in some delicious beverages. it was hot so a Radler was totally in order :D
DSC_0123
Sarah found this adorable beer hidden in one of the fridges. It was quite good actually.
DSC_0118
Mary decided to take a shot and try one of the Fruit Ale’s on draft, it was a Strawberry Ale. Oh man, that was good! Very sweet! We stayed for a while chit chatting about this and that and eventually went home, I took a nap on the drive back :3

Sunday. Mary and I decided to meet up at Berheim Forest to practice with our cameras (Mary has a D90). We walked around taking pictures of all sorts of things.
DSC_0152
These geese were protecting their goslings from other geese trying to steal the food people were throwing at them. Geese can be VICIOUS!

 

DSC_0142
Typical, insect doing something with a plant picture. Also, <insert camera talk about blurriness and focus point here>.
DSC_0254
Mary. I don’t care what she says, I like this picture :) After Bernheim we went and ate at Saigon Cafe, which was delicious! I’m really glad i got introduced to Vietnamese food, it’s so good! Then it was off to Heine Bros for some coffee before the trip home.

Once i got to my parents that evening I played with my camera some more, mainly taking pictures of the dogs.
DSC_0277
Nero begging for food. Can’t you tell? He hasn’t eaten in minutes!

DSC_0276
Papa just wanting attention. Who can resist those eyes?

One thing i’ve noticed is that Nero and Papa are very photo conscious. They’re quite good at looking at the camera and being adorable.
DSC_0329
Homer on the other hand, couldn’t give two licks about cameras being pointed at him. He’s too busy making sure there aren’t things that need to be sniffed or chased in the yard.

Duck, NC

I took a trip to Duck, NC last month. The trip was great! I thought i’d update here with some video and pictures! The group consisted of friends who all play Left 4 Dead together. We were all looking forward to an epic week!

On the first day we got there i was so exicted! So i made this video :D I was pretty out of breath at the end of it from running around the house, lol.

Day two was pretty much chilling at the beach, I made another video to rub it in everyone back home’s face :P Chair made of sand, ocean waves, plenty of sun screen. All that was missing was the corona.

The rest of the week was filled with beach, video and board games, and drinking all sorts of tasty beverages. We also did some touristy stuff, like checking out some of the local shops where we ended up doing some judo on a lawn of a restaurant, haha!

I threw Sean with Koshi Guruma!

We also went to see the Currituck Beach Lighthouse, that was really cool! The stair case seemed to go on forever! Higher and higher! But once you got to the top! What a view!

At the end of the week we went out Parasailing. I’d never gone before, and boy!, was it a fun experience! It was amazing how far you could see and how calm everything was up there.

Mary and I way up high

The week went by way too fast for me! I wish i could go on vacation all the time! I can’t wait to for Otakon to meet up with many of you guys again!

The whole group in Troll shirt attire :D

I’d like to thank Tom and Mary for the pictures! You guys take some great shots!

The Wonderful World of Minecraft

I’ve been playing quite a lot of Minecraft lately, I even have my own server up and running. You’re welcome to join in on the fun! Just connect to krandor.dyndns.org. Our world isn’t very big right now, we’ve been mainly working on crafting stuff and playing with all the stuff you can make… and well, being on the quest to find lots of iron and diamond :P But i do think we’ve made some pretty neat structures.

I love the sunrises :)

Carnes has built a rock making machine, as well as a pretty sweet wheat garden, all on top of an elevated fortress surrounded by lava moats.

Our first tree fort

I’ve been mainly running around exploring the world and caverns. Those caverns can get dark, expansive, and SCARY!

Another project we’ve been working on is getting a rail system going, because walking across the world can take a long time!

I started this post quite a while ago, and since then have taken quite a big break from the game. But recently I’ve gotten back into it, and even have  a few friends on the server regularly. There are also some mods installed on the server which allow us to specify certain areas as safe from monster spawns, set up our own shops to sell things, and even have a dynamically updated map that shows the live goings on of the server!

kinda had an accident with some flint and steel :P

Carnes’ current project is to construct a quest for us to run at one point. He’s off somewhere on the map sculpting land and building stuff so we can all go and run the quest together! I can’t wait!

My house! :D

If you want to check out what our world looks like, click here. This may not be the most up-to-date render, but it does have the most detail. If you’d like to check out our realtime map, check it out here!

Server Details:
For game connection — krandor.dyndns.org
For high quality map render — krandor.dyndns.org/mc/maps/map.html
For live dynamic map render — krandor.dyndns.org:8123

I loath creepers

Deploying to Multiple Locations in TFS 2010

This is just a forewarning, I am not an expert in the ways of TFS. I’ve only been working with TFS in general for about a year, and TFS 2010 for about 2 months or so. That being said, if anyone has recommendations on a better way to do this, please point me in the right direction :)

Scenario:

We want to deploy our built code to different environments, but, we don’t want everything that’s dumped into the Release folder.

The Plan:

The plan is to create a custom build activity to copy files from one place to another checking each file against an exclusion list.

The Guts:

Referencing my previous post, Dependency Replication in TFS 2010, I will build upon the write-ups by Ewald Hofman.

You can grab the file here: DeployFiles.cs

Here’s the whole activity:

using System;
using System.Activities;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.TeamFoundation.Build.Client;
using Microsoft.TeamFoundation.Build.Workflow.Activities;
using Microsoft.TeamFoundation.Build.Workflow.Tracking;

namespace BuildProcess.Activities
{
    [BuildActivity(HostEnvironmentOption.Agent)]
    public sealed class DeployFiles : CodeActivity
    {
        //Source dir being deployed from
        [RequiredArgument]
        public InArgument<string> SourceDir { get; set; }
        //Destination dir being copied from
        [RequiredArgument]
        public InArgument<string[]> DestinationDir { get; set; }
        //Files to exclude
        [RequiredArgument]
        public InArgument<string> FileExclusions { get; set; }
        //Folders to exclude
        [RequiredArgument]
        public InArgument<string> FolderExclusions { get; set; }

        //globals
        public string fileExclusionPattern = "";
        public string folderExclusionPattern = "";

        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument
            string fileExclusions = context.GetValue(this.FileExclusions);
            string folderExclusions = context.GetValue(this.FolderExclusions);
            string[] destinations = context.GetValue(this.DestinationDir);
            DirectoryInfo sourceDir = new DirectoryInfo(context.GetValue(this.SourceDir));

            //parse exclusions, add them to regex patterns
            if (!String.IsNullOrWhiteSpace(fileExclusions))
            {
                string[] fileexarr = fileExclusions.Split(',');
                fileExclusionPattern = "(";
                foreach (string s in fileexarr)
                {
                    fileExclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "|";
                }

                if(fileExclusionPattern.EndsWith("|"))
                    fileExclusionPattern = fileExclusionPattern.Substring(0, fileExclusionPattern.Length - 1);

                fileExclusionPattern += ")";
            }

            if (!String.IsNullOrWhiteSpace(folderExclusions))
            {
                string[] folderexarr = folderExclusions.Split(',');
                folderExclusionPattern = "(";

                foreach (string s in folderexarr)
                {
                    folderExclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "|";
                }

                if(folderExclusionPattern.EndsWith("|"))
                    folderExclusionPattern = folderExclusionPattern.Substring(0, folderExclusionPattern.Length - 1);

                folderExclusionPattern += ")";
            }

            foreach (string dir in destinations)
            {
                DirectoryInfo destDir = new DirectoryInfo(dir);

                context.Track(new BuildInformationRecord<BuildMessage>()
                {
                    Value = new BuildMessage()
                    {
                        Importance = BuildMessageImportance.High,
                        Message = "Source: " + sourceDir.FullName + "\nDestination: " + destDir.FullName +
                            "\nFolder Exclusion Pattern: " + folderExclusionPattern +
                            "\nFile Exclusion Pattern: " + fileExclusionPattern,
                    },
                });

                CopyDir(sourceDir, destDir);
            }
        }

        private void CopyDir(DirectoryInfo sourceDir, DirectoryInfo destDir)
        {
            //create destination dir if it doesn't exist
            if (!destDir.Exists)
            {
                destDir.Create();
            }

            // get all files from current dir
            FileInfo[] files = sourceDir.GetFiles();

            //copy ze files!!
            foreach (FileInfo file in files)
            {
                if (!String.IsNullOrWhiteSpace(fileExclusionPattern))
                {
                    if (!Regex.IsMatch(file.Name.ToUpper(), fileExclusionPattern))
                    {
                        if (File.Exists(Path.Combine(destDir.FullName, file.Name)))
                        {
                            File.Delete(Path.Combine(destDir.FullName, file.Name));
                        }
                        file.CopyTo(Path.Combine(destDir.FullName, file.Name));
                    }
                }
                else
                {
                    if (File.Exists(Path.Combine(destDir.FullName, file.Name)))
                    {
                        File.Delete(Path.Combine(destDir.FullName, file.Name));
                    }
                    file.CopyTo(Path.Combine(destDir.FullName, file.Name),true);
                }
            }

            // get subdirectories.
            DirectoryInfo[] dirs = sourceDir.GetDirectories();

            foreach (DirectoryInfo dir in dirs)
            {
                // Get destination directory.
                string destinationDir = Path.Combine(destDir.FullName, dir.Name);

                if (!String.IsNullOrWhiteSpace(folderExclusionPattern))
                {
                    if (!Regex.IsMatch(dir.Name.ToUpper(), folderExclusionPattern))
                    {
                        // Call CopyDirectory() recursively.
                        CopyDir(dir, new DirectoryInfo(destinationDir));
                    }
                }
                else
                {
                    // Call CopyDirectory() recursively.
                    CopyDir(dir, new DirectoryInfo(destinationDir));
                }
            }
        }
    }
}

Explanation:

Now i’ll go section by section explaining exactly what’s going on. First up are the input requirements:

         //Source dir being deployed from
        [RequiredArgument]
        public InArgument<string> SourceDir { get; set; }

The SourceDir is where the deployment starts from. This means what subdirectory from the BinariesDirectory gets deployed. This is important for Websites, since they get dropped in a _PublishedWebsites folder inside the BinariesDirectory.

        //Destination dir being copied from
        [RequiredArgument]
        public InArgument<string[]> DestinationDir { get; set; }

The DestinationDir argument is a string array of paths being passed in (we use UNC network paths, ie: \\deploymentbox\websites\sitename)

        //Files to exclude
        [RequiredArgument]
        public InArgument<string> FileExclusions { get; set; }

The FileExclusions argument is meant to be a comma delimited string of filenames and patterns you want to exclude. (ie: “web.config, *.pdb”)

        //Folders to exclude
        [RequiredArgument]
        public InArgument<string> FolderExclusions { get; set; }

The FolderExclusions argument is similar to the FileExclusions, except that if there are certain folders you don’t want deployed, you can specify them here

        //globals
        public string fileExclusionPattern = "";
        public string folderExclusionPattern = "";

These two variables will be used to build the Regex pattern which we will check files and folders against.

Now we’ll go into

protected override void Execute(CodeActivityContext context)

explaining each part in more detail.

            // Obtain the runtime value of the Text input argument
            string fileExclusions = context.GetValue(this.FileExclusions);
            string folderExclusions = context.GetValue(this.FolderExclusions);
            string[] destinations = context.GetValue(this.DestinationDir);
            DirectoryInfo sourceDir = new DirectoryInfo(context.GetValue(this.SourceDir));

Here we get the values being passed in at execution time

            //parse exclusions, add them to regex patterns
            if (!String.IsNullOrWhiteSpace(fileExclusions))
            {
                string[] fileexarr = fileExclusions.Split(',');
                fileExclusionPattern = "(";
                foreach (string s in fileexarr)
                {
                    fileExclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "|";
                }

                if(fileExclusionPattern.EndsWith("|"))
                    fileExclusionPattern = fileExclusionPattern.Substring(0, fileExclusionPattern.Length - 1);

                fileExclusionPattern += ")";
            }

            if (!String.IsNullOrWhiteSpace(folderExclusions))
            {
                string[] folderexarr = folderExclusions.Split(',');
                folderExclusionPattern = "(";

                foreach (string s in folderexarr)
                {
                    folderExclusionPattern += s.ToUpper().Trim().Replace(".", @"\.").Replace("*", @"[a-zA-Z0-9]*") + "|";
                }

                if(folderExclusionPattern.EndsWith("|"))
                    folderExclusionPattern = folderExclusionPattern.Substring(0, folderExclusionPattern.Length - 1);

                folderExclusionPattern += ")";
            }

Here we check to see if anything was passed into the file or folder exclusion parameters. If something was passed in, we split the comma delimited string into an array and then iterate through it adding the exclusions to their appropriate Regex pattern.

            foreach (string dir in destinations)
            {
                DirectoryInfo destDir = new DirectoryInfo(dir);

                context.Track(new BuildInformationRecord<BuildMessage>()
                {
                    Value = new BuildMessage()
                    {
                        Importance = BuildMessageImportance.High,
                        Message = "Source: " + sourceDir.FullName + "\nDestination: " + destDir.FullName +
                            "\nFolder Exclusion Pattern: " + folderExclusionPattern +
                            "\nFile Exclusion Pattern: " + fileExclusionPattern,
                    },
                });

                CopyDir(sourceDir, destDir);
            }

Now we loop through all the destinations we need to deploy to, copying the files and folders.

Now lets take a look at

private void CopyDir(DirectoryInfo sourceDir, DirectoryInfo destDir)
            //create destination dir if it doesn't exist
            if (!destDir.Exists)
            {
                destDir.Create();
            }

Let’s make sure the destination directory exists, creating it if it doesn’t exist already.

            // get all files from current dir
            FileInfo[] files = sourceDir.GetFiles();

Here we get the all the files from the source directory

            //copy ze files!!
            foreach (FileInfo file in files)
            {
                if (!String.IsNullOrWhiteSpace(fileExclusionPattern))
                {
                    if (!Regex.IsMatch(file.Name.ToUpper(), fileExclusionPattern))
                    {
                        if (File.Exists(Path.Combine(destDir.FullName, file.Name)))
                        {
                            File.Delete(Path.Combine(destDir.FullName, file.Name));
                        }
                        file.CopyTo(Path.Combine(destDir.FullName, file.Name));
                    }
                }
                else
                {
                    if (File.Exists(Path.Combine(destDir.FullName, file.Name)))
                    {
                        File.Delete(Path.Combine(destDir.FullName, file.Name));
                    }
                    file.CopyTo(Path.Combine(destDir.FullName, file.Name),true);
                }
            }

Let’s copy some files! Check each file against the exclusion pattern, if one is set, and copy it if needed. If the file needs to be copied and it exists in the destination already, we’ll delete it and copy the file over.

            // get subdirectories.
            DirectoryInfo[] dirs = sourceDir.GetDirectories();

            foreach (DirectoryInfo dir in dirs)
            {
                // Get destination directory.
                string destinationDir = Path.Combine(destDir.FullName, dir.Name);

                if (!String.IsNullOrWhiteSpace(folderExclusionPattern))
                {
                    if (!Regex.IsMatch(dir.Name.ToUpper(), folderExclusionPattern))
                    {
                        // Call CopyDirectory() recursively.
                        CopyDir(dir, new DirectoryInfo(destinationDir));
                    }
                }
                else
                {
                    // Call CopyDirectory() recursively.
                    CopyDir(dir, new DirectoryInfo(destinationDir));
                }
            }

Last we check to see if the directory has any sub-directories and we call CopyDir() recursively to copy all sub directories and files inside them, only of course if they aren’t on the folder exclusion list.