Skip to content

Instantly share code, notes, and snippets.

AbsentM absentm

Block or report user

Report or block absentm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@absentm
absentm / natural_sort.py
Created Oct 9, 2018
Natural sort of a string list
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(".")
You can’t perform that action at this time.