Tag Archives: notes

Android Development notes — mediaplayer error (1, – 2147483648)

Today, I recorded a pit. When I used MediaPlayer to play the video, the screen went black. Then, I saw that the system log output by the console contained a “MediaPlayer Error (1, -2147483648)”.
Then I went to the source code and found this

public interface OnErrorListener
    {
        /**
         * Called to indicate an error.
         *
         * @param mp      the MediaPlayer the error pertains to
         * @param what    the type of error that has occurred:
         * <ul>
         * <li>{@link #MEDIA_ERROR_UNKNOWN}
         * <li>{@link #MEDIA_ERROR_SERVER_DIED}
         * </ul>
         * @param extra an extra code, specific to the error. Typically
         * implementation dependent.
         * <ul>
         * <li>{@link #MEDIA_ERROR_IO}
         * <li>{@link #MEDIA_ERROR_MALFORMED}
         * <li>{@link #MEDIA_ERROR_UNSUPPORTED}
         * <li>{@link #MEDIA_ERROR_TIMED_OUT}
         * <li><code>MEDIA_ERROR_SYSTEM (-2147483648)</code> - low-level system error.
         * </ul>
         * @return True if the method handled the error, false if it didn't.
         * Returning false, or not having an OnErrorListener at all, will
         * cause the OnCompletionListener to be called.
         */
        boolean onError(MediaPlayer mp, int what, int extra);
    }

So the problem I have is the error “MEDIA_ERROR_SYSTEM”, the reason is “system version is too low error”… Then I looked it up on the Internet and found that video files are usually in MP4, AVI, etc., but even if they are in the same file format, they may have different encoding formats. For example, common coding formats are: H.264, H.263 and so on. However, many Andorid devices can only support partial encoding, which results in some videos that cannot be played on Andorid devices. If you have to play these videos, it involves the complicated operation of video transcoding… I haven’t learned this skill yet, so I’ll dig a hole and fill it up later

A solution to the error of asynchronous socket error 10053 in C + + Builder

When programming communications using TClientSocket and TServerSocket in C++Builder, clients that use TClientSocket use TClientSocket-> The server using the TServerSocket side will sometimes report the error “” Asynchronous Socket Error 10053″ when the close disconnects and exits the program. Reference to the error instruction: Software caused Connection abort. This is a tricky one because you still can’t be sure where the problem is.
In fact, this error is largely the result of the TClientSocket dropping to Free without a client/server disconnect. There are two solutions here.
A: In the calling TClientSocket TClientSocket before the Close of the call. The Socket. The Close connection is broken, but it also has another problem, there is also did not receive complete data, the server at this time will still be submitted to the Asynchronous Socket error 10053 error, So the call TClientSocket. Socket. Can call again before the Close TClientSocket. Socket. ReceiveText will server sends the data to receive completely
Add the following code to the OnClientError event on the server:

if(ErrorCode==10053)
   Socket->Close;
ErrorCode= 0;

Disconnect the connection and set the ErrorCode to 0. If you don’t, the error code is still 10053 even though the connection is disconnected, you’ll still pop up to report Asynchronous Socket Error 10053.
Original: https://blog.csdn.net/shuiyuanfengxing/article/details/8504139

On curl: (2) failed initialization

was originally created because curl could not access HTTPS and the network said it was necessary to recompile and install curl

I will download..

./configure

make

make install

results in

curl: (2) Failed Initialization

okay, I’m on my knees.

all over the world looking for reasons…

find this

It means that the curl binary is picking up the system curl library. While it was linked at compile time to the correct library, at run-time it’s picking up the incorrect library, which seems to be a pretty typical reason for this error happening.

so confure is mainly used with –disable-shared

and then make…

is OK…

MongoDB Error: Failed to start mongod.service: Unit mongod.service is not loaded properly

solution


– command line input below, open mongodb.service file
that is

 sudo vim /etc/systemd/system/mongodb.service

– paste and copy the following to the open file
or

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

Sudo service mongod stop
restart: sudo service mongod stop
restart: sudo service mongod restart

, however, I later found this problem again, at this point using the above boot command still does not work.
then run this startup command:
sudo systemctl start mongodb
problem solved

Handling of expression not in group by key [value] reported by hive on October 12, 2020

hive Expression Not In Group By Key>我在hive中创建了一个表。它有以下列:

id bigint, rank bigint, date string

我想要得到每月的平均排名。我可以使用这个命令。它的工作原理。

select a.lens_id, avg(a.rank)
from tableA a
group by a.lens_id, year(a.date_saved), month(a.date_saved); 

但是,我还想要得到日期信息。我使用这个命令:

select a.lens_id, avg(a.rank), a.date_saved
from lensrank_archive a
group by a.lens_id, year(a.date_saved), month(a.date_saved);

它报错:Expression Not In Group By Key

回答:
完整错误消息的格式应为Expression Not in Group By Key [value]。
[value]会告诉你需要在的组中是什么表达式。仅看这两个查询,我认为您需要显式地将a.date_saved添加到Group By中。

问题:是的。添加了a.date_saved之后,它就工作了。然而,它并没有做到我想要的。我想要一个月的平均薪资。现在它不做平均。它只显示了通过a.date_saved添加组之后的所有记录。
回答:
您不能选择一个列,并且不按照该列进行分组。如果您想要显示a.date_saved,您需要根据它进行分组。你可以显示year(a.date_saved)和month(a.date_saved),因为它们在组中,但不是100%

解决方案二:
走动是将额外的字段在collect_set并返回集合的第一个元素。例如

select a.lens_id, avg(a.rank), collect_set(a.date_saved)[0]
from lensrank_archive a
group by a.lens_id, year(a.date_saved), month(a.date_saved);

– customer unit price (including reject), in HQL, in select… Group by… To display a field in>, you must group by that field, otherwise do not select that field

select user_id,sum(order_money)/count(order_money) from us_order;

error:
modified answer:

select user_id,sum(order_money)/count(order_money) from us_order group by user_id;

select collect_set(user_id)[0],sum(order_money)/count(order_money) from us_order;


Idea couldn’t be found org.springframework.context .support

use maven spring project management idea, operation times can’t find the org. Springframework. Context. The support.
reason: jar package has not been imported, or idea cannot find this jar package, need to check the configuration of maven
solution:
1. Reimport maven pom file
2. Check that the version of the jar package is compatible with the currently used JDK version
3. 4. Delete the configuration of localrepository in the conf folder in the maven installation directory. Manually specify the address of the localrepository in idea

Error in comparing the size function of STL with negative number

#include<stdio.h>
#include<math.h>
#include<vector>
#include<queue>
using namespace std;
vector<int>v;
queue<int>q;
int main()
{
	v.push_back(1);
	q.push(1);
	int x=0;
	int y=v.size()-2;
	int z=q.size()-2;
	printf("%d %d\n",x,y);
	printf("%d %d\n",x<(v.size()-2),x<y);
	
	printf("\n%d %d\n",x,z);
	printf("%d %d\n",x<(q.size()-2),x<z);
    return 0;
}

program run results are as follows:

it is obvious there is a problem, the reason is that the size function the result is unsigned number, into negative becomes a big number. The solution is to store the results in a variable, so that won’t happen.
[c++] unsigned type and negative comparison

How to Fix “junit.framework.Comparison Failure Expected: but was”

junit.framework.ComparisonFailure: expected:< . > But was: solution

an error occurred while running the MVN instruction: MVN clean test using the DOS window:

[ERROR] Please refer to D:\ learning gadgets \ first semester of junior \ enterprise application construction and management \ experiments \maven_demo\target\surefire-reports for the individual test results

error display from the surefire – reports file to find errors, check the surefire – reports file:

error body is this:
junit.framework.ComparisonFailure: expected:< Hello [World]guoyilin! > but was:< Hello []guoyilin! >

in the test file called assetEquals method, the method to compare the the statement with a specified in parentheses, if different than the error


you can see, The statement returned in the sayHello method is different from the statement specified in the test module, and that’s where the error is, just change the statement to be the same.