灯角

文章 评论 浏览 24

灯角 2024-10-10 20:26:59

是的...只要你这样设计它就可以工作:

input[type="submit"], button, .button, a.actionlink {
    cursor: pointer;
    display: inline-block;
    font-family: "Arial","Verdana","Helvetica","sans-serif";
    font-size: 12px;
    font-weight: bold;
    min-width: 85px;
    -moz-outline: 0 none;
    outline: 0 none;
    padding-bottom: 7px;
    padding-top: 7px;
    text-align: center;
}

Yes... it does work provided you style it this way:

input[type="submit"], button, .button, a.actionlink {
    cursor: pointer;
    display: inline-block;
    font-family: "Arial","Verdana","Helvetica","sans-serif";
    font-size: 12px;
    font-weight: bold;
    min-width: 85px;
    -moz-outline: 0 none;
    outline: 0 none;
    padding-bottom: 7px;
    padding-top: 7px;
    text-align: center;
}

`min-width` 不适用于表单 `input[type="button"]` 元素吗?

灯角 2024-10-10 19:56:02

501 错误是因为您使用的服务器(大概是 simpleHTTPServer 之类的服务器)不支持 POST 请求。

要解决该错误,您需要使用支持 POST 请求的服务器,例如 apache

The 501 error is because the server you are using (presumably something like simpleHTTPServer) doesn't support POST requests.

To resolve that error you need to use a server that supports POST requests like apache

jQuery ajax post 返回 501 错误代码

灯角 2024-10-10 18:54:45

如果您想在托管 C++ 实现上运行程序,则需要一个 main 函数。这就是事物的定义方式。当然,如果您愿意,也可以将其留空。在技​​术方面,链接器想要解析运行时库中使用的 main 符号(它不知道您省略它的特殊意图 - 它只是仍然发出对它的调用) 。如果标准指定 main 是可选的,那么实现当然可以提出解决方案,但这需要在平行宇宙中发生。

如果您选择“执行在我的全局对象的构造函数中开始”,请注意您会给自己带来许多与不同翻译单元中定义的命名空间范围对象的构造顺序相关的问题(那么是什么 入口点?答案是:你将有多个入口点,并且首先执行哪个入口点是未指定的!)。在 C++03 中,您甚至不能保证 cout 被正确构造(在 C++0x 中,您可以保证在任何代码尝试使用它之前,只要有前面包含 )。

如果您正确地开始在 ::main 中执行操作,那么您就不会遇到这些问题,也不需要解决它们(这可能非常棘手)。


正如评论中提到的,有一些系统通过让用户告诉在 main 中实例化的类的名称来向用户隐藏 main代码>.其工作原理类似于以下示例

class MyApp {
public:
  MyApp(std::vector<std::string> const& argv);

  int run() {
      /* code comes here */
      return 0;
  };
};

IMPLEMENT_APP(MyApp);

对于该系统的用户来说,完全隐藏了 main 函数,但该宏实际上会定义这样一个主函数,如下所示

#define IMPLEMENT_APP(AppClass) \
  int main(int argc, char **argv) { \
    AppClass m(std::vector<std::string>(argv, argv + argc)); \
    return m.run(); \
  }

这没有问题上述未指定的构建顺序。它们的好处是它们可以与不同形式的更高级别入口点一起工作。例如,Windows GUI 程序在 WinMain 函数中启动 - IMPLMENT_APP 然后可以在该平台上定义这样的函数。

If you want to run your program on a hosted C++ implementation, you need a main function. That's just how things are defined. You can leave it empty if you want of course. On the technical side of things, the linker wants to resolve the main symbol that's used in the runtime library (which has no clue of your special intentions to omit it - it just still emits a call to it). If the Standard specified that main is optional, then of course implementations could come up with solutions, but that would need to happen in a parallel universe.

If you go with the "Execution starts in the constructor of my global object", beware that you set yourself up to many problems related to the order of constructions of namespace scope objects defined in different translation units (So what is the entry point? The answer is: You will have multiple entry points, and what entry point is executed first is unspecified!). In C++03 you aren't even guaranteed that cout is properly constructed (in C++0x you have a guarantee that it is, before any code tries to use it, as long as there is a preceeding include of <iostream>).

You don't have those problems and don't need to work around them (wich can be very tricky) if you properly start executing things in ::main.


As mentioned in the comments, there are however several systems that hide main from the user by having him tell the name of a class which is instantiated within main. This works similar to the following example

