Output OptionsでreplaceFileContentsOnEachWrite をtrueに設定する
参考サイト
https://github.com/nlog/NLog/wiki/File-target
Output OptionsでreplaceFileContentsOnEachWrite をtrueに設定する
参考サイト
https://github.com/nlog/NLog/wiki/File-target
見積もりの備忘録を以下に示す。
・外部向けの見積もり単位は0.5人日にする。
・例えば、作業Aの見積もりが0.2人日になる場合、外部見積もり(客向け)には0.5人日にする。
理由は他の作業の工数(作業B:0.2人日、作業C:0.2人日)を合算した場合、作業A+作業B+作業C=0.6人日になり、見積もりがきれいにならないため。
0.5人日単位だと、作業A(0.5人日)+作業B(0.5人日)+作業C(0.5人日)=1.5人日ときれいになる。
1.Visual Studio 2019を起動する
2.テストプロジェクトを新規作成する。
テンプレートプロジェクトは、クラスライブラリ(.Net Framework)を選択する
3.テストプロジェクトの参照に「nunit.framework」を追加する
<src>\packages\NUnit\bin\nunit.framework.dll
4.テストプロジェクトの参照にテスト対象のプロジェクトを追加する
5.テストコードを実装する
6.Visual Studio 2019の拡張機能メニューから以下のツールをインストールする
NUnit 2 Test Adapter
expo-cli@6.0.0以降のバージョンでは、Expo CLIのWebUIが廃止されたようです。
https://blog.expo.dev/sunsetting-the-web-ui-for-expo-cli-ab12936d2206
備忘録として、
React Navigation画面遷移ライブラリの環境構築の方法を記載する。
■前提条件
・nodejsがインストールされていること
・Expo-CLI が事前にインストールされていること
>npm install -g expo-cli
1./サンプルプロジェクトを作成する
> npx expo init react-navigation-sample
2.「react-navigation-sample」フォルダに移動する
> cd react-navigation-sample
3.React Navigationのコアライブラリをインストールする
> npm install @react-navigation/native
4-1.stackを使う場合、statckをインストールする
> npm install @react-navigation/stack
4-2.bottom-tabsを使う場合、bottom-tabsをインストールする
> npm install @react-navigation/bottom-tabs
4-3.drawerを使う場合、drawerをインストールする
> npm install @react-navigation/drawer
5.react-native-paperをインストールする
npm install react-native-paper
6.React Navigationの依存ライブラリをインストールする
> npx expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
private void ShutdownWindows() { try { ManagementClass managementClass = new ManagementClass("Win32_OperatingSystem"); managementClass.Get(); // 権限を有効化する managementClass.Scope.Options.EnablePrivileges = true; ManagementObjectCollection managementObjectCollection = managementClass.GetInstances(); foreach (ManagementObject managementObject in managementObjectCollection) { // InvokeMethodでWMIのメソッドを実行する managementObject.InvokeMethod( "Win32Shutdown", // 強制シャットダウン指定 new object[] { 5, 0 } ); managementObject.Dispose(); } managementObjectCollection.Dispose(); managementClass.Dispose(); } catch (Exception ex) { //なんかエラーログを出力する } }
private void TerminateHogeHoge() { //ローカルコンピュータ上で実行されている"HogeHoge"という名前のすべてのプロセスを取得 Process[] processes = Process.GetProcessesByName("HogeHoge"); foreach (Process process in processes) { // メイン ウィンドウにクローズ メッセージを送信する bool isCloseMainWindow = process.CloseMainWindow(); if (! isCloseMainWindow) { // 終了しなかった場合は強制終了する process.Kill(); } // プロセスが終了するまで60秒間に待機する // TODO:何秒待機するのが適正化?暫定的に60秒。 bool isExit = process.WaitForExit(60000); if (isExit) { return; } throw new HogeHogeException("一定時間内にHogeHogeが終了しませんでした。"); } }
import fetch from "node-fetch"; // DeepL WebAPI URL const URL_API = "https://api-free.deepl.com/v2/translate?auth_key="; //DeepLのAPIキーを設定 ※各自のAPIキーで書き換え const apiKey = "xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx:fx"; // 翻訳対象言語 enum TARGET_LANG { Ja = "JA", // 日本語に翻訳 En = "EN", // 英語に翻訳 } // DeepLのWepAPIにRESTで翻訳依頼する const executeTranslation = async ( targetText: string, targetLang: TARGET_LANG ) => { //APIリクエストのGET時に必要なパラメータを設定 const requestUrl = URL_API + apiKey + "&text=" + targetText + "&target_lang=" + targetLang; const response = await fetch(requestUrl); console.log("response", response); const json = await response.json(); console.log("json", json); return json; }; // WebAPIの返り値(JSON)をこっち側のクラスに変換する変換するためのType type Translation = { detected_source_language: string; text: string; }; type TranslationResult = { translations: Translation[]; }; const main = async () => { const result: TranslationResult = await executeTranslation( "This is translation test.", TARGET_LANG.Ja ); console.log("英語から日本語への翻訳:result", result); console.log( "英語から日本語への翻訳:detected_source_language", result.translations[0].detected_source_language ); console.log("英語から日本語への翻訳:text", result.translations[0].text); const result2: TranslationResult = await executeTranslation( "これは翻訳テストです。", TARGET_LANG.En ); console.log("日本語から英語への翻訳:result", result2); console.log( "日本語から英語への翻訳:detected_source_language", result2.translations[0].detected_source_language ); console.log("日本語から英語への翻訳:text", result2.translations[0].text); }; main();
■前提条件
VSCodeをインストールする
■手順
1.npm init
2.npm install typescript
3.npx tsc --init
4.npx tsc
参考サイト
https://www.clear-code.com/blog/2022/3/1/windows-performance-log.html
■PDF化
https://drive.google.com/file/d/1XT0BuMsxcEBuJL2WWnWcB4MByPblSXU-/view?usp=sharing
■エラーメッセージ
"Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin"
■対応手順
1.babel.config.jsに【plugins: ["react-native-reanimated/plugin"]】を追記する。
[babel.config.js]
-----
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["react-native-reanimated/plugin"],
};
};
2.[expo start -c]コマンドを実行する
■参考サイト
https://www.youtube.com/watch?v=Ad0LUwCytu4&ab_channel=LahoreGraphicsAcademy
備忘録になる
■前提条件
React Native Expoアカウントを作成する
https://expo.dev/
■手順
1.Expo プロジェクトを作成する
>expo init build-sample
2. プログラミング言語を選択する
.blank (TypeScript)
3.「expo build:android」を実行する
> npx expo build:android
4.Androidパッケージ名を決める
> What would you like your Android package name to be?
> com.example.myapp
5.ビルドタイプを決める
> Choose the build type you would like:
> apk
6.KeyStoreを指定する
>? Would you like to upload a Keystore or have us generate one for you?
>If you don't know what this means, let us generate it! :) »
>Generate new keystore
7.expo-updatesのインストール
>In order to publish an update, expo-updates needs to be installed. Do you want to install it now?
>Y
8.ビルドが成功したことを確認する
>Successfully built standalone app
9.apkダウンロードのURLが通知される。
オブジェクト指向エクササイズは、書籍「ThoughtWorksアンソロジー」に記載されている。
ソースコードを書くときに以下のルールを適用する。
以下のTypeScript/JavaScriptについて、空き時間に学習する。
・ Symbol.for()
https://nextribe.co.jp/katayan/basic-of-symbol-js
・typeof X[keyof typeof X]
https://nishinatoshiharu.com/keyof-typeof/
以下の拡張機能プラグインをインストールする
■拡張機能プラグイン
・Jest Runner
・Jest Snippets
・Jest Test Explorer
・Test Adapter Converter
・Test Explorer UI
npmのプロジェクト管理の備忘を記載する。
以下の3つだけ覚えておく。
1.npm init
2.npm install
3.npm run
■参考
https://www.webdesignleaves.com/pr/jquery/npm_basic.html
npmコマンドを備忘する
■ローカルインストール(プロジェクトのディレクトリで実行)
npm install パッケージ名
■グローバルインストール
npm install -g パッケージ名
■参考
https://www.webdesignleaves.com/pr/jquery/npm_basic.html
InstallShieldのログ(MSIログ)出力方法を備忘する。
説明として、コマンドを例として手順を示す。
setup.exe /v"/Liwrmo!v+ucae c:\temp\MSIlog.log"
参考サイト
https://tec-world.networld.co.jp/faq/show/214
VC6.0++のSPバージョンは、レジストリの以下の値で確認できる。
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\ServicePacks
標準ダイアログ(Welcome画面など)のイベントハンドラの修正方法を備忘する。
説明として、SdWelcome関数(Welcome画面)を例として手順を示す。
1.InstallShield 2020 Pro版を起動する。
2.[InstallScript] ビューを表示する
3.setup.rulを選択する
4.[InstallScript] ビューのドロップダウンリストの[Dialog Source] 選択する
5.SdWelcome関数のイベントハンドラのコードがsetup.rulに追記される
VBA Workbook_Openのデバッグ方法を備忘する。
[memo]
・Excelを開いた際、VBA AUTO_OPEN・Workbook_Openは呼び出される。
Excel起動時に実行したい処理を実装するプロシージャになる。
・VBAがパスワードでロックされていると、Stopステートメントが動かない。
そのため、パスワードのロックを解除して、Excelを開くこと
[Workbook_Openイベントプロシージャのデバッグ方法]
Workbook_OpenイベントプロシージャにStopステートメントを実装する。
Private Sub Workbook_Open()
Stop
' 何らかの処理
End Sub
Workbook_Openを実装しているブック(Excel)を開いた際に、
ブレークポイントと同様に、デバッグできるようになる。
1.0KL規模の開発における期間が1ヶ月なので、
詳細設計~単体テストまでを含む。
よって、詳細設計に1Week、単体テストに1Weekを要するなら、
1日のステップ数は100ステップになる。