小编Rau*_*ulp的帖子

删除项目(文件)时动态更新网格视图

我试图删除网格视图中的项目/文件.这些文件位于/data/my-image-folder/.文件立即被删除,但UI不会立即更新.这是我的代码:

   imageFilePath = /data/<my-image-folder>/"file.jpg";
   File file = new File(imageFilePath);
    if (file.exists()) {
    boolean deleted = file.delete();
    sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse(imageFilePath+ Environment.getExternalStorageDirectory())));
Run Code Online (Sandbox Code Playgroud)

getview代码:

View getView(int position, View convertView, ViewGroup parent) {
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View gridView;

            if (convertView == null) {

                gridView = new View(context);

                // get layout from gridlayout.xml
                gridView = inflater.inflate(R.layout.gridlayout, null);

                // set value into textview
                TextView textView = (TextView) gridView
                        .findViewById(R.id.grid_item_label);
                textView.setText(fileList[position]);
                System.out.println("value of fileList[position]" + fileList[0]);
                // set image
                ImageView imageThumbnail = (ImageView) …
Run Code Online (Sandbox Code Playgroud)

android gridview

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

Gstreamer 缺少插件

我试图在命令提示符下运行某些管道来播放视频,并且经常收到这些错误/消息/警告:

WARNING: erroneous pipeline: no element "qtdemux"
WARNING: erroneous pipeline: no element "playbin2"
WARNING: erroneous pipeline: no element "decodebin2"
ERROR: pipeline could not be constructed: no element "playbin".
Run Code Online (Sandbox Code Playgroud)

以下是管道:

gst-launch filesrc location=path to the mp4 file ! playbin2 ! queue ! ffmpegcolorspace ! autovideosink 
Run Code Online (Sandbox Code Playgroud)

或者

gst-launch -v filesrc location=path to the mp4 file ! qtdemux name=demuxer ! { queue ! decodebin ! sdlvideosink } { demuxer. ! queue ! decodebin ! alsasink }
Run Code Online (Sandbox Code Playgroud)

或者

gst-launch -v playbin uri=path to the …
Run Code Online (Sandbox Code Playgroud)

gstreamer python-gstreamer qtgstreamer

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

在C编译器中编译过程中的词法和句法分析是什么?

什么是编译过程中的词法和句法分析.预处理是否在词法和句法分析之后发生?

c parsing preprocessor compilation lexical-analysis

5
推荐指数
1
解决办法
8202
查看次数

如何在 Linux 上取消修补目录/文件?

如何取消修补文件和目录形成修补程序。

我使用这两个命令pd.patch在目录上应用了补丁,pf.patch在文件上应用了补丁:

patch -p1 < pd (in the directory) 

patch -p1 file_unpatch < pf.patch . ( will give me file_patch(patched file_unpatch)) 
Run Code Online (Sandbox Code Playgroud)

我如何检索原始文件file_unpatchunpatched目录?

编辑 我发现我们可以使用以下-R选项取消修补目录:

patch -p1 -R < pd (in the directory) --> will give me unpatched directory.
Run Code Online (Sandbox Code Playgroud)

现在,取消修补文件怎么样?

linux patch

5
推荐指数
1
解决办法
8451
查看次数

在C#中使用计时器实现循环

我想在C#中使用基于定时器的while循环替换基于while循环的计数器.

示例:

while(count < 100000)
{
   //do something 
}
Run Code Online (Sandbox Code Playgroud)

while(timer < X seconds)
{
    //do something 
}
Run Code Online (Sandbox Code Playgroud)

我有两种类型的C#.NET定时器本的System.TimersThreading.Timers.哪一个会更好用,怎么样.我不想在计时器上增加额外的时间消耗或线程问题.

c# loops timer countdowntimer

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

sysfs属性是否可以在Linux设备驱动程序中使用非数字值?

我正在开发一个Linux设备驱动程序,我必须使用sysfs接口将一串字符传递给它.sysfs属性是否可以接受字符串形式的数据(类似echo "somedata" > sysfs_interface)?

我已经实现了它,它似乎工作正常,但我想确定这是有效的(在内核社区可以接受).

device-driver linux-device-driver linux-kernel sysfs

5
推荐指数
1
解决办法
560
查看次数

BluetoothGattCallback - onConnectionStateChange 返回状态 40

状态 40 代表什么?我正在尝试连接到 android 蓝牙应用程序中的设备并获取状态:40?该值是十进制还是十六进制?

如果它是十六进制蓝牙规范,则说明该错误:

COARSE CLOCK ADJUSTMENT REJECTED BUT WILL
TRY TO ADJUST USING CLOCK DRAGGING (0x40)
The Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock
Dragging error code indicates that the master, at this time, is unable to make a
coarse adjustment to the piconet clock, using the supplied parameters. Instead
the master will attempt to move the clock using clock dragging.
Run Code Online (Sandbox Code Playgroud)

否则,如果它是十进制,它会这样说;

INSTANT PASSED (0x28)
The Instant Passed error code indicates that an …
Run Code Online (Sandbox Code Playgroud)

android bluetooth android-bluetooth

5
推荐指数
0
解决办法
512
查看次数

Innosetup中的字符串数组

我试图在一行中的InnoSetup中的子字符串后得到一个特定的整数.有Trim,TrimLeft,TrimRight函数但没有子串提取函数.

示例:

line string:    2345
line another string:     3456
Run Code Online (Sandbox Code Playgroud)

我想提取"2345"和"3456".

我正在加载数组中的文件内容,但无法通过array [count] [char_count]取消引用它.

pascal inno-setup

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

Linux内核中的gpiod_*vs gpio_*方法

Linux设备驱动程序编程中的哪个GPIO API更可取,在什么条件下:gpio_set_value()gpiod_set_value()

一个采用GPIO desc作为对象,而另一个采用从设备树解析的GPIO.

device-driver linux-kernel device-tree

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

用C++反向工程虚函数代码

我刚刚在VS2010上编译了以下内容(优化已关闭).

class Shape {
  public:
    int x,y;
    Shape() {
      x=10;
      y=20;
    }

    virtual void function1() {
      cout<<"function1";
    }

    virtual void function2() {
      cout<<"function2";
    }
};

int main() {
    Shape *s = new Shape();
    s->function1();
    s->function2();    
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

反汇编不显示与虚函数对应的代码块或对它的任何调用,因此我假设这是因为使用vftable查找虚函数的方式.我正在使用IDA Pro,因此可能无法解决此类问题.如果我错了,请纠正我.

我在这方面也有一些疑问.

  1. 有没有什么办法可以像反汇编时的其他功能一样查看虚拟功能?我可以使用的任何脚本(IDAPython)/方法?
  2. 有什么办法可以列出可执行文件中的所有虚函数吗?
  3. 推荐读物?

c++ virtual-functions reverse-engineering

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