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
<option value="Johor">Johor</option> | |
<option value="Kedah">Kedah</option> | |
<option value="Kelantan">Kelantan</option> | |
<option value="Kuala Lumpur">Kuala Lumpur</option> | |
<option value="Labuan">Labuan</option> | |
<option value="Melaka">Melaka</option> | |
<option value="Negeri Sembilan">Negeri Sembilan</option> | |
<option value="Pahang">Pahang</option> | |
<option value="Penang">Penang</option> | |
<option value="Perak">Perak</option> |
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 example stores a binary file image ("Koala.jpg") into a local Redis server, and then | |
* retrieves it back which the finally written back to another file ("copyKoala.jpg") | |
* | |
* Dependencies: (Jedis and Commons IO) | |
* | |
* <dependency> | |
<groupId>redis.clients</groupId> | |
<artifactId>jedis</artifactId> | |
<version>2.8.1</version> |
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_once('PPBootStrap.php'); | |
require_once('Common/Constants.php'); | |
$receiver = array(); | |
// Receiver 1 | |
$receiver[0] = new Receiver(); | |
$receiver[0] -> email = "[email protected]"; | |
$receiver[0] -> amount = 4.00; |
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 long serializeTimestamp(String timeConfigFile, String key){ | |
FileReader reader = null; | |
BufferedReader r = null; | |
FileWriter fw = null; | |
try { | |
reader = new FileReader(new File(timeConfigFile)); | |
r = new BufferedReader(reader); | |
String line = r.readLine(); | |
Pattern pattern = Pattern.compile("^"+key+"(\\d*)$"); | |
Matcher matcher = pattern.matcher(line); |
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
In Java: | |
String test = "lala " + null; | |
System.out.println(test); | |
--> lala null | |
In Transact-SQL: |
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 class SimpleCounter { | |
public static int counter = 0; | |
public SimpleCounter(){ | |
} | |
public void addOne(){ | |
counter++; | |
} |
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
Car mySedan = new Car(); | |
Garage parkingGarage = new Garage(); | |
mySedan = mySedan + parkingGarage; // park car in the garage |
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 V get(Object key) { | |
if (key == null) | |
return getForNullKey(); | |
int hash = hash(key.hashCode()); | |
for (Entry<K,V> e = table[indexFor(hash, table.length)]; | |
e != null; | |
e = e.next) { | |
Object k; | |
if (e.hash == hash && ((k = e.key) == key || key.equals(k))) | |
return e.value; |
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 class Library { | |
private static String libraryName; | |
private static List<String> books; | |
public boolean processBooks(){ | |
for (String book: books){ | |
if (book.equals(libraryName)){ | |
return true; | |
} | |
} |