2025年2月6日星期四
pytorch
使用python -m venv生成的虚拟环境,文件目录出错
windows中,
通过 python -m venv生成的虚拟环境,
在dos窗口中,通过activate.bat激活虚拟环境,
执行虚拟环境scripts目录中的python.exe,
实际执行的却是C:\Users\username\AppData\Local\Programs\Python\中的python
这可能是pytorch的DataLoader,当num_workers大于0时,出错的原因。
2025年2月5日星期三
2025年1月22日星期三
2025年1月19日星期日
2025年1月16日星期四
2025年1月15日星期三
python 环境变量
what-exactly-should-be-set-in-pythonpath
- PYTHONHOME
Change the location of the standard Python libraries. By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.
When PYTHONHOME is set to a single directory, its value replaces both prefix and exec_prefix. To specify different values for these, set PYTHONHOME to prefix:exec_prefix.
- PYTHONPATH
Augment the default search path for module files. The format is the same as the shell’s PATH: one or more directory pathnames separated by os.pathsep (e.g. colons on Unix or semicolons on Windows). Non-existent directories are silently ignored.
In addition to normal directories, individual PYTHONPATH entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles.
The default search path is installation dependent, but generally begins with prefix/lib/pythonversion (see PYTHONHOME above). It is always appended to PYTHONPATH.
An additional directory will be inserted in the search path in front of PYTHONPATH as described above under Interface options. The search path can be manipulated from within a Python program as the variable sys.path.
pyqgis
1 开发环境配置
- quick-guide-to-getting-started-with-pyqgis-3-on-windows 经测试,可用
- setting-up-pyqgis3-with-vscode-python3-on-windows 经测试,不可用
2 教程
- OSGeo4W Shell -----> C:\OSGeo4W\OSGeo4W.bat
- GRASS GIS 8.3.2------> C:\OSGeo4W\bin\grass83.bat --gui
- QGIS Desktop 3.36.3 ------> C:\OSGeo4W\bin\qgis-bin.exe
- Qt Designer with QGIS 3.36.3 custom widgets ----> C:\OSGeo4W\bin\bgspawn.exe "C:\OSGeo4W\bin\qgis-designer.bat"
- Setup ----> C:\OSGeo4W\bin\bgspawn.exe "C:\OSGeo4W\bin\setup.bat"
- SAGA GIS 9.3.1 ----> C:\OSGeo4W\bin\bgspawn.exe "C:\OSGeo4W\bin\saga_gui.bat"
2025年1月14日星期二
2025年1月13日星期一
2025年1月12日星期日
youtube
- https://github.com/yt-dlp/yt-dlp
- yt-dlp: how-do-i-pass-cookies-to-yt-dlp
- https://github.com/yt-dlp/yt-dlp/issues/7271
- https://github.com/ytdl-org/youtube-dl/issues/33006
- https://github.com/yt-dlp/yt-dlp/issues/10927
- https://github.com/yt-dlp/yt-dlp#network-options
- Get cookies.txt LOCALLY
- C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\Network
- yt-dlp.exe --proxy socks5://127.0.0.1:10808/ --cookies www.youtube.com_cookies.txt https://youtu.be/xxxxxxxxxxxxx
qgis Virtual layers
- virtual layer
- adding-a-virtual-layer-leads-to-slow-perfomance-and-crashes-in-qgis-3-36-1
- qgis-virtual-layers-and-slow-performance
- creating-virtual-layers
- 慢的无法使用
C#
1、SDK
2、.NET Interactive
3、Using .NET Interactive as a Jupyter kernel
- NotebookswithJupyter
- 命令:dotnet tool install -g Microsoft.dotnet-interactive
- 命令:dotnet-interactive
- 在conda 环境中,命令:dotnet interactive jupyter install
- 更新命令:dotnet tool update -g Microsoft.dotnet-interactive
4、使用
- magic-commands.md
- #i Adds a NuGet source to the session
- #r adds a reference to a specified assembly
2025年1月11日星期六
2025年1月10日星期五
2025年1月9日星期四
powershell:PSReadLine
- PSReadLine 2.1.0 引入了预测性 IntelliSense 功能
- PSReadLine 2.2.6 默认启用预测
- 按 RightArrow 键接受内联建议,再按 Enter 运行命令
- 按 F2 键在 InlineView 和 ListView 之间进行切换
- 使用 Set-PSReadLineOption 的 PredictionViewStyle 参数来更改视图
powershell fzf
- 使用管理员权限是必须的吗?
- 必须设置代理才能安装吗?
- Get-Alias
- Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
- Find-Module -Name PSReadLine -Repository PSGallery | Get-Member
- Install-Module -Name PowerShellGet -Force
- Install-Module PSReadLine -AllowPrerelease -Force
- Install-Module -Name PSFzf
- winget install fzf
2025年1月7日星期二
git push
C:\MDAL> git push
Username for 'https://github.com': user007
Password for 'https://user007@github.com':
Everything up-to-date
从master分支切换到mike21_mesh_optimize分支
C:\MDAL> git status
On branch mike21_mesh_optimize
nothing to commit, working tree clean
C:\MDAL> git push
fatal: The current branch mike21_mesh_optimize has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin mike21_mesh_optimize
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
2025年1月6日星期一
mike21fm 工程文件中的 Minimum depth cutoff
注意:如果建立工程文件后,手动修改了mesh文件,该值不会自动更新。
If the bathymetry level in an element is above the minimum depth cutoff value then the minimum depth cutoff value is replacing the actual bathymetry value in the computations. Please note that the minimum depth cutoff value may be negative as the bathymetry levels is often so in the mesh file.
If you also apply a Datum shift - the depth cutoff is relative to the corrected depths.
For instance - you have a mesh file with values between +2 and -20 meters. You then shift these to a different datum with a shift of +1 meters. Your corrected bathymetry now ranges between +1 and -21 m. You can then cutoff all depths above -2m, leaving the bathymetry used in the model to range between -2 and -21 m.
关于mike21的Culvert
- Culvert location 会封堵所在位置
- 推测:①culvert 的长度,可能只用来取水位;②取水位后,计算流量;③把计算的流量均匀分布到culvert location 所在的line上
- 疑问:若能根据水位计算流量,但culvert location所在的网格的高程,明显高于周边水位,计算会出错。(也就是说:如果网格本身的高程造成阻水,想通过culvert将流路打通,是无法实现的)
2025年1月2日星期四
mdal存在的问题
1、MDAL::DriverMike21::load( )加载数据太慢
原因:使用正则表达式分析数据造成 regex_split
2、加载大的Mike21 mesh文件会出错
3、使用conda命令安装mdal,为什么mdal.dll没有被安装到虚拟环境中,从conda-meta目录里的mdal-1.2.0-hd0e7f6f_0.json可以查到安装到了哪里。
4、python-mdal是怎么找到mdal.dll的?
cmake学习
- https://github.com/atrelinski/CMake-Example/tree/master
- https://github.com/aka863/MDAL
- https://github.com/buildaworldnet/IrrlichtBAW/issues/194
- https://juejin.cn/post/7157628526060011527
- how-can-i-use-cmake-to-create-a-visual-studio-solution-with-multiple-visual-stud
- cmake-exe-cant-find-dll
- https://www.cnblogs.com/zjacky/p/17088203.html
- https://github.com/BoomingTech/Piccolo/issues/130
- https://blog.csdn.net/zyw1120172694/article/details/120888157