Category Archives: How to Fix

JNI calls the add function of list in Java to flash back

JNI calls the add function of List in Java to flit back
New changes to the problem

The problem
Flash back code is as follows:
in recent applications, the need to transfer data in C to Java a structure, in this structure, there are GNSSObservation object type of List, GNSSObservation for custom structures, therefore in the jni invocation List are required for data transmission of the add function to add data into the List, but the program, when the function is called multiple times, flash back, specific code is as follows:

env – & gt; CallObjectMethod(GnssObservationList,GnssObservationListAddFunctionID,GnssObservation); Instead of running every time, the program runs for several minutes in a row, and the function is called about 40 times per second. The reason for the backout is never found, and the data that needs to be passed to Java is passed as a double array. The reason for the code flash back has not been solved, I hope you can give some suggestions on the cause of flash back.
The new change

Difference between getelementsbyname and getelementbyid

The difference between getElementsByName and getElementById
GetElementsByName gets an array
getElementById gets a number

function sum(n, m) {
            var summary = 0;
            var a = document.getElementsByName(n.toString());
            for (var i = 0; i < a.length; i++) {
                summary = summary + Number(a[i].value);
            }
            
            //1
            var b = document.getElementById(m);
            b.value = summary;
            //2
            var f = document.getElementsByName(m);
            f[0].value = summary;
        }

Configure QT designer in pychar

Then configure Qt Designer in Pycharm
1. First install Qt and Qt Dsigner PIP Install PyQt5 PIP install PyqT5-Tools

5 in pycharm is D:\anaconda3\Library\bin\designer. Exe means the path to install designer.
do not know their own installation path:
win+s
enter designer, right click display path can

and then configure:

3 D:\anaconda3\Scripts\pyuic5 exe the same for their own installation program path
4 for:

F

i

l

e

N

a

m

e

FileName

FileName-o

F

i

l

e

N

a

m

e

W

i

t

h

o

u

t

E

x

t

e

n

s

i

o

n

FileNameWithoutExtension

FileNameWithoutExtension. Py
click ok below.


Practice — CSS3 — frame animation to achieve special effects

Practice ING – Frame animation to achieve special effects
Recently, I wrote another requirement, which used a lot of CSS3 animation, but it is still very deep to go into each attribute of CSS3 animation carefully. Here, I will write down the understanding of the steps attribute of frame animation
We know that CSS3 Animation has eight attributes
animation-name
animation-duration
animation-delay
animation-iteration-count
animation-direction
animation-play-state
animation-fill-mode
animation-timing-function
Most 1-7 are introduced, but the animation-timing function is an attribute that controls the time
In addition to the three Bessel curves commonly used, there is the confusing steps() function
By default, the animation ease the transition. It inserts a tween between each key frame, so the animation is coherent
In addition to ease, transition functions such as Linear, Cubic – Bezier will insert the tween for it. However, some effects do not require tween, but only a jump between key frames, where steps should be used
Understand the steps
The Steps function specifies a step function
The first parameter specifies the number of intervals in the time function (must be positive integers)
The second parameter, which is optional, accepts both start and end values, specifying a step change at the start or end point of each interval, which defaults to end.
Step -start is equal to steps(1,start). The animation is divided into 1 step. The part that starts the left endpoint when the animation is executed is the beginning.
Step-end is the same as steps(1,end) : the animation is divided into steps, and the animation is executed starting with the end endpoint, with the default value of end.
Look at the W3C specification
The wrong understanding of the first parameter of steps:
Steps (5, start)
The first parameter “number” of steps() is the specified number of intervals, that is, the animation is divided into N-step phased display, which is estimated to be the number of changes written for keyframes by most people
A look at the cSS2 frame animation I wrote also gave me a good understanding of cSS3 animation
@-webkit-keyframes circle {
0% {}
25%{}
50%{}
75%{}
100%{}
}

I also wrote a js, please refer to

How to add directory plug-ins to jubyter notebook

