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
formatNumber = function( value ) { | |
value = value.toString(); | |
if ( value.length <= 3 ) { | |
return value; | |
} else { | |
return formatNumber( value.substr( 0, value.length - 3 ) ) + ',' + value.substr( value.length - 3 ); | |
} | |
} |
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
MethodInfo method = typeof(string).GetMethod("StartsWith", new[] { typeof(string) }); | |
var target = Expression.Parameter(typeof (string), "x"); | |
var methodArg = Expression.Parameter(typeof (string), "y"); | |
Expression[] methodArgs = new[] { methodArg }; | |
Expression call = Expression.Call(target, method, methodArgs); | |
var lambdaParameters = new[] {target, methodArg}; |
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
~function( window ) { | |
var objExtend = function( tObj, sObj ) { | |
for ( var i in sObj ) { | |
if ( typeof sObj[ i ] !== "object" ) { | |
tObj[ i ] = sObj[ i ]; | |
} else if ( sObj[ i ].constructor == Array ) { | |
tObj[ i ] = Object.clone( sObj[ i ] ); |
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
# -*- coding: utf-8 -*- | |
import webbrowser | |
def Init(): | |
urlTxt = open('url.txt', 'r') | |
content = urlTxt.readlines() | |
print u'\n\n当前所保存的URL,共有 ' + str(len([i for i in content if i != '\n'])) + u'个:' | |
print '###############################' | |
for url in content: | |
if url != '\n': |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
function StringBuilder(str) { | |
this.tmp = new Array(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
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
static void Main(string[] args) | |
{ | |
DisplayAsync(); | |
Console.Write("1"); | |
} | |
public static Task<int> GetTaskAsync() | |
{ | |
return Task.Run(() => | |
{ |
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 getNewArrayByMoveElement = function( array, insertIndex, predicate ) { | |
var tmpDeepCopyArray; | |
try { | |
tmpDeepCopyArray = array.slice( 0 ); | |
var tmpIndex = _.findLastIndex( tmpDeepCopyArray, predicate ); | |
var removedElements = tmpDeepCopyArray.splice( tmpIndex, 1 ); | |
if ( removedElements.length > 0 ) { | |
tmpDeepCopyArray.splice( insertIndex, 0, removedElements[ 0 ] ); | |
} | |
} catch ( e ) { |
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
using System; | |
using System. Collections.Generic ; | |
using System. Linq; | |
using System. Text; | |
using System. Threading; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ |