I am trying to figure out the memory consumption by my (C++) program using gprof. The program does not have a gui, it is entirely cli based.
Now, I am new to gprof, so I read a few tutorials, that taught me how to run gprof and spot time consumption.
However, I need to find out the memory consumption by a specific set of classes.
Say t...
This is an updated follow-up from my last question: http://stackoverflow.com/questions/3494178/fatal-error-from-incrementing-loop
I've finished the sorting algorithm, which seems to work fine. Now my problem is trying to calculate the health for each fighter(in the getHealth() function) based on levels in my vector to calculate correctly...
I have struts page where the text boxes are with dynamic ID and wanted to get this values into Action class. Can someone please help me with the code plz.
...
Hello All
I have a question which I cannot seem to fathom out, as fairly newish to c++. I have a class, in which a set of variables are declared in the .h file and then initialised in the .cpp file. These same variables are used by a set of 3 other classes - and the compiler has them as out of scope. I am not sure how to link the classes...
I'm new to AS3. Learning how to create classes. Is comp = new HouseObjects creating a new class? Is comp creating an instance of the HouseObjects? I realize that this is inside public class TreeHouse. I'm thinking that HouseObjects, how I set it up is not a class...not sure what the correct way to set up classes and properties.
Also I n...
I have a System class that can return a pointer to an Editor class. The Editor class is instantiated within the System class and passed pointers to System's private variables. The Editor class essentially acts as an alternative interface to System's internal data structures.
My question:
Does a design pattern exist that allows me to pr...
I've created a C++ class (myPixmap) to encapsulate the work performed by the OpenGL GLUT toolkit. The display() member function of the class contains most of the code required to set up GLUT.
void myPixmap::display()
{
// open an OpenGL window if it hasn't already been opened
if (!openedWindow)
{
// command-line ar...
Hello,
I have two classes. Looking to be able to grab a variable that is within a global object of a class.
Class Order {
public $number = "1234";
}
Class Business {
public $order;
function __construct() {
global $order;
$order = new Order();
}
}
$b = new Business();
echo $b->order->number;
In the cas...
//node.h
class node
{
public:
void sort(node n);
};
I didn't try the code yet . But It's interesting to know if is this a valid case and Why ?
Edit :
This leads me to another question :
Can I declare FOO inside a member function like this ?
//FOO.h
Class FOO
{
public:
void sort(int n) ;
void swap(int x...
I'm using C#, with which I don't have a lot of experience (I've mostly worked with java/php/javascript so far)
What I want is a class in which I save some data, this data can only be written by one other class, but still be read by other classes in the program.
Something like this:
public class DataObtainer{
DataItem[] Items;
public...
I am curious, if I create a class of many methods (functions as PHP still call them) which many of them are not used and I create an object, does it create memory for all methods even if most methods aren't being used? I'm doing PHP OOP coding.
...
Hello,
I am using simplehtmldom class to get all images from a website,
i am trying to get width and height of image returned by simplehtmldom,
what i am trying to accomplish here is, if a image width less than 50px, i don't want the image to be displayed.
I tried getimagesize(), however its often keep on timeout i think due to amou...
Does anyone know how to reuse the code from one aspx.cs class in another aspx page?
...
Hi all, if I have the following class, will I run into a problem if 100 people are requesting the page at the same time? If there is only one copy of UpdateUser, will all the requests have to queue up and wait for their turns? Thank you.
public static UserManager
{
public static void UpdateUser(int UserID)
{
// this...
I would like to define properties for classes, and be able to access them before I actually instantiate an object of that class.
I'll give some context. My application handles a library of components. Each component is mapped to a Python class. Now I want to know what configuration a component needs, before actually instancing the class...
I have a custom database class that I wrote myself, and I also have a user class and a site class.
The MySQL class has methods like this:
connect
query
clean
fetch
The user class:
register
login
logout
resetPass
The site class:
updateTopics
addTopic
addPost
addReply
etc.
These classes need to interface with a database, which i...
Hi, I got this button:
<button type="submit" class="rfrsh-btn submit" name="saveFields" title="Oppdater" value=""> </button>
I understand that elements can have multiple classes:
.rfrsh-btn {
background-image:url(../../upload/rfrsh_nb_grey.png);
...
}
.submit
{
font-size: 0.85em;
padding: 0;
}
This was work...
I have a user class that I need to use my database with. To do this, I am passing the database handle as a constructor argument like so:
index.php:
<?php
include('classes/user.class.php');
$db = new mysqli('localhost', 'root', '', 'testdb');
if ($mysqli->connect_error)
{
die('Database connection failed (' . $mysqli->connect_errno...
Can anyone instruct me on the proper way to use the MySQLi extension in PHP? I have always used procedural MySQL functions before and want to make the change but am finding the examples on PHP.net and other sites way too complicated. There seems to be multiple methods to do the same thing. I want to use it in the following method:
funct...
I'm trying to build a very simple VPS control panel; i have the following code that lists every VPS i have on a particular server :
($active variable is a BOOLEAN giving the current state of the VPS)
<ul id="vps">
<li <? if ($active): ?>class="active"<? endif;?> >
<? if ($active): ?>
<div class="status">running</div>
<?else:?>
...