Category Archives: How to Fix

C ා imitate on error resume next in VB

C# mimics VB’s On Error Resume next
and adds a try catch. The exception is not handled in catch
Try
{
the for (int I = 0; i < 10; I++)
{
try
{
int p = 0;
int d = I/p;// is zero, will go wrong

} catch

attach MessageBox. Show (i.T oString ());// here say, will cycle through ten times

}}
the catch (Exception ex)
{
MessageBox. Show (ex. Message); // because the error divided by zero is caught by the inner try catch, the outer try catch will not catch the error divided by zero
}

How to solve fatal error C1010!

 

in compiled VC++6.0 is, appears

fatal error C1010: unexpected end of file while looking for precompiled header directive

problem explanation in detail:

fatal error C1010, the file did not end as expected while looking for a precompiled indication header file. The header file where the precompiled indication information was not found.

problems generally occur in:

adds some CPP files to an MFC program by adding files, but the CPP file is not MFC, is standard C++.

solution 1:

, right-click the CPP file in the Project Project and set it to the first item: Not using preheaders, from the C++ Header on the Project Settings page.

solution 2:
Add the include file stdafx.h at the beginning of the.cpp file.

# include “stdafx. H”

from: MSDN

Visual C++ Concepts: Building A C/C++ Program

Fatal Error C1070

mismatched #if/#endif pair in file ‘filename
An #if, #ifdef, or #ifndef directive has no corresponding #endif. The following sample generates C1070:

// C1070.cpp
#define TEST

#ifdef TEST
// use the line below to resolve the error
// #endif

#ifdef TEST

#endif

int main() {
}
// C1070

Latex’s problem about package missing

Latex Error:File ‘etoolbox. Sty ‘not found latex Error:
latex Error:File 'etoolbox. Sty' not found
What should I do when I make such a mistake?
The

    click http://mirror.unl.edu/ctan/help/Catalogue/brief.html in download file with the same name. Copy etoolbox. Sty and Etoolbox. Def to../Tex /latex/ EToolbox/below EToolbox. PDF copy to../Doc /latex/ EToolbox/MiKTeX open Setting, General — & GT; Refresh FNDB and restart WinEdt.

Sometimes the download is ins and other files, how to do?
, add a step after the top 3. CMD switch to the current directory, and execute latex toolbox. Ins to generate the.sty file, then refresh.

Occupation system integration examination

When I was doing software development, I basically encountered problems related to technology and system. I didn’t pay much attention to professional certification. I signed up for the system Integration certification exam, mainly because the company organized everyone to take the exam in 2013, but I was busy with the development work (Meiyou preparation) at that time, so I failed. After six years, the time was running out a little, so I decided to try again.
Fortunately, I passed the exam successfully, O(∩_∩)O haha ~

I would also like to express my heartfelt thanks to the teachers who organized this exam for their hard work!
About the test
Last August, the name of the report, but the real test preparation time is only a week or two, on the Internet to buy “exam tutorial”, “guidance” and “32 hours clearance” and so on. In addition to book knowledge, effective learning methods are also very important. Experience in software project management and bidding will be helpful in preparing for the exam.
About System Integration
Although this is an exam that includes information technology, system integration and software management, from a personal perspective, I am more concerned with system integration. Here “integration”, simply refers to the establishment of the application system, including the network, application software, hardware and subsystem design, development and integration. But in a broad sense, it is the way of information system construction, realization, expansion and renewal. With the change of application requirements, domestic and foreign equipment manufacturers constantly launch new underlying products, IT enterprises and industry organizations will also have new technical solutions, resulting in system integration is a constantly changing industry topic.
On the other hand, with the transformation of various industries and the acceleration of domestic autonomy of IT technology, the gap between software and hardware design is expected to generalize and merge in some aspects, making the integrated design of software and hardware based on application scenarios possible, which should also be considered as the application scenario of system integration (## personal view). Anyway, there are both opportunities and challenges. Of course, this is also a blessing for the industry, and worth everyone’s efforts to achieve.
Write in the last
Although the road of software design is still not smooth, there is still a long way to go for Chinese software industry to improve itself. But, as long as the persistence pay, will certainly have the harvest!
Ps: If you feel confused in preparing for the soft test, welcome to exchange.

Solve the problem of permission after flutter package_ Handler failure

Because the project requires location, camera, and microphone permissions, the permission_handler library is invoked to implement it.
But in normal debugging without any problem, can pop up to get the rights of the dialog box can also be normal access to each permission;
The release version packaged with the command flutter build apk does not have the dialog box that pops up to get permission, nor does it get permission.
After Posting the problem on CSDN, Zhihu and SegmentFault, I finally decided to solve it by myself. Finally, I found a partner with the same problem on the Issues section of the official GitHub.
Dont work Permission_handler in release mode #406
Find the answer in the comments section:

try to do that in gradle.properties
android.enableR8=true
change to
android.enableR8=false

It means that modify android/gradle. In the properties

android.enableR8=true

for

android.enableR8=false

Pack again and you’re ready!
Thanks to brother!

[W xx:xx:xx.xxx NotebookApp] 404 GET/static/components/react/react-dom.production.min.js (::1)

I can’t open a jupyter notebook
Problem description
In do not know conda some strange installation package, there appeared jupyter can not open the error error code for the following.

[W xx:xx:xx.xxx NotebookApp] 404 GET/static/components/react/react-dom.production.min.js (::1)

Problem solving method
CSDN article read by a blogger, forget who it is, just type this under CMD

pip install --user --ignore-installed jupyter

Keep alive in Vue

keep-alive
Keep-alive is an abstract component built into Vue that allows contained components to remain in state, avoiding repeated component creation and rendering
Keep-alive is generally used in combination with routing and dynamic components to cache components.

<keep-alive>
    <component :is='current'></component>
</keep-alive>

Keep-alive provides include and exclude attributes, both of which support strings or regular expressions. Include means that only components with matching names will be cached. Exclude means that any components with matching names will not be cached.

<keep-alive :include="includeList" :exclude="excludeList">
    <router-view></router-view>
</keep-alive>

Keep-alive caches include matching components and does not cache exclude matching components.

C ා use math.net Read. Mat file, file content is complex

0. The project needs to read the complex file (.mat) generated by matlab simulation through C#, and then process it. The contents of the file are shown in the figure below:

1. Add DLL file: find Mathnet by NuGet manager, search mathnet.Numerics as shown in the figure below, install Mathnet.numerics;

2. Add references:

3. The following method can be used to read complex data.

Converting string object into datetime type in pandas

import pandas as pd


from pandas import DataFrame
from dateutil.parser import parse

data

data = DataFrame(columns=['date'], data=['2020-11-01','2020-11-05','2020-11-08','2020-11-11'])
data

data.info()

"""
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 4 entries, 0 to 3
Data columns (total 1 columns):
 #   Column  Non-Null Count  Dtype 
---  ------  --------------  ----- 
 0   date    4 non-null      object
dtypes: object(1)
memory usage: 160.0+ bytes"""

conversion

data['date'] = data['date'].apply(parse)

data.info()
"""
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 4 entries, 0 to 3
Data columns (total 1 columns):
 #   Column  Non-Null Count  Dtype         
---  ------  --------------  -----         
 0   date    4 non-null      datetime64[ns]
dtypes: datetime64[ns](1)
memory usage: 160.0 bytes
"""

Could not start Quartz Scheduler after delay; nested exception is org.quartz.SchedulerException:

directory
Problem description and solution process summary

Problem description
First of all, there is a timer in this project, and then it seems that the timing task error causes the project not to start up, but it is not.

2020-11-19 15:22:06.141 [restartedMain] INFO  com.alibaba.druid.pool.DruidDataSource 1609 - {dataSource-1} closed
2020-11-19 15:22:06.952  INFO 1352 --- [lerFactoryBean]] o.s.s.quartz.SchedulerFactoryBean        : Starting Quartz Scheduler now, after delay of 1 seconds
2020-11-19 15:22:06.952 [Quartz Scheduler [schedulerFactoryBean]] INFO  org.springframework.scheduling.quartz.SchedulerFactoryBean 665 - Starting Quartz Scheduler now, after delay of 1 seconds
Exception in thread "Quartz Scheduler [schedulerFactoryBean]" org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler after delay; nested exception is org.quartz.SchedulerException: The Scheduler cannot be restarted after shutdown() has been called.
	at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:671)
Caused by: org.quartz.SchedulerException: The Scheduler cannot be restarted after shutdown() has been called.
	at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:557)
	at org.quartz.impl.StdScheduler.start(StdScheduler.java:142)
	at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:668)

To solve the process
At the beginning, I always thought that the project could not be started due to the timing task, but I ignored the error log above. I searched a lot about the timer error, but I couldn’t solve it. And then it turned out that there was another error. The Mybatis mapping file resultMap is filled incorrectly. It will be all right after the changes are done.

conclusion
In the face of error, must be calm and calm, good observation of the log. Only after observing the log can you quickly lock the cause of the error.

Dataframe groupby custom aggregate function

The background,
The business needs to aggregate the data by grouping the results within the group by its own defined calculation method
Second, code implementation
The reference code is as follows:

# Read source files
df1 = pd.read_excel('./test_3.xlsx')
df1.head()

# Custom aggregate functions
def get_total_marks(list1: list):
    """
    Custom aggregate functions: Calculate the rules as follows
    Result of calculating the list: = largest + 1/2 * second largest + 1/4 * third largest + ... + (1/2**(n-1) * nth largest 
    """
    res = 0
    list1.sort(reverse=True)
    for index, i in enumerate(list1):
        res += i * 2**(-index)
    return res

# Using dataframe aggregation

df2 = df1.sort_values(["site", "code", "stock_price"],ascending=[True, True, False])
df3 = df2.drop_duplicates(["code", "site"])
df4 = df3.groupby(["code"]).apply(lambda x: get_total_marks([i for i in x["stock_price"]]))
df5 = df4.reset_index()
df5.columns = ["code", "total_mark"]
df5

After groupBY, you can use the Apply () method, which allows you to pass in a function. If the normal sum(), Max (), and mean() do not satisfy your needs, you can consider custom functions to complete the aggregation.