<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Let&#039;s talk about techs!</title>
	<atom:link href="http://wormtech.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wormtech.wordpress.com</link>
	<description>I&#039;m a little worm exploring the world of techs...</description>
	<lastBuildDate>Thu, 23 Feb 2012 17:03:00 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='wormtech.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/a06f85ae1cd13f455807295a136e7b2d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Let&#039;s talk about techs!</title>
		<link>http://wormtech.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://wormtech.wordpress.com/osd.xml" title="Let&#039;s talk about techs!" />
	<atom:link rel='hub' href='http://wormtech.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Cloud Computing – What businesses should know</title>
		<link>http://wormtech.wordpress.com/2012/02/21/cloud-computing-what-businesses-should-know/</link>
		<comments>http://wormtech.wordpress.com/2012/02/21/cloud-computing-what-businesses-should-know/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 17:21:54 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[cloud computing]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=452</guid>
		<description><![CDATA[Whether you are a manager of a business or an IT professional, you must have heard about cloud computing, one of the hottest buzzword on the Internet these days. Originating from the idea of utility computing, in which computing power can be provided as a service, the cloud promises a huge boost in efficiency for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=452&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Whether you are a manager of a business or an IT professional, you must have heard about cloud computing, one of the hottest buzzword on the Internet these days. Originating from the idea of utility computing, in which computing power can be provided as a service, the cloud promises a huge boost in efficiency for companies by reducing hardware and maintenance cost. In fact, as industry leaders (including Microsoft, Google, Amazon…) now embrace this technology as their strategic weapon, cloud computing is quite capable of becoming “the next big thing”.</p>
<p>How does that impact your business? Well, thinking to move your business on the cloud today may give you a competitive edge in the future. But it also comes at a price. The cloud has always been a realm of uncertainty, and its benefits tend to be exaggerated by massive marketing campaigns to overshadow its drawbacks. Nevertheless, cloud computing seems to have grown into a major trend for the near future. Is it your time to take off? Possibly, but first let us calm down just a little bit and see what awaits your business once you make a move!</p>
<h3>The benefits</h3>
<p>Cloud computing offers a lot features that, when utilized, can bring the following advantages:</p>
<p><strong>Flexibility</strong>: by employing the “pay-as-you-go” service model, businesses are liberated from physical resource limitations. Not only can storage space, processing power, and virtually everything else be allocated on-demand, but you also have to pay for just exactly what you need. This is similar to what already happened with electricity and water. For many businesses, it means cost-saving, reduced manpower and simplified processes.</p>
<p><strong>Scalability</strong>: one of the most appealing feature of cloud computing is that it allows for near infinite scalability, so that you no longer have to worry about your hardware being unable to catch up with the growth rate of your business. This is also very important to companies with seasonal workload, as they will always have enough resources even at peak time, and still don’t need to maintain any idle components when demand drops.</p>
<p><strong>Capital investment</strong>: cloud computing solve the problem of IT spending by outsourcing most of the tasks, including hardware procurement and maintenance, to cloud vendors. Given the fast-changing nature of technology, where a piece of hardware can become obsolete in a relatively short time, senior managements will be relieved to transfer much of the risk to someone else. And that also means they will have more money in hand to deal with other urgent issues of their business.</p>
<p><strong>Portability</strong>: with globalization, enterprises now often scatter across many countries, and they can make use of cloud computing to access computing resources from anywhere on earth. All they need is a moderate PC (also called thin client) and an Internet connection, which are quite ubiquitous. As geographic boundaries are blurred, enterprises find themselves with more freedom than ever before to operate in a global environment.</p>
<h3>The drawbacks</h3>
<p>Though the benefits of cloud computing sound very compelling, it’s wise to remind ourselves that nothing is perfect. Now let’s take another look at the dark side of the cloud! Some of the most notable pitfalls are:</p>
<p><strong>Dependability</strong>: migrating to the cloud may also mean that you’ll have to give up control over your critical application and data. This is the main barrier for businesses which worry about the reliability of cloud services. And it’s a legitimate concern, as it has happened more than once that Google and Amazon have their services offline for some reasons. The problem here lies in the cloud vendors: they need to be able to guarantee about their quality of service (often explicitly stated in the Service Level Agreement) before companies are willing to take a move.</p>
<p><strong>Security</strong>: where are the data stored? Even though some cloud vendors are kind enough to let you specify the region for data storage, most of the time you will not know exactly which physical servers are holding your sensitive information. What if those same machines are hosting applications from your main competitor? What types of isolation are there to prevent unwanted access? Which measures are employed to protect your assets from other common threats such as virus, Trojan horse, or DoS attack? While professionals are busy finding the right answer, some enterprises are now content with the hybrid cloud model: to move only unimportant part of the business to the cloud and keep the most valuable ones in-house.</p>
<h3>Migration guide</h3>
<p>Ok! Enough for the analysis! Now that you have some basic ideas about the gains and losses of cloud computing, you should be able to answer for yourself whether a migration is appropriate. Theoretically, cloud computing is great for SMEs (Small and Medium Enterprises) as these businesses don’t have an abundant cash flow and the saving made by the cloud can help them concentrate their limited resources on core business processes. Of course, large corporates can benefit as well. The important thing is to know your situation and make sure you have several reasons to justify your action. Should you consider migrating, here are a few steps to start with:</p>
<ol>
<li>Build your plan: just as with every non-trivial thing you do, you need to have a plan. Which components do you want to migrate? And which should remain on-premise? Generally, critical systems where integrity is top priority, such as domain controllers and servers that perform financial calculations are not a good choice to move, while web servers and mail servers will make some ideal candidates. Keep in mind that it actually depends on your specific circumstance, the decision is yours to make!</li>
<li>Execute your plan: there are three main phases in the migration process. The first phase is legacy data conversion, which converts old data into a new format compatible with the cloud environment. Next, the converted data will be loaded to the new system. Finally, a verification program will be run to ensure data transfer was a success. Due to the inherent complexity of the job, you may want to ask the cloud vendor for support or hire some professional consultants to deal with sudden problems, but the best way to identify potential pitfalls is to perform a trial upgrade before risking your valuable data. Though this is quite time-consuming, it will help avoid issues that are costly to fix once the execution has started.</li>
<li>Provide post-migration support: this step usually involves training to help user familiarize themselves with the new system. Note that the more educated your users are, the less effort you’ll have to put into help desk service later on, so make sure your employees are well-equipped to adapt to the new changes.</li>
</ol>
<h3>Conclusion</h3>
<p>Though there’re certain concerns about the reliability of cloud services, the benefits it brings are real and interesting in many aspects. Migrating your business to the cloud might be your most important decision to make today, yet the process is complicated at best, so proceed with caution! A well-prepared plan will significantly reduce the risk and allow you to reap the full reward. Still, dependability and security remain the two major issues for the coming years, but should you be willing to take on those challenges to lift your business to a new high, the cloud is yours for the taking!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/452/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=452&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2012/02/21/cloud-computing-what-businesses-should-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Bảo mật form InfoPath trong Sharepoint</title>
		<link>http://wormtech.wordpress.com/2011/11/19/b%e1%ba%a3o-m%e1%ba%adt-form-infopath-trong-sharepoint/</link>
		<comments>http://wormtech.wordpress.com/2011/11/19/b%e1%ba%a3o-m%e1%ba%adt-form-infopath-trong-sharepoint/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 15:54:53 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[InfoPath 2007]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=435</guid>
		<description><![CDATA[Trong thời đại thông tin hiện nay, vấn đề bảo mật luôn là vấn đề thu hút được sự chú ý của mọi người. Có thể nói, nơi nào có thông tin, nơi đó có nhu cầu bảo mật. Bảo mật bao gồm nhiều cấp độ, từ phần mềm, phần cứng, cho tới con người. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=435&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trong thời đại thông tin hiện nay, vấn đề bảo mật luôn là vấn đề thu hút được sự chú ý của mọi người. Có thể nói, nơi nào có thông tin, nơi đó có nhu cầu bảo mật. Bảo mật bao gồm nhiều cấp độ, từ phần mềm, phần cứng, cho tới con người. Trong bài viết hôm nay, chúng ta sẽ đi vào tìm hiểu một khía cạnh hẹp của bảo mật: bảo vệ thông tin trong form InfoPath chạy trên môi trường SharePoint.</p>
<h3>Căn bản về InfoPath</h3>
<p>InfoPath là công cụ có trong một số phiên bản của bộ ứng dụng Office, cho phép tạo form nhanh chóng và thuận tiện. InfoPath cung cấp chế độ thiết kế giao diện theo kiểu kéo thả cùng nhiều tính năng như hỗ trợ kiểm tra nhập liệu (data validation) và tùy biến bằng code. Điểm hấp dẫn nhất của InfoPath là người dùng có thể xây dựng các form phức tạp trong một thời gian tương đối ngắn. Form tạo ra có thể chạy trên cả môi trường web và Windows (tùy theo cấu hình lúc thiết kế) và toàn bộ dữ liệu trong form được lưu ở định dạng XML thân thiện với con người.</p>
<p>Với những ưu điểm đó, InfoPath trở thành lựa chọn phổ biến để thiết kế các form nhập liệu cho ứng dụng, đặc biệt là trên môi trường web bởi InfoPath không yêu cầu người thiết kế các kiến thức chuyên sâu về HTML, CSS hay JavaScript. Vì vậy, không bất ngờ gì khi InfoPath được tích hợp trực tiếp vào trong SharePoint, một công nghệ khác của Microsoft để xây dựng các website ở quy mô doanh nghiệp.</p>
<p>SharePoint cung cấp hỗ trợ cho InfoPath thông qua InfoPath Form Service, một dịch vụ cho phép người dùng cuối làm việc với form ngay trên trình duyệt mà không cần cài đặt InfoPath trên máy tính (yêu cầu giấy phép phiên bản Enterprise của SharePoint 2007 hoặc SharePoint Server 2010). Một form template có thể được xuất bản thành một Content Type  của SharePoint và được tái sử dụng bởi nhiều thư viện khác nhau.</p>
<p>Tóm lại, InfoPath kết hợp với SharePoint là một phương pháp để thu thập và lưu trữ thông tin của người dùng. Cũng như mọi phương pháp lưu trữ thông tin khác, sẽ có lúc bạn nhận thấy cần một biện pháp để bảo vệ dữ liệu của mình khỏi những cặp mắt tò mò. Đó chính là trọng tâm của vấn đề mà chúng ta đang tìm hiểu: bảo mật dữ liệu trên form InfoPath như thế nào?</p>
<h3>Bảo mật trong SharePoint</h3>
<p>Hướng đến đối tượng khách hàng là các doanh nghiệp, SharePoint đã cung cấp một mô hình bảo mật khá hoàn chỉnh mà InfoPath có thể tận dụng. Cơ chế bảo mật này bao gồm việc phân quyền người dùng ở nhiều cấp độ, trong đó phổ biến nhất là ở hai cấp độ: list và item.</p>
<p>Ở cấp độ list, người quản trị site có thể cấp quyền truy xuất list cho các nhóm người dùng xác định. Việc phân quyền có thể thực hiện ngay trên giao diện của SharePoint:</p>
<ul>
<li>Trong SharePoint 2007: Settings – List Settings – Permissions for this list. Click Action – Edit Permissions<a href="http://wormtech.files.wordpress.com/2011/11/list-permission.png"><img class="aligncenter size-full wp-image-437" title="List Permission in SharePoint" src="http://wormtech.files.wordpress.com/2011/11/list-permission.png?w=620&#038;h=301" alt="" width="620" height="301" /></a></li>
</ul>
<ul>
<li>Trong SharePoint 2010: chọn Tab Library trên Ribbon &#8211; Permissions</li>
</ul>
<p>Hạn chế quyền truy xuất list và chỉ cho phép những người dùng phù hợp thao tác trên list sẽ loại bỏ đáng kể những nguy cơ rò rỉ thông tin. Tuy nhiên trong nhiều trường hợp, bạn sẽ cần khả năng kiểm soát chi tiết hơn những gì mà cơ chế phân quyền ở cấp độ list cung cấp. Một ví dụ điển hình là trong một list chứa các đơn hàng, tất cả user thuộc group Employee đều có thể truy xuất list này để tạo các đơn hàng, nhưng mỗi user chỉ có quyền xóa/thay đổi các đơn hàng do chính mình tạo ra mà thôi. Khi đó, bạn sẽ cần đến khả năng phân quyền cho từng item trong list. Cách đơn giản nhất là tạo một event receiver cho list và override phương thức ItemAdded.</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">public override void</span> ItemAdded(<span style="color:#008080;">SPItemEventProperties </span>properties)
{
   <span style="color:#0000ff;">base</span>.ItemAdded(properties);

   <span style="color:#008080;">SPListItem</span> item = properties.ListItem;
   <span style="color:#0000ff;">if</span> (!item.HasUniqueRoleAssignments)
      item.BreakRoleInheritance(<span style="color:#0000ff;">true</span>);

   <span style="color:#008000;">// assign permissions here</span>
   …

   item.Update();
}</pre>
<p>Có thể thấy là, bằng việc hỗ trợ phân quyền ở nhiều mức độ khác nhau, SharePoint đã góp phần giảm bớt những lo lắng về bảo mật. Dù vậy, đôi lúc chỉ sử dụng những gì có sẵn là không đủ. Khi làm việc với InfoPath, một kịch bản thường gặp là phân quyền truy cập cho từng field trên một form.</p>
<p>Lấy ví dụ là một form chứa thông tin đơn hàng với các field chứa dữ liệu như tên mặt hàng, số lượng, đơn giá. Mọi nhân viên đều có quyền xem đơn hàng, nhưng thông tin về giá cả sẽ chỉ được hiển thị cho một số người dùng đặc biệt. Làm thế nào để hiện thực điều này? Thật không may là SharePoint chỉ hỗ trợ phân quyền đến từng list item, và một form được coi là một list item. Nếu bạn cần phải thao tác với từng field, bạn không có cách nào khác là phải tự thực hiện việc này! Trên thực tế, việc ẩn/hiện các field theo điều kiện không phải là quá khó thực hiện trong InfoPath:</p>
<ul>
<li>Trong InfoPath 2007: right click control -&gt; Properties -&gt; Conditional Formatting -&gt; quy định các điều kiện ẩn/hiện control.</li>
<li>Trong InfoPath 2010: right click control -&gt; Rules -&gt; Manage Rules -&gt; New -&gt; Formatting.<a href="http://wormtech.files.wordpress.com/2011/11/infopath-add-formatting-rules.png"><img class="aligncenter size-full wp-image-436" title="InfoPath - Add formatting rules" src="http://wormtech.files.wordpress.com/2011/11/infopath-add-formatting-rules.png?w=620&#038;h=243" alt="" width="620" height="243" /></a></li>
</ul>
<p>Quá dễ dàng, phải không? Nhưng chưa đâu! Nên nhớ rằng mọi dữ liệu của form InfoPath đều được lưu ở dạng XML. Do đó khi bạn ẩn một field nào đó đi thì chẳng qua là nó không được hiển thị ra mà thôi, còn thông tin thì vẫn còn nguyên trong form đấy. Vì vậy chỉ cần người dùng download toàn bộ file gốc về (điều này đặc biệt dễ dàng nếu form được cấu hình để mở trong InfoPath client thay vì mở trên trình duyệt), họ có thể sử dụng một trình soạn thảo văn bản bất kì (như notepad) để đọc toàn bộ những thông tin nhạy cảm. Đương nhiên là bạn có thể cấu hình để không cho phép mở form bằng InfoPath ở phía client, nhưng cách an toàn nhất là mã hóa dữ liệu trong những field này và chỉ cho những người có thẩm quyền giải mã chúng. Thời điểm thích hợp nhất để mã hóa dữ liệu là khi submit form. Để làm việc này, bạn thêm đoạn code sau vào sự kiện Submit của form:</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">public void</span> FormEvents_Submit(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">SubmitEventArgs</span> e)
{
   <span style="color:#008000;">// other submit logic</span>
   …

   <span style="color:#008080;">XPathNavigator</span> xpNav = this.MainDataSource.CreateNavigator()
      .SelectSingleNode(<span style="color:#ff0000;">“path to encrypted node”</span>);
   xpNav.SetValue(Encode(xpNav.Value));

   <span style="color:#008000;">// other submit logic</span>
   …
}

<span style="color:#0000ff;">public string</span> Encode(<span style="color:#0000ff;">string</span> source)
{
   <span style="color:#0000ff;">byte</span>[] binarySource = <span style="color:#008080;">Encoding</span>.UTF8.GetBytes(source);
   System.Security.Cryptography.<span style="color:#008080;">SymmetricAlgorithm</span> rijn =
      System.Security.Cryptography.<span style="color:#008080;">SymmetricAlgorithm</span>.Create();
   <span style="color:#008080;">MemoryStream </span>ms = <span style="color:#0000ff;">new </span><span style="color:#008080;">MemoryStream</span>();
   <span style="color:#0000ff;">byte</span>[] rgbIV = <span style="color:#008080;">Encoding</span>.ASCII.GetBytes(<span style="color:#ff0000;">"initialization vector"</span>);
   <span style="color:#0000ff;">byte</span>[] key = <span style="color:#008080;">Encoding</span>.ASCII.GetBytes(<span style="color:#ff0000;">"key to encrypt/decrypt data"</span>);
   <span style="color:#008080;">CryptoStream </span>cs = <span style="color:#0000ff;">new </span><span style="color:#008080;">CryptoStream</span>(ms, rijn.CreateEncryptor(key,
      rgbIV), CryptoStreamMode.Write);
   cs.Write(binarySource, 0, binarySource.Length);
   cs.Close();
   <span style="color:#0000ff;">return</span> <span style="color:#008080;">Convert</span>.ToBase64String(ms.ToArray());
}</pre>
<p>Tương tự, trong hàm xử lý sự kiện load của form, thêm đoạn code sau để chứng thực người dùng và giải mã dữ liệu:</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">public void</span> FormEvents_Loading(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">LoadingEventArgs</span> e)
{
   <span style="color:#008000;">// add your authentication logic here</span>
   …

   <span style="color:#008000;">// if authenticated, then decrypt data</span>
   <span style="color:#0000ff;">if</span>(authenticated)
   {
      <span style="color:#008080;">XPathNavigator</span> encryptedNode = this.MainDataSource.CreateNavigator()
         .SelectSingleNode(<span style="color:#ff0000;">“path to encrypted node”</span>);
      encryptedNode.SetValue(Decode(encryptedNode.Value));
   }
}

<span style="color:#0000ff;">private string</span> Decode(<span style="color:#0000ff;">string</span> source)
{
   <span style="color:#0000ff;">byte</span>[] binarySource = <span style="color:#008080;">Convert</span>.FromBase64String(source);
   <span style="color:#008080;">MemoryStream </span>ms = <span style="color:#0000ff;">new </span><span style="color:#008080;">MemoryStream</span>();
   System.Security.Cryptography.<span style="color:#008080;">SymmetricAlgorithm </span>rijn =
      System.Security.Cryptography.<span style="color:#008080;">SymmetricAlgorithm</span>.Create();
   <span style="color:#0000ff;">byte</span>[] rgbIV = <span style="color:#008080;">Encoding</span>.ASCII.GetBytes(<span style="color:#ff0000;">"initialization vector"</span>);
   <span style="color:#0000ff;">byte</span>[] key = <span style="color:#008080;">Encoding</span>.ASCII.GetBytes(<span style="color:#ff0000;">"key to encrypt/decrypt data"</span>);
   <span style="color:#008080;">CryptoStream </span>cs = <span style="color:#0000ff;">new </span><span style="color:#008080;">CryptoStream</span>(ms, rijn.CreateDecryptor(key, rgbIV),
      CryptoStreamMode.Write);
   cs.Write(binarySource, 0, binarySource.Length);
   cs.Close();
   <span style="color:#0000ff;">return</span> <span style="color:#008080;">Encoding</span>.UTF8.GetString(ms.ToArray());
}</pre>
<p>Cuối cùng, có thể bạn sẽ muốn tăng tính tin cậy cho form bằng cách áp dụng chữ ký điện tử. Bạn có thể tìm thấy các tùy chọn sử dụng chữ ký điện tử trong Form Options -&gt; Digital Signatures. Chi tiết phần này xin dành cho các bạn tự khám phá!</p>
<p>Bài viết đã trình bày tổng quan về một số phương pháp bảo mật với InfoPath chạy trên môi trường SharePoint. Hi vọng những kiến thức trên đây ít nhiều sẽ có ích cho các bạn khi làm việc với InfoPath. Thân chào!</p>
<p>* Tham khảo: <a title=".NET Cryptography &amp; Mã hóa dữ liệu" href="http://wormtech.wordpress.com/2011/01/04/net-cryptography-ma-hoa-d%e1%bb%af-li%e1%bb%87u/">Mã hóa dữ liệu với .NET Cryptography</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/435/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=435&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/11/19/b%e1%ba%a3o-m%e1%ba%adt-form-infopath-trong-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/11/list-permission.png" medium="image">
			<media:title type="html">List Permission in SharePoint</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/11/infopath-add-formatting-rules.png" medium="image">
			<media:title type="html">InfoPath - Add formatting rules</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Authentication: From Classic to Claim-Based (Part II)</title>
		<link>http://wormtech.wordpress.com/2011/10/08/sharepoint-authentication-from-classic-to-claim-based-part-ii/</link>
		<comments>http://wormtech.wordpress.com/2011/10/08/sharepoint-authentication-from-classic-to-claim-based-part-ii/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 13:29:44 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[claim]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[single-sign-on]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=425</guid>
		<description><![CDATA[Claim-Based Authentication In a simplistic world, one may think that using a single authentication method (such as NTLM or Kerberos) is sufficed for all the need. For example, a Windows application that doesn’t need much information about its users and that will be accessed only by people inside an organization. It’s true that Kerberos or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=425&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Claim-Based Authentication</h3>
<p>In a simplistic world, one may think that using a single authentication method (such as NTLM or Kerberos) is sufficed for all the need. For example, a Windows application that doesn’t need much information about its users and that will be accessed only by people inside an organization. It’s true that Kerberos or even NTLM would do well in such a situation. However, reality is rarely this simple. Suppose that you now want to know more about each user than just a simple username and password provided by Kerberos. You will need some way to acquire this information from either Active Directory Domain Service or another source. And what if the application must be accessed both inside the organization and via the Internet? What if you’d like to let users from a business partner to single-sign-on to your application? Obviously you are in need of a more powerful authentication mechanism!</p>
<p>The preferred solution here is to have one approach based on industrial standards that interoperate between multiple platforms and organizations. That solution should also be widely implemented in many products and simple to use. Does it sound too ambitious? Actually, there exists such a solution, and that’s claims-based identity!</p>
<p>Claims-based identity relies on the Secure Token Service (STS) to authenticate users rather than requiring the application to do the job itself. Developers are thereby released from the burden of user authentication. They don’t need to care how the user proved its identity to the STS – with a password, a digital signature, or something else. This also implies that the application can be deployed independent of contexts, a dramatic improvement over the usual situation today.</p>
<p style="text-align:center;" align="center"><a href="http://wormtech.files.wordpress.com/2011/10/token_and_claims1.png"><img class="aligncenter size-full wp-image-430" title="token_and_claims" src="http://wormtech.files.wordpress.com/2011/10/token_and_claims1.png?w=620" alt="Token and Claims"   /></a></p>
<p align="center">Figure 3 – Token and Claims</p>
<p>So what is a claim exactly? A claim is, indeed, nothing more than a statement about a user. For example, a claim can contain a user’s name, role, or age. A claim might also indicate a user’s right to do something, such as access a file, or restrict some right, such as setting a bandwidth limit. Multiple claims about a specific user are transferred over the network inside of a token, which also includes a signature from the STS that issues it.</p>
<p>Imagine that a user wants to access an application from his browser. The browser first asks the STS for a token containing claims about the user (step 1). The STS authenticates the user, for example, using Kerberos ticket (step 2) to ensure that the user is who he claims to be. The STS then looks up information about both the user and the application in a database (step 3). Once the STS has found what it needs, it generates the token and returns it to the browser (step 4). The browser then use this token to access the application, providing the information it needs from the claims inside the token. Of course, for all of this to work, the application must trust the STS.</p>
<p style="text-align:center;" align="center"><a href="http://wormtech.files.wordpress.com/2011/10/user_acquires_token_from_sts.png"><img class="aligncenter size-full wp-image-431" title="user_acquires_token_from_sts" src="http://wormtech.files.wordpress.com/2011/10/user_acquires_token_from_sts.png?w=620" alt="user acquires token from sts"   /></a></p>
<p align="center">Figure 4 – A user acquiring a token from an STS</p>
<h3>Federation Providers<strong></strong></h3>
<p>So you may wonder, what happens when the application you want to access doesn’t trust the STS from which you get your identity? Would you be in a hopeless situation? Well, it turns out that even though the application doesn’t trust your STS, it might trust another STS that in turn trusts your STS. This concept is called <em>identity federation</em>, and is very useful. With federation, you still get your identity from an STS as usual, but there’s another STS behind the scene which is offered by a <em>federation provider (FP)</em>. The federation provider STS is then configured by an administrator to trust the identity provider STS. This is illustrated in the image below.</p>
<p style="text-align:center;" align="center"><a href="http://wormtech.files.wordpress.com/2011/10/identity_provider_and_federation_provider.png"><img class="aligncenter size-full wp-image-432" title="identity_provider_and_federation_provider" src="http://wormtech.files.wordpress.com/2011/10/identity_provider_and_federation_provider.png?w=620&#038;h=372" alt="identity provider and federation provider" width="620" height="372" /></a></p>
<p align="center">Figure 5 – Identity Provider and Federation Provider</p>
<p>The image is pretty self-explanatory. To the end user, the complex authentication process is completely invisible. The user may not even be aware of being authenticated as no explicitly login is required, that is, he’s enjoying the benefit of what’s known as <em>single sign-on</em>. The underlying procedures are actually more complicated, but the core idea is straightforward: the power of claim is extended by the fact that one STS can trust another STS.</p>
<h3>Conclusion</h3>
<p>This overview has taken us through some of the basic concepts in SharePoint authentication. The topic of SharePoint authentication, however, is much bigger than what can be described here. A good understanding of NTLM, Kerberos and Claim-Based Identity will proved to be critically important to any SharePoint administrator. But as requirements change and new threats emerge, there’s always something out there to keep learning!</p>
<h3>References:</h3>
<ol>
<li>Claims-Based Identity For Windows – David Chappell</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/425/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=425&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/10/08/sharepoint-authentication-from-classic-to-claim-based-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/10/token_and_claims1.png" medium="image">
			<media:title type="html">token_and_claims</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/10/user_acquires_token_from_sts.png" medium="image">
			<media:title type="html">user_acquires_token_from_sts</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/10/identity_provider_and_federation_provider.png" medium="image">
			<media:title type="html">identity_provider_and_federation_provider</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Authentication: From Classic to Claim-Based (Part I)</title>
		<link>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-from-classic-to-claim-based-part-i/</link>
		<comments>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-from-classic-to-claim-based-part-i/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 18:24:33 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=421</guid>
		<description><![CDATA[SharePoint Server 2010 is packed with a slew of authentication methods designed to fit into various situations. Though powerful, it also introduces some complexities that can confuse administrators and architects with questions such as “What are the pros and cons of each methods?” and “When should I use claim?”. This article hopes to shed some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=421&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SharePoint Server 2010 is packed with a slew of authentication methods designed to fit into various situations. Though powerful, it also introduces some complexities that can confuse administrators and architects with questions such as “What are the pros and cons of each methods?” and “When should I use claim?”. This article hopes to shed some light on the subject by providing an overview on some of SharePoint’s most popular authentication methods, including the “classic” NTLM and Kerberos and the fancy Claim-Based Authentication with supported for Single-Sign-On scenarios.</p>
<h3>NTLM</h3>
<p>NTLM is Microsoft’s proprietary authentication protocol used on Windows networks and stand-alone systems. NTLM credentials are made up from a domain name, a user name, and a one-way hash of the user&#8217;s password. An encrypted challenge/response protocol helps authenticate a user without sending the user&#8217;s password over the wire.</p>
<p>NTLM is the default authentication method in SharePoint, partly due to its simplicity, but it’s also rather limited compared to Kerberos (which is why Microsoft no longer recommends using NTLM in applications). However, NTLM is still widely used today in situations where Kerberos is not supported.</p>
<p>The following steps describe NTLM authentication process:</p>
<p style="padding-left:30px;">1. The client sends the user name to the server.<br />
2. The server generates a challenge (a 16-byte random number) and sends it to the client.<br />
3. The client responds by encrypting this challenge with the hash of the user&#8217;s password and returns the result to the server.<br />
4. The server sends the following three items to the domain controller:</p>
<p style="padding-left:60px;">+ User name<br />
+ Challenge sent to the client<br />
+ Response received from the client</p>
<p style="padding-left:30px;">5. The domain controller looks up the user&#8217;s password hash from the Security Account Manager database and uses it to encrypt the challenge.<br />
6. The domain controller compares the encrypted challenge it computed (in step 6) to the response computed by the client (in step 4). If they are identical, authentication is successful.</p>
<p><a href="http://wormtech.files.wordpress.com/2011/09/ntlm-authentication-process.png"><img class="aligncenter size-full wp-image-422" title="Figure 1 - NTLM Authentication Process" src="http://wormtech.files.wordpress.com/2011/09/ntlm-authentication-process.png?w=620" alt="NTLM Authentication Process"   /></a></p>
<h3>Kerberos</h3>
<p>The <em>Kerberos protocol</em> works on the idea of &#8220;tickets&#8221; that allow devices to safely prove their identity to one another in a non-secure environment. In this protocol, the Key Distribution Center (KDC) plays a vital part as the ticket provider from which all clients obtain their tickets. Clients then present those tickets to the server against which they want to authenticate. Kerberos tickets represent the client&#8217;s network <em>credentials</em>.</p>
<p>Here are some of the advantages over NTLM that Kerberos offers:</p>
<ul>
<li><strong>Mutual authentication</strong>: Kerberos enables the client to verify the server’s identity.</li>
<li><strong>Delegation support:</strong> clients can be impersonated to use their security context to access network resources.</li>
<li><strong>Performance</strong>. Kerberos authentication offers improved performance over NTLM authentication. It is also reported that Kerberos uses less network bandwidth than NTLM.</li>
<li><strong>Simplified trust management</strong>. Networks with multiple domains no longer require a complex set of explicit, point-to-point trust relationships.</li>
<li><strong>Interoperability</strong>. The Kerberos protocol relies on open standards, and is not limited to proprietary codes or authentication mechanisms. As a result, it has much better interoperability with other networks where Kerberos is used for authentication.</li>
</ul>
<p>The following figure shows what happen when a client issues an authentication request: basically, it contacts the KDC for the ticket which can be use to authenticate at the server.</p>
<p><a href="http://wormtech.files.wordpress.com/2011/09/kerberos-authentication-process.png"><img class="aligncenter size-full wp-image-423" title="Figure 2 - Kerberos Authentication Process" src="http://wormtech.files.wordpress.com/2011/09/kerberos-authentication-process.png?w=620" alt="Kerberos Authentication Process"   /></a></p>
<h3>References:</h3>
<ol>
<li><a title="NTLM on MSDN" href="http://msdn.microsoft.com/en-us/library/aa378749(v=vs.85).aspx" target="_blank">NTLM on MSDN</a></li>
<li><a title="Kerberos on MSDN" href="http://msdn.microsoft.com/en-us/library/aa378747(v=VS.85).aspx" target="_blank">Kerberos on MSDN</a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=421&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-from-classic-to-claim-based-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/09/ntlm-authentication-process.png" medium="image">
			<media:title type="html">Figure 1 - NTLM Authentication Process</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/09/kerberos-authentication-process.png" medium="image">
			<media:title type="html">Figure 2 - Kerberos Authentication Process</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint Authentication &amp; Single-Sign-On with ADFS: Slideshow for SharePoint Saturday Vietnam 3rd</title>
		<link>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-single-sign-on-with-adfs-slideshow-for-sharepoint-saturday-vietnam-3rd/</link>
		<comments>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-single-sign-on-with-adfs-slideshow-for-sharepoint-saturday-vietnam-3rd/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 17:48:36 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[ADFS]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[single-sign-on]]></category>
		<category><![CDATA[WIF]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=418</guid>
		<description><![CDATA[This is the slide that I used at the SharePoint Saturday Vietnam 3rd event. Hope that someone might find it helpful! The content is about authentication in SharePoint. It comprises of four parts: Plan Authentication Methods: overview of authetication methods in SharePoint, also examine two classic authentication methods: NTLM &#38; Kerberos Claim-Based Authentication: explains the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=418&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the slide that I used at the SharePoint Saturday Vietnam 3rd event. Hope that someone might find it helpful!</p>
<p>The content is about authentication in SharePoint. It comprises of four parts:</p>
<ul>
<li>Plan Authentication Methods: overview of authetication methods in SharePoint, also examine two classic authentication methods: NTLM &amp; Kerberos</li>
<li>Claim-Based Authentication: explains the new authentication mode in SharePoint 2010: Claim-Based. What is it? How does it function? What benefit does it brings? Those are some of the questions that this part wants to answer.</li>
<li>Microsoft Claim: focuses on Microsoft claim technology and take a brief look at the underlying programming foundation: Windows Identity Foundation (WIF)</li>
<li>Single-Sign-On using ADFS: how to use ADFS to allow Single-Sign-On to SharePoint applications</li>
</ul>
<p><a title="SharePoint Saturday Vietnam 3rd Slide - SharePoint Authentication &amp; Single-Sign-On using ADFS" href="https://skydrive.live.com/view.aspx?cid=A951D7ADF353803E&amp;resid=A951D7ADF353803E%21211" target="_blank">Download Link</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=418&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/09/13/sharepoint-authentication-single-sign-on-with-adfs-slideshow-for-sharepoint-saturday-vietnam-3rd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Human &amp; Intelligent Machines &#8211; Some thought on The 7 Habits of Highly Effective People</title>
		<link>http://wormtech.wordpress.com/2011/08/15/human-intelligent-machines-some-thought-on-the-7-habits-of-highly-effective-people/</link>
		<comments>http://wormtech.wordpress.com/2011/08/15/human-intelligent-machines-some-thought-on-the-7-habits-of-highly-effective-people/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 18:19:12 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=414</guid>
		<description><![CDATA[This article is the result of a sudden inspiration. A kinda busy (but lazy) weekend and I decided to take some reading to relax. As I go with The 7 Habits of Highly Effective People, I noticed some points very similar to what I&#8217;ve learnt in an old book of Artificial Intelligence: A matured person [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=414&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This article is the result of a sudden inspiration. A kinda busy (but lazy) weekend and I decided to take some reading to relax. As I go with The 7 Habits of Highly Effective People, I noticed some points very similar to what I&#8217;ve learnt in an old book of Artificial Intelligence:</p>
<ul>
<li>A matured person should be independent &#8211; an &#8220;intelligent&#8221; agent should be autonomous</li>
<li>Interdependence is a higher form of independence, as in real world, people can have complex relationships &#8211; In a multi-agent system, an agent interacts with others to achieve its own goal, and still remains autonomous.</li>
<li>Every human has a set of paradigms, or maps of this world, that governs the way he thinks and acts &#8211; an agent maintains a knowledge base of what it perceives and use that knowledge to make decision. Of course, neither humans nor agents are omniscient, and their knowledge may be far from truth.</li>
<li>Given such imperfection, it&#8217;s important that we are able to learn from experiences. Humans possess self-awareness or the ability to think about our thought process. This explains why we can get rid of some habits or adopted new ones. In the same way, agents can be design to incorporate a self-study mechanism that helps them learn from failures and deal with uncertainty.</li>
</ul>
<p>Ok! So&#8230;?</p>
<p>It seems that human and agent share a lot in common. After all, the ultimate goal of AI is to create intelligent machines that model human behaviors. How can that be possible if we don&#8217;t first understand our own reasoning process? Unsurprisingly AI has its root deep in philosophy and psychology, where the foundation of human mind theories were laid. Learning AI is therefore learning about ourself. Perhaps that&#8217;s what makes it such an interesting field to discover!</p>
<p>Reading The 7 Habits of Highly Effective People is a quite refreshing experience as it reminds me of a familiar but often overlooked fact that people (or agents) tend to have very different views of a specific truth. It&#8217;s true that our number one problem is the way we see the problem. And to solve that requires a thorough approach, not a superficial change of attitude or behavior. Just as an agent&#8217;s inference algorithm becomes useless if it doesn&#8217;t know what it already knows, it&#8217;s only when we understand our own paradigm that we can make a true paradigm shift toward becoming highly effective people.</p>
<p><strong>   * Recommend reading:</strong></p>
<p><a title="Book on Amazon" href="http://www.amazon.com/Habits-Highly-Effective-People/dp/0671708635" target="_blank">The 7 Habits of Highly Effective People</a> (Stephen R. Covey)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=414&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/08/15/human-intelligent-machines-some-thought-on-the-7-habits-of-highly-effective-people/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Kiến trúc ứng dụng: Client-Server vs Service-Oriented</title>
		<link>http://wormtech.wordpress.com/2011/06/26/ki%e1%ba%bfn-truc-%e1%bb%a9ng-d%e1%bb%a5ng-client-server-vs-service-oriented/</link>
		<comments>http://wormtech.wordpress.com/2011/06/26/ki%e1%ba%bfn-truc-%e1%bb%a9ng-d%e1%bb%a5ng-client-server-vs-service-oriented/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 06:17:36 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Client-Server]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=399</guid>
		<description><![CDATA[Client-Server và Service-Oriented là hai cái tên thường được nhắc đến khi nói về kiến trúc phần mềm hiện nay. Vậy hai kiến trúc đó mang những đặc điểm gì và chúng thực sự khác nhau như thế nào? 1. Kiến trúc Client-Server Kiến trúc Client-Server được sử dụng trong các hệ thống phân tán và bao gồm hai thành phần riêng [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=399&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Client-Server và Service-Oriented là hai cái tên thường được nhắc đến khi nói về kiến trúc phần mềm hiện nay. Vậy hai kiến trúc đó mang những đặc điểm gì và chúng thực sự khác nhau như thế nào?</p>
<h3>1. Kiến trúc Client-Server</h3>
<p>Kiến trúc Client-Server được sử dụng trong các hệ thống phân tán và bao gồm hai thành phần riêng biệt: server đóng vai trò phục vụ cung cấp chức năng, và client trong vai trò người tiêu thụ sử dụng các chức năng đó. Thông thường hai thành phần này kết nối với nhau qua mạng, với client là bên chủ động tạo kết nối và gửi yêu cầu đến server, trong khi server thụ động lắng nghe và hồi đáp các yêu cầu. Mô hình client-server đơn giản nhất gồm một server phục vụ cho một hoặc nhiều client đồng thời, còn gọi là kiến trúc hai lớp (2-Tier). Một ví dụ phổ biến cho các ứng dụng Client-Server là các chương trình chat và email đã quá thông dụng hiện nay.</p>
<p>Các ưu điểm nổi bật của kiến trúc Client-Server gồm:</p>
<ul>
<li>Quản lý tập trung: dữ liệu được lưu trữ tập trung trên server thay vì nằm rải rác trên nhiều máy, giúp đơn giản hóa việc truy xuất và cập nhật dữ liệu.</li>
<li>Dễ bảo trì: nhờ khả năng quản lý tập trung mà công việc bảo trì cũng trở nên nhẹ nhàng hơn vì phần lớn việc bảo trì chỉ cần thực hiện trên server. Trong trường hợp hệ thống có nhiều server với thiết bị dự phòng, quá trình bảo trì (như sửa chữa, thay thế server) có thể diễn ra hoàn toàn trong suốt với phía client.</li>
<li>Bảo mật: dữ liệu tập trung trên server đồng nghĩa với việc kiểm soát dễ dàng hơn.</li>
</ul>
<p>Kiến trúc Client-Server cũng có một số biến thể như:</p>
<ul>
<li>Peer-to-Peer: thực chất cũng theo mô hình Client-Server, tuy nhiên Client và Server thường xuyên hoán đổi vai trò cho nhau (máy A vừa sử dụng chức năng của máy B, vừa cung cấp một chức năng khác cho máy B, hai máy này lần lượt đóng cả hai vai trò Client và Server).</li>
<li>Application Server: thay vì chạy các ứng dụng ở phía client, các ứng dụng này được cài đặt và thực thi trên server. Client sử dụng các ứng dụng này bằng cách kết nối vào server. Mô hình này đơn giản hóa đáng kể việc triển khai ứng dụng (chỉ cần cài đặt một lần trên server) và giảm bớt yêu cầu phần cứng của client (do ứng dụng chạy trên server thay vì client, vì vậy mà các client này còn được gọi là &#8220;thin client&#8221;).</li>
</ul>
<h3>2. Kiến trúc Service-Oriented</h3>
<p>Service-Oriented Architecture (SOA) hay kiến trúc hướng dịch vụ là một cái tên đang trở thành trào lưu hiện nay. SOA cung cấp một phương pháp giao tiếp dạng thông điệp (message-based) thông qua các giao diện, trong đó logic nghiệp vụ được phân chia vào trong các service. Các đặc tính cơ bản của SOA như sau:</p>
<ul>
<li>Tính tự hành: các service có thể được triển khai, bảo trì và hoạt động độc lập.</li>
<li>Liên kết lỏng: các service không phụ thuộc nhau, và chúng có thể được thay thế hoặc cải tiến mà không ảnh hưởng đến nhau, miễn là giao diện của các service vẫn đảm bảo tính tương thích.</li>
<li>Các schema và giao diện chung: cho khả năng tái sử dụng ở cấp độ vĩ mô (service) thay vì vi mô (class), đồng thời cho phép kết nối tới các hệ thống cũ hơn.</li>
</ul>
<p>Các lợi ích chính của SOA gồm:</p>
<ul>
<li>Tính trừu tượng: các dịch vụ là độc lập và được truy xuất thông qua một bản hợp đồng (contract) chính thức, qua đó trừu tượng hóa các cơ chế hoạt động nội bộ và tăng tính liên kết lỏng.</li>
<li>Khả năng khám phá: các dịch vụ có thể đưa ra các thông tin tự mô tả để các ứng dụng khác có thể tìm hiểu và xác định giao diện làm việc.</li>
<li>Khả năng hoạt động chung (interoperability): do các giao thức và định dạng dữ liệu đều đã được chuẩn hóa, các dịch vụ và các ứng dụng tiêu thụ chúng có thể được xây dựng trên các nền tảng khác nhau.</li>
<li>Khả năng tái sử dụng: giúp giảm bớt thời gian và chi phí xây dựng hệ thống.</li>
</ul>
<p>Trên thực tế, SOA có thể coi như một biến thể của Client/Server, bởi trong mô hình SOA vẫn tồn tại thành phần server (ứng dụng host các service) và client (ứng dụng sử dụng service). Điểm khác biệt ở chỗ định nghĩa của kiến trúc Client/Server không đề cập đến việc tách các nhóm chức năng của server thành các dịch vụ riêng biệt cũng như quy định các giao diện để giao tiếp với các dịch vụ đó. Vì vậy mà người ta có thể dễ dàng thiết kế và xây dựng các server theo kiểu monolithic, nghĩa là dồn tất cả các chức năng vào trong một ứng dụng lớn duy nhất, làm hạn chế khả năng tái sử dụng, bảo trì và tương tác với các hệ thống khác.</p>
<h3>3. Nhận xét</h3>
<p>Kiến trúc Client/Server phù hợp cho các ứng dụng phải phục vụ nhiều client, chẳng hạn như các ứng dụng web chạy trên trình duyệt. Kiến trúc này cũng đặc biệt thích hợp trong trường hợp cần tập trung hóa dữ liệu và công tác quản lý, hoặc khi ứng dụng cần phải hỗ trợ nhiều loại client và nhiều thiết bị khác nhau.</p>
<p>SOA trở nên lý tưởng hơn khi có nhu cầu tái sử dụng dịch vụ hoặc xây dựng các ứng dụng dạng Cloud, Software plus Service, Software as a Service&#8230;</p>
<p>Tuy nhiên, cần lưu ý rằng, hai kiến trúc này không loại trừ lẫn nhau, mà thường kết hợp cùng nhau. Đặc biệt là trong các hệ thống lớn thường tồn tại nhiều hơn một loại kiến trúc. Chẳng hạn như trong mô hình ứng dụng đa lớp, client gửi yêu cầu dữ liệu đến server, server không truy xuất trực tiếp database mà gọi các web service để thực hiện yêu cầu này và trả dữ liệu về cho client.</p>
<p>Tham khảo: <a title="Architectural Patterns and Styles" href="http://msdn.microsoft.com/en-us/library/ee658117.aspx" target="_blank">Architectural Patterns and Styles</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/399/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=399&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/06/26/ki%e1%ba%bfn-truc-%e1%bb%a9ng-d%e1%bb%a5ng-client-server-vs-service-oriented/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Multi-touch and Ink support in Silverlight</title>
		<link>http://wormtech.wordpress.com/2011/06/07/multi-touch-and-ink-support-in-silverlight/</link>
		<comments>http://wormtech.wordpress.com/2011/06/07/multi-touch-and-ink-support-in-silverlight/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 17:00:20 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[multi-touch]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=387</guid>
		<description><![CDATA[Xem bản tiếng Việt Silverlight is Microsoft’s ambitious dream to provide a simple-but-powerful development platform for Rich Internet Applications (RIAs). The release of Windows Phone 7 marks Microsoft’s latest effort to broaden Silverlight’s reach to the booming portable market, where the number of users increases by millions every year. As this market requires nontraditional ways to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=387&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Hỗ trợ Multi-touch và Ink trong Silverlight" href="http://wormtech.wordpress.com/2011/01/16/h%e1%bb%97-tr%e1%bb%a3-multi-touch-va-ink-trong-silverlight/">Xem bản tiếng Việt</a></p>
<p>Silverlight is Microsoft’s ambitious dream to provide a simple-but-powerful development platform for Rich Internet Applications (RIAs). The release of Windows Phone 7 marks Microsoft’s latest effort to broaden Silverlight’s reach to the booming portable market, where the number of users increases by millions every year. As this market requires nontraditional ways to interact with the device (you don’t expect your cell phone to have mouse and full-size keyboard, do you?), Silverlight is also empowered with new support for some of the currently “hot” technologies, including Multi-touch and Ink.</p>
<h3><strong>Multi-touch</strong></h3>
<p><a href="http://wormtech.files.wordpress.com/2011/06/multitouch.png"><img class="alignleft size-full wp-image-390" title="multitouch" src="http://wormtech.files.wordpress.com/2011/06/multitouch.png?w=620" alt=""   /></a>Multi-touch is an exciting technology that contributed to the success of the over-popular iPhone and iPad. Though the first touch-enabled (single-touch) device has appeared long ago, it is only multi-touch that truly pushes user experience to a new level by allowing them to perform complex maneuvers with more than one finger. This can create some fancy effects such as zooming and rotating photos that were previously impossible with single-touch. With more and more devices adopting to use this technology, Silverlight of course, cannot stay out of the game. Indeed, Silverlight, since version 3.0, has officially support Multi-touch.</p>
<p>Multi-touch is basically an input method, and the first thing we usually think about input processing is input events. In Silverlight, the main event that we need to care about is FrameReported, declared in the Touch class. Registering this event is as simple as follow:</p>
<pre style="padding-left:30px;"><span style="color:#008080;">Touch</span>.FrameReported += <span style="color:#0000ff;">new</span> <span style="color:#008080;">TouchFrameEventHandler</span>(Touch_FrameReported);</pre>
<p>Notice that unlike some common events such as Button.Click, FrameReported is a static event that doesn’t link to any specific instances of the Touch class (actually Touch is also static and therefore cannot have any instances!). When a device is touched, it raises this event repeatedly after a specific interval, the duration of which depends largely on the hardware being used. But for now we’ll skip the details, our interest here is how to handle this event, so let’s shift our focus to the event handler:</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">void</span> OnTouchFrameReported(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">TouchFrameEventArgs</span> e)
{
   <span style="color:#0000ff;">string</span> str = <span style="color:#993300;">""</span>;
   <span style="color:#0000ff;">foreach</span> (<span style="color:#008080;">TouchPoint</span> tp <span style="color:#0000ff;">in</span> e.GetTouchPoints(<span style="color:#0000ff;">this</span>))
   {
      str += string.Format(<span style="color:#993300;">"{0}; "</span>, tp.Position);
   }
   <span style="color:#008080;">MessageBox</span>.Show(str);
}</pre>
<p>Not surprisingly, it’s no different from that of a normal event. The above code simply collects the position of each touch point and displays them on the screen. There’s only one thing that needs a bit more explanation, that’s the second parameter of type TouchFrameEventArgs of the event handling method. This parameter contains useful members, including the two methods GetPrimaryTouchPoint() and GetTouchPoints(), whose names are already self-explanatory: GetPrimaryTouchPoint() returns the first touch point in the series (represented by an object of the TouchPoint class), while GetTouchPoints() returns a collection of all touch points. The TouchPoint class provides the following properties:</p>
<ul>
<li>Position: the coordinate of the touch point. This can be relative to another UI element (if you pass that element to GetPrimaryTouchPoint() or GetTouchPoints()) or absolute (passing null).</li>
<li>Size: the size of the touch point, reflecting how strong you press your finger.</li>
<li>Action: describes the user’s activity. A Down value means the user just pressed his finger on the screens, Up means the user lifted his finger, and Move means the finger was dragged.</li>
<li>TouchDevice: the device that provides information about the touch. The DirectlyOver property of TouchDevice returns the topmost UI element at the touch point. This is mainly for compatibility with WPF.</li>
</ul>
<h3><strong>Ink</strong></h3>
<p>Ink is a special type of content in the form of drawings created by an input device such as mouse or stylus (a pen-like input device). Silverlight provides one class, the InkPresenter, that facilitates the way you work with Ink. The ink itself is represented by a Stroke instance. Here’s the code to create an InkPresenter in XAML:<a href="http://wormtech.files.wordpress.com/2011/06/ink.png"><img class="alignright size-medium wp-image-389" title="ink" src="http://wormtech.files.wordpress.com/2011/06/ink.png?w=300&#038;h=199" alt="" width="300" height="199" /></a></p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">&lt;</span><span style="color:#993300;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="grid"&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#993300;">InkPresenter</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="inkPresenter"
</span>                 <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">="White"/&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#993300;">Grid</span><span style="color:#0000ff;">&gt;</span></pre>
<p>Just as with Multi-touch, to work with Ink, you will need to know about the events. A common scenario is that in the MouseLeftButtonDown event, we’ll instantiate a new Stroke object, and continue to build up this Stroke as the user drags the device (mouse or stylus…) upon the InkPresenter with the MouseMove event, and finally complete the stroke in the MouseLeftButtonUp event. This is illustrated in the code below:</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">private</span> <span style="color:#008080;">Stroke</span> _stroke;

<span style="color:#0000ff;">public</span> MainPage()
{
   InitializeComponent();

   inkPresenter.MouseLeftButtonDown += <span style="color:#0000ff;">new</span> <span style="color:#008080;">MouseButtonEventHandler</span>(inkPresenter_MouseLeftButtonDown);
   inkPresenter.MouseMove += <span style="color:#0000ff;">new</span> <span style="color:#008080;">MouseEventHandler</span>(inkPresenter_MouseMove);
   inkPresenter.MouseLeftButtonUp += <span style="color:#0000ff;">new</span> <span style="color:#008080;">MouseButtonEventHandler</span>(inkPresenter_MouseLeftButtonUp);
}

<span style="color:#0000ff;">private void</span> inkPresenter_MouseLeftButtonDown(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">MouseButtonEventArgs</span> e)
{
   inkPresenter.CaptureMouse();
   _stroke = <span style="color:#0000ff;">new</span> <span style="color:#008080;">Stroke</span>(e.StylusDevice.GetStylusPoints(inkPresenter));
   inkPresenter.Strokes.Add(_stroke);
}

<span style="color:#0000ff;">private void</span> inkPresenter_MouseMove(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">MouseEventArgs</span> e)
{
   if (_stroke != <span style="color:#0000ff;">null</span>)
   {
      _stroke.StylusPoints.Add(e.StylusDevice.GetStylusPoints(inkPresenter));
   }
}

<span style="color:#0000ff;">private void</span> inkPresenter_MouseLeftButtonUp(<span style="color:#0000ff;">object</span> sender, <span style="color:#008080;">MouseButtonEventArgs</span> e)
{
   inkPresenter.ReleaseMouseCapture();
   _stroke = <span style="color:#0000ff;">null</span>;
}</pre>
<p>Besides, the Stroke has many properties that allow you to format the drawing (such as changing size and color…). One great thing about Silverlight is that much of these features are accessible in both ways: declaratively (using XAML) or programmatically (using code). But this time, I’ll leave them up to you to discover.</p>
<h3><strong>Conclusion</strong></h3>
<p><strong></strong>Every application needs input! That’s true unless you never work on anything more complex than a Hello World program. Input can come from many sources: mouse, keyboard, multi-touch or ink… By providing support for such a broad range of input technologies, Silverlight has proven to be suitable for virtually every platform: from web to desktop to mobile computing. May it fulfill Microsoft’s dream about a world powered by Silverlight? Only time will tell but the ability to handle multi-touch and ink input natively are certainly welcome, as it not only simplifies the job of the developers, but also helps create a rich user experience that RIA once promised.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/387/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=387&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/06/07/multi-touch-and-ink-support-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/06/multitouch.png" medium="image">
			<media:title type="html">multitouch</media:title>
		</media:content>

		<media:content url="http://wormtech.files.wordpress.com/2011/06/ink.png?w=300" medium="image">
			<media:title type="html">ink</media:title>
		</media:content>
	</item>
		<item>
		<title>Kiểm soát truy cập với WCF Throttling</title>
		<link>http://wormtech.wordpress.com/2011/05/26/wcf-throttling/</link>
		<comments>http://wormtech.wordpress.com/2011/05/26/wcf-throttling/#comments</comments>
		<pubDate>Thu, 26 May 2011 16:46:31 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[WCF]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=378</guid>
		<description><![CDATA[Dịch vụ của bạn có thể bị quá tải khi số người sử dụng tăng đột biến. Thật không may, các hệ thống phần mềm thường không thích nghi tốt trong những trường hợp như thế này. Kịch bản xấu nhất là toàn hệ thống bị crash dẫn đến việc gián đoạn dịch vụ, gây khó chịu cho cả [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=378&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dịch vụ của bạn có thể bị quá tải khi số người sử dụng tăng đột biến. Thật không may, các hệ thống phần mềm thường không thích nghi tốt trong những trường hợp như thế này. Kịch bản xấu nhất là toàn hệ thống bị crash dẫn đến việc gián đoạn dịch vụ, gây khó chịu cho cả nhà cung cấp lẫn người sử dụng! Để tránh rơi vào tình huống trên, WCF cung cấp một cơ chế cho phép kiểm soát lượng truy cập đến dịch vụ và giới hạn số kết nối tối đa. Tính năng đó gọi là Throttling.</p>
<h3>Cấu hình WCF Throttling</h3>
<p>Cũng như nhiều tính năng khác, Throttling cho phép bạn cấu hình bằng hai cách: khai báo trong file config hoặc bằng lập trình trong code. Ví dụ sau minh họa cách cấu hình theo kiểu khai báo sử dụng thẻ &lt;serviceThrottling&gt; trong phần &lt;serviceBehaviors&gt;</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">system.serviceModel</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">services</span><span style="color:#0000ff;">&gt;</span>
      <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">service</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">="ThrottledService"</span> <span style="color:#ff0000;">behaviorConfiguration</span><span style="color:#0000ff;">=<strong>"ThrottlingDemo"</strong>&gt;</span>
         ...
      <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">service</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">services</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">behaviors</span><span style="color:#0000ff;">&gt;</span>
      <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">serviceBehaviors</span><span style="color:#0000ff;">&gt;</span>
         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">behavior</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">="ThrottlingDemo"&gt;</span>
            <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">serviceThrottling</span>
               <span style="color:#ff0000;">maxConcurrentCalls</span><span style="color:#0000ff;">="100"</span>
               <span style="color:#ff0000;">maxConcurrentSessions</span><span style="color:#0000ff;">="5000"</span>
               <span style="color:#ff0000;">maxConcurrentInstances</span><span style="color:#0000ff;">="5100" /&gt;</span>
         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">behavior</span><span style="color:#0000ff;">&gt;</span>
      <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">serviceBehaviors</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">behaviors</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">system.serviceModel</span><span style="color:#0000ff;">&gt;</span></pre>
<p>Thẻ &lt;serviceThrottling&gt; có 3 thuộc tính quan trọng sau:</p>
<ul>
<li>maxConcurrentCalls: số yêu cầu tối đa đồng thời. Thuộc tính này giới hạn tổng số yêu cầu có thể được xử lý tại một thời điểm. Trong .NET Framework 3.0, giá trị này mặc định là 16. Tuy nhiên con số này là quá thấp trong nhiều trường hợp thực tế dẫn đến việc các nhà quản trị thường xuyên phải cấu hình lại. Vì vậy WCF4 đã thay đổi giá trị mặc định này thành 16 x ProcessorCount (16 x số bộ vi xử lý trên máy).</li>
<li>maxConcurrentSessions: số kết nối có session tối đa. Giá trị mặc định là 10 (WCF3) và 100 x ProcessorCount (WCF4).</li>
<li>maxConcurrentInstances: số đối tượng InstanceContext tối đa. Con số này sẽ tương đương với tổng số session nếu InstanceContextMode là PerSession hoặc tổng số lời gọi dịch vụ đồng thời nếu InstanceContextMode là PerCall. Giá trị mặc định bằng tổng giá trị của maxConcurrentCalls và maxConcurrentSessions.</li>
</ul>
<p>Tương tự, ta cũng có thể thực hiện cấu hình Throttling trong code. Một lưu ý nhỏ là các thiết lập bằng code sẽ ghi đè các thiết lập trong file config trong trường hợp cả hai thiết lập này cùng tồn tại. Việc cấu hình trong code được thực hiện thông qua property Behaviors của lớp ServiceDescription:</p>
<pre style="padding-left:30px;"><span style="color:#008080;">ServiceHost</span> host = <span style="color:#0000ff;">new</span> <span style="color:#008080;">ServiceHost</span>(<span style="color:#0000ff;">typeof</span>(<span style="color:#008080;">ThrottledService</span>));
<span style="color:#008080;">ServiceThrottlingBehavior</span> throttlingBehavior =
   host.Description.Behaviors.Find&lt;<span style="color:#008080;">ServiceThrottlingBehavior</span>&gt;(  );</pre>
<pre style="padding-left:30px;"><span style="color:#0000ff;">if</span>(throttlingBehavior == <span style="color:#0000ff;">null</span>)
{
   throttlingBehavior = <span style="color:#0000ff;">new</span> <span style="color:#008080;">ServiceThrottlingBehavior</span>(  );
   throttlingBehavior.MaxConcurrentCalls = <span style="color:#0000ff;">100</span>;
   throttlingBehavior.MaxConcurrentSessions = <span style="color:#0000ff;">5000</span>;
   throttlingBehavior.MaxConcurrentInstances = <span style="color:#0000ff;">5100</span>;
   host.Description.Behaviors.Add(throttlingBehavior);
}

host.Open(  );</pre>
<p>Đoạn code trên kiểm tra xem đối tượng ServiceThrottlingBehavior có tồn tại hay chưa. Nếu chưa có, một đối tượng mới được tạo và thiết lập các giá trị cần thiết. Nhớ rằng bạn cần phải thực hiện cấu hình trước khi gọi phương thức Open() của ServiceHost.</p>
<p>Ngoài ra, nếu bạn sử dụng TCP hoặc IPC binding, bạn còn có thể chỉ định số kết nối tối đa cho từng Endpoint của binding đó với property MaxConnections của lớp NetTcpBinding hoặc NetNamedPipeBinding. Sau đây là cách cấu hình trong file config (đương nhiên là bạn cũng có thể cấu hình trong code như ở trên):</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">bindings</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">netTcpBinding</span><span style="color:#0000ff;">&gt;</span>
      <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">binding</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">="TCP"</span> <span style="color:#ff0000;">maxConnections</span><span style="color:#0000ff;">="30"/&gt;</span>
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">netTcpBinding</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">bindings</span><span style="color:#0000ff;">&gt;</span></pre>
<h3>Nhận xét</h3>
<p>Throttling bảo vệ dịch vụ khỏi nguy cơ bị vắt kiệt tài nguyên vào những lúc cao điểm bằng cách ngưng xử lý các yêu cầu một khi hệ thống vượt quá mức giới hạn cho phép. Các yêu cầu này không bị từ chối mà được đưa vào hàng đợi chờ đến lượt mình được xử lý. Tuy nhiên nếu thời gian chờ quá dài thì phía client có thể sẽ gặp phải TimeoutException.</p>
<p>Throttling không phải là liều thuốc thần làm tăng năng suất hệ thống. Trên thực tế, Throttling chỉ có tác dụng khi sự gia tăng số lượng client là đột biến và nhất thời. Nó sẽ trở nên vô dụng nếu hệ thống bị quá tải thường xuyên và kéo dài. Trong trường hợp đó, bạn nên nghĩ đến việc nâng cấp hoặc thiết kế lại hệ thống cho phù hợp với nhu cầu sử dụng cao hơn.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/378/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=378&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/05/26/wcf-throttling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Tìm hiểu về HTML5 &#8211; Phần V</title>
		<link>http://wormtech.wordpress.com/2011/05/24/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-v/</link>
		<comments>http://wormtech.wordpress.com/2011/05/24/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-v/#comments</comments>
		<pubDate>Mon, 23 May 2011 17:02:24 +0000</pubDate>
		<dc:creator>worm.NET</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://wormtech.wordpress.com/?p=316</guid>
		<description><![CDATA[Hỗ trợ Multimedia Web không thể hấp dẫn nếu thiếu hình ảnh và âm thanh! Ngày nay, các dịch vụ giải trí đa phương tiện như nghe nhạc, xem phim trực tuyến ngày càng nở rộ và trở thành một phần quan trọng của Internet. Cộng với việc số người sử dụng liên tục gia tăng và băng thông [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=316&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Hỗ trợ Multimedia</h1>
<p>Web không thể hấp dẫn nếu thiếu hình ảnh và âm thanh! Ngày nay, các dịch vụ giải trí đa phương tiện như nghe nhạc, xem phim trực tuyến ngày càng nở rộ và trở thành một phần quan trọng của Internet. Cộng với việc số người sử dụng liên tục gia tăng và băng thông mạng ngày càng được mở rộng, có lẽ đã đến lúc các tổ chức phát triển HTML cần nghĩ đến việc hỗ trợ multimedia một cách nghiêm túc. Và thật may, họ đã làm điều đó trong HTML5!</p>
<h3>Làm việc với thẻ &lt;video&gt; và &lt;audio&gt;</h3>
<p>Khả năng hỗ trợ đa phương tiện trong HTML5 được hiện thực qua việc bổ sung hai thẻ mới là &lt;video&gt; và &lt;audio&gt;. Hãy thử tưởng tượng đây là tất cả những gì bạn cần để thêm một đoạn phim vào trang web:</p>
<pre>   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">video</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">=“myVideo.mp4”&gt;&lt;/</span><span style="color:#800000;">video</span><span style="color:#0000ff;">&gt;</span></pre>
<p>Quá đơn giản, phải không? Thậm chí có thể còn đơn giản hơn nhiều so với việc nhúng một đối tượng Flash vào trang web. Với HTML5, video chỉ còn cách bạn có một dòng code mà thôi!</p>
<p>Tuy nhiên, sẽ không có gì đáng nói nếu đó là tất cả những gì HTML cho phép. Một khi đưa các loại nội dung trên vào website của mình, bạn hẳn mong ước có một cách tương tác với chúng. Một nhu cầu phổ biến là thêm các nút điều khiển cơ bản (như Play/Pause) để người truy cập có thể chủ động phát/ngưng đoạn phim của họ. Thẻ &lt;video&gt; cung cấp thuộc tính controls để đáp ứng nhu cầu này, chúng ta chỉ cần sửa câu khai báo lại như sau:</p>
<pre>   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">video</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">=“myVideo.mp4”</span> <span style="color:#ff0000;">controls</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">video</span><span style="color:#0000ff;">&gt;</span></pre>
<p>Thế là người sử dụng đã có thêm một chút khả năng tương tác rồi đấy, mà bạn thì lại không phải mất thêm giọt mồ hôi nào! Bên cạnh đó, thẻ &lt;video&gt; còn có nhiều thuộc tính hữu dụng khác cho các bạn thích khám phá. Hãy thử áp dụng các thuộc tính sau và xem kết quả nhé:</p>
<ul>
<li><strong>autoplay</strong>: tự động chơi đoạn video khi đã download xong (lưu ý là các đoạn video theo mặc định sẽ không tự play, do đó bạn phải thêm thuộc tính này nếu bạn muốn đoạn video được phát tự động mỗi khi có người truy cập trang web)</li>
<li><strong>height/width</strong>: hai thuộc tính này cho phép quy định kích thước (chiều cao + chiều rộng) của vùng chứa video</li>
<li><strong>loop</strong>: sử dụng thuộc tính này khi bạn muốn đoạn video được phát lặp đi lặp lại liên tục.</li>
</ul>
<p>Cuối cùng, thẻ &lt;audio&gt; cung cấp các chức năng tương tự khi bạn cần làm việc với các file âm thanh. Việc thêm một đoạn nhạc giờ đây trở nên quá dễ dàng:</p>
<pre>   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">audio</span> <span style="color:#ff0000;">autoplay controls</span><span style="color:#0000ff;">&gt;</span>
       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">source</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">="myAudio.mp3"/&gt;</span>
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">audio</span><span style="color:#0000ff;">&gt;</span></pre>
<h3>JavaScript API</h3>
<p>Không chỉ dừng lại ở mức khai báo, HTML5 còn đưa ra một giao diện lập trình để tương tác với các nội dung số trên. Bảng sau đây liệt kê một số hàm và thuộc tính thường dùng nhất:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="background:#224488;color:#ffffff;">
<td valign="top" width="204">Tên</td>
<td valign="top" width="594">Chức Năng</td>
</tr>
<tr style="background:#111111;color:#ffffff;">
<td valign="top" width="204">Hàm</td>
<td valign="top" width="594"></td>
</tr>
<tr>
<td valign="top" width="204">load()</td>
<td valign="top" width="594">Nạp file để sẵn sàng phát.</td>
</tr>
<tr>
<td valign="top" width="204">play()</td>
<td valign="top" width="594">Phát nội dung. Nếu file nội dung chưa được nạp thì nó sẽ được nạp tự động. Nếu đoạn phim hoặc nhạc đang ở trạng thái paused thì nó sẽ được phát tiếp từ vị trí ngưng trước đó.</td>
</tr>
<tr>
<td valign="top" width="204">pause()</td>
<td valign="top" width="594">Tạm ngưng phát nội dung.</td>
</tr>
<tr>
<td valign="top" width="204">canPlayType(type)</td>
<td valign="top" width="594">Kiểm tra xem định dạng file trong tham số type có được hỗ trợ hay không.</td>
</tr>
<tr style="background:#111111;color:#ffffff;">
<td valign="top" width="204">Thuộc tính</td>
<td valign="top" width="594"></td>
</tr>
<tr>
<td valign="top" width="204">currentSrc</td>
<td valign="top" width="594">Tên và đường dẫn tới file đang được phát.</td>
</tr>
<tr>
<td valign="top" width="204">duration</td>
<td valign="top" width="594">Thời lượng của đoạn phim hay nhạc đang phát.</td>
</tr>
<tr>
<td valign="top" width="204">paused</td>
<td valign="top" width="594">Giá trị true nghĩa là việc phát đang bị tạm ngưng.</td>
</tr>
<tr>
<td valign="top" width="204">ended</td>
<td valign="top" width="594">Giá trị true nghĩa là việc phát đã hoàn tất.</td>
</tr>
<tr>
<td valign="top" width="204">autoplay</td>
<td valign="top" width="594">Cho phép kiểm soát việc tự động phát nội dung.</td>
</tr>
<tr>
<td valign="top" width="204">loop</td>
<td valign="top" width="594">Giá trị true nghĩa là nội dung sẽ được phát lặp.</td>
</tr>
<tr>
<td valign="top" width="204">controls</td>
<td valign="top" width="594">Cho phép kiểm soát việc ẩn/hiện các nút điều khiển.</td>
</tr>
<tr>
<td valign="top" width="204">volume</td>
<td valign="top" width="594">Điều chỉnh âm lượng.</td>
</tr>
<tr>
<td valign="top" width="204">muted</td>
<td valign="top" width="594">Ngắt tiếng.</td>
</tr>
</tbody>
</table>
<p>Ví dụ sau minh họa cách sử dụng JavaScript API để tự tạo nút Play cho trình chơi nhạc:</p>
<pre>   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">audio</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="audioPlayer"&gt;</span>
       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">source</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">="myAudio.mp3"/&gt;</span>
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">audio</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">button</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="toggleBtn"</span> <span style="color:#ff0000;">onclick</span><span style="color:#0000ff;">="toggle()"&gt;</span>Play<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">button</span><span style="color:#0000ff;">&gt;</span>
   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">script</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">="text/javascript"&gt;</span>
       <span style="color:#0000ff;">function</span> toogle() {
           <span style="color:#0000ff;">var</span> music = document.getElementById(<span style="color:#800000;">"audioPlayer"</span>);
           <span style="color:#0000ff;">var</span> toggle = document.getElementById(<span style="color:#800000;">"toggleBtn"</span>);
           <span style="color:#0000ff;">if</span> (music.paused) {
               music.play();
               toggle.innerHTML = <span style="color:#800000;">"Pause"</span>;
           }
           <span style="color:#0000ff;">else</span> {
               music.pause();
               toggle.innerHTML = <span style="color:#800000;">"Play"</span>;
           }
       }
   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">script</span><span style="color:#0000ff;">&gt;</span></pre>
<h3>Một vài lưu ý</h3>
<p>Phần lớn các trình duyệt ngày nay đều đã hỗ trợ các thẻ &lt;audio&gt; và &lt;video&gt; của HTML5. Nếu bạn luôn luôn sử dụng các phiên bản mới nhất của IE, Chrome, hay FireFox, bạn không cần phải quá lo lắng về vấn đề tương thích trình duyệt.</p>
<p>Trong trường hợp bạn phải làm việc với các trình duyệt cũ hơn, bạn có thể kiểm tra khả năng của trình duyệt đó bằng đoạn code sau:</p>
<pre>   <span style="color:#0000ff;">var</span> support = !!(document.createElement(<span style="color:#800000;">'video'</span>).canPlayType);</pre>
<p>Mặc dù khả năng hỗ trợ multimedia trong HTML5 là rất tuyệt nhưng vẫn tồn tại một vài hạn chế: chưa có tiêu chuẩn chính thức cho media streaming và khả năng hỗ trợ người khuyết tật chưa hoàn chỉnh. Tuy nhiên, những gì đạt được với HTML5 rõ ràng là một bước tiến dài, và từ nay đến ngày HTML5 chính thức ra đời, biết đâu vẫn còn nhiều thay đổi sẽ được thực hiện.</p>
<p>* <strong>Mục lục:</strong></p>
<ol>
<li><a title="Tìm hiểu về HTML5 - Phần I" href="http://wormtech.wordpress.com/2010/11/20/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-i/">Tổng quan công nghệ</a></li>
<li><a title="Tìm hiểu về HTML5 – Phần II" href="http://wormtech.wordpress.com/2010/11/24/tim-hi%e1%bb%83u-v%e1%bb%81-html5-%e2%80%93-ph%e1%ba%a7n-ii/">Sử dụng các thẻ mới trong HTML5</a></li>
<li><a title="Tìm hiểu về HTML5 - Phần III" href="http://wormtech.wordpress.com/2010/12/06/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-iii/">CSS3 có gì hay?</a></li>
<li><a title="Tìm hiểu về HTML5 – Phần IV" href="http://wormtech.wordpress.com/2010/12/15/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-iv/">HTML5 Canvas API</a></li>
<li><a title="Tìm hiểu về HTML5 – Phần IV (tiếp)" href="http://wormtech.wordpress.com/2011/01/24/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-iv-ti%e1%ba%bfp/">Thực hành: Vẽ đồ thị với HTML5 Canvas API</a></li>
<li><a title="Tìm hiểu về HTML5 – Phần V" href="#">Hỗ trợ Multimedia</a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wormtech.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wormtech.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wormtech.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wormtech.wordpress.com&amp;blog=16849797&amp;post=316&amp;subd=wormtech&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wormtech.wordpress.com/2011/05/24/tim-hi%e1%bb%83u-v%e1%bb%81-html5-ph%e1%ba%a7n-v/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/adc27fd4ab9a0e6c526dd66d117668de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wormdotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
