Dear my friends...
I am developing a database application with Qt and
SuSE 9.1 .
My QDataTable can retrieve and display the content of
a table (from postgres) properly.
I make the cursor with QSqlSelectCursor. But the
problem is : if I clicked on of its row (record), than
the displayed record (which I clicked) disappear from
the QDataTable.
Why is it so?
Thank you very much in advance.
=========
QSqlDatabase * bd =
QSqlDatabase::addDatabase("QPSQL7");
bd->setHostName("192.168.23.1");
bd->setDatabaseName("kv");
bd->setUserName("postgres");
bd->setPassword("honestly");
if ( ! bd->open() )
{
bd->lastError().showMessage();
return;
}
QString stringsql = QString("select c.custid,
company, title, salutation, firstname, lastname,
address, postcode, city, areacode, phone, mobilephone,
fax, email, b.sent from %1 as c, sentbrochure as b
where c.custid=b.custid order by custid")
.arg(viewnya);
QSqlSelectCursor * cur = new
QSqlSelectCursor(stringsql, bd);
custdataTable->setSqlCursor(cur, true, false);
custdataTable->refresh();
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
I've trouble making bash script to move files from a directory to a new
directory--(named as the files' extension name). For example: moving files
*.pdf on /foo/ to /foo/pdf/, but there are so many extension. But how ?
Thx in advance.
---
ody
This was posted to the OpenSceneGraph mailing list, but I'm not sure if the
problem isn't with (my) SuSE implementation. My system is usually tweaked
beyond all recognition, so determining if I broke it can be tricky. Could
someone else verify that this works, or fails on their system?
Here's where to get the goods:
Prerequisites:
http://openthreads.sourceforge.net/http://www.andesengineering.com/Producer/download.html
OSG:
http://openscenegraph.sourceforge.net/http://openscenegraph.sourceforge.net/downloads/index.html
Crash course in configuration, building and installing:
I went
into the respective Make/makedef's and hardwired the INST_LOCATION =
$(WHEREIPUTIT). I believe that was unnecessary, but I was having problems
with the OSG install, so I tried to force the issue. I believe I can simply
`make INST_LOCATION = $(OSG) install' assuming the environment is configures
as shown below. Is that a correct assumption?
I also put this in my ~/.bashrc
export OPENTHREADS=$ORG/openthreads
export OPENTHREADS_INC_DIR=$OPENTHREADS/include
export OPENTHREADS_LIB_DIR=$OPENTHREADS/lib
export OPENPRODUCER=$COM/andesengeneering/openproducer
export PRODUCER_INC_DIR=$OPENPRODUCER/include
export PRODUCER_LIB_DIR=$OPENPRODUCER/lib
export OSG=$ORG/osg
# added to LIBRARY_PATH, LD_LIBRARY_PATH and CPLUS_INCLUDE_PATH
/************* Du Problem ******************/
When I run the teapot example from the OSG CVS, the surface has rectangular or
parallellogram holes appearing throughout the image. In the xterm I see
fallback Q_BIT
fallback Q_BIT
fallback Q_BIT
fallback Q_BIT
fallback Q_BIT
fallback Q_BIT
...
I'm running on SuSE 9.1 latest updates; a P4 with unsupported hyperthreading.
This is what 3Ddiag has to say:
3Ddiag version 0.716
Verifying 3D configuration:
Using 3dinfo
************************************************************
Verifying 3D configuration for 3D board "ATI Technologies Inc Radeon VE
(1002@5159)":
Tests for XFree86 configuration:
Config File /etc/X11/XF86Config ... done.
Driver ... done.
Extensions ... done.
Options ... done.
Checking GL/GLU/glut runtime configuration:
GL/GLU ... done (package XFree86-Mesa)
glut ... done (package freeglut)
Is anybody else experiencing this?
--
Regards,
Steven
> > 1. I ran top with an update every second, and it confirms that aiotest
> > uses 0.0% of the CPU. I have a 2.8 GHz Pentium 4 machine.
>
> Oh! Now I understand why you didn't see high CPU utilisation. top(1) is
> broken in this respect--for some reason it's not counting CPU
> utilisation (and presumably other resource utilisation) by threads other
> than the first/main one, at least in the case of this test case. This
> problem occurs on SLES 9 as well... I haven't had time to look into it
> much further yet, but I guess it's worth opening a bug to SuSE about it.
>
> Try using vmstat(1) or ps(1) in show-all-threads mode instead. It sounds
> like the problem does occur on your machine, so I expect if you rerun the
> test and watch the CPU using vmstat, you'll see the high CPU utilisation.
Using ps as you did, or with the -m or -T thread-switches does still not
show any CPU usage for aiotest. I can see the two threads, However, 'vmstat
1' displays that I am using
The CPU 50/50 in user- and kernel- space.
> > 2. The number of io_getevents increases proportionally to the
> > sleep-period, with about 19 calls per milliseconds.
>
> > I guess the 19 io_getevents per ms is too CPU intensive for your
> > machine?
>
> Given that I now believe the problem occurs on your SuSE 9.1 install as
> well, I think you'll find that the number of io_getevents calls increases
> in proportion to the speed of CPU, i.e. the faster the CPU, the faster
> handle_kernel_aio will spin.
>
> I appreciate your time testing this for me.
>
> Thanks,
> -mjg
> --
> Matthew Gregan |/
> /| kinetik(a)orcon.net.nz
Håkon Hallingstad
I found out although aiotest does not use much CPU, it does generate a lot
of io_getevents.
$ strace -f ./aiotest 2> aiotest.stderr &
[1] 22004
$ check CPU utilisation
$ ps -e -L -o pcpu,pid,tid,comm,wchan | grep aiotest
0.0 22005 22005 aiotest schedule_timeout
0.0 22005 22006 aiotest ptrace_notify
$
[1]+ Done strace -f ./aiotest 2> aiotest.stderr
$ grep 'io_getevents(0x4017a000, 0, 0xa, 0x4038394c, 0) = 0' aiotest.stderr
| wc --lines
1900804
1. I ran top with an update every second, and it confirms that aiotest uses
0.0% of the CPU. I have a 2.8 GHz Pentium 4 machine.
2. The number of io_getevents increases proportionally to the sleep-period,
with about 19 calls per milliseconds.
I guess the 19 io_getevents per ms is too CPU intensive for your machine?
$ rpm -q kernel-default
kernel-default-2.6.5-7.108
$ rpm -q glibc
glibc-2.3.3-97
-----Original Message-----
From: Matthew Gregan [mailto:kinetik@orcon.net.nz]
Sent: 28. september 2004 00:38
To: suse-programming-e(a)suse.com
Subject: Re: [suse-programming-e] Problems with POSIX Asynchronous IO
At 2004-09-27T11:50:28+0200, Hallingstad Håkon wrote:
> FYI: aiotest is working fine on my SuSE 9.1 Personal box.
Interesting, thanks for testing that. I've just done a minimal SuSE 9.1
install and do see the problem, even after updating to the latest available
SuSE kernel.
What versions of glibc and the kernel does you 9.1 box have, is your 9.1 box
a i686 or better (or some other system where the TLS glibc libraries will be
used), and are you running a SuSE kernel?
$ rpm -q kernel-default; rpm -q glibc kernel-default-2.6.5-7.108
glibc-2.3.3-97
Thanks,
-mjg
> -----Original Message-----
> From: Matthew Gregan [mailto:kinetik@orcon.net.nz]
> Sent: 27. september 2004 11:33
> To: suse-programming-e(a)suse.com
> Subject: [suse-programming-e] Problems with POSIX Asynchronous IO
> Hi all,
> I'm having some problems with the POSIX Asynchronous IO support on a
> SLES 9 box I've been working with. The machine has all of the
> available SLES 9 updates applied.
> After submitting a single IO using the POSIX AIO interface provided by
> glibc, I notice that the worker thread created by glibc enters a tight
> loop and consumes 100% of one CPU. Once this occurs, AIO continues to
> work fine (other than this problem), but the worker thread will remain
> in this state until the program exits.
--
Matthew Gregan |/
/| kinetik(a)orcon.net.nz
--
To unsubscribe, email: suse-programming-e-unsubscribe(a)suse.com
For additional commands, email: suse-programming-e-help(a)suse.com Archives
can be found at: http://lists.suse.com/archive/suse-programming-e
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I would like to look into how one can create his own YaST2 modules. Is
there some kind of HOWTO or other documentation or maybe a template module
that can be used to get some ideas? Any hints would be appreciated.
Thanks!
Bye,
LenZ
- --
- ------------------------------------------------------------------
Lenz Grimmer <lenz(a)grimmer.com> -o)
[ICQ: 160767607 | Jabber: LenZGr(a)jabber.org] /\\
http://www.lenzg.org/ V_V
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/
iD8DBQFBWYtoSVDhKrJykfIRAtw4AJ9fe9FE13Qqbd6V1r4O/Ihs2wTYyACaA1cP
4tKY1zjhrTqLBjS+A47UWBI=
=mZpJ
-----END PGP SIGNATURE-----
Dear friends....
I am writing a database application with Qt 3.2 and
SuSE 9.1.
Each sales must write a report for the sales
supervisor after the sales call a customer. one of the
field in the report content a smiley (image file) to
represent(describe) the reaction of the customer.
The smiley field has content in the form of ascii art
such as : ":(", ":-)", ":X" etc.
The sales reports are displayed in QDataTable.
But I want the sales supervisor does not see the ascii
art but the corresponded image file which stored in a
subdirectory of my database application.
So my code should change for example ":)" into the
file "1.png".
I want to use this :
void QDataTable::paintField ( QPainter * p, const
QSqlField * field, const QRect & cr, bool selected )
[virtual protected]
I plotted the QDataTable in a UI Form with QtDesigner.
Is it possible to draw an image file into QDataTable
with QLabel instead of QPainter ?
If yes, how?
I have second question, if the form an sql query
(content ascii art like this : ":)" why this code
comes with error ?
QString noapp = noapplineEdit.text(); //nomor
appointment
QString sid = sidlineEdit.text(); //SalesID
QString cid = cidlineEdit.text(); //Customer ID
QString smiley = slineEdit.text(); //Smiley in ascii
art
QString report = rlineEdit.text(); //report dalam
kalimat biasa
QString reportsales = QString (insert into sales
report(nomerappointment, salesid, custid, smiley,
report) values('%1', '%1', '%1', '%1', '%1')
.arg(noapp)
.arg(sid)
.arg(cid)
.arg(smiley)
.arg(report);
In PHP I can use "\" so I make like this : $smiley =
"\:)" but should I do in C++ (Qt)?
Thank you very much in advance.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
You should declare "pilihan" as a "char", and then use
"toupper((int)piliphan)".
And """cout << "You selected Quit. Good bye!" << endl;""" should come after
"case 'Q':".
-----Original Message-----
From: Prabu Subroto [mailto:prabu_subroto@yahoo.com]
Sent: 28. september 2004 14:45
To: suse-programming-e(a)suse.com
Subject: [suse-programming-e] GNU C++ (beginner question)
Dear my friends...
I am a user of SuSE 9.1 since SuSE 6.0 until now.
I am trying to learn and practice GNU C++.
I start with this very simple program:
=====
#include <iostream.h>
#include <ctype.h>
#include <stdlib.h>
class menu {
public:
int pilihan;
void tampil();
};
int main(){
menu * m = new menu();
m->tampil();
return 0;
}
void menu::tampil(){
for (;;){
cout << "Menu : (S)amba (P)ostfix (B)ind (Q)uit\n";
cin >> pilihan;
switch ( toupper(pilihan) ){
case 'S':
cout << "You are administrating Samba Server" << endl;
break;
case 'P':
cout << "You are administrating Postfix Server" <<
endl;
break;
case 'B':
cout << "You are administrating BIND Server" << endl;
break;
cout << "You selected Quit. Good bye!" << endl;
case 'Q':
exit(0);
default:
cout << "***No such command!***" << endl;
break;
}
}
}
=====
I compiled it successfully, as below :
=====
patrixlinux@patrix:~/arsip/proyek/gcc/1> ls
liss liss.cpp liss.cpp~ patrixlinux@patrix:~/arsip/proyek/gcc/1> g++ -o
liss liss.cpp In file included from /usr/include/g++/backward/iostream.h:31,
from liss.cpp:1:
/usr/include/g++/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one
deprecated or antiquated header. Please consider using
one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or
<sstream> instead of the deprecated header
<strstream.h>. To disable this warning use
-Wno-deprecated.
patrixlinux@patrix:~/arsip/proyek/gcc/1> ./liss
Menu : (S)amba (P)ostfix (B)ind (Q)uit
s
====
But the problem is my program does not run as
expected. It does like this below without ending:
====
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
====
I aborted with <control>-<C>.
what's wrong with my code? Lookslike my code does not
receive the pressed key properly.
Please help.
Thank you very much in advance.
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today! http://vote.yahoo.com
--
To unsubscribe, email: suse-programming-e-unsubscribe(a)suse.com
For additional commands, email: suse-programming-e-help(a)suse.com Archives
can be found at: http://lists.suse.com/archive/suse-programming-e
Dear my friends...
I am a user of SuSE 9.1 since SuSE 6.0 until now.
I am trying to learn and practice GNU C++.
I start with this very simple program:
=====
#include <iostream.h>
#include <ctype.h>
#include <stdlib.h>
class menu {
public:
int pilihan;
void tampil();
};
int main(){
menu * m = new menu();
m->tampil();
return 0;
}
void menu::tampil(){
for (;;){
cout << "Menu : (S)amba (P)ostfix (B)ind (Q)uit\n";
cin >> pilihan;
switch ( toupper(pilihan) ){
case 'S':
cout << "You are administrating Samba Server" << endl;
break;
case 'P':
cout << "You are administrating Postfix Server" <<
endl;
break;
case 'B':
cout << "You are administrating BIND Server" << endl;
break;
cout << "You selected Quit. Good bye!" << endl;
case 'Q':
exit(0);
default:
cout << "***No such command!***" << endl;
break;
}
}
}
=====
I compiled it successfully, as below :
=====
patrixlinux@patrix:~/arsip/proyek/gcc/1> ls
liss liss.cpp liss.cpp~
patrixlinux@patrix:~/arsip/proyek/gcc/1> g++ -o liss
liss.cpp
In file included from
/usr/include/g++/backward/iostream.h:31,
from liss.cpp:1:
/usr/include/g++/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one
deprecated or antiquated header. Please consider using
one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X>
header for the <X.h> header for C++ includes, or
<sstream> instead of the deprecated header
<strstream.h>. To disable this warning use
-Wno-deprecated.
patrixlinux@patrix:~/arsip/proyek/gcc/1> ./liss
Menu : (S)amba (P)ostfix (B)ind (Q)uit
s
====
But the problem is my program does not run as
expected. It does like this below without ending:
====
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
Menu : (S)amba (P)ostfix (B)ind (Q)uit
***No such command!***
====
I aborted with <control>-<C>.
what's wrong with my code? Lookslike my code does not
receive the pressed key properly.
Please help.
Thank you very much in advance.
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
FYI: aiotest is working fine on my SuSE 9.1 Personal box.
-----Original Message-----
From: Matthew Gregan [mailto:kinetik@orcon.net.nz]
Sent: 27. september 2004 11:33
To: suse-programming-e(a)suse.com
Subject: [suse-programming-e] Problems with POSIX Asynchronous IO
Hi all,
I'm having some problems with the POSIX Asynchronous IO support on a SLES 9
box I've been working with. The machine has all of the available SLES 9
updates applied.
After submitting a single IO using the POSIX AIO interface provided by
glibc, I notice that the worker thread created by glibc enters a tight loop
and consumes 100% of one CPU. Once this occurs, AIO continues to work fine
(other than this problem), but the worker thread will remain in this state
until the program exits.
The kernel does not log any errors during the occurrence of this problem,
and the machine has otherwise been running fine.
I've written a small test case to reproduce the problem I'm seeing (attached
as aiotest.c). Build the test case using 'cc -Wall -o aiotest aiotest.c
-lrt' and run it--it'll create an 8MB file in the current directory, submit
a single 128kB IO, and then sleep for 10 seconds. The test case is small
and does little error checking; for the sake of this test case, I prefer
exiting to handling any errors nicely.
Since writing the test case, I've reproduced the problem on a number of
other SLES 9 boxes, both x86 and z/Series. The same test case, when run on
a SLES 8 box or RHEL 3AS box runs without issue, and the CPU is close to
idle, as expected.
I suspect the problem is within either the new kernel AIO library provided
as /usr/lib/librtkaio.so.1, with the kernel, or an interaction between the
two. RHEL 3AS also provides librtkaio for kernel AIO, and it seems to be a
new addition to SLES 9 as it was not present on my SLES 8 test boxes.
Running aiotest with LD_ASSUME_KERNEL=2.4.0 to force use of the older
pre-NPTL glibc results in the userspace AIO interface provided by librt.so.1
being used, and the test case runs without consuming excessive CPU.
Any suggestions would be appreciated.
'vmstat 1' during an aiotest run shows:
procs -----------memory---------- ---swap-- -----io---- --system--
----cpu----
r b swpd free buff cache si so bi bo in cs us sy id
wa
0 0 83356 399012 10168 61196 0 0 0 0 1012 55 0 0 100
0
0 0 83356 399012 10168 61196 0 0 0 0 1036 93 1 0 99
0
[aiotest starts]
2 0 83356 400204 10192 59508 0 0 0 788 1026 54722 20 29 51
0
[aiotest should be idle at this point]
1 0 83356 398476 10192 61252 0 0 0 0 1052 111790 36 64 0
0
1 0 83356 396684 10200 63000 0 0 0 0 1010 111877 38 62 0
0
1 0 83356 394892 10200 64752 0 0 0 0 1011 112199 37 63 0
0
1 0 83356 393164 10200 66504 0 0 0 0 1009 112273 39 61 0
0
1 1 83356 391372 10204 68232 0 0 0 8740 1071 110521 35 65 0
0
1 0 83356 389708 10212 69972 0 0 0 40 1019 111472 38 62 0
0
1 0 83356 387916 10216 71724 0 0 0 0 1008 112259 40 60 0
0
1 0 83356 386188 10216 73480 0 0 0 0 1009 112332 39 61 0
0
1 0 83356 384396 10220 75232 0 0 0 0 1011 112208 38 62 0
0
0 1 83356 383516 10220 76288 0 0 0 8372 1075 67572 25 36 21
18
[10 second sleep ends, aiotest exits]
0 0 83356 383580 10228 76288 0 0 0 40 1013 57 0 0 95
5
0 0 83356 383580 10228 76288 0 0 0 0 1010 52 1 0 99
0
A few seconds after starting aiotest:
$ ps -e -L -o pcpu,pid,tid,comm,wchan' | grep [a]iotest
0.0 23316 23316 aiotest2 schedule_timeout
71.7 23316 23317 aiotest2 -
Attaching with GDB and looking at the thread backtraces:
Thread 2 (Thread 1077447600 (LWP 23317)):
#0 0x400335b6 in handle_kernel_aio () from /lib/tls/librt.so.1 #1
0x401529ed in start_thread () from /lib/tls/libpthread.so.0 #2 0x400f09ca
in clone () from /lib/tls/libc.so.6
Thread 1 (Thread 1075172000 (LWP 23316)):
#0 0xffffe410 in ?? ()
#1 0xbfffef08 in ?? ()
#2 0x40149bb8 in
__elf_set___libc_thread_subfreeres_element___rpc_thread_destroy__ () from
/lib/tls/libc.so.6 #3 0xbfffed64 in ?? () #4 0x400c0696 in
__nanosleep_nocancel () from /lib/tls/libc.so.6 #5 0x400c0473 in sleep ()
from /lib/tls/libc.so.6 #6 0x080486d7 in main () #0 0xffffe410 in ?? ()
Further observation of the worker thread indicates that it spins inside
handle_kernel_aio(), which is part of kaio_misc.c in the rtkaio module of
glibc.
I've quickly compared the source of the rtkaio module from SLES 9 and a RHEL
3AS box. The source of the modules in each glibc is identical, which
suggests that the difference between the working RHEL 3AS box and the broken
SLES 9 box lies elsewhere in the glibc code, or within the kernel.
Running the test case using 'strace -f' shows thousands syscalls like the
one below. Compared to a run on a RHEL 3AS box, the number of these
io_getevents() calls is abnormally high.
Example output from 'strace -f ./aiotest':
[...]
[pid 23317] io_getevents(0x4017f000, 0, 0xa, 0x4038894c, 0) = 0 [...the line
above is repeated thousands of times...]
Cheers,
-mjg
--
Matthew Gregan |/
/| kinetik(a)orcon.net.nz