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
Manifest-Version: 1.0 | |
Bundle-Name: RandomRoll | |
Bundle-Description: Roll a die every second | |
Bundle-Activator: RandomRoll.Activator | |
Import-Package: org.osgi.framework | |
Bundle-Vendor: Tutorial | |
Bundle-ManifestVersion: 2 | |
Bundle-SymbolicName: RandomRoll | |
Bundle-Version: 1.0.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
package RandomRoll; | |
import java.util.Random; | |
public class RandomRoll extends Thread { | |
private boolean running = true; | |
public RandomRoll() { | |
super("RandomRoll thread"); |
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
package RandomRoll; | |
import org.osgi.framework.BundleActivator; | |
import org.osgi.framework.BundleContext; | |
public class Activator implements BundleActivator { | |
public static BundleContext bundleContext = null; | |
private static RandomRoll randomRoll = null; | |
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
Square[][] grid; | |
int numCols = 10; | |
int numRows = 10; | |
//Called at the initialization of the program. | |
void setup() { | |
size(300, 300); | |
grid = new Square[numCols][numRows]; |
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
.left { | |
width: 300px; | |
float: left; | |
background-color: #CCCCCC; | |
} | |
.right { | |
margin-left: 300px; | |
} |
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
<html> | |
<head> | |
<title>Fixed Left Column</title> | |
<link rel="stylesheet" href="test.css" type="text/css" /> | |
</head> | |
<body> | |
<div>Left div</div> | |
<div>Right div</div> | |
</body> | |
</html> |
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
int max = 1000; | |
int sum = 0; | |
for (int x = 1; x < max; x++) { | |
if ((x % 3 == 0) || (x % 5 == 0)) { | |
sum += x; | |
} | |
} | |
Console.WriteLine(sum); |
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
x = 1000; | |
puts 1.5*((x-1)/3)*((x+2)/3) + 2.5*((x-1)/5)*((x+4)/5) - 7.5*((x-1)/15)*((x+14)/15); |
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
create table Games ( | |
title integer, | |
studio char(20), | |
genre char(20), | |
primary key (title, studio) | |
); |
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
create table Inventory ( | |
upc integer, | |
title varchar(20), | |
studio varchar(20), | |
quantity integer, | |
price float, | |
primary key (upc), | |
foreign key (title, studio) references Games (title, studio) | |
); |