class MyApp {
public:
  MyApp(std::vector<std::string> const& argv);

  int run() {
      /* code comes here */
      return 0;
  };
};

IMPLEMENT_APP(MyApp);

To the user of this system, it's completely hidden that there is a main function, but that macro would actually define such a main function as follows

#define IMPLEMENT_APP(AppClass) \
  int main(int argc, char **argv) { \
    AppClass m(std::vector<std::string>(argv, argv + argc)); \
    return m.run(); \
  }

This doesn't have the problem of unspecified order of construction mentioned above. The benefit of them is that they work with different forms of higher level entry points. For example, Windows GUI programs start up in a WinMain function - IMPLEMENT_APP could then define such a function instead on that platform.

你真的需要 C++ 中的 main() 吗?

灯角 2024-10-10 02:53:34

php base64_encode 功能返回一个字符串。所以 nusoap 正在正确读取类型。尝试先引用内容而不对其进行编码。

$args[]=array('name'=>'content', 'value'=>$content, 'type'=>'Base64Binary');

C.

The php base64_encode functionality returns a string. So nusoap is reading the type correctly. try referencing the content without encoding it first.

$args[]=array('name'=>'content', 'value'=>$content, 'type'=>'Base64Binary');

C.

在nusoap中传递base64Binary类型

灯角 2024-10-10 02:52:11

n=4 不会是

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

你生成的(不确定“n”是什么意思)???

n=4 would be

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

not what you generated (not sure what you mean by "n")???

真值表输入生成

灯角 2024-10-10 01:16:04

我猜我只是愚蠢

我的 load_class() 函数没有正确加载类
我忘记配置我的配置文件并将基本 uri 设置为当前文件夹哈哈
也许我应该删除这个。哦愚蠢 /facepalm

alt text

抱歉打扰大家了 xD

guess im just stupid

my load_class() function does not load the class properly
i forgot to configure my Configuration file and set the base uri to the current folder lol
maybe i should delete this one. oh stupidity /facepalm

alt text

sorry for bothering everyone xD

PHP静态函数不会消亡

灯角 2024-10-09 15:54:44

@Jullin:当您通过按 F5 从 Visual Studio 编辑器运行项目时,CLR 选择 app.config 文件来读取数据,但是当您想从 .exe (bin/debug 或 bin/release)运行项目时,则 clr 读取 applicationName.exe。 config,您必须在调试或发布或访问 applicationName.exe 的任何文件夹中拥有该文件。

就像我有一个名为“WindowsFormApplication”的窗口应用程序,当我在发布文件夹中成功构建它时,我有 WindowsFormApplication.exe 和 WindowsFormApplication.exe.config 以及其他一些文件。因此,请确保您成功发布项目,并且您的发布文件夹必须包含文件。

@Jullin: When you run project from visual studio editor by pressing F5 then CLR pick app.config file to read data but when you want to run project from .exe (bin/debug or bin/release) then clr read applicationName.exe.config, which you must have within your debug or release or any folder from where you access you applicationName.exe.

Like i have a window application named "WindowsFormApplication", when i build it successfully in release folder i have WindowsFormApplication.exe and WindowsFormApplication.exe.config and some other files. so make sure you release project successfully and your release folder must contain files.

在Release中加载app.config文件

灯角 2024-10-09 14:21:11

这只是一种预感,但您可能想调查一下它真正尝试序列化的类型 - nHibernate 在运行时为每个 POCO 生成代理(因此它可以执行诸如延迟加载外键实体等操作)。这可能就是您收到此错误的原因。

尝试指定要序列化的确切类型,或者创建一个全新的要序列化的对象,用 nHibernate POCO 的属性填充其属性。

编辑:
这似乎更能解决您的问题:

http://www. west-wind.com/WebLog/posts/147218.aspx

基本上,检查所有 POCO 是否有任何循环引用(例如,具有 Order POCO 作为属性的 Customer POCO,而 Order POCO 具有 Customer's 列表)作为财产)

This is just a hunch but you might like to investigate what type it is really trying to serialize- nHibernate generates proxies for each POCO at runtime (so it can do stuff like lazy loading of foreign key entities, etc.). This may be why you are getting this error.

Try specifying the exact type to be serialized or perhaps create a brand new object to serialize, populating its properties with that of the nHibernate POCO.

EDIT:
This seems to be much more likley the answer to your problems:

http://www.west-wind.com/WebLog/posts/147218.aspx

Basically, check all of your POCO's for any circular references (e.g. a Customer POCO that has an Order POCO as a property while the Order POCO has a list of Customer's as a property)

