private

Erroneous private base class inaccessible?

Compiling this code using g++ 4.2.1: struct S { }; template<typename T> struct ST { }; template<typename BaseType> class ref_count : private BaseType { }; template<typename RefCountType> class rep_base : public RefCountType { }; class wrap_rep : public rep_base<ref_count<S> > { typedef rep_base<ref_count<S> > base_type; // lin...

'this' object can't be accessed in private JavaScript functions without a hack?

I was working on a project for a while, trying to figure out what I was doing wrong, when I finally narrowed "the bug" down to the fact that the below code doesn't work as I expected: function Alpha() { this.onion = 'onion'; function Beta() { alert(this.onion); } Beta(); } alpha1 = new Alph...

Appropriate use of friend? Container class designed to manipulate objects of specific type

Lets say you have a FooManager made to manage multiple objects of type Foo. The FooManager needs to see some parts of its Foos to evaluate their current state. Before I was using a few accessors in Foo to see these parts, until I realized that FooManager is the only class actually using these. I decided to make FooManager a friend of Foo...

iphone mms help...

guys how to i use private framework to send mms out? i able to send sms using coretelephony framework but how i send mms.. please help.. ...

Private variable needs to be initialized only in constructor. How?

I have a class called Foo with a constructor that needs arguments, and a other class Bar with a Foo private variable class Foo { public: Foo(string); } class Bar { public: Bar() { this->foo = Foo("test") } private: Foo foo; } However, when I try to compile this, I get a compile error that t...

How to access private photos through Flickrj API

I'm making an authenticated call to access photos through Flickr API. But I am only getting my public photos but not any private photos. Given below is the code I'm using, Flickr f; RequestContext requestContext; String frob = ""; String token = ""; DocumentBuilder xmlParser = null; public void getImages() throws ParserConfigurati...

simulate private variables in python

I've got few variables I really want to hide because they do not belong outside my class. Also all such non-documented variables render inheritance useless. How do you hide such variables you don't want to show outside your object? To clarify why I need private variables, first one example where inability to hide variables is just an i...

Rails Private / Public Message Toggle

Hi, I'm not quite sure how to go about framing this question, but I am building a social network from the ground up using rails; one feature is twitter style messages. I am trying to create an option that when the user submits their message, the have a checkbox that says "private". If the checkbox is checked, only the users friends can ...

change private static final field using java reflection

I have a class with a private static final field, that unfortunately i need to change at run time. using reflection i get this error: java.lang.IllegalAccessException: Can not set static final boolean field is there any possibility to change it anyway? Field hack = WarpTransform2D.class.getDeclaredField("USE_HACK"); hack.setAccessible...

Why can't I declare a friend in one class that is a private member of another class?

Given the following code: class Screen; class WindowMgr { WindowMgr& relocateScreen( int r, int c, Screen& s); }; class Screen { friend WindowMgr& WindowMgr::relocateScreen( int r, int c, Screen& s); // ^ cannot access private member declared in class 'WindowMgr' int m_nR, m_nC; }; WindowMgr& WindowMgr::reloc...

private overrides of private methods pattern? (ANSWER: NVI)

What's the accepted jargon (if any) for describing methods meant to be invoked only virtually and from other methods in the base? I've occasionally seen this referred to as a callback, but that seems to stray pretty far from the original definition of that term. I'm not even sure that this merits being called a pattern, but I'm trying ...

Private 'set' in C# - having trouble wrapping my brain around it

I've seen a lot of example code written using something like (please forgive how horribly canned this is): public class Test { public object Thingy { get; private set; } } Unfortunately, these kinds of examples never really explain why 'set' is set as private. So, I'm just wondering if there's a good, common example that will illu...

Why private access specifier in an abstract class in Java even though we cannot create an instance of an abstract class?

I know it is not a good coding practice to declare a method as private in an abstract class. Even though we cannot create an instance of an Abstract, why there is private access specifier within an abstract class , what is the scope of it within an abstract class? In which scenario does private access specifier are used in an abstract c...

Object Oriented Private Variable

What are other purposes of private method/variable other than for protection. ...

how can i set up own cloud for my institution?

How can i set up a private cloud for my educational institution? Guide me to do this! What are all the steps I should take and send me steps to install eucalyptus in my laptop? ...

Private Variables and Methods in Python

Which should I use _foo (an underscore) or __bar (double underscore) for private members and methods in Python? ...

Ruby - hosting private gems

Hello there, By any chance, is there any place it's possible to host private ruby gems? So I could allow it to be pulled only for specific places by using public key or something like that? Thanks ...

ResourceManager override GetResourceFileName

Hi, I want to override a method in the System.Resources.ResourceManager class in mscorlib v4. I want to override the method GetResourceFileName like this; protected override string GetResourceFileName(CultureInfo culture) { string resourceFileName = base.GetResourceFileName(culture); return resourceFileName.Replace...

What are some free online flow chart tools?

Can somebody tell me of a tool that helps draw a flow chart online (to collaborate) but not make it public. I did see http://stackoverflow.com/questions/1952450 that talks of gliffy but it makes charts public in the free mode. ...

Can I trick access to private C++ class member variables?

Possible Duplicate: Accessing private members Is it possible to access private members of a class? Is there a good (yes I know this is ugly) way to hack to the private data members of a class? One brute force approach is to copy the header file and in my copy change private to public. But would there be a better way, say doi...