Tag Archives: )

Oserror: cannot open resource (pilot error handling)

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

https://www.jianshu.com/p/c64ae3e9b196

Oserror: can’t open resource error handling in using memo of pilot

In the process of using pilot, python program appears: oserror: cannot open resource prompt

Pilot error prompt

File "E:\06_python\python_demo\MyBlog\web\views\account.py", line 89, in test2
    img, code = create_validate_code()
  File "E:\06_python\python_demo\MyBlog\utils\check_code.py", line 92, in create_validate_code
    strs = create_strs()
  File "E:\06_python\python_demo\MyBlog\utils\check_code.py", line 80, in create_strs
    font = ImageFont.truetype(font_type, font_size)
  File "C:\Users\ic\AppData\Local\Programs\Python\Python35\lib\site-packages\PIL\ImageFont.py", line 280, in truetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "C:\Users\ic\AppData\Local\Programs\Python\Python35\lib\site-packages\PIL\ImageFont.py", line 145, in __init__
    layout_engine=layout_engine)
OSError: cannot open resource
[11/May/2019 15:07:57] "GET /test2.html HTTP/1.1" 500 92941
Performing system checks...

This is a common font problem
in the windows environment, the font is usually located in the C:// Windows/fonts folder. Users can check whether the font specified in the python program exists in this folder

Error log: resource leak: ‘xxx’ is never closed (precautions for scanner class)

This article gives you a comprehensive understanding of Java object serialization and deserialization>>>

When using the scanner class, for example:

 1 import java.util.Scanner;
 2 public class data {
 3 
 4      public static void main(String[] args){
 5          Scanner i=new Scanner(System.in);
 6          float j=i.nextFloat();
 7          System.out.println(j); 8      }
 9 }

A warning appears

Resource leak: 'i' is never closed

error reason: the data input scanner named I is declared, so as to obtain the configuration memory,

but the memory is not closed or released at the end, and a warning appears. Therefore, I. close () is used at the end of the mian function; End the data stream and free the memory

mysql Slave_IO_Running:NO [How to Solve]

mysql Slave_IO_Running:NO (How to Solve)

Description:

Slave_IO_Running:NO

Slave_SQL_Running:Yes

Seconds_Behind_Master: NULL

I have encountered the following two cases of Slave_IO_Running:NO.

1. in the configuration of slave synchronization because the slave does not have permission to access the master caused.

2. the mysql-bin.xxxxxxx file on the master was deleted by me by mistake.

For the first case, double-check the database access rights to solve.

For the second case, the following is a little more detailed.

mysql> show slave status\G

*************************** 1. row ***************************

Slave_IO_State:

Master_Host: 192.168.3.21

Master_User: slave

Master_Port: 3307

Connect_Retry: 60

Master_Log_File: mysql-bin.000016

Read_Master_Log_Pos: 173

Relay_Log_File: mysqld-relay-bin.000008

Relay_Log_Pos: 98

Relay_Master_Log_File: mysql-bin.000016

Slave_IO_Running: No

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table: br> Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 173

Relay_Log_Space: 98

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: NULL

1 row in set (0.00 sec)

[root@slave mysql]# tail /var/log/mysqld.log

081223 15:51:50 InnoDB: Started; log sequence number 0 43655

081223 15:51:51 [Warning] Neither –relay-log nor –relay-log-index were used; so replication may break when

this MySQL server acts as a slave and has his hostname changed!! Please use ‘–relay-

log=/var/run/mysqld/mysqld-relay-bin’ to avoid this problem.

081223 15:51:51 [Note] /usr/libexec/mysqld: ready for connections.

Version: ‘5.0.45-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3307 Source distribution

081223 15:51:51 [Note] Slave SQL thread initialized, starting replication in log ‘mysql-bin.000016’ at

position 173, relay log ‘/var/run/mysqld/mysqld-relay-bin.000007′ position: 98

081223 15:51:51 [Note] Slave I/O thread: connected to master

[email protected]:3307”>’[email protected]:3307’

, replication started

in log ‘mysql-bin.000016’ at position 173

081223 15:51:51 [ERROR] Error reading packet from server: Could not find first log file name in binary log

index file ( server_errno=1236)

081223 15:51:51 [ERROR] Got fatal error 1236: ‘Could not find first log file name in binary log index file’

from master when reading data from binary log

081223 15:51:51 [Note] Slave I/O thread exiting, read up to log ‘mysql-bin.000016’, position 173

081223 15:51:58 [Note] Error reading relay log event: slave SQL thread was killed

Solution steps.

Restart the master library: service mysqld restart

mysql> show master status;

+——————+———-+————–+——————+

| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |

+——————+———-+————–+——————+

