Normal distribution. mu is the mean, and sigma is the standard deviation.</p> </blockquote> What is "missing" in the Visual Studio 2008 Express Editions?

  • what functionality is not available?
  • Changing the distribution of any function to another involves using the inverse of the function you want.

  • what restrictions are there on its use?
  • stribution by integrating over it -> d(x) = integral(p(x)) and use its inverse: Inv(d(x)). Now use the random probability function (which have uniform distribution) and cast the result value through the function Inv(d(x)). You should get random values cast with distribution according to the function you chose.

    In other words, if you aim for a specific probability function p(x) you get the distribution by integrating over it -> d(x) = integral(p(x)) and use its inverse: Inv(d(x)). Now use the random probability function (which have uniform distribution) and cast the result value through the function Inv(d(x)). You should get random values cast with distribution according to the function you chose.

    This is the generic math approach - by using it you can now choose any probability or distribution function you have as long as it have inverse or good inverse approximation.

    Hope this helped and thanks for the small remark about using the distribution and not the probability itself.

    90246 次浏览

    There are plenty of methods:

    • Do not use Box Muller. Especially if you draw many gaussian numbers. Box Muller yields a result which is clamped between -6 and 6 (assuming double precision. Things worsen with floats.). And it is really less efficient than other available methods.
    • Ziggurat is fine, but needs a table lookup (and some platform-specific tweaking due to cache size issues)
    • Generate n of the uniformly distributed numbers, sum them, subtract n*0.5 and you have the output of an approximately normal distribution with mean equal to 0 and variance equal to (1/12) * (1/sqrt(N)) (see wikipedia on uniform distributions for that last one)

      n=10 gives you something half decent fast. If you want something more than half decent go for tylers solution (as noted in the wikipedia entry on normal distributions)

      rel="noreferrer">look there).
    • Ratio-of-uniforms is my favorite, only a few addition/multiplications and a log 1/50th of the time (eg. look there).
    • Inverting the CDF is efficient (and overlooked, why ?), you have fast implementations of it available if you search google. It is mandatory for Quasi-Random numbers.

    As far as I know there are no restrictions on its use, but I'm not a lawyer.

    Where R1, R2 are random uniform numbers:

    NORMAL DISTRIBUTION, with SD of 1:

    sqrt(-2*log(R1))*cos(2*pi*R2)
    

    AviewAnew pointed out you can use Express Editions for commercial use: there are no licensing restrictions for applications built using Visual Studio Express Editions. See FAQ #7.

    This is exact... no need to do all those slow loops!

    This MSDN document should get you everything you need!

    can be supplied with any value, so that the numbers will be of desired mean, and by changing "1", you will get the variance equal to the square of your input.

    Q How can I convert a uniform distribution (as most random number generators produce, e.g. between 0.0 and 1.0) into a normal distribution?

      For example: =norminv(rand();50;3) will yield to the normally distributed numbers with MEAN = 50 VARIANCE = 9.

    1. For software implementation I know couple random generator names which give you a pseudo uniform random sequence in [0,1] (Mersenne Twister, Linear Congruate Generator). Let's call it U(x)

    2. bution F then you can try just to evaluate F^-1(U(x)). In pr.theory it was proved that such r.v. will have integral distribution F.

    3. It is exist mathematical area which called probibility theory.

    4. Step 2 can be appliable to generate r.v.~F without usage of any counting methods when F^-1 can be derived analytically without problems. (e.g. exp.distribution)

    5. First thing: If you want to model r.v. with integral distribution F then you can try just to evaluate F^-1(U(x)). In pr.theory it was proved that such r.v. will have integral distribution F.

    6. To model normal distribution you can cacculate y1*cos(y2), where y1~is uniform in[0,2pi]. and y2 is the relei distribution.

  • Step 2 can be appliable to generate r.v.~F without usage of any counting methods when F^-1 can be derived analytically without problems. (e.g. exp.distribution)

  • Q: What if I want a mean and standard deviation of my choosing?

  • To model normal distribution you can cacculate y1*cos(y2), where y1~is uniform in[0,2pi]. and y2 is the relei distribution.

  • You can calculate sigma*N(0,1)+m.

    Q: What if I want a mean and standard deviation of my choosing?

    It can be shown that such shifting and scaling lead to N(m,sigma)

    You can calculate sigma*N(0,1)+m.

    For Visual Studio 2008, the Express editions do not have the built-in testing features for one.

    This is a Matlab implementation using the polar form of the Box-Muller transformation:

    The major areas where Visual Studio Express lacks features compared to Visual Studio Professional:

    • No add-ins/macros
    • Some Win32 tools missing
    • No Team Explorer support
    • Limited refactoring support
    • Debugging is much more limited (particularly problematic for server development is no remote debugging)
    • Lack of support for setup projects
    • No report creation tools
    • No Office development support
    • No mobile platform support
    • Limited set of designers
    • Limited set of database tools
    • No code profiling or test framework support
    • No MFC/ATL support
    • No support for compiling C++ to 64-bit images (workaround is to install Windows SDK which is free)

    NOTE: it is often said that the Express EULA does not permit commercial development - that is not true (Visual Studio Express FAQ Item 7)

    (10000000),100); this is the result: Box-Muller Matlab Histfit

    Obviously it is really inefficient compared with the Matlab built-in randn.

    You can't create Windows services for one.

    MFC is the most important missing thing in my opinion.

    You can build MFC applications if you download the libraries in the Platform SDK. But there is no built in support for designing dialogs.

    There's a handy set of comparison charts on microsoft.com.

    It depends on the particular express edition, of course (since there are several and they have different features). The limitations you're most likely to run into are source control integration (and TFS client license), debugging limitations, limited refactorings, no unit testing support, and limited designer support.

    For completeness sake, here's a list of features that are in Visual Studio 2008 Standard Edition but are in none of the express editions:

    • Add-Ins
    • Macros and Macros IDE
    • Visual Studio Add-in project template
    • VSPackages
    • Wizards
    • ATL/MFC Trace Tool
    • Create GUID
    • Dotfuscator Community Edition
    • Error Lookup
    • Source Control Integration
    • Spy++
    • Team Explorer Integration
    • Team Foundation Server Client Access License
    • Visual Studio 2008 Image Library
    • Add-Ins/Macro Security options
    • Visual Studio Settings
    • Class Designer
    • Encapsulate Field Refactoring
    • Extract Interface Refactoring
    • Promote Local Variable to Parameter Refactoring
    • Remove Parameters Refactoring
    • Reorder Parameters Refactoring
    • Debugging Dumps
    • JIT Debugging
    • Mini-dumps
    • Multithreaded/Multiprocess Debugging
    • NTSD Command Support
    • Step-Into Web Services Debugging
    • CAB Project Project Template
    • Merge Module Project Template
    • Publish Web Site Utility
    • Setup Project Template
    • Function randn_box_muller.m:

      function [values] = randn_box_muller(n, mean, std_dev)
      if nargin == 1
      mean = 0;
      std_dev = 1;
      end
      
      
      r = gaussRandomN(n);
      values = r.*std_dev - mean;
      end
      
      
      function [values] = gaussRandomN(n)
      [u, v, r] = gaussRandomNValid(n);
      
      
      c = sqrt(-2*log(r)./r);
      values = u.*c;
      end
      
      
      function [u, v, r] = gaussRandomNValid(n)
      r = zeros(n, 1);
      u = zeros(n, 1);
      v = zeros(n, 1);
      
      
      filter = r==0 | r>=1;
      
      
      % if outside interval [0,1] start over
      while n ~= 0
      u(filter) = 2*rand(n, 1)-1;
      v(filter) = 2*rand(n, 1)-1;
      r(filter) = u(filter).*u(filter) + v(filter).*v(filter);
      
      
      filter = r==0 | r>=1;
      n = size(r(filter),1);
      end
      end
      
    • Setup Wizard Project Template
    • And invoking histfit(randn_box_muller(10000000),100); this is the result: Box-Muller Matlab Histfit

    • Smart Device CAB Project Template
    • Web Setup Project Template
    • Obviously it is really inefficient compared with the Matlab built-in randn.

    • Windows Installer Deployment
    • ing
    • 64-bit Visual C++ Tools
    • Debugging Dumps
    • Create XSD Schema from an XML Document
    • JIT Debugging
    • Reports Application Project Template
    • Mini-dumps
    • Visual Studio Report Designer
    • Multithreaded/Multiprocess Debugging
    • Visual Studio Report Wizard
    • NTSD Command Support
    • Shared Add-in Project Template
    • Step-Into Web Services Debugging
    • ASP.NET AJAX Server Control Extender Project Template
    • CAB Project Project Template
    • ASP.NET AJAX Server Control Project Template
    • Merge Module Project Template
    • ASP.NET Reports Web Site project template
    • Publish Web Site Utility
    • ASP.NET Server Control Project Template
    • Setup Project Template
    • ASP.NET Web Application Project Template
    • Setup Wizard Project Template
    • Generate Local Resources
    • Smart Device CAB Project Template
    • Web Setup Project Template
    • WCF Service Host
    • WCF Service Library Project Template
    • Windows Installer Deployment
    • WF Activity Designer
    • 64-bit Visual C++ Tools
    • Custom Wizard Project Template
    • Create XSD Schema from an XML Document
    • WF Empty Workflow Project Template
    • Reports Application Project Template
    • Visual Studio Report Designer
    • MFC ActiveX Control Project Template
    • Visual Studio Report Wizard
    • MFC Application Project Template
    • Shared Add-in Project Template
    • MFC DLL Project Template
    • ASP.NET AJAX Server Control Extender Project Template
    • ASP.NET AJAX Server Control Project Template
    • WF Sequential Workflow Console Application Project Template
    • ASP.NET Reports Web Site project template
    • ASP.NET Server Control Project Template
    • ASP.NET Web Application Project Template
    • Generate Local Resources
    • WCF Service Host
    • WCF Service Library Project Template
    • WF Activity Designer
    • Custom Wizard Project Template
    • WF Empty Workflow Project Template
    • MFC ActiveX Control Project Template
    • WF Sequential Workflow Library Project Template
    • MFC Application Project Template
    • WF Sequential Workflow Service Library Project Template
    • WF State Machine Workflow Library Project Template
    • MFC DLL Project Template
    • WF Sequential Workflow Console Application Project Template
    • WF State Machine Workflow Designer
    • WF State Machine Workflow Service Library Project Template
    • WF Sequential Workflow Library Project Template
    • WCF Syndication Service Library Project Template
    • WF Sequential Workflow Service Library Project Template
    • WF State Machine Workflow Library Project Template
    • Visual Studio Extensions for Windows Workflow Foundation Designer
    • WF State Machine Workflow Designer
    • Windows Forms Control Library Project Template
    • Windows Service Project Template
    • WF State Machine Workflow Service Library Project Template
    • WF Workflow Activity Library Project Template
    • WCF Syndication Service Library Project Template
    • WPF Custom Control Library Project Template
    • Visual Studio Extensions for Windows Workflow Foundation Designer
    • WPF User Control Library Project Template
    • Windows Forms Control Library Project Template
    • ASP.NET Server Control Item Template
    • Windows Service Project Template
    • COM Class Item Template
    • WF Workflow Activity Library Project Template
    • Configuration File Item Template
    • WPF Custom Control Library Project Template
    • Frameset Item Template
    • WPF User Control Library Project Template
    • Interface Item Template
    • ASP.NET Server Control Item Template
    • CLR Installer Class Item Template
    • COM Class Item Template
    • Local Database Cache Item Template
    • Configuration File Item Template
    • Module-Definition File Item Template
    • Frameset Item Template
    • Nested Master Page Item Template
    • ATL Registration Script Item Template
    • Interface Item Template
    • CLR Installer Class Item Template
    • MS Report Item Template
    • Local Database Cache Item Template
    • Report Wizard Item Template
    • .NET Resources File Item Template
    • Win32 Resource File Item Template
    • Static Discovery File (Web Services) Item Template
    • Module-Definition File Item Template
    • Transactional Component Item Template
    • Nested Master Page Item Template
    • Web Content Form Item Template
    • ATL Registration Script Item Template
    • Windows Script Host Item Template
    • MS Report Item Template
    • Windows Services Item Template
    • Report Wizard Item Template
    • XML Schema Item Template
  • .NET Resources File Item Template
  • Other people have posted huge lists, but as a practical matter, speaking as someone who does mostly systems programming, the features I miss most when using the express edition are

    1. Win32 Resource File Item Template
    2. the thread-aware parts of the debugger,and

    3. Static Discovery File (Web Services) Item Template
    4. the ability to open files with the built-in binary viewer.

  • Transactional Component Item Template
  • If I did MFC programming more often I would probably miss the dialog designer as well.

  • Web Content Form Item Template
  • Windows Script Host Item Template
  • Add-ins are allowed in Visual Studio Express. The most notable one is straight from Microsoft: XNA Game Studio works as a Visual Studio Express add-in.

  • Windows Services Item Template
  • There's even a project type (maybe only available in the full Visual Studio) that lets you build your own Visual Studio Express add-ins!

    This is particularly important especially if you're working with systems like Perforce where you must check out files before changing with them, particularly changing project settings for all team members.

  • Add-in support
  • Refactoring is very limited (rename, extract method)
  • tled by Google. I have seen nothing but good news about App Engine, other than hosting you app on servers someone else controls completely.

    There is a workaround - you install the Visual Studio Shell and F# CTP separately and they work together.

    I have tried app engine for my small quake watch application python framework and Django can be easily added see http://quakewatch.appspot.com/

    http://code.google.com/appengine/articles/django.html

    My purpose was to see the capabilities of app engine, so here are the main points:

      google-app-engine-django (http://code.google.com/p/google-app-engine-django/) project is excellent and works almost like working on a Django project
    1. it doesn't come by default with Django, it has its own web framework which is pythonic has URL dispatcher like Django and it uses Django templates
    2. You can not execute any long running process on server, what you do is reply to request and which should be quick otherwise appengine will kill it So if you have Django exp. you will find it easy to use
        So if your app needs lots of backend processing appengine is not the best way
      • But you can use any pure python framework and Django can be easily added see otherwise you will have to do processing on a server of your own
      • http://code.google.com/appengine/articles/django.html
      • My quakewatch app has a subscription feature, it means I had to email latest quakes as they happend, but I can not run a background process in app engine to monitor new quakes google-app-engine-django (http://code.google.com/p/google-app-engine-django/) project is excellent and works almost like working on a Django project
    3. solution here is to use a third part service like pingablity.com which can connect to one of your page and which executes the subscription emailer
    4. You can not execute any long running process on server, what you do is reply to request and which should be quick otherwise appengine will kill it but here also you will have to take care that you don't spend much time here So if your app needs lots of backend processing appengine is not the best way otherwise you will have to do processing on a server of your own
    5. or break task into several pieces
    6. It provides Django like modeling capabilities but backend is totally different but for a new project it should not matter.

    But overall I think it is excellent for creating apps which do not need lot of background processing.

    Edit: Now task queues can be used for running batch processing or scheduled tasks

  • My quakewatch app has a subscription feature, it means I had to email latest quakes as they happend, but I can not run a background process in app engine to monitor new quakes

    Edit: solution here is to use a third part service like pingablity.com which can connect to one of your page and which executes the subscription emailer after working/creating a real application on GAE for a year, now my opnion is that unless you are making a application which needs to scale to million and million of users, don't use GAE. Maintaining and doing trivial tasks in GAE is a headache due to distributed nature, to avoid deadline exceeded errors, count entities or do complex queries requires complex code, so small complex application should stick to LAMP.

    but here also you will have to take care that you don't spend much time here

    Edit: or break task into several pieces

  • Models should be specially designed considering all the transactions you wish to have in future, because entities only in same entity group can be used in a transaction and it makes the process of updating two different groups a nightmare e.g. transfer money from user1 to user2 in transaction is impossible unless they are in same entity group, but making them same entity group may not be best for frequent update purposes....
  • It provides Django like modeling capabilities but backend is totally different but for a new project it should not matter.
  • But overall I think it is excellent for creating apps which do not need lot of background processing.

    read this http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine

    I had trouble with Visual Studio Express (C++) 2008 (with service pack 1) on Windows Vista, with debugging. Any time I did anything such as (a) break the program, (b) set focus from the app back to the IDE, (c) resume execution, the program hung for about 30 seconds. Task Manager showed "VSExpress.exe" consuming an entire CPU for the duration. Vista showed "Not responding" in the IDE's title bar during this time.

    Edit:

    This was driving me bonkers so I bought a commercial copy of Visual Studio Professional 2008 ($150 from SoftwareSurplus) and this solved the problem.