问题列表 - 第7372页

如何更改UITabBar选择颜色

我需要将UITabBar的选择颜色从默认的蓝色更改为红色.我们如何做到这一点.

iphone cocoa-touch objective-c uitabbar ios

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

导入json文件到沙发db-

如果我有一个看起来像这样的json文件:

{"name":"bob","hi":"hello"}
{"name":"hello","hi":"bye"}
Run Code Online (Sandbox Code Playgroud)

有没有选项将其导入couchdb?

json couchdb

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

缓存最佳实践

大家.有人可以在ASP MVC应用程序,最佳缓存架构等方面共享有关后端缓存和片段缓存的文章的链接.任何有用的建议也将非常受欢迎.

asp.net asp.net-mvc caching

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

我的Windows服务应用安装项目中出现错误1001

我正在尝试使用Visual Studio 2008安装和部署项目安装我的Windows服务应用程序.我创建了一个"运行即服务"权限的用户帐户,并将ServiceProcessInstaller.Account设置为System.ServiceProcess.ServiceAccount.User,并将用户名和密码设置为我之前创建的用户.

spInstaller.Account = System.ServiceProcess.ServiceAccount.User;
spInstaller.Username = "USER NAME";
spInstaller.Password = "PASSWORD";

sInstaller.ServiceName = "SERVICE NAME";
sInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
Run Code Online (Sandbox Code Playgroud)

但在安装过程中,我收到以下错误:

错误:1001.帐户名无效或不存在,或者密码对于指定的帐户名无效

任何想法为什么我得到这个错误以及我如何解决它?谢谢.

windows-services setup-deployment

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

混淆了Get-ChildItem cmdlet的-Include参数

来自文档:

-包括

仅检索指定的项目.此参数的值限定Path参数.输入路径元素或模式,例如"*.txt".允许使用通配符.

仅当命令包含Recurse参数或路径指向目录内容(例如C:\ Windows*)时,Include参数才有效,其中通配符指定C:\ Windows目录的内容.

我的第一个理解是:

c:\test\a.txt
c:\test\b.txt
Run Code Online (Sandbox Code Playgroud)

所以要得到'a.txt'和'b.txt'我可以写:

gci -Path "c:\test\*" -Include "*.txt"
Run Code Online (Sandbox Code Playgroud)

这很有效.但现在考虑这样的等级:

c:\test\a.txt
c:\test\b.txt
c:\test\c.txt\c.txt
Run Code Online (Sandbox Code Playgroud)

相同的命令返回:a.txt,b.txt,c.txt

实际逻辑似乎是:

-Include用于匹配-Path指定的所有实体.如果匹配元素是文件 - 返回它.如果匹配的元素是文件夹,请查看内部并返回匹配的第一级子项.

此外,文件说:

仅当命令包含Recurse参数或路径指向目录内容时,Include参数才有效...

这也是错误的.例如

gci -Path "c:\test" -Include "*.txt"
Run Code Online (Sandbox Code Playgroud)

它什么都不返回,而没有-Include我得到文件夹内容.所以 - 包含绝对是"有效的".这里到底发生了什么?-Path指定"c:\ test",-Include尝试匹配此路径.由于"*.txt"与"test"不匹配,因此没有返回任何内容.但看看这个:

gci -Path "c:\test" -Include "*t"
Run Code Online (Sandbox Code Playgroud)

它返回a.txt,b.txt和c.txt作为"*t"匹配的"test"并匹配所有子项.

毕竟,即使知道Include如何工作,我也不明白何时使用它.为什么我需要它来查看子文件夹内?为什么要这么复杂?

powershell include get-childitem

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

扩展String类与IsNullOrEmpty混淆?

每个人都知道并喜欢String.IsNullOrEmpty(yourString)方法.

我想知道如果我们将String类扩展为具有这样的方法,是否会混淆开发人员或使代码更好:

yourString.IsNullOrEmpty();
Run Code Online (Sandbox Code Playgroud)

