# Tuesday, January 26, 2010
Close up blog entry

I’ve been using a Visual Studio macro to switch between markup and code-behind for years now. I’ve forgotten where I originally obtained the code for this Visual Studio macro.  If you search around you can find incarnations of it floating around the web. I created a really short tutorial explaining how to setup the macro at the end of this post.

Public Sub Switch()
  Dim FileName As String

  If (DTE.ActiveWindow.Document.FullName.ToLower().EndsWith(".cs")) Then
      ' swith from .aspx.cs to .aspx
      FileName = DTE.ActiveWindow.Document.FullName.ToLower().Replace(".cs", "")
      If System.IO.File.Exists(FileName) Then
          DTE.ItemOperations.OpenFile(FileName)
      End If
  ElseIf (DTE.ActiveWindow.Document.FullName.ToLower().EndsWith(".aspx")) Then
      ' swith from .aspx to .aspx.cs 
      FileName = DTE.ActiveWindow.Document.FullName.ToLower().Replace(".aspx", ".aspx.cs")
      If System.IO.File.Exists(FileName) Then
          DTE.ItemOperations.OpenFile(FileName)
      End If
  ElseIf (DTE.ActiveWindow.Document.FullName.ToLower().EndsWith(".ascx")) Then
      FileName = DTE.ActiveWindow.Document.FullName.ToLower().Replace(".ascx", ".ascx.cs")
      If System.IO.File.Exists(FileName) Then
          DTE.ItemOperations.OpenFile(FileName)
      End If
  ElseIf (DTE.ActiveWindow.Document.FullName.ToLower().EndsWith(".master")) Then
      FileName = DTE.ActiveWindow.Document.FullName.ToLower().Replace(".master", ".master.cs")
      If System.IO.File.Exists(FileName) Then
          DTE.ItemOperations.OpenFile(FileName)
      End If
  End If
End Sub

I created a short tutorial to show how to setup the macro in Visual Studio.

I hope this helps! Enjoy :-D

Share/Bookmark
Tuesday, January 26, 2010 12:30:34 AM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [2]  | 
# Sunday, January 24, 2010
Close up blog entry

I’ve created a few custom dasBlog macros for this blog.  For now I’m going to use this page as the home for these macros.


You can use these links to download the macros.

To install the macros you need to put the TTC-Macros.dll file in the web site bin folder. Then you need to add the following to the web.config <configuration> section.

<newtelligence.DasBlog.Macros>
   <add macro="ttcMacros" type="TTC_Macros.TTCMacros,TTC-Macros" />
</newtelligence.DasBlog.Macros>

These macros were built against dasBlog version 2.3.9074.18820.

Please read the remainder of this post for a description of the macros.


dasBlog macro to set page title

By default dasBlog shows the page title as the blog title-page title. The problem with this page title is the link that displays in the search engine results page is not what I want.

The next example shows how the page title is truncated in the search results.

Google Page Title Result

The next example shows the page title fits in the Google search results. The blog title is not visible, but is not really important in the search results.

Google Page Title Fits

It may have SEO impact as well, although I’m not sure if the page title starting with the blog title matters so much.

The usage for the page title macro in a dasBlog .blogtemplate file is as follows:

dasBlog Page Title Macro


dasBlog macro to add NOINDEX meta tag

I like to keep the pages in the search engine nice and clean. Given a blog has a lot of duplicate pages, I wanted to keep a number of the pages out of the index. So I created a macro to add a NOINDEX meta tag to the page for certain dasBlog pages.

The usage for the macro is shown below.

dasBlog NOINDEX Macro

The NOINDEX meta tag will be added for all category view, paging, month, date, default page (not /), login, and search view pages. Basically only the blog post pages, the root, and the archives page will be in the search engine index.


dasBlog macro to set comment link

This macro that can be used in place of the default comment view hyperlink. By default the hyperlink is something like CommentView,guid,1920be4a-2789-4d12-b667-edf2e7f4ff77.aspx#commentstart. The search engines pick this up and will put it in the index. I prefer is just use the regular page title.

The usage for the macro is shown below.

dasBlog Comment Link

So use the TTCCommentLink macro in place of the CommentLink macro.


If you have any questions please feel free to ask and I’ll try to help.

Share/Bookmark
Sunday, January 24, 2010 7:53:00 PM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
# Thursday, January 14, 2010
Close up blog entry

I built the Lego Power Miner Rock Wrecker with my son. Of course it is sped up a bit :-) It was fun to create! Enjoy!

This is a response to this Lego time lapse video at WindowFruit.com .

