Tag Archives: markdown

[Solved] Markdown Edit Formula Error: ParseError: KaTeX parse error: {align} can be used only in display mode

Problem description

Edit formula:

$\begin{align}
  & \sum\limits_{i=1}^{n}{k=\frac{1}{2}}n(n+1) \\ 
 & \text{       }=\Theta ({{n}^{2}}) \\ 
\end{align}$

Markdown Error: ParseError: KaTeX parse error: {align} can be used only in display mode
Error: KaTeX parse error: No such environment: align at position 7: \begin{̲a̲l̲i̲g̲n̲}̲ & \sum\limit…

Solution:
Modify {align} to {aligned}, KaTeX is not support align, you need to modify to aligned.
Layout
Next, modify the formula layout so that the formula surrounded by $$ by KaTeX is centered.
\limit can make n and i=1 located directly above and below the accumulation symbol. ​

$$
\begin{aligned} 
\sum_{i=1}^{n} k &=\frac{1}{2} n(n+1) \\ 
&=\Theta \left(n^{2}\right) 
\end{aligned} 
$$

Registry key Error: Java version has value ‘1.8‘, but ‘1.7‘ is required

Registry key Error: Java version has value ‘1.8’, but ‘1.7’ is required

Problem Description:

1. Jdk1.7.0 is installed first_ After 80, jdk1.8.0 was installed_ 181. The former is configured in the environment variable
2. The following error occurs when entering Java – version in CMD:

Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.7', but '1.8' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

Problem solving:

When upgrading from jdk1.7 to JDK1.8, there are three things to confirm:

1. System environment variables

2. Registry

Computer \ HKEY_ LOCAL_ MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

3. Update java.exe javaw.exe javaws.exe under C: \ windows \ system32

Error caused by too many versions of JDK installed on the computer

For example, there was no problem installing 1.7

After installing 1.8 and modifying the environment variables, the java.exe javaw.exe javaws.exe under C: \ windows \ system32 is still in the 1.7 installation package.

Just replace the java.exe of 1.7 with Java 1.8.

Solve the problem of reporting errors when tsfresh downloads UCI har dataset

Problem description

