glib

Problem with GSList (GLib)

冷暖自知 提交于 2021-02-11 13:28:48
问题 HI, I'm trying to use GSList from glib.h but I'm having problems when filling the list with char * elements. Here's the code: GSList * res = NULL; char * nombre; while (...) { nombre = sqlite3_column_text(resultado, 1); res = g_slist_append (res, nombre); } printf("number of elements: %i\n", g_slist_length(res)); printf("last element: %s\n", g_slist_last(res)->data); When I print the number of elemnts, I see the list is not empty. But when I print the last element, It doesn't show anything...

How to modify a LD_LIBRARY_PATH environment variable?

跟風遠走 提交于 2021-02-08 11:37:54
问题 I have Ubuntu 16.04, and installing gtk+3.22.20, a version of GLIB >= 2.49.4 is needed. When running the 'configure' script, it says it detects that GLIB is 2.48.2. However, 'pkg-config --modversion glib-2.0' returns 2.52.3 since I installed that version. They suggest to: "remove the old version of GLib. You may also be able to fix the error by modifying your LD_LIBRARY_PATH enviroment variable, or by editing /etc/ld.so.conf. Make sure you have run ldconfig if that is required on your system.

How to send user_data with gtk signals in loop

不羁的心 提交于 2021-01-29 21:53:55
问题 I have signals "make" and "send" registered in core class in main thread. I call call_make() from user class in same thread. call_make() will do some work and fetch some data from worker thread and after return it will emit signal "make". This is code of user class struct my_struct{ int cur_make_id; int cur_send_id; //there may be many id's if multiple signals } void on_send_cb(core, gpointer data){ my_struct *user_data = (my_struct *) data; printf("cure_make_id %d", user_data->cur_make_id);

How to send user_data with gtk signals in loop

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 16:20:47
问题 I have signals "make" and "send" registered in core class in main thread. I call call_make() from user class in same thread. call_make() will do some work and fetch some data from worker thread and after return it will emit signal "make". This is code of user class struct my_struct{ int cur_make_id; int cur_send_id; //there may be many id's if multiple signals } void on_send_cb(core, gpointer data){ my_struct *user_data = (my_struct *) data; printf("cure_make_id %d", user_data->cur_make_id);

Catching signal from Python child process using GLib

核能气质少年 提交于 2021-01-29 06:27:55
问题 I'm trying to control the way my cursor looks during certain points of my program execution. To be specific, I want it to be a "spinner" when a Python script is executing, and then a standard pointer when it's done executing. Right now, I have a leave-event-notify callback in Glade that changes the spinner when it leaves a certain area, but this is non-ideal since the user might not know to move the cursor and the cursor doesn't accurately represent the state of the program. I have my Python

GstMultifilesink post-messages callback

家住魔仙堡 提交于 2021-01-02 16:35:14
问题 I would like to know how to get a callback from the gstreamer multifilesink element using post-messages=TRUE property? In the code below my_bus_callback function is never called. Multifilesink docs say: If the "post-messages" property is TRUE, it sends an application message named "GstMultiFileSink" after writing each buffer. http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gst-plugins-good-plugins-0.10/gst-plugins-good-plugins-multifilesink.html#GstMultiFileSink--post

GstMultifilesink post-messages callback

南楼画角 提交于 2021-01-02 16:31:02
问题 I would like to know how to get a callback from the gstreamer multifilesink element using post-messages=TRUE property? In the code below my_bus_callback function is never called. Multifilesink docs say: If the "post-messages" property is TRUE, it sends an application message named "GstMultiFileSink" after writing each buffer. http://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/gst-plugins-good-plugins-0.10/gst-plugins-good-plugins-multifilesink.html#GstMultiFileSink--post

SQLAdvisor使用(Centos6.8版本)

纵饮孤独 提交于 2020-12-17 02:08:12
SQLAdvisor是由美团点评公司技术工程部DBA团队(北京)开发维护的一个分析SQL给出索引优化建议的工具。它基于MySQL原生态词法解析,结合分析SQL中的where条件、聚合条件、多表Join关系 给出索引优化建议。目前SQLAdvisor在美团点评广泛应用,包括美团支付、酒店旅游、外卖、团购等产品线,公司内部对SQLAdvisor的开发全面转到github上,开源和内部使用保持一致。 主要功能:输出SQL索引优化建议 下载安装包:SQLAdvisor-2.0.tar.gz rpm -q cmake libaio-devel libffi-devel glib2 glib2-devel yum install cmake libaio-devel libffi-devel glib2 glib2-devel #在SQLAdvisor编译时需要这个 rpm -ivh percona-release-0.1-3.noarch.rpm tar -xvf Percona-Server-5.6.29-76.2-rddf26fe-el6-x86_64-bundle.tar rpm -ivh Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64.rpm --nodeps rpm -ivh Percona-Server-client-56-5

SQL优化工具SQLAdvisor使用

↘锁芯ラ 提交于 2020-12-16 13:03:55
一、简介 在数据库运维过程中,优化SQL是业务团队与DBA团队的日常任务。例行SQL优化,不仅可以提升程序性能,还能够降低线上故障的概率。 目前常用的SQL优化方式包括但不限于:业务层优化、SQL逻辑优化、索引优化等。其中索引优化通常通过调整索引或新增索引从而达到SQL优化的目的。索引优化往往可以在短时间内产生非常巨大的效果。如果能够将索引优化转化成工具化、标准化的流程,减少人工介入的工作量,无疑会大大提高DBA的工作效率 SQLAdvisor是由美团点评公司DBA团队(北京)开发维护的SQL优化工具:输入SQL,输出索引优化建议。 它基于MySQL原生词法解析,再结合SQL中的where条件以及字段选择度、聚合条件、多表Join关系等最终输出最优的索引优化建议。目前SQLAdvisor在公司内部大量使用,较为成熟、稳定。 美团点评致力于将SQLAdvisor打造成一款高智能化SQL优化工具,选择将已经在公司内部使用较为成熟的、稳定的SQLAdvisor项目开源,github地址。希望与业内有类似需求的团队,一起打造一款优秀的SQL优化产品。 目前SQLAdvisor在美团点评内部广泛应用,公司内部对SQLAdvisor的开发全面转到github上,开源和内部使用保持一致。 主要功能:输出SQL索引优化建议 GitHup地址:https://github.com/Meituan