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
ob_start(); | |
print "Hello First!\n"; | |
ob_end_flush(); | |
ob_start(); | |
print "Hello Second!\n"; | |
ob_end_clean(); | |
ob_start(); | |
print "Hello Third\n"; | |
// reusing buffers |
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
<h1>Getting your current location</h1> | |
<input type="button" id="go" value="click me to view your location"> | |
<script> | |
$(document).ready(function () { | |
// wire up button click | |
$('#go').click(function() { | |
// test for presence of geolocation | |
if (navigator && navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(geo_success, geo_error); | |
} else { |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script> | |
$(document).ready(function () { | |
//wire up button click | |
$('#go').click(function () { | |
// test for presence of geolocation | |
if (navigator && navigator.geolocation) { | |
// make the request for the user's position |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script> | |
$(document).ready(function () { | |
//wire up button click | |
$('#go').click(function () { | |
// test for presence of geolocation | |
if (navigator && navigator.geolocation) { |
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
// account.java | |
// Account class that contains a name instance variable | |
// and methods to set and get its value. | |
public class account { | |
private String name; // instance variable | |
// method to set the name in the object | |
public void setName(String name);{ | |
this.name = name; // store the name |
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
// AccountTest.java | |
// creating and manipulate an Account object. | |
import java.util.Scanner; | |
public class AccountTest { | |
public static void main(String[] args) { | |
// create a Scanner object to obtain input from the command window | |
Scanner input = new Scanner(System.in); | |
// create an Account object and assign it to myAccount |
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
// Account.java | |
// Account class with a constructor that initialize the name. | |
public class Account { | |
private String name; // instance variable | |
// constructor initializes name with parameter name | |
public Account(String name) { // constructor name is class name | |
this.name = name; | |
} |
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
private void sayHello(){ | |
System.out.println("Hello"); | |
System.out.println("This is a method called sayHello"); | |
System.out.println("It contains 3 statement"); | |
} |
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 Hello { | |
// other parts of the class | |
... | |
private void sayHello() { | |
System.out.println("Hello"); | |
System.out.println("This is a method called sayHello"); | |
System.out.println("It contains 3 statement"); | |
} |
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
class Hello { | |
// other parts of the class | |
private void sayHello() { | |
System.out.println("Hello"); | |
System.out.println("This is a method called sayHello"); | |
System.out.println("It contains 3 statement"); | |
} | |
public static void main(final String [] args) { |
OlderNewer