Programming :: Destructor Called On Objects In Deque Without It Being Called Explicitly

Jul 13, 2011

I feel there's a bit of a misunderstanding going on between C++ and me...My problem is that I have a deque of pointers to a class, and create objects then add them to the deque in a for loop. However, the destructor is called on the object as soon as the loop quits.

Code:

This prints:

Code:

Now, if I change the deque from deque<Test*> to deque<Test> then it works fine - I get:

Code:

However, I can't do this with my actual code, because I am creating a deque of pointers to an abstract class, so it won't let me instantiate the class. (This is all so that I can take advantage of polymorphism, and call functions on a set of similar objects without worrying what type of object I'm dealing with).

So, I suppose my question is: what is the correct way to create that deque of pointers to the abstract class? I don't seem to be barking up the right tree currently.

View 4 Replies


ADVERTISEMENT

Programming :: What Is Called The Old Style Of The GUI Interfaces

Nov 27, 2010

I'm wondering about this kind of GUI Interfaces like Slackware setup program

What is called ? Also, Can it be used with Python?

View 6 Replies View Related

Programming :: Function Successfully Called But It Did Not Run Device Properly?

Jan 6, 2010

I have our own C written program code which is communicating with a third party C++ written program code to run a moving device. We have successfully communicated with the third party code with wrapper functions. (Thanks to member in LQ that helped me solved this.)Now, we tried to run some functions to move the device. I think it is better for me to attach the related code first. pro.c (The source code we used to run the device)

Code:
#include<stdio.h>
#include "wrapper.h"

[code]....

View 7 Replies View Related

Programming :: Terminate Called After Throwing An Instance Of 'std::bad_alloc'

Jul 13, 2010

I have written a code in which i have used vectors:

vector< vector<double> > arr;
arr.resize(x,vector<double>(x,0));

x is a variable which is taken from a very beg text file > 64MB

first line of my code is
cout<<"
Wait Running...";

my code takes text file as an input, takes its data and generates an output text file....

Code is running fine for small data tried till x= 10

but while trying to run with large data ie x = 5000000 approx it is giving error
Even the first line of the code is not displayed. NOTE: variable is declared global but its size is defined in main.

The error that i am getting after approx 2-3 minutes is:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Wait Running...Aborted (core dumped)

View 6 Replies View Related

Programming :: What Is The Terminology Called Of A Binary Using A File That Is Not Part Of It's Self

Feb 14, 2011

What is the Terminology called of a Binary using a file that is not part of it's self? An example would be when a browser uses a HTML file for it's interface. The binaries code has to know how to find it and so on. I imagine that the applications binary uses a system call and that another application takes over.

View 1 Replies View Related

Programming :: Wrote Code For An Application Called Nagios?

Sep 3, 2010

I suspect this will be beyond my abilities but thought I'd give it a try. A few months ago I wrote code for an application called nagios which would send me tweets when a system within my network ran into a problem (code below):

Code:
define command {
command_name notify-host-twitter

[code]....

View 7 Replies View Related

Programming :: Using Command-line Options With A Program That's Called Using Env

Oct 11, 2010

I thought about this a while ago when reading through a Python tutorial and I googled some and couldn't find an answer. Now I want to know it for Ruby, also, and it's more important now because I want to invoke Ruby with -w.

How can you use:

Code:

with a -w option to ruby, like:

Code:

This doesn't work and I can't find an explanation of how to do it.

Code:

View 1 Replies View Related

Programming :: Loading Environment Into Bash Script Called By Cron?

Mar 18, 2010

Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.

The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?

View 1 Replies View Related

Programming :: What Are The Series Of Files That Are Called When A User Make Copy Operation From Usb Mass Storage To Hard Disk

Mar 20, 2010

what are the series of files that are called when a user make copy operation from usb mass storage to hard disk?i have reached the code of the usb mass storage in linux kernel 2.6.33 and i want the exact code the make the copy how can i do that?

View 2 Replies View Related

Programming :: Function Handler Is Called One Time Only Instead 2 Times If The 2 Timers Expires At A Time

Mar 2, 2011

I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?

View 14 Replies View Related

Programming :: Function In Kernel Space Called Form User Space

Jul 7, 2009

I wanna write a file in kernel space but from my searching I can to know that instead of writeing file in kernel space ,I can write data to user space by copy_to_user space.

But link is missing ...I dont know how will my user space will access kernel space means my function in kernel space which will do copy_to_user /....How my user space function will call my kernel level function ..

Can any one of you provide me with some example file which are doing this .I know every char driver is using it ...but i could not trace back how user level function is accessing it ...i m confused between user space and kernel space.

View 2 Replies View Related

Ubuntu :: Fsck Is Called On Every Startup?

May 9, 2010

I am using bootchart to investigate the slow booting of ubuntu 10.04 and I found that fsck process is called every time in the booting for around 5 seconds even the screen does not show any hard disk checking, is that normal ?

View 5 Replies View Related

Ubuntu :: Startup Script Not Being Called?

Jun 25, 2010

I'm setting up an Ubuntu 10.04 machine with the sole purpose being to function as a vpn server.I got openvpn set up but the startup script doesn't appear to be called on bootup even though it is does appear in the rcX.d directories and the openvpn script is in /etc/init.d and is executable and belongs to root:root.I tried running "update-rc.d -f openvpn remove" and "update-rc.d openvpn defaults" on the offchance something went wrong when it was first added to the startup links.

View 2 Replies View Related

Ubuntu :: Remove - Grub Or Whatever It's Called?

Jan 9, 2011

I'm having alot of trouble trying to remove linux ubuntu from my computer, so that i will only have windows vista. What's the easiest way, to totally remove anything on my harddisk with ubuntu, grub or whatever it's called?

View 1 Replies View Related

Ubuntu Multimedia :: What Are Speakers Called In / Dev?

Jun 22, 2011

depend on my sound card (which is Realtek, I think), but which file/folder in /dev is my speakers? In fact, a page with the meaning of all the /dev folders would be nice if that exists, but if not, just the speakers.

View 3 Replies View Related

General :: The Directory Would Not Exist Until 'mv' Has Been Called As In?

Jul 3, 2011

I want to copy a file from an old directory to a new directory and ideally I would like that the 'mv' command itself could create the directory for me in one step...That is to say that the directory would not exist until 'mv' has been called as in:Code:mv olddirectory/file.dat newdirectory/file.datso mv would create the directory 'newdirectory' in the above call....I am not sure if this is possible however, that is to say I think it may be necessary that the directory 'newdirectory' already exists before I make the above call to mv, as when I make try the above call when 'newdirectory' doesn't exist I get the following error:Quote:mv: cannot move `test1/4215/4215-001R.fit' to `test2/test.fit': No such file or directoryso to sum up, my question is:is there some paramater for 'mv' that I can change so that it will create the new directory as well as copy the file and if not, are there other commands that might do this?

View 3 Replies View Related

General :: Pset Profile To Be Called Only Once?

Mar 24, 2010

Profile is getting called twice for every login change. Interestingly when i use SU, it is invoked once only. how to set profile to be called only once.

View 3 Replies View Related

Debian :: Firewall Keeps Blocking Something Called CPQ-Wbem?

Jul 4, 2011

My firewall keeps blocking something called CPQ-Wbem. There have been about 10 instances of this.

A machine on the network is advertising it runs, or looks for machines running, Compaq Insight Manager on TCP/2301. If the machine isn't yours or you haven't enabled Compaq's web-based remote management then silently drop it.

Now as far as i know i do not have a network, just a dsl connection. I also do not own a Compaq computer. So if someone who has some knowledge of this could you explain to me how a " network is advertising it runs, or looks for machines running, Compaq Insight Manager on TCP/2301 " . This would seem to me to be a local network thing not a www thing ?

View 2 Replies View Related

Fedora :: Application Called Freecorder - Equivalent?

Sep 25, 2010

I found a great application called Freecorder. Is there a Linux equivalent? [URL]..

View 6 Replies View Related

Ubuntu Installation :: Boot From Grub2 Or Whatever Is Called

Nov 1, 2010

Every Time I Try Too Boot Ubuntu, Instead Of Starting Up It Takes Me To This Menu Type Thing And It Says To Press Tab To See The Command List Or Something Like That. And I Dont Know What Commands To Use.

View 9 Replies View Related

Ubuntu :: Unable To Update Something Called Seahorse?

Feb 13, 2011

I went to update my software and I saw the system wants to remove three programs. I googled them and they seem important but I can't update without removing them so I'm stuck. I've included a screen shot of the items the system wants to remove.

Also for the past month I haven't been able to update something called seahorse, the system says it's a broken package but I don't know how to fix it. Is this an essential program or can I un-install it?I want to upgrade to 10.10 but I am reading how all updates must be done before and these issues are holding me back.

View 3 Replies View Related

General :: Noticed There Was Two Files Called Passwd?

Jun 18, 2010

I was looking around the files in /etc/ to see what they were and what they said, then I noticed there was two files called passwd, which confused me a lot for a second then I noticed one of them was actually passwd-.I compared them and they only differed by one line:
< games:36:35:added by portage for gemrb:/usr/games:/bin/bash, which was in passwd but not passwd-.Should these files both exist? If yes, why, what does having both do? If no, then its safe to say I can just delete passwd-

View 2 Replies View Related

General :: What Is It Called When You Move A PDF Window While It Is Loading

May 18, 2010

1. What is it called when you move a PDF window while it is loading and the window manager does not keep up with the image, (it gets all blurry when the window is moved?)Why does this happen?

2. Why is it that when a browser window is clicked to load a new address it won't always go to it. It has to be clicked again.

3 Why is it that sometimes IE is the only browser that will work on XP. FireFox and Opera will not load a page but IE will.

4 Why is it that Firefox on Linux sometimes everything inside the window is slow to appear. It has to be closed to fix it. When the contents does appear it is all at once.

5.Why is printing different things on Linux a problem. I have a lot of inconsistency with trying to print things from Evince. Some docs print and some won't. Copying and pasting is also a problem for Evince.Why?

6. Is there a way to have Linux Shut down after computer activity has stopped and not just with a timer. Lets say I'm trying to download something and I want it to turn off after it has finished with the down load.

7. Why are some Web pages biased towards Windows. I notice that some java scripts will only run right on Windows machines with IE. A lot of on-line forms are like this.

8. Can (MOVIES, PICTURES AND MUSIC) torrents be downloaded on Linux without risk?

9. It seams that Linux browsers do not keep previous web pages in memory so if you want to go back Linux always has to reload them from the server. Why is this?

10. Why is it that browsers sometimes won't indicate that the page has finished loading, "ever".

11. Why does Linux turn on the number-lock when loading its self?

12. Why can't the brightness be adjusted in Totem? There is a menu to change it but it does not work.

View 1 Replies View Related

Networking :: Enable Function Which Is Called Clone Mac

Jul 16, 2011

I want to enable a function which is called clone mac...see in the picture. while, some systems don't support such a function... such as centos, the picture was taken in ubuntu 11.04... so, if i want to enable the function in centos or some other distributions which doesn't support this originally, what should i do? is upgrading the network manager functional?

View 4 Replies View Related

General :: Stop A Function Called In A Script?

Sep 30, 2010

I made the following script:

Code:
#!/bin/bash
logErrors(){exec 2>/tmp/errorlogfifowhile truedocat /tmp/errorlogfifo |echo $(date "+[%Y-%m-%d %H:%m:%S]") Error: >/var/log/error.logdone}
logErrors
ls inexistentFile
exit 0

If I execute the script I see the formated error message in /var/log/error.log, as to be expected. After the script execution, I hoped "logErrors" was not executing anymore, but when, in another terminal, I call "echo something > /tmp/errorlogfifo", I still see the formated error message "something" in "/var/log/error.log". How can I finalize "logErrors" before the script ends? Or, maybe someone knows a better way to format and log the erros in a script.

I forgot to say that the file "/tmp/errorlogfifo" is a named pipe created by the command "mkfifo /tmp/errorlogfifo".

View 8 Replies View Related

General :: How To Find Out Which Shell Script Called

Dec 6, 2010

I have two shell scripts:

sh1.sh
echo "First script"
echo "Now calling second one"
sh2.sh
sh2.sh
echo "Second script"

In this shell script, I want to print out which shell script called this. In this case, sh1.sh called sh2.sh. So, I want to print out "sh1.sh".How to achieve?

View 1 Replies View Related

General :: Exactly Which Files Are Called When I Login Into Server ?

May 11, 2011

Exactly what sequence of files are called as in the .my_profile,.profile,.vimrc,.vim. These are few files that I are there on the server. I want to know which file is called first and what sequence. Also can you point me to some links that tell exactly what are these files for.

View 1 Replies View Related

Security :: The Server Was Hacked From So Called Tor IP Address?

Nov 14, 2010

I always use professional services to secure my servers. Everything was fine for years but a week ago my server got hacked.I don't know how the hacker got my username/password - it was not something like admin, password.9 months ago my PC was infected with some virus which connected to the FTP server by using password which was saved in CuteFTP and infected all index files with some javascript. Then I changed the user/FTP password and didn't save it anymore in Cute FTP. Of course, I checked all the folders and re-uploaded all infected files. Is it possible that this virus uploaded some hidden file which was able to get the new password for this account?

The server was hacked from so called Tor IP address. I am tiref of worrying about server security and now have an idea to get a static IP address from my ISP and to allow logins only from this IP address. What do you think about it? This idea looks good for me but are there any risks to lose access to the server. Can ISP provider change the static IP address for some reason?

View 9 Replies View Related

Server :: Script Works When Run But Not When Called By Cron

Aug 28, 2010

I've made a bash script to do scp a file from another server and tested it successfully by executing it manually. However, when I scheduled it by cron, I received a mail from root saying permission denied.

The script is at:

It's supposed to secure copy a file from a remote host to:

The script's content is (No need to supply password as I've done the ssh-keygen thing):

Code:

From what I can make out of the mail, it appears that it has problem saving it to the /home/backup directory.

View 7 Replies View Related

Software :: Where To Download A File Called Cleanappledouble.pl?

May 20, 2010

I was reading some old posts here and was wondering if anyone could give me or show me where I can download a file called cleanappledouble.pl Apparently it is included when netatalk is installed and is located in /usr/local/atalk/bin for most people. Here is the thread where I was looking at regarding the file.

http://www.linuxquestions.org/questi...eaning-111387/

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved