Skip to content

Instantly share code, notes, and snippets.

@hirosof
hirosof / HiroSof_Func.cpp
Created February 11, 2011 15:07
SHA1、SHA256、HMAC-SHA1、HMAC-SHA256、Shift-JIS->JIS、JIS->Shift-JIS、Base64エンコード・デコード、URL(パーセント)エンコード・デコードの関数定義ファイル
/*
●SHA1、SHA256
●HMAC-SHA1、HMAC-SHA256
●Shift-JIS⇔JIS
●Base64エンコード・デコード
●URL(パーセント)エンコード・デコード
*/
//インクルード
#include <stdio.h>
@hirosof
hirosof / Twitter_OAuth_Func.cpp
Created February 11, 2011 17:02
Title:Twitter OAuth認証サポート関数定義
/*
Title:Twitter OAuth認証サポート関数定義
作成者:Hiroaki Software
機能リスト
1.SHA1
2.HMAC-SHA1
3.base64エンコード
4.base64デコード
@hirosof
hirosof / HSFFT.cpp
Created April 20, 2012 14:59
FFT関数
#include "HSFFT.h"
#ifndef __HSFFT_CPP__
#define __HSFFT_CPP__
//2を底としたlog(対数)関数 for FFT・IFFT
unsigned int HS_fft_log2(unsigned int r){
double log_num , integer;
log_num = log((double)r) / log(2.0);
if(modf(log_num , &integer))return 0;
else return (unsigned int)integer;
#include <iostream>
#include <stdio.h>
using namespace std;
#define SignToPlus(x) ((x<0)?((-1)*x):x)
/*
n次式÷1次式をする関数
書式:s_div_n1(割られる数の次数 ,
割られる数の次数ごとの係数を代入した配列へのポインタ ,
割る数の次数ごとの係数を代入した配列へのポインタ,
@hirosof
hirosof / HSFFT.cpp
Created May 16, 2012 11:05
FFT関連関数群
#include "HSFFT.h"
#include <Windows.h>
#ifndef __HSFFT_CPP__
#define __HSFFT_CPP__
//2を底としたlog(対数)関数 for FFT・IFFT
unsigned int HS_fft_log2(unsigned int r){
double log_num , integer;
log_num = log((double)r) / log(2.0);
if(modf(log_num , &integer))return 0;
@hirosof
hirosof / ps_cr.html
Created June 3, 2012 08:58
ps_cr.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<link href="style.css" type="text/css" rel="stylesheet">
<title>Style</title>
</head>
<body>
*,**{
font-family: "MS ゴシック",Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
font-size:16pt;
}
html{
background:#E0E0F0;
min-width:640px;
}
body{
margin:5px;
#include <cstdio>
#include <malloc.h>
#include <memory.h>
#define TEXTNUMS 50 //ここは文字列数
#define TEXTSIZE 12 //ここは文字列のサイズ
#define repeat(x) for(int cnt=0 ; cnt < (x) ; cnt++)
int main(void){
char **lplpdata;
//メモリ確保
#include <stdio.h>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
VOID CALLBACK TimeP(HWND hwnd , UINT msg , UINT_PTR idEv , DWORD dwTime);
unsigned int ms = 0 ;
int main(void){
unsigned int setms , timerperiod , ret=0;
printf("タイマーにセットする秒数をミリ秒単位で入力してください\n -> ");
@hirosof
hirosof / WaitPressKey.cpp
Created August 19, 2012 20:10
指定されたキーが押されたら制御をかえす関数(タイムアウト値入力可能)
#include <stdio.h>
#include <stdarg.h>
#include <malloc.h>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
int WaitPressKey(int,int);
int WaitPressKeyEx(int,int,bool,...);
int main(void){
int check = 0;