RSS 2.0 Feed

Tuesday, December 18, 2007

图形/打印做了十一年了, 太长了. 最近换了工作, 改做 Visual Studio / 多核.

posted @ | Feedback (12) | Filed Under [ 不务正业 ]

Friday, June 16, 2006

http://biz.yahoo.com/prnews/060615/sfth059.html?.v=61

REDMOND, Wash., June 15 /PRNewswire-FirstCall/ -- Microsoft Corp. (Nasdaq: MSFT - News) today announced that effective July 2008 Bill Gates, chairman, will transition out of a day-to-day role in the company to spend more time on his global health and education work at the Bill & Melinda Gates Foundation. The company announced a two-year transition process to ensure that there is a smooth and orderly transfer of Gates' daily responsibilities, and said that after July 2008 Gates would continue to serve as the company's chairman and an advisor on key development projects.

The company announced that Chief Technical Officer Ray Ozzie will immediately assume the title of chief software architect and begin working side by side with Gates on all technical architecture and product oversight responsibilities, to ensure a smooth transition. Similarly, Chief Technical Officer Craig Mundie will immediately take the new title of chief research and strategy officer and will work closely with Gates to assume his responsibility for the company's research and incubation efforts; Mundie also will partner with general counsel Brad Smith to guide Microsoft's intellectual property and technology policy efforts.

posted @ | Feedback (15) |

Thursday, March 02, 2006

突然发现 SPACES.MSN 还不错, 慢慢再把有用的东西移过去.

谢谢 JOYCODE 的款待.

posted @ | Feedback (5) |

Sunday, September 25, 2005

一年多前申请了一个 MSDN Blog,  荒废多时.最近参加 PDC 2005,实在没办法拖了, 只能重启 blogs.msdn.com/fyuan.

重点讨论:

  • XPS (XML Paper Specification)
  • WPF (Windows Presentation Foundation)
  • Printing 

posted @ | Feedback (13) |

Tuesday, May 10, 2005

上海福州路曾经是上大学时常去的地方, 这次回国, 专门旧地重游. 在上海书城逛了很久. 除了买了一大堆围棋书以外, 还买了一本梁肇新 《编程高手箴言》.

买梁肇新的书有几个原因:

1) 他是一个真正的程序员

2) 他敢称高手

3) 他的书确实是写出来的

4) 曾经有位中国的编辑让我写一本书

可能我应解释一下为何要写这个书评. 小时候, 家里有一个破破的有线收音机, 老爸常常听, 并时时加以评论. 慢慢的我也习惯了对什么人说的话都用自几的脑子去分析, 很多事就清楚多了, 很多神话就破了, 说的话就有人听了, 自信心就提高了.

写这个书评不是为了证明梁肇新不是高手. 我觉得梁肇新是一个编程高手, 而且是一个经营高手. 但我不相信绝对的高手, 反对对高手的迷信. 不管作者是不是高手, 每本书应经得起推敲. 越是高手的书越可能有误导性.

第一章前半部分可在此看到: http://blog.csdn.net/iyanglian/archive/2004/09/13/102494.aspx

第一章: 程序点滴

  • 好的开始是成功的一半. 本书首先试图告诉你什么是程序员? 为什么要做这样的程序? 正确的入门方法是什么?

简单公式有误导性. 何为开始? 何为好的开始? 何为成功? 何为成功的一半?

有了 "首先", 应有一个 "然后" 之类的.

有了 "这样的程序", 前面应提过某种程序.

 "正确的入门方法"? 有错的的入门方法吗? 用了错的的入门方法又有什么不好?

  • 程序≠软件: 如果你写个程序,别人就可以拿来用。这时候的程序就能产生价值,这个程序就直接等同于软件。但软件行业发展到现在,程序也不等同于软件了。

此书对软件有特别的定义, 产生价值的程序才是软件. 而后的章节进一步将软件定义成经过经销商销售的程序. 所以 "程序≠软件" 指的是并非所有的程序度能让经销商销售产生价值.

软件确实不等与程序, 不论其有无价值. 软件 = 程序 + 文档 + 服务.

  • 因为现在写程序很容易,但是你的这个程序很难产生什么样的商业意义,也不能产生什么价值,这就很难直接变成软件。

要写和几十年前一样的程序是很容易, 模拟别人的现有程序比较容易, 但写符合现代标准的, 或有创新的程序越来越难.

-- 慢慢道来 --

 

posted @ | Feedback (63) |

Wednesday, March 02, 2005

