问题列表 - 第29437页

谷歌地图api Circle渐变?

我正在为地图添加圆形叠加层.我现在可以正确设置颜色,不透明度等.我如何实现颜色渐变(即从中心径向向外)?这甚至可能吗?

(我正在使用api v3,但是如果你有v2的解决方案,我也很乐意看到它).

javascript google-maps

9
推荐指数
0
解决办法
1876
查看次数

Google App Engine:警告:Server @ 3d484a8a失败:java.net.BindException:地址已在使用中

我刚开始学习服务器,而且我正在搞乱谷歌的App Engine.我试图通过位于App Engine的教程,让这里在Mac上使用Eclipse,但我得到读取一个问题:

Jun 24, 2010 4:35:08 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jun 24, 2010 4:35:08 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed /Users/ayanonagon/Desktop/Venmo/iPhoneApplication/Guestbook/war/WEB-INF/appengine-web.xml
Jun 24, 2010 4:35:08 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed /Users/ayanonagon/Desktop/Venmo/iPhoneApplication/Guestbook/war/WEB-INF/web.xml
Jun 24, 2010 4:35:08 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed SelectChannelConnector@127.0.0.1:8888: java.net.BindException: Address already in use
Jun 24, 2010 4:35:08 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed Server@3d484a8a: java.net.BindException: Address already in use

************************************************
Could not open the requested socket: Address already in …
Run Code Online (Sandbox Code Playgroud)

java google-app-engine eclipse-plugin

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

使用Regex.Matches确定匹配的模式

我正在写一个翻译,而不是任何认真的项目,只是为了好玩,并且对正则表达式更加熟悉.从下面的代码中我想你可以找到我要去的地方(cheezburger有人吗?).

我正在使用一个字典,它使用正则表达式列表作为键,字典值是List<string>包含更多值的替换值的字典.如果我打算这样做,为了弄清楚替补是什么,我显然需要知道关键是什么,我怎样才能找出触发匹配的模式?

        var dictionary = new Dictionary<string, List<string>>
        {                     
            {"(?!e)ight", new List<string>(){"ite"}},
            {"(?!ues)tion", new List<string>(){"shun"}},
            {"(?:god|allah|buddah?|diety)", new List<string>(){"ceiling cat"}},
            ..
        }

        var regex = "(" + String.Join(")|(", dictionary.Keys.ToArray()) + ")";

        foreach (Match metamatch in Regex.Matches(input
           , regex
           , RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture))
        {
            substitute = GetRandomReplacement(dictionary[ ????? ]);
            input = input.Replace(metamatch.Value, substitute);
        }
Run Code Online (Sandbox Code Playgroud)

我正在尝试什么,或者有更好的方法来实现这种疯狂吗?

c# regex

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

rails boolean fields:`is_foo`或者只是`foo`?

可能重复:
在Rails中命名布尔列

有关布尔字段名称的rails约定是什么?

例如,如果我的User模型需要其"活动性"的标志,我应该调用db字段is_active还是active

注意:Rails自动生成用于访问布尔字段的问号标记方法:User.is_active?User.active?.

convention ruby-on-rails

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

WiX卸载 - 在重启管理器之前关闭应用程序

我安装了WiX安装程序.安装完成后,它会启动一个在Explorer进程中注入一些代码的应用程序.

目前,当我卸载时,Restart Manager启动并提供关闭我的应用程序和资源管理器.而不是我想手动关闭我的应用程序(这是通过在命令行上使用-exit再次运行它来完成的).我有一个自定义动作来做到这一点.

这是我到目前为止所尝试的:

<CustomAction ExeCommand="-exit" FileKey="MyApp.exe" Id="CloseMyApp" Impersonate="yes" Return="ignore" />

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallInitialize" />
    <Custom Action="CloseMyApp" Before="RemoveFiles" />
</InstallExecuteSequence>
Run Code Online (Sandbox Code Playgroud)

这不起作用.操作在Restart Manager会话之后完成.因此,重新启动管理器弹出并要求关闭我的应用程序和资源管理器.该操作稍后运行,但到那时应用程序已经消失.

那么我试过这个:

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallInitialize" />
    <Custom Action="CloseMyApp" Before="RemoveExistingProducts" />
</InstallExecuteSequence>
Run Code Online (Sandbox Code Playgroud)

这也行不通.行动太迟了.我也得到"警告LGHT1076:ICE63:某些操作属于InstallInitialize和RemoveExistingProducts.".

基本上 - 如何在卸载期间和Restart Manager会话之前执行自定义操作?

我猜我是否使用Impersonate ="no"它可能会在正确的时间运行,但这不是一个选项.这是因为新进程必须为必须关闭的进程运行相同的用户,因为它查找其窗口并发送消息.如果进程属于不同的用户,那就太麻烦了.

有任何想法吗?

install wix uninstall restart

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

PayPal折扣无法使其发挥作用

我正在尝试使用PayPal + Codeigniter设置整个购物车的折扣,我得到了这个工作没有折扣.

