您好以下代码是一个wordfeud程序.它允许您搜索与前缀,后缀和一些字母匹配的单词列表.我的问题是,我不想使用底部的列表,而是使用包含单词的外部文本文件并将其加载到列表中.我该怎么做呢?
count :: String -> String -> Int
count _[] = 0
count [] _ = 0
count (x:xs) square
|x `elem` square = 1 + count xs (delete x square)
|otherwise = count xs square
check :: String -> String -> String -> String -> Bool
check prefix suffix word square
| (length strippedWord) == (count strippedWord square) = True
| otherwise = False
where
strippedWord = drop (length prefix) (take ((length word ) - (length suffix)) word)
wordfeud …
Run Code Online (Sandbox Code Playgroud) 我已经将文件放入来自URL的流中了.但是事件OpenReadCompleted中的puttin savefiledialog给出了一个例外,因为需要从用户推断的事件中触发savefiledialog.将savefiledialog NOT置于OpenReadCompleted内会产生错误,因为bytes数组为空,尚未处理.是否有另一种方法可以保存文件以便在不使用事件的情况下从uri流式传输?
public void SaveAs()
{
WebClient webClient = new WebClient(); //Provides common methods for sending data to and receiving data from a resource identified by a URI.
webClient.OpenReadCompleted += (s, e) =>
{
Stream stream = e.Result; //put the data in a stream
MemoryStream ms = new MemoryStream();
stream.CopyTo(ms);
bytes = ms.ToArray();
}; //Occurs when an asynchronous resource-read operation is completed.
webClient.OpenReadAsync(new Uri("http://testurl/test.docx"), UriKind.Absolute); //Returns the data from a resource asynchronously, without blocking the calling thread.
try
{ …
Run Code Online (Sandbox Code Playgroud) 我已经将一个数据库导入到一个数据库项目中,直接从bat中我得到了200多个关于未解析引用的错误.现在我已经阅读了几个这样的帖子和网站(http://blogs.msdn.com/b/bahill/archive/2009/08/26/using-self-referencing-or-local-3-part-names .aspx)原因是3部分名称.
解决方案是右键单击数据库项目>重构>重命名服务器/数据库引用.然而,我的窗口与前面提到的网站的窗口不同,下拉菜单是空的.我正在使用带有SSDT 2010的Visual Studio 2010专业版.如何理解这一点的任何帮助表示赞赏.
我需要导入大约20到30个数据库,并且手动纠正所有这些错误几乎是不可能的.
我有一个带有查询的存储过程:
SELECT
ID
,AmountInCurrency
,ExtractionDate
FROM
Table
Run Code Online (Sandbox Code Playgroud)
此查询返回2行:
ID AmountInCurrency ExtractionDate
1 8.00 2013-10-17 10:00:00.000
1 10.50 2013-09-16 09:00:00.000
Run Code Online (Sandbox Code Playgroud)
我想将Min和Max Extrationdate选择为变量@mindate和@maxdate.现在我将结果集放入临时表中并从中选择最大值和最小值.
但是否有可能在选择中这样做:
ID AmountInCurrency ExtractionDate MinExtractionDate MaxExtractionDate
1 8.00 2013-10-17 10:00:00.000 2013-09-16 09:00:00.000 2013-10-17 10:00:00.000
1 10.50 2013-09-16 09:00:00.000 2013-09-16 09:00:00.000 2013-10-17 10:00:00.000
Run Code Online (Sandbox Code Playgroud) 我正在从 Excel 编辑 Microsoft Word 文档。我的 Word 文档中有一个表格,其中第 4 列由一个数字和后面的字母wk 组成。
例子:
+------+------+------+-------+
| Col1 | Col2 | Col3 | Col4 |
+------+------+------+-------+
| test | 2 | 123 | 1 wk |
| test | 2 | 123 | 13 wk |
| test | 2 | 123 | 10 wk |
+------+------+------+-------+
Run Code Online (Sandbox Code Playgroud)
我正在尝试更改字母wk的字体大小。我想我可以通过选择来做到这一点,然后替换字母,但它绝对不能通过 Excel 在 VBA 中工作。我怎样才能做到这一点?
我目前的代码:
Tbl.Columns(4).Select
WDApp.Selection.Find.ClearFormatting
With WDApp.Selection.Find
'.ClearFormatting
.Text = "wk"
.Replacement.Text = "wk"
.Font.Size = 9
End With …
Run Code Online (Sandbox Code Playgroud) absolute ×1
database ×1
excel ×1
excel-2010 ×1
haskell ×1
ms-word ×1
select ×1
silverlight ×1
sql ×1
sql-server ×1
uri ×1
vba ×1