Why? @sstephenson explains it best here.
This should get rid of the rvm dir and any installed rubies:
$ rvm implode
This should get rid of the rvm dir and any installed rubies:
$ rvm implode
| /** | |
| * The pseudo-element 'content' property doesnt accept normal (») style | |
| * HTML entities. These variables below easy the pain of looking up the HEX codes... | |
| * | |
| * Referenced from http://www.danshort.com/HTMLentities/ | |
| * | |
| * TODO: Add all the other entities? Worth it? Some day? Maybe? | |
| */ | |
| // Punctuation |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.
Set an OnClickListener in your ViewHolder creation:
private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
public static class ViewHolder extends RecyclerView.ViewHolder| When a user interacts with a UI element the various listeners are called in a top down order. (For example: OnTouch -> OnFocusChange -> OnClick.) If a listener has been defined (with setOn...Listener) and it consumes this event: the lower priority listeners will not be called. By its nature the first time you touch an EditText it receives focus with OnFocusChangeListener so that the user can type. The action is consumed here therefor OnClick is not called. Each successive touch doesn't change the focus so the event trickles down to the OnClickListener. | |
| Basically, you have three choices: | |
| Set the focusable attribute to false in your XML: | |
| android:focusable="false" | |
| Now the OnClickListener will fire every time it is clicked. But this makes the EditText useless since the user can no longer enter any text... | |
| Implement an OnFocusChangeListener along with the OnClickListener: |
| package org.cnii.layoutloader.ui; | |
| import android.content.Context; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| /** | |
| * Special thanks to Daniel López Lacalle for his response | |
| * (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791) |
| #!/bin/sh | |
| set -e | |
| set -x | |
| for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) | |
| do | |
| npm -g install "$package" | |
| done |
In React's terminology, there are five core types that are important to distinguish:
React Elements
| ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image); | |
| Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose); | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ | |
| //Default | |
| imageView.setBackgroundResource(R.drawable.rose); | |
| } else { | |
| //RoundCorners | |
| RoundCornersDrawable round = new RoundCornersDrawable(mBitmap, | |
| getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius |
return keyword. Don't add semicolons except where syntactically demanded in statements or to separate statements on the same line.var when let is appropriate, especially for properties. The compiler better optimizes let statements for items whose values will not change during their lifetime. For example, Apple writes, "It is good practice to create immutable collections in all cases where the collection does not need to change. Doing so enables the Swift compiler to optimize the performance of the collections you create."