<?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>Sokhanh03&#039;s Blog</title>
	<atom:link href="http://sokhanh03.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sokhanh03.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 19 Mar 2011 00:53:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sokhanh03.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sokhanh03&#039;s Blog</title>
		<link>http://sokhanh03.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sokhanh03.wordpress.com/osd.xml" title="Sokhanh03&#039;s Blog" />
	<atom:link rel='hub' href='http://sokhanh03.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Twitter style paging with ASP.NET MVC and jQuery</title>
		<link>http://sokhanh03.wordpress.com/2010/08/23/twitter-style-paging-with-asp-net-mvc-and-jquery/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/23/twitter-style-paging-with-asp-net-mvc-and-jquery/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 11:59:00 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/23/twitter-style-paging-with-asp-net-mvc-and-jquery/</guid>
		<description><![CDATA[&#160; I really like the simplicity of the AJAX paging at Twitter so I decided to use the same type of paging, including a similar more button, on the start page on this site. It actually surprised me how simple it was to build it, including fallback for visitors that doesn’t have javascript enabled (such <a href="http://sokhanh03.wordpress.com/2010/08/23/twitter-style-paging-with-asp-net-mvc-and-jquery/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=195&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="widows:2;text-transform:none;text-indent:0;border-collapse:separate;font:medium &#039;white-space:normal;orphans:2;letter-spacing:normal;color:rgb(0,0,0);word-spacing:0;" class="Apple-style-span">
<pre>&#160;</pre>
<p></span></p>
<p>I really like the simplicity of the AJAX paging at Twitter so I decided to use the same type of paging, including a similar more button, on the start page on this site. It actually surprised me how simple it was to build it, including fallback for visitors that doesn’t have javascript enabled (such as our dear friend Google), with ASP.NET MVC and a few lines of javascript with jQuery. </p>
<h4>Basic controller logic</h4>
<p>Being an advocate of progressive enhancement I started out by building a non-AJAX version of the feature. In the controller for the start page I let the default (Index) method have a nullable int parameter named entryCount which tells the method how many of the latest blog entries it should return for the view to display. </p>
<p><code>01.</code><code>public</code> <code>class</code> <code>HomeController : Controller</code> </p>
<p><code>02.</code><code>{</code> </p>
<p><code>03.</code><code>private</code> <code>const</code> <code>int</code> <code>defaultEntryCount = 10;</code> </p>
<p><code>04.</code> </p>
<p><code>05.</code><code>public</code> <code>ActionResult Index(</code><code>int</code><code>? entryCount)</code> </p>
<p><code>06.</code><code>{</code> </p>
<p><code>07.</code><code>if</code> <code>(!entryCount.HasValue)</code> </p>
<p><code>08.</code><code>entryCount = defaultEntryCount;</code> </p>
<p><code>09.</code> </p>
<p><code>10.</code><code>//Retrieve the first page with a page size of entryCount</code> </p>
<p><code>11.</code><code>int</code> <code>totalItems;</code> </p>
<p><code>12.</code><code>IEnumerable&lt;Entry&gt; entries = GetLatestEntries(1, entryCount.Value,</code><code>out</code> <code>totalItems);</code> </p>
<p><code>13.</code> </p>
<p><code>14.</code><code>if</code> <code>(entryCount &lt; totalItems)</code> </p>
<p><code>15.</code><code>AddMoreUrlToViewData(entryCount.Value);</code> </p>
<p><code>16.</code> </p>
<p><code>17.</code><code>return</code> <code>View(entries);</code> </p>
<p><code>18.</code><code>}</code> </p>
<p><code>19.</code> </p>
<p><code>20.</code><code>private</code> <code>void</code> <code>AddMoreUrlToViewData(</code><code>int</code><code>entryCount)</code> </p>
<p><code>21.</code><code>{</code> </p>
<p><code>22.</code><code>ViewData[</code><code>&quot;moreUrl&quot;</code><code>] = Url.Action(</code><code>&quot;Index&quot;</code><code>, </code><code>&quot;Home&quot;</code><code>, </code><code>new</code> <code>{ entryCount = entryCount + defaultEntryCount });</code> </p>
<p><code>23.</code><code>}</code> </p>
<p><code>24.</code><code>}</code> </p>
<p>The method begins by making sure that the entryCount variable has a value, setting it to a default value if the parameter is null. It then retrieves as many of the latest blog entries as entryCount specifies by calling the GetLatestEntries method. I’ve omitted the GetLatestEntries method as it’s implementation will vary depending on blogging platform. The GetLatestEntries method also has an out parameter, totalItems, which tells us the total number of blog entries. I’m not a big fan of using out parameters but that’s the way the framework that I used for my blog (<a href="http://joelabrahamsson.com/Article/What-is-EPiServer/">EPiServer Community</a>) works so I decided to follow that pattern for consistency. If you use some other type of blogging platform I would recommend making a field of the totalItems. </p>
<p>The method moves on to check if there are more blog entries than the&#160; number that will be displayed, in other words if a link for showing more entries should be displayed. If so, it calls the AddMoreUrlToViewData which, you guessed it, adds a route URL for displaying more entries to the ViewData dictionary. </p>
<p>Finally the method returns a ViewResult with the list of blog entries as the model. </p>
<h4></h4>
<h4>Creating the views</h4>
<p>The Index view for the Home controller is very simple. It simply renders a partial view named EntryTeaserList, passing along the list of blog entries (Model) and the it’s ViewData dictionary. </p>
<p><code>1.</code><code>&lt;%@ Page Language=&quot;C#&quot; MasterPageFile=&quot;~/Views/Shared/Site.Master&quot; Inherits=&quot;System.Web.Mvc.ViewPage&lt;</code><code>IEnumerable</code><code>&lt;Entry&gt;&gt;&quot; %&gt;</code> </p>
<p><code>2.</code><code>&lt;</code><code>asp:Content</code><code>ContentPlaceHolderID</code><code>=</code><code>&quot;PrimaryMainContent&quot;</code><code>runat</code><code>=</code><code>&quot;server&quot;</code><code>&gt;</code> </p>
<p><code>3.</code><code>&lt;% Html.RenderPartial(&quot;EntryTeaserList&quot;, Model, ViewData); %&gt;</code> </p>
<p><code>4.</code><code>&lt;/</code><code>asp:Content</code><code>&gt;</code> </p>
<p>The partial view EntryTeaserList offers a bit more excitement. It renders an ordered list and displays a teaser for each blog entry by rendering another partial view, EntryTeaser, inside a list item, passing in each individual blog entry as model to it. It also checks if the ViewData dictionary contains a URL for a more link. If it does it renders a link with that URL in the href attribute. </p>
<p><code>01.</code><code>&lt;%@ Control Language=&quot;C#&quot; Inherits=&quot;System.Web.Mvc.ViewUserControl&lt;</code><code>IEnumerable</code><code>&lt;Entry&gt;&gt;&quot; %&gt;</code> </p>
<p><code>02.</code><code>&lt;</code><code>div</code> <code>id</code><code>=</code><code>&quot;entryTeaserList&quot;</code><code>&gt;</code> </p>
<p><code>03.</code><code>&lt;</code><code>ol</code><code>&gt;</code> </p>
<p><code>04.</code><code>&lt;% foreach (Entry item in Model) { %&gt;</code> </p>
<p><code>05.</code><code>&lt;</code><code>li</code> <code>class</code><code>=</code><code>&quot;entryTeaser&quot;</code><code>&gt;</code> </p>
<p><code>06.</code><code>&lt;% Html.RenderPartial(&quot;EntryTeaser&quot;, item); %&gt;</code> </p>
<p><code>07.</code><code>&lt;/</code><code>li</code><code>&gt;</code> </p>
<p><code>08.</code><code>&lt;% } %&gt;</code> </p>
<p><code>09.</code><code>&lt;/</code><code>ol</code><code>&gt;</code> </p>
<p><code>10.</code><code>&lt;% if(ViewData[&quot;moreUrl&quot;] != null) { %&gt;</code> </p>
<p><code>11.</code><code>&lt;</code><code>a</code> <code>href='&lt;%= ViewData[&quot;moreUrl&quot;] %&gt;' id=&quot;moreLink&quot;&gt;More&lt;/</code><code>a</code><code>&gt;</code> </p>
<p><code>12.</code><code>&lt;% } %&gt;</code> </p>
<p><code>13.</code><code>&lt;/</code><code>div</code><code>&gt;</code> </p>
<p>Finally I made the link look like a button with some CSS. </p>
<p><code>01.</code><code>#moreLink {</code> </p>
<p><code>02.</code><code>-moz-border-radius: </code><code>6px</code><code>;</code> </p>
<p><code>03.</code><code>-webkit-border-radius: </code><code>6px</code><code>;</code> </p>
<p><code>04.</code><code>border</code><code>: </code><code>1px</code> <code>solid</code> <code>#666666</code><code>;</code> </p>
<p><code>05.</code><code>background</code><code>:</code><code>url</code><code>(</code><code>'/styles/gfx/more-bg.gif'</code><code>)</code><code>repeat-x</code><code>;</code> </p>
<p><code>06.</code><code>width</code><code>: </code><code>100%</code><code>;</code> </p>
<p><code>07.</code><code>display</code><code>: </code><code>block</code><code>;</code> </p>
<p><code>08.</code><code>text-align</code><code>: </code><code>center</code><code>;</code> </p>
<p><code>09.</code><code>padding</code><code>: </code><code>0.4em</code> <code>0</code> <code>0.4em</code> <code>0</code><code>;</code> </p>
<p><code>10.</code><code>font-weight</code><code>: </code><code>bold</code><code>;</code> </p>
<p><code>11.</code><code>color</code><code>:</code><code>#9aa57c</code><code>; </code></p>
<p><code>12.</code><code>}</code> </p>
<p><code>13.</code><code>#moreLink:hover {</code> </p>
<p><code>14.</code><code>background</code><code>:</code><code>url</code><code>(</code><code>'/styles/gfx/more-bg.gif'</code><code>) </code><code>0</code> <code>-64px</code><code>; </code><code>repeat-x</code><code>;</code> </p>
<p><code>15.</code><code>border</code><code>: </code><code>1px</code> <code>solid</code> <code>#888888</code><code>;</code> </p>
<p><code>16.</code><code>text-decoration</code><code>: </code><code>none</code><code>;</code> </p>
<p><code>17.</code><code>}</code> </p>
<p>As you might have noticed I used CSS to round the buttons corners. This will only work for some browsers. In this particular case I though that that was OK, but in many other situations I would instead have used images or javascript. You might also have noticed that the button has the same background image when it’s hovered over as when it isn’t. The background image is however offset vertically so it appears that it’s actually another image. I did this to keep the number of HTTP requests required to load the page to a minimum. </p>
<h4></h4>
<h4>Spicing things up with AJAX</h4>
<p>With the controller and views set up as described above I was done with the non-AJAX functionality. This will work fine for visitors that doesn’t have javascript enabled or debugging purposes, but this kind of paging is pretty pointless if the page has to reload. After all the point is that when someone clicks the more button the experience shouldn’t be that another page is displayed but that the list, more or less instantly, just grows a bit. </p>
<p>To add the AJAX functionality I begun by modifying the controllers Index method. </p>
<p><code>01.</code><code>public</code> <code>ActionResult Index(</code><code>int</code><code>? entryCount)</code> </p>
<p><code>02.</code><code>{</code> </p>
<p><code>03.</code><code>if</code> <code>(!entryCount.HasValue)</code> </p>
<p><code>04.</code><code>entryCount = defaultEntryCount;</code> </p>
<p><code>05.</code> </p>
<p><code>06.</code><code>int</code> <code>totalItems;</code> </p>
<p><code>07.</code> </p>
<p><code>08.</code><code>if</code><code>(Request.IsAjaxRequest())</code> </p>
<p><code>09.</code><code>{</code> </p>
<p><code>10.</code><code>int</code> <code>page = entryCount.Value / defaultEntryCount;</code> </p>
<p><code>11.</code> </p>
<p><code>12.</code><code>//Retrieve the page specified by the page variable with a page size o defaultEntryCount</code> </p>
<p><code>13.</code><code>IEnumerable&lt;Entry&gt; pagedEntries = GetLatestEntries(page, defaultEntryCount, </code><code>out</code> <code>totalItems);</code> </p>
<p><code>14.</code> </p>
<p><code>15.</code><code>if</code><code>(entryCount &lt; totalItems)</code> </p>
<p><code>16.</code><code>AddMoreUrlToViewData(entryCount.Value);</code> </p>
<p><code>17.</code> </p>
<p><code>18.</code><code>return</code> <code>View(</code><code>&quot;EntryTeaserList&quot;</code><code>, pagedEntries);</code> </p>
<p><code>19.</code><code>}</code> </p>
<p><code>20.</code> </p>
<p><code>21.</code><code>//Retrieve the first page with a page size of entryCount</code> </p>
<p><code>22.</code><code>IEnumerable&lt;Entry&gt; entries = GetLatestEntries(1, entryCount.Value, </code><code>out</code><code>totalItems);</code> </p>
<p><code>23.</code> </p>
<p><code>24.</code><code>if</code> <code>(entryCount &lt; totalItems)</code> </p>
<p><code>25.</code><code>AddMoreUrlToViewData(entryCount.Value);</code> </p>
<p><code>26.</code> </p>
<p><code>27.</code><code>return</code> <code>View(entries);</code> </p>
<p><code>28.</code><code>}</code> </p>
<p>The added code checks if the current request is an AJAX request, with the IsAjaxRequest extension method that ships with MVC. IsAjaxRequest determines if the current request is an AJAX request by looking for and at the X-Requested-With request header. If such an header, or actually any request parameter with that name, is set to “XMLHttpRequest” the method will return true. As jQuery’s AJAX methods sets that header this method works great in this example. </p>
<p>Anyway, if the current request is an AJAX request we know that the visitors browser already displays a number of blog entry teasers and instead of returning the full number of entries specified by the entryCount parameter we should only return those that haven’t yet been sent to the visitors browser. So, we calculate what page (as if we where using traditional paging) is requested by dividing entryCount with the defaultEntryCount constant. Then we retrieve a list of the entries on that page with a page size of defaultEntryCount. That is we retrieve the defaultEntryCount number of entries with an offset of page*defaultEntryCount. </p>
<p>Finally, if there are more entries we set the moreUrl in the ViewData dictionary by calling the AddMoreUrlToViewData method and return a ViewResult. This time around however we don’t return the default view for the method. Instead we return the EntryTeaserList partial view. This way we don’t return more HTML than necessary but we are able to reuse an already existing view. We could of course have returned the result as JSON or XML instead but that would have forced us to write javascript for rendering the markup to display the result and thereby duplicating the same markup in two places. </p>
<p>The last thing I did was to add a few lines of javascript to intercept clicks on the more link. </p>
<p><code>01.</code><code>$(</code><code>function</code><code>() {</code> </p>
<p><code>02.</code><code>addMoreLinkBehaviour();</code> </p>
<p><code>03.</code><code>});</code> </p>
<p><code>04.</code> </p>
<p><code>05.</code><code>function</code> <code>addMoreLinkBehaviour() {</code> </p>
<p><code>06.</code><code>$(</code><code>'#entryTeaserList #moreLink'</code><code>).live(</code><code>&quot;click&quot;</code><code>, </code><code>function</code><code>() {</code> </p>
<p><code>07.</code><code>$(</code><code>this</code><code>).html(</code><code>&quot;&lt;img src='/images/ajax-loader.gif' /&gt;&quot;</code><code>);</code> </p>
<p><code>08.</code><code>$.get($(</code><code>this</code><code>).attr(</code><code>&quot;href&quot;</code><code>),</code><code>function</code><code>(response) {</code> </p>
<p><code>09.</code><code>$(</code><code>'#entryTeaserList ol'</code><code>).append($(</code><code>&quot;ol&quot;</code><code>, response).html());</code> </p>
<p><code>10.</code><code>$(</code><code>'#entryTeaserList #moreLink'</code><code>).replaceWith($(</code><code>&quot;#moreLink&quot;</code><code>, response));</code> </p>
<p><code>11.</code><code>});</code> </p>
<p><code>12.</code><code>return</code> <code>false</code><code>;</code> </p>
<p><code>13.</code><code>});</code> </p>
<p><code>14.</code><code>}</code> </p>
<p>When the DOM is ready we add a function to the click event of the more link, and, since I’m using the live function, to any future objects matching that selector. When the link is clicked two things initially happen. First the link’s text is replaced with an image to give the visitor some visual feedback if the response of the AJAX request isn’t instantly returned. Then an AJAX request is made to the same URL as the link had in it’s href attribute. That is, there’s no special URL for the AJAX request. This works as the controller takes care of determining what type of request it is. </p>
<p>When the server has responded with the partial view, that is an ordered list and possibly a new more link the list items are appended to the existing ordered list and the more link is replaced with the new more link if it exists. This way the more link is automatically updated with a new URL in it’s href attribute and the loading image is replaced with the original text. </p>
<h4>Conclusion</h4>
<p>I personally find this solution pretty elegant. It requires quite few lines of code and almost no duplicate logic or markup at all. It also offers full fallback functionality for visitors without javascript. However, if I was really interested in offering the best possible experience to human visitors with javascript disabled I could also give each blog entry teaser an id with it’s number in the list and include a hash tag with entryCount + 1 &#8211; defaultEntryCount in the more link’s target URL so that they would automatically be scrolled to the first entry that was added to the list. In my case I deemed that to be overkill though. </p>
<p><i>PS. For updates about new posts, sites I find useful and the occasional rant you can <a href="http://twitter.com/joelabrahamsson">follow me on Twitter</a>. You are also most welcome to subscribe to <a href="http://feeds.feedburner.com/JoelAbrahamsson">the RSS-feed.</a></i> </p>
<p>&#160;</p>
<p><font face="Courier New"></font>&#160;</p>
<p><font face="Courier New"></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=195&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/23/twitter-style-paging-with-asp-net-mvc-and-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows 7 Enterprise x86 1 link !</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/windows-7-enterprise-x86-1-link/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/windows-7-enterprise-x86-1-link/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 07:18:58 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Phần mềm]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/windows-7-enterprise-x86-1-link/</guid>
		<description><![CDATA[&#160; Windows 7 Enterprise x86 File Name : en_windows_7_enterprise_x86_dv d_x15-70745.iso File Size : 2.24 GB Date Posted: 8/6/2009 9:56 AM ISO/CRC: 6A9B5097 SHA1: C6B905E48FDB6CB5BFCA967715A644 61B812D40C http://download391.mediafire.com/w1s&#8230;_x15-70745.iso<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=192&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sokhanh03.files.wordpress.com/2010/08/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sokhanh03.files.wordpress.com/2010/08/image_thumb1.png?w=478&#038;h=389" width="478" height="389" /></a> </p>
<p>&#160;</p>
<p><b>Windows 7 Enterprise x86</b>     <br />File Name : en_windows_7_enterprise_x86_dv d_x15-70745.iso     <br />File Size : 2.24 GB     <br />Date Posted: 8/6/2009 9:56 AM ISO/CRC: 6A9B5097     <br />SHA1: C6B905E48FDB6CB5BFCA967715A644 61B812D40C</p>
<p><a href="http://download391.mediafire.com/w1suioytf1og/wwmyoei4mjn/en_windows_7_enterprise_x86_dvd_x15-70745.iso">http://download391.mediafire.com/w1s&#8230;_x15-70745.iso</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=192&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/windows-7-enterprise-x86-1-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>

		<media:content url="http://sokhanh03.files.wordpress.com/2010/08/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Se7en XP x86 &#8211; Black Edition (08-2010)</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/windows-se7en-xp-x86-black-edition-08-2010/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/windows-se7en-xp-x86-black-edition-08-2010/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 07:14:12 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Phần mềm]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/windows-se7en-xp-x86-black-edition-08-2010/</guid>
		<description><![CDATA[All driverpacks are included : DriverPack Graphics A 8.12.1 DriverPack Graphics B 8.12.1 DriverPack Graphics C 8.12.1 DriverPack LAN 8.12.1 DriverPack Mass Storage 9.01 DriverPack Sound A 8.05 DriverPack Sound B 8.05 DriverPack WLAN 8.06 DriverPack CPU 8.04 CCleaner 2.21.940 dfxWMP [for more voice in WMP11] DirectX 9.0c Flash Player 10 IE/FF IconPackager 3.2 Internet <a href="http://sokhanh03.wordpress.com/2010/08/22/windows-se7en-xp-x86-black-edition-08-2010/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=189&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sokhanh03.files.wordpress.com/2010/08/image.png"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="image" border="0" alt="image" src="http://sokhanh03.files.wordpress.com/2010/08/image_thumb.png?w=477&#038;h=369" width="477" height="369" /></a> </p>
<p><b>All driverpacks are included :</b>     <br />DriverPack Graphics A 8.12.1     <br />DriverPack Graphics B 8.12.1 DriverPack Graphics C 8.12.1     <br />DriverPack LAN 8.12.1     <br />DriverPack Mass Storage 9.01     <br />DriverPack Sound A 8.05     <br />DriverPack Sound B 8.05     <br />DriverPack WLAN 8.06     <br />DriverPack CPU 8.04     <br />CCleaner 2.21.940     <br />dfxWMP [for more voice in WMP11]     <br />DirectX 9.0c     <br />Flash Player 10 IE/FF     <br />IconPackager 3.2     <br />Internet Explorer 8     <br />Java[TM] 6 Update 15     <br />Messenger Plus for WLM 9     <br />Mozilla Firefox 3.5.0     <br />NetFramework 2.0     <br />Silverlight 2.0     <br />Winrar 3.80     <br />Ueber icon 1.0.4     <br />Windows Media Player 11     <br />Windows Live Messenger 9.0     <br />Yahoo 10     <br />More…     <br />- Cyber Se7en Black Edition theme     <br />- Cpls     <br />- Cursors     <br />- Fonts     <br />- Wallpapers</p>
<p><b>Download</b></p>
<p>Name: XP Se7en Black Edition (700mb)    <br />Service Pack: 3     <br />System: x86 32bit     <br />Product K.@.y: Not Needed     <br />This version of Windows XP is designed for your convenience</p>
<pre><a href="http://www.mediafire.com/?ocpu6blkxi9w0gd">http://www.mediafire.com/?ocpu6blkxi9w0gd</a></pre>
<pre><a href="http://www.mediafire.com/?tx77ockh6e8x4jg" target="_blank">http://www.mediafire.com/?tx77ockh6e8x4jg</a></pre>
<pre><a href="http://www.mediafire.com/?8ir6geuga98v48b" target="_blank">http://www.mediafire.com/?8ir6geuga98v48b</a></pre>
<pre><a href="http://www.mediafire.com/?01283xttv5npt59" target="_blank">http://www.mediafire.com/?01283xttv5npt59</a>
Password : allmedia4u@soft</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=189&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/windows-se7en-xp-x86-black-edition-08-2010/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>

		<media:content url="http://sokhanh03.files.wordpress.com/2010/08/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Biến Windows lậu th&#224;nh Windows c&#243; bản quyền</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/bi%e1%ba%bfn-windows-l%e1%ba%adu-thnh-windows-c-b%e1%ba%a3n-quy%e1%bb%81n/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/bi%e1%ba%bfn-windows-l%e1%ba%adu-thnh-windows-c-b%e1%ba%a3n-quy%e1%bb%81n/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 07:05:19 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Thủ thuật]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/bi%e1%ba%bfn-windows-l%e1%ba%adu-thnh-windows-c-b%e1%ba%a3n-quy%e1%bb%81n/</guid>
		<description><![CDATA[Đầu tiên vào Start ,Run,gõ Regedit rùi tìm đến khóa HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\WPAEvents Ở ô bên phải nhấn chuột phải vào OOBETimer rồi click vào Modify. Tiếp đến hãy thay đổi một khóa bất kì (ví dụ 71 thành 72 chẳng hạn). Sau đó đóng nó lại và tiếp tục vào Start , Run , và đánh <a href="http://sokhanh03.wordpress.com/2010/08/22/bi%e1%ba%bfn-windows-l%e1%ba%adu-thnh-windows-c-b%e1%ba%a3n-quy%e1%bb%81n/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=186&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="snap_preview">
<p>Đầu tiên vào Start ,Run,gõ Regedit rùi tìm đến khóa      <br /><span style="color:rgb(0,0,255);">HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\WPAEvents</span></p>
<p>Ở ô bên phải nhấn chuột phải vào OOBETimer rồi click vào Modify. Tiếp đến hãy thay đổi một khóa bất kì (ví dụ 71 thành 72 chẳng hạn). Sau đó đóng nó lại và tiếp tục vào Start , Run , và đánh</p>
<p><span style="color:rgb(0,0,255);">%systemroot%\system32\oobe\msoobe.exe /a</span></p>
<p>Nó sẽ đưa bạn đến cửa sổ Active windows.</p>
<p>Đừng lo hãy chọn      <br /><span style="color:rgb(0,0,255);">I want to telephone a customer service representative to activate Windows</span></p>
<p>Tiếp đến nhấn Next, nhấn Change Product key      <br />Hãy nhập key này</p>
<p><span style="color:rgb(0,0,255);">DHXQ2-WRGCD-WGYJY-HHYDH-KKX9B</span>       <br />hoặc       <br /><span style="color:rgb(0,0,255);">JG28K-H9Q7X-BH6W4-3PDCQ-6XBFJ</span>       <br />hoặc       <br /><span style="color:rgb(0,0,255);">MJPMD-69P47-4JK37-DGQF2-XMWPQ</span></p>
<p>Đánh xong hãy nhấn Update. Nó sẽ lại đưa chúng ta về cửa sổ Active, đừng quan tâm, hãy đóng nó lại bằng cách nhấn vào Remind me later      <br />Xong đâu đó rùi thì còn chờ gì nữa, khởi động lại <a class="wiki_link" href="http://www.fotech.org/mediawiki/index.php/Windows">Windows</a> đi thôi. Khởi động lại xong hãy vào Run, đánh tiếp</p>
<p><span style="color:rgb(0,0,255);">%systemroot%\system32\oobe\msoobe.exe /a</span></p>
<p>Cửa sổ Active sẽ lại hiện ra nhưng ko phải là bắt chúng ta Active mà là báo cho ta biết <a class="wiki_link" href="http://www.fotech.org/mediawiki/index.php/Windows">Windows</a> is activated.</p>
<p>Vậy là <a class="wiki_link" href="http://www.fotech.org/mediawiki/index.php/Windows">Windows</a> đã có bản quyền rùi đó. Hãy tận hưởng bằng cách vào ngay trang update hay cài IE7, WMP11, <a class="wiki_link" href="http://www.fotech.org/mediawiki/index.php/Windows">Windows</a> Defender …. hay bất cứ cái gị có check bản quyền của Microsoft.</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=186&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/bi%e1%ba%bfn-windows-l%e1%ba%adu-thnh-windows-c-b%e1%ba%a3n-quy%e1%bb%81n/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
		<item>
		<title>WF4 &#8211; X&#226;y dựng Flowchart workflow</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/wf4-xy-d%e1%bb%b1ng-flowchart-workflow/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/wf4-xy-d%e1%bb%b1ng-flowchart-workflow/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 07:02:03 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[WF]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/wf4-xy-d%e1%bb%b1ng-flowchart-workflow/</guid>
		<description><![CDATA[Trong bài viết này, chúng ta sẽ tìm hiểu về một activity rất quan trọng trong workflow, đó là Flowchart activity. Trong flowchart activity, các child activity được kết nối với nhau qua các cây quyết định (decision tree). Nếu như trong Sequence, các child activities được thực hiện một cách tuần tự top-down theo <a href="http://sokhanh03.wordpress.com/2010/08/22/wf4-xy-d%e1%bb%b1ng-flowchart-workflow/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=185&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trong bài viết này, chúng ta sẽ tìm hiểu về một activity rất quan trọng trong workflow, đó là Flowchart activity. Trong flowchart activity, các child activity được kết nối với nhau qua các cây quyết định (decision tree). Nếu như trong Sequence, các child activities được thực hiện một cách tuần tự top-down theo một thứ tự nhất định, thì trong flowchart activity, các child activities có thể được thực hiện theo một thứ tự bất kỳ và tùy thuộc vào các điều kiện tại các nhánh quyết định (decision branches).</p>
<h2>Xây dựng một flowchart workflow</h2>
<p>Tạo mới một project Console Workflow Application với tên là FlowcharWorkflow.</p>
<p>Để bắt đầu xây dựng một flowchart, kéo thả một Flowchart activity từ toolbox vào workflow mới vừa tạo ra. Sau khi kéo thả thành công Flowchart activity vào workflow, thì kết quả thu được sẽ như sau</p>
<p><a href="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_7E7D8259.png"><img style="display:inline;border-width:0;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_1BA32A64.png" width="443" height="234" /></a></p>
<p>Một Flowchart activity luôn có một node khởi đầu như trong diagram biểu diễn ở trên. Điểm khác biệt giữa Flowchart và Sequence chính là cách mà các child activities được sắp xếp. Trong Sequence, child activities được sắp xếp theo một thứ tự duy nhất là trên xuống dưới và đó cũng là thứ tự thực hiện của các activities, đồng thời sự liên kết giữa các activities trong Sequence được tạo ra tự động và theo một chiều nhất định là top-down. Trong Flowchart activity, child activities có thể được sắp xếp tùy ý và <strong>bắt buộc</strong> người dùng phải định nghĩa các mối liên kết giữa các activities. </p>
<p>Tiếp tục thêm vào một WriteLine activity để xuất ra Console dòng chữ “Hello, Flowchart.”. Sau khi đã thêm vào WriteLine activity vào Flowchart, chúng ta phải thiết lập connections cho các activities trong flowchart này .</p>
<p><a href="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_7A4384C7.png"><img style="display:inline;border-width:0;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_71DFAF70.png" width="425" height="272" /></a>     </p>
<p>Nếu chạy Flowchart vừa tạo ra ở trên thì chúng ta sẽ thu được trên màn hình Console một dòng là “Hello, Flowchart.”. Flowchart trên chỉ bao gồm 1 activity duy nhất cùng 1 flow duy nhất. Tuy nhiên, khi làm việc với Flowchart thì chúng ta sẽ có rất nhiều flow cùng với các điều kiện tương ứng cho mỗi flow. Để có thể xây dựng một flowchart như thế, WF4.0 cung cấp sẵn cho chúng ta các activities như là FlowDecision, FlowSwitch&lt;T&gt;</p>
<h3>FlowDecision activtity</h3>
<p>Quay trở lại với ví dụ trên, chúng ta sẽ sử dụng FlowDecision để đưa ra các lời chào thời gian khác nhau tùy thuộc vào thời gian hiện tại như là “Good morning”, “Good afternoon”, “Good evening”.</p>
<p><a href="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_5F6738EE.png"><img style="display:inline;border-width:0;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_347EAF0F.png" width="459" height="383" /></a>     </p>
<p>Đối với FlowDecision, activity này sẽ dựa vào kết quả true hoặc false của condition mà quyết định hướng đi tiếp theo. Chúng ta có thể thấy rằng cách thực hiện này rất giống với If khi chỉ phụ thuộc vào 2 giá trị là true hoặc false để đưa ra quyết định.</p>
<p>Để mở rộng khả năng của Flowchart, chúng ta có thể sử dụng một activity được xem là mở rộng của FlowDecision là FlowSwitch&lt;T&gt;</p>
<h3>FlowSwitch&lt;T&gt; activity</h3>
<p>FlowSwitch hoạt động giống với FlowDecision activity, tuy nhiên điểm khác biệt là FlowSwitch không phụ thuộc vào chỉ 2 giá trị true hoặc false mà FlowSwitch chấp nhận nhiều giá trị khác nhau. FlowSwitch giống với việc sử dụng switch trong C# thông thường.</p>
<p><a href="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_5AB0E29A.png"><img style="display:inline;border-width:0;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_25B3B790.png" width="456" height="416" /></a>     </p>
<p> Có một điểm cần lưu ý là đối với FlowSwitch, vì là một generic class FlowSwitch&lt;T&gt; nên khi kéo thả activity này từ toolbox thì Visual Studio 2010 đòi hỏi chúng ta phải tùy chọn kiểu T cho activity này.   <br /> 
<p>Sơ đồ FlowChart hoàn chỉnh</p>
<p><a href="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_3930F164.png"><img style="display:inline;border-width:0;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_701AA9D0.png" width="687" height="904" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=185&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/wf4-xy-d%e1%bb%b1ng-flowchart-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>

		<media:content url="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_1BA32A64.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_71DFAF70.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_347EAF0F.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_25B3B790.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://msdnvietnam.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/duynb/image_5F00_thumb_5F00_701AA9D0.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Giới thiệu Tuple trong .NET 4.0</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/gi%e1%bb%9bi-thi%e1%bb%87u-tuple-trong-net-4-0/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/gi%e1%bb%9bi-thi%e1%bb%87u-tuple-trong-net-4-0/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 06:57:53 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/gi%e1%bb%9bi-thi%e1%bb%87u-tuple-trong-net-4-0/</guid>
		<description><![CDATA[Trong phiên bản sắp phát hành Microsoft .NET Framework 4.0 sẽ xuất hiện một kiểu dữ liệu mới là System.Tuple. System.Tuple là một kiểu tập hợp có kích thước cố định được dùng để lưu trữ tập các đối tượng có kiểu dữ liệu khác nhau. Cũng giống như kiểu mảng trước đây, một tuple <a href="http://sokhanh03.wordpress.com/2010/08/22/gi%e1%bb%9bi-thi%e1%bb%87u-tuple-trong-net-4-0/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=184&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trong phiên bản sắp phát hành Microsoft .NET Framework 4.0 sẽ xuất hiện một kiểu dữ liệu mới là System.Tuple. System.Tuple là một kiểu tập hợp có kích thước cố định được dùng để lưu trữ tập các đối tượng có kiểu dữ liệu khác nhau. Cũng giống như kiểu mảng trước đây, một tuple sẽ có kích thước cố định và không thể thay đổi sau khi được khởi tạo thành công. Điểm khác biệt so với kiểu mảng là mặc dù các phần tử trong tuple có thể có kiểu dữ liệu khác nhau nhưng mỗi phần tử trong tuple được đảm bảo về kiểu dữ liệu của mình. Để hiểu rõ hơn, hãy xét một ví dụ sau đây:</p>
<p>&#160; </p>
</p>
<div style="padding:5px;">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);overflow:scroll;padding:0;">
<ol style="background:rgb(255,255,255);margin:0 0 0 35px;">
<li><span style="color:rgb(0,0,255);">static</span> <span style="color:rgb(0,0,255);">void</span> <span style="color:rgb(1,0,1);">Main</span>(<span style="color:rgb(0,0,255);">string</span>[] <span style="color:rgb(1,0,1);">args</span>) </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(0,0,255);">object</span>[] <span style="color:rgb(1,0,1);">objects</span> = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(0,0,255);">object</span>[<span style="color:rgb(165,42,42);">3</span>]; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">0</span>] = <span style="color:rgb(163,21,21);">&quot;This is a string&quot;</span>; </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">1</span>] = <span style="color:rgb(165,42,42);">1</span>; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">2</span>] = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">DateTime</span>(<span style="color:rgb(165,42,42);">2009</span>, <span style="color:rgb(165,42,42);">10</span>, <span style="color:rgb(165,42,42);">24</span>); </li>
<li></li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">PrintObjects</span>((<span style="color:rgb(0,0,255);">string</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">0</span>], (<span style="color:rgb(0,0,255);">int</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">1</span>], (<span style="color:rgb(43,145,175);">DateTime</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">2</span>]); </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </li>
<li style="background:rgb(243,243,243);"></li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(0,0,255);">static</span> <span style="color:rgb(0,0,255);">void</span> <span style="color:rgb(1,0,1);">PrintObjects</span>(<span style="color:rgb(0,0,255);">string</span> <span style="color:rgb(1,0,1);">str</span>, <span style="color:rgb(0,0,255);">int</span> <span style="color:rgb(1,0,1);">i</span>, <span style="color:rgb(43,145,175);">DateTime</span> <span style="color:rgb(1,0,1);">dt</span>) </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(43,145,175);">Console</span>.<span style="color:rgb(1,0,1);">WriteLine</span>(<span style="color:rgb(163,21,21);">&quot;{0} {1} {2}&quot;</span>, <span style="color:rgb(1,0,1);">str</span>, <span style="color:rgb(1,0,1);">i</span>, <span style="color:rgb(1,0,1);">dt</span>.<span style="color:rgb(1,0,1);">ToString</span>()); </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </li>
<li></li>
</ol></div>
</p></div>
</p></div>
<p> Ví dụ trên tạo ra một mảng gồm 3 phần tử có kiểu là object. Thoạt nhìn, đoạn code trên không có vấn đề gì nảy sinh. Nhưng nếu xét về mặt an toàn kiểu dữ liệu (type safety) thì đoạn code trên mắc rất nhiều lỗi. Khi khai báo một mảng các object như vậy, thì ta có thể đưa vào đó bất kỳ thứ gì ta muốn và không thể kiểm soát được. Trong trường hợp, nếu như tại phần tử thứ 2, ta đưa vào là một chuỗi ký tự như sau:
</p>
<div style="padding:5px;">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);overflow:scroll;padding:0;">
<ol style="background:rgb(255,255,255);margin:0 0 0 35px;">
<li><span style="color:rgb(0,0,255);">static</span> <span style="color:rgb(0,0,255);">void</span> <span style="color:rgb(1,0,1);">Main</span>(<span style="color:rgb(0,0,255);">string</span>[] <span style="color:rgb(1,0,1);">args</span>) </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(0,0,255);">object</span>[] <span style="color:rgb(1,0,1);">objects</span> = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(0,0,255);">object</span>[<span style="color:rgb(165,42,42);">3</span>]; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">0</span>] = <span style="color:rgb(163,21,21);">&quot;This is a string&quot;</span>; </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">1</span>] = <span style="color:rgb(163,21,21);">&quot;This is an another string&quot;</span>; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">2</span>] = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">DateTime</span>(<span style="color:rgb(165,42,42);">2009</span>, <span style="color:rgb(165,42,42);">10</span>, <span style="color:rgb(165,42,42);">24</span>); </li>
<li></li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">PrintObjects</span>((<span style="color:rgb(0,0,255);">string</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">0</span>], (<span style="color:rgb(0,0,255);">int</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">1</span>], (<span style="color:rgb(43,145,175);">DateTime</span>)<span style="color:rgb(1,0,1);">objects</span>[<span style="color:rgb(165,42,42);">2</span>]); </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </li>
<li style="background:rgb(243,243,243);"></li>
</ol></div>
</p></div>
</p></div>
<p>Đoạn code sau khi sửa xong vẫn sẽ biên dịch thành công. Nhưng khi gọi thực thi phương thức PrintObjects thì sẽ bị lỗi InvalidCastException khi thực hiện việc chuyển đổi chuỗi “This is an another string” sang kiểu số int. </p>
<p>Bây giờ, cùng ví dụ trên, nhưng ta sử dụng System.Tuple</p>
<div style="padding:5px;">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);overflow:scroll;padding:0;">
<ol style="background:rgb(255,255,255);margin:0 0 0 25px;">
<li><span style="color:rgb(0,0,255);">static</span> <span style="color:rgb(0,0,255);">void</span> <span style="color:rgb(1,0,1);">Main</span>(<span style="color:rgb(0,0,255);">string</span>[] <span style="color:rgb(1,0,1);">args</span>) </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">System</span>.<span style="color:rgb(43,145,175);">Tuple</span>&lt;<span style="color:rgb(0,0,255);">string</span>, <span style="color:rgb(0,0,255);">int</span>, <span style="color:rgb(43,145,175);">DateTime</span>&gt; <span style="color:rgb(1,0,1);">tuple</span> = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">Tuple</span>&lt;<span style="color:rgb(0,0,255);">string</span>, <span style="color:rgb(0,0,255);">int</span>, <span style="color:rgb(43,145,175);">DateTime</span>&gt; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (<span style="color:rgb(163,21,21);">&quot;This is a string&quot;</span>, <span style="color:rgb(165,42,42);">1</span>, <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">DateTime</span>(<span style="color:rgb(165,42,42);">2009</span>, <span style="color:rgb(165,42,42);">10</span>, <span style="color:rgb(165,42,42);">24</span>)); </li>
<li></li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">PrintObjects</span>(<span style="color:rgb(1,0,1);">tuple</span>.<span style="color:rgb(1,0,1);">Item1</span>, <span style="color:rgb(1,0,1);">tuple</span>.<span style="color:rgb(1,0,1);">Item2</span>, <span style="color:rgb(1,0,1);">tuple</span>.<span style="color:rgb(1,0,1);">Item3</span>); </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </li>
<li style="background:rgb(243,243,243);"></li>
</ol></div>
</p></div>
</p></div>
<p>Với cách giải quyết vấn đề bằng việc sử dụng System.Tuple, ta có thể loại bỏ các phép toán “ép kiểu” (cast operators) ra khỏi chương trình, điều này giúp cho việc kiểm tra lỗi tại thời điểm biên dịch tốt hơn. Với ví dụ vừa nêu ở trên, ta thấy rằng System.Tuple là một kiểu dữ liệu hữu ích và cần phải có trong .NET Framework. </p>
<h3>System.Tuple và KeyValuePair</h3>
<p>Hãy xem một phương thức khởi tạo của Tuple như sau: </p>
<p>public static <u>System.Tuple&lt;T1,T2&gt;</u> Create&lt;T1, T2&gt;(T1 <i>item1</i>, T2 <i>item2</i>) </p>
<p>Từ các phiên bản trước của .NET Framework, đã có một kiểu dữ liệu có tên là KeyValuePair&lt;Tkey, Tvalue&gt; nằm trong namespace System.Collections.Generic. Cả hai kiểu Tuple&lt;T1, T2&gt; và KeyValuePair&lt;Tkey, Tvalue&gt; đều rất giống nhau. Thật ra, giữa Tuple&lt;T1, T2&gt; và KeyValuePair&lt;Tkey, Tvalue&gt; có khá nhiều điểm khác biệt. Đối với KeyValuePair&lt;Tkey, Tvalue&gt;, ngoài việc lưu trữ 2 thành phần Tkey và Tvalue, nó còn mang kèm cả “mối quan hệ” giữa 2 thành phần này – và cũng với lý do này, KeyValuePair&lt;Tkey, Tvalue&gt; được dùng trong Dictionary class. Bên cạnh đó, tuples khi khởi tạo có thể thay đổi được kích thước lưu trữ, còn đối với KeyValuePair thì mặc nhiên chỉ lưu trữ duy nhất 2 thành phần là Tkey và Tvalue. </p>
<p>Đối với System.Tuple, ta có các phương thức khởi tạo sau:</p>
<div style="padding:5px;">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);overflow:scroll;padding:0;">
<ol style="background:rgb(255,255,255);margin:0 0 0 25px;">
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(43,145,175);">Tuple</span> &lt;T1&gt; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">Tuple</span> &lt;<span style="color:rgb(1,0,1);">T1</span>, <span style="color:rgb(1,0,1);">T2</span>&gt; </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(43,145,175);">Tuple</span> &lt;T1, T2, <span style="color:rgb(1,0,1);">T3</span>&gt; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">Tuple</span> &lt;<span style="color:rgb(1,0,1);">T1</span>, <span style="color:rgb(1,0,1);">T2</span>, <span style="color:rgb(1,0,1);">T3</span>, <span style="color:rgb(1,0,1);">T4</span>&gt; </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(43,145,175);">Tuple</span> &lt;T1, T2, T3, T4, T5&gt; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">Tuple</span> &lt;<span style="color:rgb(1,0,1);">T1</span>, <span style="color:rgb(1,0,1);">T2</span>, <span style="color:rgb(1,0,1);">T3</span>, <span style="color:rgb(1,0,1);">T4</span>, <span style="color:rgb(1,0,1);">T5</span>, <span style="color:rgb(1,0,1);">T6</span>&gt; </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(43,145,175);">Tuple</span> &lt;T1, T2, T3, T4, T5, T6, <span style="color:rgb(1,0,1);">T7</span>&gt; </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:rgb(1,0,1);">Tuple</span> &lt;<span style="color:rgb(1,0,1);">T1</span>, <span style="color:rgb(1,0,1);">T2</span>, <span style="color:rgb(1,0,1);">T3</span>, <span style="color:rgb(1,0,1);">T4</span>, <span style="color:rgb(1,0,1);">T5</span>, <span style="color:rgb(1,0,1);">T6</span>, <span style="color:rgb(1,0,1);">T7</span>, <span style="color:rgb(1,0,1);">TRest</span>&gt; </li>
<li></li>
</ol></div>
</p></div>
</p></div>
<p>&#160; </p>
<p>Tham khảo bài viết CLR Inside Out: Building Tuple tại http://msdn.microsoft.com/en-us/magazine/dd942829.aspx </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=184&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/gi%e1%bb%9bi-thi%e1%bb%87u-tuple-trong-net-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
		<item>
		<title>Small tip with dynamic type view in ASP.MVC 2</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/small-tip-with-dynamic-type-view-in-asp-mvc-2/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/small-tip-with-dynamic-type-view-in-asp-mvc-2/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 06:53:52 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/small-tip-with-dynamic-type-view-in-asp-mvc-2/</guid>
		<description><![CDATA[ASP.NET MVC 2 allows you use dynamic type view by using System.Web.Mvc.ViewPage&#60;dynamic&#62; (or someone call this case is anonymous type view). When you use dynamic type view, the Model property is a dynamic-object which is resolved at the runtime. But, you will meet something wrong when you use dynamic type view. Example, Display is a <a href="http://sokhanh03.wordpress.com/2010/08/22/small-tip-with-dynamic-type-view-in-asp-mvc-2/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=183&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ASP.NET MVC 2 allows you use dynamic type view by using System.Web.Mvc.ViewPage&lt;dynamic&gt; (or someone call this case is anonymous type view). When you use dynamic type view, the Model property is a dynamic-object which is resolved at the runtime.</p>
<p>But, you will meet something wrong when you use dynamic type view. Example, Display is a dynamic type view in my ASP.NET MVC 2 Web Application. And in my action, I do something like this</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:86ccdf0e-4c66-4ca2-9fe6-5bfe795e5805" class="wlWriterSmartContent">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;color:rgb(0,0,0);font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);max-height:300px;overflow:auto;">
<ol style="background:rgb(255,255,255);margin:0 0 0 2em;padding:0 0 0 5px;">
<li><span style="color:rgb(0,0,255);">return</span> View(<span style="color:rgb(163,21,21);">&quot;Display&quot;</span>, </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160; <span style="color:rgb(0,0,255);">new</span> </li>
<li>&#160;&#160;&#160; { </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Mode = <span style="color:rgb(163,21,21);">&quot;Error&quot;</span>, </li>
<li>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Message = <span style="color:rgb(163,21,21);">&quot;This Student ID has already registered by someone.&quot;</span> </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160; }); </li>
</ol></div>
</p></div>
</p></div>
<p>I return Display view and pass an anonymous object as a model to Display view. And this is my Display view</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:360e12ae-697e-478c-9fb0-535dc90d4162" class="wlWriterSmartContent">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;color:rgb(0,0,0);font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);max-height:300px;overflow:auto;">
<ol style="background:rgb(255,255,255);margin:0 0 0 2em;padding:0 0 0 5px;">
<li><span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(128,0,0);">div</span><span style="color:rgb(0,0,255);">&gt;</span> </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160; <span style="background:rgb(255,255,0);">&lt;%</span><span style="color:rgb(0,0,255);">:</span> Model.Mode <span style="background:rgb(255,255,0);">%&gt;</span> </li>
<li>&#160;&#160;&#160; <span style="background:rgb(255,255,0);">&lt;%</span><span style="color:rgb(0,0,255);">:</span> Model.Message <span style="background:rgb(255,255,0);">%&gt;</span> </li>
<li style="background:rgb(243,243,243);"><span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(128,0,0);">div</span><span style="color:rgb(0,0,255);">&gt;</span> </li>
</ol></div>
</p></div>
</p></div>
<p>Everything looks good. But, when you run this application and navigate to Display view, you will get <a href="http://msdn.microsoft.com/en-us/library/microsoft.csharp.runtimebinder.runtimebinderexception.aspx" target="_blank">RuntimeBinderException</a> exception with message {‘object’ does not contain definition for ‘Mode’}. And it’s more crazy when you switch to debug mode and watch Model property, there are existing Mode and Message properties! So, what’s wrong here?</p>
<p>The answer is Anonymous type is internal, it means its properties, methods can’t be access from outside its assembly. (You can read more explaination at <a href="http://www.heartysoft.com/post/2010/05/26/anonymous-types-c-sharp-4-dynamic.aspx">http://www.heartysoft.com/post/2010/05/26/anonymous-types-c-sharp-4-dynamic.aspx</a>)</p>
<p>The solution for my case is very simple like this</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c6462ee1-9513-4c72-8580-082514bf1483" class="wlWriterSmartContent">
<div style="border-bottom:rgb(0,0,128) 1px solid;border-left:rgb(0,0,128) 1px solid;font-family:&#039;color:rgb(0,0,0);font-size:10pt;border-top:rgb(0,0,128) 1px solid;border-right:rgb(0,0,128) 1px solid;">
<div style="font-family:verdana,tahoma,arial,sans-serif;background:rgb(0,0,128);color:rgb(255,255,255);font-weight:bold;padding:2px 5px;">Code Snippet</div>
<div style="background:rgb(221,221,221);max-height:300px;overflow:auto;">
<ol style="background:rgb(255,255,255);margin:0 0 0 2em;padding:0 0 0 5px;">
<li><span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(128,0,0);">div</span><span style="color:rgb(0,0,255);">&gt;</span> </li>
<li style="background:rgb(243,243,243);">&#160;&#160;&#160; <span style="background:rgb(255,255,0);">&lt;%</span><span style="color:rgb(0,0,255);">:</span> Model.GetType().GetProperty(<span style="color:rgb(163,21,21);">&quot;Mode&quot;</span>).GetValue(Model, <span style="color:rgb(0,0,255);">null</span>) <span style="background:rgb(255,255,0);">%&gt;</span> </li>
<li>&#160;&#160;&#160; <span style="background:rgb(255,255,0);">&lt;%</span><span style="color:rgb(0,0,255);">:</span> Model.GetType().GetProperty(<span style="color:rgb(163,21,21);">&quot;Message&quot;</span>).GetValue(Model, <span style="color:rgb(0,0,255);">null</span>)<span style="background:rgb(255,255,0);">%&gt;</span> </li>
<li style="background:rgb(243,243,243);"><span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(128,0,0);">div</span><span style="color:rgb(0,0,255);">&gt;</span> </li>
</ol></div>
</p></div>
</p></div>
<p> 
<p>And everything working well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=183&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/small-tip-with-dynamic-type-view-in-asp-mvc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
		<item>
		<title>Fields Medal &#8211; Ng&#244; Bảo Ch&#226;u</title>
		<link>http://sokhanh03.wordpress.com/2010/08/22/fields-medal-ng-b%e1%ba%a3o-chu/</link>
		<comments>http://sokhanh03.wordpress.com/2010/08/22/fields-medal-ng-b%e1%ba%a3o-chu/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 06:35:53 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Toán học]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/08/22/fields-medal-ng-b%e1%ba%a3o-chu/</guid>
		<description><![CDATA[Ngô Bảo Châu is being awarded the 2010 Fields Medal for for his proof of the Fundamental Lemma in the theory of automorphic forms through the introduction of new algebro-geometric methods. Fields Medal &#8211; Ngô Bảo Châu, Université Paris-Sud In the 1960’s and 70’s Robert Langlands formulated various basic unifying principles and conjectures relating automorphic <a href="http://sokhanh03.wordpress.com/2010/08/22/fields-medal-ng-b%e1%ba%a3o-chu/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=182&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>Ngô Bảo Châu</b> is being awarded the <span class="hilite term-2">2010</span> <span class="hilite term-0">Fields</span> <span class="hilite term-1">Medal</span> for <b>for his proof of the Fundamental Lemma in the theory of automorphic forms through the introduction of new algebro-geometric methods.</b></p>
</p>
<div style="width:177px;" class="wp-caption alignright"><a title="Fields Medal - Ngô Bảo Châu, Université Paris-Sud" href="http://www.icm2010.in/wp-content/icmfiles/medalists/ngo.jpg" rel="lightbox[2623]"><img title="Fields Medal - Ngô Bảo Châu, Université Paris-Sud" alt="Fields Medal - Ngô Bảo Châu, Université Paris-Sud" src="http://www.icm2010.in/wp-content/icmfiles/medalists/ngo-thumb.jpg" width="167" height="250" /></a>
<p class="wp-caption-text"><span class="hilite term-0">Fields</span> <span class="hilite term-1">Medal</span> &#8211; Ngô Bảo Châu, Université Paris-Sud</p>
</p></div>
<p>In the 1960’s and 70’s Robert Langlands formulated various basic unifying principles and conjectures relating automorphic forms on different groups, Galois representations and L-functions. These led to what today is referred to as the Langlands programme. The main tool in establishing some cases of these conjectures is the trace formula and in applying it for the above purposes a central difficulty intervenes: to establish some natural identities in harmonic analysis on local groups as well as ones connected to arithmetic geometric objects. This problem became known as the Fundamental Lemma. After many advances by a number of researchers in 2004, Laumon and Ngô established the Fundamental Lemma for a special family of groups, and recently Ngô established the Lemma in general.
<p>Ngô’s brilliant proof of this important long standing conjecture is based in part on the introduction of novel geometric objects and techniques into this sophisticated analysis. His achievement, which lies at the crossroads between algebraic geometry, group theory and automorphic forms, is leading to many striking advances in the Langlands programme as well as the subjects linked with it.</p>
<h3>Brief Biodata</h3>
<p>Ngô Bảo Châu was born on June 28, 1972, in Hanoi, Vietnam. After secondary school in Vietnam, he moved to France and studied at the Université Paris 6, Ecole Normale Supérieure de Paris. He completed his PhD Degree in Orsay under the supervision of Gérard Laumon. He is currently Professor in the Faculté des Sciences at Orsay and Member of the Institute for Advanced Study in Princeton. In September <span class="hilite term-2">2010</span>, he will start his new appointment at the University of Chicago. Jointly with Laumon, Ngô was awarded the Clay research award in 2004. In 2007, he was awarded the Sophie Germain prize and the Oberwolfach prize.</p>
<div class="roundbox-page-2"><img class="alignleft" title="Laudations - Fields Medal" alt="" src="http://www.icm2010.in/wp-content/icmfiles/otherimages/laud_fields.jpg" width="75" height="75" />    <br /><a href="http://www.icm2010.in/wp-content/icmfiles/laudaions/fields2.pdf">The laudations</a> by James Arthur    <br /><a href="http://www.icm2010.in/wp-content/icmfiles/uploads/Ngo_Bao_Chau_profile1.pdf">The work profile</a> by Julie Rehmeyer     <br />&#160; </div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=182&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/08/22/fields-medal-ng-b%e1%ba%a3o-chu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>

		<media:content url="http://www.icm2010.in/wp-content/icmfiles/medalists/ngo-thumb.jpg" medium="image">
			<media:title type="html">Fields Medal - Ngô Bảo Châu, Université Paris-Sud</media:title>
		</media:content>

		<media:content url="http://www.icm2010.in/wp-content/icmfiles/otherimages/laud_fields.jpg" medium="image">
			<media:title type="html">Laudations - Fields Medal</media:title>
		</media:content>
	</item>
		<item>
		<title>Supporting multiple submit buttons on an ASP.NET MVC view</title>
		<link>http://sokhanh03.wordpress.com/2010/07/30/supporting-multiple-submit-buttons-on-an-asp-net-mvc-view/</link>
		<comments>http://sokhanh03.wordpress.com/2010/07/30/supporting-multiple-submit-buttons-on-an-asp-net-mvc-view/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 08:47:46 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/07/30/supporting-multiple-submit-buttons-on-an-asp-net-mvc-view/</guid>
		<description><![CDATA[A while ago, I was asked for advice on how to support multiple submit buttons in an ASP.NET MVC application, preferably without using any JavaScript. The idea was that a form could contain more than one submit button issuing a form post to a different controller action. The above situation can be solved in many <a href="http://sokhanh03.wordpress.com/2010/07/30/supporting-multiple-submit-buttons-on-an-asp-net-mvc-view/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=181&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A while ago, I was asked for advice on how to support multiple submit buttons in an ASP.NET MVC application, preferably without using any JavaScript. The idea was that a form could contain more than one submit button issuing a form post to a different controller action.</p>
<p>The above situation can be solved in many ways, one a bit cleaner than the other. For example, one could post the form back to one action method and determine which method should be called from that action method. Good solution, however: not standardized within a project and just not that maintainable… A better solution in this case was to create an <em>ActionNameSelectorAttribute</em>.</p>
<p>Whenever you decorate an action method in a controller with the <em>ActionNameSelectorAttribute</em> (or a subclass), ASP.NET MVC will use this attribute to determine which action method to call. For example, one of the ASP.NET MVC <em>ActionNameSelectorAttribute</em> subclasses is the <em>ActionNameAttribute</em>. Guess what the action name for the following code snippet will be for ASP.NET MVC:</p>
</p>
<div class="code">
<p><span class="kwrd">public</span> <span class="kwrd">class</span> HomeController : Controller       <br />{       <br />&#160;&#160;&#160; [ActionName(<span class="str">&quot;Index&quot;</span>)]       <br />&#160;&#160;&#160; <span class="kwrd">public</span> ActionResult Abcdefghij()       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="kwrd">return</span> View();       <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>That’s correct: this action method will be called <em>Index</em> instead of <em>Abcdefghij</em>. What happens at runtime is that ASP.NET MVC checks the <em>ActionNameAttribute</em> and asks if it applies for a specific request. Now let’s see if we can use this behavior for our multiple submit button scenario.</p>
<h2>The view</h2>
<p>Since our view should not be aware of the server-side plumbing, we can simply create a view that looks like this.</p>
</p>
<div class="code">
<p>&lt;%@ Page Language=<span class="str">&quot;C#&quot;</span> Inherits=<span class="str">&quot;System.Web.Mvc.ViewPage&lt;MvcMultiButton.Models.Person&gt;&quot;</span> %&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC <span class="str">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span class="str">&quot;<a href="http://blog.maartenballiauw.be/post/2009/11/26/%3C/span%3Ehttp:%3Cspan%20class=">//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&quot;&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</a>&gt;         <br />&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml%22">http://www.w3.org/1999/xhtml&quot;</a> &gt;         <br />&lt;head runat=&quot;server&quot;&gt;         <br />&#160;&#160;&#160; &lt;title&gt;Create person&lt;/title&gt;         <br />&#160;&#160;&#160; &lt;script src=&quot;&lt;%=Url.Content(&quot;~/Scripts/MicrosoftAjax.js&quot;)%&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;         <br />&#160;&#160;&#160; &lt;script src=&quot;&lt;%=Url.Content(&quot;~/Scripts/MicrosoftMvcAjax.js&quot;)%&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;         <br />&lt;/head&gt;         <br />&lt;body&gt;</span></p>
<p>&#160;&#160;&#160; &lt;% Html.EnableClientValidation(); %&gt;      <br />&#160;&#160;&#160; &lt;% <span class="kwrd">using</span> (Html.BeginForm()) {%&gt;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;fieldset&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;legend&gt;Create person&lt;/legend&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.LabelFor(model =&gt; model.Name) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.TextBoxFor(model =&gt; model.Name) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.ValidationMessageFor(model =&gt; model.Name) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.LabelFor(model =&gt; model.Email) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.TextBoxFor(model =&gt; model.Email) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%= Html.ValidationMessageFor(model =&gt; model.Email) %&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;input type=<span class="str">&quot;submit&quot;</span> <span class="kwrd">value</span>=<span class="str">&quot;Cancel&quot;</span> name=<span class="str">&quot;action&quot;</span> /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;input type=<span class="str">&quot;submit&quot;</span> <span class="kwrd">value</span>=<span class="str">&quot;Create&quot;</span> name=<span class="str">&quot;action&quot;</span> /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/p&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/fieldset&gt;</p>
<p>&#160;&#160;&#160; &lt;% } %&gt;</p>
<p>&#160;&#160;&#160; &lt;div&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;%=Html.ActionLink(<span class="str">&quot;Back to List&quot;</span>, <span class="str">&quot;Index&quot;</span>) %&gt;       <br />&#160;&#160;&#160; &lt;/div&gt;</p>
<p>&lt;/body&gt;      <br />&lt;/html&gt;</p>
</p></div>
<p>Note the two submit buttons (namely “Cancel” and “Create”), both named “action” but with a different value attribute.</p>
<h2>The controller</h2>
<p>Our controller should also not contain too much logic for determining the correct action method to be called. Here’s what I propose:</p>
</p>
<div class="code">
<p><span class="kwrd">public</span> <span class="kwrd">class</span> HomeController : Controller       <br />{       <br />&#160;&#160;&#160; <span class="kwrd">public</span> ActionResult Index()       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="kwrd">return</span> View(<span class="kwrd">new</span> Person());       <br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; [HttpPost]      <br />&#160;&#160;&#160; [MultiButton(MatchFormKey=<span class="str">&quot;action&quot;</span>, MatchFormValue=<span class="str">&quot;Cancel&quot;</span>)]       <br />&#160;&#160;&#160; <span class="kwrd">public</span> ActionResult Cancel()       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="kwrd">return</span> Content(<span class="str">&quot;Cancel clicked&quot;</span>);       <br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; [HttpPost]      <br />&#160;&#160;&#160; [MultiButton(MatchFormKey = <span class="str">&quot;action&quot;</span>, MatchFormValue = <span class="str">&quot;Create&quot;</span>)]       <br />&#160;&#160;&#160; <span class="kwrd">public</span> ActionResult Create(Person person)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="kwrd">return</span> Content(<span class="str">&quot;Create clicked&quot;</span>);       <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>Some things to note:</p>
<ul>
<li>There’s the <em>Index</em> action method which just renders the view described previously.</li>
<li>There’s a <em>Cancel</em> action method which will trigger when clicking the Cancel button.</li>
<li>There’s a <em>Create</em> action method which will trigger when clicking the Create button.</li>
</ul>
<p>Now how do these last two work… You may also have noticed the <em>MultiButtonAttribute</em> being applied. We’ll see the implementation in a minute. In short, this is a subclass for the <em>ActionNameSelectorAttribute</em>, triggering on the parameters <em>MatchFormKey</em> and <em>MatchFormValues</em>. Now let’s see how the <em>MultiButtonAttribute</em> class is built…</p>
<h2>The <em>MultiButtonAttribute</em> class</h2>
<p>Now do be surprised of the amount of code that is coming…</p>
</p>
<div class="code">
<p>[AttributeUsage(AttributeTargets.Method, AllowMultiple = <span class="kwrd">false</span>, Inherited = <span class="kwrd">true</span>)]       <br /><span class="kwrd">public</span> <span class="kwrd">class</span> MultiButtonAttribute : ActionNameSelectorAttribute       <br />{       <br />&#160;&#160;&#160; <span class="kwrd">public</span> <span class="kwrd">string</span> MatchFormKey { get; set; }       <br />&#160;&#160;&#160; <span class="kwrd">public</span> <span class="kwrd">string</span> MatchFormValue { get; set; }</p>
<p>&#160;&#160;&#160; <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> IsValidName(ControllerContext controllerContext, <span class="kwrd">string</span> actionName, MethodInfo methodInfo)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="kwrd">return</span> controllerContext.HttpContext.Request[MatchFormKey] != <span class="kwrd">null</span> &amp;&amp;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; controllerContext.HttpContext.Request[MatchFormKey] == MatchFormValue;       <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>When applying the <em>MultiButtonAttribute</em> to an action method, ASP.NET MVC will come and call the <em>IsValidName</em> method. Next, we just check if the <em>MatchFormKey</em> value is one of the request keys, and the <em>MatchFormValue</em> matches the value in the request. Simple, straightforward and re-usable.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=181&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/07/30/supporting-multiple-submit-buttons-on-an-asp-net-mvc-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
		<item>
		<title>Đặng Thế Phong: Một t&#224;i năng đoản mệnh</title>
		<link>http://sokhanh03.wordpress.com/2010/07/25/d%e1%ba%b7ng-th%e1%ba%bf-phong-m%e1%bb%99t-ti-nang-do%e1%ba%a3n-m%e1%bb%87nh/</link>
		<comments>http://sokhanh03.wordpress.com/2010/07/25/d%e1%ba%b7ng-th%e1%ba%bf-phong-m%e1%bb%99t-ti-nang-do%e1%ba%a3n-m%e1%bb%87nh/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 09:46:25 +0000</pubDate>
		<dc:creator>Trần Phước Hùng</dc:creator>
				<category><![CDATA[Giải trí]]></category>

		<guid isPermaLink="false">https://sokhanh03.wordpress.com/2010/07/25/d%e1%ba%b7ng-th%e1%ba%bf-phong-m%e1%bb%99t-ti-nang-do%e1%ba%a3n-m%e1%bb%87nh/</guid>
		<description><![CDATA[Văn đàn Việt Nam những năm 1930-1945 đã phải chứng kiến nhà văn Vũ Trọng Phụng ra đi ở tuổi 27 (1939) vì bệnh lao để lại sự tiếc thương vô hạn cho những người yêu thích văn học nước nhà. Năm 1940, chúng ta mất nhà thơ nổi tiếng Hàn Mặc Tử khi ông <a href="http://sokhanh03.wordpress.com/2010/07/25/d%e1%ba%b7ng-th%e1%ba%bf-phong-m%e1%bb%99t-ti-nang-do%e1%ba%a3n-m%e1%bb%87nh/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=179&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wlWriterHeaderFooter" style="float:none;margin:0;padding:0;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post"></a></div>
<p>Văn đàn Việt Nam những năm 1930-1945 đã phải chứng kiến nhà văn Vũ Trọng Phụng ra đi ở tuổi 27 (1939) vì bệnh lao để lại sự tiếc thương vô hạn cho những người yêu thích văn học nước nhà. </p>
<p>Năm 1940, chúng ta mất nhà thơ nổi tiếng Hàn Mặc Tử khi ông mới 28 tuổi vì bệnh phong. </p>
<p>Trong lĩnh vực âm nhạc, một tài năng khác cũng ra đi ở độ tuổi rất trẻ (24) cũng bởi căn bệnh thuộc hàng tứ chứng nan y như Vũ Trọng Phụng. Đó là Đặng Thế Phong. </p>
<p>Cũng như Vũ Trọng Phụng, phải mãi sau này khi làn gió đổi mới đến với đất nước ta thì các nhạc phẩm nổi đình đám một thời của Đặng Thế Phong và các nhạc sĩ tiền chiến khác mới được đánh giá một cách đúng mức trong kho tàng lịch sử âm nhạc Việt Nam mặc dầu từ rất lâu rồi nó đã có chỗ đứng vững chắc trong lòng người hâm mộ. </p>
<p>Cũng giống như Nguyễn Đình Thi, chỉ với hai bài hát cách mạng &quot;Diệt phát xít&quot; và &quot;Người Hà Nội&quot;, ông đã là một nhạc sĩ nổi tiếng bậc cao thủ trong giới nhạc sĩ Việt Nam đương đại. </p>
<p>Đặng Thế Phong cũng vậy. Chỉ với ba bài hát &quot;Đêm thu&quot;, &quot;Con thuyền không bến&quot; và &quot;Giọt mưa thu&quot;, ông đã là nhạc sĩ có một không hai gắn liền tên tuổi bất hủ của mình với mùa thu. Xem thế đủ biết không phải cứ đẻ sòn sòn đã là hay. Vấn đề là ở chỗ ít mà tinh, mà để đời. </p>
<p>Đặng Thế Phong là vậy đó. </p>
<p>Sinh ra trong một gia đình công chức ở thành Nam nhưng không may mắn. Cha mất sớm buộc Đặng Thế Phong phải sớm tìm con đường mưu sinh: vừa đi học, vừa vẽ thuê kiếm sống. </p>
<p>Mới hơn hai mươi tuổi đầu đã lang thang nơi đất khách quê người tận xứ Nam Vang làm đủ thứ nghề vẽ thuê, dạy nhạc để sống, để học và để sáng tác. Năng khiếu bẩm sinh về âm nhạc cho phép Đặng Thế Phong có thể vừa ôm đàn, vừa sáng tác, vừa biểu diễn tác phẩm của mình với chất giọng tenor rất đặc biệt. </p>
<p>Theo các bạn bè và bà Đặng Thanh Kim, em út của Đặng Thế Phong thì ông là một thanh niên rất điển trai, hoạt bát, thích ăn diện, ăn nói rất có duyên lại giỏi đàn hát nên được rất nhiều cô gái thành Nam yêu mến. Đặc biệt Đặng Thế Phong có biệt tài sắm các vai nữ, y như thật. Nhiều cô gái mê ông vì thế. </p>
<p>Trong số đó có ba cô lọt vào mắt xanh chàng trai trẻ đa tình. Đó là cô Hà Tiên, học sinh Trường Sarcree coeur Nam Định; cô Nguyễn Thị Na, tức Lê ở khu Ga Hải Phòng; và cô Bạch Yến ở Hàng Bông, Hà Nội. </p>
<p>Trong ba cô thì Bạch Yến xem ra nặng tình hơn cả bởi cô là người chăm sóc và tiễn đưa Đặng Thế Phong đến nơi an nghỉ cuối cùng và buồn thay cuộc đời của cả ba người đều lỡ dở. </p>
<p>Đặng Thế Phong viết &quot;Đêm thu&quot; năm 1940. Ca khúc này ông viết và biểu diễn ở những đêm lửa trại, lời ca được nhiều bạn bè đóng góp chỉnh sửa nên rất trong trẻo hồn nhiên, thể hiện nỗi đam mê của con người trước thiên nhiên và cuộc sống. Ngay lập tức bài hát được giới trẻ hưởng ứng nhiệt liệt. Song phải đến &quot;Con thuyền không bến&quot; viết vào tháng 9/1941 sau khi nhạc sĩ đi Phnom Penh trở về thì tên tuổi Đặng Thế Phong mới nổi như cồn. </p>
<p>Hôm đó tại Nhà hát Lớn Hà Nội, ca sĩ Vũ Thị Hiển lần đầu tiên hát ca khúc này đã làm xôn xao dư luận. Sau đó chính tác giả đã trình bày bài hát này tại rạp Olimpia ở phố Hàng Da thì công chúng Hà Nội càng thêm mến mộ một tài năng. Không chỉ bởi chất giọng của người nhạc sĩ kiêm ca sĩ mà bởi chất thơ nhuần nhuyễn trong từng giai điệu và lời ca thẫm đẫm chất thu: </p>
<p><i>Đêm nay thu sang cùng heo may      <br />Đêm nay sương lam mờ chân mây       <br />Thuyền ai lờ lững trôi xuôi dòng       <br />Như nhớ thương ai chùng tơ lòng.</i> </p>
<p>Có một điều rất khó lý giải là tại sao ở cái tuổi mới hơn hai mươi mà Đặng Thế Phong lại nhuần nhuyễn từ ca từ đến làn điệu thấm đẫm chất dân ca đồng bằng Bắc Bộ như vậy. </p>
<p><i>Lướt theo chiều gió. Một con thuyền theo trăng trong.</i> </p>
<p>Giai điệu này lặp đi lặp lại nhiều lần như một điểm nhấn, nó nghe như một làn điệu dân ca mơ hồ, chầu văn hay chèo nào đó. </p>
<p>Cũng lạ, trong lúc âm nhạc Pháp đang tràn ngập Việt Nam, tâm lý hướng ngoại đang là &quot;mốt&quot; trong giới trí thức, những đĩa hát tango chinoise 78 vòng/phút đầy chất lính kèn lê dương, phong trào tân nhạc chủ yếu là đặt lời cho các bài hát tây thì nhạc phẩm của Đặng Thế Phong lại thấm đẫm tâm hồn Việt… </p>
<p>Năm 1942, Đặng Thế Phong viết &quot;Vạn cổ sầu&quot;, sau Bùi Công Kỳ sửa lời và đặt tên mới là &quot;Giọt mưa thu&quot;. Đây là giai phẩm thứ ba của Đặng Thế Phong và lại có chủ đề là mùa thu:</p>
<p>&#160;</p>
<p><i>Ngoài hiên giọt mưa thu thánh thót rơi      <br />Trời lắng u buồn mây hắt hiu ngừng trôi.</i> </p>
<p>Giọt mưa thu rơi thánh thót. Thật không có hình ảnh nào sống động chính xác hơn. Hơn nửa thế kỷ đã trôi qua, người ta vẫn ví những khúc ca lộng lẫy đó như là &quot;hoa hậu&quot; của ca từ âm nhạc hiện đại Việt Nam. </p>
<p>&quot;Giọt mưa thu&quot; là một nhạc phẩm song cũng là một mảng tâm hồn của con người. Nó như một lời ru kỳ diệu đưa hồn người hòa đồng vào các cung bậc cảm xúc đầy sắc màu của thiên nhiên, nó như giãi bày hộ nỗi buồn nhân thế đang mong được giải tỏa. </p>
<p>&#160; </p>
<p>Một tiếng tơ lòng cất lên mỏng manh như tâm hồn người nghệ sĩ. </p>
<p>Đã bao năm rồi, đã có biết bao thế hệ người Việt Nam cất tiếng hát: </p>
<p><i>Ai nức nở thương đời      <br />Châu buông mau, dương thế bao la sầu.</i> </p>
<p>Sự tích Ngưu Lang &#8211; Chức Nữ chia xa, mỗi năm được gặp nhau một lần ngắn ngủi, nước mắt của tình yêu và nỗi nhớ giội từ trên trời cao xuống hiu hắt lắng đọng từ cõi vô biên, phải chăng đó là chất xúc tác để chàng nghệ sĩ họ Đặng cảm xúc cất lên những âm thanh siêu ảo vượt lên nỗi buồn thế tục, phải chăng giọt mưa thu chính là thiên sứ của tình yêu đã được nhân cách hóa một cách tài tình. </p>
<p>Hãy thử tưởng tượng trong một ngày mưa thu rơi thánh thót ngoài hiên, tiếng vĩ cầm cất lên réo rắt những giai điệu như nức nở của giọt mưa thu của Đặng Thế Phong, người ta có cảm nhận như đâu đây tiếng lòng thổn thúc của thơ Verlain, hay tiếng nhạc buồn của Chopin, hay những cánh lá vàng trong bức tranh &quot;Mùa thu vàng&quot; của Levitan. Thiên nhiên và lòng người hòa quyện một cách tài tình trong bàn tay sáng tạo của người nghệ sĩ. </p>
<p>Chỉ với ba nhạc phẩm thôi, Đặng Thế Phong đã là một hiện tượng trong lịch sử nền âm nhạc ViệtNam. Từ &quot;Đêm thu&quot; với những kỷ niệm tươi trẻ hồi thơ bé cùng Tết Trung thu: </p>
<p><i>Qua lá cành ánh trăng lan dịu dàng      <br />Ru hồn bao nhớ nhung.</i> </p>
<p>đến &quot;Con thuyền không bến&quot; mộng mơ: </p>
<p><i>Ánh trăng mờ chiếu.      <br />Một con thuyền trong đêm thâu       <br />Trên sông bao la thuyền mơ bến nơi đâu?</i> </p>
<p>đã là một bước chuyển rất lớn trong tâm hồn người nghệ sĩ. </p>
<p>Đến &quot;Giọt mưa thu&quot;: <i>Nghe gió thoảng mơ hồ trong mưa thu ai khóc ai than hờ.</i> </p>
<p>Có thể thấy Đặng Thế Phong đã hóa thân vào tiếng thu lòng thổn thức một cách tài tình như thế nào. </p>
<p>Trong số những người bạn học thân của Đặng Thế Phong hồi thiếu thời ở Nam Định có Vũ Đức Oong. Ông này sau tham gia cách mạng bị Pháp bắt giam ở nhà ngục Sơn La. Từ trong tù, nghe tin bạn bị lao mà chết, năm 1943, ông cảm thán viết bài thơ &quot;Nhớ Thế Phong&quot;, trong đó có đoạn: </p>
<p><i>Đã mấy thu rồi xa cách lắm      <br />Mấy lần thu tới mấy thu đi       <br />Bạn ơi! Có biết thu này khác       <br />Trăng úa bên rừng khóc biệt ly!</i> </p>
<p>Cũng lại ý tứ mùa thu. Phải chăng hai người bạn nối khố này rất đồng cảm với nhau. Năm 1945 ra tù tham gia cướp chính quyền ở Nam Định, ông Oong đã đến ngay gia đình Đặng Thế Phong và còn giữ nhiều tấm ảnh quý về gia đình họ Đặng này. Ông nói: &quot;Nếu tôi không bị đi tù thì tôi không để cho Phong đi Campuchia và ốm đau bệnh tật như thế!&quot;. </p>
<p>Thoắt đấy mà đã chín chục năm ngày sinh của một nhạc sĩ tài hoa nhưng đoản mệnh. Hôm qua chúng ta đã hát những ca khúc buồn của ông, hôm nay chúng ta tiếp tục hát những ca khúc của ông nhưng với một tâm thế khác. Ngày mai cũng vậy. Bởi lẽ đó là những ca khúc bất hủ của một tài năng đích thực</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sokhanh03.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sokhanh03.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sokhanh03.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sokhanh03.wordpress.com&amp;blog=12031179&amp;post=179&amp;subd=sokhanh03&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sokhanh03.wordpress.com/2010/07/25/d%e1%ba%b7ng-th%e1%ba%bf-phong-m%e1%bb%99t-ti-nang-do%e1%ba%a3n-m%e1%bb%87nh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2a3119f61a1240b2628dc9bee9aa919c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sokhanh03</media:title>
		</media:content>
	</item>
	</channel>
</rss>
