问题列表 - 第33001页

指南针在Win上使用Compass项目目录之外的相对路径

我在现有网站上使用Sass并决定让Winass在Win7x64上运行.Ruby,HAML,指南针都安装得很好(afaik).

我有一个项目,c:\project其中包含一个静态文件c:\project\static,其目录结构必须保持不变.我进去c:\project\static跑了这个:

compass create css-compass
Run Code Online (Sandbox Code Playgroud)

这导致了以下的dir结构

c:\project\static\css (previously existed; output css)
c:\project\static\css-sass (previously existed; source css)
c:\project\static\css-compass (the new compass dir created by compass)    
Run Code Online (Sandbox Code Playgroud)

这是我的config.rb:

# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "..\\css"
sass_dir = "..\\css-sass"
images_dir = "images"
javascripts_dir = "javascripts"
Run Code Online (Sandbox Code Playgroud)

当我去c:\project\static运行时compass watch compass-css,我收到以下错误:

无需编译.如果您正在尝试启动一个新项目,那么您已经离开了目录参数.运行"compass -h"获取帮助.

不过,如果我中创建符号链接c:\project\static\css-compasscss->..\css和 …

css sass compass-sass

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

使用故事板动画进行鼠标悬停和WPF ListBoxItems中的选择

我有一个WPF应用程序,它有一个列表框,我正在尝试应用一些鼠标悬停效果.当我使用简单的Setters来改变鼠标悬停/选择时的背景颜色时,一切正常,但我认为如果它在状态之间动画会看起来更好,所以我将Setters 切换为进入/退出Storyboards.这一切都很好地工作(鼠标悬停动画输入和输出,选择动画输入和输出),但一旦选择了某些内容然后被取消,它将永远不会再次执行鼠标悬停效果.

这是显示问题的最小代码示例:

<Window x:Class="WpfTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="500" Width="500">
  <Window.Resources>
    <Style x:Key="ListboxItemStyle" TargetType="{x:Type ListBoxItem}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type ListBoxItem}">
            <Border x:Name="border" BorderThickness="1" Height="50" Background="#000">
              <ContentPresenter />
            </Border>
            <ControlTemplate.Triggers>
              <MultiTrigger>
                <MultiTrigger.Conditions>
                  <Condition Property="IsMouseOver" Value="True" />
                  <Condition Property="IsSelected" Value="False" />
                </MultiTrigger.Conditions>
                <MultiTrigger.EnterActions>
                  <BeginStoryboard>
                    <Storyboard>
                      <ColorAnimation Duration="0:0:0.15" Storyboard.TargetName="border"
                          Storyboard.TargetProperty="Background.Color" To="#00F" />
                    </Storyboard>
                  </BeginStoryboard>
                </MultiTrigger.EnterActions>
                <MultiTrigger.ExitActions>
                  <BeginStoryboard>
                    <Storyboard>
                      <ColorAnimation Duration="0:0:0.3" Storyboard.TargetName="border"
                          Storyboard.TargetProperty="Background.Color" To="#008" />
                    </Storyboard>
                  </BeginStoryboard>
                </MultiTrigger.ExitActions>
              </MultiTrigger>
              <Trigger Property="IsSelected" Value="True">
                <Trigger.EnterActions>
                  <BeginStoryboard>
                    <Storyboard>
                      <ColorAnimation Duration="0:0:0.15" …
Run Code Online (Sandbox Code Playgroud)

.net wpf animation listbox storyboard

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

如何在Java中获取受信任的根证书列表?

我希望能够在Java应用程序中以编程方式访问所有受信任的根证书.

我正在查看密钥库接口,但我希望得到JRE隐含的可信根列表.

这可以随处访问吗?

java certificate keystore

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

如何在方法模板中使用模板类型的pass-by-reference参数?

我目前正在努力获得以下代码进行编译.首先是包含带有方法模板的类的头文件:

// ConfigurationContext.h

class ConfigurationContext
{
    public:
    template<typename T> T getValue(const std::string& name, T& default) const
        {
            ...
        }
}
Run Code Online (Sandbox Code Playgroud)

在其他地方,我想这样称呼这个方法:

int value = context.getValue<int>("foo", 5);
Run Code Online (Sandbox Code Playgroud)

在那里我收到以下错误:

error: no matching function for call to 'ConfigurationContext::getValue(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int)'
Run Code Online (Sandbox Code Playgroud)

我检查了明显的错误,比如丢失包含和类似的东西.但一切似乎都是正确的.我尝试删除模板类型参数的pass-by-reference,如下所示:

template<typename T> T getValue(const std::string& name, T default) const ...
Run Code Online (Sandbox Code Playgroud)

然后它编译没有任何错误,也运行良好,但我仍然想在这里传递一个参考...

有谁知道这里发生了什么以及如何使这项工作?

c++ methods templates pass-by-reference

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

无法更新标签文本

环境:

  • 使用Glade3构建界面.
  • 后端是使用GTK + Builder库用Python编写的.

-

虽然我知道我需要用来更新标签文本的方法(label.set_text("string")),但我在python代码中获取标签对象时遇到了麻烦.

这是我的代码的样子:

#!/usr/bin/python
# Filename: HelloPython.py
# Author: Andrew Hefley Carpenter
# Date: 18 August 2010

