`
文章列表
There are two worlds in the windows priting system.    One is the metric/unit system in the GDI system, in which visuals, text, pictures are managed, manipulated, transformed in memory and rendered by the Video card.    With advent of WPF, a device independant visual system is unified. with this ...
This blog is mainly a entry/introduction to the print system, one is the Documetn and Printing System, which most windows application might interact with; the other is Printer Device/Spooler system where devices and settings information are concerned. Document and printing     Document and Pr ...
in the nutshell, it is no difference between a constructor and function, because a constructor is essentially a function.   however, if you just give user a raw constructor, there is no way for the user to mistakenly call it like a normal function. and the consequence is sometimes horrible.     ...
In newer version of Internet explorer, Opera and Firefox, I think the Chrome as well. has the prototype for HTML element.      so by which, the HTML element is represented by some base functions. so you can extend more function to it by add something to its prototype.    /*********************** ...
Javascript is a dynamic type function.  you cannot do something like reflection in other strong langauge.      though you cannot do something like typeof(obj), while you can test if a function is the contructor that cretaed the object.    basically you can test if a function is the constructor t ...
I am using the word, memoization, because it is cool and it sounds like a buzzword, and author of the javascript ninja also called it so.     so, what is memoization. " Memoization is the process of building a function which is capable of remembering its previously  computed answers. " ...
  partially applying a function returns a new function which you can call. Which could be very useful in a lots of situations.     Below is an exapmle that uses the partially applied functions, the code is as below.     String.prototype.csv = String.prototype.split.partial(/,\s*/); ...
The original post is available here:    Convert XAML Flow Document to XPS with Style (multiple page, page size, header, margin)         XPS is a fixed document format in which pages are pre-formated to a fixed page sixe. On the opposite of the spectrum, WPF provides flow document which can be ...
Caching is a advanced topic if you decied to develope some enterprise level application. There are a case studied in this page "Cache and DataBase synchronization through SqlDependency".      A feel of the CacheManager   However, in this article, I am going to show a flavor of the Cach ...
In this page: Understanding the Visual Tree and Logical Tree in WPF , the difference between the Visual Tree and Logical Tree is discussed.   Visual Tree and Logical Tree   In summary.    Visual Tree     represents all of the elements in your UI which render to an output device (typically, ...
Javascript has four kind of functions, namely  global function  constructor prototype  closure I may be wrong about the types, but the rule of thumb is that the functions differs from each other in terms of how the 'this' pointer is determined.   another things that you might be aware is ...
It is a common practise to  divide the programming code into multiple files.  the same principle/rule/doctrin also applies to Javascript.    you may have a .htm file and several modules, each module in its own .js file.  the problem here is how to load the the separate modules into the html file. ...
Let's first see a code example that has !! operator turned on    var store = { id : 1 , cache : {}, add : function(fn) { if (!fn.id) { fn.id = store.id++; return !!(store.cache[fn.id] = fn); } } }; function ninja() {} assert (store.add(ninja), "F ...
with the transition from Winform to WPF, there is rising/upsurging demand to convert from System.Drawing.Icon to System.Media.ImageSource and vice versa (you cannot rule out the possibility to host new tech object in old ones)   Below shows how you can do to convert from System.Drwing.Icon to Image ...
You can define a method to have 'params' type of argument, with the 'params', you can pass argument as you can do in variable arguments as in C++/C.     Here is one example that shows you some tricks and internals with the params in C#.     class Program { static void Main(string[] args ...
Global site tag (gtag.js) - Google Analytics