问题列表 - 第29499页

如何让hg在cygwin/windows上提示我的HTTP auth用户名/密码?

在家里,这很完美.我现在在另一台计算机上(使用cygwin)并且hg push不会提示输入用户名/密码:

user@localhost /cygdrive/d/repos/upthescala/viewprotect
$ hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
abort: http authorization required
Run Code Online (Sandbox Code Playgroud)

这是我的〜/ .hgrc的内容:

[http_proxy]
host=someproxy:8080

[ui]
username = My Name <myemail>
Run Code Online (Sandbox Code Playgroud)

提前感谢任何建议!

注意:这似乎是一个cygwin问题.当我从Windows提示符(cmd.exe)尝试时,它按预期工作:

D:\repos\upthescala\viewprotect>hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
http authorization required
realm: Google Code Mercurial Repository
user: myemailaddress
password: *********

remote: Success.
Run Code Online (Sandbox Code Playgroud)

- LES

authentication mercurial push

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

如何根据ASP.NET中该行的值数据绑定在我的转发器中设置表格行颜色?

我有一个转发器控件:

 <table style="width: 100%">
     <asp:Repeater runat="server" ID="rptOptions" OnItemDataBound="rptOptions_ItemDataBound">
                                <HeaderTemplate>
                                    <tr>
                                        <td class="GridHeader">Account</td>    
                                        <td class="GridHeader">Margin</td>  
                                        <td class="GridHeader">Symbol</td>  
                                        <td class="GridHeader">Price</td> 
                                    </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td class="GridRow"><asp:Label runat="server" ID="lblOptionAccount"></asp:Label></td>
                                        <td class="GridRow"><asp:Label runat="server" ID="lblOptionMargin"></asp:Label></td>
                                        <td class="GridRow"><asp:Label runat="server" ID="lblOptionSymbol"></asp:Label></td>
                                        <td class="GridRow"><asp:Label runat="server" ID="lblOptionPrice"></asp:Label></td>
                                    </tr>
                                </ItemTemplate>
                             </asp:Repeater>
                        </table>
Run Code Online (Sandbox Code Playgroud)

以下代码隐藏数据绑定方法:

protected void rptOptions_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Option rowOption = (Option)e.Item.DataItem;

                ((Label)e.Item.FindControl("lblOptionAccount")).Text = rowOption.Account;
                ((Label)e.Item.FindControl("lblOptionMargin")).Text = rowOption.Margin ? "Y" : "N";
                ((Label)e.Item.FindControl("lblOptionSymbol")).Text = rowOption.Symbol;
                       ((Label)e.Item.FindControl("lblOptionPrice")).Text = rowOption.Price.ToString("C", currencyFormat); …
Run Code Online (Sandbox Code Playgroud)

html c# asp.net repeater

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

字符串操作 - 从字符串中删除char

我目前在java中有以下字符串:

"Blah, blah, blah,~Part One, Part Two~,blah blah"
Run Code Online (Sandbox Code Playgroud)

我需要删除~字符之间的逗号,以便读取.

"Blah, blah, blah,~Part One Part Two~,blah blah"
Run Code Online (Sandbox Code Playgroud)

有人可以帮帮我吗?

非常感谢,

java regex string

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

在方法中获取请求泛型类型

我有一个返回泛型类型的方法,有没有办法检索值<T>而不必通过参数给出这个?

public <T> T getObject(String location, String method)
{
    // ! Here I want to retrieve the class of T
    Class<?> requestedClass = getMeTheClassThatWasRequested();

    return requestedClass;
}
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

java generics reflection

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

使winforms可调整大小的最佳方法是什么?

我正在开发一个带有很多winforms的大型c#项目,即使你可以调整表单大小,表单中的元素也不会缩放.

当用户更改表单的大小时,如何使表单元素(例如datagridview,文本区域等)缩放.

几乎所有的表单都是从一个特定的表单中继承的,所以如果我能在基类中做些什么,那就太好了.

c# .net-3.5 winforms

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

在没有实例化新类的情况下重用函数的最简单方法

我目前有一个看起来像这样的功能:

public void AnimateLayoutTransform(object ControlToAnimate)
{
//Does some stuff
}
Run Code Online (Sandbox Code Playgroud)

我在很多不同的项目中使用这个函数,所以我希望它是非常可重用的.所以现在我将它放在.cs文件中,包含在命名空间和类中:

namespace LayoutTransformAnimation
{
    public class LayoutAnims
    {
        public void AnimateLayoutTransform(object ControlToAnimate)
        {
            //Do stuff
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这个问题是在给定的项目中使用这个函数,我必须做类似的事情

new LayoutTransformAnimation.LayoutAnims().AnimateLayoutTransform(mygrid);
Run Code Online (Sandbox Code Playgroud)

重用单个函数似乎需要做很多工作.有没有办法,至少在没有创建类的新实例的情况下使用该函数?类似于我们如何Double.Parse()创建一个新的double

c# visual-studio-2008 visual-studio

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

如何在vanilla GWT中隐藏模态对话框后面的当前页面?

我已经构建了一个登录组合,我在我的应用程序入口点显示给用户.在输入用户名和密码后,我将通过RemoteService将用户名和密码发送到服务器,并将收到包含ClientSession的对象.如果ClientSession是有效对象(已识别的用户名和密码),我希望显示主应用程序面板,否则我想再次显示登录对话框(带有错误消息).

我的问题是,在异步调用服务器期间,如何屏蔽屏幕,以便用户在从服务器获取会话时无法点击任何内容?

我知道登录应该很快,但Session对象包含用于生成主面板的当前用户的许多客户端缓存值.这可能需要几分之一秒或最多5秒(遗憾的是我无法控制底层基础设施的速度)所以我想屏蔽屏幕直到达到超时然后允许用户再次尝试.

在使用GWT Ext之前我已经完成了这个确切的操作,但不幸的是,vanilla GWT似乎有更少的样本.

谢谢

克里斯

user-interface gwt login

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

使用nginx返回自定义403错误页面

我试图在发生403错误时在/temp/www/error403.html中显示错误页面.

这应该是每当用户尝试通过https(ssl)访问该站点并且它的IP位于blovkips.conf文件中时,但此时它仍然显示nginx的默认错误页面.我有其他服务器相同的代码(没有任何阻止),它的工作原理.

是否阻止IP访问自定义403页面?如果是这样,我如何让它工作?

server  {
    # ssl
    listen               443;
    ssl                  on;
    ssl_certificate      /etc/nginx/ssl/site.in.crt;
    ssl_certificate_key  /etc/nginx/ssl/site.in.key;
    keepalive_timeout    70;

    server_name localhost;


    location / {
            root   /temp/www;
            index  index.html index.htm;
}

# redirect server error pages to the static page
error_page   403  /error403.html;
# location = /error403.html {
#         root   /temp/www;
# }

    # add trailing slash if missing
    if (-f $document_root/$host$uri) {
            rewrite ^(.*[^/])$ $1/ permanent;
    }      

    # list of IPs to block
    include blockips.conf;
}
Run Code Online (Sandbox Code Playgroud)

编辑: 更正了错误页面代码从504到403,但我仍然有同样的问题

webserver nginx custom-error-pages http-status-code-403

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

cakePHP - before_filter未执行

我在app/controller中有以下app_controller.

从不执行测试功能.如果我放入子类控制器,它也没有在那里执行.难道我做错了什么?

class AppController extends Controller {
 var $beforeFilter = array('test');

 function test() {
  var_dump('test');
  die();
 }

}
Run Code Online (Sandbox Code Playgroud)

cakephp

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

selectSingleNode工作但不是selectNodes

使用Javascript:

var req=xmlDoc.responseXML.selectSingleNode("//title");
alert(req.text);
Run Code Online (Sandbox Code Playgroud)

按预期,返回第一个"标题"节点的文本.

但是这个

var req=xmlDoc.responseXML.selectNodes("//title");
alert(req.text);
Run Code Online (Sandbox Code Playgroud)

返回"未定义".下列:

var req=xmlDoc.responseXML.selectNodes("//title").length;
alert(req);
Run Code Online (Sandbox Code Playgroud)

返回"2" 我不明白.也许当我选择节点时,它没有获得标题内的文本节点.这是我现在的猜测......这是xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog SYSTEM "catalog.dtd">
<catalog>
<decal>
<company>Victor</company>
<title>Wood Horn Blue Background</title>
<image>
<url>victor01.jpg</url>
<width>60</width>
<height>60</height>
<name>Wood Horn Blue Background</name>
<link></link>
</image>
<price>$15.00</price>
<instock>In Stock</instock>
<notes>no extra info</notes>
</decal>
<decal>
<company>Victor</company>
<title>Wood Horn without Black Ring</title>
<image>
<url>victor02.jpg</url>
<width>60</width>
<height>60</height>
<name>Wood Horn Without Black Ring</name>
<link></link>
</image>
<price>$15.00</price>
<instock>In Stock</instock>
<notes>no extra info</notes>
</decal>
</catalog>
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript internet-explorer xmlhttprequest selectnodes selectsinglenode

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