走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-09-23 15:42:14

这实际上取决于您的偏差在多大程度上会带来更好的用户体验。

HIG 可帮助您构建用户从一开始就或多或少了解如何使用的应用程序,并使应用程序易于使用。

如果你做了一些定制的事情来改善用户的生活,苹果可能会放弃它。但如果你的做法有所偏差,导致应用程序更难使用,他们往往会责怪你。

许多可能的拒绝都是相当合理的事情 - 例如,我因旋转视图而被拒绝一次,其中 UI 元素没有完全正确替换。一旦修复(这确实是我的一个错误),该应用程序就被接受了。

It really depends on how much your devition results in a better user experience.

The HIG is there to help you build an application that users will understand how to use more or less from the start, and make the application easy to use.

If you do some custom things that improve life for the user, Apple will probably let it go. But if you are deviating in ways that make the application harder to use, they will tend to come down on you.

A lot of the possible rejections are pretty reasonably things - for example I was rejected once for a rotated view where the UI elements didn't quite all replace correctly. Once fixed (and it really was a bug on my part) the app was accepted.

人机界面指南是福音吗?

走过海棠暮 2024-09-23 11:33:22

只需向您想要默认检查的每个无线电添加检查属性

试试这个:

<input style="width: 20px;" type="radio" name="Contact0_AmericanExpress" class="check" checked/>

just add checked attribute to each radio that you want to have default checked

try this :

<input style="width: 20px;" type="radio" name="Contact0_AmericanExpress" class="check" checked/>

单选按钮“已选中”属性不起作用

走过海棠暮 2024-09-23 11:14:53

这正是为什么像 * 或 + 这样的二元运算符应该是非成员的原因。

如果您执行了 s = u * 2,它就会起作用,假设您有一个用于 statistician 的非显式构造函数,该构造函数采用单个 int > 论证。但是,2 * u 不起作用,因为 2 不是 statistician,并且 int 不是具有成员运算符的类*。

为了使其正常工作,您应该定义一个非成员 operator* 并使其成为 statisticianfriend


statistician operator*(const statistician &left, const statistician &right);

您还需要定义其他版本的 operator* 接受整数(或您希望能够“相乘”的任何其他类型)或为 statistician 定义非显式构造函数以启用隐式转换。

This is exactly why binary operators like * or + should be non-member.

If you did s = u * 2, it would have worked, assuming that you have a non-explicit constructor for statistician that takes a single int argument. However, 2 * u does not work, because 2 is not a statistician, and int is not a class with a member operator*.

For this to work right, you should define a non-member operator* and make it a friend of statistician:


statistician operator*(const statistician &left, const statistician &right);

You also need to either define other versions of operator* that take integers (or whatever other types you wish to be able to "multiply") or define non-explicit constructors for statistician to enable implicit conversion.

二进制“*” :未找到采用“statistician”类型的全局运算符; (或者没有可接受的转换)

走过海棠暮 2024-09-23 06:12:16

PHP CLI,无 easter_date(),125 个字符

适用于 1900 年 3 月 13 日至 2100 年 3 月 13 日的日期,现在适用于 5 月的复活节

代码:

<?=date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));

调用:

$ php codegolf.php 2010
$ php codegolf.php 2005

输出:

04/04/2010
01/05/2005

使用空格:

<?=date("d/m/Y", mktime(0, 0, 0, floor(($b = ($a = (19 * (($y = $argv[1]) % 19) + 15) % 30) + (2 * ($y % 4) + 4 * $y % 7 - $a + 34) % 7 + 114) / 31), ($b % 31) + 14, $y));

由于 PHP 对赋值的处理,此迭代不再可读。它几乎是一种函数式语言!


为了完整起见,这里是之前的 127 个字符的解决方案,不依赖短标签:

代码:

echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));

调用:

$ php -r 'echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));' 2010
$ php -r 'echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));' 2005

PHP CLI, no easter_date(), 125 characters

Valid for dates from 13 March 1900 to 13 March 2100, now works for Easters that fall in May

Code:

<?=date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));

Invocation:

$ php codegolf.php 2010
$ php codegolf.php 2005

Output:

04/04/2010
01/05/2005

With whitespace:

<?=date("d/m/Y", mktime(0, 0, 0, floor(($b = ($a = (19 * (($y = $argv[1]) % 19) + 15) % 30) + (2 * ($y % 4) + 4 * $y % 7 - $a + 34) % 7 + 114) / 31), ($b % 31) + 14, $y));

This iteration is no longer readable thanks to PHP's handling of assignments. It's almost a functional language!


