tag:blogger.com,1999:blog-22994030707828619912024-02-20T17:52:45.826-08:00YasiruGamindayasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-2299403070782861991.post-7608540128664229572010-11-07T21:03:00.000-08:002010-11-07T21:04:23.181-08:00solution for prototype.js and jquery.js conflict problems<p>Jquery have provide a solution for prototype.js and jquery.js conflicts. There is one caveat: By default, jQuery uses "$" as a shortcut for "jQuery". However, you can override that default by calling jQuery.noConflict() at any point after jQuery and the other library have both loaded. For example:
</p>
<br/>
<script src="prototype.js"><⁄script><br/>
<script src="jquery.js"><⁄script><br/>
<script><br/>
var $j =jQuery.noConflict();<br/>
$j(document).ready(function(){<br/>
<br/>
⁄ ⁄ Use jQuery via $j(...)<br/>
$j('#button1').click(function(){<br/>
var textbox1 = $j('#textbox1').val();<br/>
alert(textbox1);<br/>
<br/>
});<br/>
<br/>
⁄ ⁄ Use Prototype with $(...)<br/>
$('someid').hide();<br/>
<br/>
}<br/>
<⁄script><br/>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-14942456702786706612010-10-18T00:24:00.000-07:002010-10-18T00:36:10.279-07:00How to set Cent OS date and time<br />
By entering following command line, we can change the system date of Cent OS<br />
<br />
<br />
[root@localhost ~]# date <month by 2 digits><date by 2 digits><hour by 2 digits in 24 hour format><minutes by 2 digits><year by 4 digits>
<br />
<div>
<br /></div>
<br />
eg:<br />
date 101812472010<br />
<div>
<br /></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-3877428961529051382010-09-25T06:51:00.000-07:002010-10-07T17:43:09.150-07:00How to create mysql stored procedure (without using mysql-query-browser)<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><u>How to create mysql stored procedure (without using mysql-query-browser)</u></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">In here I'm explaning to simple creating mysql stored procedure without using mysql query browser. So let’s say hello using mysql stored </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">procedure.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>1)</b> First you have to open text editor to write the mysql procdure code. So windows users can use notepad and linux users can use vim for </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">that. File name is “hello.sql”. The file format should be “.sql”.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>2)</b> Write the following code on your text editor, and save.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>DELIMITER</b> $$</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>DROP</b> <b>PROCEDURE IF EXISTS </b>`test`.`hello` $$</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>CREATE PROCEDURE </b>`test`.`hello`()</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>BEGIN</b></span></div>
<div style="text-align: justify;">
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> </span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>SELECT </b>'hello';</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>END </b>$$</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>DELIMITER </b>;</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>3)</b> Explanation about the code</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Normally mysql user ";" as the end of a statement (delimiter). But since stored procedures contain semicolons in the procedure body, we need </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">to use a different delimiter to identify the end of the procedure. Therefore in here I’m using “$$” as delimiter of the procedures. To define </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">the delimiter we can use <b>DELIMITER </b>key word as the first line of the above code.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">“ <b>DROP PROCEDURE IF EXISTS </b>`test`.`hello`$$ ” line will remove the stored procedure if it already exists in the test database. In here you </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">can see I have use “$$” procedure delimiter as the end of the statement.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">“ <b>CREATE PROCEDURE </b>`test`.`hello`() “ line is the start of a stored procedure definition. “hello” is the name of the procedure.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">“ <b>BEGIN </b>“ line is the start of the stored procedure program.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Between <b>BEGIN </b>and <b>END </b>we can write the procedure program with using sql stetments. And we use “;” as the delimiter in the program. “<b>SELECT </b></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">'hello'; “ is the simplest sql statement.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">“<b>END </b>$$ ” line ends the procedure program, and it use “$$” delimiter.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">After the end of procedure we should redefine the delimiter to “;” for normal use by "<b>DELIMITER </b>;".</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>4)</b> Now you should log on to the mysql database in command line. </span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">(Windows users should go to the C:\Program Files\MySQL\MySQL Server 5.1…\bin\ where the mysql.exe located)</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"># Mysql –u <username> –p<password></password></username></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>5)</b> After login to the mysql you should type <b>SOURCE </b><file path="">Hello.sql</file></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Example for linux:</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mysql> <b>SOURCE </b>/home/Hello.sql</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Example for windows: </span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mysql > <b>SOURCE </b>D:/Hello.sql</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>6)</b> After that you should type following code to run the procedure.</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>CALL </b>test.hello(); </span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">or </span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>USE </b>test;</span><span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> </span></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>CALL </b>hello();</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">The out put,</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">+-------+</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">| Hello |</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">+-------+</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">| Hello |</span></div>
<div style="text-align: justify;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">+-------+</span></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-76979639875817111132010-08-18T05:44:00.000-07:002010-08-18T05:44:48.511-07:00Database Normalization (1 to 3rd form)In the relational database design, normalization is a systematic way of ensuring that a database structure is suitable for querying without insertion, update, and deletion anomalies that could lead to a loss of data integrity.<br />
<br />
1st Normal Form<br />
============<br />
First you have to know what are the multivalued and composite attributes to understand the 1st normal form.<br />
<br />
Multivalued Attribute is a attribute which can have more then a single value. For an example we can take a person's telephone number. We can take many numbers as telephone number (Home tel number,Mobile number, tel number at office). To remove a multivalued attribute we have to divide the attribute.<br />
Example: If we have attribute called "telephone", then we can divide it as "home telephone", "mobile number", "office number".<br />
<br />
Composite attribute is a attribute which have several attributes. For an example the address attribute is can take as composite attribute. To remove this attribute we can divide the attribute to the sub attributes.<br />
Example: If we have attribute called "address", then we can divide it to "no.", "street1", "street2", "city", "country".<br />
<br />
These kind of attributes (multivalued and composite) should removed from the relation schema to get first normal form relation.<br />
<br />
2nd Normal Form<br />
=============<br />
In the 2nd normal form it consider two dependencies called Functional dependencies and Partial dependencies. And also you should have the knowledge of primary key of a relational schema.<br />
<br />
Functional dependency occurs when one attribute in a relation uniquely determines another attribute.<br />
<br />
Partial dependency occurs when non-key attribute in a relation uniquely determines by sub set of primary key attribute set. Therefore to occur these kind of dependencies the primary key should contain more than one attributes.<br />
<br />
All attributes in a relational schema should be fully functionally depend on the primary key of that relational schema. It means there should not occur any partial dependencies.<br />
<br />
3rd Normal Form<br />
=============<br />
relational schema which have no transitive dependencies, called 3rd normal formed relational schema. transitive dependency occurs when a non-key attribute in a relational schema depends on another non-key attribute.yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com1tag:blogger.com,1999:blog-2299403070782861991.post-85590678181823839542010-08-16T03:35:00.000-07:002010-08-17T21:52:04.287-07:00Simple Linux shell script ( for beginners)Here I'm going to show you how to write a simple Linux shell script to print "Hello World" in the Linux command line.<br />
<br />
<b>Step 1 : To go to the home folder, type "cd /home" and press 'Enter' key.</b><br />
<br />
<b>Step 2 : To open a new file, type "vi hello.sh" and press 'Enter' key.</b><br />
<br />
<b>Step 3 : Press 'Insert' key and write following code;</b><br />
<br />
<br />
<b>#!/bin/sh</b><br />
<b>#clear for clear the screen</b><br />
<b>clear</b><br />
<b>#echo for print Hello World</b><br />
<b>echo "Hello World"</b><br />
<br />
<br />
<b>Step 4 : Press 'Esc' key and type ":wq" and press 'Enter' key to save the file.</b><br />
<br />
<b>Step 5 : Now type "ls" to list the file and check the file was created.</b><br />
<br />
<b>Step 6 : Now type "chmod +x hello.sh" and press 'Enter' key to make it as executable file.</b><br />
<br />
<b>Step 7 : Check the files again by typing "ls". the file will be show in green color.</b><br />
<br />
<b>Step 8 : To run the shell script, type "./hello.sh" and press 'Enter' key. This will print "Hello World" in your screen.</b><br />
<br />
This is the simplest shell script that you can star get familiar with writing Linux shell scripts, and explore the advance shell scripts.yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-62049895734795647342010-07-28T03:39:00.000-07:002010-07-28T03:39:46.103-07:00Easy way to select numerical data from MySQL table<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">I'll explain this using a example,</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Lets thing we have table called EMP and column called SALARY.</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Now suppose there are numerical data and string data in the SALARY column. (ex: 12000, 25000, not available, null...)</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">For this kind of columns we can use following method to select only numerical data;</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">SELECT SALARY FROM EMP WHERE (SALARY+0)!=0;</span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com1tag:blogger.com,1999:blog-2299403070782861991.post-51317562462948171332010-07-26T22:22:00.000-07:002010-07-26T22:48:00.157-07:00Things that Microsoft could Never Explain....!!!<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>This is pretty funny and awesome...</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>-------------------------------------------------------------------------------------------------------------</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>MAGIC 1</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>An Indian found that nobody can create a FOLDER anywhere on the Computer which can be named as "CON". This is something funny and inexplicable? At Microsoft the whole Team, couldn't answer why this happened! TRY IT NOW, IT WILL NOT CREATE A "CON" FOLDER</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>-------------------------------------------------------------------------------------------------------------</i></b></span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>MAGIC 2</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>For those of you using Windows, do the following:</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>1.) Open notepad application</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>2.) Type "Bush hid the facts" (without the quotes)</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>3.) Save it as whatever you want.</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>4.) Close it, and re-open it.</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>Noticed the weird bug? No one can explain!</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>-------------------------------------------------------------------------------------------------------------</i></b></span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>MAGIC 3</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>Again this is something funny and can't be explained? At Microsoft the whole Team, including Bill Gates, couldn't answer why this happened!</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>It was discovered by a Brazilian. Try it out yourself?</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>Open Microsoft Word and type</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>=rand (200, 99)</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>And then press ENTER</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>And see the</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>magic...! </i></b></span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>-------------------------------------------------------------------------------------------------------------</i></b></span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>Magic 4 </i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i> </i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>Did you know that a flight number from one of the planes that hit one of the two WTC towers on 9/11 was Q33 NY. In Notepad / WordPad or MS Word, type that flight number i.e Q33 NY. Increase the font size to 72. Change the font to Wingdings. ….. u will be amazed by the findings!!!</i></b></span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i>-------------------------------------------------------------------------------------------------------------</i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><i><br /></i></b></span><br />
<br />
<br />
<br />yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-73213322351382419972010-07-17T08:24:00.000-07:002010-07-17T20:40:32.434-07:00Brief introduction about Asterisk<div style="text-align: justify;">Asterisk is a software that use to handle voice communications. It is created in 1999 by Mark Spencer of Digium.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Normally its installed as a server and attached telephones to make calls to one another, and to connect to other telephone services including the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services.</div><div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">IP PBX systems, VoIP gateways and conference servers are same of application that we can develop using Asterisk. It is used by small businesses, large businesses, call centers, carriers and governments worldwide. I'm not going to describe about these application but if you are not familiar with this application, then you can simply search them on Wikipedia.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">It is a free opensource software and originally design for Linux. But now Asterisk also runs on a variety of different operating systems including NetBSD, OpenBSD, FreeBSD, Mac OS X, and Solaris. And it is available for Microsoft Windows as AsteriskWin32. But still it is most stable on Linux and recommended OSs are Debian, Fedora, CentOS. And also other Linux OSs like Gentoo, SuSE, Mandrake and Slackware.</div></div><div style="text-align: justify;"><br /></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-38344824214446907122010-07-16T17:48:00.000-07:002010-07-16T17:54:07.449-07:00How to recover hidden data in your pen driver<div><ol><li>go to the cmd (press Window key + R -> type "cmd" -> press Enter)</li><li>go to your pen drive by type "<driver>:" (eg: C:\>f:)</li><li>take a view of all hidden file in your pen by typing "dir /ah" (eg f:\>dir /ah)</li><li>type "attrib [name of file/folder] -r -a -s -h"</li><li>type "attrib <filename.filetype/foldername> -r -a -s -h" to unhide the file (attrib test.txt -r -a -s -h)</li><li>if the file name is longer than 6 charactors, the type like this, "attrib filena~1 -r -a -s -h" (filename.txt is the file name)</li></ol><ul><li>Use this command "attrib -s -h -r f:\*.* /s /d" to solve your problem in once for all file and folders (f: is the pen diver)</li></ul></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-67526181921436796892010-05-26T23:12:00.000-07:002010-05-26T23:35:05.384-07:00Power leaking from PC casing<div style="text-align: justify; font-family: arial; font-weight: bold;"><span style="font-size:100%;">Most of PC users are having troubles with power leaking from their PC casing. There are may have lot of reasons. But most of the time the reason is improper power connection. If you use good power connection with proper 3 pin plug point, then most of the time the problems with power leaking are get solved. We are normally use low price multiplugs for supply power to Monitor, CPU, Speaker/Sub-woofer, Router,Printer, etc. These low price multiplugs have no earth connections for it's 3 pin outputs. So it is not recommend to use low quality </span><span style="font-size:100%;">multiplugs for PCs. CPU and Monitor must plugged to 3 pin plug points.<br /></span></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-45929041047728993942010-05-11T22:35:00.000-07:002010-05-11T22:48:57.542-07:00About Prototype popular javaScript frameworkPrototype is a JavaScript framework that aims to ease development of dynamic web application. This framework enables you to deal with lot of JavaScript features like Ajax, DOM extensions, JSON objects, etc. Refer following link to get some idea about Prototype JS framework, I'll give some sample codes for explain how to user these features later.<br />http://www.prototypejs.org/learnyasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-4973187482644368262010-05-07T01:16:00.000-07:002010-05-07T01:22:28.937-07:00How to modify or remove php session variables<span style="font-weight: bold;">First you have to open the session for modify or remove session variables.</span><br /><span style="font-style: italic;">session_start(); </span><br /><br /><span style="font-weight: bold;">To change a variable, just overwrite it.</span><br /><span style="font-style: italic;">$_SESSION['name']='your_name'; </span><br /><br /><span style="font-weight: bold;">To remove a single variable in the session.</span><br /><span style="font-style: italic;">unset($_SESSION['name']); </span><br /><br /><span style="font-weight: bold;">To remove all the variables in the session. (without destroying the session)</span><br /><span style="font-style: italic;">session_unset(); </span><br /><br /><span style="font-weight: bold;">To destroy the session.</span><br /><span style="font-style: italic;">session_destroy(); </span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-39375792094847084882010-05-05T03:49:00.000-07:002010-05-05T05:17:27.531-07:00How to detact javascript is enable or not in the client browser<div style="text-align: justify;"><span style=";font-family:verdana;font-size:100%;" >There are various kind of solution to check the javascript support of client browser. In here I'll provide a solution to block client access who have not enabled javascript in his/her browser.</span><br /><br /><span style=";font-family:verdana;font-size:100%;" >In this example I user index.html which clients want to visit. And user enable_js.html which will redirect clients from index.html page when their browser not support to javascript.</span></div><br /><br /><span style=";font-family:courier new;font-size:85%;" ><noscript><br /> <meta equiv="refresh" content="0;URL=enable_js.html"><br /></noscript></span><br /><br /><div style="text-align: justify;"><span style="font-family:verdana; font-size:100%;">Add above code into the body (between body tags) of index.html. This part will redirect clients who user browsers which not support for javascript to enable_js.html. If javascript is enable, then nothing happent from this code.</span></div><br /><br /><span style=";font-family:courier new;font-size:85%;" ><br /><h2 id="nojs" style="font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(204, 0, 0);"><br />JavaScript is turned off in your web browser. Turn it ON (Enable) to access the website, then refresh the page.<br /></h2><br /><script><br /> document.getElementById("nojs").style.display="none";<br /> alert("Javascript enabled successfully! Press ok to continue");<br /> window.location = "index.html";<br /></script><br /></span><br /><br /><span style="font-family:verdana;">Add above code into the body of enable_js.html. This will display error massage when javascript is disable in client's browser. After enable javascript and refresh this page will provide alert with informing the javascript is successfully working. And after press ok it will redirect to the index.html.<br /></span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-23455566593603003112010-04-20T23:37:00.000-07:002010-04-21T00:30:06.029-07:00How to use different types of page numbering formats in a same word .doc file<span style="font-family: trebuchet ms;">When we writing well formatted project reports, use (i), (ii), (iii)... page numbering format for pages before the main chapters. For main chapters we use kind of 1, 2, 3... formats. There are few steps to manage this page numberings for different parts.</span><br /><br /><span style="font-family: trebuchet ms;">Steps for MS Office 2007</span><br /><br /><span style="font-family: trebuchet ms;">Lets think we need to add (i), (ii), (iii)... page numbering format for first 5 pages and 1, 2, 3... page numbering format for rest of the doc.</span><br /><br /><span style="font-family: trebuchet ms;">Step1: Goto page 5 click on that page (Lets think the doc start at page 1, not 0)</span><br /><br /><span style="font-family: trebuchet ms;">Step2: Page Layout tab -> Breaks (in the Page Setup section) -> Section Break -> Next Page</span><br /><span style="font-family: trebuchet ms;">This will start a new new section and it start at page 6.</span><br /><br /><span style="font-family: trebuchet ms;">Step3: Goto any page in first section (page1 - page5) and click on it.</span><br /><br /><span style="font-family: trebuchet ms;">Step4 : Insert tab -> Page Number (in the Header Footer section) -> Format Page Numbers...</span><br /><span style="font-family: trebuchet ms;">-> Choose i, ii, iii.... number format (in the Page Number Format dialog box) -> Ok</span><br /><br /><span style="font-family: trebuchet ms;">Step5: Do the same above steps to set page numbers to next section with selecting the 1, 2, 3...</span><br /><span style="font-family: trebuchet ms;">number format</span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-34287928925284844692010-04-02T03:39:00.000-07:002010-04-02T03:42:31.256-07:00Some free software ER diagramming tools<span style="font-size:100%;"><span style="font-weight: bold;">RISE Editor<br /><br /><a href='http://www.risetobloome.com/'>http://www.risetobloome.com/</a><br /></span></span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com2tag:blogger.com,1999:blog-2299403070782861991.post-21152294324928194162010-04-01T21:00:00.000-07:002010-04-02T03:38:56.853-07:00UML tool for draw UML diagrams fast (a free software)<h1 class="style4" align="center" style="font-family:arial;"><span style="font-size:50%;">Free UML Tool for Fast UML Diagrams </span></h1> <p align="left"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;"><span class="style14">UMLet is an open-source UML tool with a simple user interface: <strong>draw</strong> UML diagrams fast, <strong>export</strong> diagrams to eps, pdf, jpg, svg, and clipboard, <strong>share</strong> diagrams using Eclipse, and <strong>create</strong> new, custom UML elements.</span></span></p><p align="left"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;"><span class="style14">download : <a href="http://www.umlet.com/changes.htm">http://www.umlet.com/changes.htm</a></span></span></p><p align="left"><br /></p><p style="text-align: center; font-weight: bold;">ArgoUML</p><p align="left"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;"><span class="style14"><span style="font-weight: bold;"><a href='http://argouml-downloads.tigris.org'>http://argouml-downloads.tigris.org/</a></span><br /></span></span></p>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-68943720445408240842010-03-24T23:55:00.001-07:002010-03-24T23:55:48.053-07:00flash tutorialshttp://www.webdesigntutorials.net/flash_tutorials.phpyasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-23483700128132783352010-03-15T21:55:00.000-07:002010-03-15T22:08:06.282-07:00<p style="font-family: courier new;">To get the the first N records in a SQL query differs acording to database platforms.</p><p style="font-family: courier new;">Here's some samples:</p> <p style="font-family: courier new;"><strong>Microsoft SQL Server</strong></p> <pre style="font-family: courier new;">SELECT <strong>TOP 10</strong> column FROM table<br /></pre> <p style="font-family: courier new;"><strong>PostgreSQL and MySQL</strong></p> <pre style="font-family: courier new;">SELECT column FROM table<br /><strong>LIMIT 10</strong><br /></pre> <p style="font-family: courier new;"><strong>Oracle</strong></p> <pre style="font-family: courier new;">SELECT column FROM table<br /><strong>WHERE ROWNUM <= 10</strong><br /></pre> <p style="font-family: courier new;"><strong>Sybase</strong></p> <pre style="font-family: courier new;"><strong>SET rowcount 10</strong><br />SELECT column FROM table<br /></pre> <p style="font-family: courier new;"><strong>Firebird</strong></p> <pre><span style="font-family: courier new;">SELECT </span><strong style="font-family: courier new;">FIRST 10</strong><span style="font-family: courier new;"> column </span><br /><span style="font-family: courier new;">FROM table</span><br /></pre>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-16034790372462908772010-01-18T19:53:00.000-08:002010-01-18T20:29:57.031-08:00How to send HTTP request using PHP?<span class="Apple-style-span" style="font-size:medium;">There is a predefined php class called HttpRequest. By using this class we can create object for handle HTTP requests. There are list of function to handle it. Refer PHP manual and get some idea about this class.</span><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div>In WAMP before use this objects you need to make some changes in php.ini file. Add following line into the php.ini file (somewhere near in the extension).</div><div><br /></div><div>"extension=php_http.dll"</div><div><br /></div><div><br /></div><div>Example</div><div>======</div><div><br /></div><div>user HttpRequest object to handle get method http request</div><div><br /></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$r= new HttpRequest('www.example.com?valueone=1&valuetwo=2', HttpRequest::METH_GET);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$r->send();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo $r->getResponseBody();</div></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-31798694922334406412009-12-20T19:55:00.000-08:002009-12-20T20:10:50.323-08:00Simple php sample code for privent SQL injection attacts<span style="font-size:85%;"><span style="font-family: courier new; font-weight: bold;"><?php<br /><br />if(isset($_POST["un"]) && isset($_POST["pw"])){</span><br /><br /><span style="font-family: courier new; font-weight: bold;"> mysql_connect("localhost","root","");</span><br /><span style="font-family: courier new; font-weight: bold;"> mysql_select_db("my_db");</span><br /><span style="font-family: courier new; font-weight: bold;"> </span><br /><span style="font-family: courier new; font-weight: bold;"> $username = mysql_real_escape_string($_POST["un"]);</span><br /><span style="font-family: courier new; font-weight: bold;"> $password = mysql_real_escape_string($_POST["pw"]);</span><br /><span style="font-family: courier new; font-weight: bold;"></span><span style="font-family: courier new; font-weight: bold;"> </span><span style="font-family: courier new; font-weight: bold;"></span><br /><span style="font-family: courier new; font-weight: bold;"> $sql = "SELECT * FROM user WHERE id = '$username' AND name = '$password';";</span><br /><span style="font-family: courier new; font-weight: bold;"> $result = mysql_query($sql);</span><br /><span style="font-family: courier new; font-weight: bold;"> if($result){</span><span style="font-family: courier new; font-weight: bold;"></span><br /><span style="font-family: courier new; font-weight: bold;"> if(mysql_num_rows($result)>0){</span><br /><span style="font-family: courier new; font-weight: bold;"> echo "you loged in....";</span><br /><span style="font-family: courier new; font-weight: bold;"> }</span><br /><span style="font-family: courier new; font-weight: bold;"> }</span><br /><br /><span style="font-family: courier new; font-weight: bold;">}<br />?><br /><br /><br /><form method="post"><br />Id : <input type = "textbox" name = "un"></br><br />Password : <input type = "textbox" name = "pw"><br /><input type = "submit" value = "login"><br /></form><br /></span></span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-21549868752496479952009-12-02T01:01:00.000-08:002009-12-02T01:43:31.763-08:00Mysql with C sharp<span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">dot net commonly use sql server as DBMS. But now it is possible to us Mysql which is open source DBMS commonly use for web developers.</span></span><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">First download latest</span></span><b><span class="Apple-style-span" style="color:#660000;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">Connector/Net</span></span></span></b><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;"> from </span></span><a href="http://dev.mysql.com/downloads/connector/net/"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">http://dev.mysql.com/downloads/connector/net/</span></span></a><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;"> link. Install the connector to your pc. This will install the documentation too. You need to add </span></span><b><span class="Apple-style-span" style="color:#660000;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">Mysql.Data</span></span></span></b><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;"> into the project references before use mysql in your project.</span></span><div><div><span class="Apple-style-span" style="color:#3366FF;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">(Solution Explorer -> Your solution -> Your project -> References -> right click -> add reference... -> double click on Mysql.Data)</span></span></span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">Now you have to add </span></span><b><span class="Apple-style-span" style="color:#660000;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">'</span></span></span></b><span class="Apple-style-span" style="line-height: 16px; "><b><span class="Apple-style-span" style="color:#660000;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;">using</span></span></span></b><b><span class="Apple-style-span" style="color:#660000;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;"> MySql.Data.MySqlClient;'</span></span></span></b><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size: large;"> to the top of your source code.</span></span></span></div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="font-size: large;">Try to understand following simple code :</span></div><div><br /></div><div><span class="Apple-style-span" style=" color: rgb(51, 51, 51); line-height: 16px; font-family:Verdana;font-size:12px;"><p><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">string</span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> MyConnString = "</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">SERVER=localhost;"</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> + </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">"DATABASE=database;"</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> + </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">"UID=root;"</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> + </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">"PASSWORD=passoword;"</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">;</span></span></span></p><p><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">MySqlConnection</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> connection = </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">new</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span></span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">MySqlConnection</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">(MyConnString);</span></span></span></span></p><p><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">MySqlCommand</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> command = connection.CreateCommand();</span></span></span></p><p><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"></span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">MySqlDataReader</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> Reader;</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span></span></span></span></p><p><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">command.CommandText = </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">"select * from tablename"</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">;</span></span></span></p><p><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">connection.Open();</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> </span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">Reader = command.ExecuteReader();</span></span></span></p><p><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">while</span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> (Reader.Read()) {</span></span></span></span></p><p><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span></span></span></span></span><span><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span class="Apple-tab-span" style="white-space:pre"> </span>string</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> row = </span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">""</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">;</span></span></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span></span></span></span></span></p><p><span><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span class="Apple-tab-span" style="white-space:pre"> </span>for</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> (</span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">int</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"> i = 0; i <></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><br /></span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span class="Apple-tab-span" style="white-space:pre"> </span>row += Reader.GetValue(i).ToString() + </span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">" , "</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">;</span></span></span></span></span></p><p><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"></span></span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span></span></span></span><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"><span class="Apple-tab-span" style="white-space:pre"> </span>System.</span></span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">Console</span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">.WriteLine(row);</span></span></span></span></p><p><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;"></span></span></span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">}</span></span></span></p><p><span><span><span class="Apple-style-span" style="color:#000099;"><span class="Apple-style-span" style="font-size:x-small;">connection.Close();</span></span></span></span></p></span></div></div></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-52416807428681096862009-12-01T20:44:00.000-08:002009-12-01T20:49:29.381-08:00How to execute php files without loading it<div>This method will execute the file_handle.php file and return the html result. So we can simply use this to database updates using this (use get method for pass inputs).</div><div><br /></div><div><?php</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo "Start";</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$result = file("http://localhost/testing/file_handle.php");</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo "end";</div><div>?></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-48569433229386222702009-11-03T19:22:00.000-08:002009-11-03T19:26:59.327-08:00How to disable autorun in Windows XP<span style=";font-family:verdana;font-size:85%;" >Start ---> Run ---> gpedit.msc<br /><br />(Left Pane) Computerer Configuration ---> Administrative Templates ---> System<br /><br />(Right Pane) Set "Turn off autoplay" to "Enabled"</span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-32855403329902358402009-10-23T00:59:00.000-07:002009-10-28T23:21:30.376-07:00Php function for search from a file<span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;" >If you have the start and end points, you can get the content of that two points. (as a example if the start and end point are <l1> and </l1> then u can get the content of these tags using this function. eg: <l1>content</l1>)<br /><br />","",$contents);<br />$t = my_strip("abc","xyz",$contents);<br /><br />echo $t;<br />?><br /><br /><br />aaa.txt<br />=====<br />ntbfjkb n jABCjergnv<br />fvb j njrbn ntbfjkb n jegnb ef<br />g45yyyXYZtrgjrgbXYZk oi iABCyji oni jij<br /><br />output<br />=====<br /></span><span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;" >jergnv fvb j njrbn ntbfjkb n jegnb ef g45yyy</span>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0tag:blogger.com,1999:blog-2299403070782861991.post-23103492660909903002009-09-29T04:38:00.000-07:002009-10-28T23:18:54.393-07:00sample code for undestand php file handling functions<div><span class="Apple-style-span" style="font-family:arial;"></span></div><div><span class="Apple-style-span" style="font-family:arial;"> $comment = $_POST["txtcomment"];</span></div><div><span class="Apple-style-span" style="font-family:arial;"> if ($comment!=""){</span></div><div><span class="Apple-style-span" style="font-family:arial;"> $date=date('l dS \of F Y h:i:s A');</span></div><div><span class="Apple-style-span" style="font-family:arial;"> $massage = $date.": ".$comment."\n";</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;"> $file=fopen("comment.txt","a+") or exit("Unable to open file!");</span></div><div><span class="Apple-style-span" style="font-family:arial;"> fwrite($file,$massage) or die("Could not write to file");</span></div><div><span class="Apple-style-span" style="font-family:arial;"> fclose($file);</span></div><div><span class="Apple-style-span" style="font-family:arial;"> echo "Massage sent!";</span></div><div><span class="Apple-style-span" style="font-family:arial;"> }</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">?></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">This will write the massage to the comment.txt file.</span></div>yasiru gamindahttp://www.blogger.com/profile/05261055251387763995noreply@blogger.com0