我想生成100个正态分布的随机数(μ= 10,σ= 7),然后绘制这些数字的数量图.
如何在Excel 2010中生成具有特定分布的随机数?
还有一个问题:
例如,当我生成20个随机数时RANDBETWEEN(Bottom,Top),每次重新计算时数字都会改变.我该如何防止这种情况发生?
我想用c#显示图像PictureBox.我创建了一个包含a pictureBox和计时器的类.但是当创建对象时,没有任何显示.
我该怎么办?
我正确使用timer1吗?
这是我的代码:
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 c = new c1();
c.create_move(1);
}
}
class c1 {
PictureBox p = new PictureBox();
Timer timer1 = new Timer();
public void create_move(int i){
p.ImageLocation = "1.png";
p.Location = new Point(50, 50 + (i - 1) * 50);
timer1.Start();
timer1.Interval = 15;
timer1.Tick += new EventHandler(timer_Tick);
}
private int k = 0;
void timer_Tick(object sender, EventArgs e)
{
// …Run Code Online (Sandbox Code Playgroud) 我在c#中编写下面的代码来显示图像PictureBox但是在运行应用程序时,没有显示任何内容......
请帮我解决这个问题.
这是我的代码:
private void button1_Click(object sender, EventArgs e)
{
PictureBox p =new PictureBox();
p.ImageLocation = "1.jpg"
p.Location = new Point(100, 75);
}
Run Code Online (Sandbox Code Playgroud) 我已编写代码来显示许多图像(100图像),PictureBox但在运行应用程序时,只显示了一个图像...
请帮帮我们......
这是我的代码:
Random r = new Random();
private int randomPoint()
{
return 1 + r.Next() % 15;
}
// x0, y0
private int[] initialLocation = new int[2];
private void setLocation(int i)
{
int x0 = 50, y0=50;
initialLocation[1] = y0;
switch (i)
{
case 1: initialLocation[0] = x0;
break;
case 2: initialLocation[0] = x0 + 50;
break;
case 3: initialLocation[0] = x0 + 100;
break;
case 4: initialLocation[0] = x0 + 150;
break;
case 5: initialLocation[0] = …Run Code Online (Sandbox Code Playgroud) 我想在我的网页上显示服务器时间.我用javascript代码完成了客户端时间但我怎么能显示服务器时间?
任何zendFramework类都这样做吗?
我正在使用下面的javascript代码来显示客户端时间:
<head>
<script language="javascript" type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById("time_section").innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
</head>
<body onload="startTime()">
</body>
Run Code Online (Sandbox Code Playgroud)