(작성중)
SWIG는 기존에 작성된 C 또는 C++ 라이브러리를 다양한 언어에 포팅하는데 사용되는 도구이다. 이 글에서는 C 라이브러리를 JAVA와 연결하는데 필요한 정보를 정리한다. 이 글에서 C 라이브러리의 이름은 mylib 라고 가정한다.
""" | |
Maximize currently focused window to vertically half of the screen | |
Win+Pgup hotkey performs top-half maximization | |
Win+Pgdn hotkey performs bottom-half maximization | |
NOTE: This script requires keyboard and pywin32 packages | |
Tested on my Microsoft Windows 10 PC with dual-monitor | |
""" | |
import keyboard |
// https://home.ubalt.edu/ntsbarsh/Business-stat/StatistialTables.pdf | |
// Cumulative Standardized Normal Distribution | |
// | |
// Values of z of particular importance: | |
// z A(z) | |
// 1.645 0.9500 Lower limit of right 5% tail | |
// 1.960 0.9750 Lower limit of right 2.5% tail | |
// 2.326 0.9900 Lower limit of right 1% tail | |
// 2.576 0.9950 Lower limit of right 0.5% tail | |
// 3.090 0.9990 Lower limit of right 0.1% tail |
/* | |
Copyright (C) 2017 junhee lee | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/epoll.h> | |
#include <sys/ioctl.h> |
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
ABSOLUTELY NO WARRANTY. | |
If you are still reading let's carry on with the code. | |
sudo apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
// once | |
struct sigaction sigact, old_sigact; | |
sigact.sa_handler = handler; | |
sigemptyset(&sigact.sa_mask); | |
sigact.sa_flags = SA_INTERRUPT; | |
sigaction(SIGALRM, &sigact, &old_sigact) < 0); | |
// somewhere loop | |
while(1) { |
#include "stdio.h" | |
#include "stdlib.h" | |
#include "string.h" | |
#include "time.h" | |
#include "sys/types.h" | |
#include "sys/socket.h" | |
#include "netinet/in.h" | |
#define BUF_LEN 8192 |
#include <stdio.h> | |
#include <sys/socket.h> | |
#include <time.h> | |
#if !defined(NDEBUG) | |
#define printf(fmt, args...)\ | |
do {\ | |
time_t t = time(NULL);\ | |
struct tm lt = *localtime(&t);\ | |
fprintf(stderr, "[%02d-%02d %02d:%02d:%02d | %s():%d | INFO] " fmt ,\ |