This file contains hidden or 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
var o = { | |
a: 2, | |
m: function(b){ | |
return this.a + 1; | |
} | |
}; | |
console.log(o.m()); // 3 | |
// 'this' se refiere a 'o' cuya propiedad 'a' vale 2, | |
// así que m() regresa 3. |
This file contains hidden or 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
var o = { | |
a: 2, | |
m: function(b){ | |
return this.a + 1; | |
} | |
}; |
This file contains hidden or 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
// Asumamos que tenemos un objeto o, con propiedades a y b: | |
// {a: 1, b: 2} | |
// o.[[Prototype]] tiene las propiedades b y c: | |
// {b: 3, c: 4} | |
// Finalmente, o.[[Prototype]].[[Prototype]] es null. | |
// Así que la cadena de prototipos queda como | |
// {a:1, b:2} ---> {b:3, c:4} ---> null | |
console.log(o.a); // 1 | |
// Existe una propiedad 'a' en o? Sí, y su valor es 1. |
This file contains hidden or 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
import paho.mqtt.publish as publish | |
import time | |
print(“Enviando 0...") | |
publish.single("ledStatus", "0", hostname=“tuserver”) | |
time.sleep(3) | |
print(“Enviando 1...") | |
publish.single("ledStatus", "1", hostname=“tuserver”) |
This file contains hidden or 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
#include <EEPROM.h> | |
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <Wire.h> | |
#include <Adafruit_INA219.h> | |
const char* ssid = "Tu Wifi"; | |
const char* password = "tupassword"; | |
const char* mqtt_server = "tuservidor"; | |
This file contains hidden or 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
begin | |
HPCounter1.Start; | |
end; | |
procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); | |
//alto al conteo al soltar la tecla presionada | |
var | |
valor : string; | |
valor1 : integer; |
This file contains hidden or 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
/* condiciones iniciales */ | |
numero(1). | |
numero(2). | |
numero(3). | |
numero(4). | |
numero(5). | |
numero(6). | |
numero(7). | |
numero(8). | |
numero(9). |
This file contains hidden or 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
class Airline { | |
static var corporateInformation = CorporateInformation( | |
name: "Bad Airlines", | |
address: "Bad Street 666", | |
webSiteURL: "www.bad.com", | |
) | |
var employees: Set<Employee> | |
var numberOfEmployees: Int { | |
get { |
This file contains hidden or 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
func getBound(anArray: [Int], test: (Int, Int) -> Bool) -> Int { | |
var bound = anArray[0] | |
for item in anArray[1..<anArray.count] { | |
if test(item, bound) { | |
bound = item | |
} | |
} | |
return bound | |
} |
This file contains hidden or 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
import UIKit | |
enum Gender: Printable { | |
case Female | |
case Male | |
var description: String { | |
switch self { | |
case .Male: return "Male" | |
case .Female: return "Female" | |
} |