public

Cryptography algorithm

I'm making a simple licensing system for my apps. I don't know about cryptography, but I know that I need a algorithm that consists of 2 keys: private and public. I need to encrypt some data (expiration date and customer email) using my private key, and then my app will decrypt the data using the public key to compare expiration date. ...

Should I use internal or public visibility by default?

I'm a pretty new C# and .Net developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++. I pretty much went through the whole project at some point and made every instance o...

In Java, what's the difference between public, default, protected, and private?

Are there clear rules on when to use each of these when making classes and interfaces and dealing with inheritance? ...

How can I find all the public fields of an object in C#?

I'm constructing a method to take in an ArrayList(presumably full of objects) and then list all the fields(and their values) for each object in the ArrayList. Currently my code is as follows: public static void ListArrayListMembers(ArrayList list) { foreach (Object obj in list) { Type type = obj.GetType(...

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? ...

Does RSA Private key always contain the Public key, or is it just .NET?

Hi everyone. I'm using RSACryptoServiceProvider in .NET 2 and it seems that the Private part of a Public/Private key pair always contains the Public part as well. I need to encrypt some info using my Public key, and allow the other party to ONLY DECRYPT what I encrypted. I don't want them to be able to know how I encrypted my message. ...

In C++ why is grouping not forced by the language on public, private and protected members of a class/struct?

Is it only to allow logical grouping? ...

nHibernate slow performance on a hosted website

Hi, I have a webapp being hosted with a public hosting company, the site is not live yet, and I am still doing some testing with it. I am using nHibernate with Windsor Castle Container for dependency injection and the site seems to be responding very slow from time to time. I've contacted support but they said that it's my app not their...

Is there a way I can create Exchange folders and set permissions through .NET calls?

I'm looking to build a snippet of .NET code that will go into an Exchange server and create a Public folder. Along with this I'd like to be able to set the permissions on the folder. If it's easier to copy one folder to a new one and copy over the permissions that way, that's okay too. Has anyone done this before? ...

Signing XML with Public Key Example?

I'm working to implement a SAML service. As such, I believe the identity provider is supposed to digitally sign the SAML assertion using the service provider's public key before sending the assertion to the service provider (which the service provider verifies using their private key). However, I'm having a hard time finding any exampl...

In Java, is it ever a bad idea to make an object's members publicly available?

I have a data class in my application. My application will never be used as a public API and I will be the only person developing code within my project. I am trying to save every ounce of processor and memory power I can. Is it a bad idea to make my data members in my data class to have public/protected/default protection so that...

How to setup public git repositories?

I recently tried to setup git repo on a linux box and wasted about 10 hours with absolutely no results. There aren't any problems with compilation or anything like that, it's just configuration issue. 2 hours later I got mercurial to do everything i need: public repos web ui push/pull with per-user permissions (not tied to linux accoun...

Why is this publicly accessible in my example: "MySymbol::TABLE"

class MySymbol TABLE={} def initialize(str) @str = str end def to_s() @str end def ==(other) self.object_id == other.object_id end end class String def my_intern table = MySymbol::TABLE unless table.has_key?(self) table[self] = MySymbol.new(self) end table[self] end end "foo".my_intern In the e...

Where can I find useful item lists (SQL, or plain text) like sports, hobbies, and others?

GeoNames public geographic locations index is a very useful website that I have used to import a list of countries and cities into my web app. Now, are there any other public databases that would provide various useful lists? (Other than Wikipedia) I am looking for a list of sports, hobbies and similar items. ...

Public code repository

Can anyone recommend a public code repository? A few friends and I are thinking of starting a few projects for iPhone, web, Android, etc., and it would be nice to have a public (internet) code repository to use that would work well on any platform (Mac, PC, Linux). Any type of repository is fine (SVN, CVS, Git, etc.). A few ideas are ...

How to use Unit files in Delphi

I'm just trying to get the hang of separate units to make my code more encapsulated. I'm trying to get the public/private declarations of my methods sorted out, so I can call them from other units that use testunit. In this example I want to make hellofromotherunit public, but stickletters private. unit testunit; interface uses ...

Call external (i.e. interface) functions also internally?

I am wondering if it is good practice to call public functions also internally. By public functions I mean all methods/functions that you created explicitly to be called from other objects, modules, etc. For example methods that you would typically put in a Java interface definition. By calling internally, I mean in the same module, cl...

Secure captive portal?

We would like to run a wireless access point for public use. However, in case of misbehavior, we would like some personal information to be able to pass on to law enforcement. The proposed solution involves a captive portal where users enter their email addresses, and are then given ten minutes to check their email and verify, after whi...

Useful databases around web

As Tim Berners-Lee told at TED, there's lots of hidden data. What useful free databases or APIs you know around web? For example: European Union's VAT number validator Team Cymru's IP Address to ASN/country mapping PhishTank API against phishing Akismet against spam (free for personal use) IMDB database dumps Wikipedia database dumps U...

Can we use more than one mock object in a unit test?

hello, i have read many articles about unit testing.. Most of the articles said that we should not use more than one mock object in a test..but i can't understand why :s sometimes we really need more than one mock object in a test.. ...