For completeness, here's the previous, 127 character solution that does not rely on short tags:

Code:

echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));

Invocation:

$ php -r 'echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));' 2010
$ php -r 'echo date("d/m/Y",mktime(0,0,0,floor(($b=($a=(19*(($y=$argv[1])%19)+15)%30)+(2*($y%4)+4*$y%7-$a+34)%7+114)/31),($b%31)+14,$y));' 2005

Code Golf:计算东正教复活节日期

走过海棠暮 2024-09-23 05:56:23

有几种方法可以从 XElement 导航到其子元素:

IEnumerable<XElement> allChildElements = xElement.Elements();
IEnumerable<XElement> specificChildElements = xElement.Elements("tag");
XElement firstSpecificChildElement = xElement.Element("tag");

There are a few alternatives to navigate from an XElement to its children:

IEnumerable<XElement> allChildElements = xElement.Elements();
IEnumerable<XElement> specificChildElements = xElement.Elements("tag");
XElement firstSpecificChildElement = xElement.Element("tag");

从 XElement 获取子元素

走过海棠暮 2024-09-23 03:05:05

您可以使用 time.h 库,特别是 时间difftime 函数:(

/* difftime example */
#include <stdio.h>
#include <time.h>

int main ()
{
  time_t start,end;
  double dif;

  time (&start);
  // Do some calculation.
  time (&end);
  dif = difftime (end,start);
  printf ("Your calculations took %.2lf seconds to run.\n", dif );

  return 0;
}

改编自上面链接的 difftime 网页的示例。)

请注意,此方法只能给出秒级的精度 - time_t 记录自 UNIX 纪元(1970 年 1 月 1 日)以来的秒数。

You can use the time.h library, specifically the time and difftime functions:

/* difftime example */
#include <stdio.h>
#include <time.h>

int main ()
{
  time_t start,end;
  double dif;

  time (&start);
  // Do some calculation.
  time (&end);
  dif = difftime (end,start);
  printf ("Your calculations took %.2lf seconds to run.\n", dif );

  return 0;
}

(Example adapted from the difftime webpage linked above.)

Please note that this method can only give seconds worth of accuracy - time_t records the seconds since the UNIX epoch (Jan 1st, 1970).

如何用C语言测量时间?

走过海棠暮 2024-09-23 01:29:03

未经测试...

$.fn.asort = function (order, attrName) {
    for(var i = 0, len = order.length; i < len; ++i) {
        this.children('[' + attrName + '=' + order[i] + ']').appendTo(this);
    }
}

untested...

$.fn.asort = function (order, attrName) {
    for(var i = 0, len = order.length; i < len; ++i) {
        this.children('[' + attrName + '=' + order[i] + ']').appendTo(this);
    }
}

jquery 使用数组值对元素进行排序

走过海棠暮 2024-09-23 00:13:50

调用 setNeedsDisplay 在背面视图上

[back assignLabelText:[facts getCurrentFact].answer];
[[back view] setNeedsDisplay];
[self doAnimation:back.view andViewToHide:front.view flipRight:YES];

Call setNeedsDisplay on back's view

[back assignLabelText:[facts getCurrentFact].answer];
[[back view] setNeedsDisplay];
[self doAnimation:back.view andViewToHide:front.view flipRight:YES];

如何强制 UIWebView 在屏幕外时更新?

走过海棠暮 2024-09-22 21:43:43

对于 Windows 8

删除此目录 C:\Users\Shubham\AppData\Local\NetBeans\Cache

在执行此操作之前关闭 netbeans。

再次启动 Netbeans 并让它读取该项目。

测试项目。运行项目。它应该工作正常。

For windows 8

Delete this directory C:\Users\Shubham\AppData\Local\NetBeans\Cache

Before doing so close netbeans.

Start Netbeans again and let it read the project.

Test project. Run project. It should work fine.

在 NetBeans 6.9 中找不到主类

走过海棠暮 2024-09-22 19:30:12
  1. 会话存储在服务器上,这意味着客户端无权访问您存储的有关它们的信息。会话数据存储在您的服务器上,不需要随每个页面完整传输;客户端只需发送一个 ID,然后从服务器加载数据。

  2. 另一方面,Cookie 存储在客户端。它们可以经久耐用,并且可以让您在拥有 Web 服务器集群时更加顺利地工作。然而,与会话不同的是,存储在 Cookie 中的数据会随每个页面请求完整传输。如果您需要更长的登录会话,则应该使用 cookie。

  3. URL 变量 (GET) 是开放的,用户可以看到。它们也很有用,因为它允许用户为页面添加书签并共享链接。

  1. Sessions are stored on the server, which means clients do not have access to the information you store about them. Session data, being stored on your server, does not need to be transmitted in full with each page; clients just need to send an ID and the data is loaded from the server.

  2. On the other hand, Cookies are stored on the client. They can be made durable for a long time and would allow you to work more smoothly when you have a cluster of web servers. However unlike Sessions, data stored in Cookies is transmitted in full with each page request. You should use cookie if you need longer logged-in sessions.

  3. URL variables (GET) are open and can be seen by user. They are also useful as it allows the user to bookmark the page and share the link.

