Skip to content

Instantly share code, notes, and snippets.

View absentm's full-sized avatar
🎯
Focusing

AbsentM absentm

🎯
Focusing
View GitHub Profile
# 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(".")
// nineGridGames.cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
const int MaxStep = 10000;
int AnswerIndex = 1;
struct Point
/**
* 转换图片成圆形
*
* @param bitmap
* 传入Bitmap对象
* @return
*/
public static Bitmap toRoundBitmap(Bitmap bitmap) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
@absentm
absentm / natural_sort.py
Created October 9, 2018 09:17
Natural sort of a string list
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)