Skip to content

Instantly share code, notes, and snippets.

View lingmujianshi's full-sized avatar

lmjs lingmujianshi

View GitHub Profile
@lingmujianshi
lingmujianshi / decrypt.py
Last active October 28, 2018 05:17
decrypt for HS105
def decrypt(string):
key = 171
result = ""
for i in string:
a = key ^ i #python2 a = key ^ ord(i)
key = i #python2 key = ord(i)
result += chr(a)
return result
@lingmujianshi
lingmujianshi / encrypt.py
Created October 28, 2018 05:18
encrypt for HS105
def encrypt(string):
key = 171
result = pack('>I', len(string))
for i in string:
a = key ^ ord(i)
key = a
result += a.to_bytes(1,'big') #python2 : result += chr(a)
return result
@lingmujianshi
lingmujianshi / code.gs
Created November 2, 2018 14:46
スプレッドシートを使って翻訳
//Webページからデータを受けてスプレッドシートへ
function trans(data) {
var csv = data;
var array = toArray(csv);
writeToSheet(array);
}
//スプレッドシートへ書き込み
function writeToSheet(data) {
sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
#include <IRremote.h>
IRsend irsend(26); //ピン番号26を指定
void setup()
{
}
void loop() {
unsigned int data = 0x41B6659A;
irsend.sendNEC(data, 32);
delay(5000); //5 second delay between each signal burst
}
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Enabled IRin");
#include <IRremote.h>
IRsend irsend(26);
void setup()
{
}
void loop() {
for (int i = 0; i < 3; i++) {
irsend.sendSony(0xa90, 12);
delay(40);
}
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
cout << " 3 : " << bitset<32>(3) << endl;
cout << "~3 : " << bitset<32>(~3) << endl;
cout << "i & 3 の計算" << endl;
cout << "===========" << endl;
@lingmujianshi
lingmujianshi / c_cpp_properties.json
Last active April 13, 2019 06:00
vscode win setting
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
#define ASIO_STANDALONE
#include <iostream>
#include <asio.hpp>
//16進数アスキーを数値に変換
char hex2char(char h)
{
if (h >= '0' && h <= '9')
return h - '0';
else if (h >= 'A' && h <= 'F')
#include <iostream>
#include <iomanip>
#define ASIO_STANDALONE
#include <asio.hpp>
#pragma pack(push,1)
//送信コマンドヘッダ
struct QNa3E_Frame_Send{