问题列表 - 第24206页

拆分统一配置文件

我需要将我的统一配置拆分为 n 个不同的文件,以便我可以将其中的一些文件选择到同一个统一容器中?

configuration-files unity-container

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

从浏览器中删除历史记录点

我们可以删除在Web浏览器中创建的历史记录点

或者,当单击示例链接"某个链接"并更改浏览器中的URL时,是否可能无法添加历史记录点

javascript jquery asp.net-ajax

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

从剪贴板粘贴并自动切换":set paste"

当我从剪贴板粘贴东西时,它们通常(总是)是多线的,在那些情况下(仅限那些情况),我想:set paste被触发,因为否则每一行的标签都会增加(你们都是看过!).

虽然问题:set paste在于它表现不佳set smartindent,导致光标跳转到新行的开头而不是正确的缩进.所以我只想为这个实例启用它.

我正在使用Mac,使用Vim sshing到Debian机器,因此使用cmd+ 在插入模式下粘贴v.

vim paste

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

没有www,jQuery ajax不适用于url

如果url没有www,下面的jQuery ajax脚本在我的网站上不起作用.我检查了Firebug并且它没有发送ajax调用.

$.ajax(
    {
        type: "POST",
        url: "http://www.mysite.com/beta/products.php",
        data: "page_type=index&sort=relevancerank&CartId=<?php echo $CartId;?>&HMAC=<?php echo $HMAC;?>",
        success: function(msg)
        {
            $('#content-holder').html(msg);

        },
        error: function()
        {
            alert("An error occurred while updating. Try again in a while");
        }
    });
Run Code Online (Sandbox Code Playgroud)

javascript ajax url jquery

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

从工作线程但不是主线程访问时,C# - 类字段为null

不确定我做错了什么:

class MyClass
{

    private EventInfo eventInfo;

    public void OnGenerateEvent(object sender, EventArgs e)
    { 
        // Called from *main* thread 

        // Load assembly and set eventInfo here
        eventInfo = ....GetEvent(...);
        eventInfo.AddEventHandler(source, handler);

        // Call to a static method in another assembly
        someMethodInfo.Invoke(null, null);

    }


    public void OnEventChanged(object sender, EventArgs args)
    {    
        // Called from a *worker* thread created 
        // by that static method in the other assembly

        eventInfo is null here !   

        // Trying to remove handler
        eventInfo.RemoveEventHandler(.....);

    }


    // But... …
Run Code Online (Sandbox Code Playgroud)

c# multithreading delegates invoke worker

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

沿着圆形路径的UIView动画?

我需要让我的小家伙(在UIIamgeView中)向前跳,它必须看起来很自然.我想知道有没有办法用CoreAnimation(beginAnimation/commitAnimation)做到这一点?

我可以通过在空中设置一个点来做到这一点,但运动看起来不自然:P

iphone core-animation uiview uiimageview

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

如何打包和部署Eclipse Java应用程序

在我开始之前,我是新的日食,请在回复时记住这一点.:)

在这种情况下,我已经构建了一个具有一些依赖关系的java应用程序(大约10个).我想轻松打包这个应用程序并将其作为单个文件部署到CD或USB驱动器.

我的问题是,似乎没有任何"好"的向导来搜索项目,获取依赖关系并在目标计算机上设置类路径.在我看来,我必须手动执行此操作.

有没有更好的办法.简单,容易和直接的东西.关于这个教程的链接会很棒.

在我看来,这应该是eclipse的内置功能.部署Web应用程序似乎很容易,但不是Java应用程序.

谢谢!

java eclipse deployment desktop-application

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

换行符在UILabel中不起作用

我正在从plist中加载一些帮助文本,并以UIScrollView中的UILabel形式显示相同的文本.代码的部分如下:

    UILabel *sectionDetailLabel = [[[UILabel alloc] initWithFrame:CGRectMake(34, myOriginForThisSection, 286, 20)] autorelease];
    sectionDetailLabel.backgroundColor = [UIColor clearColor];
    sectionDetailLabel.numberOfLines = 0;
    sectionDetailLabel.font = [UIFont systemFontOfSize:12];
    sectionDetailLabel.textColor = [UIColor blackColor];
    sectionDetailLabel.textAlignment = UITextAlignmentLeft;
    sectionDetailLabel.lineBreakMode = UILineBreakModeWordWrap;

    [baseScrollView addSubview:sectionDetailLabel];

    [sectionDetailLabel setText:myStringForThisSection];
    [sectionDetailLabel sizeToFit];
Run Code Online (Sandbox Code Playgroud)

虽然任何"长"文本都被正确地包装成多行,但我无法使用'myStringForThisSection'中的换行符'\n'来手动插入任何换行符.我只看到UILabel中打印的字符'\'和'n',而不是我想要的换行符.

我查了一下,普遍的共识似乎是将numberOfLines设置为0,将lineBreakMode设置为有效值并调用sizeToFit(或根据sizeWithFont :)设置UILabel的框架应该这样做.我似乎在上面的代码中做了所有这些 - 并且在将未知长度的长字符串装入UILabel上的多行时非常有效.那么这里可能缺少什么?

注意:在上面的代码开始执行之前加载了所有使用的变量 - baseScrollView,myStringForThisSection和myOriginForThisSection,并且工作正常.

iphone formatting uilabel

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

如何判断Socket何时断开连接

在客户端,我需要知道何时/如果我的套接字连接已被破坏.但是,即使服务器端已断开连接并且我已尝试通过它发送数据,Socket.Connected属性也始终返回true.任何人都可以帮我弄清楚这里发生了什么.我需要知道套接字何时断开连接.

        Socket serverSocket = null;
        TcpListener listener = new TcpListener(1530);
        listener.Start();
        listener.BeginAcceptSocket(new AsyncCallback(delegate(IAsyncResult result)
        {
            Debug.WriteLine("ACCEPTING SOCKET CONNECTION");
            TcpListener currentListener = (TcpListener)result.AsyncState;
            serverSocket = currentListener.EndAcceptSocket(result);
        }), listener);


        Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        Debug.WriteLine("client socket connected: " + clientSocket.Connected);//should be FALSE, and it is
        clientSocket.Connect("localhost", 1530);
        Debug.WriteLine("client socket connected: " + clientSocket.Connected);//should be TRUE, and it is

        Thread.Sleep(1000);
        serverSocket.Close();//closing the server socket here
        Thread.Sleep(1000);

        clientSocket.Send(new byte[0]);//sending data should cause the socket to update its Connected property.
        Debug.WriteLine("client socket connected: …
Run Code Online (Sandbox Code Playgroud)

.net c# sockets

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

如何在NSString中转义unicode字符?

当我在一些NSDictionary中存储NSString并将该字典记录到控制台时,如下所示:

NSString *someString = @"Münster";  
NSDictionary *someDict = [ NSDictionary dictionaryWithObjectsAndKeys: 
    someString, @"thestring" ];
NSLog ( @"someDict: %@", [ someDict description ] );
Run Code Online (Sandbox Code Playgroud)

控制台输出如下所示:

unicode_test[3621:903] someDict:
{
    thestring = "M\U00fcnster";
}
Run Code Online (Sandbox Code Playgroud)

字符串的unicode字符转义.是否有任何方法可以将NSString转换为此转义表示形式?

unicode cocoa escaping nsstring

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