約 2,924,614 件
https://w.atwiki.jp/kimikage/pages/63.html
Java JDKの入手 ダウンロードページ: Java SE ダウンロード - Sun Developer Network (SDN) 上記ダウンロードページから最新のJDKをダウンロードします。 インストールは、ウィザードに従って行えば何も問題はありません。 コマンドプロンプトで java -version と入力して、 java version "1.6.0_26" などが出力されますが、"1.5.~"以降のバージョンであれば現在のところAndroid SDKが動作するらしいです。 バージョンが違っていれば環境変数のpathを変更します。 Eclipseの入手 ダウンロードページ: Eclipse Downloads 上記ダウンロードページから、Eclipse IDE for Java Developersを取得する。 Android SDKの入手 ダウンロードページ: Android SDK | Android Developers Eclipse用のAndroidプラグインの入手 ①Eclipseを起動し、 "Help" "Install New Software..." を選択する。 ②"Install"画面にて"Work with "に以下のURLを入力して"Add"する。 https //dl-ssl.google.com/android/eclipse/ ③一覧に表示される全ての項目をチェックして"Next"を押下し、インストールを行う。 ④インストール後にEclipseを再起動してから、"Android SDK" のLocationを設定する。 ⑤Androidのボタンがツールバーに追加されていればOK
https://w.atwiki.jp/kimikage/pages/25.html
便利なフリーウェアを紹介 システムフルバックアップ Backup and Recovery 2010 Free Advanced ダウンロードはParagon Softwareから http //www.paragon-software.com/ 機能紹介 OSを含めたすべてのデータのバックアップを行えます。 Backup and Recovery 2010 Free Advanced 機能 仮想マシン作成 VMWare Player ダウンロードはVMWareから http //www.vmware.com/index.html 機能紹介 仮想マシンの作成と実行が行えます。 OSがぶっ壊れてしまう可能性のある作業や、OSの環境が激しく汚れてしまう作業 などは、仮想マシンで行うとよいと思います。 VMWare 機能 レジストリクリーナ CCleaner ダウンロードはpiriformから http //www.piriform.com/ 機能紹介 WINDOWSのレジストリをきれいにしてくれます。 XPでブルースクリーンが出るようになってしまった。 動作が異常に遅い。という時に使うと、症状が改善する場合があります。 仮想ドライブ daemon-tools ダウンロードはdaemon-toolsから http //www.daemon-tools.cc/jpn/home 機能紹介 ISOなどのディスクイメージを仮想ドライブにマウントします。 ディスクイメージをわざわざDVDなどに書き込まなくても使用できるようになります。 デスクトップキャプチャ Screen Hunter Free ダウンロードはWISDOM SOFTWAREから http //www.wisdom-soft.com/ 機能紹介 アクティブなウィンドウのキャプチャや、矩形範囲選択によるキャプチャが可能です。 キャプチャ画像は、クリップボードとファイルへ出力できます。 オフィス Open Office ダウンロードはOpenOffice.org 日本語プロジェクトから http //ja.openoffice.org/ 機能紹介 WINDOWSのオフィスと互換性を持つオフィスです。 WINDOWSのオフィスで開くと少しレイアウトがずれてしまうのと、スプレッドの動作が 重いのが欠点だと思いますが、無料で使えてこれだけの性能があれば最高です。 家のパソコンには、絶対これを入れるべきです。 圧縮 7-Zip ダウンロードは7-Zipから http //sevenzip.sourceforge.jp/ 機能紹介 圧縮率の高い7-Zipで圧縮することができます。 もちろんrarやzipなどなどのメジャーな圧縮形式への圧縮、解凍が行えます。 動画トランスコード MediaCoder ダウンロードはMediaCoderから http //www.mediacoderhq.com/ 機能紹介 動画のリサイズ、トランスコードなどが簡単に行えます。 PSP用の動画に変換することもできます。
https://w.atwiki.jp/kimikage/pages/138.html
コマンドを複数行にわたって記述したい場合は、行の末尾に「^」をつけます。 特殊文字をエスケープしたい場合は、文字の直前に「^」をつけます。 例)複数行 ECHO abc^ DEF 例)エスケープ SET para=abc ECHO %^para%=%para% または SET para=abc ECHO %para^%=%para%
https://w.atwiki.jp/kimikage/pages/82.html
MySqlの設定 日本語対応 日本語対応としてMySqlのテーブルをutf8で作成するように設定します。 この設定を行わない場合、テーブルから取得した日本語が???などに文字化けしてしまいます。 ①my.cnfを編集(文字コードをutf8に設定) # vi /etc/my.cnf ②mysqldを再起動 # service mysqld restart ③データベースを作成 ログイン # mysql -u root -p データベース作成 create database データベース名; 例) create database test_db; データベースへ移動 use データベース名; 例) use test_db; データベースのステータスを表示(文字コードがutf8であることを確認) status; データベースエンジンの変更 MySqlのテーブルの作成を行った場合、デフォルトはMyISAMエンジンを使用する設定となっています。 MyISAMエンジンは、パフォーマンスが高いらしいのですが、トランザクションが使用できないようです。 そこで、ここでは、テーブルのエンジンをトランザクション制御が行えるInnoDBエンジンに変更する方法について書きます。 ログイン # mysql -u root -p データベース作成 create database データベース名; データベースへ移動 use データベース名; テーブル作成 create table テーブル名(カラム名 型 その他プロパティ,...); 例) create table test(col1 varchar(10) primary key not null, col2 varchar(20)); データベースエンジンの設定および説明の表示 show engines; テーブルのエンジンの表示(EngineがMyISAMであることを確認) show table status; テーブルのエンジンを変更 alter table テーブル名 engine = InnoDB; 例) alter table test engine = InnoDB; テーブルのエンジンの表示(EngineがInnoDBに変更されたことを確認) show table status; トランザクションが有効になっていることを確認 トランザクションの開始 start transaction; 行レベルの更新・登録・削除処理を実行 insert into テーブル名 values(カラムの値1,カラムの値2,...); 例) insert into test values( test , test ); 追加された行を参照 select * from テーブル名; 例) select * from test; ロールバック(warningが出力されないことを確認) rollback; ※MyISAMの場合、ロールバック時に以下の警告が出力されロールバックが正常に行われない warning code 1196 | message Some non-transactional changed tables couldn t be rolled back 変更がロールバックされていることを確認 select * from テーブル名; MySqlを終了 exit; mysqldを再起動 # service mysqld restart
https://w.atwiki.jp/kimikage/pages/122.html
マウスカーソルを動かす using System; using System.Runtime.InteropServices; using System.Threading; using System.Windows; using System.Windows.Interop; namespace WpfApp { /// summary /// MainWindow.xaml の相互作用ロジック /// /summary public partial class MainWindow Window { [DllImport("user32.dll")] private extern static bool GetCursorPos(out POINT lpPoint); [DllImport("user32.dll")] private extern static bool SetCursorPos(int x, int y); [DllImport("user32.dll")] private extern static bool GetWindowRect(IntPtr hwnd, out RECT lpRect); [DllImport("user32.dll")] private static extern void mouse_event(uint dwFlags, int dx, int dy, int dwData, int dwExtraInfo); public enum MouseEventFlags uint { LEFTDOWN = 0x00000002, LEFTUP = 0x00000004, MIDDLEDOWN = 0x00000020, MIDDLEUP = 0x00000040, MOVE = 0x00000001, ABSOLUTE = 0x00008000, RIGHTDOWN = 0x00000008, RIGHTUP = 0x00000010, WHEEL = 0x00000800, XDOWN = 0x00000080, XUP = 0x00000100 } /// summary /// コンストラクタ /// /summary public MainWindow() { // コンポーネントの初期化 InitializeComponent(); } /// summary /// Click Close Button /// /summary /// param name="sender" /param /// param name="e" /param private void BtnClose_Click(object sender, RoutedEventArgs e) { RECT rect = new RECT(); // call user32.dll GetWindowRect method // get current window rect value if (!GetWindowRect(((HwndSource)HwndSource.FromVisual(this)).Handle, out rect)) { return; } POINT goalPoint = new POINT() { X = rect.Right - 20, Y = rect.Top + 10 }; POINT currentPoint = new POINT(); // call user32.dll GetCursorPos method // get current cursor position if (!GetCursorPos(out currentPoint)) { return; } while (currentPoint.X != goalPoint.X || currentPoint.Y != goalPoint.Y) { if (currentPoint.X != goalPoint.X) { currentPoint.X += currentPoint.X goalPoint.X ? -1 1; } if (currentPoint.Y != goalPoint.Y) { currentPoint.Y += currentPoint.Y goalPoint.Y ? -1 1; } // call user32.dll SetCursorPos method // move cursor position SetCursorPos(currentPoint.X, currentPoint.Y); Thread.Sleep(2); } // call user32.dll mouse_event method // click left button mouse_event((uint)(MouseEventFlags.LEFTDOWN | MouseEventFlags.LEFTUP), currentPoint.X, currentPoint.Y, 0, 0); } /// summary /// point /// /summary public struct POINT { public int X { get; set; } public int Y { get; set; } } /// summary /// window rect /// /summary public struct RECT { public int Left { get; set; } public int Top { get; set; } public int Right { get; set; } public int Bottom { get; set; } } } } サンプルソース
https://w.atwiki.jp/kimikage/pages/77.html
使い方 ①フォームにボタン(button1)を加える ②button1のクリックイベントにbutton1_Clickを設定する ③usingにCustomMsgBox(当プログラムのnamespace)を加える ④以下のコードをフォームのコードに加える private void button1_Click(object sender, EventArgs e) { MsgBox.Show(this, "wow"); MsgBox.Show(this, "wow", "cap"); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign, ""); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign, "", HelpNavigator.Index); MsgBox.Show(this, "wow", "cap", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign, "", HelpNavigator.Index, null); } Owner Window中央に表示されるMessageBox using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using System.Windows; namespace CustomMsgBox { /// summary /// Owner Window中央に表示されるMessageBox /// /summary public class MsgBox { [DllImport("user32.dll")] public static extern bool UnhookWindowsHookEx(IntPtr hHook); [DllImport("user32.dll")] public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("kernel32.dll")] public static extern IntPtr GetCurrentThreadId(); [DllImport("user32.dll")] public static extern IntPtr SetWindowsHookEx(int idHook, HOOKPROC lpfn, IntPtr hMod, IntPtr dwThreadId); [DllImport("user32.dll")] public static extern IntPtr CallNextHookEx(IntPtr hHook, int nCode, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); public delegate IntPtr HOOKPROC(int nCode, IntPtr wParam, IntPtr lParam); public enum HookType int { WH_JOURNALRECORD = 0, WH_JOURNALPLAYBACK = 1, WH_KEYBOARD = 2, WH_GETMESSAGE = 3, WH_CALLWNDPROC = 4, WH_CBT = 5, WH_SYSMSGFILTER = 6, WH_MOUSE = 7, WH_HARDWARE = 8, WH_DEBUG = 9, WH_SHELL = 10, WH_FOREGROUNDIDLE = 11, WH_CALLWNDPROCRET = 12, WH_KEYBOARD_LL = 13, WH_MOUSE_LL = 14, } public enum GWL int { GWL_HINSTANCE = (-6), GWL_HWNDPARENT = (-8), GWL_ID = (-12), GWL_EXSTYLE = (-20), GWL_STYLE = (-16), GWL_WNDPROC = (-16), GWL_USERDATA = (-21), } public enum SWP uint { SWP_ASYNCWINDOWPOS = 0x4000, SWP_DEFERERASE = 0x2000, SWP_DRAWFRAME = 0x0020, SWP_FRAMECHANGED = 0x0020, SWP_HIDEWINDOW = 0x0080, SWP_NOACTIVATE = 0x0010, SWP_NOCOPYBITS = 0x0100, SWP_NOMOVE = 0x0002, SWP_NOOWNERZORDER = 0x0200, SWP_NOREDRAW = 0x0008, SWP_NOREPOSITION = 0x0200, SWP_NOSENDCHANGING = 0x0400, SWP_NOSIZE = 0x0001, SWP_NOZORDER = 0x0004, SWP_SHOWWINDOW = 0x0040, } public enum HCBT int { HCBT_ACTIVATE = 5, HCBT_CLICKSKIPPED = 6, HCBT_CREATEWND = 3, HCBT_DESTROYWND = 4, HCBT_KEYSKIPPED = 7, HCBT_MINMAX = 1, HCBT_MOVESIZE = 0, HCBT_QS = 2, HCBT_SETFOCUS = 9, HCBT_SYSCOMMAND = 8, } public struct RECT { public int Left; public int Top; public int Right; public int Bottom; public int Width { get { return Right - Left; } } public int Height { get { return Bottom - Top; } } } /// summary /// 親ウィンドウ /// /summary private IWin32Window OwnerWindow; /// summary /// フックハンドル /// /summary private IntPtr HHook; /// summary /// コンストラクタ /// /summary /// param name="owner" 親ウィンドウ /param private MsgBox(IWin32Window owner) { OwnerWindow = owner; } public static DialogResult Show( IWin32Window owner, string text) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text); } public static DialogResult Show( IWin32Window owner, string text, string caption) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon, defaultButton); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon, defaultButton, options); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon, defaultButton, options, helpFilePath); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator); } public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param) { MsgBox mb = new MsgBox(owner); return mb.ShowMsgDialog(text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator, param); } private DialogResult ShowMsgDialog( string text) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text); } private DialogResult ShowMsgDialog( string text, string caption) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon, defaultButton); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon, defaultButton, options); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon, defaultButton, options, helpFilePath); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator); } private DialogResult ShowMsgDialog( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param) { // フック設定 SetHook(OwnerWindow); return MessageBox.Show(OwnerWindow, text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator, param); } /// summary /// フックプロシージャ /// /summary /// param name="nCode" /param /// param name="wParam" /param /// param name="lParam" /param /// returns /returns private IntPtr CBTProc( int nCode, IntPtr wParam, IntPtr lParam) { if (nCode == (int)HCBT.HCBT_ACTIVATE) { RECT rectOwner; RECT rectMsgBox; int x, y; // Window位置・サイズ取得 GetWindowRect(OwnerWindow.Handle, out rectOwner); GetWindowRect(wParam, out rectMsgBox); // MessageBox出力位置設定 x = rectOwner.Left + (rectOwner.Width - rectMsgBox.Width) / 2; y = rectOwner.Top + (rectOwner.Height - rectMsgBox.Height) / 2; SetWindowPos(wParam, 0, x, y, 0, 0, (uint)(SWP.SWP_NOSIZE | SWP.SWP_NOZORDER | SWP.SWP_NOACTIVATE)); // フック解除 UnhookWindowsHookEx(HHook); } // 次のプロシージャへのポインタ return CallNextHookEx(HHook, nCode, wParam, lParam); } /// summary /// フック設定 /// /summary /// param name="owner" /param private void SetHook(IWin32Window owner) { // フック設定 IntPtr hInstance = GetWindowLong(OwnerWindow.Handle, (int)GWL.GWL_HINSTANCE); IntPtr threadId = GetCurrentThreadId(); HHook = SetWindowsHookEx((int)HookType.WH_CBT, new HOOKPROC(CBTProc), hInstance, threadId); } } }
https://w.atwiki.jp/kimikage/pages/49.html
メソッドの存在を保証 using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 Form { /// summary /// フォーム /// /summary public Form1() { InitializeComponent(); proc(new Class1(), "てすと"); } /// summary /// /// /summary /// param name="test" /param /// param name="msg" /param private void proc(ITest test, string msg) { // ITestインタフェースで定義されたメソッドの存在が保障されている test.showMessage(msg); } /// summary /// インタフェース /// /summary interface ITest { void showMessage(string msg); } /// summary /// ITestインタフェースを継承 /// /summary class Class1 ITest { /// summary /// コンストラクタ /// /summary public Class1() { } /// summary /// /// /summary /// param name="msg" /param public void showMessage(string msg) { MessageBox.Show(msg); } } } }
https://w.atwiki.jp/kimikage/pages/11.html
コメントプラグイン @wikiのwikiモードでは #comment() と入力することでコメントフォームを簡単に作成することができます。 詳しくはこちらをご覧ください。 =>http //atwiki.jp/guide/17_60_ja.html たとえば、#comment() と入力すると以下のように表示されます。 名前 コメント
https://w.atwiki.jp/kimikage/pages/76.html
html head /head body script type="text/javascript" !-- document.open(); document.write("数:"); document.write(" input id= inTxt type= text maxlength=3 style= width 30px;ime-mode disabled; "); document.write("oncopy= return false onpaste= return false oncontextmenu= return false "); document.write("ondrop= return false onblur= CheckInput(this) "); document.write(" /input "); document.close(); document.getElementById("inTxt").onkeypress = OnInputKeyPress; function OnInputKeyPress(e){ var code; if(e == null){ // ie用 code = event.keyCode; }else{ // firefox用 code = e.charCode } // 0-9までと矢印,backspace,deleteなどが入力可能 if((code = 48 code = 57) || code == null || code == 0){ return true; }else{ return false; } } function CheckInput(obj){ var val = obj.value; // ime-modeが効かないプラウザ用 全角→半角、数字以外削除 val = val.replace(/[0-9]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); }); val = val.replace(/[^0-9]/g, "") // 前方に0が入力されている場合は削除 val = val.replace(/^0+/,""); obj.value = val; } //-- /script /body /html
https://w.atwiki.jp/kimikage/pages/116.html
html head title string formatのテスト /title /head body script type="text/javascript" !-- var stringFormat = function(fmt){ for(var i = 0; i arguments.length - 1; i++){ fmt = fmt.replace(new RegExp( \{ + i + \\} , g ), arguments[i+1]); } return fmt; } alert(stringFormat( ようこそ!{0}さん\n{0}さんは{1}ですね! , ○×△ , ダメ人間 )); //-- /script /body /html