はてなキーワード: EXITとは
【 1 】 searching. Summer mood
Warm sunshine in the body and melted the remaining the sorrow, but increase some warm meaning. Half a narrowed her eyes, look long rear its head, the suspension of the golden ball still smiled at me. The window, have always liked position, whether in the coffee shop or the teahouse or is a fast-food restaurant, as long as is the place all to sit down for the habitual by a window. So, I can clearly see the outside world, see clearly in the outside walk every one.
I am a fear of stay in that vague world people, can now, are steps into the relationship that vague. Once the countless times told himself, the person to work to clear and plainly, clean, neat. But, now of oneself, not only drag, ya, indecision is at sixes and sevens, blurred.
Summer, is a hot season, also is a easily lose season. Each people all have everyone's temper, and summer, let everyone's temper to acme. Stimulate each other's sensory nerve, little the release of anger. They have with anger, with anger passing, also have with anger of fighting the performance...
All kinds of people are full of all kinds of release methods, and I still slowly, don't worry about being by your side. Pay attention to you every day the fickle mood, ponder your mood every day of good and bad. Sometimes think, time is like a medicine, and like a poison. It makes us forget the pain before, but start the next paragraph sad. It let we abandon our past and desolate, but to a desolate.
【 2 】 summer. Away from grief
Spring as the fallen petal go, wearing a suit LuYeEr of summer in the jump in the warm wind coming, I like winning, jubilant welcome the arrival of the summer. I like summer, like the warm sunshine. Like the sunrise, also like the sunset. Like the golden sun, also like the warmth of sunshine.
Where there is sun, and I feel that my world will not too cold.
Where there is sun, and I feel that my life not too dark.
Where there is sun, and I think the world is full of hope.
Had the sunlight, I have confidence has been waiting for you.
The recent weather and began to change is full of sunshine in the morning, and at noon, will see the sun's trail, the change is the roaring winds, bully touching each corner, don't allow a little resistance. Recently is always looking for a variety of ways, to ease his trouble and sorrow. No longer let oneself and sad hook, no longer let yourself with tears become attached to, so, no longer let their sorrow.
Recently, always looking for all kinds of things to do, like have do not like, just like it or not, will be serious to do. So it won't have too much time to think some the mess of things, so that it doesn't always have my insignificant problem into the inside and you weep alone.
[3] night. sensational
With only a sunshine gradually exit out of the window, the moonlight slowly emerging, tight with all kinds of the stars also slowly appeared in the sky. The earth is a light moonlight and the stars into romantic ornament night. Little stars sings like pearl inlaid in under the canopy, ShanShanDe with a light, and the next you said nothing, as if to see this wonderful night.
Into that familiar with the place, the habitual open air conditioning, open the curtains, the outside world is still so wonderful, the stars and not because night and receding, but more glow. At the moment, finally understand, why do so many people like stars in the night, the night the crush.
Tonight's you, different from ordinary, striking a little can't believe. Don't know is his vision, or a real feelings, whether true or not true world. All like tonight's you, suddenly a few days before the fall of all scores brought. Perhaps that is part of your charm.
Night, still as black, so quiet. Just, tonight's night, less afraid.
I and, as usual, quiet looking at the sleeping you, the mouth cape raise filar silk smile and this is that light taste happiness?
__________________________________________________________________
http://www.chargerbatteryshop.co.uk/panasonic-cgr-d220-camcorder-battery-cbbs.html
http://www.gobatteryonline.com/canon-powershot-sd630-battery-charger-gose.html
優秀な人材が振り向いてくれるようになるのはだいたい上場後。会社の知名度や利益がついてくると、優秀な人材が興味をもってくれるようになるし、高い給料も出せるようになる。
世の中には「成功した会社で働きたい人」と「会社を成功させるために働きたい人」がいて、「優秀」にも2種類あるんじゃないかな。上場後に来るのは前者の優秀な人でしょう。もう上場しちゃってからストックもらっても大化けすることはないしねえ。
ブコメでも散々指摘されてるけど、「ベンチャー」というなら急成長して数年〜10年でexitを狙う、そのために外部の資金も入れる。「Aクラスの人材を雇う」っていうのはそういう会社の話で、それなら高待遇も提示できる。創業者やマネージャーよりも高い給料出すこともあるよ。そうでないならスモールビジネスだ。それなら元増田の言っている戦略で良いと思う。
最近は、外部資金を入れると色々縛られて嫌だってことで有機的成長を目指すスタートアップもよく聞くけど、そういう場合なら、「Aクラスの人材」は創業者の中に既にいるべき。そこで面白いことをやってれば、「あの人と、あのプロジェクトで働きたい」ってAクラスの人が寄ってきてくれるかもしれないけど、待遇をどうこうしてAクラスの人を探して雇おうっていう話は、やっぱりちょいと違うと思う。
http://blog.livedoor.jp/ikiradio/archives/51561151.html
それは人にとって「健康であること」が人生の目的になり得ないのと同じ。
社員のやりたいことを目的にしてはいけない。「誰の」会社だい?
社員がバクチを打って失敗しても、そのケツ持ちをやるというのかい?
努力することは美しいけれど、そんなことをしている暇があるのかい?
これが明確化されない状態では、どんな利益を
やめたりしなければいけない訳ではない。
いま相当頭が硬くなっているだろうし
視野もすごく狭くなっていると思う。
頭が硬くなっているならば、柔らかくすればいい。
一番良いのは組織から完全に離れることだけれども
そこまでしなくても、2週間くらいの休憩をとれば
頭を柔らかくすることだって出来るかもしれない。
苦しんでいることが分かっただろう。
熱中出来ていない状況は、半年後に会社全体の業績に現れてくる。
スタッフを路頭に迷わせたくないのであれば
http://180mm.heteml.jp/lab/20101120/
こちらで紹介されていた位置情報サービスが必ず使える小技にショックを受けたので少し調べてみた。
と二つの条件が必要だった。実際にブログに掲載されていたアプリを動かして確認した。確認した事は以下の通り。
Running App http://180mm.heteml.jp/lab/runningApp/
・同上
ちなみに通常のSafariでは許可しなかった場合は3G回線でも位置情報サービスは使用不可となっていた。
if も 3項演算子も for も do whileすらもない ifなしの Fizz Buzz
#include "stdio.h" #include "stdlib.h" int cnumber=0; void fizz(){ printf("fizz"); cnumber++; }; void nonfizz(){ }; void buzz(){ printf("buzz"); cnumber++; }; void nonbuzz(){ }; void number(int i){ printf("%d",i); cnumber = 0; } void nonnumber(int i){ cnumber = 0; } void myexit(void){ printf("\n Hit return key to exit\n"); getchar(); exit(1); } void noexit(void){ } void (*pfizz[3])() = {fizz,nonfizz,nonfizz}; void (*pbuzz[5])() = {buzz,nonbuzz,nonbuzz,nonbuzz,nonbuzz}; void (*pnumber[3])(int) = {number,nonnumber,nonnumber}; void (*pmyexit[2])() = {noexit,myexit}; int main(int argc, char* argv[]) { int loopmax = (111+222+333)*10; int i = 1; head: (*pfizz[i%3])(); (*pbuzz[i%5])(); (*pnumber[cnumber])(i); (*pmyexit[!(loopmax-i)])(); printf(","); i++; goto head; return 0; }
includeが<>を使ってないので必要ならパスは各自で通してねw
perl でバカ正直に書いたらこうなった。%seen で過去の登場分をメモって枝刈りしてみたけど、効果を発揮できてるんだかどうだか分からん。
use strict;
my $found = 0;
my %seen = ();
for my $m (2 .. 7110) {
for my $n (1 .. $m / 2) {
if (find_7110($n, $m - $n)) {
printf "found: %d, %d\n", $n, $m - $n;
$found = 1;
}
}
exit if $found;
}
print "not found.";
exit;
sub find_7110 {
my ($n1, $n2, $x) = @_;
while (($x = $n1 + $n2) < 7110) {
my $k = "$n1 + $n2";
return 0 if exists $seen{$k}; # not found
$seen{$k} = 1;
$n1 = $n2;
$n2 = $x;
}
return ($x == 7110);
}
結構苦労したので健忘録として。。
環境は以下のとおり
yum install mysql-server
/etc/init.d/mysqld start
mysql_secure_installation
jruby -S gem install rails jruby -S gem install warbler jruby -S gem install activerecord-jdbc-adapter jruby -S gem install activerecord-jdbcmysql-adapter jruby -S gem install jdbc-mysql
mysql -u root -p mysql> create database redmine character set utf8; mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'redmine'; mysql> exit
(任意の場所にRedmineを解凍して、解凍先のディレクトリに移動した後)
cp config/database.yml.example config/database.yml vi config/database.yml
database.yml
production: adapter: jdbcmysql database: redmine host: localhost username: redmine password: redmine encoding: utf8 #development: # # #test: # #
後のwarbleでのエラーを防ぐため、developmentとtestをコメントアウト
jruby -S rake generate_session_store jruby -S rake db:migrate RAILS_ENV=production jruby -S rake load_default_data RAILS_ENV=production
script/serverで起動し、http://localhost:3000 にアクセスして正常に動作するか確認する
jruby script/server -e production
vi config/environments/production.rb config.logger = Logger.new(config.log_path) config.logger.level = Logger::INFO
warble.rbを生成
jruby -S warble config
warble.rbを修正
vi config/warble.rb config.dirs = %w(app config lib log vendor tmp extra files lang) config.gems = ["jdbc-mysql", "activerecord-jdbcmysql-adapter", "activerecord-jdbc-adapter"] config.gems["rails"] = "2.3.5" config.gems["rack"] = "1.0.1" config.webxml.rails.env = "production"
jruby -S warble
できたwarファイルをTomcatに配置して、Tomcatを起動する
mv redmine-0.9.3.war /usr/local/tomcat/webapps/redmine.war /usr/local/tomcat/bin/startup.sh
warblerのバグ(?)でwarに入らないファイルをコピーして入れる
cp vendor/gems/rubytree-0.5.2/.specification /usr/local/tomcat/webapps/redmine/WEB-INF/vendor/gems/rubytree-0.5.2
while (1)
{
if (tairyoku == 0) break;
++shigoto;
--tairyoku;
}
exit(I_CAN_FLY_MY_FRIENDS);
もう過去の話題かもしれないけど、新型インフルエンザについて。
WHOのウェブサイトを訳すよ。あんま時間がないから訳は流し読みつつ適当で。
http://www.who.int/csr/disease/swineflu/frequently_asked_questions/travel/en/index.htmlより
Is it safe to travel?
旅行は安全?
WHO is not recommending travel restrictions related to the outbreak of the influenza A(H1N1) virus. Today, global travel is commonplace and large numbers of people move around the world for business and leisure. Limiting travel and imposing travel restrictions would have very little effect on stopping the virus from spreading, but would be highly disruptive to the global community.
WHOは新型インフルエンザウイルスの流行に関係した旅行の規制を推奨しません。こんにちではグローバルな旅行(日本でいう「海外旅行」)はありふれており、多くの人間がビジネスあるいは余暇のために世界中を旅行しています。旅行を制限したり、旅行の規制を強化したりすることは、ウイルスが広まるのをストップするのに対して非常に小さな効果しか持ちえず、しかしグローバルなコミュニティを混乱させるだけです。
Influenza A(H1N1) has already been confirmed in many parts of the world. The global response now focuses on minimizing the impact of the virus through the rapid identification of cases, and providing patients with appropriate medical care, rather than on stopping its spread internationally.
新型インフルエンザはすでに世界の多くの地域で確認されています。現在のグローバルな対応が今フォーカスしているのは、患者の発生を早急にアイデンティファイすることを通じて、ウイルスのインパクトを最小化することであり、患者に対して適切な医療的ケアを与えることであり、ウイルスが国際的に広まることをストップすることではありません。
Although identifying signs and symptoms of influenza in travellers can help track the path of the outbreak, it will not reduce the spread of influenza, as the virus can be transmitted from person to person before the onset of symptoms.
旅行者におけるインフルエンザの兆候や症候をアイデンティファイすることは、流行の経路を追跡するのを助けるでしょうが、そんなことではインフルエンザの拡大は低減できません。というのも、ウイルスは症候が出る前に人から人に伝染ってしまうからです。
Scientific research based on mathematical modelling shows that restricting travel would be of limited or no benefit in stopping the spread of disease. Historical records of previous influenza pandemics, as well as experience with SARS, validate this.
数学的なモデリングに基づく科学的リサーチによれば、病気の拡大をストップすることに関して、旅行の制限によって得られるベネフィットは限られたものかゼロです。過去のインフルエンザのパンデミックの記録や、SARSの経験も、このことをヴァリデート(検証・実証)しています。
------------------------------------------------------------------------------------
Does WHO recommend screenings at country entry and exit points to detect if ill people are travelling?
WHOは入国・出国の時点で病気の人間が旅行者の中にいるかどうかを検査するようなスクリーニングを推奨しますか?
No. We do not believe entry and exit screenings would work to reduce the spread of this disease. However country-level measures to respond to a public health risk are the decision of national authorities, under the International Health Regulations 2005.
ノー。 私たちは入国や出国の時点でのスクリーニングが、このインフルエンザの拡大を低減するのに役立つとは信じていません。しかし、国レベルでの公衆衛生リスクに対応する政策は、"International Health Regulations 2005"の下におけるその国家のオーソリティの決定事項です。
Countries that adopt measures that significantly interfere with international traffic (e.g. delaying an airplane passenger for more than 24 hours, or refusing country entry or departure to a traveller) must provide WHO with the public health reasoning and evidence for their actions. WHO will follow up with all of its Member countries on such matters.
国際的なトラフィックに対し著しく干渉するような政策(例えば、航空機の乗客を24時間以上遅らさせたり、旅行者の入国や出国を拒否したりするような施策)を採用する国は、公衆衛生上のリーズンと施策者の行為の(正当性の)証拠をWHOに提供しなくてはなりません。WHOはその加入国全てにおけるそのようなマターをフォローアップします。
Travellers should always be treated with dignity and respect for their human rights.
旅行者は常に彼らの人権に対する尊厳とリスペクトを以って扱われるべきです。
------------------------------------------------------------------------------------
How can I protect myself from influenza A(H1N1) when I am travelling?
旅行するときに、私はどうやって自分の身を新型インフルエンザから守ればよいでしょうか?
People who are ill should delay travel plans. Returning travellers who become ill should contact their health care provider.
病気になっている人はその旅行を延期すべきです。帰国後に病気になった人は自分の主治医にコンタクトを取るべきです。
Travellers can protect themselves and others by following simple prevention practices that apply while travelling and in daily life.
旅行者たちが自分の健康や自分の周りの他人の健康を守るためにできることは、旅行中における、あるいは日常生活におけるシンプルな感染予防法の実践に従うことです。
スーパーpre記法がアレなまま直ってないわけで。
姉妹サイト(?)ができていたわけで。
なにやらcookieを食べようとした形跡があるわけで。
#!/usr/local/bin/perl -w use strict; use warnings; use Web::Scraper; use URI; use Perl6::Say; use MIME::Type; use HTTP::Cookies; use LWP::UserAgent; use Path::Class; use Data::Dumper;sub p { print Data::Dumper::Dumper(@_) }; # cookie_jar~A~T~_~H~P #my $cookie_file = "lwpcookies.txt"; #my $cookie_jar = HTTP::Cookies->new(file => $cookie_file, autosave => 1, ignore_discard => 1); my $page = shift || 10000; unless ( $page =~ /^\d+$/ ) { die 'perl 4u.pl [page as int]'; } my @files = dir('./img/')->children; my $cache = {}; my $end_file = { mtime => 0 , file => '' }; for my $file (@files) { if ( $file->basename =~ /^(.+)\.(.+)$/ ) { $cache->{$1} = $2; } if ( $end_file->{mtime} < $file->stat->mtime ) { $end_file->{mtime} = $file->stat->mtime; $end_file->{file} = $file; } } for my $i (1..$page) { my $url = sprintf 'http://nijigen.straightline.jp/?page=%s' , $i; # if ($i == 1){ # $url = sprintf 'http://4u.straightline.jp/nude?filter=off'; # my $ua = LWP::UserAgent->new; # $ua->cookie_jar($cookie_jar); # my $request = HTTP::Request->new(GET => $url); # my $res = $ua->request($request); # } say "request url>".$url; my $scrp = scraper { process '/html/body/div/div[2]/div[2]/div/div/div/div/div/a', 'link[]' => '@href'; process '/html/body/div/div[2]/div[2]/div/div/div/div[2]/div/div/p[2]/span/a', 'img[]' => '@href'; result 'link','img'; }; # $scrp->user_agent->cookie_jar($cookie_jar); my $tmp = $scrp->scrape(URI->new($url)); my $links = $tmp->{link}; my $imgs = $tmp->{img}; if ( ref $links ne 'ARRAY' ) { say "end program."; exit; } for my $link (@$links) { $link =~ m{/([^/]+)$}; my $sesid = $1; if ( $end_file->{file} &amp;&amp; $end_file->{file}->basename =~ /^$sesid\./ ) { say "file exsits end program >".$sesid; # exit; next; } if ( $cache->{$sesid} ) { say "file exsits next >".$sesid; next; } sleep 5; my $image_url = shift @$imgs || next; $image_url =~ s/^http:\/\/nijigen.straightline.jp\/user\/manage\/do_register\?src=//; $image_url =~ s/%3A/:/ig; $image_url =~ s/%2F/\//ig; say "get image url >".$image_url; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => $image_url); my $res = $ua->request($req); my $content = $res->content; my $content_type = $res->headers->header('content-type'); my $ext = MIME::Type->new( type => $content_type )->subType || 'bin'; if ( $ext eq 'plain' ) { say "not found image >".$image_url; # ~\家~A~T~C~O~A~L~H~A~H~A~A~_~B~I4U~A奴~B~R~]~X~A~Y~B~K~@~B my $image_url = 'http://nijigen.straightline.jp/html/found/static/upload/l/l_'.$sesid.'.jpg'; say "get 4u image url >".$image_url; my $req = HTTP::Request->new(GET => $image_url); my $res = $ua->request($req); $content = $res->content; $ext = 'jpeg'; } my $write_path = './img/'.$sesid.'.'.$ext; open my $FH, '>', $write_path; binmode $FH; print $FH $content; close $FH; say "write image >".$write_path; } }
YourFileHostのCAPTCHA画像をなんとかするの続きの続き。
まぁ、なんというか、一応できたので張ってみる。微妙な出来栄えだけど。
decaptcha.rbと同じディレクトリに置いて適当に動かしてみてください。
どっかにいいRSSがないかなぁ。。。
しかし、CAPTCHA画像を相手にしてた時の方が楽しかったなぁ。。。
あと、添削とかいろいろ歓迎です。
なぜか&が&amp;に置き換えられてるみたいなので、適当に&に読み替えてください。
#!/usr/local/bin/ruby $LOAD_PATH << File::dirname(File::expand_path($0)) require 'rubygems' require 'rss' require 'mechanize' require 'decaptcha' # require 'ruby-debug' # require 'pp' DESTDIR = 'files' TMPDIR = '/tmp' class Downloader COOKIE_URI = 'http://www.yourfilehost.com/media.php?cat=video&file=%s' DOWNLOAD_URI = 'http://www.yourfilehost.com/downloadlink.php?cat=video&file=%s&adult=1' VERBOSE = false DEBUG = false def self.fetch(file, destdir) puts "Fetching file: #{file}" destfile = destdir + '/' + file if test(?e, destfile) then puts ' - Already exists. skip' puts return nil end # # Initialize Mech # mech = WWW::Mechanize.new mech.user_agent_alias = 'Windows IE 6' mech.max_history = 3 mech.open_timeout = 15 mech.read_timeout = 3 # # get cookie # uri = COOKIE_URI % file page = mech.get(uri) # # Challenge against CAPTCHA # uri = DOWNLOAD_URI % file page = mech.get(uri) for i in 0...3 captcha_path = (page/'img[@height="38"]').attr(:src) captcha_uri = 'http://www.yourfilehost.com/%s' % captcha_path gif = mech.get_file(captcha_uri) open("#{TMPDIR}/captcha.gif", 'w') {|fd| fd.write(gif) } mech.back code = DeCAPTCHA.decode("#{TMPDIR}/captcha.gif") File.unlink("#{TMPDIR}/captcha.gif") if code.nil? then puts ' - CAPTCHA decode failed. retry' if VERBOSE next end form = mech.page.forms.first form.verify = code page = mech.submit(form) break unless page.links.empty? end if page.links.empty? then puts ' - Failed 3 times. Try another one.' puts return nil end # # download # puts " - Downloading: #{page.links.first.href}" if DEBUG retry_count = 0 video = nil begin video = page.links.first.click rescue Timeout::Error => evar retry_count += 1 if retry_count < 5 then puts " * Timedout, retry" if VERBOSE retry end raise evar end unless video.instance_of?(WWW::Mechanize::File) then if DEBUG then puts " - Something wrong while downloading. skip." puts end return nil end video.save(destfile) return destfile end end # # main # [DESTDIR, TMPDIR].each do |dir| if !test(?d, dir) or !test(?w, dir) then puts "#{dir}: Directory not exists or cannot write." exit end end files = [] # collect URIs from RSS RSS_URI = [ ['http://www.yourfilehost.com/make-rss.php?range=day&af=off', lambda {|rss| rss.items.map {|x| x.link }}, ], ] RSS_URI.each do |uri, preprocessor| rss = RSS::Parser.parse(uri) uris = preprocessor.call(rss) #=> Array of URI of YourFileHost uris.map {|x| /file=([^&]*)/.match(x).to_a[1] }.each do |file| # next if file !~ /\.wmv/ # uncomment it if you need only wmv files << file end end files.uniq! # download files.each do |file| begin Downloader.fetch(file, DESTDIR) rescue SystemCallError, Timeout::Error => evar puts " - error (#{evar.to_s}). skip." puts end end __END__
せっかく書いたから匿名でのせてみるよ
使い方は
必要なものを gem で取ってくるにはこうすればいいよ
長すぎてelispが消えたから続きがあるよ
@echo off setlocal set WD=%~dp0 cd /d %WD% ruby get_movies.rb ruby get_images.rb ruby create_m3u.rb
user: ユーザID password: パスワード ids_file: ids.txt done_file: ids_done.txt movies_dir: movies log4r_config: pre_config: global: INFO loggers: - name: app type: Log4r::Logger level: INFO outputters: - STDOUT - FILE outputters: - name: STDOUT type: Log4r::StdoutOutputter formatter: type: Log4r::PatternFormatter pattern: "%d [%l] %C - %M" date_pattern: "%H:%M:%S" - name: FILE type: Log4r::FileOutputter filename: "#{LOGDIR}/sangels.log" formatter: type: Log4r::PatternFormatter pattern: "%d [%l] %C - %M" date_pattern: "%Y-%m-%d %H:%M:%S"
require 'fileutils' require 'logger' require 'mechanize' BASEDIR = File.dirname($0) require "#{BASEDIR}/util" require "#{BASEDIR}/sangels" $config = load_config(BASEDIR) prepare_logger(BASEDIR) $log = new_logger("get_movies") WWW::Mechanize.log = new_logger("mechanize") WGet.log = $log class IDFile def initialize(file) @file = file unless File.exist?(@file) Fileutils.touch(@file) end end def ids(contains_comment = nil) File.open(@file) {|io| io.to_a.map {|x| x.chomp }.select {|x| if x.empty? nil elsif contains_comment true else not /^\s*\#/ =~ x end } } end def add(id) ids = ids(true) unless ids.any? {|x| x == id} write(ids + [id]) end end def delete(id) ids = ids(true) if ids.any? {|x| x == id} write(ids - [id]) end end def write(ids) File.open(@file, "w") {|io| ids.each {|x| io.puts x} } end end $log.info("BEGIN #{$0} ================") exit_code = 0 begin ids_file = IDFile.new($config.ids_file) done_file = IDFile.new($config.done_file) movies_dir = $config.movies_dir wget = WGet.new sangels = SAngels.new sangels.login($config.user, $config.password) ids_file.ids.each {|id| begin movies = sangels.movies(id) rescue SAngels::Movies::InvalidMoviesError $log.warn("invalid movie id: #{id}") next end dir = File.expand_path(id, movies_dir) movies.each {|link| wget.retrieve(link.href, dir) } expected = movies.movie_links.map{|x| File.basename(x.href)} actual = Dir.glob("#{dir}/*").map {|x| File.basename(x)} if (expected - actual).empty? done_file.add(id) ids_file.delete(id) end } rescue => e $log.error(e) exit_code = 1 end $log.info("END #{$0} (#{exit_code}) ================") exit exit_code
require 'fileutils' require 'logger' require 'mechanize' require 'ostruct' BASEDIR = File.dirname($0) require "#{BASEDIR}/util" require "#{BASEDIR}/sangels" $config = load_config(BASEDIR) prepare_logger(BASEDIR) $log = new_logger("get_images") WWW::Mechanize.log = new_logger("mechanize") WGet.log = $log $log.info("BEGIN #{$0} ================") exit_code = 0 begin movies_dir = $config.movies_dir sangels = SAngels.new sangels.login($config.user, $config.password) thumbnails = sangels.thumbnails Dir.glob("#{movies_dir}/*").each {|dir| next unless File.directory? dir id = File.basename(dir) url = thumbnails.url(id) unless url $log.warn("#{id} is not found") next end path = File.expand_path("00_thumbnail#{File.extname(url)}", dir) next if File.exist? path $log.info("retrieving #{url}") thumbnail = thumbnails.get_file(id) File.open(path, "wb") {|io| io.write(thumbnail)} } rescue => e $log.error(e) exit_code = 1 end $log.info("END #{$0} (#{exit_code}) ================") exit exit_code
BASEDIR = File.dirname($0) require "#{BASEDIR}/util" $config = load_config(BASEDIR) movies_dir = $config.movies_dir Dir.glob("#{movies_dir}/*") {|dir| next unless File.directory? dir name = File.basename(dir) files = Dir.glob("#{dir}/*.wmv").sort File.open("#{movies_dir}/#{name}.m3u", "w") {|io| files.each {|file| io.puts "#{name}/#{File.basename(file)}" } } File.open("#{dir}/00_movies.m3u", "w") {|io| files.each {|file| io.puts "#{File.basename(file)}" } } }
require 'mechanize' require 'hpricot' BASEDIR = File.dirname($0) require "#{BASEDIR}/util" class SAngels HOST = "real2.s-angels.com" LOGIN_URL = "http://#{HOST}/member/" INFO_URL = "http://#{HOST}/teigaku/item.php" THUMBNAILS_URL = "http://#{HOST}/teigaku/" THUMBNAIL_URL = "http://#{HOST}/images/default/thumb/" def initialize() @agent = WWW::Mechanize.new end def login(user, password) login_form = @agent.get(LOGIN_URL).forms.find {|form| form.fields.any? {|field| field.name == "frmLoginid"} } login_form.frmLoginid = user login_form.frmPw = password @agent.submit(login_form) end def movies(id, no_validate = nil) Movies.new(@agent, id, !no_validate) end def thumbnails Thumbnails.new(@agent) end class Thumbnails def initialize(agent) @agent = agent doc = Hpricot(@agent.get_file(THUMBNAILS_URL)) elems = doc.search("div[@class=realthum]/a") @links = Hash( elems.map {|elem| href = elem["href"] id = $1 if /ID=(.+)/ =~ href url = elem.search("img")[0]["src"] [id, url] }) end def get_file(id) @agent.get_file(url(id)) end def url(id) @links[id] end def exist?(id) url(id) end end class Movies class InvalidMoviesError < StandardError end def initialize(agent, id, no_validate) @agent = agent @id = id if !no_validate && !valid? raise InvalidMoviesError end end def info_page_url "#{INFO_URL}?ID=#{@id}" end def info_page @agent.get(info_page_url) end def movies_page @agent.click(info_page.links.find {|link| /P=10/ =~ link.href}) end def movie_links movies_page.links.select {|link| /wmv$/ =~ link.href }.sort {|a, b| File.basename(a.href) <=> File.basename(b.href) } end def valid? info_page.uri.to_s == info_page_url end def each(&block) orig_links = movie_links orig_links.each {|orig_link| link = movie_links.find {|l| File.basename(l.href) == File.basename(orig_link.href)} block.call(link) } end end end
require 'log4r' require 'log4r/yamlconfigurator' require 'singleton' require 'fileutils' require 'ostruct' def Hash(a) Hash[*a.flatten] end def load_config(basedir) OpenStruct.new(File.open("#{basedir}/config.yaml") {|io| YAML.load(io)}) end def new_logger(name) Log4r::Logger.new("app::#{name}") end def prepare_logger(basedir, logdir = nil) logdir ||= basedir Log4r::YamlConfigurator["LOGDIR"] = logdir Log4r::YamlConfigurator.load_yaml_file("#{basedir}/config.yaml") end class NullObject include Singleton def method_missing(message, *arg) NullObject.singleton end end class WGet class << self attr_accessor :log def initialize super @log = NullObject.singleton end end def log self.class.log end def retrieve(url, dir) FileUtils.mkdir_p(dir) file = File.expand_path(File.basename(url), dir) if File.exist?(file) log.info("already retrieved #{url}") return true end tmp = "#{file}.part" log.info("retrieving #{url}") ret = system("wget", "-c", "-O", tmp, url) if ret log.info("retrieving succeeded #{url}") File.rename(tmp, file) else if $? == 0x020000 # Ctrl-C exit($?) else log.error("retrieving failure #{url} (#{$?})") end end return ret end end
初めて増田を使ってみた。
大抵の方はタイトルを見てこのエントリに来ていただいていると思うので、グラディウスリバース(以下グラリバ)についての説明は割愛。
グラリバが配信されて当然速攻で落として、平日だと言うのに必死でプレイして、コンティニュー連打で何とかノーマルモード3周済ませた。
さあ、自分の表のブログとかmixi日記とかで良い感想をたくさん書いてグラリバを大いに盛りあげてやろう、と思ったのに・・・何故か手が進まない。
情報公開から配信、そしてプレイ中はあんなにいい気分だったのに、どうしてもグラリバの、他人に推したい点が思いつかないのだ。割と本気で困っている。
もちろん、移植ではない完全新作タイトルであるところとか、グラディウスとしてバランス良く仕上がっているとか、この内容で1000円というコストパフォーマンスの高さとか、MSXグラディウス2のビフォーストーリーが語られているとか、難易度EASY/VERY EASYが史上最高に簡単(でもNORMALの下がいきなり敵弾破壊可能、で「普通のEASY」がないのはどうかと思う。本来EASYに求められる「敵の攻撃パターンや弾の撃ち方を覚えましょう」って役目を放棄している気がする…)とか、良い点はたくさんあるんだけど、他の作品ではなくこのグラリバを他人に「YOUプレイしちゃいなYO!」って推す要素が見つからないのだ。
ご存知の通りグラリバは、ありとあらゆる要素を過去の作品から引っ張ってきている。曲しかり、ステージグラフィックしかり、敵キャラしかり。
Wikipediaなんかだと「随所に小ネタが??」みたいな書かれ方をしているけど、“小ネタ”でしかゲームが構成されていないと言っても過言ではない。
むろんこれは「グラVI」みたいなナンバリングタイトル(メインストリーム)ではないし、WiiWareだし、言うなれば携帯アプリみたいなもんで、だからこういうセルフパロディというかミニゲーム的な内容でも全然ありだと思う。最初から「100%旧ネタを用いたセルフパロディ的作品です!」とアナウンスされているならこんなに変な気分にはならなかったと思っている。
グラリバみたいな「旧ネタ」を盛り込むことを重視した作品と言えば「外伝」が思いつくんだけど、旧ネタをそのまま、ではなくてちゃんと咀嚼してそこから新しいものを作り出しているじゃない。
例えば3面の結晶面。「グラII」3面が元ネタであるのは自明だけど、そこにレーザー屈折という新しい要素を加えてきた。
あと7面の火山面。ステージグラフィックは伝統の火山面そのままなんだけど、ここに「エピII」4面の重力要素を加えている。エピIIでは地形に引かれるというギミックだったけど外伝は地形までも巻き込んで画面方向に引かれるという凝った演出で。
でもグラリバのステージは元ネタをそのまま引っ張ってきていて全くひねられていないことにガッカリ、というか困惑させられている。骨面とかは本当にそのまま。骨面なら骨面をやりたい!と思ったときに、PCE版グラIじゃなくてグラリバを選ぶ気になるか?という話。
音楽に関してもそう。作曲者はいまやシューターならその名を知らない者は居ないと言ってもいいような人気コンポーザー、並木学さん。僕もとくに並木さん本人のファンというわけではないけど、「バトルガレッガ」と「ケツイ」の曲は大好きでよく聴いてる。
そんな有名なコンポーザーをおそらくは高いギャラで雇って「新曲はいらないです。全曲過去作からのアレンジでお願いします」とは・・・僕ならとてもじゃないけど言えないw
だって、並木さんの曲が好きで、グラディウスの曲が好きだったら「並木さんの作るグラディウス」が聴きたいでしょ、常識的に考えて。
たとえば空中戦をアレンジ曲、ステージ曲をオリジナル曲、とかに出来なかったのかなと。
あとアレンジもあまり「ひねりがないな」と言うのが正直な感想。例えばSFC版「グラIII」の奇数面ボスの曲なんかは「Aircraft Carrier」のアレンジで、譜面だけで見ると全然変わっちゃっているんだけど、やっぱり聴けばちゃんと「ああ、ビッグコアの曲のアレンジだ!」って分かる。折角高名なコンポーザーを高い金で使うんだから、そのくらいやっていただかないと損じゃないか?と思うし。
あんまり音楽の話ばっかりしたくないんだけど、原曲とグラリバで曲が使われている場面にあまり整合性がないのも何だかなー、って気分になる。元ネタの曲を選定したのが並木さんなのかM2さんなのか分からないんだけど、曲だけ聴いて決めていたとしたら、ちょっとそれは元ネタに対する敬意が払われていないんじゃないか、と思ってしまう。
全5面のうちの2面でいきなり「LAST EXIT」が流れてくるのはやっぱり違和感があるし、最終面の曲がよりにもよってMSX沙羅曼蛇のバッドエンドの曲とか、縁起が悪すぎるw(伝統的に最終要塞の曲はもうちょっと明るい雰囲気が多いのでその点からも違和感がある…)
そして一番違和感があるのは、開発元もプレイヤー側も、「今回のグラ新作、旧ネタ満載で素晴らしい!」としか捉えてないこと。満載って言うか、ここまで来ると過積載だよ。
2chのスレとか、ネット上では「グラV」とか新しいグラディウスはあまり受けがよくないように見えて(でもこれは本当に「見える」だけだと思う。反対派の声がでかすぎるだけで実際には「反対意見はないから出さない」人がサイレントマジョリティだ)、「旧作の曲はあんなに素晴らしかったのに」「旧作のステージはあんなに遊び甲斐があったのに」みたいな意見をよく目にするから、おそらくはそういうプレイヤーたちに文句を言われないようなつくりを考えたらああなってしまったんじゃないかな、とも思う。作曲者も、東野さんや古川さんを呼べないなら、文句が出ないような人だともう並木さんぐらいしかなかったのかなと。
確かに文句は出ていない、いまのところ。ゲーム単体として考えればグラリバは普通にグラディウスだし面白い。でもあまりにも姿勢が安直過ぎる。「文句を出さない」事しか考えてなくて、「グラディウスの新作を作ってやろう」、ひいては「新しいゲームを作って売り出そう」ってことへの意欲が全く見えてこない。
僕もグラディウスが好きで、ここで言う「旧作」もほぼ全部プレイしたことがある。それゆえにグラリバで旧ネタがいっぱい使われていると知ったときは嬉しかった。MSXシリーズのストーリーに則った作品だと知ったときは本当にエキサイトして、変な汁が出そうになった。…しかし、「旧ネタしかない」グラディウスを商用作品で出されてしまって正直なところ嫌な気分になっている。「あいつらは旧作だけ与えておけばおとなしいから」ってバカにされている気がする。
グラリバには「グラリバだから出来るなにか」がなくて、「次に続くなにか」もない。
だから残念ながら僕は、他人にこのゲームを勧める事が出来ない。
おー、使ってくれてる奇特な奴がいるとはうれしいねぇ。
感謝の気持ちを込めて実はアレから少しバージョンアップしてるのでそれを公開しますよ!
改善点は2点。
これを修正。これ微妙なんだよね。4u.pl動かしてる最中に画像が投稿されるとページングしたときに既に取得した画像にぶつかってしまって止まっちゃうんだよねー。
なので、最後に取得した画像にぶつかったらプログラム終了するように変更した。
元のURLの画像が削除されてしまって取得できなかった場合に、今までは.plainとかいうダミーデータが保存されてしまっていたが、それを4Uの画像を取得するように変更。
これで元画像が消えてても一応4Uから取得できるので取りこぼしが無くてヤッターって感じだねー。
でわでわコードは以下。
#!/usr/local/bin/perl -w use strict; use warnings; use Web::Scraper; use URI; use Perl6::Say; use MIME::Type; use LWP::UserAgent; use Path::Class; use Data::Dumper;sub p { print Data::Dumper::Dumper(@_) }; my $page = shift || 10000; unless ( $page =~ /^\d+$/ ) { die 'perl 4u.pl [page as int]'; } my @files = dir('./img/')->children; my $cache = {}; my $end_file = { mtime => 0 , file => '' }; for my $file (@files) { if ( $file->basename =~ /^(.+)\.(.+)$/ ) { $cache->{$1} = $2; } if ( $end_file->{mtime} < $file->stat->mtime ) { $end_file->{mtime} = $file->stat->mtime; $end_file->{file} = $file; } } for my $i (1..$page) { my $url = sprintf 'http://4u.straightline.jp/?page=%s' , $i; say "request url>".$url; my $tmp = scraper { process 'ul.entry-list>li>div.entry-body>div.entry-photo>a', 'link[]' => '@href'; process 'ul.entry-list>li>div.entry-footer>div.wrapper-entry-description>div.entry-description>p.entry-img-src', 'img[]' => 'TEXT'; result 'link','img'; }->scrape(URI->new($url)); my $links = $tmp->{link}; my $imgs = $tmp->{img}; if ( ref $links ne 'ARRAY' ) { say "end program."; exit; } for my $link (@$links) { $link =~ m{/([^/]+)$}; my $sesid = $1; if ( $end_file->{file} && $end_file->{file}->basename =~ /^$sesid\./ ) { say "file exsits end program >".$sesid; exit; } if ( $cache->{$sesid} ) { say "file exsits next >".$sesid; next; } sleep 1; my $image_url = shift @$imgs || next; $image_url = 'http://'.$image_url; say "get image url >".$image_url; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => $image_url); my $res = $ua->request($req); my $content = $res->content; my $content_type = $res->headers->header('content-type'); my $ext = MIME::Type->new( type => $content_type )->subType || 'bin'; if ( $ext eq 'plain' ) { say "not found image >".$image_url; # 本家の画像が消えてたら4Uの奴を保存する。 my $image_url = 'http://www.straightline.jp/html/found/static/upload/l/l_'.$sesid.'.jpg'; say "get 4u image url >".$image_url; my $req = HTTP::Request->new(GET => $image_url); my $res = $ua->request($req); $content = $res->content; $ext = 'jpeg'; } my $write_path = './img/'.$sesid.'.'.$ext; open my $FH, '>', $write_path; binmode $FH; print $FH $content; close $FH; say "write image >".$write_path; } }
4Uって知ってるかい?
”世界中の美女画像を皆でシェアするソーシャルイメージブックマークサービス”
とのことさ。それはほんともう美しい画像が満載で毎日見てても飽きないわけさ。
そこでローカルに画像を保存しようと思い、ちょっくら実装してみた。
#!/usr/local/bin/perl -w use strict; use warnings; use Web::Scraper; use LWP::UserAgent; use Perl6::Say; use MIME::Type; use URI; use Data::Dumper; sub p { print Data::Dumper::Dumper(@_) }; my $page = shift || 1000; unless ( $page =~ /^\d+$/ ) { die 'perl 4u.pl [page as int]'; } for my $i (1..$page) { my $url = sprintf 'http://4u.straightline.jp/?page=%s' , $i; say "request url>".$url; my $tmp = scraper { process 'ul.entry-list>li>div.entry-body>div.entry-photo>a', 'link[]' => '@href'; process 'ul.entry-list>li>div.entry-footer>div.wrapper-entry-description>div.entry-description>p.entry-img-src', 'img[]' => 'TEXT'; result 'link','img'; }->scrape( URI->new($url) ); my $links = $tmp->{link}; my $imgs = $tmp->{img}; if ( ref $links ne 'ARRAY' ) { say "end program."; exit; } for my $link (@$links) { $link =~ m{/([^/]+)$}; my $sesid = $1; sleep 1; my $image_url = shift @$imgs || next; $image_url = 'http://'.$image_url; say "get image url >".$image_url; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => $image_url); my $res = $ua->request($req); my $content = $res->content; my $content_type = $res->headers->header('content-type'); my $ext = MIME::Type->new( type => $content_type )->subType || 'bin'; my $write_path = './img/'.$sesid.'.'.$ext; if ( -f $write_path ) { say "file exsits end program >".$write_path; exit; } open my $FH, '>', $write_path; binmode $FH; print $FH $content; close $FH; say "write image >".$write_path; } }
貴様、うるせーんだよ。
今回俺としてはWeb::Scraper使いたかったので自力実装してみますた。
使い方を試しながらだったので製作時間2時間くらいかかたお。次からはもっと短縮できそうだ。
まーがーっと書いた後に整理してないからコード自体はかなり汚ねぇのでご了承を。ふへ。
とりあえず4u.plを叩くとカレントディレクトリのimgフォルダに取得した画像を次々書き込んでいく。
ちゃんと次のページにも遷移しながらどんどんがんがん書き込んでいくのさ。
で、以前取得したことのある画像にぶつかるとそこでプログラム終了。
ちゅーかなんつってもWeb::Scraperってばスゲエよな。俺のクリオアがびんびん反応するぜ。え?クオリアだって?うっせぇ野暮なこと言うなよ。
以上のような組み合わせで出くわした困ったことと、その解決策をメモしておきます。
Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
setup.pyに.iファイルとか.cppファイルを記述して実行すると、こんな感じのエラーメッセージが表示されました。うーん、困った!
http://labs.cybozu.co.jp/blog/mitsunari/2007/08/vc2005boostpython.html
上記のページを参考にして、"%Pythonをインストールしたフォルダ%/Lib/distutils/msvcompiler.py"を以下のように修正してみたら解決できました。ありがとうありがとう!
--- msvccompiler.py 2007-04-04 17:17:12.000000000 +0900 +++ @@ -126,7 +126,7 @@ self.set_macro("FrameworkDir", net, "installroot") try: if version > 7.0: - self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") + self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv2.0") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") except KeyError, exc: # @@ -252,7 +252,10 @@ def initialize(self): self.__paths = [] - if os.environ.has_key("DISTUTILS_USE_SDK") and os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): + if self.__version >= 7.1 or ( + os.environ.has_key("DISTUTILS_USE_SDK") and + os.environ.has_key("MSSdk") and + self.find_exe("cl.exe")): # Assume that the SDK set up everything alright; don't try to be # smarter self.cc = "cl.exe" @@ -288,10 +291,16 @@ self.preprocess_options = None if self.__arch == "Intel": - self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' , - '/DNDEBUG'] - self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX', - '/Z7', '/D_DEBUG'] + if self.__version >= 7.1: + self.compile_options = [ + '/nologo', '/Ox', '/MD', '/W3', '/EHsc', '/DNDEBUG'] + self.compile_options_debug = [ + '/nologo', '/Od', '/MDd', '/W3', '/EHsc', '/Z7', '/D_DEBUG'] + else: + self.compile_options = [ + '/nologo', '/Ox', '/MD', '/W3', '/GX', '/DNDEBUG'] + self.compile_options_debug = [ + '/nologo', '/Od', '/MDd', '/W3', '/GX', '/Z7', '/D_DEBUG'] else: # Win64
setup.pyを実行するとcl.exeが見つからないみたいなエラーが表示されました。これは、アレだ。「パス通せ!」ということですね。bashを起動するときのバッチファイル(たぶん"cygwin.bat"とか)で、以下のような行を入れてやれば解決しました。
call "%VS80COMNTOOLS%vsvars32.bat"
d:\python25\include\pyconfig.h(189) : fatal error C1083: include ファイルを開けません。'basetsd.h': No such file or directory
setup.pyを実行すると、上のようなエラーが表示されました。
http://d.hatena.ne.jp/ousttrue/20070531/1180556273
上記のサイトを見るとインクルードパスが通っていない場所に"basetsd.h"があるのが原因なので、"cygwin.bat"にインクルードパスの設定をしておきました。
call "%VS80COMNTOOLS%vsvars32.bat" set INCLUDE=C:\Program Files\Microsoft Platform SDK\Include;%INCLUDE%
link: extra operand `/INCREMENTAL:NO'
詳しくは `link --help' を実行して下さい.
これは、cygwinのほうのlink.exeが実行されてるのが原因でした。スマートな解決策ではありませんが、cygwinのほうのlink.exeをリネームして解決。パスの設定順序とかでどうにかできるといいんだけど、どうすればいいんかな。
MSVCR80.dllが見つからなかったため、このアプリケーションを開始できませんでした。アプリケーションをインストールし直すとこの問題は解決される場合があります。
SWIGが生成した.pyファイルをimportしたら、こんな感じのエラーダイアログが表示されたよ。うーん、困った!
http://d.hatena.ne.jp/moriyoshi/20070525
上記のページを参考にして、"%Pythonをインストールしたフォルダ%/python.exe.manifest"として以下のようなファイルを新しく作ったら、解決できました。ありがとうありがとう!
あとこれ、bashから実行したらエラーダイアログが表示されず、importするモジュールが見つからないみたいなエラーメッセージが出力されるだけだったよ。
<?xml version='1.0' encoding='UTF-8' standalone='yes'?> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly>
先ほど、すごいことを発見しました。それは、「政権が長期政権かどうかは、首相の学歴にズバリ、比例する傾向にある」ということです。この学歴問題を引き合いに出すのは「タブー」になっているのですが、歴代首相を論じる以上は首相の出身大学について語らないわけには行かないのです。
=======
安倍晋三 成蹊大法卒 会社員(+成蹊学園(小学校・中学校・高等学校))
==========
これを見て分かることは非常に多い。まず気が付くのは、宮澤喜一首相を最後に東大出身の首相がいない、ということです。ここ数代は、慶応と早大のたすきがけ的な形で続いています。
そして、一般的な「偏差値」が高い大学を出た政治家は首相になると「長期政権」になるということです。これは、上の履歴書をみると明らかです。
調べるまでは、まさかそんなことは、と思っていましたが、「政治家における学歴差別」は歴然として存在するのです。これで、なぜ安倍首相が不人気なのか、信望がないのかがよく分かりました。偏差値の高い大学出身の首相は、まわりに似たような学歴の政治家がたくさんいるワケです。そうすると「同窓会ネットワーク」の層が厚い。
同じ大学の仲間意識で皆が支え合うという意識があるわけです。これは、アメリカにおいても同様で、ブッシュ大統領はあれだけバカだと言われていますが、しっかりエスタブリッシュメント大学のイエールを卒業し、しかも、エリートクラブ出身です。それを考えると、安倍首相は哀れなくらいに学歴が低い。いや、学歴が低いといよりは、彼の場合には「受験を経験していない」のです。
受験を経験していないということは、「忍耐力がない」「修羅場の経験がない」という風に一般的に判断されます。しかも、安倍首相は小学校からのエスカレーターです。普通に受験して成蹊大学に入っているわけではない。これは非常にマイナス点です。
日本では、東大受験に成功することが最高のステータスシンボルであり、東大は一時期までは総理大臣を供給する大学でした。アメリカのジャパン・ハンドラーズの研究には「東大」の研究書もいくつもあるんです。東大は官僚制度と政治家にネットワークを持つ。これが日本の最大のパワーだったわけです。
====
最も有名なのはチャルマーズ・ジョンソンが共著で加わっている以下の本。ハードカバー版しかない。表紙の「東大」という文字が笑えます。
An Empire of Schools: Japan's Universities and the Molding of a National Power Elite (Hardcover)
by Robert L. Cutts (Author), Chalmers Johnson (Introduction)
Table of Contents
Foreword
Preface
Ch. 1 If There Is a God, He Went to Todai
Ch. 2 First Principles: The Society
Ch. 3 First Principles: The Individual
Ch. 4 The Ivory Basement
Ch. 5 A Tale of Two Citizens
Ch. 6 The Leisure Class
Ch. 7 Who's on Top: The Women Elites
Ch. 8 Family: She's Got the Whole World in Her Hands
Ch. 9 Weapons
Ch. 10 Making It
Ch. 11 Fifty Ways to Lever the Governed
Ch. 12 Reform: No Exit
====
同様に、早稲田大学は在野の精神で早大雄弁会を結成し、これも政治家供給源になってきました。慶応大学もどうように政財界に太いパイプがある。小泉前首相と綿貫国民新党党首の共通項はともに慶応出身というところです。意外なところで接点があって、それが情報交換のきっかけになったりする。
慶大出身の綿貫氏
そこに行くと、大変失礼なのですが、成蹊大学出身の有力政治家というのはほとんどいません。政治家の仲間がいないということは、つながるネットワークが少ない、ということ。安倍首相のネットワークは「安晋会」のようないかがわしい人たちの集まった後援会組織だったり、父親の晋太郎の時代からのサポートスタッフです。
安倍晋太郎は、病気で早くに亡くなっており、これを継ぐ形で晋三が政治家になっています。安倍家には、東大出身の寛信という三菱商事・中国支社のエリートビジネスマンもいましたが、なぜか彼ではなく、晋三に白羽の矢が立っている。
そうなると、何にも自分だけの基盤がないエスカレーター学歴の彼には、父の周辺の後援会に頼るしかなかった。そうなれば、晋三はいいなりです。広域ナントカ団だったり、地元の土建業者だったりがまとわりついてくる。それをさばくのは側近たる秘書なのでしょう。
こうなると、なぜ東大出身の寛信氏が後継者にならなかったのかが気になります。順当に東大出の晋太郎が総理大臣になっていれば、晋三が後継者になることはなかったのではないか、と強く思います。しかも、晋三氏には「南カリフォルニア大学」在学時の学歴詐称疑惑で騒がれたこともあります。結局、卒業はしていないということだったようです。民主党の代議士の学歴詐称を追及している段階で噴出した問題でした。
====
====
上のリストに戻りますが、小学校卒業の田中角栄内閣は、やはり短命政権でした。しかし、彼は安倍首相と違い、たたき上げで、一級建築士の資格も持っていた。だから、それなりにポイントは高かったのだろうと思います。鈴木善幸首相もやっぱり短命政権。宇野宗佑首相も、羽田孜首相も・・・・。みんな“ポイント”が低かった。
これを法則化して理解した上で他の首相をみていくと、細川護煕首相、上智大学出身。細川政権は約一年しか続いていません。早大出身の海部政権は約三年続いています。この事実から、キリスト教大学である上智大学は、首相になる場合の「持ち点」が少し低い、ということになるでしょう。ちなみに政治家では野田聖子さんが上智出身です。村山元首相の明治大というのも微妙なところなのでしょう。
そこに行くと、面白いのは、故・三塚博さんと小渕優子さんです。三塚さんは、派閥の領袖も務めた大政治家です。彼は、東京獣医畜産専門学校(現日本大学生物資源科学部)を経て早稲田大学第一法学部へ学士入学し、1951年に卒業。在学中は雄弁会に所属しています。わざわざ早稲田に学士入学しています。これは雄弁会に入るためでしょう。雄弁会というのは、今は威光もかげってきましたが、それでも現内閣では山本金融大臣を初め出身者が多い。森元首相、竹下元首相も雄弁会ネットワークです。三塚さんは学士入学で早稲田に入って持ち点を上げようとしたわけです。残念ながら、その努力は報われませんでしたが、閣僚にはなっています。
同様に、早稲田大学に社会人になった後に入学したケースとしては、元首相の娘さんである小渕優子さんの例があります。彼女の場合は大学院です。小渕さんは、羽田首相と同じ、成城大学出身です。この大学は意外に政治家が多い。しかし首相になったのは羽田さんだけです。しかも短命政権でした。
そこで小渕さんは、女性なので雄弁会には入れないのですが、早稲田大学に政治家をやりながら入学するという「奇策」に打って出ました。これは凄い。さすがは政治家の娘です。政治感覚が鋭いなあと思います。成城大学では幾ら政治家として頑張っても総理大臣はなれない、と冷酷に判断したのでしょう。早稲田に入学したということは、早稲田出身の政治家のネットワークの末席に置いてもらえる可能性がある、ということです。それでもなかなか首相への道は厳しいでしょうが・・・・。なんだか応援したくなりますね。
そう考えると、小学校からのエスカレーターの安倍晋三という人が首相になっていることは、国際的な一大スキャンダルである可能性が高いのです。安倍首相が国際的に影が薄いのも早稲田や慶応のネットワークに入っていないからかもしれない。そう考えると、一応、外国の政治家の経歴を調査する情報機関の間では、東大、早稲田、慶応の当たりの大学は評価されている、という見方も出来そうです。これが安倍さんが慶応幼稚舎出身だったらもう少し違ったのかもしれないですね。
そのようにしながら、日本の政治家を出身大学別に持ち点でプロファイリングしていくのも面白いと思います。同じ慶応や早稲田でも、政経学部か文学部か(例:石橋湛山)、第一部(昼間)か第二部(夜間)かで大きく違うのでしょう。私の出身は早稲田の一.五部と言われた社学出身なので、政治家的には微妙なポジションでしょう。
こういう当たり前のことは差別になるといってタブー視されていますが、やはり安倍政権は坊ちゃん政権だったのです。周りに大学のネットワークがないから、変なおかしい団体が支援者として食っ付いてくるわけです。そう考えると、やはり安倍政権、長くないでしょう。
ここでどう考えるべきか判断に苦しむのは、ポスト安倍の麻生太郎外相の扱いです。学習院大学政経学部政治学科卒業とあります。その他、スタンフォード、ロンドン大学に留学しているようですが学位があるかどうかは分かりません。学習院というのはどういう扱いになるか。彼は皇族の血が入っていると同時に、カトリック教徒です。クリスチャン政治家では、大平首相がいますが、これは短命政権に終わりました。(病気だったからかもしれないですが)学習院出身の首相はいないので、これが持ち点が高いのか、低いのかは分からない。ただ成蹊大学出の安倍首相よりは間違いなく麻生外相の方が持ち点は高いはずです。
そこへいくと、同じように微妙なのが東大出身の谷垣禎一元財務大臣です。彼が首相になれば久々の東大出身総理となります。しかし、彼は消費税を上げたりして、短命政権になるでしょう。その後に、つまり消費税上げをやった後に、民主党政権が出来るかもしれない。
つまり、大蔵官僚が、自民党に責任をおっかぶせて自分たちは民主党政権をコントロールするという考え方です。官僚を統制しているのは一部にはアメリカです。今の官僚制度をコントロールできる角栄のような政治家がいないので、官僚制度も政治家同様、アメリカに目を向けて指示を仰いでいるんでしょうね。
そう考えると、安倍首相がやたらと左翼思想を批判したり、「美しい国」というようないかがわしいタイプの保守思想を喧伝したがるのも、東大学歴に対するコンプレックスなのかもしれないですね。安倍家、佐藤家には東大出身が多いですからね。東大といえば、左翼思想、丸山真男、というわけです。「家庭の事情」で教育改革をやられては非常に困るわけですが・・・・。
まあ、政治家の価値は学歴だけで決まるというわけではないでしょうが、実際に統計的に結果が出てしまっているのは隠せませんね。
最近perlの勉強してて、naoyaのはてなダイアリー - Web::ScraperでWeb::Scraperを知り、試しにはてブのAPIを真似してニフティクリップのコメントを吐くJSONを作った。
#!/usr/local/bin/perl -T # # use strict; use warnings; use URI; use Web::Scraper; use JSON::XS; use CGI; use Encode; my $q = new CGI; print $q->header( -type=>'text/plain', -charset=>'UTF-8'); my $path_info = $q->path_info; my $path = $path_info =~ m{^/?(nobracket/)?(http\w?)://?(.*)$}xms ? $2.'://'.$3 : undef ; exit if ! $path; my $is_nobracket = 'true' if $1; if ($q->query_string) { my $query_string = $q->query_string; $query_string =~ s/;/&/g; $path = $path.'?'.$query_string } $path =~ s/%23/#/; $path =~ s/([^\w ])/'%' . unpack('H2', $1)/eg; $path =~ tr/ /+/; my $entry_url = "http://clip.nifty.com/entry/?url=" . $path; my $bookmarks = scraper { process 'h4>a', 'user' => 'TEXT'; process 'li.dateAndTime', 'timestamp' => 'TEXT'; process 'a.tagtag', 'tags[]' => sub { my $text = $_->as_text or return; my $left = decode_utf8('??~P'); my $right = decode_utf8('??~Q'); return $text =~ /$left (.*?) $right/xms; }; process 'p.comment', 'comment' => 'TEXT'; result 'user', 'timestamp', 'tags', 'comment'; }; my $niftyclip_entry_info = scraper { process 'div.clipTitle>h3>a', 'title' => 'TEXT'; process 'div.clipTitle>p.url>a', 'url' => '@href'; process 'div.comments>div.commentsDetails', 'bookmarks[]' => $bookmarks; result 'title','url','bookmarks'; }; my $niftyclip = scraper { process 'div#content', 'niftyclip_entry' => $niftyclip_entry_info; result 'niftyclip_entry'; }->scrape(URI->new($entry_url)); exit if ! ($niftyclip->{'url'}); $niftyclip->{'entry_url'} = $entry_url; $niftyclip->{'count'} = @{$niftyclip->{'bookmarks'}}; my $json = JSON::XS->new->utf8->encode($niftyclip); $json = '('. $json. ')' if ! $is_nobracket; print $json;
取得方法は
http://monm.on.coocan.jp/niftyclip/json/entry/<取得したいURL>
ってすればいい。「#」は「%23」にエスケープしないとダメ。
作りながら「取得したいURLをURLエンコードするのは面倒だな」って思い、はてブのAPIみたいにpath_infoでアクセスできるようにしたわけだけど、その取得したいURLにquery_stringが付いてた場合にどうやってやって良いかわからず結構悩んだ。
結局、path_info+'&'+query_stringってやることで無理やり作ったけど、普通どうやるもんなんだろ?cpanに何か良いモジュールがあったりするのかな。
それと、はてブに合わせて出力の際に()を付けるようにしたけど、これだとYahoo!Pipesで使えなかったから、
http://monm.on.coocan.jp/niftyclip/json/entry/nobracket/<取得したいURL>
みたいに「nobracket」付きでアクセスした場合には()を付けないようにした。
コレ使うとニフティクリップとlivedoor クリプのコメント取ってくるAPIみたいなのが作れる。
RSSで取得する場合は
http://pipes.yahoo.com/pipes/pipe.run?_id=zECBJ_VY3BGtBw6B8ivLAg&_render=rss&URL=<URLエンコードしたURL>
で取得できるし、jsonで取得する場合は
http://pipes.yahoo.com/pipes/pipe.run?_id=zECBJ_VY3BGtBw6B8ivLAg&_render=json&URL=<URLエンコードしたURL>
ってなる。
とりあえずサクッと作ってみたけど、わざわざページからJSON作ってるからちょっと重い。
その頃にはJSON吐いてくれるようになるんじゃないかなと期待はしてるけど。
参考URL:
こんばんは、しがないニコ厨です。
さてさて、EXIT TRANCE PRESENTS CODE SPEED アニメトランスBESTという商品が市場デイリーランキングで、
7/22(日) 5位
7/23(月) 3位
7/24(火) 1位
7/25(水) 1位
と推移していました。昨日からランキングが自動化されましたね。
このアルバム、なぜ売れたかっていうとレビューにもあるように"組曲『ニコニコ動画』"を真似たのかと見紛うほど、
曲目リストが被っているかららしいですね。 あれだけ中毒性のあるものだとCDで欲しくなりますもんね!
ぼくは、昨日はてブ経由でニコニコ動画で行われているオープンソース現象 組曲『ニコニコ動画』
を読んで、そこから見事にハマり、だいたいの動画を視聴しました。
歌ってみた系、素材系、元曲系などなど、ほとんどの動画で上記の商品が市場の上位に上がっていました。
まあ実際に売れているので、当たり前と言えば当たり前か。
でも、左上に来るのを4回くらい連続で見たときは、さすがに違和感を感じました。
皆素直に繰り返しの構文で1から100まで回してんのね(違うのがあったら面白いかなと思った)。
これをニモニック言語に置き換えていくのは簡単だと思う。言語は適当だけど読めるでしょ。
$c=1; $c3=3; $c5=5; { $c3--; $c5--; if (($c3 && $c5)==0) { if ($c3 == 0) { print "Fizz"; $c3=3; } if ($c5 == 0) { print "Buzz"; $c5=5; } } else { print $c; } if (($c-100) == 0) { exit; } $c++; } while(1)
何度も直していたら自分の能力に対する自信をなくしてきたorz 本職じゃなくてよかったぜ。
0判定にこだわっているのは、フラグが立つから(分かる人には分かる)。