glib

实战Ntop流量监控

为君一笑 提交于 2020-08-06 14:56:55
centos5.x安装Ntop(centos5.x不可以安装NtopNG) http://www.cyberciti.biz/faq/howto-install-ntop-on-rhel-centos-fedora-linux/ Following instructions are tested on 32/64 bit versions only: a) RHEL Linux 5.x b) CentOS Linux 5.x ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://400053.blog.51cto.com/390053/845164 安装所需要的包: #yum install automake libpcap libpcap-devel gcc gd.x86_64 gd-devel.x86_64 gdbm gdbm-devel glib glib-devel GeoIP-devel.x86_64 GeoIP.x86_64 cairo-devel pango-devel libxml2 libxml2-devel libtool 下载ntop-4.0.1.tar.gz #wget http://ncu.dl.sourceforge.net/project/ntop

How to use gdk_device_get_position()?

允我心安 提交于 2020-08-04 05:40:05
问题 I am trying to get the pointer position on screen in Gdk and found gdk_display_get_pointer() , which works fine, but it's marked as deprecated and refers to gdk_device_get_position() now. But how do I use this function? I cannot get a GdkDevice , since there is no factory, nor is there a constructor. 回答1: use Gdk.DeviceManager. ..... ..... GdkDisplay *display = gdk_display_get_default (); GdkDeviceManager *device_manager = gdk_display_get_device_manager (display); GdkDevice *device = gdk

Glib之gobject中G_DEFINE_TYPE定义

好久不见. 提交于 2020-07-27 08:29:35
#define G_DEFINE_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) #define G_DEFINE_TYPE_EXTENDED(TN, t_n, T_P, _f_, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, _f_) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() #define _G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \ \ static void type_name##_init (TypeName *self); \ static void type_name##_class_init (TypeName##Class *klass); \ static gpointer type_name##_parent_class = NULL; \ static void type_name##_class_intern_init (gpointer klass) \ { \ type_name##_parent_class = g_type_class_peek_parent (klass); \

UI freezes for a short moment while trying to execute multiple commands in a gnome shell extension

為{幸葍}努か 提交于 2020-05-17 06:11:07
问题 Original question: Multiple arguments in Gio.Subprocess So currently I'm trying to execute multiple asynchronous commands in my gnome-shell-extension via Gio.Subprocess. This works fine, if I put all commands as only one chained command with && in the command vector of the Subprocess. The drawback of this solution is, that the output of the different chained commands is only updated once and the execution time may be long. What I'm now trying to do, is to execute every command on its own at

sql优化工具SQLAdvisor的安装

核能气质少年 提交于 2020-05-02 00:31:05
原文地址:https://www.cnblogs.com/beliveli/articles/6541936.html 本机安装包路径: D:\share\src\linux-mysql\sqlAdvisor\ 1.克隆代码 git clone https://github.com/Meituan-Dianping/SQLAdvisor.git 2.安装依赖 yum install -y cmake libaio-devel libffi-devel glib2 glib2-devel bison 3.安装percona56 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm -y yum install Percona-Server-shared-56 -y 4.编译sqladvisor时依赖perconaserverclient_r, 因此需要安装Percona-Server-shared-56。有可能需要配置软链接例如: cd /usr/lib64/ ln -s libperconaserverclient_r.so.18 libperconaserverclient_r.so 5.

[转帖]【Linux】理清gcc、glibc、libstdc++的关系

女生的网名这么多〃 提交于 2020-04-12 12:02:28
【Linux】理清gcc、glibc、libstdc++的关系 \ 赏金Micheal 关注 2019.06.21 21:18:08字数 1,993阅读 249 当你在Linux下写C/C++代码的时候,是不是会遇到许多编译链接的问题? 时不时报个glibc,gcc,g++等相关的错误, 很多时候都无从下手,而且比较混乱, 这也是编译链接过程中经常出现的问题。 这篇文章不是去介绍如何编译链接,而是理清编译链接过程中碰到的一些概念和出现的问题。尤其是 libc,glib,glibc,eglibc,libc++,libstdc++,gcc,g++。 从libc说起。 libc是Linux下原来的标准C库,也就是当初写hello world时包含的头文件#include < stdio.h> 定义的地方,后来逐渐被glibc取代,也就是传说中的GNU C Library,在此之前除了有libc,还有klibc,uclibc。现在只要知道用的最多的是glibc就行了,主流的一些linux操作系统如 Debian, Ubuntu,Redhat等用的都是glibc或者其变种,下面会说到。 那glibc都做了些什么呢? glibc是Linux系统中最底层的API,几乎其它任何的运行库都要依赖glibc。 glibc最主要的功能就是对系统调用的封装,你想想看

