a system of words, letters, figures, or other symbols substituted for other words, letters, etc., especially for the purposes of secrecy.
Computing: program instructions. "hundreds of lines of code"
a systematic collection of laws or regulations e.g. "the criminal code"
a set of conventions governing behavior or activity in a particular sphere; e.g. "a stern code of honor"
convert (the words of a message) into a particular code in order to convey a secret meaning, e.g. "only Mitch knew how to read the message—even the name was coded"
write code for (a computer program). "most developers code C++ like C"
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!',0xa ;our dear string
len equ $ - msg ;length of our dear string
/*
* Solution to Project Euler problem 1
* by Project Nayuki
*
* https://www.nayuki.io/page/project-euler-solutions
* https://github.com/nayuki/Project-Euler-solutions
*/
public final class p001 implements EulerSolution {
public static void main(String[] args) {
System.out.println(new p001().run());
}
/*
* Computers are fast, so we can implement this solution directly without any clever math.
* A conservative upper bound for the sum is 1000 * 1000, which fits in a Java int type.
*/
public String run() {
int sum = 0;
for (int i = 0; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0)
sum += i;
}
return Integer.toString(sum);
}
}
#
# Solution to Project Euler problem 1
# by Project Nayuki
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
# Computers are fast, so we can implement this solution directly without any clever math.
def compute():
ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0))
return str(ans)
if __name__ == "__main__":
print(compute())
In [1]:
def compute():
ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0))
return str(ans)
if __name__ == "__main__":
print(compute())
Bloomberg devoted a full issue to this topic. http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/
Building a Turing Machine: http://aturingmachine.com/
Dr. Ken Iverson, an IBM Research Fellow and inventor of the APL and J programming languages, explains how mathematical and program notation can be a tool of thought. http://www.jsoftware.com/papers/tot.htm
Hello World in many Languages: http://c2.com/cgi/wiki?HelloWorldInManyProgrammingLanguages
Hacker News is a site about coding, computers, technology, science, and life.