I hereby claim:
- I am IanField90 on github.
- I am IanField90 (https://keybase.io/IanField90) on keybase.
- I have a public key whose fingerprint is 4840 AC58 BE03 D6DB 0C9A 22B4 CDF7 3AB9 750A 2C32
To claim this, I am signing this object:
<% | |
if @course == nil | |
@id = @programme.course_id | |
else | |
@id = @course.id | |
end | |
%> | |
<%= f.hidden_field :course_id, :value => @id %> |
this.filterTextWatcher = new TextWatcher() { | |
public void afterTextChanged(Editable s) { } | |
public void beforeTextChanged(CharSequence s, int start, int count, | |
int after) { } | |
public void onTextChanged(CharSequence s, int start, int before, int count) { | |
adapter.getFilter().filter(s); | |
} |
int pxDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 80, getResources().getDisplayMetrics()); | |
int pxDp = (int) (getResources().getDisplayMetrics().density * px + 0.5f); |
I hereby claim:
To claim this, I am signing this object:
public class MyActivity extends Activity { | |
private TextView mTextView; | |
private ImageView mLogo; | |
private ImageView mStars; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_my); |
// Generate a version string based on git | |
def computeVersionName = { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'describe', '--tags' // or commandLine 'git', 'rev-parse', 'HEAD' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} |
// DO | |
if(cursor.moveToFirst()) { | |
do { | |
// do stuff with the cursor | |
} while (cursor.moveToNext()); | |
} | |
cursor.close(); | |
// DON'T | |
while (cursor.moveToNext()) { |
public static String getJSONFromBundle(Bundle bundle) { | |
if (bundle == null || Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { | |
return null; | |
} | |
JSONObject json = new JSONObject(); | |
Set<String> keys = bundle.keySet(); | |
for (String key : keys) { | |
try { | |
// json.put(key, bundle.get(key)); see edit below | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
runner: | |
extensions: | |
spec: | |
coffee: "mocha" | |
scopes: | |
coffee: "coffee" | |
go: "go run" | |
js: "node" | |
python: "python" | |
ruby: "ruby" |