oracle 11g 在linux 5.5平台安装所必须的rpm包

孤人 提交于 2020-04-08 22:06:51
主流版本+主流平台 经过整理,包如下 elfutils-libelf-0.125-3.el5.x86_64.rpm elfutils-libelf-devel-0.125-3.el5.x86_64.rpm elfutils-libelf-devel-0.137-3.el5.i386.rpm elfutils-libelf-devel-static-0.137-3.el5.i386.rpm gcc-4.1.2-46.el5.i386.rpm gcc-4.1.2-46.el5.x86_64.rpm.rpm gcc-c++-4.1.1-52.el5.x86_64.rpm gcc-c++-4.1.2-52.el5_8.1.x86_64.rpm glibc-devel-2.5-12.i386.rpm glibc-devel-2.5-81.x86_64.rpm glibc-devel-2.9-15.1.x86_64.rpm glibc-headers-2.5-12.x86_64.rpm glib-devel-1.2.10-20.el5.i386.rpm glib-devel-1.2.10-20.el5.x86_64.rpm kernel-headers-2.6.18-164.el5.i386.rpm libaio-0.3.106-3.2.i386.rpm libaio-devel-0.3

linux下如何查看某个软件 是否安装??? 安装路径在哪???

廉价感情. 提交于 2020-03-04 12:02:34
<1>.在linux下如何判断是否已经安装某个软件? 我的系统是red hat 我用命令rpm查是否安装了某个软件(例如: matlab 与 fluent ),得到了如下的结果: 我用 rpm -qa (| grep) matlab , 回车后没有任何显示 我用 rpm -qa fluent , 回车后没有任何显示 我用 rpm -qa vasp , 回车后没有任何显示 但实际上肯定是装了 matlab 和 fluent , 而我用 [root@node1 /]# rpm -q fluent 显示的却是 package fluent is not installed matlab也一样 另外,命令 [root@node1 /]# man rpm 返回的却是 No manual entry for rpm 这是为什么呢? ++++++++++++++++++++++++++++++++++++++++++ rpm -qa|grep 软件包 ++++++++++++++++++++++++++++++++++++++++++ 用yum命令 yum search 试试 ++++++++++++++++++++++++++++++++++++++++++ 如果你使用 rpm -ivh matlab 装的, 用 rpm -qa | grep matlab 肯定是能够找到的。 如果你是用

如何在C中获取文件大小? [重复]

百般思念 提交于 2020-02-27 05:57:54
可能重复: 如何确定C中文件的大小? 如何找出用C语言编写的应用程序打开的文件大小? 我想知道大小,因为我想将加载文件的内容放入一个字符串,我使用 malloc() 分配。 只写 malloc(10000*sizeof(char)); 恕我直言是一个坏主意。 #1楼 您是否考虑过不计算文件大小而只是在必要时增加数组? 这是一个例子(省略错误检查): #define CHUNK 1024 /* Read the contents of a file into a buffer. Return the size of the file * and set buf to point to a buffer allocated with malloc that contains * the file contents. */ int read_file(FILE *fp, char **buf) { int n, np; char *b, *b2; n = CHUNK; np = n; b = malloc(sizeof(char)*n); while ((r = fread(b, sizeof(char), CHUNK, fp)) > 0) { n += r; if (np - n < CHUNK) { np *= 2; // buffer is too small, the next

How do you set an enum property on a GLib object?

半腔热情 提交于 2020-02-16 05:50:08
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188: