Visual Studio Code使用笔记

2023-05-16

文章目录

  • 简介
  • 安装
  • 常用功能
    • 文件对比
  • 常用插件
    • 通用
      • 快捷键
      • 文件头注释
    • C/C++
    • Python
    • LaTex
    • Markdown
  • 其它
    • C/C++多文件编译运行
      • 代码运行

简介

与Sublime Text相比,vscode免费开源、自带比较优秀的代码对比、调试功能,功能略强于Sublime,但功能多了略显得臃肿,速度也相对慢些,界面没那么清爽。有关Sublime Text的安装配置参见超级文本编辑器Sublime Text3

安装

vscode的安装访问主页下载安装即可。其插件可以通过点击File–>Preference–>Extensions,在其中搜索插件名安装。另一种方式是在官方Extensions里搜索插件下载.vsix格式文件,然后点击File–>Preference–>Extensions,在弹出界面寻找图标...导入文件安装。

常用功能

  • 官方教程网址
  • Ctrl + Shift + P:调出控制面板,用于更改配置(包含插件),执行功能(包含插件)等
  • 按住Ctrl + Shift + P ,在搜索框中输入setting,选择Preference: Open User Settings(JSON) 可以直接以编辑json文件的方式更改插件配置
  • Ctrl+Click:该功能可在 多光标选择转到定义间切换。调出控制面板,输入cursor 选择 Toggle cursor
  • 更改页面布局,将同一个文件划分到多个区域显示

在这里插入图片描述

文件对比

在左侧 Explorer 下, 右击文件1, 选择Select for Compare, 然后右击文件2, 选择Compare with Selected, 出现类似如下对比界面
在这里插入图片描述
它还具有文件夹对比功能,可以自己取尝试.

常用插件

通用

快捷键

用惯了sublime快捷键的同学可以搜索安装 Sublime Text Keymap and Settings Importer插件。

文件头注释

搜索安装 File Header Comment插件,参考官方教程配置即可,或者参考我的配置, 见下面的代码。使用时,按Ctrl + Shift + P 调出控制面板,然后按动图操作:

在这里插入图片描述

配置内容,可以自己仿照着自定义。

    "fileHeaderComment.parameter":{
        "*":{
            "author": "Zhi Liu",
            "year": "2013",
            "email": "zhiliu.mind@gmail.com",
            "homepage": "http://iridescent.ink",
            "version": "0.0",
            "note": "",

            "license_gpl":[
                "The GNU General Public License (GPL)",
                " Copyright (C) ${year}- ${author}",
                "",

                "This program is free software: you can redistribute it and/or modify",
                "it under the terms of the GNU General Public License as published by",
                "the Free Software Foundation, either version 3 of the License, or",
                "(at your option) any later version.",
                "",
                "This program is distributed in the hope that it will be useful,",
                "but WITHOUT ANY WARRANTY; without even the implied warranty of",
                "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the",
                "GNU General Public License for more details.",
                "",
                "You should have received a copy of the GNU General Public License",
                "along with this program. If not, see <https://www.gnu.org/licenses/>.",
            ],
            "license_mit":[
                "The MIT License (MIT)",
                " Copyright (C) ${year}- ${author}",
                "",
                " Permission is hereby granted, free of charge, to any person obtaining a copy of this software",
                " and associated documentation files (the \"Software\"), to deal in the Software without restriction,",
                " including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,",
                " and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,",
                " subject to the following conditions:",
                "",
                " The above copyright notice and this permission notice shall be included in all copies or substantial",
                " portions of the Software.",
                "",
                " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED",
                " TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL",
                " THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,",
                " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
            ],
            "license_apache":[
                "The Apache 2.0 License",
                " Copyright (C) ${year}- ${author}",
                "",
                "Licensed under the Apache License, Version 2.0 (the \"License\");",
                "you may not use this file except in compliance with the License.",
                "You may obtain a copy of the License at",
                "",
                    "http://www.apache.org/licenses/LICENSE-2.0",
                "",
                "Unless required by applicable law or agreed to in writing, software",
                "distributed under the License is distributed on an \"AS IS\" BASIS,",
                "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
                "See the License for the specific language governing permissions and",
                "limitations under the License.",
            ]
        }
    },
    "fileHeaderComment.template":{
        "simple_without_bash_header":[
            "${commentbegin}",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : ",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentend}"
        ],
        "simple_with_bash_header":[
            "${commentbegin}!/usr/bin/env python",
            "${commentbegin}-*- coding: utf-8 -*-",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : ",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentend}"
        ],
        "gpl_without_bash_header":[
            "${commentbegin}",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : GNU General Public License (GPL)",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_gpl}",
            "${commentend}"
        ],
        "gpl_with_bash_header":[
            "${commentbegin}!/usr/bin/env python",
            "${commentbegin}-*- coding: utf-8 -*-",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : GNU General Public License (GPL)",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_gpl}",
            "${commentend}"
        ],
        "mit_without_bash_header":[
            "${commentbegin}",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : v${version}",
            "${commentprefix} @license   : The MIT License (MIT)",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_mit}",
            "${commentend}"
        ],

        "mit_with_bash_header":[
            "${commentbegin}!/usr/bin/env python",
            "${commentbegin}-*- coding: utf-8 -*-",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : The MIT License (MIT)",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_mit}",
            "${commentend}"
        ],
        "apache_without_bash_header":[
            "${commentbegin}",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : v${version}",
            "${commentprefix} @license   : The Apache License 2.0",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_apache}",
            "${commentend}"
        ],

        "apache_with_bash_header":[
            "${commentbegin}!/usr/bin/env python",
            "${commentbegin}-*- coding: utf-8 -*-",
            "${commentprefix} @file      : ${filename}",
            "${commentprefix} @author    : ${author}",
            "${commentprefix} @email     : ${email}",
            "${commentprefix} @homepage  : ${homepage}",
            "${commentprefix} @date      : ${date}",
            "${commentprefix} @version   : ${version}",
            "${commentprefix} @license   : The Apache License 2.0",
            "${commentprefix} @note      : ${note}",
            "${commentprefix} ",
            "${commentprefix} ${license_apache}",
            "${commentend}"
        ],
    },

