Confession: I only use private and public visibility for my methods!
I have a feeling this is a bad thing. But in Rails it just doesn't seem to come up as an issue.
Does anyone have an example in Rails where it would be a big mistake not to use protected visibility?
...
In general, according to the OOP paradigm, my understanding of encapsulation basically says:
If a member is private, it can only be accessed by the class.
If a member is protected, it can only be accessed by the base class and any derived classes.
If a member is public, it can be accessed by anyone.
If I have a nested class, can I de...
I figured out how to create a static method that is available everywhere, for example:
UtilLib.as:
package
{
public final class UtilLib
{
public static function getTimeStamp():uint
{
var now:Date = new Date();
return now.getTime();
}
}
}
I can access this...
Hi All,
I have a section of code in a controller that replaces existing HTML with an IMG tag. The code is as follows:
render :update do |page|
page.replace_html "chart-div", "<img src=\"#{chart.chart_file}\"/>" #chart.chart_file is a path
end
For whatever reason, I keep receiving the following error:
ActionController::Routi...
Hi all!
I got a RSA pubkey.dat (almost obvious what it is) that has the following structure on contents:
ASN1 Integer of around 1024 bits (Modulus)
ASN1 Integer (Exponent)
Blob of 256 bytes (Signature)
No tags like "----begin---" or so. pure hex values in it.
There's any way to identify its format like if it's DER/PEM/etc , so i ca...
In Java I can write:
public final static MyClass foo = new MyClass("foo");
is there an equivalent in C#?
...
Hi all,
In my continuing adventure with templates, I've templated my Container class not just on the ItemType it holds, but also on a Functor argument that determines how it should order the items. So far, so good.
A little problem I've run into occurs when I want to copy the contents of one Container to another: If the two Container...
I have created public synonym as suggested in my other question about creating view at system level. Having said that I have created individual public synonym out of the view so that I don't have to connect to the individual domain anymore. My problem now is how to create a master kind of public synonym to capture all those synonyms whic...
i have stored my public key on the public key server .now i have to fetch/retrieve public key from that public key server using the python script/programme .how can i do this?
also want to know the way how to execute gpg commands within my programme.
...
If I have a java class which is package-private (declared with "class", not "public class"), there is really no difference if the methods inside are declared public or protected or package-private, right? So which should I use, or when should I use which? I'm a bit confused.
...
Hello :)
I have a 128 byte (1024 bit) modulus (in a byte array format) and my exponent (also in a byte array format). I need to create a 128 bytes byte array representing the public key.
According to Wikipedia, "The public key consists of the modulus n and the public (or encryption) exponent e." But that doesn't tell me how to mix both...
I would like to generate public and private key pairs and then store them in a private store, instead of the iphone's key chain. Is there a way to use to use the security apis on the IPhone to generate key pairs and not store them in the keychain? When I looked at the SecKeyRef it is an opaque pointer.
...
What is the difference between between signing certificate and encryption certificate?
I see that signing certificate cannot be used for encrypting the data only encryption certificate. What is the technical difference? Does both have public key and private or only encryption cert will have PP key?
...
How do I tell Doxygen to document public sections after a private section in a (C++) class?
E.g.
class Brg {
public:
//! this function will be documented
void documentedFunction1()
private:
void irrelevantFunction()
public:
//! this function will _not_ be documented
void undocumentedFunction1()
};
Even w...
I have a .Net(C#) solution. The solution contains bunch of projects. The projects were implemented not by me. It is not a framework, it means that I need to have amount of public methods/properties as less as possible. My task is to identify methods and properties which are not used, but exist in the projects. Well, I can find private me...
Hi,
I would like to know if there is a way to put only protected and public stuff on the header file .h, and all private stuff in the compile unit .cpp
I need this because the library is going to be used by others, and I wouldn't like to have to copy and edit all .h files to remove private declarations and implementations.
I tried but g...
Given this base class:
class Employee
{
char* name;
int age;
public:
Employee(char* name);
void print();
};
With regards to the "public", what's the difference between this:
class Manager : public Employee
{
EmployeeList employees;
public:
Manager(char* name, Employee* people);
void print();
}...
I am working on an application, in which I need to encrypt and decrypt the data, with the keys generated by server. I viewed the sample code of Crypto Exercise. In that keys are automatically generated. How can I use externally generated keys in the code?
Please help.
...
This is what I have so far - my dropbox public URL creation script for a directory of public URLs (getdropbox.com - gpl I think). My LIST file was created using ls in the following fashion:
ls -d ~/Dropbox/Public/PUBLICFILES/* > LIST
dropboxpuburl.sh:
for PATH in `cat LIST`
do
echo $PATH
dropbox puburl $PATH > ~/URLLIST/$PATH
d...
Hi,
I have been writing Python code for only a couple of weeks, so I'm still figuring out the lay of the land. But let's say I have a method that MAY be called on by a 'user' on occasion as well as used HEAVILY internally (ie, the arguments have already been checked before the call). Here is what I am currently doing:
#The method the '...