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
Please refer to my gibhub https://github.com/mr-fool instead of my gist. My gist will no longer be updated |
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
function countChar(string, ch) { | |
var counted = 0; | |
for (var i = 0; i < string.length; i++) | |
if (string.charAt(i) == ch) | |
counted = counted + 1; | |
var str1 = "The " + string + " contains " + ch + " at position " + i + ","; | |
var str2 = " and the total number of " + ch + " is " + counted + "."; | |
var result = str1.concat(str2); | |
return result; | |
} |
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
<html><body><pre><script src="greeting.js"> | |
</script></pre></body></html> |
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
<html><script language="JavaScript" src="buzz.js"> | |
</script> </html> |
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
<html><script language="JavaScript" src="triangle.js"> | |
</script> </html> |
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
<html><script language="JavaScript" src="program.js"> | |
</script> </html> |
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
<html><body><pre><script src="program.js"type="text/javascript" charset="utf-8"> | |
</script></pre></body></html> |
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.net.*; | |
import java.util.*; | |
import java.io.*; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import javax.imageio.*; | |
public class HTTrack { | |
public static void main(String[] args) throws Exception { | |
//Error checking |
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.net.*; | |
import java.util.*; | |
import java.io.*; | |
import java.util.concurrent.*; | |
public class WebServer { | |
//to test http://localhost:portnumber/index.html | |
public static void main(String[] args) throws Exception { | |
//Creates 4 threads to handle new connections | |
final ExecutorService clientHandler = Executors.newFixedThreadPool(4); |
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 Ciphertext { | |
/* stores the encrypted message */ | |
private String ctxt; | |
/*default constructor */ | |
public Ciphertext() | |
{ |