March 2005 Archives
Floating point math and NANs
What Every Computer Scientist Should Know About Floating-Point Arithmetic
The worst building on campus
"I once had an office -- a cubicle really -- in the physical-plant building of a major university. Gigantic machines rumbled all around me. My coffee mug sometimes vibrated off my desk. I used to pretend that I was an oiler in the engine room of the Lusitania. The room was well below ground level, and, during the rainy season, the entire floor would flood, sometimes to a depth of 18 inches. There were high water marks on the cinder-block walls from previous inundations. Mold ascended the fabric sides of my cubicle until, finally, it looked and smelled like a forest floor in the Pacific Northwest.
"After a couple of months -- and conversations with the other workers -- I learned that I could reach various points on the campus through underground steam tunnels. On my way back from teaching a class, I could pretend that I was Jean Valjean evading Inspector Javert in the sewers of Paris. My cubicle was so far from the center of campus that students rarely found me. Once, shortly after teaching Heart of Darkness, I asked one of my advisees "Are you an assassin?" And he said, without missing a beat, "No, I'm an errand boy sent by grocery clerks." We laughed for two minutes. It was the high point of my semester."
Tufte codified the design process into six principles:
- documenting the sources and characteristics of the data,
- insistently enforcing appropriate comparisons,
- demonstrating mechanisms of cause and effect,
- expressing those mechanisms quantitatively,
- recognizing the inherently multivariate nature of analytic problems,
- inspecting and evaluating alternative explanations.
In brief, "information displays should be documentary, comparative, causal and explanatory, quantified, multivariate, exploratory, skeptical."
Control to create intuitive wizards with little programming effort
XP Home to XP Professional networking
If your XP Pro machine has "Use simple file sharing" enabled, then the XP Home machine will authenticate as guest. You don't need to enable the guest account (in the User Accounts control panel) but you do need to edit the local policy to allow guest to access the computer from the network.
Local Policies->User Rights Assignment->Deny access to this computer from the network
If you don't have "use simple file sharing" enabled, then the user on the XP Home machine must have an account with the exact username and password on the XP Pro machine for it to authenticate to.
Also, enabling the Guest account in the control panel enables enables local logon for the Guest account. I don't think it enables network logon.
VBA code to query from MDB file
Sub foo()
Const cString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=g:\wwwroot\books.mdb;" +
"User Id=admin;Password=;"
Const sql As String = _
"SELECT p.asin, p.title, pt.description, p.text, p.imageURL " +
"FROM Products p, ProductType pt " +
"WHERE pt.productTypeId = p.productTypeId " +
"ORDER BY pt.description "
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Call conn.Open(connectionString:=cString)
Dim rs As ADODB.Recordset
Set rs = conn.Execute(sql)
While Not rs.EOF
Debug.Print rs.Fields("asin").Value
& ": " &
rs.Fields("title").Value
Call rs.MoveNext
Wend
Call rs.Close
Call conn.Close
End Sub
ASP.NET: Picking from double lists
Spy++ location
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\spyxx.exe
10 things I have learned
HOW YOU LIVE CHANGES YOUR BRAIN.
The brain is the most responsive organ of the body. Actually it is the organ that is most susceptible to change and regeneration of all the organs in the body. I have a friend named Gerald Edelman who was a great scholar of brain studies and says that the analogy of the brain to a computer is pathetic. The brain is actually more like an overgrown garden that is constantly growing and throwing off seeds, regenerating and so on. And he believes that the brain is susceptible, in a way that we are not fully conscious of, to almost every experience of our life and every encounter we have. I was fascinated by a story in a newspaper a few years ago about the search for perfect pitch. A group of scientists decided that they were going to find out why certain people have perfect pitch. You know certain people hear a note precisely and are able to replicate it at exactly the right pitch. Some people have relative pitch; perfect pitch is rare even among musicians. The scientists discovered - I don't know how - that among people with perfect pitch the brain was different. Certain lobes of the brain had undergone some change or deformation that was always present with those who had perfect pitch. This was interesting enough in itself. But then they discovered something even more fascinating. If you took a bunch of kids and taught them to play the violin at the age of 4 or 5 after a couple of years some of them developed perfect pitch, and in all of those cases their brain structure had changed. Well what could that mean for the rest of us? We tend to believe that the mind affects the body and the body affects the mind, although we do not generally believe that everything we do affects the brain. I am convinced that if someone was to yell at me from across the street my brain could be affected and my life might changed. That is why your mother always said, `Don't hang out with those bad kids.' Mama was right. Thought changes our life and our behaviour. I also believe that drawing works in the same way. I am a great advocate of drawing, not in order to become an illustrator, but because I believe drawing changes the brain in the same way as the search to create the right note changes the brain of a violinist. Drawing also makes you attentive. It makes you pay attention to what you are looking at, which is not so easy.
[WinZip Companion for Outlook 1.0]
Zip and attach in one step from within Outlook.
[Outlook addin to compress attachments]
bxAutoZip is an Add-In for Outlook and Outlook Express which automatically and independently compresses any e-mail attachments.
public string GenerateRandomString()
{
return System.Guid.NewGuid().
ToString().Substring(0, 7).ToLower();
}