近来很少来这边, 长在 CSDN. 居然那边有人喜欢读一个老程序员的即兴言论 (http://community.csdn.net/Expert/TopicView.asp?id=3812393).

诧异之余, 还是接受 SmallRole 的建议, 主动交代, 和盘托出:

http://csdn.fengyuan.com/

其他的慢慢加上

posted @ | Feedback (23) | Filed Under [ 不务正业 ]

Friday, October 01, 2004

My last post includes a link to www.redfin.com, which shows satellite pictures of Seattle area where Microsoft headerquarter is located.  Someone said that there are too many buildings, so it's hard to find Microsoft buildings.

I've put together a huge bitmap showing Microsoft main campus and west campus. There are dozens of Microsoft buildings in the picture.

Here is the link http://blog.joycode.com/fyuan/articles/34760.aspx. Note, these pictures were taken before Building 36 was built. Warning: it could be quite slow to load all the bitmaps.

For Microsoft building numbers, check:

http://www.microsoft.com/careers/mslife/locations/images/campus_map.jpg

http://www.microsoft.com/careers/mslife/locations/images/north_campus.jpg

http://www.microsoft.com/careers/mslife/locations/images/west_campus.jpg

I work in Building 2, one of 6 X-shaped initial Microsoft buildings.

posted @ | Feedback (9) | Filed Under [ 不务正业 ]

Tuesday, September 28, 2004

Visit www.redfin.com, click on “Polular searches” - “Microsoft Redmond” in the bottom right corner, you will see a satellite picture of Microsoft area. Microsoft main campus buildings are in the top-left corner.

My office building (Building 2) is about 1/3 from left and 1/3 from top. My home is at the bottom left corner. You can also see a red car parked in the drive way of my next door neighbour, if you know where to look.

 

posted @ | Feedback (9) | Filed Under [ 不务正业 ]

Thursday, August 19, 2004

On August 9th, I posted the following problem on community.csdn.net, under VC/MFC 基础类:

Problem: Write code to generate a bitmap rotated 90 degrees clockwise from the original bitmap, without using any graphics library.

If you want to post your code here, write on your own, do not refer to anything else, no copy/paste, write your code here, review your code before submitting, and include how much time you spend. Add comments in English when possible.

I want to see who can give a good enough answer.

There have been lots of responses to this simple programming problem and some quite interesting discussions. Here is the link to the CSDN thread: http://community.csdn.net/Expert/topic/3254/3254627.xml?temp=.7896845

Here is the link to my comments, including my code: http://blog.joycode.com/fyuan/articles/30945.aspx

posted @ | Feedback (10) | Filed Under [ 程序义诊 ]

Tuesday, July 27, 2004

Mark Schmidt has joined Microsoft today. Mark was a coworker of mine while I was working at HP Vancouver, WA. He has written several books including Microsoft Visual C# .NET 2003 Developer's Cookbook.

Here is a message from Mark:

Finally made it.

 

posted @ | Feedback (12) |

Monday, July 12, 2004

We drove to California last week. On the first day, we drove all the way from Bellevue to a small town on the California coast. So it was quite late when we arived there. Two motels we checked had no room left. The third one offered us $109.99 + tax, after AAA discount, for a room with two beds. We had to take it reluctantly, as we had never paid such price for a motel room. I was expecting something in the $50 to $60 range,

Once in the room, I looked around to see what is so special about this expensive motel room and found a notice in the back of the door. It is a printed notice about room rates, rules and regulations, and several sections from laws of California regarding hotels.

Laws of California

Room Rate Statute

California Civil Code Section 1863: 天使的笑脸 Every keeper of a hotel, inn, boading-house or lodginhhouse, shall post in a conspicuous place in the office or public room, and in every bedroom of said hotel, boarding house, Inn or lodginghouse, a printed copy of this section, and a statement of rate or change of rates by the day for lodging. 啤酒杯 No charge or sum shall be collected or received for any greater sum than specified in subdivision 天使的笑脸 For any violation of this subvision, the offender shall forfeit to the injured party one hundred dollars ($100) or three times the amount of the sum charged in excess of what he is entitled to, whichever is greater. ...

The rate for the room was listed as $105 for 3 persons, so they over-charged us $4.99. But if you read the printed California law carefully as a software engineer, the innkeeper owe me max(100, 3 * (109.99 - 105)) = 100.

The next morning, I took the notice to the office and walked away with a 100 dollar bill, after explaining the defect I found to them for two minutes.

posted @ | Feedback (9) |

Wednesday, June 09, 2004

Yesterday when I was about to send an email to an internal email alias, I noticed a new name, Matt Pietrek. So I wrote him a quick message asking if he is THE Matt Pietrek. His reply was:

Yes, I'm Matt Pietrek. I don't know of any others. 笑脸

Matt is new hire March 22, 2004.

Another famous guy working for Microsoft people may not aware is Tony Hoare (http://research.microsoft.com/~thoare/). I met him while studying in Nanjing University back in the 80s.

posted @ | Feedback (17) |

Sunday, May 16, 2004

I'm collecting large/huge EMF spool files, which are usually generated printing from CAD/CAM/GIS applications. Here are some restrictions:

1) Single page. It's always possible to print lots of pages to generate a huge spool file.

2) Recent version of applications. Old applications may just be silly in generating EMF spool file.

