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://qiita.com/takusemba/items/f05ff78b39d40937901f | |
inline fun <reified T> List<T>.filterInstance(): List<T> { | |
val destination = mutableListOf<T>() | |
this.forEach { | |
//これはできない | |
//println(it::class) | |
if (it is T) destination.add(it) | |
} | |
return destination | |
} |
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
package main | |
| |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"regexp" | |
"strconv" | |
"time" | |
) |
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 <memory> | |
class Info { | |
public: | |
Info(int id, std::string name){ this->id = id; this->name = name; } | |
int id; | |
std::string name; | |
}; |
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 <memory> | |
class Base { | |
public: | |
Base() { init(); } | |
virtual void log() const = 0; | |
private: | |
void init() { | |
std::cout << "do something" << std::endl; |
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 <algorithm> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cmath> | |
#define INF 1e+8 | |
#define EPS 1e-8 | |
#define PB push_back | |
#define rep(i,j) for(int i = 0; i < (j); i++) |
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> | |
#define N 81 | |
/* N: 長桁計算に用意する桁数 */ | |
int main(int argc, char *argv[]){ | |
char a[N],b[N],p[N]; |
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> | |
int main( int argc, char *argv[] ) { | |
int a, x; | |
a = 1; | |
scanf("%d", &x); | |
if( x <= 0 ){ | |
printf("the data is less than 0\n"); | |
}else{ | |
while( a <= x ){ |
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 time | |
ser = serial.Serial(5, 9600, timeout = 0) | |
print ser.portstr | |
c = "\0" | |
while True: | |
time.sleep(0.016); | |
print ser.read(30) |
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
using System; | |
using System.Windows.Forms; | |
class Sample1 : Form { | |
private Label lb, lb2; | |
private Button bt; | |
public static void Main() { | |
Application.Run( new Sample1() ); | |
} |
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
using System; | |
using System.Windows.Forms; | |
class Sample1 : Form { | |
private Label lb, lb2; | |
private Button bt; | |
public static void Main() { | |
Application.Run( new Sample1() ); | |
} |
NewerOlder