Tuesday, January 15, 2008

Signs of a Bad Boss (seen by me in the wild)

A certain someone at a certain company fit this to a T.

Bosses are supposed to ask themselves these questions:

1. Have you ever publicly criticized an employee?

2. Do you take credit for your employees’ work?

3. Do your employees fear you?

4. Do you expect employees to do what you tell them without question?

5. Do you believe employees should know what to do without you telling them or providing guidelines?

6. Are you a yeller?

7. Do you demean employees as a form of punishment?

8. Do you play favorites?

9. Do you hate delegating?

10. Do you check everyone’s work?

Friday, January 11, 2008

How to find files that are different between two git trees (working with git and, *gulp*, SourceSafe)

I do this a lot in my project. I change a bunch of files, and since I'm working with SourceSafe, I need to know which files to check out of SourceSafe so that I can replace them with the changed versions.

Use this command:
git diff-tree -r --name-status branch1 branch2
where branch1 is the branch I'm going to check into SourceSafe and branch2 is the upstream branch.

Example:
/c/Yellowstone.master
$ git diff-tree -r --name-status master POS-safe
M Databases/OpenBook/Alter Scripts/THE ONLY 2.2 ALTER SCRIPT YOU NEED.sql
M OpenBookSolution/HotL/DirectBillPaymentForm.cs
M OpenBookSolution/HotL/EditReservationForm.cs
M OpenBookSolution/HotL/NonGraphicalReserveForm.cs
M OpenBookSolution/HotL/OpenBook.cs
M OpenBookSolution/HotL/ReportForms/ReportSelectorForm.cs
M OpenBookSolution/HotL/SelectDirectBillAccountForm.cs
A OpenBookSolution/HotLOnly.sln
D OpenBookSolution/HotLOnly/HotLOnly.sln
M OpenBookSolution/Yellowstone.OpenBook.BusinessEntities/MonetariesBusinessEntity.cs

/c/Yellowstone.master
$
The basic procedure is:
  1. hack hack hack
  2. Get my tree in good shape, usually by rebasing my branch onto the SourceSafe tracking branch.*
  3. Run the diff-tree command above to find changed files.
  4. Check out those files. If there are any warnings from SourceSafe about the files being different (and not just writable), then do the following:
    1. Get latest from SourceSafe into the SourceSafe tracking branch (typically "master") in my project.
    2. Commit.
    3. Go back to step 2 above.
  5. Merge development branch into master. Sometimes I do this step a commit or three at a time instead of an en masse merge of the branch all at once.
  6. Check changed files back into SourceSafe.
*I realize that rebasing my development branch onto "master" probably isn't the wisest thing in the world, as it loses information -- specifically, the fact that I had branched the code. It was an interesting experiment, though. Perhaps I'll go back to merging again. Although the fact that we're using SourceSafe, which doesn't have the concept of a branch, probably means that what I'm doing isn't all that un-kosher.

The flavor of git I use is msysgit.

Linus clarifies "Central Repository" issue on git in a way palatable to managers

Linus was previously rather dogmatic about having no "official" version of a project. But here he's not quite so religious and explains how you can effectively satisfy those who would like a central repository. The distinction, he says, is social, not technical:
I certainly agree that almost any project will want a "central" repository
in the sense that you want to have one canonical default source base that people think of as the "primary" source base.

But that should not be a *technical* distinction, it should be a *social* one, if you see what I mean. The reason? Quite often, certain groups would know that there is a primary archive, but for various reasons would want to ignore that knowledge: the reasons can be any of ....

ExtJS javascript library

Tres cool!
"Ext (pronounced "extent"[citation needed]) is an open-source JavaScript library, for building richly interactive web applications using techniques such as AJAX, DHTML and DOM scripting.

Originally built as an extension of YUI, Ext can now also extend jQuery and Prototype. As of version 1.1, Ext can run stand-alone without relying on any of those external libraries, though they remain an option for integration.

Ext version 2.0 can now use many different base libraries (adapters) like YUI, jQuery, Prototype or it can work Stand-alone"

Tuesday, January 08, 2008

PyPy "dot" graph viewer (Python)

