Thursday, July 8, 2010

Tonight, I Attended the NJ Dot Net User Group Meeting

Tonight, I attended the NJ Dot Net User Group meeting (http://www.njdotnet.org/).  JP Toto  presentated on Git and GitHub.  Here is what I learned from JP.

Basically, this is the book to read (for free online, or buy it at Amazon).

There is this code called msysgit on code.google.com. Once it downloaded and installed, you have Git. Git is a "distributed source control" solution and allows you to create repositories of your data on your local machine.  You can branch and merge your repository locally on your machine -- lightning fast speed.  Then, you can "push" your repository to GitHub.

GitHub is free for open source projects (they call them "public repositories").  It costs money for a "private repository."  There is also a solution for organizations giving for granular control of access privileges.  Once a repository has been uploaded to GitHub, it is possible to do collaboration in a team environment.  There is some really wild collaboration functionality built into GitHub.

So, another developer basically "pulls" the repository from GitHub to their local machine.  There is no branching or merging on GitHub.  That stuff happens locally, hence the idea of "distributed source control."  Git utilizes "optimistic locking" in contrast to VSS's "pessimistic locking."  That means anyone can work on a any file, but the only way yo can check it in is if you have the latest copy of that file from GitHub.  If you don't have the latest copy (if someone else checked in the file before you did), then you have to "pull" that file and do a merge into your local repository.  Then, you will have the latest copy and you can push up your changes.  That is how "optimistic locking" works.

Oh, there is a GIU for Git, called  tortoisegit.  And, there is a tool for integration with VS called gitextensions.

Friday, June 4, 2010

What's the difference between Convert.ToInt32(string) and Int32.Parse(string)?

The two give identical results, except where the string is null. Convert.ToInt32(null) returns zero, whereas Int32.Parse(null) throws anArgumentNullException.

hat tip: http://www.yoda.arachsys.com/csharp/faq/#convert.parse

Thursday, June 3, 2010

Fawn in the Raspberry Bush

The whole family was in the Catskills when a deer ran past the house. Shortly after, a beautiful fawn passed by also and hid in a raspberry patch. I took this picture. The fawn stayed there for hours until dusk, when he/she (?) walked slowly and uncertainly up the hill a little calling for her mother, sounded halfway between a bird and a human. She stopped and stayed near the knoll of the hill for another couple of hours, calling out for her mother. She was gone the next day, but someone else said they saw a mother deer with her fawn together, so we are hopeful they were reunited.
Posted by Picasa

Tuesday, May 25, 2010

To fix ProfileCommon in Web Applicaiton Project, put Global.asax.cs codebehind into Global.asax script tags.

This is interesting (at least, if you are website developer). In .NET 3.5, if you take the Global.asax.cs codebehind and put it into the Global.asax inside of <script runat="Server"> tags, and then, if you change all the "usings" from the Global.asax.cs into "<%@Import" tags in the Global.asax, and then if you fix a few access issues (removing "protected" from Application_Start, Application_Error and the like), low and behind, the ProfileCommon will autogenerate even in a web application project (perhaps not the whole WAP, but at least it shows up in Profile_OnMigrateAnonymous).

Tuesday, May 11, 2010

First Month At Electric Vine

For the past month, I have been working at Electric Vine -- which does all things Web Design NJ.  I've been diving into the source code of the Ignify E-Commerce product which we will be integrating into a customer solution.  Also, I have prototyped the integration of picassa web into websites.

A week ago, we all experienced the excitement of an office move to the next building over, about 1/2 the space of the old location.

Monday, March 15, 2010

Running .NET 4.0 in IIS 7.5 for the First Time

Today, I tried my hand at running an asp.net 4.0 (release candidate) web app for the first time in IIS 7.5.  I was getting all kinds of errors, the latest one being
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
Anyhow, I thought I’d mention on this blog how I got it working.   Turned out .Net Framework 4.0 was not registered properly.  After I did run %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i, everything is working fine.

Saturday, March 13, 2010

Turning a DateTime into a Friendly String

Over at http://www.primershee.com/Forum.aspx, the date column shows a friendly string version of when each post was last updated.  I used the following extension method…

        public static string ToFriendlyString(this DateTime date)
{
if (date.DayOfYear < DateTime.Now.DayOfYear)
return date.ToString();
else
{
TimeSpan span = DateTime.Now.Subtract(date);
if (span.Hours >= 1)
return span.Hours + " Hours Ago";
else if (span.Minutes >= 1)
return span.Minutes + " Minutes Ago";
else return span.Seconds + " Seconds Ago";
}
}