问题列表 - 第31931页

如何在FullCalendar中编辑事件的宽度?

这看起来非常简单,但我已经花了半天的时间抨击墙壁试图弄清楚为什么我的全日历事件只显示在77px,当时单元格的宽度(月视图)似乎是90px或更高.我已经尝试修改fc-event css规则,但似乎javascript正在将一些内联样式写入日历,覆盖这些样式.

我似乎无法找出这些风格的写法!

任何定制过fullcalendar的人都可以提供一些见解吗?它作为一个wordpress博客上的页面运行,不知道这是否与它有任何关系,因为我注意到其中一个按钮在一个尴尬的位置被砍掉了.

fullcalendar

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

检查另一个字符串中是否存在多个字符串

如何检查数组中的任何字符串是否存在于另一个字符串中?

喜欢:

a = ['a', 'b', 'c']
str = "a123"
if a in str:
  print "some of the strings found in str"
else:
  print "no strings found in str"
Run Code Online (Sandbox Code Playgroud)

该代码不起作用,只是为了展示我想要实现的目标.

python arrays string exists

338
推荐指数
6
解决办法
28万
查看次数

如何在ASP.NET MVC CustomValidation中指定错误成员密钥?

我正在尝试添加CustomValidation并使其返回错误

Html.ValidationMessageFor(m => m.SubleaseCompany)

[CustomValidation(typeof(CreateSpaceModelValidation), "ValidateCreateSpaceModel")]
public class CreateSpaceModel
{
    public Building Building { get; set; }
    public Space Space { get; set; }

    public string SubleaseCompany { get; set; }
}

public class CreateSpaceModelValidation
{
    public static ValidationResult ValidateCreateSpaceModel(CreateSpaceModel model)
    {
        return new ValidationResult("You should specify Sublease Contact", new[] { "SubleaseCompany" }).;
    }
}
Run Code Online (Sandbox Code Playgroud)

我正在使用ValidationResult构造函数(memberNames)的第二个参数,但这似乎不起作用.

asp.net validation asp.net-mvc

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

注意:数组转换为字符串 - 为什么?

您好我试图执行以下PHP代码,但我收到错误.我将引用传递给核心类,我想将其分配给类范围内的变量.

注意:数组到字符串转换

提前致谢..

$core = new core($config);
$core->execute();   
Run Code Online (Sandbox Code Playgroud)

class core
{
   private $config;

   public function __construct(&$config)
   {
      $this->$config = $config;
   }

   public function execute()
   {
      $this->set_path();
   }

   private function set_path()
   {
      return true;      
   }  
}
Run Code Online (Sandbox Code Playgroud)

php reference notice

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

我应该如何建模我的代码以在这种特定情况下最大化代码重用?

更新:请参阅问题的结尾,了解我如何实施解决方案.

抱歉这个措辞不好的问题,但我不确定如何最好地问它.我不确定如何设计一个可以重复使用的解决方案,其中大多数代码在每次实现时完全相同,但实现的一部分将每次都改变,但遵循类似的模式.我试图避免复制和粘贴代码.

我们有一个内部数据消息系统,用于在不同机器上跨数据库更新表.我们正在扩展我们的消息服务以向外部供应商发送数据,我想编写一个简单的解决方案,如果我们决定向多个供应商发送数据,可以重复使用.代码将被编译为EXE并定期运行以将消息发送到供应商的数据服务.

以下是代码的大致概述:

public class OutboxManager 
{
    private List<OutboxMsg> _OutboxMsgs;

    public void DistributeOutboxMessages()
    {
        try {
            RetrieveMessages();
            SendMessagesToVendor();
            MarkMessagesAsProcessed();
        }
        catch Exception ex {
            LogErrorMessageInDb(ex);
        }
    }

    private void RetrieveMessages() 
    {
      //retrieve messages from the database; poplate _OutboxMsgs.
      //This code stays the same in each implementation.
    }

    private void SendMessagesToVendor()   // <== THIS CODE CHANGES EACH IMPLEMENTATION
    {
      //vendor-specific code goes here.
      //This code is specific to each implementation.
    }

