Skip to content

Instantly share code, notes, and snippets.

よや yoya

View GitHub Profile
@yoya
yoya / sigmoid_compare.cpp
Created Apr 1, 2019
sigmoid equation compare
View sigmoid_compare.cpp
#include <iostream>
#include <cmath>
#include <cfloat>
static float sigmoid1(float x) {
return 1.0 / (1.0 + exp(-x));
}
static float sigmoid2(float x) {
return exp(x) / (1.0 + exp(x));
}
@yoya
yoya / sigmoid_test.cpp
Last active Mar 30, 2019
sigmoid test
View sigmoid_test.cpp
#include <iostream>
#include <cmath>
static float sigmoid(float x) {
if (x > 0) {
return 1.0 / (1.0 + exp(-x));
} else {
return exp(x) / (1.0 + exp(x));
}
}
@yoya
yoya / webarchive.php
Last active Mar 15, 2019
get all history page from webarchive
View webarchive.php
<?php
function usage() {
echo "Usage: php webarchive.php <target_url> # http:// https:// only ".PHP_EOL;
echo "ex) php webarchive.php http://app.awm.jp".PHP_EOL;
}
if ($argc != 2) {
usage();
exit (1);
@yoya
yoya / shared.cc
Last active Dec 26, 2018
shared_ptr exercise
View shared.cc
// g++ -std=c++11 shared.cc
#include <iostream>
#include <memory>
#include <sys/time.h>
#include <sys/resource.h>
class A {
private:
View gist:e6b76998faabc09497b8bd16e502f9cd
Version Information
Data exported 2018-12-20T14:03:16.679Z
Chrome version Chrome/73.0.3645.0
Operating system Windows NT 10.0.17134
Software rendering list URL https://chromium.googlesource.com/chromium/src/+/b2e486f0d5a83d34bd6bdd72ebbe2005063a8133/gpu/config/software_rendering_list.json
Driver bug list URL https://chromium.googlesource.com/chromium/src/+/b2e486f0d5a83d34bd6bdd72ebbe2005063a8133/gpu/config/gpu_driver_bug_list.json
ANGLE commit id 4638dc9def81
2D graphics backend Skia/73 6f27489c650284c9488d0a82ab03b31dc48656cc-
Command Line chrome.exe --enable-webgl2-compute-context --use-angle=gl --flag-switches-begin --flag-switches-end
Driver Information
View simple_mjpeg_streamer_http_server_v3.py
#!/usr/bin/env python
'''
Author: Igor Maculan - n3wtron@gmail.com
Modifier: Yoshihiro Yamazaki - yoya@awm.jp
A Simple mjpg stream http server
'''
import cv2
from PIL import Image
import threading
from http.server import BaseHTTPRequestHandler,HTTPServer
@yoya
yoya / iterator_test.cpp
Created Nov 1, 2018
iterator_test.cpp (take3 OK!)
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value): m_vec(len, value) { ; }
@yoya
yoya / iterator_test.cpp
Created Nov 1, 2018
terator_test.cpp (NG take2)
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value) {
@yoya
yoya / iterator_test.cpp
Created Nov 1, 2018
iterator_test.cpp (NG)
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value) {
View gist:9a320b24d9370913786a9e1e2f0d1ec1
% # Nearest Neighbor
% convert xc: -define filter:verbose=1 -filter box -resize 8 null: | awk '$1==0{s+=$2} $1>0{s+=$2*2} END {print s/100}'
1.01
% # Bi-Linear
% convert xc: -define filter:verbose=1 -filter triangle -resize 8 null: | awk '$1==0{s+=$2} $1>0{s+=$2*2} END {print s/100}'
1
% # Mitchell-Netravali (Bi-Cubic B:1/3, C:1/3)
% convert xc: -define filter:verbose=1 -filter mitchell -resize 8 null: | awk '$1==0{s+=$2/2} $1>0{s+=$2*2} END {print s/100}'
You can’t perform that action at this time.