Referred to from this site: http://morepypy.blogspot.com/2008/01/visualizing-python-tokenizer.html:
"For debugging purposes I implemented a visualization tool for DFAs using PyPy's pygame-based graph viewer. The graph viewer is able to visualize interactively any graph given in the graph-description language of Graphviz. Looking at the tokenizing DFA for Python is rather instructive, both for understanding how tokenizing works and (maybe) for understanding the Python language. To try it, download the dot file of the DFA and run from a pypy checkout:
$ python pypy/bin/dotviewer.py tokenizer.dot
The following is a screenshot of the graphviewer: "

Monday, January 07, 2008

TCL: Creating Temporary Files

From the page:
"Tcl doesn't have a built-in command to create a temporary file and there are no built-in variables for temp directories, so you have to do a little work.

....

I had some luck with the following procedure on a UNIX box. Maybe, somebody can check if it works for windows.

 proc tempfile {prefix suffix} {
set chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
set nrand_chars 10
set maxtries 10
set access [list RDWR CREAT EXCL TRUNC]
set permission 0600
set channel ""
set checked_dir_writable 0
set mypid [pid]
for {set i 0} {$i < $maxtries} {incr i} {
set newname $prefix
for {set j 0} {$j < $nrand_chars} {incr j} {
append newname [string index $chars \
[expr ([clock clicks] ^ $mypid) % 62]]
}
append newname $suffix
if {[file exists $newname]} {
after 1
} else {
if {[catch {open $newname $access $permission} channel]} {
if {!$checked_dir_writable} {
set dirname [file dirname $newname]
if {![file writable $dirname]} {
error "Directory $dirname is not writable"
}
set checked_dir_writable 1
}
} else {
# Success
return [list $newname $channel]
}
}
}
if {[string compare $channel ""]} {
error "Failed to open a temporary file: $chanel"
} else {
error "Failed to find an unused temporary file name"
}
}

Igor Volobouev"

Thursday, December 27, 2007

sysobjects and Object Types in SQL Server

Object type. Can be one of these object types:

C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
FN = Scalar function
IF = Inlined table-function
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedure

Sunday, December 23, 2007

Slashdot English

"Re:English anyone?? (Score:5, Funny)

