问题列表 - 第48055页

我可以使用Fabric来执行交互式shell命令吗?

我正在尝试使用fabric来安装和部署一个Web项目,在此期间我需要创建一个postgresql数据库并配置一个RabbitMQ服务器.这两个操作都是交互式的,需要用户输入以创建数据库,添加用户,设置密码等(至少据我所知).

我可以使用结构脚本来执行这样的交互式shell操作吗?

python shell interactive fabric

11
推荐指数
1
解决办法
3686
查看次数

如何获得UIButton目标,动作和控制事件?

我正在使用UIImageView和UIButton一大堆.所以,我创建了一个自定义类来永久地将这两个结合起来,使事情变得更简单一些.这一切都运行良好,直到我决定实现 - (id)initWithObject:(AUIImageViewButton*)imageViewButton.

显然,我需要从传递的imageViewButton对象中复制所有相关属性.UIImageView根本没有问题.这样的事情处理它:

imageview = [[UIImageView alloc] initWithFrame:imageViewButton.imageview.frame];        // Copy all relevant data from the source's imageview
[imagebutton.imageview setBackgroundColor:imageViewButton.imageview.backgroundColor];   //
[imagebutton.imageview setImage:imageViewButton.imageview.image];                       //
Run Code Online (Sandbox Code Playgroud)

大多数按钮的东西也很容易买到:

button = [UIButton buttonWithType:imageViewButton.button.buttonType];                   // Copy all relevant data from the source's button
button.frame = imageViewButton.imageview.frame;                                         // 
[button setTitle:imageViewButton.button.titleLabel.text forState:UIControlStateNormal]; //
button.tag = imageViewButton.button.tag;                                                //
Run Code Online (Sandbox Code Playgroud)

我在弄清楚如何获取addTarget:action:forControlEvents方法的所有数据时遇到了一些麻烦.

查看文档,我可以看到我可以使用UIControl的allControlEvents和allTargets方法.我现在就深入研究它,看看我能遇到多少麻烦.我不确定的是行动.

任何人都可以向我推进正确的方向吗?

谢谢,

-Martin

iphone

13
推荐指数
2
解决办法
2万
查看次数

无法将表单定位到中心

我有一个名为Form1的表单.它设置为启动 - 位置=中心但在执行时它会在其他地方打开(在随机位置evrytime).

我使用IDE Visual Studio - 2010在Windows XP SP3下工作.请提供此问题的解决方法.

我上传了一个显示上述问题的示例项目.

下载链接:

http://www.6ybh-upload.com/vt5i4z1wz9pl/Light.zip

vb.net winforms

4
推荐指数
1
解决办法
2万
查看次数

从c#中检索程序集的MVID?

如何使用c#中的反射检索.NET程序集的模块版本标识符(MVID)?

.net c# reflection

7
推荐指数
2
解决办法
1211
查看次数

我的iPad运行时内存在哪里?

我显然导致设备(iPad)耗尽内存,所以它放弃了我的应用程序.我正在试图理解正在发生的事情,因为Instruments正在告诉我,我使用的是大约80Mb,并且设备上没有运行其他应用程序.

我发现这段代码片段要求iOS下的Mach系统获取内存统计信息:

#import <mach/mach.h>
#import <mach/mach_host.h>

static void print_free_memory () {
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;

host_port = mach_host_self();
host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
host_page_size(host_port, &pagesize);       

vm_statistics_data_t vm_stat;

if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS)
    NSLog(@"Failed to fetch vm statistics");

/* Stats in bytes */
natural_t mem_used = (vm_stat.active_count +
                      vm_stat.inactive_count +
                      vm_stat.wire_count) * pagesize;
natural_t mem_free = vm_stat.free_count * pagesize;
natural_t mem_total = mem_used + mem_free;
NSLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
}
Run Code Online (Sandbox Code Playgroud)

当我使用此函数获取三个内存值时,我发现即使mem_used总数没有发生太大变化,mem_total值也会下降.这是两个连续的输出行:

<Warning>: …
Run Code Online (Sandbox Code Playgroud)

memory heap-fragmentation ios

5
推荐指数
1
解决办法
5854
查看次数

如何从Type中获取NHibernate.Type.IType?

我尝试执行以下操作:

hibQuery.SetParameter("MyParameter", valueObject, valueType);
Run Code Online (Sandbox Code Playgroud)

唯一的问题是此方法NHibernate.Type.IType在第三个参数中需要,但valueType是类型Type.我怎么能把这个转换成IType?

任何tipps sl3dg3的thx

c# nhibernate hql

7
推荐指数
1
解决办法
4568
查看次数

从复选框中获取所有值?

有没有一种简单的方法来获取多个复选框的值并将它们存储在数据库中?

<?php
if(isset($_POST['go'])){
   $fruit = $_POST['fruit'].",";
   echo $fruit;
   // if you selected apple and grapefruit it would display apple,grapefruit
}
?>
<form method="post">
Select your favorite fruit:<br />
<input type="checkbox" name="fruit" value="apple" id="apple" /><label for="apple">Apple</label><br />
<input type="checkbox" name="fruit" value="pinapple" id="pinapple" /><label for="pinapple">Pinapple</label><br />
<input type="checkbox" name="fruit" value="grapefruit" id="grapefruit" /><label for="grapefruit">Grapefruit</label><br />
<input type="submit" name="go" />
</form>
Run Code Online (Sandbox Code Playgroud)

html php mysql checkbox

8
推荐指数
2
解决办法
4万
查看次数

jQuery - show()函数可以返回true吗?

我使用jQuery制作了一个脚本,例如:

$(document).ready(function() {
    $('a[name=pmRead]').click(function(e) {
        e.preventDefault();

        var pmtext=$(this).parents(".pmMain").find(".pmMain5");
    });         
});
Run Code Online (Sandbox Code Playgroud)

现在,我想使用像pmtext.show()这样的函数,如果元素可见则得到TRUE.否则,我想退回FALSE.使用show()获得TRUE/FALSE的任何更改?(或姐妹函数hide()).

jquery

3
推荐指数
1
解决办法
8272
查看次数

表单提交后重定向的正确方法

也许这是一个愚蠢的问题,但是在将表单保存在数据库中后,将用户重定向到成功页面的正确方法是什么?

我不知道为什么,但如果我添加action="done.php",比表单不保存数据到我的数据库.

我试图添加header ("location:/done.php");它工作,但当我将页面移动到原始服务器(PHP 4和MySQL 3.23.5)时,我尝试发送表单时出错Warning: Cannot modify header information - headers already sent by ........

这是我的PHP代码:

if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$adress = $_POST['adress'];
$post = $_POST['post'];
$phone = $_POST['phone'];

$sql="INSERT INTO tekstile_users (id, name, email, company, adress, post, phone)
VALUES
('', '$name','$email','$company', '$adress', '$post', '$phone')";

if (mysql_query($sql,$con)) {

    header ("location:/done.php"); 
    }
    else {
echo "Something is wrong";
}

}//end of submit button
Run Code Online (Sandbox Code Playgroud)

修复它将.php文件转换为UTF-8 without BOM. …

php forms redirect submit

6
推荐指数
2
解决办法
3万
查看次数

核心数据:实体<NSSQLEntity Studies id = 3>中未找到键盘错误

谁能告诉我这段代码有什么问题?它引发以下错误并导致应用程序崩溃:

reason: 'keypath Studies.patients.PatientName not found in entity <NSSQLEntity Studies id=3>'
Run Code Online (Sandbox Code Playgroud)

码:

 - (void)viewDidLoad {
        [super viewDidLoad];

        test_coredataAppDelegate *appDelegate = (test_coredataAppDelegate *)[[UIApplication sharedApplication] delegate];
        self.context = appDelegate.managedObjectContext;


        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        NSEntityDescription *entity = [NSEntityDescription 
                                       entityForName:@"Studies" inManagedObjectContext:_context];
        [fetchRequest setEntity:entity];
        /**/
        NSLog(patientName);
        [fetchRequest setPredicate:[NSPredicate predicateWithFormat:
                               @"(Studies.patients.PatientName == %@ )",patientName]];



        NSError *error;
        self.StudiessList = [_context executeFetchRequest:fetchRequest error:&error];
        self.title = @"patients"; 
        [fetchRequest release];

    }
Run Code Online (Sandbox Code Playgroud)

core-data objective-c nspredicate nsfetchrequest

15
推荐指数
2
解决办法
2万
查看次数