走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-08-28 08:15:05

mimetic 声称支持它。我认为 GNU cgicc 也可能支持它。

mimetic claims to support it. I think GNU cgicc may also support it.

C 或 C++ 中是否有轻量级的多部分/表单数据解析器?

走过海棠暮 2024-08-27 22:42:41

jQuery:

    $(function(){
     $("a:first").bind("click",function(){
         $("div").append("<span>Link</span>");
        $(this).remove(); 
    });
       $("a:last").bind("click",function(){
    $(this).prev().find("span").wrap("<a href=#>");
    });
});

HTML:

<body>
<div><a href="#">Link</a></div>
<a href="#">Link2</a>
</body>

Jquery:

    $(function(){
     $("a:first").bind("click",function(){
         $("div").append("<span>Link</span>");
        $(this).remove(); 
    });
       $("a:last").bind("click",function(){
    $(this).prev().find("span").wrap("<a href=#>");
    });
});

HTML:

<body>
<div><a href="#">Link</a></div>
<a href="#">Link2</a>
</body>

JQuery 添加/删除链接

走过海棠暮 2024-08-27 19:26:38

我认为您指的是标题中链接标记内的引用?

如果是这种情况,我认为最好的解决方案是使用 Url.Conent,这样您的链接标记将类似于:

<link href="<%=Url.Content( "~/Content/Site.css" ) %>" rel="stylesheet" type="text/css" />

这样,无论用户查看的 url 是什么,对样式表的引用始终是正确的。

I think your referring to the reference within link tag in your header?

If this is the case the best solution in my opinion is to use Url.Conent so your link tag will look something like:

<link href="<%=Url.Content( "~/Content/Site.css" ) %>" rel="stylesheet" type="text/css" />

That way no matter what the url the user is viewing the reference to the style sheet is always correct.

如何将css类应用到根文件夹?

走过海棠暮 2024-08-27 18:35:52

如果您的图像纯粹是装饰性的,那么将其用作背景图像可能是一个更具语义的解决方案。然后,您可以指定背景的位置。

background-position: center center;

如果它不是装饰性的并且构成有价值的信息,那么 img 标签是合理的。在这种情况下,您需要做的是使用以下属性设置包含 div 的样式:

div{
    display: table-cell; vertical-align: middle 
}

了解有关此技术的更多信息在这里。据报告不适用于 IE6/7(适用于 IE8)。

if your image is purely decorative, then it might be a more semantic solution to use it as a background-image. You can then specify the position of the background

background-position: center center;

If it is not decorative and constitutes valuable information then the img tag is justified. What you need to do in such case is style the containing div with the following properties:

div{
    display: table-cell; vertical-align: middle 
}

Read more about this technique here. Reported to not work on IE6/7 (works on IE8).

如何使用 CSS 将 HTML 中的 div 元素内的图像垂直居中?

走过海棠暮 2024-08-27 15:33:56

在 BOM 的 Wikipedia 页面底部引用:http://en.wikipedia。 org/wiki/Byte-order_mark#cite_note-2

“UTF-8 既不需要也不建议使用 BOM,但在从使用 BOM 的其他编码形式转换 UTF-8 数据或将 BOM 用作 UTF-8 的情况下可能会遇到这种情况签名”

Quoted at the bottom of the Wikipedia page on BOM: http://en.wikipedia.org/wiki/Byte-order_mark#cite_note-2

"Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature"

UTF-8 和带 BOM 的 UTF-8 有什么区别?

走过海棠暮 2024-08-27 14:32:06

为什么你认为并行排序会有帮助?我认为大多数排序是 I/O 绑定的,而不是处理。除非您的比较进行了大量计算,否则不太可能实现加速。

Why do you think a parallel sort would help? I'd think most sorting is i/o bound, not processing. Unless your compare does a lot of calculations, a speedup is unlikely.

多线程快速排序或合并排序

走过海棠暮 2024-08-27 05:13:28

将其视为让几个独立的系统一起工作可能会有所帮助,而不是一个“大引擎”负责一切。