C/C++

搜索安装 C/C++ 插件,可实现定义跳转,编译、调试运行等功能。按住Ctrl + Shift + P,输入CC++,可选择GUI可视化配置或者JSON文件配置,如下图所示。
在这里插入图片描述

由于C++有不同的实现,如GNU C,Visual C,因而配置也略微不同。

  • 如果使用GCC,需要安装GNU C++编译器

    • 如果在Windows平台上配置,可参考VSCode官方教程Using GCC with MinGW。从msys2下载和安装MinGW,也可参考博客。
    • 如果在Linux平台上配置,可参考VSCode官方教程Using C++ on Linux in VS Code。
  • 如果使用Visual C++,需要安装Microsoft Visual C++ (MSVC) 工具链,如果安装了Visual Studio,那你估计已经安装了,具体方法参考下面链接:VSCode官方教程Configure VS Code for Microsoft C++。

目前该插件还不支持多文件编译和调试,想实现多文件编译,请参考本文 “C++”多文件编译 章节。

Python

主要安装 PythonautoDocstring,前者用于语法高亮、运行与调试,后者用于自动生成注释文档,关于Sphinx文档的介绍可参考本人撰写的教程。

如下图所示,安装完成后,按住Ctrl + Shift + P调出控制面板,输入python,可更改相关选项,如选择解释器。当你安装有多个版本的Python时可以用它选择使用那个版本运行代码,注意需要将各个版本的python解释器路径添加到PATH环境变量。

