Tuesday, December 29, 2009

Hanging Pictures

I got some pictures from Salvation Army on Monday, and decided to hang them today. Thinking there must be design and aesthetic principles for hanging pictures, besides which way is up, I did a google search on the web.

Here's an excellent site:


http://www.thinctanc.co.uk/design/hanging_pictures.html

Monday, December 28, 2009

Kung Fu

I'm watching "Kung Fu" reruns ... if you're wanted and there are posters with "Kwai Chang Caine -- $10,000" all over the place ... why don't you change your name?

You can't have it both ways -- if everyone is a redneck bigot -- shouldn't Kwai Chang Caine look like every other "Chinaman"? How come even the most backwards hick can recognize long haired western clothed Caine in a hat as the bald-headed robe-garbed monk in a rather poor sketch? (Granted the tattoos sometimes are the giveaway).

Tuesday, December 22, 2009

Glucose conversion

I was looking online for conversion between American and Canadian units as my mental model for insulin coverage is in American units, but my meter is in Canadian units.

But I don't want an online app! I just want a simple chart that's easy to read on my cellphone - I can message it there and look it up anytime.

First I got a text chart that was impossible to read on my cellphone. Multiple cols, laid out so that you don't have to scroll. The issue is not scrolling - easy to do on a blackberry - it's trying to decide whether the one number is associated with the one on it's left or the one on it's right when the separators are "---".

Next I looked at an online app -- but connecting/getting a link is SLOW...

So I made up my own chart - dead simple. Paste it into a message, send it to your cellphone, and watch your diet and exercise!

American Canadian
mg% mmol/l
20 1.1
30 1.7
40 2.2
50 2.8
55 3.1
60 3.3
65 3.6
70 3.9
75 4.2
80 4.4
85 4.7
90 5
95 5.3
100 5.6
105 5.8
110 6.1
115 6.4
120 6.7
125 6.9
130 7.2
135 7.5
140 7.8
145 8.1
150 8.3
155 8.6
160 8.9
165 9.2
170 9.4
175 9.7
180 10
185 10.3
190 10.6
195 10.8
200 11.1
205 11.4
210 11.7
215 11.9
220 12.2
225 12.5
230 12.8
235 13.1
240 13.3
245 13.6
250 13.9
255 14.2
260 14.4
265 14.7
270 15
275 15.3
280 15.6
285 15.8
290 16.1
295 16.4
300 16.7
310 17.2
320 17.8
330 18.3
340 18.9
350 19.4
360 20
370 20.6
380 21.1
390 21.7
400 22.2
410 22.8
420 23.3
430 23.9
440 24.4
460 25.6
480 26.7
500 27.8
520 28.9
540 30
560 31.1
580 32.2
600 33.3

Monday, December 14, 2009

What Great .NET Developers Ought To Know (More .NET Interview Questions)

http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx

Calling Lisp from C or C++

Here's a link on how to do this ...

http://clisp.cons.org/impnotes/dffi.html#ex-call-in

Sunday, December 6, 2009

DataGridView not updating in c#

How to update a DataGridView in c#.

I found that a DataGridView does not seem to update correctly when the DataSource is changed.

Theoretically, the following two pieces of code should be equivalent, where OutputGridView is a DataGridView, and myList is a list of objects to be displayed:

------------------------
Code 1:

OutputDataGridView.DataSource = myList;
-------------------------
Code 2:

OutputDataGridView.DataSource = null;
OutputDataGridView.DataSource = myList;
---------------------------

Given normal program semantics, the two pieces of code should be equivalent. The only way they cannot be equivalent if assignment (or specifically assignment to null) has side effects that change the semantics. This must be the case, because in y program changing the code from code 1 to code 2 changes the behavior.

And yes, I did google for solutions, the DataGridView Program Manager suggested adding

this.BindingContext[customDataTable].EndCurrentEdit();

but this did not fix the problem.

Hope that this may help someone else!