Share/Bookmark
Thursday, January 14, 2010 11:49:33 PM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
# Thursday, January 07, 2010
Close up blog entry
WindowFruit.com

A friend started a new blog called WindowFruit.com. Tim created a very cool theme! It starts with a nice time lapsed Lego building video :-) 

Good luck with the blog!

Share/Bookmark
Thursday, January 07, 2010 7:03:10 PM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [1]  | 
# Wednesday, January 06, 2010
Close up blog entry

I’ve used a CPAP machine now for a couple years and my main issue is it can cause my eyes to dry out a bit. I ended up getting an eye mask and it really helps alleviate the eye dryness. It does not completely eliminate my dry eyes, but it really helps cut it down.

I’ve read others use goggles that are available to wear when sleeping.  I like the softness of the eye mask and the ease of sliding it up my forehead if I need to see while I’m wearing my CPAP mask.

The mask pictured is the one I purchased on Amazon. There may be better ones, so of course look around, but this one has done the job for me. It is a good price as well :-)

Please keep in mind, this works for me but may not work for others. I hope it does help

Please note that I am an Amazon affiliate.

Share/Bookmark
Wednesday, January 06, 2010 12:54:11 AM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
Close up blog entry

I read about being able to use the HTTP header X-Robots-Tag to specify Google search index control options. For my purposes, I wanted to specify that certain pages on my blog would not go in the index. So I specified the header X-Robots-Tag: noindex using Microsoft’s URL Rewrite module 2 which can use out bound rules to rewrite page content and page headers.

The header was correctly being added to the pages, but when I used the remove URL tool in Google webmaster tools to remove the pages the result was the request for page removal was denied.

image

The information about the X-Robots-Tag discusses using it for page content like PDF files and such. It does not specifically state that it will or will not work for regular content type text/html. I asked on the Google webmaster tools help forum, but I did not get any response.

I ended up modifying my blog’s code to add a meta ROBOTS tag to the HTML head element of my pages which works as expected.

I can’t be 100% sure that the X-Robots-Tag will not do the job, but I could not get it to work. If someone has found out otherwise please let me know.

Share/Bookmark
Wednesday, January 06, 2010 12:49:08 AM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, January 05, 2010
Close up blog entry

The other night my youngest son was very tired. I was rocking him on the glider and he turned around and laid his head on my shoulder. I rocked him like that for a while and realized that it might be the last time I do that with my children. He’s gotten to the point where he just does not do that anymore.

There is something about rocking your children when they are so young. It is hard to explain, but there is a certain comfort about it that is indescribable. It is amazing how much comfort our children give us. Sometimes it feels like there is a lot of wining and crying, oh wait there is a whole lot of that :-) But there are moments that have a certain magic.

My connection with my sons is a bond unlike anything I’ve ever experienced. I’m grateful and eternally thankful for it. Every morning I’m glad to greet them and every evening I look forward to getting home from work to see them again.

I will not miss rocking them in a sad sense, I am always excited to see them change and grow, instead I will reflect on those moments as treasures captured in time :-D

Share/Bookmark
Tuesday, January 05, 2010 8:08:10 PM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
Close up blog entry

Even though my blog will focus on a lot of technical information, it is still my personal blog. Hopefully I can keep the signal to noise ratio reasonable within the categories, but it might be a bit low overall. I realize a blog is supposed to have some focused purpose, but I’m breaking the rules a bit. I guess I’ll just have to wait and see how it goes.

I’ve had this blog for roughly four months now and it is interesting what a challenge it has been. Between full time work and two young children it is difficult to find any free time. Creating content an hour here and there is difficult. To all those creating content my hat is off to you!

There seems to be a stigma about bloggers that they are just a bunch of lazy slackers sitting in pajamas all day lackadaisically creating posts. I’d like to challenge this stereotype! Creating content is work, and not easy work at that. It is time that could be spent doing something fun. World of Warcraft anyone? Or maybe SkiFree :-)

With kids, it is even tougher as the days are long. From early morning until late evening it is difficult to keep up with everything that needs to be done. Between a kid’s demand for attention, baths, hassles about bedtime, diaper changes, sickness, and all those things a parent has to do, free time is precious. Blogging with children is hard :-) Don’t get me wrong though, I love my kids beyond all else and enjoy every minute I have with them!

For some reason I’ve decided to do this on top of everything else. I just hope my wife won’t get sick of me too quickly. I’m hoping to get back into the swing of things after the holidays and make some more content. We’ll see if I can pull it off ;-)

Share/Bookmark
Tuesday, January 05, 2010 12:18:07 AM (Eastern Standard Time, UTC-05:00)  #    Disclaimer  |  Comments [1]  |