Posts

Showing posts with the label Java

Stop using third party packages that has many dependencies that the author didn't have a check before they use

33. "remove every backend project that uses node third party packages, they might has backdoor that could use your VPS as their VPS to act like a general web client for hackers"   it is even worse if you use npm in root VPS, because the npm will always use new version of a package or sub_package, how can you make sure your 3000 dependencies will not have a virus that could use your VPS root permission to do bad things?   it is the same for other package manager, for example, python pip. or golang package, java package, rust package, flutter package. in chinese, people usally call those machine that has those software running 'rou ji'. """ 利用 package manager 自动更新新版本的特性,做远控 轻而易举 就算不更新,利用现有的package,二进制文件或者脚本 一个post发到黑客服务器,它就知道你的电脑能不能被控制 对于root设备,被控制就是被完全控制,对于普通设备,就是被当成hacker web 客户端,可以被拿来在网上发垃圾信息、垃圾账号注册 到时候你的ip就会被当成坏ip被服务器墙掉 """

Alipay integration essential resources

Image
https://github.com/alipay/alipay-sdk-java-all https://open.alipay.com/platform/appDaily.htm?tab=account https://opendocs.alipay.com/apis/api_1/alipay.trade.precreate https://opendocs.alipay.com/apis/02890l?scene=23

Spring Boot MyBatis-Plus and MyBatis-Plus Generator Usage

https://baomidou.com/guide/quick-start.html https://baomidou.com/guide/generator-new.html https://z.itpub.net/article/detail/D31083676671AC2CE6B42B3E0D4B7F40

SpringBoot Hibernate Usage

https://www.javadevjournal.com/spring-boot/spring-boot-with-hibernate/  https://www.codejava.net/frameworks/spring-boot/connect-to-mysql-database-examples https://dzone.com/articles/introduction-to-spring-data-jpa-part-6-bidirection https://www.baeldung.com/jpa-one-to-one

My thinking about Python

Though Python is light, elegant, beautiful, and powerful in data science and computer science. It's not a good programming language for a big project. You may often make little mistakes in grammar level, for example, type mismatching. All of that makes python fragile. Also, when it comes to a system level, our python packages will often face permission errors.  For example, Pyaudio often have to be installed by `apt install python3-pyaudio` Meanwhile, the Java programming language has a strong type checking and real-time intelligent grammar analyzing and checking ecosystem.  It decreases the brain work human has to make to code. It simplifies the process of writing codes by strong code completion. With Java, you'll never make grammar mistakes. And you can, code for 12 hours without feeling tired.

How to install java environment with one command

sudo apt install default-jdk # sudo apt install openjdk-11-jdk # sudo update-alternatives --config java ​

How to mix kotlin code and java code

First I must say, I misunderstood kotlin before. It’s a good language to simplify android development if you know java already. Here is what the official says: Kotlin is 100% interoperable with the Java programming language, so you can have as little or as much of Kotlin in your project as you want. How to use java code in kotlin You just have to create a java class besides your .kt file, then you are ready to go. Just import that file by `import ** ` , then instantiate it as you would do with any class. Then it’s done. Quite simple. The source and the author https://kotlinlang.org/docs/tutorials/mixing-java-kotlin-intellij.html https://yingshaoxo.blogspot.com ​

How to use Java bindings of OpenCV with Android Studio and Gradle

The source https://github.com/bytedeco/javacpp-presets Why I write this Beacuse they didn’t make it clear about how can I use their libs. I spent 6 hours to figure out how can I simply import it. The Code defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.god_loves_you" minSdkVersion 16 targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true //ADD THIS LINE } packagingOptions { exclude('META-INF/native-image/android-x86_64/jnijavacpp/jni-config.json') exclude('META-INF/native-image/android-x86_64/jnijavacpp/reflect-config.json') exclude('META-INF/native-image/android-arm64/jnijavacpp/jni-config.json') exclude('META-INF/native-image/android-arm64/jnijavacpp/reflect-config.json')...

Flutter and Pigeon tutorial

install https://pub.dev/packages/pigeon#flutter-calling-into-android-steps write import 'package:pigeon/pigeon_lib.dart' ; class SearchRequest { String keyword; } class SearchReply { String result; } //@HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi') @HostApi () abstract class FileManagerApi { SearchReply search(SearchRequest request); } void configurePigeon(PigeonOptions opts) { opts.dartOut = 'lib/messages.dart' ; opts.objcHeaderOut = 'ios/Runner/messages.h' ; opts.objcSourceOut = 'ios/Runner/messages.m' ; opts.objcOptions.prefix = 'FLT' ; opts.javaOut = 'android/app/src/main/java/io/flutter/plugins/filemanager/Messages.java' ; opts.javaOptions.package = 'io.flutter.plugins.filemanager' ; } compile flutter pub run pigeon --input pigeons/messages.dart java side import androidx.annotation.NonNull; import io.flutter.embedding.android.FlutterActivity; import io...