Posts

Using PDB (Debug Symbols) When Compiling in Release Mode

Image
Bit by yet another not-so-well documented "feature" in Microsoft .Net.  We were compiling in release mode for QA, since we've seen other behavioral differences between debug and release.  We also wanted to emit the line numbers in the stack trace so the engineers would have a better idea of what caused the error.  We added the /degub:pdbonly option, but left the /optimize+.  We noticed that some of the errors when compared to the line numbers didn't make sense.  It turned out that most of the stack trace was wrong... or at least wrong when compared to the original source code. If you want to emit debug symbols, ie. pdb files, when compiling in release mode, you have to disable optimizations.  Compiler optimizations will often reorganize instructions for the most efficient execution.  As a result, any stack trace will produce unexpected line numbers... you'll get the line number in the newly optimized code, not the line in your original source code. ...

Unsigned Integers in SQL Server, Oracle, MySQL, Postgres, and DB2

A recent project required the need to store an unsigned 64-bit integer in a SQL Server database table. BIGINT won't cut it because BIGINT has a max value of 9,223,372,036,854,775,807 (signed 64-bit integer), and the unsigned 64-bit integer's max value is 18,446,744,073,709,551,615.  The solution is to use NUMERIC(20) instead. I recalled that other DBMS's do support unsigned integers as integer types vs. coercion with numeric, so I decided to compare a few of them and document them here. DBMS Unsigned 64Bit Unsigned 32Bit Unsigned 16Bit SQL Server (as of "Denali") numeric(20) numeric(10) numeric(5) Oracle (as of 11g) number(20), numeric(20) number(10), numeric(10) number(5), numeric(5) MySQL (as of 5.x) bigint, numeric(20) int, numeric(10) smallint, numeric(5) Postgres (as of 9.x) numeric(20) numeric(10) numeric(5) DB2 UDB (as of 9.x) numeric(20) numeric(10) numeric(5)

Hypervisor and Host Upgrade at Milestone

It was time to upgrade the virtual machine host at Milestone.  Since most of our critical systems are hosted, the server(s) here didn't need to be anything to extreme.  The servers in house are development and test lab related.  The goals for the upgrade were to: Upgrade the hardware Go Green Experiment with various hypervisors to see which ones can be used in SOHO environments with low investment, low TCO, high ROI, and little or no headache when it comes to install and maintenance. Hardware Selection I first took a look at Apple's Mac Mini and Mac Mini Server.  These machines are certainly an upgrade from what I have and meet my green requirement with a mier 85W max power consumption, but they only have a dual core processor.  In most cases, I would say they are perfect for the SOHO environment.  Because we would be spinning up several virtual machines, I wanted to kick it up a notch.  I was also concerned about the availability of drivers with t...

Installing CentOS/RedHat 5.5 on Hyper-V Server 2008 R2

CentOS/Red Hat 5.5 on Hyper-V R2 seems to work quite well.  The trick is to download the Linux Integration Services from Microsoft and follow the install guide before creating the VM.  The guide provides specific installation guidelines for creating/configuring the VM and installing the OS itself. At the time of this writing, the latest version can be found here: Linux Integration Services v2.1 for Windows Server 2008 Hyper-V R2 http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eee39325-898b-4522-9b4c-f4b5b9b64551&displaylang=en ...but please be sure you download the latest version at the time of your reading this. Creating The Virtual Machine When creating the virtual machine, use the "Legacy Network Adapter" .  To reduce any issues, I recommend making this the only network adapter configured.  CentOS, actually, any non-windows server OS or Windows versions prior to 2003, will not see the virtual "Network Adapter" until integration services are...

Installing MySQL 5.5 on Mac OS X 10.6

Or should I say "unable to install MySQL 5.5 on Mac OS X".  My first attempt at installing MySQL on Mac was with MySQL 5.1 on Snow Leopard.  That worked as expected and without any issues.  MySQL 5.5, however, was a bit tricky. After the install, I got this error on start up: 101224  9:50:00 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. MySQL is not started at this point, so running mysql_upgrade also fails (not that there is anything to upgrade, it's a fresh install). Viva la Google!  After a little digging on Google (ok, a lot of digging), I found this article in the MySQL forums: MySQL Forums :: Install :: Unable to install MySQL 5.5.8 on MacOS 10.6 http://forums.mysql.com/read.php?11,399397,399606#msg-399606 Worked like a charm! So, the complete steps: Download the dmg and install per the reference manual:   http://dev.mysql.com/doc/refman/5.5/en/macosx-installation-pkg.html Edit: /usr/local/mysql/supp...

Identifying Datastores Configured in VMware Server 2.0

I ran into the need to start a VMware Server 2.0 virtual machine from the command line.  The vmrun command uses the data store name to locate the vmx file. Unfortunately, the system documentation wasn't readily available, so I needed to determine what stores were configured. There are a few ways to do this: At the command line as root: vmware-vim-cmd hostsvc/datastore/listsummary This will list all datastores in inventory on the host.  And... vmware-vim-cmd vmsvc/getallvms ... will list all vms in inventory on the host, noting the datastore name and path to the vmx file. The caveat to that is you need to be running the command as root.  If you're security conscious like I am, then ssh (how I was connecting the the headless host) doesn't allow root access, even doing an "su" won't work.  So unless you've given permissions to a non-root user to access the certificates and configs, the command line utility won't work.  So now what?  Well, thankfull...

Simulating Latency and Bandwidth Restrictions in WCF

Image
If you're developing WCF applications that will run over a WAN, VPN, or the public internet, then network bandwidth and latency is a concern. Messages take longer to transmit over these networks than over your local area network (LAN). As such, part of your development and testing needs to include testing the application over these typed of "slower" connection. To perform this testing there are two main options:  have a connection at your disposal, or simulate one.  Most of us will probably have to simulate one.  There are a few projects out there that are basically bridges, typically linux based, that you put between your client and server that allow you to simulate these slower connections. If you are a Java developer, you're probably familiar with JMeter. JMeter's approach doesn't involve a bridge, but rather simulates the latency at the client. I was chatting with Peter Lin, a friend, colleague, and JMeter committer, about it one night. After he mentio...