« January 2007 | Main | March 2007 »
| using PowerPoint = Microsoft.Office.Interop.PowerPoint; private void pptThumbnail(string sourceFile, string targetFile, int thumbW, int thumbH) { // Open the document and convert into HTML pages PowerPoint.ApplicationClass oApp = new PowerPoint.ApplicationClass(); PowerPoint.Presentation oDoc = oApp.Presentations.Open( sourceFile, Microsoft.Office.Core.MsoTriState.msoTrue, // read only Microsoft.Office.Core.MsoTriState.msoTrue, // untitled Microsoft.Office.Core.MsoTriState.msoFalse); // with window string tmpHtmlFile = System.IO.Path.GetTempFileName() + ".html"; oApp.Presentations[1].SaveCopyAs( tmpHtmlFile, PowerPoint.PpSaveAsFileType.ppSaveAsHTML, // format Microsoft.Office.Core.MsoTriState.msoTrue); // embed true type font // Create the thumbnail from the HTML pages Size browserSize = new Size(800, 800); WebBrowser browser = new WebBrowser(); browser.Size = browserSize; browser.Navigate(tmpHtmlFile); while (WebBrowserReadyState.Complete != browser.ReadyState) { Application.DoEvents(); } Bitmap bm = new Bitmap(browserSize.Width, browserSize.Height); browser.DrawToBitmap(bm, new Rectangle(0, 0, browserSize.Width, browserSize.Height)); Bitmap thumbnail = new Bitmap(thumbW, thumbH); Graphics g = Graphics.FromImage(thumbnail); g.DrawImage( bm, new Rectangle(0, 0, thumbnail.Width, thumbnail.Height), new Rectangle(0, 0, browserSize.Width, browserSize.Height), GraphicsUnit.Pixel); thumbnail.Save(targetFile); } |
|
(
site:stanblog.jojoyao.com OR
site:stanyrocks.spaces.live.com OR
site:clipmarks.com/clipper/stanyao/
)
OR
(
link:stanblog.jojoyao.com OR
link:stanyrocks.spaces.live.com
)
|
Publishing from Microsoft Office to blog sites is attractive because you can make use of the rich editing and formatting functionalities of Word, OneNote, etc. If you have multiple blogs, you could publish to all your blogs from one place conveniently.
Suppose you are working in OneNote and a good idea struck you and you want to blog about it and publish to one of your tech blogs implemented with Movable Type. Compose your blog in a new page in OneNote. "Menu" --> "File" --> "Send To" --> "Blog".
Edit the title, click the "Publish" button on the top left, choose "Register an account" (you only need to do this once and the blog manager will memorize it), choose blog type "Other", choose API "MetaWebLog", type in API URL "http://YOUR-DOMAIN/PATH-TO-MT/mt-xmlrpc.cgi", the user name is your blog account, but the password is NOT the one you use to login Movable Type due to security considerations. To set/get the password, login to your blog website, click your username on the top right corner, and at the bottom of the user information, you will see the "Web Services Password". You can set one that is different from your account password. "OK" and your blog is published.
Yahoo Pipes is a recently released new innovative product. The name explained itself. It's the web counterpart of UNIX Pipes. UNIX pipes help connecting multiple command line tools to produce a new customized tool, while Yahoo Pipes help connecting the countless web services and boost the power of those web services exponentially. By wiring up the web services on the web, you can create amazing new products of your own.
The pipe network consists of modules (doing processing like filtering, sorting, etc.) and pipes (directing the data flow). RSS and text flow through the pipes and produce the final result in the RSS format. Here is an easy example to show how it works. Let's build a video search that covers YouTube and Soapbox and sort the results based on the rating and play count.
We need 2 user input, keyword and minimum rating required. The Soapbox search is easier. Do a search on Soapbox and copy the RSS URL (notice the parameters on the URL). Create a URLBuilder in the Pipes, paste the URL in the Base, and it will automatically parse the parameters and fill them in below the Base. Then extract the result by a Fetch module and direct them into a filter on the ratings. Finally sort on the rating column and dump the result into Pipe Output module. YouTube is a little bit trickier, because they don't support parameters on the RSS URL. But have a tag based URL explained here. Fortunately Yahoo Pipes has a String Concatenate module, which could be used to connect the 3 pieces "feed://www.youtube.com/rss/tag/", user search keyword, and ".rss". Connect the resulting URL to the Fetcher too and we are done. One small problem though. Because YouTube feed doesn't supply the rating information, so the sorting is only effect on the result item from Soapbox. Now try this new video search here.
I suggest Yahoo Pipes to also include the following features:
Bookmarking a website and bookmarking an article are different usage of the bookmarking tools. You may want to have a clean collection of all your favorite websites and on the other hand you may want to bookmark multiple good articles from the same website. This way your bookmark collection is a mixture of both. This is my little frustration of using sites like http://del.icio.us/. It's great in collect articles and links, but not so great to keep a clean list of my favorite websites. Although I can use a different bookmarking tool (e.g., http://favorites.live.com/, which could sync with IE bookmarks) to collect just sites, it'd be nice if I could keep them in one place. So I developed a custom web control that could be put on your website to display all the websites of a list of http://del.icio.us/ RSS feeds in the order of popularity. Multiple articles of each websites are collapsed into one entry shown for that website, and the number of the articles bookmarked from that site is used as the indicator of the popularity of that site within the RSS feeds. So the more articles of a website that are bookmarked, the more popular the website is. In my example of using this web control, I put my bookmark feeds and the del.icios.us homepage hotlist feeds in so that I will get a list of all the websites either I bookmarked or on the hostlist.
|
<cc1:BookmarkedWebsites |
The "Url" property of the control specifies a list of RSS feeds to extract from. The delimiter is ";".
RSS.NET library is used to parse the RSS feed. The website part (domain) of the URL is extracted and used as the collapsing key.
|
protected override void RenderContents(HtmlTextWriter output)
// Reorder it on the number of occurrence (thus popularity)
public class SitePopularityComparer : IComparer |
The web control looks like the following:
Furthermore, it would be cooler to be able to sync this website list into the browser bookmark so that you can use them as your reading list even more conveniently.
The prototype source code can be downloaded here: MyFavoriteWebSites.zip.

This page contains all entries posted to Stanley Yao's Blog in February 2007. They are listed from oldest to newest.
January 2007 is the previous archive.
March 2007 is the next archive.
Many more can be found on the main index page or by looking through the archives.