This file contains hidden or 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
FragmentManager fm = getSupportFragmentManager(); | |
Class<FragmentStatePagerAdapter> viewPageAdpater = FragmentStatePagerAdapter.class; | |
try { | |
Field field = viewPageAdpater.getDeclaredField("mCurrentPrimaryItem"); | |
field.setAccessible(true); | |
Fragment value = (FgmMyGameCircleList) field.get(FragmentStatePagerAdapter(实例)); |
This file contains hidden or 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 class EventMain { | |
public static class Emitter { | |
private ConcurrentMap<String, ConcurrentLinkedQueue<Listener>> mCallbacks = new ConcurrentHashMap<String, ConcurrentLinkedQueue<Listener>>(); | |
private ConcurrentHashMap<Listener, Listener> mOnceCallback = new ConcurrentHashMap<Emitter.Listener, Emitter.Listener>(); | |
public Emitter on(String event, Listener fn) { |
This file contains hidden or 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
app.use('/fsck', function (req, res, next){ | |
console.log('fsck'); | |
res.header("How-Old-Are-You", "Iamfinethinkyou"); | |
next(); | |
}) | |
app.get('/fsck/fsck', function (res, res){ | |
console.log('fsck'); | |
res.send('ok') |
This file contains hidden or 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
var x = { | |
a : 1, | |
b : 2, | |
c : 3 | |
} | |
var y = { | |
b : 5 | |
} |
This file contains hidden or 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
var async = require('async'); | |
async.eachSeries(['2m内容'], function (item, callback) { | |
async.parallel([ | |
function (subcallback) { | |
//1 | |
}, | |
function (subcallback){ | |
//2 |
This file contains hidden or 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
console.log(undefined >= 0); // false | |
console.log(null === 0); // false | |
console.log(null == 0); // false | |
console.log(0 >= 0); // true | |
//坑来了.. 对了js只有恒等 只有 !==, === 可没有恒比较 >== 的写法. | |
// 直觉上 null >= 0 应该跟 null == 0 或者 undefined >= 0 的效果一样的啊..但是事实不是这样的.. | |
console.log(null >= 0); //true |
This file contains hidden or 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
( ̄(工) ̄) 凸ส้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้ |
This file contains hidden or 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
/** | |
* Created by youxiachai on 14-6-9. | |
*/ | |
var totalPoint = 0; | |
var action = '' | |
//rule |
This file contains hidden or 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
Array.prototype.mergeSort=function(){ | |
var merge=function(left,right){ | |
var final=[]; | |
while (left.length && right.length) { | |
final.push(left[0] <= right[0] ? left.shift() : right.shift() ); | |
} | |
return final.concat(left.concat(right)); | |
} | |
// 递归结束 | |
if (this.length < 2) { |
This file contains hidden or 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
var a = Array.apply(null, {length : 10}).map(function () { | |
return 'a' | |
}) | |
var b = new Array(10).join(',').split(',').map(function(){return 'b'}); |
NewerOlder