当谈到“业务指标”时,请查看KPI(关键绩效指标)。分析引擎 (MS-SSASPentaho-Mondrian 等...)允许KPI 的简单定义和呈现(仪表板)。如果您自己开发,您可能仍然了解这个概念。

数据质量主要由“操作系统”负责,这是收集数据的地方。如果垃圾到达DW,那就太晚了。使用数据分析工具了解源数据的外观就像——必须从源头强制执行数据质量。

在DW加载过程中,您可以使用逐步的ECD(Extract、Clean、Conform、Deliver)方法来实现某些“数据标准”。 ETL 工具 (MS-SSISPentaho-KettleOracle Data Itegrator 等)旨在帮忙解决这个问题。

关于规则引擎,请查看inrule ILOG FicoCorticonJboss Drools 等。这些是“独立系统”,在与操作系统编排时可用于强制执行业务规则。执行业务规则通常会提高数据质量。您可以下载 Drools 并很快开始修补,其他供应商也允许一些免费下载。

It may help to look at this as having a few separate systems working together -- as opposed of one "big engine" being responsible for everything.

When it comes to "business metrics", look at KPIs (key performance indicators). Analytic engines (MS-SSAS, Pentaho-Mondrian, etc...) allow for for simple definition and presentation (dashboards) of KPIs. If developing your own, you may still get an idea of the concept.

Data quality is mostly responsibility of "operational systems", that's where data is collected. If garbage reaches DW, it's too late. Use data profiling tools to get an idea of how source data look like -- data quality has to be enforced at the source.

During the DW loading process, you can use step-by-step ECCD (Extract, Clean, Conform, Deliver) approach to implement certain "data standards". ETL tools (MS-SSIS, Pentaho-Kettle, Oracle Data Itegrator, etc..) are designed to help with this.

Regarding rule engines, look at inrule, ILOG, Fico, Corticon, Jboss Drools, etc. These are "independent systems", and can be used to enforce business rules when orchestrated with operational systems. Enforcing business rules usually leads to increased data quality. You can download Drools and start tinkering fairly quickly, other vendors allow some freebie downloads too.

您如何实施数据质量和数据质量?数据仓库中的验证规则?

走过海棠暮 2024-08-27 00:32:24

检查您的来源是否有 requiredfield 标记,或单击 tag_owner 文本框并删除扩展程序

Check your source for a requiredfield tag or click the tag_owner textbox and remove extenders

如何将输入字段设置为可选?

走过海棠暮 2024-08-27 00:14:31

Wipmania.com 和PHP

<?php
$site_name = "www.your-site-name.com";

function getUserCountry() {
    $fp = fsockopen("api.wipmania.com", 80, $errno, $errstr, 5);
    if (!$fp) {
        // API is currently down, return as "Unknown" :(
        return "XX";
    } else {
        $out = "GET /".$_SERVER['REMOTE_ADDR']."?".$site_name." HTTP/1.1\r\n";
        $out .= "Host: api.wipmania.com\r\n";
        $out .= "Typ: php\r\n";
        $out .= "Ver: 1.0\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);
        while (!feof($fp)) {
            $country = fgets($fp, 3);
        }
        fclose($fp);
        return $country;
    }
}
?>

Wipmania.com & PHP

<?php
$site_name = "www.your-site-name.com";

function getUserCountry() {
    $fp = fsockopen("api.wipmania.com", 80, $errno, $errstr, 5);
    if (!$fp) {
        // API is currently down, return as "Unknown" :(
        return "XX";
    } else {
        $out = "GET /".$_SERVER['REMOTE_ADDR']."?".$site_name." HTTP/1.1\r\n";
        $out .= "Host: api.wipmania.com\r\n";
        $out .= "Typ: php\r\n";
        $out .= "Ver: 1.0\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);
        while (!feof($fp)) {
            $country = fgets($fp, 3);
        }
        fclose($fp);
        return $country;
    }
}
?>

如何检测网站访问者所在的国家/地区(具体来说,美国与否)?

走过海棠暮 2024-08-26 23:46:07
$str ="ABC (Test1)";    
echo preg_replace( '~\(.*\)~' , "", $str );      
$str ="ABC (Test1)";    
echo preg_replace( '~\(.*\)~' , "", $str );      