将 nHibernate 查询序列化为 JSON

灯角 2024-10-09 12:52:54

Telerik 套件+1。它们可能相当笨重,但功能丰富。

+1 for the Telerik suite. They can be rather bulky but they are feature-rich.

Windows Forms 和 WPF 的商业控制套件:可以推荐哪一个?

灯角 2024-10-09 08:21:13

编辑:

实际上,您不需要反转行:

printf -v spaces "%80s" " "; man rev | sed "s/^/$spaces/;s/.*\(.\{80\}\)\$/\1/"

原始:

反转行、填充它们、截断它们并将它们反转回来。

man rev | rev | sed '1{x;s/^$/          /;s/^.*$/&&&&&&&&/;x};G;s/^\(.\{81\}\).*$/\1/;s/\n//' | rev

输出:

  REV(1)                    BSD General Commands Manual                   REV(1)

                                                                            NAME
                                          rev — reverse lines of a file or files

                                                                        SYNOPSIS
                                                                  rev [file ...]

                                                                     DESCRIPTION
              The rev utility copies the specified files to the standard output,
        reversing the order of characters in every line.  If no files are speci‐
                                               fied, the standard input is read.

                                                                    AVAILABILITY
           The rev command is part of the util-linux-ng package and is available
                       from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

  BSD                             March 21, 1992                             BSD

这是做同样事情的另一种方法:

printf -v spaces "%80s" " "; man rev | rev | sed "s/\$/$spaces/;s/^\(.\{80\}\).*$/\1/" | rev

Edit:

Actually, you don't need to reverse the lines:

printf -v spaces "%80s" " "; man rev | sed "s/^/$spaces/;s/.*\(.\{80\}\)\$/\1/"

Original:

Reverse the lines, pad them, truncate them and reverse them back.

man rev | rev | sed '1{x;s/^$/          /;s/^.*$/&&&&&&&&/;x};G;s/^\(.\{81\}\).*$/\1/;s/\n//' | rev

Output:

  REV(1)                    BSD General Commands Manual                   REV(1)

                                                                            NAME
                                          rev — reverse lines of a file or files

                                                                        SYNOPSIS
                                                                  rev [file ...]

                                                                     DESCRIPTION
              The rev utility copies the specified files to the standard output,
        reversing the order of characters in every line.  If no files are speci‐
                                               fied, the standard input is read.

                                                                    AVAILABILITY
           The rev command is part of the util-linux-ng package and is available
                       from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

  BSD                             March 21, 1992                             BSD

Here's another way to do the same thing:

printf -v spaces "%80s" " "; man rev | rev | sed "s/\$/$spaces/;s/^\(.\{80\}\).*$/\1/" | rev

右对齐文件

灯角 2024-10-09 07:12:04

ASP.NET 成员资格使用与任何其他站点完全相同的机制,并且绝对容易受到 Firesheep 攻击。 Cookie 本身无法以防止其被劫持的方式进行加密。与服务器的所有通信都必须使用 SSL 或 WEP 无线加密进行加密,以防止会话劫持。

ASP.NET membership uses the exact same mechanism as any other site and is absolutely vulnerable to Firesheep attack. The cookie itself cannot be encrypted in a way that keeps it from being hijacked. All communication with the server must be encrypted to protect from session hijacking, using SSL or WEP wireless encryption.

ASP.NET 会员资格是否受到 Firesheep 的保护?

灯角 2024-10-09 04:50:47

更新:

属性 fork=true 无效。

术语fork通常意味着您在任务(而不是您建议的目标)中运行的代码将在不同的进程(Java 术语中的虚拟机)中执行。

由任务的实现者(例如 NAnt 中的 NUnit 或 ANT 中的 Java 任务)来定义 fork 属性的含义。

Updated:

The property fork=true has no effect.

The term fork usually means that the code you run in a task, not target as you suggest, will execute in a different process (Virtual Machine in Java-lingo).

It is up to the implementer of a task, for instance NUnit in NAnt or the Java task in ANT, to define meaning of the fork property.

fork="true" 是什么意思?在 nant 脚本目标中做什么?

灯角 2024-10-09 04:39:31

