小编Ali*_*tfi的帖子

如何使用MIPS $ k0和$ k1寄存器

我想知道,MIPS架构中有什么$k0$k1注册.正如WikiBooks上的MIPS汇编一样

k个寄存器保留供OS内核使用.

但我找不到任何有用的东西?以及如何使用它们?

谢谢.

assembly mips cpu-registers

8
推荐指数
1
解决办法
3661
查看次数

内部图形尚未初始化:javafx

我正在尝试javaFx在窗口内编写多个图像的应用程序.
简短的故事是我有一个enum名为的类Candy,每个糖果都有一些属性和表示它的图像文件的路径.
在我的javafx.application类(Table)的构造函数中,我想用这些图像填​​充数组列表,所以到目前为止我写了这个:

public class Table extends Application {

    ArrayList<Image> images;

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("CandyFx");
        primaryStage.show();
    }

    public Table() {
        images = new ArrayList<Image>();
        for (Candy candy : Candy.values()) {
            File file = new File (candy.getImagePath());
            Image image = new Image(file.toURI().toString());
            images.add(image);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

现在每次我想创建一个Table类的实例时,应用程序抛出一个java.lang.RuntimeException: Internal graphics not initialized yet.
我怎么能初始图形看起来我没有?

java javafx image

7
推荐指数
1
解决办法
1万
查看次数

如何在C中声明全局变量?

我开始使用C.我有定义全局变量的问题.例如,platformID在install.c中使用.我在main.c中声明但仍然出错:

install.c | 64 |错误:'platformID'未声明(首次在此函数中使用)|

main.c中:

#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif

 cl_int err;//the openCL error code/s
 cl_platform_id platformID;//will hold the ID of the openCL available platform
 cl_uint platformsN;//will hold the number of openCL available platforms on the machine
 cl_device_id deviceID;//will hold the ID of the openCL device
 cl_uint devicesN; //will hold the number of OpenCL devices in the system

#include "include/types.h"
#include "include/gaussian.h"
#include "include/args.h"
#include "include/files.h"
#include "refu/Time/rfc_timer.h"
#include <stdio.h>
Run Code Online (Sandbox Code Playgroud)

...

install.c

#include "include/types.h"
#include "include/gaussian.h" …
Run Code Online (Sandbox Code Playgroud)

c global-variables

3
推荐指数
1
解决办法
2万
查看次数

启用缩小时 JsonProperty 不起作用

我有以下课程

class CodeRequest(@JsonProperty("phone") val phoneNumber: String)
Run Code Online (Sandbox Code Playgroud)

当我使用此类的对象作为主体发送请求(使用改造)时(当未启用缩小时)一切正常,请求将以这种形式发送 {"phone": "123"}

但是使用以下内容启用缩小proguard-rules.pro将导致{"phoneNumber": "123"}请求正文。

# Jackson
-keep class com.fasterxml.jackson.databind.ObjectMapper {
    public <methods>;
    protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
    public ** writeValueAsString(**);
}
-keep @com.fasterxml.jackson.annotation.* class * { *; }
-keep @com.fasterxml.jackson.annotation.** class * { *; }
-keep class com.fasterxml.** { *; }
-keepattributes *Annotation*,EnclosingMethod,Signature,Exceptions,InnerClasses
-keep class * {
    @com.fasterxml.jackson.annotation.* *;
}
-keep class * { @com.fasterxml.jackson.annotation.JsonProperty *;}

# Application classes that will be serialized/deserialized over Jackson
-keepclassmembers class …
Run Code Online (Sandbox Code Playgroud)

android proguard jackson kotlin

3
推荐指数
1
解决办法
746
查看次数

在8086 + MOVSB中连接两个给定的字符串不起作用

我正在尝试编写一个8086汇编程序来连接两个给定的字符串.为了做到这一点,我使用了" REP MOVSB "指令,但程序运行不正常.所以我编写了一个应该静态连接两个字符串的程序,但似乎" REP MOVSB "根本不影响字符串.这是我为测试编写的代码部分:

                                          
data    segment

string1 db  "Lotfi", 0
string2 db  "Ali ", 0 

data ends


code segment    

ASSUME  CS: code, DS: data

start:
    cld
    mov     ax  , data
    mov     DS  , ax

    mov     SI  , offset string1
    mov     DI  , offset string2
    add     DI  , 3 ; Adding the length of destination string to the DI


    mov     cx  , 5
    rep movsb ; This should concat two strings

    ; Printing the result character by character …

assembly x86-16

2
推荐指数
1
解决办法
1万
查看次数