This is just a spot to keep miscellaneous links. It also shows you what a geek I am.
Thursday, January 24, 2008
Tuesday, January 15, 2008
Signs of a Bad Boss (seen by me in the wild)
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)
Use this command:
git diff-tree -r --name-status branch1 branch2where branch1 is the branch I'm going to check into SourceSafe and branch2 is the upstream branch.
Example:
The basic procedure is:/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
$
- hack hack hack
- Get my tree in good shape, usually by rebasing my branch onto the SourceSafe tracking branch.*
- Run the diff-tree command above to find changed files.
- Check out those files. If there are any warnings from SourceSafe about the files being different (and not just writable), then do the following:
- Get latest from SourceSafe into the SourceSafe tracking branch (typically "master") in my project.
- Commit.
- Go back to step 2 above.
- 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.
- Check changed files back into SourceSafe.
The flavor of git I use is msysgit.
Linus clarifies "Central Repository" issue on git in a way palatable to managers
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
"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)
"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.dotThe following is a screenshot of the graphviewer: "
Monday, January 07, 2008
TCL: Creating Temporary Files
"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"