Ich habe eine Android -App (in Kotlin geschrieben), wobei der Verarbeitungscode in Rost ausgeführt wird. Ich versuche, Liste Daten an das Back-End-Rust zu senden und sie als VEC zu interpretieren. Die Größe der Liste ist variabel. Ich verwende dafür JNI (Java Native Interface).
package eu.mypackage.rust
class SomeName {
@Throws(IllegalArgumentException::class)
external fun checkAnswer(answerInput: String, answerList: List): Boolean
}
< /code>
mit der ich aufrufe: < /p>
val isCorrect = sn.checkAnswer(answerInput, answerList)
< /code>
rost < /h3>
Auf der Rostseite habe ich diese Entwurfsfunktion: < /p>
#[cfg(target_os = "android")]
#[allow(non_snake_case)]
pub mod android {
extern crate jni;
// This is the interface to the JVM that we'll call the majority of our methods on.
// @See https://docs.rs/jni/latest/jni/
use self::jni::JNIEnv;
// These objects are what you should use as arguments to your native function.
// They carry extra lifetime information to prevent them escaping this context
// and getting used after being GC'd.
use self::jni::objects::{JClass, JString, JObject, JObjectArray}; // Not sure what is required
// This is just a pointer. We'll be returning it from our function.
// We can't return one of the objects with lifetime information
// because the lifetime checker won't let us.
use self::jni::sys::{jstring, jboolean, jobjectArray, jsize}; // Not sure what is required
fn kotlin_list_to_rust_vec_string(env: &JNIEnv, java_array: &jobjectArray) -> Vec {
// TODO function to convert
}
#[no_mangle] // This keeps Rust from "mangling" the name so it is unique (crate).
pub extern "system" fn Java_eu_surafusoft_rust_KanjiOrigin_checkAnswer,
// This is the class that owns our static method. It's not going to be used,
// but still must be present to match the expected signature of a static native method.
_class: JClass,
answerList: JObjectArray
Ich habe eine Android -App (in Kotlin geschrieben), wobei der Verarbeitungscode in Rost ausgeführt wird. Ich versuche, Liste Daten an das Back-End-Rust zu senden und sie als VEC zu interpretieren. Die Größe der Liste ist variabel. Ich verwende dafür JNI (Java Native Interface).[code]package eu.mypackage.rust
class SomeName { @Throws(IllegalArgumentException::class) external fun checkAnswer(answerInput: String, answerList: List): Boolean } < /code> mit der ich aufrufe: < /p> val isCorrect = sn.checkAnswer(answerInput, answerList) < /code> rost < /h3> Auf der Rostseite habe ich diese Entwurfsfunktion: < /p> #[cfg(target_os = "android")] #[allow(non_snake_case)] pub mod android { extern crate jni;
// This is the interface to the JVM that we'll call the majority of our methods on. // @See https://docs.rs/jni/latest/jni/ use self::jni::JNIEnv;
// These objects are what you should use as arguments to your native function. // They carry extra lifetime information to prevent them escaping this context // and getting used after being GC'd. use self::jni::objects::{JClass, JString, JObject, JObjectArray}; // Not sure what is required
// This is just a pointer. We'll be returning it from our function. // We can't return one of the objects with lifetime information // because the lifetime checker won't let us. use self::jni::sys::{jstring, jboolean, jobjectArray, jsize}; // Not sure what is required
fn kotlin_list_to_rust_vec_string(env: &JNIEnv, java_array: &jobjectArray) -> Vec { // TODO function to convert }
#[no_mangle] // This keeps Rust from "mangling" the name so it is unique (crate). pub extern "system" fn Java_eu_surafusoft_rust_KanjiOrigin_checkAnswer, // This is the class that owns our static method. It's not going to be used, // but still must be present to match the expected signature of a static native method. _class: JClass, answerList: JObjectArray
Ich habe Probleme mit Typprüfungen mit matplotlib.pyplot.subplot_mosaic.
Ich habe die folgende Funktion erstellt, die das Mosaikmuster und den per_subplot_kw generiert:
def create_mosaic(num_rows):...
Ich versuche, eine Liste aus einer Liste von Objekten zu entfernen.
Ich habe in Chrome nachgefragt und den Vorschlag erhalten, diese Zeile zu verwenden:
bool u = list.RemoveAll(i =>...
Ich habe versucht, eine einfache Hello World -Anwendung mit Java und Springboot in der Intellij -Idee zu erstellen, aber ich erhalte diesen Fehler und ich weiß nicht, wie ich ihn lösen soll.