Category Archives: How to Fix

Android studio auto import auto import

Since as does not automatically guide packages by default, it needs to be set.

File–> Settings–> Editor–> General–> Auto Import

Automatic import is to put
1. Insert Imports on Paste option changes to All.
2. Check immediately for Optimize imports on the fly
Neil: You’ll Add umambiguous imports on the fly

The following figure

Reference: http://blog.csdn.net/buaaroid/article/details/44979629

R language: na.fail and na.omit

In practice, the data set is rarely complete, and in many cases, the sample will contain several missing values NA, which is troublesome in data analysis and mining.
R language can improve the omit value of samples by na.fail and na.omit.
The

    na. Fail (& lt; Vector a>) : If vector A contains at least 1 NA, error is returned; If NA is excluded, return the original vector ana. Omit (& LT; Vector a>) : Return the vector aattr (na.omit (& LT); Vector a>) , “na.action”) : returns the subscript of na in vector a. Na: determines whether the element in the vector is na

Example:

data< – c (1, 2, NA, 2,4,2,10, NA, 9)
data. NA. Omit< – na. Omit (data)
data. Na. Omit the
[1] 1 2 2 and 4 2 10 9
attr (, “na. The action”)
3 8 [1]
attr (” class “)
[1] “omit”

attr (data. Na. Omit, “na. The action”)
3 8 [1]
attr (” class “)
[1] “omit”

can also be used! X mode conveniently deletes NA. Such as:

a< – c (1, 2, 3, NA, NA, 2, NA, 5)
a[!is.na(a)]
[1] 1 2 3 2 5

.
which is for na na is used to determine whether the element in the vector, returns the result: c (FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE), namely the elements within a as na, its corresponding subscript elements is TRUE, otherwise is FALSE. ! X is the non-logical operator,! Is. Na (a) means that the element inside a is not Na, and its subscript element is TRUE and FALSE conversely. After indexing through A [! Is.na (a)], the element that is not Na in A can be taken out and filtered.
The functions Na. fail and Na. omit can be applied not only to vectors but also to matrices and data boxes.
Example:

data < – read.table(text=”
a b c d e f
NA 1 1 1 1 1
1 NA 1 1 1 1
1 1 NA 1 1 1
1 1 1 NA 1 1
1 1 1 1 NA 1
1 1 1 1 1 NA”,header=T)
na.omit(data)
data
> [1] a b c d e f
< 0 line & gt; (or 0-length row.names)

— — — — — — — — — — — — — — — — — — — — —
the author: SThranduil
source: CSDN
,
https://blog.csdn.net/SThranduil/article/details/71710283 copyright statement: this article original articles for bloggers, reproduced please attach link to blog!

Add a new page in latex

When we use Latex, we sometimes need to start a new page to continue writing. Instead of using \ newPage, you’d better implement this using \ ClearPage.
Because:
\newpage: The \newpage command ends The current page.
\clearpage: The \clearpage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed.
In plain English, when you add a large number of new pages, the two are basically the same. When you add a small number of new pages, \ NewPage won’t achieve the effect you want, but \ ClearPage will.
Here’s an example:
Exp1:
\documentclass[twocolumn]{article}
\usepackage{CJK}
\setlength\textwidth{8cm}
\setlength\textheight{8cm}
\begin{document}
\begin{CJK*}{song}
\CJKtilde
first side
\newpage
sorry, first side
\clearpage
\end{CJK*}
\end{document}

Exp2:
\documentclass[twocolumn]{article}
\usepackage{CJK}
\setlength\textwidth{8cm}
\setlength\textheight{8cm}
\begin{document}
\begin{CJK*}{song}
\CJKtilde
first side
\clearpage
haha, second side
\clearpage
\end{CJK*}
\end{document}

Incomplete and “the Jupiter” distribution was not found

After using PIP Uninstall or Conda Uninstall jupyter, it is common to find that a jupyter notebook has not been fully uninstalled because PIP uninstalls only some of its packages when it is uninstalled.
Complete unloading of jupyter can be used:

pip install pip-autoremove
pip-auto remove jupyter -y

Can delete complete jupyter
It actually deletes the following related libraries, and if there are libraries that other libraries depend on, you can manually uninstall those that are not needed.

pip uninstall jupyter
pip uninstall jupyter_core
pip uninstall jupyter-client
pip uninstall jupyter-console
pip uninstall notebook
pip uninstall qtconsole
pip uninstall nbconvert
pip uninstall nbformat

Pay attention to the PIP/PIP3 switch.
 
“The jupyter” distribution was not found, but on The command line type jupyter still exists, because there are several jupyter computers in The system. This problem seems to be relatively rare, and there are few discussions on CSDN /stack Overflow. I happened to encounter this error today and solved it, so I would like to share the solution here.
The crux of the matter is that it is possible to have multiple versions of jupyters installed in multiple Python/PIP environments, and when PIP Uninstall, only jupyters for this version are uninstalled. The version using piPs can be viewed with which PIP, and you can use which -a PIP to view all piPs installed on your machine.
Therefore, we can see all versions of jupyter with which -a jupyter and then corresponding to one by one uninstall. For the most part, the file paths for jupyter and PIP are the same, so it is enough to remove them with the PIP of that directory.
such as, suppose we see a jupyter path is /usr/local/bin/jupyter, we can use the following command to remove it:

/usr/local/bin/pip uninstall jupyter

Of course you can ls the directory to see all jupyter related libraries, and then use the top of the manual unload way to remove one by one.
Of course it is possible that you have something like jupyter under Snap, if you see a jupyter that is something like /usr/bin/Snap under the directory.
for jupyter, snap remove jupyter can be uninstalled using snap remove jupyter.
Remove all versions of jupyter and a jupyter notebook and then use PIP Install to reinstall, with PIP Install-U PIP of course recommended to update the PIP before installation
Finally, the possible cause of this error is personal analysis under anaconda environment when installing jupyter, using Sudo APT install jupyter-core or Sudo Snap install jupyter. Use conda Install or PIP Install jupyter as far as possible for a jupyter installation.
 

Office 16 Click to run extensibility component uninstall

Do not read the tens of thousands of online reading said to delete the registry, may lead to unknown problems, the following solution from Microsoft official:
Component 64-bit Registration, please try the steps below:
1. Press Win + R To open the Run window, Type “installer” and click Enter to open the folder in File Explorer.Win + R run, Enter installer return
2. Add the column “Subject”. 3. Sort on the Subject column and scroll down until you locate the name “Office 16 click-to-run Extensibility Component 64-bit Registration”.
Follow the theme options information and find the click-to-run Extensibility Component Installer
. 4. Right Click the MSI file and choose uninstall.
Right-click the MSI program and select Uninstall

Python Basics – python3 installing pyhook and pywin32 Libraries

<

pyHook installation/h6>
pyHook library to download their own.
pyHook library access:
lfd.uci.edu
small jujube resource warehouse extraction code: c7fq

When is installed, use PIP install and drag the WHL file directly into the CMD to generate the path.

pywin32 install

CMD PIP install pywin32 is ready to install.
pywin32 is installed and we can use both win32com and pythoncom.

import win32com
import pythoncom

like!

Python 3.7 pyGame download method


open https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

download pygame 1.9.3 – cp37 – cp37m – win_amd64. WHL

PIP install pygame-1.9.3-cp37-cp37m-win_amd64.whl

test type import pygame in python IDLE. If no error is reported, the installation is successful, and then type pygame.ver to see the version number

The difference of four kinds of integer function (fix floor ceil round) in MATLAB

There are four integral functions in Matlab: Fix, floor, Ceil and Round. The specific application methods are as follows:

(1) fix
is rounded in the direction of zero
Such as
Fix (1.3) = 1
Fix (1.3) = 1;

(2) floor
is rounded in the direction of minus infinity (the maximum integer not exceeding x. (gaussian is rounded))
Such as
Floor (1.3) = 2
Floor (1.3) = 1;

(3) ceil
is rounded in the direction of positive infinity (the smallest integer greater than x)
Such as
The ceil (1.3) = 1
The ceil (1.3) = 2;

(4) round
rounded to the nearest integer
Such as
Round (1.3) = 1
Round (1.52) = 2
Round (1.3) = 1
Round (1.52) = 2

 

Installing markdown viewer 3.9 plug-in for Chrome

Download at https://github.com/simov/markdown-viewer/archive/3.9.zip. Unzip the Markdown-Viewer 3.9.zip and put the folder in place.
Open extensions in Your Chrome browser: Chrome :// Extensions /.

To install the MarkDown Viewer plug-in, open developer Mode in the upper right corner, click the Load Unzipped Extension button, and select the Markdown-Viewer directory.

Then drag the extension *.md file into the Chrome browser to view the Markdown document.

Shortcut to exit zoom mode in VirtualBox [off]

Shortcut to exit scale mode in VirtualBox [closed] Shortcut to exit scale mode in VirtualBox [closed]
In Oracle VirtualBox, what is the shortcut to exit zoom mode on a Windows 7 host?


# 1/f,
Reference: https://stackoom.com/question/ixxD/ in VirtualBox exit zoom mode shortcuts – shut down


# 2 floor
To exit Scale Mode, press: To exit Scale Mode, please press:
Right Ctrl (Host Key) + c Right Ctrl (Host Key) + c


Note that your (Host Key) may be different from . please Note that your (Host Key) may be different from your Right Ctrl0. To check the current binding, go to VirtualBox Preferences > Input > Virtual Machine > Host Key Combination. to check the current binding, go to VirtualBox Preferences > Input > Virtual Machine > The Host Key Combination .


The # 3 floor
If Right Ctrl ( Host Key) + C does not work (there have been some issues on Ubuntu), If the right Ctrl ( host key) + C does not work (there have been some problems in Ubuntu), please do the following:
1) File > Preferences > Input on the Virtual Machine which is stuck in Scale Mode 1) file > Preferences & gt; The input card on the virtual machine is in proportional mode
2) Change or Reset the Host Key. 2) Change or Reset the Host Key. There's no need to even save after changing the Settings do not need to save after changing the Settings
3) Re-open the Virtual Machine and it should be reset! 3) reopen the virtual machine, it should be reset!


# 4 floor
Yeah it sucks to get stuck in Scale View. yes, it sucks to get stuck in Scale View.
Host + Home will popup the Virtual machine Settings.Host + Home0 will popup the Virtual machine Settings. (by default Host is Right Control) (by default Host is Right Control)
From there you can change the view Settings, as the Menu bar is hidden in Scale view. From there you can change the view Settings because the Menu bar is hidden in the Scale view.
Had the same issue, especially when you checked the box not to show the 'Switch to Scale view' dialog. will have the same issue, especially if you check the box and it does not display the 'Switch to zoom view' dialog.
This you can do while the VM is running. This can be executed while the VM is running.


The # 5 floor
I arrived at this page looking to turn off scale mode for good, so I look at the time I would share what I found: , I look at the time I go to bed. Now I want to turn off the zoom mode, so I think I'll share what I've found:

VBoxManage setextradata global GUI/Input/MachineShortcuts "ScaleMode=None"

Running this in my host's terminal worked like a charm for me. Running this in my host's terminal worked like a charm for me.
Source: https://forums.virtualbox.org/viewtopic.php?f=8& T = 47821 source: HTTPS:// forums.virtualbox.org/viewtopic.php?F = 8&t = 47821


# 6 building
The other solution (poor one) is to exit the VM Box and save the desktop (top option), and reboot to bring back the screen just as before rezooming.

Remove M Characters “Control M” or “^M” or “CTRL M” Characters in a UNIX file

ubuntu:
sudo apt-get install dos2unix
dos2unix file

ohh do you want to remove M characters in UNIX ?Though i am not so good in UNIX but this time i had to get my hand dirty in UNIX.
Reasons were, there is no one to support things from UNIX perspective. And all of sudden I got 20+ UNIX scripts to work upon. You can imagine that what would have happened to me. I am in one among them who does not even like to see that raw black screen. It is a bizarre for me!!!!!  This happens when you import files from MS-DOS to UNIX system and is a very common issue,                      
Objective of this post is to address below questions

    Why I am seeing ^M (control M ) character in UNIX file ? How to make my UNIX script  \ file clean and without ^M (control M) character?What’s the best method to remove M characters or ( ^M ) from any UNIX file ?

You can do it by two ways. Script or manual, and my vote will be for Script as it has only one step as opposite to manual method where we need to perform two steps. Moreover it helps you to be calm when everyone in a team is spoiling files on which you are supposed to work !!!!!!!.  

 

Remove M Characters (^M) with Unix commands 
Using dos2unix  command

dos2unix ORIG_FILENAME TEMP_FILENAME 

mv TEMP_FILENAME ORIG_FILENAME 

IMP NOTE:
 use dos2ux command if you are using HPUX 

Using sed command

sed ‘s/^M//g’ ORIG_FILENAME > TEMP_FILENAME 

mv 
TEMP_FILENAME 
ORIG_FILENAME 

IMP NOTE: To get ^M in UNIX (Hold control key and then press v and m character). 

 

Using vi Editor 

 

ESCAPE   :%s/^M//g ENTER 

IMP NOTE: To get ^M in UNIX (Hold control key and then press v and m character). 

Remove M Characters (^M) with Unix Script 
You can put above command in UNIX and it will do wonder as now you just have to give one parameter to that script. A script code is below and looks at the picture to understand that how it works.

#!/bin/sh

TEMPORARY _FILE=”/TEMP_FOLDER/$$”

if [ $# -ne 1 ] ; then

echo “USAGE $0 Provide-Dos-File-Name”

exit 4

fi

dos2unix $1 > $TEMPORARY_FILE && mv $TEMPORARY_FILE $1

#############################################################

### Enable below for HPUX

#dos2ux $1 > $TEMPORARY_FILE && mv $TEMPORARY_FILE $1

#############################################################

 


Unix Script for Removing CTRL M Character – Screen Shot

To Remove m Characters:

Step 1 : save script as w2x 

Step 2: if you are in same directory call script as w2x FileName_To beConverted

Step 3: Confirm that file doesn’t have ^M character in it now by opening it in vi editor. Important that these characters are only visible in Vi can can’t be seen through more or cat. 

 

To call it from anywhere: you need to make small entry in .profile or .login or .cshrc file which is generally hidden and can’t be seen simply. you can use  (ls -a) to see hidden files.

 

Request you to share through comments if you are aware of any other method  to remove M characters (^M) in UNIX.

Thanks 

https://etllabs.com/unix/remove-m-characters-ctrl-m-unix/1944/