3) Real applications, real documents. It's always possible to copy/paste a medium complex page to generate a very complicated page.

4) EMF spool file, not raw printer data. emf.exe from www.fengyuan.com\download should be able to open EMF spool file.

I usually install a printer driver to LPT2, print to it, and then go to the spooler folder to harvest the EMF spool file (system32\spool\printers).

Thanks

posted @ | Feedback (16) |

Sunday, May 09, 2004

After several years, www.fengyuan.com finally gets a new look. This time, I hired someone to do it for me, 2.5 hours, $5 per hour, for a total cost of $12.5. Like every designer, he left a mark on my website, qc.fengyuan.com.

PS. I finished the blog on new Longhorn printing architecture: http://blog.joycode.com/fyuan/posts/20849.aspx

 

posted @ | Feedback (16) |

At WinHEC today, Microsoft unveiled details about a new printing architecture based on Longhorn's Avalon technology. It is a long time dream coming true for lots of people familar with Windows printing system. The same is true for me as I worked for four years on Deskjet printer drivers for HP, and three years for Microsoft on GDI, GDI+ and Avalon.

Here is a summary of the differences between the new and old printing architecture:

1) Double precision coordinate system. GDI on Win9X uses 16-bit coordinate system internally, GDI on NT-based systems uses 28.4 fixed point coordinate system internally, GDI+ uses single precision floating number. None of them is good enough for large size, high resolution application. Finally, Avalon changes to use double precision floating point numbers.

2) Well documented spool file format. GDI uses EMF as the basics for its spool file format. But the exact file format used is not documented and it even changes from version to version. Longhorn will support a new well documented spool file format, which is based on a subset of XAML, the markup language for Avalon. The Avalon printing system will convert contents into this subset of XAML and write to the new spool file, which can then be consumed by printer drivers, filters or devices capable of processing it. Versioning strategy and digital rights management are built in into the format.

3) Independence from GDI, DDI world. The Win32 printing system is tightly coupled with the GDI, DDI interface designed initially for display devices. Higher level GDI commands are broken down into lower level DDI commands originally designed for dump display devices. Even work group printers have to receive data through this narrow channel. Although starting from Windows 2000, user mode printer drivers are supported, rendering calls are still passed to kernel mode first before being thunked back to user mode printer driver. GDI+ does not have its own printer driver mode, so it just converts GDI+ primitive to GDI commands. Longhorn's printer driver will be based on managed code. Now printer driver is finally away from the driver mode designed for display devices. Printer drivers will be hosted in a managed process with each print queue having its own application domain, isolating bad drivers from good ones.

4) Open filter-based printer driver architecture. In the Win32 world, the first stage of printer driver is actually EMF print processor. But EMF print processor is not given direct access to EMF spool file, instead it's being fed with contents. EMF print processor also does not have direct control over the real printer driver. The real printer driver is a DDI-based driver which only receives one DDI commands at a time. More sophistated printer drivers have to save all DDI commands to a file and implement multi-stage conversion for high quality output. The new printer driver is just a chain of filter, each having directly access to spool files. Printer vendors can implement print processor like features, logging, archieving, page analysis, real conversion within the same framework. There will be lots of opportunity for innovation.

5) Consistent and extensible settings. Printing settings are kept in DEVMODE in Win32 world. But the DEVMODE mode structure was originally designed for 16-bit world so it has lots of limitation. One example is that paper size is limited to 16-bit integers. So printer vendors has to extend DEVMODE by adding data to private DEVMODE which no one else can understand. In the driver UI, there are several property sheet pages which are maintained by printer drivers according to private DEVMODE. There are lots of confusion and inconsistency between public and private settings. In Longhorn, DEVMODE is replaced with PrintTicket, an XML stream which holds all printing related settings. Printer vendors can extend it in a predefined way such that application, print UI can understand them. PrintTicket can be attached at job, document or page level for different levels of control.

6) ScRGB color space. Longhorn printing system will support ScRGB color space, CMYK color space, named color and spot colors, on top of sRGB support. In ScRGB color space, each color channel is represented using single precision floating point number using gamma of 1.0.

7) Smaller spool file size. When applications want to implement advanced graphics features like gradient fill and transparency, EMF spool file can grow to unmanageable size when they are broken down into GDI primitives. Other draw back of EMF spool file is that it does not allow compressed bitmap, unless the printer driver supports PNG and JPG pass-through; and it does not allow reuse of bitmaps. XAML-based spool file can natively represent gradient fill, transparency and different types of image formats. This translates to smaller spool file size and better performance.

8) Improved printing quality. Out of box, Longhorn will support all existing printer drivers on the market through a special built-in conversion path which translates Avalon context into GDI contents. This conversion path will provide far better printing quality than GDI+ implementation currently used by Office and .NET/WinForm applications. Further printing quality improvement can be achieved by implementing full-fledged Longhorn printer drivers.

 

posted @ | Feedback (13) |