Building Microsoft Compiled Help (CHM) files

October 23, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I am sure there are people that would disagree with me, but I don't think there is a good end to end solution to creating Microsoft Help files. I would like a simple and inexpensive solution where I can author my files in Word. I would also like my XML commented c# code to be injected in the CHM as well.
 
Instead, it seems like I need to comble a solution together with a lot of "mapping" work required by me. I am using the following tools in order to get this done:
  1. ASPose sample to convert DOC file to HTML
  2. FAR HTML tools
  3. Sandcastle
  4. Sandcastle Help File builder

As a final note, I recomend checking out http://thoughtpad.net/alan-dean/cs-xml-documentation.html.

 

Domino's Pizza Coupon

July 10, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

As a means to remind me, the best Pizza Coupon from Dominos is "pc800" (see http://www.retailmenot.com/view/dominos.com for other coupons). Upon ordering a large pizza and a coke, $8 will be subtracted from your order.
Tags:General

 

Code Obfuscation Tools

June 26, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

By its very nature, .NET’s use of an Intermediary Language (IL) makes it very easy for someone to disassemble your .NET compiled software. Tools like Lutz Roeder’s .NET Reflector produce very readable source code. Back in the old days, disassembling compiled software yielded assembly code which was very difficult to read through [as a human]. Now, disassembling with Reflector yields C# code that looks identical to your original source code minus your comments and the same variable names you used in your original source code (i.e. intWidgets might show up as int1 in Reflector generated code).

If you develop and then sell software, the ease with which your compiled code can be converted to source code is a bit concerning. I know it concerned me. Imagine, you’ve worked very hard to develop some software and someone else comes along disassembles your code and very quickly has a competitive product.

Code Obfuscators muddle your compiled .NET code thereby making it much harder for someone to disassemble your code and figure out what you are doing. It should be noted these tools do not make it impossible…just harder.

I recently purchased the {Smart Assembly} (http://www.smartassembly.com/) as a means to obfuscate my software. I looked pretty hard at all the Obfuscators I could find on the Internet. The ones that I focused my attention on were as follows.

1.       {smartassembly}

2.       XHEO

3.       Skater

4.       XenoCode

FYI:  A more detailed list of Obfuscators can be found here http://www.devdirect.com/all/OBFUSCATIORS_PCAT_2014.aspx.

My selection of {smartassembly} was based on its functionality and price. If {smartassembly} didn’t exist I would have purchased XHEO.

With that said, be aware that when you use an obfuscator that it is not a one-click to transform your assembly to an obfuscated assembly. It will require a fair amount of testing and tweaking of the obfuscation software.

Tags:.NET

 

BLOG Migration

June 25, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I have completed MOST of the migration of my blog. I changed from .text to SharePoint (http://www.codeplex.com/CKS/Wiki/View.aspx?title=Enhanced%20Blog%20Edition). Therefore many URLs to content on http://blogs.informationhub.com no longer exist. Further, http://blogs.informationhub.com echos http://blogs.blueclarity.com.

 

Microsoft Office Picture Manager Print Sequence Issue: Print multiple images to PDF doesn't work as expected in Vista

April 24, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

My HP scanner produces individual JPG files instead of PDF. That means I need to convert several JPG files to one PDF.

I USED to be a be able to use Microsoft Office Picture Manager to print several image files to one PDF by printing to a print to PDF print driver. However, the Vista picture print wizard does not work like the XP picture print wizard. The XP picture print wizard honors the order in which you selected the images [with the mouse] as the order it prints. Vista picture print wizard has some other way in which it prints out your pictures. It isn't sorted by name or anything I can determie. Further, it flips the images upside down. The end result is that I cannot use Microsoft Office Picture Manager to convert multiple image files to a single PDF. This is a problem with Vista's built in picture print wizard and not Microsoft Office Picture Manager.

The SOLUTION is to use Google's Picasa program. It doesn't use the Vista Picture Print Wizard and therefore works like a champ.

Tags:Vista

 

My experience buying a car: Costco versus Dealix (Internet Quoting)

April 2, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

$150 over invoice
Today I completed the purchase of an Acura MDX. I paid $150 over invoice. I was still charged a dealer fee, but the price was adjusted down accordingly. So, the dealer fee was $500. Therefore the price I paid before the dealer fee was applied was $450 below invoice. The bottom line is that the dealer fee is what I consider a bogus charge and represents dealer profit. They threw in some free minor stuff (free oil changes for a year, free scotch guard, free enhanced car wax) with that price and they matched my quote from Car Max for the trade-in. 

On the Edmunds.com forums, I was noticing that the lowest price people were getting for an MDX was $200 below invoice. There was a single odd ball claim that a single person got $750 below invoice. Because that person was the only one, I thought it was an outlier and probably an incorrect statement. 

I personally got a quote for $100 below invoice (with the understanding they would need to get the car shipped to them from another dealer), but they wouldn’t take my trade-in at the price Car Max quoted me. If I figure a $100 charge for shipping then it would come out to my magical $200 below invoice (inclusive of dealer fee). I didn’t buy the car there because the dealership was very far away from me and I figured that if I needed to go back from something it would be a pain. For instance, the car I bought will have its pin-striping removed and re-waxed as there is a minor scratch that needs to be buffed out.

Costco versus Dealix versus Shopping around
I started the car buying process by going through Costco. They have a special program where they offer you discounted prices for cars (
http://www.costcoauto.com). The process requires you to go to a local participating dealer and then they give you a quote while you are in the showroom. The bottom line is that the participating dealer quoted me a price of $1700 over invoice (inclusive of their dealer fee). After some negotiating, they knocked off $500 and their absolute best offer was $1200 above invoice. We walked out and called it a day.

At this same time I was requested quotes from Edmunds.com (which actually uses Dealix). I requested quotes from about 15 different dealerships in my general area. A couple people sent me a quote via email, but most wanted me to call them before they would give me a price. One said they would give me invoice (inclusive of dealer fee)—but they didn’t have the car I wanted. Another gave me a price $500 above invoice (inclusive of dealer fee)—but they would have to get the car I wanted shipped to them. Still others were very bad at getting back to me.

I think submitting internet quotes is a better strategy than going through Costco or going to the dealership. When you are at the dealership they consciously try to hold your hostage and try to wear you down. For instance the Costco participating dealer held on to my key to evaluate my trade-in MUCH longer than they needed to. It got very irritating after a while. Many people will get frustrated and be willing to pay a little more to get the whole process over with. With internet quotes you cover a lot of ground remotely and never get held hostage at the dealership. There are always going to be dealerships that charge more, for whatever reason. Internet quoting can help you determine that much faster and also help you determine who is the most flexible.

Tags:General

 

WPF (XAML) versus WinForms thinking

March 10, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I was looking up some information on XAML's implementation of the treeview and stumbled across a lot of people trying to implement XAML components like they would implement a WinForms component. In effect, they were trying to put a “round peg in a square hole” and wasting lots of time and energy. Because this seemed to be so prevelant I thought it very worth while to write-up something on this.

The fundamental concept of XAML (WPF) is that elements are connected to each other via parent and child relationships. Further, you can directly interact with whatever elments are the most appropriate for your situation. This is very different than how people program against WinForms. In WinForms you interact directly with the “parent” and you are really not supposed to directly interact with its child elements.

Case in point is the TreeView control (although this really applies to all the controls that exist both in WinForms and XAML). In WinForms, you instantiate the treeview control and attach event handlers to that control. It is through these “parent attached“ event handlers that you can easily find out which child elements the user is trying to interact with. This is in direct contrast to what you should be doing with WPF. In WPF you should attach event handlers to the TreeView children (aka TreeViewItem class) do react to events on those children. You really shouldn't be attaching event handlers to the WPF TreeView to find out what is happening with the children. The whole idea of WPF is that the children handle their own event first and then if e.Handled is not set to true, the event bubbles upto the parent (the WPF TreeView control). People from a WinForms background (probably 99% of the people messing with WPF) keep thinking that the old rules apply and try to handle TreeViewItem events at the parent (aka at the TreeView level). This is obviously super frustrating because you are comming at this ass-backwards (aka bass-ackwards).

Below is an event handler for a TreeViewItem. Of course, you will need to bind the Drop event for the treeviewitem to its event handler:

treeviewitem.Drop += new System.Windows.DragEventHandler(treeviewitem_Drop);

 

 

void treeviewitem_Drop(object sender, System.Windows.DragEventArgs e)
{

//sender will be treeviewitem that user “dropped“ on

//make sure to set e.Handled to true or else this event will bubble up to parent

}

Tags:XAML

 

Lower Service Priority

February 28, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

After getting frustrated with SearchIndexer killing my computer, I decided to look for a way to lower its priority.  I found this:

Const ALL_USERS_STARTUP = &H18&, OverwriteExisting = TRUE
Dim Shell   : Set Shell = CreateObject("Shell.Application")
Dim Fso     : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Act     : Set Act = CreateObject("Wscript.Shell")
Dim Vbs1    : Vbs1 = Act.ExpandEnvironmentStrings("%SystemDrive%\LowerSvcInstall.vbs")
Dim StrFldr : Set StrFldr = Shell.Namespace(ALL_USERS_STARTUP)
Dim FldrObj : Set FldrObj = StrFldr.Self
Dim AUStart : AUStart = FldrObj.Path
Dim Vbs2    : Vbs2 = (AUStart & "\VistaLowerSrv.vbs")
'/-> Create The Vbs Script For All User Start Menu
Dim Ts      : Set Ts = Fso.CreateTextFile(Vbs2)
   Ts.WriteLine "'/-> Priority Level For TaskManager"
   Ts.WriteLine " Const Normal = 32, Low = 64, High = 256, RealTime = 128"
   Ts.WriteLine " Const BELOW_NORMAL = 16384, Above_Normal = 32768"
   Ts.WriteLine "'/-> Varibles"
   Ts.WriteLine "  WScript.Sleep 15000"
   Ts.WriteLine " Dim strComputer : strComputer = ""."""
   Ts.WriteLine " Dim Act         : Set Act = CreateObject(""Wscript.Shell"")"
   Ts.WriteLine " Dim ObjWmi      : Set ObjWmi = GetObject(""winmgmts:\\"" & strComputer & ""\root\cimv2"")"
   Ts.WriteLine "'/-> Array For Services To Lower"
   Ts.WriteLine " Dim ObjPro      : ObjPro = Array(_"
   Ts.WriteLine "    ""SearchFilterHost.exe"", ""SearchIndexer.exe"", ""SearchProtocolHost.exe"",_"
   Ts.WriteLine "    ""SLsvc.exe"", ""spoolsv.exe"", ""TrustedInstaller.exe"", ""wmpnscfg.exe"")"  
   Ts.WriteLine "'/-> Varibles"
   Ts.WriteLine " Dim ColPro, ColSrv, ObjSrv, StrObj, StrRpt"
   Ts.WriteLine "'/-> Collect The Array Names, Then Turn Down The Service"
   Ts.WriteLine "  For Each StrObj In ObjPro"
   Ts.WriteLine "  Set ColSrv = ObjWmi.ExecQuery(""Select * from Win32_Process Where Name = '"" & StrObj & ""'"")"
   Ts.WriteLine "   For Each ObjSrv in ColSrv"
   Ts.WriteLine "    ObjSrv.SetPriority(Low)"
   Ts.WriteLine "    StrRpt = StrRpt & vbCrLf & Space(3) & ObjSrv.Name"
   Ts.WriteLine "    Next"
   Ts.WriteLine "   Next"
   Ts.WriteLine "  Act.Popup ""Completed Lowering The Priority Levels"" & StrRpt, 5,""Completed"", 0 + 32 + 4096"
   Ts.Close  
    If Fso.FileExists(Vbs2) Then
     Act.Popup "Confirm Installed Completed" , 3, "Completed", 0 + 32 + 4096
     Act.Run(Chr(34) & Vbs2 & Chr(34)),0,True
    End If
   If Fso.FileExists(Vbs1) Then Fso.DeleteFile(Vbs1) End If

 

This above came from: http://www.msfn.org/board/lofiversion/index.php/t79185.html

Tags:Vista

 

SharePoint 2007 SP1

January 11, 2008 · Posted by Jason Nadrowski
82 Comments· 0 Links to this post

SharePoint 2007 SP1 was released Dec 2007. It is apparently NOT posted on WindowsUpdate.

 

Cheap Network Laser Printer: Brother Laser HL-2070N

January 10, 2008 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I still have my old HP 6L from 1995, but I am running out of Toner and was thinking of upgrading for a cheap laser printer. Currently I have it attached to a JetDirect EX 3 printer server I purchased from EBay several years ago. So, any upgraded printer would need to have a network connection. As I mentioned, I needed new toner which now costs $65 at Staples/Office Depot/Office Max/etc.

Long story short, I purchased the Brother HL-2070N at Staples for $79. I would say this is only a slight upgrade from my HP 6L in the sense that (1) it is one unit and NOT two (printer + network print server), (2) a bit more compact than the HP 6L and certainly more compact than the printer plus print server and (3) faster. I printed a test page (http://www.normankoren.com/Stepchart_large_bw2.jpg) from both printers and compared. I compared my HP 6L 600dpi to the Brother's 600dpi and their “HQ1200” which seems like it would be 1200dpi, but isn't.

The HP 6L--even though it is almost a 15 year old printer, printed better than the Brother 600dpi resolution! I'd also say that the HQ1200 resolution is only *slightly* inferior to HP's 600dpi. The HQ1200 resolution is darker (than the HP and the Brother 600dpi) and therefore the printed page didn't have the proper “grayation” (is that really a word) to see the intricies of the landscape. It was simply all black. Where the picture wasn't so dark, I would give a VERY NARROW lead to the Brother. However, I gave the nod to the HP because it had better greyscaling in the darker regions.

Long story short, for $79, I am keeping my laser printer. First, I NEVER print out photos with my laser so that is a non issue. As for printing text, they had (at least to my naked eye) identical results. Since I always print text from my laser (and the occasion visio figures which have next to no greyscaling) it didn't matter. For $79, I won't feel bad if I throw this printer away in 1 year.

I'd also like to mention that the toner cartridge for the Brother is rated at 1500 pages while the toner cartridge for the HP is rated at 2500. Thus, it is not precisely accurate to say that there was only a $15 price difference between the two as they have cartridges that are rated for different page counts.

Tags:General

 

A refresher of why I get frustrated with SprintPCS

December 18, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

Like countless people, I often get frustrated at Sprint. If it isn't them charging me the wrong price for something, suddenly activating a fee/feature I didn't authorize or telling me the wrong thing it is usually me going round and round with them on some topic.

I recently wanted to upgrade my parents to a PDA phone and was confused by their data plans ontop of their standard Family plan. In trying to figure this out, I attempted to chat with a represenative. Below is my conversation which wound up taking 45 minutes and I feel like I still didn't get an answer I was sure was correct.

The jist of the chat is that I asked what option I needed to pay for to get ActiveSync working over the cell phone line. At first, the represenative was talking about everything but what I asked them about. Then they told me the something that didn't seem right to me..and were a little taken aback that I would question them. They then “corrected“ themselves and said that I probably needed to chose a different option they were previously sure was the correct option for me. After pressing them to be sure, they came back and said they were sure. Suffice it to say, I wasn't confident I got the right answer to my simple question--even after talking with a supposed Sprint expert for 45 minutes.

Agent: Hello, I'm a Sprint products and services expert. May I help you pick the plan that is best for you?
You: Sure. I don't understand the data plans.
Agent: I can help you with that. First; may I move this chat to the top of the window? It will be out of the way and I can stay with you in case you run into any problems or if you have any questions, okay?
You: ...or rather the data add-ons for the family plans.
You: Sure
Agent: Can you see the page below?
You: No. Just the chat window.
You: But that is fine.
You: I am interested in the Moto Q PDA phone.
Agent: Are you interested in an individual plan, a family plan, or a plan with free incoming calls?
You: I mentioned it earlier, I am interested in the family plan.
Agent: Great!
Agent: Our Sprint Power Pack Family Plan includes unlimited Sprint mobile-to-mobile calling, unlimited Nights and Weekends starting at 7PM, free long distance on our nationwide network, no roaming charges and no huge overages.
You: ...with one of the lines being setup for the Moto Q PDA phone.
Agent: Alright.
Agent: We can setup each line individually for you if you like.
Agent: How many lines will you need?
You: Please listen to my questions and don't tell me about other things I don't care about.
You: I am asking you about the data add on options
You: I see there are two options for this phone: (1) $15/month and (2) $39/month.
Agent: You can add that in the upgrades page.
Agent: The $39.99 plan is for the phone as a modem plan.
Agent: With Sprint Vision Access Pack you get unlimited data access and data browsing, picture mail, Sprint TV Improved, Sprint Music, Sprint Mobile E-Mail, NFL Mobile, Sprint Radio, and Pay per Day Sprint Navigation. You get all this for $15 per month.
Agent: Your Sprint Power Vision phone can be a high-speed Internet connection for your laptop computer anywhere on the Sprint Power Vision Network. Simply connect your Power Vision phone using a USB cable or the built-in connection on Bluetooth-enabled phones.
Agent: Includes Web access, Sprint PCS Picture Mail, Sprint PCS Video Mail, Sprint TV (based on devices capability), SMS and wireless e-mail.
You: If I am interested in syncing the PDA phone with my Exchange [Email] Server over the cell phone signal can I get the $15/month option.
Agent: Yes, you can access your E-mail on your phone anywhere. With unlimited data access on this phone you can browse endlessly.
Agent: You need a voice plan with the phone as wel.
Agent: Have you already selected the phone or the plan?
You: I am a little concerned what you are telling me isn't correct.
Agent: What do you mean?
You: How does Sprint limit the the ability of me to use that phone as a modem for my laptop with the $15/month plan?
Agent: Phone As A Modem requires a Sprint PCS Voice Plan and a 2-year subscription agreement on the same device. Promotional Offer Unlimited $39.99 per month.
Agent: You have to pay that to use your phone as a modem.
Agent: However, the $15.00 plan gives you unlimited browsing on the phon itself.
Agent: Using it as a modem is for a laptop.
Agent: Does that make sense?
Agent: Are you still with me?
You: No that doesn't make sense. Currently, I have the earlier version of the Mogul HTC and have the $15/month plan. This allows me to sync with my Exchange email server and connect my computer (via bluetooth) to the internet through this phone. I do not have the $39/month plan. TMobile and Verizion limit the PDA phones ability to do anything more than web browsing at the data connection level which therefore blocks the ability to do active-sync over the cell phone signal.
You: What I am afraid of is that the $15/month option is the same.
Agent: You can sync with the $15.00 plan.
You: OK, so are you telling me that Sprint blocks the ability to connect to the laptop at the PHONE level or at the Cell phone signal level?
Agent: I think you don't even need the plan to sync your phone. You just need it to access the internet on your phone for less.
You: ...and if I try to connect to my laptop to the cell phone to use the internet AND I have the $15/month plan what happens?
Agent: You won't be charged extra for surfing on your phone.
You: That is true, the phone has an option to sync via a USB cable...but that is NOT why I would get the phone. I would get the phone to do ActiveSync while I am on the go.
Agent: Yes, as long as it has bluetooth it will work. That is not an extra charge.
Agent: So you already have the phone?
You: Ok, let me try this again. I want to do ActiveSync over the cell phone signal. I am not concerned with doing ActiveSync over USB or Bluetooth.
You: Although this is a bit moot, I am asking these questions because I want to expand my parent's plan to give them the features I have on my plan.
Agent: Oh, I see. I don't know that the phones can do that. It woudl require a direct network connection. That is why it must be bluetooth or USB.
You: So, you are telling me that ActiveSync over the Cell Phone data signal works with the $15/plan.
You: The phone can do that.
Agent: If the phone can do that then it would require the $15.00 plan, yes. I am not sure if that is a feature included with the PRO pack.
You: What is the PRO pack?
Agent: With Sprint Power vision Pro Pack you get unlimited text messaging, unlimited data access; web browsing, email, Sprint Picture Mail/Video Mail, On Demand, NFL Mobile, Sprint TV and Active Sync for $30 per month.
Agent: I believe that you need this plan for that feature.
Agent: Are you currently a Sprint or Nextel customer?
You: If you visit: http://direct.motorola.com/ENS/q-email-setup-activesync.asp?Country=USA&language=ENS&productid=30419 you will see instructions on how to setup active sync for the phone I am talking about over the cell phone connection. The part at the bottom (in gray) is what I am concered about: : Certain mobile phone features are dependent on the capabilities and settings of your service provider's network. Additionally, certain features may not be activated by your service provider, and/or their network settings may limit the feature's functionality. Always contact your service provider about feature availability and functionality. All features, functionality and other product specifications are based upon the latest available information and are believed to be accurate; however such product specifications are subject to change without notice or obligation.
Agent: Great!
Agent: So I guess that Active Sync is only lincluded with the PRO pack.
You: I am a customer and my parents are a customer.
Agent: Okay, so you were wanting to upgrade your phone?
You: You guess?
Agent: I just talked with my manager.
Agent: Only the PRO Pack an the Ultimate Pack have that feature.
You: Ok, to be perfectly honest, I appreciate your help. But, I don't have a lot of confidence in what you told me.
Agent: With Sprint Power vision Ultimate Pack you get, Sprint TV Premier, Sprint Music Premier and unlimited Sprint Navigation. You also get the basics: Unlimited Data Access, Unlimited Web Browsing, Picture Mail, Sprint Mobile Email, On Demand, NFL Mobile. PLUS you get the added benefit of more TV channels for $25 per month.
Agent: I'm sorry that I was not certain about your question before but I did not know all of the details to begin with. honestly you are the first person that brought it to my attention that it was a different feature but I understand now.
Agent: Sorry for the inconvenience.
Agent: Is there anything else I can help you with today?
You: OK, with that said, if I get the phone and can't set it up as I expect to set it up what is the return policy.
Agent: You have 30-days to return it to the store.
You: Even for an upgrade?
Agent: They can give you a refund in the store.
Agent: Yes.
You: Ok, and is there a charge to switch back to their old phones?
You: ...some sort of "activation/deactivation" charge?
Agent: There shouldn't be when you are doing a return.
Agent: Just bring them both back into the store.

Tags:General

 

Power Supply Calculator

December 17, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

Tags:General

 

"Stream to String", "Stream to byte[]", "String to Stream" and "String to byte[]"

November 28, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

There are many ways to convert Stream to String, Stream to byte[], String to Stream and String to byte[] The following are some of the ways that I accomplish those tasks.

Stream to String:
Stream streamConvertMe = somestream;
StreamReader
sr = new StreamReader(streamConvertMe);
string strConverted = sr.ReadToEnd();

Stream to byte[]:
MemoryStream ms = somestream;
using (byte[] abyte = new byte[ms.Length])
{
  ms.Read(abyte, 0, System.Convert.ToInt32(ms.Length));
  ms.Close(); //Close stream ASAP

  //Use abyte as needed
}

String to Stream (Option 1):
string strConvertMe = “some text to convert“;
using (MemoryStream memorystream = new MemoryStream(strConvertMe.Length))
{
  StreamWriter sw = new StreamWriter(memorystream );

  sw.Write(text);
  sw.Flush();
  sw.Position = 0;

  //Use Stream
}

String to Stream (Option 2):
string strConvertMe = “some text to convert“;
StringReader srConvertMe = new StringReader(strConvertMe);

String to Stream (Option 3):
string strConvertMe = “some text to convert“;
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(strConvertMe));

String to byte[]:
byte[] abyteConverted = Encoding.UTF8.GetBytes(strConvertMe);

byte[] to String:
byte[] abyte = somebytearray;
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
string strConverted = encoding.GetString(abyte);

Tags:c#, .NET

 

The absolute best vacation ideas

November 15, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I want to do this! I am posting it up on my blog as a means to remind myself.

Panda Hugs: http://www.budgettravel.com/bt-dyn/content/article/2007/06/05/AR2007060501315.html

Animal Encounters: http://www.budgettravel.com/bt-dyn/content/article/2007/06/05/AR2007060501329.html

Tags:Travel

 

Why are generics so cool?

October 12, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

When I first saw List (generics), I didn’t get it. It simply looks like one of the System.Collections classes that I had been using for years. Of course, generics provide the obvious type safe functionality for your collection. However, the real power of generics is to write substantially less code while doing the same thing you were doing with System.Collections.

In the old days, you typically would create a custom class that would house your data item. You would then extend your newly created custom class with methods/operators to support the manipulation of the data within the collection. That would typically mean creating a new file for the new class, documenting the class and its methods, etc, etc. It is always very painful when I need to write a lot of house-keeping code and spend less time focusing on the 'problem'.

With generics you usually don’t have to write that custom class any more. For instance, I recently needed to manage a UNIQUE collection of SPList instances (FYI SPList is a Microsoft SharePoint class). Long story short, I was getting different instances of SPList that were equivalent for my purposes but that Microsoft was telling me where not equivalent. In order to create my UNIQUE list, I didn’t want any duplicates (or rather what I considered duplicates—which obviously disagreed with the SPList equal operator).  The following generated my UNIQUE list. Notice the .Exists for the generic.

List listSPList = new List();

foreach(SPList list in lists) //lists definition is not shown, but you get the idea

{

  bool blnSPListInList = listSPList.Exists(delegate(SPList listtocompare) { return listtocompare.ID == splist.ID; });

if (!blnSPListInList)

  listSPList.Add(splist);

}

The .Exists part of the code above determines if the List contains a SPList with an ID of list.ID. This is my definition of equivalent. If there isn’t, then add the list to the List.

Of course it doesn’t end there. There are a number of other methods you can 'override' as I have done here. For instance, want a custom sort for your List, then ‘override’ the Sort method. Enjoy the fun.

Tags:c#

 

Security Update for Microsoft Visual Studio 2005 Service Pack 1 (KB937061) installs successfully but keeps being offered by Windows Update

September 12, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

So I install Security Update for Microsoft Visual Studio 2005 Service Pack 1 (KB937061) and immediately thereafter it appears as needing to install in my automatic updates. I install it again, and again and again and then I think something must be wrong. Well, it turns out there is something wrong. 

Doing some research on the interest I see a posting to Microsoft forums that states the following from Eric Brodish:

If you have VS 2005 SP1 present but the Crystal Reports feature is not present, MS07-052 is re-offered.

Customers are protected and are not at risk to this vulnerability

We will be updating the detection on Microsoft Update, customers that have already installed this update need to take no action.  We are working to resolve this issue and it should be fixed shortly

So, until it is “fixed shortly” I will turn off automatic updates. HOWEVER the update caused the following error to be ever so prevalent in VS2005 “The CurrentContext property of the LicenseManager is currently locked and cannot be changed.“. WTF. Where is the quality control?  So I go to Add/Remove programs, click the checkbox that says show updates and then remove the update in question. 

 

Setting up Visual Studio Code Name "Orcas" Beta 1 Team Suite (Virtual PC version)

June 25, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I wanted to setup the Orcas VPC so that I could develop some prototypes. MS gives you these VPCs for free, but there are a couple things you need to do to connect the dots.

It was super obvious how to modify the associated VMC file to match the file path I put the VHD in...as anyone who has used Virtual Server would know. However, I encountered one main issue when trying to set this up:

The parent virtual hard disk "E:\VPC\TimeBombedBase\Base01.vhd" for the differencing virtual hard disk "G:\Projects\Virtual Server\vmOrcasBeta1\OrcasBeta1VSTS.vhd" does not exist.

The problem was that I needed to download the base, and if I read the instructions I would see that it can be found here: http://download.microsoft.com/download/5/4/9/5499b008-8ae7-46f0-89ae-aeeb18df67ae/VSCTPBase.exe. But honestly, who reads through all those instructions. Obviously it would have soooo much more helpful to list this file in the Files in This Download section instead of burying it in the instructions that very few people read? Any way, let me continue...

What isn't described in the instructions but perhaps should is how to link this base VHD to OrcasBeta1VSTS.vhd in Virtual Server. From the Virtual Server Left Nav, go to Virtual Disks group and then select Inspect. Select the Orcas VHD in the drop down and then click the Inspect button. This page allows you to modify the parent virtual hard disk(s) and therefore specify any path for the Base01.vhd.

Two additional things to note:

  1. The default memory allocation is 300 or so megs. Ouch. Might want to raise that to atleast 1 gig before you fire up the image.
  2. The username is 'Administrator' and the password is 'P2ssw0rd'. That is a zero in the password.

 

Curious about Lorem Ipsum?

June 24, 2007 · Posted by Jason Nadrowski
0 Comments· 0 Links to this post

Tags:General

 

SharePoint 2007 workflow failed to start

May 25, 2007 · Posted by Jason Nadrowski
0 Comments· 0 Links to this post

The two most common reasons why one would receive “<my cutely named workflow> failed to start” in SharePoint are:

  1. The workflow definition is invalid.  The quickest way to check this out is to make sure you have completely exited SharePoint Designer (SPD) and THEN run SharePoint designer and THEN try to edit and resave the workflow in question.  SPD won't let you resave an invalid workflow and should give you an idea of what the problem is.  One such scenario is that activities that were valid or had a certain XOML format to them are now invalid or have a different XOML format.  This can happen if you are messing around with the web.config, .actions file(s) or are building your own custom workflows. 
  2. Security configuration error.  I start my discussion by wishing the SharePoint workflow team was more descriptive as with the error message so that someone would know what element caused the failure.  Trying to debug the security configuration is problematic.  The default install of SharePoint 2007 sets the web site's application pool to an identity of network service.  I have found it interesting that changing the identity of the application pool to a user with administrative rights can cause the workflow to “fail to start“.  If this sounds like something you've done, try changing it back to network service and try running the workflow again.  You might want to try creating a new web site through the SharePoint central admin web site and through that process create a new application pool with a specified identity. 

 

Upgrading my Series 2 Tivo to a bigger hard disk via a bootable USB thumb drive

May 1, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

My Series 2 Tivo came with an 80 gig drive and I wanted to expand its capacity and use a 120 gig drive I had lying around.  Normally, this process is well documented if you have a motherboard with 2 IDE controllers.  However, newer motherboards typically have only 1 IDE controller since they have a million SATA ports.  Furthermore, this computer has drives formatted as NTFS which made them essentially inaccessible via the traditional MFS Tools or the WeaKnees upgrade methods to “pivot” the drives—i.e. backup to the computer’s existing HD, turn off and replace the old tivo drive with the new tivo drive, and then restore the old tivo data from the computer’s existing HD.  As mentioned earlier, the ideal solution of leveraging a 2 IDE controller system is well documented.  What I needed to do was to boot off a USB thumb drive (in lieu of a bootable CD/DVD) which would allow me to have the old Tivo HD and the new Tivo HD running on my side IDE controller. 


The process was as follows:

  1. Install the new tivo hard drive as the master and the old/existing tivo hard drive as the slave.  When booting in Linux with only one IDE controller, the new tivo hard drive is addressed as hda and the old/existing hard drive is addressed as hdb. 
  2. Download and install the HP USB Disk Storage Format Tool (http://h18000.www1.hp.com/support/files/serveroptions/us/download/20306.html). 
  3. Format your USB Thumb drive with the HP tool.  Select FAT for the file system.
  4. Download the latest version of Syslinux (http://syslinux.zytor.com/download.php) and unzip to any temporary folder.
  5. In the temporary Syslinux folder, change to the win32 subdirectory and run “syslinux.exe –f X:” from the command line.  Note that “X:” is the drive letter for your USB thumb drive.
  6. Download the Mfs Tools boot CD (see Hinsdale instructions for the one that applies to you - http://www.newreleasesvideo.com/hinsdale-how-to/index9.html) and unzip the contents to your USB drive.  
  7. On the USB thumb drive, copy all the files located in the “ISOLINUX” folder to the root.  Then rename the files located at the root, ISOLINUX.BIN and ISOLINUX.CFG to SYSLINUX.BIN and SYSLINUX.CFG respectively.  When booting off the thumb drive, the boot loader SYSLINUX expects to find X:\SYSLINUX.BIN and X:\SYSLINUX.CFG.  If they aren’t there, it won’t boot properly. 
  8. Modify SYSLINUX.CFG so that BOTH append lines look like this: “append hda=bswap hdb=bswap hdc=bswap hdd=bswap”.
  9. Configure your bios to boot off the USB thumb drive and then boot off the thumb drive.
  10. Hit enter a couple times when prompted during the boot.
  11. Ignore the error message about /dev and the one about the /cdrom. 
  12. Execute “dd if=/dev/hdb of=/dev/hda” at the command line.  This can take a lot of time.  It took about 2 hours for me and I was running on an AMD X2 4600 with 4 gigs of ram.  There is no status information so the only way you know it is working is to look at the hard disk activity light. 
  13. Execute “mfsadd –r 4 –x /dev/hda” at the command line.  According to the Hinsdale instructions, this does not preserve recordings.  However, it did for me.  My recordings were preserved and played back just fine. 
  14. Stick the new Tivo drive into your Tivo and then go to system information to see what the new estimated amount recording time is. 

It should be noted that I found the following URLs helpful:

  1. How to run Linux on a USB Drive (http://www.althack.com/2006/03/10/how-to-run-linux-on-a-usb-drive/).
  2. Hinsdale How-to Tivo upgrade (http://www.newreleasesvideo.com/hinsdale-how-to/index9.html).
Tags:Tivo

 

SharePoint 2007 Solution Deployment and Retraction Bug Comes an Hour Early this Year (Daylight Savings Time Bug)

March 12, 2007 · Posted by Jason Nadrowski
0 Comments· 0 Links to this post

There seems to be an issue with SharePoint 2007 and DST when you perform solution operations (Central Admin-> Operations -> Solution Management).  It seems when I try to retract a particular SharePoint just sits there and tells me it is in process.  20 minutes later it is still sitting there.  Usually it takes 5 seconds, so something is definitely wrong. 

From trial and error, it turns out that if I set my SharePoint computers to NOT use day light savings time everything works great.  Otherwise they just sit there.  I am guessing this has something to do with the SharePoint timer service and it not understanding DST has come early this year?

 

Why XP is better than Vista

March 8, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

I had been running Windows 2003 Server on my laptop for quite a while.  Obviously W2003 is significantly slower than XP.  The reasons for having W2003 on my laptop instead of XP no longer exist, so I thought what a great idea to switch to Vista.  The idea was that Vista is an upgrade to XP and since XP is substantailly faster than W2003, Vista would be faster than my current install of W2003. 

BOY WAS I WRONG.  VISTA IS A COMPLETE DOG!  I have 1.5 gigs of Ram on my Sony A290 laptop and performance was bordering on totally unresponsive.  It was severely interfering with my productivity.  I couldn't take it anymore so I removed Vista and put XP on my laptop.  It was painful to once again install XP and all the other apps I need, but the performance was completely unacceptable.  To put this in perspective, try running XP with an Intel 386 and 64 megs of memory.  Yes, it really was that bad. 

Vista had some “neat” features such as XAML support.  As for the UI, I'd say it was a slight improvement.  I wasn't blown away like the MS “WOW“ comercial would lead you to believe.  I did laugh at the Mac “Approve or Deny” commerical after myself going through the Vista pop-up approve or deny administrative action again and again.  It is funny because it was so true. 

I am sure I will have Vista on some future laptop, but that day is atleast a year away.  I will probably wait until there is a laptop that uses a AMD quad core chip.  I am not kidding, Vista is very slow. 

I can only wonder what sort of performance Longhorn will have? 

Tags:Vista

 

Sony Vaio SZ laptop electric shock...

February 6, 2007 · Posted by Jason Nadrowski
0 Comments· 0 Links to this post

There is a slight electric shock comming from my sony vaio vgn-SZ360 laptop.  It happens when I have it plugged into the wall with the AC adapter.  To prove this point, Glenn Moller found that there was between a 1.5v and 3.0v comming off the metal surface of the laptop -- see picture. 

The solution?  I called Sony @ 888.476.6972, selected repair, and kept saying “represenative” until the automated system gave up trying to route me to either (a) find my nearest authorized repair fascility or (b) check on an existing repair.  I told them my problem and they sent me a new AC adapter...which worked great!  The new AC adapter has three plugs (instead of my old two plug adapter). 

It should be noted, that I tried another adapter I had from an older sony laptop (same voltage as SZ adapter and had two plugs) and that had exactly the same problem.  I therefore assume the third plug is necessary to properly ground the computer. 

Tags:General

 

Creating Publishing Site Definitions with SharePoint 2007

January 29, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

There are a number of resources describing how to create site definitions for SharePoint 2007.  I have found the following to be very helpful:

http://www.sharepointblogs.com/tbaginski/archive/2006/05/31/8013.aspx
http://thorprojects.com/blog/archive/2006/12/08/608.aspx
http://msdn2.microsoft.com/en-us/library/ms476046.aspx

One of the challenges with Master pages in SharePoint is that they work slightly different than they do for the team site (STS) versus the publishing templates.  In fact, the the comments on the SharePointBlogs.com link above have a number of questions on how you can use master pages with the publishing templates.  The secret is to essentially duplicate the “Publishing Layouts” feature that the publishing templates employ.  In my own case, I created a solution package that had my custom feature “MySiteDefinitionPublishingLayouts” and my custom publishing site definition.  This way, I could deploy them at the same time.  Then, the site defintion will need to list that custom feature as a SITE feature (not web feature) that needs to be activated for your particular site defintion. 

The other challenge, that I haven't solved just yet, is the secret to understanding the AvailableWebTemplates key so that users can only create only certain subsite definitions templates.  The only example I have to go on specifies a single available subsite site defintion template--which is part of the blankinternet site defintion.  It is shown below.  If anyone figures out the notation to list TWO, or more please email me. 

<Property Key="AvailableWebTemplates" Value="*-BLANKINTERNET#2"/>

 

UPDATE: According to this thread, the solution is: http://forums.microsoft.com/TechNet/showpost.aspx?postid=1510418&siteid=17

 

-----

Hi Jason

 

I don't know if you have found the solution,   Bernado in this this link sugest

<Property Key="AvailableWebTemplates" Value="*-[siteDef];*-[siteDef],*-[siteDef]"/>
like this

<Property Key="AvailableWebTemplates" Value="*-STS#0;*-STS#1"/>

 

I have a similar problem with AvailablePageLayouts, I can't find a way to allow more than one pagelayout.

 

Regards

Christian

---

If you look at the search site template you will notice that it uses following syntax:

<Property Key="AvailablePageLayouts" Value="~SiteCollection/<site collection relative path1>:~SiteCollection/<site collection relative path2>:~SiteCollection/<site collection relative pathX>"/>

 

Good luck!

Renatas.

 

How to specify which list(s) to create with your site definition

January 26, 2007 · Posted by Jason Nadrowski
1 Comment· 0 Links to this post

Some of the list types have changed between SharePoint 2003 and 2007.   You create a list in your site definition with the List element. 

<List FeatureId="00BFEA71-5932-4F9C-AD71-1557E5751100" Type="1100" Title="Issues" Url="Lists/Issues" />

When specifying which lists to create with your site definition, you need to look up the FeatrueId and Type of the list.  The FeatureID can be found in the Feature.xml file (i.e. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\IssuesList\Feature.xml).  The Type can be found in the ListTeamplates\*.xml file (i.e. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\IssuesList\ListTemplates\issues.xml).  The following table summarizes the various feature [lists] and their type. 

See C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\sts\xml\onet.xml for a real example. 

 

Feature

Feature Internal Name

Type

Announcements

announce

104

Contacts

contacts

105

CustomList

custlist

100

BizAppsListTemplates

KPIList

432

DataConnectionLibrary

dcl

130

DataSourceLibrary

datasrcs

110

DiscussionList

discuss

108

DocumentLibrary

doclib

101

EventsList

events

106

GanttTasksList

gantt

150

GridList

gridlist

120

IPFSWebFeatures

IWConvertedForms

10102

IssuesList

issue

1100

LegacyDocumentLibrary

doclib

101

LegacyDocumentLibrary

doclib

200

LinksList

links

103

NoCodeWorkflowLibrary

nocodewf

117

PictureLibrary

piclib

109

Publishing

Pages

850

ReportListTemplate

ReportList

433

SlideLibrary

sldlib

2100

SurveysList

survey

102

TasksList

tasks

107

TransMgmtLib

TransMgmtLib

1300

TransMgmtLib

xlatelist