何时使用 URL/会话/cookie 变量?

走过海棠暮 2024-09-22 13:40:36

它称为包含防护

#ifndef GRANDFATHER_H
#define GRANDFATHER_H

struct foo {
    int member;
};

#endif

引用维基百科:

在 C 和 C++ 编程语言中,#include 保护(有时称为宏保护)是一种特殊的构造,用于在处理 #include 指令时避免双重包含问题。在头文件中添加 #include 保护是使该文件幂等的​​一种方法。

请参阅上面的链接了解更多信息。

It's called an include guard.

#ifndef GRANDFATHER_H
#define GRANDFATHER_H

struct foo {
    int member;
};

#endif

Quote from Wikipedia:

In the C and C++ programming languages, an #include guard, sometimes called a macro guard, is a particular construct used to avoid the problem of double inclusion when dealing with the #include directive. The addition of #include guards to a header file is one way to make that file idempotent.

See link above for more information.

为什么在 c++ 中包含两次头文件是有效的?

走过海棠暮 2024-09-22 13:18:20

您不需要 js、ajax 和 jquery 的编译器,所有这些都基于 javascript 这是一种脚本语言。 Php 是一种服务器端语言,因此您需要在您的计算机上运行自己的服务器(您可以找到有趣的 wamp ,它为您提供 php、mysql、apache 有关 IDE 的简单设置。那里有很多,也许 netbeans 作为免费解决方案是一个好主意,或者 PHPedit 当然还有其他用于 Web 开发的工具,例如 adobe Dreamweaver.

You don't need a compiler for js,ajax and jquery, all based on javascript which is a script language. Php is a server side language so you need to run your own server on your machine (you may find interesting wamp which provide you php,mysql,apache with a simple setup. About the IDE there are a lot out there, maybe netbeans as a free solution is a good idea, or PHPedit Of course there are and other tools for web developement such as adobe dreamweaver.

有没有专门用于 Web 应用程序开发的 IDE?

走过海棠暮 2024-09-22 11:23:22
  • 确保该文件夹未处于写保护状态,并且在您尝试移动该文件夹时没有进程正在访问任何文件。

  • 还要检查您是否向正确的用户授予了安全权限,方法是验证应用程序池在哪个用户帐户下运行。

  • 您可能还需要考虑在本地 IIS 上进行开发,以防止将来出现此类情况(我曾经经历过;不太好)

  • Make sure the folder is not under write-protection and no process is accessing any files at the moment you are trying to move the folder.

  • Also check whether you gave the security permissions to the correct user, by verifing under which user account the applicationpool is running.

  • You might also want to consider developing on a local IIS to prevent such situations in the future (I've been there; not nice)

Directory.Move() 在调试模式下工作,但在部署时不工作

走过海棠暮 2024-09-22 11:01:25

您是否依赖 4.0 的任何特定内容?

如果您调用 MSBuild 4.0,您将获得 4.0 工具。如果您调用 MSBuild 3.5,您将获得 3.5 工具(这正是您想要的,因为您显然托管在 2.0 CLR 中)。

另一种选择是将 4.0 CLR 放在您的 Web 服务器上。如果未打开,则您的信息流中不应该有任何 4.0 目标内容。

Are you reliant on anything 4.0 specific?

If you invoke MSBuild 4.0, you'll get 4.0 tools. If you invoke MSBuild 3.5, you'll get 3.5 tools (which is what you want as you're clearly hosting in a 2.0 CLR).

The other option is to put the 4.0 CLR on your web server. If that's not open, you shouldnt have any 4.0 targetted stuff in your stream.

VS.NET 2010/MSBUILD 可以为 .NET 3.5 SP1 生成 XmlSerializers 吗?

走过海棠暮 2024-09-22 09:16:08

基本名称($str);

basename($str);

php中如何获取文件名

更多

推荐作者

愿与i

文章 0 评论 0

♡⃝ 酴醾

文章 0 评论 0

晚安先生.

文章 0 评论 0

123

文章 0 评论 0

时光清浅

文章 0 评论 0

避讳

文章 0 评论 0

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