Run this code`

from tsfresh.examples.har_dataset import download_har_dataset, load_har_dataset, load_har_classes

# fetch dataset from uci
download_har_dataset()

Then an error is reported
connectionerror: httpsconnectionpool (host = ‘GitHub. Com’, port = 443): Max retries exceeded with URL:/maxbenchrist/human activity dataset/blob/Master/UCI% 20har% 20dataset. Zip?Raw = true (caused by newconnectionerror (‘lt; urllib3.connection.HTTPSConnection object at 0x0000023C7EDBDEE0>: Failed to establish a new connection: [winerror 10060] the connection attempt failed because the connecting party did not reply correctly after a period of time or the connected host did not respond. ‘)

resolvent

    open link
    [ https://github.com/MaxBenChrist/human-activity-dataset.git ]
    manually download the dataset, manually copy the human activity dataset master to ~/anaconda3/lib/site packages/tsfresh/examples/data/UCI har dataset, and rename it to UCI har dataset

    be careful:

    The location of the folder must be correct, otherwise an error will be reported
    location: ~/anaconda3/lib/site packages/tsfresh/examples/data/UCI har dataset/UCI har dataset

    Then you can load the data correctly!!!!!!

MarkDownPad 2 HTML Reading Error

MarkDownPad 2 HTML Reading Error

Question:

when “HTML reading error” error occurs when opening markdownpad editor


Solution:

click the “yes” button on the error prompt interface


To install the plug-in:

Download awesomium_ v1.6.6_ sdk_ The win.exe plug-in can be installed by default all the way 0


Markdownpad2 Error: Html Rendering Error (An error occurred with the Html rendering component.)

window 10 after installing markdownpad2 software, open the software prompt: an error occurred with the HTML rendering component. This </ font> as shown in the figure below:

error reason: markdownpad 2 has this view has crashed in win10.


Solution: install a SDK toolkit.

1. Click the prompt box below: “yes” to enter the official website directly and automatically http://markdownpad.com/faq.html#livepreview -DirectX

2 as shown in the figure below: click awesomium 1.6.6 SDK </ font> to enter download

3 after download, click Install, as shown in the figure below:



4. After the installation is completed, reopen the markdownpad 2 software, and no error will appear. Write something casually, as shown in the figure below:

Change Jupyter Notebook Default Directory

Change Jupyter Notebook Default Directory

There are three way to change the default (i.e., start-up) directory of jupyter notebook.

Solution #1
1. Use command line (aka, cmd), run the following command: this will generate a config file (jupyter_notebook_config.py), in your working location (C:\Users[Your Username].jupyter).
jupyter notebook --generate-config
2. Goto that location (C:\Users[Your Username].jupyter) and edit file jupyter_notebook_config.py as follow.
Find line:

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

3. Delete the “#” and type your default directory inside the ”. (Make sure the directory is exist, or it may causes some troubles)
For example:

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'E:\Default Jupyter Dir\'

Solution #2
1. Find the Jupyter Notebook execute file.
2. Right click the file
3. Find “properties” tab and click it; this will lead you to the “Jupyter Notebook Properties”
4. Check the pop-up window, and you should see “Start in” property.
5. Change the directory to your default directory, e.g., ‘E:\Default Jupyter Dir\’
Solution #3

This solution is based on Anaconda, since Jupyter Notebook load the profile from Anaconda.

You may see the following information from properties window if you had gone through Solution #2.

"Target: D:\Anaconda3\python.exe d:\Anaconda3\cwp.py d:\Anaconda3 "d:/Anaconda3/python.exe" "d:/Anaconda3/Scripts/jupyter-notebook-script.py" %USERPROFILE%"

1. Goto the Anaconda installed location.
2. Find the ‘etc’ directory in Anaconda.
3. Open file ‘jupyter_notebook_config.json’
4. Add your default directory to the ‘notebook_dir’.

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.

Renaming the column name of data frame in R language

Error type
Error: All arguments must be named

The use of rename in plyr is different from that in dplyr.

plyr::rename

rename(data, c(old=new))

dplyr::rename

rename(data, new = old)

Example

For example, the default is plyr’s rename. Run the following command, and an error will be reported :

d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
d
library(tidyverse)
rename(d, c("old2"="two", "old3"="three"))
rename(d, c(old2="two", old3="three"))

result

> d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
> d
  old1 old2 old3
1    1    4    7
2    2    5    8
3    3    6    9
> library(tidyverse)
> rename(d, c("old2"="two", "old3"="three"))
Error: All arguments must be named
> rename(d, c(old2="two", old3="three"))
Error: All arguments must be named

:

d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
d
rename(d, two=old2, three=old3)

result:

> d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
> d
  old1 old2 old3
1    1    4    7
2    2    5    8
3    3    6    9
> rename(d, two=old2, three=old3)
  old1 two three
1    1   4     7
2    2   5     8
3    3   6     9

Either

or with plyr modified in the first way :

d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
d
library(tidyverse)
plyr::rename(d, c("old2"="two", "old3"="three"))
plyr::rename(d, c(old2="two", old3="three"))

result:

> d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
> d
  old1 old2 old3
1    1    4    7
2    2    5    8
3    3    6    9
> library(tidyverse)
> plyr::rename(d, c("old2"="two", "old3"="three"))
  old1 two three
1    1   4     7
2    2   5     8
3    3   6     9
> plyr::rename(d, c(old2="two", old3="three"))
  old1 two three
1    1   4     7
2    2   5     8
3    3   6     9

done!!!!!!

key points, dplyr is the new name in front, the old name is placed behind, and without quotes, not c(), more convenient!!

In addition, the select in dplyr can also select + the name, directly specifying the number of columns!!

d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
d
select(d,one=1,three=3)

result:

> d <- data.frame(old1=1:3, old2=4:6, old3=7:9)
> d
  old1 old2 old3
1    1    4    7
2    2    5    8
3    3    6    9
> select(d,one=1,three=3)
  one three
1   1     7
2   2     8
3   3     9