Tag Archives: fatal

postgresql FATAL:no pg_hba.conf entry for host “192….“

In PG_ Add the IP to hbaconf and restart postgreql
as follows:[ https://blog.csdn.net/qq_ 36434219/article/details/118277681]

Note: there are many IP addresses added, one by one… You can directly configure the fixed network segment. For example, the above figure can be configured as follows:
192.168.3.0/24 represents having 254 IP addresses: from 192.168.1.1 to 192.168.1.254

Android error java.lang.IllegalStateException : System services not available to Activities before onC

The full error log is as follows:

 FATAL EXCEPTION: main
                                                 Process: com.example.administrator.followview, PID: 8587
                                                 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.administrator.followview/com.example.administrator.followview.MainActivity}: java.lang.IllegalStateException: System services not available to Activities before onCreate()
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:148)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                  Caused by: java.lang.IllegalStateException: System services not available to Activities before onCreate()
                                                     at android.app.Activity.getSystemService(Activity.java:5253)
                                                     at com.example.administrator.followview.MainActivity.<init>(MainActivity.java:18)
                                                     at java.lang.Class.newInstance(Native Method)
                                                     at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                     at android.os.Looper.loop(Looper.java:148) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

The error code is as follows:

public class MainActivity extends Activity implements View.OnTouchListener {
    private Button mButton;
    private ViewGroup mViewGroup;
    private int xDelta;
    private int yDelta;
    WindowManager wm = (WindowManager) this
            .getSystemService(Context.WINDOW_SERVICE);

    int width = wm.getDefaultDisplay().getWidth();
    int height = wm.getDefaultDisplay().getHeight();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mViewGroup = (ViewGroup) findViewById(R.id.root);

Sure enough, it’s written on oncreate. Just put it into the oncreate method to run.
 

Resolving fatal: reusing to merge unrelated histories in Git

An error of Git
Sometimes there are some problems in the process of using Git, so when you solve each problem, you need to summarize and record it, so that you won’t do it again.
A, fatal: refusing to merge unrelated nothing
Today, while creating a project with Git, the following error occurred when two branches were merged.

~/SpringSpace/newframe on  master ⌚ 11:35:56
$ git merge origin/druid
fatal: refusing to merge unrelated histories

The key to the problem here is: fatal: refusing to merge unrelated nothing
you might be in the git pull or git push are likely to encounter, this is because the two branches without relationship. So what's the solution?
Second, solutions
Behind the commands you add - allow - unrelated - nothing
for example:
git merge master - allow - unrelated - nothing

~/SpringSpace/newframe on  druid ⌚ 11:36:49
$ git merge master --allow-unrelated-histories
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.

If you are a git pull or git push to fatal: refusing to merge unrelated nothing
in the same way:
git pull origin master - allow - unrelated - nothing
and so on, this is the perfect solution to cough up!