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
set border lw 0.1 | |
set samples 1000 | |
set title "x^2.8 + (y/1.6)^2.8 = 1" | |
n = 2.8 | |
h = 1.6 | |
unset key | |
set size ratio h | |
set xr[0:1.0] | |
set yr[0:h] |
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
use Math::Trig; | |
my $m = 1.6; | |
my $b = 2.8; | |
for (my $theta = 90; $theta >= 0; $theta -= 5 ){ | |
my $x = cos($theta / 180 * pi); | |
$y = $m * (1 - $x ** $b) ** (1/$b); | |
printf "x=%f, %f, %f\n", $x, $x * 300, $y * 300; | |
} |
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
# ~/.greplerc | |
option --ical_data \ | |
--chdir ~/Library/Calendars/*.caldav/*.calendar/Events \ | |
--glob *.ics |
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
###################################################################### | |
# iCal | |
###################################################################### | |
option --ical_data \ | |
--chdir ~/Library/Calendars/*.caldav/*.calendar/Events \ | |
--glob *.ics | |
help --ical Search iCal data | |
option --ical \ | |
--all \ |
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/perl | |
use strict; | |
my %freq; | |
while (<>) { | |
chomp; | |
map { $freq{$_}++ } split //; | |
} |
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
#include <unistd.h> | |
#include <curses.h> | |
char *sl[] = { | |
" o o o", | |
" o ", | |
" o ____ ", | |
" -- |OO| ", | |
" _||__| | ", | |
" | | ", |
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
=head1 NAME | |
perl - Greple module for perl script | |
=head1 SYNOPSIS | |
greple -Mperl [ options ] | |
=head1 SAMPLES |
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
## なんとなく嫌だ | |
my %seen; | |
@opt_icode = grep { not $seen{$_}++ } @opt_icode; | |
## ダサい | |
{ | |
my %seen; | |
@opt_icode = grep { not $seen{$_}++ } @opt_icode; | |
} |
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
package App::Greple::diff; | |
1; | |
=head1 NAME | |
diff - greple module for diff command output | |
=head1 SYNOPSIS |
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
sub print_wdiff { | |
my %arg = @_; | |
my @matched = @{$arg{matched}}; | |
for (my $i = $#matched; $i >= 0; $i--) { | |
my($s, $e) = @{$matched[$i]}; | |
my $t = substr($_, $s, $e - $s); | |
if ($t =~ s/\A (?:\{\+|\[\-) (.*) (?:\+\}|\-\]) \Z/$1/sx) { | |
substr($_, $s, $e - $s) = $t; | |
$matched[$i][0] = $s - $i * 4; |
OlderNewer