This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Functions { | |
/** | |
* Display invalid numbers in a given array that are not the multiples of the key parameter. | |
* @param key Enter a number whose multiple you want to find | |
* @param array Enter the array which you want to check for invalid numbers | |
* @return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Main extends Functions{ | |
public static void main(String[] args) { | |
Functions test = new Functions(); | |
//Create an array to test | |
int[] array = {8,16,24,5,3,2}; | |
int key = 8; | |
ArrayList<Integer> results = test.Multiplesofanumber(key, array); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* | |
Have the function RunLength(str) take the str parameter being passed | |
and return a compressed version of the string using the Run-length | |
encoding algorithm. This algorithm works by taking the occurrence of | |
each repeating character and outputting that number along with a single | |
character of the repeating sequence. For example: "wwwggopp" would return | |
3w2g1o2p. The string will not contain any numbers, punctuation, or symbols. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my Java note from caveofprogramming.com by John. | |
This is not a program. | |
All credit goes to John. | |
/* | |
|---------------------------------------- | |
|Ten tips to make you a better programmer. | |
|---------------------------------------- | |
*/ | |
10. Learn to touch type. | |
9. Name variables and subroutines descriptively |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
|--------------------------------------------------------------- | |
|Chapter 3. Installation and setup using Eclipse | |
|--------------------------------------------------------------- | |
*/ | |
1. Rt click > New > Other > Web > Dynamic Web Project | |
-Project name: FirstSpringMVCProject | |
-Next | |
-Next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is my note for Java Collection Framework course taught by John. | |
//Original credit: John from caveofprogramming.com | |
//All of his videos can be found in youtube.com | |
/**--------------------------------- | |
| 1. ArrayList | |
| | |
*/--------------------------------- | |
1. | |
-ArrayList class implements the class that is expandable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
|------------------------------------ | |
|1. Introductiona and Installation | |
|------------------------------------ | |
*/ | |
1. A lot of people use NetBeans with JavaFX. | |
2. You will need Java 7 for this. You will need JDK 7 or later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Null Pointer Exception. | |
- If you are trying to access an object that does not exist. | |
For example, accesing an object whose pkid id 1 , but that has already been deleted will | |
result in Null Pointer Exception. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This class helps to connect to the | |
class Connection{ | |
public function connect() | |
{ | |
return new PDO('mysql:host=localhost; dbname=sqlinjection2','root','root'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
OlderNewer