Skip to content

Instantly share code, notes, and snippets.

@ringo156
ringo156 / mux_4.v
Last active October 23, 2016 14:58
module mux4_1(
input a0, a1, a2, a3,
input [1:0] sel,
output F
);
assign F = (sel == 0) ? a0:
(sel == 1) ? a1:
(sel == 2) ? a2:
(sel == 3) ? a3:
4'bx;
@ringo156
ringo156 / test.py
Last active October 24, 2016 06:05
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
alcohol = [] #アルコール
malicAcid = [] #リンゴ酸
ash = [] #灰
alcalinityOfAsh = [] #灰のアルカリ性
magnesium = [] #マグネシウム
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication
class Button01(QMainWindow):
flg = False
def __init__(self):
super().__init__()
@ringo156
ringo156 / test.md
Last active December 6, 2016 19:26
Mat detectFaceInImage(Mat &image, string &cascade_file)
{
CascadeClassifier cascade;
cascade.load(cascade_file);
vector<Rect> faces;
cascade.detectMultiScale(image, faces, 1.1, 3, 0, Size(20, 20));
for (int i = 0; i < faces.size(); i++) {
rectangle(image, Point(faces[i].x, faces[i].y), Point(faces[i].x + faces[i].width, faces[i].y + faces[i].height), Scalar(0, 200, 0), 3, CV_AA);
}
@ringo156
ringo156 / D_FF.v
Last active November 23, 2016 17:01
module D_FF_SyncRST(D, CLK, RESET, Q);
/*** ここに「同期リセット付きD-FF」のVerilogソースを書いてシミュレーションせよ! ***/
input CLK, D, RESET;
output reg Q;
always @ (posedge CLK) begin
if( ~RESET )
Q <= 1'b0;
else
Q <= D;
// 自分用atom痛エディタスタイルシート
atom-panel.bottom
{
background-color: rgba(34, 37, 43, .85);
}
atom-pane, atom-panel {
background-color: rgba(34, 37, 43, 0.8) !important;
}
import sys
import tweepy as tp
import urllib.request
import os
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_TOKEN = ""
ACCESS_SECRET = ""
auth = tp.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
module CNT10(
input CLK, RST,
input CLR, CEN, INC, MODE,
output reg [3:0] QH,
output reg [3:0] QL,
output CA
);
parameter RUN = 1'b1, STOP = 1'b0;
reg flg = 1'b0;
#include "system.h"
#include "sys/alt_stdio.h"
#include <stdio.h>
int SevenSegEnc(int n) {
int res = 0xc0;
if(n == 0) res = 0xc0;
else if(n == 1) res = 0xf9;