问题列表 - 第45338页

自定义Sitecore富文本编辑器的默认配置

使用Sitecore 6.4,我想自定义富文本编辑器提供的可用按钮(例如粗体,拼写检查).

为了澄清,我指的是当您从特定Field的菜单中选择"Show Editor"时显示的弹出编辑器.我不想基于每个项目自定义编辑器,而是全局.

起初我曾想过修改标准的telerik配置文件(\ sitecore\shell\Controls\Rich Text Editor\ToolsFile.xml)会起作用,但它似乎不会影响更改.

另一篇文章提到打开内容编辑器并修改Html编辑器配置文件节点,但在版本6.4中不存在.

任何帮助非常感谢.

sitecore telerik sitecore6

5
推荐指数
2
解决办法
4419
查看次数

在rails中创建自定义方法

我正试图找出一个好方法来解决这个问题.

假设我有一个包含帖子,标题和不同状态ID的表格.

在我的控制器索引中,我有:

@posts = Post.all
Run Code Online (Sandbox Code Playgroud)

然后在我的模型中我有:

def check_status(posts)
  posts.each do |post|
    # logic here
  end
end
Run Code Online (Sandbox Code Playgroud)

所以在我的控制器中我有:

   @posts.check_status(@posts)
Run Code Online (Sandbox Code Playgroud)

但加载索引时我收到以下错误:

undefined method check_status for <ActiveRecord::Relation:>
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

ruby ruby-on-rails ruby-on-rails-3

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

django日期格式'dd-mm-yyyy'

有什么方法可以让django将我的数据存储在postgresql中作为'dd-mm-yyyy'(如果需要)并让django表单验证'dd-mm-yyyy'?