图中sum函数的注释文档是通过输入""" 按回车后自动生成的。

在这里插入图片描述

LaTex

搜索安装 LaTeX Workshop,注意如果没有你需要的工具,可以自己添加,如biber,一个是tools,另一个是recipes。

按住Ctrl + Shift + P ,在搜索框中输入setting,选择Preference: Open User Settings(JSON) ,添加如下配置:

    "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.message.error.show": true,
    "latex-workshop.message.warning.show": true,
    "latex-workshop.synctex.afterBuild.enabled": true,
    "latex-workshop.latex.autoClean.run": "never",

    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
              "-synctex=1",
              "-interaction=nonstopmode",
              "-file-line-error",
              "-pdf",
              "-outdir=%OUTDIR%",
              "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],

    "latex-workshop.latex.recipes": [
        {
            "name": "latexmk",
            "tools": [
              "latexmk"
            ]
        },
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ],
        },
        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "bibtex",
            "tools": [
                "bibtex"
            ],
        },
        {
            "name": "biber",
            "tools": [
                "biber"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex * 2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex * 2",
            "tools": [
              "pdflatex",
              "bibtex",
              "pdflatex",
              "pdflatex"
            ]
        },
        {
            "name": "xelatex -> biber -> xelatex * 2",
            "tools": [
                "xelatex",
                "biber",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> biber -> pdflatex * 2",
            "tools": [
                "pdflatex",
                "biber",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],

然后重启vscode,在左侧工具栏可以看到 TEX图标,点击展开后可以看到添加的选项,如下图所示,另外通过View LaTex PDF功能可以设置在哪里预览PDF,建议选VSCode tab,这样可以较方便实现反向搜索(Ctrl+Double Click):

在这里插入图片描述

如果想向Sublime Text一样,按 Ctrl+B键实现代码编译,请参考下述 快捷键小结。

Markdown

搜索安装 Markdown All in One,预览结果如下, 该插件还支持自动生成目录的功能, 按住Ctrl + Shift + P调出控制面板,输入markdown all in one, 选择 Create Table of Contents 即可生成,其它功能,请自行探索.
在这里插入图片描述

其它

C/C++多文件编译运行

可以直接安装使用C/C++ Runner插件,也可以借助 Code Runner 插件和Make工具实现。使用C/C++ Runner插件比较简单,本人也推荐使用该插件,基本都是傻瓜化操作,这里不做过多介绍。下面介绍使用Code Runner 插件如何实现多文件的编译。

由于Windows不自带make,故在Windows上需要安装,可以在这里 下载,按说明安装。但实际上安装了GNU 的C/C++编译工具MinGW 或 TDM-GCC后,在TDM-GCC\bin 目录下可以找到 mingw32-make.exe,复制一个并重命名为make.exe,并在环境变量PATH里添加make.exe所在路径即可。

然后需要配置一下CodeRunner,只有c cpp 两行,如下,被注释掉的为默认配置。

{
    "code-runner.runInTerminal": true,
    "code-runner.ignoreSelection": true,
    "code-runner.executorMap": {
    
        "javascript": "node",
        "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
        // "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        // "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "c": "cd $dir && make && $dir$fileNameWithoutExt",
        "cpp": "cd $dir && make && $dir$fileNameWithoutExt",
        "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "php": "php",
        "python": "python -u",
        "perl": "perl",
        "perl6": "perl6",
        "ruby": "ruby",
        "go": "go run",
        "lua": "lua",
        "groovy": "groovy",
        "powershell": "powershell -ExecutionPolicy ByPass -File",
        "bat": "cmd /c",
        "shellscript": "bash",
        "fsharp": "fsi",
        "csharp": "scriptcs",
        "vbscript": "cscript //Nologo",
        "typescript": "ts-node",
        "coffeescript": "coffee",
        "scala": "scala",
        "swift": "swift",
        "julia": "julia",
        "crystal": "crystal",
        "ocaml": "ocaml",
        "r": "Rscript",
        "applescript": "osascript",
        "clojure": "lein exec",
        "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
        "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
        "racket": "racket",
        "scheme": "csi -script",
        "ahk": "autohotkey",
        "autoit": "autoit3",
        "dart": "dart",
        "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
        "haskell": "runhaskell",
        "nim": "nim compile --verbosity:0 --hints:off --run",
        "lisp": "sbcl --script",
        "kit": "kitc --run",
        "v": "v run",
        "sass": "sass --style expanded",
        "scss": "scss --style expanded",
        "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",
        "FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "sml": "cd $dir && sml $fileName"
    },
}

然后从本人编写的代码库这里的 c/linalg 文件夹下拷贝 Makefile文件,放入你的目录,打开并修改PROGRAM字段为你main函数所在文件的名字。在你的目录下新建文件夹includesrc,将所有.h.c/.cpp文件对应放进去即可。

配置好后就可以直接用CodeRunner进行多文件的编译与运行了。效果图如下:

在这里插入图片描述

代码运行

用过sublime的童鞋可能都比较喜欢使用 Ctrl+B快捷键运行程序, 而vscode则没有类似功能. 可以通过安装 Code Runner 插件, 并修改其快捷键实现. 假设已经安装了该插件, 然后依次点击File–>Preference–>Keyboard Shotcuts 打开快捷键设置界面,输入 alt+ctrl+n搜索code runner的快捷键, 然后点击铅笔图标,在弹出的对话框中按Ctrl+B并回车修改快捷键即可.

在这里插入图片描述
另外,如果想CodeRunner运行完,显示输出结果自动滑动到末尾,可以点击下图所示图标
在这里插入图片描述

Code Runner目前支持的语言有限,不过支持自定义扩展,下面以LaTex为例 假设想实现 pdflatex-->bibtex -->pdflatex-->pdflatex 的编译流程,只需按住Ctrl + Shift + P ,在搜索框中输入setting,选择Preference: Open User Settings(JSON) 打开用户配置文件,增加如下内容即可

    "code-runner.executorMapByFileExtension": {
        ".tex": "cd $dir && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && bibtex $fileNameWithoutExt || true && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // ".tex": "cd $dir && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && biber $fileNameWithoutExt || true && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // ".tex": "cd $dir && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && bibtex $fileNameWithoutExt || true && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // ".tex": "cd $dir && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && biber $fileNameWithoutExt || true && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
    },

或者

    "code-runner.executorMap": {
        "latex": "cd $dir && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && bibtex $fileNameWithoutExt || true && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // "latex": "cd $dir && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && biber $fileNameWithoutExt || true && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && pdflatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // "latex": "cd $dir && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && bibtex $fileNameWithoutExt || true && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
        // "latex": "cd $dir && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && biber $fileNameWithoutExt || true && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt && xelatex -synctex=1 -interaction=nonstopmode -file-line-error $fileNameWithoutExt",
    },
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Visual Studio Code使用笔记 的相关文章

  • 利用Visual Studio创建C语言dll

    利用VS2019创建dll方法 动态链接库的定义及意义如何在VS创建dll入口函数DLLMain如何创建导出函数动态调用导出函数 动态链接库的定义及意义 动态链接库 xff08 Dynamic Link Library 或者 Dynamic
  • visual studio code中模拟浏览器端向服务端发起请求

    一 需要使用的插件 二 使用方式 1 创建 http文件 2 在所创建的 http文件中输入如下内容 相关具体的使用方式可参见 xff1a https marketplace visualstudio com items itemName
  • 【转载】关于Visual Studio、VC和C++的那些事

    size 61 medium 首先 xff0c 这三个东西有什么区别呢 xff1f VC和C 43 43 是相同的吗 xff0c 有什么区别呢 xff1f 我刚开始学C 43 43 的时候也有这样的问题 xff0c 在这里我来替大家解释一下
  • RTK使用笔记-千寻CORS模式

    一 千寻CORS模式 与基站 43 接收机1对1相比 xff0c 优点为携带方便 xff0c 也不用考虑10公里移动基站问题 xff1b 缺点为第一千寻CORS模式有自己基站涵盖范围 xff0c 所以需要提前确定好范围 xff08 下文有介
  • 整理ps使用笔记

    尽管使用ps只需要记住常用命令 xff1a ps aux ps ef 并且理解输出的列含义即可 但不理解命令的含义 xff0c 用起来总有种空虚感 下面研究一下 文章目录 介绍BSD默认simpleaxT r listoutput 总结 介
  • pugixml使用笔记

    https pugixml org docs manual html dom tree pugixml官方使用手册 1 创建xml文件信息 例如 xff1a pugi xml document xmldoc pugi xml node de
  • 使用VS Code连接远程服务器

    目录 一 VS Code的安装与下载 二 安装插件 三 添加服务器连接配置 四 连接服务器 一 VS Code的安装与下载 关于VS Code的安装与下载及VS Code的使用方式详见如下链接 VSCode安装教程并配置C C 43 43
  • 【Apple Studio Display】苹果显示器无法连接Dell 5488

    Apple Studio Display 苹果显示器无法连接Dell 5488 xff08 1 xff09 Dell 5488 could not use the Apple studio display via the type c ca
  • 使用VS CODE+PlantUML高效画图

    使用VS CODE 43 PlantUML高效画图 自从发现了plantuml写脚本画图的方式之后 xff0c 爱上了画图 环境 xff1a MAC 前言 本文多数内容引用自官网文档和其他人的教程 xff0c 并非本人原创 xff0c 也谈
  • 关于loss.backward()函数反向传播时叶子节点被释放

    之前写代码的时候遇到的一个问题 一直没有解决 后来稀里糊涂的解决了 我也不知道原因 这里贴出来 希望大家遇到这个问题的时候能有些启发 图来自网上搜索 由于问题是很久以前的了 当时没有保存截图 抱歉了 这个问题的出现其实可以将 loss ba
  • CUDA 初体验

    CUDA Visual Profiler CUDA编程指导 shared memory Page locked out memory C CUDA 调用 CUDA 编程介绍 CUDA 数据同步 CUDA Visual Profiler 在上
  • vs2012编译boost_1_53_0

    Boost库的介绍 Boost库是一个经过千锤百炼 可移植 提供源代码的C 库 作为标准库的后备 是C 标准化进程的发动机之一 Boost库由C 标准委员会库工作组成员发起 其中有些内容有望成为下一代C 标准库内容 在C 社区中影响甚大 其
  • java内部类的作用分析

    提起Java内部类 Inner Class 可能很多人不太熟悉 实际上类似的概念在C 里也有 那就是嵌套类 Nested Class 关于这两者的区别与联系 在下文中会有对比 内部类从表面上看 就是在类中又定义了一个类 下文会看到 内部类可
  • How to Install Android Studio under Ubuntu 16.04

    If you find difficulties installing Android Studio under Ubuntu 16 04 1 LTS Xenial Xerus you can follow this tutorial th
  • FID(Fusion-in-Decoder models)源码笔记

    源码 源码 https github com facebookresearch FiD 目录 源码 数据集 数据格式 预训练模型 训练 测试 src slurm py 资源调度管理 util py 配置管理 evaluation py 查找
  • java中的IO整理

    写在前面 本文章基本覆盖了java IO的全部内容 文章以例子为主 因为讲解内容的java书很多了 我觉的学以致用才是真 代码是写出来的 不是看出来的 最后欢迎大家提出意见和建议 案例1 创建一个新文件 1 2 3 4 5 6
  • Java解一元二次方程

    import java util Scanner public class Calculate public static void main String args 创建键盘录入 Scanner sc new Scanner System
  • android studio从git上克隆项目显示the directory already exists and it is not empty

    英文的意思能看懂 文件夹已存在并且不为空 但是网上百度了一下貌似没有完完整整是这句话的问题 我还纳闷怎么克隆不下来 我是想把项目克隆下来到workspace里面 workspace里面本来就还有其他项目在 原来克隆操作不会帮你生成跟目录 你
  • 排序算法总结(Python版本)

    看了很多排序算法 每种算法都有多个版本 现总结一版自己觉得容易理解的 供以后翻阅 1 插入排序 直接插入排序 直接插入排序是将一个数插入到已经排序好的序列中 做法是先将第一个数作为已经排序好的 依此将后面的数取出插入到前面已排序好的序列中
  • 13位时间戳单位为毫秒,10位字符串单位为秒。时间戳转换日期数字格式100%全乎

    时间戳转换为年月日时分秒数字格式 注意时间戳有2种 13位时间戳 单位为毫秒 10位字符串 单位为秒 接口返回1616160878418 微秒 期望格式2021 03 19 21 34 35 标签 java new Date 变成GMT G

随机推荐

  • 利用实例学CMMI V2.0 (1)

    越来越多客户询问关于CMMI v2 0 xff0c 而且这个模型不像v1 3可以免费下载 xff0c 所以我们需要一些辅助资料 xff0c 帮一些有兴趣的人预先了解 xff0c 尤其是已经学过v1 3的 xff0c 可以在此基础上学习v2
  • Ubuntu 16.04升级python3.6及解决终端打不开的bug

    Ubuntu 16 04 默认安装python3的版本为python3 5 xff0c 而在一些场景下我们需要用到python3 6 xff0c 于是本人尝试将python3 5升级为python3 6 xff0c 但期间出现了界面模式下终
  • Dockerfile 指令详细介绍

    使用 Dockerfile 定制镜像 这里仅讲解如何运行 Dockerfile 文件来定制一个镜像 具体 Dockerfile 文件内指令详解 xff0c 将在下一节中介绍 xff0c 这里你只要知道构建的流程即可 下面以定制一个nginx
  • linux系统下cat命令的使用

    运维那些事 2017 01 22 21 15 cat命令是Linux系统下查看文件内容用的指令 xff0c 还可以将显示的信息转入或附加到文件上 命令格式 cat 选项 文件 命令功能 cat主要有三大功能 xff1a 一次显示整个文件 c
  • 使用Python爬取淘宝两千款套套

    各位同学们 xff0c 好久没写原创技术文章了 xff0c 最近有些忙 xff0c 所以进度很慢 xff0c 给大家道个歉 gt 警告 xff1a 本教程仅用作学习交流 xff0c 请勿用作商业盈利 xff0c 违者后果自负 xff01 如
  • 大学那会儿,我读过的技术经典图书

    我2009年考进大学的计算机系 上大学前我对电脑的使用仅限于上QQ xff0c 看小说 xff0c 可以说是零基础 但通过三年的努力及对计算机专业的喜爱 xff0c 我顺利保送到自己梦寐以求的学校攻读研究生 大学期间看了不少书 xff0c
  • vscode 配置 git (配置、暂存、推送、拉取、免密)

    前些天发现了一个巨牛的人工智能学习网站 xff0c 通俗易懂 xff0c 风趣幽默 xff0c 忍不住分享一下给大家 点击跳转到教程 vscode 中对 git 进行了集成 xff0c 很多操作只需点击就能操作 xff0c 无需写一些 gi
  • 已知子网掩码,确定ip地址范围

    主要是把 ip地址和子网掩码在二进制下进行对比 ip地址分成两个部分 xff0c 网络号和主机号 凡是在子网掩码对比下 xff0c 1 代表了网络号 xff0c 0 代表了主机号 然后对比后 xff0c 把主机号最小 xff08 全0 xf
  • virmach主机购买和使用

    01购买 参考教程 xff1a https www jb51 net yunying 470007 html 需要注意的是购买后 xff0c 登录的帐号和密码会发送到默认邮箱中 xff0c 拿到用户名密码可以先使用ssh登录 xff0c 查
  • Xmanager使用方法

    服务器 xff1a CentOS 7 6 GNOME桌面环境 xff08 若最小化安装 xff0c 默认是无桌面的 xff0c 那么就要安装桌面 xff0c 参考百度 xff09 个人主机 xff1a Windows 10专业版 xff0c
  • 制作便携式随身系统(以Ubuntu为例)

    文章目录 说明准备硬件软件 启动盘制作安装Ubuntu到随身存储设备概述 为便携式系统创建GRUB引导安装 GRUB2 到U盘或移动硬盘制作Grub引导菜单 问题与解决拔掉U盘进不了原来的系统随身系统无法在别的电脑上启动welcome to
  • 谈谈了解的几个专业

    本文涉及专业 智能科学与工程通信工程电子信息工程集成电路设计与集成系统微电子科学与工程计算机科学与技术电磁场与无线技术遥感科学与技术 这些学科专业 xff0c 很多之间是相互交叉的 以下仅作参考 xff01 xff01 xff01 随便聊聊
  • 深度学习平台框架

    简介 分类 模型转换 网络参数转到MAT 文件 keras权重到mat 可知直接用matlab读取hdf5文件 也可以通过如下脚本 keras2mat py 转换 span class token comment usr bin env p
  • Ubuntu16.04 + NVIDIA RTX3090 + Pytorch + Tensorflow

    文章目录 说明有用链接显卡驱动安装文件下载一次性安装显示驱动和cuda计算套件仅安装显示驱动仅安装cuda计算套件 安装Pytorch安装pytorch1 7源码安装pytorch1 8源码安装torchvision RTX3090性能问题
  • centOS jdk安装

    1 输入yum list installed grep java 可以查看CentOS自带的Java环境 2 卸载jdk yum y remove java 1 8 0 openjdk 输入yum y remove tzdata java
  • 元学习

    这里写自定义目录标题 说明比较好的资料文档代码 常用数据集介绍Omniglot 说明 比较好的资料 文档 torchmeta pytorch meta learning libraryPaper repro Deep Metalearnin
  • Markdown简明教程

    这里是目录 xff0c 输入 TOC 可以自动生成 文章目录 常用语法 一级标题 基本语法 二级标题 数学公式添加图片添加代码段 高级扩展语法插入classDiagram类图插入Mermaid流程图插入UML图插入甘特图 其它 常用语法 一
  • 深度神经网络中的卷积

    文章目录 卷积单元经典卷积运算经典二维卷积经典膨胀二维卷积运算经典二维转置卷积运算 实验分析实验说明实验结果 参考文献 卷积单元 本文给出了四维张量卷积的表达式 xff0c 卷积输出大小的表达式 xff0c 以及Matlab和PyTorch
  • 离线部署深度学习环境Ubuntu篇

    引言 不采用docker 以防拖慢速度 打算部署PyTorch Tensorflow 和 Keras框架 版本选择 如何选择系统 CUDA CUDNN Tensorflow Pytorch Keras等版本呢 首先看GPU 一些新的GPU卡
  • Visual Studio Code使用笔记

    文章目录 简介安装常用功能杂文件对比 常用插件通用快捷键文件头注释 C C 43 43 PythonLaTexMarkdown 其它C C 43 43 多文件编译运行代码运行 简介 与Sublime Text相比 xff0c vscode免