This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'amazon/ecs' | |
require 'yaml' | |
require 'nokogiri' | |
class PaapiSample | |
def initialize | |
@config = YAML.load_file('./paapi-sample.yaml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'amazon/ecs' | |
require 'yaml' | |
require 'nokogiri' | |
class PaapiSimilaritiesSample | |
def initialize | |
@config = YAML.load_file('./paapi-similarities-sample.yaml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim obj | |
Dim objWkBk | |
Set obj = CreateObject("Excel.Application") | |
Set objWkBk = obj.Workbooks.Open(WScript.Arguments(0)) | |
obj.ActiveWindow.SelectedSheets.PrintOut() | |
objWkBk.Save | |
objWkBk.Close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<EditText | |
android:id="@+id/editText1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_above="@+id/button_next" | |
android:layout_centerHorizontal="true" | |
android:layout_marginBottom="36dp" | |
android:ems="10" | |
android:hint="@string/edittext_nickname_default_text" <!-- ここに設定した文字列がデフォルト値になる --> | |
android:inputType="textPersonName" > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void enableInputEmoji(int id) { | |
EditText editor = (EditText) findViewById(id); | |
Bundle bundle = editor.getInputExtras(true); | |
if(bundle != null) { | |
bundle.putBoolean("allowEmoji", false); | |
bundle.putBoolean("allowDecoEmoji", false); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean hasEmoji(String value) { | |
for(int i = 0; i < value.length(); i++) { | |
int pointAt = value.codePointAt(i); | |
if(Character.isHighSurrogate(value.charAt(i)) || EmojiDrawable.isEmoji(pointAt)) { | |
return true; | |
} | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void doGet(HttpServletRequest request, | |
HttpServletResponse response) throws ServletException, IOException { | |
ClassLoader classLoader = this.getClass().getClassLoader(); | |
InputStream inputStream = classLoader.getResourceAsStream("app.properties"); | |
Properties properties = new Properties(); | |
properties.load(inputStream); | |
String hoge = properties.getProperty("hoge"); | |
response.getWriter().print(hoge); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 画像ファイルのサイズ(縦横じゃなくて容量)を取得する | |
* | |
* @param filePath 画像ファイルのパス | |
* @return | |
*/ | |
public long getFileSize(String filePath) { | |
return new File(filePath).length(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.tomoyamkung; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class ImageUtil { | |
/** | |
* ファイルの拡張子が JPG であるかを問い合わせる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.tomoyamkung; | |
import java.io.IOException; | |
import java.util.Properties; | |
public class AppProperties { | |
private static AppProperties instance; | |
/** 参照するプロパティファイル(クラスパス上のあること) */ |