Android Device MonitorのFile Explorerで何も表示されない
【VBA】自作関数
文字列置換(簡易正規表現対応)
Function replaceWithRegex(target As String, pattern As String, replaceStr As String) Dim RE, strPattern As String, ret As String Set RE = CreateObject("VBScript.RegExp") With RE .pattern = pattern ''検索パターンを設定 .IgnoreCase = True ''大文字と小文字を区別しない .Global = True ''文字列全体を検索 End With '正規表現による置換の実行 ret = RE.Replace(target, replaceStr) Set RE = Nothing replaceWithRegex = ret End Function
技術系つぶやき(ネタメモ)
Spring系
i18n(国際化対応)で、各ロケールごとのメッセージ定義ファイル内に存在しないキーをSpringが検索した時、デフォルトのメッセージ定義ファイルを読みに行くようだ。
ちなみにi18nが何故「国際化対応」を意味するかというと、
「国際化=internationalization の先頭の i と語尾の n の間に nternationalizatio の 18文字があることに起因する。」
との事。下記サイトより。
Linux系
CentOS7のsystemctl周り
Failed to get D-Bus connection: Operation not permitted
Dockerのコンテナ内でyum -y install tomcat
ってインストールして
systemctl status tomcat.service
ってやると上記メッセージが出た。
これは単純にsystemctl enable tomcat.service
ってやればいいだけかと思ったが違った。どうする?
→諦め。OSはCentOS6にしよう。
CentOS7のfirewalld周り
参考
CentOS7.1 64bit firewalldによるアクセス制御 | kakiro-web カキローウェブ
ポートをあける
firewall-cmd --permanent --add-port=80/tcp
→80番ポートを開ける。--parmanent
は、OS再起動も有効なようにするための指定。
有効化
firewall-cmd --reload
Tomcat系
Maven周り
Tomcat PluginでTomcatにデプロイする
- こんなのをpom.xmlの
要素に書く。
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <path>/xxxx</path> <server>tomcat-xxxx</server> <url>http://xxxxx:xxxxx/manager/text</url> </configuration> </plugin>
- settings.xmlにこんなのを書く。
<settings> <servers> <server> <id>tomcat-xxxx</id> <username>user</username> <password>passwoooord<password> </server> </servers> </settings>
<user username="user" password="passwoooord" roles="manager-script"/> <user username="usergui" password="passwoooord" roles="manager-gui,admin-gui"/>
※manager-scriptとmanager-guiは同時指定できないのでユーザーを分けること(ハマった)。
- からの、
mvn package tomcat7:deploy
Androidハマった&直ったメモ
キーワード:':app:zipalignDebug', 'inputFile'
事象
Androidアプリが起動せず、エラー終了する。
エラー全文
Error:A problem was found with the configuration of task ':app:zipalignDebug'. File 'C:\User\...\app\build\outputs\apk\app-debug-unaligned.apk' specified for property 'inputFile' does not exist.
解決
AndroidStudio メニュー -> [Build] -> [Build APK] -> Run App
キーワード:'dexopt error'
事象
Androidアプリを端末にインストールできない。
エラー全文
Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error).
解決
AndroidStudio メニュー -> [File] -> [Settings] -> [Build, execution, deploy] --> [Instant run] "Enable Instant Run..."のチェックボックスを外す
Apache POI メモ
インストール
Apache POI - Download Release Artifactsへアクセス後、
"The latest stable release is Apache POI 3.xx"
のリンクから辿って
"poi-bin-3.xx-20YYMMDD.zip"
のファイルをDLし、解凍し、とりあえず全部のjarを突っ込む。
書き始めテンプレ(成長中)
package XXXX; import java.io.FileInputStream; import java.io.IOException; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class XXXX { public static void main(String[] args) throws IOException { String excelPath = args[0]; String sheetName = args[1]; MondaiExporter ins = new MondaiExporter(); ins.execute(excelPath, sheetName); } public void execute(String excelPath, String sheetName) throws IOException { // // Excelファイルを開く // HSSFWorkbook wb = readFile(excelPath); // // シートを開く // HSSFSheet sheet = wb.getSheet(sheetName); // // 行のListを取得 // // // 行ごとのループ // // // ファイルに書き出す // } private HSSFWorkbook readFile(String filename) throws IOException { FileInputStream fis = new FileInputStream(filename); try { return new HSSFWorkbook(fis); } finally { fis.close(); } } } `
compassを使うまでのRubyの設定 + compass使用方法(メモ)
Rubyのインストール
RubyInstallerをダウンロードする
http://rubyinstaller.org/downloads/
にアクセスし、最新「Ruby 2.2.3 (x64)」(※2015/11/12時点)をクリック。
DevKitをダウンロードする
同じくhttp://rubyinstaller.org/downloads/
にアクセスし、「For use with Ruby 2.0 and above (x64 - 64bits only)」の方を選んでインストーラをダウンロードする。
DevKitのインストール
DOSプロンプトを開き、DevKitの展開先フォルダに移動する。
ruby dk.rb init
を実行し、下記が出るのを確認する。
[INFO] found RubyInstaller v2.2.3 at C:/Ruby/Ruby22 Initialization complete! Please review and modify the auto-generated 'config.yml' file to ensure it contains the root directories to all of the installed Rubies you want enhanced by the DevKit.
次にruby dk.rb install
を実行し、下記が出るのを確認する。
[INFO] Installing 'C:/Ruby/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/defaults/operating_system.rb' [INFO] Installing 'C:/Ruby/Ruby22/lib/ruby/site_ruby/devkit.rb'
Compassインストール
下記をそれぞれ実行。
gem update --system
sudo gem install compass
こんなメッセージが出た。
C:\Users\isomu_000\Downloads>gem install compass Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Successfully installed ffi-1.9.10 Fetching: rb-inotify-0.9.5.gem (100%) Successfully installed rb-inotify-0.9.5 Fetching: compass-1.0.3.gem (100%) Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks! Successfully installed compass-1.0.3 Parsing documentation for ffi-1.9.10 Installing ri documentation for ffi-1.9.10 Parsing documentation for rb-inotify-0.9.5 Installing ri documentation for rb-inotify-0.9.5 Parsing documentation for compass-1.0.3 Installing ri documentation for compass-1.0.3 Done installing documentation for ffi, rb-inotify, compass after 22 seconds 3 gems installed
参考
sass --> css 自動コンパイル
- config.rbがおいてあるパスを調べる
例:「/home/aaa/sasspj/ex1」だとする - 下記を実行し、監視させる(終わるときは
Ctrl+C
らしい)
compass watch /home/aaa/sasspj/ex1