This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __macrounit_h__ | |
#define __macrounit_h__ | |
#define mu_prn_failed(file,line,expr) printf( "%s:%u: failed assertion `%s'\n",file,line,expr) | |
#define mu_prn_test(test,passed) printf( " Test: %s ... %s\n",test,(passed)?"passed":"FAILED") | |
#define mu_prn_suite(suite) printf( "Suite: %s\n",suite) | |
#define mu_assert(file,line,expr) do { ++mu_asserts; if (!(expr)) { ++mu_failures; mu_prn_failed(file,line,#expr); }} while (0) | |
#define MU_ASSERT(expr) mu_assert(__FILE__,__LINE__,expr) | |
#define mu_run_test(test) do { int f=mu_failures; ++mu_tests; test(); mu_prn_test(#test,(f==mu_failures)); } while (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* verbose_c : verbosely printf for old-c */ | |
#include <stdio.h> | |
#include <stdarg.h> | |
extern int verbose_lvl; | |
extern verbose(int lvl,const char*fmt,...); | |
int verbose_lvl=3; | |
int verbose(int lvl,const char*fmt,...){ | |
int ret=0; | |
va_list ap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* destrndup(const char*s, size_t n){ | |
if (s==NULL)return NULL; | |
char *ret(new char[n+1]),*t(ret),*p; | |
const char *e(&s[n]); | |
for(;*s!='\0'&&s!=e&&n>0;--n,++s,++t){ | |
// printf("estrndup: s=%c\n",*s); | |
if(*s=='\\'){ | |
++s;--n; | |
switch(*s){ | |
case 'a':*t='\a';break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
die "Usage: $0 dir [dir dir ..]" if ($#ARGV<0); | |
sub filesize{ | |
my $s=shift || die "filesize: lack arguments"; | |
return "${s}B" if($s<10); | |
my $i=$s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $exe= '/usr/bin/exiftime'; | |
#my $exe= '/usr/bin/exiftags -v'; | |
foreach my $file (@ARGV){ | |
if (-e $file && $file =~ /\.(jpg|JPG)$/){ | |
my ($exif)=grep(/Image (Created|Generated|Digitized):/,`$exe $file`); | |
if ($exif && $exif=~s/^Image .*?: (.*)//){; | |
my ($y,$m,$d,$h,$M,$s)=split(/[: ]/,$1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<style type='text/css'> | |
* { font-size:small; margin:0; padding:0; } | |
body { margin: 5px; } | |
h1{ margin: 5px 0; } | |
pre { border: 1px solid black; padding: 5px; } | |
</style> | |
<body> | |
<h1>escapeHTML</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<style type="text/css"><!-- | |
body { border:1px solid gray; padding: 5px; } | |
table,th,td { border:1px solid gray; border-collapse:collapse; } | |
--></style> | |
</head> | |
<body> | |
<div id="mes" style="margin:50px;">drop tsv file(s)</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<pre id="view" style="border:1px solid gray"> | |
drag and drop file(s) here. | |
</pre> | |
<script language="JavaScript"> | |
var view=document.getElementById('view'); | |
function dragenter(evt) { | |
evt.stopPropagation(); | |
evt.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alert(s){ WScript.StdOut.Write(s||""); } | |
function print(s){ WScript.StdOut.Write(s||""); } | |
function sleep(t){ WScript.Sleep(t); } | |
function exit(){ WScript.Quit(); } | |
function url_get(url){ | |
var xh=new ActiveXObject("Microsoft.XMLHTTP"); | |
var s=undefined; | |
xh.open("get",url,true); | |
xh.onreadystatechange = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<textarea id="input" cols="40"> | |
%25E3%2581%25AB%25E3%2581%258F%25E3%25 | |
</textarea><br/> | |
<input type=button value="decodeURI" | |
onclick="decURI('input')" /> |
OlderNewer