by flyingfsck (986395) on Sunday December 23, @02:58PM (#21799764)
Slashdot Engrish is to be informating and not to be laughful at."

Wednesday, December 19, 2007

Open Source XML Diff Written in Java

From http://www.manageability.org/blog/stuff/open-source-xml-diff-in-java:

"Jon Udell has a column about "Structured Change Detection" where he mentions some XML diff tools that exist. The tools that he mentioned are proprietary implementations, so I was curious if I could find some open source ones. Well fortunately, I've found a whole bunch of them:

  1. VMTools - The toolkit contains tools for automatically generating differences between two XML documents. The difference document generated is optimized for minimal size. Supports mark-up style documents in addition to data documents.
  2. 3DM - The 3DM tool is a tool for performing 3-way merging and differencing of XML files. Unlike line-based tools, such as diff and diff3, 3DM is aware of the structure of the processed XML documents. 3DM is not limited to update/insert/delete operations, it also handles moves and copies of entire subtrees. 3DM is not reliant on edit histories; the only input needed are the XML files.
  3. diffxml - Standard UNIX tools exist for comparing (diff) and patching (patch) files, which operate on a line by line basis using well-studied methods for computing the longest common subsequence (LCS). This project contains XML diff and patch utilities. Also contains an implementation of a Delta Update Language or DUL.
  4. diffmk - Converts the documents into two lists of nodes (text and/or element nodes) and attempts to find the longest common subsequence of nodes. Phrased another way, it finds the smallest number of additions and deletions to each list that are required to make the two lists the same.
  5. XMLUnit - XMLUnit for Java provides two JUnit extension classes, XMLAssert and XMLTestCase, and a set of supporting classes (e.g. Diff, DetailedDiff ) that allow assertions to be made about the differences between two pieces of XML. XMLUnit for Java can also treat HTML content (even badly-formed HTML) as valid XML to allow these assertions to be made about the content of web pages too.
  6. OpenSHORE XML Merger - ool to insert XML tags from differnt sources into one or more text files. The Java program reads a very simple file format (*.xmlm files) with one XML command per line. XMLM sorts these commands, removes duplicates, ensures correct tag structure and generate XML files from listed files.
  7. XOperator - XOperator is a scriptable command-line tool and library to compare, merge and synchronize XML documents, a framework to formulate and evaluate algebraic expressions on XML trees and a framework to express object-oriented inheritance (and more) in pure XML.
  8. JXyDiff - JXyDiff is a based on XyDiff. It was originally developed at INRIA. It employs a novel Change Model tailored to XML data. It is a tree oriented algorithm that is fast and can detect if a node has been moved or updated.
  9. DiffX - DiffX is an open source Java API for comparing XML documents by analyzing the sequence of XML events. When processing XML data for comparison it more interesting to know that a word in the text of chapter X, paragraph Y has been changed rather than knowing that line Z is different. DiffX can ignorethe order of the attributes and white space for indentation or namespace prefixes.
  10. XMLPatch - XMLPatch, developed at Nokia, is a framework utilizing XML Path language (XPath) selectors for the use in applying a set of patches to a document. The framework includes a simple xml-diff utility.
  11. XMerge - The XMerge SDK provides a framework for converting documents between different formats using conversion plugins to read and write each format. In addition to format conversion, the XMerge SDK provides a framework for merging changes in one document format into an original document. XMerge provides plugins that are designed to support the OpenOffice.org XML file format. The framework is able to support "chaining" of conversions, also known as an "Any-to-Any" conversion, eg. convert from a Palm document to a PocketPC document through the intermediate OpenOffice.org XML file format."

Tuesday, December 18, 2007

"Could not load file or assembly or one of its dependencies. Access is denied" when compiling .NET assembly

Compiling with a reference to a third-party, licensed control. (UltraGrid-something-something.) Encountered the error: "Could not load file or assembly or one of its dependencies. Access is denied"

The problem was that the directories in which the source files existed had weird permissions. (I think the root cause was using a cygwin version of git to create the subdirectories.) I changed the permissions using the "Advanced" button of the Security tab. When done properly, the "Inherited From" column showed "C:\" as where the privileges were inherited from. The broken version had the "inherited from" as inheriting from nothing.

I believe I had to check the "Inherit" box to get this to work properly, and then click the "Remove" button in the Advanced view to remove the permission entries which did not inherit from C:\.

Correct permissions look like this:

Friday, December 14, 2007

Case sensitivity in bash

Case sensitivity in bash: How to turn off case sensitivity in the bash shell.

And, "to turn off the annoying beep each time you make a typo on a Unix terminal (Linux, cygwin etc.), just add the line
    set bell-style none
to the file .inputrc under your home directory."

Friday, November 16, 2007

EasyVMX!: Virtual Machine Creator

EasyVMX!: Virtual Machine Creator: "EasyVMX! is the simple and failsafe way to create complete virtual machines for VMware Player on the web. You can install any Windows, Linux, BSD or Solaris, and test LiveCDs in a safe environment."

Tuesday, November 13, 2007

Danger! Lousy Employer Ahead

Danger! Lousy Employer Ahead: "Danger! Lousy Employer Ahead If a potential employer wants proof of your previous salary and gives vague answers to specific questions, bolt for the exit"

Wednesday, October 24, 2007

How Bush wrecked conservatism | Salon.com

How Bush wrecked conservatism | Salon.com: "In the age of Bush, even the conservatives' much-vaunted moral clarity does not always bear close inspection. A Pew poll taken in March found that only 18 percent of self-described conservative Republicans believed that torture was never justified. Who was it who said, 'Do not repay anyone evil for evil, but take thought for what is noble in the sight of all ... Do not be overcome by evil, but overcome evil with good'? It must be one of those damn liberals.*

*Romans 12:17, 21"

Tuesday, October 23, 2007

15 Answers to Creationist Nonsense: Scientific American

15 Answers to Creationist Nonsense: Scientific American: "Opponents of evolution want to make a place for creationism by tearing down real science, but their arguments don't hold up"

Wednesday, October 17, 2007

Occasionally Connected Systems Architecture: Concurrency

Occasionally Connected Systems Architecture: Concurrency: "The problem of concurrency is a familiar one in the development of multi-user systems. Most of the time, optimistic locking is preferred because it results in better throughput. However, pessimistic locking has its place as well for those cases where only one user should be allowed to work on the data. Both of these solutions break down once users start working offline and try to synchronize their updates with the server later."

Thursday, October 04, 2007

How Toyota and Linux Keep Collaboration Simple - HBS Working Knowledge

How Toyota and Linux Keep Collaboration Simple - HBS Working Knowledge: "The Toyota and Linux communities illustrate time-tested techniques for collaboration under pressure: Share knowledge widely, frequently, and in small increments, and use universally available tools to do it. From Harvard Business Review."

Lean Manufacturing Blog, Kaizen Articles and Advice | Gemba Panta Rei

Lean Manufacturing Blog, Kaizen Articles and Advice | Gemba Panta Rei:

Nine Rules for Fighting Endless Meetings

I've heard that at Toyota the meetings are 60 minutes long, with 50 minutes of actual meeting time and 10 minutes to get to the next meeting. The use of the standardize A3 size one-page format to communicate the progress on PDCA problem solving keeps meetings on time. This is truly impressive, but we won't all get there in one leap.

Here are nine rules for fighting endless meetings:

#1 Start on time. You don't arrive 15 minutes late for a school examination. You don't arrive 15 minutes late for your flight. If you do, you don't fly. You don't arrive 15 minutes late for a job interview. Yet once we pass the test, make the flight and get the job, we think nothing of making others wait for meetings at work. Why?

#2 Have clear objectives. Meetings will be more productive when you start with an agenda that answers the questions: Why am I at this meeting? Who requires that I be here? When does this meeting end? How will we know if the meeting is successful?

#3 Be prepared. Review the agenda or other background information ahead of time. Know where the meeting will be held and how long it takes to get to and from that meeting place so you can be on time.

#4 Be engaged. This starts with turning off your cell phones or blackberries. Ideally, put them all on the table where they are visible to all. Make reaching to answer them is a visible offense. Pay $1 towards charity if you reach for your phone, unless it's an emergency. As long as meetings are kept short, you can get back to people who call you in a reasonable amount of time. Stand up rather than sit, it will keep you more aware.

#5 Communicate visually. Humans process more than 80% of information through their sense of sight. Psychologists say most of communication happens through body language, then tone of voice and a smaller portion through the actual content of speech. Give and read visual cues. Use images to tell a story and anchor your communication, rather than talking on and on about something without structure.

#6 Solve problems. If everything is going well, why meet? Ideally meetings should help solve problems. If there is a clear objective and a problem to solve, the meeting can end either when the problem is solved or everyone knows what to do to start solving the problem. Problem solving is engaging, and in that is what we are all here to do.

#7 Practice genchi gembutsu. Whenever possible hold the meetings at the location where the particular problem or issue being discussed has occurred. This is more visual, engaging, and improves direct access to the facts. This speeds up problem resolution by taking away opportunities for conjecture and blurring of the actual condition.

#8 End on time. You need to get to the next meeting on time.

#9 Avoid the Three Evils of Meetings as taught by Takeshi Kawabe, former executive of Showa Manufacturing Co. and student of Taiichi Ohno:

1. Meet but don’t discus
2. Discuss but don’t decide
3. Decide but don’t do

These nine rules will develop the behaviors to support more effective meetings.

By Jon Miller - March 15, 2007 5:21 PM

Friday, September 14, 2007

This was useful when I was looking for the key to view the next error in Visual Studio 2005 C# profile (Ctrl-Alt-F12, by the way):

[PDF]

Microsoft Visual C# Default Keybindings

File Format: PDF/Adobe Acrobat - View as HTML
shortcuts, warnings, and error. messages. ... Notes: These key bindings are only available through the Visual C# Development. Settings. ...
download.microsoft.com/download/e/7/9/e79cce22-b196-4b9f-9ea7-b1a21f5342e9/VCSharp_2005_color.pdf - Similar pages - Note this
[PDF]

Microsoft Visual Basic Default Keybindings

File Format: PDF/Adobe Acrobat - View as HTML
keyboard shortcuts and detailed descriptions, see ... for Visual Basic 2005 is a free application that you can download to. help do this. ...
download.microsoft.com/download/d/6/5/d65efda0-cf25-4720-8013-b3080586c5bb/VB_2005_color.pdf - Similar pages - Note this