For the last week it has been mild, and often dry -- so that the daffodils and forsythia have all suddenly burst into bloom; and the weeds are going mad in the garden. But the forecast is for colder, wet and much windier weather running up to Easter.
I took the day off today to use up some carry-over leave, and to take the new wheelchair-accessible car for a spin to take Karen out to lunch; but not a long run -- so went to the Golden Ball at Boxworth, one of the usual pub-lunch haunts from work. I'm sure the process of doing all the belts, buckles, brakes, gears, etc. will get smoother with practise. And I got a bit of unexpected manoeuvring practise when heading to Knapwell, finding the road blocked with a police car and an ambulance, so having to make a 3-point turn in a very narrow lane. Still, that was all gone on the way back, and we could enjoy the vast display of daffs along the verges through the village.
Although a frequent from-work place, I'd expected that Monday would avoid the risk of running into colleagues. So imagine my surprise when the first faces I spotted as I walked through the door were they! Still, we didn't have to rush off quickly to get back for meetings at 2pm.
Having gotten to the point of being annoyed by the way that WinZip overwrote the association, I finally crawled around the web to find a way to restore the CompressedFolder functionality as a more convenient method for reading, even if I want finer control for writing.
Most places talking about this are mildly dodgy, want to have you drop massive slabs of stuff into your registry or say "re-install your OS". Fortunately it's easier than that.
Run regedit, and go to HKEY_CLASSES_ROOT\.zip and change the (Default) value to CompressedFolder. That restores Explore as the default option, which was what I was after.
Following up on the earlier post, having found time to engage the brain a little...
Let's do the int flavoured version, everything non-default:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and then in IronPython ask the variable about itself
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>"\Program Files\IronPython 2.6\ipy.exe" callback.py
Array[object]((<System.IntPtr object at 0x000000000000002B [42]>, 23))
which is what we were looking for.
Rebuilding the C# assembly with out rather than ref and re-instating the print lines shows that the argument is still passed as a StrongBox, so there is no change on the IronPython side.
Armed with this piece of knowledge about the type, I tried Googling again, and didn't find any obvious mentions of callbacks -- just the converse matter of calling .Net methods that take out or ref parameters. But that at least is enough to reassure me that this is not just some completely undocumented hack that would be subject to change in later versions.
Note also that if I had written
print x.GetType().ToString()
(which is what I did the first time around) rather than
print type(x)
I would have gotten the result System.Int32, which gives no clue that adding
Cycled to work again on Friday -- and then a high-speed blitz into town for a short notice appointment early afternoon. So, the tooth with a cracked filling that had been playing me up for the last few weeks is now patched until the proper fix in May.
And next week is looking plausible for more cycling.
Mowed the lawn, what there is that isn't moss, and did some spring pruning, enough to fill up the green bin, before settling. And potted up some chilli seedlings and put them into a heated propagator in the greenhouse.
Only 35,932 this year or 5228 miles. Now some of that will be due to not having gone to the gym over the winter because of other commitments and some due to being snowed in a lot more or otherwise working from home. And probably rather more cycling
Suddenly a spell of mild dry weather -- Saturday, cycling into town for the first time in some weeks, and to the garden centre to pick up some supplies; and having my other gear cable snap while on off-road bridleway. So a bit of pushing as being stuck in top was not suited to the terrain.
Fumigated the greenhouse overnight, and then did bicycle repair -- much easier the second time around -- and put everything back on Sunday. That was warm enough to work up a bit of a sweat -- but in the greenhouse is cheating.
And today, cycled to work for the first time since mid-October; then had that first real day of T-shirt weather -- although a lot of people were still muffled up. Mild enough this evening that the central heating suddenly went from just keeping the chill off to being rather too much!
We can then use ctypes to get at the glass APIs, and set up some re-usable types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
which we can then hook into our window (assume we have loaded the XAML into a variable window)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Of course you now need to ensure you have some button or other control that will let you dismiss the window, now you no longer have the kiss of death available at top right.
The ref parameter in the WndProc hook is the reason behind the previous post...
So, experiment time. Build callback.dll containing (or the same with 'out'):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array[object]((<System.IntPtr object at 0x000000000000002B [42]>, False))
In sum -- it fails silently; the direct return value is fine, but mutating the actually by-value parameter does nothing.
Replacing the bool with int, and using non-default values shows that the value of a ref parameter is passed in correctly, it just can't be passed out with direct assignment.