Questions tagged [private]

Private is a way of encapsulation in object-oriented programming.

Private is a way of encapsulation in object-oriented programming.

2890 questions
1
vote
1 answer

What is the ideal way to define utility/ helper methods that may need to modify $scope data in AngularJS

Task: Within a controller I have a default object which needs to be modified based on a number of conditions. The modification logic is repetitive hence I ported it to a service/ utility called colorService (can create a private method as well). The…
1
vote
1 answer

Python strange override behaviour for "__" functions

I found "strange" behaviour in Python overriding for "__" functions class A(object): def foo1(self): print "foo1 A" self.test1() def foo2(self): print "foo2 A" self.__test2() def test1(self): …
Geos
  • 13
  • 3
1
vote
1 answer

in iOS: SecKeyDecrypt OSStaus return error code -9809

I have googling a lot, but any answer help me with this problem: Code: MAIN DECRYPT in XRSA.m - (NSData *) decryptWithString:(NSString *)content { return [self RSADecryptData:[content dataUsingEncoding:NSUTF8StringEncoding]]; } LOAD PRIVATE KEY…
Kotik_o
  • 295
  • 6
  • 19
1
vote
0 answers

The difference between protected and private methods

In the program below, the child class method calls the parent class' private and protected methods. class Parent private def private_method 'Private Method' end protected def protected_method 'Protected Method' …
user3702690
1
vote
4 answers

How does ruby internally call any method?

In the program below, the method of the child class calls the private method of the parent class. class Parent private def new_name 'Private Method' end end class Child < Parent def get_parent_name puts new_name …
user3702690
1
vote
2 answers

iPhone private APIs

How to add private APIs and frameworks to an iPhone App. Like Apple80211.
user308990
  • 61
  • 2
  • 11
1
vote
4 answers

Need advice regarding references in C++ for classes

I'm using C++ How to Program 8th Edition and one part of the code says, Employee::Employee( const string &first, const string &last, const Date &dateOfBirth, const DateOfBirth, const Date &dateOfHire) : firstName(first), lastName(last),…
Kevin Cheng
  • 39
  • 1
  • 6
1
vote
1 answer

how to migrate docker private registry to a new server

I have a private registry with lots of tags/images in the registry. What is the procedure to migrate the contents of the old private Docker registry from one server to a new one and retain all history and data? Thanks
user1660532
  • 21
  • 1
  • 5
1
vote
1 answer

Ada - private record and private array not working out

I've a small package file where I just want to define an array of couple of integer, but I want to protect it by making the type private. But after compiling and debugging I get a compilation error that I cannot solve. Here is my code: package…
cycourtot
  • 13
  • 3
1
vote
2 answers

Will my private github repo code become public if I use Docker automated build?

When I wanted to configure the Github webhook for Docker automated builds I got warning: "Only add to PUBLIC repo, otherwise Private code will end up on the public Docker index". From the other side, when I go to docker documentation it says: During…
lumaks
  • 308
  • 3
  • 9
1
vote
1 answer

Private Variable Inheritance

I'm confused on how private variables are inherited and I'm getting errors telling my variable's are private when I try to use them in inherited classes. A bare-bones example. Let's say: //dog.h class dog { private: bool fluffy; public: …
Willy Goat
  • 1,175
  • 2
  • 9
  • 24
1
vote
5 answers

Classes: Public vars or public functions to change local vars?

Exactly what the topic title says, In which cases would you prefer using public functions to change local variables over just defining that variable as public and modifying it directly?
Daniel
1
vote
0 answers

Private method compilation error

I have imported a library, but during the compilation Xcode shows an error in two .h files of this framework: @interface BxAbstractDataSet (private) @interface BxQueueDataCommand (private) after the first bracket Expected ')' I thing that…
ShurupuS
  • 2,923
  • 2
  • 24
  • 44
1
vote
1 answer

Why does dynamic_cast give nullptr with private inheritance here?

Could someone explain this to me: struct A { virtual ~A() = default; }; struct B : private A { void foo() { B* b = new B; std::list list = {b}; B* back = dynamic_cast(list.back()); std::cout << back…
prestokeys
  • 4,817
  • 3
  • 20
  • 43
1
vote
4 answers

C# Reflection - Casting private Object field

I have the following classes: public class MyEventArgs : EventArgs { public object State; public MyEventArgs (object state) { this.State = state; } } public class MyClass { // ... public List
alhazen
  • 1,907
  • 3
  • 22
  • 43
1 2 3
99
100