小编Joz*_*oze的帖子

android:layout_alignParentBottom ="true",键盘使用

我在屏幕底部有一个按钮栏(其父级是总屏幕的RelativeLayout)(在android的帮助下:layout_alignParentBottom ="true")

问题是,当键盘显示时,此栏出现在键盘上方,这减小了显示器其余部分的大小.

您是否知道如何在显示键盘时强制按钮栏保持在屏幕底部?

android

16
推荐指数
1
解决办法
6795
查看次数

这个宏有什么问题?

我正面临一个宏的问题,我无法弄清楚为什么.

这是宏:

#define WAIT(condition, max_time)               \
   do {                                         \
      int int_loop_wait=0;                      \
      while(1)                                  \    
      {                                         \           
        if(condition) { break; }                \
        sleep(1);                               \
        if(int_loop_wait>=max_time) { break; }  \
        int_loop_wait++;                        \
      }                                         \
    } while(0)                                  \
Run Code Online (Sandbox Code Playgroud)

我收到了错误

"如果(条件){break;}"预期声明"行"

有谁理解这个错误?

c macros

11
推荐指数
3
解决办法
8648
查看次数

JNI加载:警告:不要硬编码使用Context.getFilesDir().getPath()代替

我在我的一个应用程序中遇到问题,我有以下代码加载应用程序所需的lib(JNI):

static {
    // load the JNI library
    Log.i("JNI", "loading JNI library...");
    System.load("/data/data/com.mypackage.appname/lib/libxxxxxx.so");
    Log.i("JNI", "JNI library loaded!");
}
Run Code Online (Sandbox Code Playgroud)

所以我得到了警告:"Do note hardcode use Context.getFilesDir().getPath() instead"这是完全正确的(它不会在每台设备上都可移植).问题是,因为我使用静态我无法呼唤Context.getFilesDir().getPath().

你有什么想法我可以继续这样做吗?

java-native-interface android warnings

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

printf:这样安全吗?

我只是想知道这个表达式是否安全:

int main (void)
{
  char my_tab[256];

  memset(my_tab,0x61,sizeof(my_tab));

  printf("Is it safe ? : %.256s",my_tab); /* is it safe ? */
}
Run Code Online (Sandbox Code Playgroud)

c printf

4
推荐指数
1
解决办法
352
查看次数

errno变量的默认值

我想使用errno库来定义项目(c语言)函数的返回.我想知道什么......

我会做这样的事情:

#include <errno.h>

int myfunction (void)
{
  int res;

  /*Some actions....*/

  if(success)
    res = 0;
  else if (fail)
    res = -EIO;

  return res;
 }
Run Code Online (Sandbox Code Playgroud)

我喜欢总是初始化我的局部变量,我想知道使用errno值(可能是0)的变量的默认值是什么?但我真的不想默认设置:"SUCCESS"我更喜欢"失败"值.你对此有何看法(或规则)?

谢谢你提前.

c errno

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

FTP协议中的转义字符

我目前正在我的一个项目(ftp客户端部分)上实现ftp协议.我正在关注RFC959

在这个RFC中,我遇到了一个问题:转义字符,实际上,它描述了必须使用转义字符.但我不知道具体的角色是什么.

以下是关于转义字符的RFC部分:

     3.4.1.  STREAM MODE

     The data is transmitted as a stream of bytes.  There is no
     restriction on the representation type used; record structures
     are allowed.

     In a record structured file EOR and EOF will each be indicated
     by a two-byte control code.  The first byte of the control code
     will be all ones, the escape character.  The second byte will
     have the low order bit on and zeros elsewhere for EOR and the
     second low order …
Run Code Online (Sandbox Code Playgroud)

c ftp

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

奇怪的警告:"已分配但其值从未使用过"

我发布此消息是因为我想知道我的c#代码中出现了警告:

私有字段xxxx已分配,但其值从未使用过

有问题的属性仅用作用户的标志.实际上,用户可以访问(获取)值falsetrue知道某事物的状态.

以下是创建此警告的代码示例:

class Class1 {

    //Attributs
    private b_myboolean = false;

    //Accessors
    public bool B_myboolean 
    {
        get{ return b_myboolean;}
    }

     //Methods
     //Somewhere in a method 
     b_myboolean =true;

}
Run Code Online (Sandbox Code Playgroud)

这样的东西会返回警告.你知道为什么吗 ?我是否需要以另一种方式编写此标志

感谢您提前帮助.

JOZE

c# compiler-construction warnings compiler-warnings

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