小编adi*_*dit的帖子

如何停止doctrine来记录查询

我有一个奇怪的问题,当我检查我的app/log/dev.log时,我几乎可以看到我的dev.log中的所有查询都是实时记录的:

[2015-01-27 06:57:22] doctrine.DEBUG: SELECT t0.username A ....
[2015-01-27 06:57:23] doctrine.DEBUG: SELECT t0.username A ...
[2015-01-27 06:57:23] doctrine.DEBUG: SELECT s0_.id ......
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会发生这种情况,因为当我在config.yml中检查monolog时,我也在生产模式下运行网站,这就是我所看到的:

monolog:
    handlers:
        pictures:
            type: stream
            path: %kernel.logs_dir%/pictures_%kernel.environment%.log
            level: info
        instagram:
            type: stream
            path: %kernel.logs_dir%/instagram_%kernel.environment%.log
            level: info
Run Code Online (Sandbox Code Playgroud)

这是我的config_dev.yml的样子:

imports:
    - { resource: config.yml }

framework:
    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
    profiler: { only_exceptions: false }

web_profiler:
    toolbar: true
    intercept_redirects: false

monolog:
    handlers:
        main:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug
        firephp:
            type:  firephp
            level: info

assetic:
    use_controller: false

hip_mandrill:
    disable_delivery: …
Run Code Online (Sandbox Code Playgroud)

php symfony doctrine-orm

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

将文件写入java问题

我有一个使用BufferedReader写入文件的java程序,但是,在文件的末尾它总是因为它没有完成而结束.如下所示:

41,21,true,30,2010-08-07,Answer
2239,1163,true,10,2010-10-06,Answer
641,364,true,10,2010-09-02,Answer
715,149,true,5,2010-08-11,Comment
219,177,true,25,2010-07-23,Answer
4809,4591,true,10,2011-02-11,Answer
4086,4853,true,10,2011-02-17,Answer
3720,2611,true,10,2010-12-08,Answer
5101,60,true,5,2011-03-07,Comment
1393,689,true,20,2010-08-24,Answer
1274,450,true,5,2010-08-09,Comment
446,4853,true,5,2011-03-07,Comment
2191,70,true,5,2011-02-05,Comment
1487,1281,true,10,2010-08-05,Answer
3479,3899,true,10,2010-12-25,Answer
1393,685,true,10,2010-07-26,Answer
364,649,true,5,2010-07-19,Comment
1274,1236,true,10,2010-08-19,Answer
99,18
Run Code Online (Sandbox Code Playgroud)

怎么会发生这种情况?我的大多数程序都在循环中执行它.这是它的一部分:

try {
                output.write("nodedef>name VARCHAR,label VARCHAR,age INT,reputation INT,location VARCHAR(100),upvote INT,downvote INT,creationDate VARCHAR\n");
                Iterator<Integer> itr = set.iterator();

                while(itr.hasNext()){
                  Users temp = users.get(Integer.parseInt(itr.next().toString()));
                  if (temp != null)
                      output.write(temp.id + ", " + temp.displayName + "," + temp.age + "," + temp.reputation + "," + temp.location + "," + temp.upVotes + "," + temp.downVotes + "," + temp.date + "\n" );
                }

                output.write("edgedef>node1 …
Run Code Online (Sandbox Code Playgroud)

java

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

无法创建持久性存储协调器

我收到以下错误:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyExprojectception', reason: 'Managed object store failed to create persistent store coordinator: Error Domain=NSCocoaErrorDomain Code=134130 "The operation couldn’t be completed. (Cocoa error 134130.)" UserInfo=0x6eb53f0 {URL=/Users/user/Library/Application Support/iPhone Simulator/4.3.2/Applications/4EFD7570-AD87-48E8-8606-1D5633F65AD9/Documents/DiscussionBoard.sqlite, metadata=<CFBasicHash 0x6e7b610 [0x1957400]>{type = immutable dict, count = 7,
entries =>
    2 : <CFString 0x6e7bc80 [0x1957400]>{contents = "NSStoreModelVersionIdentifiers"} = <CFArray 0x6e7bd60 [0x1957400]>{type = immutable, count = 1, values = (
    0 : <CFString 0x194eed0 [0x1957400]>{contents = ""}
)}
    4 : <CFString 0x6e7bcb0 [0x1957400]>{contents = "NSPersistenceFrameworkVersion"} = …
Run Code Online (Sandbox Code Playgroud)

iphone core-data objective-c ipad

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

应用程序内购买返回0个产品和invalidProductIdentifier

我只是检查和我的:

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
Run Code Online (Sandbox Code Playgroud)

返回了SKProducstResponse,产品数组大小为0.这是为什么?如果找不到产品,它应该返回0对吗?我检查了产品ID,它与我在itunes connect中的ID相匹配.检查了捆绑包标识符,它也匹配..是的,我在设备上测试了它

更新:

我查了一下

response.invalidProductIdentifier
Run Code Online (Sandbox Code Playgroud)

它返回了我试图获取的productID.我浏览了这个清单:

• your app is InApp Purchases enabled? **yes**
• do you have an InApp Purchase test account? **yes**
• the product we offer is marked as "Cleared for Sale"? **yes**
• Did you upload the application to iTunes Connect? **no** (don't think it's necessary since 2011, correct me if I am wrong)
• do you generate and install a provisioning profile for the new "App ID"? **yes** …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ipad

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

如何创建带图像的单选按钮

我想要一个带图像而不是文本的单选按钮.所以我希望有一个男性和女性的形象,而不是男性和女性的文字.这可以使用标准HTML实现,还是必须使用jQuery?我该怎么做呢?

html

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

使用innerHTML改变p元素的内容

我有以下脚本:

var before = document.getElementById('before');    
if (switchElement.value == 'single'){
    for (var i=0; i < before.length; i++) {
        if (before[i].id == "before_label") {
            before[i].innerHTML = 'Image';
            break;
        }
    }
    after.style.display = 'none';   
} 
Run Code Online (Sandbox Code Playgroud)

HTML看起来像:

<div id="before">
    <p id="before_label"> Before Image: </p>
    <input type="file" name="before"  size="40">
    <input type="hidden" name="MAX_FILE_SIZE" value="10000000">
</div>
Run Code Online (Sandbox Code Playgroud)

想知道为什么它不起作用并改变内部html改变?

javascript

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

主要电话号码有三个文本字段

我想创建以下内容:

在此输入图像描述

我做了如下:

<span>* Primary Phone:</span>
        <input name="prim1" type="text" id="prim1" class="required">
        <input name="prim2" type="text" id="prim2" class="required">
        <input name="prim3" type="text" id="prim3" class="required">
Run Code Online (Sandbox Code Playgroud)

但我得到:

在此输入图像描述

我想通过指定宽度来使文本更小,但它不会这样做.我还需要一种方法来使用jQuery对此进行验证,如果它是一个单独的文本字段,我该怎么办呢?

html css

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

在iOS 5中查看字典/定义单词的控制器

几周前我看到iOS 5中有一个字典的视图控制器,我们可以传递一个字,它将提供它的定义.我似乎无法再在apple doc中找到文档,有谁知道这个名字是什么?

iphone objective-c ipad ios ios5

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

动画和调整UIImageView的大小

如何动画和调整UIImageView的大小?我试过这样做,但对我来说没有用:

[UIView beginAnimations:nil context:NULL];
            [UIView setAnimationDuration:1.0];
            imgView.frame = CGRectMake(0, 0, 320, 480);
            [UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)

iphone uiimageview ipad ios

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

检测UIScrollView上的用户触摸

我基本上想要检测用户何时滚动并从屏幕上移开他的手指.最简单的是什么?我在考虑使用:

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
{
    NSLog(@"TOUCH ENDED");
}
Run Code Online (Sandbox Code Playgroud)

但我把它放在我的UIViewController中,但它没有被调用

iphone objective-c ipad ios

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

标签 统计

ipad ×5

iphone ×5

objective-c ×4

ios ×3

html ×2

core-data ×1

css ×1

doctrine-orm ×1

ios5 ×1

java ×1

javascript ×1

php ×1

symfony ×1

uiimageview ×1