Author Archives: Robins

arm-eabi-gcc: command not found [How to Solve]

Scene

Busybox compiling arm architecture on Ubuntu

Operation

    1. install the cross compiler tool</ ol>
sudo apt-get install gcc-arm-linux-gnueabi
      1. modify the configuration file and use the cross compile tool </ OL>
make defconfig
vim .config
# Modify
...
-# CONFIG_STATIC is not set
+CONFIG_STATIC=y
....
-CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_CROSS_COMPILER_PREFIX="arm-linux-gnueabi-"
...
        1. compiling busybox of arm architecture
make android_defconfig

reference resources

https://github.com/yongce/AndroidDevNotes/blob/master/notes/tools/0006-busybox-android.asc

[Solved] ViewBinding Error: java.lang.ClassCastException: android.widget.RelativeLayout cannot be

prompt: after the article is written, the directory can be automatically generated. For how to generate it, please refer to the help document on the right </ font> for details

Java.lang.classcastexception encountered when using viewbinding: android.widget.relativelayout cannot be cast to cast to android.widget.textview

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <Button
        android:id="@+id/back"
        android:layout_margin="10dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:text="Back" />

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Title"
        android:textSize="20sp" />

    <Button
        android:id="@+id/done"
        android:layout_margin="10dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:text="Done" />

</RelativeLayout>

In the XML of the title, the ID of textview is title

<include
        android:id="@+id/title"
        layout="@layout/titlebar" />
        

Use include < in the main interface>  When introducing a layout, the layout ID set is also the title,
when using viewbinding, there will be confusion, so the ID name should be set to different.

[Solved] javax.servlet.ServletException: Servlet[springmvc] Servlet.init()

1. There are many cases of this exception. First of all,
when configuring sqlsessionfactorybean, you should not pay attention to the problem (see the figure)

the same as above, when configuring other places, you also use ref as value. For example,

PS: combined with the above, it can discharge itself. Pay attention to whether it is this problem

2. Problems that we didn’t pay attention to when configuring servlets with web.xml

as shown in the figure: after the integration, the configuration file should not be MVC, but should be all. Generally, when creating a configuration file, there will be a prompt in the upper right corner, which may cause this kind of problem if you don’t pay attention to it. Generally, my solution is to use the import tag (as shown in the figure)

import all the configuration files into a general file
and then import the web and XML into the general file as follows

PS: there are some special reasons, which vary from person to person. Hope someone can add!

[Solved] shc -f xxx.sh shc: invalid first line in scrip

shc -f xxx.sh shc: invalid first line in scrip
Problem: The following error occurs when running shc
Code: $ shc -f test1.sh shc: invalid first line in script
Analysis: The script works fine
$cat test1.sh
echo “hello”
cal
Code:
$ shc -f test1.sh
shc: invalid first line in script: echo “hello”
shc: Success
Reason:

You have to put the sha-bang (e.g. #!/bin/bash) at the beginning of the script, since shc need to know which shell is using. Here is an excerpt from the manual page:

Explanation:
Add to the first line of the script ( #! /bin/bash)
Pro-tested available!

[Solved] Django Access to the backend error: Invalid block tag on line 98: ‘trans‘, expected ‘elif , ‘else‘或‘ endif. Did you forget

Error:
django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 98: ‘translate’, expected ‘elif’, ‘else’ or ‘endif’. Did you forget to register or load this tag?

Solution:

Find the the catalog in the error message and then delete the red codes.

Save the file and solve it.

[Solved] httpd:httpd:Could not reliably determine the server‘s fully qualif domain name,using ::1 for Se

In the process of building lamp environment, installing Apache reported an error: starting httpd:httpd :Could not reliably determine the server’s fully qualif domain name,using ::1 for ServerName

Solution:

Edit server profile

vi /etc/httpd/conf/httpd.conf

Find the servername in the file www.example.com : 80 “change to” servername ” www.localhost.com : 80 ”
you can use ‘/’ to find (/ servername) www.example.com : 80)
and remove the previous # cancel comment

Set the server to boot

chkconfig httpd on

Restart Apache

/etc/init.d/httpd restart

For the problem of rejecting old usage errors after numpy is updated, modified in numpy 1.20; for more details and guidance

There’s something wrong with numpy

Because the latest version of numpy is updated today, the previous usage is invalid

So You need to use the latest usage

Originally, my return value is like this

return np.array(df).astype(np.float)

Error:

DeprecationWarning: np.float is a deprecated alias for the builtin
float. To silence this warning, use float by itself. Doing this
will not modify any behavior and is safe. If you specifically wanted
the numpy scalar type, use np.float64 here.

Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
return np.array(df).astype(np.float)

It seems to be because of the version of the problem

If you look at the picture
Modify to the following can be.

return np.array(df, dtype=float)

perhaps

return np.array(df).astype(np.float64)

So you won’t make a mistake

How to Solve Error: The emulator process for AVD was killed.

How to solve the problem of the emulator process for AVD was killed.
my error report:

looking at the error report means that the process has been killed
trying to start from the command line

looking at the error report means that there is no more space
so it’s easy to do
Modify pixel.ini in the directory of C: (users/administrator. Android/AVD

it used to be C: (use) rs\Administrator.android\avd\Pixel_ 2_ API_ 28. AVD
the screenshot is my configured directory

There’s enough space here
restart the simulator and start it immediately

[Solved] ValueError: only one element tensors can be converted to Python scalars

This error occurred in Python.

At first, the reason is that I want to change the list with a tensor to a tensor type, that is, [tensor (), tensor ()] to a tensor, and then I write like this,

a = torch.randn(1,2) # tensor([[-0.4962,  0.6034]])
d = [a, a, a] # [tensor([[-0.4962,  0.6034]]), tensor([[-0.4962,  0.6034]]), tensor([[-0.4962,  0.6034]])]
d = torch.tensor(d)

It’s a mistake. ValueError: only one element tensors can be converted to Python scalars

I see a solution on the Internet,

val= torch.tensor([item.cpu().detach().numpy() for item in val]).cuda() 

This method is very unsophisticated and concise.

Another way is to use torch. Cat, which is very concise. If you want to expand dimensions, you can use operations such as unsqueeze on this basis.

d = torch.cat(d, 0) 

'''
Output: tensor([[-0.4962,  0.6034],
        [-0.4962,  0.6034],
        [-0.4962,  0.6034]])
'''

Not showing null elements JAVA [How to Solve]

Reason:
the list set allows null values. When you add null values to the list, you will report an error after a series of processing

Not showing null elements

Solution:

list.removeAll(Collections.singleton(null));

Before you need to process the list, just use this code
removeAll is to remove all elements in brackets. If the parameter in brackets is empty, it means to remove all elements