小编XII*_*XII的帖子

如何在内核模块中捕获信号

我有一个内核模块,该模块在初始化例程中有一个while(1)循环,该循环应该无限运行。

如果我在用户空间程序中有等效的代码,则当我按Control + C时,用户空间程序将终止,但是内核模块不是这种情况。

有没有办法向内核模块发送终止信号(当它仍在运行其init例程时),以便它可以终止/退出?

提前致谢

kernel-module linux-kernel

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

Apache POI - 如何将表从一个 docx 复制到另一个 docx

嗨,我正在尝试将一个表格从 docx 文件复制到另一个文件,但发生的情况是表格的值被复制到新文档中的表格下方和表格之外(见下图)

原始文档中的表格 在此处输入图片说明

新 docx 中的 Talbe

在此处输入图片说明

如您所见,表的值被复制到表外。我使用的是 Libre Office,apache poi 版本 3.17,我的电脑运行的是 Ubuntu 16.04

我用来执行复制的代码如下

public static void copyTable(XWPFDocument input_doc,XWPFDocument output_doc,
                             int table_index_input, int table_index_output) {

    XWPFTable template_table = input_doc.getTables().get(table_index_input);

    CTTbl ctTbl = CTTbl.Factory.newInstance(); // Create a new CTTbl for the new table
    ctTbl.set(template_table.getCTTbl()); // Copy the template table's CTTbl
    XWPFTable new_table = new XWPFTable(ctTbl, output_doc); // Create a new table using the CTTbl upon

    output_doc.createParagraph();
    output_doc.createTable();// Create a empty table in the document
    output_doc.setTable(table_index_output, new_table);  // Replace …
Run Code Online (Sandbox Code Playgroud)

java apache-poi

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

标签 统计

apache-poi ×1

java ×1

kernel-module ×1

linux-kernel ×1