tag:blogger.com,1999:blog-24912921321799881482024-03-05T01:34:30.281-08:00AllAboutTutorialsVictor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-2491292132179988148.post-8824775133127663282013-09-23T05:20:00.002-07:002013-09-23T05:20:41.905-07:00Palindrome checker using javaimport java.util.*;<br />
<br />
public class palindrome<br />
{<br />
public static void main(String args[])<br />
{<br />
String original, reverse="";<br />
Scanner in = new Scanner(System.in);<br />
<br />
System.out.println("Enter a string to check if it is a palindrome");<br />
original = in.nextLine();<br />
<br />
<br />
int length = original.length();<br />
<br />
for ( int i = length - 1 ; i >= 0 ; i-- )<br />
reverse = reverse + original.charAt(i);<br />
<br />
if (original.equals(reverse))<br />
{<br />
System.out.println("Entered string is a palindrome.");<br />
<br />
}<br />
else<br />
{<br />
System.out.println("Entered string is not a palindrome.");<br />
System.out.println(reverse);<br />
}<br />
<br />
}<br />
}Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-28708958672335531662013-09-12T19:10:00.001-07:002013-09-12T19:10:20.893-07:00How to sort array values in ascending / descending order using JavaHere's the idea on how to sort array; descending or ascending order: I hope this would helps.<br />
<br />
Sample output:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgyY9sJIriGD47H91SYl67Z2WlD9WCZsgXICoACZH1Ovp5BKXGq8qXsOybpg9EKxLbMekNkDpBi5H_42DPrNlIwIwXE9XgImSOXfSu86tz9gVOcMT_57YDhiem01wJWHATmTNhfMnVA/s1600/2013-09-13_1012.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgyY9sJIriGD47H91SYl67Z2WlD9WCZsgXICoACZH1Ovp5BKXGq8qXsOybpg9EKxLbMekNkDpBi5H_42DPrNlIwIwXE9XgImSOXfSu86tz9gVOcMT_57YDhiem01wJWHATmTNhfMnVA/s320/2013-09-13_1012.png" width="320" /></a></div>
<br />
<br />
import java.util.Scanner;<br />
<br />
public class AscendingDescending<br />
{<br />
public static void main(String args[])<br />
{<br />
Scanner scan = new Scanner(System.in);<br />
int tenNums[]=new int[10], orderedNums[]=new int[10];<br />
int greater;<br />
String choice;<br />
<br />
System.out.println("Enter 10 integers : ");<br />
for (int i=0;i<tenNums.length;i++)<br />
{<br />
System.out.print(i+1+"=> ");<br />
tenNums[i] = scan.nextInt();<br />
}<br />
System.out.println();<br />
<br />
//imperfect number ordering algorithm<br />
for(int indexL=0;indexL<tenNums.length;indexL++)<br />
{<br />
greater=0;<br />
for(int indexR=0;indexR<tenNums.length;indexR++)<br />
{<br />
if(tenNums[indexL]>tenNums[indexR])<br />
{<br />
greater++;<br />
}<br />
}<br />
orderedNums[greater]=tenNums[indexL];<br />
}<br />
<br />
//ask if ascending or descending<br />
System.out.print("Display order :\nA - Ascending\nD - Descending\nEnter your choice : ");<br />
choice = scan.next();<br />
<br />
//output the numbers based on choice<br />
if(choice.equalsIgnoreCase("a"))<br />
{<br />
for(greater=0;greater<orderedNums.length;greater++)<br />
{<br />
System.out.print(orderedNums[greater]+" ");<br />
}<br />
}<br />
else if(choice.equalsIgnoreCase("d"))<br />
{<br />
for(greater=9;greater>-1;greater--)<br />
{<br />
System.out.print(orderedNums[greater]+" ");<br />
}<br />
}<br />
}<br />
}Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-28591678281028659042013-09-12T07:18:00.001-07:002013-09-12T07:18:38.759-07:00How to remove duplicates in an array using java without using function?Here's a simple code for removing duplicates in String array without using function or methods. I hope this would helps.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWSDTs5qSTaFHWGZLWLBJRab9JSgetTWF08Ru7vbuA2og8178-AaUH16-R0Ro8FCBbkdFzMM3sA0G2b8io2c8Z7FOriRT4cns9F5xJxCDh1k0VE-N1ttZ_piCJJP6NZkFH5kxlf5Q3KA/s1600/2013-09-12_2221.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWSDTs5qSTaFHWGZLWLBJRab9JSgetTWF08Ru7vbuA2og8178-AaUH16-R0Ro8FCBbkdFzMM3sA0G2b8io2c8Z7FOriRT4cns9F5xJxCDh1k0VE-N1ttZ_piCJJP6NZkFH5kxlf5Q3KA/s1600/2013-09-12_2221.png" height="310" width="320" /></a></div>
<br />
<br />
import java.io.*;<br />
public class Arrayremoveduplicates {<br />
<br />
public static void main(String[] args) throws Exception {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
InputStreamReader reader = new InputStreamReader(System.in);<br />
BufferedReader scan = new BufferedReader (reader);<br />
<br />
String [] name = new String[5];<br />
<br />
System.out.println("Enter name: ");<br />
for (int i=0;i<name.length;i++)<br />
{<br />
<br />
name[i] = scan.readLine();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("List of 5 Names :");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> for (int a = 0; a < name.length; a++)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> System.out.print(name[a] + " ");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> }<br />
System.out.println();<br />
int total=0;<br />
System.out.println("Names without duplicates :");<br />
for (int i = 0; i < name.length; i++)<br />
{<br />
int duplicate = 0;<br />
for (int j = i + 1; j < name.length; j++)<br />
{<br />
if (name[i].equals( name[j]))<br />
{<br />
duplicate = duplicate + 1;<br />
<br />
}<br />
}<br />
<br />
if (duplicate == 0)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> total++;<br />
System.out.println(name[i] + " ");<br />
}<br />
<br />
}<br />
System.out.println("Number of Duplicates: " + total);<br />
}<br />
}<br />
<br />
<br />Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-13317198803628489162012-11-03T01:11:00.001-07:002012-11-03T01:11:44.445-07:00A Christian holiday for Souls.<a href="http://worldwidewebco.com/a-christian-holiday-for-souls/">A Christian holiday for Souls.</a>Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-71378350768867971952012-04-27T23:01:00.003-07:002012-04-27T23:01:39.225-07:00Creating Table in HTMLTables arrange and organize content into columns and rows. Basically, they can be made via the container tags <table></table>. Each row within the table is defined by the container tags <tr></tr>. Moreover, each cell or data within a row is defined by the container tags <td></td>.<br />
<br />
Remember that the cells <td></td> are placed inside the rows <tr></tr> and rows are placed inside the table<br />
<table></table>.<br />
<br />
<br />
<html><br />
<head><br />
<title>Computer Books</title><br />
</head><br />
<body><br />
<caption>IT Learning</caption><br />
<table><br />
<tr bgcolor="#ff0000"><br />
<th></th><br />
</tr><br />
<tr><br />
<th align="center" width="200px">BOOKS</th><br />
<th align="center" width="200px">SOFTWARE</th><br />
<th align="center" width="200px">HARDWARE</th><br />
</tr><br />
<tr><br />
<th align="center" >Creative Design</th><br />
<th align="center" >Adobe</th><br />
<th align="center" >Asus Notebook</th><br />
</tr><br />
<br />
<tr><br />
<th align="center" >Office Productivity</th><br />
<th align="center" >Microsoft</th><br />
<th align="center" >inFocus Projector</th><br />
</tr><br />
<br />
</table><br />
</body><br />
</html>Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-38530402002801378972012-04-15T19:27:00.001-07:002012-04-15T19:27:22.903-07:00Specifying the Background Image of a PageYou can specify the background image of the page by using the background Attribute inside the body tag<br />
<body background="value">...</body>. However when using an image as a background of a web page you must keep in mind not to make your background image stronger than your web page or it will be hard to read the text of your Web page. You can also add a background color that matches the color of the image.<br />
<br />
In choosing a background image, you should remember the following:<br />
<br />
1. Use an image that will not distract the text and main content of the page.<br />
2. Do not use large image file because it will take a long time to load your page.<br />
3. The background should not show boundaries and grids when tiled.<br />
<br />
<br />
<html><br />
<head><br />
</head><br />
<body><br />
<body background="image.png"><br />
<font face='tahoma' size='7'> BUTTERFLY </font><br />
</body><br />
</html>Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com3tag:blogger.com,1999:blog-2491292132179988148.post-58673068562155588352012-03-26T12:27:00.002-07:002012-03-26T12:27:59.135-07:00Line Breaks in HTMLHave you noticed how your Web browser treats the white spaces on your HTML file? Your Web browser ignores white spaces and pressing <b>Enter </b>of the <b>Return </b>key does not actually create a new line on the chunk of text on your Web page as seen on the code. It will create a new line for the text that you want to appear on the next line.<br />
<br />
<br />
The <br> tag creates a line break or new line.<br />
<br />
<br />
<html><br />
<br />
<body><br />
<br />
<br>This is the first line<br><br />
<br>This is the second line<br><br />
<br>This is the third line<br><br />
<br />
</body><br />
</html><br />
<br />
<br />
Output:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb1P6tK16QSUMSeC403bz1_THVNDMKRp0JyzjNTLAE-YvqsIa60E4bp_VUi1F2Gf2s04vgQ-tYpR-XjyXNejIl2_j_cI_dsuPOkpO7xvNWy1Z1B-0XjiWtPMp98HnKULPb4ktWx00Rcw/s1600/Label-Break.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb1P6tK16QSUMSeC403bz1_THVNDMKRp0JyzjNTLAE-YvqsIa60E4bp_VUi1F2Gf2s04vgQ-tYpR-XjyXNejIl2_j_cI_dsuPOkpO7xvNWy1Z1B-0XjiWtPMp98HnKULPb4ktWx00Rcw/s320/Label-Break.gif" width="320" /></a></div>
<br />
<br />Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-61320548396363430112012-03-22T15:59:00.003-07:002012-03-22T15:59:23.151-07:00How to Save and Viewing your HTML file<b>Saving an HTML Document</b><br />
<b><br /></b><br />
After creating your codes, you can save your HTML document so that you can view or work on it later.<br />
<br />
1. On the<b> Menu Bar</b>, click <b>File</b> and click <b>Sav</b>e or <b>Save As</b>.<br />
2. On the<b> Save As dialog box</b>, type your file name in the<b> File name box</b>.<br />
3. When saving, always change the file and type to <b>All Files</b> and use <b>.html</b> or <b>.htm file</b> extension.<br />
4. Click <b>Save</b>.<br />
<br />
<br />
Viewing an HTML Page<br />
<br />
You can now view your HTML document on your web browser.<br />
<br />
1. Launch any Web browser.<br />
2. On the <b>Menu Ba</b>r, click <b>File</b> and click <b>Open File</b>.<br />
3. On the <b>Open dialog box</b>, click <b>browse</b>.<br />
4. Look for the folder or drive where<b> </b>HTML file was saved and click the file.<br />
5. Click <b>Open</b> and on the <b>Open dialog box</b> click <b>OK</b>.Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com18tag:blogger.com,1999:blog-2491292132179988148.post-55575807255507752972012-03-21T21:13:00.002-07:002012-03-21T21:13:47.770-07:00Creating a New Paragraph in HTMLIn HTML, there are tags for writing paragraph. Yes, it's container tag and it is <p></p>.<br />
<br />
<html><br />
<head><br />
<title>Latest IT Books</title><br />
</head><br />
<body><br />
<font size="5" face="arial"><br />
<p>This is the first paragraph.</p><br />
<p>This is the second paragraph.</p><br />
<p>This is the third paragraph.</p><br />
</font><br />
</body><br />
</html>Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-31094561113901133912012-03-20T15:48:00.003-07:002012-03-20T15:48:44.721-07:00HTML TagsTags are the basic units or building blocks of an HTML file (or code as you may call it now since writing it may referred to as coding, too). Web pages are designed and HTML codes are made up of these tags - they control how the HTML does it structuring, laying out and formatting.<br />
<br />
There are so many tags and each has its own use. Some are used to make your text appear in boldface, italicized or underlined. Some are used to make your text bigger, and some are, on the contrary, to make your text smaller. Some can put your text on the center or even on the far right of the screen. Some can put a horizontal line across the screen to separate texts. Some can put images and videos to even spice up your web page.<br />
<br />
<b>BASIC HTML TAGS</b><br />
<br />
<b>Name</b> <b>Meaning</b><br />
<br />
<p></p> Paragraph<br />
<br> Line Break<br />
<hr> Horizontal Rule<br />
<h1></h1> Heading 1<br />
<ol></ol> Ordered List<br />
<ul></ul> Unordered List<br />
<dl></dl> Definition List<br />
<font color="blue" size="5"> Modify Font<br />
<b></b>, <i></i>, <u></u> Bold, Italic, Underline<br />
<pre></pre> Preformat<br />
<img src="image.gif"> Image<br />
<table></table> Table<br />
<tr></tr> Table row <br />
<td></td> Table dataVictor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-63958931218637174442012-03-19T15:35:00.002-07:002012-03-19T15:35:13.962-07:00A Quick HTML Review - Creating an HTML DocumentYou can start creating HTML document with use of a text editor, HTML editor or word processing program.<br />
<br />
HTML Editors - An HTML editor is a software application for creating web pages. Since HTML documents use plain text, any text editing program can be used to create Web pages.<br />
<br />
<br />
TEXT EDITING PROGRAMS<br />
<br />
<b>Name Examples</b><br />
<b><br /></b><br />
Text Editors Microsoft Windows Notepad<br />
Apple MAcintosh TextEdit<br />
Komodo Edit<br />
Zend Studio<br />
HTML Editors Adobe DreamWeaver<br />
Microsoft Expression<br />
<br />
Word Processing Programs Microsoft WordVictor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com2tag:blogger.com,1999:blog-2491292132179988148.post-148186487433019492012-03-14T08:43:00.002-07:002012-03-14T08:43:59.815-07:00What do you need to start PHP?1. Basic use and understanding of HTML/XHTML is necessary to study PHP.<br />
Knowledge of Cascading Style Sheet (CSS) and Javascript is also helpful.<br />
2. Web server. Your computer can be web server; we simply need to install a web server program into in. In this book we will be using Apache freom this site http://httpd.apache.org/download.cgi.<br />
3. PHP. The PHP program can be downloaded free from http://www.php.net/downloads.php<br />
4. Database. The database program that we will be using for the using for the book is the equally popular and free software MySQL from this siote; http://www.mysql.com/downloads/<br />
5. Text Editor. You can either such as MS Notepad is necessary to create the HTML and PHP scripts.<br />
6. Web Browser. You can either use Internet Explorer, Mozilla Firefox, Safari, Opera or Google Chrome as your web browser. Yes, your computer can be a server and at the same time operate a web browser where you can output your scripts.Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-86707493808497501082012-03-12T17:01:00.002-07:002012-03-12T17:01:46.418-07:00Why do we use PHP?1. Te focus on this question is really why PHP and why not other scripting program. Why use PHP instead of another web technology?<br />
2. HTML is static scripting language and has many limitations and PHP can provide it with much more dynamism and flexibility.<br />
3. PHP is free of charge and an open source software. <b>Open source software</b> are available for everyone to use, study, modify and modify and improve just like the zend group did, meaning you can also create and improve PHP on your own freely.<br />
4. PHP can run on the most common server platform such as Window, MAC, Linux and Unix, programs like these are called <b>cross platform software</b>. So you can jump from one machine without being troubled by what kind of operating system you are using.<br />
5. PHP was written from the very start as a web application, therefore it is a focused web development tool.<br />
6. PHP is used by many users around the world and if you have any difficulty with its use there a lot of shared experiences and documentations available for you on the internet.<br />
7. PHP is powerful language that can grow with your application; it is powerful enough to be comparable to paid scripting programs.<br />
8. PHP have advanced programming features that are available in other major programming languages such as C, Java, C++ and others, such as object oriented feature.<br />
9. PHP has been used to develop other tools such as Wordpress, Joomla, etc that are vailable and use for free for your web applications and web site creation.Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0tag:blogger.com,1999:blog-2491292132179988148.post-7273704074072192792012-03-11T20:00:00.000-07:002012-03-11T20:00:19.303-07:00Introduction to PHPPHP is a general-purpose and powerful scripting language to produce dynamic web site and interactive web pages. PHP is free software, used by many as an efficient alternative to Microsoft Active Server Pages (ASP). PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As of press time, PHP installed on more that 20 million websites and 1 million web servers.<br />
<br />
PHP originally stood for "Personal Home Page" when it was first conceived and created by danish Rasmus Lerdorf, it is now said to stand for "PHP: Hypertext Preprocessor". Names such as these are called recursive acronyms. They refer to themselves within the meaning of the expression or abbreviation, a common practice in the IT industry.<br />
<br />
<br />
<br />Victor Naivehttp://www.blogger.com/profile/12660391467976206298noreply@blogger.com0