Resolution to the record count increasing of the file exported from DB when ‘0A’ is included in it...

解决数据导出记录数异常
本文介绍使用DBQueryAnalyzer3.02处理从数据库导出文件时遇到的数据记录数异常增加的问题。当文件中包含ASCII值为10的字符时,可能会导致Excel打开时记录数异常增加,通过配置双引号作为字段限定符可以有效解决该问题。

 

     Resolution to the record count increasing of the file exported from DB when ‘0A’ is included in it 

 

     DB Query Analyzer 3.02 is up for presented after Chinese Spring Festival. I have been doing software test on it for about a month.

      DB Query Analyzer 3.02 mainly has two new functions below:

 

    3.02 version two new characteristics

      First, DB Query Analyzer allows users to define the restrict character among single quotation marks, double quotation marks and none. If you reset it in the config window, the query result will take effect right now. However, If you reset the separator between SQL, it will take effect in the new opened SQL edit window.

      Second, Some Bug in the process that Stored Procedures and Key Words input by users will be drew different color in DB Query Analyzer is rectified.

 

 

     DB Query Analyzer  3.02 can help you

As a database application software engineer, I’m good at huge data process including not only the huge data file but huge records database system. Analysis to Billions of records is very normal in my daily job.

In some case, I found it very difficult to get know the reason why the data records became much more than the query result when you open the exported file by MS EXCEL. Also error message was seen when you import the file to some Database System.

After a long time analysis, I know it’s just because character which ASCII value is ten is in it.

This case will never been seen if you define double quotation marks to the character fields in DB Query Analyzer 3.02. After doing this step, you will get the correct record count for the exported file.


 

 

 

 

DB Query Analyzer 5.03 download URL:
http://xiazai.zol.com.cn/detail/43/420901.shtml
http://www.unitedpowersoft.com/UpFile/DBQueryAnalyzer_English_503.rar
 

 

DB Query Analyzer Simplified Chinese version 5.03  download URL:
http://xiazai.zol.com.cn/detail/27/264455.shtml
 
 

 

   

转载于:https://my.oschina.net/qzhlove/blog/333400

### Cause of the Numerical Warning The warning message `NumericalWarning: A not positive definite, added jitter of 1.0e-04 to diagonal` typically occurs in numerical computations when a matrix that is expected to be **positive definite** is found to be **not positive definite**. This situation arises frequently in applications such as Gaussian processes, covariance matrix computations, and optimization problems where matrix inversion or decomposition is required. A symmetric matrix $ A \in \mathbb{R}^{n \times n} $ is positive definite if for any non-zero vector $ x \in \mathbb{R}^n $, the quadratic form $ x^T A x > 0 $. In practical terms, this ensures that the matrix has all positive eigenvalues, which is necessary for operations like Cholesky decomposition or computing the inverse. When the matrix is close to being singular or has eigenvalues that are very close to zero or negative due to numerical precision errors, the computation may fail or become unstable. To mitigate this issue, a small positive value (referred to as **jitter**) is added to the diagonal elements of the matrix, effectively increasing the smallest eigenvalues and making the matrix numerically positive definite. This diagonal jittering technique is commonly applied in libraries like GPyTorch and scikit-learn to stabilize matrix operations without significantly altering the underlying problem[^1]. ### Solution: Adding Diagonal Jitter The standard solution is to add a small constant value to the diagonal entries of the matrix $ A $ before performing the operation that requires positive definiteness. Mathematically, this can be expressed as: $$ A_{\text{new}} = A + \epsilon I $$ where $ \epsilon $ is a small positive number (e.g., $ 10^{-4} $) and $ I $ is the identity matrix of the same size as $ A $. This adjustment ensures that all eigenvalues of $ A_{\text{new}} $ are increased by $ \epsilon $, which typically makes the matrix positive definite. Here is a Python example using NumPy to demonstrate this technique: ```python import numpy as np # Original matrix that may not be positive definite A = np.array([[2, -1, 0], [-1, 2, -1], [0, -1, 2]]) # Check if A is positive definite try: np.linalg.cholesky(A) except np.linalg.LinAlgError: print("Matrix is not positive definite.") # Add diagonal jitter epsilon = 1e-4 A_jittered = A + epsilon * np.eye(A.shape[0]) # Check again try: np.linalg.cholesky(A_jittered) print("Matrix is now positive definite after adding jitter.") except np.linalg.LinAlgError: print("Matrix is still not positive definite.") ``` In practice, choosing an appropriate value for $ \epsilon $ is crucial. Too small a value may not resolve the issue, while too large a value can distort the results significantly. Common choices for $ \epsilon $ range from $ 10^{-6} $ to $ 10^{-3} $ depending on the scale of the matrix entries and the specific application. ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值