    private void MarkMessagesAsProcessed()
    {
      //If SendMessageToVendor() worked, run this …
Run Code Online (Sandbox Code Playgroud)

.net c# oop design-patterns

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

Hibernate Criteria API多个连接

我的hibernate实体如下:

@Entity
@Table(name = "EditLocks")
public class EditLock extends AuditableEntity {

    /** The document that is checked out. */
    @OneToOne
    @JoinColumn(name = "documentId", nullable = false)
    private Document document;
Run Code Online (Sandbox Code Playgroud)

文档然后看起来像这样:

public class Document extends AuditableEntity {
    /** Type of the document. */
    @ManyToOne
    @JoinColumn(name = "documentTypeId", nullable = false)
    private DocumentType documentType;
Run Code Online (Sandbox Code Playgroud)

基本上我想写的查询是:

Select * from EditLocks el, Document docs, DocumentTypes dt where el.documentId = docs.id and docs.documentTypeId = dt.id and dt.id = 'xysz';
Run Code Online (Sandbox Code Playgroud)

如何使用hibernate条件api执行此操作?

java orm hibernate criteria hibernate-criteria

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

如何修复Subversion«!»状态

Subversion手册说明:

'!'

项目丢失(例如,您在不使用svn的情况下移动或删除了它).这也表示目录不完整(结帐或更新被中断).

但就像Subversion一样,没有迹象表明如何解决这个问题.

通常,我会使用我信任的Fix_Subversion.command,但这次它是trunk,它将需要永远.

那么有更快的选择吗?

svn

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

JBoss AS 6记录模式

在JBoss 6的部署目录中,有jboss-logging.xml:

FILE附加器具有以下模式:

<pattern-formatter pattern="%d %-5p [%c] (%t:%x) %s%E%n"/>
Run Code Online (Sandbox Code Playgroud)

这输出如下:

2010-08-02 17:41:43,845 INFO  [STDOUT] (http-127.0.0.1-8080-1:)   2010-08-02 17:41:43,844  INFO [http-127.0.0.1-8080-1] (XyzPageController.java:<init>:58) - New abc instantiated and empty xyz constructed.
Run Code Online (Sandbox Code Playgroud)

我想知道%s%E代币代表什么...这是JBoss 6特有的东西吗?

logging jboss log4j

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

Nodejs和websockets

我正在尝试将数据从我的浏览器(Chrome)推送到nodejs服务器,我遇到了可怕的麻烦.

基本上,我有这个代码出现在浏览器中:

<script src="./Socket.IO/socket.io.js"></script>
<script>
        io.setPath('./Socket.IO/');

        var socket=new io.Socket('xxx.xxx.xxx.xxx');

        socket.on('connect',function(){
                alert('connect');       
        });
        socket.on('message',function(msg){
                alert('message'+msg);
        });
        socket.on('close',function(){
                alert('close');
        });
        socket.on('disconnect',function(){
                alert('disconnect');
        });
        socket.connect();

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

出现的唯一警报是"关闭"警报.

这是我的服务器代码:

var http=require('http');
var io=require('./Socket.IO-node');

var server=http.createServer(function(req, res){
    // your normal server code
    res.writeHeader(200, {'Content-Type': 'text/html'});
    res.writeBody('<h1>Hello world</h1>');
    res.finish();
});

var socket=io.listen(server,{transports:websocket,port:8080});

socket.on('connection',function(client){
        console.log('connection');
});
Run Code Online (Sandbox Code Playgroud)

您可以看到我正在尝试将连接记录到控制台,但没有任何显示.我一直在谷歌搜索并尝试通过http://github.com/LearnBoost/Socket.IO-node上的Socket.IO示例,似乎没有什么对我有用......

任何指针都非常感谢.

编辑:嗨,

我现在有以下服务器代码:

var http=require('http');
var io=require('./Socket.IO-node');

var server=http.createServer(function(req, res){
        //your normal server code
        res.writeHead(200, {'Content-Type': 'text/html'});
        res.write('Hello world');
        res.end();
});

server.listen(8124);
server=io.listen(server);
server.on('connection', function(client){
        console.log('EOH connected');
        sys.log('EOH …
Run Code Online (Sandbox Code Playgroud)

websocket node.js

10
推荐指数
1
解决办法
3403
查看次数

Zend_Auth:允许用户登录到多个表/标识

Zend_Auth用于在门户网站中进行身份验证.

一个正常的mySQL"users"表与a loginpassword列被查询,并且用户登录.

但是,我还有两组我想要进行身份验证的用户.所有这三个用户组都在其他表中拥有登录数据.他们的数据来自外部来源,因此不希望将这些登录帐户合并为一个.

因此,用户可能是来自三个组中的任何一个的经过身份验证的用户,甚至是所有三个组,同时也是这三个组中的任何一个.

三个登录组中的每一个都有自己的登录表单和注销按钮.

目前,我有一个单一,直接的Zend_Auth登录,取自一些教程并稍加修改,看起来大致如下:

function login($user, $password)
{

$auth = Zend_Auth::getInstance();
$storage = new Zend_Auth_Storage_Session();

$auth->setStorage($storage);

$adapter = new Zend_Auth_Adapter_DbTable(....);

$adapter->setIdentity($username)->setCredential($password); 

$result = $auth->authenticate($adapter);

if ($result->isValid())
 ......... success!
else 
 .... fail!
Run Code Online (Sandbox Code Playgroud)

我将在哪里开始提供此服务并解决三个组的单独"登录"状态?我的想法是,我想分享会话,并分别管理身份验证.

这可能吗?也许有一个简单的前缀使这很容易?这个问题上是否存在任何教程或资源?

我是Zend Framework的新手.

php zend-framework zend-auth

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