删除括号之间的文本 PHP

走过海棠暮 2024-08-26 22:05:26

纯 CSS 方法将使用 CSS table-layout:

CSS:

#wrapper{
  display: table;
  width: 100%;
}
#content { 
  display: table-cell; 
  width: auto; 
}
#sidebar { 
  display: table-cell;
  width: 30%; 
}

HTML:

<div id="wrapper"><!--both sidebar and content share width-->
  <div id="content"><!--maybe at 30%-->content
  </div>
  <div id="sidebar"><!--may be at 70%-->sidebar
  </div>
</div>

然而,上述内容不适用于 IE6/7 等较旧的浏览器。使用 javascript(如本文其他答案中提到的)作为后备将是理想的选择。

A pure CSS method will be using CSS table-layout:

CSS:

#wrapper{
  display: table;
  width: 100%;
}
#content { 
  display: table-cell; 
  width: auto; 
}
#sidebar { 
  display: table-cell;
  width: 30%; 
}

HTML:

<div id="wrapper"><!--both sidebar and content share width-->
  <div id="content"><!--maybe at 30%-->content
  </div>
  <div id="sidebar"><!--may be at 70%-->sidebar
  </div>
</div>

The above however will not work for older browsers like IE6/7 etc. Using javascript (as mentioned by other answers to this post) as a fallback will be ideal.

在 2 列布局中,如果删除另一列,如何使一列扩展到总宽度?

走过海棠暮 2024-08-26 19:33:25

DialogPreference 本身并不是一个Activity。它只是一个Preference,单击时会显示一个Dialog

问题是没有明显的方法以编程方式单击首选项。但是,由于您使用的是 DialogPreference,您已经拥有了它自己的子类。因此,我们可以通过将以下方法添加到 DialogPreference 的子类中来解决我们的问题:

//Expose the protected onClick method
void show() {
    onClick();
}

然后在 PreferencesActivityonCreate() 中,您将有这样的东西从你的 XML 文件加载首选项:

// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);

之后你可以放置一些像这样的代码:

booleanProp = true; //set this to the value of the property you're checking     

if (! booleanProp) {
    //Find the Preference via its android:key
    //MyDialogPreference is your subclasss of DialogPreference
    MyDialogPreference dp = (MyDialogPreference)getPreferenceScreen().findPreference("dialog_preference");  
    dp.show();
}

这是一个有点黑客,因为公开 protected 方法并不理想,但它确实有效。

另一种选择是将 Dialog 替换为 PrefenceActivity,其中包含您希望维护的所有选项,然后您可以通过 Intent 启动它,但我假设您有充分的理由希望您自己的自定义 Dialog 具有特定的布局。如果您确实需要第二个 PreferenceActivity,您可以将其添加到您的首选项 XML 文件中,如下所示:

<PreferenceScreen
        android:title="@string/title_of_preference"
        android:summary="@string/summary_of_preference">
    <intent android:action="your.action.goes.HERE"/>
</PreferenceScreen>

A DialogPreference isn't an Activity in its own right. It's just a Preference which displays a Dialog when clicked.

The problem is that there's no obvious way programmatically click a Preference. However, since you're using DialogPreference you've already got you own subclass of it. So we can solve our problem by adding the following method to your subclass of DialogPreference:

//Expose the protected onClick method
void show() {
    onClick();
}

Then in the onCreate() of your PreferencesActivity you'll have something like this to load the preferences from your XML file:

// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);

After that you can put some code like this:

booleanProp = true; //set this to the value of the property you're checking     

if (! booleanProp) {
    //Find the Preference via its android:key
    //MyDialogPreference is your subclasss of DialogPreference
    MyDialogPreference dp = (MyDialogPreference)getPreferenceScreen().findPreference("dialog_preference");  
    dp.show();
}

This is a bit of hack, as exposing protected methods isn't ideal, but it does work.

Another option would be to replace the Dialog with a PrefenceActivity which contained all the options you wish to maintain and then you could launch it via an Intent, but I'm assuming there's a good reason that you want your own custom Dialog with a specific layout. If you do want a second PreferenceActivity you can add it to your preferences XML file as follows:

