Windows 7 DhcpNodeType Is Still a Bummer: How I returned from teched09 to have a broken network

https://connect.microsoft.com/windows7/feedback/ViewFeedback.aspx?FeedbackID=452703

I use file sharing on my home network quite a bit. I don’t have a large hard drive in my laptop. I use network shares at home to watch video downloads (all Mix08, PDC08, Mix09 content!) and store some personal files.

I don’t use Active Directory. I don’t use Windows Servers. Why would I do that at home? I’m a home user after all.

Enter Windows Behavior Fail. I connected to exactly 3 wifi networks while I was away at TechEd09: TechEd, Comfort Inn, and t-mobile @ LAX. One of them used DHCP to force my node into Netbios Name Resolution point to point mode, rather than its normal hybrid mode. This means that instead of broadcasting for a netbios name, my client host would talk only to the specified WINS browser on the network.

Except I don’t have a WINS server on the network, which effectively disables Netbios Name Resolution. I came back home, plugged into (or Wifi connected, either way is the same) my home network, and I had no access to my file shares.

I’ll bet a Mac would never do this.

So, if you ever use Windows (not just if you call yourself a Windows user, mind you). Please click the link at the beginning of this post and beg Microsoft to change their behavior. I can understand disabling WINS while I am on a public WIFI. Heck, I might ever recommend it to some customers who have public WIFI, but for the setting to not revert after I am back on a different network which does not set this DHCP setting is simply unacceptable.

Of course, the network administrators work around is to forcefully set this DHCP setting to hybrid. That is fine for savvy network administrators, but it is NOT fine for the rest of us with Linksys routers doing the job of DHCP.

Incidentally, if you happen to run ISC DHCP (which I highly recommend), you can send this setting to your DHCP clients with this setting in your subnet block:

option netbios-node-type 8;

I hate to rant like this immediately after TechEd09 (which was an awesome event), but it was the most pressing issue on my return home.

RegexReplace in SQL Server

My last post was about SQL Server. Even 10+ years later, I’m continually amazed by features which are daily use features in MySQL and Postgresql which are missing from MS SQL Server.

Regular expression matching and replacing is a severely lacking feature.

Sql Server 2005 introduced a means to write user defined functions in .NET code, so this method is uploaded to a sql server and exposed as a function.

