Say I have:
class A
{
A()
{}
~A()
{}
};
class B
{
public:
B()
{}
~B()
{}
private:
static A mA;
};
B* pB = new B;
delete pB;
When I call delete pB, B's destructor will be called. Will this then call the destructor for static member A?
I have an application that logs information to a daily text file every second on a master PC. A Slave PC on the network using the same application would like to copy this text file to its local drive. I can see there is going to be file access issues.
These files should be no larger than 30-40MB each. the network will be 100MB ethernet. I can see…
I've got a shared library with some homemade functions, which I compile into my other programs, but I have to link the end program with all the libraries I have used to compile the static library. Here is an example:
I have function foo in the library which requires a function from another library libbar.so.
In my main program to use function…
how can i write the query, to update the table videos, and set the value of field name to 'something' where the average is max(), or UPDATE the table, where average has the second value by size!!!
i think the query must look like this!!!
UPDATE videos
SET name = 'something'
WHERE average IN (SELECT `average`
FROM…
I have a DB4O server listening on a port
IObjectServer server = Db4oClientServer.OpenServer("filename.db40", 11978);
How do i register for callbacks? For example how do i execute some custom code before an object is read or stored?
The problem is there is a folder ./log/ containing the files like:
jan2010.xml, feb2010.xml, mar2010.xml, jan2009.xml, feb2009.xml, mar2009.xml ...
each xml file would like:
<root><record name="bob" spend="20"></record>...(more records)</root>
I want to write a piece of ColdFusion code (log.cfm) that simply…
Is is possible to get postsharp to remove references to the postsharp assemblies during a build?
I have an exe i needs to have a very small footprint. I want to use some of the compile time weaving of postsharp but dont want to have to deploy PostSharp.dll with the exe.
Hi,
I'm having difficulty testing controllers. Original my controller for testing looked something like this:
SomethingController CreateSomethingController()
{
var somethingData = FakeSomethingData.CreateFakeData();
var fakeRepository = FakeRepository.Create();
var controller = new SomethingController(fakeRepository);
…
I have a Java Maven project with about 800 source files (some generated by javacc/JTB) which is taking a good 25 minutes to compile with javac.
When I changed my pom.xml over to use the Eclipse compiler, it takes about 30 seconds to compile.
Any suggestions as to why javac (1.5) is running so slowly? (I don't want to switch over to…
In .net when a website hosted in IIS how do you get the current user the website is running under. ie the Application Pool user not the the current user accessing the site.
Using windows integrated and impersonate.
<authentication mode="Windows"/>
<identity impersonate="true"/>
As part of a new job, I have to devise and implement a complete test strategy for the companies new product. So far, all I really know about it is that it is written in C++, uses an SQL database and has a web API which is used by a browser client written using GWT.
As far as I know, there isn't much of an existing strategy, except…
Need some compact code for counting how many lines in a string. It should be Java Code. And the string is separated by \r or \n will be considered as a separate line. For example,
"Hello\nWorld\nThis\nIs\t"
should return 4. The prototype is
private static int countLines(String str) {...}
Can someone provide a compact code? I…
In Antlr, if I have a rule for example:
someRule : TOKENA TOKENB;
it would accept : "tokena tokenb"
if I would like TOKENA to be optional, I can say,
someRule : TOKENA* TOKENB;
then I can have : "tokena tokenb" or "tokenb" or "tokena tokena tokenb"
but this also means it can be repeated more that once. Is there anyway I can…
I have an application where I can have an image moving towards the eye.
When the image enlarged, I would like to have it resized as 635 px where initial size was 220 px. I have the image with starting position as 0 in z axis. I am wanting to calculate the distance from starting position to the resized image.
I have already…
This is an Explorer only problem and the symptoms are:
I have links that when clicked will load in HTML chunks (none of which contain html header tags) using javascript. The html chunks are placed in various <div>s around the page, perhaps 3 different places with 3 different chunks brought in via javascript.
When…
Hi,
I'm working on a pure css menu that consists of four levels
Level 1 and 2 are a dropline menu in style
Levels 3+ are dropdown menus
When you hover over a level 1 menu item, the level 2 menu displays directly below menu item you are currently hovering over. However if there are lots of menu items on level 2 then…
I have a Core Data entity, which contains a relationship to another entity. Under certain circumstances, I need to delete the managed objects in the relationship, and at other times no action needs to be taken.
I have the Delete Rule on the entity is No Action because of this manual management.
The problem I have…
Hi,
I have 3 projects in a VS6 workspace.
One is the main program, which calls - depending on configuration - one or both other progams. To call the other programs a exe is executed.
If I want to debug and set breakpoints in one of the subsequent programs, I get an error that breakpoints could not be set and…
Hi,
I have written a filewriter for my android application. It is to function on a Galaxy Tab, so my minSdkVersion has to be at least 4, so it will fill the screen. I originally started out with SdkVersion = 2 and at that point my filewriter worked perfectly. Changing the SdkVersion to 4 introduced the problem.…
I'm referencing the NHibernate dll version 2.1.2-GA, and am unable to compile under Mono 2.8.1. I've tried using NHibernate 3 instead and it compiles fine.
A simple example of the code that's failing is
NHibernate.Cfg.Configuration cfg = new
NHibernate.Cfg.Configuration();
and the error is
Error…
I'm trying to match a SEDOL (exactly 7 chars: 6 alpha-numeric chars followed by 1 numeric char)
My regex
([A-Z 0-9]{6})[0-9]{1}
matches correctly but strings greater than 7 chars that begin with a valid match also match (if you see what I mean :)). For example:
B3KMJP4
matches correctly but so…
Once again I'm having trouble with Linq to Sql and the MVC Model Binder.
I have Linq to Sql generated classes, to illustrate them they look similar to this:
public class Client
{
public int ClientID { get; set; }
public string Name { get; set; }
}
public class Site
{
public int SiteID {…