mike-obrien.net Curriculum Vitae Blog Labs
Tuesday, October 09, 2007

I love WiX, but I hate that you have to specify the id's and short filenames! This really slows you down when you have a lot of files to add. I have read that these may be optional in v3 and auto generated by the compiler. Until then you could use this Visual Studio addin that that allows you to randomly generate and insert id's and short filenames as well as insert some common tags with the aformentioned attributes randomly filled in. n-joy!

Visual Studio 2005

Installer: WiXHelperAddin.EXE (217.21 KB)
Source: WiXHelperSource.zip (258.91 KB)

Visual Studio 2008

Installer: WiXHelperAddin2008.EXE (217 KB)
Source: WiXHelperSource2008.zip (63.89 KB)

PS: Also, check out the GUID inserter (Which also appears in the image below...); this is very helpful for WiX development!

image

Tuesday, October 09, 2007 1:41:54 AM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  | 

I do this often enough to forget how to do it (And where I've seen how to do it!). Rick Strahl has a nice post about adding icons to custom Visual Studio addins; the about box icon and the icons that appear in menus.

http://www.west-wind.com/WebLog/posts/3862.aspx

Tuesday, October 09, 2007 12:42:59 AM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  | 
Tuesday, September 18, 2007

Here is a simple method to invert an HTML color:

private static string InvertHTMLColor(string htmlColor)

{

htmlColor = htmlColor.Replace("#", string.Empty).Trim();

if (string.IsNullOrEmpty(htmlColor) || htmlColor.Length != 6)

     throw new ArgumentException("Invalid HTML color.");

return string.Format("#{0}{1}{2}",

     InvertChannel(htmlColor.Substring(0, 2)),

     InvertChannel(htmlColor.Substring(2, 2)),

     InvertChannel(htmlColor.Substring(4, 2)));

}

private static string InvertChannel(string channel)

{

channel = channel.Trim();

if (string.IsNullOrEmpty(channel) || channel.Length != 2)

     throw new ArgumentException("Invalid color channel.");

int a = int.Parse(channel.Substring(0, 1), System.Globalization.NumberStyles.HexNumber);

int b = int.Parse(channel.Substring(1, 1), System.Globalization.NumberStyles.HexNumber);

return (255 - ((16 * a) + b)).ToString("X");

}

.NET | C#
Tuesday, September 18, 2007 4:26:53 PM (GMT Standard Time, UTC+00:00)  #   |  Comments [1]  | 
Tuesday, August 21, 2007

Attached is the source for a simple TCP proxy server. I whipped it up pretty quickly so it probably needs some refactoring if you plan to use it in production. The server class is loosely based on the Cassini implementation. You can set the listen port and forward host/port in the app config:

<configuration>

    <appSettings>

        <add key="listenPort" value="443"/>

        <add key="forwardHost" value="wush.net"/>

        <add key="forwardPort" value="443"/>

    </appSettings>

</configuration>

image

TCPProxy.zip (24.81 KB)
Tuesday, August 21, 2007 5:42:09 PM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  | 
Thursday, July 26, 2007

Ahhh! I finally got my 3.091 Into to Solid State Chemistry textbook. Its a pretty big book so I'll probably break my back trying to carry it on the train each day. In any event the COOP has a few of these left and from what I hear the book will change for next semester. So anyone following the OCW might want to order one before they run out. These are custom books from Wiley, specially for 3.091, so you cant get these at Borders or any chain store... I have no idea how different the book will be next semester but it may be different enough were you cant follow the OCW. The COOP is selling used copies for $84.

Thursday, July 26, 2007 10:11:01 PM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  | 
Tuesday, July 24, 2007

Nomenclature is contrasted with the tale of Romeo and Juliet:

Romeo: Shall I hear more or shall I speak at this?
Sadoway: Fellas, when this opportunity comes up don't say a word... Don't interrupt! Romeo wisely takes that path...

...

Juliet: What's in a name? That which we call a rose by any other word, would smell as sweet. So Romeo would, were he not Romeo called, retain that dear perfection which he owes without that title. Romeo, doth thy name! And for that name, which is no part of thee, take all myself.
Sadoway: That's an offer...

In Chemistry, names are important. They must be agreed upon by consensus so that we know what each other is talking about. Sadoway also contrasts a lack of agreement to Alice in Wonderland where the characters give words the meaning they intend.

Chemistry possibly had roots in ancient Egypt with embalming of the dead. These chemical processes were referred to in hieroglyphics as khemeia (Key may uh ?). The Egyptians where very keen on preserving the dead for their afterlife journey so those who knew how to employ these chemical processes of embalming were greatly valued. This later expanded to dying of cloth, making of colored glass and metals extraction.

400 BCE, Chemistry begins to move from "craft to science" with Democritus, a Greek Philosopher. At that time only about 9 discreet elements (found in nature) were known (Fe, Cu, Ag, Au, Hg, C, Sn, Pb, S). (Interesting side point; where do we find pure elemental iron in nature {Not Hematite, Fe2O3}? Meteorites...) So with only this information Democritus stated that the physical world is made up of VOID + BEING. He also stated that being is made up of an infinity of "atoms" (From the Greek word atomos which means 'indivisible', a {not} + tomo {divisible}) which are small particles that are indivisible. His description of void is strikingly similar to vacuum as we know it today. Sadoway says "That takes us right up to E=mc2!"

Unfortunately, this fairly accurate description of the physical world by Democritus is supplanted by Aristotle's view of the 4 essences (Or elements); Fire, Earth, Water & Air.

image

Combinations of these can produce compounds such as "dry", a combination of "fire" & "earth". Sadoway says "This is nuts!! This is nuts!! This is so stupid it defies description!". The fifth essence, that which comprises the heavenly bodies, can be obtained by distilling any of the 4 essences. This was the "scientific" view up through the middle ages.

As time went on however more elements were discovered. And they were characterized by their properties. Now we are getting back to science.

1776: H, Fe, Co, Ni, Cu, Zn, Ag, Pt, Au, Hg, C, N, O, P, S, As, Sn, Sb, Pb, Bi

The first characterization of the elements came from John Dalton who created a listing of the elements in 1803 where he assigned symbols and sorted the elements by atomic mass. 

image

Tuesday, July 24, 2007 4:21:07 AM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  | 
Thursday, July 19, 2007

I will be posting my lecture notes from the Fall 2005 3.091 lectures (Introduction to Solid State Chemistry, MIT). Mainly I will be doing this for my own benefit, as expressing something you just learned helps with retention and comprehension, but maybe others will find them helpful as well. I will only be including notes relevant to the subject, not any auxiliary info (viz. administrative info). As I post notes they will be linked to in the following table.

Lecture 1 Vision Statement, Administrative Details. Introduction. Taxonomy of chemical species. Origins of modern chemistry. Reading : Ch. 1.
Lecture 2 Classification schemes for the elements. Mendeleyev and the Periodic Table. Atomic structure. Reading : Ch. 1, Ch. 2, Appendix A, Elemental Bibliography . 
Lecture 3 Rutherford model of the atom, Bohr model of hydrogen. Reading : Ch. 3.1, 3.5-3.8 (text); LN 1, pp. 2-5 (archives).
Lecture 4 Atomic spectra of hydrogen, matter/energy interactions involving atomic hydrogen. Reading : Ch. 3.3, 3.4, 3.9, 3.10 (text); LN 1, pp. 5-16 ( archives ), Cecilia Payne.
Lecture 5 The Shell Model (Bohr- Sommerfeld Model) and multi-electron atoms. Quantum numbers: n, l, m, s. Reading: Ch. 3.2, 3.10-3.12, 3.15-3.18 (text); LN 1 (archives ). 
Lecture 6 De Broglie , Heisenberg, and Schrödinger. The Aufbau Principle, Pauli Exclusion Principle, and Hund's Rules. Photoelectron Spectroscopy. Average Valence Electron Energy. Reading : Ch. 3.24, 3.25, 5.1-5.7, 5.10 (text); LN 2 ( archives ). 
Lecture 7 Octet stability by electron transfer: ionic bonding. Properties of ionic compounds: crystal lattice energy. Reading : Ch. 5.1-5.7, 5.10 (text); LN 2, pp. 1-12 (archives).
Lecture 8 Born- Haber cycle. Octet stability by electron sharing: covalent bonding. Lewis structures. Hybridization. Reading : Ch. 4.1-4.7, 4.10-4.12, 4.17 (text). 
Lecture 9 Electronegativity , partial charge, polar bonds and polar molecules. Ionic character of covalent bonds, Pauling's calculation of heteronuclear bond energies. Reading : Ch. 5.7, 5.10, 4A.1, 4A.3 (text).
Lecture 10 LCAO MO, Energy Level Diagrams for H 2 , He 2 , Li 2 . Hybridization, double bonds and triple bonds, paramagnetism and diamagetism . Reading : Ch. 4A.1-4A.4, 14-4-14.6, 8.2, 8.9 (text); LN 2, pp.12- end (archives).
Lecture 11 The Shapes of Molecules, Electron Domain Theory, Secondary Bonding. Reading : Ch. 4.14, 4.15 (text).
Lecture 12 Metallic Bonding, Band Theory of Solids ( Heitler and London ), Band Gaps in Metals, Semiconductors, and Insulators, Absorption Edge of a Semiconductor. Reading : Ch. 5.9-5.11, 9.4 (text); M.12 (modules); LN 2, pp. 25-26, LN 3 ( archives ).
Lecture 13 Intrinsic and Extrinsic Semiconductors, Doping, Compound Semiconductors, Molten Semiconductors. Reading : M.12 (modules); LN 3 ( archives ). 
Lecture 14 Introduction to the Solid State , the 7 Crystal Systems, the 14 Bravais Lattices. Reading : 9.6-9.12 (text), M.1-M.4, M.8 (modules); pp. 3-11 (supplement); LN 4 ( archives ).
Lecture 15 Properties of Cubic Crystals : simple cubic, face-centered cubic, body-centered cubic, diamond cubic. Crystal coordinate systems, Miller indices. Reading : 9.6-9.12 (text); M.1-M.6 (modules); pp. 3-23; 150-155; 167-174 (supplement); LN 4 (archives).  
Lecture 16 Characterization of atomic structure: the generation of x-rays and Moseley's Law. Reading : pp. 139-141; 144-149; 175-181 (supplement); LN 5, pp. 1-9 ( archives ). 
Lecture 17 X-ray spectra, Bragg's Law. Reading : pp. 26-31; 186-191 (supplement); LN 5 (archives). 
Lecture 18 X-ray diffraction of crystals: diffractometry , Debye-Scherrer , Laue . Crystal symmetry. Reading : pp. 26-31 (supplement); LN 5 ( archives ). 
Lecture 19 Defects in crystals: point defects, line defects, interfacial defects, voids. Reading : M.11 (modules); pp. 39-43, 47-53 (supplement); LN 6 ( archives ). 
Lecture 20 Amorphous solids, glass formation, inorganic glasses: silicates. Reading : 9.1, 9.2 (text); M.15 (modules); pp. 31-32 (supplement); LN 7, pp. 1-3, 5-9 ( archives ). 
Lecture 21 Engineered glasses: network formers, network modifiers, intermediates. Properties of silicate glasses. Metallic glass. Reading : 9.1, 9.2 (text); M.15 (modules); pp. 31-32 (supplement); LN 7, pp. 1-3, 5-9 ( archives ). 
Lecture 22 Chemical kinetics: the rate equation, order of reaction, rate laws for zeroth , first, and second order reactions. Temperature dependence of rate of reaction. Reading :10.1 -10.4, 14.1-14.8, 14.10, 14.11 (text); LN 8 ( archives ). 
Lecture 23 Diffusion: Fick's First Law and steady-state diffusion, dependence of the diffusion coefficient on temperature and on atomic arrangement. Reading : pp. 63-68; 85-95 (supplement); LN 9, pp. 1-6 ( archives ).
Lecture 24 Fick's Second Law ( FSL ) and transient-state diffusion; error function solutions to FSL . Reading : pp. 68-78, 95-101 (supplement); LN 9, all (archives). 
Lecture 25 Solutions: solute, solvent, solution, solubility rules, solubility product. Reading : 8.10-8.13, 8.15 (text); SOL.1-SOL.10 (modules).
Lecture 26 Acids and Bases: Arrhenius , Brønsted -Lowry, and Lewis definitions, acid strength and pH. Reading : Ch. 11 (text). 
Lecture 27 Organic chemistry: basic concepts, alkanes , alkenes, alkynes, aromatics, functional groups, alcohols and ethers, aldehydes and ketones , esters, amines. Reading : O1.1-O1.7, O1.10-O1.11, O1.13, O1.14, O2.1, O2.3, O2.4 (modules). 
Lecture 28 Polymers: synthesis by addition polymerization and by condensation polymerization. Reading : P.1-P.3, P.7-P.9 (modules). 
Lecture 29 Structure-property relationships in polymers, crystalline polymers. Reading : P.1-P.3, P.7-P.9
Lecture 30 Biochemistry: the amino acids, peptides, and proteins. Reading : BIO.1 - BIO.3; BIO.5
Lecture 31 Protein structure: primary, secondary, tertiary; denaturing of proteins. Reading : BIO.6, BIO.9. 
Lecture 32 Lipids: self assembly into bilayers . Nucleic acids, DNA, encoding information for protein synthesis. Electrochemistry of batteries and fuel cells. Reading : BIO.6, BIO.9.
Lecture 33 Phase diagrams -   basic definitions: phase, component, equilibrium; one-component phase diagrams.  Reading : pp. 103-113 (16.1 - 16.3) (supplement); LN 10 Part A 1-3 (archives).
Lecture 34 Two-component phase diagrams: complete solid solubility. Reading : pp. 103-113 (16.1 - 16.3) (supplement); Part B 1-9 (archives).
Lecture 35 Two-component phase diagrams: limited solid solubility. Lever Rule. Reading : pp. 113-119 (16.4) (supplement); LN 10 Part B 1-9 (archives).
Lecture 36 Wrap-up: closing remarks about 3.091. Student Course Evaluations.
Thursday, July 19, 2007 2:56:37 PM (GMT Standard Time, UTC+00:00)  #   |  Comments [0]  |