Tom Clarkson 的个人资料Tom Clarkson's Blog照片日志列表 工具 帮助
4月19日

It almost works


So it seems that the clickonce deployment I put up yesterday doesn't quite work - unless you have it working already. Is there anything less convenient to test than a problem that only occurs on a clean install?

 

Ah well, I need to reinstall windows in the next few days anyway.

4月18日

I need to start releasing again

A few days ago Loren Heiny posted a screenshot of ink in IE - I noticed that it looks quite similar to something I posted nearly a year ago, but never got around to releasing.
 
The last few months I've been intending to get desktop 2.0 finished and release everything at once, but that doesn't seem to be working all that well, so I'm trying a different approach. I've got the settings infrastructure and shared code stable enough now, and it's all set up as a clickonce deployment.
 
OrangeGuava Desktop 2.0 can be installed from http://www.orangeguava.com/clickonce/desktop/publish.htm (or at least it will be in the next hour or so).
 
There are a few things missing still (notably the desktop itself isn't included yet) but there is a new version of Inkable Keys and the edit overlays (ink in IE and standard textbox controls). The automatic updating should give you the new features as they get built.
 
 

I'm not dead.

Online there isn't much difference between not posting and not living. I'm just not posting.
12月1日

Old and new

Some of the new-sounding things that make up "Web 2.0" have been around a while with different names. Tagging gets talked about like it is a new and near-perfect way to link related content. However, it seems a lot like the keyword based searching that was standard 10-15 years ago. Remember when every html document had to have a keywords tag in the header so that search engines could find it? Remember when spammers realised that the keywords didn't actually have to have anything to do with the content?
 
It's not just intentional bad metadata that causes problems. Most people are either lazy, so keywords are left out or are copied from some random document, can't spell, or just have no idea how they should be categorizing the content. Search algorithms have improved a lot in the last decade. People haven't.
 
There's a lot of stuff that computers can't do yet, and having a human reading and understanding content so that the meaning can be searched makes sense on a certain level. Unfortunately, it doesn't work on a large scale because people in general disagree with each other. You probably disagree with most of the people who classified your search results, making the returned results completely wrong. The worst you can get from a computer is logical results that may not be what you want, but you can understand why they would show up. It may not be perfect, but you can trust the computer.
 
Also, the possibility for improvement is important. Any human-generated classification effort creates data. Data just sits there and remains as good or bad as the day it was created. Any problems that get into the system stay there and are essentially unfixable. With a properly automated search, where all understanding of the content is clearly defined, the algorithm can be improved and the problem is gone.
 
Obviously, the problem of always finding what you want isn't fully solved yet. That's not going to happen until you can upload a copy of your brain into the system and have it read the entire internet to find stuff that you peronally would find interesting. Fortunately most of the ideas I have for finding useful information are a little nearer term than that.
 
11月26日

Convert Word HTML to Infopath XHTML

Sometimes making a program do something is a lot harder than doing it by hand, but you have to do it hundreds of times so you don't have much choice. For moving formatted text between Word and an InfoPath rich text box, copy and paste works quite well. Unfortunately, pasting to an InfoPath control from managed code is both difficult to get working and completely useless for a process that needs to run on a server. After trying several different approaches that didn't quite work, I came up with this code.
 
It uses the clipboard to obtain Word HTML for a range, uses  HTML Tidy and some string replacement to get standard XHTML, then loads the XHTML as an XmlDocument and changes any image elements to the inline format used by InfoPath.
 
The code is C# .NET 2.0, and although I've only tested it with InfoPath 12, it should be ok for 2003 also.
 

public XhtmlString WordToInfoPath(Range range)

{

range.Copy();

string s = (string)Clipboard.GetData("HTML Format");

s = s.Replace(

"o:", "");

s = s.Substring(s.IndexOf(

"<body"));

s = s.Substring(0, s.IndexOf(

"</body>") + "</body>".Length);

Tidy.

Document tdoc = new Tidy.Document();

tdoc.ParseString(s);

tdoc.SetOptBool(Tidy.

TidyOptionId.TidyXhtmlOut, 1);

tdoc.SetOptInt(Tidy.

TidyOptionId.TidyHideComments, 1);

tdoc.SetOptInt(Tidy.

TidyOptionId.TidyDropPropAttrs, 1);

tdoc.CleanAndRepair();

s = tdoc.SaveString();

s = s.Substring(s.IndexOf(

"<body") + "<body".Length);

s = s.Substring(s.IndexOf(

">") + ">".Length);

s = s.Substring(0, s.IndexOf(

"</body>"));

s = s.Replace(

"&nbsp;", " ");

s = s.Replace("<br />", "");

s = s.Replace(

"<![if !vml]>", "");

s = s.Replace(

"<![endif]>", "");

s =

"<span xmlns=\"http://www.w3.org/1999/xhtml\">" + s + "</span>";

 

XmlDocument xdoc = new XmlDocument();

xdoc.LoadXml(s);

 

XPathNavigator xpn = xdoc.CreateNavigator();

XPathNodeIterator xpni = xpn.SelectDescendants("img", "http://www.w3.org/1999/xhtml", false);

foreach (XPathNavigator imgel in xpni)

{

string oldsrc = imgel.GetAttribute("src", "");

System.Net.

WebRequest wreq = System.Net.WebRequest.Create(oldsrc);

System.Net.

WebResponse wres = wreq.GetResponse();

System.IO.

Stream stream = wres.GetResponseStream();

Image img = Image.FromStream(stream);

System.IO.

MemoryStream ms = new System.IO.MemoryStream();

img.Save(ms, System.Drawing.Imaging.

ImageFormat.Png);

Guid guid = Guid.NewGuid();

string newsrc = "msoinline/" + guid.ToString("N");

string imgdata = Convert.ToBase64String(ms.GetBuffer(), Base64FormattingOptions.None);

ms.Close();

stream.Close();

wres.Close();

imgel.CreateAttribute(

"xd", "inline", "http://schemas.microsoft.com/office/infopath/2003", imgdata);

imgel.MoveToAttribute("src", "");

imgel.SetValue(newsrc);

}

return new XhtmlString(xdoc.InnerXml);

}

11月18日

Import Office 12 RSS Feeds from OPML

The RSS Feed support built into Outlook 12 looks like something I'll find very useful. The only problem is that as far as I can tell the feeds have to be added one at a time. I may not have quite as many feeds to deal with as Scoble, but it would still take a while to do that way.
 
So I got into the object model and put together a program to import feeds from OPML.
 
OPML
 
 
You'll need the release version of .NET 2.0 and obviously Office 12 beta 1. It hasn't been tested much (only tried it on the OPML from NewsGator), but the only feeds not importing properly seem to be the ones that don't work through the standard interface either.
 
 Update: Ok, so I found where the built in feature was hidden. It sort of says something about the complexity of large applications that it was quicker to implement the feature myself than to find the right menu item.
11月17日

Installed

Yes, it works on vista. Very nice. It doesn't take long to start seeing the improvements - I'm really glad Microsoft has stopped using multiple text boxes for the product keys - it was only a minor annoyance when I had product keys on paper, but having to copy and paste product keys in 5 pieces when installing several applications together.

Waiting for Office 12 to download

So far I have 27% of office 12 and a document on infopath that took nearly an hour to start downloading. I probably won't start trying actual development with it until sometime next week, but it's nice to see that most of the really frustrating things I've noticed about infopath 2003 development have been fixed. The site says vista isn't supported yet - hopefully that just means untested rather than not working.
 
And there should be another vista build to download the next few days. It's not that long ago that a gigabyte monthly downloads seemed like a huge amount I'd never be able to use..
10月31日

Well, that was stupid

I think I have messed up my current vista install about as much as is possible without seeing any blue screens. One of the little annoyances running the beta on a tablet has been that the pen buttons don't work. So I decided to see if using a different keyboard driver for the buttons would help. I expected that only the tablet buttons would be affected, but it disabled the keyboard and touchpad as well. I'd already lost the tablet driver, so now everything works except that there is no working input device, even in safe mode. Guess I won't be able to wait for the next build before reinstalling.
10月30日

More installing

Another reason I like using beta software - I've been using VS2005 for the last year without any problems, then I download and install the rtm version and I get an messed up install that can't do anything useful and will pobably require reinstalling wndows to fix. Sure I was going to have to rebuild this tablet before long anyway, but this isn't the way it's supposed to work.
10月23日

Waiting for the next build

I found the right search string to get a reference to the tablet problems in vista 5231. Seems I have to wait for the next build. I'm trying to get onto the beta site so I can see the bug information, but the site just says "Unexpected Error". This definitely isn't my week for things working properly.

Installing Vista Again

So I'm installing Vista build 5231 for the fourth time. I really like the new features, except for one small problem - the tablet driver seems to be conflicting with the ink libraries. On the first boot, ink apps (journal/inkball) run using the touchpad, but the stylus doesn't work. Then I restart and the sylus works, but anything that uses ink won't start, complaining of an error initializing inking components. Go into device manager and disable "Wacom Serial Pen Tablet" and it's back to everything working except the stylus.
No solution yet, but at least now I have the problem isolated. Messing around with a single driver should take a lot less time than the three installs I had to do to find out at what point things stopped working.
10月5日

Large tablets

And now a random thought to finish off the sudden increase in blogging - the 14" tablets only seem heavy if you haven't spent some time carrying two of them.

OrangeGuava Desktop 2.0

I have started putting together the code for OrangeGuava Desktop 2.0. One of my main goals at this stage is to reduce the number of different things I have to work with - after starting to do winfx stuff there's just too many.
One of the most annoying things with the current setup has been building and uploading several different installers. So the desktop and the input applications will be implemented as different features of a single application. Licensing will be much the same as it is currently, but there will only be one installer to deal with.
I'll be switching to Microsoft's Shareware Starter Kit for activation - it works much the same way as the existing system, but having one less piece of non-core code to manage is always a good thing - also, the existing server side code is done with java and mysql, and I really don't want to use that stuff anymore.
The main new feature coming up is the ink entry for excel and other applications. Aside from that there should be some bugfixes and general improvements that come from setting up a good overall structure.
The development will all be done on Vista with .NET 2.0, since errors seem easier to find on that platform, though I also have an XP system to test stuff on.

Everything is a document

A lot of my time lately has been going into contract work. Fortunately It's not the
usual sort I do just for the money - I'm working with Tablet PCs, InfoPath and
WinFX. The project involves building the next version of a fairly typical vb/sql
business system. Systems like that have been done in a similar way for years, with
everything happening at the database record level, and a close relationship between
front end data structures and the underlying database structure. Microsoft has been
pushing a more document focused model for a while, particularly with SharePoint,
but with Windows Workflow Foundation and some of the stuff coming in Office 12, I
think it has reached the point where the old way of doing database driven
applications can be considered obsolete in about a year. I've been using Windows
Workflow for a couple of weeks now. It's beta 1, so I have seen some minor issues
with source control, but generally it works very well and provides an elegant
solution for what was going to be the ugliest part of the system.
InfoPath introduces some very interesting possibilities as well. The current
version has too many performance and code elegance issues with the managed code
support to build much of an application on, so you have to delegate almost all
logic and xml manipulation to a local web service. However, I can see that being a
lot bigger in the next version also.

Developing on Vista

I am now running Vista on my main development tablet. One thing I have noticed is
that Vista seems less tolerant of bad code than XP. I'm not sure if that's a
deliberate decision, replacing Microsoft's usual policy of backwards compatibility
above all else with something more secure or if it's just a beta issue, but as a
developer I think that's a good thing.
There was a bug in ActiveWords InkPad 1.5 that was seeming impossible to track
down. The first time I tried running it on Vista, I got an error message caused by
a line of code that had no obvious connection to any of the problems, or any
obvious reason to fail. Changing it fixed both the error message on vista and the
troublesome bug on XP. It seems there was some sort of complex interaction
involving inherited forms which I never would have found with anything short of a
complete rewrite of the startup code.
9月11日

Ink-enabling Office

Josh Einstein has added ink to Outlook. Loren Heiny has added gestures to Word.
 
I guess that just leaves me doing Excel..
 
7月30日

IE7 fixed my computer

Lately my tablet has been running pretty slow - it's been nearly a year since I last rebuilt it, and it seemed like I was going to have to find a few days to reinstall everything. Instead, I spent about 10 minutes installing the new internet explorer beta, and everything is working again. I guess that must be why it is in the 'operating systems' category on MSDN.
 
So form a stability perspective, I've never seen a beta product that was so good. There are one or two small things I notice that will need to be fixed before release. Opening favorites in new tabs is the one thingI miss from maxthon. And the dialog that pops up for the phishing filter is a bit scary - Having that capability will probably improve security a lot, but it reads like it is offering to send my entire browser history to Microsoft, which can't be right.
 
 
7月21日

Handango doesn't get it

Last week Josh Einstein got an email from Handango and decided they were charging too much for something that is essentially useless. I got mine today, and also have no intention of listing on their site.

The commision they expect is part of it of course - but that in itself I have no problem with. If you can get me a couple million sales I don't care if I haveto give a 90% discount on each one. The big problem is that I don't see their site getting any relevance in the tablet market.

Firstly, the developers aren't interested. Josh is more likely than others to publicly say exactly what he is thinking, but that doesn't mean he's the only one with those thoughts. Can you really build a one stop tablet download site when the owner of the most popular tablet download outside of Microsoft both refuses to provide content and tells other developers where to go instead?

The other problem is that they don't get what a Tablet PC is. All the other sections of their site are for handheld devices, so apparently they think of a tablet as a big pda. A tablet is a full windows xp computer. People buy tablets to replace their notebooks, not to replace their mobile phones. It's just too different from the current branding of their site.

Although I haven't wasted my time looking in to the details of their system, I am concerned that it would create an unnecessary barrier between the developer and the customer. With Paypal, as soon as the customer clicks on the "buy now" button, I have all the information and control to fix any problems that may arise. Handling refunds or partial order changes through any third party system is likely to be a pain. 

Then of course their is the question of how many people would find out about my software through handango who otherwise wouldn't - If they could find my software, so can any potential customers.