Category Archives: How to Fix

Running bat batch file in background

Scene:
When executing the bat file through the Windows timing task, the CMD window will pop up. If you do not want to be disturbed by the black box pop up, you can solve the problem by the following methods.
Solutions:
Add the following code at the beginning of the batch file:

if "%1"=="hide" goto CmdBegin
start mshta vbscript:createobject("wscript.shell").run("""%~0"" hide",0)(window.close)&&exit
:CmdBegin

 
 

Basic use of filter

The Filter Filter
It is one of the three main components of JavaWeb. Three components are: Servlet program, Listener, Filter Filter. Filter Filter is the JavaEE specification. It’s also the interface. The Filter Filter is used to intercept requests and Filter responses. Common application scenarios for intercepting requests are:
Permission checking diary operation transaction management requirements: Under your web project, there is an admin directory. All resources in the admin directory (HTML pages, JPG images, JSP files, and so on) must be logged in by the user before they can be accessed.

import com.wz.userManager.pojo.User;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebFilter(filterName = "UserCenterFilter",urlPatterns = {"/pages/*"})
public class UserCenterFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest)servletRequest;
        HttpServletResponse resp= (HttpServletResponse)servletResponse;
        HttpSession session = req.getSession();
        User username = (User) session.getAttribute("user");
        if(username==null){
            servletRequest.getRequestDispatcher("/login.jsp").forward(servletRequest,servletResponse);
        }else{
            filterChain.doFilter(servletRequest,servletResponse);
        }

    }

    @Override
    public void destroy() {

    }
}

Insufficient table space ORA-00604 unable to extend table SYS.AUD by 8192

To check the disk space is normal, refer to Oracle Trace cleanup
 
/u01/app/oracle/diag/rdbms/xe/XE/trace
 
Root login
Docker exec -it oracle /bin/bash to enter docker
su – oracle
sqlplus /nolog
conn/as sysdba
 
 
Set SQLPlus mode to display total number of rows/width of rows (current connection in effect) :
show pagesize; View the current PageSize
show linesize; View the current linesize width
set pagesize 300;
set linesize 2000;
 
Modify the installation directory glogin. SQL file (permanent) :
set pagesize 300;
set linesize 1000;
 
SELECT * FROM dba_data_files;
SELECT * FROM dba_free_space;
 
View the tablespace
col Tablespace_Name format a20
col total format a15
col used format a15
col unUsed format a15
col rate format a15
col file_name format a100
The SELECT a.F ILE_ID, a.T ablespace_Name, a.T otal | | ‘M’ total, (a.T otal – b.u nUsed) | | ‘M’, informs, b.u nUsed | | ‘M’ unUsed, Round ((a.T otal – b.u nUsed)/a.T otal * 100, 2) | | ‘%’ rate, a.F ile_name
From (Select FILE_ID,Tablespace_Name,Round(bytes/1024/1024,2) total,file_name FROM dba_data_files) a
LEFT JOIN (SELECT FILE_ID ,Round(sum(blocks*8192/1020/1024),2) unUsed FROM dba_free_space GROUP BY FILE_ID) b ON a.FILE_ID=b.FILE_ID
ORDER BY ((a.total-b.unUsed)/a.total) desc;
 
Alter database datafile ‘/dbdata/bossdb/data/web_db001.dbf’ resize 15000m;
The alter database datafile ‘/ ora/oradata/radius/undo. DBF’ resize 1024 m;
ALTER DATABASE DATAFILE ‘C :\ SMARTDB01.ORA’ AUTOEXTEND ON; // Turn on auto growth
ALTER DATABASE DATAFILE ‘C :\SmartDB01.ora’ AUTOEXTEND ON NEXT 200M; // Automatically increase 200M each time
ALTER DATABASE DATAFILE ‘c:\ smartdb01.ora ‘AUTOEXTEND ON NEXT 200M MAXSIZE 1024M; // The maximum value of the data table is not more than 1G
 
 
— Check single table occupancy
The select segment_name, Round (bytes/1024/1024, 2) | | ‘M’, informs the from dba_segments where the owner = USER order by bytes asc
 

Matlab im show squeeze

clc, clear
firstns = imread(‘Noisy_image1.jpg’);
% [M, N,L,P] = size(firstns)
% Ns = zeros(8,M,N,L);
% b =size(Ns);
for i = 1:8

tempname = strcat('Noisy_image',num2str(i),'.jpg');
Ns(i,:,:,:) = imread(tempname);

% N = imread(tempname);
% imshow (Ns (I, : 😅)

% end imge = squeeze (Ns (1, :, : 😅);
imshow(imge);
imshow(imge);
imshow(imge);
imshow(imge);

Abnormal reading after stm32f4 RTC time setting

RTC_GETTIME () and RTC_GETDATE () were ordered in different order, the time should be read first and then the date should be read, then OK!

void set_time(struct time_st *t) {
c_datetypedef date_value;
RTC_TimeTypeDef time_value;

te_value. RTC_Date = t->; D; .
date_value RTC_Month = t – & gt; M; .
date_value RTC_WeekDay = t – & gt; W; .
date_value RTC_Year = t – & gt; Y;
RTC_SetDate (RTC_Format_BIN, & amp; date_value);// set date

time_value. RTC_H12 = RTC_H12_AM; .
time_value RTC_Hours = t – & gt; h; .
time_value RTC_Minutes = t – & gt; m; .
time_value RTC_Seconds = t – & gt; s;
RTC_SetTime (RTC_Format_BIN, & amp; time_value); // Set time
}
Void get_time(struct time_st *t, struct time_st *t, struct time_st *t, struct time_st *t);
RTC_TimeTypeDef time_value;

RTC_GetTime (RTC_Format_BIN, & amp; time_value);
RTC_GetDate(RTC_Format_BIN,& date_value);

->; Y = date_value.RTC_Year;
t – & gt; M = date_value.RTC_Month;
t – & gt; D = date_value.RTC_Date;
t – & gt; W = date_value.RTC_WeekDay;

t – & gt; h = time_value.RTC_Hours;
t – & gt; m = time_value.RTC_Minutes;
t – & gt; s = time_value.RTC_Seconds;
}

The difference between classnotfoundexception and NoClassDefFoundError

Two exceptions that are commonly encountered in Java development are ClassNotFoundException and NoClassDefFoundError.
surface seems can’t find the abnormal, but specific what difference?
As their name suggests: NoClassDefFoundError is an Error, and ClassNotFoundException is an exception.
there is a difference between errors and anomalies in Java, we can recover from abnormal program but it should not be trying to recover from errors,
that is the Exception we can use the try… The catch… If an Error occurs, we cannot resume normal execution of the program.
ClassNotFoundException:
ClassNotFoundException is usually exposed at compile time, but can also occur at run time because of Java’s reflection and dynamic loading of classes. Java supports dynamically loading classes using the Class.forName method. Passing the Class name of any Class as an argument to the method will cause the Class to be loaded into the JVM memory. If the Class is not found in the classpath, then a ClassNotFoundException is thrown at runtime.
1) Missing JAR package.
1) missing JAR package.
2) There is no shortage of JARs, dependencies conflict, and dynamic loading (especially in frameworks such as Spring/Dubbo) can also occur.
3) There is no shortage of JARs and no conflicting dependencies, but class isolation is still possible (for example, there is a custom ClassLoader during framework execution that breaks the parental delegate mechanism), as is the Tomcat container.

NoClassDefFoundError:
ClassDefFoundError is not due to missing packages or class conflicts, but rather class initialization failure.
If the JVM or ClassLoader instance tries to load a class (either through normal method calls, or by using new to create new objects), the class definition is not found. The class you are looking for exists at compile time but cannot be found at run time. The error is when you use the new operator to create a new object but cannot find the corresponding class for that object. This will result in a NoClassDefFoundError. Since the NoClassDefFoundError is caused by a JVM, you should not attempt to catch this error.
1) private member variable initialization failed.
1) private member variable initialization failed.
2) Static member variable initialization failed.
3) Static code block execution exception…

Servlet page Jump error 500

Idea to deploy the servlet submit page jump, error 500 page report
error message jar package not add
in fact has been added to the project required jars
solution: in the tomcat lib folder under the required jars are added

Mobile app development: installation and configuration of react native

Mobile APP development: React Native installation and configuration

Node (version 12 above)
K (version 1.8)
y>(NPM install -g Yarn)
Android>dio (update)
Android SDK <>> Use stable scientif>eb tools
Node (version 12 or higher)

1. Double-click to run
. Enter node-verson on the console to see the current version
JDK (version 1.8)
(1.9 and higher is not currently supported. Note that 1.8 is also officially called 8).
JDK download https://www.oracle.com/java/technologies/javase-downloads.html
configuration JDK environment variables:
1, enter the system environment variables, a new environment variable, added to the Path.
2, enter the console, enter Java and javac respectively, to determine whether the installation is successful.
Android Studio (Update)

Update it to the latest by selecting the Updata update in Configure.
After the update:
select the “Custom” option in the installation screen and make sure the following items are selected:

Android SDK Platform
droid Virtual Device
T>click “Next” to install the selected component.
Android SDK
In SDK Manager, select the “SDK Platforms” TAB, and then check “Show Package Details” in the lower right corner. Expand the Android 10 (Q) option and make sure the following components are checked (again you must have a stable agent or you may not see the screen) :
Android SDK Platform 29
Intel x86 Atom_64 System Image (the official simulator Image file, use unofficial simulator does not need to install this component
then click on the “SDK Tools” TAB, the same hook in the lower right corner of “Show Package Details”. Expand the “Android SDK Build-Tools” option and make sure the React Native required version 29.0.2 is selected. You can install multiple other versions at the same time.
Then, again in the “SDK Tools” TAB, click “NDK (Side by Side)”, also check “Show Package Details” in the lower right corner, and select version 20.1.5948944 to install.
Finally, click “Apply” to download and install the components.
(For some reasons, there may not be an NDK (Side by Side). If there is no NDK, click to continue.)
Configure the Android_Home environment variable
to open the control panel ->; Systems and Security -> System – & gt; Advanced System Settings ->; Advanced – & gt; The environment variable, select the PATH variable, and then click Edit. Click New and add these tools directory paths: platform-tools, emulator, tools, tools/bin
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin