The version number of robot JS running by electron does not match

Solution to the problem of version number mismatch in running electron and robot JS

Running found that the error version number does not match, to reduce the node version number, the result found that it is not the version number problem

<project>/node_modules/robotjs/build/Release/robotjs.node' was compiled against a different Node.js version using 
NODE_MODULE_VERSION 57.
 This version of Node.js requires NODE_MODULE_VERSION 54. 
 Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install).

After one operation, the node gyp construction error was reported again

node-expat.3.18 install /usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/rnv/node_modules/node-expat node-gyp rebuild

gyp ERR! clean error gyp ERR! stack Error: EACCES: permission denied, rmdir 'build' gyp ERR! System Linux 5.3.0-51-generic gyp ERR! command "/usr/local/lib/nodejs/node-v14.0.0-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/rnv/node_modules/node-expat gyp ERR! node -v v14.0.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/rnv/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN rnv.29.0 requires a peer of now.3.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-expat.3.18 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-expat.3.18 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/abhishek/.npm/_logs/2020-05-10T08_21_14_099Z-debug.log

Solution: to delete the project again and execute the following command again can solve most of the problems
target is the electron version number

By printing console.info ( process.versions );
view the corresponding relationship between
node and ABI: see

cnpm rebuild --runtime=electron --target=8.5.5 --disturl=https://atom.io/download/atom-shell --abi=72

dd make start up usb

1. Insert U disk

2. Fdisk – l find the drive letter of U disk

3.umount /dev/sdb*

four mkfs.vfat /dev/sdb -I

5. Use the DD command to write ISO to enter the U disk
// if = input file. You should fill in the absolute address instead of ~ /… , or you can CD to the current directory and directly write the name
// of = output file

dd if=/home/zhouya/Downloads/ubuntu-20.04.2.0-desktop-amd64.iso of=/dev/sda status=progress && sync

Barrier free click path source code to read

Gesturedescription build to build gesture description class

Dispatchgesture execution gesture description class

GestureDescription.GestureStep Gesture operation steps

final IAccessibilityServiceConnection connection =
                AccessibilityInteractionClient.getInstance().getConnection(
                        mConnectionId);

  connection.sendGesture(mGestureStatusCallbackSequence,
                        new ParceledListSlice<>(steps));

Iaccessibilityserviceconnection utilizes cross process

https://www.jb51.net/article/141876.htm

MainActivity.this.onTouchEvent(MotionEvent.obtain(
                        SystemClock.uptimeMillis(),
                        SystemClock.uptimeMillis(),
                        MotionEvent.ACTION_DOWN,
                        100.0f,
                        100.0f,
                        0));


                MainActivity.this.onTouchEvent(MotionEvent.obtain(
                        SystemClock.uptimeMillis(),
                        SystemClock.uptimeMillis(),
                        MotionEvent.ACTION_MOVE,
                        150.0f,
                        150.0f,
                        0));

                MainActivity.this.onTouchEvent(MotionEvent.obtain(
                        SystemClock.uptimeMillis(),
                        SystemClock.uptimeMillis() ,
                        MotionEvent.ACTION_UP,
                        200.0f,
                        200.0f,
                        0));

Research on invalid modification of elementui component style

Background: the default font of El tabs is 14px. If you want to change it to 12px, adding styles in style will not work.

Solution: put style in app.vue Inside, the style takes effect

.panel-content .el-tabs__item.is-top{
  font-size 12px
}

Principle analysis: in Vue component, we often need to add scoped to style to make the current style only act on the node of the current component. After adding scoped, the work behind Vue is actually to add a unique attribute identifier like “data-v-1233” to the node of the current component. Of course, it will also add [data-v-1233] to all styles of the current style. In this way, the current style can only act on the node of the current component.

But we need to note that if we add a child component, similarly, if the child component is also identified with scoped, then the node in the child component cannot be set in the parent component.

If the parent component has scoped and the child component is not set, the style of the node of the child component cannot be set in the parent component. Because the parent component uses scoped, the style set in the parent component is unique and will not affect other component styles.

When I used the Vue quill editor rich text editor, I came across this pit. I just want to set the height of the content area. In this case, it must be in the App.vue Set in, we App.vue Equivalent to the root container, scoped is not set, so it can be set.

Adding scoped in style is equivalent to adding a unique logo on the page.

Ubuntu 20.04 installing gfortran-6/ libgfortran.so .3

When I try to run the do command under GAMIT on Ubuntu 20.04, it shows:

root@DESKTOP-LF0EAC9:/etc/apt# doy
doy: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

among libgfortran.so . 3 depending on gfortran-6, try to install gfortran-6:

root@DESKTOP:/etc/apt# apt install gfortran-6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gfortran-6

The problem here is that Ubuntu 20.04 does not support G + ± 6. Add the following source to/etc/apt/ sources.list For the method of adding source, see the link

