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
void Main() | |
{ | |
IRecord record = new Record1(); | |
Console.WriteLine (record.Get<int>("aaa")); | |
} | |
public interface IRecord { | |
string GetString(string field); | |
int GetInt(string field); | |
long GetLong(string field); |
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
async.waterfall([ | |
function (cb) { | |
app.service.pay(this.data, { | |
headers: { | |
"Session-Id": app.sessionId | |
}, | |
success: function (data, textStatus, jqXHR) { | |
console.log('pay resp textStatus:' + textStatus); | |
console.log('pay resp data', data); | |
cb(null, 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
var gulp = require('gulp'); | |
var shell = require('gulp-shell'); | |
var preprocess = require('gulp-preprocess'); | |
var template = require('gulp-template'); | |
var os = require('os'); | |
var _ = require('underscore'); | |
//var replace = require('gulp-replace'); | |
//var inject = require('gulp-inject'); | |
gulp.task('redis', shell.task('redis-server > /dev/null &')) |
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
# old version is 3.3.2, update to 3.3.4 | |
bower update bootstrap --save |
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 class Order { | |
public int orderId; | |
} | |
public static class OrderService { | |
private static Order[] s_orders = new Order[3]; | |
public static Response findOrder(final int orderId) { | |
Response resp = new Response(); |
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 class Foo | |
{ | |
public virtual IEnumerable<Product> Page(IEnumerable<Product> list, Model.Pager pager) | |
{ | |
IEnumerable<Product> b; | |
if (pager == null) | |
{ | |
throw new ArgumentNullException("pager"); | |
} | |
var q = list as IQueryable<Product>; |
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
/// <summary> | |
/// http://stackoverflow.com/questions/2787506/cast-string-to-enum-with-enum-attribute | |
/// todo: http://www.cnblogs.com/smalldust/archive/2006/04/25/384657.html 利用缓存优化 | |
/// </summary> | |
/// <param name="value"></param> | |
/// <returns></returns> | |
public static string GetDescription(this Enum value) | |
{ | |
if (value == null) | |
{ |
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
/* construct */ | |
function Controller() { | |
this.viewModel = new ViewModel(); | |
} | |
/* public methods */ | |
Controller.prototype.index = function () { | |
var controller = this; | |
controller._bindEventList(); | |
}; |
OlderNewer