This file contains 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
#include <stdio.h> | |
int main(void) { | |
printf("Hello"); | |
return 0; | |
} |
This file contains 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
/****************************************************************************** | |
* | |
* Reads in two integer command-line arguments x and y and prints "true" | |
* if both are divisible by 7, and false otherwise. | |
* | |
* a % 7 is the remainder when you divide 7 into a. If the remainder | |
* is 0, then a is divisible by 7. | |
* | |
******************************************************************************/ |
This file contains 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.InetAddress; | |
import java.net.UnknownHostException; | |
public class HostnameExample { | |
public static void main(String[] args) { | |
try { | |
InetAddress address = InetAddress.getLocalHost(); | |
System.out.println("Hostname: " + address.getHostName()); | |
} catch (UnknownHostException e) { |
This file contains 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.*; | |
import java.util.Scanner; | |
public class MixedTypeInput { | |
public static void main(String[] args) { | |
double number; | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter your gross income: "); |
This file contains 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
// Demonstrates reading numeric values. | |
// From http://www.cs.utexas.edu/users/ndale/Scanner.html | |
// Class NumericInput demonstrates reading numeric values. | |
import java.util.Scanner; | |
import java.io.*; | |
public class NumericInput { | |
public static void main(String[] args) { | |
// Declarations |
This file contains 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
{"lastUpload":"2020-11-29T06:23:58.885Z","extensionVersion":"v3.4.3"} |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>SimpleCMS</title> | |
</head> | |
<body> | |
</body> |
This file contains 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 function display_public() { | |
$q = "SELECT * FROM testDB ORDER BY created DESC LIMIT 3"; | |
$r = mysql_query($q); | |
if ( $r !== false && mysql_num_rows($r) > 0 ) { | |
while ( $a = mysql_fetch_assoc($r) ) { | |
$title = stripslashes($a['title']); | |
$bodytext = stripslashes($a['bodytext']); | |
$entry_display .= <<<ENTRY_DISPLAY |
This file contains 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 function write($p) { | |
if ( $p['title'] ) | |
$title = mysql_real_escape_string($p['title']); | |
if ( $p['bodytext']) | |
$bodytext = mysql_real_escape_string($p['bodytext']); | |
if ( $title && $bodytext ) { | |
$created = time(); | |
$sql = "INSERT INTO testDB VALUES('$title','$bodytext','$created')"; | |
return mysql_query($sql); | |
} else { |
This file contains 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 function display_admin() { | |
return <<<ADMIN_FORM | |
<form action="{$_SERVER['PHP_SELF']}" method="post"> | |
<label for="title">Title:</label> | |
<input name="title" id="title" type="text" maxlength="150" /> | |
<label for="bodytext">Body Text:</label> | |
<textarea name="bodytext" id="bodytext"></textarea> | |
<input type="submit" value="Create This Entry!" /> | |
</form> |