Twitter - Mike SimonFacebook Mike Simon Linked In Mike Simon

Blogtastic - Your guide to the web.
RSS:
Show Top 20 Save View Preference
7/21/2010 12:50:58 PM
Tile Packing Problem AKA lw by area and ratio
Posted By: Mike
One of the interesting problems I've encountered in doing data visualization in Silverlight has been trying to find ways to dynamically group rectangles representing different bits of data into dynamically defined spaces. They do this to great effect with Microsoft Pivot, and when I started trying to figure it out, I looked all over the web.

The premise is a relatively straight forward geometry problem, of taking the number of rectangles you want to fit into another rectangle and dividing the total area of the containing rectangle (which you get through height*width) by the number of child rectangles. From there it got kind of tricky, especially if you want to use a dynamically defined ratio that didn't conform to the h/w ratio of the containing rectangle. It was solved with the formula below.

This post is mostly (like most here) a placeholder for something I know I'll probably come back to later. It will be useful to people trying to pull of a similar tile packing task (and probably no others).

Enjoy:

double height=1000;
double width=1200;
double itemcount=100;
double ratio = 0.6666666666666667;
double totalarea = height * width;
double singleArea = totalarea / itemcount;
double newcontrolwidth = Math.Sqrt(singleArea / ratio);
double newcontrolheight = newcontrolwidth * ratio;
 
4/19/2010 4:25:51 PM
Posted By:
Steps to install Secondary Alternative cert:



In IIS -> Directory security ->
Create new cert and save the text for the request somewhere you can find it.



Go to godaddy and select "rekey" option.
paste in the contents of the text file.



Download the new cert.



go back to IIS, complete the import.



Go into the Certificate MMC, import the downloaded cert into the intermediate certs.



run this from c:\inetpub\adminscripts
cscript.exe adsutil.vbs set /w3svc//SecureBindings ":443:"
 
3/2/2010 2:22:40 PM
Posted By: Mike
Silverlight project type will not load csproj.

Open csproj file and replace ProjectTypeGuids line with this one:

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
 
1/14/2010 2:39:27 PM
Outlook Check Names from Global Address List (GAL)
Posted By: Mike
One of my favorite features of outlook is hitting ALT-K when I type in names of co-workers in the TO list and have them automatically resolved for me by outlook. In outlook 2007, by default, it only resolves against my contacts list. I find this to be almost useful as I tend to store my contacts in my personal folders or leave them for later in Suggested Contacts. So when I went looking for it in tools -> options, of course it wasn't there anymore. After googling the hell out of this, I finally gave up, and then I found it.

Hidden deep on the UI, if you open the Global Address List, then click Tools -> Options, you're brought to the magical land where this can be set. Below where it says "When sending mail, check names using these address lists in the following order:", hit the Add button. Just below all the default selections is the Global Address List. Voila. Auto-name resolution from the GAL.
 
10/16/2007 12:37:43 AM
ce suo zai na lo
Posted By: Mike
means Where's the bathroom in Chinese.
 
8/24/2007 6:17:23 PM
FLASH AS3 - Add a Bitmap from the library
Posted By: Mike
Assume a Bitmap called Background1 exists in the library. The Library object functions as a BitmapData object for the sake of methods/parameters you can use in creating and manipulating it.

var bgimage:Background1 = new Background1(100,200);
var bg:Bitmap = new Bitmap(bgimage);
addChild(bg);