@bmF6aW1hc2hhaWtoNDRAZ21haWwuY29taDY3MmU
Nazima Shaikh
any one please give me gtu papers solution summer 2013 computer engineering 7th sem.. ?????
Like · Comment ·
Nazima Shaikh
I need help to make srs for SE. So if any have an online reservation system please Give me....
Like · Comment ·

Narendra Bhaliya

I WILL
Like · 1 ·
Nazima Shaikh
plz give me material of java n algorithm?
5th sem..
BE
Like · Comment ·
Amit Prajapati likes this

Nazima Shaikh

hloo koe to do muje plzzz....
Like ·

Chetan Khandla

Previous Page Mobile Code and Security: Why Java Security Is Important Section 2 -- Mobile Code Next Page The Java programming environment from Sun Microsystems is designed for developing programs that run on many different kinds of networked computers. Because of its multiplatform capabilities, Java shows great promise for relieving many of the headaches that developers encounter when they are forced to migrate code between different types of operating systems. Code that is written in Java should run on all of the most popular platforms-everything ranging from Macintosh and Windows/Intel machines to Linux and Solaris boxes. Recently, the cross-platform capabilities of Java have been called into question. This has led Sun's marketing phrase "write once, run anywhere" to be reinterpreted by skeptics as "write once, test everywhere." Part of the problem is that not all implementations of Java are completely interoperable with Sun's version. Disagreement over what constitutes Java has generated at least one high-profile lawsuit. Most people, including a majority of Java developers, would like to see Java become a standard so that what happened to C (which was itself supposed to be a cross-platform language) doesn't happen to Java. In any case, a nice side effect of Java's built-in portability is that one special kind of Java program (popularly known as an applet) can be attached to a Web page. More technically speaking, applets are embedded into a Web page's hypertext markup language (HTML) definition and executed by Java-savvy browsers.2 Such Java-enabled browsers automatically download and begin running any Java applet they find embedded in a Web page. Java code's ability to run on many diverse platforms makes such "magic" possible. The ability to dynamically download and run Java code over the Net has led some computer pundits to proclaim that the age of truly component-based software development may actually have arrived. The idea is that instead of buying huge monolithic word processing behemoths with hundreds of obscure features that most users will never need, users can instead "create" a personal word processor on the fly out of Java building blocks. This modern sort of programming is akin to building a large toy ship out of Legos blocks. Or, more realistically, the process of creating a component-based software product could be likened to building a highway bridge out of standardized structural components. Sun is advocating a Java component architecture called JavaBeans. A number of companies are creating sets of JavaBeans for various purposes. If these efforts are successful, developers will be able to create programs by putting together sets of prefabricated Beans as illustrated in Figure 1.1. Microsoft's Component Object Model (COM) is very much oriented this way, although it is not specifically designed to use Java. Component-based software has its own interesting security implications and open questions. For example, how can the developer of a system trust a component manufacturer not to have (purposefully or accidentally) introduced security holes into the system? How can a component manufacturer anticipate all uses to which a component will be put? And so on. These sorts of questions are the topic of current research, including some by the authors of this book. Figure 1.1 Component-based software allows a designer to create large applications from standardized building-blocks. Components in Java are known as JavaBeans. The idea of using pre-fabricated components to build large-scale applications will likely do for software what the Industrial Revolution did for manufacturing. Thinking even farther into the future, one can imagine a fundamentally new kind of computer document that contains the word processing, spreadsheet, and database software that was used to create it. Using a document's embedded components, a writer or editor could modify the document on any platform. The built-in components would allow different people using different machines to edit the document without worrying about the kind of computer they are using or file type compatibility issues. If Java is developed to its full potential, this future world may not be far off. The new idea behind all of these exciting aspects of Java is simple: the ability to send data that can be automatically executed wherever it arrives, anywhere on the Net. Java is an implementation of executable content, or mobile code. This powerful idea opens up many new possibilities on the World Wide Web. For the first time it is possible to have users download from the Web and locally run a program written in a truly common programming language. These features of Java are certainly exciting; however, Java's fantastic potential is mitigated by serious security concerns. Security is always an issue when computers are networked. Realistically speaking, no computer system is 100-percent secure. Users of networked computers must weigh the benefits of being connected to the world against the risks that they incur simply by connecting. In practice, the goal of a security policy is to make such tradeoffs wisely. One of the key selling points of Java is its use as a "cross-platform" language for creating executable content in the highly interconnected world of the Internet. Simply by using a Web browser, a Web surfer can take advantage of Java's cross-platform capability. Of course, the activity of locally running code created and compiled somewhere else has important security implications. These implications are one focus of this book. The same risks and benefits that apply to connecting to the Internet itself directly apply to using the Java language. As you will see, these concerns become particularly critical when "surfing the Web." The same technology that allows Java applets to enliven once-static Web pages also allows unscrupulous applet designers to invade an unsuspecting Java user's machine. With Java applets showing up everywhere, and many millions of people using Java-enabled browsers, it pays to know where you are pointing your browser.
Like ·

