我有一个contenteditablediv和几段.
这是我的代码:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="main" contenteditable="true"
style="border:solid 1px black; width:300px; height:300px">
<div>Hello world!</div>
<div>
<br>
</div>
<div>This is a paragraph</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
假设,我想做一个范围选择,其中包含字符串"world!This is"
怎么做?
我想要tkdiff(或类似的东西)来显示我的'svn diff',以便我可以在tkdiff界面中切换文件.
(我正在使用mac.)
我有两个Windows 2008 R2 x64服务器NLB,ARR共享配置.我在网络共享中有应用程序文件.ASP.net页面(.aspx)很好但没有CSS,图像,js工作.我也有一个.htm文件显示css和图像就好了.
在iis日志中,我确实看到了401.3消息.所以它似乎是权限,但不知道还有什么其他配置权限明智.
我在下面阅读了类似的问题:
https://serverfault.com/questions/126978/iis-7-5-401-3-access-denied
我尝试了建议的解决方案 - 似乎没有工作(除非我错过了一些东西).任何意见是极大的赞赏!
我在安装了pyreadline的Windows 7 x64上运行IPython.如果我开始一个新会话并键入:
import numpy
nu<TAB>
Run Code Online (Sandbox Code Playgroud)
然后nu自动完成numpy.但是,如果我开始一个新的会话并试试这个:
import numpy
n<TAB>
Run Code Online (Sandbox Code Playgroud)
然后什么都没发生 我希望它可以循环完成所有可能的完成.我目前正在使用现成的配置,我是否需要更改设置以启用不明确的选项卡完成,或者我只是运气不好?
编辑:为了解决ma3204的评论,这是另一个例子(从新的ipython会话开始):
[In 1]: value1 = 5
[In 2]: value2 = 6
[In 3]: va<TAB> ... nothing happens
[In 3]: va<Ctrl + l>
vars value2 value1
[In 3]: val<TAB> ... completes to 'value'
[In 3]: value
[In 3]: value<Ctrl + l>
value2 value1
[In 3]: value
Run Code Online (Sandbox Code Playgroud)
当我输入va<TAB>上述我期望每个标签按循环通过value1,value2,vars,value1,value2,等.
我正在上课,其中一些例子在C#中.由于我的笔记本电脑运行Linux,我在Ubuntu上使用Mono 2.6.7.
我正在尝试编译以下代码:
using System.Net.Sockets;
using System.Net;
using System;
/// <summary>
/// Example program showing simple TCP socket connections in C#.NET.
/// Rather than reading and writing byte arrays, this example show
/// how to use a stream reader in the client.
/// TCPSocketServer is the socket server.
/// <author>Tim Lindquist ASU Polytechnic Department of Engineering</author>
/// <version>September, 2009</version>
/// </summary>
public class TCPSocketServer {
public static void Main (string [] args) {
IPAddress ipAddress = Dns.GetHostEntry("localhost").AddressList[0];
TcpListener tcpl = …Run Code Online (Sandbox Code Playgroud) 我有一个640x480图像的numpy.array,每个图像长630像.因此总阵列为630x480x640.我想生成一个平均图像,并计算所有630个图像中每个像素的标准偏差.
这很容易实现
avg_image = numpy.mean(img_array, axis=0)
std_image = numpy.std(img_array, axis=0)
Run Code Online (Sandbox Code Playgroud)
但是,由于我运行50个左右这样的数组,并且有一个8核/ 16线程工作站,我想我会变得贪婪并使用multiprocessing.Pool并行化.
所以我做了以下事情:
def chunk_avg_map(chunk):
#do the processing
sig_avg = numpy.mean(chunk, axis=0)
sig_std = numpy.std(chunk, axis=0)
return([sig_avg, sig_std])
def chunk_avg(img_data):
#take each row of the image
chunks = [img_data[:,i,:] for i in range(len(img_data[0]))]
pool = multiprocessing.Pool()
result = pool.map(chunk_avg_map, chunks)
pool.close()
pool.join()
return result
Run Code Online (Sandbox Code Playgroud)
但是,我只看到了一个小的加速.通过在chunk_avg_map中放置print语句,我能够确定一次只启动一个或两个进程,而不是16个(正如我所期望的那样).
然后我通过iPython中的cProfile运行我的代码:
%prun current_image_anal.main()
Run Code Online (Sandbox Code Playgroud)
结果表明,到目前为止,大部分时间花费在获取电话上:
ncalls tottime percall cumtime percall filename:lineno(function)
1527 309.755 0.203 309.755 0.203 {built-in method acquire}
Run Code Online (Sandbox Code Playgroud)
我理解与锁定有关,但我不明白为什么我的代码会这样做.有没有人有任何想法?
[编辑]根据要求,这是一个可运行的脚本,演示了这个问题.您可以通过任何您喜欢的方式对其进行分析,但是当我这样做时,我发现狮子分享的时间用于获取,而不是按照我的预期调整或调整.
#!/usr/bin/python
import numpy
import multiprocessing …Run Code Online (Sandbox Code Playgroud) 我从Ruby和ActiveRecord回到Java,想在Ruby中使用像ActiveRecord一样简单的东西.我有什么选择?
我想创建一个可以使用WinRM而不是WMI收集系统信息(Win32_blablabla)的小应用程序.我怎么能用C#做到这一点?
主要目标是使用WS-Man(WinRm)而不是DCOM(WMI).
我想今天非常容易.在C#中,它:
Dictionary<String, String> dict = new Dictionary<string, string>() { { "", "" } };
Run Code Online (Sandbox Code Playgroud)
但是在vb中,以下内容不起作用.
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) (("",""))
Run Code Online (Sandbox Code Playgroud)
我很确定有一种方法可以在声明中添加它们,但我不确定如何.是的,我想在声明中添加它们,而不是任何其他时间.:)所以希望它是可能的.感谢大家.
我也尝试过:
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) ({"",""})
Run Code Online (Sandbox Code Playgroud)
和...
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) {("","")}
Run Code Online (Sandbox Code Playgroud)
和...
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) {{"",""}}
Run Code Online (Sandbox Code Playgroud) 是否有任何工具或Visual Studio 2010扩展允许我查看配置文件转换的输出,而不必发布整个项目?执行转换的过程是否可以直接调用?
编辑
经过一番谷歌搜索,我发现了这个:
步骤4:从命令行为"Staging"环境生成新的转换后的web.config文件
通过转到开始 - >程序文件 - > Visual Studio v10.0 - > Visual Studio工具 - > Visual Studio 10.0命令提示符打开Visual Studio命令提示符
键入"MSBuild"应用程序项目文件的路径(.csproj/.vbproj)"/ t:TransformWebConfig/p:Configuration = Staging"并按Enter键,如下所示:
转换成功后,"Staging"配置的web.config将存储在项目根目录下的obj - > Staging文件夹下(在解决方案资源管理器中,您可以通过首先取消隐藏隐藏文件来访问此文件夹):
- 在解决方案资源管理器中,单击按钮以显示隐藏文件
- 打开Obj文件夹
- 导航到您的活动配置(在我们当前的情况下,它是"暂存")
- 你可以在那里找到转换后的web.config
您现在可以验证生成的新staging web.config文件是否具有已更改的连接字符串部分.
这对我来说并不是一个完美的解决方案,因为它仍然需要构建整个项目 - 至少使用他发布的命令.如果有人知道如何跳过使用MSBuild命令的构建步骤会有所帮助(尽管听起来有点不太可能).
编辑2
我还在CodePlex上找到了这个配置转换工具,它提供了一些很好的功能来扩展转换过程.这个工具是我所见过的最接近我正在寻找的功能的工具,并且是开发创建预览的扩展的一个很好的起点.它使用Microsoft.Web.Publishing.Tasks库来执行转换,而不依赖于构建实际项目.
web-config configuration-files visual-studio-2010 slowcheetah
c# ×2
javascript ×2
python ×2
api ×1
css ×1
database ×1
declaration ×1
dictionary ×1
diff ×1
iis-7.5 ×1
image ×1
ipython ×1
java ×1
mono ×1
profiling ×1
range ×1
selection ×1
slowcheetah ×1
svn ×1
vb.net ×1
web-config ×1
windows ×1
wmi ×1