尝试Driver.Data.Module.DriverDataModule、Driver.Data.Module。
您还可以通过实例化该类型的对象并检查其 Type 的 AssemblyQualifiedName 属性来找到该类型的完整程序集限定名称:
DriverDataModule module = new DriverDataModule();
string fullyQualifiedName = module.GetType().AssemblyQualifiedName;
您需要添加对 WinForms 程序集的引用
- 右键单击解决方案并选择“添加引用”
- 选择 System.Windows.Forms 并单击“确定”
您可能还需要对 System.Data 执行相同的操作,具体取决于您的项目设置
当您尝试将项目作为网站打开时,会出现此错误。确定您是否已创建网站或项目的最简单方法是检查您的解决方案文件夹(即保存代码的位置)并查看根目录中是否有 *.sln 文件,如果有,那么您'创建了一个项目。
只是补充一下,当我尝试打开不久前通过从 Visual Studio 菜单中选择“文件”、“打开网站”创建的项目时,我遇到了此错误,而我应该选择“文件”、“打开项目”反而。我一意识到就捂脸:)
将 UIControl 设置为禁用并不会阻止它获取触摸事件(并且无论如何您都不应该在 UIControl 上覆盖 -touchesBegan:
等)。
您应该将按钮的 userInteractionEnabled 属性设置为 NO 以避免触摸事件。
gcc
不报告任何错误/警告。但 g++
确实如此。
编辑:
看起来C允许暂定定义< /strong> 为变量。
在您的情况下,两个全局定义都是暂定的,在这种情况下,将选择链接器看到的第一个定义。
将 file2 更改为:
char global = 1; // no more tentative...but explicit.
现在,如果像以前一样编译,则 file1 中的暂定 def 将被忽略。
通过以下方式使两个 def 显式化:
int global = 1; // in file1
char global = 1; // in file2
现在两者都不能被忽略,我们会得到多个 def 错误。
>>>> l = [(1,2), (3,4)]
>>>> for i, e in enumerate(l):
.... l[i] = (e[0]+xk, e[1]+yk)
一如既往,未经测试。 ;-)
如果不需要就地做就更简单了
>>>> l = [(e[0]+xk, e[1]+yk) for e in l]
最好,根据您指定的条件:
import cPickle
...
thestring = cPickle.dumps(thedict, -1)
-1
确保最有效的序列化并生成二进制 字符串(任意字节字符串)。如果您需要一个 ascii 字符串(因为例如将会发生一些 Unicode 转码,并且您无法将字段的类型从 TEXT
切换为 BLOB< /code>),避免使用
-1
,但效率会降低。
无论哪种情况,要稍后从字符串中获取字典,
thenewdict = cPickle.loads(thestring)
这是一个顺序行*列的解决方案,
它的工作原理是从
- 数组的底部开始,并确定每个数字下面有多少项与其在列中匹配。这是在 O(MN) 时间内完成的(非常简单)
- 然后它从上到下&从左到右,看看是否有任何给定的数字与左边的数字匹配。如果是这样,它会跟踪高度之间的关系,以跟踪可能的矩形形状。
这是一个有效的 python 实现。抱歉,因为我不确定如何使语法突出显示工作
# this program finds the largest area in an array where all the elements have the same value
# It solves in O(rows * columns) time using O(rows*columns) space using dynamic programming
def max_area_subarray(array):
rows = len(array)
if (rows == 0):
return [[]]
columns = len(array[0])
# initialize a blank new array
# this will hold max elements of the same value in a column
new_array = []
for i in range(0,rows-1):
new_array.append([0] * columns)
# start with the bottom row, these all of 1 element of the same type
# below them, including themselves
new_array.append([1] * columns)
# go from the second to bottom row up, finding how many contiguous
# elements of the same type there are
for i in range(rows-2,-1,-1):
for j in range(columns-1,-1,-1):
if ( array[i][j] == array[i+1][j]):
new_array[i][j] = new_array[i+1][j]+1
else:
new_array[i][j] = 1
# go left to right and match up the max areas
max_area = 0
top = 0
bottom = 0
left = 0
right = 0
for i in range(0,rows):
running_height =[[0,0,0]]
for j in range(0,columns):
matched = False
if (j > 0): # if this isn't the leftmost column
if (array[i][j] == array[i][j-1]):
# this matches the array to the left
# keep track of if this is a longer column, shorter column, or same as
# the one on the left
matched = True
while( new_array[i][j] < running_height[-1][0]):
# this is less than the one on the left, pop that running
# height from the list, and add it's columns to the smaller
# running height below it
if (running_height[-1][1] > max_area):
max_area = running_height[-1][1]
top = i
right = j-1
bottom = i + running_height[-1][0]-1
left = j - running_height[-1][2]
previous_column = running_height.pop()
num_columns = previous_column[2]
if (len(running_height) > 0):
running_height[-1][1] += running_height[-1][0] * (num_columns)
running_height[-1][2] += num_columns
else:
# for instance, if we have heights 2,2,1
# this will trigger on the 1 after we pop the 2 out, and save the current
# height of 1, the running area of 3, and running columsn of 3
running_height.append([new_array[i][j],new_array[i][j]*(num_columns),num_columns])
if (new_array[i][j] > running_height[-1][0]):
# longer then the one on the left
# append this height and area
running_height.append([new_array[i][j],new_array[i][j],1])
elif (new_array[i][j] == running_height[-1][0]):
# same as the one on the left, add this area to the one on the left
running_height[-1][1] += new_array[i][j]
running_height[-1][2] += 1
if (matched == False or j == columns -1):
while(running_height):
# unwind the maximums & see if this is the new max area
if (running_height[-1][1] > max_area):
max_area = running_height[-1][1]
top = i
right = j
bottom = i + running_height[-1][0]-1
left = j - running_height[-1][2]+1
# this wasn't a match, so move everything one bay to the left
if (matched== False):
right = right-1
left = left-1
previous_column = running_height.pop()
num_columns = previous_column[2]
if (len(running_height) > 0):
running_height[-1][1] += running_height[-1][0] * num_columns
running_height[-1][2] += num_columns
if (matched == False):
# this is either the left column, or we don't match to the column to the left, so reset
running_height = [[new_array[i][j],new_array[i][j],1]]
if (running_height[-1][1] > max_area):
max_area = running_height[-1][1]
top = i
right = j
bottom = i + running_height[-1][0]-1
left = j - running_height[-1][2]+1
max_array = []
for i in range(top,bottom+1):
max_array.append(array[i][left:right+1])
return max_array
numbers = [[6,4,1,9],[5,2,2,7],[2,2,2,1],[2,3,1,5]]
for row in numbers:
print row
print
print
max_array = max_area_subarray(numbers)
max_area = len(max_array) * len(max_array[0])
print 'max area is ',max_area
print
for row in max_array:
print row
我会这样写:
using System.ComponentModel;
using System;
// ...
[ EditorBrowsableAttribute(EditorBrowsableState.Advanced) ]
internal static ResourceManager : Resources.ResourceManager
{
get
{
when (object.ReferenceEquals(resourceMan, null))
{
resourceMan = Resources.ResourceManager
( "splashscreen.Properties.Resources"
, typeof(Resources).Assembly
);
}
resourceMan;
}
}
Mac 顶部菜单与 Windows 方法之间的真正区别不仅仅在于菜单:- 它是如何使用菜单来破解打开的 MDI 应用程序的。
在 Windows 中,MDI 应用程序(例如 dev studio 和 Office)将所有文档窗口托管在应用程序框架窗口内。在 Mac 上,没有每个应用程序的框架窗口,所有文档窗口与其他应用程序的所有其他文档窗口共享桌面。
由于缺乏对传统 MDI 应用程序进行深入改造以将其文档窗口移至桌面的能力,获得桌面菜单的尝试无论多么高尚,似乎注定是一种新颖的东西,没有真正的用途或实用性。
考虑到所有因素,我对 Mac 和 Windows(以及 Linux)上窗口管理器的当前状态感到相当沮丧:浏览器中的选项卡式分页之类的东西实际上是应用程序开发人员的绝望行为,他们没有得到这些东西作为标准窗口管理器 - 我相信这是选项卡真正所属的地方。为什么 notepad++ 应该有一组选项卡、chrome、firefox 和 internet explorer(是的,我知道可以运行所有 4 个),以及开发工作室对接视图、各种绘画程序。
它只是对现代多文档界面应该是什么样子的不同解释的混乱。
The real difference between the Mac menu accross the top, and the Windows approach, is not just in the menu :- Its how the menu is used to crack open MDI apps.
In windows, MDI applications - like dev studio and office - have all their document windows hosted inside an application frame window. On the Mac, there are no per-application frame windows, all document windows share the desktop with all other document windows from other applications.
Lacking the ability to do a deep rework of traditional MDI apps to get their document windows out and onto the desktop, an attempt, however noble, to get a desktop menu, seems doomed to be a novelty with no real use or utility.
I am, all things considered, rather depressed by the current state of window managers on both Mac and Windows (and Linux): Things like tabbed paged in browsers are really acts of desperation by application developers who have not been given such things as part of the standard window manager - which is where I believe tabs really belong. Why should notepad++ have a set of tabs, and chrome, and firefox, and internet explorer (yes, I have been known to run all 4), along with dev studios docking view, various paint programs.
Its just a mess of different interpretations of what a modern multi document interface should look like.
Windows 系统范围内的 Mac 风格菜单