优点:

  1. 更具可读性.
  2. 减少打字.

缺点:

  1. 可能会让人感到困惑,因为yourString 变量可能null就像你在null变量上执行方法一样 .

你怎么看?

关于myObject.IsNull()方法我们可以问同样的问题.

我会怎么写它:

public static class StringExt
{
  public static bool IsNullOrEmpty(this string text)
  {
    return string.IsNullOrEmpty(text);
  }

  public static bool IsNull(this object obj)
  {
    return obj == null;
  }
}
Run Code Online (Sandbox Code Playgroud)

c# string extension-methods

11
推荐指数
4
解决办法
3402
查看次数

mysql警告

我有下表:

 CREATE TABLE `events` (
  `evt_id` int(11) NOT NULL AUTO_INCREMENT,
  `evt_name` varchar(50) NOT NULL,
  `evt_description` varchar(100) DEFAULT NULL,
  `evt_startdate` date NOT NULL,
  `evt_enddate` date DEFAULT NULL,
  `evt_starttime` time DEFAULT NULL,
  `evt_endtime` time DEFAULT NULL,
  `evt_amtpersons` int(11) DEFAULT NULL,
  `sts_id` int(11) NOT NULL,
  `adr_id` int(11) DEFAULT NULL,
  `evt_amtPersonsSubs` int(11) DEFAULT NULL,
  `evt_photo` varchar(50) DEFAULT NULL,
  `sys-mut-dt` timestamp NULL DEFAULT NULL,
  `sys-mut-user` varchar(20) DEFAULT NULL,
  `sys-mut-id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`evt_id`),
  KEY `sts_id` (`sts_id`),
  KEY `adr_id` (`adr_id`),
  CONSTRAINT `sts_id` …
Run Code Online (Sandbox Code Playgroud)

mysql sql

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

SQL server写一次列

有没有办法配置SQL Server实例不允许更新数据库中插入的值?

例如,一旦插入,该值是固定的,该同一行中的其他列可以被更改,但该值仅被写入一次.

t-sql sql-server

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

提交表单验证功能在IE中不起作用

我正在为一个html表单开发一个简单的javascript验证函数,但是使用IE7遇到了它的问题.我没有收到任何错误消息,表单只是提交而不验证.Firefox和Opera工作正常,所以我真的不确定我在这里做错了什么.我用谷歌搜索,但没有发现任何有用的,或者可能没有谷歌搜索正确的关键字.

*另外,如果有人可以推荐一个好的工具用于在IE中调试javascript.

任何帮助将不胜感激.

<html>
<head>
  <title>Hello!</title>
<style type="text/css">    
  .error {
  font-family: Tahoma;
font-size: 8pt;
  color: red;
  margin-left: 50px;
  display:none;
  }    
</style>
<script type="text/javascript">    
  function checkForm() {
  age = document.getElementById("age").value;
  name = document.getElementById("name").value;
  comment = document.getElementById("comment").value;
  parent = document.getElementById("parent").value;
  phone = document.getElementById("phone").value;
  sig = document.getElementById("sig").value;
  player = document.getElementById("player").value;
  iagree = document.getElementById("iagree").value;

  if (age == "") {
  hideAllErrors();
document.getElementById("ageError").style.display = "inline";
document.getElementById("age").select();
document.getElementById("age").focus();
  return (false);
  } else if (name == "") {
  hideAllErrors();
document.getElementById("nameError").style.display = "inline";
document.getElementById("name").select();
document.getElementById("name").focus();
  return (false);
  } else …
Run Code Online (Sandbox Code Playgroud)

html javascript javascript-events

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

c:\ program的诀窍是什么?

我发现,获取任何exe文件,将其重命名为program(不带扩展名)并将其放在C:\ root文件夹中可能会在Windows中引起奇怪的事情,比如在其他程序启动时显示此应用程序.
它是什么?它是某种后门吗?

ps如果你这样做后重新启动Windows - 你会得到一个警告.

谢谢,阿迪巴尔达

windows

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