• 《什么是民粹主义?》摘要二

    ·

    发布于

    修改于

    民主与民粹的主要差异

    民主民粹
    让多数人能授权于民意代表,但民意代表不一定最终遵循多数公民的期望或原本的意愿假定民粹主义政府的所有决策都不应受到质疑,因为它们是“人民”的意愿
    认为不断变化的多数派所作的判断可能会出错,应允许受到质疑而后者则想象出一个独立于所有制度之外的同质化实体(“人民”),该实体的身份认同和观念能被完全地表现
    认为人民充其量是由各个个体组成的,最终有效力的还是(选举中的)人数理所当然地声称,存在一个多少有着神秘色彩的“思想”,甚至连大量民众(甚至是占多数的民众)都无法适当地表现这一思想
    按照民主程序所作出的决策并非“道德”的,如果“道德”意味着所有的反对意见都必须被视为“不道德”的话假定就算那些在高度争议的情况下做出的决策也仍旧有着道德上的合理性
    认为“人民”从来无法以非制度化的形式出现,更具体地说,就是前者认为多数派(甚至是“压倒性多数”,普京最喜欢的词汇)并非“人民”,也不能以人民的名义发言正好相反

  • Linux内核module依赖关系和引用

    ·

    发布于

    修改于

    如果模块B使用了模块A提供的函数,那么可以用以下两种方式看待模块A和模块B之间的关系。

    1. 模块B依赖模块A。除非模块A已经驻留在内核内存,否则模块B无法装载。
    2. 模块B引用模块A。除非模块B已经从内核移除,否则模块A无法从内核移除。更准确的说法是,所有引用模块A的模块都已经从内核移除,才能将模块A从内核移除。

    内核使用一种数据结构管理这种依赖关系。

    //kernel 2.6.34-
    //kernel/modules.c 
    struct module_use
    {
    	struct list_head list;
    	struct module *module_which_uses;
    };
    //kernel 2.6.35+
    struct module_use {
    	struct list_head source_list;
    	struct list_head target_list;
    	struct module *source, *target;
    };

    依赖关系的网络通过module_use和module数据结构的modules_which_use_me成员共同建立起来。对每个使用了模块A中函数的模块B,都会创建一个module_use的新实例。该实例将添加到模块A的module实例中的modules_which_use_me链表。module_which_uses指向模块B的module实例。根据这些信息,内核很容易计算出使用特定模块的其他内核模块。

    内核提供了already_uses函数用于判断模块A是否需要模块B。另一个函数add_module_usage用于建立模块A和模块B的关系,模块A需要模块B才能正确运行。

    /* Does a already use b? */
    static int already_uses(struct module *a, struct module *b)
    {
    	struct module_use *use;
    	list_for_each_entry(use, &b->source_list, source_list) {
    		if (use->source == a) {
    			pr_debug("%s uses %s!\n", a->name, b->name);
    			return 1;
    		}
    	}
    	pr_debug("%s does not use %s!\n", a->name, b->name);
    	return 0;
    }
    /*
     * Module a uses b
     *  - we add 'a' as a "source", 'b' as a "target" of module use
     *  - the module_use is added to the list of 'b' sources (so
     *    'b' can walk the list to see who sourced them), and of 'a'
     *    targets (so 'a' can see what modules it targets).
     */
    static int add_module_usage(struct module *a, struct module *b)
    {
    	struct module_use *use;
    	pr_debug("Allocating new usage for %s.\n", a->name);
    	use = kmalloc(sizeof(*use), GFP_ATOMIC);
    	if (!use)
    		return -ENOMEM;
    	use->source = a;
    	use->target = b;
    	list_add(&use->source_list, &b->source_list);
    	list_add(&use->target_list, &a->target_list);
    	return 0;
    }
    /* Module a uses b: caller needs module_mutex() */
    int ref_module(struct module *a, struct module *b)
    {
    	int err;
    
    	if (b == NULL || already_uses(a, b))
    		return 0;
    
    	/* If module isn't available, we fail. */
    	err = strong_try_module_get(b);
    	if (err)
    		return err;
    
    	err = add_module_usage(a, b);
    	if (err) {
    		module_put(b);
    		return err;
    	}
    	return 0;
    }
    EXPORT_SYMBOL_GPL(ref_module);
    
    /* Clear the unload stuff of the module. */
    static void module_unload_free(struct module *mod)
    {
    	struct module_use *use, *tmp;
    
    	mutex_lock(&module_mutex);
    	list_for_each_entry_safe(use, tmp, &mod->target_list, target_list) {
    		struct module *i = use->target;
    		pr_debug("%s unusing %s\n", mod->name, i->name);
    		module_put(i);
    		list_del(&use->source_list);
    		list_del(&use->target_list);
    		kfree(use);
    	}
    	mutex_unlock(&module_mutex);
    }
    

  • VMware Workstation Pro 17 Key

    ·

    发布于

    修改于

    JU090-6039P-08409-8J0QH-2YR7F


  • 编译Aseprite

    ·

    发布于

    修改于

    需要提前准备好skia库,并在下面的参数中指定skia库在硬盘上的路径。

    cmake -DCMAKE_BUILD_TYPE=Release -DLAF_BACKEND=skia -DSKIA_DIR=D:\Aseprite-v1.3-rc4-Source\skia -DSKIA_LIBRARY_DIR=D:\Aseprite-v1.3-rc4-Source\skia\out\Release-x64 -DSKIA_LIBRARY=D:\Aseprite-v1.3-rc4-Source\skia\out\Release-x64\skia.lib -G Ninja ..

  • 两种获取RIP的方式

    ·

    发布于

    修改于

    //只有X64可以用
    void get_rip_x64only()
    {
      void* rip;
      __asm__ __volatile__("lea 0(%%rip),%0":"=r"(rip));
    }
    //X86和X64都可以用
    void get_rip_x86andx64()
    {
      void* rip;
      __asm__ __volatile__(
      "jmp _label2\n\t"
      "_label1:\n\t"
      "jmp _getRIP\n\t"
      "_label2:\n\t"
      "call _label1\n\t"
      "_getRIP:\n\t"
      "pop %%rax\n\t"
      "movq %%rax,%0"
      :"=r"(rip)
      );    
    }

  • 编译Qt

    ·

    发布于

    修改于

    configure -prefix "C:\lib\qt\5.15.11\debug-and-release" -confirm-license -opensource -debug-and-release -static -static-runtime -platform win32-msvc -no-opengl -nomake examples -nomake tests -skip qtwebengine
    configure -prefix "C:\lib\qt\6.2.6\debug-and-release" -confirm-license -opensource -debug-and-release -static -static-runtime -platform win32-msvc -no-opengl -nomake examples -nomake tests -skip qtwebengine
    configure -prefix "C:\lib\qt\6.5.3\debug-and-release" -confirm-license -opensource -debug-and-release -static -static-runtime -platform win32-msvc -no-opengl -nomake examples -nomake tests -skip qtwebengine

  • QT 5.15 开启DPI缩放

    ·

    发布于

    修改于

    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
    //或
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

  • 更新.gitignore

    ·

    发布于

    修改于

    git rm -r --cached .
    git add .
    git commit -m "update .gitignore"
    git push -u origin main

  • 用openssl生成代码签名证书

    ·

    发布于

    修改于

    需要3个证书:根证书、中间证书、用户证书。

    因为同时使用这3个证书欺骗效果更好一些,证书路径如图所示。

    (更多…)

最新