This file contains 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 serial | |
import os, time | |
import RPi.GPIO as GPIO | |
#SERIAL_PORT = "/dev/ttyAMA0" | |
SERIAL_PORT = "/dev/ttyS0" | |
BAUD_RATE = 9600 | |
GPIO.setmode(GPIO.BOARD) |
This file contains 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
// https://onlinegdb.com/r1y2ERAfL | |
#include <chrono> | |
#include <fstream> | |
#include <sstream> | |
#include <iostream> | |
#include <thread> | |
#include <queue> |
This file contains 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
// based on https://stackoverflow.com/a/936709/1496826 | |
template <typename T,typename sizeDim=size_t> | |
struct array2d{ | |
T *arr; | |
sizeDim row,col; | |
array2d(sizeDim r,sizeDim c,T defVal=0):row(r),col(c){ | |
arr = new T[r*c]; |
This file contains 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
// -*- coding:utf-8-unix; mode:c; -*- | |
/* | |
get the active window on X window system | |
http://k-ui.jp/blog/2012/05/07/get-active-window-on-x-window-system/ | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <locale.h> |
This file contains 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
define hook-next | |
info locals | |
end | |
https://github.com/cs01/gdbgui | |
https://sourceware.org/gdb/onlinedocs/gdb/Hooks.html | |
https://sourceware.org/gdb/onlinedocs/gdb/Command-Files.html | |
https://github.com/mgarg1/gdb-dashboard |
This file contains 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 <string> | |
#include <iostream> | |
#define SWITCH(CASE, VALUE) case CASE : return VALUE; | |
#define LIST_OF_VARIABLES \ | |
SWITCH(2 , "two") \ | |
SWITCH(5 , "five") \ | |
SWITCH(7 , "seven") |
This file contains 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
//Facade | |
class Compiler { | |
public: | |
Compiler(); | |
virtual void Compile(istream & , BytecodeStream & ); | |
}; | |
void Compiler::Compile( | |
istream & input, BytecodeStream & output | |
) { |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#define INIT_VALUE 1.0f | |
pthread_mutex_t m; | |
float *getValue(){ | |
static int is_initialized = 0; |
This file contains 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 WidgetFactory{ | |
public: | |
virtual ScrollBar *createScrollBar() = 0; | |
virtual Window *createWindow() = 0; | |
}; | |
class Window{ | |
public: | |
virtual void Paint() = 0; | |
}; |
This file contains 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 <iostream> | |
#include <vector> | |
#include <cassert> | |
using namespace std; | |
int main(){ | |
int N; | |
cin >> N; |
NewerOlder