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.
 

Clarkson Tom

职业
地点
第 1 张,共 1 张
更多相册 (1)