View natural_sort.py
import re | |
def natural_sort(l): | |
convert = lambda text: int(text) if text.isdigit() else text.lower() | |
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] | |
return sorted(l, key = alphanum_key) | |
# use | |
natural_sort(ll) |
View android.java
/** | |
* 转换图片成圆形 | |
* | |
* @param bitmap | |
* 传入Bitmap对象 | |
* @return | |
*/ | |
public static Bitmap toRoundBitmap(Bitmap bitmap) { | |
int width = bitmap.getWidth(); | |
int height = bitmap.getHeight(); |
View cpp_code_block
// nineGridGames.cpp | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
const int MaxStep = 10000; | |
int AnswerIndex = 1; | |
struct Point |
View fileRenameByCatalogs.py
# coding: utf-8 | |
import os | |
import shutil | |
import sys | |
# get the filename without extra extend name | |
def getImageFilePre(filename): | |
if filename.endswith(".png"): | |
temp = filename.split(".") |