Chetan Khandla

1. Searching in collections The following article will discuss the implementation of different search algorithms in Java for finding elements in a collections. Searching in collection is done to answer the questions: Does the element exists in the collections Get the element from the collection Delete the element from the collection Collection in this article is used in the broader sense and not in the strict Java sense. For example collection we are looking at my be array or lists. 2. Sequential Search 2.1. Overview Sequential search is the simplest approach. Given a collection you try every element in the collection until you have found the element or until you reach the end of the collection. 2.2. Implementation Sequential Search is extremely easy to implement. Create the Java project "de.vogella.algorithms.search.sequential" and a package with the same name. Create the following program. package de.vogella.algorithms.search.sequential; public class SequentialSearch { public static boolean contains(int[] a, int b){ for (int i : a) { if (i==b){ return true; } } return false; } } 2.3. Test You can use the following JUnit test to validate your sort method. To learn about JUnit please see JUnit Tutorial . package de.vogella.algorithms.search.sequential; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; public class SequentialSearchTest { @Test public void testContains() { int[]a = {1, 2, 3, 4, 5, 19, 17, 7}; assertTrue(SequentialSearch.contains(a, 17)); assertTrue(SequentialSearch.contains(a, 1)); assertTrue(SequentialSearch.contains(a, 2)); assertTrue(SequentialSearch.contains(a, 3)); assertTrue(SequentialSearch.contains(a, 4)); assertFalse(SequentialSearch.contains(a, 10)); } } 2.4. Complexity Analysis See Complexity Analysis for an introduction to the topic. Sequential search has a average and worst-case runtime of O(N). 3. Binary Search 3.1. Overview Binary search requires that the collection is already sorted. For example by Quicksort or Mergesort. Binary search checks the element in the middle of the collection. If the search element smaller or greater then the found element then a sub-array is defined which is then search again. If the searched element is smaller then the found element then the sub-array is from the start of the array until the found element. If the searched element is larger then the found element then the sub-array is from the found element until the end of the array. Once the searched element is found or the collection is empty then the search is over. 3.2. Implementation Create the Java project "de.vogella.algorithms.search.binary" and a package with the same name. Create the following program. package de.vogella.algorithms.search.binary; public class BinarySearch { public static boolean contains(int[] a, int b) { if (a.length == 0) { return false; } int low = 0; int high = a.length-1; while(low <= high) { int middle = (low+high) /2; if (b> a[middle]){ low = middle +1; } else if (b< a[middle]){ high = middle -1; } else { // The element has been found return true; } } return false; } } 3.3. Test You can use the following JUnit test to validate your sort method. To learn about JUnit please see JUnit Tutorial . package de.vogella.algorithms.search.binary; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class BinarySearchTest { @Test public void testContains() { int[]a = {1, 2, 3, 4, 5, 7, 17, 19 }; // assertTrue(BinarySearch.contains(a, 17)); assertTrue(BinarySearch.contains(a, 1)); assertTrue(BinarySearch.contains(a, 2)); assertTrue(BinarySearch.contains(a, 3)); assertTrue(BinarySearch.contains(a, 4)); assertFalse(BinarySearch.contains(a, 10)); } } 3.4. Complexity Analysis See Complexity Analysis for an introduction to the topic. Binary search cuts the search space in each iteration into half and has therefore O(lg N) runtime behavior. 4. Thank you
Like ·

Chetan Khandla

2. Quicksort in Java 2.1. Implementation Create a Java project "de.vogella.algorithms.sort.quicksort" and create the following class. package de.vogella.algorithms.sort.quicksort; public class Quicksort { private int[] numbers; private int number; public void sort(int[] values) { // Check for empty or null array if (values ==null || values.length==0){ return; } this.numbers = values; number = values.length; quicksort(0, number - 1); } private void quicksort(int low, int high) { int i = low, j = high; // Get the pivot element from the middle of the list int pivot = numbers[low + (high-low)/2]; // Divide into two lists while (i <= j) { // If the current value from the left list is smaller then the pivot // element then get the next element from the left list while (numbers[i] < pivot) { i++; } // If the current value from the right list is larger then the pivot // element then get the next element from the right list while (numbers[j] > pivot) { j--; } // If we have found a values in the left list which is larger then // the pivot element and if we have found a value in the right list // which is smaller then the pivot element then we exchange the // values. // As we are done we can increase i and j if (i <= j) { exchange(i, j); i++; j--; } } // Recursion if (low < j) quicksort(low, j); if (i < high) quicksort(i, high); } private void exchange(int i, int j) { int temp = numbers[i]; numbers[i] = numbers[j]; numbers[j] = temp; } } 2.2. Test You can use the following JUnit tests to validate the sort method. To learn about JUnit please see JUnit Tutorial . package de.vogella.algorithms.sort.quicksort; import java.util.Arrays; import java.util.Random; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class QuicksortTest { private int[] numbers; private final static int SIZE = 7; private final static int MAX = 20; @Before public void setUp() throws Exception { numbers = new int[SIZE]; Random generator = new Random(); for (int i = 0; i < numbers.length; i++) { numbers[i] = generator.nextInt(MAX); } } @Test public void testNull() { Quicksort sorter = new Quicksort(); sorter.sort(null); } @Test public void testEmpty() { Quicksort sorter = new Quicksort(); sorter.sort(new int[0]); } @Test public void testSimpleElement() { Quicksort sorter = new Quicksort(); int[] test = new int[1]; test[0] = 5; sorter.sort(test); } @Test public void testSpecial() { Quicksort sorter = new Quicksort(); int[] test = { 5, 5, 6, 6, 4, 4, 5, 5, 4, 4, 6, 6, 5, 5 }; sorter.sort(test); if (!validate(test)) { fail("Should not happen"; } printResult(test); } @Test public void testQuickSort() { for (Integer i : numbers) { System.out.println(i + " "; } long startTime = System.currentTimeMillis(); Quicksort sorter = new Quicksort(); sorter.sort(numbers); long stopTime = System.currentTimeMillis(); long elapsedTime = stopTime - startTime; System.out.println("Quicksort " + elapsedTime); if (!validate(numbers)) { fail("Should not happen"; } assertTrue(true); } @Test public void testStandardSort() { long startTime = System.currentTimeMillis(); Arrays.sort(numbers); long stopTime = System.currentTimeMillis(); long elapsedTime = stopTime - startTime; System.out.println("Standard Java sort " + elapsedTime); if (!validate(numbers)) { fail("Should not happen"; } assertTrue(true); } private boolean validate(int[] numbers) { for (int i = 0; i < numbers.length - 1; i++) { if (numbers[i] > numbers[i + 1]) { return false; } } return true; } private void printResult(int[] numbers) { for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i]); } System.out.println(); } }
Like ·

Nazima Shaikh

thankuuuu........
Like · 1 ·

Nazima Shaikh

algo k liye bhi ho to plzzz....
Like · 2 ·

Amit Prajapati

plz send email-id for 6th sem material
Like ·

Amit Prajapati

6 sem ni techmax ni book ................
Like ·
Download Android App