据我所知,我唯一需要做的就是设置一个隐藏字段discount_amount_cart,就像我在这里看到的一样

这是我的表格:

<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_form">
     <input type="hidden" name="rm" value="2" />
     <input type="hidden" name="cmd" value="_cart" />
     <input type="hidden" name="upload" value="1" />
     <input type="hidden" name="currency_code" value="EUR" />
     <input type="hidden" name="business" value="biz_1271300483_biz@xxxx.xx" />
     <input type="hidden" name="return" value="http://xxxxxx.com/website/pt/paypal/success/8/4c237a03897e0" />
     <input type="hidden" name="cancel_return" value="http://xxxxxxx.com/website/pt/paypal/cancel/8/4c237a03897e0" />
     <input type="hidden" name="notify_url" value="http://xxxxxx.com/website/pt/paypal/ipn" />
     <input type="hidden" name="custom" value="" />
     <input type="hidden" name="no_shipping" value="1" />
     <input type="hidden" name="cpp_header_image" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="image_url" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="invoice" value="4c237a03897e0" />
     <input type="hidden" …
Run Code Online (Sandbox Code Playgroud)

codeigniter paypal

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

JPA映射模型使用Composite-Keys返回null元素

我使用JPA构建了我的数据模型,并使用Hibernate的EntityManager 3来访问数据.我使用HSQLDB进行测试(junit).我正在将此配置用于其他类,并且没有任何问题.

但是,最新一批表使用复合键作为主键,并且在实现时无法从数据库中检索填充的行.我没有收到错误,查询只返回null对象.

例如,如果我查询(使用jsql)"FROM Order o"返回表中所有订单的列表,我的list.size()具有适当数量的元素(2),但元素为null.

我希望有一个比我更敏锐的人能够辨别出我做错了什么.提前致谢!

(简化)表定义为:

CREATE TABLE member (
    member_id INTEGER NOT NULL IDENTITY PRIMARY KEY);

CREATE TABLE orders (
    orders_id INTEGER NOT NULL,
    member_id INTEGER NOT NULL,
    PRIMARY KEY(orders_id, member_id));

ALTER TABLE orders 
    ADD CONSTRAINT fk_orders_member 
    FOREIGN KEY (member_id) REFERENCES member(member_id);
Run Code Online (Sandbox Code Playgroud)

实体POJO由以下定义:

@Entity
public class Member extends Person implements Model<Integer>{
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="MEMBER_ID", nullable=false)
    private Integer memberId;

    @OneToMany(fetch=FetchType.LAZY, mappedBy="member", cascade=CascadeType.ALL)
    private Set<Order> orderList;
}

@Entity
@Table(name="ORDERS")
@IdClass(OrderPK.class)
public class Order extends GeneralTableInformation implements Model<Integer>{

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY) …
Run Code Online (Sandbox Code Playgroud)

java orm spring hibernate jpa

5
推荐指数
2
解决办法
9200
查看次数

使用Swift发送HTML电子邮件

我想使用Swift从我的应用程序发送带有HTML正文的自动生成的电子邮件.

这是我目前的代码:

$message = Swift_Message::newInstance()
                ->setFrom(array('dummy1@test.com' => 'John Doe'))
                ->setTo('dymmy2@test.com')
                ->setSubject('some subject');

            $message->setBody($this->getPartial('global/mail_partial'));

            $this->getMailer()->send($message);
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用某些特定的Swift方法更改电子邮件消息的标题内容类型,但它无法正常工作.

email symfony1 swiftmailer

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

python断言有和没有括号

这里有四个简单的assert调用:

>>> assert 1==2
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AssertionError

>>> assert 1==2, "hi"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AssertionError: hi

>>> assert(1==2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AssertionError

>>> assert(1==2, "hi")
Run Code Online (Sandbox Code Playgroud)

请注意,最后一个不会引发错误.调用带或不带括号的断言会导致这种行为有什么区别?我的做法是使用括号,但上面的建议我不应该这样做.

python assert parentheses

91
推荐指数
4
解决办法
3万
查看次数

Registry GetSubKeyNames()列出了与Regedit不同的密钥?

我们正在使用WIX来安装我们创建的许多服务.我正在编写一个快速实用程序来转储当前安装的服务.我只是迭代以下的子键:

SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 
Run Code Online (Sandbox Code Playgroud)

寻找DisplayName.问题是,我的十项服务中只有两项出现在列表中.

但是,当我查看Regedit中的子键时,它们就在那里.同样,它们在已安装的程序中(我也可以在Win32_Product的SELECT*中找到它们).

我浏览了MSDN文档,试图找出是否有一些我错过的注册表的特殊视图.也许这是一个特权问题?但我正在以管理员身份运行该工具.是否有一些蜂巢安装问题?

为了清楚代码,这里是测试应用程序代码(来自这个答案):

String registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using(Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey))
{
  foreach(String subkeyName in key.GetSubKeyNames())
    Console.WriteLine(key.OpenSubKey(subkeyName).GetValue("DisplayName"));
}
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

c# registry wix

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