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
| // | |
| package rectangle; | |
| import javax.swing.JFrame; | |
| import javax.swing.JPanel; | |
| import java.awt.BorderLayout; | |
| import java.awt.Color; | |
| import java.awt.GridLayout; | |
| import java.awt.FlowLayout; |
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 | |
| $conn = mysql_connect('localhost:3036', 'root', 'password');//use your password that you set up for database | |
| mysql_select_db('hr'); /*use the database in mysql*/ | |
| $sql = 'SELECT * FROM employee'; //write your query. | |
| $retval = mysql_query( $sql, $conn ); |
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
| package stringChallenge; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| //This programming challenge will take a word and decompose it such way that there are no two char side by side | |
| //Rearrange characters in a string so that no character repeats twice. | |
| // | |
| //Input: aaabc |
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
| package dataStructure; | |
| public class MergeTwoSortedArray { | |
| public static void main(String[] args) { | |
| int[] arrayOne = { 1, 2, 4, 6, 10, 11, 13, 25 }; | |
| int[] arrayTwo = { 1, 3, 5, 7, 9 }; | |
| merge(arrayOne, arrayTwo); |
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
| package stringChallenge; | |
| public class PalindromeString { | |
| public static void main(String[] args) { | |
| System.out.println(isPalindrome("aAaa aaaa")); | |
| // checking if the sentence is semiPalindromic | |
| semiPalindromic("abbccddeeccbba"); | |
| semiPalindromic("bbbccddddccbba"); |
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.io.FileWriter; | |
| import java.io.IOException; | |
| public class GenerateCsv { | |
| public static void main(String[] args) { | |
| System.out.println("this is test"); | |
| try { | |
| FileWriter writer = new FileWriter("test.csv"); |
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.io.IOException; | |
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import java.util.List; | |
| class A { | |
| public static void arrayList() { | |
| List<Integer> ls = Arrays.asList(); | |
| for (Integer i : ls) { |
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.io.IOException; | |
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import java.util.List; | |
| class A{ | |
| public static void m(){ | |
| List<Integer> ls = Arrays.asList(); | |
| for(Integer i : ls){ | |
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
| public PreconditionsChecker(Tree forLoop, CompilationInfo workingCopy) { | |
| if (forLoop.getKind() == Tree.Kind.ENHANCED_FOR_LOOP) { | |
| this.isForLoop = true; | |
| this.workingCopy = workingCopy; | |
| this.hasUncaughtException = !workingCopy.getTreeUtilities() | |
| .getUncaughtExceptions(TreePath.getPath(workingCopy.getCompilationUnit(), forLoop)).isEmpty(); | |
| this.innerVariables = this.getInnerVariables(forLoop, workingCopy.getTrees()); | |
| this.visitor = new ForLoopTreeVisitor(this.innerVariables, workingCopy, new TreePath(workingCopy.getCompilationUnit()), (EnhancedForLoopTree) forLoop); | |
| this.isIterable = this.isIterbale(((EnhancedForLoopTree) forLoop).getExpression()); |
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 class will find prime numbers in diffrernt ways, innerloop, enternal method and using recursive | |
| public class FindPrime { | |
| public static void main(String[] args) { | |
| // forLoop to find prime numbers using external boolean method | |
| for (int i = 2; i < 10000; i++) { | |
| if (isPrimeNumber(i)) { | |
| // System.out.println(i); | |
| } |
NewerOlder