This part of the content is in accordance with the experience of baidu on the operation of the article records, in accordance with the steps of the operation can be, there is no problem. The article addresses is:
https://jingyan.baidu.com/article/9c69d48f5bb44552c8024e65.html
The steps are as follows:

    first close the running jupyter notebook plug-in package:
pip3 install jupyter_contrib_nbextensions
    configuration nbextension:

       jupyter contrib nbextension install --user --skip-running-check
    

    After

      is equipped, we launch jupyter; at that moment, we see the nbexlogo appearing on the menu bar, that is, the installation is successful; and then, we click on the configuration to enter nbexschematic; and we see that there are many items; after the modification, click on TableOfContents to update the webpage or restart jupyter; that is,

Browser performance tool

Why use Performance
The purpose of GC is to realize the virtuous cycle of memory space
; the cornerstone of the virtuous cycle is to use
properly at all times to determine whether it is reasonable
Performance provides multiple monitoring methods
Open a browser and enter the target website
into the developer tools panel. Select the Performance
to open the recording function. Visit the specific interface
to perform user behaviors

interface appears lazy loading or frequent pauses
interface continues to show poor performance
interface performance becomes worse and worse with time delay
The way to monitor memory
standard
memory leak: is the continuous increase of memory
memory bloat: performance problems exist on most devices
frequent garbage collection: analyzed by memory change graph
Method:
browser task manager
Timeline graph record
heap snapshot lookup decouple DOM
determines whether frequent garbage collection occurs

Several methods of deleting all empty lines in text under Linux

Method 1: Use Grep
grep -v ‘^\s*$’ test.txt
Note: -v means to reverse the matching result and the regular expression matches the blank line. (Blank lines can include whitespace characters such as space TAB characters)
Method 2: Use SED
sed ‘/^\s*$/d’ test.txt
Note: D stands for delete the line
Method 3: Use AWK
awk NF test.txt
Note: NF represents the number of fields in the current row. If the line is blank, the number of fields is 0, which is interpreted as false by AWK, so it will not be output.
 
All three of these methods can handle blank lines containing whitespace characters (Spaces, tabs, etc.).
 
Method 4: If blank lines are caused by ‘\n’, you can also use the tr command to remove them
tr -s ‘\n’ < test.txt
Note: -s represents the compression of multiple consecutive characters into a character. In this case, multiple ‘\n’ is compressed into a ‘\n’ to remove empty lines.
A weakness of method 4: If the first line is empty, the first line cannot be removed
The level is limited, if has the improper place, also hoped corrects!

Oracle error – ora-12519, TNS:no appropriate service handler found

Navicat Premium15 connection Oracle error Oracle error – ora-12519, TNS:no appropriate service handler found
most of the web said the solution was to modify the maximum number of connections, but I passed select count(*) from v$process; found that my connection number is only 30, there is no such thing as the preset number of 150, so it should not be this problem.
is found to be the Listener. Ora and tnsnames.ora files that have been modified before. Change the HOST value in the file to the local IP address, which was localhost before.
is hoping to help someone with this problem.

node url.parse()

Assume that this is a url http://localhost:8080/a/b/c?a=1&
protocol: ‘HTTP:’,// protocol
host: ‘localhost:8080’,
port: ‘8080’,// port
hostname: ‘localhost’, domain
hash: ‘#abcd’,
search: ‘?a=1& B = 2 ‘,
query: ‘a = 1 & amp; B =2 ‘,
pathname: ‘/a/b/c’,
path: ‘/a/b/c?a=1& B = 2 ‘,
href: ‘http://localhost:8080/a/b/c?a=1& B = 2 # ABC ‘
Url.parse () can break a complete URL into many parts, such as host, port, Pathname, path, and Query

var http = require("http");
var url = require("url");

var server = http.createServer(function(req,res){
    var pathname = url.parse(req.url).pathname;
    var query = url.parse(req.url).query;
    console.log("patname:"+ pathname);
    console.log(query);
    res.end();
});
server.listen(80,"127.0.0.1");

Putty remote login VMware virtual machine Linux

Install SSH service
There is no SSH service installed in Ubuntu by default. If you connect to Ubuntu via SSH, you need to manually install sSH-Server yourself. To determine whether to install SSH service, the following command can be used:

    : www.linuxidc.com@linuxidc:~$SSH localhost SSH: connect to host localhost port 22: Connection destination: Connection union

 
As shown above, it means that it has not been installed yet. It can be installed through APT. The command is as follows:

    : www.linuxidc.com@linuxidc:~$sudo apt-get install openssh-server

 
The system will be installed automatically. After the installation is completed, the service will be started first:

    www.linuxidc.com@linuxidc:~$sudo/etc/init. D/SSH start
     
    After startup, you can check to see if the service started correctly with the following command
    Ps

      www.linuxidc.com@linuxidc:~$- e | grep SSH 6212?00:00:00 SSHD
       
      As indicated above, start OK. Note that the default port for SSH is 22. You can change the port, stop,
      and then start. The configuration is under /etc/ssh/sshd_config, as shown below.

        www.linuxidc.com@linuxidc:~$vi /etc/ SSH /sshd_config # Package generated configuration file # See the SSHD (8) manpage for details # What ports, IPs and protocols we listen for Port 22
         
        Finally, it’s time to connect. See the following command:
        SSH [email protected]

          www.linuxidc.com@linuxidc:~$
          Disconnect:
          The

            exit
             
            Log into the virtual machine via Putty
            First of all, make sure that the virtual machine and host can ping each other. If you can’t ping the general, then the follow-up work cannot be carried out. You can search the Web for references to articles on VIRTUAL machine IP configuration
            Next, open the Putty client and the following interface appears. Fill in the relevant parameters:

            Where the IP address is the IP address of Ubuntu in the virtual machine.
            finally click Open to enter Putty, enter the user name and password to log in.

Pandas get column name

Getting the column name of DataFrame is a simple operation with the following methods:
Column for column in df]
2. Df.columns. Values return array
3. List (df)
4. Df.columns return Index (tolist(), or list(array)

import pandas as pd
from numpy.random import randint
df = pd.DataFrame(columns=list('abcdefghij'))

%timeit [column for column in df]

%timeit list(df.columns.values)

%timeit list(df)

%timeit list(df.columns)
# 100000 loops, best of 3: 2.24 µs per loop

%timeit df.columns.tolist()
# 1000000 loops, best of 3: 1.77 µs per loop

How to clean up the disk space of Linux server

Sometimes, a service suddenly hangs and starts again but fails to start. A look, the original disk space is full, so, how to clean it. The introduction is as follows:
Df-h, this command is used to view the server space. The rendering after running is as follows:

As you can see, I have 8 grams left.

Du-h — Max-depth =1, this command is used to see the current directory, which file occupies the most space, the operation effect is as follows:

As you can see, the IOV directory takes up a lot of space, 20G.
In addition, du-sh *, this command is also used to see the size of each file and folder under the current directory. The operation effect is as follows:

As you can see, the IOV directory takes up a lot of space, 12G.
Enter ioV directory, repeatedly execute the above view command, follow up all the way, find each directory takes up more space of the file, useless can be deleted.

As you can see, this nohup.out log file takes up a lot of space (1.9g). Now leave it empty.
The command can be used: cp /dev/null nohup.out. After clearing, check again, the occupancy is reduced (696K) as expected.

So, how do you clean up if the nohup.out file isn’t taking up space?

Very simple, just use the normal delete command.
Delete command: RM [options] file or directory

Option description:
-F-force ignores files that do not exist and forces deletion without prompting
-i– Interactive for interactive deletion
-r |-r –recursive deletes all directories and files under a listed directory
-v — Verbose verbose displays details of the steps performed
Command instance:
1. Delete the a.T.Xt file
Rm – rf a.t xt
2. Delete the Mplogs directory
rm -rf mplogs

Here we use example 2 to delete, and the effect is as follows:

Now that I’ve cleaned up a little bit, I go back to the root directory, and I’ve reduced the footprint.