Skip to content

Instantly share code, notes, and snippets.

View iso2022jp's full-sized avatar
🌌
Working in the metaverse

USHIDO Hiroyuki iso2022jp

🌌
Working in the metaverse
View GitHub Profile
@iso2022jp
iso2022jp / base94.c
Created November 11, 2012 09:05
base94 encoder/decoder
#include "base94.h"
void base94_encode(const unsigned char *plain, unsigned char *code) {
// high * 2^64 | low
unsigned long long value
= ((unsigned long long)plain[1] << 56) | ((unsigned long long)plain[2] << 48)
| ((unsigned long long)plain[3] << 40) | ((unsigned long long)plain[4] << 32)
@iso2022jp
iso2022jp / nudo.c
Created November 11, 2012 09:09
nudo.exe: Do as a normal user
#define STRICT
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
#include <windows.h>
#include <winsafer.h>
void Zero(void *dest, size_t count) {
char *p = (char *)dest;
@iso2022jp
iso2022jp / gist:4057845
Created November 12, 2012 06:41
VBA: Convert character encoding
Option Explicit
Public Sub ConvertEncoding(ByRef SourcePath As String, ByRef DestinationPath As String, ByRef SourceEncoding As String, ByRef DestinationEncoding As String)
Dim oWork As Object
With CreateObject("ADODB.Stream")
' load source
@iso2022jp
iso2022jp / CdeclCallback.cls
Created November 12, 2012 06:49
VBA: Cdecl Thunk
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CdeclCallback"
Attribute VB_GlobalNameSpace = False
@iso2022jp
iso2022jp / bmp2jpeg.pl
Created November 12, 2012 06:52
Perl: Pure BMP to JPEG converter
#!/usr/bin/perl
use strict;
use warnings;
use integer;
use bmp_io;
sub main ();
sub build_huffman_table ($$);
@iso2022jp
iso2022jp / bmp2gif.pl
Created November 12, 2012 06:53
Perl: Pure BMP to GIF converter
#!/usr/bin/perl
use strict;
use warnings;
use bmp_io;
sub compress_vcl_lzw ($$);
my $transparent = @ARGV ? $ARGV[0] : undef;
perl convert.pl < shufflers.txt > shufflers-for-mysql.txt
mysql -N test < solve.sql > result.txt
@iso2022jp
iso2022jp / dropbox-info.sh
Last active December 18, 2015 17:38
Queries information of associated dropbox account for Cacti.
#!/bin/bash
#
# Query Dropbox Account Information
#
# $referral
# $name
# $uid
# $country
@iso2022jp
iso2022jp / crossing.c
Last active December 22, 2015 03:09
CodeIQ q432 crossing
/* ********************************************************************** */
/*
矢印を逆転して見ると、隣接要素を交換しながらのソートになっている
交差回数は、隣接交換に必要な最小回数を表している。
隣接交換はどこから着手しても同じ結果になるし計算しやすいが
単純なバブルソートでは時間がかかるのでマージソートを使う。
*/
/* ********************************************************************** */
#!/bin/perl
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
=pod
=encoding UTF-8
=head1 213個の単語からパングラムを作ろう - 解答
=head2 提出要件