<?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>rahulinfo.com&#187; Clipper conversion.web application,desktop application,Database conversion</title>
	<atom:link href="http://blog.rahulinfo.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rahulinfo.com</link>
	<description>Some Helps, some Tips, some Musing</description>
	<lastBuildDate>Tue, 01 Sep 2009 13:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8-beta2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Codes for a life-time</title>
		<link>http://blog.rahulinfo.com/archives/111</link>
		<comments>http://blog.rahulinfo.com/archives/111#comments</comments>
		<pubDate>Tue, 01 Sep 2009 13:45:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://localhost:8080/wordpresshindi/?p=111</guid>
		<description><![CDATA[As  a developer you have a job to develop a program /functionalities/ Web presence for your client.Your current client owns these codes for life-time.However over period a job well done is no longer related with you maybe because you have stopped coding/you are no longer available for coding / your client have switched their [...]]]></description>
			<content:encoded><![CDATA[<p>As  a developer you have a job to develop a program /functionalities/ Web presence for your client.Your current client owns these codes for life-time.However over period a job well done is no longer related with you maybe because you have stopped coding/you are no longer available for coding / your client have switched their loyalties to some other coders.<br />
This is where comes your role to make your current work remembered and referred time and again by your client and establish your credential as a nifty and understanding programmer.If one follows these simple things codes you have so painstakingly created would be an asset for your client and you will have contention of a job quite well done.<br />
<OL></p>
<li>During the course of coding you would need to create files,classes,functions and variables that are a much needed part of any programming language.You have the option to assign them names at your will.Lazyness and haste often make us using these name as all sundries.Though it serves its purpose but anyone having a look at these<br />
names would have a real tough time making sense out of these.It would alway be advisable to name these with a context so to reflect their purpose.Examples are where we can simply use server_running we should consider using is_windows_server_running for a function that test or ascertain whether windows server is running or not.And looking at just the name a future programmer would understand this is a function for finding out if the windows server is running or not.So give meaningful and context sensitive names to files,classes,functions and variables.</li>
<li>Provision to write comments are provided in most of the languages.However these are most misused facility as we generally tend to use these to comment out per se part of the codes that were written to test/written to debug/unworking codes replaced with other codes. This is not the purpose of the comments.Comments are to explain what you intend to do and why you are doing that so that in the course of further development it  would serve as a documentation to your codes.Besides they add and explain the flow of your code.
<li>Naming variables , functions require you to devise a name and you have the option to name them using a casing convention that suits you fine.However we can utilize this to better represent and mark these name to their purpose.Onus is on us to define ,adopt and stick with these casing convention so that readability of your codes increase a lot.Once may decide on naming all variable in lower case letters , represent classes,variables with camel casing (having Captial letter for beginning of word like IsServerRunning) or Hungarian casing (which is an extension of camel casing &#8211; addition being that while naming variable we begin with datatypes in smallcase and follow up with the camel casing for the name of the variable an example could be strYourLastName instead of just yourlastname or YourLastName)</li>
<li>Space are insignificant for most of the programming languages.They are inert and server no purpose as far as the compiler/interpretor you are using to develop the application.However you may utilize this provision to beautify your codes so that they are much more comprehensible and understood . User spaces liberally to demark  line breaks,conditional loops , end of subs if fact anywhere that you believe codes would look more readable.This would also help you in debugging the application as on a glance you can view and realize the flow of the control of the program.</li>
</ol>
<p>I would surely be intrested to know what you feel about. I did not mean to preach and would be looking forward to your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rahulinfo.com/archives/111/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recover admin access to wordpress</title>
		<link>http://blog.rahulinfo.com/archives/100</link>
		<comments>http://blog.rahulinfo.com/archives/100#comments</comments>
		<pubDate>Tue, 01 Sep 2009 12:13:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://localhost:8080/wordpresshindi/?p=100</guid>
		<description><![CDATA[Ok first the reality:
You are the owner of a great well designed website developed using Wordpress.You have the admin access so that you may regularly update/sanitize your site.Admin access requires you to enter a username and password to enter the private world of administration.But on a fine sunny morning you discover that you can not [...]]]></description>
			<content:encoded><![CDATA[<p><strong><u>Ok first the reality:</u></strong></p>
<p>You are the owner of a great well designed website developed using Wordpress.You have the admin access so that you may regularly update/sanitize your site.Admin access requires you to enter a username and password to enter the private world of administration.But on a fine sunny morning you discover that you can not login to admin. You have tried all the combination of username and password that you can possibly think of but none seems to be working. Fact is your memory has failed you on the right username and password combination.<br />
To add to the agony there is never a mail me my password button on the admin panel so that you can get an email telling you what your password is.</p>
<p><strong><u>The solution:</u></strong><br />
Well we do have a solution, better then tearing your hair -no use never &#8211;  wherein you can regain your admin access albeit your memory have not played havoc on you and you have forgotten a lot of thing other then your admin pass.<br />
The process is simple enough just follow these guidelines.</p>
<blockquote>
<ol>
<li>Being the owner of the site you have access to wordpress database created in MySql.yes wordpress keeps almost all its stuff in the wordpress database.</li>
<li>Start Phpmyadmin -quite a tool for handling mysql &#8211; in your cpanel or whatever panel your webhost have provided you.Now login to your database using username and password.OK if your memory has played real havoc with you and you can not remember MySql login details just browse to your site directory and start looking for file wp-config.php.This is the file where wordpress has kept or noted down your database username and password and also your database name.</li>
<li>Now log in to mysql database server using these credential.</li>
<li>Once you have logged browse a table called users which might be just user or wp_users or somefancyprefix_user.</li>
<li>On browsing this table user_login will tell you what would be the admin&#8217;s user name.</li>
<li>user_pass will tell you what your password is &#8211; but the password is encrypted with MD5 &#8211; so what you have here is a 32char long string which is MD5 of your password.</li>
<li>Select a word that you think you can remeber well.Use md5 hash tool or there are some online sites that would hash your string/word to md5.Using these get md5 hash of selected word .</li>
<li>In phpadmin edit the record in the user table for user_login as admin/rooter/or whatever your admin user name is and replace the user_pass field value with the md5 hash you have.</li>
<li>Now you can log in to the admin section of your website with the word you have selected.</li>
<li>Once logged in you have the choice either to keep this as your password for ever or change it with any word that you feel you are comfortable with.</li>
</blockquote>
<p>Hope you find this tip as intresting and informative and of use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rahulinfo.com/archives/100/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Windows Services using a Delphi Application</title>
		<link>http://blog.rahulinfo.com/archives/67</link>
		<comments>http://blog.rahulinfo.com/archives/67#comments</comments>
		<pubDate>Mon, 31 Aug 2009 15:22:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://localhost:8080/wordpresshindi/?p=67</guid>
		<description><![CDATA[Windows services and knowing the status of a particular service are a often repeated process during application development as well as smoothing running of an application that require these services.
This code snippet is an example of how to get the status of a particular service in window in your program so that you may use [...]]]></description>
			<content:encoded><![CDATA[<p>Windows services and knowing the status of a particular service are a often repeated process during application development as well as smoothing running of an application that require these services.<br />
This code snippet is an example of how to get the status of a particular service in window in your program so that you may use the status for efficient and successful run of your program.<br />
We will be using a <strong>Win 32 api </strong> <em>QueryServiceStatus()</em> in delphi coding to get the status in the following way .</p>
<pre name="code" class ="delphi">

if( ServiceRunning( '\ComputerName','\servicename' ) )then
begin
  // Here you may mention the code if this particlar service is running.
end;

if( ServiceRunning(  '',  '\servicename' ) )then
begin
  // If machine is a local computer no need to mention computer name

end;

if( ServiceStopped( '', '\servicename' ) )then
begin
  // Put here code if the particular service is not running
end;
</pre>
<p>In order to use the above code we need to define the functions like servicerunning and service stopped.</p>
<p>Here is how these functions are defined.</p>
<p>We start by including  winsvc which is the delphi interface to interact with windows services.</p>
<pre name="code" class ="delphi">
uses WinSvc;

function WhatisServiceStatus( sMachine,  sService : string ) : DWord;
//Here sMachine is the name of your machine in a network and blank for a standalone machine.
var
  schm,  schs   : SC_Handle; //service handles
  ss     : TServiceStatus;     //service status
  dwStat : DWord;           //current status
begin
  dwStat := -1;
  schm := OpenSCManager( PChar(sMachine), Nil,   SC_MANAGER_CONNECT);

  if(schm > 0)then  //if connection to service manager is successful.
  begin
    schs := OpenService( schm, PChar(sService),      SERVICE_QUERY_STATUS);
  // we open a handle to the desired service and ask for the staus.

    if(schs > 0)then      //if status is returned
    begin

      if(QueryServiceStatus( schs,  ss))then //ask for current status
      begin
        dwStat := ss.dwCurrentState;
      end;     

      CloseServiceHandle(schs); //we have the staus so close handle.
    end;

    CloseServiceHandle(schm); //close connection to service manager.
  end;

  Result := dwStat; //Result have the current status of the service.
end;
</pre>
<p>Now we have the function that get us the current status of the service<br />
and determining the status we can infer if service is running ,stopped,or service are pending.This function will get return true if service is running and will get false is either service is not running or in a pending state like service_start_pending or service_stop_pending.</p>
<pre name="code" class ="delphi">
function ServiceRunning( sMachine, sService : string ) : boolean;
begin
  Result := SERVICE_RUNNING = ServiceGetStatus(sMachine, sService );
end;
</pre>
<pre name="code" class ="delphi">
function ServiceStopped( sMachine, sService : string ) : boolean;
begin
  Result := SERVICE_STOPPED = ServiceGetStatus( sMachine, sService );
end;
</pre>
<p>This will return if the service is stopped.</p>
<p>So now you do have some niftly code so that you can ascertain in your program the current status of a particular service just by adding some lines of codes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rahulinfo.com/archives/67/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to display serial numbers in Datagridview</title>
		<link>http://blog.rahulinfo.com/archives/1</link>
		<comments>http://blog.rahulinfo.com/archives/1#comments</comments>
		<pubDate>Sun, 30 Aug 2009 11:46:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dotnet]]></category>

		<guid isPermaLink="false">http://localhost:8080/wordpresshindi/?p=1</guid>
		<description><![CDATA[Datagirdview is often used component to display records from tables/query in a tabular fashion.However it does have a short comming that it do not have any properties to display serial number for the records.This is a much desired and neccasary feature for the datagridview.
Here are two ways you can display the records in a datagridview [...]]]></description>
			<content:encoded><![CDATA[<p>Datagirdview is often used component to display records from tables/query in a tabular fashion.However it does have a short comming that it do not have any properties to display serial number for the records.This is a much desired and neccasary feature for the datagridview.<br />
Here are two ways you can display the records in a datagridview with the serial numbers.</p>
<ol>
<li><strong>The sql way :</strong><br />
In this we will change the sql used to create dataset and fill the dataadapter.One more column would be added to the column list that will have the serial number equal to row number.And since  this is column it can be used just like other column having properties like header-text and others.<B>You have to change your sql a bit.</B><br />
say your sql statement is<P></p>
<pre name="code" class ="sql">
" select fieldname1,fieldname2 from tablename where fieldname1 is not null order by fieldname1 "</pre>
<p>
now change the sql to</P>
<pre name="code" class ="sql">
"select rowno() over ( order by fieldname1) as slno,fieldname1,fieldname2 from  tablename where fieldname1 is not null order by fieldname1 "</pre>
<p></P><br />
Here you have added another column slno which have the value equal to row numbers and order corrosponding   to fiedname1.<br />
please note that your sql need not be exactly like my example. It could be any sql except that you can  not use all (*) to represent all the field in the table.You have to explicitly mention the column name<br />
in the sql.<br />
Result of using this in an implemention done be me is as follows:<P></p>
<p><div id="attachment_29" class="wp-caption aligncenter" style="width: 697px"><a href="http://localhost:8080/wordpresshindi/?attachment_id=29" rel="attachment wp-att-29"><img src="http://localhost:8080/wordpresshindi/wp-content/uploads/2009/08/number_in_dgv111.jpg" alt="Example 1" title="Serial Number in Datagridview" width="687" height="198" class="size-full wp-image-29" /></a><p class="wp-caption-text">Example 1</p></div></P></p>
</li>
<li>
<strong>The rowpostpaint event:</strong><br />
  This is another way to achieve the same result albeit you cant specify the headertext for the column  but serial number will be elegently display with proper 0 fill for the numbers.Besides you need not  bother about sql or changing your codes.Just add a simple event and you are done.<br />
  This is an example of this method implemented by me.<P></p>
<pre name="code" class ="csharp">
  private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            int RowNumWidth = dataGridView1.RowCount.ToString().Length;
            StringBuilder RowNumber = new StringBuilder(RowNumWidth);
            RowNumber.Append(e.RowIndex + 1);
            while (RowNumber.Length < RowNumWidth)
                RowNumber.Insert(0, "0");

            // get the size of the row number string
            SizeF Sz = e.Graphics.MeasureString(RowNumber.ToString(), this.Font);

            // adjust the width of the column that contains the row header cells
            if (dataGridView1.RowHeadersWidth < (int)(Sz.Width + 20))
                dataGridView1.RowHeadersWidth = (int)(Sz.Width + 20);

            // draw the row number
            e.Graphics.DrawString(
                RowNumber.ToString(),
                this.Font,
                SystemBrushes.ControlText,
                e.RowBounds.Location.X + 15,
                e.RowBounds.Location.Y + ((e.RowBounds.Height - Sz.Height) / 2));

        }
</pre>
<p></P></p>
<p>   just put these codes in the rowpostpaint event of your datagridviews.Change the datagridview name  as assigned by you in the entire code.<br />
   Result of the above code is as follow:
<p>
<div id="attachment_16" class="wp-caption aligncenter" style="width: 517px"><a rel="attachment wp-att-16" href="http://localhost:8080/wordpresshindi/?attachment_id=16"><img class="size-full wp-image-16" title="Serial Number in Datagridview " src="http://localhost:8080/wordpresshindi/wp-content/uploads/2009/08/number_in_dgv011.jpg" alt="Example 2" width="507" height="226" /></a><p class="wp-caption-text">Example 2</p></div></P></p>
</li>
<p>   Hope these tit bits would be of intrest and use to you.<br />
   Yours comments are surely appreciated.</p>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.rahulinfo.com/archives/1/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

