问题列表 - 第42510页

如何在Visual C#Express中使用NuGet?

当我使用Visual C#2010 Express时,如何使用NuGet添加库包引用?

当我在工具>扩展管理器中搜索时,NuGet没有出现.

我从下载页面下载了"NuGet Package Manager"(.vsix),但当它提示我要集成哪个版本的Visual Studio时,它只列出了Visual Web Developer Express 2010.Windows C#Express未显示.所以我想它可以在VWD中使用Silverlight,但我想在WPF中使用它.

其中一个文档页面将我链接到1.0 CTP下载页面,其中包括命令行版本的NuGet(不再出现在最新版本中).但命令行版本似乎已经瘫痪 - 它似乎支持的唯一操作是构建一个分发包; 它似乎不支持添加对库包的引用的命令.

有没有办法使用NuGet与Visual C#Express?

.net visual-studio-express nuget

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

Android布局 - 在ListView行内垂直堆叠两个TextView

我开始使用Fedor的ListView实现.这是我的ListView项的XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
      android:id="@+id/image"
      android:layout_width="50dip"
      android:layout_height="50dip" android:src="@drawable/stub" android:scaleType="centerCrop"/>
<TextView
      android:id="@+id/name"
      android:layout_width="0px"
      android:layout_height="0px"
      android:layout_weight="0" android:textSize="20dip" android:layout_marginLeft="10dip"/>
<TextView
      android:id="@+id/address"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1"  android:textSize="16dip" android:layout_marginLeft="10dip"/>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我在设备上看到的是ImageView和从左到右依次显示的两个TextView.

我想要的是右边的ImageView(这已经是正确的),imageview右侧的TextView名称(这是正确的),地址TextView,名称为TextView.我无法弄清楚如何正确布局.

请注意,我知道我可以在名称中添加一个新行,并在此之后包含地址文本,但我希望这两个元素具有不同的字体大小,因此这不是一个选项.非常感谢!

xml android android-layout android-xml

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

使用python unittest的抽象测试用例

是否有可能创建一个抽象TestCase,它将有一些test_*方法,但这TestCase不会被调用,那些方法只会在子类中使用?我想我将TestCase在我的测试套件中有一个摘要,它将被子类化为单个接口的一些不同实现.这就是为什么所有测试方法都是一些,只有一个内部方法发生变化的原因.我怎么能以优雅的方式做到这一点?

python unit-testing testcase

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

System.Net.PeerToPeer库有什么问题吗?

我一直在研究.NET 4.0中System.Net.PeerToPeer的命名空间,这个库中提供的类似乎对构建P2P网络非常有用.但是,当我搜索示例和引用时,我只能找到仅仅指向MSDN文档的旧的过时示例或引用.似乎没有太多人使用这个库,并且没有太多的努力进入这个产品.有没有人知道我不知道的这个库的问题可能会说服我不使用它?我确实看到旧版本的Windows不支持它,但这对我来说不是一个显示阻止.还有别的事吗?

.net c# networking p2p

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

将JavaScript文件移动到Magento的底部

我在page.xml中看到JavaScript文件在头部设置如下:

<default>
    <block type="page/html" name="root" output="toHtml" template="page/2columns-right.phtml">
        <block type="page/html_head" name="head" as="head">
            <action method="addJs"><script>prototype/prototype.js</script></action>
            <action method="addJs" ifconfig="dev/js/deprecation"><script>prototype/deprecation.js</script></action>
            <action method="addJs"><script>prototype/validation.js</script></action>
            <action method="addJs"><script>scriptaculous/builder.js</script></action>
            <action method="addJs"><script>scriptaculous/effects.js</script></action>
            <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
            <action method="addJs"><script>scriptaculous/controls.js</script></action>
            <action method="addJs"><script>scriptaculous/slider.js</script></action>
            <action method="addJs"><script>varien/js.js</script></action>
            <action method="addJs"><script>varien/form.js</script></action>
            <action method="addJs"><script>varien/menu.js</script></action>
            <action method="addJs" ifconfig="dev/translate_inline/active"><script>mage/translate.js</script></action>
            <action method="addJs"><script>mage/cookies.js</script></action>
            <action method="addCss"><stylesheet>css/screen.css</stylesheet></action>

            <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
            <action method="addItem"><type>skin_css</type><name>css/styles-ie8.css</name><params/><if>IE 8</if></action>

            <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
            <action method="addItem"><type>js</type><name>varien/iehover-fix.js</name><params/><if>lt IE 7</if></action>

            <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
            <block type="page/html" name="store_language_js" as="store_language_js" template="page/html/head-translator.phtml"/>
</default>
Run Code Online (Sandbox Code Playgroud)

但是,如果我想把它们移到底部,我会做以下几点吗?

<reference name="head">
    <action method="unsetData">
        <name>items</name>
    </action><!– There are now no CSS/JavaScript links in the head …
Run Code Online (Sandbox Code Playgroud)

javascript magento

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

赋予'use lib'的perl动态路径

所以,我的代码(Perl脚本和Perl模块)就像这样一棵树:

 trunk/  
   util/  
   process/  
   scripts/  
Run Code Online (Sandbox Code Playgroud)

'util'目录有实用程序,'process /'目录中的东西需要.他们像这样访问:

