/*
序列化要发送的数据
@param  {Object} _data 数据对象
@param  {String} _sep  数据分隔符
@return {String}       数据字符串
482492
function(_data,_sep){
        if (!_data) return null;
        var _arr = [],
            _and = _sep=='&';
        _u._$forIn(
            _data,function(v,k){
                _arr.push(
                    !_and ? (k+'='+v) :
                    (encodeURIComponent(k)+'='+encodeURIComponent(v))
                );
            }
        );
        return _arr.join(_sep||'\n');
    }
212875
public static function decodeObject(String $data, String $key = NULL, String $separator = NULL) : stdClass
    {
        return self::decode($data, $key, $separator);
    }
504943
function toCSVString(data, params) {
    if (data.length === 0) {
      return '';
    }
    params = params || {};

    var header = params.headers || [],
        plainObject = isPlainObject(data[0]),
        keys = plainObject && (params.order || keysIndex(data)),
        oData,
        i;

    // Defaults
    var escape = params.escape || '"',
        delimiter = params.delimiter || ',';

    // Dealing with headers polymorphism
    if (!header.length)
      if (plainObject && params.headers !== false)
        header = keys;

    // Should we append headers
    oData = (header.length ? [header] : []).concat(
      plainObject ?
        data.map(function(e) { return objectToArray(e, keys); }) :
        data
    );

    // Converting to string
    return oData.map(function(row) {
      return row.map(function(item) {

        // Wrapping escaping characters
        var i = ('' + (typeof item === 'undefined' ? '' : item)).replace(
          new RegExp(rescape(escape), 'g'),
          escape + escape
        );

        // Escaping if needed
        return ~i.indexOf(delimiter) || ~i.indexOf(escape) || ~i.indexOf('\n') ?
          escape + i + escape :
          i;
      }).join(delimiter);
    }).join('\n');
  }
1250668
def sepBy(p, sep):
    ''''''
    return separated(p, sep, 0, maxt=float('inf'), end=False)
1027881
function filterData(str, data) {
  data = data || [];
  var ctx = String(str || '').trim();
  var slashParts = ctx.split('/');
  ctx = slashParts.pop();
  var wordParts = String(ctx).trim().split(' ');
  var res = data.filter(function (item) {
    return (strip(item).slice(0, ctx.length) === ctx);
  });
  res = res.map(function (item) {
    var parts = String(item).trim().split(' ');
    if (parts.length > 1) {
      parts = parts.slice(wordParts.length);
      return parts.join(' ');
    }
    return item;
  });
  return res;
}
1195460
function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true)
    {
        $ret = array();
    
        foreach ( (array) $data as $k => $v )
        {
            if ( $urlencode)
                $k = urlencode($k);
            if ( is_int($k) && $prefix != null )
                $k = $prefix.$k;
            if ( !empty($key) )
                $k = $key . '%5B' . $k . '%5D';
            if ( $v === NULL )
                continue;
            elseif ( $v === FALSE )
                $v = '0';
    
            if ( is_array($v) || is_object($v) )
                array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode));
            elseif ( $urlencode )
                array_push($ret, $k.'='.urlencode($v));
            else
                array_push($ret, $k.'='.$v);
        }
    
        if ( NULL === $sep )
            $sep = ini_get('arg_separator.output');
    
        return implode($sep, $ret);
    }
1163298
function(data) {

		return data instanceof Object && (
		(this.domInstance('input', data) && data.type === 'file') ||
		('FileList' in window && data instanceof window.FileList) ||
		('File' in window && data instanceof window.File) ||
		('Blob' in window && data instanceof window.Blob));

	}
122597
function split(separator, data, limit) {
	var data = ""+data,
	    results = data.split(separator);
	if(!limit) return results;
	if(results.length <= limit) return results;
	var separators = data.match(new RegExp(separator.source, "g"));
	results[limit-1] = join(results.slice(limit-1), separators.slice(limit-1));
	results.length = limit;
	return results;
}
1061144
function strRepeat(str, n, sep) {
  if(!n) {
    return str;
  }
  return str + sep + strRepeat(str, --n, sep);
}
286012
def paren_split(sep,string):
    
    if len(sep) != 1: raise Exception("Separation string must be one character long")
    retlist = []
    level = 0
    blevel = 0
    left = 0
    for i in range(len(string)):
        if string[i] == "(": level += 1
        elif string[i] == ")": level -= 1
        elif string[i] == "[": blevel += 1
        elif string[i] == "]": blevel -= 1
        elif string[i] == sep and level == 0 and blevel == 0:
            retlist.append(string[left:i])
            left = i+1
    retlist.append(string[left:])
    return retlist
787516
function (f) {
			var separator
				, temp = [];
			[ '/', '-', ' '].forEach(function(sep) {
				if (temp.length < 2) {
					separator = sep;
					temp = f.split(separator);
				}
			});
			return separator;				
		}
677713
function (sep) {
            var nonEncodedSep = [];
            for (var i = 0, len = sep.length; i < len; i++) {
                if (sep[i] == encodeURIComponent(sep[i])) {
                    nonEncodedSep.push(sep[i]);
                }
            }
            return nonEncodedSep;
        }
374475
public static String format(String[] d, String sep) {
    if(d == null) {
      return "null";
    }
    if(d.length == 0) {
      return "";
    }
    if(d.length == 1) {
      return d[0];
    }
    int len = sep.length() * (d.length - 1);
    for(String s : d) {
      len += s.length();
    }
    StringBuilder buffer = new StringBuilder(len)//
        .append(d[0]);
    for(int i = 1; i < d.length; i++) {
      buffer.append(sep).append(d[i]);
    }
    return buffer.toString();
  }
770903
function(data) {
            var paramArray = [],
                key, value;
        // TODO: use `object` module
            for (key in data) {
                value = data[key];
                key = ENCODE_URI_COMPONENT(key);
                paramArray.push((value === null) ? key : (key + '=' + ENCODE_URI_COMPONENT(value)));
            }
            console.log(NAME, '_toQueryString --> '+paramArray.join('&'));
            return paramArray.join('&');
        }
1237340
function parse(data) {
  if (Array.isArray(data)) {
    for (var i=0; i<data.length; i++) {
      data[i] = parse(data[i]);
    }
  } else {
    for (var key in data) {
      if (Array.isArray(data[key]) || typeof data[key] == 'object')
        data[key] = parse(data[key]);

      if (exports.dateKeys.indexOf(key) > -1)
        data[key] = parseISODate(data[key]);
    }
  }

  return data;
}
786514
function makeDateStr(date, sep) {
	if (sep === undefined) sep = true;

	var year = date.getUTCFullYear().toString(),
		month = padNum(date.getUTCMonth()+1),
		day = padNum(date.getUTCDate()),
		hours = padNum(date.getUTCHours()),
		minutes = padNum(date.getUTCMinutes()),
		seconds = padNum(date.getUTCSeconds());

	if (sep) {
		return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
	} else {
		return year + month + day + hours + minutes + seconds;
	}
}
1121604
public static String join(final String sep, final String... strs) {
        return join(sep, Arrays.asList(strs));
    }