我有两个问题.
>>> class One(object):
... pass
...
>>> class Two(object):
... pass
...
>>> def digest(constr):
... c = apply(constr)
... print c.__class__.__name__
... print constr.__class__.__name__
...
>>> digest(Two)
Two
type
Run Code Online (Sandbox Code Playgroud)
如何创建对象'Two'?constr()或c()都不起作用; 似乎apply将它变成了一种类型.
将类和实例传递给方法时会发生什么?
我想让我的内容滑块能够响应按键(左箭头键和右箭头键)功能.我已经阅读了几个浏览器和操作系统之间的一些冲突.
用户可以在全球网站(正文)上浏览内容.
伪代码:
ON Global Document
IF Key Press LEFT ARROW
THEN animate #showroom css 'left' -980px
IF Key Press RIGHT ARROW
THEN animate #showroom css 'left' +980px
Run Code Online (Sandbox Code Playgroud)
我需要一个没有任何交叉(浏览器,操作系统)冲突的解决方案.
如何使用任意函数或一组列使Dired显示其文件?基本上我想改变自:
-rw-r--r-- 1 konrad konrad 3847863 Out 18 14:17 ClojureinAction.pdf
-rw-rw-r-- 1 tamara tamara 27338341 Out 20 07:16 Halliday, Resnick, Walker - Fundamentals of Physics.pdf
-rw-r--r-- 1 konrad konrad 3921024 Set 22 11:11 Pragmatic.Programming.Clojure.May.2009.pdf
Run Code Online (Sandbox Code Playgroud)
喜欢的东西
644 1-5MB ClojureinAction.pdf PDF (5 days ago, 400pgs)
664 10-100MB Halliday, Resnic...pdf PDF (3 days ago, 1000pgs, Tamara's)
644 1-5MB Pragmatic.Progra...pdf PDF (1 min ago, 100 pages)
Run Code Online (Sandbox Code Playgroud)
谢谢!
编辑:谢谢你的回答,加雷斯,但你能说得更详细吗?显然,钩子只允许我在缓冲区加载时运行任意代码.Dired甚至不会停止加载缓冲区:(
(defun foo (&rest args) (unlocking-buffer (message "foo") (insert "foo\n")))
Run Code Online (Sandbox Code Playgroud)

看看dired的源代码,它似乎从我正在尝试替换的这些格式中获取信息,所以我想知道以这种方式改变它是否可行,或者我是否最终必须重写所有内容.
我想制作数据库,但我只知道MySQL和PostgreSQL.你能说出什么样的数据库服务器吗?我想知道什么DB服务器用于制作一些web或用于制作一些应用程序(VB,Delphi).
我在收到我提出的电子邮件时遇到了困难.
电子邮件打开很好,但一旦打开它就不会关闭mailComposeController:mailer didFinishWithResult:结果错误:错误处理程序永远不会被调用.
据我所知,我已经掌握了所有可以做到这一点.
任何有关我能看到什么的想法?
以下是我如何提出电子邮件:
-(IBAction)emailButtonPressed
{
Run Code Online (Sandbox Code Playgroud)
NSString*text = @"我的电子邮件文本";
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.delegate = self;
[mailer setSubject:@"Note"];
[mailer setMessageBody:text isHTML:NO];
[self presentModalViewController:mailer animated:YES];
[mailer release];
}
Run Code Online (Sandbox Code Playgroud)
然后在类中我有这个代码来处理close(但它永远不会被调用):
-(void)mailComposeController:(MFMailComposeViewController *)mailer didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
[self becomeFirstResponder];
[mailer dismissModalViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)
我的头文件定义为:
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
@interface myViewController : UIViewController <UIActionSheetDelegate, UIAlertViewDelegate, MFMailComposeViewControllerDelegate, UINavigationControllerDelegate>
Run Code Online (Sandbox Code Playgroud)
谢谢
Iphaaw
我打算构建vim并看到它支持该pythoninterp功能
--enable-pythoninterp.它是什么?由于我是Python的忠实粉丝,我想了解更多相关信息.
而且,有什么--with-python-config-dir=PATH用?
我希望在Visual Studio 2010中将目标CPU设置从"任何CPU"更改为"x86".
我在另一个网站上看到我需要做以下事情:
但是我没有在属性中的任何地方看到"编译"选项卡.
请尽早帮助我.
更新:我确实看到了一个平台下拉列表,但除了"任何CPU"之外什么都没有,
.
我正在尝试通过Mac OS X 10.6上的命令行使用PHP建立到远程服务器的交互式SSH连接.我目前正在使用PHP的proc_open函数来执行以下命令:
ssh -t -t -p 22 user@server.com
Run Code Online (Sandbox Code Playgroud)
这几乎可行.该-t -t选项都应该强制伪终端,他们几乎做.我可以输入SSH密码并按Enter键.但是,按下后,终端似乎只是挂起.没有输出,没有任何东西 - 就像SSH会话失败一样.我无法运行命令或任何东西,必须使用Ctrl + C杀死整个事物.我知道登录成功,因为我可以执行命令,ssh -t -t -p 22 user@server.com "ls -la"并获得正确的输出.
我认为这个问题必须与我在proc_open调用中使用标准管道的事实有关,所以我用pty替换它们.我收到以下错误:"此系统不支持pty伪终端......"
Mac OS X根本不支持pty或伪终端吗?(我很擅长使用所有这些shell术语).
这是PHP代码:
$descriptorspec = array(0 => array("pty"), 1 => array("pty"), 2 => array("pty"));
$cwd = getcwd();
$process = proc_open('ssh -t -t -p 22 user@server.com', $descriptorspec, $pipes, $cwd);
if (is_resource($process))
{
while (true)
{
echo(stream_get_contents($pipes[1]));
$status = proc_get_status($process);
if (! $status["running"])
break;
}
}
Run Code Online (Sandbox Code Playgroud)
(对不起 - 我不能为我的生活弄清楚SO的格式说明......)
我究竟做错了什么?为什么我不能用pty?这在Mac OS X上是不可能的吗?谢谢你的帮助!
我有一个列表框,其中包含一些项目.这些项目是网格,包含各种文本块,按钮等.
foreach (Grid thisGrid in myListBox.SelectedItems)
{
foreach (TextBlock thisTextblock in thisGrid.Children)
{
//Do Somthing
}
}
Run Code Online (Sandbox Code Playgroud)
然而,这引发了一个例外,因为除了Textblock之外还有其他项目.我怎么能适应这个?谢谢.
我在Java上尝试以下代码:
String test = "http://asda.aasd.sd.google.com/asdasdawrqwfqwfqwfqwf";
String regex = "[http://]{0,1}([a-zA-Z]*.)*\\.google\\.com/[-a-zA-Z/_.?&=]*";
System.out.println(test.matches(regex));
Run Code Online (Sandbox Code Playgroud)
它确实工作了几分钟(之后我杀了VM)没有结果.谁能帮我?
顺便说一句:您将来会建议我如何加快weblink-testng regex的速度?