首页 \ 问答 \ 添加随机数会使它们更随机吗?(Does adding random numbers make them more random?)

添加随机数会使它们更随机吗?(Does adding random numbers make them more random?)

这是一个纯粹的理论问题。

我们都知道,大多数(如果不是全部)随机数生成器实际上只生成伪随机数。

假设我想要一个10到20的随机数。我可以这样做( myRandomNumber是一个整型变量):

myRandomNumber = rand(10, 20);

但是,如果我执行此语句:

myRandomNumber = rand(5, 10) + rand(5, 10);

这种方法随机吗?


This is a purely theoretical question.

We all know that most, if not all, random-number generators actually only generate pseudo-random numbers.

Let's say I want a random number from 10 to 20. I can do this as follows (myRandomNumber being an integer-type variable):

myRandomNumber = rand(10, 20);

However, if I execute this statement:

myRandomNumber = rand(5, 10) + rand(5, 10);

Is this method more random?


原文:https://stackoverflow.com/questions/14741158
更新时间:2023-06-15 10:06

最满意答案

如今NuGet是要走的路。 如果您仍在手动处理组件,我担心您做错了。

你绝对应该通过NuGet包安装它。 这将使您在出现新更新时不会感到头疼。 NuGet知道如何正确管理包依赖关系,也就是说,它还会更新项目中安装的所有其他包,使它们与最新的ASP.NET MVC兼容。 在这种特殊情况下,事情真的变得越来越好! :)


NuGet nowadays is the way to go. If you are still dealing with assemblies manually, I fear you're doing it wrong.

You definitely should install it through a NuGet package. This will allow you no headaches when new updates appear. NuGet knows how to manage package dependencies correctly, that is, it'll also update all other packages you have installed in your project to make them compatible with the latest ASP.NET MVC. Things are really EVOLVING for the better in this specific case! :)

相关问答

更多
  • 我相信这个答案是“不”。 但是,有一些引用可以设置根文件夹NuGet将其安装到: http : //nuget.codeplex.com/workitem/215 (请参阅注释) I believe the answer to that is "No." There are, however, some references to be able to set the root folder NuGet installs things into: http://nuget.codeplex.com/work ...
  • 正如标题所示,为什么ASP.NET MVC 4项目有很多NuGet软件包? 这是一个问题,您需要向框架的设计者询问。 哪些对于一个将是网站,没有API等的空白项目来说是非常重要的? 以下是严格的最小值,允许您配置路由并使用渲染Razor视图的操作定义控制器:
    结果是你的订阅的“密钥”部分列出了他们自己的NuGet提要 Turns out the have their own NuGet feed that is listed in the "Keys" section of your subscription
  • 我认为你不能这样做 - 我认为这不是NuGet的功能,而是NuGet包中脚本的位置。 这可能因包装而异:-( I don't think you can do this - I don't think this is functionality of NuGet, but rather the location of the scripts inside the NuGet package. This could vary from one package to another :-(
  • 就像你说的那样,互联网上关于这个库的信息很少。 在Nuget上没有关于如何使用它的信息或文档,但我们有关于项目所有者的信息, Lode Kennes和他的昵称linh721990 。 所以下面的谷歌搜索linh721990 github没有提供任何结果或线索,但是linh721990 bitbucket提供了库中源代码的链接,以及一些测试应用程序: https://bitbucket.org/linh721990/coinpayments.net-c 如果您查看https://bitbucket.org/l ...
  • 您不应更新packages.config以获取新的软件包版本。 Package Restore只是下载包文件。 它不会更新引用等。 要更新程序包,可以使用“管理NuGet程序包”对话框来安装更新或使用程序包管理器控制台并键入: Update-Package You shouldn't update packages.config to get new package versions. Package Restore simply downloads the package files. It doesn' ...
  • 安装包时NuGet会做什么? 在这种特定情况下,它将js文件解压缩到您的Scripts文件夹,如果需要任何css,那么它会将CSS文件或某些情况下的文件夹精确到解决方案的Content文件夹中。 如果您希望js仅包含在某些页面上而不是所有页面的底部(Views> Controller> Whatever.cshtml),那么您可以添加以下行: @section css {
    React.ASPNET是一个允许你做类似的事情的库: @Html.React("CommentsBox", new { initialComments = Model.Comments }) 它为ASP.NET MVC添加了一些扩展方法。 你也可以这样做: