Questions tagged [anonymous]

DO NOT USE! Please use a more specific tag such as [anonymous-function] or [anonymous-class].

The term anonymous has come to represent different aspects of development with the rise of the functional programming style and the use of anonymous on-demand applications.

In an effort to disambiguate this tag, it has been split into the following subcategories:

Category Description
Anonymous Classes An anonymous class is a local class without a name. An anonymous class is defined and instantiated in a single succinct expression using the new operator.
Anonymous Functions Anonymous functions use a block of code as a value, defining it as an inline function without a name.
Anonymous Methods An anonymous method is a procedure or function that does not have a name associated with it.
Anonymous Types Anonymous types are data types which dynamically add a set of properties into a single object without having to first explicitly define a type
Anonymous Users Anonymous users are individuals or systems that make use of a product or service, without formally registering account details and are instead associated with some token or identifier.

Former Tag Definition

For new questions, see [anonymous-class] and [anonymous-function].

Typically, a programming language construct like a function or class has a name associated with it -- a symbol that can be used to refer to the construct in some context. An anonymous function or class is one that, in contrast to normal practice, has no name. For example, in Java, you can create an anonymous class using a special syntax that defines a class and constructs an instance of it at the same time:

Runnable r = new Runnable() {
    public void run() {
        System.out.println("Running");
    }
};

The variable r holds a reference to an instance of a class which has no name in Java, but which implements the Runnable interface and can be used anywhere a Runnable instance is needed.

702 questions
4
votes
1 answer

Anonymous Namespace

A recent thread on SO triggerred this. An anonymous namespace is considered to be equivalent to namespace unique { /* empty body */ } using namespace unique; namespace unique { namespace-body } I fail to recollect the exact reason as to why…
Chubsdad
  • 24,777
  • 4
  • 73
  • 129
4
votes
3 answers

javascript: returning value from anonymous function

How can I get the value of var result in this code? I know this is a basic problem but I'm looking for the solution since 3 days. Can you give me any suggestion please? function foo(myCallback){ } function bar() { var result =…
zm455
  • 489
  • 11
  • 26
4
votes
1 answer

Acegi Security: How do i add another GrantedAuthority to Authentication to anonymous user

i give users special URL with access key in it. users accessing the public page via this special url should be able to see some additional data as compared to simple anonymous user. i want to give some additional role to anonymous user based on…
miceuz
  • 3,327
  • 5
  • 29
  • 33
4
votes
2 answers

Managing SignalR connections for Anonymous user

I am using SignalR version 2.1.2 with ASP.Net MVC 5 & NServiceBus and have following requirement There is a signup page (anonymous authentication) in which SignalR is used to send notifications. Every form submit will generate a new connection id…
nzsai
  • 93
  • 1
  • 9
4
votes
4 answers

Is it an Anonymous Array if the resulting array is assigned to a variable

(I am studying for the Java Associate Exam OCJP 7) A question asked to select examples of illegal initializations. One of the answers was:- int [] k= new int[2]{5,10}; The explanation said that when creating an anonymous array it was illegal to…
user3258396
4
votes
1 answer

Anonymous namespace for utility function

My question is regarding the use of anonymous namespaces for organizing my code in a class. Earlier whenever I needed some utility method, which performed some internal computation, I added a private method in the class, did the computation and used…
Arun
  • 3,138
  • 4
  • 30
  • 41
4
votes
1 answer

Adding an artificial row to an anonymous Linq resultset

I'm wondering what the best approach to adding an artificial row to an anonymous linq result set would be. I have a linq statement which uses "select new" to form the data required. Each record comes back as an anonymous object with ID and Name…
Brian Scott
  • 9,221
  • 6
  • 47
  • 68
4
votes
2 answers

Anonymous (?) initialization of a struct passed as an argument in C++03

Say, I have struct Foo { char a; char b; }; void bar(Foo foo); What's the most succinct way to initialize a struct and pass it to the function? Ideally I would like to write something like bar(Foo = {'a','b'}); What if Foo was a…
NioBium
  • 583
  • 3
  • 10
4
votes
1 answer

How can anonymous users exchange presence information with valid users on Jabber (Ejabberd)

I am working on a social network that should allow members to chat with visitors on the site. The concept is simple. Users who have registered signup get their own account with rosters When a visitor comes to the home page of the social network, he…
Adil
  • 395
  • 1
  • 5
  • 14
4
votes
3 answers

invalid anonymous type member declarator during join two datatables

I try to do the following join : var collection = from t1 in dt1.AsEnumerable() join t2 in dt2.AsEnumerable() on new { t1.["main_code"], t1["year"]} …
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
4
votes
2 answers

git-svn anonymous checkout fails with -s

I'm trying to use git to clone an svn repository with std layout (using the -s option). The repository uses https anonymously (the repository is at https://secure.simplistix.com/svn/xlwt/). I can check the repository out fine using svn, but with…
David Fraser
  • 6,475
  • 1
  • 40
  • 56
4
votes
2 answers

C# delegate definition - anonymous methods vs. formally defined methods

When should anonymous methods be used when defining a delegate and when should formally defined methods be used when defining a delegate ?
Scott Davies
  • 1,329
  • 3
  • 15
  • 16
4
votes
2 answers

Unsubscribing from anonymous delegate event

I'm having some trouble with figuring out a way of unsubscribing from some anonymous delegate events that i found in a pre-made helper file that helps allow movement of controls at run time. The reason i want to unsubscribe to these events is so…
Kestami
  • 2,045
  • 3
  • 32
  • 47
4
votes
4 answers

javascript, access other members during anonymous object creation?

Trying to get the following code to work; As the store variable is assigned an anonymous object, the "data" property is populated using a function call. This setting should also set the contents of the other object's property "masterData". I…
Jem
  • 6,226
  • 14
  • 56
  • 74
3
votes
4 answers

WCF Exception: ...this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service

I've seen this asked here and everywhere lots of times but I can't get my head around it. Here's what I want to do. I need to host a WCF Service in IIS 6. I want user name / password security and I don't want these passed unencrypted so I'm using…
RBrowning99
  • 411
  • 2
  • 9
  • 21