[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString RegexReplace(SqlString input, SqlString pattern, SqlString replacement)
{
    var result = System.Text.RegularExpressions.Regex.Replace(input.Value, pattern.Value, replacement.Value);
    return new SqlString(result);
}

 

Now you can use it in select statements.

SELECT        Name, dbo.RegexReplace(Name, N'(?:\d+-)?\d+PPM’, N”) AS e
FROM            Table2

 

Or use it to update tables

update table2 set name=dbo.RegexReplace(Name, N'(?:\d+-)?\d+PPM’, N”)

 

I have absolutely no idea how any database developer could live without this kind of functionality.

SQL Server Command Line Administration

I don’t have SQL Management Studio installed. Perhaps I should install it, it would make my life easier.

Here are the commands I used to create a new database and add myself to it as administrator. I want to own the database too. I don’t want to have to be sa (root for you mysql folk) just to be able to create tables. I want to delegate the ownership of this database instance (not the whole sql server) to a non-admin user. This is just for me, for dev on my laptop.

C:\>osql -E -S .\SQLEXPRESS -V 2 -Q "create database test2"
C:\>osql -E -S .\SQLEXPRESS -V 2 -Q "use test2;exec sp_changedbowner [theknife\jrwren]"
C:\>osql -E -S .\SQLEXPRESS -V 2 -Q "exec sp_configure ‘clr enabled’, 1"
Configuration option ‘clr enabled’ changed from 0 to 1. Run the RECONFIGURE
statement to install.
C:\>osql -E -S .\SQLEXPRESS -V 2 -Q "reconfigure"

Finding this set of commands was the must frustrating experience that I have had in a VERY long time. It made me long for Postgresql or MySQL.

Don’t mix ANY and x86 build and forget about it

you will get a very stupid error like this:

System.BadImageFormatException : Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format.

In my case, I was getting it in a TestFixtureSetUp method.

DUH. I had set the class library project to force to x86, because I’m on x64, but I wanted to use edit and continue. I never changed the Test project, so it was still running x64. It failed with a “BadImageFormatException” when it loaded the references x86 project.

Don’t be stupid like me.

Mix09 Downloadable Content – All Days

I’ve seen it posted a couple of times, now, but each post just shows a series of links which I am required to click. I’m not savvy enough to figure out plugins like “DownloadThemAll”, so I wrote this script.

The script throws all of the day one content into a directory called day1, but for days two and three, I thought it would add to the feeling of being there if I broke them out into time slots. Within the day2 and day3 directory there are directories for the start time of each session.

#these first sessions are snagged from: http://blogs.msdn.com/nigel/archive/2009/03/20/mix09-day-1-sessions-available-now.aspx
#day1
mkdir day1
pushd day1
#add key01 to this list if you want the keynote
for i in t66m t71m t25f t40f t19f c10f c24f t04f t41f t72m t65m c28m t12f t61f t79m t09f t05f b02m t46f t45f t24f b04m t43f c02f c12f c27m t38f t07f t14f t26f ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd

#the rest are snatched from : https://content.visitmix.com/2009/Sessions/
#missing from the above originally were t10f, c19f, t07f, t37f

mkdir day2
pushd day2
mkdir 10.30am
pushd 10.30am
for i in t17f c09f t52f c14f c04f c18f c08f t09f t84m t75m t76m
do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 1pm;pushd 1pm;
for i in t33f t51f t20f t56f t23f t31f t54f t01f b05m t85m b01m  ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 2.30pm;pushd 2.30pm;
for i in c05f t12f c01f c03f t28f t49f c22f t02f b03m t82m t74m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 4.15pm;pushd 4.15pm;
for i in t48f c21f t50f t13f c13f t60f c23f t03f t69m t86m t68m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
popd

mkdir day3
pushd day3
mkdir 9am;pushd 9am;
for i in t39f t59f t44f t42f t18f c17f t11f t06f t67m t78m t81m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 10.45am;pushd 10.45am;
for i in c20f t27f t62f t58f t29f c07f t35f c16f t63m t64m t80m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 12.30pm;pushd 12.30pm;
for i in t32f t55f t22f c26f t34f t36f t30f t16f c29m t77m c30m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd
mkdir 2pm;pushd 2pm;
for i in c15f t57f t47f t15f c06f c11f t87f t53f t83m t70m t73m ; do
        curlget http://mschannel9.vo.msecnd.net/o9/mix/09/wmv-hq/$i.wmv
done
popd

popd

You can grab this script here: http://workwith.net/scripts/mix09fetch.sh

It requires only a cygwin install with bash and curl.

Windows 7

I received an email from a local Unix/Linux user group email list this morning with a link to this “review” of Windows 7.

http://jhansonxi.blogspot.com/2009/02/linux-users-review-of-windows-7-beta.html 

These are my thoughts.

Having upgraded from Vista to Win7 beta, on 1.5yr old crappy hardware. I can assure you that many of the points in this "review" are absolute lies.

"Windows 7 Setup …Like in XP it is single-task based so that every partition edit is immediately applied while most Linux installers queue up a series of operations and then perform them in a batch"
is an absolute lie. Its as if the reviewer paid no attention to what he was doing.

"The installation and updates took a long time with several reboots"
Exactly the opposite of my experience. After answering all of the questions up front (see previous lies about the installer) on a Friday night, I went to bed and awoke to a rebooted, ready to use Windows 7. There was no login/reboot experience in the install.

The 2nd paragraph of section 2. Installation, the reviewer babbles on about his awesome Linux setup. And while I agree, all of those things are cool, they have nothing to do with a Windows 7 beta review. This gem hidden in that paragraph pretty much sums up the section: "I haven’t tried any of them but …".  Yeah, I can tell.

In section 3. Storage, he does point out some VERY good differences between LVM and RAID setup at install time in Windows 7 versus Linux.

In section 4. Encryption, He continues to trash BitLocker difficulties in installing. Honestly, this is a great detailed comparison of a feature that I’ve never known anyone to use.

In section 5, he fairly says, "I would have to use the superbar a lot to know if I like it better."

in section 6, he makes a bunch of totally irrelevant points like the lack of an office suite. He calls Windows Media Player 12 a "bloated fatware compared to foobar2000, Media Player Classic, and VLC (on Ubuntu I use Rhythmbox). That is cute, except that it is a total lie. WMP12 is awesome. It starts fast. It is still the only media player that does play speed adjustment well. Its only real comparisons on Windows are iTunes, which it smokes, and Winamp. Yes, I still use foobar2000 and Media Player Classic and VLC. Depending on which type of media I am playing back, I use all of the above. But one things that WMP12 is NOT is bloated. It is damn fast.

He continues to point out that DivX MPEG-4 code doesn’t ship with Windows 7. It’s a good true point. WMP doesn’t do a good job of resolving codec problems. Yes, that sucks. Man up and go grab ffdshow from sourceforge. http://ffdshow-tryout.sourceforge.net/ Do not use k-lite codec pack like he suggests. It actually replaces better codecs in the Direct Media codec configuration.

Finally he ends section 6 saying "There are several similar PVRs for Linux" when pointing out Windows Media Center. Seriously??? I think it would be better to just say "I’m stupid and I don’t know what I am talking about." If you have ever setup and run MythTV and compared it to Windows Media Center, you are seriously on drugs. There is no comparison. The ONLY valid comparison is the cost, and the hours you spend on WMC is easily worth the dollars spend on WMC. At least make the freetard "I am free to modify it" argument here. Because as far as functionality, there is no comparison.

In section 7 he confused WOW64 with 32bit and 64bit. I think he thought he was in the 32bit ODBC setup. It is easy to get confused here, because in 64bit windows, there is still a system32 directory, and worse, system32 contains 64bit binaries. There is also a SysWow64 directory, and it contains all the 32bit compatibility binaries. But again, it shows the ignorance of the reviewer. http://msdn.microsoft.com/en-us/magazine/cc300794.aspx

Same section, next paragraph, there is more ignorance, "The Jet engine is the abandoned offspring of the SQL Server team". Anyone even remotely familiar with the history of product groups at Microsoft knows that this is false.

Section 8 talks about UAC, PC Safeguard and parental controls, but does not really say anything.

I have no idea what Section 9 is even doing in a review article. It tries to make some security point and talks about some XDG security concern on Linux and tries to convince you that it is a concern on windows too with lnk files. Read the paragraph and see if you can find the attack vector. I can’t. Its definitely not email, because Windows 7 doesn’t ship with an email client. The suggested download email client, Windows Live Mail, doesn’t let you execute any attachments.

Section 10 starts off saying "I wanted to try recreating the common Linux practice of separating user files from the rest of the OS with /home as a mount point for a separate partition."  Guess what?  Windows isn’t linux. If you want to run Linux, run Linux. Do things the linux way. If you want to run Windows, do things the windows way. Any Windows administrator will tell you, don’t do what you are trying to do! There is this neat thing call the registry which exists in your home directory. Its not going to be portable across windows installs, so don’t bother with that separate home partition. If you want backups, use backups. A separate partition is not getting you anything here. No idea what the next 3 paragraphs have to do with a Windows 7 review.

Section 11 starts off talking about Homegroups, but doesn’t explain them. See the PDC keynote, and then read these two paragraphs and tell me what is wrong here. The 3rd paragraph attempts to describe Libraries. Again, see the PDC video example and compare to this paragraph.  The remainder of this section tries to declare these new features useless. Ok, I know I already use the Library feature. If you don’t like it, don’t use it. I also found another gem, "I think that when a file transfer occurs it’s done under the AlphaUser account and then the ownership is changed on arrival."  You think do you?  Shouldn’t you KNOW?

Still in section 11, I just had to address this comment, "A default install of Ubuntu doesn’t include SMB file sharing although it’s easily enabled by adding Samba." Yes, so true, and resetting every password for all of your users so that they can access the file share. That is fun to do every time, isn’t it? Again, the rest of this paragraph talks all about Ubuntu features, which is strange for a review of Windows 7.

Section 12 is the epilogue which I wish I had read first so that I didn’t waste my time feeling compelled to write this commentary. "Windows 7 beta seemed relatively stable but I wasn’t really installing much or putting it under continuous use." Yes, I can tell. You haven’t used it at all.

"I had a lot more problems with the initial release of Vista." Fair enough, it just happens to be the opposite experience I had. In fact, I have had almost no issues, at all. On what many would consider a more unstable configuration: I upgraded from Vista.

"I did manage to crash Explorer a few times without trying but this is a "beta" which is the equivalent to an "alpha" for most other software projects." WOW, did you use this thing at all? This "beta" is more like an RC3 for most other software project. I installed Win7 a month ago, on my ONLY computer. Not this VM in which you tested it. I use it every day, and it is the ONLY computer I use. I do 100% of all of my work on it.

"This is the reason why many system administrators wait until the first Windows service pack before mass deployments." No they won’t. They will flock to it because its far better than Vista.

"Some readers may get the impression that I’m against commercial software or closed-source." And he proceeds to give reasons why he is objective. I’ll never consider you objective. But I’ll definitely consider you looney and nuts and wacco.

Finally, my own comments: "Reviews" like this aren’t reviews at all. They are comparisons, and they are not valid comparisons. they provide absolutely no value to anyone. They portrait Linux as better. I love Linux. I use Linux daily — in a server environment. Comparisons like this suggest that Linux doesn’t need to improve or play catch up to Windows. I run Windows on my primary use computer laptop, the one I spend 10+ hrs a day at, because it is just plain better. Linux is better in so many ways, ways that this article touts. But Windows is also better in many ways. Depending on how you use your computer determines which ways are most important to you and which is a better choice. I think I just defined pragmatic in there.