Skip to content

Instantly share code, notes, and snippets.

@migsalazar
migsalazar / Program.cs
Last active May 16, 2016 02:35
Program1
using System; //Declaración
namespace UsingTest.Test
{
class Program
{
static void Main(string[] args)
{
Console.Write("Console output: ");
Console.WriteLine(DateTime.Now);
@migsalazar
migsalazar / Main.asm
Last active May 16, 2016 02:46
Namespaces5
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 19 (0x13)
.maxstack 8
IL_0000: nop
IL_0001: ldsfld string UsingTest.DateTime::Now
IL_0006: call void [mscorlib]System.Console::WriteLine(string)
IL_000b: nop
IL_000c: call valuetype [mscorlib]System.ConsoleKeyInfo [mscorlib]System.Console::ReadKey()
@migsalazar
migsalazar / Program.cs
Last active May 19, 2016 01:10
Namespaces5
namespace UsingTest.Test
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine(System.DateTime.Now);
System.Console.ReadKey();
}
s = []
for x in range(1,1000):
if x % 5 == 0 or x % 3 == 0:
s.append(x)
print sum(s)
array=[0,1]
sum = 0
fib=0
while (fib <= 4000000):
if(fib%2):
sum += fib
fib = array[1]
array[1] += array[0]
@migsalazar
migsalazar / canvas.3.js
Created June 5, 2016 05:31
Plotting with Canvas
context.beginPath();
for (var x = xstart; x < width; x++) {
xreal = (x / (xorigin)) - x0,
yreal = height - ((f(xreal) - y0) * _yscale);
context.lineTo(xreal, yreal);
}
@migsalazar
migsalazar / canvas.2.js
Last active June 5, 2016 06:18
Plotting functions with canvas
for (var x = xstart; x < width; x++) {
xreal = (x / (xorigin)) - x0,
yreal = height - ((f(xreal) - y0) * _yscale);
}
@migsalazar
migsalazar / canvas.html
Last active June 5, 2016 06:18
Plotting with Canvas in HTML5
<!DOCTYPE html>
<html>
<head></head>
<body>
<canvas id="canvas-example" height="300px" width="500px">
Your browser doesn't support canvas
</canvas>
</body>
</html>
@migsalazar
migsalazar / canvas.1.js
Last active June 5, 2016 06:19
Plotting with Canvas in HTML5
(function(){
var canvas = document.getElementById("canvas-example");
if (canvas.getContext) {
context = canvas.getContext('2d');
}
}());
@migsalazar
migsalazar / canvas.4.js
Last active June 5, 2016 06:26
Plotting with canvas
var xExists = [0, 2*Math.PI],
f = function(x) {
return 3*Math.sin(x) * Math.cos(x)/2;
};
plot(f, xExists);