小编Jan*_*ink的帖子

在android按钮之间放置空格

<Button
    android:id="@+id/o_pharmacy"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/p2"
    android:text="@string/o_pharmacy"
    android:textSize="26sp" />

<Button
    android:id="@+id/lab"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/lab"
    android:text="@string/lab"
    android:textSize="26sp" />

<Button
    android:id="@+id/i_pharmacy"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/p1"
    android:text="@string/i_pharmacy"
    android:textSize="26sp" />
Run Code Online (Sandbox Code Playgroud)

我试过上面的代码在Liner布局中显示3个按钮.它工作但我需要在两个按钮之间放置空间.

android button android-linearlayout

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

如何在string中使用contains和equalsIgnoreCase

有没有办法检查字符串是否包含某些内容而不区分大小写?

例如:(此代码无效,只是为了让您对我的问题有基本的了解)

String text = "I love ponies";

if(text.contains().equalsIgnoreCase("love") {
    // do something
}
Run Code Online (Sandbox Code Playgroud)

编辑:--------仍然没有工作

哦,事实证明它不起作用.这就是我正在使用的.(这是游戏的诅咒过滤器)

public void onChat(PlayerChatEvent event) {
    Player player = event.getPlayer(); 
    if (event.getMessage().contains("douche".toLowerCase()) || /* More words ... */) {
        event.setCancelled(true);
        player.sendMessage(ChatColor.GOLD + "[Midnight Blue] " + ChatColor.RED + "Please Don't Swear.");
    }
}
Run Code Online (Sandbox Code Playgroud)

它适用于小写但不是大写.

java

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

部署的Sitecore许可证

我已将Sitecore项目部署到服务器,我收到错误

缺少必需的许可证:运行时描述:发生未处理的异常.....

异常详细信息:Sitecore.SecurityModel.License.LicenseException:缺少必需的许可证:运行时

我是否需要下载并安装Sitecore CMS安装程序并在服务器上输入许可证密钥?我期待它全部包含在网站的文件结构中.

PS/Exscuse这是一个非常简单的问题 - 极其紧迫的时间.非常感谢,

sitecore

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

是否可以将Web.config转换与发布配置文件链接?

目前,我可以根据构建配置轻松设置Web.config转换,例如使用connectionString=server;..for DebugconnectionString=./SQLExpress;..for Release.

但是有可能基于Web发布配置文件进行一些Web.config转换吗?即使用connectionString=server1;..的配置文件Server1,并connectionString=server2;..Server2

.net asp.net visual-studio-2010 web-config-transform msbuild-wpp

8
推荐指数
2
解决办法
1188
查看次数

路径'/'的控制器未找到或未在Sitecore中实现IController

我正在从这里学习Sitecore中的Controller渲染.

我创建了一个简单的控制器(HelloWorld)和相关视图(Index.schtml).在Sitecore Explorer的渲染部分中映射它(使用Name PageContent)并在Sitecore Explorer的内容部分中的Home Item中添加渲染项目.但是当我浏览它时,它会给出错误.

The controller for path '/' was not found or does not implement IController. 
Run Code Online (Sandbox Code Playgroud)

我读过的所有帖子都与Asp .Net MVC有关..但我有与Sitecore MVC有关的问题

Sample.html(Sitecore Explorer渲染部分中的页面内容)

@using Sitecore.Mvc

<html>
<body>
    @Html.Sitecore().Placeholder("content")

    <p>Today's date is @DateTime.Now.ToShortDateString()</p>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

只有这条线给出了问题

@Html.Sitecore().Placeholder("content")
Run Code Online (Sandbox Code Playgroud)

如果我删除此行...它工作正常,浏览器上的页面显示日期和时间

的index.html

<p>Hello from Controller -todays Date is @DateTime.Now.ToString()</p>
Run Code Online (Sandbox Code Playgroud)

调节器

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVC.Controllers
{
    public class HelloWorldController : Controller
    {
        //
        // GET: /HellowWorld/

        public ActionResult Index()
        {
            return View();
        } …
Run Code Online (Sandbox Code Playgroud)

.net c# controller sitecore sitecore-mvc

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

无法使用SIM 1.4安装Sitecore 8.0

使用SIM 1.3或1.4安装Sitecore 8.0时,我看到此错误.还可以手动将NETWORK SERVICE的权限设置为wwwroot文件夹.

如何解决这个问题.

在此输入图像描述

sitecore sitecore-instance-manager

6
推荐指数
1
解决办法
1799
查看次数

如何从媒体网址检索Sitecore媒体项目?

如何从我们的URL中检索Sitecore媒体项?

URL是动态URL,例如/~/media/14BDED00E4D64DFD8F74019AED4D74EB.ashx.

在富文本字段中添加项目时会生成此项.

sitecore sitecore-media-library

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

如何清除Sitecore中的安全角色?

我正在尝试从项目中删除特定角色.现在我分配了3个角色."Everyone","sitecore\author","sitecore\developer".如何删除"Everyone"和"sitecore\author".到目前为止,我已经尝试过这个但是它没有用.

public static void ClearSecurityRoles(this Item item)
{
    var accessrules = item.Security.GetAccessRules();
    var role = Sitecore.Security.Accounts.Role.FromName("Everyone");
    accessrules.Helper.RemoveExactMatches(role,AccessRight.Any,PropagationType.Any);
    item.SaveSecurityAccessRules(accessrules);
}

public static void SaveSecurityAccessRules(this Item item, AccessRuleCollection accessRules)
{
    item.Editing.BeginEdit();
    item.Security.SetAccessRules(accessRules);
    item.Editing.EndEdit();
}
Run Code Online (Sandbox Code Playgroud)

当我使用accessrules.clear()它删除所有角色,但我希望能够删除只有两个.我怎么做?

c# roles sitecore

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

配置Unicorn的序列化位置,以便将项目添加到Visual Studio解决方案中

我想让Sitecore的所有项目都在Visual Studio解决方案中进行序列化.

我知道它可以配置为绝对路径.但团队中的每个团队成员都有不同的VS解决方案路径.

我也计划自动化将序列化项目添加到构建服务器中的数据库的过程.如果有人能提供如何做的指导,那就太好了.詹金斯用于构建.

sitecore jenkins visual-studio-2013

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

Python Title Case,但保留预先存在的大写

我正在寻找一种非常pythonic的方式(Python 3.x)做下面的事情,但尚未提出一个.如果我有以下字符串:

string = 'this is a test string'
Run Code Online (Sandbox Code Playgroud)

我可以用它来标题:

string.title()
Run Code Online (Sandbox Code Playgroud)

结果如下:

'This Is A Test String'
Run Code Online (Sandbox Code Playgroud)

但是,如果我有以下字符串,我想转换:

string = 'Born in the USA'
Run Code Online (Sandbox Code Playgroud)

应用标题案例会导致:

string = 'Born In The Usa'
Run Code Online (Sandbox Code Playgroud)

应该导致:

'Born In The USA'
Run Code Online (Sandbox Code Playgroud)

我正在寻找一种方法来做一个标题案例,但不是调整现有的大写文本.有没有办法做到这一点?

python regex python-3.x

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