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 SelfSample | |
/** | |
* Created by shogo on 2016/10/03. | |
*/ | |
trait MiddleValue { | |
def middle (list: List[Double]): Double | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context="com.shogonir.android_individual.MainActivity"> |
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
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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
/** | |
* Created by shogo on 2016/06/04. | |
*/ | |
public class BookmarkApiCaller extends ApiCaller { | |
private TextView mTextView; | |
public BookmarkApiCaller (TextView textView) { | |
mTextView = textView; | |
} |
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
import android.os.Handler; | |
import java.io.IOException; | |
import okhttp3.Call; | |
import okhttp3.Callback; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.Response; |
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 editText = (EditText)findViewById(R.id.edit_text); | |
String editTextString = editText.getText().toString(); | |
TextView textView = (TextView)findViewById(R.id.text_view); | |
textView.setText(getResources().getString(R.string.label, editTextString)); |
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 editText = (EditText)findViewById(R.id.edit_text); | |
String editTextString = editText.getText().toString(); | |
TextView textView = (TextView)findViewById(R.id.text_view); | |
textView.setText("EditText string = " + editTextString); |
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
import java.util.regex.Pattern; | |
import java.util.regex.Matcher; | |
public class CheckHatenaID { | |
public static void main (String[] args) { | |
String hatenaID = "shogonir"; | |
Pattern p = Pattern.compile("[a-zA-Z][a-zA-Z0-9_\\-]{1,30}[a-zA-Z0-9]"); | |
Matcher m = p.matcher(hatenaID); | |
boolean f = m.matches(); |
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
#! /usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
sys.path.append('../') | |
from Testlib import * | |
print library_name() |
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
def library_name () : | |
return 'Testlib' |