类似地图,可以显示无限大的图片
语言文件生成工具lang_xls2multi
翻译人员只会玩excel,几个平台的开发同学WEB、Android、IOS的语言文件都不一样。
所以我写了这个工具,翻译人员写完excel,转换一下,自动生成3个平台需要的语言文件。这下,大家都省事啦
项目链接:http://joson.cc:8102/joson/lang_xls2multi
软件类型:windows桌面应用
编译须知:
1,需要.net4.8及以上
2,最后使用的是VS2022编译
3,仅支持中文、英文、繁体3种语言
4,需要下载 多语言模板,严格按格式填写语言文件

nodejs笔记
#查看当前镜像 npm config get registry #淘宝镜像 npm config set registry https://registry.npm.taobao.org #原镜像 npm config set registry https://registry.npmjs.org #清理 npm cache clean --force #使用cnpm npm install cnpm -g --registry=https://registry.npmmirror.com #windows禁止运行cnpm脚本解决 set-ExecutionPolicy RemoteSigned
vue+electron
npm create @quick-start/electron npm install npm run dev #安装vite npm install electron-vite --save-dev
基于阿里云的DDNS Docker
100块钱都不给你~!!!!
什么花生壳之类的,上官网一看价格,要100多块钱一年。自己跑阿里云注册个.cc域名,一年才30元。。太坑了。。一查,正好阿里开放做得不错,那就自己干了。
项目地址: http://joson.cc:8102/joson/aliyun_ddns
也可在以上地址的release直接下载docker发行tar。load一下就能用
城市智慧停车方案
艺象文创微物联方案(区块链版)
唯视芯科AI公司创立案
MyHome分布式家庭算力平台设计案
C++实现的RMM分词
#include <map>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include "tools.h"
using namespace std;
#ifndef PARTH
#define PARTH
#define _ARRAY_COUNT_(x) sizeof(x)/sizeof(*x)
#define _WPRINTF_(c) setlocale(LC_ALL,"chs"); wprintf( c ); cout << endl;
#define _WVECTOR_ vector<wstring>
void CreateVectorForArray(const wstring *arr, const int arr_len, vector<wstring> &vec);
void StrReplace(wstring &str, const wstring find, const wstring replace);
#define _WCreateVectorForArray_(src,target) CreateVectorForArray(src,_ARRAY_COUNT_(src),target);
#define _WInVectory(str, vec) WInVectory(str,vec)
void CreateVectorForArray(const wstring *arr, const int arr_len, vector<wstring> &vec){
vector<wstring> _tmp( arr, arr+arr_len );
vec.resize(arr_len);
copy(_tmp.begin(), _tmp.end(), vec.begin());
}
void StrReplace(wstring &str, const wstring find, const wstring replace){
string::size_type pos = 0;
while ( (pos = str.find(find, pos)) != wstring::npos ) {
str.replace( pos, find.size(), replace );
pos++;
}
}
typedef struct WordPartResultItem{
int count;
int startOffset;
int endOffset;
int sort;
float scale;
WordPartResultItem():count(0),startOffset(0),endOffset(0),scale(0),sort(0){};
} _WordPartResultItem;
typedef WordPartResultItem _WordPartResult;
class WordPart{
public:
WordPart( wstring word[], int word_len);
void SetContent( wstring content);
//分词时是否允许将每个单字分割词
bool is_single;
//执行分词
map<wstring,_WordPartResult> Part();
private:
//用于分词的词典
map<int,list<wstring>> words;
//词典总数
int words_length;
//将要分词的内容
wstring content;
//最大匹配词的长度
int max_length;
//忽略的字符
_WVECTOR_ trim_str;
//断句符号
_WVECTOR_ end_dot;
//获取最大匹配词的长度
int GetMaxLength(wstring *words);
void setResult( map<wstring,_WordPartResult> &result, int &sort, const wstring k, const int offset );
};
#endif;
WordPart::WordPart( wstring word[], int word_len){
//this->words = word;
this->words_length = word_len;
this->is_single = false;
max_length = GetMaxLength(word);
wstring trim_tmp[] = {L"\"",L"'",L"‘",L"’",L"“",L"”",L"\\",L"(",L")",L"(",L")"};
wstring end_tmp[] = {L".",L",",L"。",L",",L":",L":",L" "};
_WCreateVectorForArray_(trim_tmp,trim_str)
_WCreateVectorForArray_(end_tmp,end_dot)
//整理词典
for( int i=0; i<word_len; i++){
int k = word[i].size();
if( words.find(k) == words.end() ){
list<wstring> v;
words.insert( map<int,list<wstring>>::value_type(k,v) );
}
words[k].push_back(word[i]);
}
}
void WordPart::SetContent( wstring content){
_WVECTOR_::iterator iter;
for( iter=trim_str.begin(); iter!=trim_str.end(); iter++){
StrReplace(content,*iter,L" ");
}
this->content = content;
}
int WordPart::GetMaxLength(wstring *words){
int size = 0;
for( int i=0; i<words_length; i++ ){
if( words[i].length() > size )
size = words[i].length();
}
return size;
}
map<wstring,_WordPartResult> WordPart::Part(){
map<wstring,_WordPartResult> result;
if( content.empty() || words_length == 0 )
return result;
//如果要求切分单字
if( is_single ){
wstring cstr;
wstring eng;
int sort = 0;
for( int i=0; i<content.size(); i++ ){
cstr = content.substr(i,1);
if( (cstr < L"a" || cstr > L"z") && (cstr < L"A" || cstr > L"Z") && (cstr < L"0" || cstr > L"9") ){
if(!eng.empty()){
if( words.find(eng.size()) == words.end()
|| find( words[eng.size()].begin(), words[eng.size()].end(), eng ) == words[eng.size()].end() )
setResult(result,sort,eng,i-eng.size());
eng.clear();
}
if( words.find(1) == words.end()
|| find( words[1].begin(), words[1].end(), cstr ) == words[1].end() )
setResult(result,sort,cstr,i);
}else{
eng.append(cstr);
}
}
if(!eng.empty()){
if( words.find(eng.size()) == words.end()
|| find( words[eng.size()].begin(), words[eng.size()].end(), eng ) == words[eng.size()].end() )
setResult(result,sort,eng,content.size()-eng.size());
eng.clear();
}
}
_WVECTOR_ line;
wstring one_line = L"";
//段句
for( int i=0; i<content.size(); i++ ){
wstring str = content.substr( i, 1 );
if( find(end_dot.begin(),end_dot.end(),str) == end_dot.end() ){
one_line.append(str);
}else{
line.insert(line.begin(),one_line);
one_line.clear();
}
if( i==content.size() - 1 && !one_line.empty() ){
line.insert(line.begin(),one_line);
}
}
int content_size = content.size(), offset = content_size, sort = 0;
for(_WVECTOR_::iterator i=line.begin(); i != line.end(); i++){
offset -= (*(i)).size();
if( i != line.begin() ){
offset -= 1; //断句符号位置
}
//分词
wstring str = *i; //段内容
wstring cstr; //分段内容
int begin = 0,pointer; //游标,一个全局游标,和一个相对游标
int k; //词典键
int sublength = max_length; //每个查询字符的长度
if( str.size() > max_length ){
begin = str.size() - max_length;
}else{
sublength = str.size();
}
while (begin != -sublength)
{
pointer = 0;
while( pointer < sublength ){
if( begin >= 0 ){
cstr = str.substr( begin, sublength-pointer );
k = cstr.size();
if( words.find(k) != words.end() && find(words[k].begin(),words[k].end(),cstr)!=words[k].end() ){
setResult(result,sort,cstr,offset+begin);
break;
}
}
pointer++;
if( pointer < sublength )
begin++;
}
begin-=sublength;
}
}
return result;
}
void WordPart::setResult( map<wstring,_WordPartResult> &result, int &sort, const wstring k, const int offset ){
if( result.find(k) == result.end() ){
_WordPartResultItem row;
result.insert( map<wstring,_WordPartResult>::value_type(k,row) );
result[k].startOffset = offset;
result[k].sort = sort;
sort++;
}
result[k].count += 1;
result[k].endOffset = offset;
}
golang最小化镜像
# 基础镜像,基于golang的alpine镜像构建--编译阶段
FROM golang:alpine AS builder
# 作者
MAINTAINER joson
# 变量
# ARG <name>[=<default value>]
# 全局工作目录
WORKDIR /go/ddns
# 把运行Dockerfile文件的当前目录所有文件复制到目标目录
COPY . /go/ddns
# 环境变量
# 用于代理下载go项目依赖的包
ENV GOPROXY https://goproxy.cn,direct
# 编译,关闭CGO,防止编译后的文件有动态链接,而alpine镜像里有些c库没有,直接没有文件的错误
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
# 使用alpine这个轻量级镜像为基础镜像--运行阶段
FROM alpine AS runner
# 全局工作目录
WORKDIR /go/ddns
# 复制编译阶段编译出来的运行文件到目标目录
COPY --from=builder /go/ddns/aliyun_ddns .
# 复制编译阶段里的config文件夹到目标目录
COPY --from=builder /go/ddns/conf/aliyun-ddns.conf /go/ddns/conf/.
# 将时区设置为东八区
RUN echo "https://mirrors.aliyun.com/alpine/v3.8/main/" > /etc/apk/repositories \
&& echo "https://mirrors.aliyun.com/alpine/v3.8/community/" >> /etc/apk/repositories \
&& apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo Asia/Shanghai > /etc/timezone \
&& apk del tzdata
# 需暴露的端口
#EXPOSE 8888
# 可外挂的目录
VOLUME ["/go/ddns/conf"]
# docker run命令触发的真实命令(相当于直接运行编译后的可运行文件)
ENTRYPOINT ["./aliyun_ddns"]