<PreferenceScreen
        android:title="@string/title_of_preference"
        android:summary="@string/summary_of_preference">
    <intent android:action="your.action.goes.HERE"/>
</PreferenceScreen>

从 PreferenceScreen 到 DialogPreference

走过海棠暮 2024-08-26 16:06:46

可以验证 SQL Server 2005,因为可以在“服务”面板(也可以通过 .NET 访问)中找到已安装的 SQL Server 实例。

.NET 3.5 C# 程序无法检查是否安装了 .NET Framework。

您最好编写本机应用程序(用 VC 或其他语言)来检查先决条件。

SQL Server 2005 can be verified, as installed SQL Server instances can be found in Services panel (which is also accessible via .NET).

It is not possible for a .NET 3.5 C# program to check whether .NET Framework is installed.

You'd better write native applications (in VC or else) to check for prerequisites.

C# 应用程序依赖性检查

走过海棠暮 2024-08-26 05:45:08

我不会使用程序集作为许可证文件 - 正如其他人指出的那样,破坏它相对微不足道。
我会使用一个文件(xml 或其他文件),然后将其锁定到用户计算机。这可以通过多种方式实现:
1)使用 System.Cryptography.ProtectedData - 这只是包装 Windows DPAPI 并使用 Windows 密钥存储(每个用户或每个本地计算机)。这是一种简单的方法,但您必须使用 Encoding.UTF8.GetString (或任何您的编码)从字节数组转换回来。这很简单,但不是工业强度,因为有人仍然可以挖出密钥库等。
2) 使用机器唯一 ID(例如具有对称算法(例如 Rijndael 或 Blowfish)的 SID,并提供未加密许可证文件的 SHA-256 哈希值作为 IV。这实现起来有点复杂,因为您需要使用 WMI 来查找 SID,然后使用 System.Security.Cryptography.RijndaelManaged 等来进行加密/解密。

I wouldn't go with using an assembly as a license file - as others have pointed out it's relatively trivial to break.
I would use a file ( xml or whatever ) then lock it to the users machine. This can be achieved in several ways :
1) Use System.Cryptography.ProtectedData - this just wraps the Windows DPAPI and uses the windows key store ( either per user or per local machine ). This a simple(ish) approach but you will have to using Encoding.UTF8.GetString ( or whatever your encoding is ) to convert back from a byte array. This is simple but not industrial strength as someone could still dig out the key store etc.
2) Use a machine unique ID such as the SID with a symmetric algorithm such as Rijndael or Blowfish and provide the SHA-256 hash of the unencrypted license file as the IV. This is a bit more complex to implement as you'd need to use WMI to find the SID and then use System.Security.Cryptography.RijndaelManaged etc to do the encryption/decryption.

使用程序集作为许可证文件的优点/缺点?

走过海棠暮 2024-08-26 02:46:55

多对多根据结构的不同设置不同的方式。如果类 A 具有 B 实体的集合,您可以将其直接绑定到 DataSource 属性,如下所示:

<asp:Repeater ... DataSource="<% Eval("Bs") %>">

因此,这取决于对象模型中实体的引用方式,这又取决于多对多设置。看看这个:http://thedatafarm.com/blog/data-access/inserting-many-to-many-relationships-in-ef-with-or-without-a-join-entity/

Many to many is setup different ways depending on structure. If class A has a collection of B entities, you can bind it directly to the DataSource property as in:

<asp:Repeater ... DataSource="<% Eval("Bs") %>">

So it depends on how the entities are referenced in your object model, which again varies depending on the many to many setup. Check this out: http://thedatafarm.com/blog/data-access/inserting-many-to-many-relationships-in-ef-with-or-without-a-join-entity/

使用来自 2 个实体框架查询的数据加载嵌套转发器

更多

推荐作者

寻梦旅人

文章 0 评论 0

冰美式不加糖

文章 0 评论 0

m0_51416705

文章 0 评论 0

123456wqwqwq

文章 0 评论 0

qq_R47skh

文章 0 评论 0

hs1283

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文