<?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/"
	>

<channel>
	<title>Share your minds, soul, and idea</title>
	<atom:link href="http://fathir.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://fathir.com</link>
	<description>Trying to get a better place</description>
	<lastBuildDate>Fri, 23 Oct 2009 03:19:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Invalid Postback or Callback argument error in ASP.Net</title>
		<link>http://fathir.com/?p=100</link>
		<comments>http://fathir.com/?p=100#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:19:09 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=100</guid>
		<description><![CDATA[First of all I will give a brief overview of Postback and Callback. When ever you register a control&#8217;s server side event, ASP.Net register a JavaScript which will submit the form&#8217;s details and on the server it fires the event which is registered for the control.
ASP.net register __doPostBack javascript function. Syntax for the script is [...]]]></description>
			<content:encoded><![CDATA[<p>First of all I will give a brief overview of Postback and Callback. When ever you register a control&#8217;s server side event, ASP.Net register a JavaScript which will submit the form&#8217;s details and on the server it fires the event which is registered for the control.</p>
<p>ASP.net register __doPostBack javascript function. Syntax for the script is __doPostBack(&#8216;Event Target&#8217;,'Event Argument&#8217;); Here Event Target can be a control or it can be a function created by developer. You can also generate a postback script reference for a control by using GetPostBackScript function. Now ASP.Net page always handle the PostBack event by it self.</p>
<p>For Callback you have to impliment a ICallBackEventHandler interface. After implimenting ICallBackEventHandler a page must contain two events, RaiseCallBackEvent with return type void and GetCallBackResult with return type string. Your code logic will be contained in the RaiseCallBackEvent function code block and the result of the Callback will be contained returned by GetCallBackResult. Function GetCallBackResult will call the client side callback result function. I will explain CallBack in detail in my future post.</p>
<p>Many of ASP.Net users are facing a problem with invalid Postback or Callback argument error. Invalid PostBack or CallBack argument error is basically raise because of Event Validation feature. The EventValidation feature is a new feature in ASP.NET 2.0, and provides an additional level of checks to verify that a postback from a control on the client is really from that control and not from someone malicious using something like a cross-site script injection to try and manipulate things. It is part of our overall strategy of increasingly adding security in depth levels to the programming model &#8212; so that developers can be secure by default even if they forget to add security checks of their own.</p>
<p>Now, Invalid PostBack or CallBack argument error may occur when you are firing click event and the object is rebinding or its properties are changed in Page_Load event or someone is trying to hack into your system with cross site scripting. Each time .Net Framework render a page then it associate a unique Guid for all the controls. When binding a gridview or repeater, on each databind framework will associate a new guid for the contorl. So every time when you are firing event make sure Page_Load event does not change the control, because if the control changed the it will have a different Guid which have acutally fired the event for postback. Here are some scenario with this error.</p>
<p><span><strong>1) Invalid Postback or Callback argument in GridView</strong></span> Problem may be: You are binding data in Page_Load event with either Object Data Source or Manual Binding with function call. This will make your GridView bind data on every event fire of any control. When you are firing any GridView command with OnRowCommand, before RowCommand fire your GridView will rebind and all control within it will be assigned to new id. So RowCommand could not get the item which have fired the event. <a name="AdBriteInlineAd_Solution"></a> for Invalid Postback or Callback argument in GridView: You can bind your data within this if condition</p>
<pre class="brush: c#">
if (!IsPostBack)
{
     //Your code for Bind data
}
</pre>
<p>This code will definitely give you solution if this not work then check whether any other control is not giving error.</p>
<p>2) Invalid Postback or Callback argument while submitting form. Problem may be: You have many textboxes and textareas and when user is entering &#8220;&lt;&#8221; or &#8220;&gt;&#8221; char then it is giving error. This is because of .Net framework is giving facility to validate request. This function will allow user not to submit script or html code directly so it is blocked. Solution for Invalid Postback or Callback argument while submitting form: You can replace this char with javascript before submitting the form replace &#8220;&lt;&#8221; with &#8220;&lt;&#8221; and &#8220;&gt;&#8221; with &#8220;&gt;&#8221; the javascript code is here</p>
<pre class="brush: c#">
function ReplaceChar(obj)
{
     //Here obj is your textbox object
     var Textvalue = obj.value;
     Textvalue = Textvalue.replace(&quot;&lt;&quot;,&quot;&lt;&quot;);
     Textvalue = Textvalue.replace(&quot;&gt;&quot;,&quot;&gt;&quot;);
     obj.value = Textvalue;
}
</pre>
<p>The other solution for both of this issue is to set enableEventValidation=false You can set this option declaration &lt;@ Page &gt; or even you can put this code in your web. config file in  block<br />
//set it true if you want to validate your each request. If you do not validate the request then your security of data will be decrease so this is not the perfect solution If both of this solution not work then you can contact me on my email and if you find any new solution please post it comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resize a picture to a fixed size</title>
		<link>http://fathir.com/?p=98</link>
		<comments>http://fathir.com/?p=98#comments</comments>
		<pubDate>Wed, 03 Jun 2009 03:05:37 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[PHP Resize]]></category>
		<category><![CDATA[Resize Picture]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thumbnail]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=98</guid>
		<description><![CDATA[This function creates a thumbnail that is exactly as big as the size you give it. The image is resized to best fit the size of the thumbnail. If it does not fit exactly in both directions, it&#8217;s centered in the thumnail.
The Function:

     function thumbnail_box($img, $box_w, $box_h) {
    [...]]]></description>
			<content:encoded><![CDATA[<p>This function creates a thumbnail that is exactly as big as the size you give it. The image is resized to best fit the size of the thumbnail. If it does not fit exactly in both directions, it&#8217;s centered in the thumnail.</p>
<p><strong>The Function:</strong></p>
<pre class="brush: php">
     function thumbnail_box($img, $box_w, $box_h) {
          //create the image, of the required size
          $new = imagecreatetruecolor($box_w, $box_h);
          if($new === false) {
               //creation failed -- probably not enough memory
               return null;
          }

          //Fill the image with a light grey color
          //(this will be visible in the padding around the image,
          //if the aspect ratios of the image and the thumbnail do not match)
          //Replace this with any color you want, or comment it out for black.
          //I used grey for testing =)
          $fill = imagecolorallocate($new, 200, 200, 205);
          imagefill($new, 0, 0, $fill);

          //compute resize ratio
          $hratio = $box_h / imagesy($img);
          $wratio = $box_w / imagesx($img);
          $ratio = min($hratio, $wratio);

          //if the source is smaller than the thumbnail size,
          //don&#039;t resize -- add a margin instead
          //(that is, dont magnify images)
          if($ratio &gt; 1.0)
               $ratio = 1.0;

          //compute sizes
          $sy = floor(imagesy($img) * $ratio);
          $sx = floor(imagesx($img) * $ratio);

          //compute margins
          //Using these margins centers the image in the thumbnail.
          //If you always want the image to the top left,
          //set both of these to 0
          $m_y = floor(($box_h - $sy) / 2);
          $m_x = floor(($box_w - $sx) / 2);

          //Copy the image data, and resample
          //If you want a fast and ugly thumbnail,
          //replace imagecopyresampled with imagecopyresized
          if(!imagecopyresampled($new, $img, $m_x, $m_y, 0, 0, $sx, $sy, imagesx($img), imagesy($img))) {
               //copy failed
               imagedestroy($new);
               return null;
          }

          //copy successful
          return $new;
     }
</pre>
<p><strong>Example Usage:</strong></p>
<pre class="brush: php">
$i = imagecreatefromjpeg(&quot;img.jpg&quot;);
$thumb = thumbnail_box($i, 210, 150);
imagedestroy($i);

if(is_null($thumb)) {
    /* image creation or copying failed */
    header(&#039;HTTP/1.1 500 Internal Server Error&#039;);
    exit();
}

header(&#039;Content-Type: image/jpeg&#039;);
imagejpeg($thumb);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=98</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Becoming a Better Developer</title>
		<link>http://fathir.com/?p=95</link>
		<comments>http://fathir.com/?p=95#comments</comments>
		<pubDate>Tue, 12 May 2009 07:05:38 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[Life day]]></category>
		<category><![CDATA[life style]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=95</guid>
		<description><![CDATA[The following list are some things I am doing to become a better developer:
1. Find/Rediscover Your Passion
I&#8217;ve always believed that to be a great developer you have to have the passion. What is passion? You know, it&#8217;s that itch you get as you sit on the couch with your wife (or your husband) watching crappy [...]]]></description>
			<content:encoded><![CDATA[<p>The following list are some things I am doing to become a better developer:</p>
<p><span style="font-size: small;"><span style="font-weight: bold;"><span style="font-size: medium;">1.</span> Find/Rediscover Your Passion</span></span><br />
I&#8217;ve always believed that to be a great developer you <span style="font-style: italic;">have</span> to have the passion. What is passion? You know, it&#8217;s that itch you get as you sit on the couch with your wife (or your husband) watching crappy reality TV and you can&#8217;t break your thoughts away from sneaking off to write some code. It&#8217;s that desire you feel to know all there is to know about your language, the framework, emerging new technologies, etc &#8211; <span style="font-style: italic;">just because it is fun to know it</span>. It&#8217;s that code that is always in your head, just dying to get out. You&#8217;re not content with put in 8 hours a day writing code, you just have to find that extra time to do it just because you enjoy it. So, how do you rediscover that (or find it if you&#8217;ve never had it?). I think the rest of this list will help with that.</p>
<p><span style="font-size: small;"><span style="font-weight: bold;"><span style="font-size: medium;">2.</span> Remove Distractions</span></span><br />
There&#8217;s always things to get in your way of improving yourself and staying focused on your goals. If you work at your home, like me, <span style="font-weight: bold;">turn off the TV</span>, shut the office door, establish a &#8220;work mode&#8221; that separates itself from &#8220;home mode&#8221;. I find it helps to turn off notification sound from Yahoo Messenger or whatever messenger do you use as well as other distracting notifications. I found that my eyes would automatically shift to the bottom right corner of my monitor every time that &#8220;ping&#8221; sound would occur. I think part of &#8220;removing distractions&#8221; involved establishing routine to some degree.</p>
<p><span style="font-size: small;"><span style="font-weight: bold;"><span style="font-size: medium;">3.</span> Blog</span></span><br />
I&#8217;ve taken the first step here with reviving my fathir.com blog. My belief is that, while you can learn a lot from reading from other blogs, you&#8217;ll learn 10x that by writing posts yourself. The process of thinking through a topic enough to write about it is far more valuable than just reading about that same topic. Any time you can &#8220;teach&#8221; others, you&#8217;ll end up growing as a developer by leaps and bounds. This has been my experience throughout my entire career, and I do love teaching others.</p>
<p><span style="font-size: small;"><span style="font-weight: bold;"><span style="font-size: medium;">4.</span> Learn a New Technology Each Month</span></span><br />
For me, this is something that without questions comes out when i see something. The problem is that there are just so many things I want to really learn well and I need some focus or I won&#8217;t learn enough of any of them.</p>
<p><span style="font-size: small;"><span style="font-weight: bold;"><span style="font-size: medium;">5.</span> Read and Write</span></span><br />
the best thing you can do to be a better programmer is read. Not reading books, but reading other people&#8217;s code. I&#8217;ll take that one a step further. Not only does reading other people&#8217;s code help you become a better programmer, but getting involved in writing the code as well will take you even further.</p>
<p>Well, there you go. My thoughts on ways to improve myself as a developer. Wish me luck and hope you’ll find this helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing the Calendar control in ASP.NET</title>
		<link>http://fathir.com/?p=93</link>
		<comments>http://fathir.com/?p=93#comments</comments>
		<pubDate>Tue, 12 May 2009 06:43:17 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[ASP.NET Calendar]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=93</guid>
		<description><![CDATA[Recently I had to work on customizing an ASP.NET Calendar control by adding text to the day cells for my team&#8217;s Logon Message project. This proved to be not as straight-forward as I thought so here is what I did in case someone else might want to do the same.
The best place to modify the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to work on customizing an ASP.NET Calendar control by adding text to the day cells for my team&#8217;s <a href="http://ciforlogon.cifor.cgiar.org/logon.htm">Logon Message</a> project. This proved to be not as straight-forward as I thought so here is what I did in case someone else might want to do the same.</p>
<p>The best place to modify the text in a cell seems to be the DayRender event handler. So the first thing I tried was to just modify the e.Cell.Text property like this:</p>
<pre class="brush: c#">
void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
     e.Cell.Text += “My text”;
}
</pre>
<p>The main problem was that after adding text to a day cell in the control I wasn&#8217;t able to select that day by clicking on the day number. Here is what you can do if you still want the select day functionality:</p>
<pre class="brush: c#">
void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
     AddTextToDayCell(e, Datetime.Today, “MyText“);
}

void AddTextToDayCell(DayRenderEventArgs e, Datetime d, string text)
{
     if(e.Day.Date == d.Date)
     {
          string ID = ((System.TimeSpan)(e.Day.Date - new DateTime(2000, 1, 1))).Days.ToString();

          e.Cell.Text = &quot;&lt;a href=\&quot;javascript:__doPostBack(&#039;Calendar1&#039;,&#039;&quot; + ID + &quot;&#039;)\&quot; style=\&quot;color:#663399\&quot;&gt;&quot; + e.Day.DayNumberText; //assuming the name of the calendar control is Calendar1.

          e.Cell.Text +=text;
     }
}
</pre>
<p>If you want your new text to act as a link to some other URL, you could modify the AddTextToCell function as follows:</p>
<pre class="brush: c#">
private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
     AddTextToDayCell(e, DateTime.Today, &quot;MyText&quot;, &quot;&lt;a href=&quot;http://fathir.com/&quot;&gt;http://fathir.com&lt;/a&gt;&quot;); //this will add the MyText link to &lt;a href=&quot;http://fathir.com/&quot;&gt;http://fathir.com&lt;/a&gt; to the current day&#039;s cell
}

void AddTextToDayCell(DayRenderEventArgs e, DateTime d, string text, string URL)
{
     if(e.Day.Date == d.Date)
     {
          string ID = ((System.TimeSpan)(e.Day.Date - new DateTime(2000, 1, 1))).Days.ToString();
          e.Cell.Text = &quot;&lt;a href=\&quot;javascript:__doPostBack(&#039;Calendar1&#039;,&#039;&quot; + ID + &quot;&#039;)\&quot; style=\&quot;color:#663399\&quot;&gt;&quot; + e.Day.DayNumberText;
          e.Cell.Text += &quot;&lt;br /&gt; &lt;a href=\&quot;&quot;+ URL + &quot;\&quot;&gt;&quot; + text;
     }
}
</pre>
<p>Hope you&#8217;ll find this helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=93</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing the Windows Registry</title>
		<link>http://fathir.com/?p=91</link>
		<comments>http://fathir.com/?p=91#comments</comments>
		<pubDate>Sun, 10 May 2009 10:28:56 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=91</guid>
		<description><![CDATA[In this tutorial, I&#8217;m going to go through the code required to edit the Windows registry using C#. This will include creating new keys and values as well as modifying existing ones.
The registry is a great way to save information between application launches. Many applications use the registry to save information about dialog sizes and [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I&#8217;m going to go through the code required to edit the Windows registry using C#. This will include creating new keys and values as well as modifying existing ones.</p>
<p>The registry is a great way to save information between application launches. Many applications use the registry to save information about dialog sizes and placements. That way the user doesn&#8217;t have to resize and move dialogs every time the program starts.</p>
<p>Let&#8217;s start by creating a new registry key. The first thing we need to decide is where to put our new key. If you bring up the Registry Editor &#8211; type &#8220;regedit&#8221; in the run bar, you&#8217;ll notice the registry looks a lot like a file explorer. &#8220;Computer&#8221; is the root node with several child folders branching from it.</p>
<p>Most software packages will have a registry key inside</p>
<p>HKEY_LOCAL_MACHINE-&gt;SOFTWARE</p>
<p>These keys are available no matter who is logged in and is a good place to stick general application values. Let&#8217;s put a key in this folder called &#8220;My Registry Key&#8221;.</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;"><span style="color: #008080;">Registry</span>.<span style="color: #000000;">LocalMachine</span>.<span style="color: #000000;">CreateSubKey</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;SOFTWARE<span style="color: #ff0000;">\\</span>My Registry Key&#8221;</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></div>
</div>
<p><a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registry%28vs.71%29.aspx"><code>Registry</code></a> is a class located in the <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32%28VS.71%29.aspx"><code>Microsoft.Win32</code></a> namespace.  <code>Registry.LocalMachine</code> means where going to be modifying the HKEY_LOCAL_MACHINE registry key.  We passed in &#8220;SOFTWARE\\My Registry Key&#8221; to <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.createsubkey%28VS.71%29.aspx"><code>CreateSubKey</code></a> because we wanted our new key created inside the &#8220;SOFTWARE&#8221; key.  <code>CreateSubKey</code> has the option to take more arguments &#8211; mostly dealing with access and security, but they&#8217;re not important for this tutorial.</p>
<p>If you open the Registry Editor again, you&#8217;ll now see you&#8217;re new key. A key without any values is pretty useless, so let&#8217;s add a string value to it.</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;"><span style="color: #008080;">RegistryKey</span> myKey <span style="color: #296d26;">=</span> <span style="color: #008080;">Registry</span>.<span style="color: #000000;">LocalMachine</span>.<span style="color: #000000;">OpenSubKey</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;SOFTWARE<span style="color: #ff0000;">\\</span>My Registry Key&#8221;</span>, <span style="color: #0600ff;">true</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></p>
<p>myKey.<span style="color: #000000;">SetValue</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;My String Value&#8221;</span>, <span style="color: #ff0000;">&#8220;Test Value&#8221;</span>, <span style="color: #008080;">RegistryValueKind</span>.<span style="color: #000000;">String</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></div>
</div>
<p>The <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.opensubkey.aspx"><code>OpenSubKey</code></a> method is called to get a reference to our newly created key. It takes the path to the key, which is the same as when creating it, and it takes a boolean indicating whether or not we want to open it writable. Since we want to add a new value to this key, we want to set this to <code>true</code>.</p>
<p>Next, we simply call <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.setvalue.aspx"><code>SetValue</code></a> to create our new value.  The <code>SetValue</code> function takes the name of the value as the first argument, the actual value as the second, and the type of value as the third. The <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registryvaluekind.aspx"><code>RegistryValueKind</code></a> enumeration has lots of different kinds of data, so most primitive types can be stored in the registry. If the value you&#8217;re trying to set doesn&#8217;t exist yet (like in this case), <code>SetValue</code> will create it for you.</p>
<p>Now let&#8217;s look at how to get values back out of the registry.  It&#8217;s very similar to setting values and equally as easy.</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;"><span style="color: #008080;">RegistryKey</span> myKey <span style="color: #296d26;">=</span> <span style="color: #008080;">Registry</span>.<span style="color: #000000;">LocalMachine</span>.<span style="color: #000000;">OpenSubKey</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;SOFTWARE<span style="color: #ff0000;">\\</span>My Registry Key&#8221;</span>, <span style="color: #0600ff;">false</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></p>
<p><span style="color: #0600ff;">string</span> myValue <span style="color: #296d26;">=</span> <span style="color: #000000;">(</span><span style="color: #0600ff;">string</span><span style="color: #000000;">)</span>myKey.<span style="color: #000000;">GetValue</span><span style="color: #000000;">(</span><span style="color: #ff0000;">&#8220;My String Value&#8221;</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span><br />
<span style="color: #008000; font-style: italic;">//myValue now equals &#8220;Test Value&#8221;</span></div>
</div>
<p>We get a reference to our key exactly like we did before except this time we pass <code>false</code> for the writable argument.  A call to <a href="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.getvalue.aspx"><code>GetValue</code></a> is then made to retrieve the value from the registry. This function returns an object, so it must first be cast to your desired type &#8211; in this case string. It&#8217;s always wise to check that the return value is not null before casting it since it is possible that the registry value you&#8217;re trying to read doesn&#8217;t exist.</p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=91</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Minimize an Application to the Taskbar Tray in C#</title>
		<link>http://fathir.com/?p=89</link>
		<comments>http://fathir.com/?p=89#comments</comments>
		<pubDate>Sun, 10 May 2009 10:26:05 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Taskbar Tray]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=89</guid>
		<description><![CDATA[One very convenient features in windows is the Taskbar. To make it even better, those little icons can make something so &#8220;out of the way&#8221; that you can forget what is even down there. But, sometimes you want your applications to hang down there, out of the way, doing something that requires little attention. You [...]]]></description>
			<content:encoded><![CDATA[<p>One very convenient features in windows is the Taskbar. To make it even better, those little icons can make something so &#8220;out of the way&#8221; that you can forget what is even down there. But, sometimes you want your applications to hang down there, out of the way, doing something that requires little attention. You can even make some notification bubbles show up if you want.</p>
<p>Today I am going to be using Visual Studio Express 2008, and luckily this makes things really easy. I am assuming that you know how to create a new project, so once you have one open, we can get started. I named my &#8220;HideTaskBar&#8221;, but as always, any name is fine.</p>
<p>This whole process revolves around an object named <code>NotifyIcon</code>. Like most .NET objects, this one is designed to make the job easier. With it we can give our application its very own cute icon in the taskbar, and notify our users of important information. Of course, to start you need to add the object to your form, so go ahead and do that. The object is a <code>common control</code>.</p>
<div class="da-center da-img-div">
<div class="da-img-wrapper"><img class="da-border" src="http://www.switchonthecode.com/sites/default/files/666/images/IconProp.jpg" alt="Properties Panel" /></p>
<p class="da-img-caption">The NotifyIcon&#8217;s Properties</p>
</div>
</div>
<p>The first thing you absolutely must do is set the <code>Icon</code> property. This can be found in the properties window when you have the <code>NotifyIcon</code> object selected. If you don&#8217;t, nothing will show up in the taskbar tray.</p>
<p>Moving on to our code, the first thing we need to do is &#8220;hide&#8221; the form when we minimize it. To do this, we simply tie the action to the <code>resize</code> event. This is crude at best, but for this tutorial it gets the point across:</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;"><span style="color: #0600ff;">if</span> <span style="color: #000000;">(</span><span style="color: #000000;">WindowState</span> <span style="color: #296d26;">==</span> FormWindowState.<span style="color: #000000;">Minimized</span><span style="color: #000000;">)</span><br />
Hide<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></div>
</div>
<p>As I stated above, this simple code goes in the <code>resize</code> event of the form. We are checking to see if the form is minimized, if it is, we hide it. It&#8217;s that simple. Now we have to setup an &#8220;un-minimize&#8221; event that will show our app when we double click the icon. If you take a look at the <code>NotifyIcon</code> object, you will notice a <code>DoubleClick</code> event. How convenient, huh?</p>
<p>What we have to do on the event is show the form, then set its <code>WindowState</code> to normal:</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;">Show<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span><br />
WindowState <span style="color: #296d26;">=</span> FormWindowState.<span style="color: #000000;">Normal</span><span style="color: #000000;">;</span></div>
</div>
<p>Again, that simple. But, we can do a little more. How about adding a some notifications? Yeap, the <code>NotifyIcon</code> object can do that as well. Windows calls them bubbles, and you can access them through the object. Let&#8217;s go ahead and add one to notify us of the minimization of the app:</p>
<div class="geshifilter">
<div class="csharp geshifilter-csharp" style="font-family: monospace;"><span style="color: #0600ff;">if</span> <span style="color: #000000;">(</span><span style="color: #000000;">WindowState</span> <span style="color: #296d26;">==</span> FormWindowState.<span style="color: #000000;">Minimized</span><span style="color: #000000;">)</span><br />
<span style="color: #000000;">{</span><br />
Hide<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span></p>
<p>notifyIcon1.<span style="color: #000000;">BalloonTipTitle</span> <span style="color: #296d26;">=</span> <span style="color: #ff0000;">&#8220;APP Hidden&#8221;</span><span style="color: #000000;">;</span><br />
notifyIcon1.<span style="color: #000000;">BalloonTipText</span> <span style="color: #296d26;">=</span> <span style="color: #ff0000;">&#8220;Your application has been minimized to the taskbar.&#8221;</span><span style="color: #000000;">;</span><br />
notifyIcon1.<span style="color: #000000;">ShowBalloonTip</span><span style="color: #000000;">(</span><span style="color: #000000;">3000</span><span style="color: #000000;">)</span><span style="color: #000000;">;</span><br />
<span style="color: #000000;">}</span></div>
</div>
<p>This will make a balloon tip pop up and notify us from the taskbar. As you can imagine the possibilities are pretty endless as far as the <code>NotifyIcon</code> object goes. You can use this pretty much anywhere, so any action can have a balloon tip. In fact, no one even said you have to use the notification icon for minimizing.</p>
<div class="da-center da-img-div">
<div class="da-img-wrapper"><img class="da-border" src="http://www.switchonthecode.com/sites/default/files/666/images/Notify.jpg" alt="The Notification" /></p>
<p class="da-img-caption">Now we know what is going on.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=89</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Make Transparent Effects in PowerPoint 2007</title>
		<link>http://fathir.com/?p=87</link>
		<comments>http://fathir.com/?p=87#comments</comments>
		<pubDate>Sat, 02 May 2009 06:20:25 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[Microsoft Office 2007]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[Microsoft Powerpoint]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=87</guid>
		<description><![CDATA[Sometimes we need a clip art image that appears transparent in our PowerPoint presentation. For example, as the background of a paragraph that mixed with the original background image.
To do the following steps:

Click on the Insert ribbon tab and click the button on the Clip Art
Click the Go button in the panel and select Clip [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we need a clip art image that appears transparent in our PowerPoint presentation. For example, as the background of a paragraph that mixed with the original background image.<br />
To do the following steps:</p>
<ol>
<li>Click on the Insert ribbon tab and click the button on the Clip Art</li>
<li>Click the Go button in the panel and select Clip Art Clip Art, and put in the presentation</li>
<li>Make a right click on clip art and select Group -&gt; Ungroup</li>
<li>On the question &#8220;Do you want to convert &#8230;?&#8221; click Yes</li>
<li>Do it again, right click on the clip art and select Group -&gt; Ungroup</li>
<li>In the clip art is still selected, open the Format ribbon click on the Shape Fill button and select More Fill Colors</li>
<li>Select colors and transparency values that match your background and click the OK button</li>
<li>If there is any area of the square with the clip art images, simply click on the area of a square and pressing the delete key</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=87</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Using Add-in: Microsoft Save as PDF</title>
		<link>http://fathir.com/?p=83</link>
		<comments>http://fathir.com/?p=83#comments</comments>
		<pubDate>Sat, 02 May 2009 06:08:23 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[Microsoft Office 2007]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Trick]]></category>
		<category><![CDATA[Microsoft Add-in]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[XPS]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=83</guid>
		<description><![CDATA[How to install:

Download file SaveAsPDF&#38;XPS di www.microsoft.com link:
http://download.microsoft.com/download/b/5/3/b5370004-d59d-493f-b005-2299ffca8596/SaveAsPDF.exe
Then click 2 times on SaveAsPDF &#38; XPS file in the folder where you save downloaded earlier
License Agreement screen appears, click on &#8220;Click here to accept &#8230;&#8221; and click Continue
Then wait until the installation is finished, and press OK

Then the steps to save the file to PDF from [...]]]></description>
			<content:encoded><![CDATA[<p>How to install:</p>
<ol>
<li>Download file SaveAsPDF&amp;XPS di www.microsoft.com link:<br />
<a href="http://download.microsoft.com/download/b/5/3/b5370004-d59d-493f-b005-2299ffca8596/SaveAsPDF.exe" target="_blank">http://download.microsoft.com/download/b/5/3/b5370004-d59d-493f-b005-2299ffca8596/SaveAsPDF.exe</a></li>
<li>Then click 2 times on SaveAsPDF &amp; XPS file in the folder where you save downloaded earlier</li>
<li>License Agreement screen appears, click on &#8220;Click here to accept &#8230;&#8221; and click Continue</li>
<li>Then wait until the installation is finished, and press OK</li>
</ol>
<p>Then the steps to save the file to PDF from Microsoft Office 2007 are:</p>
<ol>
<li>Create a document with Microsoft Office or Microsoft Excel</li>
<li>Once completed, click Home and then click continue to select Save As PDF or XPS</li>
<li>Then you specify the file name and select the PDF file type. Click Publish. So your document in the form of PDF files.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=83</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Current WHO phase of pandemic alert</title>
		<link>http://fathir.com/?p=75</link>
		<comments>http://fathir.com/?p=75#comments</comments>
		<pubDate>Thu, 30 Apr 2009 07:56:45 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[Life day]]></category>
		<category><![CDATA[disease]]></category>
		<category><![CDATA[Healty]]></category>
		<category><![CDATA[life style]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=75</guid>
		<description><![CDATA[Current  phase of alert in the WHO global influenza preparedness  plan
Pandemic  preparedness 
In the 2009 revision of the phase descriptions, WHO has retained the use of a  six-phased approach for easy incorporation of new recommendations and approaches  into existing national preparedness and response plans. The grouping and  description of [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="font-weight: normal; text-transform: uppercase; color: #cc6600; font-family: 'Verdana','sans-serif';">Current  phase of alert in the WHO global influenza preparedness  plan</span></h3>
<p class="MsoNormal"><span style="font-size: 8.5pt; color: black; font-family: 'Verdana','sans-serif';"><a title="http://www.who.int/entity/csr/disease/influenza/pandemic/en/index.html" href="http://www.who.int/entity/csr/disease/influenza/pandemic/en/index.html">Pandemic  preparedness</a> </span></p>
<p>In the 2009 revision of the phase descriptions, WHO has retained the use of a  six-phased approach for easy incorporation of new recommendations and approaches  into existing national preparedness and response plans. The grouping and  description of pandemic phases have been revised to make them easier to  understand, more precise, and based upon observable phenomena. Phases 1–3  correlate with preparedness, including capacity development and response  planning activities, while Phases 4–6 clearly signal the need for response and  mitigation efforts. Furthermore, periods after the first pandemic wave are  elaborated to facilitate post pandemic recovery activities.</p>
<p><strong>The current WHO phase of pandemic alert is 5</strong>.<br />
<img style="border: 0pt none;" src="http://fathir.com/upl/phases5-6.gif" border="0" alt="" width="600" height="287" /><br />
In nature, influenza viruses circulate continuously among animals, especially  birds. Even though such viruses might theoretically develop into pandemic  viruses, in <strong>Phase 1</strong> no viruses circulating among animals have been  reported to cause infections in humans.</p>
<p>In <strong>Phase 2</strong> an animal influenza virus circulating among domesticated or  wild animals is known to have caused infection in humans, and is therefore  considered a potential pandemic threat.</p>
<p>In <strong>Phase 3</strong>, an animal or human-animal influenza reassortant virus has  caused sporadic cases or small clusters of disease in people, but has not  resulted in human-to-human transmission sufficient to sustain community-level  outbreaks. Limited human-to-human transmission may occur under some  circumstances, for example, when there is close contact between an infected  person and an unprotected caregiver. However, limited transmission under such  restricted circumstances does not indicate that the virus has gained the level  of transmissibility among humans necessary to cause a pandemic.</p>
<p><strong>Phase 4</strong> is characterized by verified human-to-human transmission of an  animal or human-animal influenza reassortant virus able to cause  “community-level outbreaks.” The ability to cause sustained disease outbreaks in  a community marks a significant upwards shift in the risk for a pandemic. Any  country that suspects or has verified such an event should urgently consult with  WHO so that the situation can be jointly assessed and a decision made by the  affected country if implementation of a rapid pandemic containment operation is  warranted. Phase 4 indicates a significant increase in risk of a pandemic but  does not necessarily mean that a pandemic is a forgone conclusion.</p>
<p><strong>Phase 5</strong> is characterized by human-to-human spread of the virus into at  least two countries in one WHO region. While most countries will not be affected  at this stage, the declaration of Phase 5 is a strong signal that a pandemic is  imminent and that the time to finalize the organization, communication, and  implementation of the planned mitigation measures is short.</p>
<p><strong>Phase 6</strong>, the pandemic phase, is characterized by community level  outbreaks in at least one other country in a different WHO region in addition to  the criteria defined in <strong>Phase 5</strong>. Designation of this phase will indicate  that a global pandemic is under way.</p>
<p>During the <strong>post-peak period</strong>, pandemic disease levels in most countries  with adequate surveillance will have dropped below peak observed levels. The  post-peak period signifies that pandemic activity appears to be decreasing;  however, it is uncertain if additional waves will occur and countries will need  to be prepared for a second wave.</p>
<p>Previous pandemics have been characterized by waves of activity spread over  months. Once the level of disease activity drops, a critical communications task  will be to balance this information with the possibility of another wave.  Pandemic waves can be separated by months and an immediate “at-ease” signal may  be premature.</p>
<p>In the <strong>post-pandemic period</strong>, influenza disease activity will have  returned to levels normally seen for seasonal influenza. It is expected that the  pandemic virus will behave as a seasonal influenza A virus. At this stage, it is  important to maintain surveillance and update pandemic preparedness and response  plans accordingly. An intensive phase of recovery and evaluation may be  required.</p>
<p><span style="color: red;">source : </span><a href="http://www.who.int/csr/disease/avian_influenza/phase/en/index.html">http://www.who.int/csr/disease/avian_influenza/phase/en/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=75</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to open Firefox faster</title>
		<link>http://fathir.com/?p=71</link>
		<comments>http://fathir.com/?p=71#comments</comments>
		<pubDate>Thu, 30 Apr 2009 07:42:08 +0000</pubDate>
		<dc:creator>Fathir</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[life style]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://fathir.com/?p=71</guid>
		<description><![CDATA[Have you ever noticed on how fast IE loads compared to Firefox? That is because XP preloads IE on its start-up.
After some research i found that Firefox developers have chosen not to tie up system resources before they really need it, but if you want it to load fast it is possible to achieve that [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever noticed on how fast IE loads compared to Firefox? That is because XP preloads IE on its start-up.</p>
<p>After some research i found that Firefox developers have chosen not to tie up system resources before they really need it, but if you want it to load fast it is possible to achieve that by doing the same thing as what IE does.</p>
<p>1. Put your Firefox shortcut onto you start menu. Easier way of doing this is if you have a shortcut on your desktop drag it onto you start button on your button left.</p>
<p>2. Right click on the shortcut in the start menu and then &#8216;Properties&#8217;. Find the target section which should contain something similar [ "C:\Program Files\Mozilla Firefox\firefox.exe" ] , add &#8216;/Prefetch:1&#8242; next to the address (without the inverted commas). SO the target box should contain what is in the square brackets as follows [ "C:\Program Files\Mozilla Firefox\firefox.exe" /Prefetch:1 ]</p>
<p><img src="http://fathir.com/upl/properties.png" border="0" alt="Fireefox Properties" /></p>
<p>Now by doing this Windows XP should preload Firefox on its start-up, so Firefox loads as fast as IE.</p>
<p><span style="color: red;">source : </span><a href="http://www.trap17.com/index.php/how-make-firefox-load-faster-known-firefox-tweaks_t39012.html">http://www.trap17.com/index.php/how-make-firefox-load-faster-known-firefox-tweaks_t39012.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fathir.com/?feed=rss2&amp;p=71</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.649 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-11 02:19:43 -->
<!-- Compression = gzip -->