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
/* | |
** numbers | |
** 1 | |
** 121 | |
** 12321 | |
** 121 | |
** 1 | |
*/ | |
#include <iostream> |
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
#man: | |
# ./workspace.sh [horizontal size] [vertical size] | |
if [ "$1" -gt "0" ]; then | |
if [ "$1" -le "10" ]; then | |
dconf write /org/compiz/profiles/unity/plugins/core/hsize $1 | |
fi | |
fi | |
if [ "$2" -gt "0" ]; then | |
if [ "$2" -le "10" ]; then |
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
@Override | |
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { | |
RecyclerView.ViewHolder viewHolder; | |
LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext()); | |
switch (viewType) { | |
case USER: | |
View v1 = inflater.inflate(R.layout.layout_viewholder1, viewGroup, false); | |
viewHolder = new ViewHolder1(v1); |
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
@BindItem(layout = R.layout.layout, holder = TextHolder.class) | |
public class TextItem { | |
@Binder | |
public void bind(TextHolder textHolder) { | |
} | |
} |
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
GhostAdapter ghostAdapter = new GhostAdapter(); | |
recycler.setAdapter(ghostAdapter); |
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
ghostAdapter.addItem(new TextItem()); |
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 <T> T using(Class<T> aClass) { | |
if (!aClass.isInterface()) { | |
throw new IllegalArgumentException("API declarations must be interfaces."); | |
} | |
if (repository == null) { | |
repository = new NetworkRepo(); | |
} | |
return repository.getRetrofit().create(aClass); |
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 <T> Observable<T> schedule(Observable<T> observable) { | |
return observable | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()); | |
} |