将额外的代码放入模块中并使用 -M。这将在循环之前运行。

您甚至可以通过 $ENV{PERL5OPT} 潜入一些东西,尽管开关非常有限;例如,没有 -e-E

我想如果你真的愿意的话,你也可以用 $ENV{PERL_ENCODING} 做一些离谱的事情。

这就是Acme:: 的全部领域。 不要这样做。 ☹

编辑:唯一喜欢的解决方案是非常没有创意且完全简单的INIT{}

Put your extra code in a module and use ‑M. That’ll run before the loop.

You might even be able to sneak something in via $ENV{PERL5OPT}, although the switches are pretty limited; no ‑e or ‑E, for example.

I suppose you could do something outrageous with $ENV{PERL_ENCODING} too, if you really wanted to.

This is all Acme:: territory. Please don’t. ☹

EDIT: The only solution I much like is the very uncreative and completely straightforward INIT{}.

如何指定“循环之前”使用“perl -ne”时的代码?

灯角 2024-10-08 23:19:47

ExtensibleActionInvoker 声称能够在操作过滤器上执行属性注入。

正确 - 但不要将操作过滤器与可能无法实现它们的属性混淆。在 ASP.NET MVC 中解决此问题的最简洁方法是划分职责,即使 MVC 框架允许您将它们组合起来。

例如,使用一对类 - 一个仅保存数据的属性类:

// Just a regular old attribute with data values
class SomeAttribute : Attribute { ... }

以及一个注入了依赖项的过滤器:

// Gets dependencies injected
class SomeFilter : IActionFilter { ... }

SomeFilter 仅使用从获取 SomeAttribute 属性的典型方法通过 GetCustomAttributes() 的控制器或操作方法来完成所需的任何工作。

然后,您可以使用 ExtensibleActionInvoker 连接过滤器:

builder.RegisterControllers(...).InjectActionInvoker();
builder.RegisterType<ExtensibleActionInvoker>().As<IActionInvoker>();
builder.RegisterType<SomeFilter>().As<IActionFilter>();

它可能比使用属性作为过滤器方法编写的代码多一点,但代码的质量会更好长期来看(例如,通过避免服务定位器解决方案的属性限制和尴尬。)

The ExtensibleActionInvoker claims to be able to perform property injection on action filters.

Correct - but don't confuse action filters with the attributes that might not implement them. The cleanest way to approach this in ASP.NET MVC is to split responsibilities, even though the MVC framework allows you to combine them.

E.g., use a pair of classes - an attribute class that holds data only:

// Just a regular old attribute with data values
class SomeAttribute : Attribute { ... }

And a filter that has dependencies injected:

// Gets dependencies injected
class SomeFilter : IActionFilter { ... }

SomeFilter just uses the typical approach of getting the SomeAttribute attribute from the controller or action method via GetCustomAttributes() to do whatever work is needed.

You can then use ExtensibleActionInvoker to wire up the filter:

builder.RegisterControllers(...).InjectActionInvoker();
builder.RegisterType<ExtensibleActionInvoker>().As<IActionInvoker>();
builder.RegisterType<SomeFilter>().As<IActionFilter>();

It might be a little more code than you'd write using the attribute-as-filter approach, but the quality of the code will be better in the long run (e.g. by avoiding the limitations of attributes and the awkwardness of the Service Locator solutions.)

如何解决 MVC 过滤器属性中的依赖注入

灯角 2024-10-08 21:53:44

您需要定义 ELSE:

SELECT LastName, CASE FirstName WHEN 'Ian' THEN JobNo ELSE FirstName END
FROM Employees

我默认返回 FirstName,如果您不希望将其替换为其他内容。只需确保数据类型相同以避免潜在问题(我假设 JobNo 是 varchar 引用代码,用于演示语法)。

You need to define the ELSE:

SELECT LastName, CASE FirstName WHEN 'Ian' THEN JobNo ELSE FirstName END
FROM Employees

I've defaulted to return the FirstName, if you don't want that just replace with something else. Just make sure the datatypes are equivalent to avoid potential issues (I've assumed JobNo is a varchar ref code for purpose of demonstrating syntax).

SQL中使用CASE选择字段?

更多

推荐作者

Promise

文章 0 评论 0

O昵称重要吗O

文章 0 评论 0

毁虫ゝ

文章 0 评论 0

leejubao

文章 0 评论 0

gaaas

文章 0 评论 0

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