Skip to content

Instantly share code, notes, and snippets.

View Nkzn's full-sized avatar

Yukiya Nakagawa Nkzn

View GitHub Profile
$('#mw-sopaOverlay').remove();
$('body').children().show();
02-17 11:24:15.650: E/AndroidRuntime(3382): FATAL EXCEPTION: main
02-17 11:24:15.650: E/AndroidRuntime(3382): java.lang.Error: Unresolved compilation problems:
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
02-17 11:24:15.650: E/AndroidRuntime(3382): R cannot be resolved to a variable
ExpandableListAdapter adapter = expandableListView.getExpandableListAdapter();
int groupCount = adapter.getGroupCount();
for(int i=0; i < groupCount; i++) {
int childCount = adapter.getChildrenCount(i);
View groupView = adapter.getGroupView(i, false, null, expandableListView);
CheckBox cbGroupSelected = (CheckBox) groupView.findViewById(R.id.cb_group_selected);
cbGroupSelected.setOnCheckedChangeListener(this);
for(int j=0; j < childCount; j++) {
@Nkzn
Nkzn / gist:3026624
Created July 1, 2012 03:00
if文の良くないネストとか
/*
* 例1
*/
if(hoge != null) {
hogeList.add(hoge);
}
// 例1の全然アリな例①
if(hoge != null)
hogeList.add(hoge);
class Sample {
public static void main(String[] args) {
bar(SuperHoge.class);
bar(Hoge.class);
bar(SubHoge.class); // ←これの話
}
StringWriter sw = new StringWriter();
AboutMeGen.encodeNullToNull(sw, aboutMe);
String json = sw.toString();
@Nkzn
Nkzn / MainActivity.java
Created July 15, 2012 13:32
ファイルサイズ検証用コード
public class MainActivity extends Activity {
private static final int REQUEST_CODE_GALLERY = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Button btnCallGallary = new Button(this);
btnCallGallary.setText("ギャラリーを開く");
/*
* http://d.hatena.ne.jp/gabuchan/20101125/1290681748 の前半を参考にして作成
* (Xperia 2.1のdata.getData()の事例は例外と判断して切りました)
*/
Uri mCameraUri;
/**
* カメラ呼び出し部分
*/
public class FizzBuzz {
public static String eval(int n) {
return ""+((n%3==0)?"fizz"+((n%5==0)?"buzz":""):(n%5==0)?"buzz":n);
}
}
public class FizzBuzzTest {
class HelloWorldActivity extends Activity {
@Override
void onCreate(Bundle savedInstanceState) {
super(savedInstanceState);
setContentView(R.layout.activity_helloworld);
TextView tvHelloWorld = (TextView)findViewById(R.id.tv_helloworld);
// 文字書き換えたりする
}
}