(我尝试过没有太多成功的事情:

DATE_INPUT_FORMATS = ('%d-%m-%Y')
USE_I18N = True
USE_L10N = True
Run Code Online (Sandbox Code Playgroud)

并做了很多谷歌搜索但没有成功:(

django django-forms

20
推荐指数
3
解决办法
6万
查看次数

Windows 7中的svcutil.exe在哪里?

对于我的WCF,我需要为我的客户端应用程序生成配置文件,以指定诸如服务绑定,服务地址和合同之类的内容.

wcf

102
推荐指数
3
解决办法
16万
查看次数

泛型和java.beans.Introspector

给定以下代码框架,是否可以确定该属性foo实际上是类型String

public class TestIntrospection {
    public static class SuperBean<T> {
        private T foo;

        public T getFoo() { return foo; }
        public void setFoo(T foo) { this.foo = foo; }
    }

    public static class SubBean extends SuperBean<String> {
    }

    public static void main(String[] args) throws IntrospectionException {
        BeanInfo beanInfo = Introspector.getBeanInfo(SubBean.class);
        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
        for (PropertyDescriptor prop : propertyDescriptors) {
            if ("foo".equals(prop.getName())) {
                System.out.printf("%s of %s\n", prop.getName(), prop.getPropertyType());

                Method readMethod = prop.getReadMethod();
                Type returnType = prop.getReadMethod().getGenericReturnType(); …
Run Code Online (Sandbox Code Playgroud)

java generics introspection javabeans

8
推荐指数
1
解决办法
6373
查看次数

AutoCompleteBox和SearchText清除

这不是一个问题,但我对问题的答案我无法在互联网上找到解决方案.

我在MVVM Silverlight应用程序中清除SearchText时遇到问题.我可以清除SelectedItem和Text,但是SearchText被遗忘了.它是只读的,不能通过绑定更改.

示例:带有国家/地区列表的AutoCompleteBox.当用户想要进入澳大利亚时,他们进入'au'此时该列表与奥地利和澳大利亚一起出现.然后用户可以选择澳大利亚并继续前进.在编辑结束时,他们点击"保存"按钮.此时,您可能希望清除数据以输入新数据.

即使您绑定了SelectedItem和Text属性,并将它们分别设置为'null'和string.Empty,SearchText属性仍然存在,AutoCompleteBox将不会清除,但将包含'au'.

silverlight-4.0 autocompletebox

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

如何测试x是否是通用集的成员?

我有一个列表L,x in L如果x是L的成员,则计算结果为True.我可以使用什么代替L来依次x in smth对x的值求值为True?

所以,我需要一些东西,包含所有对象,包括它自己,因为x也可以是这个"smth".

python math

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

如何防止System.Timers.Timer在线程池上排队执行?

标准System.Timers.Timer行为存在问题.计时器以一定间隔提升Elapsed事件.但是当Elapsed事件处理程序内的执行时间超过计时器间隔时,线程池开始排队事件处理.这是我的问题.这是因为使用我的Elapsed事件处理程序,我从数据库中获取一些数据并使用它做一些事情,最后将结果保存回数据库.但是数据处理应该只提供一次.那么,有没有办法防止排队System.Timers.Timer的elapse事件.

作为此问题的插图,您可以考虑下一个测试程序:

public class EntryPoint
{

    private static void TimeProc(object state, ElapsedEventArgs e)
    {
        Console.WriteLine("Current time {0} on the thread {1}", DateTime.Now, Thread.CurrentThread.ManagedThreadId);
        Thread.Sleep(20000);
    }

    static void Main(string[] args)
    {
        Console.WriteLine("Press <Enter> for finishing\n\n");
        ThreadPool.SetMaxThreads(10, 10);
        System.Timers.Timer MyTimer = new System.Timers.Timer(1000);
        MyTimer.Elapsed += new ElapsedEventHandler(TimeProc);
        MyTimer.Start();
        Console.ReadLine();
        MyTimer.Stop();
    }
}
Run Code Online (Sandbox Code Playgroud)

可能的输出将如下:

Current time 03.02.2011 0:00:09 on the thread 4
Current time 03.02.2011 0:00:10 on the thread 5
Current time 03.02.2011 0:00:12 on the thread 6
Current time 03.02.2011 0:00:13 on …
Run Code Online (Sandbox Code Playgroud)

.net c# vb.net multithreading timer

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

选择onchange not be written

Rails 2.3.5,Ruby 1.86

我无法弄清楚这一点.下面的选择中的'onchange'没有被写入(没有在HTML中写的onchange).我没有看到对语法的引用不同,除了在一些较旧的示例中onchange被括在括号中:

<%= f.select :directory_id, options_for_select(@directories, @directory_to_select), :onchange => 'folder_lookup()' %>
Run Code Online (Sandbox Code Playgroud)

结果是:

<select id="contact_directory_id" name="contact[directory_id]">
<option value="2">test_1</option>
<option value="4">test_2</option>
<option value="33" selected="selected">test_3</option>
</select>
Run Code Online (Sandbox Code Playgroud)


如果我只是将"f.select"更改为"select_tag",则会正确写入onchange(不是我想要这样做):

<%= select_tag :directory_id, options_for_select(@directories, @directory_to_select), :onchange => 'folder_lookup()' %>
Run Code Online (Sandbox Code Playgroud)

结果是:

<select id="contact_directory_id" name="directory_id" onchange="folder_lookup()">
<option value="2">test_1</option>
<option value="4">test_2</option>
<option value="33" selected="selected">test_2</option>
</select>
Run Code Online (Sandbox Code Playgroud)


我是否在select和select_tag帮助器之间缺少onchange的语法差异?

谢谢!

ruby-on-rails

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

通过Open Graph检索喜欢URL /网页的Facebook用户

有没有办法检索在外部网站上点击了类似按钮的Facebook用户列表?

  • 例如,有一个域example.com已通过Facebook Insights确认属于fbUser1(使用OG元标记).
  • 某处example.com有一个与像纽扣多XFBL,每一个指向一个更具体的网址页面上的example.com,如example.com/xyz,example.com/abc等.

我想明白的是,喜欢的用户列表example.com/xyz和那些谁喜欢的example.com/abc.

我的直观方法是查看graph.facebook.com/123456789/likes(其中数字是从FB洞察中获取的域的ID),但这总是返回一个空数据集:

{
   "data": [

   ]
}
Run Code Online (Sandbox Code Playgroud)

我还尝试从https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=APPID&client_secret=APPSECRET获取OAuth访问令牌(其中APPIDAPPSECRET来自标记为拥有域的FB应用程序使用OG元标记),但没有区别.

我也对非OpenGraph(即JS SDK,FQL等)解决方案感兴趣.

编辑:使用下面的代码(根据WideBlade答案)仍然给我一个空的列表(第二个查询永远不会返回):

var objectsQuery = "select id from object_url where url in ('http://example.com/xyz', 'http://example.com/abc', 'http://example.com/123')";
var likesQuery = "select object_id from like where object_id = {0}";

FB.Data.query(objectsQuery).wait(function (objectRows) {
    console.log(objectRows);

    FB.Array.forEach(objectRows, function (objectRow) { …
Run Code Online (Sandbox Code Playgroud)

facebook facebook-fql opengraph facebook-graph-api

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