VSCode - Jupyter Extension
摘要:Jupyter Extension is needed for connecting Jupyter lab server. Install the Jupyter Extension: Start a Jupyter lab server: (zpytorch) zzh@ZZHPC:/zdata/
阅读全文
Jupyter - autoreload
摘要:%reload_ext autoreload %autoreload 2 以上代码只需执行一次。 对已import的方法做修改,修改的内容直接生效,不需要重新import。 新增的方法需要import才能使用,import之后之前定义的类对象可以使用这个新方法。 在一个module中删除一个方法,即
阅读全文
VSCode - Hint documentation of a Python function is different from its docstring
摘要:Searched 'def seed(' in the source code: There is one definition of the seed() method in interface class RandomState: The implementation of the seed()
阅读全文
PyTorchStepByStep - Chapter 0: Visualizing Gradient Descent
摘要:Gradient descent is an iterative technique commonly used in machine learning and deep learning to find the best possible set of parameters / coefficie
阅读全文
Pytorch - Installation
摘要:https://pytorch.org/get-started/locally/ zzh@ZZHPC:~/zd/Github$ python -m venv zpytorch (venv创建后不能移动到别的地方,移动到别的地方后虽然仍能activate,但activate之后python和pip也不
阅读全文
Install cuDNN
摘要:The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned i
阅读全文
Ubuntu - Remove rc packages
摘要:To find if any broken packages are there: sudo dpkg -l | grep "^iU" To remove broken packages any of two commands will help: sudo apt-get -f install s
阅读全文
Install CUDA Toolkit
摘要:CUDA, which stands for Compute Unified Device Architecture, is a parallel computing platform and application programming interface (API) model created
阅读全文
Anaconda - Install and Uninstall
摘要:Download the installation file: Install: zzh@ZZHPC:/zdata/software
chmoda+xAnaconda3−2024.10−1−Linux−x8664.shzzh@ZZHPC:/zdata/software ./zzh@ZZH
阅读全文
VSCode - Keep Open for all opened files by default
摘要:Just disable the preview mode:
阅读全文
zsnippetbox 项目中遇到的问题及解决办法
摘要:问题1:在数据库表中看不到通过Web页面创建的数据 创建过程成功执行,没有数据库连接错误,也没有页面错误和数据处理错误,并且同样的操作以前创建的数据能在数据库表中查看到,突然之间就出现这样的问题。 先检查了代码,没有跟数据库相关的改动,怀疑是docker中的mysql容器在持久化方面出了问题。 将所
阅读全文
Go - Web Application 10
摘要:Creating a unit test In Go, it’s standard practice to write your tests in *_test.go files which live directly alongside the code that you’re testing.
阅读全文
MySQL - Disable autocommit globally
摘要:autocommit Command-Line Format --autocommit[={OFF|ON}] System Variable autocommit Scope Global, Session Dynamic Yes SET_VAR Hint Applies No Type Boole
阅读全文
Go - Web Application 9
摘要:Using request context At the moment our logic for authenticating a user consists of simply checking whether a "authenticatedUserID" value exists in th
阅读全文
Go - Web Application 8
摘要:User authentication Open up your handlers.go file and add placeholders for the five new handler functions as follows: func (app *application) userSign
阅读全文
Go - Web Application 7
摘要:The http.Server struct Although http.ListenAndServe() is very useful in short examples and tutorials, in real-world applications it’s more common to m
阅读全文
Go - Web Application 6
摘要:Stateful HTTP A nice touch to improve our user experience would be to display a one-time confirmation message which the user sees after they’ve added
阅读全文
Go - Web Application 5
摘要:Processing forms We’re going to add an HTML form for creating new snippets. The form will look a bit like this: The high-level flow for processing thi
阅读全文
Go - Web Application 4
摘要:How middleware works In fact, we’re actually already using some middleware in our application — the http.StripPrefix() function from serving static fi
阅读全文
Go - Web application 3
摘要:Displaying dynamic data func (app *application) snippetView(w http.ResponseWriter, r *http.Request) { id, err := strconv.Atoi(r.PathValue("id")) if er
阅读全文
Go - Web Application 2
摘要:Creating a database connection pool // The sql.Open() function initializes a new sql.DB object, which is essentially a // pool of database connections
阅读全文
Go - Web Application 1
摘要:Web application basics The first thing we need is a handler. If you’ve previously built web applications using a MVC pattern, you can think of handler
阅读全文