deb http://gb.archive.ubuntu.com/ubuntu/ bionic main universe

function

sudo apt-get update

Install GCC + + – 6

apt-get install g++-6

Setting the default version of GCC

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 6

Install gfortran-6

 apt install gfortran-6

Install successfully, run doy

root@DESKTOP-LF0EAC9:/etc/apt# doy 2020 001
Date 2020/01/01  0:00 hrs, DOY   1 JD  2458849.5000 MJD  58849.0000
GPS Week  2086 Day of week  3, GPS Seconds 259200 Day of Week Wed
Decimal Year 2020.000000000 GRACE Seconds 631108800.0

Run successfully

numpy.random.rand()

numpy.random.randn (d0, d1, … , DN) is to return one or more sample values from the standard normal distribution.  
numpy.random.rand (d0, d1, … , DN) in [0,1].   

 

numpy.random.rand (d0,d1,… ,dn)

The rand function generates data between [0,1] according to the given dimension, including 0 and excluding 1DN table. The return value of each dimension is the array of the specified dimension

np.random.rand(4,2)
array([[0.64959905, 0.14584702],
       [0.56862369, 0.5992007 ],
       [0.42512475, 0.83075541],
       [0.75685279, 0.00910825]])

np.random.rand(4,3,2) # shape: 4*3*2
array([[[0.07304796, 0.48810928],
        [0.59523586, 0.83281804],
        [0.47530734, 0.50402275]],

       [[0.63153869, 0.19636159],
        [0.93727986, 0.13564719],
        [0.11122609, 0.59646316]],

       [[0.17276155, 0.66621767],
        [0.81926792, 0.28781293],
        [0.20228714, 0.72412133]],

       [[0.29365696, 0.53956076],
        [0.19105394, 0.47044441],
        [0.85930046, 0.3867359 ]]])

 

On the dynamic acquisition of expandedheight of sliderappbar in nestedscrollview

When using nested Scrollview to collapse a writing project, we encounter a problem. The content in flexible spacebar needs to be displayed dynamically. Some data needs to be returned, which may be hidden. As a result, the height is uncertain. However, expandedheight in slicerappbar can only be fixed, so we have to find another way to obtain the height.

 

    copy a copy of the code in flexible space bar and write it into a statelesswidget to set a globalkey. Now you need to process the request, write it in the successful callback, and use the first frame of the successful request to get the height

    WidgetsBinding.instance.addPostFrameCallback((_) {
          RenderBox _cardBox =
              _flexibleSpaceBarKey.currentContext.findRenderObject();
    
          Future.delayed(Duration(milliseconds: 10), () {
            setState(() {
              heightFlexibleSpaceBar = _cardBox.size.height;
            });
          });
        });

Python data analysis dataframe converts dates to weeks

When doing data analysis with Python, how to add a new column of weeks “week” and change the date, such as “2021-03-02” to the nth week of 2021?

Introduce two methods:
the dataframe of my data is called sample, which has the feature “date”. Now add a new feature “week”
1 dt.week

sample["week"]=sample["date"].dt.week

2. Use datetimeindex

df['week'] = pd.DatetimeIndex(sample['date']).week

When using CSS to write the registration page, we found that the editing effect is not effective

When using CSS to write the registration page, we found that the editing effect is not effective

Project scenario: learning the combination of CSS and HTML Problem Description: in HTML writing, the text effect is not effective

Project scenario: learning the combination of CSS and HTML

tip: here is a brief introduction of the background of the project: when learning the combination of CSS and HTML recently, I encountered a problem that I don’t know how to describe in the process of writing the registration page


Problem Description: in HTML writing, the text effect is not effective

Receiving data code in idea:

 .rg_left > p :first-child{
            color: #FFD026;
            font-size: 20px;
        }
        .rg_left > p:last-child{
            color: #A6A6A6;
            font-size: 20px;
        }

you can’t add a space between P and colon. Although you won’t report an error, the effect displayed on the web page doesn’t take effect. At first, I thought it was Google’s problem. Later, after constant attempts, I solved the problem


Carefully check whether there are spaces in the syntax during the code writing process. Although idea will not report errors, the final implementation effect will be inconsistent with the plan

Start rqt_ Graph, prompt / opt / ROS / melody / share / PR2_ motor_ diagnostic_ Under tool plugin.xml There is something wrong with the file

Question: as the title, open it plugin.xml It was found to be blank.

Solution: find the GitHub of PR2, download and copy it to/opt/ROS/melody/share/PR2_ moto_ diagnostic_ Tool/or create your own plugin.xml File, which will be installed on GitHub plugin.xml Copy in the code in.

[new problem] prompts that we do not have permission to create a file in this path, so we need to increase the permission to obtain the super user permission: $sudo Chmod 777/opt/ROS/melody/share/PR2_ motor_ diagnostic_ tool/。 Then create a new one plugin.xml File, copy the code in and save it.