以下是virtualbox
从终端运行时错误输出的方式.怎么纠正呢?我在Ubuntu 12.10 64位机器上.
virtualbox
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-ose-dkms package and the appropriate
headers, most likely linux-headers-generic.
You will not be able to start VMs until this problem is fixed.
Run Code Online (Sandbox Code Playgroud)
编辑:
我有最新的linux-headers-generic
和virtualbox-ose-dkms
包
假设我有一个简单的形式方程式:
7x + 4y = n
Run Code Online (Sandbox Code Playgroud)
其中n由我们选择,x,y和n都是正整数.这是给我们的唯一方程式.在可能的解决方案中,我们需要解决方案(x,y),其中x是最小的.例如
7x + 4y = 14, then (2, 0) is the solution
7x + 4y = 15, then (1, 2) is the solution
7x + 4y = 32, then (4, 1) and (0, 8) are the possible solutions,
of which (0, 8) is the correct solution
Run Code Online (Sandbox Code Playgroud)
我想设计一种算法,以尽可能少的运行时间来计算它.我想到的当前算法是这样的:
Given an input n
Calculate max(x) = n/7
for i = 0 to max(x)
If the equation 7*i + 4*y = n holds
return value of i …
Run Code Online (Sandbox Code Playgroud) 我正在查看grepcode上java.util.ArrayList的sort()方法的源代码.他们似乎在小型数组(大小<7)上使用插入排序,并在大型数组上进行合并排序.我只是想知道这是否会产生很大的不同,因为它们只对大小<7的数组使用插入排序.在现代机器上,运行时间的差异几乎不可察觉.
我在Cormen读过这篇文章:
尽管合并排序在O(n*logn)最坏情况下运行,插入排序在O(n*n)最坏情况下运行,但插入排序中的常数因素可以使其在实际中对于许多机器上的小问题大小更快.因此,当子问题变得足够小时,通过在合并排序中使用插入排序来粗化递归的叶子是有意义的.
如果我会为我需要的某个组件设计排序算法,那么在合并排序与运行时间的差异变得明显之前,我会考虑使用insert-sort来获得更大的大小(可能达到<100).
我的问题是,达到<7的大小背后的分析是什么?
我一直在研究提供可扩展性的python web服务器,并决定使用Tornado(由Facebook FriendFeed使用)或Gevent.由于我对此很陌生,我依靠Python Web服务器的基准来列出Tornado和Gevent.此外,经过进一步研究,我发现:
我的要求:
由于其基于greenlet的方法,我特别倾向于gevent .我只是想要一些确凿的事实来证明gunicorn + gevent是一个不错的选择,并且在与Tornado的联盟中具有高度的可扩展性.或者是否有其他符合我要求的python web服务器?
请指出我正确的方向.