Author Archives: Robins

RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating enviro

An error occurred during installation of conda
RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating environment.
 
This error occurs because the ‘Requests’ package was installed with PIP and is triggered if you install other packages using CANDA.
Solutions:
1, Use PIP uninstall packagename to uninstall the package, it is not recommended to use this, it will cause other errors.
2. Use PIP packagename to install the package
Good luck
Reference:
https://blog.csdn.net/weixin_40405758/article/details/88094405

Removeerror: ‘requests’ is a dependency of CONDA and cannot be removed from CONDA’s o

Preparing transaction: done
Verifying transaction: failed

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

The solution
run

conda update conda

portal

Error record: this.requestWindowFeature ( Window.FEATURE_ NO_ Title) error or no effect

The requestWindowFeature method must be placed before the content view is initialized. I checked that this is the first one, but later I found that I changed the class inheritance. Before I inherited the Activity, I changed the class inheritance to AppCompatActivity.
At first I wondered if it was possible that AppCompatActivity had done something in its own super.onCreate. So the

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

On the

super.onCreate(savedInstanceState);

Finally, in the manifests file, we add an attribute to the Activity:

android:theme="@style/Theme.AppCompat.Light.NoActionBar"

solves the problem.

The title bar is not an ordinary title bar. It is called ActionBar. Another solution is to call it after setContentView

getSupportActionBar().hide();

solves the problem.

Request window feature for Android Development( Window.FEATURE_ NO_ Title) does not take effect

What if you want to hide the ActionBar but the requestWindowFeature(window.feature_no_title) doesn’t work?
Reason: because they define the Activity of inherited android. Support. V7. App. AppCompatActivity, AppCompatActivity itself does not support requestWindowFeature (Window. FEATURE_NO_TITLE) cause, can change to inherit the Activity.

Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution

Reprint please indicate the source: http://blog.csdn.net/java201159416/article/details/51940074

general app has a demand to hide the Android default Title bar, is usually used before setConvertView call requestWindowFeature (Window. FEATURE_NO_TITLE), after can sometimes find call this line of code has no effect, Very depressed.
through observation, before the Activity is to inherit the Activity, so is valid, and I am AppCompatActivity inherited, so can’t hide.
solution:
1. Let xxxActivity inherit the Activity
2. Inherit AppCompatActivity and call it in the onCreate method

if (getSupportActionBar() != null){
   getSupportActionBar().hide();
}

And then we’re done.

[Android] using request window feature( Window.FEATURE_ NO_ Title) method to remove the title invalid solution

I used to use Eclipse to write APP, but today I try to use Android Sutido to write APP. I need to hide the title bar in the APP and use a custom title bar. It turns out that using requestWindowFeature(window.feature_no_title) method has no effect, and the title is not hidden

public class TitlebarActivity extends AppCompatActivity

In Android Studio, activities inherit from AppCompatActivity by default, so the requestWindowFeature(window.feature_no_title) method fails.

There are two solutions

    > change AppCompatActivity to Activity, then requestWindowFeature(window.feature_no_title); Add the following code to the onCreate() method:
if (getSupportActionBar() != null){
   getSupportActionBar().hide();
}

Now you can hide the title bar.

Nginx can’t successfully reload

Nginx could not reload smoothly
A problem with Nginx being unable to dynamically hot reload was encountered
The daemon and master processes were shut down for debugging purposes before being discovered

daemon off;
master_process off; 

This causes the reload management to fail

#daemon off;
#master_process off; 

Comment out and it’s OK.

Chrome local file translation tool

Chrome native file translation tool
Translation tool: https://qingcms.gitee.io/translator/

Chrome native files can not be translated solution

    Click to select local file and use the browser to translate the current page to refresh the page, you can re-select the file;
    can open multiple browser tabs and translate multiple files at the same time
The file will be displayed on the current page and the file will not be uploaded (JS FileReader). The tested browser: Chrome, Edge

VirtualBox + CentOS 7 virtual machine setting static IP address of host only NIC

I am not familiar with the use of VirtualBox. Every time I start the virtual machine, it will be automatically assigned a dynamic IP address (hosting-only), which is very inconvenient for me to use Hadoop and so on. I skipped this problem before, but it took me half a day to solve it finally today.
Specific treatment methods are as follows:
1. Start VirtualBox and select “Administration” –>; “Global Settings”, in the pop-up window, select “Network”, and then in the right window, select the “Host-only Network” TAB, as shown below;

If you don’t have a VirtualBox Host-only Ethernet Adapter, you can add it by clicking “+” on the right.
Then double-click the VirtualBox Host-Only Ethernet Adapter and the following image will pop up:

Select “DHCP Server” and uncheck the “Enable Server” status.


2. Start the virtual machine
Enp0s3 and enp0s8 represent two network cards: Enp0s3 and enp0s8 represent two network cards:
[hadoop@xhp1s2 ~]$ ifconfig
enp0s3: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> MTU 1500
inet6 fe80::a00:27ff:fe4c:2f5b prefixlen 64 scopeid 0x20< link>
ether 08:00:27:4c:2f:5b TXQueuelen 1000 (Ethernet)
Packets 28 bytes 3361 (3.2 Kib)
R>rors 0 dropped 0 overruns 0 frame 0
Tx Pack>58 Bytes 6795 (6.6kib)
errors 0 dropped 0 overruns 0 carrier 0 Collision-losing 0
br> <>bb3 enp0s8: flags=4163< UP,BROADCAST,RUNNING,MULTICAST> MTU 1500
inet6 Fe80 :: A00:27ff: Fe46: D7F8 Prefixlen 64 scopeid 0x20< link>
ether 08:00:27:46: D7: F8 TXQueuelen 1000 (Ethernet)
Packets 24 bytes 6616 (6.4Kib)
R>rors 0 dropped 0 overruns 0 frame 0
Tx Pack>81 9555 bytes (9.3 KiB)
the TX errors 0 dropped overruns carrier collisions 0 0 0 0

In the directory CD /etc/sysconfig/network-scripts, you will see the presence of IFCFG-ENP0S3 file, copy a copy and change the name to IFCFG-ENP0S8, then edit IFCFG-ENP0S8, the final file contents are as follows:
TYPE=Ethernet
HWADDR= 08:00:27.46 :d7:f8 This indicates that the virtual network card address)
BOOTPROTO = static (here to change into the static)
DEFROUTE = yes
PEERDNS = yes
PEERROUTES = yes
IPV4_FAILURE_FATAL = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_PEERDNS = yes
IPV6_PEERROUTES = yes
IPV6_FAILURE_FATAL = no
NAME = enp0s8
UUID = 3 d54f693 – c56 bbef – 4-8984 – e0495a7c21s2 (this unlike enp0s3 coding)
DEVICE = enp0s8
ONBOOT = yes
IPADDR = 192.168.56.103
NETMASK = 255.255.255.0
GATEWAY = 192.168.56.1
Once this is done, start Service Network Restart and everything is OK.

A solution to the default invalid host only mode of CentOS virtual machine in VirtualBox

Because the network card is not activated at boot time.
Go to /etc/sysconfig/network-scripts/
Inside is the network card configuration file. Usually the hostonly configuration file name is: IFCFG-ENP0S8
If you open this file, you can see the ONBOOT=no line configuration. Change it to ONBOOT=yes and restart the virtual machine.

Initialization order of Java objects

The order in which Java objects are initialized

    static block of the parent class, static properties of the parent (tied for priority, according to the code in order to perform)
    (only in class load for the first time to perform a) subclasses of static code block, a subclass of static properties (tied for priority, according to the code in order to perform)
    (only in class load for the first time to perform a) code blocks in the construction of the parent class of the parent class non-static properties (tied for priority,
    every new object is executed) p>t constructor
    (every new o>t is executed) subclass constru> block, the non-static properties of the subclass (tie precedence, According to the code in order to perform)
    (once every new object will perform a) subclass constructor
    (once every new object will perform a)