private

Drupal : how to emulate the public/private attribute available in WordPress

Hi, Basically, I'm looking for an easy way (module) to add a private/public option to any kind of content I may published in Drupal (blog entry, image, etc.). So that when I'm logged in, I can see everything. But when an anonymous user visit the site, he will only see the public stuff. It's way to manage a kind of front window/back-stor...

How to set a static system date for one user or application--"Groundhog Day"

I have a vendor application on AIX which requires the system date to be set to an arbitrary value for QA testing purposes. The application gets its date from the system, and there is no possibility of changing it to get the date from a parameter. The application runs under a specific userid. I'd like to find a way to set the date for ...

Are private members inherited in C#?

Just seen one tutorial saying that: Class Dog { private string Name; } Class SuperDog:Dog { private string Mood; } Then there was an UML displaying that SuperDog will inherit Name as well. I have tried but to me it seems that only public members are inherited. At least I could not access Name unless it was declared as public. ...

delegating into private parts

Sometimes, C++'s notion of privacy just baffles me :-) class Foo { struct Bar; Bar* p; public: Bar* operator->() const { return p; } }; struct Foo::Bar { void baz() { std::cout << "inside baz\n"; } }; int main() { Foo::Bar b; // error: 'struct Foo::Bar' is private within this con...

How to hide helper functions from public API in c

I'm working on a project and I need to create an API. I am using sockets to communicate between the server (my application) and the clients (the other applications using my API). This project is in c not C++ I come from a linux background and this is my first project using Windows, Visual Studio 2008, and dll libraries. I have com...

How to Access a Private Variable?

This question isn't meant to sound as blatantly insulting as it probably is right now. This is a homework assignment, and the spec sheet is scarce and poorly designed to say the least. We have a function: double refuel( int liter, GasStation *gs ) { // TODO: Access private variable MaxFuel of gs and decrement. } Sound simple enou...

Test-driven Development: Writing tests for private / protected variables

I'm learning TDD, and I have a question about private / protected variables. My question is: If a function I want to test is operating on a private variable, how should I test it? Here is the example I'm working with: I have a class called Table that contains an instance variable called internalRepresentation that is a 2D array. I want...

final and private static

I read that doing: public final void foo() {} is equals to: private static void foo() {} both meaning that the method is not overridable! But I don't see the equivalence if a method is private it's automatically not accessible... ...

Calling private event handler from outside class

i've two classes. One class (say A) takes a textbox in c'tor. and registers TextChanged event with private event-handler method. 2nd class (say B) creates the object of class A by providing a textbox. how to invoke the private event handler of class A from class B? it also registers the MouseClick event. is there any way to invoke pr...

C++: Where can I define the body for a private function?

Hi, I have a header like this (header guards not shown): class GameSystem { public: GameSystem(Game *pcGame); virtual ~GameSystem(); void Setup(); private: void InitGame(); void RunGame(); void ExitGame(); Game *m_pcGame; /* Properties */ int m_nWidth; int m_nHeight; int m_nFps; bool m_b...

how to create in PHP analog of C# ' private const int ' and ' private const byte '?

So in C# I create something like private const int HEADER_LENGTH = 13; private const byte SIGNATURE1 = 0x46; How to create its analog in PHP? ...

Best way to check for users new private messages on website?

I am coding a website in PHP and Javascript which implements private messaging functionality, and i wanted to have it so when a user recieved a new message it notifies them (by a flashing 'mail' icon at the top of the screen). The question is how to implement this functionality without having to check the messages database for unread me...

Java Javadoc include Private

I would like to generate javadocs for my application and i would also like to include private members. I have found the following in the Javadoc documentation -private Shows all classes and members. Could you please help me by giving an example of the execution of this? It should be something like: javadoc -private...

Private class in a Vector used publically

In Java, what happens when you reference a private class in a vector from outside the class? Example: public class A { private class B {} public Vector<B> vector = new Vector<B>(); public A() { vector.add(new B()); } } public class C { public C() { A a = new A(); a.vector.get(0); // <- What does this return? }...

Any performance reason to put attributes protected/private ?

I "learned" C++ at school, but there are several things I don't know, like where or what a compiler can optimize, seems I already know that inline and const can boost a little... If performance is an important thing (gaming programming for example), does putting class attributes not public (private or protected) allow the compiler to ma...

signature.verify() Always returns False

public static void main(String[] args) { try{ String mod = "q0AwozeUj0VVkoksDQSCTj3QEgODomq4sAr02xMyIrWldZrNHhWfZAIcWt2MuAY3X6S3ZVUfOFXOrVbltRrO3F9Z6R8/jJIMv7wjkeVBFC5gncwGR0C3aV9gmF6II19jTKfF1sxb26iMEMAlMEOSnAAceNaJH91zBoaW7ZIh+qk="; String exp = "AQAB"; byte[] modulusBytes = Base64.decodeBase64(mod.getBytes...

C++ inheritance public and private?

Is it possible to inherit both or all parts of a class (other than private) in C++? class A { } clas B : ...? { } ...

Make an enum INSTANCE private

I am using an enum singletom pattern like this: public enum LicenseLoader implements ClientLicense { INSTANCE; /** * @return an instance of ClientLicense */ public static ClientLicense getInstance() { return (ClientLicense)INSTANCE; } ...rest of code } Now I want to return the Interface and hide...

Private Method Inheritance concept

While inheriting, all instances of super class are of subclass. Even after then we are unable to access private methods! Though, the instance is there. Why is it so? ...

clean C++ granular friend equivalent? (Answer: Attorney-Client Idiom)

Why does C++ have public members that anyone can call and friend declarations that expose all private members to given foreign classes or methods but offer no syntax to expose particular members to given callers? I want to express interfaces with some routines to be invoked only by known callers without having to give those callers comp...