はてなキーワード: Consoleとは
Windows 7 - Firefox 8.0 - Norton Internet Security(NIS) 2011 の場合。
(xはバージョン番号)
1. NIS - 設定 - その他の設定 - 製品セキュリティ で「Norton製品の改変対策」を「OFF」にする。
2. C:\ProgramData\Norton\{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\NIS_xx.x.x.x\
・coFFPlgn_xxxx_x_x_x → coFFPlgn_xxxx_x_x_xOLD
・IPSFFPlgn → IPSFFPlgnOLD
※WindowsXPでは C:\Documents and Settings\All Users\Application Data\Norton\{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\NIS_xx.x.x.x\ (未確認)
元に戻したい時は、リネームしたフォルダを戻して「Norton製品の改変対策」を「ON」にする。
なお、OSを再起動するとフォルダが強制的に作成されるようなので、その都度2.の実施が必要。
C:\Program Files\Mozilla Firefox\extensions\
P.340
・パスにスペースの入らない(たとえば、My Documentsなどは、途中にスペースが入っているのでエラーになる。アンダーバー「_」は可。)
フォルダ(C\Testなど)を作る。 →以下フォルダAとする。
2/ 実行ファイルを作りたいスクリプト(○○.rb)ファイル自体も、2バイト文字、半角でもスペースの入らないファイル名にする。
→「5-05-04 ride block.rb」といったファイル名は、スペースが入っているのでダメ。
3/ フォルダAに、ActiveScriptRubyをインストールするとできる「ruby console」ショートカット(everythingで検索)のショートカットを、そのフォルダにコピーする。
4/ フォルダAに、実行ファイルを作りたいスクリプト(○○.rb)を、Imgフォルダ等と共にコピーする。
5/ フォルダAに、fontを、fontsフォルダごとコピーする。
6/ フォルダAに、Ruby/SDLのDLLをそのフォルダにコピーする。15種類。
→DLLフォルダを、ではなく、exeファイルの置かれる場所に、DLLファイルそのものを直接並べる。
フォルダAにコピーしたruby consoleを起動 →コマンドプロンプトの後に、「ruby ○○.rb」とし、スクリプトの起動を確認する。
8/ フォルダAにコピーしたruby consoleを起動 →コマンドプロンプトの後に、「mkexy ○○.rb」とする。
→ゲームが起動するので、終了させる。
9/ ○○.exy ファイルを、メモ帳等のテキストエディタで開く
10/ 初期値は「core: cui」となっているのを、「core: gui」に変える。
→変えなくてもいいが、その場合、実行時にコマンドプロンプト窓が出てきて邪魔になる。
11/ フォルダAにコピーしたruby consoleを起動 →コマンドプロンプトの後に、「exerb ○○.exy」←今作ったファイル とする。
12/ 「○○.exe」をダブルクリックして実行、起動しなかった場合、2~5のプロセスに、コピーし忘れがある。
13/ 配布物は以下の通り。
・実行ファイル「○○.exe」 →ファイル名は任意に変更可。(もちろん.exe以外の名前)
・fontsフォルダ
http://anond.hatelabo.jp/20110316202255
亀仙流やつ鶴仙流など、世の中にはいくつかの流派があり、それぞれ カメハメ波やドドン波、舞空術などの技(メソッド)がある。 実際に技を使う場合、技を覚えているZ戦士(インスタンス)が必要。
クラス = 流派
メソッド = 技
インスタンス = Z 戦士
というのはおもしろいと思うし, 例えばゲームを作るなら実際にそういう実装になると思う.
例)セルを作りましょう。 class Cell extends Goku,Veget,Picoro,Tenshinhan,Kuririn{ .... } cell_inst = new Cell(); cell_inst.shotKienzan(); //Kuririnをextendsしているので気円斬が使えます。
しかし, ここではクラス = Z 戦士になってしまっているので, 混乱を招くだろう.
むしろ, 「JavaScript における prototype」 に絞って説明するのはどうだろう.
(ついでに「撃つ」の現在形は shot でなく shoot ですね)
var Goku = function () {};
Goku.prototype.shootKamehameha = function () {
console.log("波!!!");
};
var goku = new Goku;
goku.shootKamehameha(); // 波!!!
var Gohan = function () {};
Gohan.prototype = new Goku;
var gohan = new Gohan;
gohan.shootKamehameha(); // 波!!!
そしてセルによる吸収は, 動的な継承として考えるのがより自然だろう.
var Goku = function () {};
Goku.prototype.shootKamehameha = function () {
console.log("波!!!");
};
var Vegeta = function () {};
Vegeta.prototype.shootBigBangAttack = function () {
console.log("ビッグバンアタック!!!");
};
var Cell = function () {};
// 吸収メソッド
Cell.prototype.absorb = function (target) {
for (var method in target) {
this[method] = target[method];
}
};
var goku = new Goku;
var vegeta = new Vegeta;
var cell = new Cell;
cell.absorb(goku); // 悟空を吸収
cell.absorb(vegeta); // ベジータを吸収
cell.shootKamehameha(); // 波!!!
cell.shootBigBangAttack(); // ビッッグバンアタック!!!
そして次にクロージャの使用例として挙げられた次の例.
例)連続エネルギー波 var shotRenzokuEnergy = function( count ){ var shotEnergy = function(){ //エネルギー波を放ちます }; for(var i=0;i<count;i++){ shotEnergy(); } };
この実装では, shotRenzokuEnergy を実行するたびに shotEnergy が毎回定義されてしまい, 非効率である.
以下のように書き換えることで, shootEnergy の定義は, shootRenzokuEnergy の定義時の 1 回のみとなる.
var shootRenzokuEnergy = (function () {
var shootEnergy = function () {
console.log("エネルギー波!!!");
};
return function (count) {
for (var i = 0; i < count; i++) {
shootEnergy();
}
};
})();
shootRenzokuEnergy(10); // エネルギー波!!! x 10
http://okajima.air-nifty.com/b/2011/01/2011-ffac.html
ぷよぷよを解く問題をやってみた
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { StringBuilder[] blocks = { new StringBuilder("**GYRR"), new StringBuilder("RYYGYG"), new StringBuilder("GYGYRR"), new StringBuilder("RYGYRG"), new StringBuilder("YGYRYG"), new StringBuilder("GYRYRG"), new StringBuilder("YGYRYR"), new StringBuilder("YGYRYR"), new StringBuilder("YRRGRG"), new StringBuilder("RYGYGG"), new StringBuilder("GRYGYR"), new StringBuilder("GRYGYR"), new StringBuilder("GRYGYR") }; bool updated = true; while (updated) { breaked: DumpBlock(blocks); for (int i = 0; i < blocks.Length; i++) { for (int j = 0; j < blocks[i].Length; j++) { char c = blocks[i][j]; if (c == '*') continue; updated = false; if (KillBlocks(blocks, i, j)) { updated = true; goto breaked; } } } } DumpBlock(blocks); Console.Read(); } struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } } static bool KillBlocks(StringBuilder[] blocks, int x, int y) { bool[,] visted = new bool[blocks.Length,blocks[0].Length]; MarkBlock(visted, blocks, x, y); Queue<Point> queque = new Queue<Point>(); for (int i = x; i < blocks.Length; i++) for (int j = y; j < blocks[i].Length; j++) if(visted[i,j] == true) queque.Enqueue(new Point(j,i)); if (queque.Count < 4) return false; while (queque.Count > 0) { Point p = queque.Dequeue(); RemoveBlock(blocks, p.x, p.y); } return true; } static void MarkBlock(bool[,] visted, StringBuilder[] blocks, int x, int y) { if (x < 0 || y < 0 || x >= blocks.Length || y >= blocks[0].Length || visted[x, y] == true) return; char c = blocks[x][y]; visted[x, y] = true; if (x + 1 < blocks.Length && blocks[x + 1][y] == c) MarkBlock(visted, blocks, x + 1, y); if (y + 1 < blocks[0].Length && blocks[x][y + 1] == c) MarkBlock(visted, blocks, x, y + 1); if (x > 0 && blocks[x - 1][y] == c) MarkBlock(visted, blocks, x - 1, y); if (y > 0 && blocks[x][y - 1] == c) MarkBlock(visted, blocks, x, y - 1); } static void DumpBlock(StringBuilder[] blocks) { foreach (StringBuilder s in blocks) Console.WriteLine(s); Console.WriteLine(); } static void RemoveBlock(StringBuilder[] blocks,int x,int y) { int i; if (y == 0) { blocks[y][x] = '*'; return; } for (i = y; i > 0; i--) { blocks[i][x] = blocks[i - 1][x]; } blocks[i][x] = '*'; } } }
http://okajima.air-nifty.com/b/2010/01/post-abc6.html
迷路の最短経路を求める問題が出たので解いてみた
幅優先探索を使えばいいのがわかっていたのですんなりかけたのだが、無限ループになる個所があったので動くようになるまで時間がかかった
using System; using System.Collections.Generic; using System.Text; using System.Linq; namespace MazeFind { class Point { public int x; public int y; public Point before; public Point(int x, int y,Point before) { this.x = x; this.y = y; this.before = before; } } class Program { static void Main(string[] args) { const char BreakChar = 'B'; const char GoalChar = 'G'; const char WallChar = '*'; const char BeforeChar = '.'; StringBuilder[] maze = new StringBuilder[]{ new StringBuilder("**************************"), new StringBuilder("*S* * *"), new StringBuilder("* * * * ************* *"), new StringBuilder("* * * ************ *"), new StringBuilder("* * *"), new StringBuilder("************** ***********"), new StringBuilder("* *"), new StringBuilder("** ***********************"), new StringBuilder("* * G *"), new StringBuilder("* * *********** * *"), new StringBuilder("* * ******* * *"), new StringBuilder("* * *"), new StringBuilder("**************************"), }; Point start = new Point(1, 1,null); //最短経路を探索する Queue<Point> queque = new Queue<Point>(); queque.Enqueue(start); while (queque.Count > 0) { Point now = queque.Dequeue(); if (maze[now.y][now.x] == BreakChar) Console.WriteLine("break"); if (maze[now.y][now.x] == WallChar || maze[now.y][now.x] == BeforeChar) continue; else if (maze[now.y][now.x] == GoalChar) { Point p = now.before; while (p != null) { maze[p.y][p.x] = '@'; p = p.before; } break; } if (maze[now.y - 1][now.x] != '#') { queque.Enqueue(new Point(now.x, now.y - 1, now)); maze[now.y][now.x] = '.'; } if (maze[now.y][now.x + 1] != '#') { queque.Enqueue(new Point(now.x + 1, now.y, now)); maze[now.y][now.x] = '.'; } if (maze[now.y + 1][now.x] != '#') { queque.Enqueue(new Point(now.x, now.y + 1, now)); maze[now.y][now.x] = '.'; } if (maze[now.y][now.x - 1] != '#') { queque.Enqueue(new Point(now.x - 1, now.y, now)); maze[now.y][now.x] = '.'; } } //結果を出力する foreach (StringBuilder s in maze) Console.WriteLine(s.ToString().Replace(BeforeChar,' ')); Console.ReadLine(); } } } <||
さてどこから消すか
これで40分。
タイムアタックってことでアルゴリズムは全幅探索で書き上げました。
エラーチェック皆無。
A*ならもう5分ほど延びるかな?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Maze { class Program { // 探索用地図 static int[,] maze; // 始点終点 static Position Start = new Position(0, 0), Goal = new Position(0, 0); static void Main(string[] args) { //////////////////////////// まずは各行のリストとして読み込み string[] inMaze; using (var fp = new FileStream(args[0], FileMode.Open, FileAccess.Read)) using (var iStream = new StreamReader(fp)) inMaze = iStream.ReadToEnd().Split('\n'); // 迷路幅 int height = inMaze.Length; // 迷路高さ int width = inMaze[0].Length; /////////////////////////// 読み込んだ迷路を作業用地図に展開 maze = new int[width, height]; for (int y = 0; y < height; ++y) { string line = inMaze[y]; for (int x = 0; x < line.Length; ++x) { maze[x, y] = line[x] == '*' ? -1 : 0; if (line[x] == 'S') Start = new Position(x, y); if (line[x] == 'G') Goal = new Position(x, y); } } // 探索実行 int dist = Search(maze, Start); // 探索結果から最短経路を再現 Position backTracer = Goal; while (dist>1){ --dist; backTracer = backTracer.Nearbys.First(pos => maze[pos.X,pos.Y] == dist); maze[backTracer.X, backTracer.Y] = -2; } //////////////////// 最短経路こみのアスキー地図に変換 char[,] outMaze = new char[width, height]; for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { outMaze[x, y] = maze[x, y] == -2 ? '$' : maze[x, y] == -1 ? '*' : ' '; } } outMaze[Start.X, Start.Y] = 'S'; outMaze[Goal.X, Goal.Y] = 'G'; ////////////////////// 結果は標準出力に。 for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) Console.Write(outMaze[x, y]); Console.WriteLine(); } Console.ReadLine(); } /// <summary> /// 探索する。SG間の道のりを返す(道のり=SGが隣接しているなら1) /// </summary> private static int Search(int[,] maze, Position Start) { List<Position> FrontLine = new List<Position>(); FrontLine.Add(Start); int dist = 1; for (; ; ) { List<Position> NextFrontLine = new List<Position>(); foreach (var pos in FrontLine) { foreach (var nextPos in pos.Nearbys) { if (nextPos == Goal) return dist; if (maze[nextPos.X, nextPos.Y] == 0) { maze[nextPos.X, nextPos.Y] = dist; NextFrontLine.Add(nextPos); } } } FrontLine = NextFrontLine; ++dist; } } } struct Position { public readonly int X, Y; public Position(int x, int y) { X = x; Y = y; } public IEnumerable<Position> Nearbys { get { return new[]{ new Position(X-1,Y), new Position(X,Y-1), new Position(X+1,Y), new Position(X,Y+1), }; } } public static bool operator==(Position p1, Position p2){ return p1.X == p2.X && p1.Y == p2.Y; } public static bool operator!=(Position p1, Position p2){ return p1.X != p2.X || p1.Y != p2.Y; } } }
http://d.hatena.ne.jp/j5ik2o/20091024/1256369305 の
// 1.0 - 9 * 0.1
BigDecimal b1 = new BigDecimal(1.0);
BigDecimal b2 = new BigDecimal(-9);
BigDecimal b3 = new BigDecimal("0.1");
BigDecimal result = b1.add(b2.multiply(b3));
System.out.println(result.toString());
を見て悲しくなった。Javaってひどい。0.1は文字列で渡さないと誤差が出るってさ。泣ける。
C#なら
Console.WriteLine( 1.00M - 9M * .10M );
でOK
http://snowleopard.wikidot.com/ に載ってるのも試してみた。
ねとらじ用アプリが全滅で残念。
if("0x0a" == 10)
console.log("おっと、javascriptの悪口はそこまでだ。");
if("0x0a" === 10)
console.log("(´ε` )チュッ");
else
console.log("\(^o^)/");
Deploy Merb, Sinatra, or any Rack App to Heroku
http://blog.heroku.com/archives/2009/3/5/32_deploy_merb_sinatra_or_any_rack_app_to_heroku/
http://heroku.com/pages/quickstart
HerokuをGit経由で使ってみる
http://d.hatena.ne.jp/aki-s-119/20081110/1226335713
http://github.com/guides/using-git-and-github-for-the-windows-for-newbies
http://d.hatena.ne.jp/kusakari/20080715/1216091060
http://code.google.com/p/msysgit/
http://net-newbie.com/putty.html
>heroku help === General Commands help # show this usage list # list your apps create [<name>] # create a new app keys # show your user's public keys keys:add [<path to keyfile>] # add a public key keys:remove <keyname> # remove a key by name (user@host) keys:clear # remove all keys === App Commands (execute inside a checkout directory) info # show app info, like web url and git repo open # open the app in a web browser rename <newname> # rename the app sharing:add <email> # add a collaborator sharing:remove <email> # remove a collaborator domains:add <domain> # add a custom domain name domains:remove <domain> # remove a custom domain name domains:clear # remove all custom domains rake <command> # remotely execute a rake command console <command> # remotely execute a single console command console # start an interactive console to the remote restart # restart app servers logs # fetch recent log output for debugging logs:cron # fetch cron log output bundles # list bundles for the app bundles:capture [<bundle>] # capture a bundle of the app's code and dat bundles:download # download most recent app bundle as a tarba bundles:download <bundle> # download the named bundle bundles:animate <bundle> # animate a bundle into a new app bundles:destroy <bundle> # destroy the named bundle destroy # destroy the app permanently === Example story: rails myapp cd myapp (...make edits...) git init git add . git commit -m "my new app" heroku create myapp git remote add heroku git@heroku.com:myapp.git git push heroku master
http://kenz0.s201.xrea.com/weblog/2008/10/post_144.html
を見て
http://anond.hatelabo.jp/20061209160227
を思い出して
に行く。
この間どっかの記事で見つけて(これ自体は数年前から海外では言われていたことだが)ターゲットを探そうと頑張ってたんだけどいろいろと理由があってここで公開することにする。
javascriptは以下のようにコンストラクタを再定義できる。
function Array() { var obj = this; var ind = 0; var getNext = function(x) { obj[ind++] setter = getNext; if (x) { console.log(x.toString());//細工。 } }; this[ind++] setter = getNext; }
実はこれが問題で例えば、配列を含むオブジェクトをJSONで渡す際に必ずArrayコンストラクタが呼び出される。
上記のように少し細工をしておけばcallbackとかついてなくても内容を処理できるのでクロスドメイン対策がされている場合でもJSONからデータを読み取ることが出来る。
余談だが、Gmailなどではこれを回避するためにwhile 1を先頭につけることで無限ループさせている。
http://anond.hatelabo.jp/20071030034313 の二番煎じ
あまりのアホさに、作ってて気が狂いかけた
方針
using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.IO; using System.Reflection; using Microsoft.CSharp; delegate void ConvertTemplateDelegate(TextWriter tw, Dictionary<object, object> args); static class TemplateGenerator { public static ConvertTemplateDelegate Generate(string code) { CompilerParameters param = new CompilerParameters(); param.GenerateInMemory = true; param.ReferencedAssemblies.Add("System.Web.dll"); CompilerResults rs = new CSharpCodeProvider().CompileAssemblyFromSource(param, ParseTemplate(code)); if (0 < rs.Errors.Count) { StringWriter sw = new StringWriter(); sw.WriteLine("Compile Error..."); foreach (CompilerError err in rs.Errors) sw.WriteLine(err.ToString()); throw new Exception(sw.ToString()); } return (ConvertTemplateDelegate) Delegate.CreateDelegate(typeof(ConvertTemplateDelegate), rs.CompiledAssembly.GetType("Template", true).GetMethod("Convert")); } private static string ParseTemplate(string code) { using (StringWriter sw = new StringWriter()) { sw.WriteLine("using System; using System.Collections.Generic; using System.IO; using System.Web;"); sw.WriteLine("public static class Template {"); sw.WriteLine("public static void Convert(TextWriter tw, Dictionary<object, object> args) {"); int index = 0; while (0 <= index && index < code.Length) { int i = code.IndexOf("<%", index); sw.WriteLine("tw.Write(\"{0}\");", EscapeString(i < 0 ? code.Substring(index) : code.Substring(index, i - index))); if (0 <= i) { i += 2; int i2 = code.IndexOf("%>", i); if (0 <= i2) { string cc = code.Substring(i, i2 - i); if (cc.StartsWith("=")) sw.WriteLine("tw.Write(HttpUtility.HtmlEncode(\"\"+({0})));", cc.Substring(1)); else sw.WriteLine(cc); i = i2 + 2; } } index = i; } sw.WriteLine("}}"); return sw.ToString(); } } private static string EscapeString(string code) { return code.Replace("\\", "\\e").Replace("\"", "\\\"").Replace("\t", "\\t").Replace("\n", "\\n").Replace("\r", "\\r").Replace("\\e", "\\\\"); } }
サンプル C# コード。ためしにテンプレートから Xml 生成して、標準出力してみる。
class Program { static void Main(string[] args) { ConvertTemplateDelegate func = TemplateGenerator.Generate(TemplateEngine.Resource1.template); using (StringWriter sw = new StringWriter()) { Dictionary<object, object> arg = new Dictionary<object, object>(); arg["title"] = "template sample"; arg["data"] = new string[] { "foo", "fooo", "<strong>foooooooooo!</strong>" }; func(sw, arg); Console.WriteLine(sw); } } }
サンプルテンプレート
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title><%= args["title"] %></title> </head> <body> <h1><%= args["title"] %></h1> <table> <% string[] data = (string[]) args["data"]; %> <% for(int i = 0; i < data.Length; i++) { %> <tr bgcolor="<%= i % 2 == 0 ? "#FFCCCC" : "#CCCCFF" %>"> <td><%= i %></td> <td><%= data[i] %></td> </tr> <% } %> </table> </body> </html>
出力例
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>template sample</title> </head> <body> <h1>template sample</h1> <table> <tr bgcolor="#FFCCCC"> <td>0</td> <td>foo</td> </tr> <tr bgcolor="#CCCCFF"> <td>1</td> <td>fooo</td> </tr> <tr bgcolor="#FFCCCC"> <td>2</td> <td><strong>foooooooooo!</strong></td> </tr> </table> </body> </html>
CodeDom 使って動的コンパイル……って、このコードのままだとセキュリティ的に大問題な気がするな。
素直に ASP.NET 使ったほうが楽だと直感した。
あと EscapeString すっごく自信ない。たぶん修正が必要だと思うw
Ruby,Windows COM APIの知識がそれなりにあることを前提としています。あしからず。
あと、用語の使い方は結構いい加減です。訂正ヨロ。
まずは、GoogleEarthをインストールしよう。http://earth.google.co.jp/ から無料でダウンロードできます。
次に、COM APIの登録。コマンドプロンプトで、GoogleEarthをインストールしたフォルダ(通常は、c:\Program Files\Google\Google Earth)に移動して次のコマンドを実行します(>は入力する必要はありません)。
>googleearth.exe /RegService
これを実行することによりCOM APIを介して外部から操作することが可能になります。
次にRubyの実行環境を整えます。が、説明が面倒なので省きます。ActiveScriptRubyでぐぐれ!
さて、ここから実際にGoogleEarthを動かしてみます。こういうときはirbが便利ですね。ActiveScriptRubyが正しくセットアップされていれば、デスクトップにRuby Consoleというショートカットができているはずです。これを起動すると、Rubyにパスが通った状態でコマンドプロンプトが起動するはずです。そこでirb(Enter)と入力してみましょう。
irb(main):001:0>
というふうに表示されればOKです。
どんどんいきましょう。irbで、
>require 'win32ole'
と入力してください(>は入力しません。プロンプトがでているという意味のお約束です)。これで、COM APIをRuby上で取り扱うことが出来るようになります。
次に、
>ge = WIN32OLE.new('GoogleEarth.ApplicationGE')
と入力しましょう。変数geがGoogleEarthのCOM APIのインタフェースのインスタンスになります。geのメソッドを呼び出すことによりGoogleEarthを操作します。GoogleEarthを起動していない場合、ここで起動されます。
では、いよいよGoogleEarthを動かします。GoogleEarthでは、視点情報をCameraと呼称しています。カメラを移動させるために、カメラ情報へのインタフェースを生成します。
>cam = WIN32OLE.new('GoogleEarth.CameraInfoGE')
この、camのプロパティを設定することによりカメラ情報を設定することが出来ます。
>cam.FocusPointLatitude = 35.0 =>35.0 >cam.FocusPointLongitude = 135.0 =>135.0
実際に入力するのは、1行目と3行目です。Latitude:緯度、Longitude:経度です。緯度は赤道を中心として+90(北方向)から-90(南方向)の値をとります。経度は+180(東方向)から-180(西方向)の値をとります。日本の場合、どちらも+になります。
実際に視点を移動させるには、先ほどのgeのメソッドを呼び出します。
>ge.SetCamera(cam,1)
GoogleEarthでの表示が切り替われば成功です。場所は日本どこかです。岡山のあたりでしょうか。
(つづく?)
xenの設定ファイルを/etc/xen/autoにシンボリックリンクする。
例
#ln -s /etc/xen/winxp /etc/xen/auto
ただし、設定が
vnc=0
sdl=1
だと起動しませんでした。
vnc=1
sdl=0
だときちんと起動しました。
実際に何をやっているのかは、
/etc/init.d/xendomains
/etc/sysconfig/xendomains
の中をを見てください。
今使っている設定です。参考までにどうぞ。
builder = "hvm"
memory = "1000"
disk = [ 'file:/images/winxp0.img,ioemu:hda,w','phy:/dev/sdb,hdc,w']
vif = [ 'type=ioemu, mac=00:16:3e:32:23:85, bridge=xenbr1', ]
uuid = "4e845bfa-ab42-9cbe-ff02-ff877a83ef25"
device_model = "/usr/lib/xen/bin/qemu-dm"
kernel = "/usr/lib/xen/boot/hvmloader"
vnc=1
apic=1
acpi=1
pae=0
sdl=0
vcpus=1
serial = "pty" # enable serial console
on_reboot = 'restart'
on_crash = 'restart'
boot='c'
1. 遠視なのでフォントサイズは大きめ
2. エディタの関係で等幅TrueType限定
3. ClearType有効
4. 字は1Il| ,.;: (){} oO0 とmの潰れ具合ぐらいしか見てない
5. フリー
以上の条件でフォントをセレクト
定評もあり、今回の基準をほぼ完全に満たすフォント。
イタリック・ボールド、セリフ・サンセリフ全てバランスがいい。
ただ小文字のLの自己主張がちょっと激しくて、ゼロがdotted zeroなのが気に入らない。
というよりこの条件と自分の好みで選んだ結果全部似たようなフォントになってしまったが。
http://sourceforge.net/project/showfiles.php?group_id=34153&release_id=105355
1と小文字のLがほぼ同じだが、slashed zeroなのでプラマイゼロ。
セリフ体のみかな?あと#が可愛い
http://www.ms-studio.com/FontSales/anonymous.html
可読性はVeraフォント並だが、等幅だとちょっとmが潰れ気味。
フォントサイズを小さくするとそれが顕著に。
http://www.geocities.jp/osakaforwin/
なのでマイナスポイントはほぼないが、どうやら今のところまだ入手は面倒くさいようだ。
ちょっとポップな感じの、字幅が広いフォント。
1と小文字のL、aとoなど、可読性は微妙かもしれないが、可愛い字体。
あと縦棒が二つに分割されていて、コロンのようになっている(見分けはつく)
ftp://ftp.hilgraeve.com/pub/vendor/hilgraeve/hyprfont.zip
定評はあるが、今回の条件だと微妙。
このフォントの真価は、フォントサイズを限界まで小さくしたときに発揮される。
多分元々インストールされてるはず。
悪くはない可読性をもつ太めのフォント。ただこちらもフォントサイズを小さくする人向けのように思う。
プリインストール済かな
可読性はトップクラス。デザインもさすがMacといったところか。何がさすがなのかはわからないが。
http://www.geocities.jp/osakaforwin/
太字でカクカクの、何だかレトロな印象のフォント。英字のみだが、
http://66.167.72.10/ProFontWindows.zip
文句なしの可読性を誇り、多彩なラインナップを持つM+フォントを英数字部分に採用したフォント。
M+をなぜかうちのエディタが認識してくれないのでインストールした。
http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index.html
リンクはほとんどhttp://www.lowing.org/fonts/に貼ってあるのから。