My question is about generating invoices and receipts. The said bills use rates, names and values from a database. If the sources for generating the receipt stay unchanged, one can generate the same receipt dynamically each time. However, since names, rates and values may be changed or removed, the receipt also changes with time, i.e dya...
Hi,
one of my "favorite" annoyance when coding in C++ is declaring some static variable in my class and then looking at compilation error about unresolved static variable (in earlier times, I was always scared as hell what does it mean).
I mean classic example like:
Test.h
class Test
{
private:
static int m_staticVar;
int m_var;
...
I am using Microsoft Visual C++ 2010, and I need to make an application that does not require the libcurl dll. I am defining CURL_STATICLIB in the preprocessor directives and linking to libcurl.lib, libcurl_static.lib, ws2_32.lib, and winmm.lib, but it still requires the dll to work. If I only link to libcurl_static.lib, it has undefined...
Hi,
I don't know what kind of position shall I announce if the parent has a position: absolute.
Here's the code,
<div id="new_map">
<div id="map_nbc_pop">
<div class="nm_bubbletop1"></div>
<div id="nm_bubblebg">
<u...
I have a static method like this
public static string DoSomethingToString(string UntrustedString)
{
//parse format and change string here.
return newString.
}
Since I know that multiple calls to:
static int myInt=0;
public static int AddNumber()
{
lock(someObject)
{
myInt++;
}
return myInt;
}
will return an ever increasing number (...
I have the following class:
public class Test {
public static int a = 0;
public int b = 1;
}
Is it possible to use reflection to get a list of the static fields only? I'm aware I can get an array of all the fields with Test.class.getDeclaredFields(). But it seems there's no way to determine if a Field instance represents a sta...
I once read that static classes are very difficult and even impossible to debug. Is this true and why?
If an example would help, here is a PHP class I use to access a database (I don't think this is a PHP-specific question, though):
<?php
class DB
{
private static $instance;
private function __construct() { }
public stat...
While browsing some source code I came across a function like this:
void someFunction(char someArray[static 100])
{
// do something cool here
}
With some experimentation it appears other qualifiers may appear there too:
void someFunction(char someArray[const])
{
// do something cool here
}
It appears that qualifiers are onl...
I have many entry points in my assembly and I want some initialization code to be executed once per AppDomain prior to running any other code from this assembly. What would be the best way to do it?
One solution I see is to have a class with static constructor and inherit every entry point I have from it. Something like this:
public cl...
I'm trying to create a generic class which will have some static functions based on the type. Are there static members for each type? Or only where there is a generic used? The reason I ask is I want a lock object for each type, not one shared between them.
So if I had
class MyClass<T> where T:class
{
static object LockObj = new...
I have a problem with static keyword due to inheritance in PHP 5.3.
abstract class Object
{
protected static $_classDataSource = null;
public static function getDataSource()
{
return static::$_classDataSource;
}
public static function setDataSource( $dataSource)
{
static::$_classDataSource = $d...
@Spence asked this Previous Question.
So, how's that work in Java? Generic types are discarded at runtime in Java, so what happens to static variables of classes instantiated with different generic types?
...
I am looking for a C++ data type similar to std::vector but without the overhead related to dynamic resizing. The size of the container will remain constant over its lifetime. I considered using boost::array, however, that is not appropriate because it requires the size of the array to be known at compile time, which is not the case in m...
Hi,
Is it best to have static constructors where you alloc the instance in the constructor and you return the instance as auto release, e.g. [String stringWithFormat...] or is it best to have dynamic constructors where you ask the user to alloc first so that he is in charge of releasing? When should you use each?
Cheers
...
Suppose we have a class like:
Public Class Question
Private Shared _field as Integer = CrazyIntegersRepository.GetOne()
' Some other useful things go here
End Class
And the method GetOne throws an exception... How can we manage that? Is a good practice to rewrite that into a static constructor?
When is the GetOne method go...
so i read stuff about how apache's mod_rewrite does the trick but it seems to be too vague for beginners like me.
lets say i wanted to mask site.com/userpage.php into site.com/ or site.com/userpage
or even removing the get requests..
from site.com/userpage.php?query=yes into site.com/userpage.php or site.com/userpage
how can i do tha...
Hello, first of all sorry for my English is not my native language.
I have a web form input field and a servlet (Clustered Weblogic AS) which receives the contents of this input. I would like to limit the attempts given the same value without using rdbms or plain text file, eg
// Getting value of form
String input = request.getParameter...
I want to make a static class that would load some settings from XML file and apply those settings to its own properties.
I am trying to use the following code but I don't really know what to give to the SetValue method since the class for which we want to set the property is static.
// some code removed ...
Type settingsType = typeof(...
From client side, I need to call a server method that is not static.
For example, I got the following user control ucData (private instance of code-behind) that is Databind in the load event.
The server method I need should return ucData.IsValid(). So it can't be static
Is there a way I can do that ?
...
I've heard that throwing exceptions in/from a C++ library could be potentially dangerous, particularly with DLLs, and particularly if the calling code and the library are compiled with different compilers. Is there any truth to this? Is it safe as long as I stick to static libraries? Note that I am not talking about internal use of excep...