windowsでgithubのrepositoryにpushするときにエラーがでる場合の対応
使用しているgitは以下。
$ git version git version 2.6.3.windows.1
次のコマンドを実行すると、
git remote add origin https://hogehoge.gihttps://github.com/user_id/hogehoge.git git push origin master
下記のエラーがでる。
!!!bash: /dev/tty: No such device or address!!! !!!error: failed to execute prompt script (exit code 1)!!! !!!fatal: could not read Username for 'https://github.com': Invalid argument!!! !!!vimshell: exit 128 "git push origin master"!
上記はvimshellでのエラーだが、cmdから直接実行しても同様のエラーがでる。
対処法?
1. 以下の方法によるが、試してない。 [Windows] bash: /dev/tty: No such a device or address · Issue #8984 · atom/atom · GitHub
以下のURLをremote repositoryのURLとして設定する。
https://<username>:<password>@github.com/<username>/<repo_name>.git
たとえば、次の場合、 * username:hoge * password:fuga * repo_name:hage
git remote add origin https://hoge:fuga@github.com/hage/hage.git
2. こちらは、cmd上で動作は確認。vimshell上では未確認。
https://hoge@github.com/hage/hage.git
とするとパスワードが求められるので、入力する。
cppunitのテンプレ
cppunitでテストコードを書くときのテンプレ。
まずは、main.cpp
。これはまるこぴでおっけ。
#include <cppunit/BriefTestProgressListener.h> #include <cppunit/CompilerOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/TestResult.h> #include <cppunit/TestResultCollector.h> #include <cppunit/TestRunner.h> int main(int argc, char* argv[]) { // Create the event manager and test controller CPPUNIT_NS::TestResult controller; // Add a listener that colllects test result CPPUNIT_NS::TestResultCollector result; controller.addListener(&result); // Add a listener that print dots as test run. CPPUNIT_NS::BriefTestProgressListener progress; controller.addListener(&progress); // Add the top suite to the test runner CPPUNIT_NS::TestRunner runner; runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest()); runner.run(controller); // Print test in a compiler compatible format. CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut()); outputter.write(); { int a = 0; std::cin >> a; } return result.wasSuccessful() ? 0 : 1; }
テスト対象のクラスがNormalRandomGenerator
とする。
テスト用のクラスとしてNormalRandomGeneratorTest.h
及びNormalRandomGeneratorTest.cpp
を用意する。
テストクラスのsetUp
及びtearDown
メソッドは各テストメソッド(ここではtestOperatorParenthesis
)を実行する前と後に実行されるメソッド。
NormalRandomGeneratorTest.h
#pragma once //include test target hearder. #include "cva/random/NormalRandomGenerator.h" #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestFixture.h> namespace cva_test { class NormalRandomGeneratorTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(NormalRandomGeneratorTest); //class name CPPUNIT_TEST(testOperatorParenthesis); //nane of test CPPUNIT_TEST_SUITE_END(); private: void testOperatorParenthesis(); //test metdho declaration NormalRandomGenerator *_generator; }; }
NormalRandomGeneratorTest.cpp
#include "NormalRandomGeneratorTest.h" namespace cva_test { CPPUNIT_TEST_SUITE_REGISTRATION(NormalRandomGeneratorTest); void NormalRandomGeneratorTest::setUp() { _generator = new NormalRandomGenerator(); } void NormalRandomGeneratorTest::tearDown() { delete _generator; } void NormalRandomGeneratorTest::testOperatorParenthesis() { //test here } }
参考
windows7のセットアップ
インストールしたアプリ
Firefox Nighty build
tree tab
web search pro
visual studio 2012
ショートカットの設定
C:\ProgramData\Microsoft\Windows\Start Menu\Programs
にjumpという名前でフォルダを作成。
フォルダ以下にショートカットを置くと、スターとメニューでショートカットが起動できる。
フォルダのショートカットの設定
C:\ProgramData\Microsoft\Windows\Start Menu\Programs
にある適当なショートカットをコピーして、右クリック->プロパティを開く。
ショートカットのリンク先を以下のように設定。
C:\Windows\explorer.exe dir_path
dir_path
は、開きたいディレクトリのパス。
作業フォルダは適当に設定する。
thinkpad E450で削除したプリインストールアプリなど
削除したプリインストールアプリは以下。
参考
Lenovo ThinkPad のスタートアッププログラム・常駐プログラムについての詳細 - 情報科学屋さんを目指す人のメモ(FC2ブログ版)
SHAREit
- dropboxみたいに何かシェアする
REACHit
- dropboxなどのweb上のシステムに一括でアクセスできるようなもの
lenovo auto scroll utility
Message center plus
lenovo usb3.0 to dvi vba monitor adapter
- usbでDVI/VGAモニターにつなぐアダプターのためのドライバ?
lenovo Quickcontrol
lenovo solution center
lenovo communications utility
thinkVantage active protection system(SSD換装後)
- HDDを落下時の衝撃などから守る
マカフィー リブセーフ インターネットセキュリティ
- マカフィーのセキュリティソフト
PCの設定
タッチパッドの無効化
- [コントロールパネル]->[マウス]->[ThinkPad]タブ->TouchPadの無効化
E450マニュアル等
製品仕様書
ThinkPad E450 製品仕様書 - 20DC005EJP,20DC005FJP,20DC005GJP,20DC005HJP | Lenovo | 日本
裏蓋の外し方、メモリの増設仕方などのマニュアル。 「ハードウェア保守マニュアル ThinkPad E450」で検索
ハードウェア保守マニュアル ThinkPad E450 - Google 検索
セットアップ手順
リカバリメディアの作成
OS別手順
リカバリー・メディアの作成方法 - Windows 7 - Lenovo Support (JP)
リカバリメディア用USB
SSDへの換装
E450用のマニュアル
ThinkPadのSSD換装~準備編 - Thinkpad E450の気になる話
ThinkPadのSSD換装~作業編 - Thinkpad E450の気になる話
ThinkPad E450のSSD換装手順はとっても簡単でした。
換装用SSD
メモリの増設
購入時は、DDR3L PC3L-12800 4GBの一枚差し、空きスロットは1。省電力用のDDR3L PC3L
なので注意。
ThinkPad E450 Review #2 裏蓋外し(JP) | Jibara de Review
増設用メモリ
価格.com - ADATA ADDS1600W4G11-R [SODIMM DDR3L PC3L-12800 4GB] 価格比較
リカバリメディアからの復帰
USBからbootする場合はBIOSでF12
haskellで数字を文字列に変換
haskellで文字列を数字に変換するにはread
を使う
n = read "01235" main = print n --1234
逆に、数字から文字列に変換する場合はshow
を使う。
main = print (show (read "01234")) --1234