小编Ger*_*eru的帖子

IE 11中的CSS Blur

我一直试图在IE 11中获得A css模糊效果数小时并没有取得任何进展.我试着使用以下简单的html:

 <!DOCTYPE HTML>
<html>
    <head>
        <style type="text/css">
            .blur{
                -ms-filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='50');
            }
        </style>
    </head>
    <body>

        <img src='http://img3.wikia.nocookie.net/__cb20120627075127/kirby/en/images/0/01/KDCol_Kirby_K64.png' class="blur" />
    </body>

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

我也试过使用没有ms前缀的过滤器.我在电视上看到过滤代码http://jsbin.com/ulufot/31/edit甚至咨询了微软的例子http://samples.msdn.microsoft.com/workshop/samples/author/filter/blur.htm这不在Win7上的IE 11中无法正常工作.你有什么想法,我可能做错了吗?

如果你也在努力,可能会很有趣:http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_svg-filter-effects.htm

css internet-explorer blur filter internet-explorer-11

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

将 UICollectionView 与 CoreData 和 NSFetchedResultsController 结合使用

我最近开始了另一个项目,对 Swift 进行了一些探索。我想使用 NSFetchedResultsController 实现 Collection View 以从 CoreData 数据库中获取数据。我想使用https://github.com/AshFurrow/UICollectionView-NSFetchedResultsController中的示例 并在 Swift 中实现类似的东西。我不需要任何移动事件,因此我实现了以下操作:

首先,我创建了一个类来保存所做的更改:

class ChangeItem{
    var index:NSIndexPath
    var type:NSFetchedResultsChangeType

    init(index: NSIndexPath, type: NSFetchedResultsChangeType){
        self.index = index
        self.type = type
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的集合视图控制器中,我使用两个数组来临时保存更改

var sectionChanges:[ChangeItem] = []
var objectChanges:[ChangeItem] = []
Run Code Online (Sandbox Code Playgroud)

然后我等待 FetchedResultsController 在 CoreData 数据库发生更改后更改某些内容

func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?,forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
    var item:ChangeItem?
    if(type == NSFetchedResultsChangeType.Insert){
        item = ChangeItem(index: newIndexPath!, type: type)
    }else if(type == NSFetchedResultsChangeType.Delete){
        item = ChangeItem(index: …
Run Code Online (Sandbox Code Playgroud)

nsfetchedresultscontroller ios uicollectionview uicollectionviewdelegate swift

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

在C++中可以将多少个值放入数组?

我想读取一个从文件到数组的double值数组.我喜欢128 ^ 3的值.只要我保持128 ^ 2的值,我的程序工作得很好,但现在我得到一个"分段错误"错误,即使128 ^3≈2,100,000远远低于int的最大值.那么你实际可以将多少个值放入双打数组?

#include <iostream>
#include <fstream>
int LENGTH = 128;

int main(int argc, const char * argv[]) {
    // insert code here...
    const int arrLength = LENGTH*LENGTH*LENGTH;
    std::string filename = "density.dat";
    std::cout << "opening file" << std::endl;
    std::ifstream infile(filename.c_str());
    std::cout << "creating array with length " << arrLength << std::endl;
    double* densdata[arrLength];


    std::cout << "Array created"<< std::endl;
    for(int i=0; i < arrLength; ++i){
        double a;

        infile >> a;
        densdata[i] = &a;
        std::cout << "read value: " …
Run Code Online (Sandbox Code Playgroud)

c++ arrays double

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

CUDA ptxas错误"函数使用太多共享数据"

我之前从未使用过CUDA或C++,但我正试图从(http://www.maisondelasimulation.fr/projects/RAMSES-GPU/html/download.html运行中获取Ramses GPU .由于autogen中的错误.我使用./configure并使这个工作.所以生成的makefile包含以下NVCC标志 NVCCFLAGS = -gencode=arch=compute_10,code=sm_10 -gencode=arch=compute_11,code=sm_11 -gencode=arch=compute_13,code=sm_13 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20 -use_fast_math -O3 但是当我尝试使用make编译程序时,我得到多个ptxas错误:

Entry function '_Z30kernel_viscosity_forces_3d_oldPfS_S_S_iiiiiffff' uses too much shared data (0x70d0 bytes + 0x10 bytes system, 0x4000 max) Entry function '_Z26kernel_viscosity_forces_3dPfS_S_S_iiiiiffff' uses too much shared data (0x70d0 bytes + 0x10 bytes system, 0x4000 max) Entry function '_Z32kernel_viscosity_forces_3d_zslabPfS_S_S_iiiiiffff9ZslabInfo' uses too much shared data (0x70e0 bytes + 0x10 bytes system, 0x4000 max) 我正在尝试使用Kernel 2.6和CUDA 4.2在Linux上编译此代码(我尝试在我的大学中进行,并且他们不会定期升级内容.)在两个NVIDIDA C1060上.我尝试用sm_20替换sm_10,sm_11和sm_13,(我在这里看到了这个修复:Entry函数使用了太多共享数据(0x8020字节+ 0x10字节系统,最大0x4000) - CUDA错误)但这并没有解决我的问题.你有什么建议吗?如果需要,我可以上传Makefile以及其他所有内容.谢谢您的帮助!

c++ cuda ptxas

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