This was a bug I found in a server application using Valgrind.
struct Foo
{
Foo(const std::string& a)
: a_(a_)
{
}
const std::string& a_;
};
with gcc -Wall you don't get a warning.
Why is this legal code?
On IIS, we have disabled Anonymous authentication and enabled Windows Authentication
What we need is to only allow users who are members of an Active Directory security group to access the Access Point at all. All other users should be directed to a static web page that will give them instructions on how to request access.
By adding the security…
I understand what the typical access specifiers are, and what they mean. 'public' members are accessible anywhere, 'private' members are accessible only by the same class and friends, etc.
What I'm wondering is what, if anything, this equates to in lower-level terms. Are their any post-compilation functional differences between these beyond the…
In the following code, when the ctor of X is called will the ctor of A or B be called first? Does the order in which they are placed in the body of the class control this? If somebody can provide a snippet of text from the C++ standard that talks about this issue, that would be perfect.
class A;
class B;
class X
{
private:
A a;
B b;
}
I have a property
public ObservableCollection<string> Name
{
get
{
return _nameCache;
}
}
_nameCache is updated by multiple threads in other class methods. The updates are guarded by a lock. The question is: should I use the same lock around my return statement? Will not using a lock lead…
Hello,
i need a confirmation that IIS_WPG and the newer one IIS_IUSRS are also members of the "Authenticated Users" group. Can someone confirm this or am i beeing wrong? Thanks in advance!
Regards,
Krile
Given a base class
class A {
int i;
public:
int& f(){ return i;}
const int& f() const { return i;}
};
And a sub class
class ConstA : private A {
public:
const int& f() const { return A::f(); }
};
Is there a wrist-friendly way to access the ConstA::f method on a non-const variable?
ConstA ca;
int i = ca.f();
//…
Hi all,
I made a private API that assumes that the address of the first member-object in the class will be the same as the class's this-pointer... that way the member-object can trivially derive a pointer to the object that it is a member of, without having to store a pointer explicitly.
Given that I am willing to make sure that the…
I have an array of custom class Student objects. CourseStudent and ResearchStudent both inherit from Student, and all the instances of Student are one or the other of these.
I have a function to go through the array, determine the subtype of each Student, then call subtype-specific member functions on them.
The problem is, because…
Hi,
I am creating my own custom module in Magento and during testing on a Litespeed server (PHP v5.2.14) I am getting a Fatal Error: Call to a member function batch() on a non-object in ../../../BatchController.php on line 25 that was not appearing during testing on another linux server and a wamp server (PHP v5.2.11).
This one…
Originally posted on: http://geekswithblogs.net/bjackett/archive/2013/07/01/powershell-script-to-enumerate-sharepoint-2010-or-2013-permissions-and.aspx In this post I will present a script to enumerate SharePoint 2010 or 2013 permissions across the entire farm down to the site (SPWeb) level. As a bonus this…
Hi, When I did the practice below to erase my pointer member and assign new value to it.
(*pMyPointer).member.erase();
(*pMyPointer).member.assign("Hello"); // Successfully
Than I tried more...
(*pMyPointer).member.erase();
(*pMyPointer).member.assign("Long Multi Lines Format String"); // How to?
If the long multi…
I am currently working on a Wordpress site I have created some custom Post Types all work fine create the post etc.
What I need however is custom taxonomies with some of the custom Post Types, I have set this up and when adding different tags to the taxonomy it works however, when creating a post for a custom post type…
Remember my last post on dynamic filtering? Well, this time I'm extending the code in order to allow two levels of querying: Match type, represented by the following options:
public enum MatchType
{
StartsWith = 0,
Contains = 1
}
And word match:
public enum WordMatch
{
AnyWord = 0,
AllWords = 1,
…
Okay. Now I give up. I have been playing with this for hours.
I have a variable name $data.
The variable contains these contents:
array (
'headers' =>
array (
'content-type' => 'multipart/alternative; boundary="_689e1a7d-7a0a-442a-bd6c-a1fb1dc2993e_"',
),
'ctype_parameters' =>
array (
…
Not sure why I'm getting this error. I have the following:
int* arr = new int[25];
int* foo(){
int* i;
cout << "Enter an integer:";
cin >> *i;
return i;
}
void test(int** myInt){
*myInt = foo();
}
This call here is where I get the error:
test(arr[0]); //here i get invalid…
I have Python classes, of which I need only one instance at runtime, so it would be sufficient to have the attributes only once per class and not per instance. If there would be more than one instance (what won't happen), all instance should have the same configuration. I wonder which of the following…
I am aware of the concept called field hiding in java. But still I am having a confusion in relation to instance variable being not over-ridden.
According to my present knowledge, overriding a method of super-class means that the JVM will call the sub-class's over-ridden method though the…
I have to create a binary search tree which is templated and can deal with any data types, including abstract data types like objects. Since it is unknown what types of data an object might have and which data is going to be compared, the client side must create a comparison function and…
DEAR All;
Hi, I'm just beginner to C++;
Please help me to understand:
What functions should be in the Linked list class ?
I think there should be overloaded operators << and ;
Please help me to improve the code (style, errors, etc,)
Thanks for advance. …
class Thread(db.Model):
members = db.StringListProperty()
def user_is_member(self, user):
return str(user) in self.members
and
thread = Thread.get(db.Key.from_path('Thread', int(id)))
is_member = thread.user_is_member(user)
but the error is :
Traceback (most recent call…
Okay. Now I give up. I have been playing with this for hours.
I have a variable name $data.
The variable contains these contents: (extracted by using var_export())
array (
'headers' =>
array (
'content-type' => 'multipart/alternative;…