顯示具有 vscode 標籤的文章。 顯示所有文章
顯示具有 vscode 標籤的文章。 顯示所有文章

2020年3月2日 星期一

C++ Debug on VS code for Linux


  • Install C/C++ Extension for VS Code
  • Select the working directory: in VS Code, File->Open Folder, select the directory for your code files.
  • Edit tasks.json to compile the code: 
          In the command pallete (Ctrl+Shift+p), type the following to add "tasks.json" file to the project
          > Tasks: Configure Task
          > click Create tasks.json file from templates
          > select Others.

          Edit "label" and "commands" in tasks.json, here's the example:


        Note: for GCC debug, -g option should be included to tell the compiler to generate extra info for debugging

  • Modify launch.json to debug your code

          Go to Debug -> Start Debugging, it will open the launch.json file.
          Modify "program" tag and add "preLaunchTask" as the following example.


That's it. You can start debugging now...





2019年6月22日 星期六

Python on Chromebook

Now you can enable Linux on Chromebook:

https://support.google.com/chromebook/answer/9145439?hl=en

    > setting > Linux(測試版)



Python3 is installed in default.


You can also install anaconda if you prefer:

1. download the corresponding file:
     https://www.anaconda.com/distribution/#download-section

2. run the downloaded shell file:
  ~$ sudo bash ./Anaconda3-2019.03-Linux-x86_64.sh

   Please check the following website for details:
https://chromebook.home.blog/2019/01/20/installing-anaconda-on-a-chromebook-no-dev-beta-or-crouton-needed/

Then, install VSCode from the following site:
https://code.visualstudio.com/
(1. download the deb file, 2. double-click the file to install)


* install GCC:
   sudo apt-get install gcc

* how to zip / unzip files:
1. install 7-zip on Linux:
      $ sudo apt-get install p7zip-full
2. zip / unzip commands:
   $ 7z a newfile_name list_of_files
   $ 7z x zipfile_name


Binary Data, String, and Integer Conversions in Python

In Python 3, struct  will interpret bytes as packed binary data: This module performs conversions between Python values and C structs rep...