![]() |
|
Spaces home John Stewien's Road To S...ProfileFriendsFiles | ![]() |
Nearly WalkingBy the time I get back to Taiwan Violet will be walking I think: 8/12/2008 Different ways of showing a C# dialog from Managed C++ or C++/CLI
Here are 3 different behaviours for showing a C# dialog from a C++ application:
Code examples are below to show how to use each. Note that for the non-modal non-clipped call to SetWindowLongPtr the flag GWLP_HWNDPARENT doesn’t appear in the documentation for SetWindowLongPtr. That’s because the owner for a window can’t be changed after it is created, however GWLP_HWNDPARENT is the offset flag for reading the owner as seen in the GetWindowLongPtr documentation, so it can be written to before the window is shown and be used to set the owner.
// Wrapper for a HWND void OpenDialog(HWND hwnd){ // hwnd is the main window // Note that the following code snippets are mutually exclusive, only use 1
8/11/2008 Visual Studio Command Prompt Explorer Context MenuI keep on reinventing the wheel every time I'm at a new place of work and want a Visual Studio Command Prompt Explorer Context Menu, so I'm going to put the contents of a reg file here so that I can find it easily in the future when I need it. Here's the entry for a Visual Studio 2003 command prompt, but something similar would also apply for Visual Studio 2005 and 2008: Windows Registry Editor Version 5.00 8/10/2008 I now know sour, which allows me to appreciate the sweetThe title is a modified quote from the movie Vanilla Sky which has these lines: "And I know sour, which allows me to appreciate the sweet" and "Just remember, the sweet is never as sweet without the sour, and I know the sour" and "There are no guarantees, but remember: Even in the future, the sweet is never as sweet without the sour" It's a recurring theme. I suspect that this turn of phrase will be something going through my head when I return to my family in Taiwan, where my home life is quite pleasant, and I will appreciate it more for having recently been living in a less pleasant environment. I've been working in Perth since May, and my experience while living here has highlighted to me how good I have had it over the years in other places. One thing I've noticed about people in Perth is that they like to complain a lot. People like to waste energy and time focusing on little things. Living with this daily is life force draining, but has allowed me to appreciate my father's personality: My father is a true Engineer, when he looks out on the world he doesn't see problems, he just sees solutions. If a problem doesn't have a solution, or if the solution isn't worth the effort, then he doesn't see the problem, he just doesn't waste time and emotional effort on it. He enjoys his life and doesn't drive himself to misery over problems, as to him they don't exist. Probably why he's so far made it to 76 and still seems reasonably intact. Here's a small example of this: When I was around 13 my mother had to go to hospital for a long enough period that my father had to take over the household duties. My family is the traditional woman is the home maker man is the bread winner type family, so household duties were a bit foreign to my father. Anyway on Thursday night my father came home a little early and we took the car to go Thursday night grocery shopping which is an Australian tradition. After filling a shopping trolley my father let me push it to the car. He had warned me to be careful, but in my normal fashion I pushed the trolley too fast and it flipped over. Our shopping went all over the car park. I was shocked at what I had done, I just didn't see that coming. I looked at my father and he had a calm expression on his face, and he said "well lets pick up the groceries and put them back in the trolley". It's like there was no problem. Even during stressful times he didn't waver from his no-problems-just-solutions attitude. In my future years as a father, this is the mantra I want to live by. Optimally Jasmine and I will create a happy home life for my daughter with such consistency that she won't appreciate how sweet it is; but I'll know. Violet won a crawling race in Taoyuan
And here's her gold medal: 8/9/2008 The Square Root of 3I fear that I will always be A three is all that’s good and right, Beneath a vicious square root sign, For nine could thwart this evil trick, I know I’ll never see the sun, as 1-point-7-3-2-1 When harken What is this I see, Has quietly come waltzing by, To form a number we prefer, We break free from our mortal bonds Our square root signs become unglued - by David Feinberg (read by Kumar Patel in "Harold an Kumar Escape From Guantanamo Bay") 8/4/2008 Violet crawling across the floorHere's a video of Violet racing across the floor, up onto the bed and the onward
7/15/2008 C# Formatting XmlSerializer Output
So today I’m writing an app that loads and writes data to and from XML files, Excel Files, and Oracle Databases. An integration application you might say. Naturally I picked C# for the job as the thought of debugging a big hairy Perl script didn’t fill me with joy. Unfortunately my work PC only has Visual Studio 2003 on it, but what can you do? One of the things I wanted to do was load an XML file, modify some parts of it, and then write it out again with just the parts changed that I wanted changed. Fortunately I had an XSD for the XML file so I used the VS2003 xsd.exe utility to convert it to a C# .cs file. Unfortunately it did a terrible job and created C# class hierarchies that were a bit messy. So I went through and hand modified the C# code until I ended up with something I liked. Right, I deserialized the XML file, modified the data, and wrote it out again just using the simple XmlSerializer class in C#. What I wanted was this header: <?xml version="1.0" encoding="UTF-8" ?> What I got was this: <?xml version="1.0"?> And to top it off the output file had double space as the indentation instead of tabs. To fix all this first of all I modified the serializable class to generate the noNamespaceSchemaLocation attribute: [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
Then I changed the serialization to encode in UTF-8, indent using single tab spaces, and set the namespace the way I wanted it set: XmlSerializer serializer = newXmlSerializer(typeof(Xml.ReferenceData)); Then I got the output I wanted. 7/6/2008 Office DesignWe've been thinking about office design for the new company. There's a few things that come to mind: People have engaged discussions when doing something else, for example when playing golf business executives will often have very productive discussions. In light of this I'm thinking that the meeting room should have a pool table (8-ball, 9-ball, billiards, snooker, etc), so that people can play a game while having productive discussions. Work stress can lead to making mistakes, people need to feel relaxed so that they can concentrate on the job, therefore I think the office should have hot tubs (spas, artificial hot springs), for people to work in, this would also be good for meetings, however we will need to find some floating waterproof laptops. We also needs plants, heating, cooling, a location that is near a Starbucks, near the underground train, etc 7/4/2008 More Pictures From AdelaideHere are my parents waiting for me at the airport. Jasmine arrived with Violet from Taiwan, and I arrived from Perth.
Here's Jasmine at lunch with a friend, who is also my best friend's fiancee:
Here I am with Violet and my best friend Ian:
Here are Violet and I feeding the swans:
Here's Jasmine, Violet and I at the Torrens River, Adelaide:
Here I am pushing Violet along in North Adelaide:
What the?
Here's my best friend with his fiancee from Taiwan:
Here's Violet waiting for lunch:
After lunch here's Violet with her great grandmother: 7/3/2008 Baby StuntViolet climbing the couch. Violet was not harmed as a result of this stunt. The minor harm that occurred later was due to something else and was not stunt related.
Trip to AdelaideWent on a trip to Adelaide to fix up some things, and to catch up with family and friends. Unfortunately I didn't have time to catch up with all my friends. Jasmine, Violet and I are now all on the same medicare card though. For some reason it seems like a nice feeling to pull out my medicare card and see the names of my family all on there.
Here's all my immediate family including my sister's family unit:
Violet got to meet her cousins for the first time:
She's a big baby, but hopefully she won't get as big as her grandfather:
Here's a picture of my beautiful wife and daughter together:
While in Adelaide we travelled about by bus and train:
Lunch times can be tricky:
A high chair is recommended:
Got to watch out at the pub for baby grabbing things:
At the end of the day a bath is good:
Then maybe watch some tv:
We had some fun times:
Note the teeth:
But at the end of the day a rest is good: 6/13/2008 We need a Taiwan Java DeveloperYes my new company needs a Java developer to lead our Java team in Taiwan. If you have 5+ years experience in lots of enterprise web stuff in Java then join us now and soon we will be paying you lots of money and giving you flexible workings hours. What's not to like. If you just returned from Silicon Valley to Taiwan we definitely want to talk. E-mail us at jobs@jelical.com with your resume. Hope that doesn't attract too much spam. I'm a C# person with not enough web development experience which doesn't fit in with the work coming in. We have an ad up at 104: Here's the English bits: We want a person with:
We Offer: 6/11/2008 More Baby Stuff. Other news coming soon.I'm starting a company so I've been very busy of late. At some point I'll put some news about that here on my blog.
On Saturday I get to see my wife and daughter again. They are coming to Adelaide, Australia. I'm currently in Perth, Australia, but I will be flying to Adelaide to stay with them there for 2 weeks. Then they'll fly back to Taiwan, I'll keep working in Perth for 3 more months, and then I'll be returning to Taiwan, hopefully with my new company in full swing.
In the mean time I'm still surviving on photos and videos of my baby 7 month old Daughter. Here's some cute photos:
And here's a video of her following her mother Jasmine around in her walker:
6/4/2008 Violet WhistlingViolet's grandfather has been teaching Violet to whistle, however it's a bit hard for a 6 month year old to whistle. Here's what she can manage so far:
5/27/2008 Here comes troubleAt nearly 7 months Violet has started moving around, she can stand up straight hanging on to things: 5/25/2008 Funny QuoteThe police who arrived late for the beginning of my experiment, but in time for the grand finale, were unappreciative - Werner von Braun |
|
|