Memo for myself someday.
http://www.typescriptlang.org/Tutorial/
- Thinkpad X201s
- Ubuntu 12.04.1 LTS
| 1+2 | |
| 3 |
| 4+3 | |
| 7 |
| <script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js' type='text/javascript'> | |
| MathJax.Hub.Config({ | |
| HTML: ["input/TeX","output/HTML-CSS"], | |
| TeX: { extensions: ["AMSmath.js","AMSsymbols.js"], | |
| equationNumbers: { autoNumber: "AMS" } }, | |
| extensions: ["tex2jax.js"], | |
| jax: ["input/TeX","output/HTML-CSS"], | |
| tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
| displayMath: [ ['$$','$$'], ["\\[","\\]"] ], | |
| processEscapes: true }, |
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 { |