使用其他库存在计算不准确和部分压缩文件不支持问题。
安装 pdfinfo
sudo apt install poppler-utils # ubuntu debian
sudo dnf install poppler-utils # centos
安装PHP类
composer require "howtomakeaturn/pdfinfo"
计算代码
$pdf = new PDFInfo('path/to/the/pdf');
echo $pdf->pages;
使用其他库存在计算不准确和部分压缩文件不支持问题。
sudo apt install poppler-utils # ubuntu debian
sudo dnf install poppler-utils # centos
composer require "howtomakeaturn/pdfinfo"
$pdf = new PDFInfo('path/to/the/pdf');
echo $pdf->pages;
https://github.com/vbenjs/vue-vben-admin
Vue Vben Admin 是一个免费开源的中后台模版。使用了最新的vue3,vite2,TypeScript等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。
特性
https://github.com/jekip/naive-ui-admin
Naive Ui Admin 完全免费,且可商用,基于 Vue3.0、Vite、 Naive UI、TypeScript 的中后台解决方案,它使用了最新的前端技术栈,并提炼了典型的业务模型,页面,包括二次封装组件、动态菜单、权限校验、粒子化权限控制等功能,它可以帮助你快速搭建企业级中后台项目, 相信不管是从新技术使用还是其他方面,都能帮助到你。
特性
https://github.com/biubiubiu01/vue-antd-admin
vue-antd-admin基于vue-cli4+vuex+ant-design-vue开发的后台管理系统,包括权限管理,布局方式,国际化,动态路由和后台管理系统常用的table表和表单等功能,包含echarts图的各种展示,第一版已完成,有兴趣可以了解下。
之后可能不咋会更新了,准备写一个vue3+ts+vite了.
https://github.com/llyyayx/vue3-antd-admin
使用vue3+ant-design-vue+vite+ts开发的通用后台框架,实现了权限系统、动态菜单、表格集成快速使用等功能,简洁干净开箱即用。
https://github.com/chuzhixin/vue-admin-better
提供收费版本
plugins=(git composer npm pip pyenv virtualenv debian systemd python history-substring-search zsh-autosuggestions zsh-syntax-highlighting last-working-dir wd extract zoxide)
本文一步一步教你如何在小程序中使用最新版的OpenCV
安装基础工具
pacman -S base-devel cmake git
git clone https://github.com/juj/emsdk.git
cd emsdk
./emsdk install 2.0.10
./emsdk activate 2.0.10
source ./emsdk_env.sh
进入 https://opencv.org/releases/ 页面下载opencv最新版源码,并解压缩,并进入解压缩后文件夹
修改platforms/js/opencv_js.config.py
文件根据情况,去掉不用的模块
# white_list = makeWhiteList([core, imgproc, objdetect, video, dnn, features2d, photo, aruco, calib3d])
white_list = makeWhiteList([core, imgproc])
默认OpenCV4会将wasm以base64存到js文件,输出单独wasm文件便于用于微信小程序
打开modules/js/CMakeLists.txt
,去掉 SINGLE_FILE
参数
# set(EMSCRIPTEN_LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS} -s MODULARIZE=1 -s SINGLE_FILE=1")
set(EMSCRIPTEN_LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS} -s MODULARIZE=1")
微信小程序不支持eval()
和new Function()
等动态执行函数,在modules/js/CMakeLists.txt
中,增加DYNAMIC_EXECUTION
的编译参数屏蔽这些函数的输出
# set(EMSCRIPTEN_LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS} -s MODULARIZE=1 -s SINGLE_FILE=1")
set(EMSCRIPTEN_LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS} -s MODULARIZE=1")
set(EMSCRIPTEN_LINK_FLAGS "${EMSCRIPTEN_LINK_FLAGS} -s DYNAMIC_EXECUTION=0")
emcmake python ./platforms/js/build_js.py -h
emcmake python ./platforms/js/build_js.py build_wasm --build_wasm --build_test
build_wasm\bin
目录生成了opencv.js,opencv_js.wasm,tests.html文件
brotli -o build_wasm/bin/opencv_js.wasm.br build_wasm/bin/opencv_js.wasm
npm i -g http-server
http-server build_wasm/bin/
在浏览器打开 http://127.0.0.1:8080/tests.html
可以查看测试结果
opencv.js
适配微信小程序修改前先将opencv.js
格式化一下,微信小程序不支持通过url获取wasm,修改下instantiateAsync方法的else分支里面的代码,让读小程序项目下的opencv_js.wasm文件
function instantiateAsync() {
if (
!wasmBinary &&
typeof WebAssembly.instantiateStreaming === "function" &&
!isDataURI(wasmBinaryFile) &&
!isFileURI(wasmBinaryFile) &&
typeof fetch === "function"
) {
return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(
function (response) {
var result = WebAssembly.instantiateStreaming(response, info);
return result.then(
receiveInstantiatedSource,
function (reason) {
err("wasm streaming compile failed: " + reason);
err("falling back to ArrayBuffer instantiation");
return instantiateArrayBuffer(receiveInstantiatedSource);
}
);
}
);
} else {
// return instantiateArrayBuffer(receiveInstantiatedSource);
var result = WebAssembly.instantiate("/opencv/opencv_js.wasm.br", info);
return result.then(
receiveInstantiatedSource,
function (reason) {
err("wasm streaming compile failed: " + reason);
err("falling back to ArrayBuffer instantiation");
return instantiateArrayBuffer(receiveInstantiatedSource);
}
);
}
}
这些方法定义在modules\js\src\helpers.js
文件中,修改后重新编译和生成wasm文件即可
OpenCV.js
const app = getApp()
WebAssembly = WXWebAssembly;
let cv = require('../../opencv/opencv.js');
Page({
onLoad: function (options) {
if (cv instanceof Promise) {
cv.then((target) => {
console.log(target);
})
} else {
console.log(cv);
}
}
})
网上资料通常都通过命令行调用sc.exe进行,这里介绍一种通过微软提供API实现的方法。代码更加简单,可控性更好。
static void Main(string[] args)
{
if (args.Length == 0) {
// Run your service normally.
ServiceBase[] ServicesToRun = new ServiceBase[] {new YourService()};
ServiceBase.Run(ServicesToRun);
} else if (args.Length == 1) {
switch (args[0]) {
case "-install":
InstallService();
StartService();
break;
case "-uninstall":
StopService();
UninstallService();
break;
default:
throw new NotImplementedException();
}
}
}
public class ServiceControl
{
const string ServiceName = "MyService";
public static bool IsInstalled()
{
using (ServiceController controller =
new ServiceController(ServiceName))
{
try
{
ServiceControllerStatus status = controller.Status;
}
catch
{
return false;
}
return true;
}
}
public static bool IsRunning()
{
using (ServiceController controller =
new ServiceController(ServiceName))
{
if (!IsInstalled()) return false;
return (controller.Status == ServiceControllerStatus.Running);
}
}
public static AssemblyInstaller GetInstaller()
{
AssemblyInstaller installer = new AssemblyInstaller(
typeof(MyService).Assembly, null);
installer.UseNewContext = true;
return installer;
}
public static void InstallService()
{
if (IsInstalled()) return;
try
{
using (AssemblyInstaller installer = GetInstaller())
{
IDictionary state = new Hashtable();
try
{
installer.Install(state);
installer.Commit(state);
}
catch
{
try
{
installer.Rollback(state);
}
catch { }
throw;
}
}
}
catch
{
throw;
}
}
public static void UninstallService()
{
if (!IsInstalled()) return;
try
{
using (AssemblyInstaller installer = GetInstaller())
{
IDictionary state = new Hashtable();
try
{
installer.Uninstall(state);
}
catch
{
throw;
}
}
}
catch
{
throw;
}
}
public static void StartService()
{
if (!IsInstalled()) return;
using (ServiceController controller =
new ServiceController(ServiceName))
{
try
{
if (controller.Status != ServiceControllerStatus.Running)
{
controller.Start();
controller.WaitForStatus(ServiceControllerStatus.Running,
TimeSpan.FromSeconds(10));
}
}
catch
{
throw;
}
}
}
public static void StopService()
{
if (!IsInstalled()) return;
using (ServiceController controller =
new ServiceController(ServiceName))
{
try
{
if (controller.Status != ServiceControllerStatus.Stopped)
{
controller.Stop();
controller.WaitForStatus(ServiceControllerStatus.Stopped,
TimeSpan.FromSeconds(10));
}
}
catch
{
throw;
}
}
}
}
建立了一个"独立项目交流群",本群主要交流开源项目的运作模式和盈利模式。
大家可以在名字前面加地区,以及熟悉的技能,如“长沙-全栈-ning”,名字建议用昵称。
目前还没有项目启动,大家可以想一想,可以先分享一些开源或者商业案例,慢慢形成讨论氛围。
注意:
微信扫码进群
php -v
输出
PHP 7.4.14 (cli) (built: Jan 5 2021 15:11:43) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
可以看到PHP版本为7.4,NTS(非线程安全),64位
php_imagick.dll
放入PHP目录下的ext子目录下extension=imagick
知乎高分答案是让大家去重装小冰,通常可能是解决不了问题的。
因为情况实际可能是本地应用是以当前用户身份安装的,安装在用户的appdata目录下,然后Windows索引默认排除了用户的appdata目录,所以就搜索不到了。
解决办法:
sudo apt install libbz2-dev libcurses-ocaml-dev libctypes-ocaml-dev libreadline-dev libssl-ocaml-dev libffi-dev libsqlite3-dev liblzma-dev
curl https://pyenv.run | bash
pyenv install --list
export PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1
export PYTHON_BUILD_MIRROR_URL="https://npm.taobao.org/mirrors/python/"
pyenv install 3.9.9
pyenv global 3.9.9
pyenv versions
pyenv prefix 3.9.9
管理员身份进入powershell
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
将C:\Users\Administrator\.pyenv\pyenv-win\.versions_cache.xml
中的所有www.python.org/ftp
替换为npmmirror.com/mirrors
安装完以后重新管理员打开powershell
pyenv install 3.10.5
在隔离的环境中安装和运行Python应用程序,安装的程序都在自己隔离的环境,不用考虑依赖冲突,且可以安装多个版本,可以非root身份运行程序。官网:https://github.com/pypa/pipx
python3 -m pip install --user pipx
pipx completions
pipx install pipenv
pipx install git+https://github.com/psf/black.git
pipx install git+https://github.com/psf/black.git@branch # branch of your choice
pipx install git+https://github.com/psf/black.git@ce14fa8b497bae2b50ec48b3bd7022573a59cdb1 # git hash
pipx install https://github.com/psf/black/archive/18.9b0.zip # install a release
pipx list
pipx upgrade pipenv
pipx run pipenv
pipx run APP==1.0.0
pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0f/raw/6bdfbb6e9c1132b1c38fdd2f195d4a24c540c324/pipx-demo.py
pipx uninstall pipenv
pipx uninstall-all
pipx -h