Search Results

Search found 45132 results on 1806 pages for 'anonymous question guy'.

Page 2/1806 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Scope of variables inside anonymous functions in C#

    - by Vinod
    I have a doubt in scope of varibles inside anonymous functions in C#. Consider the program below: delegate void OtherDel(int x); public static void Main() { OtherDel del2; { int y = 4; del2 = delegate { Console.WriteLine("{0}", y);//Is y out of scope }; } del2(); } My VS2008 IDE gives the following errors: [Practice is a class inside namespace Practice] 1.error CS1643: Not all code paths return a value in anonymous method of type 'Practice.Practice.OtherDel' 2.error CS1593: Delegate 'OtherDel' does not take '0' arguments. It is told in a book: Illustrated C# 2008(Page 373) that the int variable y is inside the scope of del2 definition. Then why these errors.

    Read the article

  • php Set a anonymous function in an instance

    - by geekay
    I am just starting out with PHP, and I am wondering if there is a way to add an anonymous function to a class instance. For instance, lets say... class A{ public B; } $c = new A(); //This is where I am getting a little confused... //The following wont work $c->B = function(){echo('HelloWorld');}; $c->B(); What I am hoping to do is reuse the same spit of code in a great number of different applications, and make it so that I can just 'swap-out' and replace functions in specific instances. I am using php5.3 (so anonymous functions should work, just not in the way that I am using them). Thanks so very much for your time!! -GK

    Read the article

  • Turn on anonymous access in SharePoint2010 Site collection

    - by ybbest
    In this post, I would like to show you how to turn on anonymous access in SharePoint2010 Site collection using SharePoint Web UI. If you would like to achieve the same thing using PowerShell you can check this blog post here. 1. You need to go to Central AdminàManage Web Applications 2. Click Authentication provider 3. Click Default and Enable anonymous access 4. Go to your site collection and click on Site actions then click Site Permissions 5. Click on Anonymous Access 6. Select the Entire Web site and click OK. 7 Navigate to your site collection and boom you are all set for the anonymous access for your SharePoint site collection.

    Read the article

  • Creating an anonymous site in SharePoint 2010

    - by shehan
    Here’s how: Open up the Central Administration site and click on “Manage Web Applications” under the “Application Management” section From the ribbon click on “New” (Note: if its an existing web app, then click on “Extend”) Fill in the fields with appropriate values. Under “Security Configurations” make sure to select “Yes” for “Allow Anonymous” Click OK Once the web application has been created, a site collection would need to be created. Navigate to “Application Management” –> “Create Site Collection” Fill in the fields with the appropriate values and create the site collection Next sign into the newly created site collection as the Site Collection Administrator. From the “Site Actions” menu, select “Site Permissions” In the permissions page that loads, click on the Anonymous Access button appearing on the ribbon. A modal dialog would popup. Select the appropriate option and click OK. If you selected “Entire Web Site” its advisable to restart the browser to test anonymous access Technorati Tags: SharePoint 2010,anonymous,site collection,web application

    Read the article

  • Anonymous Live OS, l'OS qui ne vient PAS des Anonymous : la déclinaison d'Ubuntu apparue avant-hier reste pleine de mystères

    Anonymous Live OS, l'OS qui ne vient PAS des Anonymous La déclinaison d'Ubuntu apparue hier est pleine de mystères, voire de Trojans La nouvelle a fait le tour du Web en quelques minutes. Mais elle n'avait pas été vérifiée. Et a priori, elle ne risque pas de l'être. L'histoire commence avec la découverte sur SourceForge d'une distribution baptisée Anonymous OS Live. Déclinée de Ubuntu 11.10, le système y était décrit par ses auteurs comme « pédagogique » et/ou destiné à vérifier la sécurité des sites. Des auteurs qui n'ont pas été identifiés (normal pour des membres du mouvement), mais il n'en fallait pas plus pour que l'arrivée d'un OS estampillé Anonymous se propage. Prob...

    Read the article

  • 10 steps to enable &lsquo;Anonymous Access&rsquo; for your SharePoint 2010 site

    - by KunaalKapoor
    What’s Anonymous Access? Anonymous access to your SharePoint site enables all visitors to view your SharePoint site anonymously without having to log in. With this blog I’d like to go through an easy step wise procedure to enable/set up anonymous access. Before you actually enable anonymous access on the site, you’ll have to change some settings at the web app level. So let’s start with that: Prerequisite(s): 1. A hosted SharePoint 2010 farm/server. 2. An existing SharePoint site. I just thought I’d mention the above pre-reqs, since the steps mentioned below would’nt be valid or a different type of a site. Step 1: In Central Administration, under Application Management, click on the Manage web applications. Step 2: Now select the site you want to enable anonymous access and click on the Authentication Providers icon. Step 3: On the modal window click on the Default zone. Step 4: Now under the Edit Authentication section, check Enable anonymous access and click Save. This is basically to make the Anonymous Access authentication mechanism available at the web app level @ IIS. Now, web application will allow anonymous access to be set. 5. Going back to Web Application Management click on the Anonymous Policy icon. Step 6: Also before we proceed any further, under the Anonymous Access Restrictions (@ web app mgmt.) select your Zone and set the Permissions to None – No policy and click Save. Step 7:  Now lets navigate to your top level site collection for the web application. Click the Site Actions > Site Settings. Under Users and Permissions click Site permissions. Step 8: Under Users and Permissions, click on Site Permissions. Step 9: Under the Edit tab, click on Anonymous Access. Step 10: Choose whether you want Anonymous users to have access to the entire Web site or to lists and libraries only, and then click on OK. You should now be able to see the view as below under your permissions Also keep in mind: If you are trying to access the site from a browser within the domain, then you’ll need to change some browser settings to see the after affects. Normally this is because the browsers (Internet Explorer) is set to log in automatically to intranet zone only , not sure if you have explicitly changed the zones and added it to trusted sites. If this is from a box within your domain please try to access the site by temporarily changing the Internet Explorer setting to Anonymous Logon on the zone that the site is added example "Intranet" and try . You will find the same settings by clicking on Tools > Internet Options > Security Tab.

    Read the article

  • How to break WinDbg in an anonymous method?

    - by Richard Berg
    Title kinda says it all. The usual SOS command !bpmd doesn't do a lot of good without a name. Some ideas I had: dump every method, then use !bpmd -md when you find the corresponding MethodDesc not practical in real world usage, from what I can tell. Even if I wrote a macro to limit the dump to anonymous types/methods, there's no obvious way to tell them apart. use Reflector to dump the MSIL name doesn't help when dealing with dynamic assemblies and/or Reflection.Emit. Visual Studio's inability to read local vars inside such scenarios is the whole reason I turned to Windbg in the first place... set the breakpoint in VS, wait for it to hit, then change to Windbg using the noninvasive trick attempting to detach from VS causes it to hang (along with the app). I think this is due to the fact that the managed debugger is a "soft" debugger via thread injection instead of a standard "hard" debugger. Or maybe it's just a VS bug specific to Silverlight (would hardly be the first I've encountered). set a breakpoint on some other location known to call into the anonymous method, then single-step your way in my backup plan, though I'd rather not resort to it if this Q&A reveals a better way

    Read the article

  • Anonymous union definition/declaration in a macro GNU vs VS2008

    - by Alan_m
    I am attempting to alter an IAR specific header file for a lpc2138 so it can compile with Visual Studio 2008 (to enable compatible unit testing). My problem involves converting register definitions to be hardware independent (not at a memory address) The "IAR-safe macro" is: #define __IO_REG32_BIT(NAME, ADDRESS, ATTRIBUTE, BIT_STRUCT) \ volatile __no_init ATTRIBUTE union \ { \ unsigned long NAME; \ BIT_STRUCT NAME ## _bit; \ } @ ADDRESS //declaration //(where __gpio0_bits is a structure that names //each of the 32 bits as P0_0, P0_1, etc) __IO_REG32_BIT(IO0PIN,0xE0028000,__READ_WRITE,__gpio0_bits); //usage IO0PIN = 0x0xAA55AA55; IO0PIN_bit.P0_5 = 0; This is my comparable "hardware independent" code: #define __IO_REG32_BIT(NAME, BIT_STRUCT)\ volatile union \ { \ unsigned long NAME; \ BIT_STRUCT NAME##_bit; \ } NAME; //declaration __IO_REG32_BIT(IO0PIN,__gpio0_bits); //usage IO0PIN.IO0PIN = 0xAA55AA55; IO0PIN.IO0PIN_bit.P0_5 = 1; This compiles and works but quite obviously my "hardware independent" usage does not match the "IAR-safe" usage. How do I alter my macro so I can use IO0PIN the same way I do in IAR? I feel this is a simple anonymous union matter but multiple attempts and variants have proven unsuccessful. Maybe the IAR GNU compiler supports anonymous unions and vs2008 does not. Thank you.

    Read the article

  • Linq - How to collect Anonymous Type as Result for a Function

    - by GibboK
    I use c# 4 asp.net and EF 4. I'm precompiling a query, the result should be a collection of Anonymous Type. At the moment I use this code. public static readonly Func<CmsConnectionStringEntityDataModel, string, dynamic> queryContentsList = CompiledQuery.Compile<CmsConnectionStringEntityDataModel, string, dynamic> ( (ctx, TypeContent) => ctx.CmsContents.Where(c => c.TypeContent == TypeContent & c.IsPublished == true & c.IsDeleted == false) .Select(cnt => new { cnt.Title, cnt.TitleUrl, cnt.ContentId, cnt.TypeContent, cnt.Summary } ) .OrderByDescending(c => c.ContentId)); I suspect the RETURN for the FUNCTION Dynamic does not work properly and I get this error Sequence contains more than one element enter code here. I suppose I need to return for my function a Collection of Anonymous Types... Do you have any idea how to do it? What I'm doing wrong? Please post a sample of code thanks! Update: public class ConcTypeContents { public string Title { get; set; } public string TitleUrl { get; set; } public int ContentId { get; set; } public string TypeContent { get; set; } public string Summary { get; set; } } public static readonly Func<CmsConnectionStringEntityDataModel, string, ConcTypeContents> queryContentsList = CompiledQuery.Compile<CmsConnectionStringEntityDataModel, string, ConcTypeContents>( (ctx, TypeContent) => ctx.CmsContents.Where(c => c.TypeContent == TypeContent & c.IsPublished == true & c.IsDeleted == false) .Select(cnt => new ConcTypeContents { cnt.Title, cnt.TitleUrl, cnt.ContentId, cnt.TypeContent, cnt.Summary }).OrderByDescending(c => c.ContentId));

    Read the article

  • Javascript Anonymous Functions and Global Variables

    - by Jonathan Swift
    I thought I would try and be clever and create a Wait function of my own (I realise there are other ways to do this). So I wrote: var interval_id; var countdowntimer = 0; function Wait(wait_interval) { countdowntimer = wait_interval; interval_id = setInterval(function() { --countdowntimer <=0 ? clearInterval(interval_id) : null; }, 1000); do {} while (countdowntimer >= 0); } // Wait a bit: 5 secs Wait(5); This all works, except for the infinite looping. Upon inspection, if I take the While loop out, the anonymous function is entered 5 times, as expected. So clearly the global variable countdowntimer is decremented. However, if I check the value of countdowntimer, in the While loop, it never goes down. This is despite the fact that the anonymous function is being called whilst in the While loop! Clearly, somehow, there are two values of countdowntimer floating around, but why?

    Read the article

  • Social IT guy barrier [closed]

    - by sergiol
    Possible Duplicate: How do you deal with people who ask you to fix their computer? Hello. Almost every person that deserves the title of being a programmer as faced the problem of persons that do not even remember the mere existence of those professionals, unless they have serious problems in their computer or some other IT related problem. May be my post will be considered off-topic, but I think it is a very important question. As Joel Spolsky says, IT guys are not Asperger geeks, and they need social life like everybody. But the people that is always asking for favors from us, can ruin deeply our social and personal life. I could experience this by myself. This fact as generated articles like http://www.lifereboot.com/2007/10-reasons-it-doesnt-pay-to-be-the-computer-guy/ and http://ecraazul.wordpress.com/2009/01/29/o-gajo-da-informatica-de-a-a-z/ (I received this one in my mailbox. It is in Portuguese, but I believe it is translated from English). Basically the idea is to criticize people that is always asking us favors. It is even more annoying if you are person very specialized in some subject and a person asks you a completely out-of-that-context question. For example, you are a VBA programmer and somebody says you to that his/her Mobile Internet Pen stopped to work five days ago and needs your help to put it working again. When you go to a doctor to fix your legs, you don't go to an ophthalmologist. You go to an orthopedist. And you pay. I don't how it works in other countries, but in Portugal being a doctor is so an overvalued job, that they earn very much money and almost nobody asks them free favors. So, my question is: what kind of social barrier (or whatever else) do you use to protect yourself from that situation?

    Read the article

  • Why can't c# use inline anonymous lambdas or delegates?

    - by Samuel Meacham
    I hope I worded the title of my question appropriately. In c# I can use lambdas (as delegates), or the older delegate syntax to do this: Func<string> fnHello = () => "hello"; Console.WriteLine(fnHello()); Func<string> fnHello2 = delegate() { return "hello 2"; }; Console.WriteLine(fnHello2()); So why can't I "inline" the lambda or the delegate body, and avoid capturing it in a named variable (making it anonymous)? // Inline anonymous lambda not allowed Console.WriteLine( (() => "hello inline lambda")() ); // Inline anonymous delegate not allowed Console.WriteLine( (delegate() { return "hello inline delegate"; })() ); An example that works in javascript (just for comparison) is: alert( (function(){ return "hello inline anonymous function from javascript"; })() ); Which produces the expected alert box. UPDATE: It seems you can have an inline anonymous lambda in C#, if you cast appropriately, but the amount of ()'s starts to make it unruly. // Inline anonymous lambda with appropriate cast IS allowed Console.WriteLine( ((Func<string>)(() => "hello inline anonymous lambda"))() ); Perhaps the compiler can't infer the sig of the anonymous delegate to know which Console.WriteLine() you're trying to call? Does anyone know why this specific cast is required?

    Read the article

  • Can a Guy with Embedded System Background go into Game Development

    - by NANDAGOPAL
    Well, I finished my Masters in Embedded Systems, and I am working in GUI development, and working with graphic tools and images and GUI's keep me glued to my seat more than working on code for MUP/MUC . And I want to give game development a Fair chance, try out developing a game from scratch using basic libraries then tryout the same in a free/open source game engine and there is a good chance I may fall in love with it, but it is poissible for a person with an Electrical and Electronics Bachelors and Embedded Systems Masters ( just a years experience in the field) go into game development and be successful in the profession. And I asked the same question @ stackoverflow.com (wrong place to ask ) http://stackoverflow.com/questions/13794822/can-a-guy-with-embedded-system-background-go-into-game-development/13794943#13794943 And I received good but a very generic answer. I would be happy to know the actual pro's and con's of a master's in embedded systems migrating to Game Dev

    Read the article

  • can a guy with embedded system background go into game development

    - by NANDAGOPAL
    Well, I finished my Masters in Embedded Systems, and I am working in GUI development, and working with graphic tools and images and GUI's keep me glued to my seat more than working on code for MUP/MUC . And I want to give game development a Fair chance, try out developing a game from scratch using basic libraries then tryout the same in a free/open source game engine and there is a good chance I may fall in love with it, but it is poissible for a person with an Electrical and Electronics Bachelors and Embedded Systems Masters ( just a years experience in the field) go into game development and be successful in the profession. And I asked the same question @ stackoverflow.com (wrong place to ask ) http://stackoverflow.com/questions/13794822/can-a-guy-with-embedded-system-background-go-into-game-development/13794943#13794943 And I received good but a very generic answer. I would be happy to know the actual pro's and con's of a master's in embedded systems migrating to Game Dev And I am extremely sorry for asking the same question for the third time but I really did not know that stackoverflow had so many sister sites, So a really big sorry, and an even bigger thank you!

    Read the article

  • Accessing C# Anonymous Type Objects

    - by Ali Kazmi
    Hi, How do i access objects of an anonymous type outside the scope where its declared? for e.g. void FuncB() { var obj = FuncA(); Console.WriteLine(obj.Name); } ??? FuncA() { var a = (from e in DB.Entities where e.Id == 1 select new {Id = e.Id, Name = e.Name}).FirstOrDefault(); return a; }

    Read the article

  • Overload Anonymous Functions

    - by Nissan Fan
    Still wrapping my head around Delegates and I'm curious: Is it possible to overload anonymous functions? Such that: delegate void Output(string x, int y); Supports: Output show = (x, y) => Console.WriteLine("{0}: {1}", x.ToString(), y.ToString()); And: delegate void Output(string x, string y); Allowing: show( "ABC", "EFG" ); And: show( "ABC", 123 );

    Read the article

  • Anonymous class implementing interface

    - by Flo
    I have the following code inside a method: var list = new[] { new { Name = "Red", IsSelected = true }, new { Name = "Green", IsSelected = false }, new { Name = "Blue", IsSelected = false }, }; I would like to call a function that requires a list of elements with each element implementing an interface (ISelectable). I know how this is done with normal classes, but in this case I am only trying to fill in some demo data. Is it possible to create an anonymous class implementing an interface? like this: new { Name = "Red", IsSelected = true } : ISelectable

    Read the article

  • How To Test if a Type is Anonymous?

    - by DaveDev
    Hi Guys I have the following method which serialises an object to a HTML tag. I only want to do this though if the type isn't Anonymous. private void MergeTypeDataToTag(object typeData) { if (typeData != null) { Type elementType = typeData.GetType(); if (/* elementType != AnonymousType */) { _tag.Attributes.Add("class", elementType.Name); } // do some more stuff } } Can somebody show me how to achieve this? Thanks Dave

    Read the article

  • Arguments to JavaScript Anonymous Function

    - by Phonethics
    for (var i = 0; i < somearray.length; i++) { myclass.foo({'arg1':somearray[i][0]}, function() { console.log(somearray[i][0]); }); } How do I pass somearray or one of its indexes into the anonymous function ? somearray is already in the global scope, but I still get somearray[i] is undefined

    Read the article

  • Closure vs Anonymous function (difference?)

    - by Maxim Gershkovich
    Hi, I have been unable to find a definition that clearly explains the differences between a closure and an anonymous function. Most references I have seen clearly specify that they are distinct "things" yet I can't seem to get my head around why. Could someone please simplify it for me? What are the specific differences between these two language features? Which one is more appropriate in what scenarios?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >