convert mouse cursor image to left-handed (horizontally flip) using python

Recently I find that Windows mouse cursor is not very friently for left-handed people. Because it point from right to left. So I wonder if there is a way to change it to “left to right”. I searched the internet but havnen’t found one. Further search give me a message that the “cur” file format is a derivation of the “ico” format: https://en.wikipedia.org/wiki/ICO_(file_format) So I think if we can flip it programatically. ...

September 29, 2024

PyQt webbrowser become a virus

I’m trying to combine backend and frontend. I’ve created a frontend using PyQt webbrowser: from PySide2.QtCore import * from PySide2.QtWidgets import * from PySide2.QtGui import * from PySide2.QtWebEngineWidgets import * import sys class MainWindow(QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.browser = QWebEngineView() self.browser.setBaseSize(800, 600) self.browser.setUrl(QUrl("http://127.0.0.1:8000/")) self.setCentralWidget(self.browser) self.show() def gui_main(): app = QApplication(sys.argv) window = MainWindow() app.exec_() if __name__ == "__main__": gui_main() The backend is using fastapi: from typing import Union from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} def backend(): import uvicorn uvicorn.run(app) So far, everything is good. I can launch backend and start debugging: uvicorn backend:app ...

April 28, 2024

change back iso file's default open program in Windows 7

I change an iso file default open program to C:\Windows\explorer.exe , and I can’t change it back. (Try this in virtual machine, not real computer.) How to change it? My OS is Windows 7. Tried this, but after I change it, the .iso extension disappears from the list. https://stackoverflow.com/questions/14543602/how-to-change-default-program-open-rar-file-which-select-open-file-by-explorer I tried the registry, change Windows.IsoFile entry’s shell->open value, and rebooted, but it didn’t work, too https://www.itechtics.com/set-default-apps/ I deleted the UserChoice subitem of .iso in ...

May 23, 2023

找到方向

体验过C++、java,才发现python真好用。决定用python混饭吃了。 不过找不着得到工作呢…

March 28, 2022

编译Qt

编译Qt 通过 Qt Maintaince Tool 下载源码。 设置编译器环境: Push-Location "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build" cmd /c "vcvars64.bat & set" | ForEach-Object { if ($_ -match "=") { $v = $_.split("=", 2); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" } } Pop-Location Write-Host -ForegroundColor Green "Visual Studio 2022 Command Prompt variables set." configure: 为了兼容Win7,要设置no-feature-d3d12. # static ..\configure.bat -prefix C:\Qt\5.12.12\msvc2022-static -release -confirm-license -opensource -nomake examples -nomake tests -nomake tools -static -static-runtime -opengl dynamic -angle -combined-angle-lib -no-feature-d3d12 # dynamic ..\configure.bat -prefix C:\Qt\5.12.12\msvc2022-dynamic\ -debug-and-release -confirm-license -opensource -nomake examples -nomake tests -nomake tools -shared -opengl dynamic -angle -combined-angle-lib -no-feature-d3d12 编译 & 安装: $Env:CL="/MP" nmake nmake install

December 21, 2021

Visual Sudio 2022发布啦

微软总是把握软件开发的最前沿方向. 看来ML.NET需要学一学了. 希望能够改变我对机器学习的看法. 15/10/2024 更新 微软还是不行。Just a machine. C++已经过气了。

November 11, 2021

新电脑配置

公司发了工作电脑,是笔记本ThinkBook 14 Gen2 ITL。有16GB运存和512G存储。由于我已经有了一个用来工作的笔记本,这个笔记本就被我拿到宿舍自己用了。小巧方便。 系统更新 联网激活系统后,首先下载更新。更新到了Windows 11. 安装软件 主要有V2ray、Chrome、Windows Terminal、VSCode、Telegram Desktop. 我还安装了VirtualBox用来运行虚拟机。 对了,还有Git for Windows。 虚拟机设置 安装系统后,添加网卡,设置固定IP,然后启用ssh。 通过ssh连接后,升级系统,安装常用软件。 安装cockpit sudo dnf install cockpit sudo systemctl enable --now cockpit.socket sudo firewall-cmd --add-service=cockpit sudo firewall-cmd --add-service=cockpit --permanent web控制台在9090端口。 Windows Terminal设置 更改默认配色为One Half Dark,下载Recursive Font, 更改字体为Rec Mono Linear. 设置默认字号为14,窗口大小为80*24,光标为实心框。 设置Ctrl+D退出(参考): Set-PSReadlineKeyHandler -Key ctrl+d -Function ViExit 卸载软件 卸载联想电脑管家。

October 29, 2021

toybrick板子折腾笔记

在公司拿到了一个测试用的板子,tb96-ai + rk3399pro. [toybrick@toybrick]~% cat /proc/device-tree/compatible rockchip,rk3399pro-toybrick-96ai-linuxrockchip,rk3399pro 系统是fedora28. 设置ssh 连入键盘和鼠标, 编辑/etc/ssh/sshd_config, 将 #Port 22 取消注释, 然后 sudo systemctl enable sshd 设置不启动GUI 为了减少CPU占用嘛. systemctl set-default multi-user.target 要恢复的话 systemctl set-default graphical.target 设置shell自动登录 系统在登录后才会连接wifi,不知道为啥。 设置shell自动登录:参考stackchange 编辑/etc/systemd/logind.conf, 将#NAutoVTs=6改为NAutoVTs=2. 然后运行 systemctl edit getty@tty1 , 输入 [Service] ExecStart= ExecStart=-/sbin/agetty --autologin toybrick --noclear %I 38400 linux 启用getty@tty1.service: systemctl enable getty@tty1.service 然后重启. mirror设置 配置文件在/etc/yum.repos.d. 文件参考github. 编辑/etc/dnf/dnf.conf, 在最后加入fastestmirror=1. 软件升级 升级系统: fedora wiki。 只支持跨两个版本,所以我升级到了fedora 30. (不知道会不会break原本的驱动和库 当时存储还不够(16G存储), 我删掉了~/.cache, python package, qtcreator才升级完成. 首先刷新一下: ...

October 28, 2021

尝试d3js

最近试了一下d3js,感觉挺不错的。 官方网站:D3.js - Data-Driven Documents 教程(在Observable)上:Learn D3: Introduction Observerable真是个不错的网站,感觉比jupyter notebook都好用。 See the Pen d3-dots by SodaCris (@sodacris) on CodePen.

October 17, 2021

没钱了

交了房租,现在所有卡里加起来不到40块钱,对了,加上我私藏的50块,只有不到100块钱。只能花花呗了。 为什么会没钱呢,当然是因为我没工作。上一份工作辞职后就一直混到现在。 找了一份新的工作,目前还没入职。公司看起来又破又小,我也不是很积极。当然了,只有这种公司才会招我吧。 想要研究新的技术,可是朋友们都被互联网所阻隔,看不到我看到的世界。那么,为什么不找一些新的朋友呢。 有朋友,才不孤单。 现在啥证书也没有,应该是能进去的吧,毕竟公司很缺人。然而一切总是偏离我的想象。通勤要2个小时;是有宿舍,但是由于我没打疫苗,所以不能住进去。 工作内容是铁路视频监控系统。然而我还是一无所知。不过一切都会好起来的。 update 11-22-2024 Modern life comes with freedom and loniless. Alert for internet-inspired people. Education enpower oneself.

October 17, 2021