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
p:ページナンバー | |
m:1ページに表示したい項目数 | |
問:sql文を作成したい=>SQLのl:Limitとo:Offsetを求める。また、初期値としてそれぞれl=M,o=0とする。 | |
アルゴリズム: | |
l=m | |
o=(p-1)*l |
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
$scope.selectedFn = function($item){ | |
$scope.hoges[this.$parent.$index].huga = $item.title; | |
} | |
$scope.changedInput = function(huga){ | |
$scope.hoges[this.$parent.$index].huga = huga; | |
} |
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
#!/bin/sh | |
#Move any where. | |
move(){ | |
if [ ! "$#" -eq 1 ]; then | |
echo "The number of arameters must be 1." | |
return | |
fi | |
case $1 in | |
android) cd ~/android_workspace ;; |
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
<android.support.design.widget.TabLayout | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize"/> |
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
<Frame_Layout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<CardView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_margin="8dp"> | |
<!--Some views --> | |
</CardView> | |
</FrameLayout> |
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 main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
) | |
func 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
public static String getToken(Context context){ | |
SharedPreferences preferences = context.getSharedPreferences(PreferenceValue.PREF_KEY, Context.MODE_PRIVATE); | |
String accessKey = preferences.getString(PreferenceValue.TOKEN_ACCESS_KEY, null); | |
String encryptedToken = preferences.getString(PreferenceValue.ENCRYPTED_KEY, null); | |
byte[] rawEncryptedToken = null; | |
String rawDecryptedToken = null; | |
if(encryptedToken!=null&&accessKey!=null) { | |
rawEncryptedToken = Base64.decode(encryptedToken, Base64.DEFAULT); | |
Crypto crypto = new Crypto( |
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
/** | |
* Return Statusbar size. | |
* @param activity Activity | |
* @return Statusbar size | |
*/ | |
public static int getStatusBarHeight(Activity activity){ | |
final Rect rect = new Rect(); | |
Window window = activity.getWindow(); | |
window.getDecorView().getWindowVisibleDisplayFrame(rect); | |
return rect.top; |
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
#キーワードで自動フォロー1000人 | |
def autoFollow(api, query): | |
requestcount=1 | |
global followCount | |
global wordCount | |
#リクエストが50回以下(検索人数1000人)で繰り返す | |
while requestcount<51: | |
print 'Do request %i' %requestcount | |
users = api.search_users(query, 20, requestcount) | |
requestcount+=1 |
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
public class CustomAdapter extends ArrayAdapter<VideoItems> { | |
private LayoutInflater layoutInflater; | |
private Context context; | |
public CustomAdapter(Context context, int textViewResourceId, List<VideoItems> objects, RequestQueue queue) { | |
super(context, textViewResourceId, objects); | |
layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
this.context = context; | |
} |
NewerOlder