Hi,
I'm trying to learn glade. autogen.sh failed on my first try; giving the error
below:
./configure: line 4068: syntax error near unexpected token `PACKAGE,'
./configure: line 4068: `PKG_CHECK_MODULES(PACKAGE, $pkg_modules)'
Then i learned that i had to install pkgconfig; i did so; but this time
autogen gave the following error:
checking for gtk+-2.0 >= 2.0.0... Package gtk+-2.0 was not found in the
pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
configure: error: Library requirements (gtk+-2.0 >= 2.0.0) not met; consider
adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a
nonstandard prefix so pkg-config can find them.
How do i have to set PKG_CONFIG_PATH environment variable?
Thanks in advance.
I'm now trying to really get a handel on pointers. I must admit this stuff
has always been confusing to me. The code below produces an unexpected
result when it is run. The last line of output is "HelloClass::memberIntPtr
= -1073747936". I expected it to be "HelloClass::memberIntPtr = 1848", as it
is in the previous invocation of sayHello(). My guess as to what is
happening is that my use of a member variable of type string, and then
assigning to that variable is resulting in and over write of the memory
pointed to by HelloClass::memberPtr.
Is my understanding of what's happening correct? What's the proper remedy for
this situation?
#include <iostream> // cout, cin
#include <string>
using namespace std;
class HelloClass {
public:
HelloClass::HelloClass();
void sayHello();
/** Accessors for HelloClass::message */
void setMessage(string messageStr="This is the default setMessage message.");
string getMessage();
/** Accessors for HelloClass::messagePtr */
void setMessagePtr(string messageStr="This is the default setMessagePtr
message.");
string getMessagePtr();
/** Accessors for HelloClass::memberInt */
void setMemberInt(int memberInt=2112);
int getMemberInt();
/** Accessors for HelloClass::memberIntPtr */
void setMemberIntPtr(int memberIntPtr=1848);
int getMemberIntPtr();
private:
string message;
string *messagePtr;
int memberInt;
int *memberIntPtr;
};
/** Constructor: initialize all member variables. */
HelloClass::HelloClass(){
this->message = "c++bean message. Assigned in constructor.";
this->messagePtr = (new string("c++bean messagePtr. Assigned in
constructor."));
this->memberInt = 42;
int temp = 100760;
this->memberIntPtr = &temp;
}
/** Accessors for HelloClass::message */
void HelloClass::setMessage(string messageStr){
this->message = messageStr;
}
string HelloClass::getMessage(){
return this->message;
}
/** Accessors for HelloClass::messagePtr */
void HelloClass::setMessagePtr(string messageStr){
this->messagePtr = new string(messageStr);
}
string HelloClass::getMessagePtr(){
return *this->messagePtr;
}
/** Accessors for HelloClass::memberInt */
void HelloClass::setMemberInt(int memberInt){
this->memberInt = memberInt;
}
int HelloClass::getMemberInt(){
return this->memberInt;
}
/** Accessors for HelloClass::memberIntPtr */
void HelloClass::setMemberIntPtr(int memberIntPtr){
this->memberIntPtr = &memberIntPtr;
}
int HelloClass::getMemberIntPtr(){
return *this->memberIntPtr;
}
/** Output the properties of HelloClass*/
void HelloClass::sayHello() {
cout << "HelloClass::message = " << this->getMessage() << endl;
cout << "HelloClass::messagePtr = " << this->getMessagePtr() << endl;
cout << "HelloClass::memberInt = " << this->getMemberInt() << endl;
cout << "HelloClass::memberIntPtr = " << this->getMemberIntPtr() << endl;
cout << "___________________________" << endl;
}
main() {
HelloClass h;
h.sayHello();
h.setMessage();
h.setMessagePtr();
h.setMemberInt();
h.setMemberIntPtr();
h.sayHello();
h.setMessage("User defined \"Hello World\" message.");
h.sayHello();
return 0;
}
I tried to write the most basic hello world program I know of in c++ and I am
getting deprication messages from gcc when I compile. Looking through the the
documentation I have on line has merely lead to several levels of
indirection. What am I supposed to use insted of <iostream.h>? And where do
I find documentation on this which won't take me an hour to figure out how to
use basic standard in and standard out?
STH
Dear my friends....
I am trying to read the content per line of a query
result with "mysql_fetch_row". But I got this error
message :
"
Musingin homepage
koneksi sukses. Sukses memilih database. Sukses
melakukan query. Besar hasil query 1.
Warning: mysql_fetch_row(): supplied argument is not a
valid MySQL result resource in
/srv/www/htdocs/i-am-e-system/cgi-bin/tulis.php on
line 20
Akhir baris.
"
Could any body tell me where my mistake?
Here is my codes under belom:
<?PHP
$konek=mysql_connect("localhost", "prabu",
"password");
if ($konek){
echo "koneksi sukses.\n";
mysql_select_db("berita");
echo "Sukses memilih database.\n";
$kalimatsql="
SELECT noberita, pengirim, tanggal, namafile
FROM berita
";
$hasil = mysql_query($kalimatsql, $konek);
echo "Sukses melakukan query.\n";
$besarhasil=sizeof($hasil);
echo "Besar hasil query $besarhasil.\n";
while ($baris = mysql_fetch_row($hasil)){
list($noberita,$pengirim,$tanggal,$namafile)=$baris;
echo "
Nomer berita : $noberita\n
Pengirim : $pengirim\n
Tanggal : $tanggal\n
Nama file : $namafile\n
";
}
echo "Akhir baris.\n";
} else echo "Gagal konek.\n";
mysql_close($konek);
?>
Thank you very much in advance.
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Dear my friends...
I am trying to write a program to do uploading with
HTTP_POST_FILES but I got this error message on my
browsers:
"
Uploading Date and Time: 31-03-2003 02:03:05
Title: erw
Source: dwfds
Sender: sdfsd
File Name:IT_Master.pdf
Temporare File Name:
Warning: Unable to open '' for reading: No such file
or directory in
/srv/www/htdocs/i-am-e-system/berita.php on line 17
Failed.
"
And why does the value of
"$HTTP_POST_FILES['filename'][`tmp_name']" not come
out?
And Why could my code not copy the local file?
Here is my code:
"
<?PHP
session_start();
session_register("judul");
session_register("sumber");
session_register("pengirim");
session_register("namafile");
?>
<HTML>
<BODY bgcolor="white"><FONT type="arial" size="3">
<CENTER>
<FORM enctype="multipart/form-data" method="put"
action="berita.php">
<CENTER><U><H1>File Uploading
Menu</H1></U></CENTER><BR><BR>
<TABLE>
<OL>
<TR>
<TD><LI>Title</TD><TD>:</TD><TD><INPUT type="text"
name="title" maxlength="80"></TD>
</TR>
<TR>
<TD><LI>Source</TD><TD>:</TD><TD><INPUT type="text"
name="source" maxlength="80"></TD>
</TR>
<TR>
<TD><LI>Sender</TD><TD>:</TD><TD><INPUT type="text"
name="sender" maxlength="40"></TD>
</TR>
<INPUT type="hidden" name="MAX_FILE_SIZE"
value="10000">
<TR>
<TD><LI>File Location</TD><TD>:</TD><TD><INPUT
type="file" name="filename" maxlength="200"></TD>
</TR>
</OL>
<TR>
<TD colspan="2"></TD><TD><INPUT type="submit"
value="Up Load"></TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</FONT></BODY>
</HTML>
"
Thank you very much in advance.
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
>> * Greg Freemyer (freemyer(a)NorcrossGroup.com) [030328 10:55]:
>> > I have a series of similar boxes that I want to have identical system
>> disks.
>> >
>> > Then use mount --bind over to a configuration/data disk for the few
>> > unique files like passwd/shadow/group/etc.
>> You might just want to rsync /etc, seems much simpler and can be
>> done over ssh if that's a concern.
I don't understand.
During normal day to day admin, I would need to rsync files from /etc to /config/etc.
Then immediately after a system disk replacement, I would have to reverse the rsync.
It seems possible, but it also seems like eventually I would screw something up and lose my user accounts.
I could use timestamps to try to avoid a screw up, but somehow I don't really trust that approach.
>> > I should be able to just write a short script:
>> >
>> > #!/bin/sh
>> > chroot /config useradd $*
>> You'll need to copy a shell, libc, and whatever else useradd needs
>> into the chroot as well.
>> --
>> -ckm
I copied over a dozen or so files and I still could not get it to work.
I ran strace on useradd to see what was failing.
It seemed to revolve around PAM authentication which can get fairly involved.
So I gave up on that approach.
Instead, I got the shadow-4.0.2.src.rpm off of the CDs and extracted the source.
Then I edited ./lib/defines.h to have
===
#define PASSWD_FILE "/config/etc/passwd"
#define GROUP_FILE "/config/etc/group"
#define SHADOW_FILE "/config/etc/shadow"
#define SGROUP_FILE "/config/etc/gshadow"
===
And did a make; make install.
So far it seems to be working, but I have done very little testing. In particular, I have not tested a single-user boot!!!
I hope this effectively means that all changes are made to my /config/etc set of files, but PAM uses the /etc set I have setup as --bind to the /config set.
BTW: One nice thing about using binds for this is that if /config is not available, or if I boot single user mode, then the underlying files are still available and I _hope_ I can still login with the base accounts like root.
Thanks
Greg
>> * Greg Freemyer (freemyer(a)norcrossgroup.com) [030327 16:15]:
>> > [pid 21991] rename("/etc/passwd+", "/etc/passwd") = -1 EBUSY (Device or
>> resource busy)
>> That sounds like what should happen. From rename(2):
>> EBUSY The rename fails because oldpath or newpath is a directory that is
>> in use by some process (perhaps as current working directory, or as
>> root directory, or because it was open for reading) or is in use by
>> the system (for example as mount point), while the system considers
>> this an error. (Note that there is no requirement to return EBUSY
>> in such cases - there is nothing wrong with doing the rename anyway
>> - but it is allowed to return EBUSY if the system cannot otherwise
>> handle such situations.)
>> It's easy to duplicate this and see that's it's nothing specific to
>> yast or useradd:
>> hades:/tmp # mkdir test && touch test/motd
>> hades:/tmp # mount --bind /etc/motd test/motd
>> hades:/tmp # mv test/motd test/foo
>> mv: cannot move `test/motd' to `test/foo': Device or resource busy
Really, I wasn't complaining, nor did I think anything was broken.
I just could not make it do what I wanted. I know, I'm too demanding. :)
>> I don't think you mentioned why you want your passwd and shadow file
>> in a directory other than /etc/
I have a series of similar boxes that I want to have identical system disks.
Then use mount --bind over to a configuration/data disk for the few unique files like passwd/shadow/group/etc.
Then I can QA an update in the lab and use a disk-duplicator to rollout the upgrade.
>> but you can probably do this chroot.
Very good idea.
I should be able to just write a short script:
#!/bin/sh
chroot /config useradd $*
I'm off to give that a shot.
>> --
>> -ckm
Greg
I want to use the class described on the page found here on my SuSE 8.1. (It
requiers the CommonC++ documentation to be installed.)
file:///usr/share/doc/packages/CommonC++-doc/html/classost_1_1_string_tokenizer.html#_details
How would one typically (correctly) include such a library in his code? If I
follow K&R 2nd. Ed., they put the #includes for libraries in any .c file that
relies on them. Is that technically necessarily? From my experimentation,
id doesn't /seem/ to be necessary. All that is required to get the code to
run is that the one of the header files referenced in the .c includes the
particular library.
But 'technically' correct, and stylistically correct are not the same thing.
What is the prefered /style/?
Is this CommonC++ library really common? If I put it in my code and
distribute it, will a bunch of people curse me? Is it the best bag of trick
to draw from for general functionality such as string tokenization. I'm
writing for a QT/KDE environment.
STH
In Java I can do this.method(); on any method of my current class, or any
super class as long as the method is not private. From toying around a bit in
C++, it seems I can't do this->methodOfSuper(); Is that a correct
understanding?
STH
> Exactly. I just found an excellent book "Build Your Own Database Driven
> Website Using PHP & MySQL" by Kevin Yank. They just released second
> edition. The first 4 chapters are free for downloading. The URL is
> http://sitepoint.com. I was using O'Reilly's MySQL book and the PHP
> Bible, but this book actually got me started. For me, PHP itself was
> easy because it is so much like C.
Yes, I've decided this is a good opportunity for me to learn a new language. I
haven't done that for a few years now. :o) PHP is clearly a useful skill to
know these days.
I have the book "Core PHP Programming" which seems to contain far too much
waffle. The variables section, for instance, starts off buy describing that a
variable "is a value held somewhere in the computer's RAM", etc.
So I gave up on that and am now wading through the online PHP manual, which is
very good. The language is quite simple compared to peers like Perl, and
doesn't seem to have any unique features to learn (except the === operator
which I've not seen before).
I've not produced anything with it yet, but I'm confident it's the right
choice for what I need.
--
"...our desktop is falling behind stability-wise and feature wise to KDE
...when I went to Mexico in December to the facility where we launched gnome,
they had all switched to KDE3." - Miguel de Icaza, March 2003