Memo for myself someday.
http://www.typescriptlang.org/Tutorial/
- Thinkpad X201s
- Ubuntu 12.04.1 LTS
Memo for myself someday.
http://www.typescriptlang.org/Tutorial/
import math | |
ceil(84.2) | |
grade_report(80) | |
def grade_report(grade): | |
if grade >= 80: | |
return 'excellent' | |
elif grade >= 50: | |
return 'pass' |
var fs = require("fs"); | |
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) { | |
if (line != "") { | |
var parsedLine = line.split(";"); | |
var k = parsedLine[1]; | |
var digits = parsedLine[0].split(","); | |
var length = digits.length; | |
if (k > 1) { | |
for (var i = 1; i <= length; i++) { | |
if (i % (k) === 0) { |
var highEnd = 1000; | |
var primes = sieve(highEnd); | |
highEnd--; | |
var found = false; | |
while (found == false ) { | |
if (isPalindrome(highEnd.toString()) == true) { | |
if (primes[highEnd] == true) { | |
found = true; | |
} | |
} |
var highEnd = 1000; | |
var primes = sieve(highEnd); | |
highEnd--; | |
var found = false; | |
while (found == false ) { | |
if (isPalindrome(highEnd.toString()) == true) { | |
if (primes[highEnd] == true) { | |
found = true; | |
} | |
} |
<?php | |
/** | |
* Write a program to determine the biggest prime palindrome under 1000. | |
INPUT SAMPLE: | |
There is no input for this program. | |
OUTPUT SAMPLE: | |
Your program should print the largest palindrome on stdout, i.e. | |
929 |
var fs = require("fs"); | |
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) { | |
var myArray = line.split(" "), | |
output = new Array() | |
for (var i=1; i<=myArray[2];i++) { | |
if (i % myArray[0] == 0) { | |
if (i % myArray[1] == 0) { | |
output.push("FB") | |
} else { |
var fs = require("fs"); | |
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) { | |
if (line != "") { | |
console.log(processLine(line)); | |
} | |
}); | |
function processLine(line) { | |
var lists = line.split(";"); |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Hello World!" << endl; | |
cin.get(); | |
return 0; |
/** | |
* Change the "Hello, World!" example above to display another line. | |
* If Spock were doing this exercise, he might add to | |
* it so that it would display: | |
* | |
* Hello, World! | |
* Live long and prosper. | |
* | |
**/ |