我想问你是否可以在用Ocaml编写的程序中调用用python编写的程序,如果答案是肯定的,我该怎么办?
我想将关键笔划发送到程序,即使它在后台运行.但我只能这样做NOTEPAD,
[DllImport("user32.dll")]
protected static extern byte VkKeyScan(char ch);
[DllImport("user32.dll", SetLastError = true)]
protected static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[DllImport("User32.Dll", EntryPoint = "PostMessageA")]
protected static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
Run Code Online (Sandbox Code Playgroud)
char Key = // key value to send
IntPtr hWnd = FindWindowEx(_handle, IntPtr.Zero, "edit", null); // _handle is the windows handle of the program (here its notepad)
PostMessage(hWnd, WM_KEYDOWN, VkKeyScan(Key), 0);
Run Code Online (Sandbox Code Playgroud)
但对于所有其他应用程序,我不能发送按键,如果它在后台.因为我不知道lpszClass那个程序(我认为这是该程序中输入区域的userControl名称.对于NotePad来说,它是"edit".我发现这个上网).
对于所有其他应用程序我正在做的是,将应用程序放到前台,然后发送密钥,然后再次获取我的程序前台.我需要我的程序始终作为前台运行.
[DllImport("USER32.DLL")]
public static …Run Code Online (Sandbox Code Playgroud) 我有这个Jquery:
div.find(".CopyIntoNewTownAssociation").button({ icons: { primary: "ui-icon-copy", text: false} });
Run Code Online (Sandbox Code Playgroud)
这个HTML:
<a style=\"width:20px;height:20px\" class=\"CopyIntoNewTownAssociation\"></a>
Run Code Online (Sandbox Code Playgroud)
但是在页面上按钮位于按钮右侧.我有像这样的不同的按钮,并且具有完全相同的标记,除了图标,一些在中心,一些在底部,一些在右边.它只有几个像素,但在20像素的按钮上非常明显.
有任何想法吗?
我将 RichTextBox 控件放置在新窗体上并启动该项目。所以 RichTextBox.Text = "";
每次我按向上或向下键时,我都会听到烦人的蜂鸣声!如何摆脱这个问题?
在 KeyDown 方法中使用“e.SuppressKeyPress = true”可锁定光标位置。
我正在经历"中级Perl",这很酷.我刚刚完成了关于"Schwartzian变换"的部分,在它沉入之后,我开始想知道为什么变换不使用缓存.在具有多个重复值的列表中,转换会重新计算每个值的值,因此我想为什么不使用哈希来缓存结果.这里有一些代码:
# a place to keep our results
my %cache;
# the transformation we are interested in
sub foo {
# expensive operations
}
# some data
my @unsorted_list = ....;
# sorting with the help of the cache
my @sorted_list = sort {
($cache{$a} //= &foo($a)) <=> ($cache{$b} //= &foo($b))
} @unsorted_list;
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?为什么书中没有列出Schwartzian变换的缓存版本,一般来说只是更好地传播,因为乍一看我认为缓存版本应该更高效?
编辑:daxim在评论中指出这被称为兽人机动.所以我并不疯狂,虽然我不太明白这个名字.
这可以是社区维基.
我正在寻找一个简单的,多平台,免费的数据库浏览器(ODBC等).这是我希望与数据库连接的那些时候,只需要一种简单的方法来快速查看其中的内容.不需要支持任何特定于供应商的功能.
垃圾太多了,我不想整天玩这些东西.你用什么?
F#具有使用户能够扩展模式匹配的功能:
let (|Even|Odd|) n = if n % 2 = 0 then Even else Odd
match 3 with | Odd -> printfn "odd"
| Even -> printfn "even"
Run Code Online (Sandbox Code Playgroud)
要么:
(** Parsing date from any of the formats: MM/DD/YY, MM/DD/YYYY, YYYY-MM-DD *)
let parseDate = function
| ParseRegex "(\d{1,2})/(\d{1,2})/(\d{1,2})$" [Integer m; Integer d; Integer y]
-> new DateTime(y + 2000, m, d)
| ParseRegex "(\d{1,2})/(\d{1,2})/(\d{3,4})" [Integer m; Integer d; Integer y]
-> new DateTime(y, m, d)
| ParseRegex "(\d{1,4})-(\d{1,2})-(\d{1,2})" [Integer y; …Run Code Online (Sandbox Code Playgroud) 我从JNI调用获取一个字节数组,并试图用它构造一个Bitmap对象.
我的问题是,以下代码返回null.
byte[] image = services.getImageBuffer(1024, 600);
Bitmap bmp = BitmapFactory.decodeByteArray(image, 0, image.length);
Run Code Online (Sandbox Code Playgroud)
关于它的任何提示?
PS:像素布局是BGR,而不是RGB.
我知道它MembershipProvider在System.Web.Security命名空间中.我System.Web在我的项目中添加了一个引用,我using System.Web.Security在.cs文件中添加了一个指令 - 但正如你所看到的,VS2010不相信我:
找不到类型或命名空间名称'MembershipProvider'
(您是否缺少using指令或程序集引用?)

我在这里错过了什么?
我被引导到一篇非常好的文章,该文章展示了如何从头到尾创建自定义验证器.我唯一的问题是这只适用于单个字段:http: //haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx
如果我需要在模型中验证2个或更多属性,该怎么办?如何将整个模型传递给Validator?
注意:要清楚,我真的不想在回发后验证整个模型......这会破坏这种方法的目的.
c# ×4
winforms ×2
android ×1
caching ×1
database ×1
f# ×1
html ×1
java ×1
javascript ×1
jquery ×1
jquery-ui ×1
keystrokes ×1
membership ×1
memoization ×1
namespaces ×1
ocaml ×1
optimization ×1
perl ×1
python ×1
richtextbox ×1
scala ×1
security ×1
sorting ×1
winapi ×1