| mysql-bin.000001 | 98 | | |

+——————+———-+————–+——————+

mysql> slave stop;

mysql> change master to Master_Log_File=’mysql-bin.000001′,Master_Log_Pos=98;

mysql> slave start;

mysql> show slave status\G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.3.21

Master_User: slave

Master_Port: 3307

Connect_Retry: 60

Master_Log_File: mysql-bin.000001

Read_Master_Log_Pos: 98

Relay_Log_File: mysqld-relay-bin.000002

Relay_Log_Pos: 235

Relay_Master_Log_File: mysql-bin.000001

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 98

Relay_Log_Space: 235

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: 0

1 row in set (0.00 sec)

For piix4_ Solution of SMBus * * host SMBus controller not enabled (detailed steps summary)

Why can’t you grab tickets when you travel on holiday?Reveal the key technology of 12306 how to ensure the ticket is not oversold>>>

The first time I installed Ubuntu 16.04, I met piix4_ The problem of SMBus * * host SMBus controller not enabled makes it impossible to access the Ubuntu desktop. After searching for various solutions on the Internet, I find that the same solution is written in different ways. It’s difficult for novices to understand the lack of a step. So I summarize the detailed solution process and hope to learn from you together. For the first time, I’ll write it in my own format

Difficulty: when I first learned Linux, I didn’t understand the VIM command, which is the biggest difficulty of this method

Step 1: if you can’t enter the desktop operation, press Ctrl + Alt + F1 ~ F6 to enter the command line terminal, use the command to operate, input your own account number, and then enter the password

Step 2: enter the root mode: enter the Su command, and then enter the password you set. There is a pit here. The premise is that you have set the root permission and set the root password. If not, you need to set it; Refer to this article: https://www.cnblogs.com/vitre/p/5227456.html

Step 3: enter the command lsmod | grep I2C_ Piix4, view I2C_ Piix4, note the space here

Step 4: enter the command VI/etc/modprobe.d/blacklist.conf to enter the blacklist. You need to be reminded that you have started to enter the VIM mode. The next step is to use a separate command technique. Because you are a beginner, you have made many mistakes. You can check the VIM commands and get familiar with them. You can see this article: https://blog.csdn.net/weixin_ 37657720/article/details/80645991

Step 5: press g to jump to the last line

Step 6: press I to enter editing mode

Step 7: add a line of blacklist I2C_ Piix4. Here, you can directly input the last line of the original code, and then press enter to form a separate line. This operation is to convert I2C into a single line_ Piix4 is forbidden. Here, I understand that blacklist is like a black box, in which unnecessary things are put and a small black room is closed

Step 8: press ESC to exit editing mode

Step 9: input “: WQ!”, Here is the VIM command, which means forced save and exit

Step 10: input sudo reboot to restart

Basically, the above operation can solve piix4_ SMBus * * host SMBus controller is not enabled, but it can’t guarantee that it can solve the problem of failing to enter the desktop. If it still can’t enter, it’s necessary to find other problems

Filesystem.squashfs error in installing Ubuntu – solution (for reference)

SquashfsErrors:

unable to boot from the Ubuntu LiveCD, due to SquashFS errors like this:

SQUASHFS error: sb_bread failed reading block 0x9d7f3
SQUASHFS error: Unable to read fragment cache block [275faa28]
SQUASHFS error: Unable to read page, block 275faa28, size 23a7

method1:adding the ide=nodma or acpi=off allowed them to work around this issuemethod2:

You can add those lines to the grub entry, either in the grub.conf file or either entering letter ‘e’ on the grub menu and after editing Control+x to boot:

Add to the grub line:

all_generic_ide pci=nommconf

Add to the kernel line:

ide=nodma acpi=off

Ultra character map for Mac

Which MAC font manager works well?Bring you the ultra character map Mac version. The ultra character map Mac version is a font management tool on the Mac platform, which can help us manage a large number of fonts easily and preview fonts conveniently

Features of ultra character map mac

1. Unlock everything your font provides

Access any character, symbol or symbol in any font and use it in your file

2. Interesting colors and 3D effects

Use colors and 3D effects of any nature to create your own clip art, symbols or symbols

3. Say it with an expression

Ultra character map allows you to get all the character emoticons used in OS X, just drag or copy to your document

4. A simple way to compare fonts

Once in the text, scroll through the list to preview each font. Don’t want to see all your fonts?You can sort by style, list, filter, collect or name. Ultra character map allows you to preview title or paragraph text, including preset samples, to save you more time

5. Printed font catalogue and font samples

Ultra character map can print custom font catalog, font samples and feature maps or save them as PDF files

Ultra character map address:

https://www.macw.com/mac/2011.html