问题列表 - 第31116页

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

MSI安装程序文件名中的exe版本(VS 2010)

是否有可能使Visual Studio 2010安装程序输出文件名,包含exe版本,如"setup [MajorExeVersion] [MinorExeVersion] .msi"?

谢谢!

.net installer windows-installer visual-studio-2010

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

使用Python检索类似Facebook的链接摘要(标题,摘要,相关图像)

我想复制Facebook用来解析链接的功能.当您向Facebook状态提交链接时,他们的系统会退出并检索建议的内容title,summary并且通常会image从该页面中检索一个或多个相关内容,您可以从中选择缩略图.

我的应用程序需要使用Python来实现这一点,但我对任何类型的指南,博客文章或与此相关的其他开发人员的经验持开放态度,并可能帮助我弄清楚如何实现它.

我真的想在跳入之前先学习别人的经验.

要明确的是,当给出网页的URL时,我希望能够检索:

  1. 标题:可能只是<title>标签,但可能是<h1>,不确定.
  2. 页面的一段摘要.
  3. 一堆可以用作缩略图的相关图像.(棘手的部分是过滤掉不相关的图像,如横幅或圆角)

我可能必须自己实现它,但我至少想知道其他人是如何做这些任务的.

python facebook screen-scraping summary semantics

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

vim phpdoc multiline comment autoindent

假设我有一个这样的评论块:

/**
 * comment
 * comment
 * comment
 */
Run Code Online (Sandbox Code Playgroud)

当我在这个块中打开一个新行时,我希望vim启动它

/**
 * comment
 * _
 * comment
 * comment
 */
Run Code Online (Sandbox Code Playgroud)

但是标准(ubuntu)vim脚本中的autoindent开始一个空行,如下所示:

/**
 * comment
 _
 * comment
 * comment
 */
Run Code Online (Sandbox Code Playgroud)

是否有一个修改过的脚本或命令会使vim这样做(我记得几年前我有这个功能,但现在不能google)?

TIA.

vim phpdoc auto-indent

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

如果问题有点

以下代码:

<?php
$str = "19.09.02";
if(substr($str, -3, 2) == ".0")
{
    // Doing something
}

$str2 = "19.09.2002";
if(substr($str2, -3, 2) == ".0")
{
    // Doing something
}
?>
Run Code Online (Sandbox Code Playgroud)

为什么第二个语句适用(没有正则表达式)?我怎么解决,它只是应用第一个表达式?

谢谢

php

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

加速Oracle Text索引或让索引器仅在低负载时间工作

我们使用Oracle Text CTXSYS.CONTEXT索引来索引包含元信息的大约50万行.信息分布在两个表中,这两个表由索引器在运行时调用的过程(功能索引)组合在一起.

当我在本地机器(简单的双核笔记本)上运行CREATE INDEX时,索引在大约3分钟内构建.在我们的数据库服务器上运行在具有8个内核和16G内存的Solaris上,需要24小时才能为相同(完全相同)的数据创建索引.

示例代码: 这是两个表和3列的索引进纸器:

create or replace procedure docmeta_revisions_text_feeder 
    ( p_rowid in rowid , p_clob in out nocopy clob) as v_clob CLOB begin
    FOR c1 IN (select DM.DID, DM.XDESCRIB || ' ' || DM.XAUTHOR AS data
        from DOCMETA DM
        WHERE ROWID = p_rowid) 
    LOOP
        v_clob := v_clob || c1.data;
        FOR c2 IN (
            SELECT ' ' || RV.DDOCTITLE AS data
            FROM   REVISIONS RV
            WHERE  RV.DID = c1.DID)
        LOOP
            v_clob := v_clob || c2.data;
        END LOOP;
    END LOOP; …
Run Code Online (Sandbox Code Playgroud)

oracle full-text-indexing database-tuning

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

我可以设置一个模拟来始终返回其中一个参数中给出的对象吗?

我可以设置一个模拟对象来始终返回作为参数给出的对象吗?我有一个方法

public MyObject DoSomething(MyObject obj)
Run Code Online (Sandbox Code Playgroud)

我希望有一个模拟,它总是为每次调用DoSomething返回obj,有点像这样:

mock.Stub(x=>x.DoSomething(Arg<MyObject>.Is.Anything).Return(Arg<MyObject>)
Run Code Online (Sandbox Code Playgroud)

虽然我不确定在返回位置放什么......

编辑:我试过这个:

 MyObject o=null;
 mock.Stub(x=>x.DoSomething(Arg<MyObject>.Is.Anything).WhenCalled (y=>
 {
    o = y.Arguments[0] as MyObject;
 }).Return (o);
Run Code Online (Sandbox Code Playgroud)

这看起来似乎很有希望,但没有运气.发布它以防它慢慢某人的记忆......

rhino-mocks

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

创建快捷方式:如何使用drawable作为Icon?

下面是我的代码,用于创建所选应用程序的快捷方式.我真的没问题,应用程序工作得很好.

问题是我能够从我的应用程序创建一个带有ressource的快捷方式:

    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.drawable.icon));
Run Code Online (Sandbox Code Playgroud)

但我真的想要一个定制的drawable.(Drawable myDrawable = .....)

我能怎么做?

   ResolveInfo launchable=adapter.getItem(position);
   final Intent shortcutIntent = new Intent();
    ActivityInfo activity=launchable.activityInfo;
    ComponentName name=new ComponentName(activity.applicationInfo.packageName,activity.name);       
    shortcutIntent.setComponent(name);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    final Intent intent = new Intent();
    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
    // Sets the custom shortcut's title
    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, launchable.loadLabel(pm));
    // Set the custom shortcut icon
    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.drawable.icon));

    // add the shortcut
    intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
    sendBroadcast(intent);
    finish();
Run Code Online (Sandbox Code Playgroud)

非常感谢任何线索

icons android shortcut drawable android-intent

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

如何在C#中使用FTP列出目录内容?

如何在C#中使用FTP列出目录内容?

我使用下面的代码用FTP列出目录内容它以XML格式返回结果,但我只想要目录的名称而不是整个内容.

我怎么能这样做?

public class WebRequestGetExample
{
    public static void Main ()
    {
        // Get the object used to communicate with the server.
        FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.contoso.com/");
        request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;

        // This example assumes the FTP site uses anonymous logon.
        request.Credentials = new NetworkCredential ("anonymous","janeDoe@contoso.com");

        FtpWebResponse response = (FtpWebResponse)request.GetResponse();

        Stream responseStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(responseStream);
        Console.WriteLine(reader.ReadToEnd());

        Console.WriteLine("Directory List Complete, status {0}", response.StatusDescription);

        reader.Close();
        response.Close();
    }
}
Run Code Online (Sandbox Code Playgroud)

MSDN

.net c# ftp directory-listing

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

是否有可能在ASP.NET Webforms中实现HTML5等新标准?

是否可以(使用HTML5 Shiv)在基于Webforms的平台上实现HTML5?ASP.NET Webforms是否允许开发人员使用新的HTML5元素在语义上标记页面?

asp.net standards html5 semantics

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