import sys
import gtk

class HelloPython:

    def on_window_destroy(self, widget, data=None):
        gtk.main_quit()

    def __init__(self):

        builder = gtk.Builder()
        builder.add_from_file("HelloPython.xml") 

        self.window = builder.get_object("window")
        builder.connect_signals(self)   

    def on_button1_clicked(self, widget):

        print "Hello World!"  
        widget.set_label("Hello World!")
        #I'd like to update 

if __name__ == "__main__":
    editor = HelloPython()
    editor.window.show()
    gtk.main()
Run Code Online (Sandbox Code Playgroud)

最终目标:我想在回调"对象Y"(在本例中为button1)之后使用它的set_text方法更新"对象X",由"on_button1_clicked"处理

python gtk user-interface pygtk

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

如何定义"类型析取"(联合类型)?

已经一个方法被提出来处理的重载方法双定义是,以取代与模式匹配超载:

object Bar {
   def foo(xs: Any*) = xs foreach { 
      case _:String => println("str")
      case _:Int => println("int")
      case _ => throw new UglyRuntimeException()
   }
}
Run Code Online (Sandbox Code Playgroud)

这种方法要求我们放弃对参数的静态类型检查foo.能够写作会好得多

object Bar {
   def foo(xs: (String or Int)*) = xs foreach {
      case _: String => println("str")
      case _: Int => println("int")
   }
}
Run Code Online (Sandbox Code Playgroud)

我可以接近Either,但它有两种以上的快速变得难看:

type or[L,R] = Either[L,R]

implicit def l2Or[L,R](l: L): L or R = Left(l)
implicit def r2Or[L,R](r: R): L or R = …
Run Code Online (Sandbox Code Playgroud)

scala

175
推荐指数
12
解决办法
4万
查看次数

mshtml.dll版本为8.0,Microsoft.mshtml为7.0

我有点困惑,也许你可以帮助我.

我有mshtml.dll(版本8.0)和Microsoft.mshtml.dll(版本7.0)

如果我去添加对我的WPF项目的引用并尝试添加mshtml.dll,它会告诉我引用必须是有效的程序集或com组件.这是正确的,因为我知道我必须添加对Microsoft.mshtml.dll的引用,因为它是mshtml.dll的包装器,我是对的吗?

现在,我的mshtml.dll版本是8.0,Microsoft.mshtml是7.0.

我在哪里可以找到8.0版本的Microsoft.mshtml.dll?

如果我添加了Microsoft.mshtml.dll的7.0,它将运行mshtml 8 dll的功能?

他们为什么不同?

非常感谢Jayson

mshtml microsoft.mshtml

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

帮助理解magic_quotes_gpc()

我正在从教程中学习这个PHP代码来上传文件

<form method="post" enctype="multipart/form-data">
  <input name="userfile" type="file" id="userfile">  
</form>

<?php
  if (isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) {
    $fileName = $_FILES['userfile']['name'];
    $tmpName  = $_FILES['userfile']['tmp_name'];
    $fileSize = $_FILES['userfile']['size'];
    $fileType = $_FILES['userfile']['type'];

    $fp      = fopen($tmpName, 'r');
    $content = fread($fp, filesize($tmpName));
    $content = addslashes($content);
    fclose($fp);

   if (!get_magic_quotes_gpc()) {
     $fileName = addslashes($fileName);
   }

   include 'library/config.php';
   include 'library/opendb.php';

   $query = "INSERT INTO upload (name, size, type, content ) ".
     "VALUES ('$fileName', '$fileSize', '$fileType', '$content')";

   mysql_query($query) or die('Error, query failed');
   include 'library/closedb.php';
Run Code Online (Sandbox Code Playgroud)

现在我通过使用PHP文档了解每个功能和一切

除了

get_magic_quotes_gpc()
Run Code Online (Sandbox Code Playgroud)
  • 它是什么?它能做什么?
  • 这是否具有潜力?如果是,是否有替代品? …

php security function manual

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

编译x64代码时,"x86_amd64"和"amd64"之间有什么区别?

使用VC++编译代码时,MSDN为您提供了使用x86_amd64工具集或amd64工具集(调用vcvarsall.bat时)之间的选项.

编译x64代码时如何在这两者之间进行选择?amd64选项是否会产生比交叉编译器更高效的x64机器代码?

compiler-construction 64-bit visual-studio-2010 visual-c++

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

Wix/MSI:无法卸载

我为内部项目开发了一个Wix安装程序,但完全不小心我发现我无法卸载开发计算机上的安装程序,因为我收到以下错误消息:

您尝试使用的功能是在不可用的网络资源上

带有一个对话框,指向我从特征中安装的.msi路径.(.msi在那里,但是已经重建了,因此我安装后已经改变了)

我很担心这个对话框,因为我相信Windows Installer会跟踪已安装的.MSI文件,但是这个对话框似乎暗示我可以通过删除,移动或更改安装程序来破坏我的卸载程序.

是这样的吗?

我需要做些什么来确保我不会以这种方式破坏我的卸载程序?(我们是否需要保留计算机上安装的所有安装程序版本的副本?)

windows-installer wix uninstall

11
推荐指数
2
解决办法
4970
查看次数