use FindBin;
use lib "$FindBin::Bin/../util";
use UtilityModule qw(all);
Run Code Online (Sandbox Code Playgroud)

只要你在树中与"util /"处于同一级别,那个结构并不关心你从哪里开始.
但我觉得'scripts /'过于拥挤,所以我创造了

   scripts/scripts1  
   scripts/scripts2  
Run Code Online (Sandbox Code Playgroud)

现在我看到这不起作用.如果我运行脚本'trunk/scripts/scripts1/call_script.pl',并且它调用'/trunk/process/process_script.pl',那么'process_script.pl'将无法尝试从UtilityModule()获取例程,因为FindBin返回的路径是顶级调用脚本的路径.

我想到的解决这个问题的前十种方法都涉及到:

use lib $path_that_came_from_elsewhere;
Run Code Online (Sandbox Code Playgroud)

但这似乎是Perl不喜欢做的事情,除了通过FindBin技巧.

我尝试了一些涉及BEGIN {}块的事情,但我真的不知道我在那里做什么,并且很可能最终会重构.但如果有人对这类问题有一些聪明的洞察力,那么这将是获得一些积分的好机会!

perl relative-path shared-libraries

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

用Django和South重命名应用程序

我正在将应用程序重命名为更合适的名称.在这样做时,我想确保South正确迁移数据库(重命名数据库表并更改django_content_type或south_migrationhistory中的引用).我知道如何将模型迁移到其他应用程序,但是当我尝试重命名应用程序本身时,South无法正确识别迁移历史记录.

不受欢迎的解决方案:在重命名时old_app,new_app我可以old_app/migrations完整保留并添加新的迁移到此目录以将数据库迁移到引用new_app.

如果可能的话我宁愿old_app完全删除目录.我还没有想过更好地解决这个问题.

使用Django South重命名应用程序而不丢失数据的最佳方法是什么?

migration django rename django-south

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

oracle中报告表的数据馈送(汇总vs分组集)

我有一个问题:

select country_region, 
       country_subregion, 
       country_name, 
       calendar_year, 
       calendar_quarter_number, 
       sum(amount_sold) as amount
  from countries co join
       customers cu on co.country_id = cu.country_id join
       sales sa on cu.cust_id = sa.cust_id join
       times ti on sa.time_id = ti.time_id
 where (   co.country_region = 'Americas' 
        or co.country_region = 'Middle East'
       ) 
   and ti.calendar_year between 2000 and 2001
group by grouping sets 
(
    (country_region, country_subregion, country_name, calendar_year, calendar_quarter_number),
    (country_region, country_subregion, country_name, calendar_year),
    (country_region, country_subregion, country_name),
    (country_region, country_subregion, calendar_year, calendar_quarter_number),
    (country_region, country_subregion, calendar_year),
    (country_region, country_subregion),
    (country_region, calendar_year, calendar_quarter_number), …
Run Code Online (Sandbox Code Playgroud)

sql oracle rollup

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

Android UI:TransitionDrawable

在代码中使用 TransitionDrawable 的预期方式是什么?有什么例子吗?

我制作了一个小型测试应用程序来奠定一些背景:

public class SkeletonActivity extends Activity {
    private Button b;
    private ImageView iv;
    private TransitionDrawable transition;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Inflate our UI from its XML layout description.
        setContentView(R.layout.skeleton_activity);

        // Hook up button presses to the appropriate event handler.
        b = ((Button) findViewById(R.id.button));
        b.setOnClickListener(mButtonListener);
        iv = ((ImageView) findViewById(R.id.image));

        //XML-based code
        transition = (TransitionDrawable)getResources().getDrawable(R.drawable.trans).mutate();
        transition.setDrawableByLayerId(transition.getId(0), getResources().getDrawable(R.drawable.trans3));
        transition.setDrawableByLayerId(transition.getId(1), getResources().getDrawable(R.drawable.trans4));

        //Pure programmatic code
        transition = new TransitionDrawable(new Drawable[] {getResources().getDrawable(R.drawable.trans3), getResources().getDrawable(R.drawable.trans4)});

        transition.setCrossFadeEnabled(true);
    }

    OnClickListener mButtonListener = new …
Run Code Online (Sandbox Code Playgroud)

user-interface android transition

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

JavaScript数组随机索引的插入和删除

我正在使用随机创建的索引将一些项插入到数组中,例如:

var myArray = new Array();
myArray[123] = "foo";
myArray[456] = "bar";
myArray[789] = "baz";
...
Run Code Online (Sandbox Code Playgroud)

换句话说,数组索引不以零开头,它们之间会有"数字间隙".我的问题是:

  • 这些数字间隙是否会以某种方式分配(因此需要一些内存),即使它们没有分配值?
  • 当我从上面的例子中删除myArray [456]时,这个项目下面的项目会被重新定位吗?

编辑:关于插入/删除后重新定位项目的问题/关注 - 我想知道内存发生了什么,而不是索引.来自维基百科文章的更多信息:

链接列表与动态数组相比有几个优点.在列表的特定点处插入元素是恒定时间操作,而在随机位置插入动态数组将需要平均移动一半元素,并且在最坏情况下移动所有元素.虽然可以通过某种方式将其插槽标记为"空闲"而在恒定时间内从数组中"删除"元素,但这会导致碎片阻碍迭代的执行.

javascript arrays

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