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
//通过key去重 | |
Map<String, OrderItem> orderItemMap = orderItemList.stream() | |
.collect(Collectors.toMap(item -> item.getSkuId() + "_" + item.getDeliveryDate() + "_" + item.getWarehouseId(), item -> item, (a, b) -> a)); | |
orderItemList = orderItemMap.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); |
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
//点击form 中的label让其后的输入项获取焦点 | |
$("div.form-group label").each(function () { | |
$(this).click(function () { | |
$(this).next().focus(); | |
}); | |
}); | |
//选中value为1的option | |
$("#select_id_warehouseId option").eq(1).attr('selected', 'true'); |
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
$.ajax({ | |
url: "../routeProgressReport/dataItem", //请求的url地址 | |
type: "POST", //请求方式 | |
data: {warehouseId: warehouseId}, //参数值为@RequestBody或@RequestParam | |
dataType: "json", //返回格式为json | |
beforeSend: function () { | |
//请求前的处理 | |
}, | |
success: function (data) { | |
// |
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/bash | |
# Sync Homebrew installations between Macs via Dropbox | |
# | |
BREW="/usr/local/bin/brew" | |
# first get local settings | |
echo "Reading local settings ..." | |
rm -f /tmp/brew-sync.* |
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
\w+Activity\w* XXXActivity或XXXActivtyXXX | |
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
//希望返回:[1A, 2B, 3A]。但实际返回[1A, 2B, 3B]。怎么搞? | |
public Observable<List<String>> test_onErrorResumeNext() { | |
final List<Integer> codeList = new ArrayList<>(); | |
for (int i = 1; i <= 3; i++) { | |
codeList.add(i); | |
} | |
return Observable.create(new Observable.OnSubscribe<String>() { | |
@Override | |
public void call(Subscriber<? super String> subscriber) { |
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 class MyData{ | |
public int code; | |
public String name; | |
public MyData(int code, String name) { | |
this.code = code; | |
this.name = name; | |
} |
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
/** | |
* entity可用性常规则检查 | |
*/ | |
@SuppressWarnings("unchecked") | |
public static <T> Observable.Transformer<BaseEntity<T>, T> check() { | |
return new Observable.Transformer<BaseEntity<T>, T>() { | |
@Override | |
public Observable<T> call(Observable<BaseEntity<T>> observable) { | |
return observable.flatMap(new Func1<BaseEntity<T>, Observable<T>>() { | |
@Override |
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
/** | |
* 显示并隐藏loading | |
*/ | |
@SuppressWarnings("unchecked") | |
public static <T> Observable.Transformer<T, T> showLoading(final ILoading loading) { | |
return new Observable.Transformer<T, T>() { | |
@Override | |
public Observable<T> call(Observable<T> observable) { | |
return observable | |
.doOnSubscribe(new Action0() { |
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
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
android { | |
dataBinding { | |
enabled true | |
} | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
buildToolsVersion rootProject.ext.buildToolsVersion |
NewerOlder